@scania/tegel 1.26.0 → 1.27.0-allow-numbers-and-zero-values-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 (182) hide show
  1. package/dist/cjs/index-ca8040ad.js +4 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/tds-banner.cjs.entry.js +1 -1
  4. package/dist/cjs/tds-checkbox.cjs.entry.js +10 -3
  5. package/dist/cjs/tds-chip.cjs.entry.js +7 -2
  6. package/dist/cjs/tds-dropdown_2.cjs.entry.js +74 -45
  7. package/dist/cjs/tds-folder-tab.cjs.entry.js +21 -2
  8. package/dist/cjs/tds-folder-tabs.cjs.entry.js +4 -2
  9. package/dist/cjs/tds-icon.cjs.entry.js +1 -1
  10. package/dist/cjs/tds-inline-tab.cjs.entry.js +21 -2
  11. package/dist/cjs/tds-inline-tabs.cjs.entry.js +4 -2
  12. package/dist/cjs/tds-link.cjs.entry.js +17 -3
  13. package/dist/cjs/tds-message.cjs.entry.js +15 -3
  14. package/dist/cjs/tds-modal.cjs.entry.js +74 -2
  15. package/dist/cjs/tds-navigation-tab.cjs.entry.js +21 -2
  16. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +6 -4
  17. package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
  18. package/dist/cjs/tds-text-field.cjs.entry.js +13 -7
  19. package/dist/cjs/tds-textarea.cjs.entry.js +21 -9
  20. package/dist/cjs/tds-toast.cjs.entry.js +4 -4
  21. package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
  22. package/dist/cjs/tds-tooltip.cjs.entry.js +14 -4
  23. package/dist/cjs/tegel.cjs.js +1 -1
  24. package/dist/collection/components/banner/banner.css +1 -1
  25. package/dist/collection/components/banner/banner.js +1 -1
  26. package/dist/collection/components/checkbox/checkbox.js +44 -3
  27. package/dist/collection/components/chip/chip.js +24 -2
  28. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +2 -2
  29. package/dist/collection/components/dropdown/dropdown.js +89 -43
  30. package/dist/collection/components/icon/icon.js +1 -1
  31. package/dist/collection/components/icon/iconsArray.js +96 -1
  32. package/dist/collection/components/link/link.js +17 -3
  33. package/dist/collection/components/message/message.css +44 -26
  34. package/dist/collection/components/message/message.js +49 -2
  35. package/dist/collection/components/modal/modal.js +103 -3
  36. package/dist/collection/components/popover-core/tds-popover-core.css +596 -53
  37. package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +21 -2
  38. package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +40 -2
  39. package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +21 -2
  40. package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +40 -2
  41. package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +21 -2
  42. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +42 -4
  43. package/dist/collection/components/text-field/text-field.js +31 -8
  44. package/dist/collection/components/textarea/textarea.css +11 -6
  45. package/dist/collection/components/textarea/textarea.js +38 -8
  46. package/dist/collection/components/toast/toast.css +1 -1
  47. package/dist/collection/components/toast/toast.js +3 -3
  48. package/dist/collection/components/toggle/toggle.js +2 -2
  49. package/dist/collection/components/tooltip/tooltip.js +40 -4
  50. package/dist/collection/utils/axeHelpers.js +1 -1
  51. package/dist/components/{p-c65351ab.js → p-14ab9663.js} +12 -3
  52. package/dist/components/p-17338bcb.js +115 -0
  53. package/dist/components/{p-2a43e410.js → p-2d93a742.js} +5 -5
  54. package/dist/components/p-4487c541.js +65 -0
  55. package/dist/components/{p-29d19dc8.js → p-60ff84f2.js} +1 -1
  56. package/dist/components/{p-a64dc22e.js → p-797c8dce.js} +75 -45
  57. package/dist/components/{p-4c1e3344.js → p-83db8b35.js} +1 -1
  58. package/dist/components/{p-b1d21573.js → p-a1181b1f.js} +1 -1
  59. package/dist/components/p-e71e3b2e.js +2052 -0
  60. package/dist/components/tds-accordion-item.js +1 -1
  61. package/dist/components/tds-banner.js +2 -2
  62. package/dist/components/tds-checkbox.js +1 -1
  63. package/dist/components/tds-chip.js +9 -3
  64. package/dist/components/tds-datetime.js +1 -1
  65. package/dist/components/tds-dropdown-option.js +1 -1
  66. package/dist/components/tds-dropdown.js +1 -1
  67. package/dist/components/tds-folder-tab.js +21 -2
  68. package/dist/components/tds-folder-tabs.js +7 -3
  69. package/dist/components/tds-footer-group.js +1 -1
  70. package/dist/components/tds-header-cell.js +1 -1
  71. package/dist/components/tds-header-dropdown.js +3 -3
  72. package/dist/components/tds-header-hamburger.js +1 -1
  73. package/dist/components/tds-header-launcher-button.js +1 -1
  74. package/dist/components/tds-header-launcher.js +4 -4
  75. package/dist/components/tds-icon.js +1 -1
  76. package/dist/components/tds-inline-tab.js +21 -2
  77. package/dist/components/tds-inline-tabs.js +7 -3
  78. package/dist/components/tds-link.js +17 -3
  79. package/dist/components/tds-message.js +19 -5
  80. package/dist/components/tds-modal.js +78 -4
  81. package/dist/components/tds-navigation-tab.js +21 -2
  82. package/dist/components/tds-navigation-tabs.js +9 -5
  83. package/dist/components/tds-popover-canvas.js +1 -1
  84. package/dist/components/tds-popover-core.js +1 -1
  85. package/dist/components/tds-popover-menu.js +1 -1
  86. package/dist/components/tds-side-menu-close-button.js +1 -1
  87. package/dist/components/tds-side-menu-dropdown.js +1 -1
  88. package/dist/components/tds-slider.js +1 -1
  89. package/dist/components/tds-step.js +1 -1
  90. package/dist/components/tds-table-body-input-wrapper.js +1 -1
  91. package/dist/components/tds-table-body-row.js +1 -1
  92. package/dist/components/tds-table-footer.js +4 -4
  93. package/dist/components/tds-table-header-input-wrapper.js +1 -1
  94. package/dist/components/tds-table-header.js +1 -1
  95. package/dist/components/tds-table-toolbar.js +1 -1
  96. package/dist/components/tds-text-field.js +15 -8
  97. package/dist/components/tds-textarea.js +36 -11
  98. package/dist/components/tds-toast.js +5 -5
  99. package/dist/components/tds-toggle.js +2 -2
  100. package/dist/components/tds-tooltip.js +1 -102
  101. package/dist/esm/index-51d04e39.js +4 -4
  102. package/dist/esm/loader.js +1 -1
  103. package/dist/esm/tds-banner.entry.js +1 -1
  104. package/dist/esm/tds-checkbox.entry.js +10 -3
  105. package/dist/esm/tds-chip.entry.js +7 -2
  106. package/dist/esm/tds-dropdown_2.entry.js +74 -45
  107. package/dist/esm/tds-folder-tab.entry.js +22 -3
  108. package/dist/esm/tds-folder-tabs.entry.js +4 -2
  109. package/dist/esm/tds-icon.entry.js +1 -1
  110. package/dist/esm/tds-inline-tab.entry.js +22 -3
  111. package/dist/esm/tds-inline-tabs.entry.js +4 -2
  112. package/dist/esm/tds-link.entry.js +17 -3
  113. package/dist/esm/tds-message.entry.js +15 -3
  114. package/dist/esm/tds-modal.entry.js +74 -2
  115. package/dist/esm/tds-navigation-tab.entry.js +22 -3
  116. package/dist/esm/tds-navigation-tabs.entry.js +6 -4
  117. package/dist/esm/tds-popover-core.entry.js +1 -1
  118. package/dist/esm/tds-text-field.entry.js +13 -7
  119. package/dist/esm/tds-textarea.entry.js +21 -9
  120. package/dist/esm/tds-toast.entry.js +4 -4
  121. package/dist/esm/tds-toggle.entry.js +2 -2
  122. package/dist/esm/tds-tooltip.entry.js +14 -4
  123. package/dist/esm/tegel.js +1 -1
  124. package/dist/tegel/p-0f2c9507.entry.js +1 -0
  125. package/dist/tegel/p-125a6b06.entry.js +1 -0
  126. package/dist/tegel/p-28517288.entry.js +1 -0
  127. package/dist/tegel/p-2af57972.entry.js +1 -0
  128. package/dist/tegel/p-3e9ca19a.entry.js +1 -0
  129. package/dist/tegel/{p-be1d1345.entry.js → p-4465f687.entry.js} +1 -1
  130. package/dist/tegel/p-668b7662.entry.js +1 -0
  131. package/dist/tegel/{p-4e298888.entry.js → p-66f394a2.entry.js} +1 -1
  132. package/dist/tegel/p-754a4921.entry.js +1 -0
  133. package/dist/tegel/{p-46205cfb.entry.js → p-769d0503.entry.js} +1 -1
  134. package/dist/tegel/p-843413ba.entry.js +1 -0
  135. package/dist/tegel/p-97f10223.entry.js +1 -0
  136. package/dist/tegel/p-a21250b8.entry.js +1 -0
  137. package/dist/tegel/p-aadb2553.entry.js +1 -0
  138. package/dist/tegel/p-b08886e3.entry.js +1 -0
  139. package/dist/tegel/p-b114ec3d.entry.js +1 -0
  140. package/dist/tegel/p-c3607f10.entry.js +1 -0
  141. package/dist/tegel/p-ddda64eb.entry.js +1 -0
  142. package/dist/tegel/p-eaa279dd.entry.js +1 -0
  143. package/dist/tegel/p-ee960089.entry.js +1 -0
  144. package/dist/tegel/tegel.css +13 -3
  145. package/dist/tegel/tegel.esm.js +1 -1
  146. package/dist/types/components/checkbox/checkbox.d.ts +5 -0
  147. package/dist/types/components/chip/chip.d.ts +3 -0
  148. package/dist/types/components/dropdown/dropdown.d.ts +5 -0
  149. package/dist/types/components/message/message.d.ts +5 -0
  150. package/dist/types/components/modal/modal.d.ts +6 -0
  151. package/dist/types/components/tabs/folder-tabs/folder-tab/folder-tab.d.ts +2 -0
  152. package/dist/types/components/tabs/folder-tabs/folder-tabs.d.ts +4 -0
  153. package/dist/types/components/tabs/inline-tabs/inline-tab/inline-tab.d.ts +2 -0
  154. package/dist/types/components/tabs/inline-tabs/inline-tabs.d.ts +4 -0
  155. package/dist/types/components/tabs/navigation-tabs/navigation-tab/navigation-tab.d.ts +2 -0
  156. package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +4 -0
  157. package/dist/types/components/text-field/text-field.d.ts +4 -1
  158. package/dist/types/components/textarea/textarea.d.ts +7 -4
  159. package/dist/types/components/tooltip/tooltip.d.ts +3 -0
  160. package/dist/types/components.d.ts +130 -2
  161. package/dist/types/types/Icons.d.ts +1 -1
  162. package/dist/types/utils/axeHelpers.d.ts +1 -2
  163. package/package.json +1 -1
  164. package/dist/components/p-4764a1d5.js +0 -2052
  165. package/dist/components/p-a2b7bdef.js +0 -65
  166. package/dist/tegel/p-065d6f83.entry.js +0 -1
  167. package/dist/tegel/p-0c1e632d.entry.js +0 -1
  168. package/dist/tegel/p-168122a7.entry.js +0 -1
  169. package/dist/tegel/p-19eb4ae1.entry.js +0 -1
  170. package/dist/tegel/p-4e33cbda.entry.js +0 -1
  171. package/dist/tegel/p-4ee344e5.entry.js +0 -1
  172. package/dist/tegel/p-64c80f14.entry.js +0 -1
  173. package/dist/tegel/p-72fd0083.entry.js +0 -1
  174. package/dist/tegel/p-93a4bd11.entry.js +0 -1
  175. package/dist/tegel/p-9e0b31a1.entry.js +0 -1
  176. package/dist/tegel/p-a0fc0cc2.entry.js +0 -1
  177. package/dist/tegel/p-b35e7208.entry.js +0 -1
  178. package/dist/tegel/p-b6526302.entry.js +0 -1
  179. package/dist/tegel/p-b686f1ad.entry.js +0 -1
  180. package/dist/tegel/p-cca85da0.entry.js +0 -1
  181. package/dist/tegel/p-d0abf078.entry.js +0 -1
  182. package/dist/tegel/p-dcbc35af.entry.js +0 -1
