@scania/tegel 1.16.0 → 1.17.0-local-assets-beta.0

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.
Files changed (100) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tds-badge.cjs.entry.js +1 -1
  3. package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
  4. package/dist/cjs/tds-dropdown_2.cjs.entry.js +18 -8
  5. package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +30 -10
  6. package/dist/cjs/tds-table-body-row.cjs.entry.js +22 -3
  7. package/dist/cjs/tds-table-footer.cjs.entry.js +6 -3
  8. package/dist/cjs/tegel.cjs.js +1 -1
  9. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCY-Bold.woff +0 -0
  10. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCY-Italic.woff +0 -0
  11. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCY-Regular.woff +0 -0
  12. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYCondensed-Bold.woff +0 -0
  13. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYCondensed-Italic.woff +0 -0
  14. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYCondensed-Regular.woff +0 -0
  15. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYHeadline-Bold.woff +0 -0
  16. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYHeadline-Regular.woff +0 -0
  17. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Bold.woff +0 -0
  18. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Italic.woff +0 -0
  19. package/dist/collection/assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Regular.woff +0 -0
  20. package/dist/collection/assets/fonts/latin/ScaniaSans-Bold.woff +0 -0
  21. package/dist/collection/assets/fonts/latin/ScaniaSans-Italic.woff +0 -0
  22. package/dist/collection/assets/fonts/latin/ScaniaSans-Regular.woff +0 -0
  23. package/dist/collection/assets/fonts/latin/ScaniaSansCondensed-Bold.woff +0 -0
  24. package/dist/collection/assets/fonts/latin/ScaniaSansCondensed-Italic.woff +0 -0
  25. package/dist/collection/assets/fonts/latin/ScaniaSansCondensed-Regular.woff +0 -0
  26. package/dist/collection/assets/fonts/latin/ScaniaSansHeadline-Bold.woff +0 -0
  27. package/dist/collection/assets/fonts/latin/ScaniaSansHeadline-Regular.woff +0 -0
  28. package/dist/collection/assets/fonts/latin/ScaniaSansSemiCondensed-Bold.woff +0 -0
  29. package/dist/collection/assets/fonts/latin/ScaniaSansSemiCondensed-Italic.woff +0 -0
  30. package/dist/collection/assets/fonts/latin/ScaniaSansSemiCondensed-Regular.woff +0 -0
  31. package/dist/collection/assets/logos/scania-symbol.png +0 -0
  32. package/dist/collection/assets/logos/scania-symbol.svg +1 -0
  33. package/dist/collection/assets/logos/scania-wordmark-white.svg +1 -0
  34. package/dist/collection/components/badge/badge.css +0 -1
  35. package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.css +1 -1
  36. package/dist/collection/components/dropdown/dropdown.js +18 -8
  37. package/dist/collection/components/side-menu/side-menu.js +3 -3
  38. package/dist/collection/components/stepper/stepper.js +1 -1
  39. package/dist/collection/components/table/table/table.js +1 -1
  40. package/dist/collection/components/table/table-body-row/table-body-row.css +8 -0
  41. package/dist/collection/components/table/table-body-row/table-body-row.js +58 -2
  42. package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.css +6 -0
  43. package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +58 -13
  44. package/dist/collection/components/table/table-footer/table-footer.js +6 -3
  45. package/dist/components/{p-e7eab204.js → p-9c87dbde.js} +18 -8
  46. package/dist/components/tds-badge.js +1 -1
  47. package/dist/components/tds-breadcrumb.js +1 -1
  48. package/dist/components/tds-dropdown.js +1 -1
  49. package/dist/components/tds-table-body-row-expandable.js +32 -11
  50. package/dist/components/tds-table-body-row.js +23 -3
  51. package/dist/components/tds-table-footer.js +7 -4
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/tds-badge.entry.js +1 -1
  54. package/dist/esm/tds-breadcrumb.entry.js +1 -1
  55. package/dist/esm/tds-dropdown_2.entry.js +18 -8
  56. package/dist/esm/tds-table-body-row-expandable.entry.js +30 -10
  57. package/dist/esm/tds-table-body-row.entry.js +22 -3
  58. package/dist/esm/tds-table-footer.entry.js +6 -3
  59. package/dist/esm/tegel.js +1 -1
  60. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCY-Bold.woff +0 -0
  61. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCY-Italic.woff +0 -0
  62. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCY-Regular.woff +0 -0
  63. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYCondensed-Bold.woff +0 -0
  64. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYCondensed-Italic.woff +0 -0
  65. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYCondensed-Regular.woff +0 -0
  66. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYHeadline-Bold.woff +0 -0
  67. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYHeadline-Regular.woff +0 -0
  68. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Bold.woff +0 -0
  69. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Italic.woff +0 -0
  70. package/dist/tegel/assets/fonts/cyrillic/ScaniaSansCYSemiCondensed-Regular.woff +0 -0
  71. package/dist/tegel/assets/fonts/latin/ScaniaSans-Bold.woff +0 -0
  72. package/dist/tegel/assets/fonts/latin/ScaniaSans-Italic.woff +0 -0
  73. package/dist/tegel/assets/fonts/latin/ScaniaSans-Regular.woff +0 -0
  74. package/dist/tegel/assets/fonts/latin/ScaniaSansCondensed-Bold.woff +0 -0
  75. package/dist/tegel/assets/fonts/latin/ScaniaSansCondensed-Italic.woff +0 -0
  76. package/dist/tegel/assets/fonts/latin/ScaniaSansCondensed-Regular.woff +0 -0
  77. package/dist/tegel/assets/fonts/latin/ScaniaSansHeadline-Bold.woff +0 -0
  78. package/dist/tegel/assets/fonts/latin/ScaniaSansHeadline-Regular.woff +0 -0
  79. package/dist/tegel/assets/fonts/latin/ScaniaSansSemiCondensed-Bold.woff +0 -0
  80. package/dist/tegel/assets/fonts/latin/ScaniaSansSemiCondensed-Italic.woff +0 -0
  81. package/dist/tegel/assets/fonts/latin/ScaniaSansSemiCondensed-Regular.woff +0 -0
  82. package/dist/tegel/assets/logos/scania-symbol.png +0 -0
  83. package/dist/tegel/assets/logos/scania-symbol.svg +1 -0
  84. package/dist/tegel/assets/logos/scania-wordmark-white.svg +1 -0
  85. package/dist/tegel/{p-a593cae3.entry.js → p-0df92ce7.entry.js} +1 -1
  86. package/dist/tegel/{p-137929b7.entry.js → p-26ae4a93.entry.js} +1 -1
  87. package/dist/tegel/p-4655ef6d.entry.js +1 -0
  88. package/dist/tegel/p-6e2435ef.entry.js +1 -0
  89. package/dist/tegel/p-9c2dfecc.entry.js +1 -0
  90. package/dist/tegel/p-bcae4d3a.entry.js +1 -0
  91. package/dist/tegel/tegel.css +2 -2
  92. package/dist/tegel/tegel.esm.js +1 -1
  93. package/dist/types/components/table/table-body-row/table-body-row.d.ts +10 -0
  94. package/dist/types/components/table/table-body-row-expandable/table-body-row-expandable.d.ts +11 -1
  95. package/dist/types/components.d.ts +33 -2
  96. package/package.json +1 -1
  97. package/dist/tegel/p-2da2c193.entry.js +0 -1
  98. package/dist/tegel/p-d3541e17.entry.js +0 -1
  99. package/dist/tegel/p-e4343e51.entry.js +0 -1
  100. package/dist/tegel/p-f4b640af.entry.js +0 -1
