@scania/tegel 1.24.0-value-prop.beta.6 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-accordion-item.cjs.entry.js +7 -4
- package/dist/cjs/tds-badge.cjs.entry.js +6 -1
- package/dist/cjs/tds-banner.cjs.entry.js +6 -2
- package/dist/cjs/tds-block.cjs.entry.js +10 -6
- package/dist/cjs/tds-body-cell.cjs.entry.js +2 -2
- 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.cjs.entry.js +4 -2
- package/dist/cjs/tds-card.cjs.entry.js +9 -5
- package/dist/cjs/tds-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/tds-chip.cjs.entry.js +1 -1
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +3 -3
- package/dist/cjs/tds-datetime.cjs.entry.js +2 -2
- package/dist/cjs/tds-divider.cjs.entry.js +1 -1
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +216 -147
- package/dist/cjs/tds-folder-tab.cjs.entry.js +4 -2
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +2 -2
- package/dist/cjs/tds-footer-group.cjs.entry.js +3 -3
- package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer.cjs.entry.js +3 -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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +5 -2
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +2 -2
- package/dist/cjs/tds-link.cjs.entry.js +5 -5
- package/dist/cjs/tds-message.cjs.entry.js +6 -4
- package/dist/cjs/tds-modal.cjs.entry.js +4 -1
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +2 -2
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +8 -2
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +2 -2
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-popover-menu.cjs.entry.js +2 -2
- 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 +4 -4
- package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-side-menu-dropdown-list.cjs.entry.js +2 -2
- package/dist/cjs/tds-side-menu-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-side-menu-overlay.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-user-image_2.cjs.entry.js +2 -2
- package/dist/cjs/tds-side-menu-user.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +8 -8
- package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tds-step.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 +7 -7
- package/dist/cjs/tds-table-body-row.cjs.entry.js +2 -2
- package/dist/cjs/tds-table-body.cjs.entry.js +2 -2
- package/dist/cjs/tds-table-footer.cjs.entry.js +3 -3
- package/dist/cjs/tds-table-header-input-wrapper.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-header.cjs.entry.js +2 -2
- package/dist/cjs/tds-table-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/tds-text-field.cjs.entry.js +8 -6
- package/dist/cjs/tds-textarea.cjs.entry.js +14 -12
- package/dist/cjs/tds-toast.cjs.entry.js +3 -3
- package/dist/cjs/tds-toggle.cjs.entry.js +4 -1
- package/dist/cjs/tds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +25 -4
- package/dist/collection/components/badge/badge.js +6 -1
- package/dist/collection/components/banner/banner.js +6 -2
- package/dist/collection/components/block/block.js +10 -6
- package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/collection/components/button/button.js +4 -2
- package/dist/collection/components/card/card.js +9 -5
- package/dist/collection/components/checkbox/checkbox.js +2 -2
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/datetime/datetime.js +2 -2
- package/dist/collection/components/divider/divider.js +1 -1
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +266 -221
- package/dist/collection/components/footer/footer-group/footer-group.js +3 -3
- package/dist/collection/components/footer/footer-item/footer-item.js +1 -1
- package/dist/collection/components/footer/footer.js +3 -1
- package/dist/collection/components/header/core-header-item/core-header-item.js +1 -1
- package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.js +1 -1
- package/dist/collection/components/header/header-dropdown/header-dropdown.js +3 -3
- package/dist/collection/components/header/header-dropdown-list/header-dropdown-list.js +1 -1
- package/dist/collection/components/header/header-dropdown-list-item/header-dropdown-list-item.js +2 -2
- package/dist/collection/components/header/header-dropdown-list-user/header-dropdown-list-user.js +1 -1
- package/dist/collection/components/header/header-hamburger/header-hamburger.js +1 -1
- package/dist/collection/components/header/header-item/header-item.js +2 -2
- package/dist/collection/components/header/header-launcher/header-launcher.js +2 -2
- package/dist/collection/components/header/header-launcher-button/header-launcher-button.js +1 -1
- package/dist/collection/components/header/header-launcher-grid/header-launcher-grid.js +1 -1
- package/dist/collection/components/header/header-launcher-grid-item/header-launcher-grid-item.js +1 -1
- package/dist/collection/components/header/header-launcher-grid-title/header-launcher-grid-title.js +1 -1
- package/dist/collection/components/header/header-launcher-list/header-launcher-list.js +1 -1
- package/dist/collection/components/header/header-launcher-list-item/header-launcher-list-item.js +1 -1
- package/dist/collection/components/header/header-launcher-list-title/header-launcher-list-title.js +1 -1
- package/dist/collection/components/header/header-title/header-title.js +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/link/link.js +5 -5
- package/dist/collection/components/message/message.js +6 -4
- package/dist/collection/components/modal/modal.js +4 -1
- package/dist/collection/components/popover-canvas/popover-canvas.js +2 -2
- package/dist/collection/components/popover-core/popover-core.js +1 -1
- package/dist/collection/components/popover-menu/popover-menu-item/popover-menu-item.js +2 -2
- package/dist/collection/components/popover-menu/popover-menu.js +2 -2
- package/dist/collection/components/radio-button/radio-button.js +1 -1
- package/dist/collection/components/side-menu/side-menu-close-button/side-menu-close-button.js +1 -1
- package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +4 -4
- package/dist/collection/components/side-menu/side-menu-dropdown/side-menu-dropdown.js +3 -3
- package/dist/collection/components/side-menu/side-menu-dropdown-list/side-menu-dropdown-list.js +2 -2
- package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.js +2 -2
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.js +2 -2
- package/dist/collection/components/side-menu/side-menu-overlay/side-menu-overlay.js +1 -1
- package/dist/collection/components/side-menu/side-menu-user/side-menu-user.js +1 -1
- package/dist/collection/components/side-menu/side-menu-user-image/side-menu-user-image.js +1 -1
- package/dist/collection/components/side-menu/side-menu-user-label/side-menu-user-label.js +1 -1
- package/dist/collection/components/slider/slider.css +13 -0
- package/dist/collection/components/slider/slider.js +7 -7
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/stepper/step/step.js +1 -1
- package/dist/collection/components/table/table-body/table-body.js +2 -2
- package/dist/collection/components/table/table-body-cell/table-body-cell.js +2 -2
- package/dist/collection/components/table/table-body-input-wrapper/table-body-input-wrapper.js +1 -1
- package/dist/collection/components/table/table-body-row/table-body-row.js +2 -2
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +7 -7
- package/dist/collection/components/table/table-footer/table-footer.js +3 -3
- package/dist/collection/components/table/table-header/table-header.js +2 -2
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +1 -1
- package/dist/collection/components/table/table-header-input-wrapper/table-header-input-wrapper.js +1 -1
- package/dist/collection/components/table/table-toolbar/table-toolbar.js +2 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +4 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +2 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +5 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +2 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +2 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +8 -2
- package/dist/collection/components/text-field/text-field.js +9 -7
- package/dist/collection/components/textarea/textarea.js +14 -12
- package/dist/collection/components/toast/toast.js +3 -3
- package/dist/collection/components/toggle/toggle.js +4 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/utils/axeHelpers.js +3 -0
- package/dist/components/{p-4030e9bc.js → p-1e110ab8.js} +3 -3
- package/dist/components/{p-0c3cab16.js → p-2ef329f1.js} +2 -2
- package/dist/components/{p-5e1a9abc.js → p-3351035f.js} +1 -1
- package/dist/components/{p-0676aa23.js → p-3a7f88ff.js} +3 -3
- package/dist/components/{p-09d36119.js → p-4bdaf254.js} +1 -1
- package/dist/components/{p-30de8ac4.js → p-707a562e.js} +1 -1
- package/dist/components/{p-fcec766c.js → p-75437dea.js} +1 -1
- package/dist/components/{p-e46088d9.js → p-8f8b0827.js} +1 -1
- package/dist/components/{p-cfb1b588.js → p-9d7232d0.js} +2 -2
- package/dist/components/{p-e323cd2a.js → p-ad77fb02.js} +1 -1
- package/dist/components/{p-dddaa520.js → p-d1ace0be.js} +1 -1
- package/dist/components/{p-1aae42d5.js → p-dd6ff1e2.js} +221 -155
- package/dist/components/{p-d921fe75.js → p-eac79032.js} +2 -2
- package/dist/components/{p-aea7fa6b.js → p-f0a50868.js} +3 -3
- package/dist/components/{p-8a2d7b2f.js → p-f1980746.js} +4 -4
- package/dist/components/tds-accordion-item.js +9 -5
- package/dist/components/tds-badge.js +6 -1
- package/dist/components/tds-banner.js +7 -3
- package/dist/components/tds-block.js +10 -6
- package/dist/components/tds-body-cell.js +2 -2
- package/dist/components/tds-breadcrumb.js +1 -1
- package/dist/components/tds-breadcrumbs.js +1 -1
- package/dist/components/tds-button.js +4 -2
- package/dist/components/tds-card.js +10 -6
- package/dist/components/tds-checkbox.js +1 -1
- package/dist/components/tds-chip.js +1 -1
- package/dist/components/tds-core-header-item.js +1 -1
- package/dist/components/tds-datetime.js +3 -3
- package/dist/components/tds-divider.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tab.js +4 -2
- package/dist/components/tds-folder-tabs.js +3 -3
- package/dist/components/tds-footer-group.js +4 -4
- package/dist/components/tds-footer-item.js +1 -1
- package/dist/components/tds-footer.js +3 -1
- package/dist/components/tds-header-brand-symbol.js +3 -3
- package/dist/components/tds-header-cell.js +2 -2
- package/dist/components/tds-header-dropdown-list-item.js +1 -1
- package/dist/components/tds-header-dropdown-list-user.js +1 -1
- package/dist/components/tds-header-dropdown-list.js +1 -1
- package/dist/components/tds-header-dropdown.js +8 -8
- package/dist/components/tds-header-hamburger.js +4 -4
- package/dist/components/tds-header-item.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher-grid-item.js +1 -1
- package/dist/components/tds-header-launcher-grid-title.js +1 -1
- package/dist/components/tds-header-launcher-grid.js +1 -1
- package/dist/components/tds-header-launcher-list-item.js +2 -2
- package/dist/components/tds-header-launcher-list-title.js +1 -1
- package/dist/components/tds-header-launcher-list.js +2 -2
- package/dist/components/tds-header-launcher.js +8 -8
- package/dist/components/tds-header-title.js +1 -1
- package/dist/components/tds-header.js +1 -1
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tab.js +5 -2
- package/dist/components/tds-inline-tabs.js +3 -3
- package/dist/components/tds-link.js +5 -5
- package/dist/components/tds-message.js +7 -5
- package/dist/components/tds-modal.js +5 -2
- package/dist/components/tds-navigation-tab.js +2 -2
- package/dist/components/tds-navigation-tabs.js +9 -3
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu-item.js +2 -2
- package/dist/components/tds-popover-menu.js +3 -3
- package/dist/components/tds-radio-button.js +1 -1
- package/dist/components/tds-side-menu-close-button.js +2 -2
- package/dist/components/tds-side-menu-collapse-button.js +5 -5
- package/dist/components/tds-side-menu-dropdown-list-item.js +2 -2
- package/dist/components/tds-side-menu-dropdown-list.js +2 -2
- package/dist/components/tds-side-menu-dropdown.js +5 -5
- package/dist/components/tds-side-menu-item.js +1 -1
- package/dist/components/tds-side-menu-overlay.js +1 -1
- package/dist/components/tds-side-menu-user-image.js +1 -1
- package/dist/components/tds-side-menu-user-label.js +1 -1
- package/dist/components/tds-side-menu-user.js +3 -3
- package/dist/components/tds-slider.js +9 -9
- package/dist/components/tds-spinner.js +1 -1
- package/dist/components/tds-step.js +2 -2
- package/dist/components/tds-table-body-input-wrapper.js +2 -2
- package/dist/components/tds-table-body-row-expandable.js +7 -7
- package/dist/components/tds-table-body-row.js +3 -3
- package/dist/components/tds-table-body.js +2 -2
- package/dist/components/tds-table-footer.js +7 -7
- package/dist/components/tds-table-header-input-wrapper.js +2 -2
- package/dist/components/tds-table-header.js +3 -3
- package/dist/components/tds-table-toolbar.js +3 -3
- package/dist/components/tds-text-field.js +9 -7
- package/dist/components/tds-textarea.js +15 -13
- package/dist/components/tds-toast.js +4 -4
- package/dist/components/tds-toggle.js +4 -1
- package/dist/components/tds-tooltip.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-accordion-item.entry.js +7 -4
- package/dist/esm/tds-badge.entry.js +6 -1
- package/dist/esm/tds-banner.entry.js +6 -2
- package/dist/esm/tds-block.entry.js +10 -6
- package/dist/esm/tds-body-cell.entry.js +2 -2
- package/dist/esm/tds-breadcrumb.entry.js +1 -1
- package/dist/esm/tds-breadcrumbs.entry.js +1 -1
- package/dist/esm/tds-button.entry.js +4 -2
- package/dist/esm/tds-card.entry.js +9 -5
- package/dist/esm/tds-checkbox.entry.js +2 -2
- package/dist/esm/tds-chip.entry.js +1 -1
- package/dist/esm/tds-core-header-item_2.entry.js +3 -3
- package/dist/esm/tds-datetime.entry.js +2 -2
- package/dist/esm/tds-divider.entry.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +216 -147
- package/dist/esm/tds-folder-tab.entry.js +4 -2
- package/dist/esm/tds-folder-tabs.entry.js +2 -2
- package/dist/esm/tds-footer-group.entry.js +3 -3
- package/dist/esm/tds-footer-item.entry.js +1 -1
- package/dist/esm/tds-footer.entry.js +3 -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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +5 -2
- package/dist/esm/tds-inline-tabs.entry.js +2 -2
- package/dist/esm/tds-link.entry.js +5 -5
- package/dist/esm/tds-message.entry.js +6 -4
- package/dist/esm/tds-modal.entry.js +4 -1
- package/dist/esm/tds-navigation-tab.entry.js +2 -2
- package/dist/esm/tds-navigation-tabs.entry.js +8 -2
- package/dist/esm/tds-popover-canvas.entry.js +2 -2
- package/dist/esm/tds-popover-core.entry.js +1 -1
- package/dist/esm/tds-popover-menu-item.entry.js +2 -2
- package/dist/esm/tds-popover-menu.entry.js +2 -2
- 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 +4 -4
- package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +2 -2
- package/dist/esm/tds-side-menu-dropdown-list.entry.js +2 -2
- package/dist/esm/tds-side-menu-dropdown.entry.js +3 -3
- package/dist/esm/tds-side-menu-item.entry.js +2 -2
- package/dist/esm/tds-side-menu-overlay.entry.js +1 -1
- package/dist/esm/tds-side-menu-user-image_2.entry.js +2 -2
- package/dist/esm/tds-side-menu-user.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +8 -8
- package/dist/esm/tds-spinner.entry.js +1 -1
- package/dist/esm/tds-step.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 +7 -7
- package/dist/esm/tds-table-body-row.entry.js +2 -2
- package/dist/esm/tds-table-body.entry.js +2 -2
- package/dist/esm/tds-table-footer.entry.js +3 -3
- package/dist/esm/tds-table-header-input-wrapper.entry.js +1 -1
- package/dist/esm/tds-table-header.entry.js +2 -2
- package/dist/esm/tds-table-toolbar.entry.js +2 -2
- package/dist/esm/tds-text-field.entry.js +8 -6
- package/dist/esm/tds-textarea.entry.js +14 -12
- package/dist/esm/tds-toast.entry.js +3 -3
- package/dist/esm/tds-toggle.entry.js +4 -1
- package/dist/esm/tds-tooltip.entry.js +2 -2
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/{p-b4c7099f.entry.js → p-038c22ff.entry.js} +1 -1
- package/dist/tegel/{p-57f95a1b.entry.js → p-059a9499.entry.js} +1 -1
- package/dist/tegel/{p-9de400f4.entry.js → p-06968bd7.entry.js} +1 -1
- package/dist/tegel/{p-ede11de8.entry.js → p-0939b9fb.entry.js} +1 -1
- package/dist/tegel/p-0b773208.entry.js +1 -0
- package/dist/tegel/{p-7a83cf55.entry.js → p-0cb6c898.entry.js} +1 -1
- package/dist/tegel/{p-b9e37cf2.entry.js → p-1703f73a.entry.js} +1 -1
- package/dist/tegel/p-170ab61b.entry.js +1 -0
- package/dist/tegel/{p-ac46b0a4.entry.js → p-24ff5903.entry.js} +1 -1
- package/dist/tegel/{p-9bf7f5cd.entry.js → p-2795009a.entry.js} +1 -1
- package/dist/tegel/{p-4ab7461e.entry.js → p-2a38b053.entry.js} +1 -1
- package/dist/tegel/{p-6b405a0f.entry.js → p-2a96bd05.entry.js} +1 -1
- package/dist/tegel/{p-50fcdc56.entry.js → p-2f32991e.entry.js} +1 -1
- package/dist/tegel/p-32b7f431.entry.js +1 -0
- package/dist/tegel/p-39373227.entry.js +1 -0
- package/dist/tegel/{p-2557b79b.entry.js → p-3a32fe40.entry.js} +1 -1
- package/dist/tegel/p-3c22aef7.entry.js +1 -0
- package/dist/tegel/{p-bcae4d3a.entry.js → p-3d3ee51f.entry.js} +1 -1
- package/dist/tegel/p-3e144a83.entry.js +1 -0
- package/dist/tegel/p-3e1b1399.entry.js +1 -0
- package/dist/tegel/{p-2e44b4e9.entry.js → p-44c33b20.entry.js} +1 -1
- package/dist/tegel/p-48bbc11f.entry.js +1 -0
- package/dist/tegel/p-4a282c25.entry.js +1 -0
- package/dist/tegel/p-4b231bf9.entry.js +1 -0
- package/dist/tegel/{p-1634247e.entry.js → p-4b7c53a6.entry.js} +1 -1
- package/dist/tegel/{p-0df92ce7.entry.js → p-4c2f313d.entry.js} +1 -1
- package/dist/tegel/{p-ff5cd75f.entry.js → p-54154f09.entry.js} +1 -1
- package/dist/tegel/{p-ff7ae8a3.entry.js → p-59293f88.entry.js} +1 -1
- package/dist/tegel/{p-e63f827f.entry.js → p-5eaa23dc.entry.js} +1 -1
- package/dist/tegel/{p-bb129d43.entry.js → p-5fea857b.entry.js} +1 -1
- package/dist/tegel/{p-088bfcd4.entry.js → p-68859ddc.entry.js} +1 -1
- package/dist/tegel/p-69b38504.entry.js +1 -0
- package/dist/tegel/{p-a5a67770.entry.js → p-6d022f47.entry.js} +1 -1
- package/dist/tegel/{p-868435cd.entry.js → p-6eeded00.entry.js} +1 -1
- package/dist/tegel/{p-0f38bea7.entry.js → p-708a8bab.entry.js} +1 -1
- package/dist/tegel/p-7090a95c.entry.js +1 -0
- package/dist/tegel/{p-4e3e2601.entry.js → p-72106a5c.entry.js} +1 -1
- package/dist/tegel/{p-ed02ad2b.entry.js → p-7929d22f.entry.js} +1 -1
- package/dist/tegel/p-85a9032e.entry.js +1 -0
- package/dist/tegel/{p-f9325536.entry.js → p-86b30f71.entry.js} +1 -1
- package/dist/tegel/p-88204e0a.entry.js +1 -0
- package/dist/tegel/{p-6a52ed63.entry.js → p-9016758e.entry.js} +1 -1
- package/dist/tegel/p-92f81cda.entry.js +1 -0
- package/dist/tegel/p-93930c03.entry.js +1 -0
- package/dist/tegel/{p-aed1c5cf.entry.js → p-96bdf035.entry.js} +1 -1
- package/dist/tegel/{p-7097a39a.entry.js → p-99da056d.entry.js} +1 -1
- package/dist/tegel/p-9c3f2c12.entry.js +1 -0
- package/dist/tegel/{p-9c2dfecc.entry.js → p-9eaaa2c0.entry.js} +1 -1
- package/dist/tegel/p-a38dda58.entry.js +1 -0
- package/dist/tegel/{p-de540cc0.entry.js → p-a392e6e7.entry.js} +1 -1
- package/dist/tegel/p-a86fe122.entry.js +1 -0
- package/dist/tegel/{p-220affa9.entry.js → p-b19ce79c.entry.js} +1 -1
- package/dist/tegel/{p-987084a5.entry.js → p-b2018a5b.entry.js} +1 -1
- package/dist/tegel/{p-c790ef93.entry.js → p-b425b2f4.entry.js} +1 -1
- package/dist/tegel/p-b647d20e.entry.js +1 -0
- package/dist/tegel/{p-c18b2746.entry.js → p-b96cd80d.entry.js} +1 -1
- package/dist/tegel/{p-f1c172a4.entry.js → p-b9b63210.entry.js} +1 -1
- package/dist/tegel/p-be88c5ab.entry.js +1 -0
- package/dist/tegel/{p-91dcddd5.entry.js → p-c289dfb9.entry.js} +1 -1
- package/dist/tegel/p-cc2730d8.entry.js +1 -0
- package/dist/tegel/p-d1112915.entry.js +1 -0
- package/dist/tegel/{p-e65dba91.entry.js → p-d7f48112.entry.js} +1 -1
- package/dist/tegel/p-d926d075.entry.js +1 -0
- package/dist/tegel/{p-26ae4a93.entry.js → p-ddd33cce.entry.js} +1 -1
- package/dist/tegel/{p-c917d8be.entry.js → p-e478953c.entry.js} +1 -1
- package/dist/tegel/p-e7300cca.entry.js +1 -0
- package/dist/tegel/{p-6c26e66f.entry.js → p-e9ac7a1a.entry.js} +1 -1
- package/dist/tegel/{p-dd060c11.entry.js → p-ea4a9a4f.entry.js} +1 -1
- package/dist/tegel/p-ee0e04ed.entry.js +1 -0
- package/dist/tegel/p-f050aad8.entry.js +1 -0
- package/dist/tegel/{p-e7108828.entry.js → p-f4db0231.entry.js} +1 -1
- package/dist/tegel/p-f67b4047.entry.js +1 -0
- package/dist/tegel/{p-a642c800.entry.js → p-fd3d56aa.entry.js} +1 -1
- package/dist/tegel/{p-06d2fa56.entry.js → p-fd432c54.entry.js} +1 -1
- package/dist/tegel/{p-ad434031.entry.js → p-ffd827ef.entry.js} +1 -1
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +36 -26
- package/dist/types/components.d.ts +19 -21
- package/dist/types/utils/axeHelpers.d.ts +2 -0
- package/package.json +5 -5
- package/dist/tegel/p-12303135.entry.js +0 -1
- package/dist/tegel/p-1a2f3852.entry.js +0 -1
- package/dist/tegel/p-1bc2c73c.entry.js +0 -1
- package/dist/tegel/p-54a105a4.entry.js +0 -1
- package/dist/tegel/p-5a891dd2.entry.js +0 -1
- package/dist/tegel/p-5d0e8f1e.entry.js +0 -1
- package/dist/tegel/p-6938329a.entry.js +0 -1
- package/dist/tegel/p-693e48cf.entry.js +0 -1
- package/dist/tegel/p-6aabf7e1.entry.js +0 -1
- package/dist/tegel/p-7d39487c.entry.js +0 -1
- package/dist/tegel/p-7d83ba98.entry.js +0 -1
- package/dist/tegel/p-845e1fca.entry.js +0 -1
- package/dist/tegel/p-930e767e.entry.js +0 -1
- package/dist/tegel/p-959a6780.entry.js +0 -1
- package/dist/tegel/p-9aefb942.entry.js +0 -1
- package/dist/tegel/p-a9654cd4.entry.js +0 -1
- package/dist/tegel/p-b00bcf39.entry.js +0 -1
- package/dist/tegel/p-b9ac3122.entry.js +0 -1
- package/dist/tegel/p-bda3d846.entry.js +0 -1
- package/dist/tegel/p-cd5219ac.entry.js +0 -1
- package/dist/tegel/p-d1cbe5be.entry.js +0 -1
- package/dist/tegel/p-dcbd977f.entry.js +0 -1
- package/dist/tegel/p-e13935b6.entry.js +0 -1
- package/dist/tegel/p-e86f2d31.entry.js +0 -1
- package/dist/tegel/p-e97a2700.entry.js +0 -1
- package/dist/tegel/p-f45d905c.entry.js +0 -1
- package/dist/tegel/p-f841f094.entry.js +0 -1
- package/dist/tegel/p-fc0079d2.entry.js +0 -1
|
@@ -9,13 +9,33 @@ export class TdsDropdown {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.setDefaultOption = () => {
|
|
11
11
|
if (this.defaultValue) {
|
|
12
|
+
const children = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
13
|
+
if (children.length === 0) {
|
|
14
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
12
17
|
const defaultValues = this.multiselect
|
|
13
18
|
? new Set(this.defaultValue.split(','))
|
|
14
19
|
: [this.defaultValue];
|
|
15
|
-
const
|
|
16
|
-
|
|
20
|
+
const childrenMap = new Map(children.map((element) => [element.value, element]));
|
|
21
|
+
const matchedValues = Array.from(defaultValues).filter((value) => {
|
|
22
|
+
const element = childrenMap.get(value);
|
|
23
|
+
if (element) {
|
|
24
|
+
element.setSelected(true);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
});
|
|
29
|
+
if (matchedValues.length > 0) {
|
|
30
|
+
this.value = [...new Set(this.value ? [...this.value, ...matchedValues] : matchedValues)];
|
|
31
|
+
this.setValueAttribute();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.warn(`TDS DROPDOWN: No matching option found for defaultValue "${this.defaultValue}"`);
|
|
35
|
+
}
|
|
17
36
|
}
|
|
18
37
|
};
|
|
38
|
+
/* Returns a list of all children that are tds-dropdown-option elements */
|
|
19
39
|
this.getChildren = () => {
|
|
20
40
|
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
21
41
|
if (tdsDropdownOptions.length === 0) {
|
|
@@ -24,36 +44,6 @@ export class TdsDropdown {
|
|
|
24
44
|
else
|
|
25
45
|
return tdsDropdownOptions;
|
|
26
46
|
};
|
|
27
|
-
this.getSelectedChildren = () => {
|
|
28
|
-
if (this.selectedOptions.length === 0)
|
|
29
|
-
return [];
|
|
30
|
-
return this.selectedOptions
|
|
31
|
-
.map((stringValue) => {
|
|
32
|
-
var _a;
|
|
33
|
-
const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => element.value === stringValue);
|
|
34
|
-
return matchingElement;
|
|
35
|
-
})
|
|
36
|
-
.filter(Boolean);
|
|
37
|
-
};
|
|
38
|
-
this.getSelectedChildrenLabels = () => {
|
|
39
|
-
var _a;
|
|
40
|
-
return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
|
|
41
|
-
};
|
|
42
|
-
this.getValue = () => {
|
|
43
|
-
const labels = this.getSelectedChildrenLabels();
|
|
44
|
-
if (!labels) {
|
|
45
|
-
return '';
|
|
46
|
-
}
|
|
47
|
-
return labels === null || labels === void 0 ? void 0 : labels.join(', ');
|
|
48
|
-
};
|
|
49
|
-
this.setValueAttribute = () => {
|
|
50
|
-
if (this.selectedOptions.length === 0) {
|
|
51
|
-
this.host.removeAttribute('value');
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.host.setAttribute('value', this.selectedOptions.join(','));
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
47
|
this.getOpenDirection = () => {
|
|
58
48
|
var _a, _b, _c, _d, _e;
|
|
59
49
|
if (this.openDirection === 'auto' || !this.openDirection) {
|
|
@@ -67,6 +57,7 @@ export class TdsDropdown {
|
|
|
67
57
|
}
|
|
68
58
|
return this.openDirection;
|
|
69
59
|
};
|
|
60
|
+
/* Toggles the open state of the Dropdown and sets focus to the input element */
|
|
70
61
|
this.handleToggleOpen = () => {
|
|
71
62
|
if (!this.disabled) {
|
|
72
63
|
this.open = !this.open;
|
|
@@ -75,10 +66,38 @@ export class TdsDropdown {
|
|
|
75
66
|
}
|
|
76
67
|
}
|
|
77
68
|
};
|
|
69
|
+
/* Focuses the input element in the Dropdown, if the reference is present. */
|
|
78
70
|
this.focusInputElement = () => {
|
|
79
71
|
if (this.inputElement)
|
|
80
72
|
this.inputElement.focus();
|
|
81
73
|
};
|
|
74
|
+
this.getSelectedChildren = () => {
|
|
75
|
+
var _a;
|
|
76
|
+
return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((stringValue) => {
|
|
77
|
+
const matchingElement = this.getChildren().find((element) => element.value === stringValue);
|
|
78
|
+
return matchingElement;
|
|
79
|
+
}).filter(Boolean);
|
|
80
|
+
};
|
|
81
|
+
this.getSelectedChildrenLabels = () => {
|
|
82
|
+
var _a;
|
|
83
|
+
return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
|
|
84
|
+
};
|
|
85
|
+
this.getValue = () => {
|
|
86
|
+
const labels = this.getSelectedChildrenLabels();
|
|
87
|
+
if (!labels) {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
return labels === null || labels === void 0 ? void 0 : labels.join(', ');
|
|
91
|
+
};
|
|
92
|
+
this.setValueAttribute = () => {
|
|
93
|
+
var _a;
|
|
94
|
+
if (!this.value || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '') {
|
|
95
|
+
this.host.removeAttribute('value');
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.host.setAttribute('value', this.value.map((val) => val).toString());
|
|
99
|
+
}
|
|
100
|
+
};
|
|
82
101
|
this.handleFilter = (event) => {
|
|
83
102
|
this.tdsInput.emit(event);
|
|
84
103
|
const query = event.target.value.toLowerCase();
|
|
@@ -109,10 +128,8 @@ export class TdsDropdown {
|
|
|
109
128
|
this.handleFilterReset = () => {
|
|
110
129
|
this.reset();
|
|
111
130
|
this.inputElement.value = '';
|
|
112
|
-
this.handleFilter({ target: { value:
|
|
131
|
+
this.handleFilter({ target: { value: this.inputElement.value } });
|
|
113
132
|
this.inputElement.focus();
|
|
114
|
-
// Add this line to ensure internal value is cleared
|
|
115
|
-
this.internalValue = '';
|
|
116
133
|
};
|
|
117
134
|
this.handleFocus = (event) => {
|
|
118
135
|
this.open = true;
|
|
@@ -126,6 +143,13 @@ export class TdsDropdown {
|
|
|
126
143
|
this.handleBlur = (event) => {
|
|
127
144
|
this.tdsBlur.emit(event);
|
|
128
145
|
};
|
|
146
|
+
this.handleChange = () => {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
this.tdsChange.emit({
|
|
149
|
+
name: this.name,
|
|
150
|
+
value: (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString()) !== null && _b !== void 0 ? _b : null,
|
|
151
|
+
});
|
|
152
|
+
};
|
|
129
153
|
this.resetInput = () => {
|
|
130
154
|
const inputEl = this.host.querySelector('input');
|
|
131
155
|
if (inputEl) {
|
|
@@ -148,101 +172,107 @@ export class TdsDropdown {
|
|
|
148
172
|
this.normalizeText = true;
|
|
149
173
|
this.noResultText = 'No result';
|
|
150
174
|
this.defaultValue = undefined;
|
|
151
|
-
this.value = null;
|
|
152
175
|
this.open = false;
|
|
153
|
-
this.
|
|
176
|
+
this.value = undefined;
|
|
154
177
|
this.filterResult = undefined;
|
|
155
178
|
this.filterFocus = undefined;
|
|
156
|
-
this.selectedOptions = [];
|
|
157
179
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.updateDropdownState(normalizedValue);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
normalizeValue(value) {
|
|
167
|
-
if (!value || value === '')
|
|
168
|
-
return []; // Handle both null and empty string
|
|
169
|
-
// For multiselect, keep array. For single select, wrap in array
|
|
170
|
-
if (this.multiselect) {
|
|
171
|
-
return Array.isArray(value) ? value : value.split(',').filter((v) => v !== '');
|
|
172
|
-
}
|
|
173
|
-
return Array.isArray(value) ? value : [value];
|
|
174
|
-
}
|
|
175
|
-
hasValueChanged(newValue, currentValue) {
|
|
176
|
-
if (newValue.length !== currentValue.length)
|
|
177
|
-
return true;
|
|
178
|
-
return newValue.some((val) => !currentValue.includes(val));
|
|
180
|
+
/** Method that resets the Dropdown, marks all children as non-selected and resets the value to null. */
|
|
181
|
+
async reset() {
|
|
182
|
+
this.dropdownList.scrollTop = 0;
|
|
183
|
+
this.internalReset();
|
|
184
|
+
this.handleChange();
|
|
179
185
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
this.
|
|
183
|
-
|
|
184
|
-
this.value = this.multiselect ? this.selectedOptions : this.selectedOptions[0] || null;
|
|
185
|
-
// Force update of internal value
|
|
186
|
-
this.internalValue = this.getValue();
|
|
187
|
-
// Update DOM
|
|
188
|
-
this.updateOptionElements();
|
|
189
|
-
// Update display value
|
|
190
|
-
this.updateDisplayValue();
|
|
191
|
-
// Emit change event
|
|
192
|
-
this.emitChange();
|
|
193
|
-
// Update value attribute
|
|
194
|
-
this.setValueAttribute();
|
|
186
|
+
/** Method that forces focus on the input element. */
|
|
187
|
+
async focusElement() {
|
|
188
|
+
this.focusInputElement();
|
|
189
|
+
this.handleFocus({});
|
|
195
190
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
191
|
+
/** Method for setting the value of the Dropdown.
|
|
192
|
+
*
|
|
193
|
+
* Single selection example:
|
|
194
|
+
*
|
|
195
|
+
* <code>
|
|
196
|
+
* dropdown.setValue('option-1', 'Option 1');
|
|
197
|
+
* </code>
|
|
198
|
+
*
|
|
199
|
+
* Multiselect example:
|
|
200
|
+
*
|
|
201
|
+
* <code>
|
|
202
|
+
* dropdown.setValue(['option-1', 'option-2']);
|
|
203
|
+
* </code>
|
|
204
|
+
*/
|
|
205
|
+
// The label is optional here ONLY to not break the API. Should be removed for 2.0.
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
208
|
+
async setValue(value, label) {
|
|
209
|
+
let nextValue;
|
|
210
|
+
if (typeof value === 'string')
|
|
211
|
+
nextValue = [value];
|
|
212
|
+
else
|
|
213
|
+
nextValue = value;
|
|
214
|
+
if (!this.multiselect && nextValue.length > 1) {
|
|
215
|
+
console.warn('Tried to select multiple items, but multiselect is not enabled.');
|
|
216
|
+
nextValue = [nextValue[0]];
|
|
217
|
+
}
|
|
218
|
+
nextValue = [...new Set(nextValue)];
|
|
219
|
+
this.internalReset();
|
|
220
|
+
for (let i = 0; i < nextValue.length; i++) {
|
|
221
|
+
const optionExist = this.getChildren().some((element) => element.value === nextValue[i]);
|
|
222
|
+
if (!optionExist) {
|
|
223
|
+
nextValue.splice(i, 1);
|
|
202
224
|
}
|
|
203
|
-
return isValid;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
updateOptionElements() {
|
|
207
|
-
var _a;
|
|
208
|
-
(_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
|
|
209
|
-
element.setSelected(this.selectedOptions.includes(element.value));
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
updateDisplayValue() {
|
|
213
|
-
this.internalValue = this.getSelectedChildrenLabels().join(', ');
|
|
214
|
-
if (this.filter && this.inputElement) {
|
|
215
|
-
this.inputElement.value = this.internalValue;
|
|
216
225
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
value: value !== null && value !== void 0 ? value : null,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
async setValue(value) {
|
|
228
|
-
const normalizedValue = this.normalizeValue(value);
|
|
229
|
-
this.updateDropdownState(normalizedValue);
|
|
230
|
-
return this.getSelectedChildren().map((element) => ({
|
|
226
|
+
this.value = nextValue;
|
|
227
|
+
this.setValueAttribute();
|
|
228
|
+
this.selectChildrenAsSelectedBasedOnSelectionProp();
|
|
229
|
+
this.handleChange();
|
|
230
|
+
/* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
|
|
231
|
+
/* https://tegel.atlassian.net/browse/CDEP-2703 */
|
|
232
|
+
const selection = this.getSelectedChildren().map((element) => ({
|
|
231
233
|
value: element.value,
|
|
232
234
|
label: element.textContent.trim(),
|
|
233
235
|
}));
|
|
236
|
+
// Update inputElement value and placeholder text
|
|
237
|
+
if (this.filter) {
|
|
238
|
+
this.inputElement.value = this.getValue();
|
|
239
|
+
}
|
|
240
|
+
return selection;
|
|
234
241
|
}
|
|
235
|
-
|
|
236
|
-
|
|
242
|
+
/**
|
|
243
|
+
* @internal
|
|
244
|
+
*/
|
|
245
|
+
async appendValue(value) {
|
|
246
|
+
if (this.multiselect && this.value) {
|
|
247
|
+
this.setValue([...this.value, value]);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
this.setValue(value);
|
|
251
|
+
}
|
|
237
252
|
}
|
|
253
|
+
/** Method for removing a selected value in the Dropdown. */
|
|
238
254
|
async removeValue(oldValue) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
255
|
+
var _a, _b;
|
|
256
|
+
let label;
|
|
257
|
+
if (this.multiselect) {
|
|
258
|
+
(_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
|
|
259
|
+
var _a;
|
|
260
|
+
if (element.value === oldValue) {
|
|
261
|
+
this.value = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter((value) => value !== element.value);
|
|
262
|
+
label = element.textContent.trim();
|
|
263
|
+
element.setSelected(false);
|
|
264
|
+
}
|
|
265
|
+
return element;
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
this.reset();
|
|
270
|
+
}
|
|
271
|
+
this.handleChange();
|
|
272
|
+
this.setValueAttribute();
|
|
273
|
+
/* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
|
|
274
|
+
/* https://tegel.atlassian.net/browse/CDEP-2703 */
|
|
275
|
+
return (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((value) => ({ value, label }));
|
|
246
276
|
}
|
|
247
277
|
/** Method for closing the Dropdown. */
|
|
248
278
|
async close() {
|
|
@@ -291,15 +321,12 @@ export class TdsDropdown {
|
|
|
291
321
|
handleOpenState() {
|
|
292
322
|
if (this.filter && this.multiselect) {
|
|
293
323
|
if (!this.open) {
|
|
294
|
-
this.inputElement.value = this.
|
|
324
|
+
this.inputElement.value = this.getValue();
|
|
295
325
|
}
|
|
296
326
|
}
|
|
297
327
|
}
|
|
298
328
|
componentWillLoad() {
|
|
299
|
-
|
|
300
|
-
const initialValue = this.multiselect ? this.defaultValue.split(',') : [this.defaultValue];
|
|
301
|
-
this.updateDropdownState(initialValue);
|
|
302
|
-
}
|
|
329
|
+
this.setDefaultOption();
|
|
303
330
|
}
|
|
304
331
|
/** Method to handle slot changes */
|
|
305
332
|
handleSlotChange() {
|
|
@@ -309,13 +336,29 @@ export class TdsDropdown {
|
|
|
309
336
|
normalizeString(text) {
|
|
310
337
|
return this.normalizeText ? text.normalize('NFD').replace(/\p{Diacritic}/gu, '') : text;
|
|
311
338
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
339
|
+
/** Method that resets the dropdown without emitting an event. */
|
|
340
|
+
internalReset() {
|
|
341
|
+
this.getChildren().forEach((element) => {
|
|
342
|
+
element.setSelected(false);
|
|
343
|
+
return element;
|
|
344
|
+
});
|
|
345
|
+
this.value = null;
|
|
346
|
+
this.setValueAttribute();
|
|
347
|
+
}
|
|
348
|
+
selectChildrenAsSelectedBasedOnSelectionProp() {
|
|
349
|
+
this.getChildren().forEach((element) => {
|
|
350
|
+
this.value.forEach((selection) => {
|
|
351
|
+
if (element.value !== selection) {
|
|
352
|
+
// If not multiselect, we need to unselect all other options.
|
|
353
|
+
if (!this.multiselect) {
|
|
354
|
+
element.setSelected(false);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
element.setSelected(true);
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
});
|
|
319
362
|
}
|
|
320
363
|
componentDidRender() {
|
|
321
364
|
const form = this.host.closest('form');
|
|
@@ -330,8 +373,15 @@ export class TdsDropdown {
|
|
|
330
373
|
}
|
|
331
374
|
}
|
|
332
375
|
render() {
|
|
333
|
-
|
|
334
|
-
|
|
376
|
+
var _a, _b, _c, _d;
|
|
377
|
+
appendHiddenInput(this.host, this.name, (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString(), this.disabled);
|
|
378
|
+
return (h(Host, { key: '3b547dda7bede0ae8e020d976d08ed9d8bf50356', role: "select", class: {
|
|
379
|
+
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
380
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ca3c45bce793171f4af249b4c007d4279599f2b4', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'fb12d8b69a4430977b3269f44f9b5e5600965cc1', class: {
|
|
381
|
+
'dropdown-select': true,
|
|
382
|
+
[this.size]: true,
|
|
383
|
+
'disabled': this.disabled,
|
|
384
|
+
} }, this.filter ? (h("div", { class: {
|
|
335
385
|
filter: true,
|
|
336
386
|
focus: this.filterFocus,
|
|
337
387
|
disabled: this.disabled,
|
|
@@ -339,16 +389,26 @@ export class TdsDropdown {
|
|
|
339
389
|
} }, h("div", { class: "value-wrapper" }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
|
|
340
390
|
label-inside-as-placeholder
|
|
341
391
|
${this.size}
|
|
342
|
-
${this.
|
|
392
|
+
${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
|
|
343
393
|
` }, this.label)), h("input", {
|
|
344
394
|
// eslint-disable-next-line no-return-assign
|
|
345
|
-
ref: (inputEl) => (this.inputElement = inputEl), class:
|
|
395
|
+
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
396
|
+
placeholder: this.labelPosition === 'inside',
|
|
397
|
+
}, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
|
|
346
398
|
this.filterFocus = false;
|
|
347
399
|
if (this.multiselect) {
|
|
348
400
|
this.inputElement.value = this.getValue();
|
|
349
401
|
}
|
|
350
402
|
this.handleBlur(event);
|
|
351
|
-
}, onFocus: (event) =>
|
|
403
|
+
}, onFocus: (event) => {
|
|
404
|
+
this.open = true;
|
|
405
|
+
this.filterFocus = true;
|
|
406
|
+
if (this.multiselect) {
|
|
407
|
+
this.inputElement.value = '';
|
|
408
|
+
}
|
|
409
|
+
this.handleFocus(event);
|
|
410
|
+
this.handleFilter({ target: { value: '' } });
|
|
411
|
+
}, onKeyDown: (event) => {
|
|
352
412
|
if (event.key === 'Escape') {
|
|
353
413
|
this.open = false;
|
|
354
414
|
}
|
|
@@ -357,7 +417,10 @@ export class TdsDropdown {
|
|
|
357
417
|
if (event.key === 'Enter') {
|
|
358
418
|
this.handleFilterReset();
|
|
359
419
|
}
|
|
360
|
-
}, class:
|
|
420
|
+
}, class: {
|
|
421
|
+
'clear-icon': true,
|
|
422
|
+
'hide': !(this.open && this.inputElement.value !== ''),
|
|
423
|
+
}, name: "cross", size: "16px" }), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", onClick: this.handleToggleOpen, onKeyDown: (event) => {
|
|
361
424
|
if (event.key === 'Enter') {
|
|
362
425
|
this.handleToggleOpen();
|
|
363
426
|
}
|
|
@@ -365,15 +428,19 @@ export class TdsDropdown {
|
|
|
365
428
|
if (event.key === 'Escape') {
|
|
366
429
|
this.open = false;
|
|
367
430
|
}
|
|
368
|
-
}, class:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
431
|
+
}, class: {
|
|
432
|
+
value: Boolean(this.value),
|
|
433
|
+
placeholder: Boolean(!this.value),
|
|
434
|
+
open: this.open,
|
|
435
|
+
closed: !this.open,
|
|
436
|
+
error: this.error,
|
|
437
|
+
}, disabled: this.disabled }, h("div", { class: `value-wrapper ${this.size}` }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: {
|
|
438
|
+
'label-inside-as-placeholder': true,
|
|
439
|
+
[this.size]: true,
|
|
440
|
+
'selected': Boolean((_c = this.value) === null || _c === void 0 ? void 0 : _c.length),
|
|
441
|
+
} }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.value) === null || _d === void 0 ? void 0 : _d.length) ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: 'b734958a92e331bc6fcd07a0cf716219cec235c1', ref: (element) => {
|
|
442
|
+
this.dropdownList = element;
|
|
443
|
+
}, class: {
|
|
377
444
|
'dropdown-list': true,
|
|
378
445
|
[this.size]: true,
|
|
379
446
|
[this.getOpenDirection()]: true,
|
|
@@ -382,7 +449,11 @@ export class TdsDropdown {
|
|
|
382
449
|
'closed': !this.open,
|
|
383
450
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
384
451
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
385
|
-
} }, h("slot", { key: '
|
|
452
|
+
} }, h("slot", { key: '85d5f7599b21df148a34416fb271c894ff6a2e3e', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '5009c99ade06605dd2605e28f59b82e78e3f3bec', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '88d55d60aac26a3c5af04bfa74b6649d5d893fce', class: {
|
|
453
|
+
helper: true,
|
|
454
|
+
error: this.error,
|
|
455
|
+
disabled: this.disabled,
|
|
456
|
+
} }, this.error && h("tds-icon", { key: '1f6f2b7272f35501bf684816b4bc1cd746910fe9', name: "error", size: "16px" }), this.helper))));
|
|
386
457
|
}
|
|
387
458
|
static get is() { return "tds-dropdown"; }
|
|
388
459
|
static get encapsulation() { return "shadow"; }
|
|
@@ -679,34 +750,15 @@ export class TdsDropdown {
|
|
|
679
750
|
},
|
|
680
751
|
"attribute": "default-value",
|
|
681
752
|
"reflect": false
|
|
682
|
-
},
|
|
683
|
-
"value": {
|
|
684
|
-
"type": "string",
|
|
685
|
-
"mutable": true,
|
|
686
|
-
"complexType": {
|
|
687
|
-
"original": "string | string[]",
|
|
688
|
-
"resolved": "string | string[]",
|
|
689
|
-
"references": {}
|
|
690
|
-
},
|
|
691
|
-
"required": false,
|
|
692
|
-
"optional": false,
|
|
693
|
-
"docs": {
|
|
694
|
-
"tags": [],
|
|
695
|
-
"text": "Value of the dropdown. For multiselect, provide array of strings. For single select, provide a string."
|
|
696
|
-
},
|
|
697
|
-
"attribute": "value",
|
|
698
|
-
"reflect": false,
|
|
699
|
-
"defaultValue": "null"
|
|
700
753
|
}
|
|
701
754
|
};
|
|
702
755
|
}
|
|
703
756
|
static get states() {
|
|
704
757
|
return {
|
|
705
758
|
"open": {},
|
|
706
|
-
"
|
|
759
|
+
"value": {},
|
|
707
760
|
"filterResult": {},
|
|
708
|
-
"filterFocus": {}
|
|
709
|
-
"selectedOptions": {}
|
|
761
|
+
"filterFocus": {}
|
|
710
762
|
};
|
|
711
763
|
}
|
|
712
764
|
static get events() {
|
|
@@ -785,51 +837,28 @@ export class TdsDropdown {
|
|
|
785
837
|
}
|
|
786
838
|
}
|
|
787
839
|
}
|
|
788
|
-
}, {
|
|
789
|
-
"method": "tdsValueChange",
|
|
790
|
-
"name": "tdsValueChange",
|
|
791
|
-
"bubbles": true,
|
|
792
|
-
"cancelable": false,
|
|
793
|
-
"composed": true,
|
|
794
|
-
"docs": {
|
|
795
|
-
"tags": [],
|
|
796
|
-
"text": "Value change event for the Dropdown."
|
|
797
|
-
},
|
|
798
|
-
"complexType": {
|
|
799
|
-
"original": "{\n name: string;\n value: string;\n }",
|
|
800
|
-
"resolved": "{ name: string; value: string; }",
|
|
801
|
-
"references": {}
|
|
802
|
-
}
|
|
803
840
|
}];
|
|
804
841
|
}
|
|
805
842
|
static get methods() {
|
|
806
843
|
return {
|
|
807
|
-
"
|
|
844
|
+
"reset": {
|
|
808
845
|
"complexType": {
|
|
809
|
-
"signature": "(
|
|
810
|
-
"parameters": [
|
|
811
|
-
"name": "value",
|
|
812
|
-
"type": "string | string[]",
|
|
813
|
-
"docs": ""
|
|
814
|
-
}],
|
|
846
|
+
"signature": "() => Promise<void>",
|
|
847
|
+
"parameters": [],
|
|
815
848
|
"references": {
|
|
816
849
|
"Promise": {
|
|
817
850
|
"location": "global",
|
|
818
851
|
"id": "global::Promise"
|
|
819
|
-
},
|
|
820
|
-
"HTMLTdsDropdownOptionElement": {
|
|
821
|
-
"location": "global",
|
|
822
|
-
"id": "global::HTMLTdsDropdownOptionElement"
|
|
823
852
|
}
|
|
824
853
|
},
|
|
825
|
-
"return": "Promise<
|
|
854
|
+
"return": "Promise<void>"
|
|
826
855
|
},
|
|
827
856
|
"docs": {
|
|
828
|
-
"text": "",
|
|
857
|
+
"text": "Method that resets the Dropdown, marks all children as non-selected and resets the value to null.",
|
|
829
858
|
"tags": []
|
|
830
859
|
}
|
|
831
860
|
},
|
|
832
|
-
"
|
|
861
|
+
"focusElement": {
|
|
833
862
|
"complexType": {
|
|
834
863
|
"signature": "() => Promise<void>",
|
|
835
864
|
"parameters": [],
|
|
@@ -842,15 +871,19 @@ export class TdsDropdown {
|
|
|
842
871
|
"return": "Promise<void>"
|
|
843
872
|
},
|
|
844
873
|
"docs": {
|
|
845
|
-
"text": "",
|
|
874
|
+
"text": "Method that forces focus on the input element.",
|
|
846
875
|
"tags": []
|
|
847
876
|
}
|
|
848
877
|
},
|
|
849
|
-
"
|
|
878
|
+
"setValue": {
|
|
850
879
|
"complexType": {
|
|
851
|
-
"signature": "(
|
|
880
|
+
"signature": "(value: string | string[], label?: string) => Promise<{ value: string; label: string; }[]>",
|
|
852
881
|
"parameters": [{
|
|
853
|
-
"name": "
|
|
882
|
+
"name": "value",
|
|
883
|
+
"type": "string | string[]",
|
|
884
|
+
"docs": ""
|
|
885
|
+
}, {
|
|
886
|
+
"name": "label",
|
|
854
887
|
"type": "string",
|
|
855
888
|
"docs": ""
|
|
856
889
|
}],
|
|
@@ -858,19 +891,27 @@ export class TdsDropdown {
|
|
|
858
891
|
"Promise": {
|
|
859
892
|
"location": "global",
|
|
860
893
|
"id": "global::Promise"
|
|
894
|
+
},
|
|
895
|
+
"HTMLTdsDropdownOptionElement": {
|
|
896
|
+
"location": "global",
|
|
897
|
+
"id": "global::HTMLTdsDropdownOptionElement"
|
|
861
898
|
}
|
|
862
899
|
},
|
|
863
|
-
"return": "Promise<
|
|
900
|
+
"return": "Promise<{ value: string; label: string; }[]>"
|
|
864
901
|
},
|
|
865
902
|
"docs": {
|
|
866
|
-
"text": "",
|
|
903
|
+
"text": "Method for setting the value of the Dropdown.\n\nSingle selection example:\n\n<code>\ndropdown.setValue('option-1', 'Option 1');\n</code>\n\nMultiselect example:\n\n<code>\ndropdown.setValue(['option-1', 'option-2']);\n</code>",
|
|
867
904
|
"tags": []
|
|
868
905
|
}
|
|
869
906
|
},
|
|
870
|
-
"
|
|
907
|
+
"appendValue": {
|
|
871
908
|
"complexType": {
|
|
872
|
-
"signature": "() => Promise<void>",
|
|
873
|
-
"parameters": [
|
|
909
|
+
"signature": "(value: string) => Promise<void>",
|
|
910
|
+
"parameters": [{
|
|
911
|
+
"name": "value",
|
|
912
|
+
"type": "string",
|
|
913
|
+
"docs": ""
|
|
914
|
+
}],
|
|
874
915
|
"references": {
|
|
875
916
|
"Promise": {
|
|
876
917
|
"location": "global",
|
|
@@ -880,35 +921,42 @@ export class TdsDropdown {
|
|
|
880
921
|
"return": "Promise<void>"
|
|
881
922
|
},
|
|
882
923
|
"docs": {
|
|
883
|
-
"text": "
|
|
884
|
-
"tags": [
|
|
924
|
+
"text": "",
|
|
925
|
+
"tags": [{
|
|
926
|
+
"name": "internal",
|
|
927
|
+
"text": undefined
|
|
928
|
+
}]
|
|
885
929
|
}
|
|
886
930
|
},
|
|
887
|
-
"
|
|
931
|
+
"removeValue": {
|
|
888
932
|
"complexType": {
|
|
889
|
-
"signature": "() => Promise<
|
|
890
|
-
"parameters": [
|
|
933
|
+
"signature": "(oldValue: string) => Promise<{ value: string; label: string; }[]>",
|
|
934
|
+
"parameters": [{
|
|
935
|
+
"name": "oldValue",
|
|
936
|
+
"type": "string",
|
|
937
|
+
"docs": ""
|
|
938
|
+
}],
|
|
891
939
|
"references": {
|
|
892
940
|
"Promise": {
|
|
893
941
|
"location": "global",
|
|
894
942
|
"id": "global::Promise"
|
|
943
|
+
},
|
|
944
|
+
"HTMLTdsDropdownOptionElement": {
|
|
945
|
+
"location": "global",
|
|
946
|
+
"id": "global::HTMLTdsDropdownOptionElement"
|
|
895
947
|
}
|
|
896
948
|
},
|
|
897
|
-
"return": "Promise<
|
|
949
|
+
"return": "Promise<{ value: string; label: string; }[]>"
|
|
898
950
|
},
|
|
899
951
|
"docs": {
|
|
900
|
-
"text": "Method for
|
|
952
|
+
"text": "Method for removing a selected value in the Dropdown.",
|
|
901
953
|
"tags": []
|
|
902
954
|
}
|
|
903
955
|
},
|
|
904
|
-
"
|
|
956
|
+
"close": {
|
|
905
957
|
"complexType": {
|
|
906
|
-
"signature": "(
|
|
907
|
-
"parameters": [
|
|
908
|
-
"name": "value",
|
|
909
|
-
"type": "string",
|
|
910
|
-
"docs": ""
|
|
911
|
-
}],
|
|
958
|
+
"signature": "() => Promise<void>",
|
|
959
|
+
"parameters": [],
|
|
912
960
|
"references": {
|
|
913
961
|
"Promise": {
|
|
914
962
|
"location": "global",
|
|
@@ -918,7 +966,7 @@ export class TdsDropdown {
|
|
|
918
966
|
"return": "Promise<void>"
|
|
919
967
|
},
|
|
920
968
|
"docs": {
|
|
921
|
-
"text": "",
|
|
969
|
+
"text": "Method for closing the Dropdown.",
|
|
922
970
|
"tags": []
|
|
923
971
|
}
|
|
924
972
|
}
|
|
@@ -927,9 +975,6 @@ export class TdsDropdown {
|
|
|
927
975
|
static get elementRef() { return "host"; }
|
|
928
976
|
static get watchers() {
|
|
929
977
|
return [{
|
|
930
|
-
"propName": "value",
|
|
931
|
-
"methodName": "handleValueChange"
|
|
932
|
-
}, {
|
|
933
978
|
"propName": "open",
|
|
934
979
|
"methodName": "handleOpenState"
|
|
935
980
|
}];
|