@scania/tegel 1.32.2-dropdown-dynamic-updates-beta.0 → 1.32.2-dropdown-qa-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 (170) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
  3. package/dist/cjs/tds-accordion.cjs.entry.js +1 -1
  4. package/dist/cjs/tds-banner.cjs.entry.js +1 -1
  5. package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
  6. package/dist/cjs/tds-button.cjs.entry.js +1 -1
  7. package/dist/cjs/tds-chip.cjs.entry.js +1 -1
  8. package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
  9. package/dist/cjs/tds-dropdown_2.cjs.entry.js +41 -65
  10. package/dist/cjs/tds-folder-tab.cjs.entry.js +1 -1
  11. package/dist/cjs/tds-folder-tabs.cjs.entry.js +1 -1
  12. package/dist/cjs/tds-footer-group.cjs.entry.js +1 -1
  13. package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
  14. package/dist/cjs/tds-header-dropdown-list-item.cjs.entry.js +1 -1
  15. package/dist/cjs/tds-header-launcher-grid-item.cjs.entry.js +1 -1
  16. package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -1
  17. package/dist/cjs/tds-modal.cjs.entry.js +1 -1
  18. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
  19. package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
  20. package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
  21. package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +1 -1
  22. package/dist/cjs/tds-table-footer.cjs.entry.js +1 -1
  23. package/dist/cjs/tds-toast.cjs.entry.js +1 -1
  24. package/dist/cjs/tegel.cjs.js +1 -1
  25. package/dist/collection/assets/logos/traton/traton-logotype-black.png +0 -0
  26. package/dist/collection/assets/logos/traton/traton-logotype-black.svg +1 -0
  27. package/dist/collection/assets/logos/traton/traton-logotype-blue.png +0 -0
  28. package/dist/collection/assets/logos/traton/traton-logotype-blue.svg +1 -0
  29. package/dist/collection/assets/logos/traton/traton-logotype-white.png +0 -0
  30. package/dist/collection/assets/logos/traton/traton-logotype-white.svg +1 -0
  31. package/dist/collection/components/accordion/accordion-item/accordion-item.css +43 -13
  32. package/dist/collection/components/accordion/accordion.css +10 -0
  33. package/dist/collection/components/banner/banner.css +1 -0
  34. package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.css +1 -0
  35. package/dist/collection/components/button/button.css +1 -0
  36. package/dist/collection/components/chip/chip.css +1 -0
  37. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.css +5 -5
  38. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +27 -4
  39. package/dist/collection/components/dropdown/dropdown.css +24 -31
  40. package/dist/collection/components/dropdown/dropdown.js +36 -62
  41. package/dist/collection/components/footer/footer-group/footer-group.css +1 -0
  42. package/dist/collection/components/footer/footer-item/footer-item.css +3 -0
  43. package/dist/collection/components/header/header-dropdown-list-item/header-dropdown-list-item.css +1 -0
  44. package/dist/collection/components/header/header-item/header-item.css +1 -0
  45. package/dist/collection/components/header/header-launcher-grid-item/header-launcher-grid-item.css +1 -0
  46. package/dist/collection/components/modal/modal.css +1 -0
  47. package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.css +1 -0
  48. package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +1 -0
  49. package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.css +1 -0
  50. package/dist/collection/components/table/table-footer/table-footer.css +0 -14
  51. package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.css +1 -0
  52. package/dist/collection/components/tabs/folder-tabs/folder-tabs.css +1 -0
  53. package/dist/collection/components/tabs/inline-tabs/inline-tabs.css +1 -0
  54. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +1 -0
  55. package/dist/collection/components/toast/toast.css +1 -0
  56. package/dist/components/{p-92f764ad.js → p-1cd6b2c6.js} +30 -60
  57. package/dist/components/{p-90197afb.js → p-4b0c6ab5.js} +12 -5
  58. package/dist/components/{p-9388c920.js → p-6adb1ce3.js} +1 -1
  59. package/dist/components/{p-8317c073.js → p-71c3dfe9.js} +1 -1
  60. package/dist/components/{p-8f545f6b.js → p-ea381f94.js} +1 -1
  61. package/dist/components/{p-0ace60ac.js → p-f589b91c.js} +1 -1
  62. package/dist/components/tds-accordion-item.js +1 -1
  63. package/dist/components/tds-accordion.js +1 -1
  64. package/dist/components/tds-banner.js +1 -1
  65. package/dist/components/tds-breadcrumb.js +1 -1
  66. package/dist/components/tds-button.js +1 -1
  67. package/dist/components/tds-chip.js +1 -1
  68. package/dist/components/tds-dropdown-option.js +1 -1
  69. package/dist/components/tds-dropdown.js +1 -1
  70. package/dist/components/tds-folder-tab.js +1 -1
  71. package/dist/components/tds-folder-tabs.js +1 -1
  72. package/dist/components/tds-footer-group.js +1 -1
  73. package/dist/components/tds-footer-item.js +1 -1
  74. package/dist/components/tds-header-brand-symbol.js +1 -1
  75. package/dist/components/tds-header-dropdown-list-item.js +1 -1
  76. package/dist/components/tds-header-dropdown.js +1 -1
  77. package/dist/components/tds-header-hamburger.js +1 -1
  78. package/dist/components/tds-header-item.js +1 -1
  79. package/dist/components/tds-header-launcher-button.js +1 -1
  80. package/dist/components/tds-header-launcher-grid-item.js +1 -1
  81. package/dist/components/tds-header-launcher-list-item.js +1 -1
  82. package/dist/components/tds-header-launcher.js +2 -2
  83. package/dist/components/tds-inline-tabs.js +1 -1
  84. package/dist/components/tds-modal.js +1 -1
  85. package/dist/components/tds-navigation-tabs.js +1 -1
  86. package/dist/components/tds-side-menu-collapse-button.js +1 -1
  87. package/dist/components/tds-side-menu-dropdown-list-item.js +1 -1
  88. package/dist/components/tds-side-menu-dropdown.js +1 -1
  89. package/dist/components/tds-side-menu-item.js +1 -1
  90. package/dist/components/tds-table-body-row-expandable.js +1 -1
  91. package/dist/components/tds-table-footer.js +3 -3
  92. package/dist/components/tds-toast.js +1 -1
  93. package/dist/esm/loader.js +1 -1
  94. package/dist/esm/tds-accordion-item.entry.js +1 -1
  95. package/dist/esm/tds-accordion.entry.js +1 -1
  96. package/dist/esm/tds-banner.entry.js +1 -1
  97. package/dist/esm/tds-breadcrumb.entry.js +1 -1
  98. package/dist/esm/tds-button.entry.js +1 -1
  99. package/dist/esm/tds-chip.entry.js +1 -1
  100. package/dist/esm/tds-core-header-item_2.entry.js +1 -1
  101. package/dist/esm/tds-dropdown_2.entry.js +41 -65
  102. package/dist/esm/tds-folder-tab.entry.js +1 -1
  103. package/dist/esm/tds-folder-tabs.entry.js +1 -1
  104. package/dist/esm/tds-footer-group.entry.js +1 -1
  105. package/dist/esm/tds-footer-item.entry.js +1 -1
  106. package/dist/esm/tds-header-dropdown-list-item.entry.js +1 -1
  107. package/dist/esm/tds-header-launcher-grid-item.entry.js +1 -1
  108. package/dist/esm/tds-inline-tabs.entry.js +1 -1
  109. package/dist/esm/tds-modal.entry.js +1 -1
  110. package/dist/esm/tds-navigation-tabs.entry.js +1 -1
  111. package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
  112. package/dist/esm/tds-side-menu-item.entry.js +1 -1
  113. package/dist/esm/tds-table-body-row-expandable.entry.js +1 -1
  114. package/dist/esm/tds-table-footer.entry.js +1 -1
  115. package/dist/esm/tds-toast.entry.js +1 -1
  116. package/dist/esm/tegel.js +1 -1
  117. package/dist/tegel/assets/logos/traton/traton-logotype-black.png +0 -0
  118. package/dist/tegel/assets/logos/traton/traton-logotype-black.svg +1 -0
  119. package/dist/tegel/assets/logos/traton/traton-logotype-blue.png +0 -0
  120. package/dist/tegel/assets/logos/traton/traton-logotype-blue.svg +1 -0
  121. package/dist/tegel/assets/logos/traton/traton-logotype-white.png +0 -0
  122. package/dist/tegel/assets/logos/traton/traton-logotype-white.svg +1 -0
  123. package/dist/tegel/{p-80123e1f.entry.js → p-1c75f8a7.entry.js} +1 -1
  124. package/dist/tegel/p-35a88a52.entry.js +1 -0
  125. package/dist/tegel/{p-40c94144.entry.js → p-4274d329.entry.js} +1 -1
  126. package/dist/tegel/{p-73055353.entry.js → p-5020a688.entry.js} +1 -1
  127. package/dist/tegel/{p-efa84ea2.entry.js → p-5c077bb9.entry.js} +1 -1
  128. package/dist/tegel/{p-8a65fba0.entry.js → p-614bcd4b.entry.js} +1 -1
  129. package/dist/tegel/{p-d8970b35.entry.js → p-61a1dc59.entry.js} +1 -1
  130. package/dist/tegel/{p-fd6892b8.entry.js → p-6a615ac1.entry.js} +1 -1
  131. package/dist/tegel/{p-421307de.entry.js → p-6e57997e.entry.js} +1 -1
  132. package/dist/tegel/{p-83f5f98b.entry.js → p-8c841698.entry.js} +1 -1
  133. package/dist/tegel/p-942abc1e.entry.js +1 -0
  134. package/dist/tegel/{p-89f3ccf4.entry.js → p-9b2257f3.entry.js} +1 -1
  135. package/dist/tegel/{p-51b75159.entry.js → p-a0591e58.entry.js} +1 -1
  136. package/dist/tegel/{p-63bd0e61.entry.js → p-b734b309.entry.js} +1 -1
  137. package/dist/tegel/{p-4d439643.entry.js → p-bcd5e06d.entry.js} +1 -1
  138. package/dist/tegel/p-bdc913a0.entry.js +1 -0
  139. package/dist/tegel/{p-4392455a.entry.js → p-c0b26507.entry.js} +1 -1
  140. package/dist/tegel/{p-b73211ea.entry.js → p-cf7af8f2.entry.js} +1 -1
  141. package/dist/tegel/{p-5e868e17.entry.js → p-d267c18f.entry.js} +1 -1
  142. package/dist/tegel/{p-852569b2.entry.js → p-dc375d3e.entry.js} +1 -1
  143. package/dist/tegel/{p-bb4579da.entry.js → p-f2232281.entry.js} +1 -1
  144. package/dist/tegel/p-f78b6a16.entry.js +1 -0
  145. package/dist/tegel/tegel.css +4 -4
  146. package/dist/tegel/tegel.esm.js +1 -1
  147. package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +3 -0
  148. package/dist/types/components/dropdown/dropdown.d.ts +10 -12
  149. package/dist/types/components.d.ts +13 -2
  150. package/package.json +1 -1
  151. package/dist/tegel/p-2b95225a.entry.js +0 -1
  152. package/dist/tegel/p-87e8f355.entry.js +0 -1
  153. package/dist/tegel/p-cdc02f4a.entry.js +0 -1
  154. package/dist/tegel/p-de483ce4.entry.js +0 -1
  155. /package/dist/collection/assets/logos/{scania-logotype.png → scania/scania-logotype.png} +0 -0
  156. /package/dist/collection/assets/logos/{scania-logotype.svg → scania/scania-logotype.svg} +0 -0
  157. /package/dist/collection/assets/logos/{scania-symbol.png → scania/scania-symbol.png} +0 -0
  158. /package/dist/collection/assets/logos/{scania-symbol.svg → scania/scania-symbol.svg} +0 -0
  159. /package/dist/collection/assets/logos/{scania-wordmark-white.png → scania/scania-wordmark-white.png} +0 -0
  160. /package/dist/collection/assets/logos/{scania-wordmark-white.svg → scania/scania-wordmark-white.svg} +0 -0
  161. /package/dist/collection/assets/logos/{scania-wordmark.png → scania/scania-wordmark.png} +0 -0
  162. /package/dist/collection/assets/logos/{scania-wordmark.svg → scania/scania-wordmark.svg} +0 -0
  163. /package/dist/tegel/assets/logos/{scania-logotype.png → scania/scania-logotype.png} +0 -0
  164. /package/dist/tegel/assets/logos/{scania-logotype.svg → scania/scania-logotype.svg} +0 -0
  165. /package/dist/tegel/assets/logos/{scania-symbol.png → scania/scania-symbol.png} +0 -0
  166. /package/dist/tegel/assets/logos/{scania-symbol.svg → scania/scania-symbol.svg} +0 -0
  167. /package/dist/tegel/assets/logos/{scania-wordmark-white.png → scania/scania-wordmark-white.png} +0 -0
  168. /package/dist/tegel/assets/logos/{scania-wordmark-white.svg → scania/scania-wordmark-white.svg} +0 -0
  169. /package/dist/tegel/assets/logos/{scania-wordmark.png → scania/scania-wordmark.png} +0 -0
  170. /package/dist/tegel/assets/logos/{scania-wordmark.svg → scania/scania-wordmark.svg} +0 -0
