@statistikzh/leu 0.24.2 → 0.26.0
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/.release-please-manifest.json +1 -1
- package/.storybook/main.ts +18 -53
- package/.storybook/manager.ts +1 -4
- package/.storybook/preview.ts +23 -16
- package/.storybook/theme.ts +1 -1
- package/CHANGELOG.md +21 -0
- package/CONTRIBUTING.md +19 -8
- package/dist/Accordion-B04QkmHz.js +241 -0
- package/dist/Accordion.d.ts +44 -44
- package/dist/Accordion.js +2 -249
- package/dist/Button-BgNUxmo_.d.ts +99 -0
- package/dist/Button-BkhqVjug.js +564 -0
- package/dist/Button.d.ts +2 -85
- package/dist/Button.js +5 -504
- package/dist/ButtonGroup-B8U9fDvM.js +88 -0
- package/dist/ButtonGroup.d.ts +19 -19
- package/dist/ButtonGroup.js +6 -101
- package/dist/ChartWrapper-CSMFwz9e.js +158 -0
- package/dist/ChartWrapper.d.ts +26 -26
- package/dist/ChartWrapper.js +3 -163
- package/dist/Checkbox-Dd1QLpfn.js +198 -0
- package/dist/Checkbox.d.ts +35 -27
- package/dist/Checkbox.js +4 -157
- package/dist/CheckboxGroup-Bz2eWEFL.js +81 -0
- package/dist/CheckboxGroup.d.ts +18 -18
- package/dist/CheckboxGroup.js +5 -82
- package/dist/Chip-DLKM9P7v.d.ts +18 -0
- package/dist/Chip-XAQIIsXq.js +171 -0
- package/dist/Chip.d.ts +2 -18
- package/dist/Chip.js +2 -166
- package/dist/ChipGroup-DLqfK2kn.js +125 -0
- package/dist/ChipGroup-Ta8Ht4jc.d.ts +42 -0
- package/dist/ChipGroup.d.ts +2 -43
- package/dist/ChipGroup.js +3 -132
- package/dist/ChipLink-BAxyQO2M.d.ts +17 -0
- package/dist/ChipLink.d.ts +2 -18
- package/dist/ChipLink.js +28 -28
- package/dist/ChipRemovable-DBjwt0CH.d.ts +25 -0
- package/dist/ChipRemovable.d.ts +2 -26
- package/dist/ChipRemovable.js +42 -43
- package/dist/ChipSelectable-CMJNcE4U.d.ts +32 -0
- package/dist/ChipSelectable.d.ts +2 -33
- package/dist/ChipSelectable.js +63 -72
- package/dist/Dialog-DHuXR_oo.js +241 -0
- package/dist/Dialog.d.ts +28 -28
- package/dist/Dialog.js +3 -240
- package/dist/Dropdown-DtFTePbc.js +155 -0
- package/dist/Dropdown.d.ts +39 -41
- package/dist/Dropdown.js +9 -157
- package/dist/FileInput-b8sbLDPI.js +344 -0
- package/dist/FileInput.d.ts +56 -57
- package/dist/FileInput.js +7 -383
- package/dist/FormAssociatedMixin-Cc74LjbC.d.ts +22 -0
- package/dist/FormAssociatedMixin-DLPvFtbT.js +58 -0
- package/dist/Icon-C_yYuynf.js +186 -0
- package/dist/Icon-Op80LrrO.d.ts +151 -0
- package/dist/Icon.d.ts +2 -4
- package/dist/Icon.js +2 -188
- package/dist/Input-D2THgo7c.d.ts +169 -0
- package/dist/Input-DEOVocTa.js +610 -0
- package/dist/Input.d.ts +2 -166
- package/dist/Input.js +4 -626
- package/dist/LeuElement-BeFrgKes.js +46 -0
- package/dist/LeuElement-pJFU18Xm.d.ts +11 -0
- package/dist/Menu-BeqqtCw6.js +136 -0
- package/dist/Menu-CQdx1ef3.d.ts +43 -0
- package/dist/Menu.d.ts +2 -44
- package/dist/Menu.js +4 -157
- package/dist/MenuItem-DVg8-1Bq.js +219 -0
- package/dist/MenuItem-QcgnRk_7.d.ts +63 -0
- package/dist/MenuItem.d.ts +2 -64
- package/dist/MenuItem.js +3 -227
- package/dist/Message-BhknWvAF.js +252 -0
- package/dist/Message.d.ts +53 -53
- package/dist/Message.js +3 -267
- package/dist/Pagination-CqkHh-Vd.d.ts +76 -0
- package/dist/Pagination-DJI5MIi_.js +226 -0
- package/dist/Pagination.d.ts +2 -76
- package/dist/Pagination.js +7 -240
- package/dist/Placeholder-BJybFwSg.js +95 -0
- package/dist/Placeholder.d.ts +15 -15
- package/dist/Placeholder.js +2 -89
- package/dist/Popup-Btgm2a3D.d.ts +61 -0
- package/dist/Popup-DNlm_9AA.js +195 -0
- package/dist/Popup.d.ts +2 -62
- package/dist/Popup.js +2 -233
- package/dist/ProgressBar-B0wYj1KF.js +167 -0
- package/dist/ProgressBar.d.ts +21 -21
- package/dist/ProgressBar.js +2 -165
- package/dist/Radio-DMCL8c4D.js +160 -0
- package/dist/Radio.d.ts +22 -22
- package/dist/Radio.js +2 -151
- package/dist/RadioGroup-CM6IyBlq.js +171 -0
- package/dist/RadioGroup.d.ts +35 -35
- package/dist/RadioGroup.js +3 -182
- package/dist/Range-B72rtfln.js +496 -0
- package/dist/Range.d.ts +112 -112
- package/dist/Range.js +2 -586
- package/dist/ScrollTop-BFAqBVDR.js +130 -0
- package/dist/ScrollTop.d.ts +21 -21
- package/dist/ScrollTop.js +6 -134
- package/dist/Select-vxl3BvD4.js +618 -0
- package/dist/Select.d.ts +130 -132
- package/dist/Select.js +10 -675
- package/dist/Spinner-CrM1enM0.d.ts +14 -0
- package/dist/Spinner-DDTqijTO.js +56 -0
- package/dist/Spinner.d.ts +2 -14
- package/dist/Spinner.js +2 -52
- package/dist/Table-BgCxfBcm.js +392 -0
- package/dist/Table.d.ts +61 -63
- package/dist/Table.js +8 -427
- package/dist/Tag-DK2KkPIQ.js +76 -0
- package/dist/Tag.d.ts +8 -8
- package/dist/Tag.js +2 -74
- package/dist/VisuallyHidden-OeQvhxYn.d.ts +13 -0
- package/dist/VisuallyHidden-pll3amXE.js +29 -0
- package/dist/VisuallyHidden.d.ts +2 -13
- package/dist/VisuallyHidden.js +2 -25
- package/dist/decorate-DwpAc4D0.js +9 -0
- package/dist/hasSlotController-DSBCVzPD.js +38 -0
- package/dist/hasSlotController-DWPyZ52b.d.ts +19 -0
- package/dist/index.d.ts +33 -30
- package/dist/index.js +35 -45
- package/dist/leu-accordion.d.ts +7 -10
- package/dist/leu-accordion.js +4 -8
- package/dist/leu-button-group.d.ts +7 -10
- package/dist/leu-button-group.js +8 -12
- package/dist/leu-button.d.ts +7 -11
- package/dist/leu-button.js +7 -11
- package/dist/leu-chart-wrapper.d.ts +7 -12
- package/dist/leu-chart-wrapper.js +5 -9
- package/dist/leu-checkbox-group.d.ts +7 -10
- package/dist/leu-checkbox-group.js +7 -10
- package/dist/leu-checkbox.d.ts +7 -11
- package/dist/leu-checkbox.js +6 -8
- package/dist/leu-chip-group.d.ts +7 -12
- package/dist/leu-chip-group.js +5 -10
- package/dist/leu-chip-link.d.ts +7 -11
- package/dist/leu-chip-link.js +5 -8
- package/dist/leu-chip-removable.d.ts +7 -12
- package/dist/leu-chip-removable.js +6 -9
- package/dist/leu-chip-selectable.d.ts +7 -11
- package/dist/leu-chip-selectable.js +5 -8
- package/dist/leu-dialog.d.ts +7 -13
- package/dist/leu-dialog.js +5 -11
- package/dist/leu-dropdown.d.ts +7 -18
- package/dist/leu-dropdown.js +11 -17
- package/dist/leu-file-input.d.ts +7 -13
- package/dist/leu-file-input.js +9 -13
- package/dist/leu-icon.d.ts +7 -10
- package/dist/leu-icon.js +4 -7
- package/dist/leu-input.d.ts +7 -12
- package/dist/leu-input.js +6 -12
- package/dist/leu-menu-item.d.ts +7 -11
- package/dist/leu-menu-item.js +5 -9
- package/dist/leu-menu.d.ts +7 -12
- package/dist/leu-menu.js +6 -10
- package/dist/leu-message.d.ts +7 -11
- package/dist/leu-message.js +5 -10
- package/dist/leu-pagination.d.ts +7 -13
- package/dist/leu-pagination.js +9 -14
- package/dist/leu-placeholder.d.ts +7 -10
- package/dist/leu-placeholder.js +4 -5
- package/dist/leu-popup.d.ts +7 -11
- package/dist/leu-popup.js +4 -8
- package/dist/leu-progress-bar.d.ts +7 -10
- package/dist/leu-progress-bar.js +4 -8
- package/dist/leu-radio-group.d.ts +7 -10
- package/dist/leu-radio-group.js +5 -9
- package/dist/leu-radio.d.ts +7 -10
- package/dist/leu-radio.js +4 -7
- package/dist/leu-range.d.ts +7 -10
- package/dist/leu-range.js +4 -9
- package/dist/leu-scroll-top.d.ts +7 -12
- package/dist/leu-scroll-top.js +8 -13
- package/dist/leu-select.d.ts +7 -19
- package/dist/leu-select.js +12 -19
- package/dist/leu-spinner.d.ts +7 -10
- package/dist/leu-spinner.js +4 -5
- package/dist/leu-table.d.ts +7 -14
- package/dist/leu-table.js +10 -17
- package/dist/leu-tag.d.ts +7 -10
- package/dist/leu-tag.js +4 -7
- package/dist/leu-visually-hidden.d.ts +7 -10
- package/dist/leu-visually-hidden.js +4 -5
- package/dist/utils-hfk5Nwy8.js +28 -0
- package/dist/vscode.html-custom-data.json +7 -8
- package/dist/vue/index.d.ts +5 -9
- package/dist/web-types.json +18 -24
- package/eslint.config.mjs +79 -0
- package/package.json +44 -60
- package/scripts/generate-component/templates/stories/[name].stories.ts +1 -1
- package/src/components/accordion/Accordion.ts +1 -1
- package/src/components/button/Button.ts +76 -5
- package/src/components/button/button.css +37 -9
- package/src/components/button/stories/button.stories.ts +23 -0
- package/src/components/button/test/button.test.ts +214 -9
- package/src/components/button-group/ButtonGroup.ts +1 -6
- package/src/components/button-group/stories/button-group.stories.ts +1 -1
- package/src/components/chart-wrapper/ChartWrapper.ts +1 -1
- package/src/components/chart-wrapper/stories/chart-wrapper.stories.ts +1 -1
- package/src/components/checkbox/Checkbox.ts +76 -12
- package/src/components/checkbox/CheckboxGroup.ts +1 -1
- package/src/components/checkbox/checkbox.css +4 -0
- package/src/components/checkbox/stories/checkbox.stories.ts +26 -3
- package/src/components/checkbox/test/checkbox.test.ts +147 -3
- package/src/components/chip/Chip.ts +1 -1
- package/src/components/chip/ChipGroup.ts +2 -2
- package/src/components/chip/stories/chip-removable.stories.ts +1 -1
- package/src/components/chip/test/chip-removable.test.ts +2 -2
- package/src/components/dialog/Dialog.ts +1 -1
- package/src/components/dialog/stories/dialog.stories.ts +0 -2
- package/src/components/dropdown/Dropdown.ts +1 -1
- package/src/components/dropdown/stories/dropdown.stories.ts +1 -1
- package/src/components/file-input/FileInput.ts +18 -20
- package/src/components/file-input/stories/file-input.stories.ts +2 -2
- package/src/components/file-input/test/file-input.test.ts +14 -1
- package/src/components/icon/Icon.ts +1 -1
- package/src/components/input/Input.ts +18 -7
- package/src/components/input/stories/input.stories.ts +24 -21
- package/src/components/menu/Menu.ts +4 -4
- package/src/components/menu/MenuItem.ts +1 -1
- package/src/components/menu/stories/menu-item.stories.ts +0 -2
- package/src/components/message/Message.ts +1 -1
- package/src/components/message/stories/message.stories.ts +2 -2
- package/src/components/pagination/Pagination.ts +1 -1
- package/src/components/pagination/stories/pagination.stories.ts +3 -3
- package/src/components/pagination/test/pagination.test.ts +1 -1
- package/src/components/placeholder/Placeholder.ts +1 -1
- package/src/components/placeholder/stories/placeholder.stories.ts +1 -1
- package/src/components/popup/Popup.ts +1 -1
- package/src/components/progress-bar/ProgressBar.ts +1 -1
- package/src/components/progress-bar/stories/progress-bar.stories.ts +1 -1
- package/src/components/radio/Radio.ts +1 -1
- package/src/components/radio/RadioGroup.ts +5 -5
- package/src/components/range/Range.ts +1 -1
- package/src/components/range/stories/range.stories.ts +2 -2
- package/src/components/scroll-top/ScrollTop.ts +1 -1
- package/src/components/select/Select.ts +2 -5
- package/src/components/spinner/Spinner.ts +1 -1
- package/src/components/table/Table.ts +1 -1
- package/src/components/tag/Tag.ts +1 -1
- package/src/components/tag/stories/tag.stories.ts +1 -1
- package/src/components/visually-hidden/VisuallyHidden.ts +1 -1
- package/src/docs/contributing.mdx +1 -1
- package/src/docs/installation.mdx +1 -1
- package/src/docs/theme.mdx +1 -1
- package/src/docs/usage.mdx +1 -1
- package/src/global.d.ts +1 -1
- package/src/lib/LeuElement.ts +1 -1
- package/src/lib/mixins/FormAssociatedMixin.ts +115 -0
- package/src/lib/styleMap.ts +1 -1
- package/tsdown.config.ts +35 -0
- package/web-test-runner.config.mjs +20 -2
- package/.eslintrc.json +0 -57
- package/dist/Icon.d-itcQ94ym.d.ts +0 -151
- package/dist/LeuElement-BfXSO7MN.js +0 -42
- package/dist/LeuElement.d-BevHqLUu.d.ts +0 -10
- package/dist/_tslib-CNEFicEt.js +0 -30
- package/dist/components/accordion/Accordion.d.ts +0 -49
- package/dist/components/accordion/Accordion.d.ts.map +0 -1
- package/dist/components/accordion/leu-accordion.d.ts +0 -8
- package/dist/components/accordion/leu-accordion.d.ts.map +0 -1
- package/dist/components/accordion/stories/accordion.stories.d.ts +0 -26
- package/dist/components/accordion/stories/accordion.stories.d.ts.map +0 -1
- package/dist/components/accordion/test/accordion.test.d.ts +0 -2
- package/dist/components/accordion/test/accordion.test.d.ts.map +0 -1
- package/dist/components/button/Button.d.ts +0 -81
- package/dist/components/button/Button.d.ts.map +0 -1
- package/dist/components/button/leu-button.d.ts +0 -8
- package/dist/components/button/leu-button.d.ts.map +0 -1
- package/dist/components/button/stories/button.stories.d.ts +0 -19
- package/dist/components/button/stories/button.stories.d.ts.map +0 -1
- package/dist/components/button/test/button.test.d.ts +0 -3
- package/dist/components/button/test/button.test.d.ts.map +0 -1
- package/dist/components/button-group/ButtonGroup.d.ts +0 -25
- package/dist/components/button-group/ButtonGroup.d.ts.map +0 -1
- package/dist/components/button-group/leu-button-group.d.ts +0 -8
- package/dist/components/button-group/leu-button-group.d.ts.map +0 -1
- package/dist/components/button-group/stories/button-group.stories.d.ts +0 -15
- package/dist/components/button-group/stories/button-group.stories.d.ts.map +0 -1
- package/dist/components/button-group/test/button-group.test.d.ts +0 -3
- package/dist/components/button-group/test/button-group.test.d.ts.map +0 -1
- package/dist/components/chart-wrapper/ChartWrapper.d.ts +0 -34
- package/dist/components/chart-wrapper/ChartWrapper.d.ts.map +0 -1
- package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +0 -8
- package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +0 -1
- package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts +0 -47
- package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts.map +0 -1
- package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts +0 -2
- package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +0 -1
- package/dist/components/checkbox/Checkbox.d.ts +0 -28
- package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/CheckboxGroup.d.ts +0 -22
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +0 -1
- package/dist/components/checkbox/leu-checkbox-group.d.ts +0 -8
- package/dist/components/checkbox/leu-checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox/leu-checkbox.d.ts +0 -8
- package/dist/components/checkbox/leu-checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts +0 -29
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts.map +0 -1
- package/dist/components/checkbox/stories/checkbox.stories.d.ts +0 -22
- package/dist/components/checkbox/stories/checkbox.stories.d.ts.map +0 -1
- package/dist/components/checkbox/test/checkbox-group.test.d.ts +0 -3
- package/dist/components/checkbox/test/checkbox-group.test.d.ts.map +0 -1
- package/dist/components/checkbox/test/checkbox.test.d.ts +0 -2
- package/dist/components/checkbox/test/checkbox.test.d.ts.map +0 -1
- package/dist/components/chip/Chip.d.ts +0 -15
- package/dist/components/chip/Chip.d.ts.map +0 -1
- package/dist/components/chip/ChipGroup.d.ts +0 -38
- package/dist/components/chip/ChipGroup.d.ts.map +0 -1
- package/dist/components/chip/ChipLink.d.ts +0 -13
- package/dist/components/chip/ChipLink.d.ts.map +0 -1
- package/dist/components/chip/ChipRemovable.d.ts +0 -21
- package/dist/components/chip/ChipRemovable.d.ts.map +0 -1
- package/dist/components/chip/ChipSelectable.d.ts +0 -28
- package/dist/components/chip/ChipSelectable.d.ts.map +0 -1
- package/dist/components/chip/exports.d.ts +0 -5
- package/dist/components/chip/exports.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-group.d.ts +0 -8
- package/dist/components/chip/leu-chip-group.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-link.d.ts +0 -8
- package/dist/components/chip/leu-chip-link.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-removable.d.ts +0 -8
- package/dist/components/chip/leu-chip-removable.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-selectable.d.ts +0 -8
- package/dist/components/chip/leu-chip-selectable.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-group.stories.d.ts +0 -40
- package/dist/components/chip/stories/chip-group.stories.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-link.stories.d.ts +0 -27
- package/dist/components/chip/stories/chip-link.stories.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-removable.stories.d.ts +0 -21
- package/dist/components/chip/stories/chip-removable.stories.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-selectable.stories.d.ts +0 -35
- package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +0 -1
- package/dist/components/chip/test/chip-group.test.d.ts +0 -4
- package/dist/components/chip/test/chip-group.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip-link.test.d.ts +0 -2
- package/dist/components/chip/test/chip-link.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip-removable.test.d.ts +0 -2
- package/dist/components/chip/test/chip-removable.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip-selectable.test.d.ts +0 -2
- package/dist/components/chip/test/chip-selectable.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip.test.d.ts +0 -2
- package/dist/components/chip/test/chip.test.d.ts.map +0 -1
- package/dist/components/dialog/Dialog.d.ts +0 -29
- package/dist/components/dialog/Dialog.d.ts.map +0 -1
- package/dist/components/dialog/leu-dialog.d.ts +0 -8
- package/dist/components/dialog/leu-dialog.d.ts.map +0 -1
- package/dist/components/dialog/stories/dialog.stories.d.ts +0 -19
- package/dist/components/dialog/stories/dialog.stories.d.ts.map +0 -1
- package/dist/components/dialog/test/dialog.test.d.ts +0 -2
- package/dist/components/dialog/test/dialog.test.d.ts.map +0 -1
- package/dist/components/dropdown/Dropdown.d.ts +0 -40
- package/dist/components/dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/leu-dropdown.d.ts +0 -8
- package/dist/components/dropdown/leu-dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/stories/dropdown.stories.d.ts +0 -25
- package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +0 -1
- package/dist/components/dropdown/test/dropdown.test.d.ts +0 -2
- package/dist/components/dropdown/test/dropdown.test.d.ts.map +0 -1
- package/dist/components/file-input/FileInput.d.ts +0 -62
- package/dist/components/file-input/FileInput.d.ts.map +0 -1
- package/dist/components/file-input/leu-file-input.d.ts +0 -8
- package/dist/components/file-input/leu-file-input.d.ts.map +0 -1
- package/dist/components/file-input/stories/file-input.stories.d.ts +0 -34
- package/dist/components/file-input/stories/file-input.stories.d.ts.map +0 -1
- package/dist/components/file-input/test/file-input.test.d.ts +0 -2
- package/dist/components/file-input/test/file-input.test.d.ts.map +0 -1
- package/dist/components/icon/Icon.d.ts +0 -20
- package/dist/components/icon/Icon.d.ts.map +0 -1
- package/dist/components/icon/leu-icon.d.ts +0 -8
- package/dist/components/icon/leu-icon.d.ts.map +0 -1
- package/dist/components/icon/paths.d.ts +0 -127
- package/dist/components/icon/paths.d.ts.map +0 -1
- package/dist/components/icon/stories/icon.stories.d.ts +0 -32
- package/dist/components/icon/stories/icon.stories.d.ts.map +0 -1
- package/dist/components/icon/test/icon.test.d.ts +0 -2
- package/dist/components/icon/test/icon.test.d.ts.map +0 -1
- package/dist/components/input/Input.d.ts +0 -163
- package/dist/components/input/Input.d.ts.map +0 -1
- package/dist/components/input/leu-input.d.ts +0 -8
- package/dist/components/input/leu-input.d.ts.map +0 -1
- package/dist/components/input/stories/input.stories.d.ts +0 -35
- package/dist/components/input/stories/input.stories.d.ts.map +0 -1
- package/dist/components/input/test/input.test.d.ts +0 -2
- package/dist/components/input/test/input.test.d.ts.map +0 -1
- package/dist/components/menu/Menu.d.ts +0 -39
- package/dist/components/menu/Menu.d.ts.map +0 -1
- package/dist/components/menu/MenuItem.d.ts +0 -61
- package/dist/components/menu/MenuItem.d.ts.map +0 -1
- package/dist/components/menu/leu-menu-item.d.ts +0 -8
- package/dist/components/menu/leu-menu-item.d.ts.map +0 -1
- package/dist/components/menu/leu-menu.d.ts +0 -8
- package/dist/components/menu/leu-menu.d.ts.map +0 -1
- package/dist/components/menu/stories/menu-item.stories.d.ts +0 -24
- package/dist/components/menu/stories/menu-item.stories.d.ts.map +0 -1
- package/dist/components/menu/stories/menu.stories.d.ts +0 -26
- package/dist/components/menu/stories/menu.stories.d.ts.map +0 -1
- package/dist/components/menu/test/menu-item.test.d.ts +0 -3
- package/dist/components/menu/test/menu-item.test.d.ts.map +0 -1
- package/dist/components/menu/test/menu.test.d.ts +0 -4
- package/dist/components/menu/test/menu.test.d.ts.map +0 -1
- package/dist/components/message/Message.d.ts +0 -59
- package/dist/components/message/Message.d.ts.map +0 -1
- package/dist/components/message/leu-message.d.ts +0 -8
- package/dist/components/message/leu-message.d.ts.map +0 -1
- package/dist/components/message/stories/message.stories.d.ts +0 -179
- package/dist/components/message/stories/message.stories.d.ts.map +0 -1
- package/dist/components/message/test/message.test.d.ts +0 -2
- package/dist/components/message/test/message.test.d.ts.map +0 -1
- package/dist/components/pagination/Pagination.d.ts +0 -72
- package/dist/components/pagination/Pagination.d.ts.map +0 -1
- package/dist/components/pagination/leu-pagination.d.ts +0 -8
- package/dist/components/pagination/leu-pagination.d.ts.map +0 -1
- package/dist/components/pagination/stories/pagination.stories.d.ts +0 -25
- package/dist/components/pagination/stories/pagination.stories.d.ts.map +0 -1
- package/dist/components/pagination/test/pagination.test.d.ts +0 -2
- package/dist/components/pagination/test/pagination.test.d.ts.map +0 -1
- package/dist/components/placeholder/Placeholder.d.ts +0 -23
- package/dist/components/placeholder/Placeholder.d.ts.map +0 -1
- package/dist/components/placeholder/leu-placeholder.d.ts +0 -8
- package/dist/components/placeholder/leu-placeholder.d.ts.map +0 -1
- package/dist/components/placeholder/stories/placeholder.stories.d.ts +0 -27
- package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +0 -1
- package/dist/components/placeholder/test/placeholder.test.d.ts +0 -2
- package/dist/components/placeholder/test/placeholder.test.d.ts.map +0 -1
- package/dist/components/popup/Popup.d.ts +0 -57
- package/dist/components/popup/Popup.d.ts.map +0 -1
- package/dist/components/popup/leu-popup.d.ts +0 -8
- package/dist/components/popup/leu-popup.d.ts.map +0 -1
- package/dist/components/popup/stories/popup.stories.d.ts +0 -28
- package/dist/components/popup/stories/popup.stories.d.ts.map +0 -1
- package/dist/components/popup/test/popup.test.d.ts +0 -2
- package/dist/components/popup/test/popup.test.d.ts.map +0 -1
- package/dist/components/progress-bar/ProgressBar.d.ts +0 -25
- package/dist/components/progress-bar/ProgressBar.d.ts.map +0 -1
- package/dist/components/progress-bar/leu-progress-bar.d.ts +0 -8
- package/dist/components/progress-bar/leu-progress-bar.d.ts.map +0 -1
- package/dist/components/progress-bar/stories/progress-bar.stories.d.ts +0 -48
- package/dist/components/progress-bar/stories/progress-bar.stories.d.ts.map +0 -1
- package/dist/components/progress-bar/test/progress-bar.test.d.ts +0 -2
- package/dist/components/progress-bar/test/progress-bar.test.d.ts.map +0 -1
- package/dist/components/radio/Radio.d.ts +0 -24
- package/dist/components/radio/Radio.d.ts.map +0 -1
- package/dist/components/radio/RadioGroup.d.ts +0 -39
- package/dist/components/radio/RadioGroup.d.ts.map +0 -1
- package/dist/components/radio/leu-radio-group.d.ts +0 -8
- package/dist/components/radio/leu-radio-group.d.ts.map +0 -1
- package/dist/components/radio/leu-radio.d.ts +0 -8
- package/dist/components/radio/leu-radio.d.ts.map +0 -1
- package/dist/components/radio/stories/radio-group.stories.d.ts +0 -29
- package/dist/components/radio/stories/radio-group.stories.d.ts.map +0 -1
- package/dist/components/radio/stories/radio.stories.d.ts +0 -22
- package/dist/components/radio/stories/radio.stories.d.ts.map +0 -1
- package/dist/components/radio/test/radio-group.test.d.ts +0 -3
- package/dist/components/radio/test/radio-group.test.d.ts.map +0 -1
- package/dist/components/radio/test/radio.test.d.ts +0 -2
- package/dist/components/radio/test/radio.test.d.ts.map +0 -1
- package/dist/components/range/Range.d.ts +0 -116
- package/dist/components/range/Range.d.ts.map +0 -1
- package/dist/components/range/leu-range.d.ts +0 -8
- package/dist/components/range/leu-range.d.ts.map +0 -1
- package/dist/components/range/stories/range.stories.d.ts +0 -231
- package/dist/components/range/stories/range.stories.d.ts.map +0 -1
- package/dist/components/range/test/range.test.d.ts +0 -2
- package/dist/components/range/test/range.test.d.ts.map +0 -1
- package/dist/components/scroll-top/ScrollTop.d.ts +0 -23
- package/dist/components/scroll-top/ScrollTop.d.ts.map +0 -1
- package/dist/components/scroll-top/leu-scroll-top.d.ts +0 -8
- package/dist/components/scroll-top/leu-scroll-top.d.ts.map +0 -1
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts +0 -8
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts.map +0 -1
- package/dist/components/scroll-top/test/scroll-top.test.d.ts +0 -2
- package/dist/components/scroll-top/test/scroll-top.test.d.ts.map +0 -1
- package/dist/components/select/Select.d.ts +0 -145
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/leu-select.d.ts +0 -8
- package/dist/components/select/leu-select.d.ts.map +0 -1
- package/dist/components/select/stories/select.stories.d.ts +0 -23
- package/dist/components/select/stories/select.stories.d.ts.map +0 -1
- package/dist/components/select/test/fixtures.d.ts +0 -2
- package/dist/components/select/test/fixtures.d.ts.map +0 -1
- package/dist/components/select/test/select.test.d.ts +0 -3
- package/dist/components/select/test/select.test.d.ts.map +0 -1
- package/dist/components/spinner/Spinner.d.ts +0 -10
- package/dist/components/spinner/Spinner.d.ts.map +0 -1
- package/dist/components/spinner/leu-spinner.d.ts +0 -8
- package/dist/components/spinner/leu-spinner.d.ts.map +0 -1
- package/dist/components/spinner/stories/spinner.stories.d.ts +0 -16
- package/dist/components/spinner/stories/spinner.stories.d.ts.map +0 -1
- package/dist/components/spinner/test/spinner.test.d.ts +0 -2
- package/dist/components/spinner/test/spinner.test.d.ts.map +0 -1
- package/dist/components/table/Table.d.ts +0 -65
- package/dist/components/table/Table.d.ts.map +0 -1
- package/dist/components/table/leu-table.d.ts +0 -8
- package/dist/components/table/leu-table.d.ts.map +0 -1
- package/dist/components/table/stories/table.stories.d.ts +0 -15
- package/dist/components/table/stories/table.stories.d.ts.map +0 -1
- package/dist/components/table/test/table.test.d.ts +0 -2
- package/dist/components/table/test/table.test.d.ts.map +0 -1
- package/dist/components/tag/Tag.d.ts +0 -13
- package/dist/components/tag/Tag.d.ts.map +0 -1
- package/dist/components/tag/leu-tag.d.ts +0 -8
- package/dist/components/tag/leu-tag.d.ts.map +0 -1
- package/dist/components/tag/stories/tag.stories.d.ts +0 -136
- package/dist/components/tag/stories/tag.stories.d.ts.map +0 -1
- package/dist/components/tag/test/tag.test.d.ts +0 -2
- package/dist/components/tag/test/tag.test.d.ts.map +0 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +0 -9
- package/dist/components/visually-hidden/VisuallyHidden.d.ts.map +0 -1
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts +0 -8
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts.map +0 -1
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts +0 -13
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts.map +0 -1
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts +0 -2
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts.map +0 -1
- package/dist/hasSlotController-Bm2tipvG.js +0 -53
- package/dist/hasSlotController.d-emXwVXWF.d.ts +0 -23
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/LeuElement.d.ts +0 -8
- package/dist/lib/LeuElement.d.ts.map +0 -1
- package/dist/lib/a11y.d.ts +0 -11
- package/dist/lib/a11y.d.ts.map +0 -1
- package/dist/lib/hasSlotController.d.ts +0 -20
- package/dist/lib/hasSlotController.d.ts.map +0 -1
- package/dist/lib/styleMap.d.ts +0 -61
- package/dist/lib/styleMap.d.ts.map +0 -1
- package/dist/lib/utils.d.ts +0 -23
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/styles/style.stories.d.ts +0 -6
- package/dist/styles/style.stories.d.ts.map +0 -1
- package/dist/utils-DBGsNSJW.js +0 -33
- package/rollup.config.js +0 -94
- package/web-dev-server.config.mjs +0 -30
package/dist/Range.js
CHANGED
|
@@ -1,587 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { property, query } from 'lit/decorators.js';
|
|
4
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-BfXSO7MN.js';
|
|
6
|
-
import { i as isNumber, c as clamp } from './utils-DBGsNSJW.js';
|
|
7
|
-
|
|
8
|
-
var css_248z = css`:host {
|
|
9
|
-
--range-color: var(--leu-color-black-40);
|
|
10
|
-
--range-color-disabled: var(--leu-color-black-20);
|
|
11
|
-
--range-color-focus: var(--leu-color-func-cyan);
|
|
12
|
-
|
|
13
|
-
--range-track-background-color: var(--leu-color-black-10);
|
|
14
|
-
--range-track-height: 4px;
|
|
15
|
-
--range-track-radius: var(--range-track-height);
|
|
16
|
-
|
|
17
|
-
--range-track-value-color: var(--leu-color-func-cyan);
|
|
18
|
-
--range-track-value-width: 0;
|
|
19
|
-
--range-track-value-min: 0;
|
|
20
|
-
|
|
21
|
-
--range-thumb-color: var(--leu-color-black-0);
|
|
22
|
-
--range-thumb-border-color: var(--range-color);
|
|
23
|
-
--range-thumb-hover-border-color: var(--leu-color-black-100);
|
|
24
|
-
--range-thumb-diameter: 32px;
|
|
25
|
-
|
|
26
|
-
--range-value-color: var(--leu-color-black-100);
|
|
27
|
-
--range-value-color-disabled: var(--range-color-disabled);
|
|
28
|
-
|
|
29
|
-
--range-font-regular: var(--leu-font-family-regular);
|
|
30
|
-
--range-font-black: var(--leu-font-family-black);
|
|
31
|
-
|
|
32
|
-
display: block;
|
|
33
|
-
|
|
34
|
-
font-family: var(--range-font-regular);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([disabled]) {
|
|
38
|
-
--range-track-background: var(--range-color-disabled);
|
|
39
|
-
--range-track-value-color: var(--range-color-disabled);
|
|
40
|
-
--range-thumb-border-color: var(--range-color-disabled);
|
|
41
|
-
--range-thumb-hover-border-color: var(--range-color-disabled);
|
|
42
|
-
--range-value-color: var(--range-value-color-disabled);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.container {
|
|
46
|
-
position: relative;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.label {
|
|
50
|
-
display: inline-block;
|
|
51
|
-
margin-bottom: 0.5rem;
|
|
52
|
-
color: var(--leu-color-black-100);
|
|
53
|
-
font: var(--leu-t-regular-regular-font);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host([hide-label]) .label {
|
|
57
|
-
clip: rect(0 0 0 0);
|
|
58
|
-
border: 0;
|
|
59
|
-
height: 1px;
|
|
60
|
-
margin: -1px !important;
|
|
61
|
-
overflow: hidden;
|
|
62
|
-
padding: 0 !important;
|
|
63
|
-
position: absolute;
|
|
64
|
-
width: 1px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.outputs {
|
|
68
|
-
position: relative;
|
|
69
|
-
height: 1.5rem;
|
|
70
|
-
margin-bottom: 0.25rem;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.output {
|
|
74
|
-
position: absolute;
|
|
75
|
-
|
|
76
|
-
text-align: center;
|
|
77
|
-
font: var(--leu-t-tiny-black-font);
|
|
78
|
-
color: var(--range-value-color);
|
|
79
|
-
|
|
80
|
-
min-width: var(--range-thumb-diameter);
|
|
81
|
-
|
|
82
|
-
--_stop: calc(100% - var(--range-thumb-diameter));
|
|
83
|
-
--_start: 0%;
|
|
84
|
-
|
|
85
|
-
left: calc(var(--value) * (var(--_stop) - 0%) + 0%);
|
|
86
|
-
|
|
87
|
-
left: calc(var(--value) * (var(--_stop) - var(--_start)) + var(--_start));
|
|
88
|
-
transform: translateX(calc(-50% + var(--range-thumb-diameter) / 2));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.inputs {
|
|
92
|
-
position: relative;
|
|
93
|
-
z-index: 1;
|
|
94
|
-
height: var(--range-thumb-diameter);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.range {
|
|
98
|
-
-webkit-appearance: none;
|
|
99
|
-
-moz-appearance: none;
|
|
100
|
-
appearance: none;
|
|
101
|
-
width: 100%;
|
|
102
|
-
height: var(--range-thumb-diameter);
|
|
103
|
-
padding: 0;
|
|
104
|
-
margin: 0;
|
|
105
|
-
background: transparent;
|
|
106
|
-
|
|
107
|
-
--_track-background: linear-gradient(
|
|
108
|
-
to right,
|
|
109
|
-
var(--range-track-background-color) calc(var(--low) * 100%),
|
|
110
|
-
var(--range-track-value-color) 0,
|
|
111
|
-
var(--range-track-value-color) calc(var(--high) * 100%),
|
|
112
|
-
var(--range-track-background-color) 0
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.range--ghost {
|
|
117
|
-
position: absolute;
|
|
118
|
-
top: 0;
|
|
119
|
-
left: 0;
|
|
120
|
-
z-index: 1;
|
|
121
|
-
pointer-events: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.range:focus {
|
|
125
|
-
outline: none;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/* Thumb */
|
|
129
|
-
|
|
130
|
-
.range::-moz-range-thumb {
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
background: var(--range-thumb-color);
|
|
133
|
-
|
|
134
|
-
border: 2px var(--range-thumb-border-color) solid;
|
|
135
|
-
border-radius: 50%;
|
|
136
|
-
|
|
137
|
-
height: var(--range-thumb-diameter);
|
|
138
|
-
width: var(--range-thumb-diameter);
|
|
139
|
-
|
|
140
|
-
pointer-events: all;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.range:disabled::-moz-range-thumb {
|
|
144
|
-
cursor: not-allowed;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.range:focus-visible::-moz-range-thumb {
|
|
148
|
-
outline: 2px solid var(--range-color-focus);
|
|
149
|
-
outline-offset: 2px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.range::-moz-range-thumb:hover,
|
|
153
|
-
.range:focus-visible::-moz-range-thumb {
|
|
154
|
-
border-color: var(--range-thumb-hover-border-color);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.range::-webkit-slider-thumb {
|
|
158
|
-
-webkit-appearance: none;
|
|
159
|
-
appearance: none;
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
background: var(--range-thumb-color);
|
|
162
|
-
|
|
163
|
-
border: 2px var(--range-thumb-border-color) solid;
|
|
164
|
-
border-radius: 50%;
|
|
165
|
-
|
|
166
|
-
height: var(--range-thumb-diameter);
|
|
167
|
-
width: var(--range-thumb-diameter);
|
|
168
|
-
margin-top: calc(var(--range-thumb-diameter) / -2 + 2px);
|
|
169
|
-
|
|
170
|
-
pointer-events: all;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.range:disabled::-webkit-slider-thumb {
|
|
174
|
-
cursor: not-allowed;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.range:focus::-webkit-slider-thumb {
|
|
178
|
-
outline: 2px solid var(--range-color-focus);
|
|
179
|
-
outline-offset: 2px;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.range:focus::-webkit-slider-thumb,
|
|
183
|
-
.range::-webkit-slider-thumb:hover {
|
|
184
|
-
border-color: var(--range-thumb-hover-border-color);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/* Track */
|
|
188
|
-
|
|
189
|
-
.range::-moz-range-track {
|
|
190
|
-
background: var(--_track-background);
|
|
191
|
-
border-radius: var(--range-track-radius);
|
|
192
|
-
height: var(--range-track-height);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.range--ghost::-moz-range-track {
|
|
196
|
-
background: transparent;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.range::-webkit-slider-runnable-track {
|
|
200
|
-
background: var(--_track-background);
|
|
201
|
-
border-radius: var(--range-track-radius);
|
|
202
|
-
height: var(--range-track-height);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.range--ghost::-webkit-slider-runnable-track {
|
|
206
|
-
background: transparent;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* Ticks */
|
|
210
|
-
|
|
211
|
-
.ticks {
|
|
212
|
-
position: absolute;
|
|
213
|
-
top: calc(
|
|
214
|
-
var(--range-thumb-diameter) / 2 + var(--range-track-height)
|
|
215
|
-
);
|
|
216
|
-
left: calc(var(--range-thumb-diameter) / 2);
|
|
217
|
-
right: calc(var(--range-thumb-diameter) / 2);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.tick {
|
|
221
|
-
z-index: -1;
|
|
222
|
-
position: absolute;
|
|
223
|
-
top: 50%;
|
|
224
|
-
width: 2px;
|
|
225
|
-
height: 0.5rem;
|
|
226
|
-
background-color: var(--range-track-background-color);
|
|
227
|
-
transform: translateY(-50%);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.tick-labels {
|
|
231
|
-
display: flex;
|
|
232
|
-
justify-content: space-between;
|
|
233
|
-
color: var(--leu-color-black-60);
|
|
234
|
-
font: var(--leu-t-tiny-regular-font);
|
|
235
|
-
margin-top: 0.25rem;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.tick-label--max {
|
|
239
|
-
text-align: right;
|
|
240
|
-
}
|
|
241
|
-
`;
|
|
242
|
-
|
|
243
|
-
const defaultValueConverter = {
|
|
244
|
-
fromAttribute(value) {
|
|
245
|
-
return value.split(",").map((v) => Number(v.trim()));
|
|
246
|
-
},
|
|
247
|
-
toAttribute(value) {
|
|
248
|
-
return value.join(",");
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
const RANGE_LABELS = ["Von", "Bis"];
|
|
252
|
-
/**
|
|
253
|
-
* @tagname leu-range
|
|
254
|
-
*/
|
|
255
|
-
class LeuRange extends LeuElement {
|
|
256
|
-
constructor() {
|
|
257
|
-
super(...arguments);
|
|
258
|
-
/**
|
|
259
|
-
* The default value of the range slider.
|
|
260
|
-
* String input is parsed as a comma-separated list of numbers.
|
|
261
|
-
*/
|
|
262
|
-
this.defaultValue = [50];
|
|
263
|
-
/**
|
|
264
|
-
* The minimum value of the range slider.
|
|
265
|
-
*/
|
|
266
|
-
this.min = 0;
|
|
267
|
-
/**
|
|
268
|
-
* The maximum value of the range slider.
|
|
269
|
-
*/
|
|
270
|
-
this.max = 100;
|
|
271
|
-
/**
|
|
272
|
-
* The step size of the range slider.
|
|
273
|
-
*/
|
|
274
|
-
this.step = 1;
|
|
275
|
-
this.name = "";
|
|
276
|
-
/**
|
|
277
|
-
* The label of the range slider.
|
|
278
|
-
*/
|
|
279
|
-
this.label = "";
|
|
280
|
-
/**
|
|
281
|
-
* Whether to hide the label of the range slider.
|
|
282
|
-
* If true, the label will still be available for screen readers
|
|
283
|
-
* and is only visually hidden.
|
|
284
|
-
*/
|
|
285
|
-
this.hideLabel = false;
|
|
286
|
-
/**
|
|
287
|
-
* Whether the range slider is disabled.
|
|
288
|
-
*/
|
|
289
|
-
this.disabled = false;
|
|
290
|
-
/**
|
|
291
|
-
* Whether to use a range with two handles.
|
|
292
|
-
*/
|
|
293
|
-
this.multiple = false;
|
|
294
|
-
/**
|
|
295
|
-
* Wheter to show tick marks below the range slider.
|
|
296
|
-
* One tick mark per step will be rendered.
|
|
297
|
-
*/
|
|
298
|
-
this.showTicks = false;
|
|
299
|
-
/**
|
|
300
|
-
* Whether to show the min and max labels below the range slider.
|
|
301
|
-
*/
|
|
302
|
-
this.showRangeLabels = false;
|
|
303
|
-
/**
|
|
304
|
-
* A prefix to display before the value in the output element(s).
|
|
305
|
-
* Is ignored if a custom valueFormatter is provided.
|
|
306
|
-
*/
|
|
307
|
-
this.prefix = "";
|
|
308
|
-
/**
|
|
309
|
-
* A suffix to display after the value in the output element(s).
|
|
310
|
-
* Is ignored if a custom valueFormatter is provided.
|
|
311
|
-
*/
|
|
312
|
-
this.suffix = "";
|
|
313
|
-
this._value = this.defaultValue.map((v) => this.clampAndRoundValue(v));
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* The value of the range slider.
|
|
317
|
-
* String input is parsed as a comma-separated list of numbers.
|
|
318
|
-
* In multiple mode, if only a single value is provided, the second handle will be set to the minimum value.
|
|
319
|
-
* In single mode, only the first value will be used.
|
|
320
|
-
*/
|
|
321
|
-
set value(value) {
|
|
322
|
-
let nextValue = [];
|
|
323
|
-
if (typeof value === "string") {
|
|
324
|
-
nextValue = value
|
|
325
|
-
.split(",")
|
|
326
|
-
.map((v) => Number(v.trim()))
|
|
327
|
-
.filter(isNumber);
|
|
328
|
-
}
|
|
329
|
-
else if (isNumber(value)) {
|
|
330
|
-
nextValue = [value];
|
|
331
|
-
}
|
|
332
|
-
else if (Array.isArray(value)) {
|
|
333
|
-
nextValue = value.map((v) => Number(v)).filter(isNumber);
|
|
334
|
-
}
|
|
335
|
-
if (nextValue.length === 0) {
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
// In multiple mode, we need to ensure that we always have two values.
|
|
339
|
-
// `min` is a fallback for the second value.
|
|
340
|
-
if (this.multiple && nextValue.length === 1) {
|
|
341
|
-
nextValue.unshift(this.min);
|
|
342
|
-
}
|
|
343
|
-
this._value = nextValue
|
|
344
|
-
.slice(0, this.multiple ? 2 : 1)
|
|
345
|
-
.map((v) => this.clampAndRoundValue(v));
|
|
346
|
-
}
|
|
347
|
-
get value() {
|
|
348
|
-
return this._value.join(",");
|
|
349
|
-
}
|
|
350
|
-
get valueAsArray() {
|
|
351
|
-
return this._value.slice();
|
|
352
|
-
}
|
|
353
|
-
get valueLow() {
|
|
354
|
-
return Math.min(...this._value);
|
|
355
|
-
}
|
|
356
|
-
get valueHigh() {
|
|
357
|
-
return Math.max(...this._value);
|
|
358
|
-
}
|
|
359
|
-
updated() {
|
|
360
|
-
this.updateStyles();
|
|
361
|
-
}
|
|
362
|
-
willUpdate(changedProperties) {
|
|
363
|
-
// Reflect defaultValue changes to the value property
|
|
364
|
-
// to ensure backwards compatibility with previous versions
|
|
365
|
-
if (changedProperties.has("defaultValue")) {
|
|
366
|
-
this.value = this.defaultValue.map((v) => this.clampAndRoundValue(v));
|
|
367
|
-
}
|
|
368
|
-
if (changedProperties.has("min") ||
|
|
369
|
-
changedProperties.has("max") ||
|
|
370
|
-
changedProperties.has("step")) {
|
|
371
|
-
this._value = this._value.map((v) => this.clampAndRoundValue(v));
|
|
372
|
-
}
|
|
373
|
-
if (changedProperties.has("multiple") && this.multiple) {
|
|
374
|
-
// When switching to multiple mode, ensure that we have two values
|
|
375
|
-
if (this._value.length === 1) {
|
|
376
|
-
this._value = [this.min, this._value[0]];
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
else if (changedProperties.has("multiple") && !this.multiple) {
|
|
380
|
-
// When switching to single mode, keep only the lower value
|
|
381
|
-
this._value = [this.valueLow];
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
updateStyles() {
|
|
385
|
-
const normalizedRange = this.getNormalizedRange();
|
|
386
|
-
this.container?.style.setProperty("--low", normalizedRange[0].toString());
|
|
387
|
-
this.container?.style.setProperty("--high", normalizedRange[1].toString());
|
|
388
|
-
const inputs = this.multiple
|
|
389
|
-
? [this.inputBase, this.inputGhost]
|
|
390
|
-
: [this.inputBase];
|
|
391
|
-
inputs.forEach((input) => {
|
|
392
|
-
const output = input.id === "input-base" ? this.outputBase : this.outputGhost;
|
|
393
|
-
const normalizedValue = this.getNormalizedValue(input.valueAsNumber);
|
|
394
|
-
output.style.setProperty("--value", normalizedValue.toString());
|
|
395
|
-
output.value = this.formatValue(input.valueAsNumber);
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
clampAndRoundValue(value) {
|
|
399
|
-
const clampedValue = clamp(value, this.min, this.max);
|
|
400
|
-
const roundedValue = Math.round((clampedValue - this.min) / this.step) * this.step + this.min;
|
|
401
|
-
return roundedValue;
|
|
402
|
-
}
|
|
403
|
-
handleInput(e) {
|
|
404
|
-
e.stopPropagation();
|
|
405
|
-
if (this.multiple) {
|
|
406
|
-
this.value = [this.inputBase.valueAsNumber, this.inputGhost.valueAsNumber];
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
this.value = [this.inputBase.valueAsNumber];
|
|
410
|
-
}
|
|
411
|
-
this.dispatchEvent(new CustomEvent("input", {
|
|
412
|
-
composed: true,
|
|
413
|
-
bubbles: true,
|
|
414
|
-
detail: { value: this.value, valueAsArray: this.valueAsArray },
|
|
415
|
-
}));
|
|
416
|
-
}
|
|
417
|
-
getNormalizedValue(value) {
|
|
418
|
-
return (value - this.min) / (this.max - this.min);
|
|
419
|
-
}
|
|
420
|
-
getNormalizedRange() {
|
|
421
|
-
if (this.multiple) {
|
|
422
|
-
return this.valueAsArray
|
|
423
|
-
.map((value) => this.getNormalizedValue(value))
|
|
424
|
-
.sort((a, b) => a - b);
|
|
425
|
-
}
|
|
426
|
-
return [0, this.getNormalizedValue(this.valueAsArray[0])];
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* This event handler is only applied to the "base" input element and only when in "multiple" mode.
|
|
430
|
-
* It handles pointer events on the *track* and the thumb.
|
|
431
|
-
* This method determines if the interaction was closer to the base or the ghost input.
|
|
432
|
-
*/
|
|
433
|
-
handlePointerDown(e) {
|
|
434
|
-
const clickValue = this.min + ((this.max - this.min) * e.offsetX) / this.offsetWidth;
|
|
435
|
-
const middleValue = (this.valueAsArray[0] + this.valueAsArray[1]) / 2;
|
|
436
|
-
if ((e.target.valueAsNumber === this.valueLow) ===
|
|
437
|
-
clickValue > middleValue) {
|
|
438
|
-
/**
|
|
439
|
-
* As the pointerdown event is fired before the input event, we first overwrite the value
|
|
440
|
-
* of the input element that was not clicked on. The active input element will update itself.
|
|
441
|
-
*/
|
|
442
|
-
this.inputGhost.value = e.target.value;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
formatValue(value) {
|
|
446
|
-
if (this.valueFormatter) {
|
|
447
|
-
return this.valueFormatter(value);
|
|
448
|
-
}
|
|
449
|
-
return `${this.prefix}${value}${this.suffix}`;
|
|
450
|
-
}
|
|
451
|
-
renderTicks() {
|
|
452
|
-
if (!this.showTicks) {
|
|
453
|
-
return nothing;
|
|
454
|
-
}
|
|
455
|
-
return html `<div class="ticks">
|
|
456
|
-
${Array.from({ length: (this.max - this.min) / this.step + 1 }, (_, i) => this.min + i * this.step).map((tick) => html `<span
|
|
457
|
-
class="tick"
|
|
458
|
-
style="left: ${this.getNormalizedValue(tick) * 100}%"
|
|
459
|
-
></span>`)}
|
|
460
|
-
</div>`;
|
|
461
|
-
}
|
|
462
|
-
render() {
|
|
463
|
-
const inputs = this.multiple ? ["base", "ghost"] : ["base"];
|
|
464
|
-
const { multiple, disabled, label, valueAsArray } = this;
|
|
465
|
-
return html `
|
|
466
|
-
<div
|
|
467
|
-
id="container"
|
|
468
|
-
class="container"
|
|
469
|
-
role=${ifDefined(multiple ? "group" : undefined)}
|
|
470
|
-
aria-labelledby=${ifDefined(multiple ? "group-label" : undefined)}
|
|
471
|
-
>
|
|
472
|
-
${multiple
|
|
473
|
-
? html `<span id="group-label" class="label">${label}</span>`
|
|
474
|
-
: html `<label for="input-base" class="label">${label}</label>`}
|
|
475
|
-
<div class="outputs">
|
|
476
|
-
${inputs.map((type, index) => html `<output
|
|
477
|
-
class="output"
|
|
478
|
-
for="input-${type}"
|
|
479
|
-
value=${this.formatValue(valueAsArray[index])}
|
|
480
|
-
></output>`)}
|
|
481
|
-
</div>
|
|
482
|
-
<div class="inputs">
|
|
483
|
-
${inputs.map((type, index) => html `
|
|
484
|
-
<input
|
|
485
|
-
@input=${this.handleInput}
|
|
486
|
-
@pointerdown=${multiple && !disabled && index === 0
|
|
487
|
-
? this.handlePointerDown
|
|
488
|
-
: undefined}
|
|
489
|
-
type="range"
|
|
490
|
-
class="range range--${type}"
|
|
491
|
-
id="input-${type}"
|
|
492
|
-
name=${this.name}
|
|
493
|
-
min=${this.min}
|
|
494
|
-
max=${this.max}
|
|
495
|
-
step=${this.step}
|
|
496
|
-
aria-label=${ifDefined(multiple ? RANGE_LABELS[index] : undefined)}
|
|
497
|
-
?disabled=${disabled}
|
|
498
|
-
.value=${valueAsArray[index].toString()}
|
|
499
|
-
/>
|
|
500
|
-
`)}
|
|
501
|
-
${this.renderTicks()}
|
|
502
|
-
</div>
|
|
503
|
-
</div>
|
|
504
|
-
${this.showRangeLabels
|
|
505
|
-
? html `<div class="tick-labels">
|
|
506
|
-
<span class="tick-label tick-label--min"
|
|
507
|
-
>${this.formatValue(this.min)}</span
|
|
508
|
-
>
|
|
509
|
-
<span class="tick-label tick-label--max"
|
|
510
|
-
>${this.formatValue(this.max)}</span
|
|
511
|
-
>
|
|
512
|
-
</div>`
|
|
513
|
-
: nothing}
|
|
514
|
-
`;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
LeuRange.styles = [LeuElement.styles, css_248z];
|
|
518
|
-
LeuRange.shadowRootOptions = {
|
|
519
|
-
...LeuElement.shadowRootOptions,
|
|
520
|
-
delegatesFocus: true,
|
|
521
|
-
};
|
|
522
|
-
__decorate([
|
|
523
|
-
property({
|
|
524
|
-
converter: defaultValueConverter,
|
|
525
|
-
attribute: "value",
|
|
526
|
-
reflect: true,
|
|
527
|
-
})
|
|
528
|
-
], LeuRange.prototype, "defaultValue", void 0);
|
|
529
|
-
__decorate([
|
|
530
|
-
property({ type: Number, reflect: true })
|
|
531
|
-
], LeuRange.prototype, "min", void 0);
|
|
532
|
-
__decorate([
|
|
533
|
-
property({ type: Number, reflect: true })
|
|
534
|
-
], LeuRange.prototype, "max", void 0);
|
|
535
|
-
__decorate([
|
|
536
|
-
property({ type: Number, reflect: true })
|
|
537
|
-
], LeuRange.prototype, "step", void 0);
|
|
538
|
-
__decorate([
|
|
539
|
-
property({ type: String, reflect: true })
|
|
540
|
-
], LeuRange.prototype, "name", void 0);
|
|
541
|
-
__decorate([
|
|
542
|
-
property({ type: String, reflect: true })
|
|
543
|
-
], LeuRange.prototype, "label", void 0);
|
|
544
|
-
__decorate([
|
|
545
|
-
property({ type: Boolean, reflect: true, attribute: "hide-label" })
|
|
546
|
-
], LeuRange.prototype, "hideLabel", void 0);
|
|
547
|
-
__decorate([
|
|
548
|
-
property({ type: Boolean, reflect: true })
|
|
549
|
-
], LeuRange.prototype, "disabled", void 0);
|
|
550
|
-
__decorate([
|
|
551
|
-
property({ type: Boolean, reflect: true })
|
|
552
|
-
], LeuRange.prototype, "multiple", void 0);
|
|
553
|
-
__decorate([
|
|
554
|
-
property({ type: Boolean, reflect: true, attribute: "show-ticks" })
|
|
555
|
-
], LeuRange.prototype, "showTicks", void 0);
|
|
556
|
-
__decorate([
|
|
557
|
-
property({ type: Boolean, reflect: true, attribute: "show-range-labels" })
|
|
558
|
-
], LeuRange.prototype, "showRangeLabels", void 0);
|
|
559
|
-
__decorate([
|
|
560
|
-
property({ type: String, reflect: true })
|
|
561
|
-
], LeuRange.prototype, "prefix", void 0);
|
|
562
|
-
__decorate([
|
|
563
|
-
property({ type: String, reflect: true })
|
|
564
|
-
], LeuRange.prototype, "suffix", void 0);
|
|
565
|
-
__decorate([
|
|
566
|
-
property({ attribute: false })
|
|
567
|
-
], LeuRange.prototype, "valueFormatter", void 0);
|
|
568
|
-
__decorate([
|
|
569
|
-
property({ attribute: false })
|
|
570
|
-
], LeuRange.prototype, "value", null);
|
|
571
|
-
__decorate([
|
|
572
|
-
query("#container")
|
|
573
|
-
], LeuRange.prototype, "container", void 0);
|
|
574
|
-
__decorate([
|
|
575
|
-
query("#input-base")
|
|
576
|
-
], LeuRange.prototype, "inputBase", void 0);
|
|
577
|
-
__decorate([
|
|
578
|
-
query("#input-ghost")
|
|
579
|
-
], LeuRange.prototype, "inputGhost", void 0);
|
|
580
|
-
__decorate([
|
|
581
|
-
query("output[for=input-base]")
|
|
582
|
-
], LeuRange.prototype, "outputBase", void 0);
|
|
583
|
-
__decorate([
|
|
584
|
-
query("output[for=input-ghost]")
|
|
585
|
-
], LeuRange.prototype, "outputGhost", void 0);
|
|
586
|
-
|
|
1
|
+
import "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import { t as LeuRange } from "./Range-B72rtfln.js";
|
|
587
3
|
export { LeuRange };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { t as LeuElement } from "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import { t as __decorate } from "./decorate-DwpAc4D0.js";
|
|
3
|
+
import { t as LeuIcon } from "./Icon-C_yYuynf.js";
|
|
4
|
+
import { t as LeuButton } from "./Button-BkhqVjug.js";
|
|
5
|
+
import { r as throttle } from "./utils-hfk5Nwy8.js";
|
|
6
|
+
import { css, html } from "lit";
|
|
7
|
+
import { state } from "lit/decorators.js";
|
|
8
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
9
|
+
//#region src/components/scroll-top/scroll-top.css?inline
|
|
10
|
+
var scroll_top_default = css`.scroll-top {
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
position: fixed;
|
|
13
|
+
z-index: var(--leu-z-index-scroll-top);
|
|
14
|
+
|
|
15
|
+
--_space: 1.5rem;
|
|
16
|
+
right: 1.5rem;
|
|
17
|
+
right: var(--_space);
|
|
18
|
+
bottom: 1.5rem;
|
|
19
|
+
bottom: var(--_space);
|
|
20
|
+
|
|
21
|
+
/* show */
|
|
22
|
+
height: 3rem;
|
|
23
|
+
pointer-events: auto;
|
|
24
|
+
transition: height, bottom 0.9s, 0.6s ease;
|
|
25
|
+
}
|
|
26
|
+
@media (min-width: 600px) {
|
|
27
|
+
.scroll-top {
|
|
28
|
+
--_space: 2rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@media (min-width: 1024px) {
|
|
32
|
+
.scroll-top {
|
|
33
|
+
--_space: 2.5rem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
@media (min-width: 1280px) {
|
|
37
|
+
.scroll-top {
|
|
38
|
+
--_space: 3rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.hide {
|
|
42
|
+
height: 0;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
transition: height, top 0.9s, 0.6s ease;
|
|
45
|
+
}
|
|
46
|
+
@keyframes hide-animation {
|
|
47
|
+
0% {
|
|
48
|
+
transform: rotate(0deg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
100% {
|
|
52
|
+
transform: rotate(90deg);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.hide leu-button {
|
|
56
|
+
animation-name: hide-animation;
|
|
57
|
+
animation-duration: 0.45s;
|
|
58
|
+
animation-timing-function: ease;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/scroll-top/ScrollTop.ts
|
|
63
|
+
/**
|
|
64
|
+
* @tagname leu-scroll-top
|
|
65
|
+
*/
|
|
66
|
+
var LeuScrollTop = class LeuScrollTop extends LeuElement {
|
|
67
|
+
constructor(..._args) {
|
|
68
|
+
super(..._args);
|
|
69
|
+
this._showButton = false;
|
|
70
|
+
this._prevYPos = 0;
|
|
71
|
+
this._scrollDown = false;
|
|
72
|
+
this.scroll = () => {
|
|
73
|
+
const delta = window.scrollY - this._prevYPos;
|
|
74
|
+
if (this._scrollDown) {
|
|
75
|
+
if (delta < 0) this._scrollDown = false;
|
|
76
|
+
} else if (delta > 0) this._scrollDown = true;
|
|
77
|
+
/**
|
|
78
|
+
* Only show the button when
|
|
79
|
+
* ... the current scroll position is greater than the window height (below-the-fold) and when
|
|
80
|
+
* ... scrolling up
|
|
81
|
+
*/
|
|
82
|
+
this._showButton = window.scrollY > window.innerHeight && !this._scrollDown;
|
|
83
|
+
this._prevYPos = window.scrollY;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static {
|
|
87
|
+
this.dependencies = {
|
|
88
|
+
"leu-button": LeuButton,
|
|
89
|
+
"leu-icon": LeuIcon
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static {
|
|
93
|
+
this.styles = [LeuElement.styles, scroll_top_default];
|
|
94
|
+
}
|
|
95
|
+
connectedCallback() {
|
|
96
|
+
super.connectedCallback();
|
|
97
|
+
this._scrollListener = throttle(this.scroll, 100);
|
|
98
|
+
document.addEventListener("scroll", this._scrollListener, true);
|
|
99
|
+
}
|
|
100
|
+
disconnectedCallback() {
|
|
101
|
+
document.removeEventListener("scroll", this._scrollListener, true);
|
|
102
|
+
super.disconnectedCallback();
|
|
103
|
+
}
|
|
104
|
+
static scrollToTop() {
|
|
105
|
+
window.scrollTo({
|
|
106
|
+
top: 0,
|
|
107
|
+
left: 0,
|
|
108
|
+
behavior: "smooth"
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
render() {
|
|
112
|
+
return html`
|
|
113
|
+
<div class=${classMap({
|
|
114
|
+
"scroll-top": true,
|
|
115
|
+
hide: !this._showButton
|
|
116
|
+
})}>
|
|
117
|
+
<leu-button
|
|
118
|
+
label="Zum Seitenanfang"
|
|
119
|
+
round
|
|
120
|
+
@click="${() => LeuScrollTop.scrollToTop()}"
|
|
121
|
+
>
|
|
122
|
+
<leu-icon name="arrowUp"></leu-icon>
|
|
123
|
+
</leu-button>
|
|
124
|
+
</div>
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
__decorate([state()], LeuScrollTop.prototype, "_showButton", void 0);
|
|
129
|
+
//#endregion
|
|
130
|
+
export { LeuScrollTop as t };
|