@@ -11,6 +11,7 @@ export class TdsTableBodyRow {
11
11
  constructor() {
12
12
  this.selected = false;
13
13
  this.disabled = false;
14
+ this.clickable = false;
14
15
  this.multiselect = false;
15
16
  this.mainCheckBoxStatus = false;
16
17
  this.verticalDividers = false;
@@ -26,6 +27,22 @@ export class TdsTableBodyRow {
26
27
  selectedRows: await this.tableEl.getSelectedRows(),
27
28
  });
28
29
  }
30
+ handleRowClick(e) {
31
+ if (!this.clickable)
32
+ return;
33
+ let rowIndex = Array.from(this.host.parentElement.children).indexOf(this.host);
34
+ this.tdsClick.emit({
35
+ event: e,
36
+ tableId: this.tableId,
37
+ rowIndex: rowIndex,
38
+ });
39
+ }
40
+ handleKeyDown(e) {
41
+ if (this.clickable && (e.key === 'Enter' || e.key === ' ')) {
42
+ e.preventDefault();
43
+ this.handleRowClick(e);
44
+ }
45
+ }
29
46
  internalTdsPropChangeListener(event) {
30
47
  if (this.tableId === event.detail.tableId) {
31
48
  event.detail.changed
@@ -48,12 +65,13 @@ export class TdsTableBodyRow {
48
65
  });
49
66
  }
50
67
  render() {
51
- return (h(Host, { key: '2b99a5336354cb5e7e2e7ef9c81bac76a55c6895', class: {
68
+ return (h(Host, { key: '47571b7325bea2c32791792aee4813ce4364e8eb', tabindex: this.clickable ? '0' : null, class: {
52
69
  'tds-table__row': true,
53
70
  'tds-table__row--selected': this.selected,
54
71
  'tds-table__compact': this.compactDesign,
55
72
  'tds-table--divider': this.verticalDividers,
56
- } }, this.multiselect && (h("td", { key: '049e91ea474a539b6fbe344db4aed9de42297f3d', class: "tds-table__body-cell tds-table__body-cell--checkbox tds-form-label tds-form-label--table" }, h("tds-checkbox", { key: '2af9307e3143db71cae028c1cc2116382b20f4c9', onTdsChange: (event) => this.handleCheckboxChange(event), checked: this.selected, disabled: this.disabled }))), h("slot", { key: '2eff0d398eb53934ca0b152d25422a5febbbffbb' })));
73
+ 'tds-table__row--clickable': this.clickable,
74
+ }, onClick: (e) => this.handleRowClick(e), onKeyDown: (e) => this.handleKeyDown(e) }, this.multiselect && (h("td", { key: 'ad8bb61ead16afe42e6100dc4fe842c058556a20', class: "tds-table__body-cell tds-table__body-cell--checkbox tds-form-label tds-form-label--table" }, h("tds-checkbox", { key: '37844a08f73175f234168a016a9527d01ad2209e', onTdsChange: (event) => this.handleCheckboxChange(event), checked: this.selected, disabled: this.disabled }))), h("slot", { key: 'e7beb86f278f2476f23c365197addd4f22ce2a69' })));
57
75
  }
58
76
  static get is() { return "tds-table-body-row"; }
59
77
  static get encapsulation() { return "shadow"; }
@@ -104,6 +122,24 @@ export class TdsTableBodyRow {
104
122
  "attribute": "disabled",
105
123
  "reflect": true,
106
124
  "defaultValue": "false"
125
+ },
126
+ "clickable": {
127
+ "type": "boolean",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "boolean",
131
+ "resolved": "boolean",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "Makes the row clickable and tabbable for accessibility purposes."
139
+ },
140
+ "attribute": "clickable",
141
+ "reflect": true,
142
+ "defaultValue": "false"
107
143
  }
108
144
  };
109
145
  }
@@ -133,6 +169,26 @@ export class TdsTableBodyRow {
133
169
  "resolved": "{ tableId: string; checked: boolean; selectedRows: any[]; }",
134
170
  "references": {}
135
171
  }
172
+ }, {
173
+ "method": "tdsClick",
174
+ "name": "tdsClick",
175
+ "bubbles": true,
176
+ "cancelable": false,
177
+ "composed": true,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "Event emitted when a row is clicked."
181
+ },
182
+ "complexType": {
183
+ "original": "{\n event: MouseEvent;\n tableId: string;\n rowIndex: number;\n }",
184
+ "resolved": "{ event: MouseEvent; tableId: string; rowIndex: number; }",
185
+ "references": {
186
+ "MouseEvent": {
187
+ "location": "global",
188
+ "id": "global::MouseEvent"
189
+ }
190
+ }
191
+ }
136
192
  }];
137
193
  }
138
194
  static get elementRef() { return "host"; }
@@ -61,6 +61,12 @@
61
61
  padding: 16px 16px 16px 66px;
62
62
  color: var(--tds-table-color);
63
63
  }
64
+ :host .tds-table__row-expand .tds-table__cell-expand--overflow-visible {
65
+ overflow: visible;
66
+ }
67
+ :host .tds-table__row-expand .tds-table__cell-expand--overflow-hidden {
68
+ overflow: hidden;
69
+ }
64
70
 
65
71
  :host(.tds-table__row-expand--active) .tds-table__row {
66
72
  background-color: var(--tds-table-body-row-background-selected);
@@ -12,6 +12,7 @@ const relevantTableProps = [
12
12
 
13
13
  * @part row - Selector for the main row of the table.
14
14
  * @part expand-row - Selector for the expanded row of the table.
15
+ * @part expand-row-cell - Selector for the cell in the expanded row of the table.
15
16
  */
16
17
  export class TdsTableBodyRowExpandable {
17
18
  constructor() {
@@ -19,6 +20,7 @@ export class TdsTableBodyRowExpandable {
19
20
  this.rowId = generateUniqueId();
20
21
  this.expanded = undefined;
21
22
  this.overflow = 'auto';
23
+ this.autoCollapse = false;
22
24
  this.isExpanded = false;
23
25
  this.tableId = '';
24
26
  this.columnsNumber = null;
@@ -39,21 +41,34 @@ export class TdsTableBodyRowExpandable {
39
41
  });
40
42
  }
41
43
  }
44
+ handleRowExpand(event) {
45
+ /** Collapse all other rows when autoCollapse is true and a row is expanded */
46
+ if (this.autoCollapse &&
47
+ event.detail.isExpanded &&
48
+ event.detail.rowId !== this.rowId &&
49
+ event.detail.tableId === this.tableId) {
50
+ this.collapse();
51
+ }
52
+ }
42
53
  watchExpanded(newValue) {
43
54
  if (newValue !== this.isExpanded) {
44
55
  this.isExpanded = newValue;
45
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
56
+ this.tdsChange.emit({
57
+ rowId: this.rowId,
58
+ isExpanded: this.isExpanded,
59
+ tableId: this.tableId,
60
+ });
46
61
  }
47
62
  }
48
63
  /** Method to expand table row */
49
64
  async expand() {
50
65
  this.isExpanded = true;
51
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
66
+ this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded, tableId: this.tableId });
52
67
  }
