@scania/tegel 0.0.51 → 0.0.52
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-5ad19933.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sdds-accordion-item.cjs.entry.js +18 -18
- package/dist/cjs/sdds-accordion.cjs.entry.js +9 -9
- package/dist/cjs/sdds-badges.cjs.entry.js +43 -43
- package/dist/cjs/sdds-banner.cjs.entry.js +69 -69
- package/dist/cjs/sdds-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-block.cjs.entry.js +21 -21
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js +158 -158
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-breadcrumb-link.cjs.entry.js +14 -14
- package/dist/cjs/sdds-breadcrumb-link.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-breadcrumb.cjs.entry.js +12 -12
- package/dist/cjs/sdds-button.cjs.entry.js +23 -23
- package/dist/cjs/sdds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-card.cjs.entry.js +37 -37
- package/dist/cjs/sdds-checkbox.cjs.entry.js +45 -45
- package/dist/cjs/sdds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-datetime.cjs.entry.js +84 -84
- package/dist/cjs/sdds-divider.cjs.entry.js +9 -9
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +83 -83
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +317 -317
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-folder-tabs-button.cjs.entry.js +15 -15
- package/dist/cjs/sdds-folder-tabs-link.cjs.entry.js +18 -18
- package/dist/cjs/sdds-folder-tabs.cjs.entry.js +167 -167
- package/dist/cjs/sdds-footer-link-group.cjs.entry.js +19 -19
- package/dist/cjs/sdds-footer-link.cjs.entry.js +16 -16
- package/dist/cjs/sdds-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-footer.cjs.entry.js +15 -15
- package/dist/cjs/sdds-header-cell.cjs.entry.js +124 -124
- package/dist/cjs/sdds-icon.cjs.entry.js +31 -30
- package/dist/cjs/sdds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-inline-tabs-button.cjs.entry.js +11 -11
- package/dist/cjs/sdds-inline-tabs-button.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-inline-tabs-link.cjs.entry.js +14 -14
- package/dist/cjs/sdds-inline-tabs-link.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-inline-tabs.cjs.entry.js +175 -175
- package/dist/cjs/sdds-link.cjs.entry.js +13 -13
- package/dist/cjs/sdds-message.cjs.entry.js +27 -27
- package/dist/cjs/sdds-modal.cjs.entry.js +85 -85
- package/dist/cjs/sdds-navigation-tabs-button.cjs.entry.js +10 -10
- package/dist/cjs/sdds-navigation-tabs-link.cjs.entry.js +13 -13
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +132 -132
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +99 -99
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +73 -73
- package/dist/cjs/sdds-radio-button.cjs.entry.js +25 -25
- package/dist/cjs/sdds-radio-button.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-slider.cjs.entry.js +347 -347
- package/dist/cjs/sdds-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-spinner.cjs.entry.js +10 -10
- package/dist/cjs/sdds-stepper-item.cjs.entry.js +27 -27
- package/dist/cjs/sdds-stepper.cjs.entry.js +32 -32
- package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +71 -71
- package/dist/cjs/sdds-table-body.cjs.entry.js +233 -233
- package/dist/cjs/sdds-table-footer.cjs.entry.js +153 -153
- package/dist/cjs/sdds-table-header.cjs.entry.js +89 -89
- package/dist/cjs/sdds-table-header.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-table-toolbar.cjs.entry.js +54 -54
- package/dist/cjs/sdds-table.cjs.entry.js +57 -57
- package/dist/cjs/sdds-textarea.cjs.entry.js +55 -55
- package/dist/cjs/sdds-textfield.cjs.entry.js +59 -59
- package/dist/cjs/sdds-textfield.cjs.entry.js.map +1 -1
- package/dist/cjs/sdds-toast.cjs.entry.js +70 -70
- package/dist/cjs/sdds-toggle.cjs.entry.js +32 -32
- package/dist/cjs/sdds-tooltip.cjs.entry.js +92 -92
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +142 -142
- package/dist/collection/components/accordion/accordion.js +44 -44
- package/dist/collection/components/accordion/accordion.stories.js +80 -80
- package/dist/collection/components/badge/badge.stories.js +65 -65
- package/dist/collection/components/badge/badges.js +148 -148
- package/dist/collection/components/banner/banner.stories.js +79 -79
- package/dist/collection/components/banner/sdds-banner.css +7 -2
- package/dist/collection/components/banner/sdds-banner.js +250 -331
- package/dist/collection/components/banner/sdds-banner.js.map +1 -1
- package/dist/collection/components/banner/sdds-banner.stories.js +90 -113
- package/dist/collection/components/banner/sdds-banner.stories.js.map +1 -1
- package/dist/collection/components/block/block-native.stories.js +40 -40
- package/dist/collection/components/block/sdds-block.js +56 -56
- package/dist/collection/components/block/sdds-block.stories.js +40 -40
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +21 -21
- package/dist/collection/components/breadcrumb/sdds-breadcrumb-link/sdds-breadcrumb-link.css +2 -2
- package/dist/collection/components/breadcrumb/sdds-breadcrumb-link/sdds-breadcrumb-link.js +119 -119
- package/dist/collection/components/breadcrumb/sdds-breadcrumb-link/sdds-breadcrumb-link.js.map +1 -1
- package/dist/collection/components/breadcrumb/sdds-breadcrumb.js +23 -23
- package/dist/collection/components/breadcrumb/sdds-breadcrumb.stories.js +33 -27
- package/dist/collection/components/breadcrumb/sdds-breadcrumb.stories.js.map +1 -1
- package/dist/collection/components/button/button-component.js +152 -152
- package/dist/collection/components/button/button-native.stories.js +175 -175
- package/dist/collection/components/button/button-webcomponent.stories.js +172 -172
- package/dist/collection/components/button/button.css +28 -59
- package/dist/collection/components/card/card.stories.js +137 -137
- package/dist/collection/components/card/sdds-card.js +269 -269
- package/dist/collection/components/card/sdds-card.stories.js +129 -129
- package/dist/collection/components/checkbox/checkbox.stories.js +58 -58
- package/dist/collection/components/checkbox/sdds-checkbox.css +5 -4
- package/dist/collection/components/checkbox/sdds-checkbox.js +240 -240
- package/dist/collection/components/checkbox/sdds-checkbox.stories.js +58 -58
- package/dist/collection/components/chips/chips.stories.js +110 -110
- package/dist/collection/components/data-table/native-table.stories.js +102 -102
- package/dist/collection/components/data-table/table/table.js +257 -257
- package/dist/collection/components/data-table/table-body/table-body.js +435 -435
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +169 -169
- package/dist/collection/components/data-table/table-body-row/table-body-row.css +10 -5
- package/dist/collection/components/data-table/table-body-row/table-body-row.js +172 -172
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +163 -163
- package/dist/collection/components/data-table/table-component-basic.stories.js +133 -133
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +130 -130
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +44 -44
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +122 -122
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +122 -122
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +122 -122
- package/dist/collection/components/data-table/table-component-filtering.stories.js +137 -137
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +133 -133
- package/dist/collection/components/data-table/table-component-pagination.stories.js +133 -133
- package/dist/collection/components/data-table/table-component-sorting.stories.js +166 -166
- package/dist/collection/components/data-table/table-footer/table-footer.js +358 -358
- package/dist/collection/components/data-table/table-header/table-header.css +10 -5
- package/dist/collection/components/data-table/table-header/table-header.js +156 -156
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +314 -314
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +142 -142
- package/dist/collection/components/datetime/datetime.js +389 -389
- package/dist/collection/components/datetime/datetime.stories.js +170 -170
- package/dist/collection/components/divider/divider-webcomponent.stories.js +58 -58
- package/dist/collection/components/divider/divider.js +44 -44
- package/dist/collection/components/divider/divider.stories.js +92 -92
- package/dist/collection/components/divider/divider.stories.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +360 -360
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +144 -144
- package/dist/collection/components/dropdown/dropdown-native.stories.js +82 -82
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +191 -191
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +146 -146
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +141 -141
- package/dist/collection/components/dropdown/dropdown.css +12 -10
- package/dist/collection/components/dropdown/dropdown.js +573 -573
- package/dist/collection/components/footer/footer.stories.js +53 -53
- package/dist/collection/components/footer/webcomponent/sdds-footer-link/sdds-footer-link.js +86 -86
- package/dist/collection/components/footer/webcomponent/sdds-footer-link/sdds-footer-link.js.map +1 -1
- package/dist/collection/components/footer/webcomponent/sdds-footer-link-group/sdds-footer-link-group.js +58 -58
- package/dist/collection/components/footer/webcomponent/sdds-footer.js +56 -56
- package/dist/collection/components/footer/webcomponent/sdds-footer.stories.js +73 -73
- package/dist/collection/components/footer/webcomponent/sdds-footer.stories.js.map +1 -1
- package/dist/collection/components/header/header-all.stories.js +41 -41
- package/dist/collection/components/header/header-default.stories.js +41 -41
- package/dist/collection/components/header/header-inline.stories.js +41 -41
- package/dist/collection/components/header/header-search.stories.js +41 -41
- package/dist/collection/components/header/header-toolbar.stories.js +41 -41
- package/dist/collection/components/icon/icon-font.stories.js +50 -50
- package/dist/collection/components/icon/icon-web-component.stories.js +50 -50
- package/dist/collection/components/icon/icon.js +90 -90
- package/dist/collection/components/icon/iconsArray.js +111 -2
- package/dist/collection/components/link/link.stories.js +48 -48
- package/dist/collection/components/link/sdds-link.js +118 -118
- package/dist/collection/components/link/sdds-link.stories.js +62 -62
- package/dist/collection/components/message/message.stories.js +109 -107
- package/dist/collection/components/message/message.stories.js.map +1 -1
- package/dist/collection/components/message/sdds-message.js +133 -133
- package/dist/collection/components/message/sdds-message.stories.js +90 -90
- package/dist/collection/components/modal/modal-native.stories.js +83 -83
- package/dist/collection/components/modal/modal-webcomponent.stories.js +82 -82
- package/dist/collection/components/modal/modal.js +267 -267
- package/dist/collection/components/popover-canvas/popover-canvas.js +273 -273
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +59 -59
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +71 -71
- package/dist/collection/components/popover-menu/popover-menu.js +221 -221
- package/dist/collection/components/popover-menu/popover-menu.stories.js +71 -71
- package/dist/collection/components/radio-button/radio-button-component.stories.js +53 -49
- package/dist/collection/components/radio-button/radio-button-component.stories.js.map +1 -1
- package/dist/collection/components/radio-button/radio-button.js +165 -165
- package/dist/collection/components/radio-button/radio-button.js.map +1 -1
- package/dist/collection/components/radio-button/radio-button.stories.js +45 -45
- package/dist/collection/components/side-menu/side-menu.stories.js +51 -51
- package/dist/collection/components/slider/slider.css +25 -14
- package/dist/collection/components/slider/slider.js +722 -722
- package/dist/collection/components/slider/slider.js.map +1 -1
- package/dist/collection/components/slider/slider.stories.js +205 -205
- package/dist/collection/components/spinner/spinner.js +62 -62
- package/dist/collection/components/spinner/spinner.stories.js +61 -61
- package/dist/collection/components/stepper/sdds-stepper.js +126 -126
- package/dist/collection/components/stepper/stepper-item/sdds-stepper-item.js +112 -112
- package/dist/collection/components/stepper/stepper.stories.js +88 -88
- package/dist/collection/components/tabs/folder-tabs/folder-tabs-button/sdds-folder-tabs-button.js +99 -99
- package/dist/collection/components/tabs/folder-tabs/folder-tabs-link/sdds-folder-tabs-link.js +155 -155
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +256 -256
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.stories.js +64 -64
- package/dist/collection/components/tabs/inline-tabs/inline-tabs-button/sdds-inline-tabs-button.css +1 -1
- package/dist/collection/components/tabs/inline-tabs/inline-tabs-button/sdds-inline-tabs-button.js +63 -63
- package/dist/collection/components/tabs/inline-tabs/inline-tabs-link/sdds-inline-tabs-link.css +1 -1
- package/dist/collection/components/tabs/inline-tabs/inline-tabs-link/sdds-inline-tabs-link.js +119 -119
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +261 -261
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.stories.js +58 -58
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs-button/sdds-navigation-tabs-button.js +63 -63
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs-link/sdds-navigation-tabs-link.js +119 -119
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +217 -217
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +59 -59
- package/dist/collection/components/textarea/textarea.js +414 -414
- package/dist/collection/components/textarea/textarea.stories.js +148 -148
- package/dist/collection/components/textfield/textfield.css +12 -67
- package/dist/collection/components/textfield/textfield.js +419 -419
- package/dist/collection/components/textfield/textfield.js.map +1 -1
- package/dist/collection/components/textfield/textfield.stories.js +209 -208
- package/dist/collection/components/textfield/textfield.stories.js.map +1 -1
- package/dist/collection/components/toast/sdds-toast.js +252 -252
- package/dist/collection/components/toast/sdds-toast.stories.js +70 -70
- package/dist/collection/components/toast/toast.stories.js +103 -103
- package/dist/collection/components/toggle/sdds-toggle.js +210 -210
- package/dist/collection/components/toggle/sdds-toggle.stories.js +78 -78
- package/dist/collection/components/toggle/toggle.stories.js +71 -71
- package/dist/collection/components/tooltip/tooltip.js +230 -230
- package/dist/collection/components/tooltip/tooltip.stories.js +103 -103
- package/dist/collection/components/utility/colour/background-color.stories.js +84 -84
- package/dist/collection/components/utility/colour/text-color.stories.js +84 -84
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +15 -15
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +54 -54
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +15 -15
- package/dist/collection/foundations-stories/grid/grid.stories.js +53 -53
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +11 -11
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +11 -11
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +10 -10
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +10 -10
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +23 -23
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +10 -10
- package/dist/collection/index.js +2 -2
- package/dist/collection/utils/utils.js +13 -13
- package/dist/components/dropdown-option.js +92 -92
- package/dist/components/dropdown-option.js.map +1 -1
- package/dist/components/dropdown.js +290 -290
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/icon.js +51 -50
- package/dist/components/icon.js.map +1 -1
- package/dist/components/sdds-accordion-item.js +44 -44
- package/dist/components/sdds-accordion.js +26 -26
- package/dist/components/sdds-badges.js +65 -65
- package/dist/components/sdds-banner.js +101 -110
- package/dist/components/sdds-banner.js.map +1 -1
- package/dist/components/sdds-block.js +38 -38
- package/dist/components/sdds-breadcrumb-link.js +35 -35
- package/dist/components/sdds-breadcrumb-link.js.map +1 -1
- package/dist/components/sdds-breadcrumb.js +27 -27
- package/dist/components/sdds-button.js +46 -46
- package/dist/components/sdds-button.js.map +1 -1
- package/dist/components/sdds-card.js +66 -66
- package/dist/components/sdds-checkbox.js +67 -67
- package/dist/components/sdds-checkbox.js.map +1 -1
- package/dist/components/sdds-datetime.js +118 -118
- package/dist/components/sdds-divider.js +26 -26
- package/dist/components/sdds-dropdown-filter.js +129 -129
- package/dist/components/sdds-dropdown-filter.js.map +1 -1
- package/dist/components/sdds-folder-tabs-button.js +35 -35
- package/dist/components/sdds-folder-tabs-link.js +41 -41
- package/dist/components/sdds-folder-tabs.js +195 -195
- package/dist/components/sdds-footer-link-group.js +41 -41
- package/dist/components/sdds-footer-link.js +34 -34
- package/dist/components/sdds-footer-link.js.map +1 -1
- package/dist/components/sdds-footer.js +33 -33
- package/dist/components/sdds-header-cell.js +156 -156
- package/dist/components/sdds-inline-tabs-button.js +29 -29
- package/dist/components/sdds-inline-tabs-button.js.map +1 -1
- package/dist/components/sdds-inline-tabs-link.js +35 -35
- package/dist/components/sdds-inline-tabs-link.js.map +1 -1
- package/dist/components/sdds-inline-tabs.js +202 -202
- package/dist/components/sdds-link.js +42 -1
- package/dist/components/sdds-link.js.map +1 -1
- package/dist/components/sdds-message.js +53 -53
- package/dist/components/sdds-modal.js +115 -115
- package/dist/components/sdds-navigation-tabs-button.js +28 -28
- package/dist/components/sdds-navigation-tabs-link.js +34 -34
- package/dist/components/sdds-navigation-tabs.js +158 -158
- package/dist/components/sdds-popover-canvas.js +126 -126
- package/dist/components/sdds-popover-menu.js +98 -98
- package/dist/components/sdds-radio-button.js +46 -46
- package/dist/components/sdds-radio-button.js.map +1 -1
- package/dist/components/sdds-slider.js +384 -384
- package/dist/components/sdds-slider.js.map +1 -1
- package/dist/components/sdds-spinner.js +27 -27
- package/dist/components/sdds-stepper-item.js +56 -56
- package/dist/components/sdds-stepper.js +53 -53
- package/dist/components/sdds-table-body-row-expandable.js +95 -95
- package/dist/components/sdds-table-body.js +280 -280
- package/dist/components/sdds-table-footer.js +185 -185
- package/dist/components/sdds-table-header.js +115 -115
- package/dist/components/sdds-table-header.js.map +1 -1
- package/dist/components/sdds-table-toolbar.js +77 -77
- package/dist/components/sdds-table.js +81 -81
- package/dist/components/sdds-textarea.js +91 -91
- package/dist/components/sdds-textfield.js +95 -95
- package/dist/components/sdds-textfield.js.map +1 -1
- package/dist/components/sdds-toast.js +101 -101
- package/dist/components/sdds-toggle.js +55 -55
- package/dist/components/sdds-tooltip.js +116 -116
- package/dist/components/table-body-cell.js +94 -94
- package/dist/components/table-body-row.js +114 -114
- package/dist/components/table-body-row.js.map +1 -1
- package/dist/esm/index-fdfb114c.js +4 -4
- package/dist/esm/loader.js +1 -1
- 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 +18 -18
- package/dist/esm/sdds-accordion.entry.js +9 -9
- package/dist/esm/sdds-badges.entry.js +43 -43
- package/dist/esm/sdds-banner.entry.js +69 -69
- package/dist/esm/sdds-banner.entry.js.map +1 -1
- package/dist/esm/sdds-block.entry.js +21 -21
- package/dist/esm/sdds-body-cell_2.entry.js +158 -158
- package/dist/esm/sdds-body-cell_2.entry.js.map +1 -1
- package/dist/esm/sdds-breadcrumb-link.entry.js +14 -14
- package/dist/esm/sdds-breadcrumb-link.entry.js.map +1 -1
- package/dist/esm/sdds-breadcrumb.entry.js +12 -12
- package/dist/esm/sdds-button.entry.js +23 -23
- package/dist/esm/sdds-button.entry.js.map +1 -1
- package/dist/esm/sdds-card.entry.js +37 -37
- package/dist/esm/sdds-checkbox.entry.js +45 -45
- package/dist/esm/sdds-checkbox.entry.js.map +1 -1
- package/dist/esm/sdds-datetime.entry.js +84 -84
- package/dist/esm/sdds-divider.entry.js +9 -9
- package/dist/esm/sdds-dropdown-filter.entry.js +83 -83
- package/dist/esm/sdds-dropdown-filter.entry.js.map +1 -1
- package/dist/esm/sdds-dropdown_2.entry.js +317 -317
- package/dist/esm/sdds-dropdown_2.entry.js.map +1 -1
- package/dist/esm/sdds-folder-tabs-button.entry.js +15 -15
- package/dist/esm/sdds-folder-tabs-link.entry.js +18 -18
- package/dist/esm/sdds-folder-tabs.entry.js +167 -167
- package/dist/esm/sdds-footer-link-group.entry.js +19 -19
- package/dist/esm/sdds-footer-link.entry.js +16 -16
- package/dist/esm/sdds-footer-link.entry.js.map +1 -1
- package/dist/esm/sdds-footer.entry.js +15 -15
- package/dist/esm/sdds-header-cell.entry.js +124 -124
- package/dist/esm/sdds-icon.entry.js +31 -30
- package/dist/esm/sdds-icon.entry.js.map +1 -1
- package/dist/esm/sdds-inline-tabs-button.entry.js +11 -11
- package/dist/esm/sdds-inline-tabs-button.entry.js.map +1 -1
- package/dist/esm/sdds-inline-tabs-link.entry.js +14 -14
- package/dist/esm/sdds-inline-tabs-link.entry.js.map +1 -1
- package/dist/esm/sdds-inline-tabs.entry.js +175 -175
- package/dist/esm/sdds-link.entry.js +13 -13
- package/dist/esm/sdds-message.entry.js +27 -27
- package/dist/esm/sdds-modal.entry.js +85 -85
- package/dist/esm/sdds-navigation-tabs-button.entry.js +10 -10
- package/dist/esm/sdds-navigation-tabs-link.entry.js +13 -13
- package/dist/esm/sdds-navigation-tabs.entry.js +132 -132
- package/dist/esm/sdds-popover-canvas.entry.js +99 -99
- package/dist/esm/sdds-popover-menu.entry.js +73 -73
- package/dist/esm/sdds-radio-button.entry.js +25 -25
- package/dist/esm/sdds-radio-button.entry.js.map +1 -1
- package/dist/esm/sdds-slider.entry.js +347 -347
- package/dist/esm/sdds-slider.entry.js.map +1 -1
- package/dist/esm/sdds-spinner.entry.js +10 -10
- package/dist/esm/sdds-stepper-item.entry.js +27 -27
- package/dist/esm/sdds-stepper.entry.js +32 -32
- package/dist/esm/sdds-table-body-row-expandable.entry.js +71 -71
- package/dist/esm/sdds-table-body.entry.js +233 -233
- package/dist/esm/sdds-table-footer.entry.js +153 -153
- package/dist/esm/sdds-table-header.entry.js +89 -89
- package/dist/esm/sdds-table-header.entry.js.map +1 -1
- package/dist/esm/sdds-table-toolbar.entry.js +54 -54
- package/dist/esm/sdds-table.entry.js +57 -57
- package/dist/esm/sdds-textarea.entry.js +55 -55
- package/dist/esm/sdds-textfield.entry.js +59 -59
- package/dist/esm/sdds-textfield.entry.js.map +1 -1
- package/dist/esm/sdds-toast.entry.js +70 -70
- package/dist/esm/sdds-toggle.entry.js +32 -32
- package/dist/esm/sdds-tooltip.entry.js +92 -92
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-1df2e987.entry.js +2 -0
- package/dist/tegel/p-1df2e987.entry.js.map +1 -0
- package/dist/tegel/p-1e196fff.entry.js +2 -0
- package/dist/tegel/p-1e196fff.entry.js.map +1 -0
- package/dist/tegel/p-23998948.entry.js +2 -0
- package/dist/tegel/{p-cfacd8e6.entry.js.map → p-23998948.entry.js.map} +1 -1
- package/dist/tegel/p-29bcd369.entry.js +2 -0
- package/dist/tegel/p-29bcd369.entry.js.map +1 -0
- package/dist/tegel/p-3a93619e.entry.js +2 -0
- package/dist/tegel/p-3a93619e.entry.js.map +1 -0
- package/dist/tegel/p-5812ec42.entry.js +2 -0
- package/dist/tegel/p-5812ec42.entry.js.map +1 -0
- package/dist/tegel/{p-792e8c5d.entry.js → p-5ca26ce8.entry.js} +2 -2
- package/dist/tegel/p-5ca26ce8.entry.js.map +1 -0
- package/dist/tegel/p-5cc6d070.entry.js +2 -0
- package/dist/tegel/{p-90af19c6.entry.js.map → p-5cc6d070.entry.js.map} +1 -1
- package/dist/tegel/p-626434af.entry.js +2 -0
- package/dist/tegel/{p-1baafb40.entry.js.map → p-626434af.entry.js.map} +1 -1
- package/dist/tegel/p-68e4c190.entry.js +2 -0
- package/dist/tegel/{p-872bef70.entry.js.map → p-68e4c190.entry.js.map} +1 -1
- package/dist/tegel/{p-d87ce5e9.entry.js → p-88ba44a7.entry.js} +2 -2
- package/dist/tegel/p-88ba44a7.entry.js.map +1 -0
- package/dist/tegel/p-8b807df5.entry.js +2 -0
- package/dist/tegel/p-8b807df5.entry.js.map +1 -0
- package/dist/tegel/{p-8ee9e2f5.entry.js → p-ad3439b8.entry.js} +2 -2
- package/dist/tegel/{p-8ee9e2f5.entry.js.map → p-ad3439b8.entry.js.map} +1 -1
- package/dist/tegel/p-b8d838d1.entry.js +2 -0
- package/dist/tegel/p-b8d838d1.entry.js.map +1 -0
- package/dist/tegel/p-f23cb0ae.entry.js +2 -0
- package/dist/tegel/p-f23cb0ae.entry.js.map +1 -0
- package/dist/tegel/tegel.css +4 -4
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/tegel/tegel.esm.js.map +1 -1
- package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +17 -17
- package/dist/types/components/accordion/accordion.d.ts +5 -5
- package/dist/types/components/accordion/accordion.stories.d.ts +77 -77
- package/dist/types/components/badge/badge.stories.d.ts +61 -61
- package/dist/types/components/badge/badges.d.ts +16 -16
- package/dist/types/components/banner/banner.stories.d.ts +68 -68
- package/dist/types/components/banner/sdds-banner.d.ts +40 -48
- package/dist/types/components/banner/sdds-banner.stories.d.ts +82 -104
- package/dist/types/components/block/block-native.stories.d.ts +31 -31
- package/dist/types/components/block/sdds-block.d.ts +9 -9
- package/dist/types/components/block/sdds-block.stories.d.ts +32 -32
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +12 -12
- package/dist/types/components/breadcrumb/sdds-breadcrumb-link/sdds-breadcrumb-link.d.ts +13 -13
- package/dist/types/components/breadcrumb/sdds-breadcrumb.d.ts +5 -5
- package/dist/types/components/breadcrumb/sdds-breadcrumb.stories.d.ts +16 -16
- package/dist/types/components/button/button-component.d.ts +18 -18
- package/dist/types/components/button/button-native.stories.d.ts +159 -159
- package/dist/types/components/button/button-webcomponent.stories.d.ts +151 -151
- package/dist/types/components/card/card.stories.d.ts +137 -137
- package/dist/types/components/card/sdds-card.d.ts +39 -39
- package/dist/types/components/card/sdds-card.stories.d.ts +128 -128
- package/dist/types/components/checkbox/checkbox.stories.d.ts +51 -51
- package/dist/types/components/checkbox/sdds-checkbox.d.ts +38 -38
- package/dist/types/components/checkbox/sdds-checkbox.stories.d.ts +52 -52
- package/dist/types/components/chips/chips.stories.d.ts +101 -101
- package/dist/types/components/data-table/native-table.stories.d.ts +119 -119
- package/dist/types/components/data-table/table/table.d.ts +48 -48
- 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 +144 -144
- package/dist/types/components/data-table/table-component-batch-actions.stories.d.ts +139 -139
- package/dist/types/components/data-table/table-component-bodydata.stories.d.ts +33 -33
- package/dist/types/components/data-table/table-component-custom-width.stories.d.ts +131 -131
- package/dist/types/components/data-table/table-component-event-listeners.stories.d.ts +131 -131
- package/dist/types/components/data-table/table-component-expandable-rows.stories.d.ts +131 -131
- package/dist/types/components/data-table/table-component-filtering.stories.d.ts +139 -139
- package/dist/types/components/data-table/table-component-multiselect.stories.d.ts +144 -144
- package/dist/types/components/data-table/table-component-pagination.stories.d.ts +144 -144
- package/dist/types/components/data-table/table-component-sorting.stories.d.ts +183 -183
- 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 +43 -43
- package/dist/types/components/data-table/table-toolbar/table-toolbar.d.ts +22 -22
- package/dist/types/components/datetime/datetime.d.ts +48 -48
- package/dist/types/components/datetime/datetime.stories.d.ts +128 -128
- package/dist/types/components/divider/divider-webcomponent.stories.d.ts +58 -58
- package/dist/types/components/divider/divider.d.ts +5 -5
- package/dist/types/components/divider/divider.stories.d.ts +60 -60
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.d.ts +44 -44
- package/dist/types/components/dropdown/dropdown-filter/dropdown-filter.stories.d.ts +137 -137
- package/dist/types/components/dropdown/dropdown-native.stories.d.ts +72 -72
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +24 -24
- package/dist/types/components/dropdown/dropdown-wc-default.stories.d.ts +144 -144
- package/dist/types/components/dropdown/dropdown-wc-multiselect.stories.d.ts +144 -144
- package/dist/types/components/dropdown/dropdown.d.ts +59 -59
- package/dist/types/components/footer/footer.stories.d.ts +45 -45
- package/dist/types/components/footer/webcomponent/sdds-footer-link/sdds-footer-link.d.ts +13 -13
- package/dist/types/components/footer/webcomponent/sdds-footer-link-group/sdds-footer-link-group.d.ts +11 -11
- package/dist/types/components/footer/webcomponent/sdds-footer.d.ts +9 -9
- package/dist/types/components/footer/webcomponent/sdds-footer.stories.d.ts +44 -44
- package/dist/types/components/header/header-all.stories.d.ts +31 -31
- package/dist/types/components/header/header-default.stories.d.ts +31 -31
- package/dist/types/components/header/header-inline.stories.d.ts +31 -31
- package/dist/types/components/header/header-search.stories.d.ts +31 -31
- package/dist/types/components/header/header-toolbar.stories.d.ts +31 -31
- package/dist/types/components/icon/icon-font.stories.d.ts +38 -38
- package/dist/types/components/icon/icon-web-component.stories.d.ts +38 -38
- package/dist/types/components/icon/icon.d.ts +12 -12
- package/dist/types/components/link/link.stories.d.ts +43 -43
- package/dist/types/components/link/sdds-link.d.ts +13 -13
- package/dist/types/components/link/sdds-link.stories.d.ts +58 -58
- package/dist/types/components/message/message.stories.d.ts +89 -89
- package/dist/types/components/message/sdds-message.d.ts +14 -14
- package/dist/types/components/message/sdds-message.stories.d.ts +88 -88
- package/dist/types/components/modal/modal-native.stories.d.ts +74 -74
- package/dist/types/components/modal/modal-webcomponent.stories.d.ts +70 -70
- package/dist/types/components/modal/modal.d.ts +37 -37
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +33 -33
- package/dist/types/components/popover-canvas/popover-canvas.stories.d.ts +27 -27
- package/dist/types/components/popover-menu/popover-menu-icons.stories.d.ts +32 -32
- package/dist/types/components/popover-menu/popover-menu.d.ts +24 -24
- package/dist/types/components/popover-menu/popover-menu.stories.d.ts +32 -32
- package/dist/types/components/radio-button/radio-button-component.stories.d.ts +39 -39
- package/dist/types/components/radio-button/radio-button.d.ts +26 -26
- package/dist/types/components/radio-button/radio-button.stories.d.ts +38 -38
- package/dist/types/components/side-menu/side-menu.stories.d.ts +42 -42
- package/dist/types/components/slider/slider.d.ts +86 -86
- package/dist/types/components/slider/slider.stories.d.ts +235 -235
- package/dist/types/components/spinner/spinner.d.ts +7 -7
- package/dist/types/components/spinner/spinner.stories.d.ts +47 -47
- package/dist/types/components/stepper/sdds-stepper.d.ts +17 -17
- package/dist/types/components/stepper/stepper-item/sdds-stepper-item.d.ts +17 -17
- package/dist/types/components/stepper/stepper.stories.d.ts +72 -72
- package/dist/types/components/tabs/folder-tabs/folder-tabs-button/sdds-folder-tabs-button.d.ts +10 -10
- package/dist/types/components/tabs/folder-tabs/folder-tabs-link/sdds-folder-tabs-link.d.ts +16 -16
- package/dist/types/components/tabs/folder-tabs/folder-tabs.d.ts +38 -38
- package/dist/types/components/tabs/folder-tabs/folder-tabs.stories.d.ts +52 -52
- package/dist/types/components/tabs/inline-tabs/inline-tabs-button/sdds-inline-tabs-button.d.ts +7 -7
- package/dist/types/components/tabs/inline-tabs/inline-tabs-link/sdds-inline-tabs-link.d.ts +13 -13
- package/dist/types/components/tabs/inline-tabs/inline-tabs.d.ts +40 -40
- package/dist/types/components/tabs/inline-tabs/inline-tabs.stories.d.ts +44 -44
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs-button/sdds-navigation-tabs-button.d.ts +7 -7
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs-link/sdds-navigation-tabs-link.d.ts +13 -13
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +35 -35
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.stories.d.ts +44 -44
- package/dist/types/components/textarea/textarea.d.ts +50 -50
- package/dist/types/components/textarea/textarea.stories.d.ts +139 -139
- package/dist/types/components/textfield/textfield.d.ts +52 -52
- package/dist/types/components/textfield/textfield.stories.d.ts +201 -201
- package/dist/types/components/toast/sdds-toast.d.ts +36 -36
- package/dist/types/components/toast/sdds-toast.stories.d.ts +56 -56
- package/dist/types/components/toast/toast.stories.d.ts +68 -68
- package/dist/types/components/toggle/sdds-toggle.d.ts +31 -31
- package/dist/types/components/toggle/sdds-toggle.stories.d.ts +74 -74
- package/dist/types/components/toggle/toggle.stories.d.ts +58 -58
- package/dist/types/components/tooltip/tooltip.d.ts +24 -24
- package/dist/types/components/tooltip/tooltip.stories.d.ts +66 -66
- package/dist/types/components/utility/colour/background-color.stories.d.ts +58 -58
- package/dist/types/components/utility/colour/text-color.stories.d.ts +58 -58
- package/dist/types/components.d.ts +2 -42
- package/dist/types/foundations-stories/colour/colour-brand.stories.d.ts +13 -13
- package/dist/types/foundations-stories/colour/colour-scales.stories.d.ts +13 -13
- package/dist/types/foundations-stories/colour/colour-semantic.stories.d.ts +13 -13
- package/dist/types/foundations-stories/grid/grid.stories.d.ts +35 -35
- package/dist/types/foundations-stories/spacing/spacing-element.stories.d.ts +8 -8
- package/dist/types/foundations-stories/spacing/spacing-layout.stories.d.ts +8 -8
- package/dist/types/foundations-stories/typography/typography-body.stories.d.ts +8 -8
- package/dist/types/foundations-stories/typography/typography-detail.stories.d.ts +8 -8
- package/dist/types/foundations-stories/typography/typography-headline.stories.d.ts +21 -21
- package/dist/types/foundations-stories/typography/typography-paragraph.stories.d.ts +8 -8
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/sdds-link2.js +0 -46
- package/dist/components/sdds-link2.js.map +0 -1
- package/dist/tegel/p-1adb9259.entry.js +0 -2
- package/dist/tegel/p-1adb9259.entry.js.map +0 -1
- package/dist/tegel/p-1baafb40.entry.js +0 -2
- package/dist/tegel/p-2837b06c.entry.js +0 -2
- package/dist/tegel/p-2837b06c.entry.js.map +0 -1
- package/dist/tegel/p-58bc7a27.entry.js +0 -2
- package/dist/tegel/p-58bc7a27.entry.js.map +0 -1
- package/dist/tegel/p-70ccf3f7.entry.js +0 -2
- package/dist/tegel/p-70ccf3f7.entry.js.map +0 -1
- package/dist/tegel/p-792e8c5d.entry.js.map +0 -1
- package/dist/tegel/p-81c597fd.entry.js +0 -2
- package/dist/tegel/p-81c597fd.entry.js.map +0 -1
- package/dist/tegel/p-872bef70.entry.js +0 -2
- package/dist/tegel/p-90af19c6.entry.js +0 -2
- package/dist/tegel/p-b2269b6b.entry.js +0 -2
- package/dist/tegel/p-b2269b6b.entry.js.map +0 -1
- package/dist/tegel/p-b6fc0de7.entry.js +0 -2
- package/dist/tegel/p-b6fc0de7.entry.js.map +0 -1
- package/dist/tegel/p-bd09c184.entry.js +0 -2
- package/dist/tegel/p-bd09c184.entry.js.map +0 -1
- package/dist/tegel/p-cfacd8e6.entry.js +0 -2
- package/dist/tegel/p-d87ce5e9.entry.js.map +0 -1
|
@@ -1,722 +1,722 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
export class Slider {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.wrapperElement = null;
|
|
5
|
-
this.scrubberElement = null;
|
|
6
|
-
this.scrubberInnerElement = null;
|
|
7
|
-
this.dividersElement = null;
|
|
8
|
-
this.trackElement = null;
|
|
9
|
-
this.trackFillElement = null;
|
|
10
|
-
this.minusElement = null;
|
|
11
|
-
this.plusElement = null;
|
|
12
|
-
this.inputElement = null;
|
|
13
|
-
this.nativeRangeInputElement = null;
|
|
14
|
-
this.scrubberGrabPos = { x: 0, y: 0 };
|
|
15
|
-
this.scrubberGrabbed = false;
|
|
16
|
-
this.scrubberLeft = 0;
|
|
17
|
-
this.tickValues = [];
|
|
18
|
-
this.disabledState = false;
|
|
19
|
-
this.readonlyState = false;
|
|
20
|
-
this.useControls = false;
|
|
21
|
-
this.useInput = false;
|
|
22
|
-
this.useSmall = false;
|
|
23
|
-
this.useSnapping = false;
|
|
24
|
-
this.supposedValueSlot = -1;
|
|
25
|
-
this.eventListenersAdded = false;
|
|
26
|
-
this.resizeObserverAdded = false;
|
|
27
|
-
this.label = '';
|
|
28
|
-
this.value = '0';
|
|
29
|
-
this.min = '0';
|
|
30
|
-
this.max = '100';
|
|
31
|
-
this.ticks = '0';
|
|
32
|
-
this.showTickNumbers = false;
|
|
33
|
-
this.tooltip = false;
|
|
34
|
-
this.disabled = false;
|
|
35
|
-
this.readOnly = false;
|
|
36
|
-
this.controls = false;
|
|
37
|
-
this.input = false;
|
|
38
|
-
this.step = '1';
|
|
39
|
-
this.name = '';
|
|
40
|
-
this.scrubberSize = 'lg';
|
|
41
|
-
this.snap = false;
|
|
42
|
-
this.sliderId = crypto.randomUUID();
|
|
43
|
-
}
|
|
44
|
-
/** Public method to re-initialise the slider if some configuration props are changed */
|
|
45
|
-
async reset() {
|
|
46
|
-
// @TODO: maybe refactor to use watch-decorators instead
|
|
47
|
-
this.componentWillLoad();
|
|
48
|
-
this.componentDidLoad();
|
|
49
|
-
}
|
|
50
|
-
handleKeydown(event) {
|
|
51
|
-
switch (event.key) {
|
|
52
|
-
case 'ArrowLeft':
|
|
53
|
-
this.stepLeft();
|
|
54
|
-
break;
|
|
55
|
-
case 'ArrowRight':
|
|
56
|
-
this.stepRight();
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
handleMouseUp() {
|
|
63
|
-
if (!this.scrubberGrabbed) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
this.scrubberGrabbed = false;
|
|
67
|
-
this.scrubberInnerElement.classList.remove('pressed');
|
|
68
|
-
this.updateValue();
|
|
69
|
-
this.trackElement.focus();
|
|
70
|
-
}
|
|
71
|
-
handleTouchEnd() {
|
|
72
|
-
if (!this.scrubberGrabbed) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.scrubberGrabbed = false;
|
|
76
|
-
this.scrubberInnerElement.classList.remove('pressed');
|
|
77
|
-
this.updateValue();
|
|
78
|
-
this.trackElement.focus();
|
|
79
|
-
}
|
|
80
|
-
handleMouseMove(event) {
|
|
81
|
-
if (!this.scrubberGrabbed) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const numTicks = parseInt(this.ticks);
|
|
85
|
-
const trackRect = this.trackElement.getBoundingClientRect();
|
|
86
|
-
let localLeft = event.clientX - trackRect.left;
|
|
87
|
-
this.supposedValueSlot = -1;
|
|
88
|
-
if (this.useSnapping && numTicks > 0) {
|
|
89
|
-
const v = Math.round(this.getTrackWidth() / (numTicks + 1));
|
|
90
|
-
localLeft = Math.round(localLeft / v) * v;
|
|
91
|
-
this.supposedValueSlot = Math.round(localLeft / v);
|
|
92
|
-
}
|
|
93
|
-
this.scrubberLeft = this.constrainScrubber(localLeft);
|
|
94
|
-
this.scrubberElement.style.left = `${this.scrubberLeft}px`;
|
|
95
|
-
this.updateValue();
|
|
96
|
-
this.updateTrack();
|
|
97
|
-
}
|
|
98
|
-
handleTouchMove(event) {
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
if (!this.scrubberGrabbed) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const numTicks = parseInt(this.ticks);
|
|
104
|
-
const trackRect = this.trackElement.getBoundingClientRect();
|
|
105
|
-
let localLeft = event.touches[0].clientX - trackRect.left;
|
|
106
|
-
this.supposedValueSlot = -1;
|
|
107
|
-
if (this.useSnapping && numTicks > 0) {
|
|
108
|
-
const v = Math.round(this.getTrackWidth() / (numTicks + 1));
|
|
109
|
-
localLeft = Math.round(localLeft / v) * v;
|
|
110
|
-
this.supposedValueSlot = Math.round(localLeft / v);
|
|
111
|
-
}
|
|
112
|
-
this.scrubberLeft = this.constrainScrubber(localLeft);
|
|
113
|
-
this.scrubberElement.style.left = `${this.scrubberLeft}px`;
|
|
114
|
-
this.updateValue();
|
|
115
|
-
this.updateTrack();
|
|
116
|
-
}
|
|
117
|
-
updateTrack() {
|
|
118
|
-
const trackWidth = this.getTrackWidth();
|
|
119
|
-
const percentageFilled = (this.scrubberLeft / trackWidth) * 100;
|
|
120
|
-
this.trackFillElement.style.width = `${percentageFilled}%`;
|
|
121
|
-
}
|
|
122
|
-
dispatchChangeEvent() {
|
|
123
|
-
this.sddsChange.emit({ value: this.value });
|
|
124
|
-
}
|
|
125
|
-
updateValue() {
|
|
126
|
-
const trackWidth = this.getTrackWidth();
|
|
127
|
-
/* if snapping (supposedValueSlot > 0) is enabled, make sure we display the supposed value (instead of maybe getting a -1/+1 depending on rounding) */
|
|
128
|
-
if (this.supposedValueSlot > 0) {
|
|
129
|
-
const supposedValue = this.tickValues[this.supposedValueSlot];
|
|
130
|
-
this.value = `${supposedValue}`;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
const percentage = this.scrubberLeft / trackWidth;
|
|
134
|
-
this.value = `${Math.trunc(this.getMin() + percentage * (this.getMax() - this.getMin()))}`;
|
|
135
|
-
}
|
|
136
|
-
this.dispatchChangeEvent();
|
|
137
|
-
}
|
|
138
|
-
updateValueForced(value) {
|
|
139
|
-
this.value = value;
|
|
140
|
-
this.dispatchChangeEvent();
|
|
141
|
-
}
|
|
142
|
-
getMin() {
|
|
143
|
-
return parseFloat(this.min);
|
|
144
|
-
}
|
|
145
|
-
getMax() {
|
|
146
|
-
return parseFloat(this.max);
|
|
147
|
-
}
|
|
148
|
-
constrainScrubber(x) {
|
|
149
|
-
const width = this.getTrackWidth();
|
|
150
|
-
if (x < 0) {
|
|
151
|
-
return 0;
|
|
152
|
-
}
|
|
153
|
-
if (x > width) {
|
|
154
|
-
return width;
|
|
155
|
-
}
|
|
156
|
-
return x;
|
|
157
|
-
}
|
|
158
|
-
getTrackWidth() {
|
|
159
|
-
const trackRect = this.trackElement.getBoundingClientRect();
|
|
160
|
-
return trackRect.right - trackRect.left;
|
|
161
|
-
}
|
|
162
|
-
calculateScrubberLeftFromValue(value) {
|
|
163
|
-
const initValue = value;
|
|
164
|
-
const trackWidth = this.getTrackWidth();
|
|
165
|
-
const normalizedValue = initValue - this.getMin();
|
|
166
|
-
const normalizedMax = this.getMax() - this.getMin();
|
|
167
|
-
const calculatedLeft = (normalizedValue / normalizedMax) * trackWidth;
|
|
168
|
-
this.scrubberLeft = calculatedLeft;
|
|
169
|
-
this.scrubberElement.style.left = `${this.scrubberLeft}px`;
|
|
170
|
-
}
|
|
171
|
-
componentDidLoad() {
|
|
172
|
-
if (!this.resizeObserverAdded) {
|
|
173
|
-
this.resizeObserverAdded = true;
|
|
174
|
-
const resizeObserver = new ResizeObserver(( /* entries */) => {
|
|
175
|
-
this.calculateScrubberLeftFromValue(this.value);
|
|
176
|
-
this.updateTrack();
|
|
177
|
-
});
|
|
178
|
-
resizeObserver.observe(this.wrapperElement);
|
|
179
|
-
}
|
|
180
|
-
if (!this.eventListenersAdded) {
|
|
181
|
-
this.eventListenersAdded = true;
|
|
182
|
-
this.scrubberElement.addEventListener('mousedown', (event) => {
|
|
183
|
-
event.preventDefault();
|
|
184
|
-
this.grabScrubber(event.offsetX, event.offsetY);
|
|
185
|
-
});
|
|
186
|
-
this.scrubberElement.addEventListener('touchstart', (event) => {
|
|
187
|
-
const rect = this.scrubberElement.getBoundingClientRect();
|
|
188
|
-
const x = event.targetTouches[0].pageX - rect.left;
|
|
189
|
-
const y = event.targetTouches[0].pageY - rect.top;
|
|
190
|
-
this.grabScrubber(x, y);
|
|
191
|
-
});
|
|
192
|
-
if (this.useControls) {
|
|
193
|
-
this.minusElement.addEventListener('click', () => {
|
|
194
|
-
this.stepLeft();
|
|
195
|
-
});
|
|
196
|
-
this.plusElement.addEventListener('click', () => {
|
|
197
|
-
this.stepRight();
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
if (this.inputElement) {
|
|
201
|
-
this.inputElement.addEventListener('keydown', (event) => {
|
|
202
|
-
event.stopPropagation();
|
|
203
|
-
if (event.key === 'Enter') {
|
|
204
|
-
let newValue = parseInt(this.inputElement.value);
|
|
205
|
-
if (newValue < this.getMin()) {
|
|
206
|
-
newValue = this.getMin();
|
|
207
|
-
}
|
|
208
|
-
else if (newValue > this.getMax()) {
|
|
209
|
-
newValue = this.getMax();
|
|
210
|
-
}
|
|
211
|
-
this.calculateScrubberLeftFromValue(newValue);
|
|
212
|
-
this.updateValueForced(newValue);
|
|
213
|
-
this.updateTrack();
|
|
214
|
-
this.inputElement.blur();
|
|
215
|
-
this.wrapperElement.focus();
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
this.calculateScrubberLeftFromValue(this.value);
|
|
221
|
-
this.updateTrack();
|
|
222
|
-
}
|
|
223
|
-
grabScrubber(xOffset, yOffset) {
|
|
224
|
-
if (this.readonlyState) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
this.scrubberGrabPos = {
|
|
228
|
-
x: xOffset,
|
|
229
|
-
y: yOffset,
|
|
230
|
-
};
|
|
231
|
-
this.scrubberGrabbed = true;
|
|
232
|
-
this.scrubberInnerElement.classList.add('pressed');
|
|
233
|
-
}
|
|
234
|
-
calculateInputSizeFromMax() {
|
|
235
|
-
return this.max.length;
|
|
236
|
-
}
|
|
237
|
-
controlsStep(delta) {
|
|
238
|
-
if (this.readonlyState || this.disabled) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
const trackWidth = this.getTrackWidth();
|
|
242
|
-
const percentage = this.scrubberLeft / trackWidth;
|
|
243
|
-
const numTicks = parseInt(this.ticks);
|
|
244
|
-
let currentValue = this.getMin() + percentage * (this.getMax() - this.getMin());
|
|
245
|
-
currentValue += delta;
|
|
246
|
-
if (currentValue < this.getMin()) {
|
|
247
|
-
currentValue = this.getMin();
|
|
248
|
-
}
|
|
249
|
-
else if (currentValue > this.getMax()) {
|
|
250
|
-
currentValue = this.getMax();
|
|
251
|
-
}
|
|
252
|
-
this.value = `${currentValue}`;
|
|
253
|
-
/* if snapping is enabled, instead just increment or decrement the current "fixed" value from our ticknumber array */
|
|
254
|
-
if (this.useSnapping && numTicks > 0) {
|
|
255
|
-
const stepDir = delta > 0 ? 1 : -1;
|
|
256
|
-
this.supposedValueSlot += stepDir;
|
|
257
|
-
if (this.supposedValueSlot < 0) {
|
|
258
|
-
this.supposedValueSlot = 0;
|
|
259
|
-
}
|
|
260
|
-
else if (this.supposedValueSlot > numTicks + 1) {
|
|
261
|
-
this.supposedValueSlot = numTicks + 1;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
this.calculateScrubberLeftFromValue(currentValue);
|
|
265
|
-
this.updateTrack();
|
|
266
|
-
this.updateValue();
|
|
267
|
-
}
|
|
268
|
-
stepLeft() {
|
|
269
|
-
this.controlsStep(-parseInt(this.step));
|
|
270
|
-
}
|
|
271
|
-
stepRight() {
|
|
272
|
-
this.controlsStep(parseInt(this.step));
|
|
273
|
-
}
|
|
274
|
-
componentWillLoad() {
|
|
275
|
-
const numTicks = parseInt(this.ticks);
|
|
276
|
-
if (numTicks > 0) {
|
|
277
|
-
this.tickValues = [this.getMin()];
|
|
278
|
-
const step = (this.getMax() - this.getMin()) / (numTicks + 1);
|
|
279
|
-
for (let i = 1; i < numTicks + 1; i++) {
|
|
280
|
-
this.tickValues.push(this.getMin() + Math.round(step * i));
|
|
281
|
-
}
|
|
282
|
-
this.tickValues.push(this.getMax());
|
|
283
|
-
}
|
|
284
|
-
if (this.disabled) {
|
|
285
|
-
this.disabledState = true;
|
|
286
|
-
}
|
|
287
|
-
else {
|
|
288
|
-
this.disabledState = false;
|
|
289
|
-
}
|
|
290
|
-
if (this.readOnly) {
|
|
291
|
-
this.readonlyState = true;
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
this.readonlyState = false;
|
|
295
|
-
}
|
|
296
|
-
this.useInput = false;
|
|
297
|
-
this.useControls = false;
|
|
298
|
-
if (this.controls) {
|
|
299
|
-
this.useControls = true;
|
|
300
|
-
}
|
|
301
|
-
else if (this.input) {
|
|
302
|
-
this.useInput = true;
|
|
303
|
-
}
|
|
304
|
-
this.useSmall = false;
|
|
305
|
-
if (this.scrubberSize === 'sm') {
|
|
306
|
-
this.useSmall = true;
|
|
307
|
-
}
|
|
308
|
-
this.useSnapping = false;
|
|
309
|
-
if (this.snap) {
|
|
310
|
-
this.useSnapping = true;
|
|
311
|
-
}
|
|
312
|
-
const min = this.getMin();
|
|
313
|
-
const max = this.getMax();
|
|
314
|
-
if (min > max) {
|
|
315
|
-
console.warn('min-prop must have a higher value than max-prop for the component to work correctly.');
|
|
316
|
-
this.disabledState = true;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
render() {
|
|
320
|
-
return (h("div", { class: `sdds-slider-wrapper ${this.readonlyState ? 'read-only' : ''}` }, h("input", { ref: (el) => {
|
|
321
|
-
this.nativeRangeInputElement = el;
|
|
322
|
-
}, class: "sdds-slider-native-element", type: "range", value: this.value, name: this.name, min: this.min, max: this.max, disabled: this.disabled }), h("div", { class: `sdds-slider ${this.disabledState ? 'disabled' : ''} ${this.useSmall ? 'sdds-slider-small' : ''}`, ref: (el) => {
|
|
323
|
-
this.wrapperElement = el;
|
|
324
|
-
} }, this.useInput && (h("div", { class: "sdds-slider__input-values" }, h("div", { ref: (el) => {
|
|
325
|
-
this.minusElement = el;
|
|
326
|
-
}, class: "sdds-slider__input-value" }, this.min))), this.useControls && (h("div", { class: "sdds-slider__controls" }, h("div", { ref: (el) => (this.minusElement = el), class: "sdds-slider__control sdds-slider__control-minus" }, h("sdds-icon", { name: "minus", size: "16px" })))), h("div", { class: "sdds-slider-inner" }, h("label", { class: this.tickValues.length > 0 && 'offset' }, this.label), this.tickValues.length > 0 && (h("div", { class: "sdds-slider__value-dividers-wrapper" }, h("div", { ref: (el) => {
|
|
327
|
-
this.dividersElement = el;
|
|
328
|
-
}, class: "sdds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "sdds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { class: "sdds-slider__track", ref: (el) => {
|
|
329
|
-
this.trackElement = el;
|
|
330
|
-
}, tabindex: this.disabled ? '-1' : '0' }, h("div", { class: "sdds-slider__track-fill", ref: (el) => {
|
|
331
|
-
this.trackFillElement = el;
|
|
332
|
-
} }), h("div", { class: "sdds-slider__scrubber", ref: (el) => {
|
|
333
|
-
this.scrubberElement = el;
|
|
334
|
-
} }, this.tooltip && (h("div", { class: "sdds-slider__value" }, this.value, h("svg", { width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "
|
|
335
|
-
this.scrubberInnerElement = el;
|
|
336
|
-
} })))), this.useInput && (h("div", { class: "sdds-slider__input-values" }, h("div", { ref: (el) => {
|
|
337
|
-
this.minusElement = el;
|
|
338
|
-
}, class: "sdds-slider__input-value" }, this.max), h("div", { class: "sdds-slider__input-field-wrapper" }, h("input", { onFocus: (e) => {
|
|
339
|
-
if (this.readonlyState) {
|
|
340
|
-
e.preventDefault();
|
|
341
|
-
this.inputElement.blur();
|
|
342
|
-
}
|
|
343
|
-
}, size: this.calculateInputSizeFromMax(), class: "sdds-slider__input-field", value: this.value, ref: (el) => {
|
|
344
|
-
this.inputElement = el;
|
|
345
|
-
} })))), this.useControls && (h("div", { class: "sdds-slider__controls" }, h("div", { ref: (el) => (this.plusElement = el), class: "sdds-slider__control sdds-slider__control-plus" }, h("sdds-icon", { name: "plus", size: "16px" })))))));
|
|
346
|
-
}
|
|
347
|
-
static get is() { return "sdds-slider"; }
|
|
348
|
-
static get originalStyleUrls() {
|
|
349
|
-
return {
|
|
350
|
-
"$": ["slider.scss"]
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
static get styleUrls() {
|
|
354
|
-
return {
|
|
355
|
-
"$": ["slider.css"]
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
static get properties() {
|
|
359
|
-
return {
|
|
360
|
-
"label": {
|
|
361
|
-
"type": "string",
|
|
362
|
-
"mutable": false,
|
|
363
|
-
"complexType": {
|
|
364
|
-
"original": "string",
|
|
365
|
-
"resolved": "string",
|
|
366
|
-
"references": {}
|
|
367
|
-
},
|
|
368
|
-
"required": false,
|
|
369
|
-
"optional": false,
|
|
370
|
-
"docs": {
|
|
371
|
-
"tags": [],
|
|
372
|
-
"text": "Text for label"
|
|
373
|
-
},
|
|
374
|
-
"attribute": "label",
|
|
375
|
-
"reflect": false,
|
|
376
|
-
"defaultValue": "''"
|
|
377
|
-
},
|
|
378
|
-
"value": {
|
|
379
|
-
"type": "string",
|
|
380
|
-
"mutable": false,
|
|
381
|
-
"complexType": {
|
|
382
|
-
"original": "string",
|
|
383
|
-
"resolved": "string",
|
|
384
|
-
"references": {}
|
|
385
|
-
},
|
|
386
|
-
"required": false,
|
|
387
|
-
"optional": false,
|
|
388
|
-
"docs": {
|
|
389
|
-
"tags": [],
|
|
390
|
-
"text": "Initial value"
|
|
391
|
-
},
|
|
392
|
-
"attribute": "value",
|
|
393
|
-
"reflect": false,
|
|
394
|
-
"defaultValue": "'0'"
|
|
395
|
-
},
|
|
396
|
-
"min": {
|
|
397
|
-
"type": "string",
|
|
398
|
-
"mutable": false,
|
|
399
|
-
"complexType": {
|
|
400
|
-
"original": "string",
|
|
401
|
-
"resolved": "string",
|
|
402
|
-
"references": {}
|
|
403
|
-
},
|
|
404
|
-
"required": false,
|
|
405
|
-
"optional": false,
|
|
406
|
-
"docs": {
|
|
407
|
-
"tags": [],
|
|
408
|
-
"text": "Minimum value"
|
|
409
|
-
},
|
|
410
|
-
"attribute": "min",
|
|
411
|
-
"reflect": false,
|
|
412
|
-
"defaultValue": "'0'"
|
|
413
|
-
},
|
|
414
|
-
"max": {
|
|
415
|
-
"type": "string",
|
|
416
|
-
"mutable": false,
|
|
417
|
-
"complexType": {
|
|
418
|
-
"original": "string",
|
|
419
|
-
"resolved": "string",
|
|
420
|
-
"references": {}
|
|
421
|
-
},
|
|
422
|
-
"required": false,
|
|
423
|
-
"optional": false,
|
|
424
|
-
"docs": {
|
|
425
|
-
"tags": [],
|
|
426
|
-
"text": "Maximum value"
|
|
427
|
-
},
|
|
428
|
-
"attribute": "max",
|
|
429
|
-
"reflect": false,
|
|
430
|
-
"defaultValue": "'100'"
|
|
431
|
-
},
|
|
432
|
-
"ticks": {
|
|
433
|
-
"type": "string",
|
|
434
|
-
"mutable": false,
|
|
435
|
-
"complexType": {
|
|
436
|
-
"original": "string",
|
|
437
|
-
"resolved": "string",
|
|
438
|
-
"references": {}
|
|
439
|
-
},
|
|
440
|
-
"required": false,
|
|
441
|
-
"optional": false,
|
|
442
|
-
"docs": {
|
|
443
|
-
"tags": [],
|
|
444
|
-
"text": "Number of tick markers (tick for min- and max-value will be added automatically)"
|
|
445
|
-
},
|
|
446
|
-
"attribute": "ticks",
|
|
447
|
-
"reflect": false,
|
|
448
|
-
"defaultValue": "'0'"
|
|
449
|
-
},
|
|
450
|
-
"showTickNumbers": {
|
|
451
|
-
"type": "boolean",
|
|
452
|
-
"mutable": false,
|
|
453
|
-
"complexType": {
|
|
454
|
-
"original": "boolean",
|
|
455
|
-
"resolved": "boolean",
|
|
456
|
-
"references": {}
|
|
457
|
-
},
|
|
458
|
-
"required": false,
|
|
459
|
-
"optional": false,
|
|
460
|
-
"docs": {
|
|
461
|
-
"tags": [],
|
|
462
|
-
"text": "Decide to show numbers above the tick markers or not"
|
|
463
|
-
},
|
|
464
|
-
"attribute": "show-tick-numbers",
|
|
465
|
-
"reflect": false,
|
|
466
|
-
"defaultValue": "false"
|
|
467
|
-
},
|
|
468
|
-
"tooltip": {
|
|
469
|
-
"type": "boolean",
|
|
470
|
-
"mutable": false,
|
|
471
|
-
"complexType": {
|
|
472
|
-
"original": "boolean",
|
|
473
|
-
"resolved": "boolean",
|
|
474
|
-
"references": {}
|
|
475
|
-
},
|
|
476
|
-
"required": false,
|
|
477
|
-
"optional": false,
|
|
478
|
-
"docs": {
|
|
479
|
-
"tags": [],
|
|
480
|
-
"text": "Decide to show the tooltip or not"
|
|
481
|
-
},
|
|
482
|
-
"attribute": "tooltip",
|
|
483
|
-
"reflect": false,
|
|
484
|
-
"defaultValue": "false"
|
|
485
|
-
},
|
|
486
|
-
"disabled": {
|
|
487
|
-
"type": "boolean",
|
|
488
|
-
"mutable": false,
|
|
489
|
-
"complexType": {
|
|
490
|
-
"original": "boolean",
|
|
491
|
-
"resolved": "boolean",
|
|
492
|
-
"references": {}
|
|
493
|
-
},
|
|
494
|
-
"required": false,
|
|
495
|
-
"optional": false,
|
|
496
|
-
"docs": {
|
|
497
|
-
"tags": [],
|
|
498
|
-
"text": "Sets the disabled state for the whole component"
|
|
499
|
-
},
|
|
500
|
-
"attribute": "disabled",
|
|
501
|
-
"reflect": false,
|
|
502
|
-
"defaultValue": "false"
|
|
503
|
-
},
|
|
504
|
-
"readOnly": {
|
|
505
|
-
"type": "boolean",
|
|
506
|
-
"mutable": false,
|
|
507
|
-
"complexType": {
|
|
508
|
-
"original": "boolean",
|
|
509
|
-
"resolved": "boolean",
|
|
510
|
-
"references": {}
|
|
511
|
-
},
|
|
512
|
-
"required": false,
|
|
513
|
-
"optional": false,
|
|
514
|
-
"docs": {
|
|
515
|
-
"tags": [],
|
|
516
|
-
"text": "Sets the read only state for the whole component"
|
|
517
|
-
},
|
|
518
|
-
"attribute": "read-only",
|
|
519
|
-
"reflect": false,
|
|
520
|
-
"defaultValue": "false"
|
|
521
|
-
},
|
|
522
|
-
"controls": {
|
|
523
|
-
"type": "boolean",
|
|
524
|
-
"mutable": false,
|
|
525
|
-
"complexType": {
|
|
526
|
-
"original": "boolean",
|
|
527
|
-
"resolved": "boolean",
|
|
528
|
-
"references": {}
|
|
529
|
-
},
|
|
530
|
-
"required": false,
|
|
531
|
-
"optional": false,
|
|
532
|
-
"docs": {
|
|
533
|
-
"tags": [],
|
|
534
|
-
"text": "Decide to show the controls or not"
|
|
535
|
-
},
|
|
536
|
-
"attribute": "controls",
|
|
537
|
-
"reflect": false,
|
|
538
|
-
"defaultValue": "false"
|
|
539
|
-
},
|
|
540
|
-
"input": {
|
|
541
|
-
"type": "boolean",
|
|
542
|
-
"mutable": false,
|
|
543
|
-
"complexType": {
|
|
544
|
-
"original": "boolean",
|
|
545
|
-
"resolved": "boolean",
|
|
546
|
-
"references": {}
|
|
547
|
-
},
|
|
548
|
-
"required": false,
|
|
549
|
-
"optional": false,
|
|
550
|
-
"docs": {
|
|
551
|
-
"tags": [],
|
|
552
|
-
"text": "Decide to show the input field or not"
|
|
553
|
-
},
|
|
554
|
-
"attribute": "input",
|
|
555
|
-
"reflect": false,
|
|
556
|
-
"defaultValue": "false"
|
|
557
|
-
},
|
|
558
|
-
"step": {
|
|
559
|
-
"type": "string",
|
|
560
|
-
"mutable": false,
|
|
561
|
-
"complexType": {
|
|
562
|
-
"original": "string",
|
|
563
|
-
"resolved": "string",
|
|
564
|
-
"references": {}
|
|
565
|
-
},
|
|
566
|
-
"required": false,
|
|
567
|
-
"optional": false,
|
|
568
|
-
"docs": {
|
|
569
|
-
"tags": [],
|
|
570
|
-
"text": "Defines how much to increment/decrement the value when using controls"
|
|
571
|
-
},
|
|
572
|
-
"attribute": "step",
|
|
573
|
-
"reflect": false,
|
|
574
|
-
"defaultValue": "'1'"
|
|
575
|
-
},
|
|
576
|
-
"name": {
|
|
577
|
-
"type": "string",
|
|
578
|
-
"mutable": false,
|
|
579
|
-
"complexType": {
|
|
580
|
-
"original": "string",
|
|
581
|
-
"resolved": "string",
|
|
582
|
-
"references": {}
|
|
583
|
-
},
|
|
584
|
-
"required": false,
|
|
585
|
-
"optional": false,
|
|
586
|
-
"docs": {
|
|
587
|
-
"tags": [],
|
|
588
|
-
"text": "Name property (will be inherited by the native slider component)"
|
|
589
|
-
},
|
|
590
|
-
"attribute": "name",
|
|
591
|
-
"reflect": false,
|
|
592
|
-
"defaultValue": "''"
|
|
593
|
-
},
|
|
594
|
-
"scrubberSize": {
|
|
595
|
-
"type": "string",
|
|
596
|
-
"mutable": false,
|
|
597
|
-
"complexType": {
|
|
598
|
-
"original": "'sm' | 'lg'",
|
|
599
|
-
"resolved": "\"lg\" | \"sm\"",
|
|
600
|
-
"references": {}
|
|
601
|
-
},
|
|
602
|
-
"required": false,
|
|
603
|
-
"optional": false,
|
|
604
|
-
"docs": {
|
|
605
|
-
"tags": [],
|
|
606
|
-
"text": "Sets the size of the scrubber"
|
|
607
|
-
},
|
|
608
|
-
"attribute": "scrubber-size",
|
|
609
|
-
"reflect": false,
|
|
610
|
-
"defaultValue": "'lg'"
|
|
611
|
-
},
|
|
612
|
-
"snap": {
|
|
613
|
-
"type": "boolean",
|
|
614
|
-
"mutable": false,
|
|
615
|
-
"complexType": {
|
|
616
|
-
"original": "boolean",
|
|
617
|
-
"resolved": "boolean",
|
|
618
|
-
"references": {}
|
|
619
|
-
},
|
|
620
|
-
"required": false,
|
|
621
|
-
"optional": false,
|
|
622
|
-
"docs": {
|
|
623
|
-
"tags": [],
|
|
624
|
-
"text": "Snap to the ticks grid"
|
|
625
|
-
},
|
|
626
|
-
"attribute": "snap",
|
|
627
|
-
"reflect": false,
|
|
628
|
-
"defaultValue": "false"
|
|
629
|
-
},
|
|
630
|
-
"sliderId": {
|
|
631
|
-
"type": "string",
|
|
632
|
-
"mutable": false,
|
|
633
|
-
"complexType": {
|
|
634
|
-
"original": "string",
|
|
635
|
-
"resolved": "string",
|
|
636
|
-
"references": {}
|
|
637
|
-
},
|
|
638
|
-
"required": false,
|
|
639
|
-
"optional": false,
|
|
640
|
-
"docs": {
|
|
641
|
-
"tags": [],
|
|
642
|
-
"text": "Id for the sliders input element, randomly generated if not specified."
|
|
643
|
-
},
|
|
644
|
-
"attribute": "slider-id",
|
|
645
|
-
"reflect": false,
|
|
646
|
-
"defaultValue": "crypto.randomUUID()"
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
static get events() {
|
|
651
|
-
return [{
|
|
652
|
-
"method": "sddsChange",
|
|
653
|
-
"name": "sddsChange",
|
|
654
|
-
"bubbles": true,
|
|
655
|
-
"cancelable": true,
|
|
656
|
-
"composed": true,
|
|
657
|
-
"docs": {
|
|
658
|
-
"tags": [],
|
|
659
|
-
"text": "Sends the value of the slider when changed."
|
|
660
|
-
},
|
|
661
|
-
"complexType": {
|
|
662
|
-
"original": "{\n value: string;\n }",
|
|
663
|
-
"resolved": "{ value: string; }",
|
|
664
|
-
"references": {}
|
|
665
|
-
}
|
|
666
|
-
}];
|
|
667
|
-
}
|
|
668
|
-
static get methods() {
|
|
669
|
-
return {
|
|
670
|
-
"reset": {
|
|
671
|
-
"complexType": {
|
|
672
|
-
"signature": "() => Promise<void>",
|
|
673
|
-
"parameters": [],
|
|
674
|
-
"references": {
|
|
675
|
-
"Promise": {
|
|
676
|
-
"location": "global"
|
|
677
|
-
}
|
|
678
|
-
},
|
|
679
|
-
"return": "Promise<void>"
|
|
680
|
-
},
|
|
681
|
-
"docs": {
|
|
682
|
-
"text": "Public method to re-initialise the slider if some configuration props are changed",
|
|
683
|
-
"tags": []
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
static get listeners() {
|
|
689
|
-
return [{
|
|
690
|
-
"name": "keydown",
|
|
691
|
-
"method": "handleKeydown",
|
|
692
|
-
"target": undefined,
|
|
693
|
-
"capture": false,
|
|
694
|
-
"passive": false
|
|
695
|
-
}, {
|
|
696
|
-
"name": "mouseup",
|
|
697
|
-
"method": "handleMouseUp",
|
|
698
|
-
"target": "window",
|
|
699
|
-
"capture": false,
|
|
700
|
-
"passive": true
|
|
701
|
-
}, {
|
|
702
|
-
"name": "touchend",
|
|
703
|
-
"method": "handleTouchEnd",
|
|
704
|
-
"target": "window",
|
|
705
|
-
"capture": false,
|
|
706
|
-
"passive": true
|
|
707
|
-
}, {
|
|
708
|
-
"name": "mousemove",
|
|
709
|
-
"method": "handleMouseMove",
|
|
710
|
-
"target": "window",
|
|
711
|
-
"capture": false,
|
|
712
|
-
"passive": true
|
|
713
|
-
}, {
|
|
714
|
-
"name": "touchmove",
|
|
715
|
-
"method": "handleTouchMove",
|
|
716
|
-
"target": "window",
|
|
717
|
-
"capture": false,
|
|
718
|
-
"passive": true
|
|
719
|
-
}];
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
//# sourceMappingURL=slider.js.map
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
export class Slider {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.wrapperElement = null;
|
|
5
|
+
this.scrubberElement = null;
|
|
6
|
+
this.scrubberInnerElement = null;
|
|
7
|
+
this.dividersElement = null;
|
|
8
|
+
this.trackElement = null;
|
|
9
|
+
this.trackFillElement = null;
|
|
10
|
+
this.minusElement = null;
|
|
11
|
+
this.plusElement = null;
|
|
12
|
+
this.inputElement = null;
|
|
13
|
+
this.nativeRangeInputElement = null;
|
|
14
|
+
this.scrubberGrabPos = { x: 0, y: 0 };
|
|
15
|
+
this.scrubberGrabbed = false;
|
|
16
|
+
this.scrubberLeft = 0;
|
|
17
|
+
this.tickValues = [];
|
|
18
|
+
this.disabledState = false;
|
|
19
|
+
this.readonlyState = false;
|
|
20
|
+
this.useControls = false;
|
|
21
|
+
this.useInput = false;
|
|
22
|
+
this.useSmall = false;
|
|
23
|
+
this.useSnapping = false;
|
|
24
|
+
this.supposedValueSlot = -1;
|
|
25
|
+
this.eventListenersAdded = false;
|
|
26
|
+
this.resizeObserverAdded = false;
|
|
27
|
+
this.label = '';
|
|
28
|
+
this.value = '0';
|
|
29
|
+
this.min = '0';
|
|
30
|
+
this.max = '100';
|
|
31
|
+
this.ticks = '0';
|
|
32
|
+
this.showTickNumbers = false;
|
|
33
|
+
this.tooltip = false;
|
|
34
|
+
this.disabled = false;
|
|
35
|
+
this.readOnly = false;
|
|
36
|
+
this.controls = false;
|
|
37
|
+
this.input = false;
|
|
38
|
+
this.step = '1';
|
|
39
|
+
this.name = '';
|
|
40
|
+
this.scrubberSize = 'lg';
|
|
41
|
+
this.snap = false;
|
|
42
|
+
this.sliderId = crypto.randomUUID();
|
|
43
|
+
}
|
|
44
|
+
/** Public method to re-initialise the slider if some configuration props are changed */
|
|
45
|
+
async reset() {
|
|
46
|
+
// @TODO: maybe refactor to use watch-decorators instead
|
|
47
|
+
this.componentWillLoad();
|
|
48
|
+
this.componentDidLoad();
|
|
49
|
+
}
|
|
50
|
+
handleKeydown(event) {
|
|
51
|
+
switch (event.key) {
|
|
52
|
+
case 'ArrowLeft':
|
|
53
|
+
this.stepLeft();
|
|
54
|
+
break;
|
|
55
|
+
case 'ArrowRight':
|
|
56
|
+
this.stepRight();
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
handleMouseUp() {
|
|
63
|
+
if (!this.scrubberGrabbed) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.scrubberGrabbed = false;
|
|
67
|
+
this.scrubberInnerElement.classList.remove('pressed');
|
|
68
|
+
this.updateValue();
|
|
69
|
+
this.trackElement.focus();
|
|
70
|
+
}
|
|
71
|
+
handleTouchEnd() {
|
|
72
|
+
if (!this.scrubberGrabbed) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.scrubberGrabbed = false;
|
|
76
|
+
this.scrubberInnerElement.classList.remove('pressed');
|
|
77
|
+
this.updateValue();
|
|
78
|
+
this.trackElement.focus();
|
|
79
|
+
}
|
|
80
|
+
handleMouseMove(event) {
|
|
81
|
+
if (!this.scrubberGrabbed) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const numTicks = parseInt(this.ticks);
|
|
85
|
+
const trackRect = this.trackElement.getBoundingClientRect();
|
|
86
|
+
let localLeft = event.clientX - trackRect.left;
|
|
87
|
+
this.supposedValueSlot = -1;
|
|
88
|
+
if (this.useSnapping && numTicks > 0) {
|
|
89
|
+
const v = Math.round(this.getTrackWidth() / (numTicks + 1));
|
|
90
|
+
localLeft = Math.round(localLeft / v) * v;
|
|
91
|
+
this.supposedValueSlot = Math.round(localLeft / v);
|
|
92
|
+
}
|
|
93
|
+
this.scrubberLeft = this.constrainScrubber(localLeft);
|
|
94
|
+
this.scrubberElement.style.left = `${this.scrubberLeft}px`;
|
|
95
|
+
this.updateValue();
|
|
96
|
+
this.updateTrack();
|
|
97
|
+
}
|
|
98
|
+
handleTouchMove(event) {
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
if (!this.scrubberGrabbed) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const numTicks = parseInt(this.ticks);
|
|
104
|
+
const trackRect = this.trackElement.getBoundingClientRect();
|
|
105
|
+
let localLeft = event.touches[0].clientX - trackRect.left;
|
|
106
|
+
this.supposedValueSlot = -1;
|
|
107
|
+
if (this.useSnapping && numTicks > 0) {
|
|
108
|
+
const v = Math.round(this.getTrackWidth() / (numTicks + 1));
|
|
109
|
+
localLeft = Math.round(localLeft / v) * v;
|
|
110
|
+
this.supposedValueSlot = Math.round(localLeft / v);
|
|
111
|
+
}
|
|
112
|
+
this.scrubberLeft = this.constrainScrubber(localLeft);
|
|
113
|
+
this.scrubberElement.style.left = `${this.scrubberLeft}px`;
|
|
114
|
+
this.updateValue();
|
|
115
|
+
this.updateTrack();
|
|
116
|
+
}
|
|
117
|
+
updateTrack() {
|
|
118
|
+
const trackWidth = this.getTrackWidth();
|
|
119
|
+
const percentageFilled = (this.scrubberLeft / trackWidth) * 100;
|
|
120
|
+
this.trackFillElement.style.width = `${percentageFilled}%`;
|
|
121
|
+
}
|
|
122
|
+
dispatchChangeEvent() {
|
|
123
|
+
this.sddsChange.emit({ value: this.value });
|
|
124
|
+
}
|
|
125
|
+
updateValue() {
|
|
126
|
+
const trackWidth = this.getTrackWidth();
|
|
127
|
+
/* if snapping (supposedValueSlot > 0) is enabled, make sure we display the supposed value (instead of maybe getting a -1/+1 depending on rounding) */
|
|
128
|
+
if (this.supposedValueSlot > 0) {
|
|
129
|
+
const supposedValue = this.tickValues[this.supposedValueSlot];
|
|
130
|
+
this.value = `${supposedValue}`;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const percentage = this.scrubberLeft / trackWidth;
|
|
134
|
+
this.value = `${Math.trunc(this.getMin() + percentage * (this.getMax() - this.getMin()))}`;
|
|
135
|
+
}
|
|
136
|
+
this.dispatchChangeEvent();
|
|
137
|
+
}
|
|
138
|
+
updateValueForced(value) {
|
|
139
|
+
this.value = value;
|
|
140
|
+
this.dispatchChangeEvent();
|
|
141
|
+
}
|
|
142
|
+
getMin() {
|
|
143
|
+
return parseFloat(this.min);
|
|
144
|
+
}
|
|
145
|
+
getMax() {
|
|
146
|
+
return parseFloat(this.max);
|
|
147
|
+
}
|
|
148
|
+
constrainScrubber(x) {
|
|
149
|
+
const width = this.getTrackWidth();
|
|
150
|
+
if (x < 0) {
|
|
151
|
+
return 0;
|
|
152
|
+
}
|
|
153
|
+
if (x > width) {
|
|
154
|
+
return width;
|
|
155
|
+
}
|
|
156
|
+
return x;
|
|
157
|
+
}
|
|
158
|
+
getTrackWidth() {
|
|
159
|
+
const trackRect = this.trackElement.getBoundingClientRect();
|
|
160
|
+
return trackRect.right - trackRect.left;
|
|
161
|
+
}
|
|
162
|
+
calculateScrubberLeftFromValue(value) {
|
|
163
|
+
const initValue = value;
|
|
164
|
+
const trackWidth = this.getTrackWidth();
|
|
165
|
+
const normalizedValue = initValue - this.getMin();
|
|
166
|
+
const normalizedMax = this.getMax() - this.getMin();
|
|
167
|
+
const calculatedLeft = (normalizedValue / normalizedMax) * trackWidth;
|
|
168
|
+
this.scrubberLeft = calculatedLeft;
|
|
169
|
+
this.scrubberElement.style.left = `${this.scrubberLeft}px`;
|
|
170
|
+
}
|
|
171
|
+
componentDidLoad() {
|
|
172
|
+
if (!this.resizeObserverAdded) {
|
|
173
|
+
this.resizeObserverAdded = true;
|
|
174
|
+
const resizeObserver = new ResizeObserver(( /* entries */) => {
|
|
175
|
+
this.calculateScrubberLeftFromValue(this.value);
|
|
176
|
+
this.updateTrack();
|
|
177
|
+
});
|
|
178
|
+
resizeObserver.observe(this.wrapperElement);
|
|
179
|
+
}
|
|
180
|
+
if (!this.eventListenersAdded) {
|
|
181
|
+
this.eventListenersAdded = true;
|
|
182
|
+
this.scrubberElement.addEventListener('mousedown', (event) => {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
this.grabScrubber(event.offsetX, event.offsetY);
|
|
185
|
+
});
|
|
186
|
+
this.scrubberElement.addEventListener('touchstart', (event) => {
|
|
187
|
+
const rect = this.scrubberElement.getBoundingClientRect();
|
|
188
|
+
const x = event.targetTouches[0].pageX - rect.left;
|
|
189
|
+
const y = event.targetTouches[0].pageY - rect.top;
|
|
190
|
+
this.grabScrubber(x, y);
|
|
191
|
+
});
|
|
192
|
+
if (this.useControls) {
|
|
193
|
+
this.minusElement.addEventListener('click', () => {
|
|
194
|
+
this.stepLeft();
|
|
195
|
+
});
|
|
196
|
+
this.plusElement.addEventListener('click', () => {
|
|
197
|
+
this.stepRight();
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (this.inputElement) {
|
|
201
|
+
this.inputElement.addEventListener('keydown', (event) => {
|
|
202
|
+
event.stopPropagation();
|
|
203
|
+
if (event.key === 'Enter') {
|
|
204
|
+
let newValue = parseInt(this.inputElement.value);
|
|
205
|
+
if (newValue < this.getMin()) {
|
|
206
|
+
newValue = this.getMin();
|
|
207
|
+
}
|
|
208
|
+
else if (newValue > this.getMax()) {
|
|
209
|
+
newValue = this.getMax();
|
|
210
|
+
}
|
|
211
|
+
this.calculateScrubberLeftFromValue(newValue);
|
|
212
|
+
this.updateValueForced(newValue);
|
|
213
|
+
this.updateTrack();
|
|
214
|
+
this.inputElement.blur();
|
|
215
|
+
this.wrapperElement.focus();
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
this.calculateScrubberLeftFromValue(this.value);
|
|
221
|
+
this.updateTrack();
|
|
222
|
+
}
|
|
223
|
+
grabScrubber(xOffset, yOffset) {
|
|
224
|
+
if (this.readonlyState) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
this.scrubberGrabPos = {
|
|
228
|
+
x: xOffset,
|
|
229
|
+
y: yOffset,
|
|
230
|
+
};
|
|
231
|
+
this.scrubberGrabbed = true;
|
|
232
|
+
this.scrubberInnerElement.classList.add('pressed');
|
|
233
|
+
}
|
|
234
|
+
calculateInputSizeFromMax() {
|
|
235
|
+
return this.max.length;
|
|
236
|
+
}
|
|
237
|
+
controlsStep(delta) {
|
|
238
|
+
if (this.readonlyState || this.disabled) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const trackWidth = this.getTrackWidth();
|
|
242
|
+
const percentage = this.scrubberLeft / trackWidth;
|
|
243
|
+
const numTicks = parseInt(this.ticks);
|
|
244
|
+
let currentValue = this.getMin() + percentage * (this.getMax() - this.getMin());
|
|
245
|
+
currentValue += delta;
|
|
246
|
+
if (currentValue < this.getMin()) {
|
|
247
|
+
currentValue = this.getMin();
|
|
248
|
+
}
|
|
249
|
+
else if (currentValue > this.getMax()) {
|
|
250
|
+
currentValue = this.getMax();
|
|
251
|
+
}
|
|
252
|
+
this.value = `${currentValue}`;
|
|
253
|
+
/* if snapping is enabled, instead just increment or decrement the current "fixed" value from our ticknumber array */
|
|
254
|
+
if (this.useSnapping && numTicks > 0) {
|
|
255
|
+
const stepDir = delta > 0 ? 1 : -1;
|
|
256
|
+
this.supposedValueSlot += stepDir;
|
|
257
|
+
if (this.supposedValueSlot < 0) {
|
|
258
|
+
this.supposedValueSlot = 0;
|
|
259
|
+
}
|
|
260
|
+
else if (this.supposedValueSlot > numTicks + 1) {
|
|
261
|
+
this.supposedValueSlot = numTicks + 1;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
this.calculateScrubberLeftFromValue(currentValue);
|
|
265
|
+
this.updateTrack();
|
|
266
|
+
this.updateValue();
|
|
267
|
+
}
|
|
268
|
+
stepLeft() {
|
|
269
|
+
this.controlsStep(-parseInt(this.step));
|
|
270
|
+
}
|
|
271
|
+
stepRight() {
|
|
272
|
+
this.controlsStep(parseInt(this.step));
|
|
273
|
+
}
|
|
274
|
+
componentWillLoad() {
|
|
275
|
+
const numTicks = parseInt(this.ticks);
|
|
276
|
+
if (numTicks > 0) {
|
|
277
|
+
this.tickValues = [this.getMin()];
|
|
278
|
+
const step = (this.getMax() - this.getMin()) / (numTicks + 1);
|
|
279
|
+
for (let i = 1; i < numTicks + 1; i++) {
|
|
280
|
+
this.tickValues.push(this.getMin() + Math.round(step * i));
|
|
281
|
+
}
|
|
282
|
+
this.tickValues.push(this.getMax());
|
|
283
|
+
}
|
|
284
|
+
if (this.disabled) {
|
|
285
|
+
this.disabledState = true;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this.disabledState = false;
|
|
289
|
+
}
|
|
290
|
+
if (this.readOnly) {
|
|
291
|
+
this.readonlyState = true;
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
this.readonlyState = false;
|
|
295
|
+
}
|
|
296
|
+
this.useInput = false;
|
|
297
|
+
this.useControls = false;
|
|
298
|
+
if (this.controls) {
|
|
299
|
+
this.useControls = true;
|
|
300
|
+
}
|
|
301
|
+
else if (this.input) {
|
|
302
|
+
this.useInput = true;
|
|
303
|
+
}
|
|
304
|
+
this.useSmall = false;
|
|
305
|
+
if (this.scrubberSize === 'sm') {
|
|
306
|
+
this.useSmall = true;
|
|
307
|
+
}
|
|
308
|
+
this.useSnapping = false;
|
|
309
|
+
if (this.snap) {
|
|
310
|
+
this.useSnapping = true;
|
|
311
|
+
}
|
|
312
|
+
const min = this.getMin();
|
|
313
|
+
const max = this.getMax();
|
|
314
|
+
if (min > max) {
|
|
315
|
+
console.warn('min-prop must have a higher value than max-prop for the component to work correctly.');
|
|
316
|
+
this.disabledState = true;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
render() {
|
|
320
|
+
return (h("div", { class: `sdds-slider-wrapper ${this.readonlyState ? 'read-only' : ''}` }, h("input", { ref: (el) => {
|
|
321
|
+
this.nativeRangeInputElement = el;
|
|
322
|
+
}, class: "sdds-slider-native-element", type: "range", value: this.value, name: this.name, min: this.min, max: this.max, disabled: this.disabled }), h("div", { class: `sdds-slider ${this.disabledState ? 'disabled' : ''} ${this.useSmall ? 'sdds-slider-small' : ''}`, ref: (el) => {
|
|
323
|
+
this.wrapperElement = el;
|
|
324
|
+
} }, this.useInput && (h("div", { class: "sdds-slider__input-values" }, h("div", { ref: (el) => {
|
|
325
|
+
this.minusElement = el;
|
|
326
|
+
}, class: "sdds-slider__input-value" }, this.min))), this.useControls && (h("div", { class: "sdds-slider__controls" }, h("div", { ref: (el) => (this.minusElement = el), class: "sdds-slider__control sdds-slider__control-minus" }, h("sdds-icon", { name: "minus", size: "16px" })))), h("div", { class: "sdds-slider-inner" }, h("label", { class: this.tickValues.length > 0 && 'offset' }, this.label), this.tickValues.length > 0 && (h("div", { class: "sdds-slider__value-dividers-wrapper" }, h("div", { ref: (el) => {
|
|
327
|
+
this.dividersElement = el;
|
|
328
|
+
}, class: "sdds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "sdds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { class: "sdds-slider__track", ref: (el) => {
|
|
329
|
+
this.trackElement = el;
|
|
330
|
+
}, tabindex: this.disabled ? '-1' : '0' }, h("div", { class: "sdds-slider__track-fill", ref: (el) => {
|
|
331
|
+
this.trackFillElement = el;
|
|
332
|
+
} }), h("div", { class: "sdds-slider__scrubber", ref: (el) => {
|
|
333
|
+
this.scrubberElement = el;
|
|
334
|
+
} }, this.tooltip && (h("div", { class: "sdds-slider__value" }, this.value, h("svg", { width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { class: "sdds-slider__scrubber-inner", ref: (el) => {
|
|
335
|
+
this.scrubberInnerElement = el;
|
|
336
|
+
} })))), this.useInput && (h("div", { class: "sdds-slider__input-values" }, h("div", { ref: (el) => {
|
|
337
|
+
this.minusElement = el;
|
|
338
|
+
}, class: "sdds-slider__input-value" }, this.max), h("div", { class: "sdds-slider__input-field-wrapper" }, h("input", { onFocus: (e) => {
|
|
339
|
+
if (this.readonlyState) {
|
|
340
|
+
e.preventDefault();
|
|
341
|
+
this.inputElement.blur();
|
|
342
|
+
}
|
|
343
|
+
}, size: this.calculateInputSizeFromMax(), class: "sdds-slider__input-field", value: this.value, ref: (el) => {
|
|
344
|
+
this.inputElement = el;
|
|
345
|
+
} })))), this.useControls && (h("div", { class: "sdds-slider__controls" }, h("div", { ref: (el) => (this.plusElement = el), class: "sdds-slider__control sdds-slider__control-plus" }, h("sdds-icon", { name: "plus", size: "16px" })))))));
|
|
346
|
+
}
|
|
347
|
+
static get is() { return "sdds-slider"; }
|
|
348
|
+
static get originalStyleUrls() {
|
|
349
|
+
return {
|
|
350
|
+
"$": ["slider.scss"]
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
static get styleUrls() {
|
|
354
|
+
return {
|
|
355
|
+
"$": ["slider.css"]
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
static get properties() {
|
|
359
|
+
return {
|
|
360
|
+
"label": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "string",
|
|
365
|
+
"resolved": "string",
|
|
366
|
+
"references": {}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": false,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "Text for label"
|
|
373
|
+
},
|
|
374
|
+
"attribute": "label",
|
|
375
|
+
"reflect": false,
|
|
376
|
+
"defaultValue": "''"
|
|
377
|
+
},
|
|
378
|
+
"value": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"mutable": false,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "string",
|
|
383
|
+
"resolved": "string",
|
|
384
|
+
"references": {}
|
|
385
|
+
},
|
|
386
|
+
"required": false,
|
|
387
|
+
"optional": false,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": "Initial value"
|
|
391
|
+
},
|
|
392
|
+
"attribute": "value",
|
|
393
|
+
"reflect": false,
|
|
394
|
+
"defaultValue": "'0'"
|
|
395
|
+
},
|
|
396
|
+
"min": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "string",
|
|
401
|
+
"resolved": "string",
|
|
402
|
+
"references": {}
|
|
403
|
+
},
|
|
404
|
+
"required": false,
|
|
405
|
+
"optional": false,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": "Minimum value"
|
|
409
|
+
},
|
|
410
|
+
"attribute": "min",
|
|
411
|
+
"reflect": false,
|
|
412
|
+
"defaultValue": "'0'"
|
|
413
|
+
},
|
|
414
|
+
"max": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"mutable": false,
|
|
417
|
+
"complexType": {
|
|
418
|
+
"original": "string",
|
|
419
|
+
"resolved": "string",
|
|
420
|
+
"references": {}
|
|
421
|
+
},
|
|
422
|
+
"required": false,
|
|
423
|
+
"optional": false,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": "Maximum value"
|
|
427
|
+
},
|
|
428
|
+
"attribute": "max",
|
|
429
|
+
"reflect": false,
|
|
430
|
+
"defaultValue": "'100'"
|
|
431
|
+
},
|
|
432
|
+
"ticks": {
|
|
433
|
+
"type": "string",
|
|
434
|
+
"mutable": false,
|
|
435
|
+
"complexType": {
|
|
436
|
+
"original": "string",
|
|
437
|
+
"resolved": "string",
|
|
438
|
+
"references": {}
|
|
439
|
+
},
|
|
440
|
+
"required": false,
|
|
441
|
+
"optional": false,
|
|
442
|
+
"docs": {
|
|
443
|
+
"tags": [],
|
|
444
|
+
"text": "Number of tick markers (tick for min- and max-value will be added automatically)"
|
|
445
|
+
},
|
|
446
|
+
"attribute": "ticks",
|
|
447
|
+
"reflect": false,
|
|
448
|
+
"defaultValue": "'0'"
|
|
449
|
+
},
|
|
450
|
+
"showTickNumbers": {
|
|
451
|
+
"type": "boolean",
|
|
452
|
+
"mutable": false,
|
|
453
|
+
"complexType": {
|
|
454
|
+
"original": "boolean",
|
|
455
|
+
"resolved": "boolean",
|
|
456
|
+
"references": {}
|
|
457
|
+
},
|
|
458
|
+
"required": false,
|
|
459
|
+
"optional": false,
|
|
460
|
+
"docs": {
|
|
461
|
+
"tags": [],
|
|
462
|
+
"text": "Decide to show numbers above the tick markers or not"
|
|
463
|
+
},
|
|
464
|
+
"attribute": "show-tick-numbers",
|
|
465
|
+
"reflect": false,
|
|
466
|
+
"defaultValue": "false"
|
|
467
|
+
},
|
|
468
|
+
"tooltip": {
|
|
469
|
+
"type": "boolean",
|
|
470
|
+
"mutable": false,
|
|
471
|
+
"complexType": {
|
|
472
|
+
"original": "boolean",
|
|
473
|
+
"resolved": "boolean",
|
|
474
|
+
"references": {}
|
|
475
|
+
},
|
|
476
|
+
"required": false,
|
|
477
|
+
"optional": false,
|
|
478
|
+
"docs": {
|
|
479
|
+
"tags": [],
|
|
480
|
+
"text": "Decide to show the tooltip or not"
|
|
481
|
+
},
|
|
482
|
+
"attribute": "tooltip",
|
|
483
|
+
"reflect": false,
|
|
484
|
+
"defaultValue": "false"
|
|
485
|
+
},
|
|
486
|
+
"disabled": {
|
|
487
|
+
"type": "boolean",
|
|
488
|
+
"mutable": false,
|
|
489
|
+
"complexType": {
|
|
490
|
+
"original": "boolean",
|
|
491
|
+
"resolved": "boolean",
|
|
492
|
+
"references": {}
|
|
493
|
+
},
|
|
494
|
+
"required": false,
|
|
495
|
+
"optional": false,
|
|
496
|
+
"docs": {
|
|
497
|
+
"tags": [],
|
|
498
|
+
"text": "Sets the disabled state for the whole component"
|
|
499
|
+
},
|
|
500
|
+
"attribute": "disabled",
|
|
501
|
+
"reflect": false,
|
|
502
|
+
"defaultValue": "false"
|
|
503
|
+
},
|
|
504
|
+
"readOnly": {
|
|
505
|
+
"type": "boolean",
|
|
506
|
+
"mutable": false,
|
|
507
|
+
"complexType": {
|
|
508
|
+
"original": "boolean",
|
|
509
|
+
"resolved": "boolean",
|
|
510
|
+
"references": {}
|
|
511
|
+
},
|
|
512
|
+
"required": false,
|
|
513
|
+
"optional": false,
|
|
514
|
+
"docs": {
|
|
515
|
+
"tags": [],
|
|
516
|
+
"text": "Sets the read only state for the whole component"
|
|
517
|
+
},
|
|
518
|
+
"attribute": "read-only",
|
|
519
|
+
"reflect": false,
|
|
520
|
+
"defaultValue": "false"
|
|
521
|
+
},
|
|
522
|
+
"controls": {
|
|
523
|
+
"type": "boolean",
|
|
524
|
+
"mutable": false,
|
|
525
|
+
"complexType": {
|
|
526
|
+
"original": "boolean",
|
|
527
|
+
"resolved": "boolean",
|
|
528
|
+
"references": {}
|
|
529
|
+
},
|
|
530
|
+
"required": false,
|
|
531
|
+
"optional": false,
|
|
532
|
+
"docs": {
|
|
533
|
+
"tags": [],
|
|
534
|
+
"text": "Decide to show the controls or not"
|
|
535
|
+
},
|
|
536
|
+
"attribute": "controls",
|
|
537
|
+
"reflect": false,
|
|
538
|
+
"defaultValue": "false"
|
|
539
|
+
},
|
|
540
|
+
"input": {
|
|
541
|
+
"type": "boolean",
|
|
542
|
+
"mutable": false,
|
|
543
|
+
"complexType": {
|
|
544
|
+
"original": "boolean",
|
|
545
|
+
"resolved": "boolean",
|
|
546
|
+
"references": {}
|
|
547
|
+
},
|
|
548
|
+
"required": false,
|
|
549
|
+
"optional": false,
|
|
550
|
+
"docs": {
|
|
551
|
+
"tags": [],
|
|
552
|
+
"text": "Decide to show the input field or not"
|
|
553
|
+
},
|
|
554
|
+
"attribute": "input",
|
|
555
|
+
"reflect": false,
|
|
556
|
+
"defaultValue": "false"
|
|
557
|
+
},
|
|
558
|
+
"step": {
|
|
559
|
+
"type": "string",
|
|
560
|
+
"mutable": false,
|
|
561
|
+
"complexType": {
|
|
562
|
+
"original": "string",
|
|
563
|
+
"resolved": "string",
|
|
564
|
+
"references": {}
|
|
565
|
+
},
|
|
566
|
+
"required": false,
|
|
567
|
+
"optional": false,
|
|
568
|
+
"docs": {
|
|
569
|
+
"tags": [],
|
|
570
|
+
"text": "Defines how much to increment/decrement the value when using controls"
|
|
571
|
+
},
|
|
572
|
+
"attribute": "step",
|
|
573
|
+
"reflect": false,
|
|
574
|
+
"defaultValue": "'1'"
|
|
575
|
+
},
|
|
576
|
+
"name": {
|
|
577
|
+
"type": "string",
|
|
578
|
+
"mutable": false,
|
|
579
|
+
"complexType": {
|
|
580
|
+
"original": "string",
|
|
581
|
+
"resolved": "string",
|
|
582
|
+
"references": {}
|
|
583
|
+
},
|
|
584
|
+
"required": false,
|
|
585
|
+
"optional": false,
|
|
586
|
+
"docs": {
|
|
587
|
+
"tags": [],
|
|
588
|
+
"text": "Name property (will be inherited by the native slider component)"
|
|
589
|
+
},
|
|
590
|
+
"attribute": "name",
|
|
591
|
+
"reflect": false,
|
|
592
|
+
"defaultValue": "''"
|
|
593
|
+
},
|
|
594
|
+
"scrubberSize": {
|
|
595
|
+
"type": "string",
|
|
596
|
+
"mutable": false,
|
|
597
|
+
"complexType": {
|
|
598
|
+
"original": "'sm' | 'lg'",
|
|
599
|
+
"resolved": "\"lg\" | \"sm\"",
|
|
600
|
+
"references": {}
|
|
601
|
+
},
|
|
602
|
+
"required": false,
|
|
603
|
+
"optional": false,
|
|
604
|
+
"docs": {
|
|
605
|
+
"tags": [],
|
|
606
|
+
"text": "Sets the size of the scrubber"
|
|
607
|
+
},
|
|
608
|
+
"attribute": "scrubber-size",
|
|
609
|
+
"reflect": false,
|
|
610
|
+
"defaultValue": "'lg'"
|
|
611
|
+
},
|
|
612
|
+
"snap": {
|
|
613
|
+
"type": "boolean",
|
|
614
|
+
"mutable": false,
|
|
615
|
+
"complexType": {
|
|
616
|
+
"original": "boolean",
|
|
617
|
+
"resolved": "boolean",
|
|
618
|
+
"references": {}
|
|
619
|
+
},
|
|
620
|
+
"required": false,
|
|
621
|
+
"optional": false,
|
|
622
|
+
"docs": {
|
|
623
|
+
"tags": [],
|
|
624
|
+
"text": "Snap to the ticks grid"
|
|
625
|
+
},
|
|
626
|
+
"attribute": "snap",
|
|
627
|
+
"reflect": false,
|
|
628
|
+
"defaultValue": "false"
|
|
629
|
+
},
|
|
630
|
+
"sliderId": {
|
|
631
|
+
"type": "string",
|
|
632
|
+
"mutable": false,
|
|
633
|
+
"complexType": {
|
|
634
|
+
"original": "string",
|
|
635
|
+
"resolved": "string",
|
|
636
|
+
"references": {}
|
|
637
|
+
},
|
|
638
|
+
"required": false,
|
|
639
|
+
"optional": false,
|
|
640
|
+
"docs": {
|
|
641
|
+
"tags": [],
|
|
642
|
+
"text": "Id for the sliders input element, randomly generated if not specified."
|
|
643
|
+
},
|
|
644
|
+
"attribute": "slider-id",
|
|
645
|
+
"reflect": false,
|
|
646
|
+
"defaultValue": "crypto.randomUUID()"
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
static get events() {
|
|
651
|
+
return [{
|
|
652
|
+
"method": "sddsChange",
|
|
653
|
+
"name": "sddsChange",
|
|
654
|
+
"bubbles": true,
|
|
655
|
+
"cancelable": true,
|
|
656
|
+
"composed": true,
|
|
657
|
+
"docs": {
|
|
658
|
+
"tags": [],
|
|
659
|
+
"text": "Sends the value of the slider when changed."
|
|
660
|
+
},
|
|
661
|
+
"complexType": {
|
|
662
|
+
"original": "{\n value: string;\n }",
|
|
663
|
+
"resolved": "{ value: string; }",
|
|
664
|
+
"references": {}
|
|
665
|
+
}
|
|
666
|
+
}];
|
|
667
|
+
}
|
|
668
|
+
static get methods() {
|
|
669
|
+
return {
|
|
670
|
+
"reset": {
|
|
671
|
+
"complexType": {
|
|
672
|
+
"signature": "() => Promise<void>",
|
|
673
|
+
"parameters": [],
|
|
674
|
+
"references": {
|
|
675
|
+
"Promise": {
|
|
676
|
+
"location": "global"
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
"return": "Promise<void>"
|
|
680
|
+
},
|
|
681
|
+
"docs": {
|
|
682
|
+
"text": "Public method to re-initialise the slider if some configuration props are changed",
|
|
683
|
+
"tags": []
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
static get listeners() {
|
|
689
|
+
return [{
|
|
690
|
+
"name": "keydown",
|
|
691
|
+
"method": "handleKeydown",
|
|
692
|
+
"target": undefined,
|
|
693
|
+
"capture": false,
|
|
694
|
+
"passive": false
|
|
695
|
+
}, {
|
|
696
|
+
"name": "mouseup",
|
|
697
|
+
"method": "handleMouseUp",
|
|
698
|
+
"target": "window",
|
|
699
|
+
"capture": false,
|
|
700
|
+
"passive": true
|
|
701
|
+
}, {
|
|
702
|
+
"name": "touchend",
|
|
703
|
+
"method": "handleTouchEnd",
|
|
704
|
+
"target": "window",
|
|
705
|
+
"capture": false,
|
|
706
|
+
"passive": true
|
|
707
|
+
}, {
|
|
708
|
+
"name": "mousemove",
|
|
709
|
+
"method": "handleMouseMove",
|
|
710
|
+
"target": "window",
|
|
711
|
+
"capture": false,
|
|
712
|
+
"passive": true
|
|
713
|
+
}, {
|
|
714
|
+
"name": "touchmove",
|
|
715
|
+
"method": "handleTouchMove",
|
|
716
|
+
"target": "window",
|
|
717
|
+
"capture": false,
|
|
718
|
+
"passive": true
|
|
719
|
+
}];
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
//# sourceMappingURL=slider.js.map
|