@scania/tegel 1.24.0-value-prop.beta.6 → 1.25.0-config-for-china.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/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 -3
- package/dist/cjs/tds-block.cjs.entry.js +10 -6
- package/dist/cjs/tds-body-cell.cjs.entry.js +9 -6
- 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 +7 -3
- 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 +262 -156
- 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 +9 -6
- 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 +24 -3
- 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.css +3 -3
- package/dist/collection/components/button/button.js +6 -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 +26 -11
- package/dist/collection/components/dropdown/dropdown.js +283 -226
- 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 +9 -6
- 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 +9 -6
- 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/collection/utils/convertToString.js +14 -0
- 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-1aae42d5.js → p-467fe701.js} +241 -160
- package/dist/components/{p-09d36119.js → p-4bdaf254.js} +1 -1
- package/dist/components/{p-4030e9bc.js → p-6c2d5c85.js} +24 -10
- 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-b1d21573.js +16 -0
- package/dist/components/{p-dddaa520.js → p-d1ace0be.js} +1 -1
- 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 +8 -4
- package/dist/components/tds-block.js +10 -6
- package/dist/components/tds-body-cell.js +9 -6
- package/dist/components/tds-breadcrumb.js +1 -1
- package/dist/components/tds-breadcrumbs.js +1 -1
- package/dist/components/tds-button.js +7 -3
- 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 +10 -7
- 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 -3
- package/dist/esm/tds-block.entry.js +10 -6
- package/dist/esm/tds-body-cell.entry.js +9 -6
- 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 +7 -3
- 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 +262 -156
- 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 +9 -6
- 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-b9e37cf2.entry.js → p-1703f73a.entry.js} +1 -1
- package/dist/tegel/p-170ab61b.entry.js +1 -0
- package/dist/tegel/p-1aecae56.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-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-5e0fc86c.entry.js +1 -0
- 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-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-ab0528bf.entry.js +1 -0
- package/dist/tegel/p-b0a5eba7.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-be1d1345.entry.js +1 -0
- 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-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/banner/banner.d.ts +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +6 -2
- package/dist/types/components/dropdown/dropdown.d.ts +39 -27
- package/dist/types/components.d.ts +33 -27
- package/dist/types/utils/axeHelpers.d.ts +2 -0
- package/dist/types/utils/convertToString.d.ts +7 -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-7a83cf55.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-9c2dfecc.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
|
@@ -2,20 +2,41 @@ import { Host, h, } from "@stencil/core";
|
|
|
2
2
|
import findNextFocusableElement from "../../utils/findNextFocusableElement";
|
|
3
3
|
import findPreviousFocusableElement from "../../utils/findPreviousFocusableElement";
|
|
4
4
|
import appendHiddenInput from "../../utils/appendHiddenInput";
|
|
5
|
+
import { convertToString, convertArrayToStrings } from "../../utils/convertToString";
|
|
5
6
|
/**
|
|
6
7
|
* @slot <default> - <b>Unnamed slot.</b> For dropdown option elements.
|
|
7
8
|
*/
|
|
8
9
|
export class TdsDropdown {
|
|
9
10
|
constructor() {
|
|
10
11
|
this.setDefaultOption = () => {
|
|
11
|
-
if (this.
|
|
12
|
+
if (this.internalDefaultValue) {
|
|
13
|
+
const children = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
14
|
+
if (children.length === 0) {
|
|
15
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
12
18
|
const defaultValues = this.multiselect
|
|
13
|
-
? new Set(this.
|
|
14
|
-
: [this.
|
|
15
|
-
const
|
|
16
|
-
|
|
19
|
+
? new Set(this.internalDefaultValue.split(','))
|
|
20
|
+
: [this.internalDefaultValue];
|
|
21
|
+
const childrenMap = new Map(children.map((element) => [element.value, element]));
|
|
22
|
+
const matchedValues = Array.from(defaultValues).filter((value) => {
|
|
23
|
+
const element = childrenMap.get(value);
|
|
24
|
+
if (element) {
|
|
25
|
+
element.setSelected(true);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
});
|
|
30
|
+
if (matchedValues.length > 0) {
|
|
31
|
+
this.value = [...new Set(this.value ? [...this.value, ...matchedValues] : matchedValues)];
|
|
32
|
+
this.setValueAttribute();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
console.warn(`TDS DROPDOWN: No matching option found for defaultValue "${this.internalDefaultValue}"`);
|
|
36
|
+
}
|
|
17
37
|
}
|
|
18
38
|
};
|
|
39
|
+
/* Returns a list of all children that are tds-dropdown-option elements */
|
|
19
40
|
this.getChildren = () => {
|
|
20
41
|
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
21
42
|
if (tdsDropdownOptions.length === 0) {
|
|
@@ -24,36 +45,6 @@ export class TdsDropdown {
|
|
|
24
45
|
else
|
|
25
46
|
return tdsDropdownOptions;
|
|
26
47
|
};
|
|
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
48
|
this.getOpenDirection = () => {
|
|
58
49
|
var _a, _b, _c, _d, _e;
|
|
59
50
|
if (this.openDirection === 'auto' || !this.openDirection) {
|
|
@@ -67,6 +58,7 @@ export class TdsDropdown {
|
|
|
67
58
|
}
|
|
68
59
|
return this.openDirection;
|
|
69
60
|
};
|
|
61
|
+
/* Toggles the open state of the Dropdown and sets focus to the input element */
|
|
70
62
|
this.handleToggleOpen = () => {
|
|
71
63
|
if (!this.disabled) {
|
|
72
64
|
this.open = !this.open;
|
|
@@ -75,10 +67,38 @@ export class TdsDropdown {
|
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
69
|
};
|
|
70
|
+
/* Focuses the input element in the Dropdown, if the reference is present. */
|
|
78
71
|
this.focusInputElement = () => {
|
|
79
72
|
if (this.inputElement)
|
|
80
73
|
this.inputElement.focus();
|
|
81
74
|
};
|
|
75
|
+
this.getSelectedChildren = () => {
|
|
76
|
+
var _a;
|
|
77
|
+
return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((stringValue) => {
|
|
78
|
+
const matchingElement = this.getChildren().find((element) => element.value === stringValue);
|
|
79
|
+
return matchingElement;
|
|
80
|
+
}).filter(Boolean);
|
|
81
|
+
};
|
|
82
|
+
this.getSelectedChildrenLabels = () => {
|
|
83
|
+
var _a;
|
|
84
|
+
return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
|
|
85
|
+
};
|
|
86
|
+
this.getValue = () => {
|
|
87
|
+
const labels = this.getSelectedChildrenLabels();
|
|
88
|
+
if (!labels) {
|
|
89
|
+
return '';
|
|
90
|
+
}
|
|
91
|
+
return labels === null || labels === void 0 ? void 0 : labels.join(', ');
|
|
92
|
+
};
|
|
93
|
+
this.setValueAttribute = () => {
|
|
94
|
+
var _a;
|
|
95
|
+
if (!this.value || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '') {
|
|
96
|
+
this.host.removeAttribute('value');
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.host.setAttribute('value', convertArrayToStrings(this.value).join(','));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
82
102
|
this.handleFilter = (event) => {
|
|
83
103
|
this.tdsInput.emit(event);
|
|
84
104
|
const query = event.target.value.toLowerCase();
|
|
@@ -109,10 +129,8 @@ export class TdsDropdown {
|
|
|
109
129
|
this.handleFilterReset = () => {
|
|
110
130
|
this.reset();
|
|
111
131
|
this.inputElement.value = '';
|
|
112
|
-
this.handleFilter({ target: { value:
|
|
132
|
+
this.handleFilter({ target: { value: this.inputElement.value } });
|
|
113
133
|
this.inputElement.focus();
|
|
114
|
-
// Add this line to ensure internal value is cleared
|
|
115
|
-
this.internalValue = '';
|
|
116
134
|
};
|
|
117
135
|
this.handleFocus = (event) => {
|
|
118
136
|
this.open = true;
|
|
@@ -126,6 +144,12 @@ export class TdsDropdown {
|
|
|
126
144
|
this.handleBlur = (event) => {
|
|
127
145
|
this.tdsBlur.emit(event);
|
|
128
146
|
};
|
|
147
|
+
this.handleChange = () => {
|
|
148
|
+
this.tdsChange.emit({
|
|
149
|
+
name: this.name,
|
|
150
|
+
value: this.value ? convertArrayToStrings(this.value).join(',') : null,
|
|
151
|
+
});
|
|
152
|
+
};
|
|
129
153
|
this.resetInput = () => {
|
|
130
154
|
const inputEl = this.host.querySelector('input');
|
|
131
155
|
if (inputEl) {
|
|
@@ -148,101 +172,110 @@ 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.
|
|
157
|
-
}
|
|
158
|
-
handleValueChange(newValue) {
|
|
159
|
-
// Normalize to array
|
|
160
|
-
const normalizedValue = this.normalizeValue(newValue);
|
|
161
|
-
// Only update if actually changed
|
|
162
|
-
if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
|
|
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];
|
|
179
|
+
this.internalDefaultValue = undefined;
|
|
174
180
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
/** Method that resets the Dropdown, marks all children as non-selected and resets the value to null. */
|
|
182
|
+
async reset() {
|
|
183
|
+
this.dropdownList.scrollTop = 0;
|
|
184
|
+
this.internalReset();
|
|
185
|
+
this.handleChange();
|
|
179
186
|
}
|
|
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();
|
|
187
|
+
/** Method that forces focus on the input element. */
|
|
188
|
+
async focusElement() {
|
|
189
|
+
this.focusInputElement();
|
|
190
|
+
this.handleFocus({});
|
|
195
191
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
192
|
+
/** Method for setting the value of the Dropdown.
|
|
193
|
+
*
|
|
194
|
+
* Single selection example:
|
|
195
|
+
*
|
|
196
|
+
* <code>
|
|
197
|
+
* dropdown.setValue('option-1', 'Option 1');
|
|
198
|
+
* </code>
|
|
199
|
+
*
|
|
200
|
+
* Multiselect example:
|
|
201
|
+
*
|
|
202
|
+
* <code>
|
|
203
|
+
* dropdown.setValue(['option-1', 'option-2']);
|
|
204
|
+
* </code>
|
|
205
|
+
*/
|
|
206
|
+
// The label is optional here ONLY to not break the API. Should be removed for 2.0.
|
|
207
|
+
// @ts-ignore
|
|
208
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
209
|
+
async setValue(value) {
|
|
210
|
+
let nextValue;
|
|
211
|
+
if (Array.isArray(value)) {
|
|
212
|
+
nextValue = convertArrayToStrings(value);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
nextValue = [convertToString(value)];
|
|
216
|
+
}
|
|
217
|
+
if (!this.multiselect && nextValue.length > 1) {
|
|
218
|
+
console.warn('Tried to select multiple items, but multiselect is not enabled.');
|
|
219
|
+
nextValue = [nextValue[0]];
|
|
220
|
+
}
|
|
221
|
+
nextValue = [...new Set(nextValue)];
|
|
222
|
+
this.internalReset();
|
|
223
|
+
for (let i = 0; i < nextValue.length; i++) {
|
|
224
|
+
const optionExist = this.getChildren().some((element) => element.value === nextValue[i]);
|
|
225
|
+
if (!optionExist) {
|
|
226
|
+
nextValue.splice(i, 1);
|
|
202
227
|
}
|
|
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
228
|
}
|
|
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) => ({
|
|
229
|
+
this.value = nextValue;
|
|
230
|
+
this.setValueAttribute();
|
|
231
|
+
this.selectChildrenAsSelectedBasedOnSelectionProp();
|
|
232
|
+
this.handleChange();
|
|
233
|
+
/* 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. */
|
|
234
|
+
/* https://tegel.atlassian.net/browse/CDEP-2703 */
|
|
235
|
+
const selection = this.getSelectedChildren().map((element) => ({
|
|
231
236
|
value: element.value,
|
|
232
237
|
label: element.textContent.trim(),
|
|
233
238
|
}));
|
|
239
|
+
// Update inputElement value and placeholder text
|
|
240
|
+
if (this.filter) {
|
|
241
|
+
this.inputElement.value = this.getValue();
|
|
242
|
+
}
|
|
243
|
+
return selection;
|
|
234
244
|
}
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
/**
|
|
246
|
+
* @internal
|
|
247
|
+
*/
|
|
248
|
+
async appendValue(value) {
|
|
249
|
+
if (this.multiselect && this.value) {
|
|
250
|
+
this.setValue([...this.value, value]);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.setValue(value);
|
|
254
|
+
}
|
|
237
255
|
}
|
|
256
|
+
/** Method for removing a selected value in the Dropdown. */
|
|
238
257
|
async removeValue(oldValue) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
258
|
+
var _a, _b;
|
|
259
|
+
let label;
|
|
260
|
+
if (this.multiselect) {
|
|
261
|
+
(_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
|
|
262
|
+
var _a;
|
|
263
|
+
if (element.value === oldValue) {
|
|
264
|
+
this.value = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter((value) => value !== element.value);
|
|
265
|
+
label = element.textContent.trim();
|
|
266
|
+
element.setSelected(false);
|
|
267
|
+
}
|
|
268
|
+
return element;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this.reset();
|
|
273
|
+
}
|
|
274
|
+
this.handleChange();
|
|
275
|
+
this.setValueAttribute();
|
|
276
|
+
/* 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. */
|
|
277
|
+
/* https://tegel.atlassian.net/browse/CDEP-2703 */
|
|
278
|
+
return (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((value) => ({ value, label }));
|
|
246
279
|
}
|
|
247
280
|
/** Method for closing the Dropdown. */
|
|
248
281
|
async close() {
|
|
@@ -291,15 +324,21 @@ export class TdsDropdown {
|
|
|
291
324
|
handleOpenState() {
|
|
292
325
|
if (this.filter && this.multiselect) {
|
|
293
326
|
if (!this.open) {
|
|
294
|
-
this.inputElement.value = this.
|
|
327
|
+
this.inputElement.value = this.getValue();
|
|
295
328
|
}
|
|
296
329
|
}
|
|
297
330
|
}
|
|
331
|
+
handleDefaultValueChange(newValue) {
|
|
332
|
+
if (newValue !== undefined && newValue !== null) {
|
|
333
|
+
this.internalDefaultValue = convertToString(newValue);
|
|
334
|
+
this.setDefaultOption();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
298
337
|
componentWillLoad() {
|
|
299
|
-
if (this.defaultValue &&
|
|
300
|
-
|
|
301
|
-
this.updateDropdownState(initialValue);
|
|
338
|
+
if (this.defaultValue !== undefined && this.defaultValue !== null) {
|
|
339
|
+
this.internalDefaultValue = convertToString(this.defaultValue);
|
|
302
340
|
}
|
|
341
|
+
this.setDefaultOption();
|
|
303
342
|
}
|
|
304
343
|
/** Method to handle slot changes */
|
|
305
344
|
handleSlotChange() {
|
|
@@ -309,13 +348,29 @@ export class TdsDropdown {
|
|
|
309
348
|
normalizeString(text) {
|
|
310
349
|
return this.normalizeText ? text.normalize('NFD').replace(/\p{Diacritic}/gu, '') : text;
|
|
311
350
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
351
|
+
/** Method that resets the dropdown without emitting an event. */
|
|
352
|
+
internalReset() {
|
|
353
|
+
this.getChildren().forEach((element) => {
|
|
354
|
+
element.setSelected(false);
|
|
355
|
+
return element;
|
|
356
|
+
});
|
|
357
|
+
this.value = null;
|
|
358
|
+
this.setValueAttribute();
|
|
359
|
+
}
|
|
360
|
+
selectChildrenAsSelectedBasedOnSelectionProp() {
|
|
361
|
+
this.getChildren().forEach((element) => {
|
|
362
|
+
this.value.forEach((selection) => {
|
|
363
|
+
if (element.value !== selection) {
|
|
364
|
+
// If not multiselect, we need to unselect all other options.
|
|
365
|
+
if (!this.multiselect) {
|
|
366
|
+
element.setSelected(false);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
element.setSelected(true);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
});
|
|
319
374
|
}
|
|
320
375
|
componentDidRender() {
|
|
321
376
|
const form = this.host.closest('form');
|
|
@@ -330,8 +385,15 @@ export class TdsDropdown {
|
|
|
330
385
|
}
|
|
331
386
|
}
|
|
332
387
|
render() {
|
|
333
|
-
|
|
334
|
-
|
|
388
|
+
var _a, _b, _c;
|
|
389
|
+
appendHiddenInput(this.host, this.name, this.value ? convertArrayToStrings(this.value).join(',') : null, this.disabled);
|
|
390
|
+
return (h(Host, { key: '0bb6532a6a87ba128f556022792fe5afb3e3e482', role: "select", class: {
|
|
391
|
+
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
392
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'c65377474abaae962436d53b42e19eeda2bcdda6', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '80d21a17eef6a3d8ff7f73e5a52a744ae4aa08b6', class: {
|
|
393
|
+
'dropdown-select': true,
|
|
394
|
+
[this.size]: true,
|
|
395
|
+
'disabled': this.disabled,
|
|
396
|
+
} }, this.filter ? (h("div", { class: {
|
|
335
397
|
filter: true,
|
|
336
398
|
focus: this.filterFocus,
|
|
337
399
|
disabled: this.disabled,
|
|
@@ -339,16 +401,26 @@ export class TdsDropdown {
|
|
|
339
401
|
} }, 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
402
|
label-inside-as-placeholder
|
|
341
403
|
${this.size}
|
|
342
|
-
${this.
|
|
404
|
+
${((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) ? 'selected' : ''}
|
|
343
405
|
` }, this.label)), h("input", {
|
|
344
406
|
// eslint-disable-next-line no-return-assign
|
|
345
|
-
ref: (inputEl) => (this.inputElement = inputEl), class:
|
|
407
|
+
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
408
|
+
placeholder: this.labelPosition === 'inside',
|
|
409
|
+
}, 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
410
|
this.filterFocus = false;
|
|
347
411
|
if (this.multiselect) {
|
|
348
412
|
this.inputElement.value = this.getValue();
|
|
349
413
|
}
|
|
350
414
|
this.handleBlur(event);
|
|
351
|
-
}, onFocus: (event) =>
|
|
415
|
+
}, onFocus: (event) => {
|
|
416
|
+
this.open = true;
|
|
417
|
+
this.filterFocus = true;
|
|
418
|
+
if (this.multiselect) {
|
|
419
|
+
this.inputElement.value = '';
|
|
420
|
+
}
|
|
421
|
+
this.handleFocus(event);
|
|
422
|
+
this.handleFilter({ target: { value: '' } });
|
|
423
|
+
}, onKeyDown: (event) => {
|
|
352
424
|
if (event.key === 'Escape') {
|
|
353
425
|
this.open = false;
|
|
354
426
|
}
|
|
@@ -357,7 +429,10 @@ export class TdsDropdown {
|
|
|
357
429
|
if (event.key === 'Enter') {
|
|
358
430
|
this.handleFilterReset();
|
|
359
431
|
}
|
|
360
|
-
}, class:
|
|
432
|
+
}, class: {
|
|
433
|
+
'clear-icon': true,
|
|
434
|
+
'hide': !(this.open && this.inputElement.value !== ''),
|
|
435
|
+
}, 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
436
|
if (event.key === 'Enter') {
|
|
362
437
|
this.handleToggleOpen();
|
|
363
438
|
}
|
|
@@ -365,15 +440,19 @@ export class TdsDropdown {
|
|
|
365
440
|
if (event.key === 'Escape') {
|
|
366
441
|
this.open = false;
|
|
367
442
|
}
|
|
368
|
-
}, class:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
443
|
+
}, class: {
|
|
444
|
+
value: Boolean(this.value),
|
|
445
|
+
placeholder: Boolean(!this.value),
|
|
446
|
+
open: this.open,
|
|
447
|
+
closed: !this.open,
|
|
448
|
+
error: this.error,
|
|
449
|
+
}, 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: {
|
|
450
|
+
'label-inside-as-placeholder': true,
|
|
451
|
+
[this.size]: true,
|
|
452
|
+
'selected': Boolean((_b = this.value) === null || _b === void 0 ? void 0 : _b.length),
|
|
453
|
+
} }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_c = this.value) === null || _c === void 0 ? void 0 : _c.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: '1f1c87b17a78c2a65add834208f487c6e9a4f77e', ref: (element) => {
|
|
454
|
+
this.dropdownList = element;
|
|
455
|
+
}, class: {
|
|
377
456
|
'dropdown-list': true,
|
|
378
457
|
[this.size]: true,
|
|
379
458
|
[this.getOpenDirection()]: true,
|
|
@@ -382,7 +461,11 @@ export class TdsDropdown {
|
|
|
382
461
|
'closed': !this.open,
|
|
383
462
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
384
463
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
385
|
-
} }, h("slot", { key: '
|
|
464
|
+
} }, h("slot", { key: '6eb6b21f865702aa56af12b9e54bdb2c6c7c8cc2', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '58c15bd69f38c001e0d6c74466ddfe97d6d77a79', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'cc7e1a7f988e6bc61f3bacb7dd9a564b6c1f738d', class: {
|
|
465
|
+
helper: true,
|
|
466
|
+
error: this.error,
|
|
467
|
+
disabled: this.disabled,
|
|
468
|
+
} }, this.error && h("tds-icon", { key: 'ffd574d493f3bbaa37ddc7b14a8372ba4b23bd70', name: "error", size: "16px" }), this.helper))));
|
|
386
469
|
}
|
|
387
470
|
static get is() { return "tds-dropdown"; }
|
|
388
471
|
static get encapsulation() { return "shadow"; }
|
|
@@ -664,11 +747,11 @@ export class TdsDropdown {
|
|
|
664
747
|
"defaultValue": "'No result'"
|
|
665
748
|
},
|
|
666
749
|
"defaultValue": {
|
|
667
|
-
"type": "
|
|
750
|
+
"type": "any",
|
|
668
751
|
"mutable": false,
|
|
669
752
|
"complexType": {
|
|
670
|
-
"original": "string",
|
|
671
|
-
"resolved": "string",
|
|
753
|
+
"original": "string | number",
|
|
754
|
+
"resolved": "number | string",
|
|
672
755
|
"references": {}
|
|
673
756
|
},
|
|
674
757
|
"required": false,
|
|
@@ -679,34 +762,16 @@ export class TdsDropdown {
|
|
|
679
762
|
},
|
|
680
763
|
"attribute": "default-value",
|
|
681
764
|
"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
765
|
}
|
|
701
766
|
};
|
|
702
767
|
}
|
|
703
768
|
static get states() {
|
|
704
769
|
return {
|
|
705
770
|
"open": {},
|
|
706
|
-
"
|
|
771
|
+
"value": {},
|
|
707
772
|
"filterResult": {},
|
|
708
773
|
"filterFocus": {},
|
|
709
|
-
"
|
|
774
|
+
"internalDefaultValue": {}
|
|
710
775
|
};
|
|
711
776
|
}
|
|
712
777
|
static get events() {
|
|
@@ -785,51 +850,28 @@ export class TdsDropdown {
|
|
|
785
850
|
}
|
|
786
851
|
}
|
|
787
852
|
}
|
|
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
853
|
}];
|
|
804
854
|
}
|
|
805
855
|
static get methods() {
|
|
806
856
|
return {
|
|
807
|
-
"
|
|
857
|
+
"reset": {
|
|
808
858
|
"complexType": {
|
|
809
|
-
"signature": "(
|
|
810
|
-
"parameters": [
|
|
811
|
-
"name": "value",
|
|
812
|
-
"type": "string | string[]",
|
|
813
|
-
"docs": ""
|
|
814
|
-
}],
|
|
859
|
+
"signature": "() => Promise<void>",
|
|
860
|
+
"parameters": [],
|
|
815
861
|
"references": {
|
|
816
862
|
"Promise": {
|
|
817
863
|
"location": "global",
|
|
818
864
|
"id": "global::Promise"
|
|
819
|
-
},
|
|
820
|
-
"HTMLTdsDropdownOptionElement": {
|
|
821
|
-
"location": "global",
|
|
822
|
-
"id": "global::HTMLTdsDropdownOptionElement"
|
|
823
865
|
}
|
|
824
866
|
},
|
|
825
|
-
"return": "Promise<
|
|
867
|
+
"return": "Promise<void>"
|
|
826
868
|
},
|
|
827
869
|
"docs": {
|
|
828
|
-
"text": "",
|
|
870
|
+
"text": "Method that resets the Dropdown, marks all children as non-selected and resets the value to null.",
|
|
829
871
|
"tags": []
|
|
830
872
|
}
|
|
831
873
|
},
|
|
832
|
-
"
|
|
874
|
+
"focusElement": {
|
|
833
875
|
"complexType": {
|
|
834
876
|
"signature": "() => Promise<void>",
|
|
835
877
|
"parameters": [],
|
|
@@ -842,35 +884,43 @@ export class TdsDropdown {
|
|
|
842
884
|
"return": "Promise<void>"
|
|
843
885
|
},
|
|
844
886
|
"docs": {
|
|
845
|
-
"text": "",
|
|
887
|
+
"text": "Method that forces focus on the input element.",
|
|
846
888
|
"tags": []
|
|
847
889
|
}
|
|
848
890
|
},
|
|
849
|
-
"
|
|
891
|
+
"setValue": {
|
|
850
892
|
"complexType": {
|
|
851
|
-
"signature": "(
|
|
893
|
+
"signature": "(value: string | string[] | number | number[]) => Promise<{ value: string | number; label: string; }[]>",
|
|
852
894
|
"parameters": [{
|
|
853
|
-
"name": "
|
|
854
|
-
"type": "string",
|
|
895
|
+
"name": "value",
|
|
896
|
+
"type": "string | number | string[] | number[]",
|
|
855
897
|
"docs": ""
|
|
856
898
|
}],
|
|
857
899
|
"references": {
|
|
858
900
|
"Promise": {
|
|
859
901
|
"location": "global",
|
|
860
902
|
"id": "global::Promise"
|
|
903
|
+
},
|
|
904
|
+
"HTMLTdsDropdownOptionElement": {
|
|
905
|
+
"location": "global",
|
|
906
|
+
"id": "global::HTMLTdsDropdownOptionElement"
|
|
861
907
|
}
|
|
862
908
|
},
|
|
863
|
-
"return": "Promise<
|
|
909
|
+
"return": "Promise<{ value: string | number; label: string; }[]>"
|
|
864
910
|
},
|
|
865
911
|
"docs": {
|
|
866
|
-
"text": "",
|
|
912
|
+
"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
913
|
"tags": []
|
|
868
914
|
}
|
|
869
915
|
},
|
|
870
|
-
"
|
|
916
|
+
"appendValue": {
|
|
871
917
|
"complexType": {
|
|
872
|
-
"signature": "() => Promise<void>",
|
|
873
|
-
"parameters": [
|
|
918
|
+
"signature": "(value: string) => Promise<void>",
|
|
919
|
+
"parameters": [{
|
|
920
|
+
"name": "value",
|
|
921
|
+
"type": "string",
|
|
922
|
+
"docs": ""
|
|
923
|
+
}],
|
|
874
924
|
"references": {
|
|
875
925
|
"Promise": {
|
|
876
926
|
"location": "global",
|
|
@@ -880,35 +930,42 @@ export class TdsDropdown {
|
|
|
880
930
|
"return": "Promise<void>"
|
|
881
931
|
},
|
|
882
932
|
"docs": {
|
|
883
|
-
"text": "
|
|
884
|
-
"tags": [
|
|
933
|
+
"text": "",
|
|
934
|
+
"tags": [{
|
|
935
|
+
"name": "internal",
|
|
936
|
+
"text": undefined
|
|
937
|
+
}]
|
|
885
938
|
}
|
|
886
939
|
},
|
|
887
|
-
"
|
|
940
|
+
"removeValue": {
|
|
888
941
|
"complexType": {
|
|
889
|
-
"signature": "() => Promise<
|
|
890
|
-
"parameters": [
|
|
942
|
+
"signature": "(oldValue: string) => Promise<{ value: string; label: string; }[]>",
|
|
943
|
+
"parameters": [{
|
|
944
|
+
"name": "oldValue",
|
|
945
|
+
"type": "string",
|
|
946
|
+
"docs": ""
|
|
947
|
+
}],
|
|
891
948
|
"references": {
|
|
892
949
|
"Promise": {
|
|
893
950
|
"location": "global",
|
|
894
951
|
"id": "global::Promise"
|
|
952
|
+
},
|
|
953
|
+
"HTMLTdsDropdownOptionElement": {
|
|
954
|
+
"location": "global",
|
|
955
|
+
"id": "global::HTMLTdsDropdownOptionElement"
|
|
895
956
|
}
|
|
896
957
|
},
|
|
897
|
-
"return": "Promise<
|
|
958
|
+
"return": "Promise<{ value: string; label: string; }[]>"
|
|
898
959
|
},
|
|
899
960
|
"docs": {
|
|
900
|
-
"text": "Method for
|
|
961
|
+
"text": "Method for removing a selected value in the Dropdown.",
|
|
901
962
|
"tags": []
|
|
902
963
|
}
|
|
903
964
|
},
|
|
904
|
-
"
|
|
965
|
+
"close": {
|
|
905
966
|
"complexType": {
|
|
906
|
-
"signature": "(
|
|
907
|
-
"parameters": [
|
|
908
|
-
"name": "value",
|
|
909
|
-
"type": "string",
|
|
910
|
-
"docs": ""
|
|
911
|
-
}],
|
|
967
|
+
"signature": "() => Promise<void>",
|
|
968
|
+
"parameters": [],
|
|
912
969
|
"references": {
|
|
913
970
|
"Promise": {
|
|
914
971
|
"location": "global",
|
|
@@ -918,7 +975,7 @@ export class TdsDropdown {
|
|
|
918
975
|
"return": "Promise<void>"
|
|
919
976
|
},
|
|
920
977
|
"docs": {
|
|
921
|
-
"text": "",
|
|
978
|
+
"text": "Method for closing the Dropdown.",
|
|
922
979
|
"tags": []
|
|
923
980
|
}
|
|
924
981
|
}
|
|
@@ -927,11 +984,11 @@ export class TdsDropdown {
|
|
|
927
984
|
static get elementRef() { return "host"; }
|
|
928
985
|
static get watchers() {
|
|
929
986
|
return [{
|
|
930
|
-
"propName": "value",
|
|
931
|
-
"methodName": "handleValueChange"
|
|
932
|
-
}, {
|
|
933
987
|
"propName": "open",
|
|
934
988
|
"methodName": "handleOpenState"
|
|
989
|
+
}, {
|
|
990
|
+
"propName": "defaultValue",
|
|
991
|
+
"methodName": "handleDefaultValueChange"
|
|
935
992
|
}];
|
|
936
993
|
}
|
|
937
994
|
static get listeners() {
|