@@ -4,6 +4,11 @@ import findPreviousFocusableElement from "../../utils/findPreviousFocusableEleme
4
4
  import appendHiddenInput from "../../utils/appendHiddenInput";
5
5
  import { convertToString, convertArrayToStrings } from "../../utils/convertToString";
6
6
  import generateUniqueId from "../../utils/generateUniqueId";
7
+ function hasValueChanged(newValue, currentValue) {
8
+ if (newValue.length !== currentValue.length)
9
+ return true;
10
+ return newValue.some((val) => !currentValue.includes(val));
11
+ }
7
12
  /**
8
13
  * @slot <default> - <b>Unnamed slot.</b> For dropdown option elements.
9
14
  */
@@ -172,7 +177,7 @@ export class TdsDropdown {
172
177
  // Normalize to array
173
178
  const normalizedValue = this.normalizeValue(newValue);
174
179
  // Only update if actually changed
175
- if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
180
+ if (hasValueChanged(normalizedValue, this.selectedOptions)) {
176
181
  this.updateDropdownStateFromUser(normalizedValue);
177
182
  }
178
183
  }
@@ -197,12 +202,6 @@ export class TdsDropdown {
197
202
  .split(',')
198
203
  .filter((v) => v !== '');
199
204
  }
200
- // eslint-disable-next-line class-methods-use-this
201
- hasValueChanged(newValue, currentValue) {
202
- if (newValue.length !== currentValue.length)
203
- return true;
204
- return newValue.some((val) => !currentValue.includes(val));
205
- }
206
205
  updateDropdownStateInternal(values) {
207
206
  this.updateDropdownState(values, false);
208
207
  }
