@scania/tegel 0.0.1-beta.7 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-e1c79686.js → index-b98965c7.js} +7 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sdds-accordion-item.cjs.entry.js +21 -21
- package/dist/cjs/sdds-accordion.cjs.entry.js +12 -12
- package/dist/cjs/sdds-badges.cjs.entry.js +45 -46
- package/dist/cjs/sdds-banner.cjs.entry.js +79 -0
- package/dist/cjs/sdds-block.cjs.entry.js +32 -0
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js +160 -160
- package/dist/cjs/sdds-breadcrumb-item.cjs.entry.js +25 -0
- package/dist/cjs/sdds-breadcrumb.cjs.entry.js +23 -0
- package/dist/cjs/sdds-button.cjs.entry.js +25 -24
- package/dist/cjs/sdds-card.cjs.entry.js +56 -0
- package/dist/cjs/sdds-checkbox.cjs.entry.js +55 -0
- package/dist/cjs/sdds-datetime.cjs.entry.js +78 -49
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +83 -83
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +327 -321
- package/dist/cjs/sdds-header-cell.cjs.entry.js +130 -132
- package/dist/cjs/sdds-icon.cjs.entry.js +30 -30
- package/dist/cjs/sdds-inline-tab.cjs.entry.js +22 -0
- package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +89 -87
- package/dist/cjs/sdds-inline-tabs.cjs.entry.js +212 -202
- package/dist/cjs/sdds-link.cjs.entry.js +28 -0
- package/dist/cjs/sdds-message.cjs.entry.js +41 -0
- package/dist/cjs/sdds-modal.cjs.entry.js +42 -40
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +89 -86
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +74 -66
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +75 -65
- package/dist/cjs/sdds-radio-button.cjs.entry.js +32 -0
- package/dist/cjs/sdds-slider.cjs.entry.js +348 -327
- package/dist/cjs/sdds-spinner.cjs.entry.js +11 -11
- package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +73 -72
- package/dist/cjs/sdds-table-body.cjs.entry.js +235 -235
- package/dist/cjs/sdds-table-footer.cjs.entry.js +155 -156
- package/dist/cjs/sdds-table-header.cjs.entry.js +90 -91
- package/dist/cjs/sdds-table-toolbar.cjs.entry.js +56 -57
- package/dist/cjs/sdds-table.cjs.entry.js +58 -59
- package/dist/cjs/sdds-textarea.cjs.entry.js +57 -44
- package/dist/cjs/sdds-textfield.cjs.entry.js +73 -64
- package/dist/cjs/sdds-toast.cjs.entry.js +86 -0
- package/dist/cjs/sdds-toggle.cjs.entry.js +44 -0
- package/dist/cjs/sdds-tooltip.cjs.entry.js +94 -85
- package/dist/cjs/tegel.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +30 -11
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +142 -142
- package/dist/collection/components/accordion/accordion.css +2 -16
- package/dist/collection/components/accordion/accordion.js +62 -62
- package/dist/collection/components/accordion/accordion.stories.js +90 -0
- package/dist/collection/components/badge/badge.stories.js +102 -0
- package/dist/collection/components/badge/badges.css +2 -2
- package/dist/collection/components/badge/badges.js +147 -150
- package/dist/collection/components/banner/banner.stories.js +92 -0
- package/dist/collection/components/banner/sdds-banner.css +88 -0
- package/dist/collection/components/banner/sdds-banner.js +330 -0
- package/dist/collection/components/banner/sdds-banner.stories.js +129 -0
- package/dist/collection/components/block/block-native.stories.js +48 -0
- package/dist/collection/components/block/sdds-block.css +22 -0
- package/dist/collection/components/block/sdds-block.js +55 -0
- package/dist/collection/components/block/sdds-block.stories.js +48 -0
- package/dist/collection/components/breadcrumb/breadcrumb-component.css +30 -0
- package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.css +43 -0
- package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.js +83 -0
- package/dist/collection/components/breadcrumb/breadcrumb.js +22 -0
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +26 -0
- package/dist/collection/components/button/button-component.js +152 -151
- package/dist/collection/components/button/button-native.stories.js +187 -0
- package/dist/collection/components/button/button-webcomponent.stories.js +189 -0
- package/dist/collection/components/button/button.css +63 -51
- package/dist/collection/components/card/card.stories.js +167 -0
- package/dist/collection/components/card/sdds-card.css +78 -0
- package/dist/collection/components/card/sdds-card.js +276 -0
- package/dist/collection/components/card/sdds-card.stories.js +168 -0
- package/dist/collection/components/checkbox/checkbox.stories.js +54 -0
- package/dist/collection/components/checkbox/sdds-checkbox.css +95 -0
- package/dist/collection/components/checkbox/sdds-checkbox.js +239 -0
- package/dist/collection/components/checkbox/sdds-checkbox.stories.js +71 -0
- package/dist/collection/components/chips/chips.stories.js +106 -0
- package/dist/collection/components/data-table/native-table.stories.js +160 -0
- package/dist/collection/components/data-table/table/table.js +252 -253
- package/dist/collection/components/data-table/table-body/table-body.css +1 -1
- package/dist/collection/components/data-table/table-body/table-body.js +425 -425
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +3 -3
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +168 -169
- package/dist/collection/components/data-table/table-body-row/table-body-row.css +24 -45
- package/dist/collection/components/data-table/table-body-row/table-body-row.js +165 -164
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +23 -24
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +156 -155
- package/dist/collection/components/data-table/table-component-basic.stories.js +161 -0
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +128 -0
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +58 -0
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +197 -0
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +151 -0
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +135 -0
- package/dist/collection/components/data-table/table-component-filtering.stories.js +137 -0
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +158 -0
- package/dist/collection/components/data-table/table-component-pagination.stories.js +127 -0
- package/dist/collection/components/data-table/table-component-sorting.stories.js +126 -0
- package/dist/collection/components/data-table/table-footer/table-footer.css +9 -5
- package/dist/collection/components/data-table/table-footer/table-footer.js +354 -355
- package/dist/collection/components/data-table/table-header/table-header.css +22 -36
- package/dist/collection/components/data-table/table-header/table-header.js +152 -153
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +9 -8
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +317 -320
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +7 -6
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +141 -142
- package/dist/collection/components/datetime/datetime.css +68 -58
- package/dist/collection/components/datetime/datetime.js +344 -243
- package/dist/collection/components/datetime/datetime.stories.js +207 -0
- package/dist/collection/components/divider/divider.stories.js +133 -0
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +339 -339
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +130 -0
- package/dist/collection/components/dropdown/dropdown-native.stories.js +90 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +185 -185
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +167 -0
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +146 -0
- package/dist/collection/components/dropdown/dropdown.css +146 -86
- package/dist/collection/components/dropdown/dropdown.js +576 -553
- package/dist/collection/components/footer/footer.stories.js +117 -0
- package/dist/collection/components/header/header-all.stories.js +217 -0
- package/dist/collection/components/header/header-default.stories.js +47 -0
- package/dist/collection/components/header/header-inline.stories.js +113 -0
- package/dist/collection/components/header/header-search.stories.js +263 -0
- package/dist/collection/components/header/header-toolbar.stories.js +204 -0
- package/dist/collection/components/icon/icon-font.stories.js +57 -0
- package/dist/collection/components/icon/icon-web-component.stories.js +51 -0
- package/dist/collection/components/icon/icon.js +89 -89
- package/dist/collection/components/link/link.stories.js +45 -0
- package/dist/collection/components/link/sdds-link.css +36 -0
- package/dist/collection/components/link/sdds-link.js +121 -0
- package/dist/collection/components/link/sdds-link.stories.js +70 -0
- package/dist/collection/components/message/message.stories.js +108 -0
- package/dist/collection/components/message/sdds-message.css +70 -0
- package/dist/collection/components/message/sdds-message.js +135 -0
- package/dist/collection/components/message/sdds-message.stories.js +106 -0
- package/dist/collection/components/modal/modal-native.stories.js +129 -0
- package/dist/collection/components/modal/modal-webcomponent.stories.js +86 -0
- package/dist/collection/components/modal/modal.css +63 -37
- package/dist/collection/components/modal/modal.js +148 -146
- package/dist/collection/components/popover-canvas/popover-canvas.css +3 -3
- package/dist/collection/components/popover-canvas/popover-canvas.js +219 -190
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +89 -0
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +121 -0
- package/dist/collection/components/popover-menu/popover-menu.css +2 -2
- package/dist/collection/components/popover-menu/popover-menu.js +220 -189
- package/dist/collection/components/popover-menu/popover-menu.stories.js +114 -0
- package/dist/collection/components/radio-button/radio-button-component.css +123 -0
- package/dist/collection/components/radio-button/radio-button-component.stories.js +91 -0
- package/dist/collection/components/radio-button/radio-button.js +160 -0
- package/dist/collection/components/radio-button/radio-button.stories.js +68 -0
- package/dist/collection/components/side-menu/side-menu.stories.js +182 -0
- package/dist/collection/components/slider/slider.css +56 -19
- package/dist/collection/components/slider/slider.js +721 -682
- package/dist/collection/components/slider/slider.stories.js +208 -0
- package/dist/collection/components/spinner/spinner.js +61 -61
- package/dist/collection/components/spinner/spinner.stories.js +59 -0
- package/dist/collection/components/stepper/stepper.stories.js +139 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tab/inline-tab.css +3 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tab/inline-tab.js +80 -0
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +21 -24
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +312 -302
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +71 -0
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +36 -67
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +128 -126
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +46 -0
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +22 -18
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +128 -103
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +32 -0
- package/dist/collection/components/textarea/textarea.css +60 -45
- package/dist/collection/components/textarea/textarea.js +394 -328
- package/dist/collection/components/textarea/textarea.stories.js +169 -0
- package/dist/collection/components/textfield/textfield.css +92 -84
- package/dist/collection/components/textfield/textfield.js +430 -350
- package/dist/collection/components/textfield/textfield.stories.js +239 -0
- package/dist/collection/components/toast/sdds-toast.css +102 -0
- package/dist/collection/components/toast/sdds-toast.js +256 -0
- package/dist/collection/components/toast/sdds-toast.stories.js +86 -0
- package/dist/collection/components/toast/toast.stories.js +129 -0
- package/dist/collection/components/toggle/sdds-toggle.css +104 -0
- package/dist/collection/components/toggle/sdds-toggle.js +261 -0
- package/dist/collection/components/toggle/sdds-toggle.stories.js +92 -0
- package/dist/collection/components/toggle/toggle.stories.js +72 -0
- package/dist/collection/components/tooltip/tooltip.css +3 -3
- package/dist/collection/components/tooltip/tooltip.js +229 -200
- package/dist/collection/components/tooltip/tooltip.stories.js +115 -0
- package/dist/collection/components/utility/colour/background-color.stories.js +96 -0
- package/dist/collection/components/utility/colour/text-color.stories.js +94 -0
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +38 -0
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +71 -0
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +40 -0
- package/dist/collection/foundations-stories/grid/grid.stories.js +386 -0
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +100 -0
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +94 -0
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +16 -0
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +17 -0
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +39 -0
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +12 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/utils/utils.js +12 -12
- package/dist/components/dropdown-option.js +94 -94
- package/dist/components/dropdown.js +296 -289
- package/dist/components/icon.js +49 -49
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +12 -0
- package/dist/components/sdds-accordion-item.js +46 -46
- package/dist/components/sdds-accordion.js +29 -29
- package/dist/components/sdds-badges.js +66 -67
- package/dist/components/sdds-banner.d.ts +11 -0
- package/dist/components/sdds-banner.js +119 -0
- package/dist/components/sdds-block.d.ts +11 -0
- package/dist/components/sdds-block.js +48 -0
- package/dist/components/sdds-breadcrumb-item.d.ts +11 -0
- package/dist/components/sdds-breadcrumb-item.js +43 -0
- package/dist/components/sdds-breadcrumb.d.ts +11 -0
- package/dist/components/sdds-breadcrumb.js +37 -0
- package/dist/components/sdds-button.js +48 -47
- package/dist/components/sdds-card.d.ts +11 -0
- package/dist/components/sdds-card.js +84 -0
- package/dist/components/sdds-checkbox.d.ts +11 -0
- package/dist/components/sdds-checkbox.js +76 -0
- package/dist/components/sdds-datetime.js +112 -73
- package/dist/components/sdds-dropdown-filter.js +127 -127
- package/dist/components/sdds-header-cell.js +161 -164
- package/dist/components/sdds-inline-tab.d.ts +11 -0
- package/dist/components/sdds-inline-tab.js +40 -0
- package/dist/components/sdds-inline-tabs-fullbleed.js +108 -106
- package/dist/components/sdds-inline-tabs.js +236 -226
- package/dist/components/sdds-link.d.ts +11 -0
- package/dist/components/sdds-link.js +6 -0
- package/dist/components/sdds-link2.js +44 -0
- package/dist/components/sdds-message.d.ts +11 -0
- package/dist/components/sdds-message.js +67 -0
- package/dist/components/sdds-modal.js +68 -60
- package/dist/components/sdds-navigation-tabs.js +108 -104
- package/dist/components/sdds-popover-canvas.js +98 -87
- package/dist/components/sdds-popover-menu.js +99 -86
- package/dist/components/sdds-radio-button.d.ts +11 -0
- package/dist/components/sdds-radio-button.js +52 -0
- package/dist/components/sdds-slider.js +385 -357
- package/dist/components/sdds-spinner.js +27 -27
- package/dist/components/sdds-table-body-row-expandable.js +96 -95
- package/dist/components/sdds-table-body.js +281 -281
- package/dist/components/sdds-table-footer.js +186 -187
- package/dist/components/sdds-table-header.js +115 -116
- package/dist/components/sdds-table-toolbar.js +78 -79
- package/dist/components/sdds-table.js +81 -82
- package/dist/components/sdds-textarea.js +92 -73
- package/dist/components/sdds-textfield.js +109 -93
- package/dist/components/sdds-toast.d.ts +11 -0
- package/dist/components/sdds-toast.js +117 -0
- package/dist/components/sdds-toggle.d.ts +11 -0
- package/dist/components/sdds-toggle.js +69 -0
- package/dist/components/sdds-tooltip.js +117 -106
- package/dist/components/table-body-cell.js +95 -96
- package/dist/components/table-body-row.js +114 -113
- package/dist/esm/{index-b67b15a6.js → index-32571711.js} +7 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/sdds-accordion-item.entry.js +21 -21
- package/dist/esm/sdds-accordion.entry.js +12 -12
- package/dist/esm/sdds-badges.entry.js +45 -46
- package/dist/esm/sdds-banner.entry.js +75 -0
- package/dist/esm/sdds-block.entry.js +28 -0
- package/dist/esm/sdds-body-cell_2.entry.js +160 -160
- package/dist/esm/sdds-breadcrumb-item.entry.js +21 -0
- package/dist/esm/sdds-breadcrumb.entry.js +19 -0
- package/dist/esm/sdds-button.entry.js +25 -24
- package/dist/esm/sdds-card.entry.js +52 -0
- package/dist/esm/sdds-checkbox.entry.js +51 -0
- package/dist/esm/sdds-datetime.entry.js +78 -49
- package/dist/esm/sdds-dropdown-filter.entry.js +83 -83
- package/dist/esm/sdds-dropdown_2.entry.js +327 -321
- package/dist/esm/sdds-header-cell.entry.js +130 -132
- package/dist/esm/sdds-icon.entry.js +30 -30
- package/dist/esm/sdds-inline-tab.entry.js +18 -0
- package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +89 -87
- package/dist/esm/sdds-inline-tabs.entry.js +212 -202
- package/dist/esm/sdds-link.entry.js +24 -0
- package/dist/esm/sdds-message.entry.js +37 -0
- package/dist/esm/sdds-modal.entry.js +42 -40
- package/dist/esm/sdds-navigation-tabs.entry.js +89 -86
- package/dist/esm/sdds-popover-canvas.entry.js +74 -66
- package/dist/esm/sdds-popover-menu.entry.js +75 -65
- package/dist/esm/sdds-radio-button.entry.js +28 -0
- package/dist/esm/sdds-slider.entry.js +348 -327
- package/dist/esm/sdds-spinner.entry.js +11 -11
- package/dist/esm/sdds-table-body-row-expandable.entry.js +73 -72
- package/dist/esm/sdds-table-body.entry.js +235 -235
- package/dist/esm/sdds-table-footer.entry.js +155 -156
- package/dist/esm/sdds-table-header.entry.js +90 -91
- package/dist/esm/sdds-table-toolbar.entry.js +56 -57
- package/dist/esm/sdds-table.entry.js +58 -59
- package/dist/esm/sdds-textarea.entry.js +57 -44
- package/dist/esm/sdds-textfield.entry.js +73 -64
- package/dist/esm/sdds-toast.entry.js +82 -0
- package/dist/esm/sdds-toggle.entry.js +40 -0
- package/dist/esm/sdds-tooltip.entry.js +94 -85
- package/dist/esm/tegel.js +2 -2
- package/dist/tegel/p-05d3cfc8.entry.js +1 -0
- package/dist/tegel/p-13a25c7f.entry.js +1 -0
- package/dist/tegel/p-13b783f1.js +2 -0
- package/dist/tegel/p-1dda8de9.entry.js +1 -0
- package/dist/tegel/p-2248b59e.entry.js +1 -0
- package/dist/tegel/p-232e5c9a.entry.js +1 -0
- package/dist/tegel/p-2375f0eb.entry.js +1 -0
- package/dist/tegel/p-29deedc6.entry.js +1 -0
- package/dist/tegel/p-2f52021b.entry.js +1 -0
- package/dist/tegel/p-3344582d.entry.js +1 -0
- package/dist/tegel/{p-040efb32.entry.js → p-4b14324d.entry.js} +1 -1
- package/dist/tegel/p-561fbe77.entry.js +1 -0
- package/dist/tegel/p-5a215722.entry.js +1 -0
- package/dist/tegel/p-5f7b1539.entry.js +1 -0
- package/dist/tegel/p-6f382b38.entry.js +1 -0
- package/dist/tegel/p-765e2719.entry.js +1 -0
- package/dist/tegel/p-76f60546.entry.js +1 -0
- package/dist/tegel/p-7a5244b6.entry.js +1 -0
- package/dist/tegel/p-816ff5f7.entry.js +1 -0
- package/dist/tegel/p-81d2d57b.entry.js +1 -0
- package/dist/tegel/p-87650f36.entry.js +1 -0
- package/dist/tegel/p-8e6f885c.entry.js +1 -0
- package/dist/tegel/p-8e9dcc20.entry.js +1 -0
- package/dist/tegel/p-997fc919.entry.js +1 -0
- package/dist/tegel/p-9a057c9a.entry.js +1 -0
- package/dist/tegel/p-9a95e92c.entry.js +1 -0
- package/dist/tegel/p-a75ff060.entry.js +1 -0
- package/dist/tegel/p-bf1216f9.entry.js +1 -0
- package/dist/tegel/p-bf597564.entry.js +1 -0
- package/dist/tegel/p-d2217bf0.entry.js +1 -0
- package/dist/tegel/p-e335137d.entry.js +1 -0
- package/dist/tegel/p-e34cce75.entry.js +1 -0
- package/dist/tegel/p-e55d09f2.entry.js +1 -0
- package/dist/tegel/p-ebbffa8a.entry.js +1 -0
- package/dist/tegel/{p-a5919930.entry.js → p-ed076d47.entry.js} +1 -1
- package/dist/tegel/p-ef887910.entry.js +1 -0
- package/dist/tegel/p-f4b70868.entry.js +1 -0
- package/dist/tegel/p-f52a0b63.entry.js +1 -0
- package/dist/tegel/p-f5bf214b.entry.js +1 -0
- package/dist/tegel/p-fd1b5923.entry.js +1 -0
- package/dist/tegel/tegel.css +13 -5
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +17 -17
- package/dist/types/components/accordion/accordion.d.ts +7 -7
- package/dist/types/components/accordion/accordion.stories.d.ts +77 -0
- package/dist/types/components/badge/badge.stories.d.ts +66 -0
- package/dist/types/components/badge/badges.d.ts +16 -16
- package/dist/types/components/banner/banner.stories.d.ts +68 -0
- package/dist/types/components/banner/sdds-banner.d.ts +48 -0
- package/dist/types/components/banner/sdds-banner.stories.d.ts +109 -0
- package/dist/types/components/block/block-native.stories.d.ts +31 -0
- package/dist/types/components/block/sdds-block.d.ts +9 -0
- package/dist/types/components/block/sdds-block.stories.d.ts +32 -0
- package/dist/types/components/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +9 -0
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +5 -0
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +12 -0
- package/dist/types/components/button/button-component.d.ts +18 -15
- package/dist/types/components/button/button-native.stories.d.ts +148 -0
- package/dist/types/components/button/button-webcomponent.stories.d.ts +147 -0
- package/dist/types/components/card/card.stories.d.ts +138 -0
- package/dist/types/components/card/sdds-card.d.ts +39 -0
- package/dist/types/components/card/sdds-card.stories.d.ts +139 -0
- package/dist/types/components/checkbox/checkbox.stories.d.ts +39 -0
- package/dist/types/components/checkbox/sdds-checkbox.d.ts +38 -0
- package/dist/types/components/checkbox/sdds-checkbox.stories.d.ts +40 -0
- package/dist/types/components/chips/chips.stories.d.ts +77 -0
- package/dist/types/components/data-table/native-table.stories.d.ts +133 -0
- package/dist/types/components/data-table/table/table.d.ts +47 -47
- package/dist/types/components/data-table/table-body/table-body.d.ts +54 -54
- package/dist/types/components/data-table/table-body-cell/table-body-cell.d.ts +24 -24
- package/dist/types/components/data-table/table-body-row/table-body-row.d.ts +27 -27
- package/dist/types/components/data-table/table-body-row-expandable/table-body-row-expandable.d.ts +27 -27
- package/dist/types/components/data-table/table-component-basic.stories.d.ts +101 -0
- package/dist/types/components/data-table/table-component-batch-actions.stories.d.ts +99 -0
- package/dist/types/components/data-table/table-component-bodydata.stories.d.ts +38 -0
- package/dist/types/components/data-table/table-component-custom-width.stories.d.ts +148 -0
- package/dist/types/components/data-table/table-component-event-listeners.stories.d.ts +88 -0
- package/dist/types/components/data-table/table-component-expandable-rows.stories.d.ts +88 -0
- package/dist/types/components/data-table/table-component-filtering.stories.d.ts +101 -0
- package/dist/types/components/data-table/table-component-multiselect.stories.d.ts +101 -0
- package/dist/types/components/data-table/table-component-pagination.stories.d.ts +101 -0
- package/dist/types/components/data-table/table-component-sorting.stories.d.ts +100 -0
- package/dist/types/components/data-table/table-footer/table-footer.d.ts +50 -50
- package/dist/types/components/data-table/table-header/table-header.d.ts +27 -27
- package/dist/types/components/data-table/table-header-cell/table-header-cell.d.ts +44 -45
- package/dist/types/components/data-table/table-toolbar/table-toolbar.d.ts +22 -22
- package/dist/types/components/datetime/datetime.d.ts +42 -32
- package/dist/types/components/datetime/datetime.stories.d.ts +127 -0
- package/dist/types/components/divider/divider.stories.d.ts +65 -0
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +42 -42
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.stories.d.ts +73 -0
- package/dist/types/components/dropdown/dropdown-native.stories.d.ts +57 -0
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +19 -19
- package/dist/types/components/dropdown/dropdown-wc-default.stories.d.ts +129 -0
- package/dist/types/components/dropdown/dropdown-wc-multiselect.stories.d.ts +115 -0
- package/dist/types/components/dropdown/dropdown.d.ts +58 -56
- package/dist/types/components/footer/footer.stories.d.ts +45 -0
- package/dist/types/components/header/header-all.stories.d.ts +29 -0
- package/dist/types/components/header/header-default.stories.d.ts +29 -0
- package/dist/types/components/header/header-inline.stories.d.ts +29 -0
- package/dist/types/components/header/header-search.stories.d.ts +29 -0
- package/dist/types/components/header/header-toolbar.stories.d.ts +29 -0
- package/dist/types/components/icon/icon-font.stories.d.ts +38 -0
- package/dist/types/components/icon/icon-web-component.stories.d.ts +38 -0
- package/dist/types/components/icon/icon.d.ts +12 -12
- package/dist/types/components/link/link.stories.d.ts +33 -0
- package/dist/types/components/link/sdds-link.d.ts +13 -0
- package/dist/types/components/link/sdds-link.stories.d.ts +58 -0
- package/dist/types/components/message/message.stories.d.ts +69 -0
- package/dist/types/components/message/sdds-message.d.ts +14 -0
- package/dist/types/components/message/sdds-message.stories.d.ts +87 -0
- package/dist/types/components/modal/modal-native.stories.d.ts +59 -0
- package/dist/types/components/modal/modal-webcomponent.stories.d.ts +52 -0
- package/dist/types/components/modal/modal.d.ts +17 -16
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +24 -18
- package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +25 -0
- package/dist/types/components/popover-menu/popover-menu-icons.stories.d.ts +27 -0
- package/dist/types/components/popover-menu/popover-menu.d.ts +24 -18
- package/dist/types/components/popover-menu/popover-menu.stories.d.ts +27 -0
- package/dist/types/components/radio-button/radio-button-component.stories.d.ts +39 -0
- package/dist/types/components/radio-button/radio-button.d.ts +26 -0
- package/dist/types/components/radio-button/radio-button.stories.d.ts +33 -0
- package/dist/types/components/side-menu/side-menu.stories.d.ts +42 -0
- package/dist/types/components/slider/slider.d.ts +86 -82
- package/dist/types/components/slider/slider.stories.d.ts +169 -0
- package/dist/types/components/spinner/spinner.d.ts +7 -7
- package/dist/types/components/spinner/spinner.stories.d.ts +37 -0
- package/dist/types/components/stepper/stepper.stories.d.ts +56 -0
- package/dist/types/components/tabs/inline-tabs-default/inline-tab/inline-tab.d.ts +6 -0
- package/dist/types/components/tabs/inline-tabs-default/inline-tabs.d.ts +40 -41
- package/dist/types/components/tabs/inline-tabs-default/inline-tabs.stories.d.ts +49 -0
- package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.d.ts +20 -20
- package/dist/types/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.d.ts +30 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +20 -18
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +13 -0
- package/dist/types/components/textarea/textarea.d.ts +48 -41
- package/dist/types/components/textarea/textarea.stories.d.ts +116 -0
- package/dist/types/components/textfield/textfield.d.ts +52 -42
- package/dist/types/components/textfield/textfield.stories.d.ts +180 -0
- package/dist/types/components/toast/sdds-toast.d.ts +36 -0
- package/dist/types/components/toast/sdds-toast.stories.d.ts +56 -0
- package/dist/types/components/toast/toast.stories.d.ts +69 -0
- package/dist/types/components/toggle/sdds-toggle.d.ts +34 -0
- package/dist/types/components/toggle/sdds-toggle.stories.d.ts +74 -0
- package/dist/types/components/toggle/toggle.stories.d.ts +55 -0
- package/dist/types/components/tooltip/tooltip.d.ts +24 -20
- package/dist/types/components/tooltip/tooltip.stories.d.ts +54 -0
- package/dist/types/components/utility/colour/background-color.stories.d.ts +58 -0
- package/dist/types/components/utility/colour/text-color.stories.d.ts +58 -0
- package/dist/types/components.d.ts +939 -48
- package/dist/types/foundations-stories/colour/colour-brand.stories.d.ts +13 -0
- package/dist/types/foundations-stories/colour/colour-scales.stories.d.ts +13 -0
- package/dist/types/foundations-stories/colour/colour-semantic.stories.d.ts +13 -0
- package/dist/types/foundations-stories/grid/grid.stories.d.ts +35 -0
- package/dist/types/foundations-stories/spacing/spacing-element.stories.d.ts +8 -0
- package/dist/types/foundations-stories/spacing/spacing-layout.stories.d.ts +8 -0
- package/dist/types/foundations-stories/typography/typography-body.stories.d.ts +8 -0
- package/dist/types/foundations-stories/typography/typography-detail.stories.d.ts +8 -0
- package/dist/types/foundations-stories/typography/typography-headline.stories.d.ts +21 -0
- package/dist/types/foundations-stories/typography/typography-paragraph.stories.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/package.json +1 -1
- package/readme.md +41 -8
- package/dist/tegel/p-12ca5cfa.entry.js +0 -1
- package/dist/tegel/p-157e1618.js +0 -2
- package/dist/tegel/p-1fe61cf6.entry.js +0 -1
- package/dist/tegel/p-2f376504.entry.js +0 -1
- package/dist/tegel/p-44ced895.entry.js +0 -1
- package/dist/tegel/p-4880f03d.entry.js +0 -1
- package/dist/tegel/p-4aba73a3.entry.js +0 -1
- package/dist/tegel/p-4b58a02c.entry.js +0 -1
- package/dist/tegel/p-4cb85347.entry.js +0 -1
- package/dist/tegel/p-52031b5a.entry.js +0 -1
- package/dist/tegel/p-677baf7f.entry.js +0 -1
- package/dist/tegel/p-71797eaf.entry.js +0 -1
- package/dist/tegel/p-7373284c.entry.js +0 -1
- package/dist/tegel/p-7451779b.entry.js +0 -1
- package/dist/tegel/p-77aeea3b.entry.js +0 -1
- package/dist/tegel/p-8582d6a7.entry.js +0 -1
- package/dist/tegel/p-96021bd0.entry.js +0 -1
- package/dist/tegel/p-9d8caf51.entry.js +0 -1
- package/dist/tegel/p-b01cface.entry.js +0 -1
- package/dist/tegel/p-bf896643.entry.js +0 -1
- package/dist/tegel/p-c311725c.entry.js +0 -1
- package/dist/tegel/p-cf72dfd9.entry.js +0 -1
- package/dist/tegel/p-d91caec6.entry.js +0 -1
- package/dist/tegel/p-e10eec33.entry.js +0 -1
- package/dist/tegel/p-f2262a69.entry.js +0 -1
- package/dist/tegel/p-f2f7aa45.entry.js +0 -1
|
@@ -1,207 +1,217 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-32571711.js';
|
|
2
2
|
|
|
3
|
-
const inlineTabsCss = ":host{outline:0 !important;box-sizing:border-box}:host *{box-sizing:border-box}.sdds-inline-tabs{overflow:hidden;outline:0}.sdds-inline-tabs-header{position:relative}.sdds-inline-tabs-main{background-color:var(--sdds-inline-tabs-main-
|
|
3
|
+
const inlineTabsCss = ":host{outline:0 !important;box-sizing:border-box}:host *{box-sizing:border-box}.sdds-inline-tabs{overflow:hidden;outline:0}.sdds-inline-tabs-header{position:relative}.sdds-inline-tabs-main{background-color:var(--sdds-inline-tabs-main-background);padding:24px 24px 48px}.sdds-inline-tabs-wrapper{display:flex;overflow-x:scroll;scrollbar-width:none}.sdds-inline-tabs-wrapper::-webkit-scrollbar{display:none}.sdds-inline-tabs--forward,.sdds-inline-tabs--back{cursor:pointer;width:48px;height:100%;border:0;position:absolute;top:0;background-color:var(--sdds-inline-tabs-scroll-btn-background);display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none}.sdds-inline-tabs--forward__show,.sdds-inline-tabs--back__show{opacity:1;pointer-events:all}.sdds-inline-tabs--forward:hover,.sdds-inline-tabs--back:hover{background-color:var(--sdds-inline-tabs-scroll-btn-background-hover)}.sdds-inline-tabs--forward:active,.sdds-inline-tabs--back:active{background-color:var(--sdds-inline-tabs-scroll-btn-background-active)}.sdds-inline-tabs--forward:focus,.sdds-inline-tabs--back:focus{outline:2px solid var(--sdds-blue-400);outline-offset:-2px}.sdds-inline-tabs--forward svg,.sdds-inline-tabs--back svg{fill:var(--sdds-inline-tabs-scroll-btn-color)}.sdds-inline-tabs--back{left:0}.sdds-inline-tabs--forward{right:0}.sdds-inline-tabs--tab{font:var(--sdds-headline-07);letter-spacing:var(--sdds-headline-07-ls);cursor:pointer;border:0;color:var(--sdds-inline-tabs-tab-color);background-color:var(--sdds-inline-tabs-tab-background);padding:16px;min-width:142px;text-decoration:none;display:block;position:relative;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out;white-space:nowrap;flex-shrink:0;text-align:left;outline:none}.sdds-inline-tabs--tab>*{opacity:0.6}.sdds-inline-tabs--tab:not(:last-child){border-right:1px solid var(--sdds-inline-tabs-tab-border-color)}.sdds-inline-tabs--tab::after{content:\" \";position:absolute;top:0;right:0;left:0;margin-left:auto;width:0;margin-right:auto;height:2px;background-color:var(--sdds-inline-tabs-tab-indicator-background);transition:width 0.15s ease-in-out}.sdds-inline-tabs--tab:hover{background-color:var(--sdds-inline-tabs-tab-background-hover);color:var(--sdds-inline-tabs-tab-color-hover);text-decoration:none}.sdds-inline-tabs--tab:focus{outline:2px solid var(--sdds-blue-400);outline-offset:-2px}.sdds-inline-tabs--tab__active{background-color:var(--sdds-inline-tabs-tab-background-active);color:var(--sdds-inline-tabs-tab-color-active);cursor:initial;border-right:1px solid transparent !important}.sdds-inline-tabs--tab__active>*{opacity:1}.sdds-inline-tabs--tab__active:hover{background-color:var(--sdds-inline-tabs-tab-background-active)}.sdds-inline-tabs--tab__active::after{width:calc(100% + 2px);left:-1px;background-color:var(--sdds-inline-tabs-tab-indicator-background-active)}.sdds-inline-tabs--tab__active::before{content:\" \";background-color:var(--sdds-inline-tabs-tab-background-active);width:1px;top:0;bottom:0;left:-1px;display:block;position:absolute}.sdds-inline-tabs--tab__active:first-child:focus::before{left:0}.sdds-inline-tabs--tab:disabled,.sdds-inline-tabs--tab__disabled{cursor:initial;color:var(--sdds-navigation-tabs-tab-color-disabled);pointer-events:none}.sdds-inline-tabs--tab:disabled>*,.sdds-inline-tabs--tab__disabled>*{opacity:0.16}.sdds-inline-tabs--tab__active{background-color:var(--sdds-inline-tabs-tab-background-active)}.sdds-inline-tabs-main{background-color:var(--sdds-inline-tabs-main-background)}";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
componentWillLoad() {
|
|
35
|
-
this.
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
navButton.style.width = oldStyle;
|
|
75
|
-
if (navButton.clientWidth > best) {
|
|
76
|
-
best = width;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
this.buttonWidth = best;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
let best = 0;
|
|
83
|
-
this.tabs.forEach(
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
tab.element.style.display =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
tab
|
|
158
|
-
tab.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (scroll
|
|
190
|
-
this.
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
this.
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
5
|
+
function generateKeyFromName(name) {
|
|
6
|
+
return name
|
|
7
|
+
.replace(/\s/g, '-')
|
|
8
|
+
.replace(/[^a-z0-9-]/gi, '')
|
|
9
|
+
.toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
const InlineTabs = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
registerInstance(this, hostRef);
|
|
14
|
+
this.startingTab = null; // name of the tab to show by default (infered from either "default-tab"-prop (on component) or "default"-prop (on a slotted child)
|
|
15
|
+
this.navWrapperElement = null; // reference to container with nav buttons
|
|
16
|
+
this.tabWrapperElement = null; // reference to container with slotted children
|
|
17
|
+
this.componentWidth = 0; // visible width of this component
|
|
18
|
+
this.buttonsWidth = 0; // total width of all nav items combined
|
|
19
|
+
this.scrollWidth = 0; // total amount that is possible to scroll in the nav wrapper
|
|
20
|
+
this.useAutoHeight = false; // set height for slotted children or not
|
|
21
|
+
this.defaultTab = '';
|
|
22
|
+
this.autoHeight = false;
|
|
23
|
+
this.modeVariant = null;
|
|
24
|
+
this.tabs = [];
|
|
25
|
+
this.buttonWidth = 0;
|
|
26
|
+
this.tabHeight = 0;
|
|
27
|
+
this.showLeftScroll = false;
|
|
28
|
+
this.showRightScroll = false;
|
|
29
|
+
}
|
|
30
|
+
/** used for switching to a tab programmatically */
|
|
31
|
+
async showTab(key) {
|
|
32
|
+
this.switchToTab(key);
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.initComponent();
|
|
36
|
+
}
|
|
37
|
+
initComponent(createInitialState = true) {
|
|
38
|
+
if (this.autoHeight) {
|
|
39
|
+
this.useAutoHeight = true;
|
|
40
|
+
}
|
|
41
|
+
this.tabs = Array.from(this.host.children).map((item, index) => {
|
|
42
|
+
const name = item.label ? item.label : item.getAttribute('name') || `Tab ${index + 1}`;
|
|
43
|
+
const key = generateKeyFromName(name);
|
|
44
|
+
if (item.default) {
|
|
45
|
+
this.startingTab = key;
|
|
46
|
+
}
|
|
47
|
+
let disabled = false;
|
|
48
|
+
if (item.disabled) {
|
|
49
|
+
disabled = true;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
name,
|
|
53
|
+
key,
|
|
54
|
+
element: item,
|
|
55
|
+
disabled,
|
|
56
|
+
visible: true,
|
|
57
|
+
initialDisplay: window.getComputedStyle(item).display,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
if (createInitialState) {
|
|
61
|
+
this.setInitialState();
|
|
62
|
+
}
|
|
63
|
+
this.tabs = Array.from(this.tabs);
|
|
64
|
+
}
|
|
65
|
+
calculateButtonWidth() {
|
|
66
|
+
const navButtons = this.navWrapperElement.querySelectorAll('button.sdds-inline-tabs--tab');
|
|
67
|
+
let best = 0;
|
|
68
|
+
Array.from(navButtons).forEach((navButton) => {
|
|
69
|
+
const oldStyle = navButton.style.width;
|
|
70
|
+
// eslint-disable-next-line no-param-reassign
|
|
71
|
+
navButton.style.width = '';
|
|
72
|
+
const width = navButton.clientWidth;
|
|
73
|
+
// eslint-disable-next-line no-param-reassign
|
|
74
|
+
navButton.style.width = oldStyle;
|
|
75
|
+
if (navButton.clientWidth > best) {
|
|
76
|
+
best = width;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.buttonWidth = best;
|
|
80
|
+
}
|
|
81
|
+
calculateTabHeight() {
|
|
82
|
+
let best = 0;
|
|
83
|
+
this.tabs.forEach((_, tabIndex) => {
|
|
84
|
+
const tab = this.tabs[tabIndex];
|
|
85
|
+
// TODO: add comment on what this does
|
|
86
|
+
const oldStyle = tab.element.style.display;
|
|
87
|
+
tab.element.style.display = '';
|
|
88
|
+
const height = tab.element.clientHeight;
|
|
89
|
+
tab.element.style.display = oldStyle;
|
|
90
|
+
if (height > best) {
|
|
91
|
+
best = height;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
this.tabHeight = best;
|
|
95
|
+
}
|
|
96
|
+
componentDidRender() {
|
|
97
|
+
this.calculateTabHeight();
|
|
98
|
+
this.calculateButtonWidth();
|
|
99
|
+
}
|
|
100
|
+
componentDidLoad() {
|
|
101
|
+
const mutationObserver = new MutationObserver(( /* mutations, observer */) => {
|
|
102
|
+
const visibleTab = this.tabs.find((tab) => tab.visible);
|
|
103
|
+
this.initComponent(false);
|
|
104
|
+
this.calculateTabHeight();
|
|
105
|
+
this.calculateButtonWidth();
|
|
106
|
+
if (visibleTab) {
|
|
107
|
+
this.switchToTab(visibleTab.key);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
111
|
+
entries.forEach((entry) => {
|
|
112
|
+
const componentWidth = entry.contentRect.width;
|
|
113
|
+
let buttonsWidth = 0;
|
|
114
|
+
const navButtons = entry.target.querySelectorAll('button.sdds-inline-tabs--tab');
|
|
115
|
+
Array.from(navButtons).forEach((navButton) => {
|
|
116
|
+
buttonsWidth += navButton.clientWidth;
|
|
117
|
+
});
|
|
118
|
+
this.componentWidth = componentWidth;
|
|
119
|
+
this.buttonsWidth = buttonsWidth;
|
|
120
|
+
this.scrollWidth = buttonsWidth - componentWidth;
|
|
121
|
+
if (this.buttonsWidth > this.componentWidth) {
|
|
122
|
+
this.evaluateScrollButtons();
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.showLeftScroll = false;
|
|
126
|
+
this.showRightScroll = false;
|
|
127
|
+
}
|
|
128
|
+
this.calculateTabHeight();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
mutationObserver.observe(this.host, {
|
|
132
|
+
childList: true,
|
|
133
|
+
attributes: true,
|
|
134
|
+
});
|
|
135
|
+
resizeObserver.observe(this.navWrapperElement);
|
|
136
|
+
this.calculateButtonWidth();
|
|
137
|
+
this.calculateTabHeight();
|
|
138
|
+
}
|
|
139
|
+
setInitialState() {
|
|
140
|
+
if (this.defaultTab) {
|
|
141
|
+
this.startingTab = this.defaultTab;
|
|
142
|
+
}
|
|
143
|
+
this.tabs.forEach((tab, index) => {
|
|
144
|
+
if (this.startingTab) {
|
|
145
|
+
if (tab.key !== this.startingTab) {
|
|
146
|
+
this.hideTab(index);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
if (index > 0) {
|
|
151
|
+
this.hideTab(index);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
unhideTab(tabIndex) {
|
|
157
|
+
const tab = this.tabs[tabIndex];
|
|
158
|
+
tab.element.style.display = '';
|
|
159
|
+
tab.visible = true;
|
|
160
|
+
}
|
|
161
|
+
hideTab(tabIndex) {
|
|
162
|
+
const tab = this.tabs[tabIndex];
|
|
163
|
+
tab.element.style.display = 'none';
|
|
164
|
+
tab.visible = false;
|
|
165
|
+
}
|
|
166
|
+
switchToTab(key) {
|
|
167
|
+
this.tabs.forEach((tab, index) => {
|
|
168
|
+
if (tab.key === key) {
|
|
169
|
+
this.unhideTab(index);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.hideTab(index);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
this.tabs = Array.from(this.tabs);
|
|
176
|
+
}
|
|
177
|
+
scrollRight() {
|
|
178
|
+
const scroll = this.navWrapperElement.scrollLeft;
|
|
179
|
+
this.navWrapperElement.scrollLeft = scroll + this.buttonWidth;
|
|
180
|
+
this.evaluateScrollButtons();
|
|
181
|
+
}
|
|
182
|
+
scrollLeft() {
|
|
183
|
+
const scroll = this.navWrapperElement.scrollLeft;
|
|
184
|
+
this.navWrapperElement.scrollLeft = scroll - this.buttonWidth;
|
|
185
|
+
this.evaluateScrollButtons();
|
|
186
|
+
}
|
|
187
|
+
evaluateScrollButtons() {
|
|
188
|
+
const scroll = this.navWrapperElement.scrollLeft;
|
|
189
|
+
if (scroll >= this.scrollWidth) {
|
|
190
|
+
this.showRightScroll = false;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.showRightScroll = true;
|
|
194
|
+
}
|
|
195
|
+
if (scroll <= 0) {
|
|
196
|
+
this.showLeftScroll = false;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
this.showLeftScroll = true;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
render() {
|
|
203
|
+
const style = {};
|
|
204
|
+
if (this.useAutoHeight) {
|
|
205
|
+
style.height = `${this.tabHeight}px`;
|
|
206
|
+
}
|
|
207
|
+
return (h(Host, { class: `${this.modeVariant !== null ? `sdds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { class: `sdds-inline-tabs sdds-inline-tabs` }, h("nav", { class: "sdds-inline-tabs-header" }, h("div", { ref: (el) => {
|
|
208
|
+
this.navWrapperElement = el;
|
|
209
|
+
}, class: "sdds-inline-tabs-wrapper" }, this.tabs.map((tab) => (h("button", { style: { width: `${this.buttonWidth}px` }, disabled: tab.disabled, class: `sdds-inline-tabs--tab ${tab.visible ? 'sdds-inline-tabs--tab__active' : ''}`, onClick: () => this.switchToTab(tab.key) }, h("span", null, tab.name))))), h("div", { class: "sdds-inline-tabs-header-navigation" }, h("button", { class: `sdds-inline-tabs--forward ${this.showRightScroll ? 'sdds-inline-tabs--back__show' : ''}`, disabled: !this.showRightScroll, onClick: () => this.scrollRight() }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.1147 17.3291C5.87062 17.0851 5.87062 16.6893 6.1147 16.4453L12.2948 10.2652C12.4412 10.1187 12.4412 9.8813 12.2948 9.73485L6.1147 3.55476C5.87062 3.31068 5.87062 2.91496 6.1147 2.67088C6.35878 2.4268 6.75451 2.4268 6.99858 2.67088L13.1787 8.85097C13.8133 9.48557 13.8133 10.5145 13.1787 11.1491L6.99858 17.3291C6.75451 17.5732 6.35878 17.5732 6.1147 17.3291Z" }))), h("button", { class: `sdds-inline-tabs--back ${this.showLeftScroll ? 'sdds-inline-tabs--back__show' : ''}`, disabled: !this.showLeftScroll, onClick: () => this.scrollLeft() }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M13.8853 2.67085C14.1294 2.91493 14.1294 3.31066 13.8853 3.55473L7.70522 9.73482C7.55878 9.88127 7.55878 10.1187 7.70522 10.2652L13.8853 16.4452C14.1294 16.6893 14.1294 17.085 13.8853 17.3291C13.6412 17.5732 13.2455 17.5732 13.0014 17.3291L6.82134 11.149C6.18674 10.5144 6.18674 9.48554 6.82134 8.85094L13.0014 2.67085C13.2455 2.42677 13.6412 2.42677 13.8853 2.67085Z" }))))), h("div", { ref: (el) => {
|
|
210
|
+
this.tabWrapperElement = el;
|
|
211
|
+
}, class: "sdds-inline-tabs-main", style: style }, h("slot", null)))));
|
|
212
|
+
}
|
|
213
|
+
get host() { return getElement(this); }
|
|
214
|
+
};
|
|
205
215
|
InlineTabs.style = inlineTabsCss;
|
|
206
216
|
|
|
207
217
|
export { InlineTabs as sdds_inline_tabs };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-32571711.js';
|
|
2
|
+
|
|
3
|
+
const sddsLinkCss = "a{cursor:pointer;outline:none;color:var(--sdds-link)}a:active{color:var(--sdds-link);text-decoration:underline;text-decoration-color:var(--sdds-link)}a:hover{color:var(--sdds-link-hover);text-decoration:underline;text-decoration-color:var(--sdds-link-hover)}a:visited{color:var(--sdds-link-visited);text-decoration-color:var(--sdds-link-visited)}a:focus{color:var(--sdds-link-focus);text-decoration:none;outline:2px solid var(--sdds-link-focus);outline-offset:-2px}a.disabled{color:var(--sdds-link-disabled);text-decoration-color:var(--sdds-link-disabled);pointer-events:none}a.no-underline{text-decoration:none}a.no-underline:hover{text-decoration:none}";
|
|
4
|
+
|
|
5
|
+
const SddsLink = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.href = undefined;
|
|
9
|
+
this.target = '_self';
|
|
10
|
+
this.disabled = false;
|
|
11
|
+
this.underline = true;
|
|
12
|
+
this.rel = 'noopener';
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (h("a", { class: `
|
|
16
|
+
${this.disabled ? 'disabled' : ''}
|
|
17
|
+
${this.underline ? '' : 'no-underline'}
|
|
18
|
+
|
|
19
|
+
`, href: this.href, target: this.target, rel: this.rel }, h("slot", null)));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
SddsLink.style = sddsLinkCss;
|
|
23
|
+
|
|
24
|
+
export { SddsLink as sdds_link };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-32571711.js';
|
|
2
|
+
|
|
3
|
+
const sddsMessageCss = ":host .message-wrapper{display:flex;padding:16px;background-color:var(--sdds-message-background);border-radius:4px}:host .message-wrapper.information{border-left:4px solid var(--sdds-information)}:host .message-wrapper.information sdds-icon{color:var(--sdds-information)}:host .message-wrapper.success{border-left:4px solid var(--sdds-positive)}:host .message-wrapper.success sdds-icon{color:var(--sdds-positive)}:host .message-wrapper.error{background-color:var(--sdds-message-type-error-background);border-left:4px solid var(--sdds-negative)}:host .message-wrapper.error sdds-icon{color:var(--sdds-negative)}:host .message-wrapper.warning{border-left:4px solid var(--sdds-warning)}:host .message-wrapper.warning sdds-icon{color:var(--sdds-warning)}:host .message-wrapper.message-minimal{border:none;display:flex;align-items:center;padding:0;background-color:transparent}:host .message-wrapper.message-minimal .message-header{font:var(--sdds-detail-02);letter-spacing:var(--sdds-detail-02-ls)}:host .message-wrapper.message-minimal sdds-icon{padding-right:8px}:host sdds-icon{padding-right:16px}:host .message-content{display:flex;flex-direction:column;gap:4px;color:var(--sdds-message-color);padding:2px 0}:host .message-content .message-header{font:var(--sdds-headline-07);letter-spacing:var(--sdds-headline-07-ls)}:host .message-content .message-extended-message{color:var(--sdds-message-color);font:var(--sdds-detail-02);letter-spacing:var(--sdds-detail-02-ls)}:host .sdds-mode-variant-primary{--sdds-message-background:var(--sdds-message-background-primary)}:host .sdds-mode-variant-secondary{--sdds-message-background:var(--sdds-message-background-secondary)}";
|
|
4
|
+
|
|
5
|
+
const SddsMessage = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.getIconName = () => {
|
|
9
|
+
switch (this.type) {
|
|
10
|
+
case 'information':
|
|
11
|
+
return 'info';
|
|
12
|
+
case 'error':
|
|
13
|
+
return 'error';
|
|
14
|
+
case 'warning':
|
|
15
|
+
return 'warning';
|
|
16
|
+
case 'success':
|
|
17
|
+
return 'tick';
|
|
18
|
+
default:
|
|
19
|
+
return 'info';
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.header = undefined;
|
|
23
|
+
this.modeVariant = null;
|
|
24
|
+
this.type = 'information';
|
|
25
|
+
this.noIcon = false;
|
|
26
|
+
this.minimal = false;
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return (h(Host, null, h("div", { class: `
|
|
30
|
+
message-wrapper ${this.type}
|
|
31
|
+
${this.minimal ? 'message-minimal' : ''}
|
|
32
|
+
${this.modeVariant !== null ? `sdds-mode-variant-${this.modeVariant}` : ''}` }, !this.noIcon && h("sdds-icon", { name: this.getIconName(), size: "20px" }), h("div", { class: `message-content` }, this.header && h("div", { class: "message-header" }, this.header), !this.minimal && (h("div", { class: "message-extended-message" }, h("slot", null)))))));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
SddsMessage.style = sddsMessageCss;
|
|
36
|
+
|
|
37
|
+
export { SddsMessage as sdds_message };
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-32571711.js';
|
|
2
2
|
|
|
3
|
-
const modalCss = ":root
|
|
3
|
+
const modalCss = ":root,.sdds-mode-light{--sdds-modal-backdrop:rgba(0 0 0 / 40%);--sdds-modal-background:var(--sdds-white);--sdds-modal-text:var(--sdds-grey-958);--sdds-modal-icon:var(--sdds-black);--sdds-modal-icon-native:url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.40338 2.34308C3.11048 2.05019 2.63561 2.05019 2.34272 2.34308C2.04982 2.63598 2.04982 3.11085 2.34272 3.40374L6.93897 8L2.34283 12.5961C2.04994 12.889 2.04994 13.3639 2.34283 13.6568C2.63572 13.9497 3.1106 13.9497 3.40349 13.6568L7.99963 9.06066L12.5958 13.6568C12.8887 13.9497 13.3635 13.9497 13.6564 13.6568C13.9493 13.3639 13.9493 12.889 13.6564 12.5961L9.06029 8L13.6565 3.40376C13.9494 3.11086 13.9494 2.63599 13.6565 2.3431C13.3636 2.0502 12.8888 2.0502 12.5959 2.3431L7.99963 6.93934L3.40338 2.34308Z' fill='black'/%3E%3C/svg%3E%0A\");--sdds-modal-scrollbar:var(--sdds-grey-300);--sdds-modal-scrollbar-track:var(--sdds-grey-300);--sdds-modal-scrollbar-thumb:var(--sdds-grey-500)}.sdds-mode-dark{--sdds-modal-backdrop:rgba(0 0 0 / 40%);--sdds-modal-background:var(--sdds-grey-900);--sdds-modal-text:var(--sdds-grey-50);--sdds-modal-icon:var(--sdds-white);--sdds-modal-icon-native:url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.40338 2.34308C3.11048 2.05019 2.63561 2.05019 2.34272 2.34308C2.04982 2.63598 2.04982 3.11085 2.34272 3.40374L6.93897 8L2.34283 12.5961C2.04994 12.889 2.04994 13.3639 2.34283 13.6568C2.63572 13.9497 3.1106 13.9497 3.40349 13.6568L7.99963 9.06066L12.5958 13.6568C12.8887 13.9497 13.3635 13.9497 13.6564 13.6568C13.9493 13.3639 13.9493 12.889 13.6564 12.5961L9.06029 8L13.6565 3.40376C13.9494 3.11086 13.9494 2.63599 13.6565 2.3431C13.3636 2.0502 12.8888 2.0502 12.5959 2.3431L7.99963 6.93934L3.40338 2.34308Z' fill='white'/%3E%3C/svg%3E%0A\");--sdds-modal-scrollbar:var(--sdds-grey-300);--sdds-modal-scrollbar-track:var(--sdds-grey-300);--sdds-modal-scrollbar-thumb:var(--sdds-grey-500)}.sdds-modal{box-sizing:border-box;background-color:var(--sdds-modal-background);margin:auto;position:relative;border-radius:4px;padding:16px;max-height:85vh;overflow-y:auto;}.sdds-modal *{box-sizing:border-box}.sdds-modal::-webkit-scrollbar{width:5px;background-color:var(--sdds-grey-300);border-radius:0 1em 1em 0}.sdds-modal::-webkit-scrollbar-track{background-color:var(--sdds-grey-300);border-radius:0 1em 1em 0}.sdds-modal::-webkit-scrollbar-thumb{background-color:var(--sdds-grey-500);border-radius:0 1em 1em 0}.sdds-modal__actions-sticky{overflow:hidden}.sdds-modal__actions-sticky .sdds-modal-body{font:var(--sdds-body-01);letter-spacing:var(--sdds-body-01-ls);padding-bottom:96px;margin:0 -16px 0 0;max-height:calc(85vh - 36px);overflow-y:auto}.sdds-modal__actions-sticky .sdds-modal-actions{position:absolute;bottom:-1px;left:0;right:0;background-color:var(--sdds-modal-background);padding:var(--sdds-spacing-element-16);display:flex;gap:16px}.sdds-modal__actions-static .sdds-modal-actions{background-color:var(--sdds-modal-background);display:flex;gap:16px}@media (min-width: 320px){.sdds-modal-xs{width:100%}.sdds-modal-sm{width:100%}.sdds-modal-md{width:100%}.sdds-modal-lg{width:100%}}@media (min-width: 672px){.sdds-modal-xs{width:75%}.sdds-modal-sm{width:62.5%}.sdds-modal-md{width:75%}.sdds-modal-lg{width:100%}}@media (min-width: 1056px){.sdds-modal-xs{width:31.25%}.sdds-modal-sm{width:43.75%}.sdds-modal-md{width:62.5%}.sdds-modal-lg{width:75%}}@media (min-width: 1312px){.sdds-modal-xs{width:31.25%}.sdds-modal-sm{width:37.5%}.sdds-modal-md{width:62.5%}.sdds-modal-lg{width:75%}}@media (min-width: 1584px){.sdds-modal-xs{width:25%}.sdds-modal-sm{width:37.5%}.sdds-modal-md{width:50%}.sdds-modal-lg{width:75%}}@media (max-width: 320px){.sdds-modal-md,.sdds-modal-lg,.sdds-modal-sm{height:100%}.sdds-modal-md slot[name=sdds-modal-actions]::slotted(*),.sdds-modal-lg slot[name=sdds-modal-actions]::slotted(*),.sdds-modal-sm slot[name=sdds-modal-actions]::slotted(*){display:flex}}.sdds-modal-header{display:flex;padding-bottom:var(--sdds-spacing-element-8);position:sticky;top:0;background-color:var(--sdds-modal-background);z-index:1}.sdds-modal-header::before{content:\" \";position:absolute;height:16px;top:-16px;width:100%;background-color:var(--sdds-modal-background)}.sdds-modal-headline{color:var(--sdds-modal-text);font:var(--sdds-headline-05);letter-spacing:var(--sdds-headline-05-ls);margin:0;flex:1;color:var(--sdds-modal-text)}.sdds-modal-body{color:var(--sdds-modal-text);font:var(--sdds-body-01);letter-spacing:var(--sdds-body-01-ls);padding-bottom:40px;overflow-y:visible;padding-right:16px;}.sdds-modal-body::-webkit-scrollbar{width:5px;background-color:var(--sdds-grey-300)}.sdds-modal-body::-webkit-scrollbar-track{background-color:var(--sdds-grey-300)}.sdds-modal-body::-webkit-scrollbar-thumb{background-color:var(--sdds-grey-500)}@media (min-width: 1056px){.sdds-modal-body{padding-right:64px}}.sdds-modal-backdrop{box-sizing:border-box;left:0;top:0;position:fixed;height:100%;width:100%;z-index:600;background-color:var(--sdds-modal-backdrop);padding:0 16px}.sdds-modal-backdrop *{box-sizing:border-box}@media (max-width: 320px){.sdds-modal-backdrop{padding:0}}.sdds-modal-backdrop.show{display:flex}.sdds-modal-backdrop.hide{display:none}button.sdds-modal-close{background-color:transparent;border:0;padding:0;appearance:unset}.sdds-modal-close{display:inline-block;height:auto;color:var(--sdds-modal-icon);cursor:pointer}.sdds-modal-close:focus{outline:2px solid var(--sdds-blue-400);outline-offset:-2px}@media (min-width: 320px){.sdds-modal-close{margin-left:var(--sdds-spacing-element-16)}}@media (min-width: 1056px){.sdds-modal-close{margin-left:var(--sdds-spacing-element-48)}}.sdds-modal-close-btn{display:inline-block;height:auto;background-repeat:no-repeat;cursor:pointer}@media (min-width: 320px){.sdds-modal-close-btn{margin-left:var(--sdds-spacing-element-16)}}@media (min-width: 1056px){.sdds-modal-close-btn{margin-left:var(--sdds-spacing-element-48)}}.sdds-modal-close-btn svg{fill:var(--sdds-modal-icon)}.sdds-modal-overflow{overflow:hidden}:host{left:0;top:0;position:fixed;height:100%;width:100%;z-index:600;background-color:var(--sdds-modal-backdrop);padding:0 16px}@media (max-width: 320px){:host{padding:0}}:host.show{display:flex}:host.hide{display:none}:host .sdds-modal-close{border:none;background-color:transparent}:host .sdds-modal-close-btn{border:none;background-color:transparent}:host(.show){display:flex}:host(.hide){display:none}";
|
|
4
4
|
|
|
5
|
-
const Modal = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.prevent = false;
|
|
9
|
-
this.size = 'md';
|
|
10
|
-
this.actions = 'static';
|
|
11
|
-
this.open = false;
|
|
12
|
-
}
|
|
13
|
-
/** Shows the modal */
|
|
14
|
-
async openModal() {
|
|
15
|
-
this.open = true;
|
|
16
|
-
}
|
|
17
|
-
setDissmissButtons() {
|
|
18
|
-
const nodes = this.el.querySelectorAll('[data-dismiss-modal]');
|
|
19
|
-
nodes.forEach((el) => {
|
|
20
|
-
el.addEventListener('click', () => {
|
|
21
|
-
this.open = false;
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
handleClick(e) {
|
|
26
|
-
const targetList = e.composedPath();
|
|
27
|
-
const target = targetList[0];
|
|
28
|
-
if (target.classList[0] === 'sdds-modal-
|
|
29
|
-
(target.classList[0] === 'sdds-modal-backdrop' && this.prevent === false)) {
|
|
30
|
-
this.open = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
componentDidRender() {
|
|
34
|
-
this.setDissmissButtons();
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
return (h(Host, { onClick: (event) => {
|
|
38
|
-
this.handleClick(event);
|
|
39
|
-
}, class: `sdds-modal-backdrop ${this.open ? 'show' : 'hide'}` }, h("div", { class: `sdds-modal ${this.actions ? `sdds-modal__actions-${this.actions}` : ''} ${this.size ? `sdds-modal-${this.size}` : ''} ` }, h("div", { class: "sdds-modal-header" }, h("slot", { name: "sdds-modal-headline" }), h("button", { class: "sdds-modal-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
5
|
+
const Modal = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.prevent = false;
|
|
9
|
+
this.size = 'md';
|
|
10
|
+
this.actions = 'static';
|
|
11
|
+
this.open = false;
|
|
12
|
+
}
|
|
13
|
+
/** Shows the modal */
|
|
14
|
+
async openModal() {
|
|
15
|
+
this.open = true;
|
|
16
|
+
}
|
|
17
|
+
setDissmissButtons() {
|
|
18
|
+
const nodes = this.el.querySelectorAll('[data-dismiss-modal]');
|
|
19
|
+
[...Array.from(nodes), this.closeButtonEl].forEach((el) => {
|
|
20
|
+
el.addEventListener('click', () => {
|
|
21
|
+
this.open = false;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
handleClick(e) {
|
|
26
|
+
const targetList = e.composedPath();
|
|
27
|
+
const target = targetList[0];
|
|
28
|
+
if (target.classList[0] === 'sdds-modal-close' ||
|
|
29
|
+
(target.classList[0] === 'sdds-modal-backdrop' && this.prevent === false)) {
|
|
30
|
+
this.open = false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
componentDidRender() {
|
|
34
|
+
this.setDissmissButtons();
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return (h(Host, { onClick: (event) => {
|
|
38
|
+
this.handleClick(event);
|
|
39
|
+
}, class: `sdds-modal-backdrop ${this.open ? 'show' : 'hide'}` }, h("div", { class: `sdds-modal ${this.actions ? `sdds-modal__actions-${this.actions}` : ''} ${this.size ? `sdds-modal-${this.size}` : ''} ` }, h("div", { class: "sdds-modal-header" }, h("slot", { name: "sdds-modal-headline" }), h("button", { class: "sdds-modal-close", "aria-label": "close", ref: (el) => {
|
|
40
|
+
this.closeButtonEl = el;
|
|
41
|
+
} }, h("sdds-icon", { name: "cross", size: "20px" }))), h("div", { class: "sdds-modal-body" }, h("slot", { name: "sdds-modal-body" })), h("div", { class: "sdds-modal-actions" }, h("slot", { name: "sdds-modal-actions" })))));
|
|
42
|
+
}
|
|
43
|
+
get el() { return getElement(this); }
|
|
44
|
+
};
|
|
43
45
|
Modal.style = modalCss;
|
|
44
46
|
|
|
45
47
|
export { Modal as sdds_modal };
|