@scania/tegel 1.49.1-test-warning-beta.0 → 1.49.2
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/tds-dropdown_2.cjs.entry.js +16 -13
- package/dist/collection/components/dropdown/dropdown.js +16 -13
- package/dist/components/p-hCp8GmRl.js +1 -0
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-table-footer.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +16 -13
- package/dist/tegel/p-091c27ee.entry.js +1 -0
- package/dist/tegel/tegel.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-iaLyTi5L.js +0 -1
- package/dist/tegel/p-36151a93.entry.js +0 -1
|
@@ -142,7 +142,13 @@ const TdsDropdown = class {
|
|
|
142
142
|
this.updateDropdownStateInternal(defaultValues);
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
|
-
this.getChildren = () =>
|
|
145
|
+
this.getChildren = () => {
|
|
146
|
+
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
147
|
+
if (tdsDropdownOptions.length === 0) {
|
|
148
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
149
|
+
}
|
|
150
|
+
return tdsDropdownOptions;
|
|
151
|
+
};
|
|
146
152
|
this.getSelectedChildren = () => {
|
|
147
153
|
if (this.selectedOptions.length === 0)
|
|
148
154
|
return [];
|
|
@@ -406,14 +412,16 @@ const TdsDropdown = class {
|
|
|
406
412
|
this.setValueAttribute();
|
|
407
413
|
}
|
|
408
414
|
validateValues(values) {
|
|
415
|
+
/** Make sure we have children before validation */
|
|
409
416
|
const children = this.getChildren();
|
|
410
417
|
if (!children || children.length === 0) {
|
|
418
|
+
console.warn('No dropdown options found');
|
|
411
419
|
return values; /** Return original values if no children yet */
|
|
412
420
|
}
|
|
413
421
|
return values.filter((val) => {
|
|
414
422
|
const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
|
|
415
423
|
if (!isValid) {
|
|
416
|
-
console.warn(`
|
|
424
|
+
console.warn(`Option with value "${val}" does not exist`);
|
|
417
425
|
}
|
|
418
426
|
return isValid;
|
|
419
427
|
});
|
|
@@ -622,12 +630,7 @@ const TdsDropdown = class {
|
|
|
622
630
|
}
|
|
623
631
|
/** Method to handle slot changes */
|
|
624
632
|
handleSlotChange() {
|
|
625
|
-
|
|
626
|
-
this.updateDropdownStateInternal([...this.selectedOptions]);
|
|
627
|
-
}
|
|
628
|
-
else if (this.internalDefaultValue) {
|
|
629
|
-
this.setDefaultOption();
|
|
630
|
-
}
|
|
633
|
+
this.setDefaultOption();
|
|
631
634
|
}
|
|
632
635
|
/** Method to check if we should normalize text */
|
|
633
636
|
normalizeString(text) {
|
|
@@ -705,9 +708,9 @@ const TdsDropdown = class {
|
|
|
705
708
|
else if (showPlaceholderButton) {
|
|
706
709
|
buttonText = (_d = this.placeholder) !== null && _d !== void 0 ? _d : '';
|
|
707
710
|
}
|
|
708
|
-
return (index.h(index.Host, { key: '
|
|
711
|
+
return (index.h(index.Host, { key: 'e7c3ade8e5b56a41f78016c44fb75efcaaf666c1', class: {
|
|
709
712
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
710
|
-
} }, this.label && this.labelPosition === 'outside' && (index.h("div", { key: '
|
|
713
|
+
} }, this.label && this.labelPosition === 'outside' && (index.h("div", { key: '26dd2d4137fea024b4b436fca739cfecaea13491', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), index.h("div", { key: 'ce88e29fa87c4c9e54ea68bef9bde26b6300bae9', class: {
|
|
711
714
|
'dropdown-select': true,
|
|
712
715
|
[this.size]: true,
|
|
713
716
|
'disabled': this.disabled,
|
|
@@ -766,7 +769,7 @@ const TdsDropdown = class {
|
|
|
766
769
|
}, class: {
|
|
767
770
|
'clear-icon': true,
|
|
768
771
|
'hide': !(this.multiselect && this.selectedOptions.length > 0),
|
|
769
|
-
}, name: "cross", size: "16px" }), index.h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" })))), index.h("div", { key: '
|
|
772
|
+
}, name: "cross", size: "16px" }), index.h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" })))), index.h("div", { key: '0d76e422a2f0887595f60d57e03ec3980d4b9774', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
770
773
|
if (element)
|
|
771
774
|
this.dropdownList = element;
|
|
772
775
|
}, class: {
|
|
@@ -778,11 +781,11 @@ const TdsDropdown = class {
|
|
|
778
781
|
'closed': !this.open,
|
|
779
782
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
780
783
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
781
|
-
} }, index.h("slot", { key: '
|
|
784
|
+
} }, index.h("slot", { key: 'f971e4e9e24fe8d9092066d72bb05b76547f05a7', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (index.h("div", { key: '0d8f90a543bf7b8dc3b3185d27f05d0517b4e0e6', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (index.h("div", { key: '4f17cfead0616b262e91e0e5b82cf59ce1309d73', id: helperId, class: {
|
|
782
785
|
helper: true,
|
|
783
786
|
error: this.error,
|
|
784
787
|
disabled: this.disabled,
|
|
785
|
-
} }, this.error && index.h("tds-icon", { key: '
|
|
788
|
+
} }, this.error && index.h("tds-icon", { key: '032599d86280e2a204c22fb97409f097841259b5', name: "error", size: "16px" }), this.helper))));
|
|
786
789
|
}
|
|
787
790
|
get host() { return index.getElement(this); }
|
|
788
791
|
static get watchers() { return {
|
|
@@ -66,7 +66,13 @@ export class TdsDropdown {
|
|
|
66
66
|
this.updateDropdownStateInternal(defaultValues);
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
this.getChildren = () =>
|
|
69
|
+
this.getChildren = () => {
|
|
70
|
+
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
71
|
+
if (tdsDropdownOptions.length === 0) {
|
|
72
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
73
|
+
}
|
|
74
|
+
return tdsDropdownOptions;
|
|
75
|
+
};
|
|
70
76
|
this.getSelectedChildren = () => {
|
|
71
77
|
if (this.selectedOptions.length === 0)
|
|
72
78
|
return [];
|
|
@@ -330,14 +336,16 @@ export class TdsDropdown {
|
|
|
330
336
|
this.setValueAttribute();
|
|
331
337
|
}
|
|
332
338
|
validateValues(values) {
|
|
339
|
+
/** Make sure we have children before validation */
|
|
333
340
|
const children = this.getChildren();
|
|
334
341
|
if (!children || children.length === 0) {
|
|
342
|
+
console.warn('No dropdown options found');
|
|
335
343
|
return values; /** Return original values if no children yet */
|
|
336
344
|
}
|
|
337
345
|
return values.filter((val) => {
|
|
338
346
|
const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
|
|
339
347
|
if (!isValid) {
|
|
340
|
-
console.warn(`
|
|
348
|
+
console.warn(`Option with value "${val}" does not exist`);
|
|
341
349
|
}
|
|
342
350
|
return isValid;
|
|
343
351
|
});
|
|
@@ -546,12 +554,7 @@ export class TdsDropdown {
|
|
|
546
554
|
}
|
|
547
555
|
/** Method to handle slot changes */
|
|
548
556
|
handleSlotChange() {
|
|
549
|
-
|
|
550
|
-
this.updateDropdownStateInternal([...this.selectedOptions]);
|
|
551
|
-
}
|
|
552
|
-
else if (this.internalDefaultValue) {
|
|
553
|
-
this.setDefaultOption();
|
|
554
|
-
}
|
|
557
|
+
this.setDefaultOption();
|
|
555
558
|
}
|
|
556
559
|
/** Method to check if we should normalize text */
|
|
557
560
|
normalizeString(text) {
|
|
@@ -629,9 +632,9 @@ export class TdsDropdown {
|
|
|
629
632
|
else if (showPlaceholderButton) {
|
|
630
633
|
buttonText = (_d = this.placeholder) !== null && _d !== void 0 ? _d : '';
|
|
631
634
|
}
|
|
632
|
-
return (h(Host, { key: '
|
|
635
|
+
return (h(Host, { key: 'e7c3ade8e5b56a41f78016c44fb75efcaaf666c1', class: {
|
|
633
636
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
634
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
637
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '26dd2d4137fea024b4b436fca739cfecaea13491', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'ce88e29fa87c4c9e54ea68bef9bde26b6300bae9', class: {
|
|
635
638
|
'dropdown-select': true,
|
|
636
639
|
[this.size]: true,
|
|
637
640
|
'disabled': this.disabled,
|
|
@@ -690,7 +693,7 @@ export class TdsDropdown {
|
|
|
690
693
|
}, class: {
|
|
691
694
|
'clear-icon': true,
|
|
692
695
|
'hide': !(this.multiselect && this.selectedOptions.length > 0),
|
|
693
|
-
}, name: "cross", size: "16px" }), 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: '
|
|
696
|
+
}, name: "cross", size: "16px" }), 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: '0d76e422a2f0887595f60d57e03ec3980d4b9774', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
694
697
|
if (element)
|
|
695
698
|
this.dropdownList = element;
|
|
696
699
|
}, class: {
|
|
@@ -702,11 +705,11 @@ export class TdsDropdown {
|
|
|
702
705
|
'closed': !this.open,
|
|
703
706
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
704
707
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
705
|
-
} }, h("slot", { key: '
|
|
708
|
+
} }, h("slot", { key: 'f971e4e9e24fe8d9092066d72bb05b76547f05a7', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '0d8f90a543bf7b8dc3b3185d27f05d0517b4e0e6', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '4f17cfead0616b262e91e0e5b82cf59ce1309d73', id: helperId, class: {
|
|
706
709
|
helper: true,
|
|
707
710
|
error: this.error,
|
|
708
711
|
disabled: this.disabled,
|
|
709
|
-
} }, this.error && h("tds-icon", { key: '
|
|
712
|
+
} }, this.error && h("tds-icon", { key: '032599d86280e2a204c22fb97409f097841259b5', name: "error", size: "16px" }), this.helper))));
|
|
710
713
|
}
|
|
711
714
|
static get is() { return "tds-dropdown"; }
|
|
712
715
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as o,H as s,c as e,h as i,a as r}from"./index.js";import{c as l,a as d}from"./p-CBZ6wC3m.js";import{g as n}from"./p-Cn4f8w1e.js";import{d as a}from"./p-CIt4YhvL.js";const h=o(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tdsChange=e(this,"tdsChange",6),this.tdsFocus=e(this,"tdsFocus",6),this.tdsBlur=e(this,"tdsBlur",6),this.tdsInput=e(this,"tdsInput",6),this.tdsClear=e(this,"tdsClear",6),this.disabled=!1,this.modeVariant=null,this.openDirection="auto",this.size="lg",this.animation="slide",this.error=!1,this.multiselect=!1,this.filter=!1,this.normalizeText=!0,this.noResultText="No result",this.value=null,this.open=!1,this.internalValue="",this.filterResult=null,this.filterFocus=!1,this.internalDefaultValue="",this.selectedOptions=[],this.filterQuery="",this.hasFocus=!1,this.uuid=n(),this.setDefaultOption=()=>{if(this.internalDefaultValue){const t=this.multiselect?this.internalDefaultValue.split(","):[this.internalDefaultValue];this.updateDropdownStateInternal(t)}},this.getChildren=()=>{const t=Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName));return 0===t.length&&console.warn("TDS DROPDOWN: No options found. Disregard if loading data asynchronously."),t},this.getSelectedChildren=()=>0===this.selectedOptions.length?[]:this.selectedOptions.map((t=>{var o;return null===(o=this.getChildren())||void 0===o?void 0:o.find((o=>l(o.value)===l(t)))})).filter(Boolean),this.getSelectedChildrenLabels=()=>{var t;return null===(t=this.getSelectedChildren())||void 0===t?void 0:t.map((t=>{var o;return null===(o=t.textContent)||void 0===o?void 0:o.trim()}))},this.getValue=()=>{const t=this.getSelectedChildrenLabels();return t?null==t?void 0:t.join(", "):""},this.setValueAttribute=()=>{0===this.selectedOptions.length?this.host.removeAttribute("value"):this.host.setAttribute("value",this.selectedOptions.join(","))},this.getOpenDirection=()=>{var t,o,s,e,i;if("auto"===this.openDirection||!this.openDirection){const r=null!==(o=null===(t=this.dropdownList)||void 0===t?void 0:t.offsetHeight)&&void 0!==o?o:0;return(null!==(i=null===(e=(s=this.host).getBoundingClientRect)||void 0===e?void 0:e.call(s).top)&&void 0!==i?i:0)+r+57>window.innerHeight?"up":"down"}return this.openDirection},this.handleToggleOpen=()=>{var t;if(!this.disabled&&(this.open=!this.open,this.open))if(this.filter)this.focusInputElement();else{const o=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");o&&o.focus()}},this.focusInputElement=()=>{this.inputElement&&this.inputElement.focus()},this.handleFilter=t=>{const o=t.currentTarget;if(this.multiselect&&0===this.filterQuery.length&&this.selectedOptions.length>0&&this.inputElement){const t=this.getValue(),s=o.value,e=function(t,o){return t.length<=o.length+1?t:t.startsWith(o)?t.slice(o.length):t.endsWith(o)?t.slice(0,t.length-o.length):t}(s,t);e!==s&&(this.inputElement.value=e)}this.tdsInput.emit(t);const s=this.inputElement?this.inputElement.value.toLowerCase():o.value.toLowerCase();this.filterQuery=s;const e=this.getChildren();""===s?(e.forEach((t=>(t.removeAttribute("hidden"),t))),this.filterResult=null):this.filterResult=e.filter((t=>{var o;return this.normalizeString(null!==(o=null==t?void 0:t.textContent)&&void 0!==o?o:"").toLowerCase().includes(this.normalizeString(s).toLowerCase())?t.removeAttribute("hidden"):t.setAttribute("hidden",""),!t.hasAttribute("hidden")})).length},this.handleFilterReset=()=>{if(this.multiselect){if(this.filterQuery.length>0){const t=this.filterQuery;this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.getValue(),this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}else if(this.selectedOptions.length>0){const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}}else{const t=[];this.filterQuery.length>0&&(t.push(this.filterQuery),this.filterQuery="",this.resetFilterVisibility()),this.selectedOptions.length>0&&(t.push(this.selectedOptions.join(",")),this.updateDropdownStateFromUser([])),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),t.length>0&&this.tdsClear.emit({clearedValue:t.join(",")})}},this.resetFilterVisibility=()=>{this.filterQuery="",this.getChildren().forEach((t=>{t.removeAttribute("hidden")})),this.filterResult=null},this.handleMultiselectClear=()=>{const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.tdsClear.emit({clearedValue:t})},this.handleFocus=()=>{this.open=!0,this.filterFocus=!0,this.multiselect&&this.filter?this.inputElement&&(this.inputElement.value=this.getValue()):this.inputElement&&(this.inputElement.value=""),this.filter&&this.resetFilterVisibility()},this.handleBlur=()=>{this.filterFocus=!1,this.filterQuery="",this.inputElement&&(this.inputElement.value=this.getValue()),this.filter&&this.resetFilterVisibility()},this.handleInputClick=()=>{this.multiselect&&this.filter&&(this.filterQuery="",this.inputElement&&(this.inputElement.value=""),this.resetFilterVisibility())},this.resetInput=()=>{this.host.querySelector("input")&&this.reset()}}handleValueChange(t){const o=this.normalizeValue(t);(function(t,o){return t.length!==o.length||t.some((t=>!o.includes(t)))})(o,this.selectedOptions)&&this.updateDropdownStateFromUser(o)}normalizeValue(t){return null==t||""===t?[]:this.multiselect?Array.isArray(t)?d(t):t.toString().split(",").filter((t=>""!==t)):Array.isArray(t)?[l(t[0])]:[l(t)]}updateDropdownStateInternal(t){this.updateDropdownState(t,!1)}updateDropdownStateFromUser(t){this.updateDropdownState(t,!0)}updateDropdownState(t,o=!0){const s=this.validateValues(t);this.selectedOptions=[...s],this.value=this.multiselect?this.selectedOptions:this.selectedOptions[0]||null,this.internalValue=this.getValue(),this.updateOptionElements(),this.updateDisplayValue(),o&&this.emitChange(),this.setValueAttribute()}validateValues(t){const o=this.getChildren();return o&&0!==o.length?t.filter((t=>{const s=o.some((o=>l(o.value)===l(t)));return s||console.warn(`Option with value "${t}" does not exist`),s})):(console.warn("No dropdown options found"),t)}updateOptionElements(){var t;null===(t=this.getChildren())||void 0===t||t.forEach((t=>{t.setSelected(this.selectedOptions.includes(l(t.value)))}))}updateDisplayValue(){this.internalValue=this.getSelectedChildrenLabels().join(", "),this.filter&&this.inputElement&&(this.inputElement.value=this.internalValue)}emitChange(){const t=this.multiselect?this.selectedOptions.join(","):this.selectedOptions[0]||null;this.tdsChange.emit({name:this.name,value:null!=t?t:null})}async setValue(t,o){let s;return s=Array.isArray(t)?d(t):[l(t)],this.updateDropdownStateFromUser(s),this.getSelectedChildren().map((t=>{var o;return{value:t.value,label:null===(o=t.textContent)||void 0===o?void 0:o.trim()}}))}async reset(){this.updateDropdownStateFromUser([])}async removeValue(t){const o=this.selectedOptions.filter((o=>o!==t));this.updateDropdownStateFromUser(o)}async focusElement(){var t;if(this.filter)this.focusInputElement();else{const o=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");o&&o.focus()}this.handleFocus()}async close(){this.open=!1}async updateDisplay(){this.updateDisplayValue()}onAnyClick(t){this.open&&!t.composedPath().includes(this.host)&&(this.filter&&this.filterQuery&&this.tdsClear.emit({clearedValue:this.filterQuery}),this.open=!1)}onFocusIn(t){this.host.contains(t.target)&&(this.hasFocus||(this.hasFocus=!0,this.tdsFocus.emit(t)))}onFocusOut(t){const o=t.relatedTarget;!this.hasFocus||o&&this.host.contains(o)||(this.hasFocus=!1,this.handleBlur(),this.tdsBlur.emit(t))}async onKeyDown(t){var o,s;const{activeElement:e}=document;if(!e)return;const i=this.getChildren();if("ArrowDown"===t.key){const t=e.nextElementSibling?i.findIndex((t=>t===e.nextElementSibling)):0;if(i.length>0){const o=((t,o)=>{if(void 0===t[o])return 0;for(let s=o;s<t.length;s++)if(!t[s].disabled)return s})(i,t),s="number"==typeof o?i[o]:i[0];null==s||s.focus()}}else if("ArrowUp"===t.key){const t=e.nextElementSibling?this.getChildren().findIndex((t=>t===e.previousElementSibling)):0;if(i.length>0){const o=((t,o)=>{if(void 0===t[o])return t.length-1;for(let s=o;s>=0;s--)if(!t[s].disabled)return s})(i,t),s="number"==typeof o?i[o]:i[i.length-1];null==s||s.focus()}}else if("Escape"===t.key)if(this.open=!1,this.filter)null===(o=this.inputElement)||void 0===o||o.focus();else{const t=null===(s=this.host.shadowRoot)||void 0===s?void 0:s.querySelector("button");null==t||t.focus()}}handleOpenState(){this.filter&&(this.open||(this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.selectedOptions.length?this.getValue():""))),this.updateDropdownListInertState()}handleDefaultValueChange(t){null!=t&&(this.internalDefaultValue=l(t),this.setDefaultOption())}componentWillLoad(){if(null==this.value){if(null!=this.defaultValue){const t=l(this.defaultValue),o=this.multiselect?t.split(",").map(l):[t];this.updateDropdownStateInternal(o)}}else{const t=this.normalizeValue(this.value);this.updateDropdownStateInternal(t)}}handleSlotChange(){this.setDefaultOption()}normalizeString(t){return this.normalizeText?t.normalize("NFD").replace(/\p{Diacritic}/gu,""):t}async appendValue(t){this.filter&&this.filterQuery.length>0&&(this.filterQuery="",this.resetFilterVisibility()),this.updateDropdownStateFromUser(this.multiselect?[...this.selectedOptions,t]:[t]),this.filter&&this.multiselect&&this.inputElement&&(this.inputElement.value=this.getValue())}componentDidRender(){const t=this.host.closest("form");t&&t.addEventListener("reset",this.resetInput),this.updateDropdownListInertState()}disconnectedCallback(){const t=this.host.closest("form");t&&t.removeEventListener("reset",this.resetInput)}updateDropdownListInertState(){this.dropdownList&&(this.open?this.dropdownList.removeAttribute("inert"):this.dropdownList.setAttribute("inert",""))}render(){var t,o,s,e;((t,o,s,e)=>{let i=t.querySelector("input");t.querySelector("input")||(i=t.ownerDocument.createElement("input"),i.type="hidden",t.appendChild(i)),i&&(i.disabled=e,i.name=o||"",i.value=s||"")})(this.host,this.name,this.selectedOptions.join(","),this.disabled);const l=this.name||this.uuid,d=`dropdown-input-${l}`,n=this.label?`dropdown-label-${l}`:void 0,a=this.helper?`dropdown-helper-${l}`:void 0,h=this.selectedOptions.length>0,c=this.filterQuery.length>0,p=this.filterFocus||h||c,u=this.open||h,b="inside"!==this.labelPosition||u,v=null!==(t=this.tdsAriaLabel)&&void 0!==t?t:this.label?void 0:"Dropdown";let w=null!==(o=this.placeholder)&&void 0!==o?o:"";"inside"===this.labelPosition&&(w=!this.filterFocus||c||h||null===(s=this.placeholder)||void 0===s?"":s);let f="";return this.selectedOptions.length>0?f=this.getValue():b&&(f=null!==(e=this.placeholder)&&void 0!==e?e:""),i(r,{key:"e7c3ade8e5b56a41f78016c44fb75efcaaf666c1",class:{[`tds-mode-variant-${this.modeVariant}`]:Boolean(this.modeVariant)}},this.label&&"outside"===this.labelPosition&&i("div",{key:"26dd2d4137fea024b4b436fca739cfecaea13491",id:n,class:"label-outside "+(this.disabled?"disabled":"")},this.label),i("div",{key:"ce88e29fa87c4c9e54ea68bef9bde26b6300bae9",class:{"dropdown-select":!0,[this.size]:!0,disabled:this.disabled}},this.filter?i("div",{class:{filter:!0,focus:this.filterFocus,disabled:this.disabled,error:this.error}},i("div",{class:"value-wrapper"},this.label&&"inside"===this.labelPosition&&i("label",{id:n,htmlFor:d,class:{"label-inside":!0,[this.size]:!0,floated:p}},this.label),i("input",{"aria-label":v,"aria-labelledby":n,"aria-describedby":a,"aria-disabled":this.disabled,ref:t=>{this.inputElement=t,this.inputElement&&!this.filterFocus&&(this.inputElement.value=this.getValue())},class:{placeholder:"inside"===this.labelPosition},id:d,type:"text",placeholder:w,disabled:this.disabled,onInput:t=>this.handleFilter(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleInputClick(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)}})),i("tds-icon",{tabIndex:0,role:"button","aria-label":this.filterQuery.length>0?"Clear filter":"Clear selection",svgTitle:this.filterQuery.length>0?"Clear filter":"Clear selection",onClick:this.handleFilterReset,onKeyDown:t=>{"Enter"===t.key&&this.handleFilterReset()},class:{"clear-icon":!0,hide:!(this.filterQuery.length>0||this.selectedOptions.length>0)},name:"cross",size:"16px"}),i("tds-icon",{tdsAriaHidden:!0,role:"button","aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",onClick:this.handleToggleOpen,onKeyDown:t=>{"Enter"===t.key&&this.handleToggleOpen()},class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"})):i("button",{"aria-label":this.tdsAriaLabel,"aria-labelledby":n,"aria-describedby":a,"aria-disabled":this.disabled,onClick:()=>this.handleToggleOpen(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)},class:`\n ${this.selectedOptions.length?"value":"placeholder"}\n ${this.open?"open":"closed"}\n ${this.error?"error":""}\n `,disabled:this.disabled},i("div",{class:`value-wrapper ${this.size}`},this.label&&"inside"===this.labelPosition&&i("div",{id:n,class:{"label-inside":!0,[this.size]:!0,floated:u}},this.label),i("div",{"aria-label":this.tdsAriaLabel?`Selected options for ${this.tdsAriaLabel}`:void 0,class:`placeholder ${this.size}`},f)),i("tds-icon",{tabIndex:0,role:"button","aria-label":"Clear selection",svgTitle:"Clear selection",onClick:t=>{t.stopPropagation(),this.handleMultiselectClear()},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.stopPropagation(),t.preventDefault(),this.handleMultiselectClear())},class:{"clear-icon":!0,hide:!(this.multiselect&&this.selectedOptions.length>0)},name:"cross",size:"16px"}),i("tds-icon",{"aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"}))),i("div",{key:"0d76e422a2f0887595f60d57e03ec3980d4b9774",role:"listbox","aria-label":this.tdsAriaLabel,inert:!this.open,"aria-orientation":"vertical","aria-multiselectable":this.multiselect,ref:t=>{t&&(this.dropdownList=t)},class:{"dropdown-list":!0,[this.size]:!0,[this.getOpenDirection()]:!0,"label-outside":!(!this.label||"outside"!==this.labelPosition),open:this.open,closed:!this.open,[`animation-enter-${this.animation}`]:"none"!==this.animation&&this.open,[`animation-exit-${this.animation}`]:"none"!==this.animation&&!this.open}},i("slot",{key:"f971e4e9e24fe8d9092066d72bb05b76547f05a7",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&i("div",{key:"0d8f90a543bf7b8dc3b3185d27f05d0517b4e0e6",class:`no-result ${this.size}`},this.noResultText)),this.helper&&i("div",{key:"4f17cfead0616b262e91e0e5b82cf59ce1309d73",id:a,class:{helper:!0,error:this.error,disabled:this.disabled}},this.error&&i("tds-icon",{key:"032599d86280e2a204c22fb97409f097841259b5",name:"error",size:"16px"}),this.helper))}get host(){return this}static get watchers(){return{value:[{handleValueChange:0}],open:[{handleOpenState:0}],defaultValue:[{handleDefaultValueChange:0}]}}static get style(){return'@charset "UTF-8";:host button{all:unset;display:flex;align-items:center;height:100%;width:100%;box-sizing:border-box;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius);padding:0 16px}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{flex:1;min-width:0;display:flex;align-items:center;padding:0}:host button .menu-icon{margin-right:16px}: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;align-items:center;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,:root{--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,:host .dropdown-select.disabled .menu-icon{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-dropdown-label-inside-color);left:16px;transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside.lg{top:20px;left:16px}:host .dropdown-select .label-inside.md{top:16px;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 .label-inside.floated{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls)}:host .dropdown-select .label-inside.floated.lg{top:12px}:host .dropdown-select .label-inside.floated.md{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;background-color:var(--tds-dropdown-bg)}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;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 .clear-icon{cursor:pointer;flex-shrink:0;margin:0;margin-right:8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .clear-icon.hide{display:none;visibility:hidden}:host tds-icon{transition:transform var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host tds-icon.open{transform:rotateZ(180deg)}'}},[257,"tds-dropdown",{name:[1],disabled:[4],helper:[1],label:[1],labelPosition:[1,"label-position"],modeVariant:[1,"mode-variant"],openDirection:[1,"open-direction"],placeholder:[1],size:[1],animation:[1],error:[4],multiselect:[4],filter:[4],normalizeText:[4,"normalize-text"],noResultText:[1,"no-result-text"],defaultValue:[8,"default-value"],value:[1032],tdsAriaLabel:[1,"tds-aria-label"],open:[32],internalValue:[32],filterResult:[32],filterFocus:[32],internalDefaultValue:[32],selectedOptions:[32],filterQuery:[32],setValue:[64],reset:[64],removeValue:[64],focusElement:[64],close:[64],updateDisplay:[64],appendValue:[64]},[[9,"mousedown","onAnyClick"],[0,"focusin","onFocusIn"],[0,"focusout","onFocusOut"],[0,"keydown","onKeyDown"]],{value:[{handleValueChange:0}],open:[{handleOpenState:0}],defaultValue:[{handleDefaultValueChange:0}]}]);function c(){"undefined"!=typeof customElements&&["tds-dropdown","tds-icon"].forEach((o=>{switch(o){case"tds-dropdown":customElements.get(t(o))||customElements.define(t(o),h);break;case"tds-icon":customElements.get(t(o))||a()}}))}c();export{h as T,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as o,d as
|
|
1
|
+
import{T as o,d as p}from"./p-hCp8GmRl.js";const s=o,m=p;export{s as TdsDropdown,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,c as a,h as o,a as i}from"./index.js";import{d as l}from"./p-Zx1hN-_O.js";import{d}from"./p-iaLyTi5L.js";import{d as r}from"./p-Dc6aMuMv.js";import{d as n}from"./p-CIt4YhvL.js";const c=["compactDesign","horizontalScrollWidth","multiselect","expandableRows"];function b(t){t.target.classList.remove("tds-table__page-selector-input--shake")}const h=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tdsPagination=a(this,"tdsPagination",7),this.pagination=!1,this.paginationValue=1,this.rowsperpage=!0,this.rowsPerPageValues=[10,25,50],this.pages=0,this.cols=null,this.columnsNumber=0,this.compactDesign=!1,this.multiselect=!1,this.expandableRows=!1,this.lastCorrectValue=1,this.tableId="",this.horizontalScrollWidth=null,this.rowsPerPageValue=this.rowsPerPageValues[0],this.emitTdsPagination=()=>{this.tdsPagination.emit(this.rowsperpage?{tableId:this.tableId,paginationValue:Number(this.paginationValue),rowsPerPage:this.rowsPerPageValue}:{tableId:this.tableId,paginationValue:Number(this.paginationValue)})},this.previousPage=()=>{this.paginationValue>=2&&this.paginationValue--,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.nextPage=()=>{this.pages&&this.paginationValue<=this.pages&&this.paginationValue++,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.lastPage=()=>{this.paginationValue=this.pages,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.firstPage=()=>{this.paginationValue=1,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)}}internalTdsPropChangeListener(t){this.tableId===t.detail.tableId&&t.detail.changed.filter((t=>c.includes(t))).forEach((e=>{if(void 0===this[e])throw Error("Table prop is not supported: "+e);this[e]=t.detail[e]}))}colsChanged(t){null!==t?this.columnsNumber=t:this.updateColumnsNumber()}updateColumnsNumber(){var t,e,s;if(this.cols)return;let a=null!==(s=null===(e=null===(t=this.host.parentElement)||void 0===t?void 0:t.querySelector("tds-table-header"))||void 0===e?void 0:e.childElementCount)&&void 0!==s?s:0;this.multiselect&&(a+=1),this.expandableRows&&(a+=1),this.columnsNumber=a}connectedCallback(){var t;this.tableEl=this.host.closest("tds-table"),this.tableId=null===(t=this.tableEl)||void 0===t?void 0:t.tableId}componentWillLoad(){var t,e,s;c.forEach((t=>{var e;this[t]=null===(e=this.tableEl)||void 0===e?void 0:e[t]})),this.storeLastCorrectValue(this.paginationValue);const a=null!==(s=null===(e=null===(t=this.host.parentElement)||void 0===t?void 0:t.querySelector("tds-table-header"))||void 0===e?void 0:e.childElementCount)&&void 0!==s?s:0;if(this.cols)this.columnsNumber=this.cols;else{let t=a;this.multiselect&&(t+=1),this.expandableRows&&(t+=1),this.columnsNumber=t}}storeLastCorrectValue(t){this.lastCorrectValue=t}paginationInputChange(t){const e=Number(t.target.value);e>t.target.max||e<t.target.min?(t.target.classList.add("tds-table__page-selector-input--shake"),this.inputElement.value=this.lastCorrectValue+"",this.paginationValue=Number(this.inputElement.value)):this.paginationValue=e,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)}rowsPerPageChange(t){this.rowsPerPageValue=parseInt(t.detail.value),this.paginationValue>this.pages&&(this.paginationValue=this.pages),this.emitTdsPagination()}getStyles(){const t={};return this.horizontalScrollWidth&&(t.width=this.horizontalScrollWidth+"px"),t}render(){var t;return o(i,{key:"8cf70f3e746f05b392b4b95d54bfece7220633e4",class:{"tds-table--compact":this.compactDesign,"footer__horizontal-scroll":!!this.horizontalScrollWidth},style:this.getStyles()},o("tr",{key:"5cb6329b2555cc8b5d225509523e231c446b3c4a",class:"tds-table__footer-row"},o("td",{key:"6f80504a5a0ff08150815f92981ca3fc6daaefab",class:"tds-table__footer-cell",colSpan:this.columnsNumber},this.pagination&&o("div",{key:"14412d3db567342d7d24a52291de9468306111cc",class:"tds-table__pagination"},o("div",{key:"e7d3853740a5173322cb35670e39485e9ffb8c11",class:"tds-table__row-selector"},this.rowsperpage&&(null===(t=this.rowsPerPageValues)||void 0===t?void 0:t.length)>0&&o("div",{key:"9f92698875cacaa25910597a7361fcbcda4318c6",class:"rows-per-page"},o("p",{key:"f046870d8bdbe7f90625e36a37b8b3720f72ff12"},"Rows per page"),o("tds-dropdown",{key:"c75c1ef3c1a66e8ec7a130d24dca504148b8113e",modeVariant:"secondary",id:"rows-dropdown",class:"page-dropdown",size:"xs",defaultValue:""+this.rowsPerPageValues[0],onTdsChange:t=>this.rowsPerPageChange(t)},this.rowsPerPageValues.map((t=>o("tds-dropdown-option",{value:""+t},t)))))),o("div",{key:"dd171addd35fdfb1f4a90e545dd3d4a56568436f",class:"tds-table__page-selector"},o("input",{key:"af61e22ec0dfa8468ee32ed0343aae28bc54f101",ref:t=>{t&&(this.inputElement=t)},class:"tds-table__page-selector-input",type:"number",min:"1",max:this.pages,value:this.paginationValue,pattern:"[0-9]+",dir:"ltr",onChange:t=>this.paginationInputChange(t),onAnimationEnd:b}),o("p",{key:"d741a6d807bcbc9d3b132092b827b99ac7c27764",class:"tds-table__footer-text"},"of ",o("span",{key:"ba74d91e5ed8796c0c17e73e53f4ea9385cdbdb5"},this.pages)," pages"),o("button",{key:"7ba4cb7b425c0aba89cde7e925d3b50ebd28070d",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.firstPage()},o("tds-icon",{key:"2b6ddc50e9d584cf4e7530a6f3a8a20b67035c89",name:"skip_backwards",size:"20px"})),o("button",{key:"5dd123e068da4d89552c6403aefa32e6c037c571",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.previousPage()},o("tds-icon",{key:"86da02b6cde0c0aac91a5bbde6a705c8499f7516",name:"chevron_left",size:"20px"})),o("button",{key:"d8208da719503be3edc6397a82d196c76beac598",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.nextPage()},o("tds-icon",{key:"f52872c6cf209a65658f4cf8f9ca7f309a94793b",name:"chevron_right",size:"20px"})),o("button",{key:"b1e5db7b0dffd15b920db01ed3f02d5c5940e288",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.lastPage()},o("tds-icon",{key:"52ec734eaa1992709ac6ffc32f6d493e8ebd86a9",name:"skip_forward",size:"20px"})))))))}get host(){return this}static get watchers(){return{cols:[{colsChanged:0}],multiselect:[{updateColumnsNumber:0}],expandableRows:[{updateColumnsNumber:0}]}}static get style(){return":host{box-sizing:border-box;display:table-footer-group;height:var(--tds-spacing-element-48)}:host *{box-sizing:border-box}:host .tds-table__footer-row{background-color:var(--tds-table-footer-background);color:var(--tds-table-color)}:host .tds-table__footer-cell{padding:0 var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-48);display:flex;align-items:center;justify-content:space-between}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector{display:flex;align-items:center}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page{display:flex;align-items:center;margin-right:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page p,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page p{margin-right:var(--tds-spacing-element-8)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-table-footer-page-selector-input-background);color:var(--tds-table-color);width:74px;height:30px;border:none;border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;margin-right:var(--tds-spacing-element-4);padding-left:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:hover{background-color:var(--tds-table-footer-page-selector-input-background-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:disabled{color:var(--tds-table-footer-page-selector-input-color-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input--shake{animation:tds-shake-animation 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;transform:translate3d(0, 0, 0);backface-visibility:hidden;perspective:1000px}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-text{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:1px 8px 0 0}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{display:flex;justify-content:center;align-items:center;border:none;background-color:transparent;cursor:pointer;height:var(--tds-spacing-element-32);width:var(--tds-spacing-element-32);border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;color:var(--tds-table-footer-page-selector-icon)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:hover{background-color:var(--tds-table-footer-btn-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled{cursor:default;color:var(--tds-table-footer-page-selector-icon-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled:hover{background-color:transparent}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn-svg{height:var(--tds-spacing-element-20);width:var(--tds-spacing-element-20);fill:var(--tds-table-color)}:host(.tds-table--compact){height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{height:var(--tds-spacing-element-24)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{height:28px;width:28px}:host(.footer__horizontal-scroll){display:inline-table;position:absolute;margin-top:10px}@keyframes tds-shake-animation{10%,90%{transform:translate3d(-1px, 0, 0)}20%,80%{transform:translate3d(2px, 0, 0)}30%,50%,70%{transform:translate3d(-4px, 0, 0)}40%,60%{transform:translate3d(4px, 0, 0)}}"}},[1,"tds-table-footer",{pagination:[516],paginationValue:[1538,"pagination-value"],rowsperpage:[516],rowsPerPageValues:[16],pages:[514],cols:[2],columnsNumber:[32],compactDesign:[32],multiselect:[32],expandableRows:[32],lastCorrectValue:[32],tableId:[32],horizontalScrollWidth:[32],rowsPerPageValue:[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]],{cols:[{colsChanged:0}],multiselect:[{updateColumnsNumber:0}],expandableRows:[{updateColumnsNumber:0}]}]);function p(){"undefined"!=typeof customElements&&["tds-table-footer","tds-checkbox","tds-dropdown","tds-dropdown-option","tds-icon"].forEach((e=>{switch(e){case"tds-table-footer":customElements.get(t(e))||customElements.define(t(e),h);break;case"tds-checkbox":customElements.get(t(e))||l();break;case"tds-dropdown":customElements.get(t(e))||d();break;case"tds-dropdown-option":customElements.get(t(e))||r();break;case"tds-icon":customElements.get(t(e))||n()}}))}p();const _=h,g=p;export{_ as TdsTableFooter,g as defineCustomElement}
|
|
1
|
+
import{t,p as e,H as s,c as a,h as o,a as i}from"./index.js";import{d as l}from"./p-Zx1hN-_O.js";import{d}from"./p-hCp8GmRl.js";import{d as r}from"./p-Dc6aMuMv.js";import{d as n}from"./p-CIt4YhvL.js";const c=["compactDesign","horizontalScrollWidth","multiselect","expandableRows"];function b(t){t.target.classList.remove("tds-table__page-selector-input--shake")}const h=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tdsPagination=a(this,"tdsPagination",7),this.pagination=!1,this.paginationValue=1,this.rowsperpage=!0,this.rowsPerPageValues=[10,25,50],this.pages=0,this.cols=null,this.columnsNumber=0,this.compactDesign=!1,this.multiselect=!1,this.expandableRows=!1,this.lastCorrectValue=1,this.tableId="",this.horizontalScrollWidth=null,this.rowsPerPageValue=this.rowsPerPageValues[0],this.emitTdsPagination=()=>{this.tdsPagination.emit(this.rowsperpage?{tableId:this.tableId,paginationValue:Number(this.paginationValue),rowsPerPage:this.rowsPerPageValue}:{tableId:this.tableId,paginationValue:Number(this.paginationValue)})},this.previousPage=()=>{this.paginationValue>=2&&this.paginationValue--,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.nextPage=()=>{this.pages&&this.paginationValue<=this.pages&&this.paginationValue++,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.lastPage=()=>{this.paginationValue=this.pages,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.firstPage=()=>{this.paginationValue=1,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)}}internalTdsPropChangeListener(t){this.tableId===t.detail.tableId&&t.detail.changed.filter((t=>c.includes(t))).forEach((e=>{if(void 0===this[e])throw Error("Table prop is not supported: "+e);this[e]=t.detail[e]}))}colsChanged(t){null!==t?this.columnsNumber=t:this.updateColumnsNumber()}updateColumnsNumber(){var t,e,s;if(this.cols)return;let a=null!==(s=null===(e=null===(t=this.host.parentElement)||void 0===t?void 0:t.querySelector("tds-table-header"))||void 0===e?void 0:e.childElementCount)&&void 0!==s?s:0;this.multiselect&&(a+=1),this.expandableRows&&(a+=1),this.columnsNumber=a}connectedCallback(){var t;this.tableEl=this.host.closest("tds-table"),this.tableId=null===(t=this.tableEl)||void 0===t?void 0:t.tableId}componentWillLoad(){var t,e,s;c.forEach((t=>{var e;this[t]=null===(e=this.tableEl)||void 0===e?void 0:e[t]})),this.storeLastCorrectValue(this.paginationValue);const a=null!==(s=null===(e=null===(t=this.host.parentElement)||void 0===t?void 0:t.querySelector("tds-table-header"))||void 0===e?void 0:e.childElementCount)&&void 0!==s?s:0;if(this.cols)this.columnsNumber=this.cols;else{let t=a;this.multiselect&&(t+=1),this.expandableRows&&(t+=1),this.columnsNumber=t}}storeLastCorrectValue(t){this.lastCorrectValue=t}paginationInputChange(t){const e=Number(t.target.value);e>t.target.max||e<t.target.min?(t.target.classList.add("tds-table__page-selector-input--shake"),this.inputElement.value=this.lastCorrectValue+"",this.paginationValue=Number(this.inputElement.value)):this.paginationValue=e,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)}rowsPerPageChange(t){this.rowsPerPageValue=parseInt(t.detail.value),this.paginationValue>this.pages&&(this.paginationValue=this.pages),this.emitTdsPagination()}getStyles(){const t={};return this.horizontalScrollWidth&&(t.width=this.horizontalScrollWidth+"px"),t}render(){var t;return o(i,{key:"8cf70f3e746f05b392b4b95d54bfece7220633e4",class:{"tds-table--compact":this.compactDesign,"footer__horizontal-scroll":!!this.horizontalScrollWidth},style:this.getStyles()},o("tr",{key:"5cb6329b2555cc8b5d225509523e231c446b3c4a",class:"tds-table__footer-row"},o("td",{key:"6f80504a5a0ff08150815f92981ca3fc6daaefab",class:"tds-table__footer-cell",colSpan:this.columnsNumber},this.pagination&&o("div",{key:"14412d3db567342d7d24a52291de9468306111cc",class:"tds-table__pagination"},o("div",{key:"e7d3853740a5173322cb35670e39485e9ffb8c11",class:"tds-table__row-selector"},this.rowsperpage&&(null===(t=this.rowsPerPageValues)||void 0===t?void 0:t.length)>0&&o("div",{key:"9f92698875cacaa25910597a7361fcbcda4318c6",class:"rows-per-page"},o("p",{key:"f046870d8bdbe7f90625e36a37b8b3720f72ff12"},"Rows per page"),o("tds-dropdown",{key:"c75c1ef3c1a66e8ec7a130d24dca504148b8113e",modeVariant:"secondary",id:"rows-dropdown",class:"page-dropdown",size:"xs",defaultValue:""+this.rowsPerPageValues[0],onTdsChange:t=>this.rowsPerPageChange(t)},this.rowsPerPageValues.map((t=>o("tds-dropdown-option",{value:""+t},t)))))),o("div",{key:"dd171addd35fdfb1f4a90e545dd3d4a56568436f",class:"tds-table__page-selector"},o("input",{key:"af61e22ec0dfa8468ee32ed0343aae28bc54f101",ref:t=>{t&&(this.inputElement=t)},class:"tds-table__page-selector-input",type:"number",min:"1",max:this.pages,value:this.paginationValue,pattern:"[0-9]+",dir:"ltr",onChange:t=>this.paginationInputChange(t),onAnimationEnd:b}),o("p",{key:"d741a6d807bcbc9d3b132092b827b99ac7c27764",class:"tds-table__footer-text"},"of ",o("span",{key:"ba74d91e5ed8796c0c17e73e53f4ea9385cdbdb5"},this.pages)," pages"),o("button",{key:"7ba4cb7b425c0aba89cde7e925d3b50ebd28070d",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.firstPage()},o("tds-icon",{key:"2b6ddc50e9d584cf4e7530a6f3a8a20b67035c89",name:"skip_backwards",size:"20px"})),o("button",{key:"5dd123e068da4d89552c6403aefa32e6c037c571",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.previousPage()},o("tds-icon",{key:"86da02b6cde0c0aac91a5bbde6a705c8499f7516",name:"chevron_left",size:"20px"})),o("button",{key:"d8208da719503be3edc6397a82d196c76beac598",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.nextPage()},o("tds-icon",{key:"f52872c6cf209a65658f4cf8f9ca7f309a94793b",name:"chevron_right",size:"20px"})),o("button",{key:"b1e5db7b0dffd15b920db01ed3f02d5c5940e288",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.lastPage()},o("tds-icon",{key:"52ec734eaa1992709ac6ffc32f6d493e8ebd86a9",name:"skip_forward",size:"20px"})))))))}get host(){return this}static get watchers(){return{cols:[{colsChanged:0}],multiselect:[{updateColumnsNumber:0}],expandableRows:[{updateColumnsNumber:0}]}}static get style(){return":host{box-sizing:border-box;display:table-footer-group;height:var(--tds-spacing-element-48)}:host *{box-sizing:border-box}:host .tds-table__footer-row{background-color:var(--tds-table-footer-background);color:var(--tds-table-color)}:host .tds-table__footer-cell{padding:0 var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-48);display:flex;align-items:center;justify-content:space-between}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector{display:flex;align-items:center}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page{display:flex;align-items:center;margin-right:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page p,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page p{margin-right:var(--tds-spacing-element-8)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-table-footer-page-selector-input-background);color:var(--tds-table-color);width:74px;height:30px;border:none;border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;margin-right:var(--tds-spacing-element-4);padding-left:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:hover{background-color:var(--tds-table-footer-page-selector-input-background-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:disabled{color:var(--tds-table-footer-page-selector-input-color-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input--shake{animation:tds-shake-animation 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;transform:translate3d(0, 0, 0);backface-visibility:hidden;perspective:1000px}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-text{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:1px 8px 0 0}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{display:flex;justify-content:center;align-items:center;border:none;background-color:transparent;cursor:pointer;height:var(--tds-spacing-element-32);width:var(--tds-spacing-element-32);border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;color:var(--tds-table-footer-page-selector-icon)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:hover{background-color:var(--tds-table-footer-btn-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled{cursor:default;color:var(--tds-table-footer-page-selector-icon-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled:hover{background-color:transparent}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn-svg{height:var(--tds-spacing-element-20);width:var(--tds-spacing-element-20);fill:var(--tds-table-color)}:host(.tds-table--compact){height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{height:var(--tds-spacing-element-24)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{height:28px;width:28px}:host(.footer__horizontal-scroll){display:inline-table;position:absolute;margin-top:10px}@keyframes tds-shake-animation{10%,90%{transform:translate3d(-1px, 0, 0)}20%,80%{transform:translate3d(2px, 0, 0)}30%,50%,70%{transform:translate3d(-4px, 0, 0)}40%,60%{transform:translate3d(4px, 0, 0)}}"}},[1,"tds-table-footer",{pagination:[516],paginationValue:[1538,"pagination-value"],rowsperpage:[516],rowsPerPageValues:[16],pages:[514],cols:[2],columnsNumber:[32],compactDesign:[32],multiselect:[32],expandableRows:[32],lastCorrectValue:[32],tableId:[32],horizontalScrollWidth:[32],rowsPerPageValue:[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]],{cols:[{colsChanged:0}],multiselect:[{updateColumnsNumber:0}],expandableRows:[{updateColumnsNumber:0}]}]);function p(){"undefined"!=typeof customElements&&["tds-table-footer","tds-checkbox","tds-dropdown","tds-dropdown-option","tds-icon"].forEach((e=>{switch(e){case"tds-table-footer":customElements.get(t(e))||customElements.define(t(e),h);break;case"tds-checkbox":customElements.get(t(e))||l();break;case"tds-dropdown":customElements.get(t(e))||d();break;case"tds-dropdown-option":customElements.get(t(e))||r();break;case"tds-icon":customElements.get(t(e))||n()}}))}p();const _=h,g=p;export{_ as TdsTableFooter,g as defineCustomElement}
|
|
@@ -140,7 +140,13 @@ const TdsDropdown = class {
|
|
|
140
140
|
this.updateDropdownStateInternal(defaultValues);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
this.getChildren = () =>
|
|
143
|
+
this.getChildren = () => {
|
|
144
|
+
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
145
|
+
if (tdsDropdownOptions.length === 0) {
|
|
146
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
147
|
+
}
|
|
148
|
+
return tdsDropdownOptions;
|
|
149
|
+
};
|
|
144
150
|
this.getSelectedChildren = () => {
|
|
145
151
|
if (this.selectedOptions.length === 0)
|
|
146
152
|
return [];
|
|
@@ -404,14 +410,16 @@ const TdsDropdown = class {
|
|
|
404
410
|
this.setValueAttribute();
|
|
405
411
|
}
|
|
406
412
|
validateValues(values) {
|
|
413
|
+
/** Make sure we have children before validation */
|
|
407
414
|
const children = this.getChildren();
|
|
408
415
|
if (!children || children.length === 0) {
|
|
416
|
+
console.warn('No dropdown options found');
|
|
409
417
|
return values; /** Return original values if no children yet */
|
|
410
418
|
}
|
|
411
419
|
return values.filter((val) => {
|
|
412
420
|
const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
|
|
413
421
|
if (!isValid) {
|
|
414
|
-
console.warn(`
|
|
422
|
+
console.warn(`Option with value "${val}" does not exist`);
|
|
415
423
|
}
|
|
416
424
|
return isValid;
|
|
417
425
|
});
|
|
@@ -620,12 +628,7 @@ const TdsDropdown = class {
|
|
|
620
628
|
}
|
|
621
629
|
/** Method to handle slot changes */
|
|
622
630
|
handleSlotChange() {
|
|
623
|
-
|
|
624
|
-
this.updateDropdownStateInternal([...this.selectedOptions]);
|
|
625
|
-
}
|
|
626
|
-
else if (this.internalDefaultValue) {
|
|
627
|
-
this.setDefaultOption();
|
|
628
|
-
}
|
|
631
|
+
this.setDefaultOption();
|
|
629
632
|
}
|
|
630
633
|
/** Method to check if we should normalize text */
|
|
631
634
|
normalizeString(text) {
|
|
@@ -703,9 +706,9 @@ const TdsDropdown = class {
|
|
|
703
706
|
else if (showPlaceholderButton) {
|
|
704
707
|
buttonText = (_d = this.placeholder) !== null && _d !== void 0 ? _d : '';
|
|
705
708
|
}
|
|
706
|
-
return (h(Host, { key: '
|
|
709
|
+
return (h(Host, { key: 'e7c3ade8e5b56a41f78016c44fb75efcaaf666c1', class: {
|
|
707
710
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
708
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
711
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '26dd2d4137fea024b4b436fca739cfecaea13491', id: labelId, class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'ce88e29fa87c4c9e54ea68bef9bde26b6300bae9', class: {
|
|
709
712
|
'dropdown-select': true,
|
|
710
713
|
[this.size]: true,
|
|
711
714
|
'disabled': this.disabled,
|
|
@@ -764,7 +767,7 @@ const TdsDropdown = class {
|
|
|
764
767
|
}, class: {
|
|
765
768
|
'clear-icon': true,
|
|
766
769
|
'hide': !(this.multiselect && this.selectedOptions.length > 0),
|
|
767
|
-
}, name: "cross", size: "16px" }), 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: '
|
|
770
|
+
}, name: "cross", size: "16px" }), 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: '0d76e422a2f0887595f60d57e03ec3980d4b9774', role: "listbox", "aria-label": this.tdsAriaLabel, inert: !this.open, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
768
771
|
if (element)
|
|
769
772
|
this.dropdownList = element;
|
|
770
773
|
}, class: {
|
|
@@ -776,11 +779,11 @@ const TdsDropdown = class {
|
|
|
776
779
|
'closed': !this.open,
|
|
777
780
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
778
781
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
779
|
-
} }, h("slot", { key: '
|
|
782
|
+
} }, h("slot", { key: 'f971e4e9e24fe8d9092066d72bb05b76547f05a7', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '0d8f90a543bf7b8dc3b3185d27f05d0517b4e0e6', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '4f17cfead0616b262e91e0e5b82cf59ce1309d73', id: helperId, class: {
|
|
780
783
|
helper: true,
|
|
781
784
|
error: this.error,
|
|
782
785
|
disabled: this.disabled,
|
|
783
|
-
} }, this.error && h("tds-icon", { key: '
|
|
786
|
+
} }, this.error && h("tds-icon", { key: '032599d86280e2a204c22fb97409f097841259b5', name: "error", size: "16px" }), this.helper))));
|
|
784
787
|
}
|
|
785
788
|
get host() { return getElement(this); }
|
|
786
789
|
static get watchers() { return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as o,h as s,H as i,a as e}from"./p-9xxNGlso.js";import{g as r}from"./p-Cn4f8w1e.js";const d=t=>null==t?"":t.toString(),l=t=>t.map((t=>d(t))),n=class{constructor(s){t(this,s),this.tdsChange=o(this,"tdsChange",6),this.tdsFocus=o(this,"tdsFocus",6),this.tdsBlur=o(this,"tdsBlur",6),this.tdsInput=o(this,"tdsInput",6),this.tdsClear=o(this,"tdsClear",6),this.disabled=!1,this.modeVariant=null,this.openDirection="auto",this.size="lg",this.animation="slide",this.error=!1,this.multiselect=!1,this.filter=!1,this.normalizeText=!0,this.noResultText="No result",this.value=null,this.open=!1,this.internalValue="",this.filterResult=null,this.filterFocus=!1,this.internalDefaultValue="",this.selectedOptions=[],this.filterQuery="",this.hasFocus=!1,this.uuid=r(),this.setDefaultOption=()=>{if(this.internalDefaultValue){const t=this.multiselect?this.internalDefaultValue.split(","):[this.internalDefaultValue];this.updateDropdownStateInternal(t)}},this.getChildren=()=>{const t=Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName));return 0===t.length&&console.warn("TDS DROPDOWN: No options found. Disregard if loading data asynchronously."),t},this.getSelectedChildren=()=>0===this.selectedOptions.length?[]:this.selectedOptions.map((t=>{var o;return null===(o=this.getChildren())||void 0===o?void 0:o.find((o=>d(o.value)===d(t)))})).filter(Boolean),this.getSelectedChildrenLabels=()=>{var t;return null===(t=this.getSelectedChildren())||void 0===t?void 0:t.map((t=>{var o;return null===(o=t.textContent)||void 0===o?void 0:o.trim()}))},this.getValue=()=>{const t=this.getSelectedChildrenLabels();return t?null==t?void 0:t.join(", "):""},this.setValueAttribute=()=>{0===this.selectedOptions.length?this.host.removeAttribute("value"):this.host.setAttribute("value",this.selectedOptions.join(","))},this.getOpenDirection=()=>{var t,o,s,i,e;if("auto"===this.openDirection||!this.openDirection){const r=null!==(o=null===(t=this.dropdownList)||void 0===t?void 0:t.offsetHeight)&&void 0!==o?o:0;return(null!==(e=null===(i=(s=this.host).getBoundingClientRect)||void 0===i?void 0:i.call(s).top)&&void 0!==e?e:0)+r+57>window.innerHeight?"up":"down"}return this.openDirection},this.handleToggleOpen=()=>{var t;if(!this.disabled&&(this.open=!this.open,this.open))if(this.filter)this.focusInputElement();else{const o=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");o&&o.focus()}},this.focusInputElement=()=>{this.inputElement&&this.inputElement.focus()},this.handleFilter=t=>{const o=t.currentTarget;if(this.multiselect&&0===this.filterQuery.length&&this.selectedOptions.length>0&&this.inputElement){const t=this.getValue(),s=o.value,i=function(t,o){return t.length<=o.length+1?t:t.startsWith(o)?t.slice(o.length):t.endsWith(o)?t.slice(0,t.length-o.length):t}(s,t);i!==s&&(this.inputElement.value=i)}this.tdsInput.emit(t);const s=this.inputElement?this.inputElement.value.toLowerCase():o.value.toLowerCase();this.filterQuery=s;const i=this.getChildren();""===s?(i.forEach((t=>(t.removeAttribute("hidden"),t))),this.filterResult=null):this.filterResult=i.filter((t=>{var o;return this.normalizeString(null!==(o=null==t?void 0:t.textContent)&&void 0!==o?o:"").toLowerCase().includes(this.normalizeString(s).toLowerCase())?t.removeAttribute("hidden"):t.setAttribute("hidden",""),!t.hasAttribute("hidden")})).length},this.handleFilterReset=()=>{if(this.multiselect){if(this.filterQuery.length>0){const t=this.filterQuery;this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.getValue(),this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}else if(this.selectedOptions.length>0){const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}}else{const t=[];this.filterQuery.length>0&&(t.push(this.filterQuery),this.filterQuery="",this.resetFilterVisibility()),this.selectedOptions.length>0&&(t.push(this.selectedOptions.join(",")),this.updateDropdownStateFromUser([])),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),t.length>0&&this.tdsClear.emit({clearedValue:t.join(",")})}},this.resetFilterVisibility=()=>{this.filterQuery="",this.getChildren().forEach((t=>{t.removeAttribute("hidden")})),this.filterResult=null},this.handleMultiselectClear=()=>{const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.tdsClear.emit({clearedValue:t})},this.handleFocus=()=>{this.open=!0,this.filterFocus=!0,this.multiselect&&this.filter?this.inputElement&&(this.inputElement.value=this.getValue()):this.inputElement&&(this.inputElement.value=""),this.filter&&this.resetFilterVisibility()},this.handleBlur=()=>{this.filterFocus=!1,this.filterQuery="",this.inputElement&&(this.inputElement.value=this.getValue()),this.filter&&this.resetFilterVisibility()},this.handleInputClick=()=>{this.multiselect&&this.filter&&(this.filterQuery="",this.inputElement&&(this.inputElement.value=""),this.resetFilterVisibility())},this.resetInput=()=>{this.host.querySelector("input")&&this.reset()}}handleValueChange(t){const o=this.normalizeValue(t);(function(t,o){return t.length!==o.length||t.some((t=>!o.includes(t)))})(o,this.selectedOptions)&&this.updateDropdownStateFromUser(o)}normalizeValue(t){return null==t||""===t?[]:this.multiselect?Array.isArray(t)?l(t):t.toString().split(",").filter((t=>""!==t)):Array.isArray(t)?[d(t[0])]:[d(t)]}updateDropdownStateInternal(t){this.updateDropdownState(t,!1)}updateDropdownStateFromUser(t){this.updateDropdownState(t,!0)}updateDropdownState(t,o=!0){const s=this.validateValues(t);this.selectedOptions=[...s],this.value=this.multiselect?this.selectedOptions:this.selectedOptions[0]||null,this.internalValue=this.getValue(),this.updateOptionElements(),this.updateDisplayValue(),o&&this.emitChange(),this.setValueAttribute()}validateValues(t){const o=this.getChildren();return o&&0!==o.length?t.filter((t=>{const s=o.some((o=>d(o.value)===d(t)));return s||console.warn(`Option with value "${t}" does not exist`),s})):(console.warn("No dropdown options found"),t)}updateOptionElements(){var t;null===(t=this.getChildren())||void 0===t||t.forEach((t=>{t.setSelected(this.selectedOptions.includes(d(t.value)))}))}updateDisplayValue(){this.internalValue=this.getSelectedChildrenLabels().join(", "),this.filter&&this.inputElement&&(this.inputElement.value=this.internalValue)}emitChange(){const t=this.multiselect?this.selectedOptions.join(","):this.selectedOptions[0]||null;this.tdsChange.emit({name:this.name,value:null!=t?t:null})}async setValue(t,o){let s;return s=Array.isArray(t)?l(t):[d(t)],this.updateDropdownStateFromUser(s),this.getSelectedChildren().map((t=>{var o;return{value:t.value,label:null===(o=t.textContent)||void 0===o?void 0:o.trim()}}))}async reset(){this.updateDropdownStateFromUser([])}async removeValue(t){const o=this.selectedOptions.filter((o=>o!==t));this.updateDropdownStateFromUser(o)}async focusElement(){var t;if(this.filter)this.focusInputElement();else{const o=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");o&&o.focus()}this.handleFocus()}async close(){this.open=!1}async updateDisplay(){this.updateDisplayValue()}onAnyClick(t){this.open&&!t.composedPath().includes(this.host)&&(this.filter&&this.filterQuery&&this.tdsClear.emit({clearedValue:this.filterQuery}),this.open=!1)}onFocusIn(t){this.host.contains(t.target)&&(this.hasFocus||(this.hasFocus=!0,this.tdsFocus.emit(t)))}onFocusOut(t){const o=t.relatedTarget;!this.hasFocus||o&&this.host.contains(o)||(this.hasFocus=!1,this.handleBlur(),this.tdsBlur.emit(t))}async onKeyDown(t){var o,s;const{activeElement:i}=document;if(!i)return;const e=this.getChildren();if("ArrowDown"===t.key){const t=i.nextElementSibling?e.findIndex((t=>t===i.nextElementSibling)):0;if(e.length>0){const o=((t,o)=>{if(void 0===t[o])return 0;for(let s=o;s<t.length;s++)if(!t[s].disabled)return s})(e,t),s="number"==typeof o?e[o]:e[0];null==s||s.focus()}}else if("ArrowUp"===t.key){const t=i.nextElementSibling?this.getChildren().findIndex((t=>t===i.previousElementSibling)):0;if(e.length>0){const o=((t,o)=>{if(void 0===t[o])return t.length-1;for(let s=o;s>=0;s--)if(!t[s].disabled)return s})(e,t),s="number"==typeof o?e[o]:e[e.length-1];null==s||s.focus()}}else if("Escape"===t.key)if(this.open=!1,this.filter)null===(o=this.inputElement)||void 0===o||o.focus();else{const t=null===(s=this.host.shadowRoot)||void 0===s?void 0:s.querySelector("button");null==t||t.focus()}}handleOpenState(){this.filter&&(this.open||(this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.selectedOptions.length?this.getValue():""))),this.updateDropdownListInertState()}handleDefaultValueChange(t){null!=t&&(this.internalDefaultValue=d(t),this.setDefaultOption())}componentWillLoad(){if(null==this.value){if(null!=this.defaultValue){const t=d(this.defaultValue),o=this.multiselect?t.split(",").map(d):[t];this.updateDropdownStateInternal(o)}}else{const t=this.normalizeValue(this.value);this.updateDropdownStateInternal(t)}}handleSlotChange(){this.setDefaultOption()}normalizeString(t){return this.normalizeText?t.normalize("NFD").replace(/\p{Diacritic}/gu,""):t}async appendValue(t){this.filter&&this.filterQuery.length>0&&(this.filterQuery="",this.resetFilterVisibility()),this.updateDropdownStateFromUser(this.multiselect?[...this.selectedOptions,t]:[t]),this.filter&&this.multiselect&&this.inputElement&&(this.inputElement.value=this.getValue())}componentDidRender(){const t=this.host.closest("form");t&&t.addEventListener("reset",this.resetInput),this.updateDropdownListInertState()}disconnectedCallback(){const t=this.host.closest("form");t&&t.removeEventListener("reset",this.resetInput)}updateDropdownListInertState(){this.dropdownList&&(this.open?this.dropdownList.removeAttribute("inert"):this.dropdownList.setAttribute("inert",""))}render(){var t,o,e,r;((t,o,s,i)=>{let e=t.querySelector("input");t.querySelector("input")||(e=t.ownerDocument.createElement("input"),e.type="hidden",t.appendChild(e)),e&&(e.disabled=i,e.name=o||"",e.value=s||"")})(this.host,this.name,this.selectedOptions.join(","),this.disabled);const d=this.name||this.uuid,l=`dropdown-input-${d}`,n=this.label?`dropdown-label-${d}`:void 0,h=this.helper?`dropdown-helper-${d}`:void 0,a=this.selectedOptions.length>0,p=this.filterQuery.length>0,c=this.filterFocus||a||p,b=this.open||a,u="inside"!==this.labelPosition||b,v=null!==(t=this.tdsAriaLabel)&&void 0!==t?t:this.label?void 0:"Dropdown";let w=null!==(o=this.placeholder)&&void 0!==o?o:"";"inside"===this.labelPosition&&(w=!this.filterFocus||p||a||null===(e=this.placeholder)||void 0===e?"":e);let f="";return this.selectedOptions.length>0?f=this.getValue():u&&(f=null!==(r=this.placeholder)&&void 0!==r?r:""),s(i,{key:"e7c3ade8e5b56a41f78016c44fb75efcaaf666c1",class:{[`tds-mode-variant-${this.modeVariant}`]:Boolean(this.modeVariant)}},this.label&&"outside"===this.labelPosition&&s("div",{key:"26dd2d4137fea024b4b436fca739cfecaea13491",id:n,class:"label-outside "+(this.disabled?"disabled":"")},this.label),s("div",{key:"ce88e29fa87c4c9e54ea68bef9bde26b6300bae9",class:{"dropdown-select":!0,[this.size]:!0,disabled:this.disabled}},this.filter?s("div",{class:{filter:!0,focus:this.filterFocus,disabled:this.disabled,error:this.error}},s("div",{class:"value-wrapper"},this.label&&"inside"===this.labelPosition&&s("label",{id:n,htmlFor:l,class:{"label-inside":!0,[this.size]:!0,floated:c}},this.label),s("input",{"aria-label":v,"aria-labelledby":n,"aria-describedby":h,"aria-disabled":this.disabled,ref:t=>{this.inputElement=t,this.inputElement&&!this.filterFocus&&(this.inputElement.value=this.getValue())},class:{placeholder:"inside"===this.labelPosition},id:l,type:"text",placeholder:w,disabled:this.disabled,onInput:t=>this.handleFilter(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleInputClick(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)}})),s("tds-icon",{tabIndex:0,role:"button","aria-label":this.filterQuery.length>0?"Clear filter":"Clear selection",svgTitle:this.filterQuery.length>0?"Clear filter":"Clear selection",onClick:this.handleFilterReset,onKeyDown:t=>{"Enter"===t.key&&this.handleFilterReset()},class:{"clear-icon":!0,hide:!(this.filterQuery.length>0||this.selectedOptions.length>0)},name:"cross",size:"16px"}),s("tds-icon",{tdsAriaHidden:!0,role:"button","aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",onClick:this.handleToggleOpen,onKeyDown:t=>{"Enter"===t.key&&this.handleToggleOpen()},class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"})):s("button",{"aria-label":this.tdsAriaLabel,"aria-labelledby":n,"aria-describedby":h,"aria-disabled":this.disabled,onClick:()=>this.handleToggleOpen(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)},class:`\n ${this.selectedOptions.length?"value":"placeholder"}\n ${this.open?"open":"closed"}\n ${this.error?"error":""}\n `,disabled:this.disabled},s("div",{class:`value-wrapper ${this.size}`},this.label&&"inside"===this.labelPosition&&s("div",{id:n,class:{"label-inside":!0,[this.size]:!0,floated:b}},this.label),s("div",{"aria-label":this.tdsAriaLabel?`Selected options for ${this.tdsAriaLabel}`:void 0,class:`placeholder ${this.size}`},f)),s("tds-icon",{tabIndex:0,role:"button","aria-label":"Clear selection",svgTitle:"Clear selection",onClick:t=>{t.stopPropagation(),this.handleMultiselectClear()},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.stopPropagation(),t.preventDefault(),this.handleMultiselectClear())},class:{"clear-icon":!0,hide:!(this.multiselect&&this.selectedOptions.length>0)},name:"cross",size:"16px"}),s("tds-icon",{"aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"}))),s("div",{key:"0d76e422a2f0887595f60d57e03ec3980d4b9774",role:"listbox","aria-label":this.tdsAriaLabel,inert:!this.open,"aria-orientation":"vertical","aria-multiselectable":this.multiselect,ref:t=>{t&&(this.dropdownList=t)},class:{"dropdown-list":!0,[this.size]:!0,[this.getOpenDirection()]:!0,"label-outside":!(!this.label||"outside"!==this.labelPosition),open:this.open,closed:!this.open,[`animation-enter-${this.animation}`]:"none"!==this.animation&&this.open,[`animation-exit-${this.animation}`]:"none"!==this.animation&&!this.open}},s("slot",{key:"f971e4e9e24fe8d9092066d72bb05b76547f05a7",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&s("div",{key:"0d8f90a543bf7b8dc3b3185d27f05d0517b4e0e6",class:`no-result ${this.size}`},this.noResultText)),this.helper&&s("div",{key:"4f17cfead0616b262e91e0e5b82cf59ce1309d73",id:h,class:{helper:!0,error:this.error,disabled:this.disabled}},this.error&&s("tds-icon",{key:"032599d86280e2a204c22fb97409f097841259b5",name:"error",size:"16px"}),this.helper))}get host(){return e(this)}static get watchers(){return{value:[{handleValueChange:0}],open:[{handleOpenState:0}],defaultValue:[{handleDefaultValueChange:0}]}}};n.style='@charset "UTF-8";:host button{all:unset;display:flex;align-items:center;height:100%;width:100%;box-sizing:border-box;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius);padding:0 16px}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{flex:1;min-width:0;display:flex;align-items:center;padding:0}:host button .menu-icon{margin-right:16px}: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;align-items:center;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,:root{--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,:host .dropdown-select.disabled .menu-icon{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-dropdown-label-inside-color);left:16px;transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside.lg{top:20px;left:16px}:host .dropdown-select .label-inside.md{top:16px;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 .label-inside.floated{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls)}:host .dropdown-select .label-inside.floated.lg{top:12px}:host .dropdown-select .label-inside.floated.md{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;background-color:var(--tds-dropdown-bg)}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;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 .clear-icon{cursor:pointer;flex-shrink:0;margin:0;margin-right:8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .clear-icon.hide{display:none;visibility:hidden}:host tds-icon{transition:transform var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host tds-icon.open{transform:rotateZ(180deg)}';const h=class{constructor(s){t(this,s),this.tdsSelect=o(this,"tdsSelect",6),this.tdsFocus=o(this,"tdsFocus",6),this.tdsBlur=o(this,"tdsBlur",6),this.internalValue="",this.disabled=!1,this.selected=!1,this.multiselect=!1,this.size="lg",this.parentDropdown=null,this.label="",this.componentWillRender=()=>{var t,o,s;this.host.parentElement&&(this.parentDropdown="TDS-DROPDOWN"===(null===(t=this.host.parentElement)||void 0===t?void 0:t.tagName)?this.host.parentElement:this.host.getRootNode().host,this.parentDropdown&&(this.multiselect=null!==(o=this.parentDropdown.multiselect)&&void 0!==o&&o,this.size=this.parentDropdown.size||"lg"),this.label=(null===(s=this.host.textContent)||void 0===s?void 0:s.trim())||"")},this.handleSingleSelect=()=>{var t,o;this.disabled||(this.selected=!0,null===(t=this.parentDropdown)||void 0===t||t.appendValue(this.internalValue),null===(o=this.parentDropdown)||void 0===o||o.close(),this.tdsSelect.emit({value:this.internalValue,selected:this.selected}))},this.handleMultiselect=t=>{var o,s;this.disabled||(t.detail.checked?(null===(o=this.parentDropdown)||void 0===o||o.appendValue(this.internalValue),this.selected=!0,this.tdsSelect.emit({value:this.internalValue,selected:this.selected})):(null===(s=this.parentDropdown)||void 0===s||s.removeValue(this.internalValue),this.selected=!1,this.tdsSelect.emit({value:this.internalValue,selected:this.selected})),t.stopPropagation())},this.handleFocus=t=>{this.parentDropdown||this.tdsFocus.emit(t)},this.handleBlur=t=>{this.parentDropdown||this.tdsBlur.emit(t)}}async setSelected(t){this.selected=t}valueWatcher(t){this.internalValue=d(t)}componentWillLoad(){this.internalValue=d(this.value)}render(){return s(i,{key:"35542ea54d2ba455982e2470190711f75f88a999"},s("div",{key:"4236d5281cf4675586a7d8b16e80141b9689dad3",class:`dropdown-option\n ${this.size}\n ${this.selected?"selected":""}\n ${this.disabled?"disabled":""}\n `},this.multiselect?s("div",{class:"multiselect",onKeyDown:t=>{var o;"Escape"===t.key&&(null===(o=this.parentDropdown)||void 0===o||o.close())}},s("tds-checkbox",{onTdsChange:t=>{this.handleMultiselect(t)},onTdsBlur:t=>{t.stopPropagation()},disabled:this.disabled,checked:this.selected,tdsAriaLabel:this.tdsAriaLabel,class:{[this.size]:!0}},s("div",{slot:"label"},s("slot",null)))):s("button",{role:"option","aria-disabled":this.disabled,"aria-selected":this.selected,"aria-label":this.tdsAriaLabel,onClick:()=>{this.handleSingleSelect()},onFocus:t=>this.handleFocus(t),onBlur:t=>this.handleBlur(t),disabled:this.disabled,class:this.size},s("div",{class:"single-select"},s("slot",null),this.selected&&s("tds-icon",{name:"tick",size:"16px"})))))}static get delegatesFocus(){return!0}get host(){return e(this)}static get watchers(){return{value:[{valueWatcher:0}]}}};h.style=":host{box-sizing:border-box;display:block;background-color:var(--tds-dropdown-option-background)}:host *{box-sizing:border-box}:host .dropdown-option{color:var(--tds-dropdown-option-color);border-bottom:1px solid var(--tds-dropdown-option-border);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);overflow-wrap:anywhere;transition:background-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-option.selected{background-color:var(--tds-dropdown-option-background-selected)}:host .dropdown-option.disabled{color:var(--tds-dropdown-option-color-disabled)}:host .dropdown-option button:focus{outline:2px solid var(--tds-focus-outline-color);box-shadow:inset 0 0 0 3px var(--tds-white);outline-offset:-2px}:host .dropdown-option button{all:unset;width:100%}:host .dropdown-option button.lg{padding:19px 0 20px}:host .dropdown-option button.md{padding:15px 0 16px}:host .dropdown-option button.sm{padding:11px 0 12px}:host .dropdown-option button.xs{padding:7px 0 8px}:host .dropdown-option button .single-select{display:flex;align-items:center;justify-content:space-between;padding:0 16px}:host .dropdown-option .multiselect{width:100%;height:100%}:host .dropdown-option .multiselect tds-checkbox{display:flex;height:100%;width:100%}:host .dropdown-option .multiselect tds-checkbox.lg{padding:15px 16px 16px}:host .dropdown-option .multiselect tds-checkbox.md{padding:11px 16px 12px}:host .dropdown-option .multiselect tds-checkbox.sm{padding:7px 16px 8px}:host .dropdown-option .multiselect tds-checkbox.xs{padding:7px 16px 8px}:host .dropdown-option:hover{border-bottom-color:var(--tds-dropdown-option-border-hover);cursor:pointer}:host .dropdown-option:hover.disabled{border-bottom-color:var(--tds-dropdown-option-border-hover);cursor:not-allowed}:host([hidden]){display:none}";export{n as tds_dropdown,h as tds_dropdown_option}
|
package/dist/tegel/tegel.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as a,b as t}from"./p-9xxNGlso.js";export{s as setNonce}from"./p-9xxNGlso.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await a(),t(JSON.parse('[["p-b524bbfe",[[257,"tds-header-launcher",{"tdsAriaLabel":[1,"tds-aria-label"],"open":[32],"buttonEl":[32],"hasListTypeMenu":[32]},[[8,"click","onAnyClick"],[8,"keydown","handleKeyDown"]]]]],["p-34acf548",[[257,"tds-header-dropdown",{"label":[1],"noDropdownIcon":[4,"no-dropdown-icon"],"selected":[4],"tdsAriaLabel":[1,"tds-aria-label"],"open":[32],"buttonEl":[32]},[[4,"click","onAnyClick"],[8,"keydown","handleKeyDown"]]]]],["p-01c5df5c",[[0,"tds-slider",{"label":[1],"value":[1025],"min":[1],"max":[1],"ticks":[1],"showTickNumbers":[4,"show-tick-numbers"],"tooltip":[4],"disabled":[4],"readOnly":[4,"read-only"],"controls":[4],"input":[4],"step":[1],"name":[1],"thumbSize":[1,"thumb-size"],"snap":[4],"tdsAriaLabel":[1,"tds-aria-label"],"sliderId":[1,"slider-id"],"tdsReadOnlyAriaLabel":[1,"tds-read-only-aria-label"],"reset":[64]},[[0,"keydown","handleKeydown"],[9,"mouseup","handleRelease"],[9,"touchend","handleRelease"],[9,"mousemove","handleMove"],[9,"touchmove","handleMove"]],{"value":[{"handleValueUpdate":0}]}]]],["p-fed169d8",[[1,"tds-table-footer",{"pagination":[516],"paginationValue":[1538,"pagination-value"],"rowsperpage":[516],"rowsPerPageValues":[16],"pages":[514],"cols":[2],"columnsNumber":[32],"compactDesign":[32],"multiselect":[32],"expandableRows":[32],"lastCorrectValue":[32],"tableId":[32],"horizontalScrollWidth":[32],"rowsPerPageValue":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]],{"cols":[{"colsChanged":0}],"multiselect":[{"updateColumnsNumber":0}],"expandableRows":[{"updateColumnsNumber":0}]}]]],["p-92ee76ea",[[257,"tds-card",{"modeVariant":[1,"mode-variant"],"imagePlacement":[1,"image-placement"],"header":[1],"subheader":[1],"bodyImg":[1,"body-img"],"bodyImgAlt":[1,"body-img-alt"],"bodyDivider":[4,"body-divider"],"clickable":[4],"stretch":[4],"cardId":[1,"card-id"],"expandable":[4],"expanded":[1540]}]]],["p-7aa48b05",[[1,"tds-header-hamburger",{"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-e399bba6",[[2,"tds-textarea",{"label":[1],"name":[1],"helper":[1],"cols":[2],"rows":[2],"labelPosition":[1,"label-position"],"placeholder":[1],"value":[1],"disabled":[4],"readOnly":[4,"read-only"],"hideReadOnlyIcon":[4,"hide-read-only-icon"],"state":[1],"maxLength":[2,"max-length"],"modeVariant":[1,"mode-variant"],"autofocus":[4],"noMinWidth":[4,"no-min-width"],"tdsAriaLabel":[1,"tds-aria-label"],"focusInput":[32],"focusElement":[64]}]]],["p-130d96b2",[[257,"tds-header-brand-symbol"]]],["p-b765f247",[[257,"tds-side-menu-dropdown",{"defaultOpen":[4,"default-open"],"buttonLabel":[1,"button-label"],"selected":[4],"open":[4],"hoverState":[32],"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapsedSideMenuEventHandler"],[1,"pointerenter","onEventPointerEnter"],[0,"focusin","onEventFocus"],[1,"pointerleave","onEventPointerLeave"],[0,"focusout","onEventBlur"],[0,"keydown","handleKeyDown"]]]]],["p-1c73f091",[[257,"tds-side-menu-user",{"heading":[1],"subheading":[1],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"]}]]],["p-dfa11d82",[[257,"tds-accordion-item",{"header":[1],"expandIconPosition":[1,"expand-icon-position"],"disabled":[4],"expanded":[516],"paddingReset":[4,"padding-reset"],"ariaLevelValue":[1,"aria-level-value"],"toggleAccordionItem":[64],"expand":[64],"collapse":[64],"isExpanded":[64]}]]],["p-873dd581",[[257,"tds-banner",{"icon":[1],"header":[1],"subheader":[1],"variant":[1],"bannerId":[1,"banner-id"],"hidden":[516],"roleType":[1,"role-type"],"hideBanner":[64],"showBanner":[64]}]]],["p-afad1dba",[[2,"tds-datetime",{"type":[513],"value":[1537],"min":[1],"max":[1],"defaultValue":[1,"default-value"],"disabled":[4],"size":[1],"noMinWidth":[4,"no-min-width"],"modeVariant":[1,"mode-variant"],"name":[1],"state":[1025],"autofocus":[4],"label":[1],"labelPosition":[1,"label-position"],"helper":[1],"helperError":[1,"helper-error"],"helperErrorInvalid":[1,"helper-error-invalid"],"tdsAriaLabel":[1,"tds-aria-label"],"customValidator":[16],"focusInput":[32],"reset":[64],"setValue":[64],"focusElement":[64]},[[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"]],{"value":[{"onValueChanged":0}]}]]],["p-7d2217bc",[[257,"tds-folder-tabs",{"modeVariant":[1,"mode-variant"],"defaultSelectedIndex":[2,"default-selected-index"],"selectedIndex":[514,"selected-index"],"tdsScrollLeftAriaLabel":[1,"tds-scroll-left-aria-label"],"tdsScrollRightAriaLabel":[1,"tds-scroll-right-aria-label"],"buttonWidth":[32],"showLeftScroll":[32],"showRightScroll":[32],"selectTab":[64],"reinitialize":[64]},null,{"selectedIndex":[{"handleSelectedIndexUpdate":0}]}]]],["p-fb9f17be",[[257,"tds-footer-group",{"titleText":[1,"title-text"],"tdsListAriaLabel":[1,"tds-list-aria-label"],"open":[32],"isMobile":[32]},[[9,"resize","handleResize"]]]]],["p-bc98d0e2",[[257,"tds-header-cell",{"cellKey":[513,"cell-key"],"cellValue":[513,"cell-value"],"customWidth":[513,"custom-width"],"sortable":[4],"textAlign":[513,"text-align"],"disablePadding":[516,"disable-padding"],"tdsAriaLabelSortButton":[513,"tds-aria-label-sort-button"],"colSpan":[2,"col-span"],"rowSpan":[2,"row-span"],"textAlignState":[32],"sortingDirection":[32],"sortedByMyKey":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"multiselect":[32],"enableToolbarDesign":[32],"tableId":[32],"expandableRows":[32]},[[16,"internalTdsPropChange","internalTdsPropChangeListener"],[16,"internalSortButtonClicked","updateOptionsContent"]]]]],["p-e2848b6f",[[260,"tds-header-launcher-list"]]],["p-1c117ed6",[[257,"tds-header-launcher-list-item"]]],["p-513f9e4a",[[257,"tds-inline-tabs",{"modeVariant":[1,"mode-variant"],"defaultSelectedIndex":[2,"default-selected-index"],"selectedIndex":[514,"selected-index"],"tdsScrollLeftAriaLabel":[1,"tds-scroll-left-aria-label"],"tdsScrollRightAriaLabel":[1,"tds-scroll-right-aria-label"],"leftPadding":[514,"left-padding"],"showLeftScroll":[32],"showRightScroll":[32],"selectTab":[64],"reinitialize":[64]},null,{"selectedIndex":[{"handleSelectedIndexUpdate":0}]}]]],["p-483d8c89",[[257,"tds-message",{"header":[1],"modeVariant":[1,"mode-variant"],"variant":[1],"noIcon":[4,"no-icon"],"minimal":[4],"tdsAlertDialog":[1,"tds-alert-dialog"],"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-f7e30ce0",[[257,"tds-modal",{"header":[1],"prevent":[4],"size":[1],"actionsPosition":[1,"actions-position"],"selector":[1],"referenceEl":[16],"show":[4],"closable":[4],"tdsAlertDialog":[1,"tds-alert-dialog"],"isShown":[32],"activeElementIndex":[32],"showModal":[64],"closeModal":[64],"isOpen":[64],"initializeModal":[64],"cleanupModal":[64]},[[10,"keydown","handleFocusTrap"]],{"show":[{"handleShowPropChange":0}]}]]],["p-10bd75ab",[[257,"tds-navigation-tabs",{"modeVariant":[1,"mode-variant"],"defaultSelectedIndex":[2,"default-selected-index"],"selectedIndex":[514,"selected-index"],"leftPadding":[514,"left-padding"],"tdsScrollLeftAriaLabel":[1,"tds-scroll-left-aria-label"],"tdsScrollRightAriaLabel":[1,"tds-scroll-right-aria-label"],"showLeftScroll":[32],"showRightScroll":[32],"selectTab":[64],"reinitialize":[64]},null,{"selectedIndex":[{"handleSelectedIndexUpdate":0}]}]]],["p-b29a9c01",[[262,"tds-popover-menu",{"selector":[1],"referenceEl":[16],"show":[4],"defaultShow":[4,"default-show"],"placement":[1],"animation":[1],"offsetSkidding":[2,"offset-skidding"],"offsetDistance":[2,"offset-distance"],"fluidWidth":[4,"fluid-width"],"modeVariant":[1,"mode-variant"],"childRef":[32],"close":[64]}]]],["p-c2e17e83",[[1,"tds-side-menu-close-button"]]],["p-6bcb6678",[[257,"tds-side-menu-collapse-button",{"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapseSideMenuEventHandler"]]]]],["p-64e04dc0",[[257,"tds-step",{"index":[1],"state":[1],"tdsAriaCurrent":[1,"tds-aria-current"],"hideLabels":[32],"size":[32],"orientation":[32],"labelPosition":[32]},[[16,"internalTdsPropsChange","handlePropsChange"]]]]],["p-f935c2e9",[[257,"tds-table-body-input-wrapper",{"showIcon":[4,"show-icon"],"renderSlot":[32],"inputFocused":[32],"compactDesign":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-09867bb0",[[257,"tds-table-body-row",{"selected":[516],"disabled":[516],"clickable":[516],"multiselect":[32],"mainCheckBoxStatus":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-6c86f384",[[257,"tds-table-body-row-expandable",{"colSpan":[2,"col-span"],"rowId":[513,"row-id"],"expanded":[516],"overflow":[513],"autoCollapse":[4,"auto-collapse"],"tdsAriaLabelExpandButton":[513,"tds-aria-label-expand-button"],"selected":[516],"disabled":[516],"isExpanded":[32],"tableId":[32],"columnsNumber":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"modeVariant":[32],"multiselect":[32],"expand":[64],"collapse":[64]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"],[16,"tdsChange","handleRowExpand"]],{"expanded":[{"watchExpanded":0}]}]]],["p-8f69297f",[[257,"tds-table-header",{"allSelected":[1540,"all-selected"],"selected":[1540],"disabled":[1540],"indeterminate":[4],"multiselect":[32],"expandableRows":[32],"mainCheckboxSelected":[32],"mainExpendSelected":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"whiteBackground":[32],"enableToolbarDesign":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"],[16,"internalTdsRowExpanded","internalTdsRowExpandedListener"]]]]],["p-2c4defb0",[[257,"tds-table-header-input-wrapper",{"showIcon":[4,"show-icon"],"compactDesign":[4,"compact-design"],"renderSlot":[32],"inputFocused":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-089347c1",[[257,"tds-table-toolbar",{"tableTitle":[513,"table-title"],"filter":[516],"tdsSearchAriaLabel":[1,"tds-search-aria-label"],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"whiteBackground":[32],"tableId":[32],"horizontalScrollWidth":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-b11a2807",[[257,"tds-toast",{"toastId":[1,"toast-id"],"header":[1],"subheader":[1],"variant":[1],"hidden":[516],"closable":[4],"toastRole":[1,"toast-role"],"tdsCloseAriaLabel":[1,"tds-close-aria-label"],"tdsAriaLive":[1,"tds-aria-live"],"hideToast":[64],"showToast":[64]}]]],["p-a6415b2c",[[257,"tds-accordion",{"modeVariant":[1,"mode-variant"],"hideLastBorder":[4,"hide-last-border"]}]]],["p-3d11fc11",[[1,"tds-badge",{"value":[1],"hidden":[516],"size":[1],"tdsAriaLive":[1,"tds-aria-live"],"tdsAriaLabel":[32],"shape":[32],"text":[32]},null,{"value":[{"watchProps":0}],"size":[{"watchProps":0}]}]]],["p-826bfbff",[[257,"tds-block",{"modeVariant":[1,"mode-variant"],"componentTag":[1,"component-tag"]}]]],["p-fc5445b7",[[257,"tds-body-cell",{"cellValue":[520,"cell-value"],"cellKey":[513,"cell-key"],"disablePadding":[516,"disable-padding"],"textAlign":[513,"text-align"],"colSpan":[2,"col-span"],"rowSpan":[2,"row-span"],"textAlignState":[32],"activeSorting":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"tableId":[32]},[[16,"internalTdsPropChange","internalTdsPropChangeListener"],[16,"internalTdsHover","internalTdsHoverListener"],[16,"internalTdsTextAlign","internalTdsTextAlignListener"]]]]],["p-408ccb20",[[257,"tds-breadcrumb",{"current":[4]}]]],["p-88deac25",[[257,"tds-breadcrumbs",{"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-b881093c",[[262,"tds-chip",{"type":[1],"size":[1],"chipId":[1,"chip-id"],"checked":[1540],"name":[1],"value":[1],"disabled":[4],"tdsAriaLabel":[1,"tds-aria-label"]},[[16,"internalRadioOnChange","handleInternaRadioChange"]]]]],["p-eebfce98",[[257,"tds-folder-tab",{"disabled":[4],"selected":[32],"tabWidth":[32],"setTabWidth":[64],"setSelected":[64]}]]],["p-808c9db1",[[257,"tds-footer",{"modeVariant":[1,"mode-variant"]}]]],["p-00f77dd3",[[257,"tds-footer-item"]]],["p-735375dd",[[260,"tds-header"]]],["p-5de5a2e8",[[257,"tds-header-dropdown-list-user",{"imgUrl":[1,"img-url"],"imgAlt":[1,"img-alt"],"header":[1],"subheader":[1]}]]],["p-9a0253d6",[[260,"tds-header-launcher-grid",{"headingElement":[32]}]]],["p-9c179f84",[[257,"tds-header-launcher-grid-item"]]],["p-e4cd252c",[[260,"tds-header-launcher-grid-title"]]],["p-399de5fb",[[260,"tds-header-launcher-list-title"]]],["p-492af98d",[[257,"tds-header-title"]]],["p-d92682e4",[[257,"tds-inline-tab",{"disabled":[4],"selected":[32],"setSelected":[64]}]]],["p-bf411bd0",[[257,"tds-link",{"disabled":[4],"underline":[4],"standalone":[4]}]]],["p-a5ec44a0",[[257,"tds-navigation-tab",{"disabled":[4],"selected":[32],"setSelected":[64]}]]],["p-462a1867",[[257,"tds-popover-menu-item",{"disabled":[4]}]]],["p-e8658834",[[262,"tds-radio-button",{"name":[1],"value":[1],"radioId":[1,"radio-id"],"checked":[516],"required":[4],"disabled":[4],"tdsAriaLabel":[1,"tds-aria-label"],"tdsTabIndex":[2,"tds-tab-index"],"focusElement":[64]}]]],["p-dc425994",[[257,"tds-side-menu",{"open":[1028],"persistent":[4],"collapsed":[1028],"isMobile":[32],"isUpperSlotEmpty":[32],"isCollapsed":[32],"initialCollapsedState":[32],"activeElementIndex":[32]},[[8,"keydown","handleKeyDown"],[10,"keydown","handleFocusTrap"],[16,"internalTdsCollapse","collapsedSideMenuEventHandler"]],{"collapsed":[{"onCollapsedChange":0}],"open":[{"onOpenChange":0}]}]]],["p-066bb57c",[[257,"tds-side-menu-dropdown-list",{"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapsedSideMenuEventHandler"]]]]],["p-bfa98728",[[257,"tds-side-menu-dropdown-list-item",{"selected":[4],"dropdownHasIcon":[32],"dropdownHasUser":[32],"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapseSideMenuEventHandler"]]]]],["p-5aac239b",[[1,"tds-side-menu-overlay"]]],["p-5b787973",[[0,"tds-spinner",{"size":[1],"variant":[1]}]]],["p-c612b88f",[[257,"tds-stepper",{"orientation":[1],"labelPosition":[1,"label-position"],"size":[1],"hideLabels":[4,"hide-labels"],"stepperId":[1,"stepper-id"],"tdsAriaLabel":[1,"tds-aria-label"]},null,{"orientation":[{"handleDirectionChange":0}],"labelPosition":[{"handleLabelPositionChange":0}],"size":[{"handleSizeChange":0}],"hideLabels":[{"handleHideLabelsChange":0}]}]]],["p-72f04cd1",[[257,"tds-table",{"verticalDividers":[516,"vertical-dividers"],"compactDesign":[516,"compact-design"],"noMinWidth":[516,"no-min-width"],"multiselect":[516],"expandableRows":[516,"expandable-rows"],"responsive":[516],"modeVariant":[513,"mode-variant"],"zebraMode":[513,"zebra-mode"],"horizontalScrollWidth":[1,"horizontal-scroll-width"],"tableId":[1,"table-id"],"enableHorizontalScrollToolbarDesign":[32],"enableHorizontalScrollFooterDesign":[32],"getSelectedRows":[64]},null,{"multiselect":[{"multiselectChanged":0}],"expandableRows":[{"enableExpandableRowsChanged":0}],"compactDesign":[{"compactDesignChanged":0}],"verticalDividers":[{"verticalDividersChanged":0}],"noMinWidth":[{"noMinWidthChanged":0}],"zebraMode":[{"zebraModeChanged":0}],"modeVariant":[{"modeVariantChanged":0}],"horizontalScrollWidth":[{"widthChanged":0}]}]]],["p-2ef824fb",[[260,"tds-table-body",{"multiselect":[32],"enablePaginationTableBody":[32],"expandableRows":[32],"multiselectArray":[32],"multiselectArrayJSON":[32],"mainCheckboxStatus":[32],"columnsNumber":[32],"zebraMode":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"],[16,"internalTdsRowChange","bodyCheckboxListener"]]]]],["p-c18d557c",[[262,"tds-tag",{"text":[1],"size":[1],"variant":[1]}]]],["p-785a02d1",[[262,"tds-toggle",{"checked":[516],"required":[4],"size":[1],"name":[1],"headline":[1],"disabled":[4],"toggleId":[1,"toggle-id"],"tdsAriaLabel":[1,"tds-aria-label"],"toggle":[64],"focusElement":[64]}]]],["p-ad5f719a",[[1,"tds-header-launcher-button",{"active":[4],"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-4236bbf5",[[262,"tds-text-field",{"type":[513],"labelPosition":[1,"label-position"],"label":[1],"min":[8],"max":[8],"step":[8],"helper":[1],"placeholder":[1],"value":[513],"disabled":[4],"readOnly":[4,"read-only"],"hideReadOnlyIcon":[4,"hide-read-only-icon"],"size":[1],"modeVariant":[1,"mode-variant"],"noMinWidth":[4,"no-min-width"],"name":[1],"state":[1],"maxLength":[2,"max-length"],"autofocus":[4],"tdsAriaLabel":[1,"tds-aria-label"],"required":[4],"autocomplete":[1],"hideNumberArrows":[4,"hide-number-arrows"],"focusInput":[32],"focusElement":[64]}]]],["p-84580662",[[257,"tds-header-dropdown-list",{"size":[513],"headingElement":[32]}]]],["p-fe45a38b",[[257,"tds-header-dropdown-list-item",{"selected":[4],"size":[513]}]]],["p-36151a93",[[273,"tds-dropdown-option",{"value":[8],"disabled":[4],"tdsAriaLabel":[1,"tds-aria-label"],"internalValue":[32],"selected":[32],"multiselect":[32],"size":[32],"setSelected":[64]},null,{"value":[{"valueWatcher":0}]}],[257,"tds-dropdown",{"name":[1],"disabled":[4],"helper":[1],"label":[1],"labelPosition":[1,"label-position"],"modeVariant":[1,"mode-variant"],"openDirection":[1,"open-direction"],"placeholder":[1],"size":[1],"animation":[1],"error":[4],"multiselect":[4],"filter":[4],"normalizeText":[4,"normalize-text"],"noResultText":[1,"no-result-text"],"defaultValue":[8,"default-value"],"value":[1032],"tdsAriaLabel":[1,"tds-aria-label"],"open":[32],"internalValue":[32],"filterResult":[32],"filterFocus":[32],"internalDefaultValue":[32],"selectedOptions":[32],"filterQuery":[32],"setValue":[64],"reset":[64],"removeValue":[64],"focusElement":[64],"close":[64],"updateDisplay":[64],"appendValue":[64]},[[9,"mousedown","onAnyClick"],[0,"focusin","onFocusIn"],[0,"focusout","onFocusOut"],[0,"keydown","onKeyDown"]],{"value":[{"handleValueChange":0}],"open":[{"handleOpenState":0}],"defaultValue":[{"handleDefaultValueChange":0}]}]]],["p-09c5a74a",[[262,"tds-popover-canvas",{"selector":[1],"referenceEl":[16],"defaultShow":[4,"default-show"],"show":[4],"placement":[1],"offsetSkidding":[2,"offset-skidding"],"animation":[1],"offsetDistance":[2,"offset-distance"],"modifiers":[16],"tdsAlertDialog":[1,"tds-alert-dialog"],"modeVariant":[1,"mode-variant"],"childRef":[32],"close":[64]}]]],["p-9d1d18e5",[[262,"tds-button",{"text":[1],"type":[1],"variant":[1],"size":[1],"disabled":[4],"fullbleed":[4],"modeVariant":[1,"mode-variant"],"animation":[1],"tdsAriaLabel":[1,"tds-aria-label"],"name":[1],"value":[1],"onlyIcon":[32]},[[0,"keydown","handleKeyDown"],[0,"keyup","handleKeyUp"]]],[1,"tds-divider",{"orientation":[1],"variant":[1]}]]],["p-dc823504",[[257,"tds-side-menu-user-image",{"src":[1],"alt":[1]}],[1,"tds-side-menu-user-label",{"heading":[1],"subheading":[1]}]]],["p-e0be794f",[[257,"tds-side-menu-item",{"selected":[4],"active":[4],"collapsed":[32],"hasUserComponent":[32]},[[16,"internalTdsSideMenuPropChange","collapseSideMenuEventHandler"]]]]],["p-8db648a3",[[262,"tds-popover-core",{"selector":[1],"referenceEl":[16],"defaultShow":[4,"default-show"],"animation":[1],"show":[4],"placement":[1],"offsetSkidding":[2,"offset-skidding"],"offsetDistance":[2,"offset-distance"],"modifiers":[16],"trigger":[1],"autoHide":[4,"auto-hide"],"renderedShowValue":[32],"popperInstance":[32],"target":[32],"isShown":[32],"disableLogic":[32],"hasShownAtLeastOnce":[32],"openedByKeyboard":[32],"close":[64]},[[8,"click","onAnyClick"],[8,"internalTdsShow","onTdsShow"],[8,"keydown","handleKeydown"]],{"show":[{"onShowChange":0}],"referenceEl":[{"onReferenceElChanged":0}],"trigger":[{"onTriggerChanged":0}],"isShown":[{"onIsShownChange":0}]}]]],["p-17ea4d71",[[262,"tds-tooltip",{"text":[1],"selector":[1],"referenceEl":[16],"defaultShow":[4,"default-show"],"mouseOverTooltip":[4,"mouse-over-tooltip"],"trigger":[1],"show":[1028],"placement":[1],"offsetSkidding":[2,"offset-skidding"],"offsetDistance":[2,"offset-distance"],"tdsAriaDescribedby":[1,"tds-aria-describedby"]},[[8,"keydown","handleKeyDown"]]]]],["p-121afb33",[[262,"tds-checkbox",{"name":[1],"checkboxId":[1,"checkbox-id"],"disabled":[4],"required":[4],"checked":[1540],"indeterminate":[1028],"value":[1],"tdsAriaLabel":[1,"tds-aria-label"],"tdsAriaDescribedby":[1,"tds-aria-describedby"],"toggleCheckbox":[64],"focusElement":[64]},[[4,"reset","handleFormReset"]],{"indeterminate":[{"handleIndeterminateState":0}]}]]],["p-7fd4299d",[[257,"tds-header-item",{"active":[4],"selected":[4]}],[257,"tds-core-header-item"]]],["p-e7793e67",[[1,"tds-icon",{"name":[513],"size":[513],"svgTitle":[1,"svg-title"],"tdsAriaHidden":[4,"tds-aria-hidden"],"svgDescription":[1,"svg-description"],"icons_object":[32],"arrayOfIcons":[32]}]]]]'),e))));
|
|
1
|
+
import{p as e,g as a,b as t}from"./p-9xxNGlso.js";export{s as setNonce}from"./p-9xxNGlso.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await a(),t(JSON.parse('[["p-b524bbfe",[[257,"tds-header-launcher",{"tdsAriaLabel":[1,"tds-aria-label"],"open":[32],"buttonEl":[32],"hasListTypeMenu":[32]},[[8,"click","onAnyClick"],[8,"keydown","handleKeyDown"]]]]],["p-34acf548",[[257,"tds-header-dropdown",{"label":[1],"noDropdownIcon":[4,"no-dropdown-icon"],"selected":[4],"tdsAriaLabel":[1,"tds-aria-label"],"open":[32],"buttonEl":[32]},[[4,"click","onAnyClick"],[8,"keydown","handleKeyDown"]]]]],["p-01c5df5c",[[0,"tds-slider",{"label":[1],"value":[1025],"min":[1],"max":[1],"ticks":[1],"showTickNumbers":[4,"show-tick-numbers"],"tooltip":[4],"disabled":[4],"readOnly":[4,"read-only"],"controls":[4],"input":[4],"step":[1],"name":[1],"thumbSize":[1,"thumb-size"],"snap":[4],"tdsAriaLabel":[1,"tds-aria-label"],"sliderId":[1,"slider-id"],"tdsReadOnlyAriaLabel":[1,"tds-read-only-aria-label"],"reset":[64]},[[0,"keydown","handleKeydown"],[9,"mouseup","handleRelease"],[9,"touchend","handleRelease"],[9,"mousemove","handleMove"],[9,"touchmove","handleMove"]],{"value":[{"handleValueUpdate":0}]}]]],["p-fed169d8",[[1,"tds-table-footer",{"pagination":[516],"paginationValue":[1538,"pagination-value"],"rowsperpage":[516],"rowsPerPageValues":[16],"pages":[514],"cols":[2],"columnsNumber":[32],"compactDesign":[32],"multiselect":[32],"expandableRows":[32],"lastCorrectValue":[32],"tableId":[32],"horizontalScrollWidth":[32],"rowsPerPageValue":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]],{"cols":[{"colsChanged":0}],"multiselect":[{"updateColumnsNumber":0}],"expandableRows":[{"updateColumnsNumber":0}]}]]],["p-92ee76ea",[[257,"tds-card",{"modeVariant":[1,"mode-variant"],"imagePlacement":[1,"image-placement"],"header":[1],"subheader":[1],"bodyImg":[1,"body-img"],"bodyImgAlt":[1,"body-img-alt"],"bodyDivider":[4,"body-divider"],"clickable":[4],"stretch":[4],"cardId":[1,"card-id"],"expandable":[4],"expanded":[1540]}]]],["p-7aa48b05",[[1,"tds-header-hamburger",{"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-e399bba6",[[2,"tds-textarea",{"label":[1],"name":[1],"helper":[1],"cols":[2],"rows":[2],"labelPosition":[1,"label-position"],"placeholder":[1],"value":[1],"disabled":[4],"readOnly":[4,"read-only"],"hideReadOnlyIcon":[4,"hide-read-only-icon"],"state":[1],"maxLength":[2,"max-length"],"modeVariant":[1,"mode-variant"],"autofocus":[4],"noMinWidth":[4,"no-min-width"],"tdsAriaLabel":[1,"tds-aria-label"],"focusInput":[32],"focusElement":[64]}]]],["p-130d96b2",[[257,"tds-header-brand-symbol"]]],["p-b765f247",[[257,"tds-side-menu-dropdown",{"defaultOpen":[4,"default-open"],"buttonLabel":[1,"button-label"],"selected":[4],"open":[4],"hoverState":[32],"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapsedSideMenuEventHandler"],[1,"pointerenter","onEventPointerEnter"],[0,"focusin","onEventFocus"],[1,"pointerleave","onEventPointerLeave"],[0,"focusout","onEventBlur"],[0,"keydown","handleKeyDown"]]]]],["p-1c73f091",[[257,"tds-side-menu-user",{"heading":[1],"subheading":[1],"imgSrc":[1,"img-src"],"imgAlt":[1,"img-alt"]}]]],["p-dfa11d82",[[257,"tds-accordion-item",{"header":[1],"expandIconPosition":[1,"expand-icon-position"],"disabled":[4],"expanded":[516],"paddingReset":[4,"padding-reset"],"ariaLevelValue":[1,"aria-level-value"],"toggleAccordionItem":[64],"expand":[64],"collapse":[64],"isExpanded":[64]}]]],["p-873dd581",[[257,"tds-banner",{"icon":[1],"header":[1],"subheader":[1],"variant":[1],"bannerId":[1,"banner-id"],"hidden":[516],"roleType":[1,"role-type"],"hideBanner":[64],"showBanner":[64]}]]],["p-afad1dba",[[2,"tds-datetime",{"type":[513],"value":[1537],"min":[1],"max":[1],"defaultValue":[1,"default-value"],"disabled":[4],"size":[1],"noMinWidth":[4,"no-min-width"],"modeVariant":[1,"mode-variant"],"name":[1],"state":[1025],"autofocus":[4],"label":[1],"labelPosition":[1,"label-position"],"helper":[1],"helperError":[1,"helper-error"],"helperErrorInvalid":[1,"helper-error-invalid"],"tdsAriaLabel":[1,"tds-aria-label"],"customValidator":[16],"focusInput":[32],"reset":[64],"setValue":[64],"focusElement":[64]},[[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"]],{"value":[{"onValueChanged":0}]}]]],["p-7d2217bc",[[257,"tds-folder-tabs",{"modeVariant":[1,"mode-variant"],"defaultSelectedIndex":[2,"default-selected-index"],"selectedIndex":[514,"selected-index"],"tdsScrollLeftAriaLabel":[1,"tds-scroll-left-aria-label"],"tdsScrollRightAriaLabel":[1,"tds-scroll-right-aria-label"],"buttonWidth":[32],"showLeftScroll":[32],"showRightScroll":[32],"selectTab":[64],"reinitialize":[64]},null,{"selectedIndex":[{"handleSelectedIndexUpdate":0}]}]]],["p-fb9f17be",[[257,"tds-footer-group",{"titleText":[1,"title-text"],"tdsListAriaLabel":[1,"tds-list-aria-label"],"open":[32],"isMobile":[32]},[[9,"resize","handleResize"]]]]],["p-bc98d0e2",[[257,"tds-header-cell",{"cellKey":[513,"cell-key"],"cellValue":[513,"cell-value"],"customWidth":[513,"custom-width"],"sortable":[4],"textAlign":[513,"text-align"],"disablePadding":[516,"disable-padding"],"tdsAriaLabelSortButton":[513,"tds-aria-label-sort-button"],"colSpan":[2,"col-span"],"rowSpan":[2,"row-span"],"textAlignState":[32],"sortingDirection":[32],"sortedByMyKey":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"multiselect":[32],"enableToolbarDesign":[32],"tableId":[32],"expandableRows":[32]},[[16,"internalTdsPropChange","internalTdsPropChangeListener"],[16,"internalSortButtonClicked","updateOptionsContent"]]]]],["p-e2848b6f",[[260,"tds-header-launcher-list"]]],["p-1c117ed6",[[257,"tds-header-launcher-list-item"]]],["p-513f9e4a",[[257,"tds-inline-tabs",{"modeVariant":[1,"mode-variant"],"defaultSelectedIndex":[2,"default-selected-index"],"selectedIndex":[514,"selected-index"],"tdsScrollLeftAriaLabel":[1,"tds-scroll-left-aria-label"],"tdsScrollRightAriaLabel":[1,"tds-scroll-right-aria-label"],"leftPadding":[514,"left-padding"],"showLeftScroll":[32],"showRightScroll":[32],"selectTab":[64],"reinitialize":[64]},null,{"selectedIndex":[{"handleSelectedIndexUpdate":0}]}]]],["p-483d8c89",[[257,"tds-message",{"header":[1],"modeVariant":[1,"mode-variant"],"variant":[1],"noIcon":[4,"no-icon"],"minimal":[4],"tdsAlertDialog":[1,"tds-alert-dialog"],"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-f7e30ce0",[[257,"tds-modal",{"header":[1],"prevent":[4],"size":[1],"actionsPosition":[1,"actions-position"],"selector":[1],"referenceEl":[16],"show":[4],"closable":[4],"tdsAlertDialog":[1,"tds-alert-dialog"],"isShown":[32],"activeElementIndex":[32],"showModal":[64],"closeModal":[64],"isOpen":[64],"initializeModal":[64],"cleanupModal":[64]},[[10,"keydown","handleFocusTrap"]],{"show":[{"handleShowPropChange":0}]}]]],["p-10bd75ab",[[257,"tds-navigation-tabs",{"modeVariant":[1,"mode-variant"],"defaultSelectedIndex":[2,"default-selected-index"],"selectedIndex":[514,"selected-index"],"leftPadding":[514,"left-padding"],"tdsScrollLeftAriaLabel":[1,"tds-scroll-left-aria-label"],"tdsScrollRightAriaLabel":[1,"tds-scroll-right-aria-label"],"showLeftScroll":[32],"showRightScroll":[32],"selectTab":[64],"reinitialize":[64]},null,{"selectedIndex":[{"handleSelectedIndexUpdate":0}]}]]],["p-b29a9c01",[[262,"tds-popover-menu",{"selector":[1],"referenceEl":[16],"show":[4],"defaultShow":[4,"default-show"],"placement":[1],"animation":[1],"offsetSkidding":[2,"offset-skidding"],"offsetDistance":[2,"offset-distance"],"fluidWidth":[4,"fluid-width"],"modeVariant":[1,"mode-variant"],"childRef":[32],"close":[64]}]]],["p-c2e17e83",[[1,"tds-side-menu-close-button"]]],["p-6bcb6678",[[257,"tds-side-menu-collapse-button",{"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapseSideMenuEventHandler"]]]]],["p-64e04dc0",[[257,"tds-step",{"index":[1],"state":[1],"tdsAriaCurrent":[1,"tds-aria-current"],"hideLabels":[32],"size":[32],"orientation":[32],"labelPosition":[32]},[[16,"internalTdsPropsChange","handlePropsChange"]]]]],["p-f935c2e9",[[257,"tds-table-body-input-wrapper",{"showIcon":[4,"show-icon"],"renderSlot":[32],"inputFocused":[32],"compactDesign":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-09867bb0",[[257,"tds-table-body-row",{"selected":[516],"disabled":[516],"clickable":[516],"multiselect":[32],"mainCheckBoxStatus":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-6c86f384",[[257,"tds-table-body-row-expandable",{"colSpan":[2,"col-span"],"rowId":[513,"row-id"],"expanded":[516],"overflow":[513],"autoCollapse":[4,"auto-collapse"],"tdsAriaLabelExpandButton":[513,"tds-aria-label-expand-button"],"selected":[516],"disabled":[516],"isExpanded":[32],"tableId":[32],"columnsNumber":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"modeVariant":[32],"multiselect":[32],"expand":[64],"collapse":[64]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"],[16,"tdsChange","handleRowExpand"]],{"expanded":[{"watchExpanded":0}]}]]],["p-8f69297f",[[257,"tds-table-header",{"allSelected":[1540,"all-selected"],"selected":[1540],"disabled":[1540],"indeterminate":[4],"multiselect":[32],"expandableRows":[32],"mainCheckboxSelected":[32],"mainExpendSelected":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"whiteBackground":[32],"enableToolbarDesign":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"],[16,"internalTdsRowExpanded","internalTdsRowExpandedListener"]]]]],["p-2c4defb0",[[257,"tds-table-header-input-wrapper",{"showIcon":[4,"show-icon"],"compactDesign":[4,"compact-design"],"renderSlot":[32],"inputFocused":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-089347c1",[[257,"tds-table-toolbar",{"tableTitle":[513,"table-title"],"filter":[516],"tdsSearchAriaLabel":[1,"tds-search-aria-label"],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"whiteBackground":[32],"tableId":[32],"horizontalScrollWidth":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"]]]]],["p-b11a2807",[[257,"tds-toast",{"toastId":[1,"toast-id"],"header":[1],"subheader":[1],"variant":[1],"hidden":[516],"closable":[4],"toastRole":[1,"toast-role"],"tdsCloseAriaLabel":[1,"tds-close-aria-label"],"tdsAriaLive":[1,"tds-aria-live"],"hideToast":[64],"showToast":[64]}]]],["p-a6415b2c",[[257,"tds-accordion",{"modeVariant":[1,"mode-variant"],"hideLastBorder":[4,"hide-last-border"]}]]],["p-3d11fc11",[[1,"tds-badge",{"value":[1],"hidden":[516],"size":[1],"tdsAriaLive":[1,"tds-aria-live"],"tdsAriaLabel":[32],"shape":[32],"text":[32]},null,{"value":[{"watchProps":0}],"size":[{"watchProps":0}]}]]],["p-826bfbff",[[257,"tds-block",{"modeVariant":[1,"mode-variant"],"componentTag":[1,"component-tag"]}]]],["p-fc5445b7",[[257,"tds-body-cell",{"cellValue":[520,"cell-value"],"cellKey":[513,"cell-key"],"disablePadding":[516,"disable-padding"],"textAlign":[513,"text-align"],"colSpan":[2,"col-span"],"rowSpan":[2,"row-span"],"textAlignState":[32],"activeSorting":[32],"verticalDividers":[32],"compactDesign":[32],"noMinWidth":[32],"tableId":[32]},[[16,"internalTdsPropChange","internalTdsPropChangeListener"],[16,"internalTdsHover","internalTdsHoverListener"],[16,"internalTdsTextAlign","internalTdsTextAlignListener"]]]]],["p-408ccb20",[[257,"tds-breadcrumb",{"current":[4]}]]],["p-88deac25",[[257,"tds-breadcrumbs",{"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-b881093c",[[262,"tds-chip",{"type":[1],"size":[1],"chipId":[1,"chip-id"],"checked":[1540],"name":[1],"value":[1],"disabled":[4],"tdsAriaLabel":[1,"tds-aria-label"]},[[16,"internalRadioOnChange","handleInternaRadioChange"]]]]],["p-eebfce98",[[257,"tds-folder-tab",{"disabled":[4],"selected":[32],"tabWidth":[32],"setTabWidth":[64],"setSelected":[64]}]]],["p-808c9db1",[[257,"tds-footer",{"modeVariant":[1,"mode-variant"]}]]],["p-00f77dd3",[[257,"tds-footer-item"]]],["p-735375dd",[[260,"tds-header"]]],["p-5de5a2e8",[[257,"tds-header-dropdown-list-user",{"imgUrl":[1,"img-url"],"imgAlt":[1,"img-alt"],"header":[1],"subheader":[1]}]]],["p-9a0253d6",[[260,"tds-header-launcher-grid",{"headingElement":[32]}]]],["p-9c179f84",[[257,"tds-header-launcher-grid-item"]]],["p-e4cd252c",[[260,"tds-header-launcher-grid-title"]]],["p-399de5fb",[[260,"tds-header-launcher-list-title"]]],["p-492af98d",[[257,"tds-header-title"]]],["p-d92682e4",[[257,"tds-inline-tab",{"disabled":[4],"selected":[32],"setSelected":[64]}]]],["p-bf411bd0",[[257,"tds-link",{"disabled":[4],"underline":[4],"standalone":[4]}]]],["p-a5ec44a0",[[257,"tds-navigation-tab",{"disabled":[4],"selected":[32],"setSelected":[64]}]]],["p-462a1867",[[257,"tds-popover-menu-item",{"disabled":[4]}]]],["p-e8658834",[[262,"tds-radio-button",{"name":[1],"value":[1],"radioId":[1,"radio-id"],"checked":[516],"required":[4],"disabled":[4],"tdsAriaLabel":[1,"tds-aria-label"],"tdsTabIndex":[2,"tds-tab-index"],"focusElement":[64]}]]],["p-dc425994",[[257,"tds-side-menu",{"open":[1028],"persistent":[4],"collapsed":[1028],"isMobile":[32],"isUpperSlotEmpty":[32],"isCollapsed":[32],"initialCollapsedState":[32],"activeElementIndex":[32]},[[8,"keydown","handleKeyDown"],[10,"keydown","handleFocusTrap"],[16,"internalTdsCollapse","collapsedSideMenuEventHandler"]],{"collapsed":[{"onCollapsedChange":0}],"open":[{"onOpenChange":0}]}]]],["p-066bb57c",[[257,"tds-side-menu-dropdown-list",{"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapsedSideMenuEventHandler"]]]]],["p-bfa98728",[[257,"tds-side-menu-dropdown-list-item",{"selected":[4],"dropdownHasIcon":[32],"dropdownHasUser":[32],"collapsed":[32]},[[16,"internalTdsSideMenuPropChange","collapseSideMenuEventHandler"]]]]],["p-5aac239b",[[1,"tds-side-menu-overlay"]]],["p-5b787973",[[0,"tds-spinner",{"size":[1],"variant":[1]}]]],["p-c612b88f",[[257,"tds-stepper",{"orientation":[1],"labelPosition":[1,"label-position"],"size":[1],"hideLabels":[4,"hide-labels"],"stepperId":[1,"stepper-id"],"tdsAriaLabel":[1,"tds-aria-label"]},null,{"orientation":[{"handleDirectionChange":0}],"labelPosition":[{"handleLabelPositionChange":0}],"size":[{"handleSizeChange":0}],"hideLabels":[{"handleHideLabelsChange":0}]}]]],["p-72f04cd1",[[257,"tds-table",{"verticalDividers":[516,"vertical-dividers"],"compactDesign":[516,"compact-design"],"noMinWidth":[516,"no-min-width"],"multiselect":[516],"expandableRows":[516,"expandable-rows"],"responsive":[516],"modeVariant":[513,"mode-variant"],"zebraMode":[513,"zebra-mode"],"horizontalScrollWidth":[1,"horizontal-scroll-width"],"tableId":[1,"table-id"],"enableHorizontalScrollToolbarDesign":[32],"enableHorizontalScrollFooterDesign":[32],"getSelectedRows":[64]},null,{"multiselect":[{"multiselectChanged":0}],"expandableRows":[{"enableExpandableRowsChanged":0}],"compactDesign":[{"compactDesignChanged":0}],"verticalDividers":[{"verticalDividersChanged":0}],"noMinWidth":[{"noMinWidthChanged":0}],"zebraMode":[{"zebraModeChanged":0}],"modeVariant":[{"modeVariantChanged":0}],"horizontalScrollWidth":[{"widthChanged":0}]}]]],["p-2ef824fb",[[260,"tds-table-body",{"multiselect":[32],"enablePaginationTableBody":[32],"expandableRows":[32],"multiselectArray":[32],"multiselectArrayJSON":[32],"mainCheckboxStatus":[32],"columnsNumber":[32],"zebraMode":[32],"tableId":[32]},[[16,"internalTdsTablePropChange","internalTdsPropChangeListener"],[16,"internalTdsRowChange","bodyCheckboxListener"]]]]],["p-c18d557c",[[262,"tds-tag",{"text":[1],"size":[1],"variant":[1]}]]],["p-785a02d1",[[262,"tds-toggle",{"checked":[516],"required":[4],"size":[1],"name":[1],"headline":[1],"disabled":[4],"toggleId":[1,"toggle-id"],"tdsAriaLabel":[1,"tds-aria-label"],"toggle":[64],"focusElement":[64]}]]],["p-ad5f719a",[[1,"tds-header-launcher-button",{"active":[4],"tdsAriaLabel":[1,"tds-aria-label"]}]]],["p-4236bbf5",[[262,"tds-text-field",{"type":[513],"labelPosition":[1,"label-position"],"label":[1],"min":[8],"max":[8],"step":[8],"helper":[1],"placeholder":[1],"value":[513],"disabled":[4],"readOnly":[4,"read-only"],"hideReadOnlyIcon":[4,"hide-read-only-icon"],"size":[1],"modeVariant":[1,"mode-variant"],"noMinWidth":[4,"no-min-width"],"name":[1],"state":[1],"maxLength":[2,"max-length"],"autofocus":[4],"tdsAriaLabel":[1,"tds-aria-label"],"required":[4],"autocomplete":[1],"hideNumberArrows":[4,"hide-number-arrows"],"focusInput":[32],"focusElement":[64]}]]],["p-84580662",[[257,"tds-header-dropdown-list",{"size":[513],"headingElement":[32]}]]],["p-fe45a38b",[[257,"tds-header-dropdown-list-item",{"selected":[4],"size":[513]}]]],["p-091c27ee",[[273,"tds-dropdown-option",{"value":[8],"disabled":[4],"tdsAriaLabel":[1,"tds-aria-label"],"internalValue":[32],"selected":[32],"multiselect":[32],"size":[32],"setSelected":[64]},null,{"value":[{"valueWatcher":0}]}],[257,"tds-dropdown",{"name":[1],"disabled":[4],"helper":[1],"label":[1],"labelPosition":[1,"label-position"],"modeVariant":[1,"mode-variant"],"openDirection":[1,"open-direction"],"placeholder":[1],"size":[1],"animation":[1],"error":[4],"multiselect":[4],"filter":[4],"normalizeText":[4,"normalize-text"],"noResultText":[1,"no-result-text"],"defaultValue":[8,"default-value"],"value":[1032],"tdsAriaLabel":[1,"tds-aria-label"],"open":[32],"internalValue":[32],"filterResult":[32],"filterFocus":[32],"internalDefaultValue":[32],"selectedOptions":[32],"filterQuery":[32],"setValue":[64],"reset":[64],"removeValue":[64],"focusElement":[64],"close":[64],"updateDisplay":[64],"appendValue":[64]},[[9,"mousedown","onAnyClick"],[0,"focusin","onFocusIn"],[0,"focusout","onFocusOut"],[0,"keydown","onKeyDown"]],{"value":[{"handleValueChange":0}],"open":[{"handleOpenState":0}],"defaultValue":[{"handleDefaultValueChange":0}]}]]],["p-09c5a74a",[[262,"tds-popover-canvas",{"selector":[1],"referenceEl":[16],"defaultShow":[4,"default-show"],"show":[4],"placement":[1],"offsetSkidding":[2,"offset-skidding"],"animation":[1],"offsetDistance":[2,"offset-distance"],"modifiers":[16],"tdsAlertDialog":[1,"tds-alert-dialog"],"modeVariant":[1,"mode-variant"],"childRef":[32],"close":[64]}]]],["p-9d1d18e5",[[262,"tds-button",{"text":[1],"type":[1],"variant":[1],"size":[1],"disabled":[4],"fullbleed":[4],"modeVariant":[1,"mode-variant"],"animation":[1],"tdsAriaLabel":[1,"tds-aria-label"],"name":[1],"value":[1],"onlyIcon":[32]},[[0,"keydown","handleKeyDown"],[0,"keyup","handleKeyUp"]]],[1,"tds-divider",{"orientation":[1],"variant":[1]}]]],["p-dc823504",[[257,"tds-side-menu-user-image",{"src":[1],"alt":[1]}],[1,"tds-side-menu-user-label",{"heading":[1],"subheading":[1]}]]],["p-e0be794f",[[257,"tds-side-menu-item",{"selected":[4],"active":[4],"collapsed":[32],"hasUserComponent":[32]},[[16,"internalTdsSideMenuPropChange","collapseSideMenuEventHandler"]]]]],["p-8db648a3",[[262,"tds-popover-core",{"selector":[1],"referenceEl":[16],"defaultShow":[4,"default-show"],"animation":[1],"show":[4],"placement":[1],"offsetSkidding":[2,"offset-skidding"],"offsetDistance":[2,"offset-distance"],"modifiers":[16],"trigger":[1],"autoHide":[4,"auto-hide"],"renderedShowValue":[32],"popperInstance":[32],"target":[32],"isShown":[32],"disableLogic":[32],"hasShownAtLeastOnce":[32],"openedByKeyboard":[32],"close":[64]},[[8,"click","onAnyClick"],[8,"internalTdsShow","onTdsShow"],[8,"keydown","handleKeydown"]],{"show":[{"onShowChange":0}],"referenceEl":[{"onReferenceElChanged":0}],"trigger":[{"onTriggerChanged":0}],"isShown":[{"onIsShownChange":0}]}]]],["p-17ea4d71",[[262,"tds-tooltip",{"text":[1],"selector":[1],"referenceEl":[16],"defaultShow":[4,"default-show"],"mouseOverTooltip":[4,"mouse-over-tooltip"],"trigger":[1],"show":[1028],"placement":[1],"offsetSkidding":[2,"offset-skidding"],"offsetDistance":[2,"offset-distance"],"tdsAriaDescribedby":[1,"tds-aria-describedby"]},[[8,"keydown","handleKeyDown"]]]]],["p-121afb33",[[262,"tds-checkbox",{"name":[1],"checkboxId":[1,"checkbox-id"],"disabled":[4],"required":[4],"checked":[1540],"indeterminate":[1028],"value":[1],"tdsAriaLabel":[1,"tds-aria-label"],"tdsAriaDescribedby":[1,"tds-aria-describedby"],"toggleCheckbox":[64],"focusElement":[64]},[[4,"reset","handleFormReset"]],{"indeterminate":[{"handleIndeterminateState":0}]}]]],["p-7fd4299d",[[257,"tds-header-item",{"active":[4],"selected":[4]}],[257,"tds-core-header-item"]]],["p-e7793e67",[[1,"tds-icon",{"name":[513],"size":[513],"svgTitle":[1,"svg-title"],"tdsAriaHidden":[4,"tds-aria-hidden"],"svgDescription":[1,"svg-description"],"icons_object":[32],"arrayOfIcons":[32]}]]]]'),e))));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,p as s,H as o,c as e,h as i,a as r}from"./index.js";import{c as l,a as d}from"./p-CBZ6wC3m.js";import{g as n}from"./p-Cn4f8w1e.js";import{d as a}from"./p-CIt4YhvL.js";const h=s(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tdsChange=e(this,"tdsChange",6),this.tdsFocus=e(this,"tdsFocus",6),this.tdsBlur=e(this,"tdsBlur",6),this.tdsInput=e(this,"tdsInput",6),this.tdsClear=e(this,"tdsClear",6),this.disabled=!1,this.modeVariant=null,this.openDirection="auto",this.size="lg",this.animation="slide",this.error=!1,this.multiselect=!1,this.filter=!1,this.normalizeText=!0,this.noResultText="No result",this.value=null,this.open=!1,this.internalValue="",this.filterResult=null,this.filterFocus=!1,this.internalDefaultValue="",this.selectedOptions=[],this.filterQuery="",this.hasFocus=!1,this.uuid=n(),this.setDefaultOption=()=>{if(this.internalDefaultValue){const t=this.multiselect?this.internalDefaultValue.split(","):[this.internalDefaultValue];this.updateDropdownStateInternal(t)}},this.getChildren=()=>Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName)),this.getSelectedChildren=()=>0===this.selectedOptions.length?[]:this.selectedOptions.map((t=>{var s;return null===(s=this.getChildren())||void 0===s?void 0:s.find((s=>l(s.value)===l(t)))})).filter(Boolean),this.getSelectedChildrenLabels=()=>{var t;return null===(t=this.getSelectedChildren())||void 0===t?void 0:t.map((t=>{var s;return null===(s=t.textContent)||void 0===s?void 0:s.trim()}))},this.getValue=()=>{const t=this.getSelectedChildrenLabels();return t?null==t?void 0:t.join(", "):""},this.setValueAttribute=()=>{0===this.selectedOptions.length?this.host.removeAttribute("value"):this.host.setAttribute("value",this.selectedOptions.join(","))},this.getOpenDirection=()=>{var t,s,o,e,i;if("auto"===this.openDirection||!this.openDirection){const r=null!==(s=null===(t=this.dropdownList)||void 0===t?void 0:t.offsetHeight)&&void 0!==s?s:0;return(null!==(i=null===(e=(o=this.host).getBoundingClientRect)||void 0===e?void 0:e.call(o).top)&&void 0!==i?i:0)+r+57>window.innerHeight?"up":"down"}return this.openDirection},this.handleToggleOpen=()=>{var t;if(!this.disabled&&(this.open=!this.open,this.open))if(this.filter)this.focusInputElement();else{const s=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");s&&s.focus()}},this.focusInputElement=()=>{this.inputElement&&this.inputElement.focus()},this.handleFilter=t=>{const s=t.currentTarget;if(this.multiselect&&0===this.filterQuery.length&&this.selectedOptions.length>0&&this.inputElement){const t=this.getValue(),o=s.value,e=function(t,s){return t.length<=s.length+1?t:t.startsWith(s)?t.slice(s.length):t.endsWith(s)?t.slice(0,t.length-s.length):t}(o,t);e!==o&&(this.inputElement.value=e)}this.tdsInput.emit(t);const o=this.inputElement?this.inputElement.value.toLowerCase():s.value.toLowerCase();this.filterQuery=o;const e=this.getChildren();""===o?(e.forEach((t=>(t.removeAttribute("hidden"),t))),this.filterResult=null):this.filterResult=e.filter((t=>{var s;return this.normalizeString(null!==(s=null==t?void 0:t.textContent)&&void 0!==s?s:"").toLowerCase().includes(this.normalizeString(o).toLowerCase())?t.removeAttribute("hidden"):t.setAttribute("hidden",""),!t.hasAttribute("hidden")})).length},this.handleFilterReset=()=>{if(this.multiselect){if(this.filterQuery.length>0){const t=this.filterQuery;this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.getValue(),this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}else if(this.selectedOptions.length>0){const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}}else{const t=[];this.filterQuery.length>0&&(t.push(this.filterQuery),this.filterQuery="",this.resetFilterVisibility()),this.selectedOptions.length>0&&(t.push(this.selectedOptions.join(",")),this.updateDropdownStateFromUser([])),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),t.length>0&&this.tdsClear.emit({clearedValue:t.join(",")})}},this.resetFilterVisibility=()=>{this.filterQuery="",this.getChildren().forEach((t=>{t.removeAttribute("hidden")})),this.filterResult=null},this.handleMultiselectClear=()=>{const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.tdsClear.emit({clearedValue:t})},this.handleFocus=()=>{this.open=!0,this.filterFocus=!0,this.multiselect&&this.filter?this.inputElement&&(this.inputElement.value=this.getValue()):this.inputElement&&(this.inputElement.value=""),this.filter&&this.resetFilterVisibility()},this.handleBlur=()=>{this.filterFocus=!1,this.filterQuery="",this.inputElement&&(this.inputElement.value=this.getValue()),this.filter&&this.resetFilterVisibility()},this.handleInputClick=()=>{this.multiselect&&this.filter&&(this.filterQuery="",this.inputElement&&(this.inputElement.value=""),this.resetFilterVisibility())},this.resetInput=()=>{this.host.querySelector("input")&&this.reset()}}handleValueChange(t){const s=this.normalizeValue(t);(function(t,s){return t.length!==s.length||t.some((t=>!s.includes(t)))})(s,this.selectedOptions)&&this.updateDropdownStateFromUser(s)}normalizeValue(t){return null==t||""===t?[]:this.multiselect?Array.isArray(t)?d(t):t.toString().split(",").filter((t=>""!==t)):Array.isArray(t)?[l(t[0])]:[l(t)]}updateDropdownStateInternal(t){this.updateDropdownState(t,!1)}updateDropdownStateFromUser(t){this.updateDropdownState(t,!0)}updateDropdownState(t,s=!0){const o=this.validateValues(t);this.selectedOptions=[...o],this.value=this.multiselect?this.selectedOptions:this.selectedOptions[0]||null,this.internalValue=this.getValue(),this.updateOptionElements(),this.updateDisplayValue(),s&&this.emitChange(),this.setValueAttribute()}validateValues(t){const s=this.getChildren();return s&&0!==s.length?t.filter((t=>{const o=s.some((s=>l(s.value)===l(t)));return o||console.warn(`TDS DROPDOWN: Option with value "${t}" does not exist`),o})):t}updateOptionElements(){var t;null===(t=this.getChildren())||void 0===t||t.forEach((t=>{t.setSelected(this.selectedOptions.includes(l(t.value)))}))}updateDisplayValue(){this.internalValue=this.getSelectedChildrenLabels().join(", "),this.filter&&this.inputElement&&(this.inputElement.value=this.internalValue)}emitChange(){const t=this.multiselect?this.selectedOptions.join(","):this.selectedOptions[0]||null;this.tdsChange.emit({name:this.name,value:null!=t?t:null})}async setValue(t,s){let o;return o=Array.isArray(t)?d(t):[l(t)],this.updateDropdownStateFromUser(o),this.getSelectedChildren().map((t=>{var s;return{value:t.value,label:null===(s=t.textContent)||void 0===s?void 0:s.trim()}}))}async reset(){this.updateDropdownStateFromUser([])}async removeValue(t){const s=this.selectedOptions.filter((s=>s!==t));this.updateDropdownStateFromUser(s)}async focusElement(){var t;if(this.filter)this.focusInputElement();else{const s=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");s&&s.focus()}this.handleFocus()}async close(){this.open=!1}async updateDisplay(){this.updateDisplayValue()}onAnyClick(t){this.open&&!t.composedPath().includes(this.host)&&(this.filter&&this.filterQuery&&this.tdsClear.emit({clearedValue:this.filterQuery}),this.open=!1)}onFocusIn(t){this.host.contains(t.target)&&(this.hasFocus||(this.hasFocus=!0,this.tdsFocus.emit(t)))}onFocusOut(t){const s=t.relatedTarget;!this.hasFocus||s&&this.host.contains(s)||(this.hasFocus=!1,this.handleBlur(),this.tdsBlur.emit(t))}async onKeyDown(t){var s,o;const{activeElement:e}=document;if(!e)return;const i=this.getChildren();if("ArrowDown"===t.key){const t=e.nextElementSibling?i.findIndex((t=>t===e.nextElementSibling)):0;if(i.length>0){const s=((t,s)=>{if(void 0===t[s])return 0;for(let o=s;o<t.length;o++)if(!t[o].disabled)return o})(i,t),o="number"==typeof s?i[s]:i[0];null==o||o.focus()}}else if("ArrowUp"===t.key){const t=e.nextElementSibling?this.getChildren().findIndex((t=>t===e.previousElementSibling)):0;if(i.length>0){const s=((t,s)=>{if(void 0===t[s])return t.length-1;for(let o=s;o>=0;o--)if(!t[o].disabled)return o})(i,t),o="number"==typeof s?i[s]:i[i.length-1];null==o||o.focus()}}else if("Escape"===t.key)if(this.open=!1,this.filter)null===(s=this.inputElement)||void 0===s||s.focus();else{const t=null===(o=this.host.shadowRoot)||void 0===o?void 0:o.querySelector("button");null==t||t.focus()}}handleOpenState(){this.filter&&(this.open||(this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.selectedOptions.length?this.getValue():""))),this.updateDropdownListInertState()}handleDefaultValueChange(t){null!=t&&(this.internalDefaultValue=l(t),this.setDefaultOption())}componentWillLoad(){if(null==this.value){if(null!=this.defaultValue){const t=l(this.defaultValue),s=this.multiselect?t.split(",").map(l):[t];this.updateDropdownStateInternal(s)}}else{const t=this.normalizeValue(this.value);this.updateDropdownStateInternal(t)}}handleSlotChange(){this.selectedOptions.length>0?this.updateDropdownStateInternal([...this.selectedOptions]):this.internalDefaultValue&&this.setDefaultOption()}normalizeString(t){return this.normalizeText?t.normalize("NFD").replace(/\p{Diacritic}/gu,""):t}async appendValue(t){this.filter&&this.filterQuery.length>0&&(this.filterQuery="",this.resetFilterVisibility()),this.updateDropdownStateFromUser(this.multiselect?[...this.selectedOptions,t]:[t]),this.filter&&this.multiselect&&this.inputElement&&(this.inputElement.value=this.getValue())}componentDidRender(){const t=this.host.closest("form");t&&t.addEventListener("reset",this.resetInput),this.updateDropdownListInertState()}disconnectedCallback(){const t=this.host.closest("form");t&&t.removeEventListener("reset",this.resetInput)}updateDropdownListInertState(){this.dropdownList&&(this.open?this.dropdownList.removeAttribute("inert"):this.dropdownList.setAttribute("inert",""))}render(){var t,s,o,e;((t,s,o,e)=>{let i=t.querySelector("input");t.querySelector("input")||(i=t.ownerDocument.createElement("input"),i.type="hidden",t.appendChild(i)),i&&(i.disabled=e,i.name=s||"",i.value=o||"")})(this.host,this.name,this.selectedOptions.join(","),this.disabled);const l=this.name||this.uuid,d=`dropdown-input-${l}`,n=this.label?`dropdown-label-${l}`:void 0,a=this.helper?`dropdown-helper-${l}`:void 0,h=this.selectedOptions.length>0,c=this.filterQuery.length>0,p=this.filterFocus||h||c,u=this.open||h,b="inside"!==this.labelPosition||u,v=null!==(t=this.tdsAriaLabel)&&void 0!==t?t:this.label?void 0:"Dropdown";let w=null!==(s=this.placeholder)&&void 0!==s?s:"";"inside"===this.labelPosition&&(w=!this.filterFocus||c||h||null===(o=this.placeholder)||void 0===o?"":o);let f="";return this.selectedOptions.length>0?f=this.getValue():b&&(f=null!==(e=this.placeholder)&&void 0!==e?e:""),i(r,{key:"d9d98d0592db6fef42ad3e1931bf658ca2402032",class:{[`tds-mode-variant-${this.modeVariant}`]:Boolean(this.modeVariant)}},this.label&&"outside"===this.labelPosition&&i("div",{key:"6703bd5f36f983cbdb80c68c7ac16882e8f6656a",id:n,class:"label-outside "+(this.disabled?"disabled":"")},this.label),i("div",{key:"61719795f191e28bba107c4226c527b74b305d80",class:{"dropdown-select":!0,[this.size]:!0,disabled:this.disabled}},this.filter?i("div",{class:{filter:!0,focus:this.filterFocus,disabled:this.disabled,error:this.error}},i("div",{class:"value-wrapper"},this.label&&"inside"===this.labelPosition&&i("label",{id:n,htmlFor:d,class:{"label-inside":!0,[this.size]:!0,floated:p}},this.label),i("input",{"aria-label":v,"aria-labelledby":n,"aria-describedby":a,"aria-disabled":this.disabled,ref:t=>{this.inputElement=t,this.inputElement&&!this.filterFocus&&(this.inputElement.value=this.getValue())},class:{placeholder:"inside"===this.labelPosition},id:d,type:"text",placeholder:w,disabled:this.disabled,onInput:t=>this.handleFilter(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleInputClick(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)}})),i("tds-icon",{tabIndex:0,role:"button","aria-label":this.filterQuery.length>0?"Clear filter":"Clear selection",svgTitle:this.filterQuery.length>0?"Clear filter":"Clear selection",onClick:this.handleFilterReset,onKeyDown:t=>{"Enter"===t.key&&this.handleFilterReset()},class:{"clear-icon":!0,hide:!(this.filterQuery.length>0||this.selectedOptions.length>0)},name:"cross",size:"16px"}),i("tds-icon",{tdsAriaHidden:!0,role:"button","aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",onClick:this.handleToggleOpen,onKeyDown:t=>{"Enter"===t.key&&this.handleToggleOpen()},class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"})):i("button",{"aria-label":this.tdsAriaLabel,"aria-labelledby":n,"aria-describedby":a,"aria-disabled":this.disabled,onClick:()=>this.handleToggleOpen(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)},class:`\n ${this.selectedOptions.length?"value":"placeholder"}\n ${this.open?"open":"closed"}\n ${this.error?"error":""}\n `,disabled:this.disabled},i("div",{class:`value-wrapper ${this.size}`},this.label&&"inside"===this.labelPosition&&i("div",{id:n,class:{"label-inside":!0,[this.size]:!0,floated:u}},this.label),i("div",{"aria-label":this.tdsAriaLabel?`Selected options for ${this.tdsAriaLabel}`:void 0,class:`placeholder ${this.size}`},f)),i("tds-icon",{tabIndex:0,role:"button","aria-label":"Clear selection",svgTitle:"Clear selection",onClick:t=>{t.stopPropagation(),this.handleMultiselectClear()},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.stopPropagation(),t.preventDefault(),this.handleMultiselectClear())},class:{"clear-icon":!0,hide:!(this.multiselect&&this.selectedOptions.length>0)},name:"cross",size:"16px"}),i("tds-icon",{"aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"}))),i("div",{key:"8335ca04dd9e0aeda2c8caa31758918c41c7e9d4",role:"listbox","aria-label":this.tdsAriaLabel,inert:!this.open,"aria-orientation":"vertical","aria-multiselectable":this.multiselect,ref:t=>{t&&(this.dropdownList=t)},class:{"dropdown-list":!0,[this.size]:!0,[this.getOpenDirection()]:!0,"label-outside":!(!this.label||"outside"!==this.labelPosition),open:this.open,closed:!this.open,[`animation-enter-${this.animation}`]:"none"!==this.animation&&this.open,[`animation-exit-${this.animation}`]:"none"!==this.animation&&!this.open}},i("slot",{key:"b1d5d76a4843cc03bb37b3dbc31cb1f7c4fa732d",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&i("div",{key:"115b23f03a201d9cf8d064aedc5151dd20fdc3b6",class:`no-result ${this.size}`},this.noResultText)),this.helper&&i("div",{key:"9cfaf3db7adfbddbe455d74bcc2db3f34c8415c3",id:a,class:{helper:!0,error:this.error,disabled:this.disabled}},this.error&&i("tds-icon",{key:"ccdd2d844e510eb91fe93851fd8ed8a09ac080dd",name:"error",size:"16px"}),this.helper))}get host(){return this}static get watchers(){return{value:[{handleValueChange:0}],open:[{handleOpenState:0}],defaultValue:[{handleDefaultValueChange:0}]}}static get style(){return'@charset "UTF-8";:host button{all:unset;display:flex;align-items:center;height:100%;width:100%;box-sizing:border-box;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius);padding:0 16px}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{flex:1;min-width:0;display:flex;align-items:center;padding:0}:host button .menu-icon{margin-right:16px}: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;align-items:center;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,:root{--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,:host .dropdown-select.disabled .menu-icon{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-dropdown-label-inside-color);left:16px;transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside.lg{top:20px;left:16px}:host .dropdown-select .label-inside.md{top:16px;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 .label-inside.floated{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls)}:host .dropdown-select .label-inside.floated.lg{top:12px}:host .dropdown-select .label-inside.floated.md{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;background-color:var(--tds-dropdown-bg)}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;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 .clear-icon{cursor:pointer;flex-shrink:0;margin:0;margin-right:8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .clear-icon.hide{display:none;visibility:hidden}:host tds-icon{transition:transform var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host tds-icon.open{transform:rotateZ(180deg)}'}},[257,"tds-dropdown",{name:[1],disabled:[4],helper:[1],label:[1],labelPosition:[1,"label-position"],modeVariant:[1,"mode-variant"],openDirection:[1,"open-direction"],placeholder:[1],size:[1],animation:[1],error:[4],multiselect:[4],filter:[4],normalizeText:[4,"normalize-text"],noResultText:[1,"no-result-text"],defaultValue:[8,"default-value"],value:[1032],tdsAriaLabel:[1,"tds-aria-label"],open:[32],internalValue:[32],filterResult:[32],filterFocus:[32],internalDefaultValue:[32],selectedOptions:[32],filterQuery:[32],setValue:[64],reset:[64],removeValue:[64],focusElement:[64],close:[64],updateDisplay:[64],appendValue:[64]},[[9,"mousedown","onAnyClick"],[0,"focusin","onFocusIn"],[0,"focusout","onFocusOut"],[0,"keydown","onKeyDown"]],{value:[{handleValueChange:0}],open:[{handleOpenState:0}],defaultValue:[{handleDefaultValueChange:0}]}]);function c(){"undefined"!=typeof customElements&&["tds-dropdown","tds-icon"].forEach((s=>{switch(s){case"tds-dropdown":customElements.get(t(s))||customElements.define(t(s),h);break;case"tds-icon":customElements.get(t(s))||a()}}))}c();export{h as T,c as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as o,h as s,H as i,a as e}from"./p-9xxNGlso.js";import{g as d}from"./p-Cn4f8w1e.js";const r=t=>null==t?"":t.toString(),l=t=>t.map((t=>r(t))),n=class{constructor(s){t(this,s),this.tdsChange=o(this,"tdsChange",6),this.tdsFocus=o(this,"tdsFocus",6),this.tdsBlur=o(this,"tdsBlur",6),this.tdsInput=o(this,"tdsInput",6),this.tdsClear=o(this,"tdsClear",6),this.disabled=!1,this.modeVariant=null,this.openDirection="auto",this.size="lg",this.animation="slide",this.error=!1,this.multiselect=!1,this.filter=!1,this.normalizeText=!0,this.noResultText="No result",this.value=null,this.open=!1,this.internalValue="",this.filterResult=null,this.filterFocus=!1,this.internalDefaultValue="",this.selectedOptions=[],this.filterQuery="",this.hasFocus=!1,this.uuid=d(),this.setDefaultOption=()=>{if(this.internalDefaultValue){const t=this.multiselect?this.internalDefaultValue.split(","):[this.internalDefaultValue];this.updateDropdownStateInternal(t)}},this.getChildren=()=>Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName)),this.getSelectedChildren=()=>0===this.selectedOptions.length?[]:this.selectedOptions.map((t=>{var o;return null===(o=this.getChildren())||void 0===o?void 0:o.find((o=>r(o.value)===r(t)))})).filter(Boolean),this.getSelectedChildrenLabels=()=>{var t;return null===(t=this.getSelectedChildren())||void 0===t?void 0:t.map((t=>{var o;return null===(o=t.textContent)||void 0===o?void 0:o.trim()}))},this.getValue=()=>{const t=this.getSelectedChildrenLabels();return t?null==t?void 0:t.join(", "):""},this.setValueAttribute=()=>{0===this.selectedOptions.length?this.host.removeAttribute("value"):this.host.setAttribute("value",this.selectedOptions.join(","))},this.getOpenDirection=()=>{var t,o,s,i,e;if("auto"===this.openDirection||!this.openDirection){const d=null!==(o=null===(t=this.dropdownList)||void 0===t?void 0:t.offsetHeight)&&void 0!==o?o:0;return(null!==(e=null===(i=(s=this.host).getBoundingClientRect)||void 0===i?void 0:i.call(s).top)&&void 0!==e?e:0)+d+57>window.innerHeight?"up":"down"}return this.openDirection},this.handleToggleOpen=()=>{var t;if(!this.disabled&&(this.open=!this.open,this.open))if(this.filter)this.focusInputElement();else{const o=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");o&&o.focus()}},this.focusInputElement=()=>{this.inputElement&&this.inputElement.focus()},this.handleFilter=t=>{const o=t.currentTarget;if(this.multiselect&&0===this.filterQuery.length&&this.selectedOptions.length>0&&this.inputElement){const t=this.getValue(),s=o.value,i=function(t,o){return t.length<=o.length+1?t:t.startsWith(o)?t.slice(o.length):t.endsWith(o)?t.slice(0,t.length-o.length):t}(s,t);i!==s&&(this.inputElement.value=i)}this.tdsInput.emit(t);const s=this.inputElement?this.inputElement.value.toLowerCase():o.value.toLowerCase();this.filterQuery=s;const i=this.getChildren();""===s?(i.forEach((t=>(t.removeAttribute("hidden"),t))),this.filterResult=null):this.filterResult=i.filter((t=>{var o;return this.normalizeString(null!==(o=null==t?void 0:t.textContent)&&void 0!==o?o:"").toLowerCase().includes(this.normalizeString(s).toLowerCase())?t.removeAttribute("hidden"):t.setAttribute("hidden",""),!t.hasAttribute("hidden")})).length},this.handleFilterReset=()=>{if(this.multiselect){if(this.filterQuery.length>0){const t=this.filterQuery;this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.getValue(),this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}else if(this.selectedOptions.length>0){const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),this.tdsClear.emit({clearedValue:t})}}else{const t=[];this.filterQuery.length>0&&(t.push(this.filterQuery),this.filterQuery="",this.resetFilterVisibility()),this.selectedOptions.length>0&&(t.push(this.selectedOptions.join(",")),this.updateDropdownStateFromUser([])),this.inputElement&&(this.inputElement.value="",this.inputElement.focus()),t.length>0&&this.tdsClear.emit({clearedValue:t.join(",")})}},this.resetFilterVisibility=()=>{this.filterQuery="",this.getChildren().forEach((t=>{t.removeAttribute("hidden")})),this.filterResult=null},this.handleMultiselectClear=()=>{const t=this.selectedOptions.join(",");this.updateDropdownStateFromUser([]),this.tdsClear.emit({clearedValue:t})},this.handleFocus=()=>{this.open=!0,this.filterFocus=!0,this.multiselect&&this.filter?this.inputElement&&(this.inputElement.value=this.getValue()):this.inputElement&&(this.inputElement.value=""),this.filter&&this.resetFilterVisibility()},this.handleBlur=()=>{this.filterFocus=!1,this.filterQuery="",this.inputElement&&(this.inputElement.value=this.getValue()),this.filter&&this.resetFilterVisibility()},this.handleInputClick=()=>{this.multiselect&&this.filter&&(this.filterQuery="",this.inputElement&&(this.inputElement.value=""),this.resetFilterVisibility())},this.resetInput=()=>{this.host.querySelector("input")&&this.reset()}}handleValueChange(t){const o=this.normalizeValue(t);(function(t,o){return t.length!==o.length||t.some((t=>!o.includes(t)))})(o,this.selectedOptions)&&this.updateDropdownStateFromUser(o)}normalizeValue(t){return null==t||""===t?[]:this.multiselect?Array.isArray(t)?l(t):t.toString().split(",").filter((t=>""!==t)):Array.isArray(t)?[r(t[0])]:[r(t)]}updateDropdownStateInternal(t){this.updateDropdownState(t,!1)}updateDropdownStateFromUser(t){this.updateDropdownState(t,!0)}updateDropdownState(t,o=!0){const s=this.validateValues(t);this.selectedOptions=[...s],this.value=this.multiselect?this.selectedOptions:this.selectedOptions[0]||null,this.internalValue=this.getValue(),this.updateOptionElements(),this.updateDisplayValue(),o&&this.emitChange(),this.setValueAttribute()}validateValues(t){const o=this.getChildren();return o&&0!==o.length?t.filter((t=>{const s=o.some((o=>r(o.value)===r(t)));return s||console.warn(`TDS DROPDOWN: Option with value "${t}" does not exist`),s})):t}updateOptionElements(){var t;null===(t=this.getChildren())||void 0===t||t.forEach((t=>{t.setSelected(this.selectedOptions.includes(r(t.value)))}))}updateDisplayValue(){this.internalValue=this.getSelectedChildrenLabels().join(", "),this.filter&&this.inputElement&&(this.inputElement.value=this.internalValue)}emitChange(){const t=this.multiselect?this.selectedOptions.join(","):this.selectedOptions[0]||null;this.tdsChange.emit({name:this.name,value:null!=t?t:null})}async setValue(t,o){let s;return s=Array.isArray(t)?l(t):[r(t)],this.updateDropdownStateFromUser(s),this.getSelectedChildren().map((t=>{var o;return{value:t.value,label:null===(o=t.textContent)||void 0===o?void 0:o.trim()}}))}async reset(){this.updateDropdownStateFromUser([])}async removeValue(t){const o=this.selectedOptions.filter((o=>o!==t));this.updateDropdownStateFromUser(o)}async focusElement(){var t;if(this.filter)this.focusInputElement();else{const o=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector("button");o&&o.focus()}this.handleFocus()}async close(){this.open=!1}async updateDisplay(){this.updateDisplayValue()}onAnyClick(t){this.open&&!t.composedPath().includes(this.host)&&(this.filter&&this.filterQuery&&this.tdsClear.emit({clearedValue:this.filterQuery}),this.open=!1)}onFocusIn(t){this.host.contains(t.target)&&(this.hasFocus||(this.hasFocus=!0,this.tdsFocus.emit(t)))}onFocusOut(t){const o=t.relatedTarget;!this.hasFocus||o&&this.host.contains(o)||(this.hasFocus=!1,this.handleBlur(),this.tdsBlur.emit(t))}async onKeyDown(t){var o,s;const{activeElement:i}=document;if(!i)return;const e=this.getChildren();if("ArrowDown"===t.key){const t=i.nextElementSibling?e.findIndex((t=>t===i.nextElementSibling)):0;if(e.length>0){const o=((t,o)=>{if(void 0===t[o])return 0;for(let s=o;s<t.length;s++)if(!t[s].disabled)return s})(e,t),s="number"==typeof o?e[o]:e[0];null==s||s.focus()}}else if("ArrowUp"===t.key){const t=i.nextElementSibling?this.getChildren().findIndex((t=>t===i.previousElementSibling)):0;if(e.length>0){const o=((t,o)=>{if(void 0===t[o])return t.length-1;for(let s=o;s>=0;s--)if(!t[s].disabled)return s})(e,t),s="number"==typeof o?e[o]:e[e.length-1];null==s||s.focus()}}else if("Escape"===t.key)if(this.open=!1,this.filter)null===(o=this.inputElement)||void 0===o||o.focus();else{const t=null===(s=this.host.shadowRoot)||void 0===s?void 0:s.querySelector("button");null==t||t.focus()}}handleOpenState(){this.filter&&(this.open||(this.filterQuery="",this.resetFilterVisibility(),this.inputElement&&(this.inputElement.value=this.selectedOptions.length?this.getValue():""))),this.updateDropdownListInertState()}handleDefaultValueChange(t){null!=t&&(this.internalDefaultValue=r(t),this.setDefaultOption())}componentWillLoad(){if(null==this.value){if(null!=this.defaultValue){const t=r(this.defaultValue),o=this.multiselect?t.split(",").map(r):[t];this.updateDropdownStateInternal(o)}}else{const t=this.normalizeValue(this.value);this.updateDropdownStateInternal(t)}}handleSlotChange(){this.selectedOptions.length>0?this.updateDropdownStateInternal([...this.selectedOptions]):this.internalDefaultValue&&this.setDefaultOption()}normalizeString(t){return this.normalizeText?t.normalize("NFD").replace(/\p{Diacritic}/gu,""):t}async appendValue(t){this.filter&&this.filterQuery.length>0&&(this.filterQuery="",this.resetFilterVisibility()),this.updateDropdownStateFromUser(this.multiselect?[...this.selectedOptions,t]:[t]),this.filter&&this.multiselect&&this.inputElement&&(this.inputElement.value=this.getValue())}componentDidRender(){const t=this.host.closest("form");t&&t.addEventListener("reset",this.resetInput),this.updateDropdownListInertState()}disconnectedCallback(){const t=this.host.closest("form");t&&t.removeEventListener("reset",this.resetInput)}updateDropdownListInertState(){this.dropdownList&&(this.open?this.dropdownList.removeAttribute("inert"):this.dropdownList.setAttribute("inert",""))}render(){var t,o,e,d;((t,o,s,i)=>{let e=t.querySelector("input");t.querySelector("input")||(e=t.ownerDocument.createElement("input"),e.type="hidden",t.appendChild(e)),e&&(e.disabled=i,e.name=o||"",e.value=s||"")})(this.host,this.name,this.selectedOptions.join(","),this.disabled);const r=this.name||this.uuid,l=`dropdown-input-${r}`,n=this.label?`dropdown-label-${r}`:void 0,h=this.helper?`dropdown-helper-${r}`:void 0,a=this.selectedOptions.length>0,c=this.filterQuery.length>0,p=this.filterFocus||a||c,b=this.open||a,u="inside"!==this.labelPosition||b,v=null!==(t=this.tdsAriaLabel)&&void 0!==t?t:this.label?void 0:"Dropdown";let w=null!==(o=this.placeholder)&&void 0!==o?o:"";"inside"===this.labelPosition&&(w=!this.filterFocus||c||a||null===(e=this.placeholder)||void 0===e?"":e);let f="";return this.selectedOptions.length>0?f=this.getValue():u&&(f=null!==(d=this.placeholder)&&void 0!==d?d:""),s(i,{key:"d9d98d0592db6fef42ad3e1931bf658ca2402032",class:{[`tds-mode-variant-${this.modeVariant}`]:Boolean(this.modeVariant)}},this.label&&"outside"===this.labelPosition&&s("div",{key:"6703bd5f36f983cbdb80c68c7ac16882e8f6656a",id:n,class:"label-outside "+(this.disabled?"disabled":"")},this.label),s("div",{key:"61719795f191e28bba107c4226c527b74b305d80",class:{"dropdown-select":!0,[this.size]:!0,disabled:this.disabled}},this.filter?s("div",{class:{filter:!0,focus:this.filterFocus,disabled:this.disabled,error:this.error}},s("div",{class:"value-wrapper"},this.label&&"inside"===this.labelPosition&&s("label",{id:n,htmlFor:l,class:{"label-inside":!0,[this.size]:!0,floated:p}},this.label),s("input",{"aria-label":v,"aria-labelledby":n,"aria-describedby":h,"aria-disabled":this.disabled,ref:t=>{this.inputElement=t,this.inputElement&&!this.filterFocus&&(this.inputElement.value=this.getValue())},class:{placeholder:"inside"===this.labelPosition},id:l,type:"text",placeholder:w,disabled:this.disabled,onInput:t=>this.handleFilter(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleInputClick(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)}})),s("tds-icon",{tabIndex:0,role:"button","aria-label":this.filterQuery.length>0?"Clear filter":"Clear selection",svgTitle:this.filterQuery.length>0?"Clear filter":"Clear selection",onClick:this.handleFilterReset,onKeyDown:t=>{"Enter"===t.key&&this.handleFilterReset()},class:{"clear-icon":!0,hide:!(this.filterQuery.length>0||this.selectedOptions.length>0)},name:"cross",size:"16px"}),s("tds-icon",{tdsAriaHidden:!0,role:"button","aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",onClick:this.handleToggleOpen,onKeyDown:t=>{"Enter"===t.key&&this.handleToggleOpen()},class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"})):s("button",{"aria-label":this.tdsAriaLabel,"aria-labelledby":n,"aria-describedby":h,"aria-disabled":this.disabled,onClick:()=>this.handleToggleOpen(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)},class:`\n ${this.selectedOptions.length?"value":"placeholder"}\n ${this.open?"open":"closed"}\n ${this.error?"error":""}\n `,disabled:this.disabled},s("div",{class:`value-wrapper ${this.size}`},this.label&&"inside"===this.labelPosition&&s("div",{id:n,class:{"label-inside":!0,[this.size]:!0,floated:b}},this.label),s("div",{"aria-label":this.tdsAriaLabel?`Selected options for ${this.tdsAriaLabel}`:void 0,class:`placeholder ${this.size}`},f)),s("tds-icon",{tabIndex:0,role:"button","aria-label":"Clear selection",svgTitle:"Clear selection",onClick:t=>{t.stopPropagation(),this.handleMultiselectClear()},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.stopPropagation(),t.preventDefault(),this.handleMultiselectClear())},class:{"clear-icon":!0,hide:!(this.multiselect&&this.selectedOptions.length>0)},name:"cross",size:"16px"}),s("tds-icon",{"aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"}))),s("div",{key:"8335ca04dd9e0aeda2c8caa31758918c41c7e9d4",role:"listbox","aria-label":this.tdsAriaLabel,inert:!this.open,"aria-orientation":"vertical","aria-multiselectable":this.multiselect,ref:t=>{t&&(this.dropdownList=t)},class:{"dropdown-list":!0,[this.size]:!0,[this.getOpenDirection()]:!0,"label-outside":!(!this.label||"outside"!==this.labelPosition),open:this.open,closed:!this.open,[`animation-enter-${this.animation}`]:"none"!==this.animation&&this.open,[`animation-exit-${this.animation}`]:"none"!==this.animation&&!this.open}},s("slot",{key:"b1d5d76a4843cc03bb37b3dbc31cb1f7c4fa732d",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&s("div",{key:"115b23f03a201d9cf8d064aedc5151dd20fdc3b6",class:`no-result ${this.size}`},this.noResultText)),this.helper&&s("div",{key:"9cfaf3db7adfbddbe455d74bcc2db3f34c8415c3",id:h,class:{helper:!0,error:this.error,disabled:this.disabled}},this.error&&s("tds-icon",{key:"ccdd2d844e510eb91fe93851fd8ed8a09ac080dd",name:"error",size:"16px"}),this.helper))}get host(){return e(this)}static get watchers(){return{value:[{handleValueChange:0}],open:[{handleOpenState:0}],defaultValue:[{handleDefaultValueChange:0}]}}};n.style='@charset "UTF-8";:host button{all:unset;display:flex;align-items:center;height:100%;width:100%;box-sizing:border-box;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius);padding:0 16px}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{flex:1;min-width:0;display:flex;align-items:center;padding:0}:host button .menu-icon{margin-right:16px}: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;align-items:center;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,:root{--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,:host .dropdown-select.disabled .menu-icon{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-dropdown-label-inside-color);left:16px;transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside.lg{top:20px;left:16px}:host .dropdown-select .label-inside.md{top:16px;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 .label-inside.floated{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls)}:host .dropdown-select .label-inside.floated.lg{top:12px}:host .dropdown-select .label-inside.floated.md{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;background-color:var(--tds-dropdown-bg)}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;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 .clear-icon{cursor:pointer;flex-shrink:0;margin:0;margin-right:8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .clear-icon.hide{display:none;visibility:hidden}:host tds-icon{transition:transform var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host tds-icon.open{transform:rotateZ(180deg)}';const h=class{constructor(s){t(this,s),this.tdsSelect=o(this,"tdsSelect",6),this.tdsFocus=o(this,"tdsFocus",6),this.tdsBlur=o(this,"tdsBlur",6),this.internalValue="",this.disabled=!1,this.selected=!1,this.multiselect=!1,this.size="lg",this.parentDropdown=null,this.label="",this.componentWillRender=()=>{var t,o,s;this.host.parentElement&&(this.parentDropdown="TDS-DROPDOWN"===(null===(t=this.host.parentElement)||void 0===t?void 0:t.tagName)?this.host.parentElement:this.host.getRootNode().host,this.parentDropdown&&(this.multiselect=null!==(o=this.parentDropdown.multiselect)&&void 0!==o&&o,this.size=this.parentDropdown.size||"lg"),this.label=(null===(s=this.host.textContent)||void 0===s?void 0:s.trim())||"")},this.handleSingleSelect=()=>{var t,o;this.disabled||(this.selected=!0,null===(t=this.parentDropdown)||void 0===t||t.appendValue(this.internalValue),null===(o=this.parentDropdown)||void 0===o||o.close(),this.tdsSelect.emit({value:this.internalValue,selected:this.selected}))},this.handleMultiselect=t=>{var o,s;this.disabled||(t.detail.checked?(null===(o=this.parentDropdown)||void 0===o||o.appendValue(this.internalValue),this.selected=!0,this.tdsSelect.emit({value:this.internalValue,selected:this.selected})):(null===(s=this.parentDropdown)||void 0===s||s.removeValue(this.internalValue),this.selected=!1,this.tdsSelect.emit({value:this.internalValue,selected:this.selected})),t.stopPropagation())},this.handleFocus=t=>{this.parentDropdown||this.tdsFocus.emit(t)},this.handleBlur=t=>{this.parentDropdown||this.tdsBlur.emit(t)}}async setSelected(t){this.selected=t}valueWatcher(t){this.internalValue=r(t)}componentWillLoad(){this.internalValue=r(this.value)}render(){return s(i,{key:"35542ea54d2ba455982e2470190711f75f88a999"},s("div",{key:"4236d5281cf4675586a7d8b16e80141b9689dad3",class:`dropdown-option\n ${this.size}\n ${this.selected?"selected":""}\n ${this.disabled?"disabled":""}\n `},this.multiselect?s("div",{class:"multiselect",onKeyDown:t=>{var o;"Escape"===t.key&&(null===(o=this.parentDropdown)||void 0===o||o.close())}},s("tds-checkbox",{onTdsChange:t=>{this.handleMultiselect(t)},onTdsBlur:t=>{t.stopPropagation()},disabled:this.disabled,checked:this.selected,tdsAriaLabel:this.tdsAriaLabel,class:{[this.size]:!0}},s("div",{slot:"label"},s("slot",null)))):s("button",{role:"option","aria-disabled":this.disabled,"aria-selected":this.selected,"aria-label":this.tdsAriaLabel,onClick:()=>{this.handleSingleSelect()},onFocus:t=>this.handleFocus(t),onBlur:t=>this.handleBlur(t),disabled:this.disabled,class:this.size},s("div",{class:"single-select"},s("slot",null),this.selected&&s("tds-icon",{name:"tick",size:"16px"})))))}static get delegatesFocus(){return!0}get host(){return e(this)}static get watchers(){return{value:[{valueWatcher:0}]}}};h.style=":host{box-sizing:border-box;display:block;background-color:var(--tds-dropdown-option-background)}:host *{box-sizing:border-box}:host .dropdown-option{color:var(--tds-dropdown-option-color);border-bottom:1px solid var(--tds-dropdown-option-border);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);overflow-wrap:anywhere;transition:background-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-option.selected{background-color:var(--tds-dropdown-option-background-selected)}:host .dropdown-option.disabled{color:var(--tds-dropdown-option-color-disabled)}:host .dropdown-option button:focus{outline:2px solid var(--tds-focus-outline-color);box-shadow:inset 0 0 0 3px var(--tds-white);outline-offset:-2px}:host .dropdown-option button{all:unset;width:100%}:host .dropdown-option button.lg{padding:19px 0 20px}:host .dropdown-option button.md{padding:15px 0 16px}:host .dropdown-option button.sm{padding:11px 0 12px}:host .dropdown-option button.xs{padding:7px 0 8px}:host .dropdown-option button .single-select{display:flex;align-items:center;justify-content:space-between;padding:0 16px}:host .dropdown-option .multiselect{width:100%;height:100%}:host .dropdown-option .multiselect tds-checkbox{display:flex;height:100%;width:100%}:host .dropdown-option .multiselect tds-checkbox.lg{padding:15px 16px 16px}:host .dropdown-option .multiselect tds-checkbox.md{padding:11px 16px 12px}:host .dropdown-option .multiselect tds-checkbox.sm{padding:7px 16px 8px}:host .dropdown-option .multiselect tds-checkbox.xs{padding:7px 16px 8px}:host .dropdown-option:hover{border-bottom-color:var(--tds-dropdown-option-border-hover);cursor:pointer}:host .dropdown-option:hover.disabled{border-bottom-color:var(--tds-dropdown-option-border-hover);cursor:not-allowed}:host([hidden]){display:none}";export{n as tds_dropdown,h as tds_dropdown_option}
|