@scania/tegel 0.0.9 → 0.0.11
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 +10 -14
- package/dist/cjs/loader.cjs.js +1 -1
- 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 +13 -13
- 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 +20 -18
- 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} +31 -26
- 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-item.cjs.entry.js +2 -2
- package/dist/cjs/tds-header-dropdown-list-user.cjs.entry.js +4 -4
- package/dist/cjs/tds-header-dropdown-list.cjs.entry.js +6 -6
- 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-item.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 +3 -2
- 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 +2 -2
- package/dist/cjs/tds-message.cjs.entry.js +6 -6
- 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 +10 -80
- package/dist/{components/popper.js → cjs/tds-popover-core.cjs.entry.js} +166 -13
- package/dist/cjs/tds-popover-menu.cjs.entry.js +12 -62
- 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 +16 -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 +13 -28
- package/dist/cjs/tds-toggle.cjs.entry.js +2 -1
- package/dist/cjs/tds-tooltip.cjs.entry.js +41 -78
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/cjs/{utils-2beb1aa0.js → utils-a908536d.js} +33 -12
- package/dist/collection/collection-manifest.json +1 -3
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +5 -1
- package/dist/collection/components/accordion/accordion.js +3 -0
- 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 +40 -24
- package/dist/collection/components/banner/banner.stories.js +107 -0
- package/dist/collection/components/block/block.js +3 -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 +4 -21
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +3 -3
- package/dist/collection/components/breadcrumbs/breadcrumbs.stories.js +36 -0
- package/dist/collection/components/button/button.css +20 -14
- package/dist/collection/components/button/button.js +46 -23
- package/dist/collection/components/button/button.stories.js +185 -0
- package/dist/collection/components/card/card.css +18 -14
- package/dist/collection/components/card/card.js +32 -68
- package/dist/collection/components/card/card.stories.js +163 -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 +145 -116
- package/dist/collection/components/dropdown/dropdown.css +212 -386
- package/dist/collection/components/dropdown/dropdown.js +480 -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 +5 -2
- package/dist/collection/components/footer/footer-item/footer-item.css +16 -8
- package/dist/collection/components/footer/footer-item/footer-item.js +3 -0
- package/dist/collection/components/footer/footer.css +9 -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/core-header-item/core-header-item.js +3 -0
- package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.js +3 -0
- package/dist/collection/components/header/header-dropdown/header-dropdown.js +11 -5
- package/dist/collection/components/header/header-dropdown-list/header-dropdown-list.css +2 -2
- package/dist/collection/components/header/header-dropdown-list/header-dropdown-list.js +10 -7
- package/dist/collection/components/header/header-dropdown-list-item/header-dropdown-list-item.css +3 -3
- package/dist/collection/components/header/header-dropdown-list-item/header-dropdown-list-item.js +7 -4
- 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-item/header-item.js +3 -0
- package/dist/collection/components/header/header-launcher/header-launcher.js +5 -2
- package/dist/collection/components/header/header-launcher-grid/header-launcher-grid.js +3 -0
- package/dist/collection/components/header/header-launcher-grid-item/header-launcher-grid-item.js +3 -0
- package/dist/collection/components/header/header-launcher-grid-title/header-launcher-grid-title.js +6 -2
- package/dist/collection/components/header/header-launcher-list/header-launcher-list.js +6 -2
- package/dist/collection/components/header/header-launcher-list-item/header-launcher-list-item.js +4 -1
- package/dist/collection/components/header/header-launcher-list-title/header-launcher-list-title.js +6 -2
- package/dist/collection/components/header/header-title/header-title.js +3 -0
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +6 -0
- package/dist/collection/components/header/header.stories.js +82 -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 +5 -1
- package/dist/collection/components/link/link.stories.js +59 -0
- package/dist/collection/components/message/message.css +16 -16
- package/dist/collection/components/message/message.js +11 -8
- 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.css +3 -7
- package/dist/collection/components/popover-canvas/popover-canvas.js +15 -104
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +92 -0
- package/dist/collection/components/popover-core/popover-core.js +390 -0
- package/dist/collection/components/popover-menu/popover-menu.css +2 -8
- package/dist/collection/components/popover-menu/popover-menu.js +18 -81
- 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 +17 -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 +7 -3
- package/dist/collection/components/stepper/stepper.stories.js +95 -0
- package/dist/collection/components/table/table/table.js +7 -3
- package/dist/collection/components/table/table-body/table-body.js +15 -60
- package/dist/collection/components/table/table-body-cell/table-body-cell.js +3 -0
- package/dist/collection/components/table/table-body-row/table-body-row.js +3 -0
- package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +4 -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/table-header.js +3 -0
- 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 +4 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +8 -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-tab/inline-tab.js +3 -0
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +8 -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-tab/navigation-tab.js +3 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +8 -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 +21 -37
- 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 +47 -87
- package/dist/collection/components/tooltip/tooltip.stories.js +136 -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-item.js +3 -3
- package/dist/components/header-dropdown-list.js +7 -7
- package/dist/components/header-item.js +1 -1
- package/dist/components/popover-canvas.js +20 -89
- package/dist/{esm/popper-bfa25c7f.js → components/popover-core.js} +190 -13
- 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 +16 -17
- package/dist/components/tds-breadcrumb.js +3 -6
- package/dist/components/tds-breadcrumbs.js +0 -3
- package/dist/components/tds-button.js +23 -22
- 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 +323 -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 +19 -12
- 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-item.js +1 -1
- package/dist/components/tds-header-launcher-list-title.js +3 -2
- package/dist/components/tds-header-launcher-list.js +3 -2
- package/dist/components/tds-header-launcher.js +18 -12
- package/dist/components/tds-inline-tab.js +1 -1
- package/dist/components/tds-inline-tabs.js +5 -5
- package/dist/components/tds-link.js +4 -3
- package/dist/components/tds-message.js +7 -7
- 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-dropdown-v2.d.ts → tds-popover-core.d.ts} +4 -4
- package/dist/components/tds-popover-core.js +6 -0
- package/dist/components/tds-popover-menu.js +22 -70
- 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 +16 -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 +15 -32
- package/dist/components/tds-toggle.js +2 -1
- package/dist/components/tds-tooltip.js +51 -85
- package/dist/components/utils.js +31 -12
- package/dist/esm/index-23ee700b.js +10 -14
- package/dist/esm/loader.js +1 -1
- 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 +13 -13
- 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 +20 -18
- 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} +31 -26
- 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-item.entry.js +2 -2
- package/dist/esm/tds-header-dropdown-list-user.entry.js +4 -4
- package/dist/esm/tds-header-dropdown-list.entry.js +6 -6
- 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-item.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 +3 -2
- 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 +2 -2
- package/dist/esm/tds-message.entry.js +6 -6
- 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 +10 -80
- package/dist/{cjs/popper-9def2535.js → esm/tds-popover-core.entry.js} +161 -14
- package/dist/esm/tds-popover-menu.entry.js +12 -62
- 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 +16 -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 +13 -28
- package/dist/esm/tds-toggle.entry.js +2 -1
- package/dist/esm/tds-tooltip.entry.js +42 -79
- package/dist/esm/tegel.js +1 -1
- package/dist/esm/{utils-9ac24735.js → utils-8544b156.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-0641ac24.entry.js +1 -0
- package/dist/tegel/p-099025f0.entry.js +1 -0
- package/dist/tegel/p-0ae649c3.entry.js +1 -0
- package/dist/tegel/p-1a907ae9.entry.js +1 -0
- package/dist/tegel/p-1c82ccf0.entry.js +1 -0
- package/dist/tegel/{p-1acb8407.entry.js → p-1f43d4f0.entry.js} +1 -1
- package/dist/tegel/p-2e5f6086.entry.js +1 -0
- package/dist/tegel/{p-89283891.entry.js → p-31848a92.entry.js} +1 -1
- package/dist/tegel/{p-fb3f4a14.entry.js → p-3d28689e.entry.js} +1 -1
- package/dist/tegel/p-400282e5.entry.js +1 -0
- package/dist/tegel/p-4163997b.entry.js +1 -0
- package/dist/tegel/{p-bcb2fad3.entry.js → p-42990ec0.entry.js} +1 -1
- package/dist/tegel/p-43320d81.entry.js +1 -0
- package/dist/tegel/p-49a084db.entry.js +1 -0
- package/dist/tegel/{p-e8fccebc.entry.js → p-56189659.entry.js} +1 -1
- package/dist/tegel/{p-b6a16219.entry.js → p-656add37.entry.js} +1 -1
- package/dist/tegel/p-65ab407b.entry.js +1 -0
- package/dist/tegel/p-6654e59d.entry.js +1 -0
- package/dist/tegel/p-6f0072cc.entry.js +1 -0
- package/dist/tegel/{p-39227588.js → p-72fced16.js} +1 -1
- package/dist/tegel/p-79b1bb29.entry.js +1 -0
- package/dist/tegel/p-7ccff0a5.entry.js +1 -0
- package/dist/tegel/p-81915088.entry.js +1 -0
- package/dist/tegel/{p-232f5889.entry.js → p-823399ef.entry.js} +1 -1
- package/dist/tegel/p-84d231a5.entry.js +1 -0
- package/dist/tegel/{p-7b34156b.entry.js → p-88807dac.entry.js} +1 -1
- package/dist/tegel/p-88d7c4c1.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-8e745d73.entry.js +1 -0
- package/dist/tegel/p-9991a816.entry.js +1 -0
- 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-a8cc3901.entry.js +1 -0
- package/dist/tegel/{p-7d3a66ae.entry.js → p-aa7e2f79.entry.js} +1 -1
- 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-c411f254.entry.js +1 -0
- package/dist/tegel/p-cacdd03f.entry.js +1 -0
- package/dist/tegel/p-cb5a4d7d.entry.js +1 -0
- package/dist/tegel/p-d0f15f73.entry.js +1 -0
- package/dist/tegel/p-d2ca7f58.entry.js +1 -0
- package/dist/tegel/p-d4c25eb6.entry.js +1 -0
- package/dist/tegel/p-d5bd9b2e.entry.js +1 -0
- package/dist/tegel/{p-de799b9a.entry.js → p-d60cb9e5.entry.js} +1 -1
- package/dist/tegel/p-da6f310c.entry.js +1 -0
- package/dist/tegel/p-df318a85.entry.js +1 -0
- package/dist/tegel/p-df95f0ae.entry.js +1 -0
- package/dist/tegel/p-e36ceefe.entry.js +1 -0
- package/dist/tegel/p-e4d6a4c5.entry.js +1 -0
- package/dist/tegel/p-f36ec03b.entry.js +1 -0
- package/dist/tegel/p-f64ff692.entry.js +1 -0
- package/dist/tegel/p-f682dd0b.entry.js +1 -0
- package/dist/tegel/p-fa30061f.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 +4 -0
- package/dist/types/components/accordion/accordion.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 +10 -5
- package/dist/types/components/banner/banner.stories.d.ts +82 -0
- package/dist/types/components/block/block.d.ts +3 -0
- package/dist/types/components/block/block.stories.d.ts +32 -0
- package/dist/types/components/breadcrumbs/breadcrumb/breadcrumb.d.ts +3 -2
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +3 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.stories.d.ts +16 -0
- package/dist/types/components/button/button.d.ts +9 -3
- package/dist/types/components/button/button.stories.d.ts +147 -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 +31 -17
- package/dist/types/components/dropdown/dropdown.d.ts +82 -54
- package/dist/types/components/dropdown/dropdown.stories.d.ts +183 -0
- package/dist/types/components/footer/footer-group/footer-group.d.ts +4 -1
- package/dist/types/components/footer/footer-item/footer-item.d.ts +3 -0
- 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/core-header-item/core-header-item.d.ts +3 -0
- package/dist/types/components/header/header-brand-symbol/header-brand-symbol.d.ts +3 -0
- package/dist/types/components/header/header-dropdown/header-dropdown.d.ts +6 -1
- package/dist/types/components/header/header-dropdown-list/header-dropdown-list.d.ts +5 -1
- package/dist/types/components/header/header-dropdown-list-item/header-dropdown-list-item.d.ts +5 -2
- package/dist/types/components/header/header-dropdown-list-user/header-dropdown-list-user.d.ts +8 -4
- package/dist/types/components/header/header-item/header-item.d.ts +3 -0
- package/dist/types/components/header/header-launcher/header-launcher.d.ts +3 -0
- package/dist/types/components/header/header-launcher-grid/header-launcher-grid.d.ts +3 -0
- package/dist/types/components/header/header-launcher-grid-item/header-launcher-grid-item.d.ts +3 -0
- package/dist/types/components/header/header-launcher-grid-title/header-launcher-grid-title.d.ts +3 -0
- package/dist/types/components/header/header-launcher-list/header-launcher-list.d.ts +3 -0
- package/dist/types/components/header/header-launcher-list-item/header-launcher-list-item.d.ts +3 -0
- package/dist/types/components/header/header-launcher-list-title/header-launcher-list-title.d.ts +3 -0
- package/dist/types/components/header/header-title/header-title.d.ts +3 -0
- package/dist/types/components/header/header.d.ts +6 -0
- package/dist/types/components/header/header.stories.d.ts +32 -0
- package/dist/types/components/icon/icon.stories.d.ts +36 -0
- package/dist/types/components/link/link.d.ts +3 -0
- package/dist/types/components/link/link.stories.d.ts +44 -0
- package/dist/types/components/message/message.d.ts +5 -2
- 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 +8 -14
- package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +27 -0
- package/dist/types/components/popover-core/popover-core.d.ts +46 -0
- package/dist/types/components/popover-menu/popover-menu.d.ts +9 -10
- 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.d.ts +3 -0
- package/dist/types/components/stepper/stepper.stories.d.ts +80 -0
- package/dist/types/components/table/table/table.d.ts +3 -0
- package/dist/types/components/table/table-body/table-body.d.ts +6 -3
- package/dist/types/components/table/table-body-cell/table-body-cell.d.ts +3 -0
- package/dist/types/components/table/table-body-row/table-body-row.d.ts +3 -0
- package/dist/types/components/table/table-body-row-expandable/table-body-row-expandable.d.ts +4 -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-header/table-header.d.ts +3 -0
- package/dist/types/components/table/table-toolbar/table-toolbar.d.ts +3 -0
- package/dist/types/components/tabs/folder-tabs/folder-tab/folder-tab.d.ts +3 -0
- package/dist/types/components/tabs/folder-tabs/folder-tabs.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-tab/inline-tab.d.ts +3 -0
- package/dist/types/components/tabs/inline-tabs/inline-tabs.d.ts +3 -0
- package/dist/types/components/tabs/inline-tabs/inline-tabs.stories.d.ts +61 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tab/navigation-tab.d.ts +3 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +3 -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 +6 -5
- 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 +17 -7
- package/dist/types/components/tooltip/tooltip.stories.d.ts +66 -0
- package/dist/types/components.d.ts +232 -415
- 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 +22 -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.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-7331ec7b.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-9d707f6e.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-c8d4af09.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-e95059e9.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
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
import tdsTable from './table/readme.md';
|
|
3
|
+
import tdsTableToolbar from './table-toolbar/readme.md';
|
|
4
|
+
import tdsHeader from './table-header/readme.md';
|
|
5
|
+
import tdsHeaderCell from './table-header-cell/readme.md';
|
|
6
|
+
import tdsTableBody from './table-body/readme.md';
|
|
7
|
+
import tdsBodyRow from './table-body-row/readme.md';
|
|
8
|
+
import tdsBodyRowExpandable from './table-body-row-expandable/readme.md';
|
|
9
|
+
import tdsBodyCell from './table-body-cell/readme.md';
|
|
10
|
+
import tdsTableFooter from './table-footer/readme.md';
|
|
11
|
+
import { ComponentsFolder } from '../../utils/constants';
|
|
12
|
+
export default {
|
|
13
|
+
title: `${ComponentsFolder}/Table`,
|
|
14
|
+
parameters: {
|
|
15
|
+
notes: {
|
|
16
|
+
'tds-table': tdsTable,
|
|
17
|
+
'tds-table-toolbar': tdsTableToolbar,
|
|
18
|
+
'tds-header': tdsHeader,
|
|
19
|
+
'tds-header-cell': tdsHeaderCell,
|
|
20
|
+
'tds-table-body': tdsTableBody,
|
|
21
|
+
'tds-body-row': tdsBodyRow,
|
|
22
|
+
'tds-body-row-expandable': tdsBodyRowExpandable,
|
|
23
|
+
'tds-body-cell': tdsBodyCell,
|
|
24
|
+
'tds-table-footer': tdsTableFooter,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
modeVariant: {
|
|
29
|
+
name: 'Mode variant',
|
|
30
|
+
description: 'Mode variant adjusts component colors to have better visibility depending on global mode and background.',
|
|
31
|
+
control: {
|
|
32
|
+
type: 'radio',
|
|
33
|
+
},
|
|
34
|
+
options: ['Inherit from parent', 'Primary', 'Secondary'],
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: 'Inherit from parent' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
compactDesign: {
|
|
40
|
+
name: 'Compact design',
|
|
41
|
+
description: 'Enables compact design of the Table, rows with less height.',
|
|
42
|
+
control: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
},
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: false },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
responsiveDesign: {
|
|
50
|
+
name: 'Responsive Table',
|
|
51
|
+
description: 'Enables Table to take 100% of available width. For column values less than 192px, "No minimum width" has to be enabled too.',
|
|
52
|
+
control: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
},
|
|
55
|
+
table: {
|
|
56
|
+
defaultValue: { summary: false },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
verticalDivider: {
|
|
60
|
+
name: 'Vertical dividers',
|
|
61
|
+
description: 'Enables vertical dividers between Table columns.',
|
|
62
|
+
control: {
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
},
|
|
65
|
+
table: {
|
|
66
|
+
defaultValue: { summary: false },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
noMinWidth: {
|
|
70
|
+
name: 'No minimum width',
|
|
71
|
+
description: 'Resets min-width rule and enables setting column width value to less than 192px which is the default. When enabled, controls for column width will show here.',
|
|
72
|
+
control: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
column1Width: {
|
|
77
|
+
name: 'Column 1 width',
|
|
78
|
+
description: 'Value of width for column 1. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
79
|
+
control: {
|
|
80
|
+
type: 'text',
|
|
81
|
+
},
|
|
82
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
83
|
+
},
|
|
84
|
+
column2Width: {
|
|
85
|
+
name: 'Column 2 width',
|
|
86
|
+
description: 'Value of width for column 2. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
87
|
+
control: {
|
|
88
|
+
type: 'text',
|
|
89
|
+
},
|
|
90
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
91
|
+
},
|
|
92
|
+
column3Width: {
|
|
93
|
+
name: 'Column 3 width',
|
|
94
|
+
description: 'Value of width for column 3. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
95
|
+
control: {
|
|
96
|
+
type: 'text',
|
|
97
|
+
},
|
|
98
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
99
|
+
},
|
|
100
|
+
column4Width: {
|
|
101
|
+
name: 'Column 4 width',
|
|
102
|
+
description: 'Value of width for column 4. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
103
|
+
control: {
|
|
104
|
+
type: 'text',
|
|
105
|
+
},
|
|
106
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
args: {
|
|
110
|
+
modeVariant: 'Inherit from parent',
|
|
111
|
+
compactDesign: false,
|
|
112
|
+
responsiveDesign: false,
|
|
113
|
+
verticalDivider: false,
|
|
114
|
+
noMinWidth: false,
|
|
115
|
+
column1Width: '',
|
|
116
|
+
column2Width: '',
|
|
117
|
+
column3Width: '',
|
|
118
|
+
column4Width: '',
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const PaginationTemplate = ({ modeVariant, compactDesign, responsiveDesign, verticalDivider, noMinWidth, column1Width, column2Width, column3Width, column4Width, }) => formatHtmlPreview(`
|
|
122
|
+
<tds-table
|
|
123
|
+
vertical-dividers="${verticalDivider}"
|
|
124
|
+
compact-design="${compactDesign}"
|
|
125
|
+
enable-responsive="${responsiveDesign}"
|
|
126
|
+
${noMinWidth ? 'no-min-width' : ''}
|
|
127
|
+
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
128
|
+
>
|
|
129
|
+
<tds-table-header>
|
|
130
|
+
<tds-header-cell column-key='truck' column-title='Truck type' ${column1Width ? `custom-width="${column1Width}"` : ''}></tds-header-cell>
|
|
131
|
+
<tds-header-cell column-key='driver' column-title='Driver name' ${column2Width ? `custom-width="${column2Width}"` : ''}></tds-header-cell>
|
|
132
|
+
<tds-header-cell column-key='country' column-title='Country' ${column3Width ? `custom-width="${column3Width}"` : ''}></tds-header-cell>
|
|
133
|
+
<tds-header-cell column-key='mileage' column-title='Mileage' text-align='right' ${column4Width ? `custom-width="${column4Width}"` : ''}></tds-header-cell>
|
|
134
|
+
</tds-table-header>
|
|
135
|
+
<tds-table-body>
|
|
136
|
+
</tds-table-body>
|
|
137
|
+
<tds-table-footer default-page="2" pages="4" pagination></tds-table-footer>
|
|
138
|
+
</tds-table>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<script>
|
|
142
|
+
/* ONLY WORKS IN THE CANVAS TAB. */
|
|
143
|
+
myData = [
|
|
144
|
+
{
|
|
145
|
+
"truck": "L-series",
|
|
146
|
+
"driver": "Sonya Bruce",
|
|
147
|
+
"country": "Brazil",
|
|
148
|
+
"mileage": 123987
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"truck": "P-series",
|
|
152
|
+
"driver": "Guerra Bowman",
|
|
153
|
+
"country": "Sweden",
|
|
154
|
+
"mileage": 2000852
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"truck": "G-series",
|
|
158
|
+
"driver": "Ferrell Wallace",
|
|
159
|
+
"country": "Germany",
|
|
160
|
+
"mileage": 564
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"truck": "R-series",
|
|
164
|
+
"driver": "Cox Burris",
|
|
165
|
+
"country": "Spain",
|
|
166
|
+
"mileage": 1789357
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"truck": "S-series",
|
|
170
|
+
"driver": "Montgomery Cervantes",
|
|
171
|
+
"country": "Croatia",
|
|
172
|
+
"mileage": 65
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"truck": "L-series",
|
|
176
|
+
"driver": "Sheryl Nielsen",
|
|
177
|
+
"country": "Greece",
|
|
178
|
+
"mileage": 365784
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"truck": "G-series",
|
|
182
|
+
"driver": "Benton Gomez",
|
|
183
|
+
"country": "France",
|
|
184
|
+
"mileage": 80957
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"truck": "G-series",
|
|
188
|
+
"driver": "Benton Gomez",
|
|
189
|
+
"country": "France",
|
|
190
|
+
"mileage": 80957
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
tableBody = document.querySelector('tds-table-body');
|
|
194
|
+
tableFooter = document.querySelector('tds-table-footer');
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
setPage = (page) => {
|
|
198
|
+
const rowsPerPage = 2;
|
|
199
|
+
const start = (page - 1) * rowsPerPage;
|
|
200
|
+
|
|
201
|
+
tableBody.bodyData = myData.slice(start, start + rowsPerPage);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
setPage(2);
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
tableFooter.addEventListener('tdsPageChange', (event) => {
|
|
208
|
+
const page = event.detail.paginationValue;
|
|
209
|
+
setPage(page);
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
</script>
|
|
213
|
+
|
|
214
|
+
`);
|
|
215
|
+
export const Pagination = PaginationTemplate.bind({});
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
+
import tdsTable from './table/readme.md';
|
|
3
|
+
import tdsTableToolbar from './table-toolbar/readme.md';
|
|
4
|
+
import tdsHeader from './table-header/readme.md';
|
|
5
|
+
import tdsHeaderCell from './table-header-cell/readme.md';
|
|
6
|
+
import tdsTableBody from './table-body/readme.md';
|
|
7
|
+
import tdsBodyRow from './table-body-row/readme.md';
|
|
8
|
+
import tdsBodyRowExpandable from './table-body-row-expandable/readme.md';
|
|
9
|
+
import tdsBodyCell from './table-body-cell/readme.md';
|
|
10
|
+
import tdsTableFooter from './table-footer/readme.md';
|
|
11
|
+
import { ComponentsFolder } from '../../utils/constants';
|
|
12
|
+
export default {
|
|
13
|
+
title: `${ComponentsFolder}/Table`,
|
|
14
|
+
parameters: {
|
|
15
|
+
notes: {
|
|
16
|
+
'tds-table': tdsTable,
|
|
17
|
+
'tds-table-toolbar': tdsTableToolbar,
|
|
18
|
+
'tds-header': tdsHeader,
|
|
19
|
+
'tds-header-cell': tdsHeaderCell,
|
|
20
|
+
'tds-table-body': tdsTableBody,
|
|
21
|
+
'tds-body-row': tdsBodyRow,
|
|
22
|
+
'tds-body-row-expandable': tdsBodyRowExpandable,
|
|
23
|
+
'tds-body-cell': tdsBodyCell,
|
|
24
|
+
'tds-table-footer': tdsTableFooter,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
modeVariant: {
|
|
29
|
+
name: 'Mode variant',
|
|
30
|
+
description: 'Mode variant adjusts component colors to have better visibility depending on global mode and background.',
|
|
31
|
+
control: {
|
|
32
|
+
type: 'radio',
|
|
33
|
+
},
|
|
34
|
+
options: ['Inherit from parent', 'Primary', 'Secondary'],
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: 'Inherit from parent' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
compactDesign: {
|
|
40
|
+
name: 'Compact Design',
|
|
41
|
+
description: 'Enables compact design of the Table, rows with less height.',
|
|
42
|
+
control: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
},
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: false },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
responsiveDesign: {
|
|
50
|
+
name: 'Responsive design',
|
|
51
|
+
description: 'Enables Table to take 100% of available width. For column values less than 192px, "No minimum width" has to be enabled too.',
|
|
52
|
+
control: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
},
|
|
55
|
+
table: {
|
|
56
|
+
defaultValue: { summary: false },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
column1sortable: {
|
|
60
|
+
name: 'Column 1 is sortable',
|
|
61
|
+
description: 'Enables column 1 to be sorted alphabetically.',
|
|
62
|
+
control: {
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
},
|
|
65
|
+
table: {
|
|
66
|
+
defaultValue: { summary: false },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
column2sortable: {
|
|
70
|
+
name: 'Column 2 is sortable',
|
|
71
|
+
description: 'Enables column 2 to be sorted alphabetically.',
|
|
72
|
+
control: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
},
|
|
75
|
+
table: {
|
|
76
|
+
defaultValue: { summary: false },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
column3sortable: {
|
|
80
|
+
name: 'Column 3 is sortable',
|
|
81
|
+
description: 'Enables column 3 to be sorted alphabetically.',
|
|
82
|
+
control: {
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
},
|
|
85
|
+
table: {
|
|
86
|
+
defaultValue: { summary: false },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
column4sortable: {
|
|
90
|
+
name: 'Column 4 is sortable',
|
|
91
|
+
description: 'Enables column 4 to be sorted alphabetically.',
|
|
92
|
+
control: {
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
},
|
|
95
|
+
table: {
|
|
96
|
+
defaultValue: { summary: false },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
verticalDivider: {
|
|
100
|
+
name: 'Vertical dividers',
|
|
101
|
+
description: 'Enables vertical dividers between Table columns.',
|
|
102
|
+
control: {
|
|
103
|
+
type: 'boolean',
|
|
104
|
+
},
|
|
105
|
+
table: {
|
|
106
|
+
defaultValue: { summary: false },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
noMinWidth: {
|
|
110
|
+
name: 'No minimum width',
|
|
111
|
+
description: 'Resets min-width rule and enables setting column width value to less than 192px which is the default. When enabled, controls for column width will show here.',
|
|
112
|
+
control: {
|
|
113
|
+
type: 'boolean',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
column1Width: {
|
|
117
|
+
name: 'Column 1 width',
|
|
118
|
+
description: 'Value of width for column 1. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
119
|
+
control: {
|
|
120
|
+
type: 'text',
|
|
121
|
+
},
|
|
122
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
123
|
+
},
|
|
124
|
+
column2Width: {
|
|
125
|
+
name: 'Column 2 width',
|
|
126
|
+
description: 'Value of width for column 2. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
127
|
+
control: {
|
|
128
|
+
type: 'text',
|
|
129
|
+
},
|
|
130
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
131
|
+
},
|
|
132
|
+
column3Width: {
|
|
133
|
+
name: 'Column 3 width',
|
|
134
|
+
description: 'Value of width for column 3. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
135
|
+
control: {
|
|
136
|
+
type: 'text',
|
|
137
|
+
},
|
|
138
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
139
|
+
},
|
|
140
|
+
column4Width: {
|
|
141
|
+
name: 'Column 4 width',
|
|
142
|
+
description: 'Value of width for column 4. In order to work correctly "No minimum width" has to be enabled too. When editing please provide a unit next to the value, eg. 200px.',
|
|
143
|
+
control: {
|
|
144
|
+
type: 'text',
|
|
145
|
+
},
|
|
146
|
+
if: { arg: 'noMinWidth', eq: true },
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
args: {
|
|
150
|
+
modeVariant: 'Inherit from parent',
|
|
151
|
+
compactDesign: false,
|
|
152
|
+
responsiveDesign: false,
|
|
153
|
+
column1sortable: true,
|
|
154
|
+
column2sortable: true,
|
|
155
|
+
column3sortable: true,
|
|
156
|
+
column4sortable: true,
|
|
157
|
+
verticalDivider: false,
|
|
158
|
+
noMinWidth: false,
|
|
159
|
+
column1Width: '',
|
|
160
|
+
column2Width: '',
|
|
161
|
+
column3Width: '',
|
|
162
|
+
column4Width: '',
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
const SortingTemplate = ({ modeVariant, compactDesign, responsiveDesign, column1sortable, column2sortable, column3sortable, column4sortable, verticalDivider, noMinWidth, column1Width, column2Width, column3Width, column4Width, }) => formatHtmlPreview(`
|
|
166
|
+
<tds-table
|
|
167
|
+
vertical-dividers="${verticalDivider}"
|
|
168
|
+
compact-design="${compactDesign}"
|
|
169
|
+
enable-responsive="${responsiveDesign}"
|
|
170
|
+
${noMinWidth ? 'no-min-width' : ''}
|
|
171
|
+
${modeVariant !== 'Inherit from parent' ? `mode-variant="${modeVariant.toLowerCase()}"` : ''}
|
|
172
|
+
>
|
|
173
|
+
<tds-table-toolbar table-title="Sorting"></tds-table-toolbar>
|
|
174
|
+
<tds-table-header>
|
|
175
|
+
<tds-header-cell column-key='truck' column-title='Truck type' sortable="${column1sortable}" ${column1Width ? `custom-width="${column1Width}"` : ''}></tds-header-cell>
|
|
176
|
+
<tds-header-cell column-key='driver' column-title='Driver name' sortable="${column2sortable}" ${column2Width ? `custom-width="${column2Width}"` : ''}></tds-header-cell>
|
|
177
|
+
<tds-header-cell column-key='country' column-title='Country' sortable="${column3sortable}" ${column3Width ? `custom-width="${column3Width}"` : ''}></tds-header-cell>
|
|
178
|
+
<tds-header-cell column-key='mileage' column-title='Mileage' sortable="${column4sortable}" text-align='right' ${column4Width ? `custom-width="${column4Width}"` : ''}></tds-header-cell>
|
|
179
|
+
</tds-table-header>
|
|
180
|
+
<tds-table-body>
|
|
181
|
+
</tds-table-body>
|
|
182
|
+
</tds-table>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
<script>
|
|
186
|
+
|
|
187
|
+
document.addEventListener('tdsSortChange', (event) => {
|
|
188
|
+
console.log(event)
|
|
189
|
+
})
|
|
190
|
+
/* ONLY WORKS IN THE CANVAS TAB. */
|
|
191
|
+
tableBody = document.querySelector('tds-table-body');
|
|
192
|
+
tableBody.bodyData = [
|
|
193
|
+
{
|
|
194
|
+
"truck": "L-series",
|
|
195
|
+
"driver": "Sonya Bruce",
|
|
196
|
+
"country": "Brazil",
|
|
197
|
+
"mileage": 123987
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"truck": "P-series",
|
|
201
|
+
"driver": "Guerra Bowman",
|
|
202
|
+
"country": "Sweden",
|
|
203
|
+
"mileage": 2000852
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"truck": "G-series",
|
|
207
|
+
"driver": "Ferrell Wallace",
|
|
208
|
+
"country": "Germany",
|
|
209
|
+
"mileage": 564
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"truck": "R-series",
|
|
213
|
+
"driver": "Cox Burris",
|
|
214
|
+
"country": "Spain",
|
|
215
|
+
"mileage": 1789357
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"truck": "S-series",
|
|
219
|
+
"driver": "Montgomery Cervantes",
|
|
220
|
+
"country": "Croatia",
|
|
221
|
+
"mileage": 65
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"truck": "L-series",
|
|
225
|
+
"driver": "Sheryl Nielsen",
|
|
226
|
+
"country": "Greece",
|
|
227
|
+
"mileage": 365784
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"truck": "G-series",
|
|
231
|
+
"driver": "Benton Gomez",
|
|
232
|
+
"country": "France",
|
|
233
|
+
"mileage": 80957
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
|
|
237
|
+
</script>`);
|
|
238
|
+
export const Sorting = SortingTemplate.bind({});
|
|
@@ -7,66 +7,69 @@ export class TdsTableFooter {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.previousPage = () => {
|
|
9
9
|
/* Emits pagination event. */
|
|
10
|
-
|
|
10
|
+
this.tdsPageChange.emit({
|
|
11
11
|
tableId: this.tableId,
|
|
12
12
|
paginationValue: Number(this.inputElement.value) - 1,
|
|
13
13
|
});
|
|
14
14
|
/** If pages and greater or equal to 2, decrease pagination value.
|
|
15
15
|
* This is to not get under 1 in pagination value. */
|
|
16
|
-
if (this.
|
|
17
|
-
this.
|
|
16
|
+
if (this.defaultPage >= 2) {
|
|
17
|
+
this.defaultPage--;
|
|
18
18
|
}
|
|
19
19
|
/* If the change event is not prevented -> do pagination. */
|
|
20
|
-
if (!
|
|
20
|
+
if (!this.pages) {
|
|
21
21
|
/* Decrease the pagination until the first page. */
|
|
22
22
|
this.runPagination();
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
this.nextPage = () => {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
var _a;
|
|
27
|
+
this.tdsPageChange.emit({
|
|
28
28
|
tableId: this.tableId,
|
|
29
29
|
paginationValue: Number(this.inputElement.value) + 1,
|
|
30
30
|
});
|
|
31
31
|
/** If pages and greater or equal to the amount of pages, increase pagination value.
|
|
32
32
|
* This is to not get above the amount of pages in pagination value. */
|
|
33
|
-
if (this.
|
|
34
|
-
this.
|
|
33
|
+
if (this.defaultPage <= ((_a = this.pages) !== null && _a !== void 0 ? _a : this.numberOfPages)) {
|
|
34
|
+
this.defaultPage++;
|
|
35
35
|
}
|
|
36
36
|
/* If the change event is not prevented -> do pagination. */
|
|
37
|
-
if (!
|
|
37
|
+
if (!this.pages) {
|
|
38
38
|
/* Increase the pagination until the last page. */
|
|
39
39
|
this.runPagination();
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
this.runPagination = () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const lastResult = this.rowsPerPage * this.paginationValue;
|
|
55
|
-
const firstResult = lastResult - this.rowsPerPage;
|
|
56
|
-
if (index > firstResult && index <= lastResult) {
|
|
57
|
-
item.classList.remove('tds-table__row--hidden');
|
|
43
|
+
/** Check the rows per page is used - if so, we need to do all the pagination. */
|
|
44
|
+
if (this.rowsPerPage) {
|
|
45
|
+
// grab all rows in body
|
|
46
|
+
const dataRowsPagination = this.host.parentNode
|
|
47
|
+
.querySelector('tds-table-body')
|
|
48
|
+
.querySelectorAll('.tds-table__row');
|
|
49
|
+
dataRowsPagination.forEach((item, i) => {
|
|
50
|
+
// for making logic easier 1st result, 2nd result...
|
|
51
|
+
const index = i + 1;
|
|
52
|
+
if (this.tempPaginationDisable) {
|
|
53
|
+
this.defaultPage = 1;
|
|
58
54
|
}
|
|
59
55
|
else {
|
|
60
|
-
|
|
56
|
+
const lastResult = this.rowsPerPage * this.defaultPage;
|
|
57
|
+
const firstResult = lastResult - this.rowsPerPage;
|
|
58
|
+
if (index > firstResult && index <= lastResult) {
|
|
59
|
+
item.classList.remove('tds-table__row--hidden');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
item.classList.add('tds-table__row--hidden');
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
64
67
|
};
|
|
65
68
|
this.pagination = false;
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
69
|
+
this.defaultPage = 1;
|
|
70
|
+
this.pages = null;
|
|
71
|
+
this.rowsPerPage = undefined;
|
|
72
|
+
this.cols = null;
|
|
70
73
|
this.columnsNumber = 0;
|
|
71
74
|
this.numberOfPages = 0;
|
|
72
75
|
this.tempPaginationDisable = false;
|
|
@@ -93,11 +96,15 @@ export class TdsTableFooter {
|
|
|
93
96
|
relevantTableProps.forEach((tablePropName) => {
|
|
94
97
|
this[tablePropName] = this.tableEl[tablePropName];
|
|
95
98
|
});
|
|
96
|
-
|
|
99
|
+
if (this.rowsPerPage) {
|
|
100
|
+
/* Number of children which are <tds-table-body-row> */
|
|
101
|
+
const numberOfRows = Array.from(this.host.parentElement.querySelector('tds-table-body').children).filter((element) => element.tagName === 'TDS-TABLE-BODY-ROW').length;
|
|
102
|
+
this.numberOfPages = Math.ceil(numberOfRows / this.rowsPerPage);
|
|
103
|
+
}
|
|
104
|
+
/** Get the number of columns. */
|
|
97
105
|
const numberOfColumns = this.host.parentElement.querySelector('tds-table-header').childElementCount;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this.columnsNumber = this.clientSetColumnsNumber;
|
|
106
|
+
if (this.cols) {
|
|
107
|
+
this.columnsNumber = this.cols;
|
|
101
108
|
}
|
|
102
109
|
else {
|
|
103
110
|
this.columnsNumber = numberOfColumns;
|
|
@@ -107,10 +114,10 @@ export class TdsTableFooter {
|
|
|
107
114
|
const insertedValue = event.target.value;
|
|
108
115
|
if (insertedValue > this.numberOfPages || insertedValue < 1) {
|
|
109
116
|
event.target.classList.add('tds-table__page-selector-input--shake');
|
|
110
|
-
this.
|
|
117
|
+
this.defaultPage = event.target.max;
|
|
111
118
|
}
|
|
112
119
|
else {
|
|
113
|
-
this.
|
|
120
|
+
this.defaultPage = event.target.value;
|
|
114
121
|
}
|
|
115
122
|
const paginationEvent = this.tdsPageChange.emit({
|
|
116
123
|
tableId: this.tableId,
|
|
@@ -126,8 +133,9 @@ export class TdsTableFooter {
|
|
|
126
133
|
}
|
|
127
134
|
}
|
|
128
135
|
render() {
|
|
129
|
-
var _a;
|
|
130
|
-
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.
|
|
136
|
+
var _a, _b, _c;
|
|
137
|
+
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) ||
|
|
138
|
+
this.tempPaginationDisable, onClick: () => this.nextPage() }, h("tds-icon", { name: "chevron_right", size: "20px" })))))))));
|
|
131
139
|
}
|
|
132
140
|
static get is() { return "tds-table-footer"; }
|
|
133
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -161,7 +169,7 @@ export class TdsTableFooter {
|
|
|
161
169
|
"reflect": true,
|
|
162
170
|
"defaultValue": "false"
|
|
163
171
|
},
|
|
164
|
-
"
|
|
172
|
+
"defaultPage": {
|
|
165
173
|
"type": "number",
|
|
166
174
|
"mutable": false,
|
|
167
175
|
"complexType": {
|
|
@@ -173,13 +181,13 @@ export class TdsTableFooter {
|
|
|
173
181
|
"optional": false,
|
|
174
182
|
"docs": {
|
|
175
183
|
"tags": [],
|
|
176
|
-
"text": "Sets
|
|
184
|
+
"text": "Sets the default page number."
|
|
177
185
|
},
|
|
178
|
-
"attribute": "
|
|
186
|
+
"attribute": "default-page",
|
|
179
187
|
"reflect": true,
|
|
180
|
-
"defaultValue": "
|
|
188
|
+
"defaultValue": "1"
|
|
181
189
|
},
|
|
182
|
-
"
|
|
190
|
+
"pages": {
|
|
183
191
|
"type": "number",
|
|
184
192
|
"mutable": false,
|
|
185
193
|
"complexType": {
|
|
@@ -191,13 +199,13 @@ export class TdsTableFooter {
|
|
|
191
199
|
"optional": false,
|
|
192
200
|
"docs": {
|
|
193
201
|
"tags": [],
|
|
194
|
-
"text": "Sets the
|
|
202
|
+
"text": "Sets the number of pages."
|
|
195
203
|
},
|
|
196
|
-
"attribute": "
|
|
204
|
+
"attribute": "pages",
|
|
197
205
|
"reflect": true,
|
|
198
|
-
"defaultValue": "
|
|
206
|
+
"defaultValue": "null"
|
|
199
207
|
},
|
|
200
|
-
"
|
|
208
|
+
"rowsPerPage": {
|
|
201
209
|
"type": "number",
|
|
202
210
|
"mutable": false,
|
|
203
211
|
"complexType": {
|
|
@@ -208,13 +216,16 @@ export class TdsTableFooter {
|
|
|
208
216
|
"required": false,
|
|
209
217
|
"optional": false,
|
|
210
218
|
"docs": {
|
|
211
|
-
"tags": [
|
|
212
|
-
|
|
219
|
+
"tags": [{
|
|
220
|
+
"name": "deprecated",
|
|
221
|
+
"text": "Used to set rows per page, this also enabled automatic pagination of the table."
|
|
222
|
+
}],
|
|
223
|
+
"text": ""
|
|
213
224
|
},
|
|
214
|
-
"attribute": "
|
|
225
|
+
"attribute": "rows-per-page",
|
|
215
226
|
"reflect": true
|
|
216
227
|
},
|
|
217
|
-
"
|
|
228
|
+
"cols": {
|
|
218
229
|
"type": "number",
|
|
219
230
|
"mutable": false,
|
|
220
231
|
"complexType": {
|
|
@@ -226,9 +237,9 @@ export class TdsTableFooter {
|
|
|
226
237
|
"optional": false,
|
|
227
238
|
"docs": {
|
|
228
239
|
"tags": [],
|
|
229
|
-
"text": "
|
|
240
|
+
"text": "<b>Client override</b> Used to set the number of columns, use as fallback if the automatic count of columns fail."
|
|
230
241
|
},
|
|
231
|
-
"attribute": "
|
|
242
|
+
"attribute": "cols",
|
|
232
243
|
"reflect": false,
|
|
233
244
|
"defaultValue": "null"
|
|
234
245
|
}
|