@digital-realty/ix-widget 2.2.10 → 2.2.12
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 +9 -0
- package/dist/ix-table-data.js +120 -33
- package/dist/ix-table-data.js.map +1 -1
- package/package.json +4 -4
package/dist/ix-table-data.d.ts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import '@digital-realty/ix-icon/ix-icon.js';
|
|
3
|
+
import '@digital-realty/ix-grid/ix-grid-nav.js';
|
|
3
4
|
import '@digital-realty/ix-grid/ix-grid.js';
|
|
4
5
|
import './ix-widget.js';
|
|
5
6
|
export declare class IxTableData extends LitElement {
|
|
6
7
|
static styles: import("lit").CSSResult;
|
|
7
8
|
columns: string[];
|
|
9
|
+
isLoading: boolean;
|
|
8
10
|
rows: string[] | undefined;
|
|
9
11
|
disabled: boolean;
|
|
10
12
|
showViewAllButtonOnEmpty: boolean;
|
|
13
|
+
showHeaderViewAll: boolean;
|
|
14
|
+
showFooterViewAll: boolean;
|
|
15
|
+
viewAllText: string;
|
|
11
16
|
pageSize: number;
|
|
17
|
+
showViewAll: boolean;
|
|
18
|
+
rowLimit: number;
|
|
19
|
+
totalCount: number;
|
|
12
20
|
header: string;
|
|
13
21
|
emptyDescription: string;
|
|
14
22
|
href: string;
|
|
23
|
+
firstUpdated(): void;
|
|
15
24
|
renderEmptyTable(): import("lit-html").TemplateResult<1>;
|
|
16
25
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
17
26
|
}
|
package/dist/ix-table-data.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, LitElement, css, nothing } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
4
|
import '@digital-realty/ix-icon/ix-icon.js';
|
|
5
|
+
import '@digital-realty/ix-grid/ix-grid-nav.js';
|
|
5
6
|
import '@digital-realty/ix-grid/ix-grid.js';
|
|
6
7
|
import './ix-widget.js';
|
|
7
8
|
import { loader } from './assets/iconset.js';
|
|
@@ -9,31 +10,35 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this.columns = [];
|
|
13
|
+
this.isLoading = false;
|
|
12
14
|
this.rows = [];
|
|
13
15
|
this.disabled = false;
|
|
14
16
|
this.showViewAllButtonOnEmpty = false;
|
|
17
|
+
this.showHeaderViewAll = false;
|
|
18
|
+
this.showFooterViewAll = false;
|
|
19
|
+
this.viewAllText = '';
|
|
15
20
|
this.pageSize = 5;
|
|
21
|
+
this.showViewAll = false;
|
|
22
|
+
this.rowLimit = 0;
|
|
23
|
+
this.totalCount = 0;
|
|
16
24
|
this.header = '';
|
|
17
25
|
this.emptyDescription = '';
|
|
18
|
-
this.href = '
|
|
26
|
+
this.href = '';
|
|
27
|
+
}
|
|
28
|
+
firstUpdated() {
|
|
29
|
+
var _a;
|
|
30
|
+
this.rowLimit = ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
31
|
+
this.showViewAll = !(this.rowLimit > 0 && this.rowLimit < this.totalCount);
|
|
19
32
|
}
|
|
20
33
|
renderEmptyTable() {
|
|
21
|
-
return html `<ix-widget
|
|
22
|
-
|
|
34
|
+
return html `<ix-widget
|
|
35
|
+
class="empty"
|
|
36
|
+
type="empty-table"
|
|
37
|
+
data-testid="no-data-table"
|
|
38
|
+
>
|
|
39
|
+
<div class="header ${this.showHeaderViewAll ? 'view-all' : ''}">
|
|
23
40
|
<h2>${this.header}</h2>
|
|
24
|
-
|
|
25
|
-
? html ` <ix-button
|
|
26
|
-
type="button"
|
|
27
|
-
has-icon
|
|
28
|
-
trailing-icon
|
|
29
|
-
appearance="text"
|
|
30
|
-
href=${this.href}
|
|
31
|
-
data-testid="ix-table-empty-header-view-all"
|
|
32
|
-
>
|
|
33
|
-
<ix-icon slot="icon">chevron_right</ix-icon>
|
|
34
|
-
View all
|
|
35
|
-
</ix-button>`
|
|
36
|
-
: nothing}
|
|
41
|
+
<slot name="tabs"></slot>
|
|
37
42
|
</div>
|
|
38
43
|
<div
|
|
39
44
|
class=${`content ${this.showViewAllButtonOnEmpty ? 'view-all' : ''}`}
|
|
@@ -46,7 +51,7 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
46
51
|
>
|
|
47
52
|
<p>${this.emptyDescription}</p>
|
|
48
53
|
</div>
|
|
49
|
-
${this.showViewAllButtonOnEmpty
|
|
54
|
+
${this.showViewAllButtonOnEmpty && this.href
|
|
50
55
|
? html ` <ix-button type="button" href=${this.href}>
|
|
51
56
|
View all
|
|
52
57
|
</ix-button>`
|
|
@@ -55,7 +60,7 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
55
60
|
</ix-widget>`;
|
|
56
61
|
}
|
|
57
62
|
render() {
|
|
58
|
-
var _a
|
|
63
|
+
var _a;
|
|
59
64
|
if (this.disabled) {
|
|
60
65
|
return this.renderEmptyTable();
|
|
61
66
|
}
|
|
@@ -73,23 +78,75 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
73
78
|
.columns=${this.columns}
|
|
74
79
|
.rows=${this.rows}
|
|
75
80
|
.pageSize=${this.pageSize}
|
|
76
|
-
|
|
81
|
+
rowLimit=${this.rowLimit}
|
|
77
82
|
?hide-filters=${true}
|
|
78
83
|
add-params-to-url="false"
|
|
79
|
-
|
|
84
|
+
show-view-more
|
|
85
|
+
recordCount=${this.totalCount}
|
|
86
|
+
?isLoading=${this.isLoading}
|
|
87
|
+
simple-pagination
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
slot="header"
|
|
91
|
+
class="header ${this.showHeaderViewAll ? 'view-all' : ''}"
|
|
92
|
+
>
|
|
80
93
|
<h2>${this.header}</h2>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
<slot name="tabs"></slot>
|
|
95
|
+
${this.showHeaderViewAll && this.href
|
|
96
|
+
? html `
|
|
97
|
+
<ix-button
|
|
98
|
+
type="button"
|
|
99
|
+
has-icon
|
|
100
|
+
trailing-icon
|
|
101
|
+
appearance="text"
|
|
102
|
+
href=${this.href}
|
|
103
|
+
data-testid="ix-table-header-view-all"
|
|
104
|
+
>
|
|
105
|
+
<ix-icon slot="icon">chevron_right</ix-icon>
|
|
106
|
+
View all
|
|
107
|
+
</ix-button>
|
|
108
|
+
`
|
|
109
|
+
: nothing}
|
|
92
110
|
</div>
|
|
111
|
+
${this.showFooterViewAll
|
|
112
|
+
? html `
|
|
113
|
+
<div slot="viewMore">
|
|
114
|
+
${this.showViewAll
|
|
115
|
+
? html `
|
|
116
|
+
<ix-button
|
|
117
|
+
data-testid="grid-view-more"
|
|
118
|
+
name="view-all-button"
|
|
119
|
+
type="button"
|
|
120
|
+
appearance="text"
|
|
121
|
+
href=${this.href}
|
|
122
|
+
has-icon
|
|
123
|
+
trailing-icon
|
|
124
|
+
>
|
|
125
|
+
<ix-icon slot="icon">chevron_right</ix-icon>
|
|
126
|
+
<span>${this.viewAllText || 'View all'}</span>
|
|
127
|
+
</ix-button>
|
|
128
|
+
`
|
|
129
|
+
: html `
|
|
130
|
+
<ix-button
|
|
131
|
+
data-testid="grid-view-more"
|
|
132
|
+
name="view-more-button"
|
|
133
|
+
appearance="text"
|
|
134
|
+
@click=${() => {
|
|
135
|
+
this.showViewAll = true;
|
|
136
|
+
this.rowLimit = 0;
|
|
137
|
+
this.pageSize = 10;
|
|
138
|
+
this.dispatchEvent(new Event('show-view-more', {
|
|
139
|
+
bubbles: true,
|
|
140
|
+
composed: true,
|
|
141
|
+
}));
|
|
142
|
+
}}
|
|
143
|
+
>
|
|
144
|
+
<span>View more</span>
|
|
145
|
+
</ix-button>
|
|
146
|
+
`}
|
|
147
|
+
</div>
|
|
148
|
+
`
|
|
149
|
+
: nothing}
|
|
93
150
|
</ix-grid>
|
|
94
151
|
</ix-widget>`;
|
|
95
152
|
}
|
|
@@ -97,19 +154,26 @@ let IxTableData = class IxTableData extends LitElement {
|
|
|
97
154
|
IxTableData.styles = css `
|
|
98
155
|
ix-widget {
|
|
99
156
|
--ix-widget-padding: 0;
|
|
157
|
+
--progress-bar-top: 46px;
|
|
100
158
|
}
|
|
101
159
|
.empty-state {
|
|
102
160
|
padding: 24px;
|
|
103
161
|
}
|
|
104
162
|
.header {
|
|
105
163
|
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
gap: 32px;
|
|
106
166
|
-webkit-box-pack: justify;
|
|
107
167
|
justify-content: space-between;
|
|
108
168
|
-webkit-box-align: center;
|
|
109
|
-
align-items: center;
|
|
110
169
|
width: 100%;
|
|
111
170
|
width: -webkit-fill-available;
|
|
171
|
+
margin: 8px 6px 16px 8px;
|
|
172
|
+
}
|
|
173
|
+
.header.view-all {
|
|
174
|
+
flex-direction: row;
|
|
112
175
|
margin: 0px -15px 9px 4px;
|
|
176
|
+
align-items: center;
|
|
113
177
|
}
|
|
114
178
|
h2 {
|
|
115
179
|
margin: 0px;
|
|
@@ -184,6 +248,8 @@ IxTableData.styles = css `
|
|
|
184
248
|
}
|
|
185
249
|
ix-widget.empty {
|
|
186
250
|
--ix-widget-padding: 1rem 11px 22px 24px;
|
|
251
|
+
box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,
|
|
252
|
+
#e1e4e8 0px 0px 0px 1px inset;
|
|
187
253
|
}
|
|
188
254
|
ix-widget.empty .content {
|
|
189
255
|
display: flex;
|
|
@@ -223,6 +289,9 @@ IxTableData.styles = css `
|
|
|
223
289
|
__decorate([
|
|
224
290
|
property({ type: Array })
|
|
225
291
|
], IxTableData.prototype, "columns", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: Boolean })
|
|
294
|
+
], IxTableData.prototype, "isLoading", void 0);
|
|
226
295
|
__decorate([
|
|
227
296
|
property({ type: Array })
|
|
228
297
|
], IxTableData.prototype, "rows", void 0);
|
|
@@ -232,9 +301,27 @@ __decorate([
|
|
|
232
301
|
__decorate([
|
|
233
302
|
property({ type: Boolean })
|
|
234
303
|
], IxTableData.prototype, "showViewAllButtonOnEmpty", void 0);
|
|
304
|
+
__decorate([
|
|
305
|
+
property({ type: Boolean, attribute: 'header-view-all' })
|
|
306
|
+
], IxTableData.prototype, "showHeaderViewAll", void 0);
|
|
307
|
+
__decorate([
|
|
308
|
+
property({ type: Boolean, attribute: 'footer-view-all' })
|
|
309
|
+
], IxTableData.prototype, "showFooterViewAll", void 0);
|
|
310
|
+
__decorate([
|
|
311
|
+
property({ type: String, attribute: 'view-all-text' })
|
|
312
|
+
], IxTableData.prototype, "viewAllText", void 0);
|
|
235
313
|
__decorate([
|
|
236
314
|
property({ type: Number })
|
|
237
315
|
], IxTableData.prototype, "pageSize", void 0);
|
|
316
|
+
__decorate([
|
|
317
|
+
state()
|
|
318
|
+
], IxTableData.prototype, "showViewAll", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
state()
|
|
321
|
+
], IxTableData.prototype, "rowLimit", void 0);
|
|
322
|
+
__decorate([
|
|
323
|
+
property({ type: Number, attribute: 'total-count' })
|
|
324
|
+
], IxTableData.prototype, "totalCount", void 0);
|
|
238
325
|
__decorate([
|
|
239
326
|
property({ type: String })
|
|
240
327
|
], IxTableData.prototype, "header", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ix-table-data.js","sourceRoot":"","sources":["../src/ix-table-data.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,oCAAoC,CAA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,IAAI,CAAC,IAAI;oBACL,IAAI,CAAC,QAAQ;oBACb,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,KAAI,CAAC;wBAClB,IAAI;;;gBAGZ,IAAI,CAAC,MAAM;;;;;;mBAMR,IAAI,CAAC,IAAI;;;;;;;;iBAQX,CAAC;IAChB,CAAC;;AA1NM,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6HlB,AA7HY,CA6HX;AAEyB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAwB;AAEvB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAiC;AAE9B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAEjB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6DAAkC;AAElC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AAEb;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;yCAAY;AA9I5B,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA4NvB","sourcesContent":["import { html, LitElement, css, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon/ix-icon.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 }\n .empty-state {\n padding: 24px;\n }\n .header {\n display: flex;\n -webkit-box-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n align-items: center;\n width: 100%;\n width: -webkit-fill-available;\n margin: 0px -15px 9px 4px;\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 }\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: Array }) rows: string[] | undefined = [];\n\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: Boolean }) showViewAllButtonOnEmpty = false;\n\n @property({ type: Number }) pageSize = 5;\n\n @property({ type: String }) header = '';\n\n @property({ type: String }) emptyDescription = '';\n\n @property({ type: String }) href = '/';\n\n renderEmptyTable() {\n return html`<ix-widget class=\"empty\" type=\"empty-table\">\n <div class=\"header\">\n <h2>${this.header}</h2>\n ${this.showViewAllButtonOnEmpty\n ? html` <ix-button\n type=\"button\"\n has-icon\n trailing-icon\n appearance=\"text\"\n href=${this.href}\n data-testid=\"ix-table-empty-header-view-all\"\n >\n <ix-icon slot=\"icon\">chevron_right</ix-icon>\n View all\n </ix-button>`\n : nothing}\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\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.rows?.length || 0}\n ?hide-filters=${true}\n add-params-to-url=\"false\"\n ><div slot=\"header\" class=\"header\">\n <h2>${this.header}</h2>\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 </div>\n </ix-grid>\n </ix-widget>`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ix-table-data.js","sourceRoot":"","sources":["../src/ix-table-data.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oCAAoC,CAAC;AAC5C,OAAO,wCAAwC,CAAC;AAChD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAyIsB,YAAO,GAAa,EAAE,CAAC;QAErB,cAAS,GAAY,KAAK,CAAC;QAE7B,SAAI,GAAyB,EAAE,CAAC;QAE9B,aAAQ,GAAG,KAAK,CAAC;QAEjB,6BAAwB,GAAG,KAAK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AW;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"]}
|
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.12",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@adobe/lit-mobx": "^2.2.2",
|
|
41
41
|
"@digital-realty/ix-accordion": "^1.1.11",
|
|
42
42
|
"@digital-realty/ix-button": "^3.4.2",
|
|
43
|
-
"@digital-realty/ix-dialog": "^1.2.
|
|
44
|
-
"@digital-realty/ix-grid": "^1.3.
|
|
43
|
+
"@digital-realty/ix-dialog": "^1.2.6",
|
|
44
|
+
"@digital-realty/ix-grid": "^1.3.9",
|
|
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": "e370cda9ea15770dbf3a247c5eb12e4294e76109"
|
|
134
134
|
}
|