@@ -89,16 +89,15 @@ const TdsDropdown = class {
89
89
  const defaultValues = this.multiselect
90
90
  ? this.internalDefaultValue.split(',')
91
91
  : [this.internalDefaultValue];
92
- this.updateDropdownState(defaultValues);
92
+ this.updateDropdownStateInternal(defaultValues);
93
93
  }
94
94
  };
95
95
  this.getChildren = () => {
96
96
  const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
97
97
  if (tdsDropdownOptions.length === 0) {
98
- console.warn('TDS DROPDOWN: Data missing. Disregard if loading data asynchronously.');
98
+ console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
99
99
  }
100
- else
101
- return tdsDropdownOptions;
100
+ return tdsDropdownOptions;
102
101
  };
103
102
  this.getSelectedChildren = () => {
104
103
  if (this.selectedOptions.length === 0)
@@ -106,7 +105,7 @@ const TdsDropdown = class {
106
105
  return this.selectedOptions
107
106
  .map((stringValue) => {
108
107
  var _a;
109
- const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => element.value === stringValue);
108
+ const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => convertToString(element.value) === convertToString(stringValue));
110
109
  return matchingElement;
111
110
  })
112
111
  .filter(Boolean);
@@ -225,6 +224,7 @@ const TdsDropdown = class {
225
224
  this.noResultText = 'No result';
226
225
  this.defaultValue = undefined;
227
226
  this.value = null;
227
+ this.tdsAriaLabel = undefined;
228
228
  this.open = false;
229
229
  this.internalValue = undefined;
230
230
  this.filterResult = undefined;
@@ -237,50 +237,69 @@ const TdsDropdown = class {
237
237
  const normalizedValue = this.normalizeValue(newValue);
238
238
  // Only update if actually changed
239
239
  if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
240
- this.updateDropdownState(normalizedValue);
240
+ this.updateDropdownStateFromUser(normalizedValue);
241
241
  }
242
242
  }