@@ -265,7 +264,23 @@ export class TdsDropdown {
265
264
  value: value !== null && value !== void 0 ? value : null,
266
265
  });
267
266
  }
268
- async setValue(value) {
267
+ /** Method for setting the selected value of the Dropdown.
268
+ *
269
+ * Single selection example:
270
+ *
271
+ * <code>
272
+ * dropdown.setValue('option-1', 'Option 1');
273
+ * </code>
274
+ *
275
+ * Multiselect example:
276
+ *
277
+ * <code>
278
+ * dropdown.setValue(['option-1', 'option-2']);
279
+ * </code>
280
+ */
281
+ // @ts-expect-error for label: the label is optional here ONLY to not break the API. Should be removed for 2.0.
282
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
283
+ async setValue(value, label) {
269
284
  let normalizedValue;
270
285
  if (Array.isArray(value)) {
271
286
  normalizedValue = convertArrayToStrings(value);
@@ -302,20 +317,7 @@ export class TdsDropdown {
302
317
  // Always trigger the focus event to open the dropdown
303
318
  this.handleFocus({});
304
319
  }
305
- /** Method for setting the value of the Dropdown.
306
- *
307
- * Single selection example:
308
- *
309
- * <code>
310
- * dropdown.setValue('option-1', 'Option 1');
311
- * </code>
312
- *
313
- * Multiselect example:
314
- *
315
- * <code>
316
- * dropdown.setValue(['option-1', 'option-2']);
317
- * </code>
318
- */
320
+ /** Method for closing the Dropdown. */
319
321
  async close() {
320
322
  this.open = false;
321
323
  }
@@ -405,8 +407,6 @@ export class TdsDropdown {
405
407
  : [defaultValueStr];
406
408
  this.updateDropdownStateInternal(initialValue);
407
409
  }
408
- // Setup mutation observer to watch for text content changes
409
- this.setupMutationObserver();
410
410
  }
411
411
  /** Method to handle slot changes */
412
412
  handleSlotChange() {
@@ -436,12 +436,10 @@ export class TdsDropdown {
436
436
  this.updateDropdownListInertState();
437
437
  }
438
438
  disconnectedCallback() {
439
- var _a;
440
439
  const form = this.host.closest('form');
441
440
  if (form) {
442
441
  form.removeEventListener('reset', this.resetInput);
443
442
  }
444
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
445
443
  }
446
444
  connectedCallback() {
447
445
  if (!this.tdsAriaLabel) {
@@ -458,42 +456,14 @@ export class TdsDropdown {
458
456
  }
459
457
  }
460
458
  }
461
- setupMutationObserver() {
462
- this.mutationObserver = new MutationObserver((mutations) => {
463
- let shouldUpdate = false;
464
- mutations.forEach((mutation) => {
465
- var _a;
466
- if (mutation.type === 'characterData' || mutation.type === 'childList') {
467
- // Check if the mutation affects any of our dropdown options
468
- const target = mutation.target;
469
- const optionElement = target.nodeType === Node.TEXT_NODE
470
- ? (_a = target.parentElement) === null || _a === void 0 ? void 0 : _a.closest('tds-dropdown-option')
471
- : target === null || target === void 0 ? void 0 : target.closest('tds-dropdown-option');
472
- if (optionElement &&
473
- this.getChildren().includes(optionElement)) {
474
- shouldUpdate = true;
475
- }
476
- }
477
- });
478
- if (shouldUpdate) {
479
- this.updateDisplayValue();
480
- }
481
- });
482
- // Start observing
483
- this.mutationObserver.observe(this.host, {
484
- childList: true,
485
- subtree: true,
486
- characterData: true,
487
- });
488
- }
489
459
  render() {
490
460
  appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
491
461
  // Generate unique IDs for associating labels and helpers with the input/button
492
462
  const labelId = this.label ? `dropdown-label-${this.name || generateUniqueId()}` : undefined;
493
463
  const helperId = this.helper ? `dropdown-helper-${this.name || generateUniqueId()}` : undefined;
494
- return (h(Host, { key: '3226a3c374e7f402ae4fc036775300ccb13be681', class: {
464
+ return (h(Host, { key: '676f9d61c5fd8488cedbc949757e992be13e49eb', class: {
495
465
  [`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
496
- } }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'aebbbf9180a868cfda604f0231765beb6b4a4d3c', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '9d88d1fc96c595edb8debc30bef3d541f76141a7', class: {
466
+ } }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ac4f3c9ca2719acc72f06ae977bf032d05913c6d', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'c9d4142f63e315c73daef5038f266a32b05559a1', class: {
497
467
  'dropdown-select': true,
498
468
  [this.size]: true,
499
469
  'disabled': this.disabled,
@@ -543,7 +513,7 @@ export class TdsDropdown {
543
513
  label-inside-as-placeholder
544
514
  ${this.size}
545
515
  ${this.selectedOptions.length ? 'selected' : ''}
546
- ` }, 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: 'd6f0b267ca40bde1f83dda5613a30b3d1f8321d6', role: "listbox", "aria-label": this.tdsAriaLabel, "aria-hidden": this.open ? 'false' : 'true', inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
516
+ ` }, 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: '6de931198040eec79815f83e2617d2646507b6a1', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
547
517
  this.dropdownList = element;
548
518
  }, class: {
549
519
  'dropdown-list': true,
@@ -554,11 +524,11 @@ export class TdsDropdown {
554
524
  'closed': !this.open,
555
525
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
556
526
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
557
- } }, h("slot", { key: '50ecd38b57b6e8eae312de70e98cb1fdd8ad5249', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'b8d9441da28942114b8076360a201a01ef243705', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '2cdad6a9dba7772e77229d2bfefd32cb8b1fc80b', id: helperId, class: {
527
+ } }, h("slot", { key: '61ab9737181371073b25b95c34dad3311c2995c0', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'aca39f881a57a6a23de03da78b5062e5dff55af7', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '1e4221e58bc16608bfb0f780b7bc8040935eab37', id: helperId, class: {
558
528
  helper: true,
559
529
  error: this.error,
560
530
  disabled: this.disabled,
561
- } }, this.error && h("tds-icon", { key: '4994294053a29d235b401af7a6c2cfea550cd305', name: "error", size: "16px" }), this.helper))));
531
+ } }, this.error && h("tds-icon", { key: 'ec946e77add75e7eaf194e2b38e5dd1c548ab32f', name: "error", size: "16px" }), this.helper))));
562
532
  }
563
533
  static get is() { return "tds-dropdown"; }
564
534
  static get encapsulation() { return "shadow"; }
@@ -985,11 +955,15 @@ export class TdsDropdown {
985
955
  return {
986
956
  "setValue": {
987
957
  "complexType": {
988
- "signature": "(value: string | number | string[] | number[]) => Promise<{ value: string | number; label: string; }[]>",
958
+ "signature": "(value: string | number | string[] | number[], label?: string) => Promise<{ value: string | number; label: string; }[]>",
989
959
  "parameters": [{
990
960
  "name": "value",
991
961
  "type": "string | number | string[] | number[]",
992
962
  "docs": ""
963
+ }, {
964
+ "name": "label",
965
+ "type": "string",
966
+ "docs": ""
993
967
  }],
994
968
  "references": {
995
969
  "Promise": {
@@ -1004,7 +978,7 @@ export class TdsDropdown {
1004
978
  "return": "Promise<{ value: string | number; label: string; }[]>"
1005
979
  },
1006
980
  "docs": {
1007
- "text": "",
981
+ "text": "Method for setting the selected value of the Dropdown.\n\nSingle selection example:\n\n<code>\ndropdown.setValue('option-1', 'Option 1');\n</code>\n\nMultiselect example:\n\n<code>\ndropdown.setValue(['option-1', 'option-2']);\n</code>",
1008
982
  "tags": []
1009
983
  }
1010
984
  },
@@ -1076,7 +1050,7 @@ export class TdsDropdown {
1076
1050
  "return": "Promise<void>"
1077
1051
  },
1078
1052
  "docs": {
1079
- "text": "Method for setting the value of the Dropdown.\n\nSingle selection example:\n\n<code>\ndropdown.setValue('option-1', 'Option 1');\n</code>\n\nMultiselect example:\n\n<code>\ndropdown.setValue(['option-1', 'option-2']);\n</code>",
1053
+ "text": "Method for closing the Dropdown.",
1080
1054
  "tags": []
1081
1055
  }
1082
1056
  },
@@ -43,6 +43,7 @@
43
43
  outline: 2px solid var(--tds-focus-outline-color);
44
44
  box-shadow: 0 0 0 1px var(--tds-white);
45
45
  outline-offset: 1px;
46
+ z-index: 1;
46
47
  }
47
48
  :host button.footer-top-title-button tds-icon {
48
49
  transition: transform 0.2s ease-in-out;
@@ -10,6 +10,7 @@
10
10
  outline: 2px solid var(--tds-focus-outline-color);
11
11
  box-shadow: 0 0 0 1px var(--tds-white);
12
12
  outline-offset: 1px;
13
+ z-index: 1;
13
14
  }
14
15
  :host([role=listitem]) div ::slotted(a:hover),
15
16
  :host([role=listitem]) div ::slotted(button:hover) {
@@ -26,6 +27,7 @@
26
27
  outline: 2px solid var(--tds-focus-outline-color);
27
28
  box-shadow: 0 0 0 1px var(--tds-white);
28
29
  outline-offset: 1px;
30
+ z-index: 1;
29
31
  }
30
32
 
31
33
  @media all and (max-width: 992px) {
@@ -49,5 +51,6 @@
49
51
  outline: 2px solid var(--tds-focus-outline-color);
50
52
  box-shadow: 0 0 0 1px var(--tds-white);
51
53
  outline-offset: 1px;
54
+ z-index: 1;
52
55
  }
53
56
  }
@@ -30,6 +30,7 @@
30
30
  outline: 2px solid var(--tds-focus-outline-color);
31
31
  box-shadow: 0 0 0 1px var(--tds-white);
32
32
  outline-offset: 1px;
33
+ z-index: 1;
33
34
  }
34
35
  :host .component-selected {
35
36
  background-color: var(--tds-nav-item-background-selected);
@@ -25,6 +25,7 @@
25
25
  outline: 2px solid var(--tds-focus-outline-color);
26
26
  box-shadow: 0 0 0 1px var(--tds-white);
27
27
  outline-offset: 1px;
28
+ z-index: 1;
28
29
  }
29
30
  :host .component-active ::slotted(button),
30
31
  :host .component-active ::slotted(a) {
@@ -35,4 +35,5 @@
35
35
  outline: 2px solid var(--tds-focus-outline-color);
36
36
  box-shadow: 0 0 0 1px var(--tds-white);
37
37
  outline-offset: 1px;
38
+ z-index: 1;
38
39
  }
@@ -219,6 +219,7 @@ button.tds-modal-close {
219
219
  outline: 2px solid var(--tds-focus-outline-color);
220
220
  box-shadow: 0 0 0 1px var(--tds-white);
221
221
  outline-offset: 1px;
222
+ z-index: 1;
222
223
  }
223
224
  @media (min-width: 320px) {
224
225
  .tds-modal-close {
@@ -38,6 +38,7 @@
38
38
  outline: 2px solid var(--tds-focus-outline-color);
39
39
  box-shadow: 0 0 0 1px var(--tds-white);
40
40
  outline-offset: 1px;
41
+ z-index: 1;
41
42
  }
42
43
  :host .component.component-selected ::slotted(a),
43
44
  :host .component.component-selected ::slotted(button) {
@@ -45,6 +45,7 @@
45
45
  outline: 2px solid var(--tds-focus-outline-color);
46
46
  box-shadow: 0 0 0 1px var(--tds-white);
47
47
  outline-offset: 1px;
48
+ z-index: 1;
48
49
  }
49
50
  :host .component:hover ::slotted(a),
50
51
  :host .component:hover ::slotted(button) {
@@ -42,6 +42,7 @@
42
42
  outline: 2px solid var(--tds-focus-outline-color);
43
43
  box-shadow: 0 0 0 1px var(--tds-white);
44
44
  outline-offset: 1px;
45
+ z-index: 1;
45
46
  }
46
47
  :host .tds-table__expand-control-container .tds-expendable-row-icon {
47
48
  height: 16px;
@@ -126,18 +126,4 @@
126
126
  40%, 60% {
127
127
  transform: translate3d(4px, 0, 0);
128
128
  }
129
- }
130
- tds-dropdown:focus-within::after {
131
- content: "";
132
- position: absolute;
133
- bottom: 0;
134
- left: 0;
135
- height: 100%;
136
- width: 100%;
137
- background-color: transparent;
138
- border-radius: var(--tds-spacing-element-4);
139
- pointer-events: none;
140
- outline: 2px solid var(--tds-focus-outline-color);
141
- box-shadow: 0 0 0 1px var(--tds-white);
142
- outline-offset: 1px;
143
129
  }
@@ -27,6 +27,7 @@
27
27
  outline: 2px solid var(--tds-focus-outline-color);
28
28
  box-shadow: 0 0 0 1px var(--tds-white);
29
29
  outline-offset: 1px;
30
+ z-index: 1;
30
31
  }
31
32
  :host div:not(.selected) {
32
33
  background-color: var(--tds-folder-tab-background);
@@ -58,6 +58,7 @@
58
58
  outline: 2px solid var(--tds-focus-outline-color);
59
59
  box-shadow: 0 0 0 1px var(--tds-white);
60
60
  outline-offset: 1px;
61
+ z-index: 1;
61
62
  }
62
63
  :host .scroll-right-button svg,
63
64
  :host .scroll-left-button svg {
@@ -70,6 +70,7 @@
70
70
  outline: 2px solid var(--tds-focus-outline-color);
71
71
  box-shadow: 0 0 0 1px var(--tds-white);
72
72
  outline-offset: 1px;
73
+ z-index: 1;
73
74
  }
74
75
  :host .scroll-right-button svg,
75
76
  :host .scroll-left-button svg {
@@ -70,6 +70,7 @@
70
70
  outline: 2px solid var(--tds-focus-outline-color);
71
71
  box-shadow: 0 0 0 1px var(--tds-white);
72
72
  outline-offset: 1px;
73
+ z-index: 1;
73
74
  }
74
75
  :host .scroll-right-button svg,
75
76
  :host .scroll-left-button svg {
@@ -53,6 +53,7 @@
53
53
  outline: 2px solid var(--tds-focus-outline-color);
54
54
  box-shadow: 0 0 0 1px var(--tds-white);
55
55
  outline-offset: 1px;
56
+ z-index: 1;
56
57
  }
57
58
  :host .wrapper button.close tds-icon {
58
59
  color: var(--tds-toast-dissmiss-color);
@@ -61,9 +61,14 @@ const appendHiddenInput = (element, name, value, disabled, additionalAttributes)
61
61
  input.value = value || '';
62
62
  };
63
63
 
64
- const dropdownCss = "@charset \"UTF-8\";:host button{all:unset;height:100%;width:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius)}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{padding:0 16px;display:flex;align-items:center;justify-content:space-between}:host button.placeholder{color:var(--tds-dropdown-placeholder-color);line-height:1.3}:host button.value{color:var(--tds-dropdown-value-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3}:host button:focus{border-bottom-color:var(--tds-dropdown-border-bottom-open)}:host button:focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--tds-dropdown-border-bottom-open)}:host button.error{border-bottom:1px solid var(--tds-negative)}:host button.error:focus{border-bottom-color:transparent}:host button.error:focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host button:disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host button .menu-icon{margin-right:0}:host .filter{display:flex;align-items:center;justify-content:space-between;height:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);padding-left:16px;border-radius:4px 4px 0 0}:host .filter:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host .filter.disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host .filter.disabled .value-wrapper input{color:var(--tds-dropdown-disabled-color)}:host .filter .value-wrapper{display:flex;width:100%;height:100%}:host .filter .value-wrapper input{color:var(--tds-dropdown-filter-input-color)}:host .filter .label-inside-as-placeholder{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3;color:var(--tds-dropdown-placeholder-color)}:host .filter .label-inside-as-placeholder.lg{top:20px}:host .filter .label-inside-as-placeholder.md{top:16px}:host .filter .label-inside-as-placeholder.sm{display:none}:host .filter .label-inside-as-placeholder.selected{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .filter .label-inside-as-placeholder.selected.lg{top:12px}:host .filter .label-inside-as-placeholder.selected.md{top:8px}:host .filter .label-inside-as-placeholder.selected.sm{display:none}:host .filter .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .filter.focus{border-bottom-color:transparent}:host .filter.focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-dropdown-border-bottom-open)}:host .filter.error{border-bottom:1px solid var(--tds-negative)}:host .filter.error.focus{border-bottom-color:transparent}:host .filter.error.focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host .filter input{flex:1;all:unset;width:100%}:host .filter input::placeholder{color:var(--tds-dropdown-placeholder-color)}:host .filter input:disabled::placeholder{color:var(--tds-dropdown-disabled-color)}:host .filter tds-icon{cursor:pointer}:host .filter .menu-icon{margin-right:16px}:host .filter .clear-icon{margin:0 8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .filter .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .filter .clear-icon.hide{display:none;visibility:hidden}:host{--tds-scrollbar-width-standard:thin;--tds-scrollbar-width:10px;--tds-scrollbar-height:10px;--tds-scrollbar-thumb-border-width:3px;--tds-scrollbar-thumb-border-hover-width:2px}body{scrollbar-width:thin}:host{display:block;position:relative;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .label-outside{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-dropdown-label-color);margin-bottom:8px}:host .label-outside.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select{position:relative}:host .dropdown-select button{transition:border-bottom-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-select button:focus{border-bottom-color:var(--tds-dropdown-border-bottom)}:host .dropdown-select button:hover{border-bottom-color:var(--tds-dropdown-border-bottom-hover)}:host .dropdown-select button{border-bottom-color:var(--tds-dropdown-border-bottom)}:host .dropdown-select button.error{border-bottom-color:var(--tds-dropdown-error)}:host .dropdown-select button.error:focus{border-bottom-color:transparent}:host .dropdown-select.disabled .label-inside,:host .dropdown-select.disabled .placeholder,:host .dropdown-select.disabled .label-inside-as-placeholder,:host .dropdown-select.disabled .value-wrapper{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);color:var(--tds-dropdown-label-inside-color)}:host .dropdown-select .label-inside.lg{top:12px;left:16px}:host .dropdown-select .label-inside.md{top:8px;left:16px}:host .dropdown-select .label-inside.sm{display:none}:host .dropdown-select .label-inside.xs{display:none}:host .dropdown-select .label-inside+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select .placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:var(--tds-placeholder-margin);}:host .dropdown-select .placeholder.xs{line-height:1}:host .dropdown-select .label-inside-as-placeholder{color:var(--tds-dropdown-placeholder-color)}:host .dropdown-select .label-inside-as-placeholder.selected{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside-as-placeholder.selected.lg{top:12px}:host .dropdown-select .label-inside-as-placeholder.selected.md{top:8px}:host .dropdown-select .label-inside-as-placeholder.selected.sm{display:none}:host .dropdown-select .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select.lg{height:55px}:host .dropdown-select.md{height:47px}:host .dropdown-select.sm{height:39px}:host .dropdown-select.xs{height:29px}:host .helper{margin-top:4px;color:var(--tds-dropdown-helper-color);font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;align-items:center;gap:8px}:host .helper.error{color:var(--tds-dropdown-error)}:host .helper.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-list{z-index:100;position:absolute;margin-top:1px;width:100%;transform-origin:top;box-shadow:rgba(0, 0, 0, 0.1) 0 2px 3px 0;border-radius:var(--tds-dropdown-list-border-radius-down);overflow-y:auto;transform:scaleY(0);pointer-events:none}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;background:var(--tds-scrollbar-hover-thumb-color);background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar{width:var(--tds-scrollbar-width)}:host .dropdown-list::-webkit-scrollbar-track{background:var(--tds-scrollbar-track-color)}:host .dropdown-list::-webkit-scrollbar-thumb{border-radius:40px;background:var(--tds-scrollbar-thumb-color);border:var(--tds-scrollbar-thumb-border-width) solid transparent;background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar-button{height:0;width:0}@supports not selector(::-webkit-scrollbar){:host .dropdown-list{scrollbar-color:var(--tds-scrollbar-thumb-color) var(--tds-scrollbar-track-color);scrollbar-width:var(--tds-scrollbar-width-standard)}}:host .dropdown-list.lg{max-height:312px}:host .dropdown-list.md{max-height:312px}:host .dropdown-list.sm{max-height:260px}:host .dropdown-list.xs{max-height:260px}:host .dropdown-list.up{bottom:100%;margin-top:0;margin-bottom:1px;transform-origin:bottom;display:flex;flex-direction:column-reverse;box-shadow:rgba(0, 0, 0, 0.1) 0 -1px 3px 0;border-radius:var(--tds-dropdown-list-border-radius-up)}:host .dropdown-list.up.label-outside{bottom:calc(100% - 24px)}:host .dropdown-list.closed{transform:scaleY(0);pointer-events:none}:host .dropdown-list.open{transform:scaleY(1);visibility:visible;opacity:1;pointer-events:auto}:host .dropdown-list.animation-enter-slide{transition:transform var(--tds-motion-duration-moderate-01) var(--tds-motion-easing-enter)}:host .dropdown-list.animation-exit-slide{transition:transform var(--tds-motion-duration-moderate-01) var(--tds-motion-easing-exit)}:host .dropdown-list .no-result{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);display:flex;align-items:center;padding:0 16px;background-color:var(--tds-dropdown-bg)}:host .dropdown-list .no-result.lg{height:56px}:host .dropdown-list .no-result.md{height:48px}:host .dropdown-list .no-result.sm{height:40px}:host .dropdown-list .no-result.xs{height:40px}:host .menu-icon{color:var(--tds-dropdown-menu-icon-color)}:host tds-icon{transition:transform var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host tds-icon.open{transform:rotateZ(180deg)}";
64
+ const dropdownCss = "@charset \"UTF-8\";:host button{all:unset;height:100%;width:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius)}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{padding:0 16px;display:flex;align-items:center;justify-content:space-between}:host button.placeholder{color:var(--tds-dropdown-placeholder-color);line-height:1.3}:host button.value{color:var(--tds-dropdown-value-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3}:host button:focus{border-bottom:0}:host button.error{border-bottom:1px solid var(--tds-dropdown-error)}:host button.error:focus{border-bottom-color:transparent}:host button.error:focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--tds-dropdown-error)}:host button:disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host button .menu-icon{margin-right:0}:host .dropdown-select:focus-within{outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1}:host .filter{display:flex;align-items:center;justify-content:space-between;height:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);padding-left:16px;border-radius:4px 4px 0 0}:host .filter:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host .filter.disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host .filter.disabled .value-wrapper input{color:var(--tds-dropdown-disabled-color)}:host .filter .value-wrapper{display:flex;width:100%;height:100%}:host .filter .value-wrapper input{color:var(--tds-dropdown-filter-input-color)}:host .filter .label-inside-as-placeholder{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3;color:var(--tds-dropdown-placeholder-color)}:host .filter .label-inside-as-placeholder.lg{top:20px}:host .filter .label-inside-as-placeholder.md{top:16px}:host .filter .label-inside-as-placeholder.sm{display:none}:host .filter .label-inside-as-placeholder.selected{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .filter .label-inside-as-placeholder.selected.lg{top:12px}:host .filter .label-inside-as-placeholder.selected.md{top:8px}:host .filter .label-inside-as-placeholder.selected.sm{display:none}:host .filter .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .filter.focus{border-bottom:0}:host .filter.focus:hover{border-bottom:0}:host .filter.error{border-bottom:1px solid var(--tds-dropdown-error)}:host .filter.error.focus{border-bottom-color:transparent}:host .filter.error.focus::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--tds-dropdown-error)}:host .filter input{flex:1;all:unset;width:100%}:host .filter input::placeholder{color:var(--tds-dropdown-placeholder-color)}:host .filter input:disabled::placeholder{color:var(--tds-dropdown-disabled-color)}:host .filter tds-icon{cursor:pointer}:host .filter .menu-icon{margin-right:16px}:host .filter .clear-icon{margin:0 8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .filter .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .filter .clear-icon.hide{display:none;visibility:hidden}:host{--tds-scrollbar-width-standard:thin;--tds-scrollbar-width:10px;--tds-scrollbar-height:10px;--tds-scrollbar-thumb-border-width:3px;--tds-scrollbar-thumb-border-hover-width:2px}body{scrollbar-width:thin}:host{display:block;position:relative;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .label-outside{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-dropdown-label-color);margin-bottom:8px}:host .label-outside.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select{position:relative}:host .dropdown-select button:focus{outline:2px solid var(--tds-focus-outline-color);box-shadow:0 0 0 1px var(--tds-white);outline-offset:1px;z-index:1;border-radius:0}:host .dropdown-select button{transition:border-bottom-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-select button:hover{border-bottom-color:var(--tds-dropdown-border-bottom-hover)}:host .dropdown-select button{border-bottom-color:var(--tds-dropdown-border-bottom)}:host .dropdown-select button.error{border-bottom-color:var(--tds-dropdown-error)}:host .dropdown-select button.error:focus{border-bottom-color:transparent}:host .dropdown-select.disabled .label-inside,:host .dropdown-select.disabled .placeholder,:host .dropdown-select.disabled .label-inside-as-placeholder,:host .dropdown-select.disabled .value-wrapper{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);color:var(--tds-dropdown-label-inside-color)}:host .dropdown-select .label-inside.lg{top:12px;left:16px}:host .dropdown-select .label-inside.md{top:8px;left:16px}:host .dropdown-select .label-inside.sm{display:none}:host .dropdown-select .label-inside.xs{display:none}:host .dropdown-select .label-inside+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select .placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:var(--tds-placeholder-margin);}:host .dropdown-select .placeholder.xs{line-height:1}:host .dropdown-select .label-inside-as-placeholder{color:var(--tds-dropdown-placeholder-color)}:host .dropdown-select .label-inside-as-placeholder.selected{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside-as-placeholder.selected.lg{top:12px}:host .dropdown-select .label-inside-as-placeholder.selected.md{top:8px}:host .dropdown-select .label-inside-as-placeholder.selected.sm{display:none}:host .dropdown-select .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select.lg{height:55px}:host .dropdown-select.md{height:47px}:host .dropdown-select.sm{height:39px}:host .dropdown-select.xs{height:29px}:host .helper{margin-top:4px;color:var(--tds-dropdown-helper-color);font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;align-items:center;gap:8px}:host .helper.error{color:var(--tds-dropdown-error)}:host .helper.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-list{z-index:100;position:absolute;width:100%;transform-origin:top;box-shadow:0 2px 3px 0 rgba(0, 0, 0, 0.1);border-radius:var(--tds-dropdown-list-border-radius-down);overflow-y:auto;transform:scaleY(0);pointer-events:none}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;background:var(--tds-scrollbar-hover-thumb-color);background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar{width:var(--tds-scrollbar-width)}:host .dropdown-list::-webkit-scrollbar-track{background:var(--tds-scrollbar-track-color)}:host .dropdown-list::-webkit-scrollbar-thumb{border-radius:40px;background:var(--tds-scrollbar-thumb-color);border:var(--tds-scrollbar-thumb-border-width) solid transparent;background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar-button{height:0;width:0}@supports not selector(::-webkit-scrollbar){:host .dropdown-list{scrollbar-color:var(--tds-scrollbar-thumb-color) var(--tds-scrollbar-track-color);scrollbar-width:var(--tds-scrollbar-width-standard)}}:host .dropdown-list.lg{max-height:312px}:host .dropdown-list.md{max-height:312px}:host .dropdown-list.sm{max-height:260px}:host .dropdown-list.xs{max-height:260px}:host .dropdown-list.up{bottom:100%;margin-top:0;margin-bottom:1px;transform-origin:bottom;display:flex;flex-direction:column-reverse;border-radius:var(--tds-dropdown-list-border-radius-up)}:host .dropdown-list.up.label-outside{bottom:calc(100% - 24px)}:host .dropdown-list.closed{transform:scaleY(0);pointer-events:none}:host .dropdown-list.open{transform:scaleY(1);visibility:visible;opacity:1;pointer-events:auto}:host .dropdown-list.animation-enter-slide{transition:transform var(--tds-motion-duration-moderate-01) var(--tds-motion-easing-enter)}:host .dropdown-list.animation-exit-slide{transition:transform var(--tds-motion-duration-moderate-01) var(--tds-motion-easing-exit)}:host .dropdown-list .no-result{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);display:flex;align-items:center;padding:0 16px;background-color:var(--tds-dropdown-bg)}:host .dropdown-list .no-result.lg{height:56px}:host .dropdown-list .no-result.md{height:48px}:host .dropdown-list .no-result.sm{height:40px}:host .dropdown-list .no-result.xs{height:40px}:host .menu-icon{color:var(--tds-dropdown-menu-icon-color)}:host tds-icon{transition:transform var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host tds-icon.open{transform:rotateZ(180deg)}";
65
65
  const TdsDropdownStyle0 = dropdownCss;
66
66
 
67
+ function hasValueChanged(newValue, currentValue) {
68
+ if (newValue.length !== currentValue.length)
69
+ return true;
70
+ return newValue.some((val) => !currentValue.includes(val));
71
+ }
67
72
  const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H {
68
73
  constructor() {
69
74
  super();
@@ -236,7 +241,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
236
241
  // Normalize to array
237
242
  const normalizedValue = this.normalizeValue(newValue);
238
243
  // Only update if actually changed
239
- if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
244
+ if (hasValueChanged(normalizedValue, this.selectedOptions)) {
240
245
  this.updateDropdownStateFromUser(normalizedValue);
241
246
  }
242
247
  }
@@ -261,12 +266,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
261
266
  .split(',')
262
267
  .filter((v) => v !== '');
263
268
  }
264
- // eslint-disable-next-line class-methods-use-this
265
- hasValueChanged(newValue, currentValue) {
266
- if (newValue.length !== currentValue.length)
267
- return true;
268
- return newValue.some((val) => !currentValue.includes(val));
269
- }
270
269
  updateDropdownStateInternal(values) {
271
270
  this.updateDropdownState(values, false);
272
271
  }
@@ -329,7 +328,23 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
329
328
  value: value !== null && value !== void 0 ? value : null,
330
329
  });
331
330
  }
332
- async setValue(value) {
331
+ /** Method for setting the selected value of the Dropdown.
332
+ *
333
+ * Single selection example:
334
+ *
335
+ * <code>
336
+ * dropdown.setValue('option-1', 'Option 1');
337
+ * </code>
338
+ *
339
+ * Multiselect example:
340
+ *
341
+ * <code>
342
+ * dropdown.setValue(['option-1', 'option-2']);
343
+ * </code>
344
+ */
345
+ // @ts-expect-error for label: the label is optional here ONLY to not break the API. Should be removed for 2.0.
346
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
347
+ async setValue(value, label) {
333
348
  let normalizedValue;
334
349
  if (Array.isArray(value)) {
335
350
  normalizedValue = convertArrayToStrings(value);
@@ -366,20 +381,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
366
381
  // Always trigger the focus event to open the dropdown
367
382
  this.handleFocus({});
368
383
  }
369
- /** Method for setting the value of the Dropdown.
370
- *
371
- * Single selection example:
372
- *
373
- * <code>
374
- * dropdown.setValue('option-1', 'Option 1');
375
- * </code>
376
- *
377
- * Multiselect example:
378
- *
379
- * <code>
380
- * dropdown.setValue(['option-1', 'option-2']);
381
- * </code>
382
- */
384
+ /** Method for closing the Dropdown. */
383
385
  async close() {
384
386
  this.open = false;
385
387
  }
@@ -469,8 +471,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
469
471
  : [defaultValueStr];
470
472
  this.updateDropdownStateInternal(initialValue);
471
473
  }
472
- // Setup mutation observer to watch for text content changes
473
- this.setupMutationObserver();
474
474
  }
475
475
  /** Method to handle slot changes */
476
476
  handleSlotChange() {
@@ -500,12 +500,10 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
500
500
  this.updateDropdownListInertState();
501
501
  }
502
502
  disconnectedCallback() {
503
- var _a;
504
503
  const form = this.host.closest('form');
505
504
  if (form) {
506
505
  form.removeEventListener('reset', this.resetInput);
507
506
  }
508
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
509
507
  }
510
508
  connectedCallback() {
511
509
  if (!this.tdsAriaLabel) {
@@ -522,42 +520,14 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
522
520
  }
523
521
  }
524
522
  }
525
- setupMutationObserver() {
526
- this.mutationObserver = new MutationObserver((mutations) => {
527
- let shouldUpdate = false;
528
- mutations.forEach((mutation) => {
529
- var _a;
530
- if (mutation.type === 'characterData' || mutation.type === 'childList') {
531
- // Check if the mutation affects any of our dropdown options
532
- const target = mutation.target;
533
- const optionElement = target.nodeType === Node.TEXT_NODE
534
- ? (_a = target.parentElement) === null || _a === void 0 ? void 0 : _a.closest('tds-dropdown-option')
535
- : target === null || target === void 0 ? void 0 : target.closest('tds-dropdown-option');
536
- if (optionElement &&
537
- this.getChildren().includes(optionElement)) {
538
- shouldUpdate = true;
539
- }
540
- }
541
- });
542
- if (shouldUpdate) {
543
- this.updateDisplayValue();
544
- }
545
- });
546
- // Start observing
547
- this.mutationObserver.observe(this.host, {
548
- childList: true,
549
- subtree: true,
550
- characterData: true,
551
- });
552
- }
553
523
  render() {
554
524
  appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
555
525
  // Generate unique IDs for associating labels and helpers with the input/button
556
526
  const labelId = this.label ? `dropdown-label-${this.name || generateUniqueId()}` : undefined;
557
527
  const helperId = this.helper ? `dropdown-helper-${this.name || generateUniqueId()}` : undefined;
558
- return (h(Host, { key: '3226a3c374e7f402ae4fc036775300ccb13be681', class: {
528
+ return (h(Host, { key: '676f9d61c5fd8488cedbc949757e992be13e49eb', class: {
559
529
  [`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
560
- } }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'aebbbf9180a868cfda604f0231765beb6b4a4d3c', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '9d88d1fc96c595edb8debc30bef3d541f76141a7', class: {
530
+ } }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ac4f3c9ca2719acc72f06ae977bf032d05913c6d', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'c9d4142f63e315c73daef5038f266a32b05559a1', class: {
561
531
  'dropdown-select': true,
562
532
  [this.size]: true,
563
533
  'disabled': this.disabled,
@@ -607,7 +577,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
607
577
  label-inside-as-placeholder
608
578
  ${this.size}
609
579
  ${this.selectedOptions.length ? 'selected' : ''}
610
- ` }, 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: 'd6f0b267ca40bde1f83dda5613a30b3d1f8321d6', role: "listbox", "aria-label": this.tdsAriaLabel, "aria-hidden": this.open ? 'false' : 'true', inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
580
+ ` }, 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: '6de931198040eec79815f83e2617d2646507b6a1', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
611
581
  this.dropdownList = element;
612
582
  }, class: {
613
583
  'dropdown-list': true,
@@ -618,11 +588,11 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
618
588
  'closed': !this.open,
619
589
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
620
590
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
621
- } }, h("slot", { key: '50ecd38b57b6e8eae312de70e98cb1fdd8ad5249', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'b8d9441da28942114b8076360a201a01ef243705', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '2cdad6a9dba7772e77229d2bfefd32cb8b1fc80b', id: helperId, class: {
591
+ } }, h("slot", { key: '61ab9737181371073b25b95c34dad3311c2995c0', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'aca39f881a57a6a23de03da78b5062e5dff55af7', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '1e4221e58bc16608bfb0f780b7bc8040935eab37', id: helperId, class: {
622
592
  helper: true,
623
593
  error: this.error,
624
594
  disabled: this.disabled,
625
- } }, this.error && h("tds-icon", { key: '4994294053a29d235b401af7a6c2cfea550cd305', name: "error", size: "16px" }), this.helper))));
595
+ } }, this.error && h("tds-icon", { key: 'ec946e77add75e7eaf194e2b38e5dd1c548ab32f', name: "error", size: "16px" }), this.helper))));
626
596
  }
627
597
  get host() { return this; }
628
598
  static get watchers() { return {