53
68
  /** Method to collapse table row */
54
69
  async collapse() {
55
70
  this.isExpanded = false;
56
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
71
+ this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded, tableId: this.tableId });
57
72
  }
58
73
  connectedCallback() {
59
74
  /* if user did set a prop we use that as default behaviour */
@@ -78,27 +93,33 @@ export class TdsTableBodyRowExpandable {
78
93
  }
79
94
  sendValue() {
80
95
  this.internalTdsRowExpanded.emit([this.tableId, this.isExpanded]);
81
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
96
+ this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded, tableId: this.tableId });
82
97
  }
83
98
  onChangeHandler(event) {
84
99
  this.isExpanded = event.currentTarget.checked === true;
85
100
  this.sendValue();
86
101
  }
87
102
  render() {
88
- return (h(Host, { key: '46a17e89125c4647a7a3db2c04cb8dff90dcc06a', class: {
103
+ return (h(Host, { key: '802679e89bc19447faa87010bd47d17447c08aca', class: {
89
104
  'tds-table__row': true,
90
105
  'tds-table__row-expand--active': this.isExpanded,
91
106
  'tds-table__compact': this.compactDesign,
92
107
  'tds-table--divider': this.verticalDividers,
93
- } }, h("tr", { key: '656a636f2444586e1c78fb5c5de45c623a47e2b5', class: {
108
+ } }, h("tr", { key: '1c089710478c5effb5f6eb727e22879a80e9003d', class: {
94
109
  'tds-table__row': true,
95
110
  'tds-table__row--expanded': this.isExpanded,
96
- }, part: "row" }, h("td", { key: '65cb018b213aca84d520a737761e528a6244da8b', class: "tds-table__cell tds-table__cell--expand" }, h("label", { key: 'c029a732fe57be3189cfe51c456cb8cdd90739c2', class: "tds-table__expand-control-container" }, h("input", { key: '8bfe49a5a02b5467cd38563244910ea7544c7c5d', class: "tds-table__expand-input", type: "checkbox", onChange: (event) => this.onChangeHandler(event), checked: this.isExpanded }), h("span", { key: '31b764bf3293b551fc036a4d2a17db4d2c379ab6', class: "tds-expendable-row-icon" }, h("svg", { key: 'e35527f2c66ead3523736ea2dbaf0ce2fcfd3c69', fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: '00c9f5bca5b04898e0f17ab567e0826d39fe71c4', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M4.273 9.783a1 1 0 0 1 1.415 0l9.888 9.888a.6.6 0 0 0 .848 0l9.888-9.888a1 1 0 1 1 1.415 1.414l-9.889 9.889a2.6 2.6 0 0 1-3.677 0l-9.888-9.889a1 1 0 0 1 0-1.414Z", fill: "currentColor" }))))), h("slot", { key: '983217a323605c06a600a8db70174fd7464c826c' })), h("tr", { key: '5a2f7db44631b3d912ea93bc97b490d996803d4f', class: {
111
+ }, part: "row" }, h("td", { key: '6f2b7ad6cffef0c33b9cc177e423eb3edbb5b806', class: {
112
+ 'tds-table__cell-expand': true,
113
+ } }, h("label", { key: 'bfe1cc4c8bb91c3e50b1cc3abb823ce22a8c8cad', class: "tds-table__expand-control-container" }, h("input", { key: '65be9c515bccfa2bd42dfdfa869b764ca863d009', class: "tds-table__expand-input", type: "checkbox", onChange: (event) => this.onChangeHandler(event), checked: this.isExpanded }), h("span", { key: 'fbf0df316c42061b1800c2db37a26ba6114a2037', class: "tds-expendable-row-icon" }, h("svg", { key: '26057fa763a2debe0ef180c4e7d7e96fdd4a08a7', fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: '4d66ac5c686c5c0c9ba3a02dff9d7a89f5f15e1a', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M4.273 9.783a1 1 0 0 1 1.415 0l9.888 9.888a.6.6 0 0 0 .848 0l9.888-9.888a1 1 0 1 1 1.415 1.414l-9.889 9.889a2.6 2.6 0 0 1-3.677 0l-9.888-9.889a1 1 0 0 1 0-1.414Z", fill: "currentColor" }))))), h("slot", { key: 'b6b611bc514d9e3e74b7c275c407da8d7b1a5ef4' })), h("tr", { key: '8cb106ff4e548936195a6ffbb18739a07cd17ad1', class: {
97
114
  'tds-table__row-expand': true,
98
115
  'tds-table__row-expand--expanded': this.isExpanded,
99
- }, part: "expand-row" }, h("td", { key: '38ee3a00705e910161f43894990f987596f3f139', class: "tds-table__cell-expand", colSpan: this.columnsNumber }, h("div", { key: '5fccf84bd2f7454afc3bb036210294e55f80f781', style: {
116
+ }, part: "expand-row" }, h("td", { key: '248e880b6793a6a36eb738646a07d82d91e15e8b', class: {
117
+ 'tds-table__cell-expand': true,
118
+ 'tds-table__cell-expand--overflow-hidden': this.overflow === 'hidden',
119
+ 'tds-table__cell-expand--overflow-visible': this.overflow === 'visible',
120
+ }, part: "expand-row-cell", colSpan: this.columnsNumber }, h("div", { key: '7489853de5d7a2cbe0168f7e873f7bb0be01a215', style: {
100
121
  overflow: this.overflow,
101
- } }, h("slot", { key: '01a7f9edf532244bd4f7205b339ffcafb93ceb20', name: "expand-row" }))))));
122
+ } }, h("slot", { key: '3f4d7715c224969fb2d798432019c3e45685731f', name: "expand-row" }))))));
102
123
  }
103
124
  static get is() { return "tds-table-body-row-expandable"; }
104
125
  static get encapsulation() { return "shadow"; }
@@ -171,8 +192,8 @@ export class TdsTableBodyRowExpandable {
171
192
  "type": "string",
172
193
  "mutable": false,
173
194
  "complexType": {
174
- "original": "'auto' | 'hidden'",
175
- "resolved": "\"auto\" | \"hidden\"",
195
+ "original": "'auto' | 'hidden' | 'visible'",
196
+ "resolved": "\"auto\" | \"hidden\" | \"visible\"",
176
197
  "references": {}
177
198
  },
178
199
  "required": false,
@@ -184,6 +205,24 @@ export class TdsTableBodyRowExpandable {
184
205
  "attribute": "overflow",
185
206
  "reflect": true,
186
207
  "defaultValue": "'auto'"
208
+ },
209
+ "autoCollapse": {
210
+ "type": "boolean",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "boolean",
214
+ "resolved": "boolean",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "Enables auto-collapse of other expandable rows when one row is expanded"
222
+ },
223
+ "attribute": "auto-collapse",
224
+ "reflect": false,
225
+ "defaultValue": "false"
187
226
  }
188
227
  };
189
228
  }
@@ -228,8 +267,8 @@ export class TdsTableBodyRowExpandable {
228
267
  "text": "Sends unique table row identifier and isExpanded status when it is expanded/collapsed."
229
268
  },
230
269
  "complexType": {
231
- "original": "{\n rowId: string;\n isExpanded: boolean;\n }",
232
- "resolved": "{ rowId: string; isExpanded: boolean; }",
270
+ "original": "{\n rowId: string;\n isExpanded: boolean;\n tableId: string;\n }",
271
+ "resolved": "{ rowId: string; isExpanded: boolean; tableId: string; }",
233
272
  "references": {}
234
273
  }
235
274
  }];
@@ -286,6 +325,12 @@ export class TdsTableBodyRowExpandable {
286
325
  "target": "body",
287
326
  "capture": false,
288
327
  "passive": false
328
+ }, {
329
+ "name": "tdsChange",
330
+ "method": "handleRowExpand",
331
+ "target": "body",
332
+ "capture": false,
333
+ "passive": false
289
334
  }];
290
335
  }
