@digital-realty/ix-widget 2.3.1-alpha.1 → 2.3.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ix-status-counter.js","sourceRoot":"","sources":["../src/ix-status-counter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG9C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAgHuB,UAAK,GAAgC,SAAS,CAAC;QAE/C,WAAM,GAAG,QAAQ,CAAC;QAElB,SAAI,GAAG,MAAM,CAAC;QAEd,WAAM,GAAG,GAAG,CAAC;QAEzC,aAAQ,GAAG,GAAG,EAAE;YACd,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,OAAO,EAAE;gBACvB,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;gBAC9B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACf,CAAC,CACH,CAAC;QACJ,CAAC,CAAC;IA4BJ,CAAC;IA1BoB,MAAM;QACvB,OAAO,IAAI,CAAA;eACA,IAAI,CAAC,QAAQ;iBACX,CAAC,CAAgB,EAAE,EAAE;YAC9B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YACrC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;;;;;YAKK,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;YAC9B,CAAC,CAAC,IAAI,CAAA;kBACA,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;gBAC9B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;gBAC7B,CAAC,CAAC,IAAI,CAAC,KAAK;oBACV;YACR,CAAC,CAAC,IAAI,CAAA,wBAAwB,MAAM,SAAS;gBACzC,IAAI,CAAC,MAAM;;mBAER,IAAI,CAAC,IAAI;;iBAEX,CAAC;IAChB,CAAC;;AA1JM,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GlB,AA7GY,CA6GX;AAE0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgD;AAE/C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AAEd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AAtH9B,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA4J3B","sourcesContent":["import { html, LitElement, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport './IxWidget.js';\nimport { laptop, loader } from './assets/iconset.js';\n\n@customElement('ix-status-counter')\nexport class IxStatusCounter extends LitElement {\n static styles = css`\n ix-widget {\n --ix-widget-background: rgb(200, 223, 250);\n --ix-widget-padding: 36.5px 20px 36.5px 24px;\n --ix-icon-font-size: 5rem;\n --ix-icon-line-height: 1;\n cursor: pointer;\n }\n h2 {\n margin: 0px;\n font-family: var(--text-default-font, sans-serif);\n font-size: var(--text-default-size, 16px);\n letter-spacing: var(--text-default-letter-spacing, 0.0275em);\n line-height: var(--text-default-line-height, 1.75em);\n font-weight: var(--text-default-weight, normal);\n text-transform: var(--text-default-decoration, none);\n text-decoration: var(--text-default-transform, none);\n }\n h3 {\n margin: 0px;\n font-family: var(--text-page-title-font, sans-serif);\n font-size: var(--text-page-title-size, 2.125rem);\n letter-spacing: var(--text-page-title-letter-spacing, 0.01029412em);\n line-height: var(--text-page-title-line-height, 1.17647059em);\n font-weight: var(--text-page-title-weight, bold);\n text-decoration: var(--text-page-title-decoration, none);\n text-transform: var(--text-page-title-transform, none);\n }\n .content {\n display: flex;\n -webkit-box-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n }\n ix-icon {\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n display: flex;\n -webkit-box-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n align-items: center;\n width: 60px;\n height: 60px;\n font-size: 36px;\n }\n .loader {\n width: 24px;\n height: 24px;\n }\n .info svg {\n stroke: var(--clr-primary, #1456e0);\n width: 24px;\n height: 24px;\n animation-name: loading;\n animation-duration: 1000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n @keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n svg {\n width: 24px;\n margin: auto;\n }\n\n @media (min-width: 1200px) {\n svg {\n width: 36px;\n margin: auto;\n }\n .info svg {\n width: 36px;\n height: 36px;\n }\n }\n\n @media (max-width: 600px) {\n .info {\n flex-direction: row;\n justify-content: start;\n }\n .content {\n flex-direction: row;\n padding: 0.5rem 1.5rem;\n }\n .content.last-item {\n border-bottom: none;\n }\n .content h2 {\n font-size: 16px;\n }\n .content h3 {\n font-size: 20px;\n }\n ix-icon {\n width: 42px;\n height: 42px;\n }\n }\n `;\n\n @property({ type: String }) value: number | undefined | string = undefined;\n\n @property({ type: String }) header = 'status';\n\n @property({ type: Object }) icon = laptop;\n\n @property({ type: String }) target = '/';\n\n navigate = () => {\n this.dispatchEvent(\n new CustomEvent('route', {\n detail: { route: this.target },\n bubbles: true,\n composed: true,\n })\n );\n };\n\n protected override render() {\n return html`<ix-widget\n @click=${this.navigate}\n @keydown=${(e: KeyboardEvent) => {\n const selectionKeys = [' ', 'Enter'];\n if (selectionKeys.includes(e.key)) {\n this.navigate();\n }\n }}\n type=\"status-counter\"\n >\n <div class=\"content\">\n <div class=\"info\">\n ${this.value || this.value === 0\n ? html`<h3>\n ${typeof this.value === 'number'\n ? this.value.toLocaleString()\n : this.value}\n </h3>`\n : html`<span class=\"loader\">${loader}</span>`}\n <h2>${this.header}</h2>\n </div>\n <ix-icon>${this.icon}</ix-icon>\n </div>\n </ix-widget>`;\n }\n}\n"]}
1
+ {"version":3,"file":"ix-status-counter.js","sourceRoot":"","sources":["../src/ix-status-counter.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,CAAC;AAC5C,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAGrD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAqJuB,UAAK,GAAgC,SAAS,CAAC;QAE/C,WAAM,GAAG,QAAQ,CAAC;QAElB,SAAI,GAAG,MAAM,CAAC;QAEd,WAAM,GAAG,GAAG,CAAC;QAEZ,UAAK,GAAG,KAAK,CAAC;QAE3C,aAAQ,GAAG,GAAG,EAAE;YACd,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,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AO;gCACW,IAAI,CAAC,MAAM;;mBAExB,IAAI,CAAC,IAAI;;iBAEX,CAAC;IAChB,CAAC;;AAzNM,sBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkJlB,AAlJY,CAkJX;AAE0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAgD;AAE/C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAe;AAEd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AAEZ;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CAAe;AA7JhC,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA2N3B","sourcesContent":["import { html, LitElement, css, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport './IxWidget.js';\nimport { laptop, loader } from './assets/iconset.js';\n\nexport const ERROR_DISPLAY_VALUE = '--';\nexport const ERROR_DISPLAY_TEXT = 'Unable to retrieve data';\n\n@customElement('ix-status-counter')\nexport class IxStatusCounter extends LitElement {\n static styles = css`\n ix-widget {\n --ix-widget-background: rgb(200, 223, 250);\n --ix-widget-padding: 36.5px 20px 36.5px 24px;\n --ix-icon-font-size: 5rem;\n --ix-icon-line-height: 1;\n cursor: pointer;\n }\n h2 {\n margin: 0px;\n font-family: var(--text-default-font, sans-serif);\n font-size: var(--text-default-size, 16px);\n letter-spacing: var(--text-default-letter-spacing, 0.0275em);\n line-height: 1.2;\n font-weight: var(--text-default-weight, normal);\n text-transform: var(--text-default-decoration, none);\n text-decoration: var(--text-default-transform, none);\n }\n h2.error {\n font-size: 2.25rem;\n font-family: var(--text-page-title-font, sans-serif);\n }\n h3 {\n margin: 0px;\n font-family: var(--text-page-title-font, sans-serif);\n font-size: var(--text-page-title-size, 2.125rem);\n letter-spacing: var(--text-page-title-letter-spacing, 0.01029412em);\n line-height: 1.2;\n font-weight: var(--text-page-title-weight, bold);\n text-decoration: var(--text-page-title-decoration, none);\n text-transform: var(--text-page-title-transform, none);\n }\n .content {\n display: flex;\n -webkit-box-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n width: 100%;\n }\n ix-icon {\n background-color: rgb(255, 255, 255);\n border-radius: 50%;\n display: flex;\n -webkit-box-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n align-items: center;\n width: 60px;\n height: 60px;\n font-size: 36px;\n }\n .api-error {\n position: relative;\n }\n .api-error ix-icon {\n width: 24px;\n height: 24px;\n --ix-icon-font-size: 24px;\n margin-left: -4px;\n background-color: transparent;\n color: var(--cp-critical-40, #db0028);\n }\n .api-error span {\n background-color: var(--clr-on-surface);\n border-radius: 3px;\n color: white;\n font-size: 12px;\n line-height: 26px;\n padding: 0 8px;\n position: absolute;\n top: -1px;\n left: 30px;\n white-space: nowrap;\n display: none;\n }\n .api-error ix-icon:hover + span,\n .api-error ix-icon:focus + span {\n display: block;\n }\n .api-error + h3 {\n margin-bottom: -4px;\n }\n .loader {\n width: 24px;\n height: 24px;\n }\n .info svg {\n stroke: var(--clr-primary, #1456e0);\n width: 24px;\n height: 24px;\n animation-name: loading;\n animation-duration: 1000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n @keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n svg {\n width: 24px;\n margin: auto;\n }\n\n @media (min-width: 1200px) {\n svg {\n width: 36px;\n margin: auto;\n }\n .info svg {\n width: 36px;\n height: 36px;\n }\n }\n\n @media (max-width: 600px) {\n .info {\n flex-direction: row;\n justify-content: start;\n }\n .content {\n flex-direction: row;\n padding: 0.5rem 1.5rem;\n width: auto;\n }\n .content.last-item {\n border-bottom: none;\n }\n .content h2 {\n font-size: 16px;\n }\n .content h3 {\n font-size: 20px;\n }\n ix-icon {\n width: 42px;\n height: 42px;\n }\n }\n `;\n\n @property({ type: String }) value: number | string | undefined = undefined;\n\n @property({ type: String }) header = 'status';\n\n @property({ type: Object }) icon = laptop;\n\n @property({ type: String }) target = '/';\n\n @property({ type: Boolean }) error = false;\n\n navigate = () => {\n this.dispatchEvent(\n new CustomEvent('route', {\n detail: { route: this.target },\n bubbles: true,\n composed: true,\n })\n );\n };\n\n protected override render() {\n return html`<ix-widget\n @click=${this.navigate}\n @keydown=${(e: KeyboardEvent) => {\n const selectionKeys = [' ', 'Enter'];\n if (selectionKeys.includes(e.key)) {\n this.navigate();\n }\n }}\n type=\"status-counter\"\n >\n <div class=\"content\">\n <div class=\"info\">\n ${this.error\n ? html`<div class=\"api-error\">\n <ix-icon\n tabindex=\"0\"\n aria-label=\"Error\"\n @click=${(e: Event) => {\n e.stopPropagation();\n }}\n >Error</ix-icon\n >\n <span\n role=\"tooltip\"\n aria-label=${ERROR_DISPLAY_TEXT}\n aria-live=\"polite\"\n >${ERROR_DISPLAY_TEXT}</span\n >\n </div>`\n : nothing}\n ${!this.error && ['string', 'number'].includes(typeof this.value)\n ? html`<h3 aria-label=\"${this.header} status\" role=\"status\">\n ${typeof this.value === 'number'\n ? this.value.toLocaleString()\n : this.value}\n </h3>`\n : nothing}\n ${this.value === undefined\n ? html`<span class=\"loader\">${loader}</span>`\n : nothing}\n ${this.error\n ? html`<h2 class=\"error\" role=\"status\">${ERROR_DISPLAY_VALUE}</h2>`\n : nothing}\n <h2 class=\"heading\">${this.header}</h2>\n </div>\n <ix-icon>${this.icon}</ix-icon>\n </div>\n </ix-widget>`;\n }\n}\n"]}
@@ -1,17 +1,27 @@
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;
24
+ name: string;
15
25
  renderEmptyTable(): import("lit-html").TemplateResult<1>;
16
26
  protected render(): import("lit-html").TemplateResult<1>;
17
27
  }
@@ -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,39 +10,49 @@ 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
+ this.name = 'table-data';
28
+ }
29
+ firstUpdated() {
30
+ var _a;
31
+ this.rowLimit = ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.length) || 0;
32
+ this.showViewAll = !(this.rowLimit > 0 && this.rowLimit < this.totalCount);
19
33
  }
