@scania/tegel 1.0.1 → 1.0.3
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/dfs-babd18a6.js +29 -0
- package/dist/cjs/generateUniqueId-56da4810.js +28 -0
- package/dist/cjs/hasSlot-1c90e9ba.js +11 -0
- package/dist/cjs/{index-2a60e106.js → index-862c9693.js} +5 -5
- package/dist/cjs/inheritAriaAttributes-640b1abb.js +78 -0
- package/dist/cjs/inheritAttributes-845f5217.js +27 -0
- package/dist/cjs/isHeadingElement-d31dde38.js +71 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/tds-badge.cjs.entry.js +1 -1
- package/dist/cjs/tds-banner.cjs.entry.js +7 -6
- package/dist/cjs/tds-block.cjs.entry.js +5 -3
- package/dist/cjs/tds-body-cell.cjs.entry.js +1 -1
- package/dist/cjs/tds-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/tds-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/tds-button.cjs.entry.js +4 -4
- package/dist/cjs/tds-card.cjs.entry.js +11 -10
- package/dist/cjs/tds-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/tds-chip.cjs.entry.js +7 -6
- 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-option.cjs.entry.js +4 -3
- package/dist/cjs/tds-dropdown.cjs.entry.js +182 -56
- package/dist/cjs/tds-folder-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer-group.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-footer.cjs.entry.js +5 -5
- package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list-user.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list.cjs.entry.js +4 -3
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/tds-header-hamburger.cjs.entry.js +4 -3
- package/dist/cjs/tds-header-launcher-button.cjs.entry.js +4 -3
- package/dist/cjs/tds-header-launcher-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-grid-title.cjs.entry.js +3 -3
- package/dist/cjs/tds-header-launcher-grid.cjs.entry.js +5 -4
- package/dist/cjs/tds-header-launcher-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-list-title.cjs.entry.js +3 -3
- package/dist/cjs/tds-header-launcher-list.cjs.entry.js +3 -3
- package/dist/cjs/tds-header-launcher.cjs.entry.js +6 -4
- package/dist/cjs/tds-header-title.cjs.entry.js +1 -1
- package/dist/cjs/tds-header.cjs.entry.js +21 -5
- package/dist/cjs/tds-icon.cjs.entry.js +4 -2
- package/dist/cjs/tds-inline-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +1 -7
- package/dist/cjs/tds-link.cjs.entry.js +1 -1
- package/dist/cjs/tds-message.cjs.entry.js +1 -1
- package/dist/cjs/tds-modal.cjs.entry.js +5 -5
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +1 -4
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -3
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu.cjs.entry.js +3 -3
- package/dist/cjs/tds-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/tds-side-menu-close-button.cjs.entry.js +4 -3
- package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown-list.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/tds-side-menu-overlay.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-user-image_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-user.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-slider.cjs.entry.js +15 -9
- package/dist/cjs/tds-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tds-step.cjs.entry.js +1 -1
- package/dist/cjs/tds-stepper.cjs.entry.js +3 -3
- package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body-row.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-footer.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-header.cjs.entry.js +1 -1
- package/dist/cjs/tds-table-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/tds-table.cjs.entry.js +3 -3
- package/dist/cjs/tds-text-field.cjs.entry.js +5 -5
- package/dist/cjs/tds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/tds-toast.cjs.entry.js +7 -6
- package/dist/cjs/tds-toggle.cjs.entry.js +3 -3
- package/dist/cjs/tds-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/tegel.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/accordion/accordion.stories.js +1 -1
- package/dist/collection/components/badge/badge.stories.js +1 -1
- package/dist/collection/components/banner/banner.js +2 -1
- package/dist/collection/components/banner/banner.stories.js +2 -2
- package/dist/collection/components/block/block.js +4 -2
- package/dist/collection/components/block/block.stories.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/button/button.stories.js +2 -2
- package/dist/collection/components/card/card.css +1 -0
- package/dist/collection/components/card/card.js +2 -1
- package/dist/collection/components/card/card.stories.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +1 -1
- package/dist/collection/components/checkbox/checkbox.stories.js +1 -1
- package/dist/collection/components/chip/chip.js +2 -1
- package/dist/collection/components/chip/chip.stories.js +1 -1
- package/dist/collection/components/datetime/datetime.js +1 -1
- package/dist/collection/components/datetime/datetime.stories.js +1 -1
- package/dist/collection/components/divider/divider.stories.js +1 -1
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +3 -2
- package/dist/collection/components/dropdown/dropdown.css +7 -2
- package/dist/collection/components/dropdown/dropdown.js +151 -61
- package/dist/collection/components/dropdown/dropdown.stories.js +10 -14
- package/dist/collection/components/footer/footer.js +1 -1
- package/dist/collection/components/footer/footer.stories.js +1 -1
- package/dist/collection/components/header/header-dropdown/header-dropdown.js +1 -1
- package/dist/collection/components/header/header-dropdown-list/header-dropdown-list.js +2 -1
- package/dist/collection/components/header/header-hamburger/header-hamburger.js +1 -1
- package/dist/collection/components/header/header-item/header-item.js +1 -1
- package/dist/collection/components/header/header-launcher/header-launcher.js +2 -1
- 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 +2 -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-title/header-launcher-list-title.js +1 -1
- package/dist/collection/components/header/header.js +2 -1
- package/dist/collection/components/header/header.stories.js +1 -1
- package/dist/collection/components/icon/icon.js +20 -1
- package/dist/collection/components/icon/icon.stories.js +1 -1
- package/dist/collection/components/link/link.stories.js +1 -1
- package/dist/collection/components/message/message.stories.js +1 -1
- package/dist/collection/components/modal/modal.js +1 -1
- package/dist/collection/components/modal/modal.stories.js +1 -1
- package/dist/collection/components/popover-canvas/popover-canvas.js +1 -1
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +1 -1
- package/dist/collection/components/popover-menu/popover-menu.js +1 -1
- package/dist/collection/components/popover-menu/popover-menu.stories.js +3 -5
- package/dist/collection/components/radio-button/radio-button.js +1 -1
- package/dist/collection/components/radio-button/radio-button.stories.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-item/side-menu-item.js +1 -1
- package/dist/collection/components/side-menu/side-menu.js +3 -3
- package/dist/collection/components/side-menu/side-menu.stories.js +1 -1
- package/dist/collection/components/slider/slider.js +16 -7
- package/dist/collection/components/slider/slider.stories.js +3 -3
- package/dist/collection/components/spinner/spinner.stories.js +1 -1
- package/dist/collection/components/stepper/stepper.js +2 -2
- package/dist/collection/components/stepper/stepper.stories.js +1 -1
- package/dist/collection/components/table/table/table.js +2 -2
- package/dist/collection/components/table/table-component-basic.stories.js +1 -1
- package/dist/collection/components/table/table-component-batch-actions.stories.js +1 -1
- package/dist/collection/components/table/table-component-custom-width.stories.js +1 -1
- package/dist/collection/components/table/table-component-expandable-rows.stories.js +1 -1
- package/dist/collection/components/table/table-component-filtering.stories.js +1 -9
- package/dist/collection/components/table/table-component-multiselect.stories.js +1 -2
- package/dist/collection/components/table/table-component-pagination.stories.js +1 -1
- package/dist/collection/components/table/table-component-sorting.stories.js +1 -1
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.stories.js +1 -1
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +0 -6
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.stories.js +1 -1
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +0 -3
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +1 -1
- package/dist/collection/components/text-field/text-field.js +2 -2
- package/dist/collection/components/text-field/text-field.stories.js +1 -1
- package/dist/collection/components/textarea/textarea.stories.js +1 -1
- package/dist/collection/components/toast/toast.js +2 -1
- package/dist/collection/components/toast/toast.stories.js +1 -1
- package/dist/collection/components/toggle/toggle.js +1 -1
- package/dist/collection/components/toggle/toggle.stories.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/components/tooltip/tooltip.stories.js +3 -13
- package/dist/collection/stories/Installation/installation.stories.js +4 -8
- package/dist/collection/stories/formatHtmlPreview.js +10 -0
- package/dist/collection/stories/foundations/color/color-brand.stories.js +1 -1
- package/dist/collection/stories/foundations/color/color-scales.stories.js +1 -1
- package/dist/collection/stories/foundations/color/color-semantic.stories.js +2 -2
- package/dist/collection/stories/foundations/grid/grid.stories.js +1 -1
- package/dist/collection/stories/foundations/spacing/spacing-element.stories.js +1 -1
- package/dist/collection/stories/foundations/spacing/spacing-layout.stories.js +1 -1
- package/dist/collection/stories/foundations/typography/typography-body.stories.js +1 -1
- package/dist/collection/stories/foundations/typography/typography-detail.stories.js +1 -1
- package/dist/collection/stories/foundations/typography/typography-headline.stories.js +1 -1
- package/dist/collection/stories/foundations/typography/typography-paragraph.stories.js +1 -1
- package/dist/collection/stories/patterns/navigation/navigation-basic.stories.js +1 -1
- package/dist/collection/stories/patterns/navigation/navigation-fewitems.stories.js +1 -1
- package/dist/collection/stories/patterns/navigation/navigation-manyitems.stories.js +1 -1
- package/dist/collection/stories/patterns/navigation/navigation-user-menu.stories.js +1 -1
- package/dist/collection/stories/utility/color/background-color.stories.js +1 -1
- package/dist/collection/stories/utility/color/text-color.stories.js +1 -1
- package/dist/collection/types/Attributes.js +1 -0
- package/dist/collection/utils/appendHiddenInput.js +25 -0
- package/dist/collection/utils/dfs.js +26 -0
- package/dist/collection/utils/findNextFocusableElement.js +16 -0
- package/dist/collection/utils/findPreviousFocusableElement.js +17 -0
- package/dist/collection/utils/generateUniqueId.js +25 -0
- package/dist/collection/utils/getNestedChildOfSiblingsMatching.js +22 -0
- package/dist/collection/utils/getNextNestedChildOfSiblingsMatching.js +32 -0
- package/dist/collection/utils/getNextSibling.js +2 -0
- package/dist/collection/utils/getPreviousNestedChildOfSiblingsMatching.js +32 -0
- package/dist/collection/utils/getPreviousSibling.js +2 -0
- package/dist/collection/utils/hasSlot.js +8 -0
- package/dist/collection/utils/inheritAriaAttributes.js +74 -0
- package/dist/collection/utils/inheritAttributes.js +24 -0
- package/dist/collection/utils/isHeadingElement.js +12 -0
- package/dist/collection/utils/updateListChildrenRoles.js +15 -0
- package/{components → dist/components}/checkbox.js +1 -1
- package/dist/components/dfs.js +27 -0
- package/dist/components/generateUniqueId.js +26 -0
- package/dist/components/getPreviousNestedChildOfSiblingsMatching.js +68 -0
- package/dist/components/hasSlot.js +9 -0
- package/{components → dist/components}/header-dropdown-list.js +1 -1
- package/{components → dist/components}/header-item.js +1 -1
- package/{components → dist/components}/header-launcher-button.js +1 -1
- package/{components → dist/components}/icon.js +4 -1
- package/dist/components/inheritAriaAttributes.js +76 -0
- package/dist/components/inheritAttributes.js +25 -0
- package/{components → dist/components}/popover-canvas.js +1 -1
- package/{components → dist/components}/side-menu-item.js +1 -1
- package/{components → dist/components}/tds-accordion-item.d.ts +1 -1
- package/{components → dist/components}/tds-accordion.d.ts +1 -1
- package/{components → dist/components}/tds-badge.d.ts +1 -1
- package/{components → dist/components}/tds-banner.d.ts +1 -1
- package/{components → dist/components}/tds-banner.js +2 -1
- package/{components → dist/components}/tds-block.d.ts +1 -1
- package/{components → dist/components}/tds-block.js +4 -2
- package/{components → dist/components}/tds-body-cell.d.ts +1 -1
- package/{components → dist/components}/tds-breadcrumb.d.ts +1 -1
- package/{components → dist/components}/tds-breadcrumbs.d.ts +1 -1
- package/{components → dist/components}/tds-button.d.ts +1 -1
- package/{components → dist/components}/tds-button.js +1 -1
- package/{components → dist/components}/tds-card.d.ts +1 -1
- package/{components → dist/components}/tds-card.js +3 -2
- package/{components → dist/components}/tds-checkbox.d.ts +1 -1
- package/{components → dist/components}/tds-chip.d.ts +1 -1
- package/{components → dist/components}/tds-chip.js +2 -1
- package/{components → dist/components}/tds-core-header-item.d.ts +1 -1
- package/{components → dist/components}/tds-datetime.d.ts +1 -1
- package/{components → dist/components}/tds-datetime.js +1 -1
- package/{components → dist/components}/tds-divider.d.ts +1 -1
- package/{components → dist/components}/tds-dropdown-option.d.ts +1 -1
- package/{components → dist/components}/tds-dropdown-option.js +3 -2
- package/{components → dist/components}/tds-dropdown.d.ts +1 -1
- package/dist/components/tds-dropdown.js +446 -0
- package/{components → dist/components}/tds-folder-tab.d.ts +1 -1
- package/{components → dist/components}/tds-folder-tabs.d.ts +1 -1
- package/{components → dist/components}/tds-footer-group.d.ts +1 -1
- package/{components → dist/components}/tds-footer-item.d.ts +1 -1
- package/{components → dist/components}/tds-footer.d.ts +1 -1
- package/{components → dist/components}/tds-footer.js +1 -1
- package/{components → dist/components}/tds-header-brand-symbol.d.ts +1 -1
- package/{components → dist/components}/tds-header-cell.d.ts +1 -1
- package/{components → dist/components}/tds-header-dropdown-list-item.d.ts +1 -1
- package/{components → dist/components}/tds-header-dropdown-list-user.d.ts +1 -1
- package/{components → dist/components}/tds-header-dropdown-list.d.ts +1 -1
- package/{components → dist/components}/tds-header-dropdown.d.ts +1 -1
- package/{components → dist/components}/tds-header-dropdown.js +1 -1
- package/{components → dist/components}/tds-header-hamburger.d.ts +1 -1
- package/{components → dist/components}/tds-header-hamburger.js +1 -1
- package/{components → dist/components}/tds-header-item.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-button.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-grid-item.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-grid-title.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-grid-title.js +1 -1
- package/{components → dist/components}/tds-header-launcher-grid.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-grid.js +1 -1
- package/{components → dist/components}/tds-header-launcher-list-item.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-list-title.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-list-title.js +1 -1
- package/{components → dist/components}/tds-header-launcher-list.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher-list.js +1 -1
- package/{components → dist/components}/tds-header-launcher.d.ts +1 -1
- package/{components → dist/components}/tds-header-launcher.js +2 -1
- package/{components → dist/components}/tds-header-title.d.ts +1 -1
- package/{components → dist/components}/tds-header.d.ts +1 -1
- package/{components → dist/components}/tds-header.js +16 -1
- package/{components → dist/components}/tds-icon.d.ts +1 -1
- package/{components → dist/components}/tds-inline-tab.d.ts +1 -1
- package/{components → dist/components}/tds-inline-tabs.d.ts +1 -1
- package/{components → dist/components}/tds-inline-tabs.js +0 -6
- package/{components → dist/components}/tds-link.d.ts +1 -1
- package/{components → dist/components}/tds-message.d.ts +1 -1
- package/{components → dist/components}/tds-modal.d.ts +1 -1
- package/{components → dist/components}/tds-modal.js +1 -1
- package/{components → dist/components}/tds-navigation-tab.d.ts +1 -1
- package/{components → dist/components}/tds-navigation-tabs.d.ts +1 -1
- package/{components → dist/components}/tds-navigation-tabs.js +0 -3
- package/{components → dist/components}/tds-popover-canvas.d.ts +1 -1
- package/{components → dist/components}/tds-popover-core.d.ts +1 -1
- package/{components → dist/components}/tds-popover-menu-item.d.ts +1 -1
- package/{components → dist/components}/tds-popover-menu.d.ts +1 -1
- package/{components → dist/components}/tds-popover-menu.js +1 -1
- package/{components → dist/components}/tds-radio-button.d.ts +1 -1
- package/{components → dist/components}/tds-radio-button.js +1 -1
- package/{components → dist/components}/tds-side-menu-close-button.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-close-button.js +1 -1
- package/{components → dist/components}/tds-side-menu-collapse-button.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-dropdown-list-item.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-dropdown-list.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-dropdown.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-item.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-overlay.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-user-image.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-user-label.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu-user.d.ts +1 -1
- package/{components → dist/components}/tds-side-menu.d.ts +1 -1
- package/{components → dist/components}/tds-slider.d.ts +1 -1
- package/{components → dist/components}/tds-slider.js +13 -7
- package/{components → dist/components}/tds-spinner.d.ts +1 -1
- package/{components → dist/components}/tds-step.d.ts +1 -1
- package/{components → dist/components}/tds-stepper.d.ts +1 -1
- package/{components → dist/components}/tds-stepper.js +1 -1
- package/{components → dist/components}/tds-table-body-row-expandable.d.ts +1 -1
- package/{components → dist/components}/tds-table-body-row.d.ts +1 -1
- package/{components → dist/components}/tds-table-body.d.ts +1 -1
- package/{components → dist/components}/tds-table-footer.d.ts +1 -1
- package/{components → dist/components}/tds-table-header.d.ts +1 -1
- package/{components → dist/components}/tds-table-toolbar.d.ts +1 -1
- package/{components → dist/components}/tds-table.d.ts +1 -1
- package/{components → dist/components}/tds-table.js +1 -1
- package/{components → dist/components}/tds-text-field.d.ts +1 -1
- package/{components → dist/components}/tds-text-field.js +2 -2
- package/{components → dist/components}/tds-textarea.d.ts +1 -1
- package/{components → dist/components}/tds-toast.d.ts +1 -1
- package/{components → dist/components}/tds-toast.js +2 -1
- package/{components → dist/components}/tds-toggle.d.ts +1 -1
- package/{components → dist/components}/tds-toggle.js +1 -1
- package/{components → dist/components}/tds-tooltip.d.ts +1 -1
- package/{components → dist/components}/tds-tooltip.js +1 -1
- package/dist/esm/dfs-3f5bd9e8.js +27 -0
- package/dist/esm/generateUniqueId-c96c8ee6.js +26 -0
- package/dist/esm/hasSlot-d52114d0.js +9 -0
- package/dist/esm/{index-7471aeb6.js → index-21543b0f.js} +5 -5
- package/dist/esm/inheritAriaAttributes-d4dfca6b.js +76 -0
- package/dist/esm/inheritAttributes-8bb09af0.js +25 -0
- package/dist/esm/isHeadingElement-2c158fc4.js +68 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/tds-accordion-item.entry.js +1 -1
- package/dist/esm/tds-accordion.entry.js +1 -1
- package/dist/esm/tds-badge.entry.js +1 -1
- package/dist/esm/tds-banner.entry.js +3 -2
- package/dist/esm/tds-block.entry.js +5 -3
- package/dist/esm/tds-body-cell.entry.js +1 -1
- package/dist/esm/tds-breadcrumb.entry.js +1 -1
- package/dist/esm/tds-breadcrumbs.entry.js +1 -1
- package/dist/esm/tds-button.entry.js +2 -2
- package/dist/esm/tds-card.entry.js +4 -3
- package/dist/esm/tds-checkbox.entry.js +2 -2
- package/dist/esm/tds-chip.entry.js +3 -2
- package/dist/esm/tds-core-header-item_2.entry.js +2 -2
- package/dist/esm/tds-datetime.entry.js +2 -2
- package/dist/esm/tds-divider.entry.js +1 -1
- package/dist/esm/tds-dropdown-option.entry.js +4 -3
- package/dist/esm/tds-dropdown.entry.js +182 -56
- package/dist/esm/tds-folder-tab.entry.js +1 -1
- package/dist/esm/tds-folder-tabs.entry.js +1 -1
- package/dist/esm/tds-footer-group.entry.js +1 -1
- package/dist/esm/tds-footer-item.entry.js +1 -1
- package/dist/esm/tds-footer.entry.js +2 -2
- package/dist/esm/tds-header-brand-symbol.entry.js +1 -1
- package/dist/esm/tds-header-cell.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list-user.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list.entry.js +3 -2
- package/dist/esm/tds-header-dropdown.entry.js +2 -2
- package/dist/esm/tds-header-hamburger.entry.js +3 -2
- package/dist/esm/tds-header-launcher-button.entry.js +3 -2
- package/dist/esm/tds-header-launcher-grid-item.entry.js +1 -1
- package/dist/esm/tds-header-launcher-grid-title.entry.js +2 -2
- package/dist/esm/tds-header-launcher-grid.entry.js +3 -2
- package/dist/esm/tds-header-launcher-list-item.entry.js +1 -1
- package/dist/esm/tds-header-launcher-list-title.entry.js +2 -2
- package/dist/esm/tds-header-launcher-list.entry.js +2 -2
- package/dist/esm/tds-header-launcher.entry.js +4 -2
- package/dist/esm/tds-header-title.entry.js +1 -1
- package/dist/esm/tds-header.entry.js +18 -2
- package/dist/esm/tds-icon.entry.js +4 -2
- package/dist/esm/tds-inline-tab.entry.js +1 -1
- package/dist/esm/tds-inline-tabs.entry.js +1 -7
- package/dist/esm/tds-link.entry.js +1 -1
- package/dist/esm/tds-message.entry.js +1 -1
- package/dist/esm/tds-modal.entry.js +2 -2
- package/dist/esm/tds-navigation-tab.entry.js +1 -1
- package/dist/esm/tds-navigation-tabs.entry.js +1 -4
- 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 +1 -1
- package/dist/esm/tds-popover-menu.entry.js +2 -2
- package/dist/esm/tds-radio-button.entry.js +2 -2
- package/dist/esm/tds-side-menu-close-button.entry.js +3 -2
- package/dist/esm/tds-side-menu-collapse-button.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown-list.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown.entry.js +1 -1
- package/dist/esm/tds-side-menu-item.entry.js +2 -2
- package/dist/esm/tds-side-menu-overlay.entry.js +1 -1
- package/dist/esm/tds-side-menu-user-image_2.entry.js +1 -1
- package/dist/esm/tds-side-menu-user.entry.js +1 -1
- package/dist/esm/tds-side-menu.entry.js +1 -1
- package/dist/esm/tds-slider.entry.js +14 -8
- package/dist/esm/tds-spinner.entry.js +1 -1
- package/dist/esm/tds-step.entry.js +1 -1
- package/dist/esm/tds-stepper.entry.js +2 -2
- package/dist/esm/tds-table-body-row-expandable.entry.js +1 -1
- package/dist/esm/tds-table-body-row.entry.js +1 -1
- package/dist/esm/tds-table-body.entry.js +1 -1
- package/dist/esm/tds-table-footer.entry.js +1 -1
- package/dist/esm/tds-table-header.entry.js +1 -1
- package/dist/esm/tds-table-toolbar.entry.js +1 -1
- package/dist/esm/tds-table.entry.js +2 -2
- package/dist/esm/tds-text-field.entry.js +3 -3
- package/dist/esm/tds-textarea.entry.js +1 -1
- package/dist/esm/tds-toast.entry.js +3 -2
- package/dist/esm/tds-toggle.entry.js +2 -2
- package/dist/esm/tds-tooltip.entry.js +2 -2
- package/dist/esm/tegel.js +4 -4
- package/dist/tegel/p-098a26f3.js +1 -0
- package/dist/tegel/{p-bd823881.entry.js → p-0a8ee1f9.entry.js} +1 -1
- package/dist/tegel/p-0c4fbe10.entry.js +1 -0
- package/dist/tegel/p-0edeccb6.js +1 -0
- package/dist/tegel/p-0f8f9398.entry.js +1 -0
- package/dist/tegel/p-1168e527.entry.js +1 -0
- package/dist/tegel/{p-e9b8d1d5.entry.js → p-15230250.entry.js} +1 -1
- package/dist/tegel/{p-514610b9.entry.js → p-17d0b13e.entry.js} +1 -1
- package/dist/tegel/{p-888fec9e.entry.js → p-22f15794.entry.js} +1 -1
- package/dist/tegel/{p-37b1329c.entry.js → p-235cda64.entry.js} +1 -1
- package/dist/tegel/{p-54ebce22.entry.js → p-23822382.entry.js} +1 -1
- package/dist/tegel/p-26e5d00c.entry.js +1 -0
- package/dist/tegel/p-2727d592.entry.js +1 -0
- package/dist/tegel/{p-9af2e8ab.entry.js → p-289a487d.entry.js} +1 -1
- package/dist/tegel/p-2955b397.entry.js +1 -0
- package/dist/tegel/{p-f2819741.entry.js → p-2ab8970f.entry.js} +1 -1
- package/dist/tegel/{p-5663c320.entry.js → p-30743f62.entry.js} +1 -1
- package/dist/tegel/p-3079490b.entry.js +1 -0
- package/dist/tegel/{p-446ab609.entry.js → p-30c571d4.entry.js} +1 -1
- package/dist/tegel/{p-286691df.entry.js → p-32c133ba.entry.js} +1 -1
- package/dist/tegel/p-35265b56.entry.js +1 -0
- package/dist/tegel/p-363ee512.entry.js +1 -0
- package/dist/tegel/{p-0d573de8.entry.js → p-3ad7d61d.entry.js} +1 -1
- package/dist/tegel/{p-d8215514.entry.js → p-3b39140f.entry.js} +1 -1
- package/dist/tegel/{p-0eac159c.entry.js → p-3cd5821f.entry.js} +1 -1
- package/dist/tegel/{p-073cf6c0.entry.js → p-44a3b63b.entry.js} +1 -1
- package/dist/tegel/p-4a02a38f.entry.js +1 -0
- package/dist/tegel/{p-824f5dad.entry.js → p-4af50429.entry.js} +1 -1
- package/dist/tegel/{p-62732059.entry.js → p-4bca96e5.entry.js} +1 -1
- package/dist/tegel/p-4df1ed46.entry.js +1 -0
- package/dist/tegel/{p-166d6252.entry.js → p-50ea7ad8.entry.js} +1 -1
- package/dist/tegel/{p-0d886890.entry.js → p-52719efc.entry.js} +1 -1
- package/dist/tegel/{p-d1be74e7.entry.js → p-555e1263.entry.js} +1 -1
- package/dist/tegel/p-57156832.entry.js +1 -0
- package/dist/tegel/{p-f6ff8d7e.entry.js → p-595c3a77.entry.js} +1 -1
- package/dist/tegel/{p-2782cab8.entry.js → p-5a6efad0.entry.js} +1 -1
- package/dist/tegel/{p-fc88f7ba.entry.js → p-5b9115c3.entry.js} +1 -1
- package/dist/tegel/{p-8b634b36.entry.js → p-72bbf0af.entry.js} +1 -1
- package/dist/tegel/{p-d289a792.entry.js → p-74644ab7.entry.js} +1 -1
- package/dist/tegel/{p-94c27eb3.entry.js → p-762357bb.entry.js} +1 -1
- package/dist/tegel/{p-cbb227b3.entry.js → p-7b0dabcb.entry.js} +1 -1
- package/dist/tegel/p-7e0ec688.entry.js +1 -0
- package/dist/tegel/p-81039661.js +1 -0
- package/dist/tegel/p-86f542a6.js +1 -0
- package/dist/tegel/{p-a72409fc.entry.js → p-8ad9d997.entry.js} +1 -1
- package/dist/tegel/{p-f712146b.entry.js → p-90597e3c.entry.js} +1 -1
- package/dist/tegel/{p-2efaac74.entry.js → p-931a6b29.entry.js} +1 -1
- package/dist/tegel/{p-5b58d6c9.entry.js → p-950ad7d7.entry.js} +1 -1
- package/dist/tegel/{p-495d2b37.entry.js → p-970da069.entry.js} +1 -1
- package/dist/tegel/{p-26757a32.entry.js → p-9920be66.entry.js} +1 -1
- package/dist/tegel/{p-c1ed83c6.entry.js → p-9bc33f53.entry.js} +1 -1
- package/dist/tegel/{p-364654b5.entry.js → p-a0a1840f.entry.js} +1 -1
- package/dist/tegel/{p-026a3e05.entry.js → p-a3123355.entry.js} +1 -1
- package/dist/tegel/{p-d1289eb3.entry.js → p-a3440291.entry.js} +1 -1
- package/dist/tegel/{p-ae2c6537.entry.js → p-a7a12627.entry.js} +1 -1
- package/dist/tegel/{p-7bbae944.entry.js → p-a9df694d.entry.js} +1 -1
- package/dist/tegel/{p-9c6e8abb.entry.js → p-ac253317.entry.js} +1 -1
- package/dist/tegel/{p-38c68fac.entry.js → p-ac8585f9.entry.js} +1 -1
- package/dist/tegel/{p-301110a1.entry.js → p-adca7314.entry.js} +1 -1
- package/dist/tegel/p-adf21f07.entry.js +1 -0
- package/dist/tegel/p-ae110fc2.js +1 -0
- package/dist/tegel/{p-b0a5cef2.entry.js → p-b1e3feda.entry.js} +1 -1
- package/dist/tegel/{p-62154528.entry.js → p-c1b19d10.entry.js} +1 -1
- package/dist/tegel/{p-045e99f2.entry.js → p-c46dad72.entry.js} +1 -1
- package/dist/tegel/{p-77282750.entry.js → p-cb3ba5d0.entry.js} +1 -1
- package/dist/tegel/p-cc0ea750.entry.js +1 -0
- package/dist/tegel/p-cc2a998f.entry.js +1 -0
- package/dist/tegel/p-cc771b46.entry.js +1 -0
- package/dist/tegel/{p-386c3c42.entry.js → p-d98cf434.entry.js} +1 -1
- package/dist/tegel/{p-acabb656.entry.js → p-da386849.entry.js} +1 -1
- package/dist/tegel/p-df2c8c5b.entry.js +1 -0
- package/dist/tegel/{p-dfeaa580.entry.js → p-df7f3773.entry.js} +1 -1
- package/dist/tegel/{p-78a367c0.entry.js → p-e122947b.entry.js} +1 -1
- package/dist/tegel/p-e179315a.entry.js +1 -0
- package/dist/tegel/p-e74f77c4.entry.js +1 -0
- package/dist/tegel/{p-34e75630.entry.js → p-edc8b0b0.entry.js} +1 -1
- package/dist/tegel/p-effd0764.entry.js +1 -0
- package/dist/tegel/{p-c9c5b832.entry.js → p-f375707c.entry.js} +1 -1
- package/dist/tegel/{p-ef96df10.entry.js → p-f6ca4367.entry.js} +1 -1
- package/dist/tegel/p-f71c9fe3.entry.js +1 -0
- package/dist/tegel/p-f7ce52e9.js +1 -0
- package/dist/tegel/{p-974ee937.entry.js → p-f84d4394.entry.js} +1 -1
- package/dist/tegel/{p-eeedd806.entry.js → p-f9c37154.entry.js} +1 -1
- package/dist/tegel/p-ff07dea0.entry.js +1 -0
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/block/block.d.ts +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +29 -11
- package/dist/types/components/icon/icon.d.ts +2 -0
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +1 -1
- package/dist/types/components/popover-menu/popover-menu.d.ts +1 -1
- package/dist/types/components/slider/slider.d.ts +1 -1
- package/dist/types/components/table/table-component-filtering.stories.d.ts +0 -8
- package/dist/types/components/table/table-component-multiselect.stories.d.ts +0 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components.d.ts +11 -2
- package/dist/types/stencil-public-runtime.d.ts +3 -3
- package/dist/types/stories/formatHtmlPreview.d.ts +2 -0
- package/dist/types/stories/foundations/color/color-semantic.stories.d.ts +1 -1
- package/dist/types/types/Attributes.d.ts +3 -0
- package/dist/types/utils/appendHiddenInput.d.ts +15 -0
- package/dist/types/utils/dfs.d.ts +10 -0
- package/dist/types/utils/findNextFocusableElement.d.ts +7 -0
- package/dist/types/utils/findPreviousFocusableElement.d.ts +8 -0
- package/dist/types/utils/generateUniqueId.d.ts +15 -0
- package/dist/types/utils/getNestedChildOfSiblingsMatching.d.ts +2 -0
- package/dist/types/utils/getNextNestedChildOfSiblingsMatching.d.ts +30 -0
- package/dist/types/utils/getNextSibling.d.ts +2 -0
- package/dist/types/utils/getPreviousNestedChildOfSiblingsMatching.d.ts +30 -0
- package/dist/types/utils/getPreviousSibling.d.ts +2 -0
- package/dist/types/utils/hasSlot.d.ts +8 -0
- package/dist/types/utils/inheritAriaAttributes.d.ts +9 -0
- package/dist/types/utils/inheritAttributes.d.ts +13 -0
- package/dist/types/utils/isHeadingElement.d.ts +8 -0
- package/dist/types/utils/updateListChildrenRoles.d.ts +6 -0
- package/package.json +3 -3
- package/components/tds-dropdown.js +0 -319
- package/components/utils.js +0 -489
- package/dist/cjs/utils-23ce2e45.js +0 -501
- package/dist/collection/utils/utils.js +0 -369
- package/dist/collection/utils/utils.spec.js +0 -15
- package/dist/esm/utils-4d967376.js +0 -489
- package/dist/tegel/p-1af982bc.entry.js +0 -1
- package/dist/tegel/p-24fc848d.entry.js +0 -1
- package/dist/tegel/p-271d0081.entry.js +0 -1
- package/dist/tegel/p-3c5acada.entry.js +0 -1
- package/dist/tegel/p-461e81bd.entry.js +0 -1
- package/dist/tegel/p-4e676ba1.entry.js +0 -1
- package/dist/tegel/p-52b727a7.entry.js +0 -1
- package/dist/tegel/p-5e6318d2.entry.js +0 -1
- package/dist/tegel/p-67fa6245.entry.js +0 -1
- package/dist/tegel/p-6e1c6b71.entry.js +0 -1
- package/dist/tegel/p-7125dad7.entry.js +0 -1
- package/dist/tegel/p-8a502e4f.entry.js +0 -1
- package/dist/tegel/p-8a6dac22.entry.js +0 -1
- package/dist/tegel/p-8faaaaf3.entry.js +0 -1
- package/dist/tegel/p-8fea52fe.js +0 -43
- package/dist/tegel/p-98d31b74.entry.js +0 -1
- package/dist/tegel/p-aeff41d5.entry.js +0 -1
- package/dist/tegel/p-c65429b4.entry.js +0 -1
- package/dist/tegel/p-ca8b8a16.entry.js +0 -1
- package/dist/tegel/p-d4aa3315.entry.js +0 -1
- package/dist/tegel/p-d852143b.entry.js +0 -1
- package/dist/tegel/p-e9ae12d7.entry.js +0 -1
- package/dist/tegel/p-ec6afc7b.entry.js +0 -1
- package/dist/tegel/p-f147d270.entry.js +0 -1
- package/dist/types/utils/utils.d.ts +0 -164
- /package/{components → dist/components}/core-header-item.js +0 -0
- /package/{components → dist/components}/divider.js +0 -0
- /package/{components → dist/components}/header-dropdown-list-item.js +0 -0
- /package/{components → dist/components}/index.d.ts +0 -0
- /package/{components → dist/components}/index.js +0 -0
- /package/{components → dist/components}/popover-core.js +0 -0
- /package/{components → dist/components}/side-menu-user-image.js +0 -0
- /package/{components → dist/components}/side-menu-user-label.js +0 -0
- /package/{components → dist/components}/tds-accordion-item.js +0 -0
- /package/{components → dist/components}/tds-accordion.js +0 -0
- /package/{components → dist/components}/tds-badge.js +0 -0
- /package/{components → dist/components}/tds-body-cell.js +0 -0
- /package/{components → dist/components}/tds-breadcrumb.js +0 -0
- /package/{components → dist/components}/tds-breadcrumbs.js +0 -0
- /package/{components → dist/components}/tds-checkbox.js +0 -0
- /package/{components → dist/components}/tds-core-header-item.js +0 -0
- /package/{components → dist/components}/tds-divider.js +0 -0
- /package/{components → dist/components}/tds-folder-tab.js +0 -0
- /package/{components → dist/components}/tds-folder-tabs.js +0 -0
- /package/{components → dist/components}/tds-footer-group.js +0 -0
- /package/{components → dist/components}/tds-footer-item.js +0 -0
- /package/{components → dist/components}/tds-header-brand-symbol.js +0 -0
- /package/{components → dist/components}/tds-header-cell.js +0 -0
- /package/{components → dist/components}/tds-header-dropdown-list-item.js +0 -0
- /package/{components → dist/components}/tds-header-dropdown-list-user.js +0 -0
- /package/{components → dist/components}/tds-header-dropdown-list.js +0 -0
- /package/{components → dist/components}/tds-header-item.js +0 -0
- /package/{components → dist/components}/tds-header-launcher-button.js +0 -0
- /package/{components → dist/components}/tds-header-launcher-grid-item.js +0 -0
- /package/{components → dist/components}/tds-header-launcher-list-item.js +0 -0
- /package/{components → dist/components}/tds-header-title.js +0 -0
- /package/{components → dist/components}/tds-icon.js +0 -0
- /package/{components → dist/components}/tds-inline-tab.js +0 -0
- /package/{components → dist/components}/tds-link.js +0 -0
- /package/{components → dist/components}/tds-message.js +0 -0
- /package/{components → dist/components}/tds-navigation-tab.js +0 -0
- /package/{components → dist/components}/tds-popover-canvas.js +0 -0
- /package/{components → dist/components}/tds-popover-core.js +0 -0
- /package/{components → dist/components}/tds-popover-menu-item.js +0 -0
- /package/{components → dist/components}/tds-side-menu-collapse-button.js +0 -0
- /package/{components → dist/components}/tds-side-menu-dropdown-list-item.js +0 -0
- /package/{components → dist/components}/tds-side-menu-dropdown-list.js +0 -0
- /package/{components → dist/components}/tds-side-menu-dropdown.js +0 -0
- /package/{components → dist/components}/tds-side-menu-item.js +0 -0
- /package/{components → dist/components}/tds-side-menu-overlay.js +0 -0
- /package/{components → dist/components}/tds-side-menu-user-image.js +0 -0
- /package/{components → dist/components}/tds-side-menu-user-label.js +0 -0
- /package/{components → dist/components}/tds-side-menu-user.js +0 -0
- /package/{components → dist/components}/tds-side-menu.js +0 -0
- /package/{components → dist/components}/tds-spinner.js +0 -0
- /package/{components → dist/components}/tds-step.js +0 -0
- /package/{components → dist/components}/tds-table-body-row-expandable.js +0 -0
- /package/{components → dist/components}/tds-table-body-row.js +0 -0
- /package/{components → dist/components}/tds-table-body.js +0 -0
- /package/{components → dist/components}/tds-table-footer.js +0 -0
- /package/{components → dist/components}/tds-table-header.js +0 -0
- /package/{components → dist/components}/tds-table-toolbar.js +0 -0
- /package/{components → dist/components}/tds-textarea.js +0 -0
- /package/dist/tegel/{p-43fe6507.js → p-31561847.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** reference: https://github.com/ionic-team/ionic-framework/blob/main/core/src/utils/helpers.ts#L346
|
|
2
|
+
*
|
|
3
|
+
* Appends a hidden input element to allow the component
|
|
4
|
+
* work within and get picked up by a <form>.
|
|
5
|
+
* @param element The element on which the input with be appended.
|
|
6
|
+
* @param name Name of the input.
|
|
7
|
+
* @param value The value of the input.
|
|
8
|
+
* @param disabled Disables the input if true.
|
|
9
|
+
* @param additionalAttributes Additional attributes that should be passed to the input.
|
|
10
|
+
*/
|
|
11
|
+
const appendHiddenInput = (element, name, value, disabled, additionalAttributes) => {
|
|
12
|
+
let input = element.querySelector('input');
|
|
13
|
+
if (!element.querySelector('input')) {
|
|
14
|
+
input = element.ownerDocument.createElement('input');
|
|
15
|
+
input.type = 'hidden';
|
|
16
|
+
if (additionalAttributes) {
|
|
17
|
+
additionalAttributes.forEach((attr) => input.setAttribute(attr.key, attr.value));
|
|
18
|
+
}
|
|
19
|
+
element.appendChild(input);
|
|
20
|
+
}
|
|
21
|
+
input.disabled = disabled;
|
|
22
|
+
input.name = name;
|
|
23
|
+
input.value = value || '';
|
|
24
|
+
};
|
|
25
|
+
export default appendHiddenInput;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively finds the first matching element or child based on a provided condition.
|
|
3
|
+
*
|
|
4
|
+
* @param {ParentNode} parentNode - The starting element or shadow root to search from.
|
|
5
|
+
* @param {(el: HTMLElement) => boolean} searchPredicate - The condition to match the element, receives an HTMLElement and returns a boolean.
|
|
6
|
+
* @param {boolean} [pierceShadow=false] - Whether to pierce through shadow DOM boundaries.
|
|
7
|
+
* @returns {HTMLElement | null} - The first matching element or child, or null if none is found.
|
|
8
|
+
*/
|
|
9
|
+
function dfs(parentNode, searchPredicate, pierceShadow = false) {
|
|
10
|
+
if (parentNode instanceof HTMLElement && searchPredicate(parentNode)) {
|
|
11
|
+
return parentNode;
|
|
12
|
+
}
|
|
13
|
+
const childElements = parentNode instanceof HTMLSlotElement
|
|
14
|
+
? parentNode.assignedElements({ flatten: true })
|
|
15
|
+
: Array.from(parentNode.children);
|
|
16
|
+
if (pierceShadow && parentNode instanceof HTMLElement && parentNode.shadowRoot) {
|
|
17
|
+
childElements.push(...Array.from(parentNode.shadowRoot.children));
|
|
18
|
+
}
|
|
19
|
+
let foundElement = null;
|
|
20
|
+
childElements.some((child) => {
|
|
21
|
+
foundElement = dfs(child, searchPredicate, pierceShadow);
|
|
22
|
+
return foundElement !== null;
|
|
23
|
+
});
|
|
24
|
+
return foundElement;
|
|
25
|
+
}
|
|
26
|
+
export default dfs;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the next focusable element index in a list of focusable elements.
|
|
3
|
+
* @param items List of focusable elements, element with a attribute of disabled that is true will be skipped over.
|
|
4
|
+
* @param nextItemIndex The index in the list to start the search on.
|
|
5
|
+
*/
|
|
6
|
+
const findNextFocusableElement = (items, nextItemIndex) => {
|
|
7
|
+
if (items[nextItemIndex] === undefined) {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
for (let index = nextItemIndex; index < items.length; index++) {
|
|
11
|
+
if (!items[index].disabled) {
|
|
12
|
+
return index;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export default findNextFocusableElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the previous focusable element index in a list of focusable elements.
|
|
3
|
+
*
|
|
4
|
+
* @param items List of focusable elements, element with a attribute of disabled that is true will be skipped over.
|
|
5
|
+
* @param nextItemIndex The index in the list to start the search on.
|
|
6
|
+
*/
|
|
7
|
+
const findPreviousFocusableElement = (items, previousItemIndex) => {
|
|
8
|
+
if (items[previousItemIndex] === undefined) {
|
|
9
|
+
return items.length - 1;
|
|
10
|
+
}
|
|
11
|
+
for (let index = previousItemIndex; index >= 0; index--) {
|
|
12
|
+
if (!items[index].disabled) {
|
|
13
|
+
return index;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export default findPreviousFocusableElement;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a reasonably unique string ID based on current time (minutes, seconds, milliseconds) and random numbers.
|
|
3
|
+
*
|
|
4
|
+
* This function combines the current time and random numbers to generate
|
|
5
|
+
* a unique string ID. The function assumes that it won't be called frequently
|
|
6
|
+
* enough to generate two identical IDs within a millisecond, or that the random
|
|
7
|
+
* number generator will produce the same value twice in quick succession.
|
|
8
|
+
*
|
|
9
|
+
* Note: The IDs generated by this function are not globally unique and their length may vary.
|
|
10
|
+
* For truly unique and fixed-length IDs, consider using a more robust method such as UUID.
|
|
11
|
+
*
|
|
12
|
+
* @returns {string} A unique string ID.
|
|
13
|
+
*/
|
|
14
|
+
function generateUniqueId() {
|
|
15
|
+
const now = new Date();
|
|
16
|
+
const timeInMilliseconds = now.getMinutes() * 60000 + now.getSeconds() * 1000 + now.getMilliseconds(); // Get current time in milliseconds from the start of the hour
|
|
17
|
+
const randomNum1 = Math.floor(Math.random() * 1000000); // Random number between 0 and 999999
|
|
18
|
+
const randomNum2 = Math.floor(Math.random() * 1000000); // Another random number
|
|
19
|
+
// Convert to base 36 (using numbers and letters) and remove '0.' from the random number
|
|
20
|
+
const uniqueString = randomNum1.toString(36).substring(2) +
|
|
21
|
+
timeInMilliseconds.toString(36) +
|
|
22
|
+
randomNum2.toString(36).substring(2);
|
|
23
|
+
return uniqueString;
|
|
24
|
+
}
|
|
25
|
+
export default generateUniqueId;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// A higher-order function to find the nested child of siblings matching a predicate,
|
|
2
|
+
import dfs from "./dfs";
|
|
3
|
+
// based on a sibling traversal function (getNextSibling or getPreviousSibling).
|
|
4
|
+
function getNestedChildOfSiblingsMatching(element, searchPredicate, siblingTraversalFn) {
|
|
5
|
+
// Start with the sibling of the provided element.
|
|
6
|
+
let sibling = siblingTraversalFn(element);
|
|
7
|
+
// Iterate through the siblings until there are no more siblings.
|
|
8
|
+
while (sibling) {
|
|
9
|
+
// Use the dfs helper function to find the deeply nested child
|
|
10
|
+
// that matches the given criteria within the current sibling.
|
|
11
|
+
const nestedChild = dfs(sibling, searchPredicate);
|
|
12
|
+
// If a matching deeply nested child is found, return it.
|
|
13
|
+
if (nestedChild) {
|
|
14
|
+
return nestedChild;
|
|
15
|
+
}
|
|
16
|
+
// Move on to the next sibling.
|
|
17
|
+
sibling = siblingTraversalFn(sibling);
|
|
18
|
+
}
|
|
19
|
+
// If no matching deeply nested child is found, return null.
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
export default getNestedChildOfSiblingsMatching;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import getNestedChildOfSiblingsMatching from "./getNestedChildOfSiblingsMatching";
|
|
2
|
+
import getNextSibling from "./getNextSibling";
|
|
3
|
+
/**
|
|
4
|
+
* Searches for a next sibling element that has a nested child element matching the provided search predicate.
|
|
5
|
+
* The search starts from the given element and proceeds to its next siblings, diving deep into each sibling's descendants.
|
|
6
|
+
*
|
|
7
|
+
* @param {HTMLElement} element - The starting element to begin the search from.
|
|
8
|
+
* @param {(el: HTMLElement) => boolean} searchPredicate - A predicate function that checks if an element matches the desired condition.
|
|
9
|
+
* @returns {HTMLElement | null} - The matching nested child element, or null if no matching element is found.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // HTML structure:
|
|
13
|
+
* // <div>
|
|
14
|
+
* // <h1>Heading 1</h1>
|
|
15
|
+
* // <ul role="list">
|
|
16
|
+
* // <li>Item 1</li>
|
|
17
|
+
* // </ul>
|
|
18
|
+
* // </div>
|
|
19
|
+
* // <div>
|
|
20
|
+
* // <h2>Heading 2</h2>
|
|
21
|
+
* // <ul role="list">
|
|
22
|
+
* // <li>Item 2</li>
|
|
23
|
+
* // </ul>
|
|
24
|
+
* // </div>
|
|
25
|
+
*
|
|
26
|
+
* const searchPredicate = (el) => el.tagName.toLowerCase() === 'h2';
|
|
27
|
+
* const startingElement = document.querySelector('[role="list"]');
|
|
28
|
+
* const headingEl = getNextNestedChildOfSiblingsMatching(startingElement, searchPredicate);
|
|
29
|
+
* console.log(headingEl); // Logs the <h2>Heading 2</h2> element
|
|
30
|
+
*/
|
|
31
|
+
const getNextNestedChildOfSiblingsMatching = (element, searchPredicate) => getNestedChildOfSiblingsMatching(element, searchPredicate, getNextSibling);
|
|
32
|
+
export default getNextNestedChildOfSiblingsMatching;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import getNestedChildOfSiblingsMatching from "./getNestedChildOfSiblingsMatching";
|
|
2
|
+
import getPreviousSibling from "./getPreviousSibling";
|
|
3
|
+
/**
|
|
4
|
+
* Searches for a previous sibling element that has a nested child element matching the provided search predicate.
|
|
5
|
+
* The search starts from the given element and proceeds to its previous siblings, diving deep into each sibling's descendants.
|
|
6
|
+
*
|
|
7
|
+
* @param {HTMLElement} element - The starting element to begin the search from.
|
|
8
|
+
* @param {(el: HTMLElement) => boolean} searchPredicate - A predicate function that checks if an element matches the desired condition.
|
|
9
|
+
* @returns {HTMLElement | null} - The matching nested child element, or null if no matching element is found.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // HTML structure:
|
|
13
|
+
* // <div>
|
|
14
|
+
* // <h1>Heading 1</h1>
|
|
15
|
+
* // <ul role="list">
|
|
16
|
+
* // <li>Item 1</li>
|
|
17
|
+
* // </ul>
|
|
18
|
+
* // </div>
|
|
19
|
+
* // <div>
|
|
20
|
+
* // <h2>Heading 2</h2>
|
|
21
|
+
* // <ul role="list">
|
|
22
|
+
* // <li>Item 2</li>
|
|
23
|
+
* // </ul>
|
|
24
|
+
* // </div>
|
|
25
|
+
*
|
|
26
|
+
* const searchPredicate = (el) => el.tagName.toLowerCase() === 'h2';
|
|
27
|
+
* const startingElement = document.querySelector('[role="list"]');
|
|
28
|
+
* const headingEl = getPreviousNestedChildOfSiblingsMatching(startingElement, searchPredicate);
|
|
29
|
+
* console.log(headingEl); // Logs the <h2>Heading 2</h2> element
|
|
30
|
+
*/
|
|
31
|
+
const getPreviousNestedChildOfSiblingsMatching = (element, searchPredicate) => getNestedChildOfSiblingsMatching(element, searchPredicate, getPreviousSibling);
|
|
32
|
+
export default getPreviousNestedChildOfSiblingsMatching;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the provided element has a slotted element
|
|
3
|
+
* in the slot with the corresponding slotName
|
|
4
|
+
* @param slotName the name of the slot.
|
|
5
|
+
* @param element the element to look for the slot within.
|
|
6
|
+
*/
|
|
7
|
+
const hasSlot = (slotName, element) => !!element.querySelector(`[slot="${slotName}"]`);
|
|
8
|
+
export default hasSlot;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import inheritAttributes from "./inheritAttributes";
|
|
2
|
+
/**
|
|
3
|
+
* List of available ARIA attributes + `role`.
|
|
4
|
+
* Removed deprecated attributes.
|
|
5
|
+
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
|
|
6
|
+
*/
|
|
7
|
+
const ariaAttributes = [
|
|
8
|
+
'role',
|
|
9
|
+
'aria-activedescendant',
|
|
10
|
+
'aria-atomic',
|
|
11
|
+
'aria-autocomplete',
|
|
12
|
+
'aria-braillelabel',
|
|
13
|
+
'aria-brailleroledescription',
|
|
14
|
+
'aria-busy',
|
|
15
|
+
'aria-checked',
|
|
16
|
+
'aria-colcount',
|
|
17
|
+
'aria-colindex',
|
|
18
|
+
'aria-colindextext',
|
|
19
|
+
'aria-colspan',
|
|
20
|
+
'aria-controls',
|
|
21
|
+
'aria-current',
|
|
22
|
+
'aria-describedby',
|
|
23
|
+
'aria-description',
|
|
24
|
+
'aria-details',
|
|
25
|
+
'aria-disabled',
|
|
26
|
+
'aria-errormessage',
|
|
27
|
+
'aria-expanded',
|
|
28
|
+
'aria-flowto',
|
|
29
|
+
'aria-haspopup',
|
|
30
|
+
'aria-hidden',
|
|
31
|
+
'aria-invalid',
|
|
32
|
+
'aria-keyshortcuts',
|
|
33
|
+
'aria-label',
|
|
34
|
+
'aria-labelledby',
|
|
35
|
+
'aria-level',
|
|
36
|
+
'aria-live',
|
|
37
|
+
'aria-multiline',
|
|
38
|
+
'aria-multiselectable',
|
|
39
|
+
'aria-orientation',
|
|
40
|
+
'aria-owns',
|
|
41
|
+
'aria-placeholder',
|
|
42
|
+
'aria-posinset',
|
|
43
|
+
'aria-pressed',
|
|
44
|
+
'aria-readonly',
|
|
45
|
+
'aria-relevant',
|
|
46
|
+
'aria-required',
|
|
47
|
+
'aria-roledescription',
|
|
48
|
+
'aria-rowcount',
|
|
49
|
+
'aria-rowindex',
|
|
50
|
+
'aria-rowindextext',
|
|
51
|
+
'aria-rowspan',
|
|
52
|
+
'aria-selected',
|
|
53
|
+
'aria-setsize',
|
|
54
|
+
'aria-sort',
|
|
55
|
+
'aria-valuemax',
|
|
56
|
+
'aria-valuemin',
|
|
57
|
+
'aria-valuenow',
|
|
58
|
+
'aria-valuetext',
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* Returns an array of aria attributes that should be copied from
|
|
62
|
+
* the shadow host element to a target within the light DOM.
|
|
63
|
+
* @param el The element that the attributes should be copied from.
|
|
64
|
+
* @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.
|
|
65
|
+
* Use this in instances where we manually specify aria attributes on the `<Host>` element.
|
|
66
|
+
*/
|
|
67
|
+
const inheritAriaAttributes = (el, ignoreList) => {
|
|
68
|
+
let attributesToInherit = ariaAttributes;
|
|
69
|
+
if (ignoreList && ignoreList.length > 0) {
|
|
70
|
+
attributesToInherit = attributesToInherit.filter((attr) => !ignoreList.includes(attr));
|
|
71
|
+
}
|
|
72
|
+
return inheritAttributes(el, attributesToInherit);
|
|
73
|
+
};
|
|
74
|
+
export default inheritAriaAttributes;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elements inside of web components sometimes need to inherit global attributes
|
|
3
|
+
* set on the host. For example, the inner input in `ion-input` should inherit
|
|
4
|
+
* the `title` attribute that developers set directly on `ion-input`. This
|
|
5
|
+
* helper function should be called in componentWillLoad and assigned to a variable
|
|
6
|
+
* that is later used in the render function.
|
|
7
|
+
*
|
|
8
|
+
* This does not need to be reactive as changing attributes on the host element
|
|
9
|
+
* does not trigger a re-render.
|
|
10
|
+
*/
|
|
11
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
12
|
+
const attributeObject = {};
|
|
13
|
+
attributes.forEach((attr) => {
|
|
14
|
+
if (el.hasAttribute(attr)) {
|
|
15
|
+
const value = el.getAttribute(attr);
|
|
16
|
+
if (value !== null) {
|
|
17
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
18
|
+
}
|
|
19
|
+
el.removeAttribute(attr);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return attributeObject;
|
|
23
|
+
};
|
|
24
|
+
export default inheritAttributes;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given element is a heading element (h1-h6) or has a role of "heading".
|
|
3
|
+
*
|
|
4
|
+
* @param {HTMLElement} el - The element to check.
|
|
5
|
+
* @returns {boolean} - True if the element is a heading element, false otherwise.
|
|
6
|
+
*/
|
|
7
|
+
const isHeadingElement = (el) => {
|
|
8
|
+
const tagName = el.tagName.toLowerCase();
|
|
9
|
+
const role = el.getAttribute('role');
|
|
10
|
+
return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tagName) || role === 'heading';
|
|
11
|
+
};
|
|
12
|
+
export default isHeadingElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loop through the children and add the 'listitem' role if needed.
|
|
3
|
+
* @param {Node} targetNode The node being updated.
|
|
4
|
+
* */
|
|
5
|
+
const updateListChildrenRoles = (targetNode) => {
|
|
6
|
+
targetNode.childNodes.forEach((node) => {
|
|
7
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
8
|
+
const element = node;
|
|
9
|
+
if (element.tagName.toLowerCase() !== 'li' && element.getAttribute('role') !== 'listitem') {
|
|
10
|
+
element.setAttribute('role', 'listitem');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export default updateListChildrenRoles;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { g as generateUniqueId } from './
|
|
2
|
+
import { g as generateUniqueId } from './generateUniqueId.js';
|
|
3
3
|
|
|
4
4
|
const checkboxCss = ".sc-tds-checkbox-h{align-items:center;position:relative;box-sizing:border-box}.tds-checkbox.sc-tds-checkbox{box-sizing:border-box;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-checkbox-text);display:flex;align-items:center;margin-left:-4px}.tds-checkbox.sc-tds-checkbox *.sc-tds-checkbox{box-sizing:border-box}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox{appearance:none;outline:none;margin:0;border:0;border-radius:2px;width:24px;height:24px;position:relative;cursor:pointer;flex-shrink:0;align-self:flex-start}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox+label.sc-tds-checkbox{color:var(--tds-checkbox-color);padding-left:var(--tds-spacing-element-4);padding-top:var(--tds-spacing-element-4);padding-bottom:var(--tds-spacing-element-4);cursor:pointer;display:flex;align-items:center}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox+label.sc-tds-checkbox::before{content:\"\";position:absolute;width:100%;height:100%;left:0;top:0}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox::before,.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox::after{content:\"\";position:absolute;box-sizing:border-box}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox::before{width:24px;height:24px;left:0;top:0;border-radius:4px}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox::after{border:1px solid var(--tds-checkbox-interaction-01);background-color:var(--tds-checkbox-interaction-02);width:16px;height:16px;left:4px;top:4px;border-radius:2px}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:hover::before{background-color:var(--tds-checkbox-background-hover);opacity:var(--tds-checkbox-background-opacity-hover)}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:focus::before{background-color:var(--tds-checkbox-background-focus);opacity:var(--tds-checkbox-background-opacity-focus);transition:opacity 0.2s ease-in-out}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:disabled,.tds-checkbox.sc-tds-checkbox input[type=checkbox].disabled.sc-tds-checkbox{cursor:not-allowed}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:disabled::after,.tds-checkbox.sc-tds-checkbox input[type=checkbox].disabled.sc-tds-checkbox::after{border-color:var(--tds-checkbox-border-color-disabled-after)}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:disabled+label.sc-tds-checkbox,.tds-checkbox.sc-tds-checkbox input[type=checkbox].disabled.sc-tds-checkbox+label.sc-tds-checkbox{color:var(--tds-grey-600);cursor:not-allowed}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:disabled:hover::before,.tds-checkbox.sc-tds-checkbox input[type=checkbox].disabled.sc-tds-checkbox:hover::before{display:none}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked::after{background-image:var(--tds-checkbox-background-img);background-color:var(--tds-checkbox-interaction-01);background-repeat:no-repeat;background-position:center}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked:hover::before{background-color:var(--tds-checkbox-background-hover);opacity:var(--tds-checkbox-background-opacity-hover)}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked:disabled:hover::before,.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked:disabled::before,.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked.disabled:hover::before,.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked.disabled::before{display:block;width:16px;height:16px;left:4px;top:4px;border:1px solid #b0b7c4}.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked:disabled::after,.tds-checkbox.sc-tds-checkbox input[type=checkbox].sc-tds-checkbox:checked.disabled::after{background-image:var(--tds-checkbox-background-img-disabled);background-color:var(--tds-checkbox-interaction-02);color:var(--tds-checkbox-color-disabled-after)}";
|
|
5
5
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively finds the first matching element or child based on a provided condition.
|
|
3
|
+
*
|
|
4
|
+
* @param {ParentNode} parentNode - The starting element or shadow root to search from.
|
|
5
|
+
* @param {(el: HTMLElement) => boolean} searchPredicate - The condition to match the element, receives an HTMLElement and returns a boolean.
|
|
6
|
+
* @param {boolean} [pierceShadow=false] - Whether to pierce through shadow DOM boundaries.
|
|
7
|
+
* @returns {HTMLElement | null} - The first matching element or child, or null if none is found.
|
|
8
|
+
*/
|
|
9
|
+
function dfs(parentNode, searchPredicate, pierceShadow = false) {
|
|
10
|
+
if (parentNode instanceof HTMLElement && searchPredicate(parentNode)) {
|
|
11
|
+
return parentNode;
|
|
12
|
+
}
|
|
13
|
+
const childElements = parentNode instanceof HTMLSlotElement
|
|
14
|
+
? parentNode.assignedElements({ flatten: true })
|
|
15
|
+
: Array.from(parentNode.children);
|
|
16
|
+
if (pierceShadow && parentNode instanceof HTMLElement && parentNode.shadowRoot) {
|
|
17
|
+
childElements.push(...Array.from(parentNode.shadowRoot.children));
|
|
18
|
+
}
|
|
19
|
+
let foundElement = null;
|
|
20
|
+
childElements.some((child) => {
|
|
21
|
+
foundElement = dfs(child, searchPredicate, pierceShadow);
|
|
22
|
+
return foundElement !== null;
|
|
23
|
+
});
|
|
24
|
+
return foundElement;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { dfs as d };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a reasonably unique string ID based on current time (minutes, seconds, milliseconds) and random numbers.
|
|
3
|
+
*
|
|
4
|
+
* This function combines the current time and random numbers to generate
|
|
5
|
+
* a unique string ID. The function assumes that it won't be called frequently
|
|
6
|
+
* enough to generate two identical IDs within a millisecond, or that the random
|
|
7
|
+
* number generator will produce the same value twice in quick succession.
|
|
8
|
+
*
|
|
9
|
+
* Note: The IDs generated by this function are not globally unique and their length may vary.
|
|
10
|
+
* For truly unique and fixed-length IDs, consider using a more robust method such as UUID.
|
|
11
|
+
*
|
|
12
|
+
* @returns {string} A unique string ID.
|
|
13
|
+
*/
|
|
14
|
+
function generateUniqueId() {
|
|
15
|
+
const now = new Date();
|
|
16
|
+
const timeInMilliseconds = now.getMinutes() * 60000 + now.getSeconds() * 1000 + now.getMilliseconds(); // Get current time in milliseconds from the start of the hour
|
|
17
|
+
const randomNum1 = Math.floor(Math.random() * 1000000); // Random number between 0 and 999999
|
|
18
|
+
const randomNum2 = Math.floor(Math.random() * 1000000); // Another random number
|
|
19
|
+
// Convert to base 36 (using numbers and letters) and remove '0.' from the random number
|
|
20
|
+
const uniqueString = randomNum1.toString(36).substring(2) +
|
|
21
|
+
timeInMilliseconds.toString(36) +
|
|
22
|
+
randomNum2.toString(36).substring(2);
|
|
23
|
+
return uniqueString;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { generateUniqueId as g };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { d as dfs } from './dfs.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if the given element is a heading element (h1-h6) or has a role of "heading".
|
|
5
|
+
*
|
|
6
|
+
* @param {HTMLElement} el - The element to check.
|
|
7
|
+
* @returns {boolean} - True if the element is a heading element, false otherwise.
|
|
8
|
+
*/
|
|
9
|
+
const isHeadingElement = (el) => {
|
|
10
|
+
const tagName = el.tagName.toLowerCase();
|
|
11
|
+
const role = el.getAttribute('role');
|
|
12
|
+
return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tagName) || role === 'heading';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// A higher-order function to find the nested child of siblings matching a predicate,
|
|
16
|
+
// based on a sibling traversal function (getNextSibling or getPreviousSibling).
|
|
17
|
+
function getNestedChildOfSiblingsMatching(element, searchPredicate, siblingTraversalFn) {
|
|
18
|
+
// Start with the sibling of the provided element.
|
|
19
|
+
let sibling = siblingTraversalFn(element);
|
|
20
|
+
// Iterate through the siblings until there are no more siblings.
|
|
21
|
+
while (sibling) {
|
|
22
|
+
// Use the dfs helper function to find the deeply nested child
|
|
23
|
+
// that matches the given criteria within the current sibling.
|
|
24
|
+
const nestedChild = dfs(sibling, searchPredicate);
|
|
25
|
+
// If a matching deeply nested child is found, return it.
|
|
26
|
+
if (nestedChild) {
|
|
27
|
+
return nestedChild;
|
|
28
|
+
}
|
|
29
|
+
// Move on to the next sibling.
|
|
30
|
+
sibling = siblingTraversalFn(sibling);
|
|
31
|
+
}
|
|
32
|
+
// If no matching deeply nested child is found, return null.
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const getPreviousSibling = (element) => element.previousElementSibling;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Searches for a previous sibling element that has a nested child element matching the provided search predicate.
|
|
40
|
+
* The search starts from the given element and proceeds to its previous siblings, diving deep into each sibling's descendants.
|
|
41
|
+
*
|
|
42
|
+
* @param {HTMLElement} element - The starting element to begin the search from.
|
|
43
|
+
* @param {(el: HTMLElement) => boolean} searchPredicate - A predicate function that checks if an element matches the desired condition.
|
|
44
|
+
* @returns {HTMLElement | null} - The matching nested child element, or null if no matching element is found.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // HTML structure:
|
|
48
|
+
* // <div>
|
|
49
|
+
* // <h1>Heading 1</h1>
|
|
50
|
+
* // <ul role="list">
|
|
51
|
+
* // <li>Item 1</li>
|
|
52
|
+
* // </ul>
|
|
53
|
+
* // </div>
|
|
54
|
+
* // <div>
|
|
55
|
+
* // <h2>Heading 2</h2>
|
|
56
|
+
* // <ul role="list">
|
|
57
|
+
* // <li>Item 2</li>
|
|
58
|
+
* // </ul>
|
|
59
|
+
* // </div>
|
|
60
|
+
*
|
|
61
|
+
* const searchPredicate = (el) => el.tagName.toLowerCase() === 'h2';
|
|
62
|
+
* const startingElement = document.querySelector('[role="list"]');
|
|
63
|
+
* const headingEl = getPreviousNestedChildOfSiblingsMatching(startingElement, searchPredicate);
|
|
64
|
+
* console.log(headingEl); // Logs the <h2>Heading 2</h2> element
|
|
65
|
+
*/
|
|
66
|
+
const getPreviousNestedChildOfSiblingsMatching = (element, searchPredicate) => getNestedChildOfSiblingsMatching(element, searchPredicate, getPreviousSibling);
|
|
67
|
+
|
|
68
|
+
export { getPreviousNestedChildOfSiblingsMatching as g, isHeadingElement as i };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the provided element has a slotted element
|
|
3
|
+
* in the slot with the corresponding slotName
|
|
4
|
+
* @param slotName the name of the slot.
|
|
5
|
+
* @param element the element to look for the slot within.
|
|
6
|
+
*/
|
|
7
|
+
const hasSlot = (slotName, element) => !!element.querySelector(`[slot="${slotName}"]`);
|
|
8
|
+
|
|
9
|
+
export { hasSlot as h };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { g as getPreviousNestedChildOfSiblingsMatching, i as isHeadingElement } from './getPreviousNestedChildOfSiblingsMatching.js';
|
|
3
3
|
|
|
4
4
|
const headerDropdownListCss = ":host{display:block;width:190px;padding:0;margin:0;list-style:none;border-radius:unset;background-color:var(--tds-header-app-launcher-menu-bg)}@media all and (max-width: 384px){:host{width:100vw}}:host([size=lg]){width:320px}";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as dfs } from './
|
|
2
|
+
import { d as dfs } from './dfs.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './core-header-item.js';
|
|
4
4
|
|
|
5
5
|
const headerItemCss = ":host ::slotted(button),:host ::slotted(a){all:unset;box-sizing:border-box;background-color:var(--tds-header-background);border-right:1px solid var(--tds-header--basic-element-border);width:100%;height:100%;cursor:pointer;padding:0 24px;display:flex;align-items:center;gap:8px}:host ::slotted(button) *,:host ::slotted(a) *{box-sizing:border-box}:host ::slotted(button:hover),:host ::slotted(a:hover){background-color:var(--tds-header-item-hover)}:host ::slotted(button:focus-visible),:host ::slotted(a:focus-visible){outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .component-active ::slotted(button),:host .component-active ::slotted(a){background-color:var(--tds-header--basic-element-background-open);color:var(--tds-header-nav-item-dropdown-opened-color);border-color:var(--tds-header--basic-element-border-open)}:host .component-selected:not(.component-active) ::slotted(button),:host .component-selected:not(.component-active) ::slotted(a){background-color:var(--tds-header--basic-element-background-selected);padding-top:4px;border-bottom-style:solid;border-bottom-width:4px;border-bottom-color:var(--tds-nav-item-border-color-active)}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { i as inheritAriaAttributes } from './
|
|
2
|
+
import { i as inheritAriaAttributes } from './inheritAriaAttributes.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './core-header-item.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './header-item.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './icon.js';
|
|
@@ -11,12 +11,14 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends HTMLElement {
|
|
|
11
11
|
this.__registerHost();
|
|
12
12
|
this.__attachShadow();
|
|
13
13
|
this.setIcons = () => this.arrayOfIcons.map((element) => {
|
|
14
|
+
var _a;
|
|
14
15
|
if (element.name === this.name) {
|
|
15
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "aria-labelledby": `icon ${element.name}`, role: "img", style: { fontSize: this.size }, height: this.size, width: this.size }, h("title", null,
|
|
16
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", "aria-labelledby": `icon ${element.name}`, role: "img", style: { fontSize: this.size }, height: this.size, width: this.size }, h("title", null, (_a = this.svgTitle) !== null && _a !== void 0 ? _a : `${element.name} icon`), h("path", { fill: "currentColor", d: element.definition })));
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
19
|
this.name = 'truck';
|
|
19
20
|
this.size = '16px';
|
|
21
|
+
this.svgTitle = undefined;
|
|
20
22
|
this.icons_object = iconsCollection;
|
|
21
23
|
this.arrayOfIcons = [];
|
|
22
24
|
}
|
|
@@ -39,6 +41,7 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends HTMLElement {
|
|
|
39
41
|
}, [1, "tds-icon", {
|
|
40
42
|
"name": [513],
|
|
41
43
|
"size": [513],
|
|
44
|
+
"svgTitle": [1, "svg-title"],
|
|
42
45
|
"icons_object": [32],
|
|
43
46
|
"arrayOfIcons": [32]
|
|
44
47
|
}]);
|