291
336
  }
@@ -113,6 +113,9 @@ export class TdsTableFooter {
113
113
  }
114
114
  rowsPerPageChange(event) {
115
115
  this.rowsPerPageValue = parseInt(event.detail.value);
116
+ if (this.paginationValue > this.pages) {
117
+ this.paginationValue = this.pages;
118
+ }
116
119
  this.emitTdsPagination();
117
120
  }
118
121
  getStyles() {
@@ -124,12 +127,12 @@ export class TdsTableFooter {
124
127
  }
125
128
  render() {
126
129
  var _a;
127
- return (h(Host, { key: 'a47ca76a46aae73aca5ce929c70c2e76f8c2c853', class: {
130
+ return (h(Host, { key: 'ef2cd69929908fa46254c82d0799c1b1a4ee52b3', class: {
128
131
  'tds-table--compact': this.compactDesign,
129
132
  'footer__horizontal-scroll': !!this.horizontalScrollWidth,
130
- }, style: this.getStyles() }, h("tr", { key: '725d46b781fd8abe9748a1aabeff92ca419a4189', class: "tds-table__footer-row" }, h("td", { key: 'dce6cb9b634da75b37cd6181d12fbfdfa1eba34c', class: "tds-table__footer-cell", colSpan: this.columnsNumber }, this.pagination && (h("div", { key: '045cf654031b791addb51eb1c9a7b951cb5aec5c', class: "tds-table__pagination" }, h("div", { key: 'e321a6407dc41bb0d5ea8ff272a3ad5a73cc7bf9', class: "tds-table__row-selector" }, this.rowsperpage && ((_a = this.rowsPerPageValues) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("div", { key: 'c126a905a62dbbfad2b1f9b4e90e24ea0a5d1f7d', class: "rows-per-page" }, h("p", { key: '68da58804bf6bf222179368ff99b83aaa2e891b4' }, "Rows per page"), h("tds-dropdown", { key: '4db380d47b1944a45c31b083a69d4662c0951fa4', modeVariant: "secondary", id: "rows-dropdown", class: "page-dropdown", size: "xs", defaultValue: `${this.rowsPerPageValues[0]}`, onTdsChange: (event) => this.rowsPerPageChange(event) }, this.rowsPerPageValues.map((value) => {
133
+ }, style: this.getStyles() }, h("tr", { key: 'f18eb0b2a49d1d8df9dacc998138dae4e5f8d256', class: "tds-table__footer-row" }, h("td", { key: 'abb1f6f2971c9fa9b68bfb856882817406d0d87f', class: "tds-table__footer-cell", colSpan: this.columnsNumber }, this.pagination && (h("div", { key: '8226ac0aee40b97cad90035ff9aba54b8365b960', class: "tds-table__pagination" }, h("div", { key: '9b604d5ccb7dbdac0cdb1bc96567d7b29d7fa250', class: "tds-table__row-selector" }, this.rowsperpage && ((_a = this.rowsPerPageValues) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("div", { key: '716b6830e891305611ceb6213bd696298dbcfe12', class: "rows-per-page" }, h("p", { key: 'd6b7bfff5262fcf0174f6b2d92dcfdedda97dfc2' }, "Rows per page"), h("tds-dropdown", { key: '9da6799f30172a1628a4630aa5474456f6351089', modeVariant: "secondary", id: "rows-dropdown", class: "page-dropdown", size: "xs", defaultValue: `${this.rowsPerPageValues[0]}`, onTdsChange: (event) => this.rowsPerPageChange(event) }, this.rowsPerPageValues.map((value) => {
131
134
  return (h("tds-dropdown-option", { value: `${value}` }, value));
132
- }))))), h("div", { key: '81951e2a1405f7d8d9fb9d5602ded2652fa3574e', class: "tds-table__page-selector" }, h("input", { key: 'f9a0b0e94c31df6c7f6b78c8334f172b412fde64', ref: (element) => (this.inputElement = element), class: "tds-table__page-selector-input", type: "number", min: "1", max: this.pages, value: this.paginationValue, pattern: "[0-9]+", dir: "ltr", onChange: (event) => this.paginationInputChange(event), onAnimationEnd: removeShakeAnimation }), h("p", { key: '9f03ddfb2efed8f29d932e4272f37cb7fea99366', class: "tds-table__footer-text" }, "of ", h("span", { key: '0e925460d959f6e00f83011d13e5ef2d7ed3cbb6' }, this.pages), " pages"), h("button", { key: '50da78d78b7ef971056e33ba0d0a1bac78149319', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue <= 1, onClick: () => this.firstPage() }, h("tds-icon", { key: 'd69ea67ed2ff1dff364c9d3805b3cb29fd953050', name: "skip_backwards", size: "20px" })), h("button", { key: 'c3aeea0024fc6a72aea633d59c10db7729f76022', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue <= 1, onClick: () => this.previousPage() }, h("tds-icon", { key: '0df46c69a9682fb2a4ec4c75b15adc50b7d436da', name: "chevron_left", size: "20px" })), h("button", { key: '5bd78c3e14dc55421763ac78e19daac64c184e34', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue >= this.pages, onClick: () => this.nextPage() }, h("tds-icon", { key: 'c0739697329a13021dd9cdb771b69491264962a5', name: "chevron_right", size: "20px" })), h("button", { key: 'b1317db56a99632abf132f619bc59c773e631e04', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue >= this.pages, onClick: () => this.lastPage() }, h("tds-icon", { key: '3d6b0997ae36fd372aeb2099a304f02282766f7e', name: "skip_forward", size: "20px" })))))))));
135
+ }))))), h("div", { key: '73c5849886a0144c22b79d31b92a607d8f794483', class: "tds-table__page-selector" }, h("input", { key: 'a297fd5b739df5d4353b045a25ba6e480dbad03e', ref: (element) => (this.inputElement = element), class: "tds-table__page-selector-input", type: "number", min: "1", max: this.pages, value: this.paginationValue, pattern: "[0-9]+", dir: "ltr", onChange: (event) => this.paginationInputChange(event), onAnimationEnd: removeShakeAnimation }), h("p", { key: 'f6d1257c745638b2152843d52c494db23d26b2ca', class: "tds-table__footer-text" }, "of ", h("span", { key: '81b8c076cf322798709eafae1fad43b036127ada' }, this.pages), " pages"), h("button", { key: 'd9789d9d6ccd45f1d0c4e4d427c3ed1bb13e7440', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue <= 1, onClick: () => this.firstPage() }, h("tds-icon", { key: 'dac60e50f54fd71ae1d89e21e6140bbcbbda6680', name: "skip_backwards", size: "20px" })), h("button", { key: '39810bac01a38c71427192beea48257b7d2dd2b1', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue <= 1, onClick: () => this.previousPage() }, h("tds-icon", { key: '2987abbbdc7be2c7485d7bfcabcafe94983f5f54', name: "chevron_left", size: "20px" })), h("button", { key: '2252c555a816a4014c130b05ae70d2e25893f460', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue >= this.pages, onClick: () => this.nextPage() }, h("tds-icon", { key: 'a19c83f25082c82cdac308d3538c274bbce62826', name: "chevron_right", size: "20px" })), h("button", { key: 'e06ec885711559b6e7893d90ada5057292f624e0', type: "button", class: "tds-table__footer-btn", disabled: this.paginationValue >= this.pages, onClick: () => this.lastPage() }, h("tds-icon", { key: '6a8f4218a45cc5bdbb0c8b0711e802ce5f2dfed1', name: "skip_forward", size: "20px" })))))))));
133
136
  }
134
137
  static get is() { return "tds-table-footer"; }
135
138
  static get encapsulation() { return "shadow"; }
@@ -154,10 +154,13 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
154
154
  return this.filter ? labels === null || labels === void 0 ? void 0 : labels.join(', ') : labels === null || labels === void 0 ? void 0 : labels.toString();
155
155
  };
