@scania/tegel 0.0.9 → 0.0.10
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/README.md +3 -0
- package/dist/cjs/index-ee36ffa1.js +8 -16
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popper-9def2535.js → popper-d7adcfc6.js} +6 -12
- package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-badge.cjs.entry.js +3 -3
- package/dist/cjs/tds-banner.cjs.entry.js +10 -10
- package/dist/cjs/tds-breadcrumb.cjs.entry.js +2 -4
- package/dist/cjs/tds-breadcrumbs.cjs.entry.js +0 -3
- package/dist/cjs/tds-button.cjs.entry.js +4 -11
- package/dist/cjs/tds-card.cjs.entry.js +19 -23
- package/dist/cjs/tds-checkbox.cjs.entry.js +2 -1
- package/dist/cjs/tds-chip.cjs.entry.js +14 -3
- package/dist/cjs/tds-core-header-item_2.cjs.entry.js +1 -1
- package/dist/cjs/{tds-dropdown-option-v2.cjs.entry.js → tds-dropdown-option.cjs.entry.js} +5 -5
- package/dist/cjs/{tds-dropdown-v2.cjs.entry.js → tds-dropdown.cjs.entry.js} +19 -19
- package/dist/cjs/tds-folder-tab.cjs.entry.js +2 -3
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +5 -5
- 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 +6 -6
- package/dist/cjs/tds-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown-list-user.cjs.entry.js +4 -4
- package/dist/cjs/tds-header-dropdown-list.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +4 -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-title.cjs.entry.js +3 -2
- package/dist/cjs/tds-header-launcher-grid.cjs.entry.js +1 -1
- package/dist/cjs/tds-header-launcher-list-title.cjs.entry.js +3 -2
- package/dist/cjs/tds-header-launcher-list.cjs.entry.js +2 -1
- package/dist/cjs/tds-header-launcher.cjs.entry.js +2 -2
- package/dist/cjs/tds-header.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +5 -5
- package/dist/cjs/tds-link.cjs.entry.js +1 -1
- package/dist/cjs/tds-message.cjs.entry.js +4 -4
- package/dist/cjs/tds-modal.cjs.entry.js +13 -5
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +5 -5
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/tds-radio-button.cjs.entry.js +3 -2
- package/dist/cjs/tds-side-menu-close-button.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-side-menu.cjs.entry.js +2 -2
- package/dist/cjs/tds-slider.cjs.entry.js +12 -15
- package/dist/cjs/tds-stepper.cjs.entry.js +3 -2
- package/dist/cjs/tds-table-body.cjs.entry.js +4 -51
- package/dist/cjs/tds-table-footer.cjs.entry.js +47 -39
- package/dist/cjs/tds-table-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/tds-table.cjs.entry.js +2 -1
- package/dist/cjs/tds-text-field.cjs.entry.js +6 -2
- package/dist/cjs/tds-toast.cjs.entry.js +11 -26
- package/dist/cjs/tds-toggle.cjs.entry.js +2 -1
- package/dist/cjs/tds-tooltip.cjs.entry.js +6 -2
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/cjs/{utils-2beb1aa0.js → utils-41de5fb2.js} +32 -12
- package/dist/collection/collection-manifest.json +0 -3
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +4 -1
- package/dist/collection/components/accordion/accordion.stories.js +100 -0
- package/dist/collection/components/badge/badge.js +4 -4
- package/dist/collection/components/badge/badge.stories.js +106 -0
- package/dist/collection/components/banner/banner.css +12 -9
- package/dist/collection/components/banner/banner.js +33 -17
- package/dist/collection/components/banner/banner.stories.js +107 -0
- package/dist/collection/components/block/block.stories.js +49 -0
- package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.css +4 -4
- package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.js +1 -21
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +0 -3
- package/dist/collection/components/breadcrumbs/breadcrumbs.stories.js +36 -0
- package/dist/collection/components/button/button.css +16 -0
- package/dist/collection/components/button/button.js +7 -12
- package/dist/collection/components/button/button.stories.js +167 -0
- package/dist/collection/components/card/card.css +18 -17
- package/dist/collection/components/card/card.js +32 -68
- package/dist/collection/components/card/card.stories.js +162 -0
- package/dist/collection/components/checkbox/checkbox.js +6 -2
- package/dist/collection/components/checkbox/checkbox.stories.js +80 -0
- package/dist/collection/components/chip/chip.css +23 -8
- package/dist/collection/components/chip/chip.js +19 -3
- package/dist/collection/components/chip/chip.stories.js +230 -0
- package/dist/collection/components/datetime/datetime.stories.js +195 -0
- package/dist/collection/components/divider/divider.stories.js +62 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +142 -116
- package/dist/collection/components/dropdown/dropdown.css +212 -386
- package/dist/collection/components/dropdown/dropdown.js +472 -329
- package/dist/collection/components/dropdown/dropdown.stories.js +268 -0
- package/dist/collection/components/footer/footer-group/footer-group.css +3 -3
- package/dist/collection/components/footer/footer-group/footer-group.js +2 -2
- package/dist/collection/components/footer/footer-item/footer-item.css +16 -8
- package/dist/collection/components/footer/footer.css +8 -12
- package/dist/collection/components/footer/footer.js +10 -10
- package/dist/collection/components/footer/footer.stories.js +145 -0
- package/dist/collection/components/header/header-dropdown/header-dropdown.js +10 -5
- package/dist/collection/components/header/header-dropdown-list-user/header-dropdown-list-user.css +1 -1
- package/dist/collection/components/header/header-dropdown-list-user/header-dropdown-list-user.js +13 -9
- package/dist/collection/components/header/header-hamburger/header-hamburger.css +0 -1
- package/dist/collection/components/header/header-launcher/header-launcher.js +2 -2
- package/dist/collection/components/header/header-launcher-grid-title/header-launcher-grid-title.js +3 -2
- package/dist/collection/components/header/header-launcher-list/header-launcher-list.js +2 -1
- package/dist/collection/components/header/header-launcher-list-title/header-launcher-list-title.js +3 -2
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +5 -0
- package/dist/collection/components/header/header.stories.js +80 -0
- package/dist/collection/components/icon/icon.stories.js +48 -0
- package/dist/collection/components/link/link.css +16 -13
- package/dist/collection/components/link/link.js +1 -0
- package/dist/collection/components/link/link.stories.js +57 -0
- package/dist/collection/components/message/message.css +16 -16
- package/dist/collection/components/message/message.js +6 -3
- package/dist/collection/components/message/message.stories.js +110 -0
- package/dist/collection/components/modal/modal.css +19 -33
- package/dist/collection/components/modal/modal.js +36 -6
- package/dist/collection/components/modal/modal.stories.js +109 -0
- package/dist/collection/components/popover-canvas/popover-canvas.js +2 -2
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +92 -0
- package/dist/collection/components/popover-menu/popover-menu.js +2 -2
- package/dist/collection/components/popover-menu/popover-menu.stories.js +140 -0
- package/dist/collection/components/radio-button/radio-button.css +1 -1
- package/dist/collection/components/radio-button/radio-button.js +6 -2
- package/dist/collection/components/radio-button/radio-button.stories.js +91 -0
- package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +3 -0
- package/dist/collection/components/side-menu/side-menu-dropdown/side-menu-dropdown.css +1 -1
- package/dist/collection/components/side-menu/side-menu-dropdown/side-menu-dropdown.js +5 -0
- package/dist/collection/components/side-menu/side-menu-dropdown-list/side-menu-dropdown-list.js +3 -0
- package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.js +3 -0
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.css +1 -1
- package/dist/collection/components/side-menu/side-menu-item/side-menu-item.js +3 -0
- package/dist/collection/components/side-menu/side-menu-user/side-menu-user.js +3 -0
- package/dist/collection/components/side-menu/side-menu-user-image/side-menu-user-image.js +5 -0
- package/dist/collection/components/side-menu/side-menu.css +6 -5
- package/dist/collection/components/side-menu/side-menu.js +11 -3
- package/dist/collection/components/side-menu/side-menu.stories.js +215 -0
- package/dist/collection/components/slider/slider.js +13 -16
- package/dist/collection/components/slider/slider.stories.js +243 -0
- package/dist/collection/components/spinner/spinner.stories.js +61 -0
- package/dist/collection/components/stepper/step/step.js +3 -0
- package/dist/collection/components/stepper/stepper.css +3 -0
- package/dist/collection/components/stepper/stepper.js +4 -3
- package/dist/collection/components/stepper/stepper.stories.js +95 -0
- package/dist/collection/components/table/table/table.js +4 -3
- package/dist/collection/components/table/table-body/table-body.js +15 -60
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +3 -0
- package/dist/collection/components/table/table-component-basic.stories.js +184 -0
- package/dist/collection/components/table/table-component-batch-actions.stories.js +201 -0
- package/dist/collection/components/table/table-component-bodydata.stories.js +101 -0
- package/dist/collection/components/table/table-component-custom-width.stories.js +174 -0
- package/dist/collection/components/table/table-component-event-listeners.stories.js +193 -0
- package/dist/collection/components/table/table-component-expandable-rows.stories.js +160 -0
- package/dist/collection/components/table/table-component-filtering.stories.js +210 -0
- package/dist/collection/components/table/table-component-multiselect.stories.js +230 -0
- package/dist/collection/components/table/table-component-pagination.stories.js +215 -0
- package/dist/collection/components/table/table-component-sorting.stories.js +238 -0
- package/dist/collection/components/table/table-footer/table-footer.js +65 -54
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -0
- package/dist/collection/components/table/table-toolbar/table-toolbar.css +2 -1
- package/dist/collection/components/table/table-toolbar/table-toolbar.js +4 -1
- package/dist/collection/components/table/table.filtering.spec.js +0 -6
- package/dist/collection/components/table/table.spec.js +0 -6
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.css +10 -11
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +1 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +5 -5
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.stories.js +105 -0
- package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.css +13 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +5 -5
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.stories.js +99 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.css +13 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +5 -5
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +101 -0
- package/dist/collection/components/text-field/text-field.js +10 -2
- package/dist/collection/components/text-field/text-field.stories.js +247 -0
- package/dist/collection/components/textarea/textarea.stories.js +188 -0
- package/dist/collection/components/toast/toast.css +32 -25
- package/dist/collection/components/toast/toast.js +17 -33
- package/dist/collection/components/toast/toast.stories.js +79 -0
- package/dist/collection/components/toggle/toggle.js +6 -2
- package/dist/collection/components/toggle/toggle.stories.js +95 -0
- package/dist/collection/components/tooltip/tooltip.js +27 -3
- package/dist/collection/components/tooltip/tooltip.stories.js +128 -0
- package/dist/collection/stories/Installation/installation.stories.js +222 -0
- package/dist/collection/stories/announcements/announce-tegel.stories.js +262 -0
- package/dist/collection/stories/announcements/prefix-change.stories.js +93 -0
- package/dist/collection/stories/foundations/color/color-brand.stories.js +38 -0
- package/dist/collection/stories/foundations/color/color-scales.stories.js +71 -0
- package/dist/collection/stories/foundations/color/color-semantic.stories.js +40 -0
- package/dist/collection/stories/foundations/grid/grid.stories.js +386 -0
- package/dist/collection/stories/foundations/spacing/spacing-element.stories.js +100 -0
- package/dist/collection/stories/foundations/spacing/spacing-layout.stories.js +94 -0
- package/dist/collection/stories/foundations/typography/typography-body.stories.js +16 -0
- package/dist/collection/stories/foundations/typography/typography-detail.stories.js +17 -0
- package/dist/collection/stories/foundations/typography/typography-headline.stories.js +39 -0
- package/dist/collection/stories/foundations/typography/typography-paragraph.stories.js +12 -0
- package/dist/collection/stories/patterns/navigation/navigation-basic.stories.js +85 -0
- package/dist/collection/stories/patterns/navigation/navigation-fewitems.stories.js +259 -0
- package/dist/collection/stories/patterns/navigation/navigation-manyitems.stories.js +246 -0
- package/dist/collection/stories/patterns/navigation/navigation-user-menu.stories.js +140 -0
- package/dist/collection/stories/tegel.stories.js +293 -0
- package/dist/collection/stories/utility/color/background-color.stories.js +96 -0
- package/dist/collection/stories/utility/color/text-color.stories.js +94 -0
- package/dist/collection/utils/utils.js +30 -11
- package/dist/components/checkbox.js +2 -1
- package/dist/components/header-dropdown-list.js +1 -1
- package/dist/components/header-item.js +1 -1
- package/dist/components/popper.js +6 -12
- package/dist/components/side-menu-item.js +1 -1
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-badge.js +4 -4
- package/dist/components/tds-banner.js +12 -13
- package/dist/components/tds-breadcrumb.js +3 -6
- package/dist/components/tds-breadcrumbs.js +0 -3
- package/dist/components/tds-button.js +5 -13
- package/dist/components/tds-card.js +21 -29
- package/dist/components/tds-chip.js +14 -3
- package/dist/components/tds-dropdown-option.js +121 -1
- package/dist/components/tds-dropdown.js +318 -1
- package/dist/components/tds-folder-tab.js +2 -3
- package/dist/components/tds-folder-tabs.js +5 -5
- package/dist/components/tds-footer-group.js +3 -3
- package/dist/components/tds-footer-item.js +1 -1
- package/dist/components/tds-footer.js +7 -8
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown-list-user.js +6 -6
- package/dist/components/tds-header-dropdown.js +5 -4
- package/dist/components/tds-header-launcher-grid-title.js +3 -2
- package/dist/components/tds-header-launcher-grid.js +1 -1
- package/dist/components/tds-header-launcher-list-title.js +3 -2
- package/dist/components/tds-header-launcher-list.js +2 -1
- package/dist/components/tds-header-launcher.js +2 -2
- package/dist/components/tds-inline-tab.js +1 -1
- package/dist/components/tds-inline-tabs.js +5 -5
- package/dist/components/tds-link.js +3 -2
- package/dist/components/tds-message.js +4 -4
- package/dist/components/tds-modal.js +14 -5
- package/dist/components/tds-navigation-tab.js +1 -1
- package/dist/components/tds-navigation-tabs.js +5 -5
- package/dist/components/tds-radio-button.js +3 -2
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-side-menu.js +2 -2
- package/dist/components/tds-slider.js +12 -15
- package/dist/components/tds-stepper.js +3 -2
- package/dist/components/tds-table-body.js +5 -53
- package/dist/components/tds-table-footer.js +50 -42
- package/dist/components/tds-table-toolbar.js +9 -3
- package/dist/components/tds-table.js +2 -1
- package/dist/components/tds-text-field.js +6 -2
- package/dist/components/tds-toast.js +12 -29
- package/dist/components/tds-toggle.js +2 -1
- package/dist/components/tds-tooltip.js +7 -2
- package/dist/components/utils.js +31 -12
- package/dist/esm/index-23ee700b.js +8 -16
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popper-bfa25c7f.js → popper-15e448b4.js} +6 -12
- package/dist/esm/tds-accordion-item.entry.js +1 -1
- package/dist/esm/tds-badge.entry.js +3 -3
- package/dist/esm/tds-banner.entry.js +10 -10
- package/dist/esm/tds-breadcrumb.entry.js +2 -4
- package/dist/esm/tds-breadcrumbs.entry.js +0 -3
- package/dist/esm/tds-button.entry.js +4 -11
- package/dist/esm/tds-card.entry.js +19 -23
- package/dist/esm/tds-checkbox.entry.js +2 -1
- package/dist/esm/tds-chip.entry.js +15 -4
- package/dist/esm/tds-core-header-item_2.entry.js +1 -1
- package/dist/esm/{tds-dropdown-option-v2.entry.js → tds-dropdown-option.entry.js} +5 -5
- package/dist/esm/{tds-dropdown-v2.entry.js → tds-dropdown.entry.js} +19 -19
- package/dist/esm/tds-folder-tab.entry.js +2 -3
- package/dist/esm/tds-folder-tabs.entry.js +5 -5
- 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 +6 -6
- package/dist/esm/tds-header-cell.entry.js +1 -1
- package/dist/esm/tds-header-dropdown-list-user.entry.js +4 -4
- package/dist/esm/tds-header-dropdown-list.entry.js +1 -1
- package/dist/esm/tds-header-dropdown.entry.js +4 -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-title.entry.js +3 -2
- package/dist/esm/tds-header-launcher-grid.entry.js +1 -1
- package/dist/esm/tds-header-launcher-list-title.entry.js +3 -2
- package/dist/esm/tds-header-launcher-list.entry.js +2 -1
- package/dist/esm/tds-header-launcher.entry.js +2 -2
- package/dist/esm/tds-header.entry.js +1 -1
- package/dist/esm/tds-inline-tab.entry.js +1 -1
- package/dist/esm/tds-inline-tabs.entry.js +5 -5
- package/dist/esm/tds-link.entry.js +1 -1
- package/dist/esm/tds-message.entry.js +4 -4
- package/dist/esm/tds-modal.entry.js +13 -5
- package/dist/esm/tds-navigation-tab.entry.js +1 -1
- package/dist/esm/tds-navigation-tabs.entry.js +5 -5
- package/dist/esm/tds-popover-canvas.entry.js +1 -1
- package/dist/esm/tds-popover-menu.entry.js +1 -1
- package/dist/esm/tds-radio-button.entry.js +3 -2
- package/dist/esm/tds-side-menu-close-button.entry.js +1 -1
- package/dist/esm/tds-side-menu-dropdown.entry.js +1 -1
- package/dist/esm/tds-side-menu-item.entry.js +1 -1
- package/dist/esm/tds-side-menu.entry.js +2 -2
- package/dist/esm/tds-slider.entry.js +12 -15
- package/dist/esm/tds-stepper.entry.js +3 -2
- package/dist/esm/tds-table-body.entry.js +4 -51
- package/dist/esm/tds-table-footer.entry.js +47 -39
- package/dist/esm/tds-table-toolbar.entry.js +2 -2
- package/dist/esm/tds-table.entry.js +2 -1
- package/dist/esm/tds-text-field.entry.js +7 -3
- package/dist/esm/tds-toast.entry.js +11 -26
- package/dist/esm/tds-toggle.entry.js +2 -1
- package/dist/esm/tds-tooltip.entry.js +6 -2
- package/dist/esm/tegel.js +1 -1
- package/dist/esm/{utils-9ac24735.js → utils-74fb1bed.js} +31 -12
- package/dist/tegel/p-000d60e5.entry.js +1 -0
- package/dist/tegel/p-04bff255.entry.js +1 -0
- package/dist/tegel/p-06093e3e.entry.js +1 -0
- package/dist/tegel/p-099025f0.entry.js +1 -0
- package/dist/tegel/p-0995ca77.entry.js +1 -0
- package/dist/tegel/p-10337d3f.entry.js +1 -0
- package/dist/tegel/p-19fb9ad5.entry.js +1 -0
- package/dist/tegel/p-1bac7d2e.entry.js +1 -0
- package/dist/tegel/p-1c82ccf0.entry.js +1 -0
- package/dist/tegel/p-347414ad.entry.js +1 -0
- package/dist/tegel/p-34a06d2f.entry.js +1 -0
- package/dist/tegel/p-3c9865c3.entry.js +1 -0
- package/dist/tegel/{p-c8d4af09.entry.js → p-40142a58.entry.js} +1 -1
- package/dist/tegel/p-48136431.entry.js +1 -0
- package/dist/tegel/p-49a084db.entry.js +1 -0
- package/dist/tegel/p-4c809685.entry.js +1 -0
- package/dist/tegel/p-54e56257.entry.js +1 -0
- package/dist/tegel/{p-e8fccebc.entry.js → p-56189659.entry.js} +1 -1
- package/dist/tegel/p-6bee84a2.entry.js +1 -0
- package/dist/tegel/p-6f0072cc.entry.js +1 -0
- package/dist/tegel/p-73a8f43e.entry.js +1 -0
- package/dist/tegel/p-8ba77ea3.entry.js +1 -0
- package/dist/tegel/p-8bd0a233.entry.js +1 -0
- package/dist/tegel/{p-e0ee20ee.entry.js → p-8c194dd8.entry.js} +1 -1
- package/dist/tegel/p-95e170f3.entry.js +1 -0
- package/dist/tegel/p-99837611.entry.js +1 -0
- package/dist/tegel/p-9991a816.entry.js +1 -0
- package/dist/tegel/{p-bcb2fad3.entry.js → p-9b29bf68.entry.js} +1 -1
- package/dist/tegel/{p-39227588.js → p-9dc14c21.js} +1 -1
- package/dist/tegel/p-9f1e1cc0.entry.js +1 -0
- package/dist/tegel/{p-232f5889.entry.js → p-9fe0d654.entry.js} +1 -1
- package/dist/tegel/{p-135575ae.entry.js → p-a08be1c3.entry.js} +1 -1
- package/dist/tegel/{p-3aa634ed.entry.js → p-a1ad46d2.entry.js} +1 -1
- package/dist/tegel/p-a34bb501.entry.js +1 -0
- package/dist/tegel/p-a4e3eb95.entry.js +1 -0
- package/dist/tegel/{p-fb3f4a14.entry.js → p-aa443b06.entry.js} +1 -1
- package/dist/tegel/p-afe13096.entry.js +1 -0
- package/dist/tegel/{p-cd2a74d7.entry.js → p-b0d313cd.entry.js} +1 -1
- package/dist/tegel/p-b1067b50.entry.js +1 -0
- package/dist/tegel/{p-7b34156b.entry.js → p-b5424456.entry.js} +1 -1
- package/dist/tegel/p-c15bbe0b.entry.js +1 -0
- package/dist/tegel/p-c411f254.entry.js +1 -0
- package/dist/tegel/p-c5588508.entry.js +1 -0
- package/dist/tegel/{p-b6a16219.entry.js → p-c5ab3a3b.entry.js} +1 -1
- package/dist/tegel/p-d5bd9b2e.entry.js +1 -0
- package/dist/tegel/p-df95f0ae.entry.js +1 -0
- package/dist/tegel/{p-de799b9a.entry.js → p-e24835ba.entry.js} +1 -1
- package/dist/tegel/p-e3f8fc68.entry.js +1 -0
- package/dist/tegel/{p-89283891.entry.js → p-e4dc07bb.entry.js} +1 -1
- package/dist/tegel/p-f36ec03b.entry.js +1 -0
- package/dist/tegel/{p-7331ec7b.entry.js → p-f795bc11.entry.js} +1 -1
- package/dist/tegel/{p-7d3a66ae.entry.js → p-f9d04ff2.entry.js} +1 -1
- package/dist/tegel/p-fc6da19c.entry.js +1 -0
- package/dist/tegel/tegel.css +2 -2
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +3 -0
- package/dist/types/components/accordion/accordion.stories.d.ts +77 -0
- package/dist/types/components/badge/badge.stories.d.ts +73 -0
- package/dist/types/components/banner/banner.d.ts +7 -2
- package/dist/types/components/banner/banner.stories.d.ts +82 -0
- package/dist/types/components/block/block.stories.d.ts +32 -0
- package/dist/types/components/breadcrumbs/breadcrumb/breadcrumb.d.ts +0 -2
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +0 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.stories.d.ts +16 -0
- package/dist/types/components/button/button.d.ts +3 -1
- package/dist/types/components/button/button.stories.d.ts +133 -0
- package/dist/types/components/card/card.d.ts +11 -9
- package/dist/types/components/card/card.stories.d.ts +128 -0
- package/dist/types/components/checkbox/checkbox.d.ts +3 -0
- package/dist/types/components/checkbox/checkbox.stories.d.ts +52 -0
- package/dist/types/components/chip/chip.d.ts +6 -0
- package/dist/types/components/chip/chip.stories.d.ts +99 -0
- package/dist/types/components/datetime/datetime.stories.d.ts +125 -0
- package/dist/types/components/divider/divider.stories.d.ts +58 -0
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +28 -17
- package/dist/types/components/dropdown/dropdown.d.ts +79 -54
- package/dist/types/components/dropdown/dropdown.stories.d.ts +183 -0
- package/dist/types/components/footer/footer-group/footer-group.d.ts +1 -1
- package/dist/types/components/footer/footer.d.ts +5 -3
- package/dist/types/components/footer/footer.stories.d.ts +44 -0
- package/dist/types/components/header/header-dropdown/header-dropdown.d.ts +5 -1
- package/dist/types/components/header/header-dropdown-list-user/header-dropdown-list-user.d.ts +8 -4
- package/dist/types/components/header/header.d.ts +5 -0
- package/dist/types/components/header/header.stories.d.ts +31 -0
- package/dist/types/components/icon/icon.stories.d.ts +36 -0
- package/dist/types/components/link/link.stories.d.ts +44 -0
- package/dist/types/components/message/message.d.ts +3 -0
- package/dist/types/components/message/message.stories.d.ts +88 -0
- package/dist/types/components/modal/modal.d.ts +9 -3
- package/dist/types/components/modal/modal.stories.d.ts +70 -0
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +1 -1
- package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +27 -0
- package/dist/types/components/popover-menu/popover-menu.d.ts +1 -1
- package/dist/types/components/popover-menu/popover-menu.stories.d.ts +40 -0
- package/dist/types/components/radio-button/radio-button.d.ts +3 -0
- package/dist/types/components/radio-button/radio-button.stories.d.ts +39 -0
- package/dist/types/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.d.ts +3 -0
- package/dist/types/components/side-menu/side-menu-dropdown/side-menu-dropdown.d.ts +5 -0
- package/dist/types/components/side-menu/side-menu-dropdown-list/side-menu-dropdown-list.d.ts +3 -0
- package/dist/types/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.d.ts +3 -0
- package/dist/types/components/side-menu/side-menu-item/side-menu-item.d.ts +3 -0
- package/dist/types/components/side-menu/side-menu-user/side-menu-user.d.ts +3 -0
- package/dist/types/components/side-menu/side-menu-user-image/side-menu-user-image.d.ts +4 -0
- package/dist/types/components/side-menu/side-menu.d.ts +8 -0
- package/dist/types/components/side-menu/side-menu.stories.d.ts +53 -0
- package/dist/types/components/slider/slider.d.ts +0 -1
- package/dist/types/components/slider/slider.stories.d.ts +235 -0
- package/dist/types/components/spinner/spinner.stories.d.ts +46 -0
- package/dist/types/components/stepper/step/step.d.ts +3 -0
- package/dist/types/components/stepper/stepper.stories.d.ts +80 -0
- package/dist/types/components/table/table-body/table-body.d.ts +6 -3
- package/dist/types/components/table/table-body-row-expandable/table-body-row-expandable.d.ts +3 -0
- package/dist/types/components/table/table-component-basic.stories.d.ts +144 -0
- package/dist/types/components/table/table-component-batch-actions.stories.d.ts +139 -0
- package/dist/types/components/table/table-component-bodydata.stories.d.ts +35 -0
- package/dist/types/components/table/table-component-custom-width.stories.d.ts +131 -0
- package/dist/types/components/table/table-component-event-listeners.stories.d.ts +131 -0
- package/dist/types/components/table/table-component-expandable-rows.stories.d.ts +131 -0
- package/dist/types/components/table/table-component-filtering.stories.d.ts +139 -0
- package/dist/types/components/table/table-component-multiselect.stories.d.ts +144 -0
- package/dist/types/components/table/table-component-pagination.stories.d.ts +131 -0
- package/dist/types/components/table/table-component-sorting.stories.d.ts +183 -0
- package/dist/types/components/table/table-footer/table-footer.d.ts +7 -7
- package/dist/types/components/table/table-toolbar/table-toolbar.d.ts +3 -0
- package/dist/types/components/tabs/folder-tabs/folder-tabs.stories.d.ts +69 -0
- package/dist/types/components/tabs/inline-tabs/inline-tabs.stories.d.ts +61 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +61 -0
- package/dist/types/components/text-field/text-field.d.ts +5 -0
- package/dist/types/components/text-field/text-field.stories.d.ts +201 -0
- package/dist/types/components/textarea/textarea.stories.d.ts +139 -0
- package/dist/types/components/toast/toast.d.ts +5 -4
- package/dist/types/components/toast/toast.stories.d.ts +56 -0
- package/dist/types/components/toggle/toggle.d.ts +3 -0
- package/dist/types/components/toggle/toggle.stories.d.ts +74 -0
- package/dist/types/components/tooltip/tooltip.d.ts +3 -1
- package/dist/types/components/tooltip/tooltip.stories.d.ts +66 -0
- package/dist/types/components.d.ts +105 -393
- package/dist/types/stories/Installation/installation.stories.d.ts +7 -0
- package/dist/types/stories/announcements/announce-tegel.stories.d.ts +6 -0
- package/dist/types/stories/announcements/prefix-change.stories.d.ts +6 -0
- package/dist/types/stories/foundations/color/color-brand.stories.d.ts +13 -0
- package/dist/types/stories/foundations/color/color-scales.stories.d.ts +30 -0
- package/dist/types/stories/foundations/color/color-semantic.stories.d.ts +13 -0
- package/dist/types/stories/foundations/grid/grid.stories.d.ts +35 -0
- package/dist/types/stories/foundations/spacing/spacing-element.stories.d.ts +8 -0
- package/dist/types/stories/foundations/spacing/spacing-layout.stories.d.ts +8 -0
- package/dist/types/stories/foundations/typography/typography-body.stories.d.ts +8 -0
- package/dist/types/stories/foundations/typography/typography-detail.stories.d.ts +8 -0
- package/dist/types/stories/foundations/typography/typography-headline.stories.d.ts +21 -0
- package/dist/types/stories/foundations/typography/typography-paragraph.stories.d.ts +8 -0
- package/dist/types/stories/patterns/navigation/navigation-basic.stories.d.ts +23 -0
- package/dist/types/stories/patterns/navigation/navigation-fewitems.stories.d.ts +23 -0
- package/dist/types/stories/patterns/navigation/navigation-manyitems.stories.d.ts +38 -0
- package/dist/types/stories/patterns/navigation/navigation-user-menu.stories.d.ts +33 -0
- package/dist/types/stories/tegel.stories.d.ts +6 -0
- package/dist/types/stories/utility/color/background-color.stories.d.ts +64 -0
- package/dist/types/stories/utility/color/text-color.stories.d.ts +64 -0
- package/dist/types/utils/utils.d.ts +20 -6
- package/package.json +21 -24
- package/dist/cjs/tds-dropdown-filter.cjs.entry.js +0 -96
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +0 -339
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +0 -380
- package/dist/collection/components/dropdown-v2/dropdown-option-v2/dropdown-option-v2.js +0 -216
- package/dist/collection/components/dropdown-v2/dropdown-v2.css +0 -286
- package/dist/collection/components/dropdown-v2/dropdown-v2.js +0 -726
- package/dist/components/dropdown-option.js +0 -104
- package/dist/components/dropdown.js +0 -304
- package/dist/components/tds-dropdown-filter.d.ts +0 -11
- package/dist/components/tds-dropdown-filter.js +0 -150
- package/dist/components/tds-dropdown-option-v2.d.ts +0 -11
- package/dist/components/tds-dropdown-option-v2.js +0 -126
- package/dist/components/tds-dropdown-v2.d.ts +0 -11
- package/dist/components/tds-dropdown-v2.js +0 -323
- package/dist/esm/tds-dropdown-filter.entry.js +0 -92
- package/dist/esm/tds-dropdown_2.entry.js +0 -334
- package/dist/tegel/p-07e5df94.entry.js +0 -1
- package/dist/tegel/p-0a3e7512.entry.js +0 -1
- package/dist/tegel/p-0e55d72f.entry.js +0 -1
- package/dist/tegel/p-107d3da8.entry.js +0 -1
- package/dist/tegel/p-13b02a4f.entry.js +0 -1
- package/dist/tegel/p-19e9addd.entry.js +0 -1
- package/dist/tegel/p-1fb5c5d4.entry.js +0 -1
- package/dist/tegel/p-2bee16f6.entry.js +0 -1
- package/dist/tegel/p-2e2c91c4.entry.js +0 -1
- package/dist/tegel/p-330ed982.entry.js +0 -1
- package/dist/tegel/p-3604b5d3.entry.js +0 -1
- package/dist/tegel/p-375e361b.entry.js +0 -1
- package/dist/tegel/p-55dc4711.entry.js +0 -1
- package/dist/tegel/p-59f1cb9b.entry.js +0 -1
- package/dist/tegel/p-5a6aba01.entry.js +0 -1
- package/dist/tegel/p-60733f89.entry.js +0 -1
- package/dist/tegel/p-6a530c2f.entry.js +0 -1
- package/dist/tegel/p-732256e0.entry.js +0 -1
- package/dist/tegel/p-76f941e8.entry.js +0 -1
- package/dist/tegel/p-7b0853e6.entry.js +0 -1
- package/dist/tegel/p-90686bc7.entry.js +0 -1
- package/dist/tegel/p-95da9b7f.entry.js +0 -1
- package/dist/tegel/p-99f540db.entry.js +0 -1
- package/dist/tegel/p-9bcc42cf.entry.js +0 -1
- package/dist/tegel/p-9f57d275.entry.js +0 -1
- package/dist/tegel/p-9fe384ad.entry.js +0 -1
- package/dist/tegel/p-a5604352.entry.js +0 -1
- package/dist/tegel/p-acb62b52.entry.js +0 -1
- package/dist/tegel/p-aeffa257.entry.js +0 -1
- package/dist/tegel/p-b8d88873.entry.js +0 -1
- package/dist/tegel/p-beb8a6bd.entry.js +0 -1
- package/dist/tegel/p-c90a247c.entry.js +0 -1
- package/dist/tegel/p-ca4527de.entry.js +0 -1
- package/dist/tegel/p-cf4cfc54.entry.js +0 -1
- package/dist/tegel/p-d3f5cf74.entry.js +0 -1
- package/dist/tegel/p-d67d67be.entry.js +0 -1
- package/dist/tegel/p-da4c92b9.entry.js +0 -1
- package/dist/tegel/p-f6206d3c.entry.js +0 -1
- package/dist/tegel/p-fc47d911.entry.js +0 -1
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +0 -47
- package/dist/types/components/dropdown-v2/dropdown-option-v2/dropdown-option-v2.d.ts +0 -35
- package/dist/types/components/dropdown-v2/dropdown-v2.d.ts +0 -86
- /package/dist/collection/components/{dropdown-v2/dropdown-option-v2/dropdown-option-v2.css → dropdown/dropdown-option/dropdown-option.css} +0 -0
- /package/dist/tegel/{p-9d707f6e.js → p-7c0dcd00.js} +0 -0
|
@@ -5,50 +5,6 @@ import { d as defineCustomElement$2 } from './table-body-row.js';
|
|
|
5
5
|
|
|
6
6
|
const tableBodyCss = ":host,tds-table-body{box-sizing:border-box;display:table-row-group}:host *,tds-table-body *{box-sizing:border-box}:host .tds-table__info-message,tds-table-body .tds-table__info-message{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);display:table-cell;box-sizing:border-box;color:var(--tds-table-color);padding:var(--tds-spacing-element-16);min-width:192px;vertical-align:top;background-color:transparent;transition:background-color 200ms ease}";
|
|
7
7
|
|
|
8
|
-
const jsonData = [
|
|
9
|
-
{
|
|
10
|
-
truck: 'L-series',
|
|
11
|
-
driver: 'Sonya Bruce',
|
|
12
|
-
country: 'Brazil',
|
|
13
|
-
mileage: 123987,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
truck: 'P-series',
|
|
17
|
-
driver: 'Guerra Bowman',
|
|
18
|
-
country: 'Sweden',
|
|
19
|
-
mileage: 2000852,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
truck: 'G-series',
|
|
23
|
-
driver: 'Ferrell Wallace',
|
|
24
|
-
country: 'Germany',
|
|
25
|
-
mileage: 564,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
truck: 'R-series',
|
|
29
|
-
driver: 'Cox Burris',
|
|
30
|
-
country: 'Spain',
|
|
31
|
-
mileage: 1789357,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
truck: 'S-series',
|
|
35
|
-
driver: 'Montgomery Cervantes',
|
|
36
|
-
country: 'Croatia',
|
|
37
|
-
mileage: 65,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
truck: 'L-series',
|
|
41
|
-
driver: 'Sheryl Nielsen',
|
|
42
|
-
country: 'Greece',
|
|
43
|
-
mileage: 365784,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
truck: 'G-series',
|
|
47
|
-
driver: 'Benton Gomez',
|
|
48
|
-
country: 'France',
|
|
49
|
-
mileage: 80957,
|
|
50
|
-
},
|
|
51
|
-
];
|
|
52
8
|
const relevantTableProps = [
|
|
53
9
|
'enableMultiselect',
|
|
54
10
|
'enableExpandableRows',
|
|
@@ -88,8 +44,7 @@ const TdsTableBody$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBody exten
|
|
|
88
44
|
this.selectedDataExporter();
|
|
89
45
|
};
|
|
90
46
|
this.bodyData = undefined;
|
|
91
|
-
this.
|
|
92
|
-
this.jsonData = JSON.stringify(jsonData);
|
|
47
|
+
this.noResultMessage = undefined;
|
|
93
48
|
this.rowsPerPage = 1;
|
|
94
49
|
this.enableMultiselect = false;
|
|
95
50
|
this.enablePaginationTableBody = false;
|
|
@@ -216,6 +171,7 @@ const TdsTableBody$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBody exten
|
|
|
216
171
|
item.classList.remove('tds-table__row--hidden');
|
|
217
172
|
});
|
|
218
173
|
}
|
|
174
|
+
this.showNoResultsMessage = false;
|
|
219
175
|
this.disableAllSorting = false;
|
|
220
176
|
this.internalTdsSortingChange.emit([this.tableId, this.disableAllSorting]);
|
|
221
177
|
}
|
|
@@ -234,10 +190,7 @@ const TdsTableBody$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBody exten
|
|
|
234
190
|
relevantTableProps.forEach((tablePropName) => {
|
|
235
191
|
this[tablePropName] = this.tableEl[tablePropName];
|
|
236
192
|
});
|
|
237
|
-
if (this.
|
|
238
|
-
this.bodyData = this.jsonData;
|
|
239
|
-
}
|
|
240
|
-
else if (this.bodyData) {
|
|
193
|
+
if (this.bodyData) {
|
|
241
194
|
this.arrayDataWatcher(this.bodyData);
|
|
242
195
|
}
|
|
243
196
|
}
|
|
@@ -252,7 +205,7 @@ const TdsTableBody$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBody exten
|
|
|
252
205
|
}
|
|
253
206
|
}
|
|
254
207
|
render() {
|
|
255
|
-
return (h(Host, { "data-selected-rows": this.multiselectArrayJSON }, this.bodyDataManipulated.map((row) => (h("tds-table-body-row", null, Object.keys(row).map((cellData) => (h("tds-body-cell", { "cell-key": cellData, "cell-value": row[cellData] })))))),
|
|
208
|
+
return (h(Host, { "data-selected-rows": this.multiselectArrayJSON }, this.bodyDataManipulated.map((row) => (h("tds-table-body-row", null, Object.keys(row).map((cellData) => (h("tds-body-cell", { "cell-key": cellData, "cell-value": row[cellData] })))))), h("tr", { hidden: !this.showNoResultsMessage }, h("td", { class: "tds-table__info-message", colSpan: this.columnsNumber }, h("slot", { name: "no-result" }), this.noResultMessage)), h("slot", null)));
|
|
256
209
|
}
|
|
257
210
|
get host() { return this; }
|
|
258
211
|
static get watchers() { return {
|
|
@@ -261,8 +214,7 @@ const TdsTableBody$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableBody exten
|
|
|
261
214
|
static get style() { return tableBodyCss; }
|
|
262
215
|
}, [4, "tds-table-body", {
|
|
263
216
|
"bodyData": [1032, "body-data"],
|
|
264
|
-
"
|
|
265
|
-
"jsonData": [32],
|
|
217
|
+
"noResultMessage": [1, "no-result-message"],
|
|
266
218
|
"rowsPerPage": [32],
|
|
267
219
|
"enableMultiselect": [32],
|
|
268
220
|
"enablePaginationTableBody": [32],
|
|
@@ -15,66 +15,69 @@ const TdsTableFooter$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableFooter e
|
|
|
15
15
|
this.tdsPageChange = createEvent(this, "tdsPageChange", 7);
|
|
16
16
|
this.previousPage = () => {
|
|
17
17
|
/* Emits pagination event. */
|
|
18
|
-
|
|
18
|
+
this.tdsPageChange.emit({
|
|
19
19
|
tableId: this.tableId,
|
|
20
20
|
paginationValue: Number(this.inputElement.value) - 1,
|
|
21
21
|
});
|
|
22
22
|
/** If pages and greater or equal to 2, decrease pagination value.
|
|
23
23
|
* This is to not get under 1 in pagination value. */
|
|
24
|
-
if (this.
|
|
25
|
-
this.
|
|
24
|
+
if (this.defaultPage >= 2) {
|
|
25
|
+
this.defaultPage--;
|
|
26
26
|
}
|
|
27
27
|
/* If the change event is not prevented -> do pagination. */
|
|
28
|
-
if (!
|
|
28
|
+
if (!this.pages) {
|
|
29
29
|
/* Decrease the pagination until the first page. */
|
|
30
30
|
this.runPagination();
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
this.nextPage = () => {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
var _a;
|
|
35
|
+
this.tdsPageChange.emit({
|
|
36
36
|
tableId: this.tableId,
|
|
37
37
|
paginationValue: Number(this.inputElement.value) + 1,
|
|
38
38
|
});
|
|
39
39
|
/** If pages and greater or equal to the amount of pages, increase pagination value.
|
|
40
40
|
* This is to not get above the amount of pages in pagination value. */
|
|
41
|
-
if (this.
|
|
42
|
-
this.
|
|
41
|
+
if (this.defaultPage <= ((_a = this.pages) !== null && _a !== void 0 ? _a : this.numberOfPages)) {
|
|
42
|
+
this.defaultPage++;
|
|
43
43
|
}
|
|
44
44
|
/* If the change event is not prevented -> do pagination. */
|
|
45
|
-
if (!
|
|
45
|
+
if (!this.pages) {
|
|
46
46
|
/* Increase the pagination until the last page. */
|
|
47
47
|
this.runPagination();
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
this.runPagination = () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const lastResult = this.rowsPerPage * this.paginationValue;
|
|
63
|
-
const firstResult = lastResult - this.rowsPerPage;
|
|
64
|
-
if (index > firstResult && index <= lastResult) {
|
|
65
|
-
item.classList.remove('tds-table__row--hidden');
|
|
51
|
+
/** Check the rows per page is used - if so, we need to do all the pagination. */
|
|
52
|
+
if (this.rowsPerPage) {
|
|
53
|
+
// grab all rows in body
|
|
54
|
+
const dataRowsPagination = this.host.parentNode
|
|
55
|
+
.querySelector('tds-table-body')
|
|
56
|
+
.querySelectorAll('.tds-table__row');
|
|
57
|
+
dataRowsPagination.forEach((item, i) => {
|
|
58
|
+
// for making logic easier 1st result, 2nd result...
|
|
59
|
+
const index = i + 1;
|
|
60
|
+
if (this.tempPaginationDisable) {
|
|
61
|
+
this.defaultPage = 1;
|
|
66
62
|
}
|
|
67
63
|
else {
|
|
68
|
-
|
|
64
|
+
const lastResult = this.rowsPerPage * this.defaultPage;
|
|
65
|
+
const firstResult = lastResult - this.rowsPerPage;
|
|
66
|
+
if (index > firstResult && index <= lastResult) {
|
|
67
|
+
item.classList.remove('tds-table__row--hidden');
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
item.classList.add('tds-table__row--hidden');
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
72
75
|
};
|
|
73
76
|
this.pagination = false;
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
77
|
+
this.defaultPage = 1;
|
|
78
|
+
this.pages = null;
|
|
79
|
+
this.rowsPerPage = undefined;
|
|
80
|
+
this.cols = null;
|
|
78
81
|
this.columnsNumber = 0;
|
|
79
82
|
this.numberOfPages = 0;
|
|
80
83
|
this.tempPaginationDisable = false;
|
|
@@ -101,11 +104,15 @@ const TdsTableFooter$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableFooter e
|
|
|
101
104
|
relevantTableProps.forEach((tablePropName) => {
|
|
102
105
|
this[tablePropName] = this.tableEl[tablePropName];
|
|
103
106
|
});
|
|
104
|
-
|
|
107
|
+
if (this.rowsPerPage) {
|
|
108
|
+
/* Number of children which are <tds-table-body-row> */
|
|
109
|
+
const numberOfRows = Array.from(this.host.parentElement.querySelector('tds-table-body').children).filter((element) => element.tagName === 'TDS-TABLE-BODY-ROW').length;
|
|
110
|
+
this.numberOfPages = Math.ceil(numberOfRows / this.rowsPerPage);
|
|
111
|
+
}
|
|
112
|
+
/** Get the number of columns. */
|
|
105
113
|
const numberOfColumns = this.host.parentElement.querySelector('tds-table-header').childElementCount;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.columnsNumber = this.clientSetColumnsNumber;
|
|
114
|
+
if (this.cols) {
|
|
115
|
+
this.columnsNumber = this.cols;
|
|
109
116
|
}
|
|
110
117
|
else {
|
|
111
118
|
this.columnsNumber = numberOfColumns;
|
|
@@ -115,10 +122,10 @@ const TdsTableFooter$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableFooter e
|
|
|
115
122
|
const insertedValue = event.target.value;
|
|
116
123
|
if (insertedValue > this.numberOfPages || insertedValue < 1) {
|
|
117
124
|
event.target.classList.add('tds-table__page-selector-input--shake');
|
|
118
|
-
this.
|
|
125
|
+
this.defaultPage = event.target.max;
|
|
119
126
|
}
|
|
120
127
|
else {
|
|
121
|
-
this.
|
|
128
|
+
this.defaultPage = event.target.value;
|
|
122
129
|
}
|
|
123
130
|
const paginationEvent = this.tdsPageChange.emit({
|
|
124
131
|
tableId: this.tableId,
|
|
@@ -134,17 +141,18 @@ const TdsTableFooter$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableFooter e
|
|
|
134
141
|
}
|
|
135
142
|
}
|
|
136
143
|
render() {
|
|
137
|
-
var _a;
|
|
138
|
-
return (h(Host, { class: this.compactDesign ? 'tds-table--compact' : '' }, h("tr", { class: "tds-table__footer-row" }, h("td", { class: "tds-table__footer-cell", colSpan: this.columnsNumber }, this.pagination && (h("div", { class: "tds-table__pagination" }, h("div", { class: "tds-table__row-selector" }), h("div", { class: "tds-table__page-selector" }, h("input", { ref: (element) => (this.inputElement = element), class: "tds-table__page-selector-input", type: "number", min: "1", max: (_a = this.
|
|
144
|
+
var _a, _b, _c;
|
|
145
|
+
return (h(Host, { class: this.compactDesign ? 'tds-table--compact' : '' }, h("tr", { class: "tds-table__footer-row" }, h("td", { class: "tds-table__footer-cell", colSpan: this.columnsNumber }, this.pagination && (h("div", { class: "tds-table__pagination" }, h("div", { class: "tds-table__row-selector" }), h("div", { class: "tds-table__page-selector" }, h("input", { ref: (element) => (this.inputElement = element), class: "tds-table__page-selector-input", type: "number", min: "1", max: (_a = this.pages) !== null && _a !== void 0 ? _a : this.numberOfPages, value: this.defaultPage, pattern: "[0-9]+", dir: "rtl", onChange: (event) => this.paginationInputChange(event), onFocusout: (event) => this.paginationInputChange(event), onAnimationEnd: removeShakeAnimation, disabled: this.tempPaginationDisable }), h("p", { class: "tds-table__footer-text" }, "of", ' ', h("span", null, this.tempPaginationDisable ? 1 : (_b = this.pages) !== null && _b !== void 0 ? _b : this.numberOfPages), ' ', "pages"), h("button", { type: "button", class: "tds-table__footer-btn", disabled: this.defaultPage <= 1 || this.tempPaginationDisable, onClick: () => this.previousPage() }, h("tds-icon", { name: "chevron_left", size: "20px" })), h("button", { type: "button", class: "tds-table__footer-btn", disabled: this.defaultPage >= ((_c = this.pages) !== null && _c !== void 0 ? _c : this.numberOfPages) ||
|
|
146
|
+
this.tempPaginationDisable, onClick: () => this.nextPage() }, h("tds-icon", { name: "chevron_right", size: "20px" })))))))));
|
|
139
147
|
}
|
|
140
148
|
get host() { return this; }
|
|
141
149
|
static get style() { return tableFooterCss; }
|
|
142
150
|
}, [1, "tds-table-footer", {
|
|
143
151
|
"pagination": [516],
|
|
152
|
+
"defaultPage": [514, "default-page"],
|
|
153
|
+
"pages": [514],
|
|
144
154
|
"rowsPerPage": [514, "rows-per-page"],
|
|
145
|
-
"
|
|
146
|
-
"maxPages": [514, "max-pages"],
|
|
147
|
-
"clientSetColumnsNumber": [2, "client-set-columns-number"],
|
|
155
|
+
"cols": [2],
|
|
148
156
|
"columnsNumber": [32],
|
|
149
157
|
"numberOfPages": [32],
|
|
150
158
|
"tempPaginationDisable": [32],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
|
2
3
|
|
|
3
|
-
const tableToolbarCss = ":host{box-sizing:border-box;display:table-caption;position:relative;background-color:var(--tds-table-toolbar-background);color:var(--tds-table-color);padding:0 var(--tds-spacing-element-16);height:64px;border-top-left-radius:4px;border-top-right-radius:4px}:host *{box-sizing:border-box}:host .tds-table__upper-bar-flex{width:100%;height:100%;display:flex;justify-content:space-between}:host .tds-table__title{font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);padding-top:var(--tds-spacing-element-16);text-align:left}:host .tds-table__actionbar{display:flex;align-self:center;gap:8px}:host .tds-table__searchbar{display:flex;align-self:center;position:relative;height:40px;width:40px;border-radius:4px 4px 0 0;transition:background-color 250ms ease, width 250ms ease;overflow:hidden;background-color:transparent}:host .tds-table__searchbar::after{content:\"\";width:100%;height:2px;position:absolute;bottom:0;background-color:var(--tds-blue-400);transform:scaleX(0);transition:transform 150ms ease}:host .tds-table__searchbar:focus-within::after{transform:scaleX(100%)}:host .tds-table__searchbar:focus-within,:host .tds-table__searchbar.tds-table__searchbar--active{width:208px;background-color:var(--tds-table-toolbar-searchbar-background)}:host .tds-table__searchbar:focus-within:hover,:host .tds-table__searchbar.tds-table__searchbar--active:hover{background-color:var(--tds-table-toolbar-searchbar-background)}:host .tds-table__searchbar .tds-table__searchbar-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-table-color);z-index:1;width:100%;height:100%;border:none;padding:0 36px 0 16px;background-color:transparent;outline:none;cursor:pointer}:host .tds-table__searchbar .tds-table__searchbar-input :focus{background-color:var(--tds-table-toolbar-searchbar-background)}:host .tds-table__searchbar:hover{background-color:var(--tds-table-toolbar-searchbar-background-hover)}:host .tds-table__searchbar .tds-table__searchbar-icon{z-index:0;position:absolute;right:9px;top:9px;width:20px;height:20px}:host(.tds-table--compact){height:56px}";
|
|
4
|
+
const tableToolbarCss = ":host{box-sizing:border-box;display:table-caption;position:relative;background-color:var(--tds-table-toolbar-background);color:var(--tds-table-color);padding:0 var(--tds-spacing-element-16);height:64px;border-top-left-radius:4px;border-top-right-radius:4px}:host *{box-sizing:border-box}:host .tds-table__upper-bar-flex{width:100%;height:100%;display:flex;justify-content:space-between}:host .tds-table__title{font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);padding-top:var(--tds-spacing-element-16);text-align:left}:host .tds-table__actionbar,:host slot[name=end]::slotted(*){display:flex;align-self:center;gap:8px}:host .tds-table__searchbar{display:flex;align-self:center;position:relative;height:40px;width:40px;border-radius:4px 4px 0 0;transition:background-color 250ms ease, width 250ms ease;overflow:hidden;background-color:transparent}:host .tds-table__searchbar::after{content:\"\";width:100%;height:2px;position:absolute;bottom:0;background-color:var(--tds-blue-400);transform:scaleX(0);transition:transform 150ms ease}:host .tds-table__searchbar:focus-within::after{transform:scaleX(100%)}:host .tds-table__searchbar:focus-within,:host .tds-table__searchbar.tds-table__searchbar--active{width:208px;background-color:var(--tds-table-toolbar-searchbar-background)}:host .tds-table__searchbar:focus-within:hover,:host .tds-table__searchbar.tds-table__searchbar--active:hover{background-color:var(--tds-table-toolbar-searchbar-background)}:host .tds-table__searchbar .tds-table__searchbar-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-table-color);z-index:1;width:100%;height:100%;border:none;padding:0 36px 0 16px;background-color:transparent;outline:none;cursor:pointer}:host .tds-table__searchbar .tds-table__searchbar-input :focus{background-color:var(--tds-table-toolbar-searchbar-background)}:host .tds-table__searchbar:hover{background-color:var(--tds-table-toolbar-searchbar-background-hover)}:host .tds-table__searchbar .tds-table__searchbar-icon{z-index:0;position:absolute;right:9px;top:9px;width:20px;height:20px}:host(.tds-table--compact){height:56px}";
|
|
4
5
|
|
|
5
6
|
const relevantTableProps = [
|
|
6
7
|
'compactDesign',
|
|
@@ -64,7 +65,7 @@ const TdsTableToolbar$1 = /*@__PURE__*/ proxyCustomElement(class TdsTableToolbar
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
render() {
|
|
67
|
-
return (h(Host, { class: this.compactDesign ? 'tds-table--compact' : '' }, h("div", { class: "tds-table__upper-bar-flex" }, h("caption", { class: "tds-table__title" }, this.tableTitle), h("div", { class: "tds-table__actionbar" }, this.enableFiltering && (h("div", { class: "tds-table__searchbar" }, h("input", { class: "tds-table__searchbar-input", type: "text", onKeyUp: (event) => this.searchFunction(event) }), h("span", { class: "tds-table__searchbar-icon" }, h("
|
|
68
|
+
return (h(Host, { class: this.compactDesign ? 'tds-table--compact' : '' }, h("div", { class: "tds-table__upper-bar-flex" }, h("caption", { class: "tds-table__title" }, this.tableTitle), h("div", { class: "tds-table__actionbar" }, this.enableFiltering && (h("div", { class: "tds-table__searchbar" }, h("input", { class: "tds-table__searchbar-input", type: "text", onKeyUp: (event) => this.searchFunction(event) }), h("span", { class: "tds-table__searchbar-icon" }, h("tds-icon", { name: "search", size: "20px" })))), h("slot", { name: "end" })))));
|
|
68
69
|
}
|
|
69
70
|
get host() { return this; }
|
|
70
71
|
static get style() { return tableToolbarCss; }
|
|
@@ -81,13 +82,18 @@ function defineCustomElement$1() {
|
|
|
81
82
|
if (typeof customElements === "undefined") {
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
|
-
const components = ["tds-table-toolbar"];
|
|
85
|
+
const components = ["tds-table-toolbar", "tds-icon"];
|
|
85
86
|
components.forEach(tagName => { switch (tagName) {
|
|
86
87
|
case "tds-table-toolbar":
|
|
87
88
|
if (!customElements.get(tagName)) {
|
|
88
89
|
customElements.define(tagName, TdsTableToolbar$1);
|
|
89
90
|
}
|
|
90
91
|
break;
|
|
92
|
+
case "tds-icon":
|
|
93
|
+
if (!customElements.get(tagName)) {
|
|
94
|
+
defineCustomElement$2();
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
91
97
|
} });
|
|
92
98
|
}
|
|
93
99
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as generateUniqueId } from './utils.js';
|
|
2
3
|
|
|
3
4
|
const tableCss = ":host,.tds-table{border-collapse:collapse;display:table;box-sizing:border-box}:host *,.tds-table *{box-sizing:border-box}:host(.tds-table--responsive),.tds-table--responsive{width:100%}";
|
|
4
5
|
|
|
@@ -15,7 +16,7 @@ const TdsTable$1 = /*@__PURE__*/ proxyCustomElement(class TdsTable extends HTMLE
|
|
|
15
16
|
this.enableExpandableRows = false;
|
|
16
17
|
this.enableResponsive = false;
|
|
17
18
|
this.modeVariant = null;
|
|
18
|
-
this.tableId =
|
|
19
|
+
this.tableId = generateUniqueId();
|
|
19
20
|
}
|
|
20
21
|
emitInternalTdsPropChange(changedValueName, changedValue) {
|
|
21
22
|
this.internalTdsTablePropChange.emit({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { h as hasSlot } from './utils.js';
|
|
2
3
|
import { d as defineCustomElement$2 } from './icon.js';
|
|
3
4
|
|
|
4
5
|
const textFieldCss = ".text-field-input-lg.sc-tds-text-field{all:unset;border-radius:4px 4px 0 0;width:100%;box-sizing:border-box;margin:0;border:none;outline:none;height:100%;color:var(--tds-text-field-color);background-color:var(--tds-text-field-background);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:var(--tds-spacing-element-20) var(--tds-spacing-element-16)}.text-field-input-lg.sc-tds-text-field::placeholder{opacity:1;color:var(--tds-text-field-placeholder)}.text-field-input-lg.sc-tds-text-field:focus::placeholder{color:var(--tds-text-field-placeholder-focus-color)}.text-field-input-lg.sc-tds-text-field:disabled{cursor:not-allowed;background-color:var(--tds-text-field-background-disabled);color:var(--tds-text-field-color-disabled)}.text-field-input-lg.sc-tds-text-field:disabled::placeholder{color:var(--tds-text-field-placeholder-disabled)}.text-field-input-lg.sc-tds-text-field:disabled~.text-field-label-inside.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-input-md.sc-tds-text-field{all:unset;border-radius:4px 4px 0 0;width:100%;box-sizing:border-box;margin:0;border:none;outline:none;height:100%;color:var(--tds-text-field-color);background-color:var(--tds-text-field-background);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:var(--tds-spacing-element-16)}.text-field-input-md.sc-tds-text-field::placeholder{opacity:1;color:var(--tds-text-field-placeholder)}.text-field-input-md.sc-tds-text-field:focus::placeholder{color:var(--tds-text-field-placeholder-focus-color)}.text-field-input-md.sc-tds-text-field:disabled{cursor:not-allowed;background-color:var(--tds-text-field-background-disabled);color:var(--tds-text-field-color-disabled)}.text-field-input-md.sc-tds-text-field:disabled::placeholder{color:var(--tds-text-field-placeholder-disabled)}.text-field-input-md.sc-tds-text-field:disabled~.text-field-label-inside.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-input-sm.sc-tds-text-field{all:unset;border-radius:4px 4px 0 0;width:100%;box-sizing:border-box;margin:0;border:none;outline:none;height:100%;color:var(--tds-text-field-color);background-color:var(--tds-text-field-background);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:var(--tds-spacing-element-16)}.text-field-input-sm.sc-tds-text-field::placeholder{opacity:1;color:var(--tds-text-field-placeholder)}.text-field-input-sm.sc-tds-text-field:focus::placeholder{color:var(--tds-text-field-placeholder-focus-color)}.text-field-input-sm.sc-tds-text-field:disabled{cursor:not-allowed;background-color:var(--tds-text-field-background-disabled);color:var(--tds-text-field-color-disabled)}.text-field-input-sm.sc-tds-text-field:disabled::placeholder{color:var(--tds-text-field-placeholder-disabled)}.text-field-input-sm.sc-tds-text-field:disabled~.text-field-label-inside.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-container.sc-tds-text-field{border-radius:4px 4px 0 0;display:flex;position:relative;height:56px;box-sizing:border-box;background-color:var(--tds-text-field-background);border-bottom:1px solid var(--tds-text-field-border-bottom);transition:border-bottom-color 200ms ease}.text-field-container.sc-tds-text-field:hover{border-bottom-color:var(--tds-text-field-border-bottom-hover)}.form-text-field-md.sc-tds-text-field .text-field-container.sc-tds-text-field{height:48px}.form-text-field-sm.sc-tds-text-field .text-field-container.sc-tds-text-field{height:40px}.text-field-input-container.sc-tds-text-field{position:relative;width:100%}.text-field-label-outside.sc-tds-text-field>*.sc-tds-text-field{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:block;margin-bottom:var(--tds-spacing-element-8);color:var(--tds-text-field-label-color)}.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);position:absolute;pointer-events:none;color:var(--tds-text-field-label-inside-color);left:16px}.form-text-field.sc-tds-text-field{display:block;min-width:208px}.form-text-field-nomin.sc-tds-text-field{min-width:auto}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field{padding-top:var(--tds-spacing-element-24);padding-bottom:15px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{top:20px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field .sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-lg.sc-tds-text-field:focus::placeholder{transition:color 0.35s ease;color:var(--tds-text-field-placeholder-focus-color)}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field{padding-top:var(--tds-spacing-element-20);padding-bottom:11px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{top:16px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field .sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-md.sc-tds-text-field:focus::placeholder{transition:color 0.35s ease;color:var(--tds-text-field-placeholder-focus-color)}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field{padding-top:var(--tds-spacing-element-20);padding-bottom:11px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{top:16px}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field .sc-tds-text-field::placeholder{color:transparent}.form-text-field.text-field-container-label-inside.sc-tds-text-field .text-field-input-sm.sc-tds-text-field:focus::placeholder{transition:color 0.35s ease;color:var(--tds-text-field-placeholder-focus-color)}.form-text-field.text-field-container-label-inside.text-field-focus.sc-tds-text-field .text-field-input-sm.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field,.form-text-field.text-field-container-label-inside.text-field-data.sc-tds-text-field .text-field-input-sm.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:0.1s ease all;top:8px}.form-text-field.text-field-container-label-inside.text-field-focus.sc-tds-text-field .text-field-input-md.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field,.form-text-field.text-field-container-label-inside.text-field-data.sc-tds-text-field .text-field-input-md.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:0.1s ease all;top:8px}.form-text-field.text-field-container-label-inside.text-field-focus.sc-tds-text-field .text-field-input-lg.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field,.form-text-field.text-field-container-label-inside.text-field-data.sc-tds-text-field .text-field-input-lg.sc-tds-text-field~.text-field-label-inside.sc-tds-text-field{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:0.1s ease all;top:12px}.text-field-bar.sc-tds-text-field{position:absolute;width:100%}.text-field-bar.sc-tds-text-field::before,.text-field-bar.sc-tds-text-field::after{content:\"\";height:2px;top:54px;width:0;position:absolute;background:var(--tds-text-field-bar);transition:0.35s ease all}.form-text-field-md.sc-tds-text-field .text-field-bar.sc-tds-text-field::before,.form-text-field-md.sc-tds-text-field .text-field-bar.sc-tds-text-field::after{top:46px}.form-text-field-sm.sc-tds-text-field .text-field-bar.sc-tds-text-field::before,.form-text-field-sm.sc-tds-text-field .text-field-bar.sc-tds-text-field::after{top:40px}.text-field-bar.sc-tds-text-field::before{left:50%}.text-field-bar.sc-tds-text-field::after{right:50%}.text-field-focus.sc-tds-text-field .text-field-bar.sc-tds-text-field::before,.text-field-focus.sc-tds-text-field .text-field-bar.sc-tds-text-field::after{width:50%}.text-field-helper.sc-tds-text-field{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;gap:8px;justify-content:space-between;flex-basis:100%;padding-top:var(--tds-spacing-element-4);color:var(--tds-text-field-helper)}.text-field-helper.sc-tds-text-field .text-field-textcounter.sc-tds-text-field{margin-left:auto}.form-text-field-disabled.sc-tds-text-field .text-field-container.sc-tds-text-field{border-bottom-color:transparent}.form-text-field-disabled.sc-tds-text-field .text-field-slot-wrap-prefix.sc-tds-text-field>*.sc-tds-text-field,.form-text-field-disabled.sc-tds-text-field .text-field-slot-wrap-suffix.sc-tds-text-field>*.sc-tds-text-field{color:var(--tds-text-field-ps-color-disabled)}.form-text-field-disabled.sc-tds-text-field .text-field-label-outside.sc-tds-text-field>*.sc-tds-text-field{color:var(--tds-text-field-label-disabled)}.text-field-icon__readonly.sc-tds-text-field{display:none;position:absolute;right:18px;top:18px;color:var(--tds-text-field-icon-read-only-label-color)}.text-field-icon__readonly-label.sc-tds-text-field{display:none;position:absolute;right:18px;top:48px;font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);padding:8px;white-space:nowrap;border-radius:4px 0 4px 4px;background-color:var(--tds-text-field-icon-read-only-label-background)}.form-text-field-readonly.sc-tds-text-field{pointer-events:none}.form-text-field-readonly.sc-tds-text-field .text-field-icon__readonly.sc-tds-text-field{display:block}.form-text-field-readonly.sc-tds-text-field .text-field-icon__readonly.sc-tds-text-field:hover~.text-field-icon__readonly-label.sc-tds-text-field{display:block}.form-text-field-readonly.sc-tds-text-field .text-field-input.sc-tds-text-field{padding-right:54px;background-color:transparent}.form-text-field-success.sc-tds-text-field .text-field-container.sc-tds-text-field{border-bottom-color:var(--tds-text-field-border-bottom-success)}.form-text-field-error.sc-tds-text-field .text-field-helper.sc-tds-text-field{color:var(--tds-text-field-helper-error)}.form-text-field-error.sc-tds-text-field .text-field-container.sc-tds-text-field{border-bottom-color:var(--tds-text-field-border-bottom-error)}.form-text-field-error.sc-tds-text-field .text-field-bar.sc-tds-text-field::before,.form-text-field-error.sc-tds-text-field .text-field-bar.sc-tds-text-field::after{background:var(--tds-text-field-bar-error)}.text-field-helper-error-state.sc-tds-text-field{display:flex;gap:8px;flex-wrap:nowrap}.text-field-textcounter.sc-tds-text-field{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-text-field-textcounter);float:right}.text-field-textcounter.sc-tds-text-field .text-field-textcounter-divider.sc-tds-text-field{color:var(--tds-text-field-textcounter-divider)}.text-field-slot-wrap-prefix.sc-tds-text-field,.text-field-slot-wrap-suffix.sc-tds-text-field{align-self:center;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);margin:0 0 0 14px;color:var(--tds-text-field-ps-color)}.text-field-slot-wrap-prefix.sc-tds-text-field-s>:not(tds-icon),.text-field-slot-wrap-suffix.sc-tds-text-field-s>:not(tds-icon){margin:0 0 0 2px}.text-field-slot-wrap-prefix.text-field-error.sc-tds-text-field,.text-field-slot-wrap-suffix.text-field-error.sc-tds-text-field{color:var(--tds-text-field-ps-color-error)}.text-field-slot-wrap-suffix.sc-tds-text-field{margin:0 14px 0 0}.text-field-slot-wrap-suffix.sc-tds-text-field-s>:not(tds-icon){margin:0 2px 0 0}";
|
|
@@ -49,6 +50,8 @@ const TdsTextField$1 = /*@__PURE__*/ proxyCustomElement(class TdsTextField exten
|
|
|
49
50
|
}
|
|
50
51
|
render() {
|
|
51
52
|
var _a;
|
|
53
|
+
const usesPrefixSlot = hasSlot('prefix', this.host);
|
|
54
|
+
const usesSuffixSlot = hasSlot('suffix', this.host);
|
|
52
55
|
return (h("div", { class: `
|
|
53
56
|
${this.noMinWidth ? 'form-text-field-nomin' : ''}
|
|
54
57
|
${this.focusInput && !this.disabled
|
|
@@ -64,7 +67,7 @@ const TdsTextField$1 = /*@__PURE__*/ proxyCustomElement(class TdsTextField exten
|
|
|
64
67
|
${this.size === 'md' ? 'form-text-field-md' : ''}
|
|
65
68
|
${this.size === 'sm' ? 'form-text-field-sm' : ''}
|
|
66
69
|
${this.state === 'error' || this.state === 'success' ? `form-text-field-${this.state}` : ''}
|
|
67
|
-
` }, this.labelPosition === 'outside' && (h("div", { class: "text-field-label-outside" }, h("div", null, this.label))), h("div", { onClick: () => this.textInput.focus(), class: "text-field-container" }, h("div", { class: `text-field-slot-wrap-prefix text-field-${this.state}` }, h("slot", { name: "prefix" })), h("div", { class: "text-field-input-container" }, h("input", { ref: (inputEl) => (this.textInput = inputEl), class: `text-field-input text-field-input-${this.size}`, type: this.type, disabled: this.disabled, readonly: this.readOnly, placeholder: this.placeholder, value: this.value, autofocus: this.autofocus, maxlength: this.maxLength, name: this.name, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onFocus: (event) => {
|
|
70
|
+
` }, this.labelPosition === 'outside' && (h("div", { class: "text-field-label-outside" }, h("div", null, this.label))), h("div", { onClick: () => this.textInput.focus(), class: "text-field-container" }, usesPrefixSlot && (h("div", { class: `text-field-slot-wrap-prefix text-field-${this.state}` }, h("slot", { name: "prefix" }))), h("div", { class: "text-field-input-container" }, h("input", { ref: (inputEl) => (this.textInput = inputEl), class: `text-field-input text-field-input-${this.size}`, type: this.type, disabled: this.disabled, readonly: this.readOnly, placeholder: this.placeholder, value: this.value, autofocus: this.autofocus, maxlength: this.maxLength, name: this.name, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onFocus: (event) => {
|
|
68
71
|
if (!this.readOnly) {
|
|
69
72
|
this.handleFocus(event);
|
|
70
73
|
}
|
|
@@ -72,8 +75,9 @@ const TdsTextField$1 = /*@__PURE__*/ proxyCustomElement(class TdsTextField exten
|
|
|
72
75
|
if (!this.readOnly) {
|
|
73
76
|
this.handleBlur(event);
|
|
74
77
|
}
|
|
75
|
-
} }), this.labelPosition === 'inside' && this.size !== 'sm' && (h("label", { class: "text-field-label-inside" }, this.label))), h("div", { class: "text-field-bar" }), h("div", { class: `text-field-slot-wrap-suffix text-field-${this.state}` }, h("slot", { name: "suffix" })), h("span", { class: "text-field-icon__readonly" }, h("tds-icon", { name: "edit_inactive", size: "20px" })), h("span", { class: "text-field-icon__readonly-label" }, "This field is non-editable")), h("div", { class: "text-field-helper" }, this.state === 'error' && (h("div", { class: "text-field-helper-error-state" }, h("tds-icon", { name: "error", size: "16px" }), this.helper)), this.state !== 'error' && this.helper, this.maxLength > 0 && (h("div", { class: "text-field-textcounter" }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { class: "text-field-textcounter-divider" }, " / "), this.maxLength)))));
|
|
78
|
+
} }), this.labelPosition === 'inside' && this.size !== 'sm' && (h("label", { class: "text-field-label-inside" }, this.label))), h("div", { class: "text-field-bar" }), usesSuffixSlot && (h("div", { class: `text-field-slot-wrap-suffix text-field-${this.state}` }, h("slot", { name: "suffix" }))), h("span", { class: "text-field-icon__readonly" }, h("tds-icon", { name: "edit_inactive", size: "20px" })), h("span", { class: "text-field-icon__readonly-label" }, "This field is non-editable")), h("div", { class: "text-field-helper" }, this.state === 'error' && (h("div", { class: "text-field-helper-error-state" }, h("tds-icon", { name: "error", size: "16px" }), this.helper)), this.state !== 'error' && this.helper, this.maxLength > 0 && (h("div", { class: "text-field-textcounter" }, this.value === null ? 0 : (_a = this.value) === null || _a === void 0 ? void 0 : _a.length, h("span", { class: "text-field-textcounter-divider" }, " / "), this.maxLength)))));
|
|
76
79
|
}
|
|
80
|
+
get host() { return this; }
|
|
77
81
|
static get style() { return textFieldCss; }
|
|
78
82
|
}, [6, "tds-text-field", {
|
|
79
83
|
"type": [513],
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as generateUniqueId, h as hasSlot } from './utils.js';
|
|
2
3
|
import { d as defineCustomElement$2 } from './icon.js';
|
|
3
4
|
|
|
4
|
-
const toastCss = ":host(.hide){display:none;visibility:hidden}:host{z-index:700}:host .
|
|
5
|
+
const toastCss = ":host(.hide){display:none;visibility:hidden}:host{z-index:700}:host .wrapper{display:flex;width:348px;background-color:var(--tds-toast-background-color);border-radius:4px}:host .wrapper.information{border-left:4px solid var(--tds-information)}:host .wrapper.information tds-icon{color:var(--tds-information)}:host .wrapper.success{border-left:4px solid var(--tds-positive)}:host .wrapper.success tds-icon{color:var(--tds-positive)}:host .wrapper.error{border-left:4px solid var(--tds-negative)}:host .wrapper.error tds-icon{color:var(--tds-negative)}:host .wrapper.warning{border-left:4px solid var(--tds-warning)}:host .wrapper.warning tds-icon{color:var(--tds-warning)}:host .wrapper button.close{height:20px;width:20px;display:flex;align-items:center;justify-content:center;margin:14px 14px 0 0;border:none;background:transparent}:host .wrapper button.close:hover{cursor:pointer}:host .wrapper button.close:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .wrapper button.close tds-icon{color:var(--tds-toast-dissmiss-color);padding:0}:host tds-icon{padding:14px 0 0 12px}:host .content{padding:16px 0 16px 10px;display:flex;flex-direction:column;flex:1}:host .content .header-subheader{display:flex;flex-direction:column;gap:4px}:host .content .header,:host .content slot[name=header]::slotted(*){font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);color:var(--tds-toast-headline-color)}:host .content .subheader,:host .content slot[name=subheader]::slotted(*){margin-top:4px;color:var(--tds-toast-subheadline-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);max-width:252px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .content .subheader.no-link slot::slotted(*),:host .content slot[name=subheader]::slotted(*).no-link slot::slotted(*){padding-bottom:0}:host .content .toast-bottom.subheader{margin-top:16px}:host .content .toast-bottom.no-subheader{margin-top:4px}:host slot[name=bottom]::slotted(*){color:var(--tds-toast-link-color)}:host .tds-mode-variant-primary{--tds-toast-background:var(--tds-toast-background-primary)}:host .tds-mode-variant-secondary{--tds-toast-background:var(--tds-toast-background-secondary)}";
|
|
5
6
|
|
|
6
7
|
const TdsToast$1 = /*@__PURE__*/ proxyCustomElement(class TdsToast extends HTMLElement {
|
|
7
8
|
constructor() {
|
|
@@ -39,46 +40,30 @@ const TdsToast$1 = /*@__PURE__*/ proxyCustomElement(class TdsToast extends HTMLE
|
|
|
39
40
|
this.hidden = false;
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
this.
|
|
43
|
-
if (!this.hasSubheader && !this.hasLink) {
|
|
44
|
-
return 'only-header';
|
|
45
|
-
}
|
|
46
|
-
if (!this.hasSubheader) {
|
|
47
|
-
return 'no-subheader';
|
|
48
|
-
}
|
|
49
|
-
return '';
|
|
50
|
-
};
|
|
51
|
-
this.toastId = crypto.randomUUID();
|
|
43
|
+
this.toastId = generateUniqueId();
|
|
52
44
|
this.header = undefined;
|
|
53
45
|
this.subheader = undefined;
|
|
54
46
|
this.type = 'information';
|
|
55
47
|
this.hidden = false;
|
|
56
48
|
this.toastRole = 'alert';
|
|
57
|
-
this.hasSubheader = undefined;
|
|
58
|
-
this.hasLink = undefined;
|
|
59
49
|
}
|
|
60
50
|
/** Hides the Toast. */
|
|
61
51
|
async hideToast() {
|
|
62
|
-
this.
|
|
52
|
+
this.hidden = true;
|
|
63
53
|
}
|
|
64
54
|
/** Shows the Toast. */
|
|
65
55
|
async showToast() {
|
|
66
|
-
this.
|
|
67
|
-
}
|
|
68
|
-
connectedCallback() {
|
|
69
|
-
const children = Array.from(this.host.children);
|
|
70
|
-
this.hasSubheader = children.some((childElement) => childElement.slot === 'toast-subheader');
|
|
71
|
-
this.hasLink = children.some((childElement) => childElement.slot === 'toast-link');
|
|
56
|
+
this.hidden = false;
|
|
72
57
|
}
|
|
73
58
|
render() {
|
|
59
|
+
const usesHeaderSlot = hasSlot('header', this.host);
|
|
60
|
+
const usesSubheaderSlot = hasSlot('subheader', this.host);
|
|
61
|
+
const usesBottomSlot = hasSlot('bottom', this.host);
|
|
74
62
|
return (h(Host, { toastRole: this.toastRole, "aria-describedby": this.host.getAttribute('aria-describedby'), class: `${this.hidden ? 'hide' : 'show'}` }, h("div", { class: `
|
|
75
|
-
|
|
76
|
-
${this.type}
|
|
77
|
-
` }, h("tds-icon", { name: this.getIconName(), size: "20px" }), h("div", { class: `toast-content` }, h("div", { class: `toast-header
|
|
78
|
-
${this.getHeaderClasses()}
|
|
79
|
-
` }, this.header), h("div", { class: `toast-subheader ${this.hasLink ? '' : 'no-link'}` }, h("slot", { name: "toast-subheader" })), h("slot", { name: "toast-link" })), h("button", { onClick: () => {
|
|
63
|
+
wrapper
|
|
64
|
+
${this.type}` }, h("tds-icon", { name: this.getIconName(), size: "20px" }), h("div", { class: `content` }, h("div", { class: "header-subheader" }, this.header && h("div", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("div", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" })), usesBottomSlot && (h("div", { class: `toast-bottom ${usesSubheaderSlot || this.subheader ? 'subheader' : 'no-subheader'}` }, h("slot", { name: "bottom" })))), h("button", { onClick: () => {
|
|
80
65
|
this.handleClose();
|
|
81
|
-
}, class: `
|
|
66
|
+
}, class: `close` }, h("tds-icon", { name: "cross", size: "20px" })))));
|
|
82
67
|
}
|
|
83
68
|
get host() { return this; }
|
|
84
69
|
static get style() { return toastCss; }
|
|
@@ -87,10 +72,8 @@ const TdsToast$1 = /*@__PURE__*/ proxyCustomElement(class TdsToast extends HTMLE
|
|
|
87
72
|
"header": [1],
|
|
88
73
|
"subheader": [1],
|
|
89
74
|
"type": [1],
|
|
90
|
-
"hidden": [
|
|
75
|
+
"hidden": [516],
|
|
91
76
|
"toastRole": [1, "toast-role"],
|
|
92
|
-
"hasSubheader": [32],
|
|
93
|
-
"hasLink": [32],
|
|
94
77
|
"hideToast": [64],
|
|
95
78
|
"showToast": [64]
|
|
96
79
|
}]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as generateUniqueId } from './utils.js';
|
|
2
3
|
|
|
3
4
|
const toggleCss = ".tds-toggle.sc-tds-toggle .toggle-headline.sc-tds-toggle{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);color:var(--tds-toggle-headline);margin-bottom:12px}.tds-toggle.sc-tds-toggle .toggle-headline.disabled.sc-tds-toggle{color:var(--tds-toggle-headline-disabled)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle{appearance:initial;margin:0;width:44px;height:24px;position:relative;display:inline-block;vertical-align:middle}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle::after,.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle::before{content:\"\";position:absolute;box-sizing:border-box;transition:all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle::before{width:44px;height:24px;border-radius:16px;background-color:var(--tds-toggle-off-slider);left:0}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle::after{width:16px;height:16px;background-color:var(--tds-toggle-switch);border-radius:50%;left:4px;top:4px}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:focus{outline:none}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:focus::before{background-color:var(--tds-toggle-off-slider-focus);border:1px solid var(--tds-toggle-off-border-focus)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:checked::before{background-color:var(--tds-toggle-on-slider);border:1px solid var(--tds-toggle-on-border-focus)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:checked::after{left:24px}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:disabled::before{background-color:var(--tds-toggle-slider-disabled);border:1px solid var(--tds-toggle-slider-disabled)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:disabled::after{background-color:var(--tds-toggle-switch-disabled)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:disabled:checked::before{background-color:var(--tds-toggle-on-slider-disabled);border:1px solid var(--tds-toggle-on-slider-disabled)}.tds-toggle.sc-tds-toggle input[type=checkbox].sc-tds-toggle:disabled:checked::after{background-color:var(--tds-toggle-switch-disabled)}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle{width:28px;height:16px}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle::before{width:28px;height:16px}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle::after{width:8px;height:8px}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle:checked::before{background-color:var(--tds-toggle-on-slider)}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle:checked::after{left:16px}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle:disabled::before{background-color:var(--tds-toggle-slider-disabled);border:1px solid var(--tds-toggle-slider-disabled)}.tds-toggle.sc-tds-toggle input[type=checkbox].sm.sc-tds-toggle:disabled::after{background-color:var(--tds-toggle-switch-disabled)}.tds-toggle.sc-tds-toggle label.sc-tds-toggle{display:inline-block;vertical-align:middle;font:var(--tds-detail-01);letter-spacing:var(--tds-detail-01-ls);color:var(--tds-toggle-label-color);padding-left:8px}.tds-toggle.sc-tds-toggle label.disabled.sc-tds-toggle{color:var(--tds-toggle-label-color-disabled)}";
|
|
4
5
|
|
|
@@ -20,7 +21,7 @@ const TdsToggle$1 = /*@__PURE__*/ proxyCustomElement(class TdsToggle extends HTM
|
|
|
20
21
|
this.name = undefined;
|
|
21
22
|
this.headline = undefined;
|
|
22
23
|
this.disabled = false;
|
|
23
|
-
this.toggleId =
|
|
24
|
+
this.toggleId = generateUniqueId();
|
|
24
25
|
}
|
|
25
26
|
/** Toggles the Toggle. */
|
|
26
27
|
async toggle() {
|
|
@@ -19,6 +19,11 @@ const TdsTooltip$1 = /*@__PURE__*/ proxyCustomElement(class TdsTooltip extends H
|
|
|
19
19
|
this.popperInstance = undefined;
|
|
20
20
|
this.target = undefined;
|
|
21
21
|
}
|
|
22
|
+
/** Method to update the Tooltip. Will reevaluate the Tooltips position. */
|
|
23
|
+
async updateTooltip() {
|
|
24
|
+
var _a;
|
|
25
|
+
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
|
|
26
|
+
}
|
|
22
27
|
componentDidLoad() {
|
|
23
28
|
var _a;
|
|
24
29
|
this.target = (_a = this.referenceEl) !== null && _a !== void 0 ? _a : document.querySelector(this.selector);
|
|
@@ -90,7 +95,6 @@ const TdsTooltip$1 = /*@__PURE__*/ proxyCustomElement(class TdsTooltip extends H
|
|
|
90
95
|
var _a;
|
|
91
96
|
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
92
97
|
}
|
|
93
|
-
/* Slot on line 118 is added to support adding HTML elements to component */
|
|
94
98
|
render() {
|
|
95
99
|
return (h("span", { ref: (el) => {
|
|
96
100
|
this.tooltip = el;
|
|
@@ -105,7 +109,8 @@ const TdsTooltip$1 = /*@__PURE__*/ proxyCustomElement(class TdsTooltip extends H
|
|
|
105
109
|
"show": [1028],
|
|
106
110
|
"placement": [1],
|
|
107
111
|
"popperInstance": [32],
|
|
108
|
-
"target": [32]
|
|
112
|
+
"target": [32],
|
|
113
|
+
"updateTooltip": [64]
|
|
109
114
|
}]);
|
|
110
115
|
function defineCustomElement$1() {
|
|
111
116
|
if (typeof customElements === "undefined") {
|
package/dist/components/utils.js
CHANGED
|
@@ -500,16 +500,35 @@ function isFocusable(element) {
|
|
|
500
500
|
return false;
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
* @param
|
|
506
|
-
*
|
|
507
|
-
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
503
|
+
* Checks if the provided element has a slotted element
|
|
504
|
+
* in the slot with the corresponding slotName
|
|
505
|
+
* @param slotName the name of the slot.
|
|
506
|
+
* @param element the element to look for the slot within.
|
|
507
|
+
*/
|
|
508
|
+
const hasSlot = (slotName, element) => !!element.querySelector(`[slot="${slotName}"]`);
|
|
509
|
+
/**
|
|
510
|
+
* Generates a reasonably unique string ID based on current time (minutes, seconds, milliseconds) and random numbers.
|
|
511
|
+
*
|
|
512
|
+
* This function combines the current time and random numbers to generate
|
|
513
|
+
* a unique string ID. The function assumes that it won't be called frequently
|
|
514
|
+
* enough to generate two identical IDs within a millisecond, or that the random
|
|
515
|
+
* number generator will produce the same value twice in quick succession.
|
|
516
|
+
*
|
|
517
|
+
* Note: The IDs generated by this function are not globally unique and their length may vary.
|
|
518
|
+
* For truly unique and fixed-length IDs, consider using a more robust method such as UUID.
|
|
519
|
+
*
|
|
520
|
+
* @returns {string} A unique string ID.
|
|
521
|
+
*/
|
|
522
|
+
function generateUniqueId() {
|
|
523
|
+
const now = new Date();
|
|
524
|
+
const timeInMilliseconds = now.getMinutes() * 60000 + now.getSeconds() * 1000 + now.getMilliseconds(); // Get current time in milliseconds from the start of the hour
|
|
525
|
+
const randomNum1 = Math.floor(Math.random() * 1000000); // Random number between 0 and 999999
|
|
526
|
+
const randomNum2 = Math.floor(Math.random() * 1000000); // Another random number
|
|
527
|
+
// Convert to base 36 (using numbers and letters) and remove '0.' from the random number
|
|
528
|
+
const uniqueString = randomNum1.toString(36).substring(2) +
|
|
529
|
+
timeInMilliseconds.toString(36) +
|
|
530
|
+
randomNum2.toString(36).substring(2);
|
|
531
|
+
return uniqueString;
|
|
532
|
+
}
|
|
514
533
|
|
|
515
|
-
export { appendChildElement as a, appendHiddenInput as b, findPreviousFocusableItem as c,
|
|
534
|
+
export { appendChildElement as a, appendHiddenInput as b, findPreviousFocusableItem as c, dfs as d, getPreviousNestedChildOfSiblingsMatching as e, findNextFocusableItem as f, generateUniqueId as g, hasSlot as h, inheritAriaAttributes as i, isHeadingElement as j, isFocusable as k, updateListChildrenRoles as u };
|
|
@@ -2144,18 +2144,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2144
2144
|
return import(
|
|
2145
2145
|
/* webpackMode: "lazy" */
|
|
2146
2146
|
'./tds-datetime.entry.js').then(processMod, consoleError);
|
|
2147
|
-
case 'tds-dropdown
|
|
2147
|
+
case 'tds-dropdown':
|
|
2148
2148
|
return import(
|
|
2149
2149
|
/* webpackMode: "lazy" */
|
|
2150
|
-
'./tds-dropdown
|
|
2151
|
-
case 'tds-dropdown-option
|
|
2150
|
+
'./tds-dropdown.entry.js').then(processMod, consoleError);
|
|
2151
|
+
case 'tds-dropdown-option':
|
|
2152
2152
|
return import(
|
|
2153
2153
|
/* webpackMode: "lazy" */
|
|
2154
|
-
'./tds-dropdown-option
|
|
2155
|
-
case 'tds-dropdown-v2':
|
|
2156
|
-
return import(
|
|
2157
|
-
/* webpackMode: "lazy" */
|
|
2158
|
-
'./tds-dropdown-v2.entry.js').then(processMod, consoleError);
|
|
2154
|
+
'./tds-dropdown-option.entry.js').then(processMod, consoleError);
|
|
2159
2155
|
case 'tds-folder-tab':
|
|
2160
2156
|
return import(
|
|
2161
2157
|
/* webpackMode: "lazy" */
|
|
@@ -2368,10 +2364,6 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2368
2364
|
return import(
|
|
2369
2365
|
/* webpackMode: "lazy" */
|
|
2370
2366
|
'./tds-divider.entry.js').then(processMod, consoleError);
|
|
2371
|
-
case 'tds-dropdown_2':
|
|
2372
|
-
return import(
|
|
2373
|
-
/* webpackMode: "lazy" */
|
|
2374
|
-
'./tds-dropdown_2.entry.js').then(processMod, consoleError);
|
|
2375
2367
|
case 'tds-header-dropdown-list':
|
|
2376
2368
|
return import(
|
|
2377
2369
|
/* webpackMode: "lazy" */
|
|
@@ -2396,14 +2388,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2396
2388
|
return import(
|
|
2397
2389
|
/* webpackMode: "lazy" */
|
|
2398
2390
|
'./tds-side-menu-item.entry.js').then(processMod, consoleError);
|
|
2399
|
-
case 'tds-core-header-item_2':
|
|
2400
|
-
return import(
|
|
2401
|
-
/* webpackMode: "lazy" */
|
|
2402
|
-
'./tds-core-header-item_2.entry.js').then(processMod, consoleError);
|
|
2403
2391
|
case 'tds-checkbox':
|
|
2404
2392
|
return import(
|
|
2405
2393
|
/* webpackMode: "lazy" */
|
|
2406
2394
|
'./tds-checkbox.entry.js').then(processMod, consoleError);
|
|
2395
|
+
case 'tds-core-header-item_2':
|
|
2396
|
+
return import(
|
|
2397
|
+
/* webpackMode: "lazy" */
|
|
2398
|
+
'./tds-core-header-item_2.entry.js').then(processMod, consoleError);
|
|
2407
2399
|
case 'tds-icon':
|
|
2408
2400
|
return import(
|
|
2409
2401
|
/* webpackMode: "lazy" */
|