web: remove common_styles
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -1,12 +1,18 @@
|
||||
import { gettext } from "django";
|
||||
import { CSSResult, html, LitElement, property, TemplateResult } from "lit-element";
|
||||
import { AKResponse } from "../../api/Client";
|
||||
import { COMMON_STYLES } from "../../common/styles";
|
||||
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
import PFTable from "@patternfly/patternfly/components/Table/table.css";
|
||||
import PFBullseye from "@patternfly/patternfly/layouts/Bullseye/bullseye.css";
|
||||
import PFButton from "@patternfly/patternfly/components/Button/button.css";
|
||||
import PFToolbar from "@patternfly/patternfly/components/Toolbar/toolbar.css";
|
||||
import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css";
|
||||
import PFPagination from "@patternfly/patternfly/components/Pagination/pagination.css";
|
||||
import AKGlobal from "../../authentik.css";
|
||||
|
||||
import "./TablePagination";
|
||||
import "../EmptyState";
|
||||
import "../Spinner";
|
||||
import { SpinnerSize } from "../Spinner";
|
||||
|
||||
export class TableColumn {
|
||||
|
||||
@ -109,7 +115,7 @@ export abstract class Table<T> extends LitElement {
|
||||
expandedRows: boolean[] = [];
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return COMMON_STYLES;
|
||||
return [PFBase, PFTable, PFBullseye, PFButton, PFToolbar, PFDropdown, PFPagination, AKGlobal];
|
||||
}
|
||||
|
||||
constructor() {
|
||||
@ -138,14 +144,10 @@ export abstract class Table<T> extends LitElement {
|
||||
return html`<tr role="row">
|
||||
<td role="cell" colspan="25">
|
||||
<div class="pf-l-bullseye">
|
||||
<div class="pf-c-empty-state pf-m-sm">
|
||||
<div class="pf-c-empty-state__content">
|
||||
<div class="pf-c-empty-state__icon">
|
||||
<ak-spinner size=${SpinnerSize.XLarge}></ak-spinner>
|
||||
</div>
|
||||
<h2 class="pf-c-title pf-m-lg">${gettext("Loading")}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<ak-empty-state
|
||||
?loading="${true}"
|
||||
header=${gettext("Loading")}>
|
||||
</ak-empty-state>
|
||||
</div>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
import { gettext } from "django";
|
||||
import { CSSResult } from "lit-element";
|
||||
import { html, TemplateResult } from "lit-html";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { Table } from "./Table";
|
||||
import "./TableSearch";
|
||||
import PFPage from "@patternfly/patternfly/components/Page/page.css";
|
||||
import PFContent from "@patternfly/patternfly/components/Content/content.css";
|
||||
|
||||
export abstract class TablePage<T> extends Table<T> {
|
||||
abstract pageTitle(): string;
|
||||
@ -10,6 +13,10 @@ export abstract class TablePage<T> extends Table<T> {
|
||||
abstract pageIcon(): string;
|
||||
abstract searchEnabled(): boolean;
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return super.styles.concat(PFPage, PFContent);
|
||||
}
|
||||
|
||||
renderSearch(): TemplateResult {
|
||||
if (!this.searchEnabled()) {
|
||||
return super.renderSearch();
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
|
||||
import { COMMON_STYLES } from "../../common/styles";
|
||||
import { AKPagination } from "../../api/Client";
|
||||
import { gettext } from "django";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
import PFButton from "@patternfly/patternfly/components/Button/button.css";
|
||||
import PFPagination from "@patternfly/patternfly/components/Pagination/pagination.css";
|
||||
|
||||
|
||||
@customElement("ak-table-pagination")
|
||||
export class TablePagination extends LitElement {
|
||||
@ -13,7 +16,7 @@ export class TablePagination extends LitElement {
|
||||
pageChangeHandler: (page: number) => void = (page: number) => {}
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return COMMON_STYLES;
|
||||
return [PFBase, PFButton, PFPagination];
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { COMMON_STYLES } from "../../common/styles";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
import PFButton from "@patternfly/patternfly/components/Button/button.css";
|
||||
import PFToolbar from "@patternfly/patternfly/components/Toolbar/toolbar.css";
|
||||
import PFInputGroup from "@patternfly/patternfly/components/InputGroup/input-group.css";
|
||||
import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css";
|
||||
|
||||
|
||||
@customElement("ak-table-search")
|
||||
export class TableSearch extends LitElement {
|
||||
@ -12,7 +17,7 @@ export class TableSearch extends LitElement {
|
||||
onSearch?: (value: string) => void;
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return COMMON_STYLES;
|
||||
return [PFBase, PFButton, PFToolbar, PFInputGroup, PFFormControl];
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
|
||||
Reference in New Issue
Block a user