156
156
  this.setValueAttribute = () => {
157
- var _a, _b, _c;
158
- if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '')
159
- this.value = null;
160
- this.host.setAttribute('value', (_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((val) => val).toString()) !== null && _c !== void 0 ? _c : null);
157
+ var _a;
158
+ if (!this.value || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '') {
159
+ this.host.removeAttribute('value');
160
+ }
161
+ else {
162
+ this.host.setAttribute('value', this.value.map((val) => val).toString());
163
+ }
161
164
  };
162
165
  this.handleFilter = (event) => {
163
166
  this.tdsInput.emit(event);
@@ -406,7 +409,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
406
409
  render() {
407
410
  var _a, _b, _c, _d;
408
411
  appendHiddenInput(this.host, this.name, (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString(), this.disabled);
409
- return (h(Host, { key: '1e7eacac32eba892288cd94254053ef9d09b03f7', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: '8a97e693abbf5ff8973fde64c1d383e926d5c5a8', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '55d98944321d2084de6cb3fd5f70b32b5b84d518', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
412
+ return (h(Host, { key: 'c756dc7221c39b901524bd0c28938bd166e412bc', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: '5184a8c84d24e0f13379c95fc7ceb7791f1e25ab', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '601bc322ce765ed1ee52e1ee6a0894fcb335485b', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
410
413
  filter: true,
411
414
  focus: this.filterFocus,
412
415
  disabled: this.disabled,
@@ -417,13 +420,20 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
417
420
  ${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
418
421
  ` }, this.label)), h("input", {
419
422
  // eslint-disable-next-line no-return-assign
420
- ref: (inputEl) => (this.inputElement = inputEl), class: `${this.labelPosition === 'inside' ? 'placeholder' : ''}`, type: "text", placeholder: this.placeholder, value: this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
423
+ ref: (inputEl) => (this.inputElement = inputEl), class: `${this.labelPosition === 'inside' ? 'placeholder' : ''}`, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
421
424
  this.filterFocus = false;
425
+ if (this.multiselect) {
426
+ this.inputElement.value = this.getValue();
427
+ }
422
428
  this.handleBlur(event);
423
429
  }, onFocus: (event) => {
424
430
  this.open = true;
425
431
  this.filterFocus = true;
432
+ if (this.multiselect) {
433
+ this.inputElement.value = '';
434
+ }
426
435
  this.handleFocus(event);
436
+ this.handleFilter({ target: { value: '' } });
427
437
  }, onKeyDown: (event) => {
428
438
  if (event.key === 'Escape') {
429
439
  this.open = false;
@@ -449,11 +459,11 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
449
459
  label-inside-as-placeholder
450
460
  ${this.size}
451
461
  ${((_c = this.value) === null || _c === void 0 ? void 0 : _c.length) ? 'selected' : ''}
452
- ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: 'b661988b59447f31ab71e6d03da4b6226caab184', ref: (element) => (this.dropdownList = element), class: `dropdown-list
462
+ ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: '71042ce1a28e3598ee37977b86ae887c68caad1d', ref: (element) => (this.dropdownList = element), class: `dropdown-list
453
463
  ${this.size}
454
464
  ${this.open ? 'open' : 'closed'}
455
465
  ${this.getOpenDirection()}
456
- ${this.label && this.labelPosition === 'outside' ? 'label-outside' : ''}` }, h("slot", { key: '855021b97bdc5e56d8a2ebcd981e143aabb8a1ef', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'c282e26376e176e3eca36261eb269bfe4cce60da', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '6bce306c718a21a8eb5320da036a7f8909467d76', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: 'a15e4b87b4388fd44701db482b4be4a9cfee68f2', name: "error", size: "16px" }), this.helper))));
466
+ ${this.label && this.labelPosition === 'outside' ? 'label-outside' : ''}` }, h("slot", { key: 'bf606ae5c67258fc04df20474cde59ff00ea90eb', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '2a1b20c4ad0acf3f6c7de06ef3e6a84e7879f398', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '1c4cb2ca717f28fe16306729ae6cf555358a1a65', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: '6b3a6054fa2e1f1b77c8520cdfab20ef5e7a4bf9', name: "error", size: "16px" }), this.helper))));
457
467
  }
458
468
  get host() { return this; }
459
469
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-28ef5186.js';
2
2
 
3
- const badgeCss = ":host{--tds-badge-background-color:var(--tds-negative);--tds-badge-color-text:var(--tds-white);box-sizing:border-box;display:block}:host *{box-sizing:border-box}.tds-badge{display:block;border-radius:12px;background-color:var(--tds-badge-background-color);text-align:center}.tds-badge.tds-badge-sm{height:8px;width:8px;line-height:8px}.tds-badge.tds-badge-lg{height:20px;line-height:20px;width:20px}.tds-badge.tds-badge-pill{display:inline-block;width:unset;padding-left:8px;padding-right:8px}.tds-badge.tds-badge-hidden{display:none}.tds-badge-text{font-family:var(--tds-font-family-semi-condensed-bold);font-size:12px;color:var(--tds-badge-color-text);font-weight:bold}";
3
+ const badgeCss = ":host{--tds-badge-background-color:var(--tds-negative);--tds-badge-color-text:var(--tds-white);box-sizing:border-box;display:block}:host *{box-sizing:border-box}.tds-badge{display:block;border-radius:12px;background-color:var(--tds-badge-background-color);text-align:center}.tds-badge.tds-badge-sm{height:8px;width:8px;line-height:8px}.tds-badge.tds-badge-lg{height:20px;line-height:20px;width:20px}.tds-badge.tds-badge-pill{display:inline-block;width:unset;padding-left:8px;padding-right:8px}.tds-badge.tds-badge-hidden{display:none}.tds-badge-text{font-size:12px;color:var(--tds-badge-color-text);font-weight:bold}";
4
4
  const TdsBadgeStyle0 = badgeCss;
5
5
 
6
6
  const TdsBadge$1 = /*@__PURE__*/ proxyCustomElement(class TdsBadge extends H {
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-28ef5186.js';
2
2
 
3
- const breadcrumbCss = "@charset \"UTF-8\";[role=listitem] ::slotted(*){color:var(--tds-breadcrumb-color);text-decoration:none}[role=listitem]:hover ::slotted(*){color:var(--tds-breadcrumb-color-hover);text-decoration:underline}[role=listitem] ::slotted(*:focus-visible){outline:2px solid var(--tds-blue-400);outline-offset:-2px;outline-offset:0}[role=listitem].current ::slotted(*),[role=listitem] [aria-current=page] ::slotted(*){pointer-events:none;cursor:default;color:var(--tds-breadcrumb-color-current)}[role=listitem].current:hover ::slotted(*),[role=listitem] [aria-current=page]:hover ::slotted(*){text-decoration:none;cursor:not-allowed}[role=listitem]::after{content:\"›\";color:var(--tds-breadcrumb-separator-color);margin-right:4px;margin-left:4px;display:inline-block;width:4px;height:8px}:host(.last) [role=listitem]::after{display:none}";
3
+ const breadcrumbCss = "@charset \"UTF-8\";[role=listitem] ::slotted(*){color:var(--tds-breadcrumb-color);text-decoration:none}[role=listitem]:hover ::slotted(*){color:var(--tds-breadcrumb-color-hover);text-decoration:underline}[role=listitem] ::slotted(*:focus-visible){outline:2px solid var(--tds-blue-400);outline-offset:-2px;outline-offset:0}[role=listitem].current ::slotted(*),[role=listitem] [aria-current=page] ::slotted(*){pointer-events:none;cursor:default;color:var(--tds-breadcrumb-color-current)}[role=listitem].current:hover ::slotted(*),[role=listitem] [aria-current=page]:hover ::slotted(*){text-decoration:none;cursor:not-allowed}[role=listitem]::after{content:\"›\";color:var(--tds-breadcrumb-separator-color);margin-right:4px;margin-left:4px;display:inline-block;width:4px;height:8px}.current::after{display:none}";
4
4
  const TdsBreadcrumbStyle0 = breadcrumbCss;
5
5
 
6
6
  const TdsBreadcrumb$1 = /*@__PURE__*/ proxyCustomElement(class TdsBreadcrumb extends H {
@@ -1,4 +1,4 @@
1
- import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-e7eab204.js';
1
+ import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-9c87dbde.js';
2
2
 
3
3
  const TdsDropdown = TdsDropdown$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
2
  import { g as generateUniqueId } from './p-11648030.js';
3
3
 
4
- const tableBodyRowExpandableCss = ":host{box-sizing:border-box;display:contents}:host *{box-sizing:border-box}:host .tds-table__row,:host .tds-table__row-extend{display:table-row;border-bottom:1px solid var(--tds-table-divider);background-color:var(--tds-table-body-row-background);transition:background-color 200ms ease;color:var(--tds-table-color)}:host .tds-table__row--expanded{border-bottom:none}:host .tds-table__row:hover,:host .tds-table__row-extend:hover{background-color:var(--tds-table-body-row-background-hover)}:host .tds-table__expand-control-container{display:flex;justify-content:center;align-items:center;height:46px;cursor:pointer;padding:0 16px;position:relative}:host .tds-table__expand-control-container .tds-table__expand-input{all:unset;top:0;left:0;width:100%;height:100%;position:absolute;cursor:pointer}:host .tds-table__expand-control-container .tds-table__expand-input:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .tds-table__expand-control-container .tds-expendable-row-icon{height:16px;width:16px;transition:transform 200ms ease;transform:rotate(0)}:host .tds-table__row-expand{display:none;transition:background-color 200ms ease}:host .tds-table__row-expand--expanded{border-bottom:1px solid var(--tds-table-divider)}:host .tds-table__row-expand .tds-table__cell-expand{max-width:1px;overflow:auto;padding:16px 16px 16px 66px;color:var(--tds-table-color)}:host(.tds-table__row-expand--active) .tds-table__row{background-color:var(--tds-table-body-row-background-selected)}:host(.tds-table__row-expand--active) .tds-table__expand-control-container .tds-expendable-row-icon{transform:rotate(180deg)}:host(.tds-table__row-expand--active) .tds-table__row-expand{background-color:var(--tds-table-body-row-background-selected);display:table-row}:host(.tds-table__compact) .tds-table__expand-control-container{height:30px}:host(.tds-table__compact) .tds-table__row-expand .tds-table__cell-expand{padding:8px 16px 8px 66px}:host(.tds-table__row--hidden){display:none}:host(.tds-table--divider) .tds-table__cell--expand{border-right:1px solid var(--tds-table-divider)}";
4
+ const tableBodyRowExpandableCss = ":host{box-sizing:border-box;display:contents}:host *{box-sizing:border-box}:host .tds-table__row,:host .tds-table__row-extend{display:table-row;border-bottom:1px solid var(--tds-table-divider);background-color:var(--tds-table-body-row-background);transition:background-color 200ms ease;color:var(--tds-table-color)}:host .tds-table__row--expanded{border-bottom:none}:host .tds-table__row:hover,:host .tds-table__row-extend:hover{background-color:var(--tds-table-body-row-background-hover)}:host .tds-table__expand-control-container{display:flex;justify-content:center;align-items:center;height:46px;cursor:pointer;padding:0 16px;position:relative}:host .tds-table__expand-control-container .tds-table__expand-input{all:unset;top:0;left:0;width:100%;height:100%;position:absolute;cursor:pointer}:host .tds-table__expand-control-container .tds-table__expand-input:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .tds-table__expand-control-container .tds-expendable-row-icon{height:16px;width:16px;transition:transform 200ms ease;transform:rotate(0)}:host .tds-table__row-expand{display:none;transition:background-color 200ms ease}:host .tds-table__row-expand--expanded{border-bottom:1px solid var(--tds-table-divider)}:host .tds-table__row-expand .tds-table__cell-expand{max-width:1px;overflow:auto;padding:16px 16px 16px 66px;color:var(--tds-table-color)}:host .tds-table__row-expand .tds-table__cell-expand--overflow-visible{overflow:visible}:host .tds-table__row-expand .tds-table__cell-expand--overflow-hidden{overflow:hidden}:host(.tds-table__row-expand--active) .tds-table__row{background-color:var(--tds-table-body-row-background-selected)}:host(.tds-table__row-expand--active) .tds-table__expand-control-container .tds-expendable-row-icon{transform:rotate(180deg)}:host(.tds-table__row-expand--active) .tds-table__row-expand{background-color:var(--tds-table-body-row-background-selected);display:table-row}:host(.tds-table__compact) .tds-table__expand-control-container{height:30px}:host(.tds-table__compact) .tds-table__row-expand .tds-table__cell-expand{padding:8px 16px 8px 66px}:host(.tds-table__row--hidden){display:none}:host(.tds-table--divider) .tds-table__cell--expand{border-right:1px solid var(--tds-table-divider)}";
5
5
  const TdsTableBodyRowExpandableStyle0 = tableBodyRowExpandableCss;
6
6
 
7
7
  const relevantTableProps = [
@@ -21,6 +21,7 @@ const TdsTableBodyRowExpandable$1 = /*@__PURE__*/ proxyCustomElement(class TdsTa
21
21
  this.rowId = generateUniqueId();
22
22
  this.expanded = undefined;
23
23
  this.overflow = 'auto';
24
+ this.autoCollapse = false;
24
25
  this.isExpanded = false;
25
26
  this.tableId = '';
26
27
  this.columnsNumber = null;
@@ -41,21 +42,34 @@ const TdsTableBodyRowExpandable$1 = /*@__PURE__*/ proxyCustomElement(class TdsTa
41
42
  });
42
43
  }
43
44
  }
45
+ handleRowExpand(event) {
46
+ /** Collapse all other rows when autoCollapse is true and a row is expanded */
47
+ if (this.autoCollapse &&
48
+ event.detail.isExpanded &&
49
+ event.detail.rowId !== this.rowId &&
50
+ event.detail.tableId === this.tableId) {
51
+ this.collapse();
52
+ }
53
+ }
44
54
  watchExpanded(newValue) {
45
55
  if (newValue !== this.isExpanded) {
46
56
  this.isExpanded = newValue;
47
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
57
+ this.tdsChange.emit({
58
+ rowId: this.rowId,
59
+ isExpanded: this.isExpanded,
60
+ tableId: this.tableId,
61
+ });
48
62
  }
49
63
  }
50
64
  /** Method to expand table row */
51
65
  async expand() {
52
66
  this.isExpanded = true;
53
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
67
+ this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded, tableId: this.tableId });
54
68
  }
55
69
  /** Method to collapse table row */
56
70
  async collapse() {
57
71
  this.isExpanded = false;
58
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
72
+ this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded, tableId: this.tableId });
59
73
  }
60
74
  connectedCallback() {
61
75
  /* if user did set a prop we use that as default behaviour */
@@ -80,27 +94,33 @@ const TdsTableBodyRowExpandable$1 = /*@__PURE__*/ proxyCustomElement(class TdsTa
80
94
  }
81
95
  sendValue() {
82
96
  this.internalTdsRowExpanded.emit([this.tableId, this.isExpanded]);
83
- this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded });
97
+ this.tdsChange.emit({ rowId: this.rowId, isExpanded: this.isExpanded, tableId: this.tableId });
84
98
  }
85
99
  onChangeHandler(event) {
86
100
  this.isExpanded = event.currentTarget.checked === true;
87
101
  this.sendValue();
88
102
  }
89
103
  render() {
90
- return (h(Host, { key: '46a17e89125c4647a7a3db2c04cb8dff90dcc06a', class: {
104
+ return (h(Host, { key: '802679e89bc19447faa87010bd47d17447c08aca', class: {
91
105
  'tds-table__row': true,
92
106
  'tds-table__row-expand--active': this.isExpanded,
93
107
  'tds-table__compact': this.compactDesign,
94
108
  'tds-table--divider': this.verticalDividers,
95
- } }, h("tr", { key: '656a636f2444586e1c78fb5c5de45c623a47e2b5', class: {
109
+ } }, h("tr", { key: '1c089710478c5effb5f6eb727e22879a80e9003d', class: {
96
110
  'tds-table__row': true,
97
111
  'tds-table__row--expanded': this.isExpanded,
98
- }, part: "row" }, h("td", { key: '65cb018b213aca84d520a737761e528a6244da8b', class: "tds-table__cell tds-table__cell--expand" }, h("label", { key: 'c029a732fe57be3189cfe51c456cb8cdd90739c2', class: "tds-table__expand-control-container" }, h("input", { key: '8bfe49a5a02b5467cd38563244910ea7544c7c5d', class: "tds-table__expand-input", type: "checkbox", onChange: (event) => this.onChangeHandler(event), checked: this.isExpanded }), h("span", { key: '31b764bf3293b551fc036a4d2a17db4d2c379ab6', class: "tds-expendable-row-icon" }, h("svg", { key: 'e35527f2c66ead3523736ea2dbaf0ce2fcfd3c69', fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: '00c9f5bca5b04898e0f17ab567e0826d39fe71c4', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M4.273 9.783a1 1 0 0 1 1.415 0l9.888 9.888a.6.6 0 0 0 .848 0l9.888-9.888a1 1 0 1 1 1.415 1.414l-9.889 9.889a2.6 2.6 0 0 1-3.677 0l-9.888-9.889a1 1 0 0 1 0-1.414Z", fill: "currentColor" }))))), h("slot", { key: '983217a323605c06a600a8db70174fd7464c826c' })), h("tr", { key: '5a2f7db44631b3d912ea93bc97b490d996803d4f', class: {
112
+ }, part: "row" }, h("td", { key: '6f2b7ad6cffef0c33b9cc177e423eb3edbb5b806', class: {
113
+ 'tds-table__cell-expand': true,
114
+ } }, h("label", { key: 'bfe1cc4c8bb91c3e50b1cc3abb823ce22a8c8cad', class: "tds-table__expand-control-container" }, h("input", { key: '65be9c515bccfa2bd42dfdfa869b764ca863d009', class: "tds-table__expand-input", type: "checkbox", onChange: (event) => this.onChangeHandler(event), checked: this.isExpanded }), h("span", { key: 'fbf0df316c42061b1800c2db37a26ba6114a2037', class: "tds-expendable-row-icon" }, h("svg", { key: '26057fa763a2debe0ef180c4e7d7e96fdd4a08a7', fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { key: '4d66ac5c686c5c0c9ba3a02dff9d7a89f5f15e1a', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M4.273 9.783a1 1 0 0 1 1.415 0l9.888 9.888a.6.6 0 0 0 .848 0l9.888-9.888a1 1 0 1 1 1.415 1.414l-9.889 9.889a2.6 2.6 0 0 1-3.677 0l-9.888-9.889a1 1 0 0 1 0-1.414Z", fill: "currentColor" }))))), h("slot", { key: 'b6b611bc514d9e3e74b7c275c407da8d7b1a5ef4' })), h("tr", { key: '8cb106ff4e548936195a6ffbb18739a07cd17ad1', class: {
99
115
  'tds-table__row-expand': true,
100
116
  'tds-table__row-expand--expanded': this.isExpanded,
101
- }, part: "expand-row" }, h("td", { key: '38ee3a00705e910161f43894990f987596f3f139', class: "tds-table__cell-expand", colSpan: this.columnsNumber }, h("div", { key: '5fccf84bd2f7454afc3bb036210294e55f80f781', style: {
117
+ }, part: "expand-row" }, h("td", { key: '248e880b6793a6a36eb738646a07d82d91e15e8b', class: {
118
+ 'tds-table__cell-expand': true,
119
+ 'tds-table__cell-expand--overflow-hidden': this.overflow === 'hidden',
120
+ 'tds-table__cell-expand--overflow-visible': this.overflow === 'visible',
121
+ }, part: "expand-row-cell", colSpan: this.columnsNumber }, h("div", { key: '7489853de5d7a2cbe0168f7e873f7bb0be01a215', style: {
102
122
  overflow: this.overflow,
103
- } }, h("slot", { key: '01a7f9edf532244bd4f7205b339ffcafb93ceb20', name: "expand-row" }))))));
123
+ } }, h("slot", { key: '3f4d7715c224969fb2d798432019c3e45685731f', name: "expand-row" }))))));
104
124
  }
105
125
  get host() { return this; }
106
126
  static get watchers() { return {
@@ -112,6 +132,7 @@ const TdsTableBodyRowExpandable$1 = /*@__PURE__*/ proxyCustomElement(class TdsTa
112
132
  "rowId": [513, "row-id"],
113
133
  "expanded": [516],
114
134
  "overflow": [513],
135
+ "autoCollapse": [4, "auto-collapse"],
115
136
  "isExpanded": [32],
116
137
  "tableId": [32],
117
138
  "columnsNumber": [32],
@@ -121,7 +142,7 @@ const TdsTableBodyRowExpandable$1 = /*@__PURE__*/ proxyCustomElement(class TdsTa
121
142
  "modeVariant": [32],
122
143
  "expand": [64],
123
144
  "collapse": [64]
124
- }, [[16, "internalTdsTablePropChange", "internalTdsPropChangeListener"]], {
145
+ }, [[16, "internalTdsTablePropChange", "internalTdsPropChangeListener"], [16, "tdsChange", "handleRowExpand"]], {
125
146
  "expanded": ["watchExpanded"]
126
147
  }]);
127
148
  function defineCustomElement$1() {
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
2
  import { d as defineCustomElement$2 } from './p-e4d7c655.js';
3
3
 
4
- const tableBodyRowCss = ":host(.tds-table__row){box-sizing:border-box;display:table-row;border-bottom:1px solid var(--tds-table-divider);background-color:var(--tds-table-body-row-background);transition:background-color 200ms ease;color:var(--tds-table-color)}:host(.tds-table__row) *{box-sizing:border-box}:host(.tds-table__row) .tds-table__body-cell--checkbox{min-width:48px;width:48px;padding:0}:host(.tds-table__row:hover){background-color:var(--tds-table-body-row-background-hover)}:host(.tds-table__row--selected){background-color:var(--tds-table-body-row-background-selected)}:host(.tds-table__row--selected:hover){background-color:var(--tds-table-body-row-background-selected-hover)}:host(.tds-table__row--hidden){display:none}:host(.tds-table__row--expended){width:100%;background-color:pink}:host .tds-form-label--table{width:100%;height:48px;display:flex;justify-content:center;align-items:center;cursor:pointer}:host(.tds-table__compact) .tds-form-label--table{height:32px}:host(.tds-table--divider) .tds-table__body-cell--checkbox{border-right:1px solid var(--tds-table-divider)}";
4
+ const tableBodyRowCss = ":host(.tds-table__row){box-sizing:border-box;display:table-row;border-bottom:1px solid var(--tds-table-divider);background-color:var(--tds-table-body-row-background);transition:background-color 200ms ease;color:var(--tds-table-color)}:host(.tds-table__row) *{box-sizing:border-box}:host(.tds-table__row) .tds-table__body-cell--checkbox{min-width:48px;width:48px;padding:0}:host(.tds-table__row:hover){background-color:var(--tds-table-body-row-background-hover)}:host(.tds-table__row--selected){background-color:var(--tds-table-body-row-background-selected)}:host(.tds-table__row--selected:hover){background-color:var(--tds-table-body-row-background-selected-hover)}:host(.tds-table__row--hidden){display:none}:host(.tds-table__row--expended){width:100%;background-color:pink}:host .tds-form-label--table{width:100%;height:48px;display:flex;justify-content:center;align-items:center;cursor:pointer}:host(.tds-table__compact) .tds-form-label--table{height:32px}:host(.tds-table--divider) .tds-table__body-cell--checkbox{border-right:1px solid var(--tds-table-divider)}:host(.tds-table__row--clickable){cursor:pointer}:host(.tds-table__row--clickable:focus-visible){outline:var(--focus-outline, 2px solid blue)}";
5
5
  const TdsTableBodyRowStyle0 = tableBodyRowCss;
6
6
 
7
7
  const relevantTableProps = [
@@ -15,8 +15,10 @@ const TdsTableBodyRow$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBodyRow
15
15
  this.__registerHost();
16
16
  this.__attachShadow();
17
17
  this.tdsSelect = createEvent(this, "tdsSelect", 6);
18
+ this.tdsClick = createEvent(this, "tdsClick", 6);
18
19
  this.selected = false;
19
20
  this.disabled = false;
21
+ this.clickable = false;
20
22
  this.multiselect = false;
21
23
  this.mainCheckBoxStatus = false;
22
24
  this.verticalDividers = false;
@@ -32,6 +34,22 @@ const TdsTableBodyRow$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBodyRow
32
34
  selectedRows: await this.tableEl.getSelectedRows(),
33
35
  });
34
36
  }
37
+ handleRowClick(e) {
38
+ if (!this.clickable)
39
+ return;
40
+ let rowIndex = Array.from(this.host.parentElement.children).indexOf(this.host);
41
+ this.tdsClick.emit({
42
+ event: e,
43
+ tableId: this.tableId,
44
+ rowIndex: rowIndex,
45
+ });
46
+ }
47
+ handleKeyDown(e) {
48
+ if (this.clickable && (e.key === 'Enter' || e.key === ' ')) {
49
+ e.preventDefault();
50
+ this.handleRowClick(e);
51
+ }
52
+ }
35
53
  internalTdsPropChangeListener(event) {
36
54
  if (this.tableId === event.detail.tableId) {
37
55
  event.detail.changed
@@ -54,18 +72,20 @@ const TdsTableBodyRow$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBodyRow
54
72
  });
55
73
  }
56
74
  render() {
57
- return (h(Host, { key: '2b99a5336354cb5e7e2e7ef9c81bac76a55c6895', class: {
75
+ return (h(Host, { key: '47571b7325bea2c32791792aee4813ce4364e8eb', tabindex: this.clickable ? '0' : null, class: {
58
76
  'tds-table__row': true,
59
77
  'tds-table__row--selected': this.selected,
60
78
  'tds-table__compact': this.compactDesign,
61
79
  'tds-table--divider': this.verticalDividers,
62
- } }, this.multiselect && (h("td", { key: '049e91ea474a539b6fbe344db4aed9de42297f3d', class: "tds-table__body-cell tds-table__body-cell--checkbox tds-form-label tds-form-label--table" }, h("tds-checkbox", { key: '2af9307e3143db71cae028c1cc2116382b20f4c9', onTdsChange: (event) => this.handleCheckboxChange(event), checked: this.selected, disabled: this.disabled }))), h("slot", { key: '2eff0d398eb53934ca0b152d25422a5febbbffbb' })));
80
+ 'tds-table__row--clickable': this.clickable,
81
+ }, onClick: (e) => this.handleRowClick(e), onKeyDown: (e) => this.handleKeyDown(e) }, this.multiselect && (h("td", { key: 'ad8bb61ead16afe42e6100dc4fe842c058556a20', class: "tds-table__body-cell tds-table__body-cell--checkbox tds-form-label tds-form-label--table" }, h("tds-checkbox", { key: '37844a08f73175f234168a016a9527d01ad2209e', onTdsChange: (event) => this.handleCheckboxChange(event), checked: this.selected, disabled: this.disabled }))), h("slot", { key: 'e7beb86f278f2476f23c365197addd4f22ce2a69' })));
63
82
  }
64
83
  get host() { return this; }
65
84
  static get style() { return TdsTableBodyRowStyle0; }
66
85
  }, [1, "tds-table-body-row", {
67
86
  "selected": [516],
68
87
  "disabled": [516],
88
+ "clickable": [516],
69
89
  "multiselect": [32],
70
90
  "mainCheckBoxStatus": [32],
71
91
  "verticalDividers": [32],