20
34
  renderEmptyTable() {
21
- return html `<ix-widget class="empty" type="empty-table">
22
- <div class="header">
35
+ return html `<ix-widget
36
+ class="empty"
37
+ type="empty-table"
38
+ data-testid="no-data-table"
39
+ >
40
+ <div class="header ${this.showHeaderViewAll ? 'view-all' : ''}">
23
41
  <h2>${this.header}</h2>
24
- ${this.showViewAllButtonOnEmpty
25
- ? html ` <ix-button
26
- type="button"
27
- has-icon
28
- trailing-icon
29
- appearance="text"
30
- href=${this.href}
31
- >
32
- <ix-icon slot="icon">chevron_right</ix-icon>
33
- View all
34
- </ix-button>`
35
- : nothing}
42
+ <slot name="tabs"></slot>
36
43
  </div>
37
44
  <div
38
45
  class=${`content ${this.showViewAllButtonOnEmpty ? 'view-all' : ''}`}
39
46
  >
40
47
  <ix-icon class="info" filled>info</ix-icon>
41
- <div class="description">
48
+ <div
49
+ class="description"
50
+ data-testid="ix-table-empty-desc"
51
+ role="status"
52
+ >
42
53
  <p>${this.emptyDescription}</p>
43
54
  </div>
44
- ${this.showViewAllButtonOnEmpty
55
+ ${this.showViewAllButtonOnEmpty && this.href
45
56
  ? html ` <ix-button type="button" href=${this.href}>
46
57
  View all
47
58
  </ix-button>`
@@ -50,7 +61,7 @@ let IxTableData = class IxTableData extends LitElement {
50
61
  </ix-widget>`;
51
62
  }
52
63
  render() {
53
- var _a, _b;
64
+ var _a;
54
65
  if (this.disabled) {
55
66
  return this.renderEmptyTable();
56
67
  }
@@ -68,22 +79,76 @@ let IxTableData = class IxTableData extends LitElement {
68
79
  .columns=${this.columns}
69
80
  .rows=${this.rows}
70
81
  .pageSize=${this.pageSize}
71
- .rowLimit=${((_b = this.rows) === null || _b === void 0 ? void 0 : _b.length) || 0}
82
+ rowLimit=${this.rowLimit}
72
83
  ?hide-filters=${true}
73
84
  add-params-to-url="false"
74
- ><div slot="header" class="header">
85
+ session-storage-key=${this.name}
86
+ show-view-more
87
+ recordCount=${this.totalCount}
88
+ ?isLoading=${this.isLoading}
89
+ simple-pagination
90
+ >
91
+ <div
92
+ slot="header"
93
+ class="header ${this.showHeaderViewAll ? 'view-all' : ''}"
94
+ >
75
95
  <h2>${this.header}</h2>
76
- <ix-button
77
- type="button"
78
- has-icon
79
- trailing-icon
80
- appearance="text"
81
- href=${this.href}
82
- >
83
- <ix-icon slot="icon">chevron_right</ix-icon>
84
- View all
85
- </ix-button>
96
+ <slot name="tabs"></slot>
97
+ ${this.showHeaderViewAll && this.href
98
+ ? html `
99
+ <ix-button
100
+ type="button"
101
+ has-icon
102
+ trailing-icon
103
+ appearance="text"
104
+ href=${this.href}
105
+ data-testid="ix-table-header-view-all"
106
+ >
107
+ <ix-icon slot="icon">chevron_right</ix-icon>
108
+ View all
109
+ </ix-button>
110
+ `
111
+ : nothing}
86
112
  </div>
113
+ ${this.showFooterViewAll
114
+ ? html `
115
+ <div slot="viewMore">
116
+ ${this.showViewAll
117
+ ? html `
118
+ <ix-button
119
+ data-testid="grid-view-more"
120
+ name="view-all-button"
121
+ type="button"
122
+ appearance="text"
123
+ href=${this.href}
124
+ has-icon
125
+ trailing-icon
126
+ >
127
+ <ix-icon slot="icon">chevron_right</ix-icon>
128
+ <span>${this.viewAllText || 'View all'}</span>
129
+ </ix-button>
130
+ `
131
+ : html `
132
+ <ix-button
133
+ data-testid="grid-view-more"
134
+ name="view-more-button"
135
+ appearance="text"
136
+ @click=${() => {
137
+ this.showViewAll = true;
138
+ this.rowLimit = 0;
139
+ this.pageSize = 10;
140
+ this.dispatchEvent(new Event('show-view-more', {
141
+ bubbles: true,
142
+ composed: true,
143
+ }));
144
+ }}
145
+ >
146
+ <span>View more</span>
147
+ </ix-button>
148
+ `}
149
+ </div>
150
+ `
151
+ : nothing}
87
152
  </ix-grid>
88
153
  </ix-widget>`;
89
154
  }
@@ -91,19 +156,26 @@ let IxTableData = class IxTableData extends LitElement {
91
156
  IxTableData.styles = css `
92
157
  ix-widget {
93
158
  --ix-widget-padding: 0;
159
+ --progress-bar-top: 46px;
94
160
  }
95
161
  .empty-state {
96
162
  padding: 24px;
97
163
  }
98
164
  .header {
99
165
  display: flex;
166
+ flex-direction: column;
167
+ gap: 32px;
100
168
  -webkit-box-pack: justify;
101
169
  justify-content: space-between;
102
170
  -webkit-box-align: center;
103
- align-items: center;
104
171
  width: 100%;
105
172
  width: -webkit-fill-available;
173
+ margin: 8px 6px 16px 8px;
174
+ }
175
+ .header.view-all {
176
+ flex-direction: row;
106
177
  margin: 0px -15px 9px 4px;
178
+ align-items: center;
107
179
  }
108
180
  h2 {
109
181
  margin: 0px;
@@ -178,6 +250,8 @@ IxTableData.styles = css `
178
250
  }
179
251
  ix-widget.empty {
180
252
  --ix-widget-padding: 1rem 11px 22px 24px;
253
+ box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,
254
+ #e1e4e8 0px 0px 0px 1px inset;
181
255
  }
182
256
  ix-widget.empty .content {
183
257
  display: flex;
@@ -217,6 +291,9 @@ IxTableData.styles = css `
217
291
  __decorate([
218
292
  property({ type: Array })
219
293
  ], IxTableData.prototype, "columns", void 0);
294
+ __decorate([
295
+ property({ type: Boolean })
296
+ ], IxTableData.prototype, "isLoading", void 0);
220
297
  __decorate([
221
298
  property({ type: Array })
222
299
  ], IxTableData.prototype, "rows", void 0);
@@ -226,9 +303,27 @@ __decorate([
226
303
  __decorate([
227
304
  property({ type: Boolean })
228
305
  ], IxTableData.prototype, "showViewAllButtonOnEmpty", void 0);
306
+ __decorate([
307
+ property({ type: Boolean, attribute: 'header-view-all' })
308
+ ], IxTableData.prototype, "showHeaderViewAll", void 0);
309
+ __decorate([
310
+ property({ type: Boolean, attribute: 'footer-view-all' })
311
+ ], IxTableData.prototype, "showFooterViewAll", void 0);
312
+ __decorate([
313
+ property({ type: String, attribute: 'view-all-text' })
314
+ ], IxTableData.prototype, "viewAllText", void 0);
229
315
  __decorate([
230
316
  property({ type: Number })
231
317
  ], IxTableData.prototype, "pageSize", void 0);
318
+ __decorate([
319
+ state()
320
+ ], IxTableData.prototype, "showViewAll", void 0);
321
+ __decorate([
322
+ state()
323
+ ], IxTableData.prototype, "rowLimit", void 0);
324
+ __decorate([
325
+ property({ type: Number, attribute: 'total-count' })
326
+ ], IxTableData.prototype, "totalCount", void 0);
232
327
  __decorate([
233
328
  property({ type: String })
234
329
  ], IxTableData.prototype, "header", void 0);
@@ -238,6 +333,9 @@ __decorate([
238
333
  __decorate([
239
334
  property({ type: String })
240
335
  ], IxTableData.prototype, "href", void 0);
336
+ __decorate([
337
+ property({ type: String })
338
+ ], IxTableData.prototype, "name", void 0);
241
339
  IxTableData = __decorate([
242
340
  customElement('ix-table-data')
243
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,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAgIsB,YAAO,GAAa,EAAE,CAAC;QAEvB,SAAI,GAAyB,EAAE,CAAC;QAE9B,aAAQ,GAAG,KAAK,CAAC;QAEjB,6BAAwB,GAAG,KAAK,CAAC;QAElC,aAAQ,GAAG,CAAC,CAAC;QAEb,WAAM,GAAG,EAAE,CAAC;QAEZ,qBAAgB,GAAG,EAAE,CAAC;QA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A7HY,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,CAsNvB","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 >\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 class=\"description\">\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 >\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,CAAC;QAEH,sBAAiB,GAC1E,KAAK,CAAC;QAEmD,sBAAiB,GAC1E,KAAK,CAAC;QAEgD,gBAAW,GAAG,EAAE,CAAC;QAE7C,aAAQ,GAAG,CAAC,CAAC;QAEhC,gBAAW,GAAG,KAAK,CAAC;QAEpB,aAAQ,GAAW,CAAC,CAAC;QAEwB,eAAU,GAAG,CAAC,CAAC;QAEzC,WAAM,GAAG,EAAE,CAAC;QAEZ,qBAAgB,GAAG,EAAE,CAAC;QAEtB,SAAI,GAAG,EAAE,CAAC;QAOV,SAAI,GAAG,YAAY,CAAC;IA6HlD,CAAC;IAlIC,YAAY;;QACV,IAAI,CAAC,QAAQ,GAAG,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,KAAI,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,G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AAE,OAAO,EAAE,CAAC;6DAAkC;AAEH;IAA1D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;sDAClD;AAEmD;IAA1D,QAAQ,CAAC,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"]}
@@ -1 +1,82 @@
1
- import{__decorate}from"tslib";import{css,LitElement,html}from"lit";import{property}from"lit/decorators.js";class IxWidget extends LitElement{constructor(){super(...arguments),this.type="default"}render(){return html`<div class="card" type="${this.type}"><slot></slot></div>`}}IxWidget.styles=css`.card{border-radius:.75rem;background:var(--ix-widget-background,#fff);padding:var(--ix-widget-padding,16px 24px 32px);border:var(--ix-widget-border,none)}[type=status-counter].card{margin-bottom:0;--ix-widget-padding:0;--ix-widget-padding:1rem}[type=status-counter-group].card{--ix-widget-padding:1rem;--ix-widget-background:transparent}[type=action-list].card{--ix-widget-padding:0 11px 16px 24px}[type=info-card].card{display:block;max-width:348px;border-radius:.5rem;border:1px solid #e0e0e0;position:relative;overflow:auto;aspect-ratio:1/1.47}[type=info-card-resources].card{display:block;max-width:348px;border-radius:.5rem;border:1px solid #e0e0e0;position:relative;overflow:hidden;aspect-ratio:1/.85}[type=action-list].card{box-shadow:rgba(0,0,0,.2) 0 2px 1px -1px,rgba(0,0,0,.14) 0 1px 1px 0,rgba(0,0,0,.12) 0 1px 3px 0}[type=news-feed].card{display:flex;flex-direction:column;background:#fff;box-shadow:rgba(0,0,0,.12) 0 12px 20px -12px,#e1e4e8 0 0 0 1px inset;border-radius:12px;padding-bottom:11px}@media (min-width:600px){[type=status-counter].card{--ix-widget-padding:33px 20px 33px 24px}[type=status-counter-group].card{padding:0}}@media (max-width:600px){[type=status-counter-group].card{background:#c8dffa;padding-left:0;padding-right:0}[type=status-counter].card{--ix-widget-padding:0;background:0 0;border-radius:0}}`,__decorate([property({type:String})],IxWidget.prototype,"type",void 0),window.customElements.define("ix-widget",IxWidget);
1
+ import{__decorate as r}from"tslib";import{css as d,LitElement as t,html as e}from"lit";import{property as i}from"lit/decorators.js";class p extends t{constructor(){super(...arguments),this.type="default"}render(){return e`<div class="card" type=${this.type}>
2
+ <slot></slot>
3
+ </div>`}}p.styles=d`
4
+ .card {
5
+ border-radius: 0.75rem;
6
+ background: var(--ix-widget-background, white);
7
+ padding: var(--ix-widget-padding, 16px 24px 32px);
8
+ border: var(--ix-widget-border, none);
9
+ }
10
+
11
+ [type='status-counter'].card {
12
+ margin-bottom: 0;
13
+ --ix-widget-padding: 0;
14
+ --ix-widget-padding: 1rem;
15
+ }
16
+
17
+ [type='status-counter-group'].card {
18
+ --ix-widget-padding: 1rem;
19
+ --ix-widget-background: transparent;
20
+ }
21
+
22
+ [type='action-list'].card {
23
+ --ix-widget-padding: 0 11px 16px 24px;
24
+ }
25
+
26
+ [type='info-card'].card {
27
+ display: block;
28
+ max-width: 348px;
29
+ border-radius: 0.5rem;
30
+ border: 1px solid #e0e0e0;
31
+ position: relative;
32
+ overflow: auto;
33
+ aspect-ratio: 1 / 1.47;
34
+ }
35
+ [type='info-card-resources'].card {
36
+ display: block;
37
+ max-width: 348px;
38
+ border-radius: 0.5rem;
39
+ border: 1px solid #e0e0e0;
40
+ position: relative;
41
+ overflow: hidden;
42
+ aspect-ratio: 1 / 0.85;
43
+ }
44
+ [type='action-list'].card {
45
+ box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 1px -1px,
46
+ rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px;
47
+ }
48
+ [type='news-feed'].card {
49
+ display: flex;
50
+ flex-direction: column;
51
+ background: rgb(255, 255, 255);
52
+ box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,
53
+ rgb(225, 228, 232) 0px 0px 0px 1px inset;
54
+ border-radius: 12px;
55
+ padding-bottom: 11px;
56
+ }
57
+
58
+ @media (min-width: 600px) {
59
+ [type='status-counter'].card {
60
+ --ix-widget-padding: 0 20px 0 24px;
61
+ min-height: 134px;
62
+ display: flex;
63
+ }
64
+
65
+ [type='status-counter-group'].card {
66
+ padding: 0;
67
+ }
68
+ }
69
+
70
+ @media (max-width: 600px) {
71
+ [type='status-counter-group'].card {
72
+ background: #c8dffa;
73
+ padding-left: 0;
74
+ padding-right: 0;
75
+ }
76
+ [type='status-counter'].card {
77
+ --ix-widget-padding: 0;
78
+ background: transparent;
79
+ border-radius: 0;
80
+ }
81
+ }
82
+ `,r([i({type:String})],p.prototype,"type",void 0),window.customElements.define("ix-widget",p);
@@ -0,0 +1,146 @@
1
+ export declare const valid: {
2
+ whatsNews: {
3
+ id: number;
4
+ abstract: string;
5
+ behavior: string;
6
+ topics: {
7
+ code: string;
8
+ icon: string;
9
+ id: number;
10
+ name: string;
11
+ }[];
12
+ thumbnail: {
13
+ url: string;
14
+ alternativeText: string;
15
+ };
16
+ video: null;
17
+ category: {
18
+ icon: string;
19
+ image: {
20
+ url: string;
21
+ alternativeText: string;
22
+ };
23
+ showSortBy: boolean;
24
+ showFilterByTopic: boolean;
25
+ subtitle: string;
26
+ title: string;
27
+ uid: string;
28
+ };
29
+ dateAdded: string;
30
+ documents: null;
31
+ duration: null;
32
+ featured: boolean;
33
+ text: null;
34
+ title: string;
35
+ uid: string;
36
+ }[];
37
+ resources: never[];
38
+ newsAndPromotions: never[];
39
+ welcomeVideo: {
40
+ id: number;
41
+ abstract: string;
42
+ behavior: null;
43
+ topics: null;
44
+ thumbnail: {
45
+ url: string;
46
+ alternativeText: string;
47
+ };
48
+ video: {
49
+ url: string;
50
+ };
51
+ category: null;
52
+ dateAdded: string;
53
+ documents: null;
54
+ duration: null;
55
+ featured: boolean;
56
+ text: null;
57
+ title: string;
58
+ uid: string;
59
+ };
60
+ release: null;
61
+ };
62
+ export declare const invalidDate: {
63
+ whatsNews: ({
64
+ id: number;
65
+ abstract: string;
66
+ behavior: string;
67
+ topics: never[];
68
+ thumbnail: {
69
+ url: string;
70
+ alternativeText: string;
71
+ };
72
+ video: null;
73
+ category: {
74
+ icon: string;
75
+ image: {
76
+ url: string;
77
+ alternativeText: string;
78
+ };
79
+ showSortBy: boolean;
80
+ showFilterByTopic: boolean;
81
+ subtitle: string;
82
+ title: string;
83
+ uid: string;
84
+ };
85
+ dateAdded: string;
86
+ documents: null;
87
+ duration: null;
88
+ featured: boolean;
89
+ text: null;
90
+ title: string;
91
+ uid: string;
92
+ } | {
93
+ id: number;
94
+ abstract: string;
95
+ behavior: string;
96
+ topics: never[];
97
+ thumbnail: {
98
+ url: string;
99
+ alternativeText: string;
100
+ };
101
+ video: null;
102
+ category: {
103
+ icon: string;
104
+ image: {
105
+ url: string;
106
+ alternativeText: string;
107
+ };
108
+ showSortBy: boolean;
109
+ showFilterByTopic: boolean;
110
+ subtitle: string;
111
+ title: string;
112
+ uid: string;
113
+ };
114
+ dateAdded: null;
115
+ documents: null;
116
+ duration: null;
117
+ featured: boolean;
118
+ text: null;
119
+ title: string;
120
+ uid: string;
121
+ })[];
122
+ resources: never[];
123
+ newsAndPromotions: never[];
124
+ welcomeVideo: {
125
+ id: number;
126
+ abstract: null;
127
+ behavior: null;
128
+ topics: null;
129
+ thumbnail: {
130
+ url: string;
131
+ alternativeText: string;
132
+ };
133
+ video: {
134
+ url: string;
135
+ };
136
+ category: null;
137
+ dateAdded: string;
138
+ documents: null;
139
+ duration: number;
140
+ featured: boolean;
141
+ text: string;
142
+ title: string;
143
+ uid: string;
144
+ };
145
+ release: null;
146
+ };