@digital-realty/ix-widget 2.2.12 → 2.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ix-table-data.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class IxTableData extends LitElement {
|
|
|
21
21
|
emptyDescription: string;
|
|
22
22
|
href: string;
|
|
23
23
|
firstUpdated(): void;
|
|
24
|
+
name: string;
|
|
24
25
|
renderEmptyTable(): import("lit-html").TemplateResult<1>;
|
|
25
26
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
26
27
|
}
|
package/dist/ix-table-data.js
CHANGED
|
@@ -24,6 +24,7 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
24
24
|
this.header = '';
|
|
25
25
|
this.emptyDescription = '';
|
|
26
26
|
this.href = '';
|
|
27
|
+
this.name = 'table-data';
|
|
27
28
|
}
|
|
28
29
|
firstUpdated() {
|
|
29
30
|
var _a;
|
|
@@ -81,6 +82,7 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
81
82
|
rowLimit=${this.rowLimit}
|
|
82
83
|
?hide-filters=${true}
|
|
83
84
|
add-params-to-url="false"
|
|
85
|
+
session-storage-key=${this.name}
|
|
84
86
|
show-view-more
|
|
85
87
|
recordCount=${this.totalCount}
|
|
86
88
|
?isLoading=${this.isLoading}
|
|
@@ -331,6 +333,9 @@ __decorate([
|
|
|
331
333
|
__decorate([
|
|
332
334
|
property({ type: String })
|
|
333
335
|
], IxTableData.prototype, "href", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
property({ type: String })
|
|
338
|
+
], IxTableData.prototype, "name", void 0);
|
|
334
339
|
IxTableData = __decorate([
|
|
335
340
|
customElement('ix-table-data')
|
|
336
341
|
], IxTableData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ix-table-data.js","sourceRoot":"","sources":["../src/ix-table-data.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAA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,SAAS,EAAE,eAAe,EAAE,CAAC;gDAAkB;AAE7C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AAEhC;IAAR,KAAK,EAAE;gDAAqB;AAEpB;IAAR,KAAK,EAAE;6CAAsB;AAEwB;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAgB;AAEzC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAa;AAEZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAuB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAW;AAvK3B,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAwSvB","sourcesContent":["import { html, LitElement, css, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport '@digital-realty/ix-grid/ix-grid-nav.js';\nimport '@digital-realty/ix-grid/ix-grid.js';\nimport './ix-widget.js';\nimport { loader } from './assets/iconset.js';\n\n@customElement('ix-table-data')\nexport class IxTableData extends LitElement {\n static styles = css`\n ix-widget {\n --ix-widget-padding: 0;\n --progress-bar-top: 46px;\n }\n .empty-state {\n padding: 24px;\n }\n .header {\n display: flex;\n flex-direction: column;\n gap: 32px;\n -webkit-box-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n width: 100%;\n width: -webkit-fill-available;\n margin: 8px 6px 16px 8px;\n }\n .header.view-all {\n flex-direction: row;\n margin: 0px -15px 9px 4px;\n align-items: center;\n }\n h2 {\n margin: 0px;\n font-family: var(--text-heading-font, sans-serif);\n font-size: var(--text-heading-size, 1.25rem);\n letter-spacing: var(--text-heading-letter-spacing, 0.0075em);\n line-height: var(--text-heading-line-height, 1.2em);\n font-weight: var(--text-heading-weight, bold);\n text-decoration: var(--text-heading-decoration, none);\n text-transform: var(--text-heading-transform, none);\n }\n h3 {\n margin: 0px;\n font-family: var(--text-heading-font, sans-serif);\n font-size: 1rem;\n letter-spacing: var(--text-heading-letter-spacing, 0.0075em);\n line-height: var(--text-heading-line-height, 1.2em);\n font-weight: var(--text-heading-weight, bold);\n text-decoration: var(--text-heading-decoration, none);\n text-transform: var(--text-heading-transform, none);\n text-align: center;\n padding: 1rem;\n }\n .status {\n display: flex;\n flex-direction: row;\n -webkit-box-align: center;\n align-items: center;\n padding: 2px 12px;\n width: 185px;\n height: 28px;\n left: 0px;\n top: 0px;\n border-radius: 68px;\n flex: 0 0 auto;\n order: 0;\n -webkit-box-flex: 0;\n color: white;\n -webkit-box-pack: center;\n justify-content: center;\n background: rgb(76, 175, 80);\n }\n ix-grid {\n --_cell-padding: 0;\n }\n .loader {\n width: 24px;\n height: 24px;\n margin: 1rem auto;\n }\n svg {\n stroke: var(--clr-primary, #1456e0);\n width: 48px;\n height: 48px;\n animation-name: loading;\n animation-duration: 1000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n margin: auto;\n }\n @keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n ix-widget.empty .header {\n margin: 0;\n }\n ix-widget.empty {\n --ix-widget-padding: 1rem 11px 22px 24px;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,\n #e1e4e8 0px 0px 0px 1px inset;\n }\n ix-widget.empty .content {\n display: flex;\n flex-direction: column;\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: start;\n justify-content: start;\n margin: 22px 0 16px;\n }\n ix-widget.empty .content.view-all {\n margin-bottom: 8px;\n }\n ix-widget.empty ix-icon.info {\n user-select: none;\n width: 48px;\n height: 44px;\n --ix-icon-font-size: 48px;\n --ix-icon-line-height: 1;\n color: var(--ix-sys-primary, #1456e0);\n }\n ix-widget.empty .description p {\n font-family: var(--text-heading-font, sans-serif);\n font-size: var(--text-heading-size, 1.25rem);\n letter-spacing: var(--text-heading-letter-spacing, 0.0075em);\n line-height: var(--text-heading-line-height, 1.2em);\n font-weight: var(--text-heading-weight, bold);\n text-decoration: var(--text-heading-decoration, none);\n text-transform: var(--text-heading-transform, none);\n text-align: center;\n margin-bottom: 24px;\n }\n ix-widget.empty .description p a {\n color: var(--clr-primary, #1456e0);\n }\n `;\n\n @property({ type: Array }) columns: string[] = [];\n\n @property({ type: Boolean }) isLoading: boolean = false;\n\n @property({ type: Array }) rows: string[] | undefined = [];\n\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: Boolean }) showViewAllButtonOnEmpty = false;\n\n @property({ type: Boolean, attribute: 'header-view-all' }) showHeaderViewAll =\n false;\n\n @property({ type: Boolean, attribute: 'footer-view-all' }) showFooterViewAll =\n false;\n\n @property({ type: String, attribute: 'view-all-text' }) viewAllText = '';\n\n @property({ type: Number }) pageSize = 5;\n\n @state() showViewAll = false;\n\n @state() rowLimit: number = 0;\n\n @property({ type: Number, attribute: 'total-count' }) totalCount = 0;\n\n @property({ type: String }) header = '';\n\n @property({ type: String }) emptyDescription = '';\n\n @property({ type: String }) href = '';\n\n firstUpdated() {\n this.rowLimit = this.rows?.length || 0;\n this.showViewAll = !(this.rowLimit > 0 && this.rowLimit < this.totalCount);\n }\n\n renderEmptyTable() {\n return html`<ix-widget\n class=\"empty\"\n type=\"empty-table\"\n data-testid=\"no-data-table\"\n >\n <div class=\"header ${this.showHeaderViewAll ? 'view-all' : ''}\">\n <h2>${this.header}</h2>\n <slot name=\"tabs\"></slot>\n </div>\n <div\n class=${`content ${this.showViewAllButtonOnEmpty ? 'view-all' : ''}`}\n >\n <ix-icon class=\"info\" filled>info</ix-icon>\n <div\n class=\"description\"\n data-testid=\"ix-table-empty-desc\"\n role=\"status\"\n >\n <p>${this.emptyDescription}</p>\n </div>\n ${this.showViewAllButtonOnEmpty && this.href\n ? html` <ix-button type=\"button\" href=${this.href}>\n View all\n </ix-button>`\n : nothing}\n </div>\n </ix-widget>`;\n }\n\n protected override render() {\n if (this.disabled) {\n return this.renderEmptyTable();\n }\n if (!this.rows?.length) {\n return html`<ix-widget type=\"news-feed\">\n <div class=\"empty-state\">\n <h2>${this.header}</h2>\n <div class=\"loader\">${loader}</div>\n </div>\n </ix-widget>`;\n }\n return html`<ix-widget>\n <ix-grid\n variantClass=\"launchpad\"\n .columns=${this.columns}\n .rows=${this.rows}\n .pageSize=${this.pageSize}\n rowLimit=${this.rowLimit}\n ?hide-filters=${true}\n add-params-to-url=\"false\"\n show-view-more\n recordCount=${this.totalCount}\n ?isLoading=${this.isLoading}\n simple-pagination\n >\n <div\n slot=\"header\"\n class=\"header ${this.showHeaderViewAll ? 'view-all' : ''}\"\n >\n <h2>${this.header}</h2>\n <slot name=\"tabs\"></slot>\n ${this.showHeaderViewAll && this.href\n ? html`\n <ix-button\n type=\"button\"\n has-icon\n trailing-icon\n appearance=\"text\"\n href=${this.href}\n data-testid=\"ix-table-header-view-all\"\n >\n <ix-icon slot=\"icon\">chevron_right</ix-icon>\n View all\n </ix-button>\n `\n : nothing}\n </div>\n ${this.showFooterViewAll\n ? html`\n <div slot=\"viewMore\">\n ${this.showViewAll\n ? html`\n <ix-button\n data-testid=\"grid-view-more\"\n name=\"view-all-button\"\n type=\"button\"\n appearance=\"text\"\n href=${this.href}\n has-icon\n trailing-icon\n >\n <ix-icon slot=\"icon\">chevron_right</ix-icon>\n <span>${this.viewAllText || 'View all'}</span>\n </ix-button>\n `\n : html`\n <ix-button\n data-testid=\"grid-view-more\"\n name=\"view-more-button\"\n appearance=\"text\"\n @click=${() => {\n this.showViewAll = true;\n this.rowLimit = 0;\n this.pageSize = 10;\n this.dispatchEvent(\n new Event('show-view-more', {\n bubbles: true,\n composed: true,\n })\n );\n }}\n >\n <span>View more</span>\n </ix-button>\n `}\n </div>\n `\n : nothing}\n </ix-grid>\n </ix-widget>`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ix-table-data.js","sourceRoot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C,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;sDAClD;AAEgD;IAAvD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;gDAAkB;AAE7C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AAEhC;IAAR,KAAK,EAAE;gDAAqB;AAEpB;IAAR,KAAK,EAAE;6CAAsB;AAEwB;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAgB;AAEzC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAa;AAEZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAuB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAW;AAOV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAqB;AA9KrC,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA2SvB","sourcesContent":["import { html, LitElement, css, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport '@digital-realty/ix-grid/ix-grid-nav.js';\nimport '@digital-realty/ix-grid/ix-grid.js';\nimport './ix-widget.js';\nimport { loader } from './assets/iconset.js';\n\n@customElement('ix-table-data')\nexport class IxTableData extends LitElement {\n static styles = css`\n ix-widget {\n --ix-widget-padding: 0;\n --progress-bar-top: 46px;\n }\n .empty-state {\n padding: 24px;\n }\n .header {\n display: flex;\n flex-direction: column;\n gap: 32px;\n -webkit-box-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n width: 100%;\n width: -webkit-fill-available;\n margin: 8px 6px 16px 8px;\n }\n .header.view-all {\n flex-direction: row;\n margin: 0px -15px 9px 4px;\n align-items: center;\n }\n h2 {\n margin: 0px;\n font-family: var(--text-heading-font, sans-serif);\n font-size: var(--text-heading-size, 1.25rem);\n letter-spacing: var(--text-heading-letter-spacing, 0.0075em);\n line-height: var(--text-heading-line-height, 1.2em);\n font-weight: var(--text-heading-weight, bold);\n text-decoration: var(--text-heading-decoration, none);\n text-transform: var(--text-heading-transform, none);\n }\n h3 {\n margin: 0px;\n font-family: var(--text-heading-font, sans-serif);\n font-size: 1rem;\n letter-spacing: var(--text-heading-letter-spacing, 0.0075em);\n line-height: var(--text-heading-line-height, 1.2em);\n font-weight: var(--text-heading-weight, bold);\n text-decoration: var(--text-heading-decoration, none);\n text-transform: var(--text-heading-transform, none);\n text-align: center;\n padding: 1rem;\n }\n .status {\n display: flex;\n flex-direction: row;\n -webkit-box-align: center;\n align-items: center;\n padding: 2px 12px;\n width: 185px;\n height: 28px;\n left: 0px;\n top: 0px;\n border-radius: 68px;\n flex: 0 0 auto;\n order: 0;\n -webkit-box-flex: 0;\n color: white;\n -webkit-box-pack: center;\n justify-content: center;\n background: rgb(76, 175, 80);\n }\n ix-grid {\n --_cell-padding: 0;\n }\n .loader {\n width: 24px;\n height: 24px;\n margin: 1rem auto;\n }\n svg {\n stroke: var(--clr-primary, #1456e0);\n width: 48px;\n height: 48px;\n animation-name: loading;\n animation-duration: 1000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n margin: auto;\n }\n @keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n ix-widget.empty .header {\n margin: 0;\n }\n ix-widget.empty {\n --ix-widget-padding: 1rem 11px 22px 24px;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,\n #e1e4e8 0px 0px 0px 1px inset;\n }\n ix-widget.empty .content {\n display: flex;\n flex-direction: column;\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-pack: start;\n justify-content: start;\n margin: 22px 0 16px;\n }\n ix-widget.empty .content.view-all {\n margin-bottom: 8px;\n }\n ix-widget.empty ix-icon.info {\n user-select: none;\n width: 48px;\n height: 44px;\n --ix-icon-font-size: 48px;\n --ix-icon-line-height: 1;\n color: var(--ix-sys-primary, #1456e0);\n }\n ix-widget.empty .description p {\n font-family: var(--text-heading-font, sans-serif);\n font-size: var(--text-heading-size, 1.25rem);\n letter-spacing: var(--text-heading-letter-spacing, 0.0075em);\n line-height: var(--text-heading-line-height, 1.2em);\n font-weight: var(--text-heading-weight, bold);\n text-decoration: var(--text-heading-decoration, none);\n text-transform: var(--text-heading-transform, none);\n text-align: center;\n margin-bottom: 24px;\n }\n ix-widget.empty .description p a {\n color: var(--clr-primary, #1456e0);\n }\n `;\n\n @property({ type: Array }) columns: string[] = [];\n\n @property({ type: Boolean }) isLoading: boolean = false;\n\n @property({ type: Array }) rows: string[] | undefined = [];\n\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: Boolean }) showViewAllButtonOnEmpty = false;\n\n @property({ type: Boolean, attribute: 'header-view-all' }) showHeaderViewAll =\n false;\n\n @property({ type: Boolean, attribute: 'footer-view-all' }) showFooterViewAll =\n false;\n\n @property({ type: String, attribute: 'view-all-text' }) viewAllText = '';\n\n @property({ type: Number }) pageSize = 5;\n\n @state() showViewAll = false;\n\n @state() rowLimit: number = 0;\n\n @property({ type: Number, attribute: 'total-count' }) totalCount = 0;\n\n @property({ type: String }) header = '';\n\n @property({ type: String }) emptyDescription = '';\n\n @property({ type: String }) href = '';\n\n firstUpdated() {\n this.rowLimit = this.rows?.length || 0;\n this.showViewAll = !(this.rowLimit > 0 && this.rowLimit < this.totalCount);\n }\n\n @property({ type: String }) name = 'table-data';\n\n renderEmptyTable() {\n return html`<ix-widget\n class=\"empty\"\n type=\"empty-table\"\n data-testid=\"no-data-table\"\n >\n <div class=\"header ${this.showHeaderViewAll ? 'view-all' : ''}\">\n <h2>${this.header}</h2>\n <slot name=\"tabs\"></slot>\n </div>\n <div\n class=${`content ${this.showViewAllButtonOnEmpty ? 'view-all' : ''}`}\n >\n <ix-icon class=\"info\" filled>info</ix-icon>\n <div\n class=\"description\"\n data-testid=\"ix-table-empty-desc\"\n role=\"status\"\n >\n <p>${this.emptyDescription}</p>\n </div>\n ${this.showViewAllButtonOnEmpty && this.href\n ? html` <ix-button type=\"button\" href=${this.href}>\n View all\n </ix-button>`\n : nothing}\n </div>\n </ix-widget>`;\n }\n\n protected override render() {\n if (this.disabled) {\n return this.renderEmptyTable();\n }\n if (!this.rows?.length) {\n return html`<ix-widget type=\"news-feed\">\n <div class=\"empty-state\">\n <h2>${this.header}</h2>\n <div class=\"loader\">${loader}</div>\n </div>\n </ix-widget>`;\n }\n return html`<ix-widget>\n <ix-grid\n variantClass=\"launchpad\"\n .columns=${this.columns}\n .rows=${this.rows}\n .pageSize=${this.pageSize}\n rowLimit=${this.rowLimit}\n ?hide-filters=${true}\n add-params-to-url=\"false\"\n session-storage-key=${this.name}\n show-view-more\n recordCount=${this.totalCount}\n ?isLoading=${this.isLoading}\n simple-pagination\n >\n <div\n slot=\"header\"\n class=\"header ${this.showHeaderViewAll ? 'view-all' : ''}\"\n >\n <h2>${this.header}</h2>\n <slot name=\"tabs\"></slot>\n ${this.showHeaderViewAll && this.href\n ? html`\n <ix-button\n type=\"button\"\n has-icon\n trailing-icon\n appearance=\"text\"\n href=${this.href}\n data-testid=\"ix-table-header-view-all\"\n >\n <ix-icon slot=\"icon\">chevron_right</ix-icon>\n View all\n </ix-button>\n `\n : nothing}\n </div>\n ${this.showFooterViewAll\n ? html`\n <div slot=\"viewMore\">\n ${this.showViewAll\n ? html`\n <ix-button\n data-testid=\"grid-view-more\"\n name=\"view-all-button\"\n type=\"button\"\n appearance=\"text\"\n href=${this.href}\n has-icon\n trailing-icon\n >\n <ix-icon slot=\"icon\">chevron_right</ix-icon>\n <span>${this.viewAllText || 'View all'}</span>\n </ix-button>\n `\n : html`\n <ix-button\n data-testid=\"grid-view-more\"\n name=\"view-more-button\"\n appearance=\"text\"\n @click=${() => {\n this.showViewAll = true;\n this.rowLimit = 0;\n this.pageSize = 10;\n this.dispatchEvent(\n new Event('show-view-more', {\n bubbles: true,\n composed: true,\n })\n );\n }}\n >\n <span>View more</span>\n </ix-button>\n `}\n </div>\n `\n : nothing}\n </ix-grid>\n </ix-widget>`;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-widget following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "2.2.
|
|
6
|
+
"version": "2.2.14",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/lit-mobx": "^2.2.2",
|
|
41
41
|
"@digital-realty/ix-accordion": "^1.1.11",
|
|
42
|
-
"@digital-realty/ix-button": "^3.4.
|
|
42
|
+
"@digital-realty/ix-button": "^3.4.3",
|
|
43
43
|
"@digital-realty/ix-dialog": "^1.2.6",
|
|
44
|
-
"@digital-realty/ix-grid": "^1.3.
|
|
44
|
+
"@digital-realty/ix-grid": "^1.3.11",
|
|
45
45
|
"@digital-realty/ix-icon": "^1.2.2",
|
|
46
46
|
"@digital-realty/ix-list": "^1.2.2",
|
|
47
47
|
"@lit/react": "^1.0.2",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"README.md",
|
|
131
131
|
"LICENSE"
|
|
132
132
|
],
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "c3c75d912f2c2d41e7f9ea4ff7c250c021dfb586"
|
|
134
134
|
}
|