@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.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/tds-banner.cjs.entry.js +1 -1
- package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/tds-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-chip.cjs.entry.js +1 -1
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +41 -65
- package/dist/cjs/tds-folder-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer-group.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-modal.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-footer.cjs.entry.js +1 -1
- package/dist/cjs/tds-toast.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/assets/logos/traton/traton-logotype-black.png +0 -0
- package/dist/collection/assets/logos/traton/traton-logotype-black.svg +1 -0
- package/dist/collection/assets/logos/traton/traton-logotype-blue.png +0 -0
- package/dist/collection/assets/logos/traton/traton-logotype-blue.svg +1 -0
- package/dist/collection/assets/logos/traton/traton-logotype-white.png +0 -0
- package/dist/collection/assets/logos/traton/traton-logotype-white.svg +1 -0
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +43 -13
- package/dist/collection/components/accordion/accordion.css +10 -0
- package/dist/collection/components/banner/banner.css +1 -0
- package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.css +1 -0
- package/dist/collection/components/button/button.css +1 -0
- package/dist/collection/components/chip/chip.css +1 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.css +5 -5
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +27 -4
- package/dist/collection/components/dropdown/dropdown.css +24 -31
- package/dist/collection/components/dropdown/dropdown.js +36 -62
- package/dist/collection/components/footer/footer-group/footer-group.css +1 -0
- package/dist/collection/components/footer/footer-item/footer-item.css +3 -0
- package/dist/collection/components/header/header-dropdown-list-item/header-dropdown-list-item.css +1 -0
- package/dist/collection/components/header/header-item/header-item.css +1 -0
- package/dist/collection/components/header/header-launcher-grid-item/header-launcher-grid-item.css +1 -0
- package/dist/collection/components/modal/modal.css +1 -0
- package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.css +1 -0
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +1 -0
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.css +1 -0
- package/dist/collection/components/table/table-footer/table-footer.css +0 -14
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.css +1 -0
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.css +1 -0
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.css +1 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +1 -0
- package/dist/collection/components/toast/toast.css +1 -0
- package/dist/components/{p-92f764ad.js → p-1cd6b2c6.js} +30 -60
- package/dist/components/{p-90197afb.js → p-4b0c6ab5.js} +12 -5
- package/dist/components/{p-9388c920.js → p-6adb1ce3.js} +1 -1
- package/dist/components/{p-8317c073.js → p-71c3dfe9.js} +1 -1
- package/dist/components/{p-8f545f6b.js → p-ea381f94.js} +1 -1
- package/dist/components/{p-0ace60ac.js → p-f589b91c.js} +1 -1
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-accordion.js +1 -1
- package/dist/components/tds-banner.js +1 -1
- package/dist/components/tds-breadcrumb.js +1 -1
- package/dist/components/tds-button.js +1 -1
- package/dist/components/tds-chip.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tab.js +1 -1
- package/dist/components/tds-folder-tabs.js +1 -1
- package/dist/components/tds-footer-group.js +1 -1
- package/dist/components/tds-footer-item.js +1 -1
- package/dist/components/tds-header-brand-symbol.js +1 -1
- package/dist/components/tds-header-dropdown-list-item.js +1 -1
- package/dist/components/tds-header-dropdown.js +1 -1
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-item.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher-grid-item.js +1 -1
- package/dist/components/tds-header-launcher-list-item.js +1 -1
- package/dist/components/tds-header-launcher.js +2 -2
- package/dist/components/tds-inline-tabs.js +1 -1
- package/dist/components/tds-modal.js +1 -1
- package/dist/components/tds-navigation-tabs.js +1 -1
- package/dist/components/tds-side-menu-collapse-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown-list-item.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-side-menu-item.js +1 -1
- package/dist/components/tds-table-body-row-expandable.js +1 -1
- package/dist/components/tds-table-footer.js +3 -3
- package/dist/components/tds-toast.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-accordion-item.entry.js +1 -1
- package/dist/esm/tds-accordion.entry.js +1 -1
- package/dist/esm/tds-banner.entry.js +1 -1
- package/dist/esm/tds-breadcrumb.entry.js +1 -1
- package/dist/esm/tds-button.entry.js +1 -1
- package/dist/esm/tds-chip.entry.js +1 -1
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +41 -65
- package/dist/esm/tds-folder-tab.entry.js +1 -1
- package/dist/esm/tds-folder-tabs.entry.js +1 -1
- package/dist/esm/tds-footer-group.entry.js +1 -1
- package/dist/esm/tds-footer-item.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-header-launcher-grid-item.entry.js +1 -1
- package/dist/esm/tds-inline-tabs.entry.js +1 -1
- package/dist/esm/tds-modal.entry.js +1 -1
- package/dist/esm/tds-navigation-tabs.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-side-menu-item.entry.js +1 -1
- package/dist/esm/tds-table-body-row-expandable.entry.js +1 -1
- package/dist/esm/tds-table-footer.entry.js +1 -1
- package/dist/esm/tds-toast.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/assets/logos/traton/traton-logotype-black.png +0 -0
- package/dist/tegel/assets/logos/traton/traton-logotype-black.svg +1 -0
- package/dist/tegel/assets/logos/traton/traton-logotype-blue.png +0 -0
- package/dist/tegel/assets/logos/traton/traton-logotype-blue.svg +1 -0
- package/dist/tegel/assets/logos/traton/traton-logotype-white.png +0 -0
- package/dist/tegel/assets/logos/traton/traton-logotype-white.svg +1 -0
- package/dist/tegel/{p-80123e1f.entry.js → p-1c75f8a7.entry.js} +1 -1
- package/dist/tegel/p-35a88a52.entry.js +1 -0
- package/dist/tegel/{p-40c94144.entry.js → p-4274d329.entry.js} +1 -1
- package/dist/tegel/{p-73055353.entry.js → p-5020a688.entry.js} +1 -1
- package/dist/tegel/{p-efa84ea2.entry.js → p-5c077bb9.entry.js} +1 -1
- package/dist/tegel/{p-8a65fba0.entry.js → p-614bcd4b.entry.js} +1 -1
- package/dist/tegel/{p-d8970b35.entry.js → p-61a1dc59.entry.js} +1 -1
- package/dist/tegel/{p-fd6892b8.entry.js → p-6a615ac1.entry.js} +1 -1
- package/dist/tegel/{p-421307de.entry.js → p-6e57997e.entry.js} +1 -1
- package/dist/tegel/{p-83f5f98b.entry.js → p-8c841698.entry.js} +1 -1
- package/dist/tegel/p-942abc1e.entry.js +1 -0
- package/dist/tegel/{p-89f3ccf4.entry.js → p-9b2257f3.entry.js} +1 -1
- package/dist/tegel/{p-51b75159.entry.js → p-a0591e58.entry.js} +1 -1
- package/dist/tegel/{p-63bd0e61.entry.js → p-b734b309.entry.js} +1 -1
- package/dist/tegel/{p-4d439643.entry.js → p-bcd5e06d.entry.js} +1 -1
- package/dist/tegel/p-bdc913a0.entry.js +1 -0
- package/dist/tegel/{p-4392455a.entry.js → p-c0b26507.entry.js} +1 -1
- package/dist/tegel/{p-b73211ea.entry.js → p-cf7af8f2.entry.js} +1 -1
- package/dist/tegel/{p-5e868e17.entry.js → p-d267c18f.entry.js} +1 -1
- package/dist/tegel/{p-852569b2.entry.js → p-dc375d3e.entry.js} +1 -1
- package/dist/tegel/{p-bb4579da.entry.js → p-f2232281.entry.js} +1 -1
- package/dist/tegel/p-f78b6a16.entry.js +1 -0
- package/dist/tegel/tegel.css +4 -4
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +3 -0
- package/dist/types/components/dropdown/dropdown.d.ts +10 -12
- package/dist/types/components.d.ts +13 -2
- package/package.json +1 -1
- package/dist/tegel/p-2b95225a.entry.js +0 -1
- package/dist/tegel/p-87e8f355.entry.js +0 -1
- package/dist/tegel/p-cdc02f4a.entry.js +0 -1
- package/dist/tegel/p-de483ce4.entry.js +0 -1
- /package/dist/collection/assets/logos/{scania-logotype.png → scania/scania-logotype.png} +0 -0
- /package/dist/collection/assets/logos/{scania-logotype.svg → scania/scania-logotype.svg} +0 -0
- /package/dist/collection/assets/logos/{scania-symbol.png → scania/scania-symbol.png} +0 -0
- /package/dist/collection/assets/logos/{scania-symbol.svg → scania/scania-symbol.svg} +0 -0
- /package/dist/collection/assets/logos/{scania-wordmark-white.png → scania/scania-wordmark-white.png} +0 -0
- /package/dist/collection/assets/logos/{scania-wordmark-white.svg → scania/scania-wordmark-white.svg} +0 -0
- /package/dist/collection/assets/logos/{scania-wordmark.png → scania/scania-wordmark.png} +0 -0
- /package/dist/collection/assets/logos/{scania-wordmark.svg → scania/scania-wordmark.svg} +0 -0
- /package/dist/tegel/assets/logos/{scania-logotype.png → scania/scania-logotype.png} +0 -0
- /package/dist/tegel/assets/logos/{scania-logotype.svg → scania/scania-logotype.svg} +0 -0
- /package/dist/tegel/assets/logos/{scania-symbol.png → scania/scania-symbol.png} +0 -0
- /package/dist/tegel/assets/logos/{scania-symbol.svg → scania/scania-symbol.svg} +0 -0
- /package/dist/tegel/assets/logos/{scania-wordmark-white.png → scania/scania-wordmark-white.png} +0 -0
- /package/dist/tegel/assets/logos/{scania-wordmark-white.svg → scania/scania-wordmark-white.svg} +0 -0
- /package/dist/tegel/assets/logos/{scania-wordmark.png → scania/scania-wordmark.png} +0 -0
- /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 (
|
|
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
|
-
|
|
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
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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
|
|
1053
|
+
"text": "Method for closing the Dropdown.",
|
|
1080
1054
|
"tags": []
|
|
1081
1055
|
}
|
|
1082
1056
|
},
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
|
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 (
|
|
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
|
-
|
|
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
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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 {
|