@scania/tegel 1.50.0-develop-beta.1 → 1.50.0-figma-script-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-BVB4NySF.js +2548 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/tds-badge.cjs.entry.js +1 -1
- package/dist/cjs/tds-banner.cjs.entry.js +1 -1
- package/dist/cjs/tds-block.cjs.entry.js +1 -1
- package/dist/cjs/tds-body-cell.cjs.entry.js +1 -1
- package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/tds-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/tds-button_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-card.cjs.entry.js +1 -1
- package/dist/cjs/tds-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/tds-chip.cjs.entry.js +1 -1
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-datetime.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-folder-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer-group.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list-user.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-hamburger.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-grid-title.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-grid.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-list-title.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-list.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-title.cjs.entry.js +1 -1
- package/dist/cjs/tds-header.cjs.entry.js +1 -1
- package/dist/cjs/tds-icon.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-link.cjs.entry.js +1 -1
- package/dist/cjs/tds-message.cjs.entry.js +1 -1
- package/dist/cjs/tds-modal.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-close-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown-list.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-overlay.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-user-image_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-user.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +1 -1
- package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tds-step.cjs.entry.js +1 -1
- package/dist/cjs/tds-stepper.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body-input-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body-row.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-footer.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-header-input-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-header.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/tds-table.cjs.entry.js +1 -1
- package/dist/cjs/tds-tag.cjs.entry.js +1 -1
- package/dist/cjs/tds-text-field.cjs.entry.js +1 -1
- package/dist/cjs/tds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/tds-toast.cjs.entry.js +1 -1
- package/dist/cjs/tds-toggle.cjs.entry.js +1 -1
- package/dist/cjs/tds-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/esm/index-DweBXg7f.js +2519 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/tds-accordion-item.entry.js +1 -1
- package/dist/esm/tds-accordion.entry.js +1 -1
- package/dist/esm/tds-badge.entry.js +1 -1
- package/dist/esm/tds-banner.entry.js +1 -1
- package/dist/esm/tds-block.entry.js +1 -1
- package/dist/esm/tds-body-cell.entry.js +1 -1
- package/dist/esm/tds-breadcrumb.entry.js +1 -1
- package/dist/esm/tds-breadcrumbs.entry.js +1 -1
- package/dist/esm/tds-button_2.entry.js +1 -1
- package/dist/esm/tds-card.entry.js +1 -1
- package/dist/esm/tds-checkbox.entry.js +1 -1
- package/dist/esm/tds-chip.entry.js +1 -1
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/tds-datetime.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +1 -1
- package/dist/esm/tds-folder-tab.entry.js +1 -1
- package/dist/esm/tds-folder-tabs.entry.js +1 -1
- package/dist/esm/tds-footer-group.entry.js +1 -1
- package/dist/esm/tds-footer-item.entry.js +1 -1
- package/dist/esm/tds-footer.entry.js +1 -1
- package/dist/esm/tds-header-brand-symbol.entry.js +1 -1
- package/dist/esm/tds-header-cell.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list-user.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list.entry.js +1 -1
- package/dist/esm/tds-header-dropdown.entry.js +1 -1
- package/dist/esm/tds-header-hamburger.entry.js +1 -1
- package/dist/esm/tds-header-launcher-button.entry.js +1 -1
- package/dist/esm/tds-header-launcher-grid-item.entry.js +1 -1
- package/dist/esm/tds-header-launcher-grid-title.entry.js +1 -1
- package/dist/esm/tds-header-launcher-grid.entry.js +1 -1
- package/dist/esm/tds-header-launcher-list-item.entry.js +1 -1
- package/dist/esm/tds-header-launcher-list-title.entry.js +1 -1
- package/dist/esm/tds-header-launcher-list.entry.js +1 -1
- package/dist/esm/tds-header-launcher.entry.js +1 -1
- package/dist/esm/tds-header-title.entry.js +1 -1
- package/dist/esm/tds-header.entry.js +1 -1
- package/dist/esm/tds-icon.entry.js +1 -1
- package/dist/esm/tds-inline-tab.entry.js +1 -1
- package/dist/esm/tds-inline-tabs.entry.js +1 -1
- package/dist/esm/tds-link.entry.js +1 -1
- package/dist/esm/tds-message.entry.js +1 -1
- package/dist/esm/tds-modal.entry.js +1 -1
- package/dist/esm/tds-navigation-tab.entry.js +1 -1
- package/dist/esm/tds-navigation-tabs.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +1 -1
- package/dist/esm/tds-popover-core.entry.js +1 -1
- package/dist/esm/tds-popover-menu-item.entry.js +1 -1
- package/dist/esm/tds-popover-menu.entry.js +1 -1
- package/dist/esm/tds-radio-button.entry.js +1 -1
- package/dist/esm/tds-side-menu-close-button.entry.js +1 -1
- package/dist/esm/tds-side-menu-collapse-button.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown-list.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown.entry.js +1 -1
- package/dist/esm/tds-side-menu-item.entry.js +1 -1
- package/dist/esm/tds-side-menu-overlay.entry.js +1 -1
- package/dist/esm/tds-side-menu-user-image_2.entry.js +1 -1
- package/dist/esm/tds-side-menu-user.entry.js +1 -1
- package/dist/esm/tds-side-menu.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +1 -1
- package/dist/esm/tds-spinner.entry.js +1 -1
- package/dist/esm/tds-step.entry.js +1 -1
- package/dist/esm/tds-stepper.entry.js +1 -1
- package/dist/esm/tds-table-body-input-wrapper.entry.js +1 -1
- package/dist/esm/tds-table-body-row-expandable.entry.js +1 -1
- package/dist/esm/tds-table-body-row.entry.js +1 -1
- package/dist/esm/tds-table-body.entry.js +1 -1
- package/dist/esm/tds-table-footer.entry.js +1 -1
- package/dist/esm/tds-table-header-input-wrapper.entry.js +1 -1
- package/dist/esm/tds-table-header.entry.js +1 -1
- package/dist/esm/tds-table-toolbar.entry.js +1 -1
- package/dist/esm/tds-table.entry.js +1 -1
- package/dist/esm/tds-tag.entry.js +1 -1
- package/dist/esm/tds-text-field.entry.js +1 -1
- package/dist/esm/tds-textarea.entry.js +1 -1
- package/dist/esm/tds-toast.entry.js +1 -1
- package/dist/esm/tds-toggle.entry.js +1 -1
- package/dist/esm/tds-tooltip.entry.js +1 -1
- package/dist/esm/tegel.js +2 -2
- package/dist/tegel/{p-d45483a2.entry.js → p-01ada5cc.entry.js} +1 -1
- package/dist/tegel/{p-b6e1dfa5.entry.js → p-036500ba.entry.js} +1 -1
- package/dist/tegel/p-04d85b0f.entry.js +1 -0
- package/dist/tegel/{p-5a1681e5.entry.js → p-053b25a7.entry.js} +1 -1
- package/dist/tegel/{p-d4365572.entry.js → p-056a99f3.entry.js} +1 -1
- package/dist/tegel/{p-57d395ed.entry.js → p-0a977120.entry.js} +1 -1
- package/dist/tegel/{p-d36b6ce9.entry.js → p-0b12a178.entry.js} +1 -1
- package/dist/tegel/{p-a8b22784.entry.js → p-0ca82d41.entry.js} +1 -1
- package/dist/tegel/{p-d2d05d9a.entry.js → p-118d48a8.entry.js} +1 -1
- package/dist/tegel/{p-8d956ad4.entry.js → p-11f65313.entry.js} +1 -1
- package/dist/tegel/{p-4b563670.entry.js → p-19dd1ae7.entry.js} +1 -1
- package/dist/tegel/{p-fab0fa77.entry.js → p-1b7a6444.entry.js} +1 -1
- package/dist/tegel/{p-c044faa3.entry.js → p-1e388219.entry.js} +1 -1
- package/dist/tegel/{p-05b17d71.entry.js → p-1eee6082.entry.js} +1 -1
- package/dist/tegel/{p-888184f4.entry.js → p-204c07e4.entry.js} +1 -1
- package/dist/tegel/{p-5a230bfb.entry.js → p-25dda965.entry.js} +1 -1
- package/dist/tegel/{p-91bf500a.entry.js → p-295981b0.entry.js} +1 -1
- package/dist/tegel/{p-ea1e187e.entry.js → p-2b121bca.entry.js} +1 -1
- package/dist/tegel/p-2ba3870b.entry.js +1 -0
- package/dist/tegel/{p-7ad4cff6.entry.js → p-2dcd1256.entry.js} +1 -1
- package/dist/tegel/{p-65475bb9.entry.js → p-308a9360.entry.js} +1 -1
- package/dist/tegel/{p-79a98f30.entry.js → p-32999857.entry.js} +1 -1
- package/dist/tegel/{p-809721c8.entry.js → p-3bff4a02.entry.js} +1 -1
- package/dist/tegel/{p-130750dd.entry.js → p-3c353dbe.entry.js} +1 -1
- package/dist/tegel/{p-266eb96c.entry.js → p-3ca13df1.entry.js} +1 -1
- package/dist/tegel/{p-0b2f28ca.entry.js → p-3d1d0539.entry.js} +1 -1
- package/dist/tegel/{p-fb9c0c8b.entry.js → p-407bf43a.entry.js} +1 -1
- package/dist/tegel/{p-2b06e015.entry.js → p-466b3ada.entry.js} +1 -1
- package/dist/tegel/{p-f6554516.entry.js → p-475f4f25.entry.js} +1 -1
- package/dist/tegel/{p-5ca31069.entry.js → p-4a4a8fd8.entry.js} +1 -1
- package/dist/tegel/{p-0dd222cb.entry.js → p-50684cc9.entry.js} +1 -1
- package/dist/tegel/{p-7fb81f56.entry.js → p-507e1770.entry.js} +1 -1
- package/dist/tegel/{p-be00d349.entry.js → p-5e638157.entry.js} +1 -1
- package/dist/tegel/{p-ce67fac5.entry.js → p-5f86c486.entry.js} +1 -1
- package/dist/tegel/{p-0e89bd08.entry.js → p-67fc2dea.entry.js} +1 -1
- package/dist/tegel/{p-8b03811b.entry.js → p-6bfcaa2a.entry.js} +1 -1
- package/dist/tegel/{p-52432e2d.entry.js → p-7ccbba43.entry.js} +1 -1
- package/dist/tegel/{p-4817040f.entry.js → p-7dea78f2.entry.js} +1 -1
- package/dist/tegel/{p-29546870.entry.js → p-81e2755d.entry.js} +1 -1
- package/dist/tegel/{p-25ffd41a.entry.js → p-831c9366.entry.js} +1 -1
- package/dist/tegel/{p-8aa37880.entry.js → p-88abcb6a.entry.js} +1 -1
- package/dist/tegel/{p-58f73c59.entry.js → p-88e70c3b.entry.js} +1 -1
- package/dist/tegel/p-89cc6b53.entry.js +1 -0
- package/dist/tegel/{p-c7e81ef2.entry.js → p-98ab6d90.entry.js} +1 -1
- package/dist/tegel/{p-7a110985.entry.js → p-9cdb4f92.entry.js} +1 -1
- package/dist/tegel/{p-45da9cad.entry.js → p-9f11a4d2.entry.js} +1 -1
- package/dist/tegel/p-DweBXg7f.js +2 -0
- package/dist/tegel/{p-dad3e02f.entry.js → p-a274cda5.entry.js} +1 -1
- package/dist/tegel/{p-71f12fbe.entry.js → p-a801a3dc.entry.js} +1 -1
- package/dist/tegel/p-af80e494.entry.js +1 -0
- package/dist/tegel/{p-6b56155b.entry.js → p-b2987e97.entry.js} +1 -1
- package/dist/tegel/{p-c10d32f0.entry.js → p-b2e56961.entry.js} +1 -1
- package/dist/tegel/{p-1a805013.entry.js → p-b4ec80bf.entry.js} +1 -1
- package/dist/tegel/{p-3b8f7ccf.entry.js → p-b4f4a662.entry.js} +1 -1
- package/dist/tegel/{p-9b6ea0b4.entry.js → p-bd13b9e7.entry.js} +1 -1
- package/dist/tegel/{p-e2ef5e0b.entry.js → p-be14d395.entry.js} +1 -1
- package/dist/tegel/{p-943d61f9.entry.js → p-c4694585.entry.js} +1 -1
- package/dist/tegel/{p-ba466230.entry.js → p-c4cf9048.entry.js} +1 -1
- package/dist/tegel/{p-5c13c37d.entry.js → p-c585fb4f.entry.js} +1 -1
- package/dist/tegel/{p-cbf5b8fd.entry.js → p-c5ef8d6a.entry.js} +1 -1
- package/dist/tegel/{p-b882afdc.entry.js → p-c7f41809.entry.js} +1 -1
- package/dist/tegel/{p-701d4293.entry.js → p-ca6a5ea7.entry.js} +1 -1
- package/dist/tegel/{p-6abb4e48.entry.js → p-cd9faccb.entry.js} +1 -1
- package/dist/tegel/{p-e4d9f174.entry.js → p-d01f4544.entry.js} +1 -1
- package/dist/tegel/{p-76dea1da.entry.js → p-d4980629.entry.js} +1 -1
- package/dist/tegel/{p-68fe9b76.entry.js → p-d6047e04.entry.js} +1 -1
- package/dist/tegel/{p-d34cfa4a.entry.js → p-d9c17e1b.entry.js} +1 -1
- package/dist/tegel/{p-2831fafe.entry.js → p-dd6aac89.entry.js} +1 -1
- package/dist/tegel/{p-1c67816d.entry.js → p-e191c74a.entry.js} +1 -1
- package/dist/tegel/{p-d727ce15.entry.js → p-e2ebbf38.entry.js} +1 -1
- package/dist/tegel/{p-5c167f7d.entry.js → p-ea4e5fda.entry.js} +1 -1
- package/dist/tegel/{p-2132adfd.entry.js → p-ebb3203d.entry.js} +1 -1
- package/dist/tegel/{p-12b87ea5.entry.js → p-ebc95d30.entry.js} +1 -1
- package/dist/tegel/{p-05734bd9.entry.js → p-f0e8ba85.entry.js} +1 -1
- package/dist/tegel/{p-deacc365.entry.js → p-f2bd2109.entry.js} +1 -1
- package/dist/tegel/{p-3f690d81.entry.js → p-f31e9596.entry.js} +1 -1
- package/dist/tegel/{p-190d22e3.entry.js → p-f4e3b306.entry.js} +1 -1
- package/dist/tegel/{p-443829dd.entry.js → p-f8352d9e.entry.js} +1 -1
- package/dist/tegel/{p-ba462135.entry.js → p-fc3cacf7.entry.js} +1 -1
- package/dist/tegel/{p-022feefe.entry.js → p-fe3d8e4a.entry.js} +1 -1
- package/dist/tegel/tegel.css +9 -9
- package/dist/tegel/tegel.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-BJ10h8-I.js +0 -2548
- package/dist/esm/index-BdzyrAx0.js +0 -2519
- package/dist/tegel/p-02de949b.entry.js +0 -1
- package/dist/tegel/p-925340e5.entry.js +0 -1
- package/dist/tegel/p-BdzyrAx0.js +0 -2
- package/dist/tegel/p-eef1f3a6.entry.js +0 -1
- package/dist/tegel/p-fec63ee6.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as o,h as s,H as i,a as e}from"./p-BdzyrAx0.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=()=>{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=>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(`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(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.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:"b9cf35a8a59a4394231a6a1eaf28d10eb406d9dd",class:{[`tds-mode-variant-${this.modeVariant}`]:Boolean(this.modeVariant)}},this.label&&"outside"===this.labelPosition&&s("div",{key:"d0a437dd9964f99a6fc584e19db6cb202a52db6d",id:n,class:"label-outside "+(this.disabled?"disabled":"")},this.label),s("div",{key:"1f2bc5ba3a4f88d0562920514582dbbca392f0f2",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:"33b396b80b0bd9df1e2ad49ce76a6d206b8494c1",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:"34c20eb4db47adc67acbfa82fb9cdc4d00570dff",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&s("div",{key:"20accfd7501265ef8bb4472984950af150967292",class:`no-result ${this.size}`},this.noResultText)),this.helper&&s("div",{key:"184197b19327dc1f41cf4deff322516c8a8e2016",id:h,class:{helper:!0,error:this.error,disabled:this.disabled}},this.error&&s("tds-icon",{key:"d981559018ad6f969a2292e1520db0fa1fe66623",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:"f2c0929d4a6d9e7df2259b80175ddde7bad15946"},s("div",{key:"433562a99e20ec9b21cf1b07819c52e516081723",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}
|
|
1
|
+
import{r as t,c as o,h as s,H as i,a as e}from"./p-DweBXg7f.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=()=>{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=>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(`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(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.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:"b9cf35a8a59a4394231a6a1eaf28d10eb406d9dd",class:{[`tds-mode-variant-${this.modeVariant}`]:Boolean(this.modeVariant)}},this.label&&"outside"===this.labelPosition&&s("div",{key:"d0a437dd9964f99a6fc584e19db6cb202a52db6d",id:n,class:"label-outside "+(this.disabled?"disabled":"")},this.label),s("div",{key:"1f2bc5ba3a4f88d0562920514582dbbca392f0f2",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:"33b396b80b0bd9df1e2ad49ce76a6d206b8494c1",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:"34c20eb4db47adc67acbfa82fb9cdc4d00570dff",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&s("div",{key:"20accfd7501265ef8bb4472984950af150967292",class:`no-result ${this.size}`},this.noResultText)),this.helper&&s("div",{key:"184197b19327dc1f41cf4deff322516c8a8e2016",id:h,class:{helper:!0,error:this.error,disabled:this.disabled}},this.error&&s("tds-icon",{key:"d981559018ad6f969a2292e1520db0fa1fe66623",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:"f2c0929d4a6d9e7df2259b80175ddde7bad15946"},s("div",{key:"433562a99e20ec9b21cf1b07819c52e516081723",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}
|