243
243
  normalizeValue(value) {
244
- if (!value || value === '')
245
- return []; // Handle both null and empty string
246
- // For multiselect, keep array. For single select, wrap in array
247
- if (this.multiselect) {
244
+ if (value === null || value === undefined || value === '')
245
+ return [];
246
+ // For single select, ensure we handle both string and array inputs
247
+ if (!this.multiselect) {
248
+ // If array is passed to single select, take first value
248
249
  if (Array.isArray(value)) {
249
- return convertArrayToStrings(value);
250
+ return [convertToString(value[0])];
250
251
  }
251
- return value
252
- .toString()
253
- .split(',')
254
- .filter((v) => v !== '');
252
+ return [convertToString(value)];
253
+ }
254
+ // For multiselect
255
+ if (Array.isArray(value)) {
256
+ return convertArrayToStrings(value);
255
257
  }
256
- // Single select - convert to string array
257
- return Array.isArray(value) ? convertArrayToStrings(value) : [convertToString(value)];
258
+ // Handle comma-separated string for multiselect
259
+ return value
260
+ .toString()
261
+ .split(',')
262
+ .filter((v) => v !== '');
258
263
  }
259
264
  hasValueChanged(newValue, currentValue) {
260
265
  if (newValue.length !== currentValue.length)
261
266
  return true;
262
267
  return newValue.some((val) => !currentValue.includes(val));
263
268
  }
264
- updateDropdownState(values) {
269
+ updateDropdownStateInternal(values) {
270
+ this.updateDropdownState(values, false);
271
+ }
272
+ updateDropdownStateFromUser(values) {
273
+ this.updateDropdownState(values, true);
274
+ }
275
+ updateDropdownState(values, emitChange = true) {
276
+ // Validate the values first
277
+ const validValues = this.validateValues(values);
265
278
  // Update internal state
266
- this.selectedOptions = [...this.validateValues(values)]; // Force new array reference
267
- // Then update the value prop to match
279
+ this.selectedOptions = [...validValues];
280
+ // Update the value prop
268
281
  this.value = this.multiselect ? this.selectedOptions : this.selectedOptions[0] || null;
269
- // Force update of internal value
282
+ // Update internal value for display
270
283
  this.internalValue = this.getValue();
271
284
  // Update DOM
272
285
  this.updateOptionElements();
273
286
  // Update display value
274
287
  this.updateDisplayValue();
275
- // Emit change event
276
- this.emitChange();
288
+ // Emit change event only if value has changed by user
289
+ if (emitChange)
290
+ this.emitChange();
277
291
  // Update value attribute
278
292
  this.setValueAttribute();
279
293
  }
280
294
  validateValues(values) {
295
+ // Make sure we have children before validation
296
+ const children = this.getChildren();
297
+ if (!children || children.length === 0) {
298
+ console.warn('No dropdown options found');
299
+ return values; // Return original values if no children yet
300
+ }
281
301
  return values.filter((val) => {
282
- var _a;
283
- const isValid = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.some((element) => element.value === val);
302
+ const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
284
303
  if (!isValid) {
285
304
  console.warn(`Option with value "${val}" does not exist`);
286
305
  }
@@ -317,18 +336,18 @@ const TdsDropdown = class {
317
336
  else {
318
337
  normalizedValue = [convertToString(value)];
319
338
  }
320
- this.updateDropdownState(normalizedValue);
339
+ this.updateDropdownStateFromUser(normalizedValue);
321
340
  return this.getSelectedChildren().map((element) => ({
322
341
  value: element.value,
323
342
  label: element.textContent.trim(),
324
343
  }));
325
344
  }
326
345
  async reset() {
327
- this.updateDropdownState([]);
346
+ this.updateDropdownStateFromUser([]);
328
347
  }
329
348
  async removeValue(oldValue) {
330
349
  const newValues = this.selectedOptions.filter((v) => v !== oldValue);
331
- this.updateDropdownState(newValues);
350
+ this.updateDropdownStateFromUser(newValues);
332
351
  }
333
352
  /** Method that forces focus on the input element. */
334
353
  async focusElement() {
@@ -406,13 +425,19 @@ const TdsDropdown = class {
406
425
  }
407
426
  }
408
427
  componentWillLoad() {
409
- if (this.defaultValue && !this.value) {
410
- // Convert defaultValue to string before splitting
428
+ // First handle the value prop if it exists
429
+ if (this.value !== null && this.value !== undefined) {
430
+ const normalizedValue = this.normalizeValue(this.value);
431
+ this.updateDropdownStateInternal(normalizedValue);
432
+ return; // Exit early if we handled the value prop
433
+ }
434
+ // Only use defaultValue if no value prop was provided
435
+ if (this.defaultValue !== null && this.defaultValue !== undefined) {
411
436
  const defaultValueStr = convertToString(this.defaultValue);
412
437
  const initialValue = this.multiselect
413
438
  ? defaultValueStr.split(',').map(convertToString)
414
- : [convertToString(this.defaultValue)];
415
- this.updateDropdownState(initialValue);
439
+ : [defaultValueStr];
440
+ this.updateDropdownStateInternal(initialValue);
416
441
  }
417
442
  }
418
443
  /** Method to handle slot changes */
@@ -428,10 +453,10 @@ const TdsDropdown = class {
428
453
  */
429
454
  async appendValue(value) {
430
455
  if (this.multiselect) {
431
- this.updateDropdownState([...this.selectedOptions, value]);
456
+ this.updateDropdownStateFromUser([...this.selectedOptions, value]);
432
457
  }
433
458
  else {
434
- this.updateDropdownState([value]);
459
+ this.updateDropdownStateFromUser([value]);
435
460
  }
436
461
  }
437
462
  componentDidRender() {
@@ -446,11 +471,16 @@ const TdsDropdown = class {
446
471
  form.removeEventListener('reset', this.resetInput);
447
472
  }
448
473
  }
474
+ connectedCallback() {
475
+ if (!this.tdsAriaLabel) {
476
+ console.warn('Tegel Dropdown component: tdsAriaLabel prop is missing');
477
+ }
478
+ }
449
479
  render() {
450
480
  appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
451
- return (h(Host, { key: '490d34545b3a09c3b4342fa09d38f6bf9c782498', role: "select", class: {
481
+ return (h(Host, { key: 'b8c418ebe609789c1610178d764a7d620e2231c2', class: {
452
482
  [`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
453
- } }, this.label && this.labelPosition === 'outside' && (h("div", { key: '7eb96c0134032654df98a3b68ffb692a2cd91d2b', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '439fddb188ad65239e9d5451a82ab3bbe8f47fb7', class: {
483
+ } }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ee5c005d5020e2226ce54c93a90f2098e081a6df', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'ca674a2361f1301886bb855b7093c67b999a500a', class: {
454
484
  'dropdown-select': true,
455
485
  [this.size]: true,
456
486
  'disabled': this.disabled,
@@ -463,7 +493,7 @@ const TdsDropdown = class {
463
493
  label-inside-as-placeholder
464
494
  ${this.size}
465
495
  ${this.selectedOptions.length ? 'selected' : ''}
466
- ` }, this.label)), h("input", {
496
+ ` }, this.label)), h("input", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled,
467
497
  // eslint-disable-next-line no-return-assign
468
498
  ref: (inputEl) => (this.inputElement = inputEl), class: {
469
499
  placeholder: this.labelPosition === 'inside',
@@ -477,8 +507,7 @@ const TdsDropdown = class {
477
507
  if (event.key === 'Escape') {
478
508
  this.open = false;
479
509
  }
480
- }
481
- })), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
510
+ } })), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
482
511
  if (event.key === 'Enter') {
483
512
  this.handleFilterReset();
484
513
  }
@@ -489,7 +518,7 @@ const TdsDropdown = class {
489
518
  if (event.key === 'Enter') {
490
519
  this.handleToggleOpen();
491
520
  }
492
- }, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
521
+ }, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled, onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
493
522
  if (event.key === 'Escape') {
494
523
  this.open = false;
495
524
  }
@@ -501,7 +530,7 @@ const TdsDropdown = class {
501
530
  label-inside-as-placeholder
502
531
  ${this.size}
503
532
  ${this.selectedOptions.length ? 'selected' : ''}
504
- ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.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: 'd6381f78466994f05415cf8981b3cedaaf4df6a9', ref: (element) => {
533
+ ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.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: '14558013e5903958942dc7dd3ef2d3a49f79b245', role: "listbox", "aria-label": this.tdsAriaLabel, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
505
534
  this.dropdownList = element;
506
535
  }, class: {
507
536
  'dropdown-list': true,
@@ -512,11 +541,11 @@ const TdsDropdown = class {
512
541
  'closed': !this.open,
513
542
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
514
543
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
515
- } }, h("slot", { key: 'c36a9cb5398a7d290f11576431982e869986e4a0', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '5ec07552d105f8a4addc46da0172f67cf9233817', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'b3e240c31060f2d2bce6e3647f903f9ff1250ed5', class: {
544
+ } }, h("slot", { key: '5f69c2fcb5b6a130888d7cd92d4cb882122e3e58', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'bae7a62960f90cd7b679ac4956a677dbff378ac7', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'be5fe56a1e19e812fa983c22f130c0d3001da55b', class: {
516
545
  helper: true,
517
546
  error: this.error,
518
547
  disabled: this.disabled,
519
- } }, this.error && h("tds-icon", { key: 'c0eb10dfeaa5236f5ac02dabf44329e85d52dcda', name: "error", size: "16px" }), this.helper))));
548
+ } }, this.error && h("tds-icon", { key: 'c0ccc491caa1aca628aff12e02d8a917a74e9c86', name: "error", size: "16px" }), this.helper))));
520
549
  }
521
550
  get host() { return getElement(this); }
522
551
  static get watchers() { return {
@@ -611,7 +640,7 @@ const TdsDropdownOption = class {
611
640
  this.internalValue = convertToString(this.value);
612
641
  }
613
642
  render() {
614
- return (h(Host, { key: 'af1229553e89c02aca1d7c11bbc80acd25ce44b5', role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected }, h("div", { key: 'c93eb33d1864028690ab981c0f676f03993265c4', class: `dropdown-option
643
+ return (h(Host, { key: 'f471d5238869b3a522b36d99d7549c1229cd83a2' }, h("div", { key: 'da9edccba96999b0ee40f8c599325774593de814', class: `dropdown-option
615
644
  ${this.size}
616
645
  ${this.selected ? 'selected' : ''}
617
646
  ${this.disabled ? 'disabled' : ''}
@@ -623,7 +652,7 @@ const TdsDropdownOption = class {
623
652
  this.handleMultiselect(event);
624
653
  }, disabled: this.disabled, checked: this.selected, class: {
625
654
  [this.size]: true,
626
- } }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { onClick: () => {
655
+ } }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, onClick: () => {
627
656
  this.handleSingleSelect();
628
657
  }, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), disabled: this.disabled, class: this.size }, h("div", { class: "single-select" }, h("slot", null), this.selected && h("tds-icon", { name: "tick", size: "16px" })))))));
629
658
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-51d04e39.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-51d04e39.js';
2
2
 
3
3
  const folderTabCss = ":host{box-sizing:border-box;position:relative}:host *{box-sizing:border-box}:host ::slotted(*){all:unset;min-width:142px;display:block;width:calc(100% - 32px);font:var(--tds-headline-07) !important;letter-spacing:var(--tds-headline-07-ls) !important;cursor:pointer;padding:16px;white-space:nowrap;text-decoration:none;text-align:left;outline:none;border:none;border-left:1px solid;border-left-color:transparent}:host ::slotted(*:focus-visible){outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host div:not(.selected){background-color:var(--tds-folder-tab-background)}:host div:not(.selected) ::slotted(*){border-left-color:var(--tds-folder-tab-divider-color);border-top:2px solid var(--tds-folder-tab-background);color:var(--tds-folder-tab-item-color)}:host div:not(.selected):hover:not(.disabled){background-color:var(--tds-folder-tab-background-hover);cursor:pointer}:host div:not(.selected):hover:not(.disabled) ::slotted(*){border-top-color:var(--tds-folder-tab-background-hover);color:var(--tds-folder-tab-color)}:host div:not(.selected).disabled ::slotted(*){color:var(--tds-folder-tab-item-color-disabled)}:host div:not(.selected).disabled ::slotted(*:focus-visible){outline:none}:host div:not(.selected).disabled ::slotted(*:hover){cursor:not-allowed}:host div:not(.selected).disabled ::slotted(*::after){content:none}:host .selected{background-color:var(--tds-folder-tab-background-selected);border-top:2px solid var(--tds-folder-tab-border-selected)}:host .selected::after{content:\" \";background-color:var(--tds-folder-tab-background-selected);width:1px;top:0;bottom:0;right:-1px;display:block;position:absolute;z-index:1}:host .selected ::slotted(*){color:var(--tds-folder-tab-color)}:host(.first) :not(.selected) ::slotted(*){border-left-color:transparent}";
4
4
  const TdsFolderTabStyle0 = folderTabCss;
@@ -18,12 +18,31 @@ const TdsFolderTab = class {
18
18
  async setSelected(selected) {
19
19
  this.selected = selected;
20
20
  }
21
+ connectedCallback() {
22
+ const elements = this.host.querySelectorAll('button, a');
23
+ for (let index = 0; index < elements.length; index++) {
24
+ const element = elements[index];
25
+ if (!element.getAttribute('aria-controls')) {
26
+ console.warn('Tegel folder-tab component: Interactive elements should have aria-controls attribute to link the tab to its corresponding panel');
27
+ }
28
+ if (element.getAttribute('role') !== 'tab') {
29
+ console.warn('Tegel folder-tab component: Interactive elements should have attribute role="tab"');
30
+ }
31
+ if (this.disabled) {
32
+ element.setAttribute('aria-disabled', 'true');
33
+ }
34
+ else {
35
+ element.removeAttribute('aria-disabled');
36
+ }
37
+ }
38
+ }
21
39
  render() {
22
- return (h(Host, { key: '919cd453da1e3649fb5da8783ab8fabc47322d47', role: "listitem" }, h("div", { key: 'f00bf3eea1ee0d670d8989e23e27d6c54fbe7c17', class: {
40
+ return (h(Host, { key: '9290c4ab2f7d051bba9fec4dad9a7d07790ed5b7', "aria-selected": this.selected }, h("div", { key: '36225101c510f2d77282fd600c4ee00085791109', class: {
23
41
  selected: this.selected,
24
42
  disabled: this.disabled,
25
- }, style: { width: `${this.tabWidth}px` } }, h("slot", { key: '3e3bd62fd02c922fa0592dc0f2dae5a8b49d6c4c' }))));
43
+ }, style: { width: `${this.tabWidth}px` } }, h("slot", { key: '05954c498b9fbd6a2a1231d84bf2657a0616db36' }))));
26
44
  }
45
+ get host() { return getElement(this); }
27
46
  };
28
47
  TdsFolderTab.style = TdsFolderTabStyle0;
29
48
 
@@ -63,6 +63,8 @@ const TdsFolderTabs = class {
63
63
  this.modeVariant = null;
64
64
  this.defaultSelectedIndex = 0;
65
65
  this.selectedIndex = undefined;
66
+ this.tdsScrollLeftAriaLabel = 'Scroll left';
67
+ this.tdsScrollRightAriaLabel = 'Scroll right';
66
68
  this.buttonWidth = 0;
67
69
  this.showLeftScroll = false;
68
70
  this.showRightScroll = false;
@@ -163,9 +165,9 @@ const TdsFolderTabs = class {
163
165
  this.removeEventListenerFromTabs();
164
166
  }
165
167
  render() {
166
- return (h(Host, { key: '19b773750f13304194341caf79242c7be95b41be', role: "list", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { key: '915b525f1d8fc67f3edf82f0841ea89cfd8424bc', class: "wrapper", ref: (el) => {
168
+ return (h(Host, { key: '54a3cceed49387a8f0dbe74eecb96ae284882ff9', role: "tablist", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { key: '170e5256bde8efdce412bbab1a674b23159d02d1', class: "wrapper", ref: (el) => {
167
169
  this.navWrapperElement = el;
168
- } }, h("button", { key: '806f5ce973b4b9bf842ae4c3fdf42c6160255db4', class: `scroll-left-button ${this.showLeftScroll ? 'show' : ''}`, disabled: !this.showLeftScroll, onClick: () => this.scrollLeft() }, h("tds-icon", { key: '4762c8fcfb5f7bb9a67ce2515fc3cab557180ca8', name: "chevron_left", size: "20px" })), h("slot", { key: '498f04374cb1ad240df2a6e02830eba9bc6c3c8d', onSlotchange: () => this.handleSlotChange() }), h("button", { key: '47f114815e98c22f26b021df2b5f53f4498ba24b', class: `scroll-right-button ${this.showRightScroll ? 'show' : ''}`, disabled: !this.showRightScroll, onClick: () => this.scrollRight() }, h("tds-icon", { key: 'b4f3a0e137c84b996bdf7eb7e497e788637ac401', name: "chevron_right", size: "20px" })))));
170
+ } }, h("button", { key: '1c74ef8c81361bfa6ff5d227c145a3371fb2f66f', "aria-label": this.tdsScrollLeftAriaLabel, class: `scroll-left-button ${this.showLeftScroll ? 'show' : ''}`, disabled: !this.showLeftScroll, onClick: () => this.scrollLeft() }, h("tds-icon", { key: '94ddd85d4107c89487db727f13a9c443fd160fc6', name: "chevron_left", size: "20px" })), h("slot", { key: '63978c3c62482bc0a251377756630f555f10dfef', onSlotchange: () => this.handleSlotChange() }), h("button", { key: 'aeb86fbdb365e62df37b72daa0b53f51486834a9', "aria-label": this.tdsScrollRightAriaLabel, class: `scroll-right-button ${this.showRightScroll ? 'show' : ''}`, disabled: !this.showRightScroll, onClick: () => this.scrollRight() }, h("tds-icon", { key: '2cc4d301a4490d6b8d8f2373fc2450c93922a814', name: "chevron_right", size: "20px" })))));
169
171
  }
170
172
  get host() { return getElement(this); }
171
173
  static get watchers() { return {