@statistikzh/leu 0.14.3 → 0.14.4
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/.eslintrc.json +23 -4
- package/.github/workflows/release-please.yml +0 -1
- package/.prettierignore +1 -1
- package/.release-please-manifest.json +3 -0
- package/.storybook/{main.js → main.ts} +18 -2
- package/.storybook/{theme.js → theme.ts} +1 -0
- package/CHANGELOG.md +7 -0
- package/custom-elements-manifest.config.js +2 -2
- package/dist/Accordion.d.ts +32 -11
- package/dist/Accordion.js +96 -68
- package/dist/Button.d.ts +84 -33
- package/dist/Button.js +116 -136
- package/dist/ButtonGroup.d.ts +15 -10
- package/dist/ButtonGroup.js +65 -72
- package/dist/Checkbox.d.ts +41 -8
- package/dist/Checkbox.js +33 -45
- package/dist/CheckboxGroup.d.ts +21 -8
- package/dist/CheckboxGroup.js +31 -35
- package/dist/Chip.d.ts +23 -4
- package/dist/Chip.js +13 -17
- package/dist/ChipGroup.d.ts +43 -17
- package/dist/ChipGroup.js +87 -113
- package/dist/ChipLink.d.ts +28 -10
- package/dist/ChipLink.js +17 -24
- package/dist/ChipRemovable.d.ts +25 -6
- package/dist/ChipRemovable.js +32 -36
- package/dist/ChipSelectable.d.ts +41 -23
- package/dist/ChipSelectable.js +55 -69
- package/dist/Dialog.d.ts +39 -11
- package/dist/Dialog.js +48 -55
- package/dist/Dropdown.d.ts +44 -9
- package/dist/Dropdown.js +89 -96
- package/dist/Icon.d.ts +16 -9
- package/dist/Icon.js +117 -122
- package/dist/Input.d.ts +122 -34
- package/dist/Input.js +262 -342
- package/dist/LeuElement-x8UlIDDl.js +42 -0
- package/dist/LeuElement.d-BevHqLUu.d.ts +10 -0
- package/dist/Menu.d.ts +29 -10
- package/dist/Menu.js +111 -110
- package/dist/MenuItem.d.ts +69 -19
- package/dist/MenuItem.js +93 -109
- package/dist/Pagination.d.ts +46 -16
- package/dist/Pagination.js +101 -116
- package/dist/Popup.d.ts +55 -21
- package/dist/Popup.js +149 -178
- package/dist/Radio.d.ts +37 -8
- package/dist/Radio.js +30 -42
- package/dist/RadioGroup.d.ts +25 -7
- package/dist/RadioGroup.js +123 -128
- package/dist/Range.d.ts +62 -23
- package/dist/Range.js +154 -180
- package/dist/ScrollTop.d.ts +25 -14
- package/dist/ScrollTop.js +71 -75
- package/dist/Select.d.ts +48 -38
- package/dist/Select.js +309 -336
- package/dist/Spinner.d.ts +9 -4
- package/dist/Spinner.js +5 -5
- package/dist/Table.d.ts +61 -31
- package/dist/Table.js +160 -179
- package/dist/VisuallyHidden.d.ts +9 -4
- package/dist/VisuallyHidden.js +5 -5
- package/dist/components/accordion/Accordion.d.ts +49 -0
- package/dist/components/accordion/Accordion.d.ts.map +1 -0
- package/dist/components/accordion/leu-accordion.d.ts +8 -0
- package/dist/components/accordion/leu-accordion.d.ts.map +1 -0
- package/dist/components/accordion/stories/accordion.stories.d.ts +26 -0
- package/dist/components/accordion/stories/accordion.stories.d.ts.map +1 -0
- package/dist/components/accordion/test/accordion.test.d.ts +2 -0
- package/dist/components/accordion/test/accordion.test.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts +93 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/leu-button.d.ts +8 -0
- package/dist/components/button/leu-button.d.ts.map +1 -0
- package/dist/components/button/stories/button.stories.d.ts +19 -0
- package/dist/components/button/stories/button.stories.d.ts.map +1 -0
- package/dist/components/button/test/button.test.d.ts +3 -0
- package/dist/components/button/test/button.test.d.ts.map +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +25 -0
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
- package/dist/components/button-group/leu-button-group.d.ts +8 -0
- package/dist/components/button-group/leu-button-group.d.ts.map +1 -0
- package/dist/components/button-group/stories/button-group.stories.d.ts +15 -0
- package/dist/components/button-group/stories/button-group.stories.d.ts.map +1 -0
- package/dist/components/button-group/test/button-group.test.d.ts +3 -0
- package/dist/components/button-group/test/button-group.test.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +43 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts +23 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -0
- package/dist/components/checkbox/leu-checkbox-group.d.ts +8 -0
- package/dist/components/checkbox/leu-checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox/leu-checkbox.d.ts +8 -0
- package/dist/components/checkbox/leu-checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts +29 -0
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts.map +1 -0
- package/dist/components/checkbox/stories/checkbox.stories.d.ts +22 -0
- package/dist/components/checkbox/stories/checkbox.stories.d.ts.map +1 -0
- package/dist/components/checkbox/test/checkbox-group.test.d.ts +3 -0
- package/dist/components/checkbox/test/checkbox-group.test.d.ts.map +1 -0
- package/dist/components/checkbox/test/checkbox.test.d.ts +2 -0
- package/dist/components/checkbox/test/checkbox.test.d.ts.map +1 -0
- package/dist/components/chip/Chip.d.ts +21 -0
- package/dist/components/chip/Chip.d.ts.map +1 -0
- package/dist/components/chip/ChipGroup.d.ts +58 -0
- package/dist/components/chip/ChipGroup.d.ts.map +1 -0
- package/dist/components/chip/ChipLink.d.ts +29 -0
- package/dist/components/chip/ChipLink.d.ts.map +1 -0
- package/dist/components/chip/ChipRemovable.d.ts +32 -0
- package/dist/components/chip/ChipRemovable.d.ts.map +1 -0
- package/dist/components/chip/ChipSelectable.d.ts +51 -0
- package/dist/components/chip/ChipSelectable.d.ts.map +1 -0
- package/dist/components/chip/exports.d.ts +5 -0
- package/dist/components/chip/exports.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-group.d.ts +8 -0
- package/dist/components/chip/leu-chip-group.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-link.d.ts +8 -0
- package/dist/components/chip/leu-chip-link.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-removable.d.ts +8 -0
- package/dist/components/chip/leu-chip-removable.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-selectable.d.ts +8 -0
- package/dist/components/chip/leu-chip-selectable.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-group.stories.d.ts +40 -0
- package/dist/components/chip/stories/chip-group.stories.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-link.stories.d.ts +27 -0
- package/dist/components/chip/stories/chip-link.stories.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-removable.stories.d.ts +21 -0
- package/dist/components/chip/stories/chip-removable.stories.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-selectable.stories.d.ts +35 -0
- package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +1 -0
- package/dist/components/chip/test/chip-group.test.d.ts +4 -0
- package/dist/components/chip/test/chip-group.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip-link.test.d.ts +2 -0
- package/dist/components/chip/test/chip-link.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip-removable.test.d.ts +2 -0
- package/dist/components/chip/test/chip-removable.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip-selectable.test.d.ts +2 -0
- package/dist/components/chip/test/chip-selectable.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip.test.d.ts +2 -0
- package/dist/components/chip/test/chip.test.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +41 -0
- package/dist/components/dialog/Dialog.d.ts.map +1 -0
- package/dist/components/dialog/leu-dialog.d.ts +8 -0
- package/dist/components/dialog/leu-dialog.d.ts.map +1 -0
- package/dist/components/dialog/stories/dialog.stories.d.ts +19 -0
- package/dist/components/dialog/stories/dialog.stories.d.ts.map +1 -0
- package/dist/components/dialog/test/dialog.test.d.ts +2 -0
- package/dist/components/dialog/test/dialog.test.d.ts.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +49 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/leu-dropdown.d.ts +8 -0
- package/dist/components/dropdown/leu-dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/stories/dropdown.stories.d.ts +25 -0
- package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +1 -0
- package/dist/components/dropdown/test/dropdown.test.d.ts +2 -0
- package/dist/components/dropdown/test/dropdown.test.d.ts.map +1 -0
- package/dist/components/icon/Icon.d.ts +23 -0
- package/dist/components/icon/Icon.d.ts.map +1 -0
- package/dist/components/icon/leu-icon.d.ts +8 -0
- package/dist/components/icon/leu-icon.d.ts.map +1 -0
- package/dist/components/icon/paths.d.ts +101 -0
- package/dist/components/icon/paths.d.ts.map +1 -0
- package/dist/components/icon/stories/icon.stories.d.ts +22 -0
- package/dist/components/icon/stories/icon.stories.d.ts.map +1 -0
- package/dist/components/icon/test/icon.test.d.ts +2 -0
- package/dist/components/icon/test/icon.test.d.ts.map +1 -0
- package/dist/components/input/Input.d.ts +239 -0
- package/dist/components/input/Input.d.ts.map +1 -0
- package/dist/components/input/leu-input.d.ts +8 -0
- package/dist/components/input/leu-input.d.ts.map +1 -0
- package/dist/components/input/stories/input.stories.d.ts +35 -0
- package/dist/components/input/stories/input.stories.d.ts.map +1 -0
- package/dist/components/input/test/input.test.d.ts +2 -0
- package/dist/components/input/test/input.test.d.ts.map +1 -0
- package/dist/components/menu/Menu.d.ts +44 -0
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/MenuItem.d.ts +88 -0
- package/dist/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/components/menu/leu-menu-item.d.ts +8 -0
- package/dist/components/menu/leu-menu-item.d.ts.map +1 -0
- package/dist/components/menu/leu-menu.d.ts +8 -0
- package/dist/components/menu/leu-menu.d.ts.map +1 -0
- package/dist/components/menu/stories/menu-item.stories.d.ts +24 -0
- package/dist/components/menu/stories/menu-item.stories.d.ts.map +1 -0
- package/dist/components/menu/stories/menu.stories.d.ts +26 -0
- package/dist/components/menu/stories/menu.stories.d.ts.map +1 -0
- package/dist/components/menu/test/menu-item.test.d.ts +3 -0
- package/dist/components/menu/test/menu-item.test.d.ts.map +1 -0
- package/dist/components/menu/test/menu.test.d.ts +4 -0
- package/dist/components/menu/test/menu.test.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.d.ts +59 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/pagination/leu-pagination.d.ts +8 -0
- package/dist/components/pagination/leu-pagination.d.ts.map +1 -0
- package/dist/components/pagination/stories/pagination.stories.d.ts +17 -0
- package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -0
- package/dist/components/pagination/test/pagination.test.d.ts +2 -0
- package/dist/components/pagination/test/pagination.test.d.ts.map +1 -0
- package/dist/components/popup/Popup.d.ts +66 -0
- package/dist/components/popup/Popup.d.ts.map +1 -0
- package/dist/components/popup/leu-popup.d.ts +8 -0
- package/dist/components/popup/leu-popup.d.ts.map +1 -0
- package/dist/components/popup/stories/popup.stories.d.ts +17 -0
- package/dist/components/popup/stories/popup.stories.d.ts.map +1 -0
- package/dist/components/popup/test/popup.test.d.ts +2 -0
- package/dist/components/popup/test/popup.test.d.ts.map +1 -0
- package/dist/components/radio/Radio.d.ts +39 -0
- package/dist/components/radio/Radio.d.ts.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +34 -0
- package/dist/components/radio/RadioGroup.d.ts.map +1 -0
- package/dist/components/radio/leu-radio-group.d.ts +8 -0
- package/dist/components/radio/leu-radio-group.d.ts.map +1 -0
- package/dist/components/radio/leu-radio.d.ts +8 -0
- package/dist/components/radio/leu-radio.d.ts.map +1 -0
- package/dist/components/radio/stories/radio-group.stories.d.ts +29 -0
- package/dist/components/radio/stories/radio-group.stories.d.ts.map +1 -0
- package/dist/components/radio/stories/radio.stories.d.ts +22 -0
- package/dist/components/radio/stories/radio.stories.d.ts.map +1 -0
- package/dist/components/radio/test/radio-group.test.d.ts +3 -0
- package/dist/components/radio/test/radio-group.test.d.ts.map +1 -0
- package/dist/components/radio/test/radio.test.d.ts +2 -0
- package/dist/components/radio/test/radio.test.d.ts.map +1 -0
- package/dist/components/range/Range.d.ts +95 -0
- package/dist/components/range/Range.d.ts.map +1 -0
- package/dist/components/range/leu-range.d.ts +8 -0
- package/dist/components/range/leu-range.d.ts.map +1 -0
- package/dist/components/range/stories/range-slider.stories.d.ts +26 -0
- package/dist/components/range/stories/range-slider.stories.d.ts.map +1 -0
- package/dist/components/range/test/range.test.d.ts +2 -0
- package/dist/components/range/test/range.test.d.ts.map +1 -0
- package/dist/components/scroll-top/ScrollTop.d.ts +25 -0
- package/dist/components/scroll-top/ScrollTop.d.ts.map +1 -0
- package/dist/components/scroll-top/leu-scroll-top.d.ts +8 -0
- package/dist/components/scroll-top/leu-scroll-top.d.ts.map +1 -0
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts +8 -0
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts.map +1 -0
- package/dist/components/scroll-top/test/scroll-top.test.d.ts +2 -0
- package/dist/components/scroll-top/test/scroll-top.test.d.ts.map +1 -0
- package/dist/components/select/Select.d.ts +145 -0
- package/dist/components/select/Select.d.ts.map +1 -0
- package/dist/components/select/leu-select.d.ts +8 -0
- package/dist/components/select/leu-select.d.ts.map +1 -0
- package/dist/components/select/stories/select.stories.d.ts +23 -0
- package/dist/components/select/stories/select.stories.d.ts.map +1 -0
- package/dist/components/select/test/fixtures.d.ts +2 -0
- package/dist/components/select/test/fixtures.d.ts.map +1 -0
- package/dist/components/select/test/select.test.d.ts +3 -0
- package/dist/components/select/test/select.test.d.ts.map +1 -0
- package/dist/components/spinner/Spinner.d.ts +10 -0
- package/dist/components/spinner/Spinner.d.ts.map +1 -0
- package/dist/components/spinner/leu-spinner.d.ts +8 -0
- package/dist/components/spinner/leu-spinner.d.ts.map +1 -0
- package/dist/components/spinner/stories/spinner.stories.d.ts +16 -0
- package/dist/components/spinner/stories/spinner.stories.d.ts.map +1 -0
- package/dist/components/spinner/test/spinner.test.d.ts +2 -0
- package/dist/components/spinner/test/spinner.test.d.ts.map +1 -0
- package/dist/components/table/Table.d.ts +65 -0
- package/dist/components/table/Table.d.ts.map +1 -0
- package/dist/components/table/leu-table.d.ts +8 -0
- package/dist/components/table/leu-table.d.ts.map +1 -0
- package/dist/components/table/stories/table.stories.d.ts +15 -0
- package/dist/components/table/stories/table.stories.d.ts.map +1 -0
- package/dist/components/table/test/table.test.d.ts +2 -0
- package/dist/components/table/test/table.test.d.ts.map +1 -0
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +9 -0
- package/dist/components/visually-hidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts +8 -0
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts.map +1 -0
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts +13 -0
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts.map +1 -0
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts +2 -0
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts.map +1 -0
- package/dist/hasSlotController-Bm2tipvG.js +53 -0
- package/dist/hasSlotController.d-emXwVXWF.d.ts +23 -0
- package/dist/index.d.ts +17 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/leu-accordion.d.ts +12 -2
- package/dist/leu-accordion.js +2 -1
- package/dist/leu-button-group.d.ts +12 -2
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.d.ts +14 -2
- package/dist/leu-button.js +2 -2
- package/dist/leu-checkbox-group.d.ts +12 -2
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.d.ts +13 -2
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.d.ts +12 -2
- package/dist/leu-chip-group.js +2 -2
- package/dist/leu-chip-link.d.ts +13 -2
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.d.ts +14 -2
- package/dist/leu-chip-removable.js +1 -1
- package/dist/leu-chip-selectable.d.ts +13 -2
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/leu-dialog.d.ts +14 -2
- package/dist/leu-dialog.js +2 -2
- package/dist/leu-dropdown.d.ts +18 -2
- package/dist/leu-dropdown.js +2 -2
- package/dist/leu-icon.d.ts +12 -2
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.d.ts +13 -2
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.d.ts +13 -2
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.d.ts +14 -2
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.d.ts +16 -2
- package/dist/leu-pagination.js +2 -2
- package/dist/leu-popup.d.ts +12 -2
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.d.ts +12 -2
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.d.ts +12 -2
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.d.ts +12 -2
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.d.ts +15 -2
- package/dist/leu-scroll-top.js +2 -2
- package/dist/leu-select.d.ts +19 -2
- package/dist/leu-select.js +2 -2
- package/dist/leu-spinner.d.ts +12 -2
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.d.ts +17 -2
- package/dist/leu-table.js +2 -2
- package/dist/leu-visually-hidden.d.ts +12 -2
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/lib/LeuElement.d.ts +8 -0
- package/dist/lib/LeuElement.d.ts.map +1 -0
- package/dist/lib/a11y.d.ts +11 -0
- package/dist/lib/a11y.d.ts.map +1 -0
- package/dist/lib/hasSlotController.d.ts +20 -0
- package/dist/lib/hasSlotController.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +16 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/styles/style.stories.d.ts +6 -0
- package/dist/styles/style.stories.d.ts.map +1 -0
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/vue/index.d.ts +1 -3
- package/dist/web-types.json +4 -5
- package/package.json +18 -11
- package/release-please-config.json +10 -0
- package/rollup.config.js +55 -25
- package/scripts/generate-component/generate.js +1 -1
- package/scripts/generate-component/templates/{[Name].js → [Name].ts} +3 -3
- package/src/components/accordion/{Accordion.js → Accordion.ts} +26 -21
- package/src/components/accordion/{leu-accordion.js → leu-accordion.ts} +6 -0
- package/src/components/accordion/stories/{accordion.stories.js → accordion.stories.ts} +10 -8
- package/src/components/button/{Button.js → Button.ts} +0 -1
- package/src/components/button/{leu-button.js → leu-button.ts} +6 -0
- package/src/components/button-group/{ButtonGroup.js → ButtonGroup.ts} +4 -8
- package/src/components/button-group/{leu-button-group.js → leu-button-group.ts} +6 -0
- package/src/components/checkbox/{Checkbox.js → Checkbox.ts} +0 -1
- package/src/components/checkbox/{CheckboxGroup.js → CheckboxGroup.ts} +0 -1
- package/src/components/checkbox/{leu-checkbox-group.js → leu-checkbox-group.ts} +6 -0
- package/src/components/checkbox/{leu-checkbox.js → leu-checkbox.ts} +6 -0
- package/src/components/chip/{Chip.js → Chip.ts} +0 -1
- package/src/components/chip/{ChipGroup.js → ChipGroup.ts} +0 -1
- package/src/components/chip/{leu-chip-group.js → leu-chip-group.ts} +6 -0
- package/src/components/chip/{leu-chip-link.js → leu-chip-link.ts} +6 -0
- package/src/components/chip/{leu-chip-removable.js → leu-chip-removable.ts} +6 -0
- package/src/components/chip/{leu-chip-selectable.js → leu-chip-selectable.ts} +6 -0
- package/src/components/dialog/{Dialog.js → Dialog.ts} +0 -1
- package/src/components/dialog/{leu-dialog.js → leu-dialog.ts} +6 -0
- package/src/components/dropdown/{Dropdown.js → Dropdown.ts} +0 -1
- package/src/components/dropdown/{leu-dropdown.js → leu-dropdown.ts} +6 -0
- package/src/components/icon/{Icon.js → Icon.ts} +0 -1
- package/src/components/icon/{leu-icon.js → leu-icon.ts} +6 -0
- package/src/components/input/{Input.js → Input.ts} +0 -1
- package/src/components/input/{leu-input.js → leu-input.ts} +6 -0
- package/src/components/menu/{Menu.js → Menu.ts} +0 -1
- package/src/components/menu/{MenuItem.js → MenuItem.ts} +0 -1
- package/src/components/menu/{leu-menu-item.js → leu-menu-item.ts} +6 -0
- package/src/components/menu/{leu-menu.js → leu-menu.ts} +6 -0
- package/src/components/pagination/{Pagination.js → Pagination.ts} +0 -1
- package/src/components/pagination/{leu-pagination.js → leu-pagination.ts} +6 -0
- package/src/components/popup/{Popup.js → Popup.ts} +0 -1
- package/src/components/popup/{leu-popup.js → leu-popup.ts} +6 -0
- package/src/components/radio/{Radio.js → Radio.ts} +0 -1
- package/src/components/radio/{RadioGroup.js → RadioGroup.ts} +0 -1
- package/src/components/radio/{leu-radio-group.js → leu-radio-group.ts} +6 -0
- package/src/components/radio/{leu-radio.js → leu-radio.ts} +6 -0
- package/src/components/range/{leu-range.js → leu-range.ts} +6 -0
- package/src/components/scroll-top/{ScrollTop.js → ScrollTop.ts} +0 -1
- package/src/components/scroll-top/{leu-scroll-top.js → leu-scroll-top.ts} +6 -0
- package/src/components/select/{Select.js → Select.ts} +0 -1
- package/src/components/select/{leu-select.js → leu-select.ts} +6 -0
- package/src/components/select/test/{fixtures.js → fixtures.ts} +1 -1
- package/src/components/spinner/{leu-spinner.js → leu-spinner.ts} +6 -0
- package/src/components/table/{Table.js → Table.ts} +0 -1
- package/src/components/table/{leu-table.js → leu-table.ts} +6 -0
- package/src/components/visually-hidden/{VisuallyHidden.js → VisuallyHidden.ts} +0 -1
- package/src/components/visually-hidden/{leu-visually-hidden.js → leu-visually-hidden.ts} +6 -0
- package/src/docs/theme.mdx +14 -10
- package/src/global.d.ts +11 -0
- package/src/index.ts +17 -0
- package/src/lib/{LeuElement.js → LeuElement.ts} +15 -6
- package/src/lib/{a11y.js → a11y.ts} +2 -2
- package/src/lib/{hasSlotController.js → hasSlotController.ts} +12 -25
- package/stylelint.config.mjs +1 -1
- package/tsconfig.build.json +6 -4
- package/tsconfig.json +7 -10
- package/web-dev-server.config.mjs +11 -1
- package/web-test-runner.config.mjs +11 -2
- package/babel.config.json +0 -3
- package/dist/Accordion.d.ts.map +0 -1
- package/dist/Button.d.ts.map +0 -1
- package/dist/ButtonGroup.d.ts.map +0 -1
- package/dist/Checkbox.d.ts.map +0 -1
- package/dist/CheckboxGroup.d.ts.map +0 -1
- package/dist/Chip.d.ts.map +0 -1
- package/dist/ChipGroup.d.ts.map +0 -1
- package/dist/ChipLink.d.ts.map +0 -1
- package/dist/ChipRemovable.d.ts.map +0 -1
- package/dist/ChipSelectable.d.ts.map +0 -1
- package/dist/Dialog.d.ts.map +0 -1
- package/dist/Dropdown.d.ts.map +0 -1
- package/dist/Icon.d.ts.map +0 -1
- package/dist/Input.d.ts.map +0 -1
- package/dist/LeuElement-Dd6zm9XF.d.ts +0 -7
- package/dist/LeuElement-Dd6zm9XF.d.ts.map +0 -1
- package/dist/LeuElement-Dd6zm9XF.js +0 -70
- package/dist/Menu.d.ts.map +0 -1
- package/dist/MenuItem.d.ts.map +0 -1
- package/dist/Pagination.d.ts.map +0 -1
- package/dist/Popup.d.ts.map +0 -1
- package/dist/Radio.d.ts.map +0 -1
- package/dist/RadioGroup.d.ts.map +0 -1
- package/dist/Range.d.ts.map +0 -1
- package/dist/ScrollTop.d.ts.map +0 -1
- package/dist/Select.d.ts.map +0 -1
- package/dist/Spinner.d.ts.map +0 -1
- package/dist/Table.d.ts.map +0 -1
- package/dist/VisuallyHidden.d.ts.map +0 -1
- package/dist/hasSlotController-dQsSUUpb.d.ts +0 -38
- package/dist/hasSlotController-dQsSUUpb.d.ts.map +0 -1
- package/dist/hasSlotController-dQsSUUpb.js +0 -75
- package/dist/leu-accordion.d.ts.map +0 -1
- package/dist/leu-button-group.d.ts.map +0 -1
- package/dist/leu-button.d.ts.map +0 -1
- package/dist/leu-checkbox-group.d.ts.map +0 -1
- package/dist/leu-checkbox.d.ts.map +0 -1
- package/dist/leu-chip-group.d.ts.map +0 -1
- package/dist/leu-chip-link.d.ts.map +0 -1
- package/dist/leu-chip-removable.d.ts.map +0 -1
- package/dist/leu-chip-selectable.d.ts.map +0 -1
- package/dist/leu-dialog.d.ts.map +0 -1
- package/dist/leu-dropdown.d.ts.map +0 -1
- package/dist/leu-icon.d.ts.map +0 -1
- package/dist/leu-input.d.ts.map +0 -1
- package/dist/leu-menu-item.d.ts.map +0 -1
- package/dist/leu-menu.d.ts.map +0 -1
- package/dist/leu-pagination.d.ts.map +0 -1
- package/dist/leu-popup.d.ts.map +0 -1
- package/dist/leu-radio-group.d.ts.map +0 -1
- package/dist/leu-radio.d.ts.map +0 -1
- package/dist/leu-range.d.ts.map +0 -1
- package/dist/leu-scroll-top.d.ts.map +0 -1
- package/dist/leu-select.d.ts.map +0 -1
- package/dist/leu-spinner.d.ts.map +0 -1
- package/dist/leu-table.d.ts.map +0 -1
- package/dist/leu-visually-hidden.d.ts.map +0 -1
- package/index.js +0 -17
- /package/.storybook/{manager.js → manager.ts} +0 -0
- /package/.storybook/{preview.js → preview.ts} +0 -0
- /package/scripts/generate-component/templates/{[namespace]-[name].js → [namespace]-[name].ts} +0 -0
- /package/scripts/generate-component/templates/stories/{[name].stories.js → [name].stories.ts} +0 -0
- /package/scripts/generate-component/templates/test/{[name].test.js → [name].test.ts} +0 -0
- /package/src/components/accordion/test/{accordion.test.js → accordion.test.ts} +0 -0
- /package/src/components/button/stories/{button.stories.js → button.stories.ts} +0 -0
- /package/src/components/button/test/{button.test.js → button.test.ts} +0 -0
- /package/src/components/button-group/stories/{button-group.stories.js → button-group.stories.ts} +0 -0
- /package/src/components/button-group/test/{button-group.test.js → button-group.test.ts} +0 -0
- /package/src/components/checkbox/stories/{checkbox-group.stories.js → checkbox-group.stories.ts} +0 -0
- /package/src/components/checkbox/stories/{checkbox.stories.js → checkbox.stories.ts} +0 -0
- /package/src/components/checkbox/test/{checkbox-group.test.js → checkbox-group.test.ts} +0 -0
- /package/src/components/checkbox/test/{checkbox.test.js → checkbox.test.ts} +0 -0
- /package/src/components/chip/{ChipLink.js → ChipLink.ts} +0 -0
- /package/src/components/chip/{ChipRemovable.js → ChipRemovable.ts} +0 -0
- /package/src/components/chip/{ChipSelectable.js → ChipSelectable.ts} +0 -0
- /package/src/components/chip/{exports.js → exports.ts} +0 -0
- /package/src/components/chip/stories/{chip-group.stories.js → chip-group.stories.ts} +0 -0
- /package/src/components/chip/stories/{chip-link.stories.js → chip-link.stories.ts} +0 -0
- /package/src/components/chip/stories/{chip-removable.stories.js → chip-removable.stories.ts} +0 -0
- /package/src/components/chip/stories/{chip-selectable.stories.js → chip-selectable.stories.ts} +0 -0
- /package/src/components/chip/test/{chip-group.test.js → chip-group.test.ts} +0 -0
- /package/src/components/chip/test/{chip-link.test.js → chip-link.test.ts} +0 -0
- /package/src/components/chip/test/{chip-removable.test.js → chip-removable.test.ts} +0 -0
- /package/src/components/chip/test/{chip-selectable.test.js → chip-selectable.test.ts} +0 -0
- /package/src/components/chip/test/{chip.test.js → chip.test.ts} +0 -0
- /package/src/components/dialog/stories/{dialog.stories.js → dialog.stories.ts} +0 -0
- /package/src/components/dialog/test/{dialog.test.js → dialog.test.ts} +0 -0
- /package/src/components/dropdown/stories/{dropdown.stories.js → dropdown.stories.ts} +0 -0
- /package/src/components/dropdown/test/{dropdown.test.js → dropdown.test.ts} +0 -0
- /package/src/components/icon/{paths.js → paths.ts} +0 -0
- /package/src/components/icon/stories/{icon.stories.js → icon.stories.ts} +0 -0
- /package/src/components/icon/test/{icon.test.js → icon.test.ts} +0 -0
- /package/src/components/input/stories/{input.stories.js → input.stories.ts} +0 -0
- /package/src/components/input/test/{input.test.js → input.test.ts} +0 -0
- /package/src/components/menu/stories/{menu-item.stories.js → menu-item.stories.ts} +0 -0
- /package/src/components/menu/stories/{menu.stories.js → menu.stories.ts} +0 -0
- /package/src/components/menu/test/{menu-item.test.js → menu-item.test.ts} +0 -0
- /package/src/components/menu/test/{menu.test.js → menu.test.ts} +0 -0
- /package/src/components/pagination/stories/{pagination.stories.js → pagination.stories.ts} +0 -0
- /package/src/components/pagination/test/{pagination.test.js → pagination.test.ts} +0 -0
- /package/src/components/popup/stories/{popup.stories.js → popup.stories.ts} +0 -0
- /package/src/components/popup/test/{popup.test.js → popup.test.ts} +0 -0
- /package/src/components/radio/stories/{radio-group.stories.js → radio-group.stories.ts} +0 -0
- /package/src/components/radio/stories/{radio.stories.js → radio.stories.ts} +0 -0
- /package/src/components/radio/test/{radio-group.test.js → radio-group.test.ts} +0 -0
- /package/src/components/radio/test/{radio.test.js → radio.test.ts} +0 -0
- /package/src/components/range/{Range.js → Range.ts} +0 -0
- /package/src/components/range/stories/{range-slider.stories.js → range-slider.stories.ts} +0 -0
- /package/src/components/range/test/{range-test.js → range.test.ts} +0 -0
- /package/src/components/scroll-top/stories/{scroll-top.stories.js → scroll-top.stories.ts} +0 -0
- /package/src/components/scroll-top/test/{scroll-top.test.js → scroll-top.test.ts} +0 -0
- /package/src/components/select/stories/{select.stories.js → select.stories.ts} +0 -0
- /package/src/components/select/test/{select.test.js → select.test.ts} +0 -0
- /package/src/components/spinner/{Spinner.js → Spinner.ts} +0 -0
- /package/src/components/spinner/stories/{spinner.stories.js → spinner.stories.ts} +0 -0
- /package/src/components/spinner/test/{spinner.test.js → spinner.test.ts} +0 -0
- /package/src/components/table/stories/{table.stories.js → table.stories.ts} +0 -0
- /package/src/components/table/test/{table.test.js → table.test.ts} +0 -0
- /package/src/components/visually-hidden/stories/{visually-hidden.stories.js → visually-hidden.stories.ts} +0 -0
- /package/src/components/visually-hidden/test/{visually-hidden.test.js → visually-hidden.test.ts} +0 -0
- /package/src/lib/{utils.js → utils.ts} +0 -0
- /package/src/styles/{style.stories.js → style.stories.ts} +0 -0
package/dist/Range.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
1
|
import { css, html } from 'lit';
|
|
2
|
+
import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
|
|
3
3
|
|
|
4
4
|
var css_248z = css`:host {
|
|
5
5
|
--range-color: var(--leu-color-black-40);
|
|
@@ -189,168 +189,166 @@ var css_248z = css`:host {
|
|
|
189
189
|
`;
|
|
190
190
|
|
|
191
191
|
const defaultValueConverter = {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
fromAttribute(value) {
|
|
193
|
+
return value.split(",").map((v) => Number(v.trim()));
|
|
194
|
+
},
|
|
195
|
+
toAttribute(value) {
|
|
196
|
+
return value.join(",");
|
|
197
|
+
},
|
|
198
198
|
};
|
|
199
199
|
const RANGE_LABELS = ["Von", "Bis"];
|
|
200
|
-
|
|
201
200
|
/**
|
|
202
201
|
* @tagname leu-range
|
|
203
202
|
*/
|
|
204
203
|
class LeuRange extends LeuElement {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
204
|
+
constructor() {
|
|
205
|
+
super();
|
|
206
|
+
this.defaultValue = [50];
|
|
207
|
+
this.min = 0;
|
|
208
|
+
this.max = 100;
|
|
209
|
+
this.step = 1;
|
|
210
|
+
this.name = "";
|
|
211
|
+
this.label = "";
|
|
212
|
+
this.disabled = false;
|
|
213
|
+
this.multiple = false;
|
|
214
|
+
}
|
|
215
|
+
updated() {
|
|
216
|
+
this._updateStyles();
|
|
217
|
+
}
|
|
218
|
+
_updateStyles() {
|
|
219
|
+
const normalizedRange = this._getNormalizedRange();
|
|
220
|
+
this.style.setProperty("--low", normalizedRange[0].toString());
|
|
221
|
+
this.style.setProperty("--high", normalizedRange[1].toString());
|
|
222
|
+
const inputs = this.multiple
|
|
223
|
+
? [this._getBaseInput(), this._getGhostInput()]
|
|
224
|
+
: [this._getBaseInput()];
|
|
225
|
+
inputs.forEach((input) => {
|
|
226
|
+
/** @type {HTMLOutputElement} */
|
|
227
|
+
const output = this.shadowRoot.querySelector(`.output[for=${input.id}]`);
|
|
228
|
+
const normalizedValue = this._getNormalizedValue(input.valueAsNumber);
|
|
229
|
+
output.style.setProperty("--value", normalizedValue.toString());
|
|
230
|
+
output.value = input.value;
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
get value() {
|
|
234
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
|
|
235
|
+
return inputs.map((input) => input.value).join(",");
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Sets the value of the underlying input element(s).
|
|
239
|
+
* The value has to be an array if "multiple" range is used.
|
|
240
|
+
* Otherwise it has to be a string.
|
|
241
|
+
* @param {string | Array} value
|
|
242
|
+
*/
|
|
243
|
+
set value(value) {
|
|
244
|
+
if (this.multiple && Array.isArray(value)) {
|
|
245
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
|
|
246
|
+
value.forEach((v, i) => {
|
|
247
|
+
inputs[i].value = v;
|
|
248
|
+
});
|
|
249
|
+
this._updateStyles();
|
|
250
|
+
}
|
|
251
|
+
else if (!this.multiple) {
|
|
252
|
+
this._getBaseInput().value = value;
|
|
253
|
+
this._updateStyles();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
get valueAsArray() {
|
|
257
|
+
return Array.from(this.shadowRoot.querySelectorAll("input")).map((input) => input.valueAsNumber);
|
|
258
|
+
}
|
|
259
|
+
get valueLow() {
|
|
260
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
|
|
261
|
+
if (this.multiple) {
|
|
262
|
+
return inputs.map((input) => input.valueAsNumber).sort((a, b) => a - b)[0];
|
|
263
|
+
}
|
|
264
|
+
return inputs[0].value;
|
|
253
265
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
if (this.multiple) {
|
|
261
|
-
return inputs.map(input => input.valueAsNumber).sort((a, b) => a - b)[0];
|
|
266
|
+
get valueHigh() {
|
|
267
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
|
|
268
|
+
if (this.multiple) {
|
|
269
|
+
return inputs.map((input) => input.valueAsNumber).sort((a, b) => a - b)[1];
|
|
270
|
+
}
|
|
271
|
+
return inputs[0].value;
|
|
262
272
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return inputs.map(input => input.valueAsNumber).sort((a, b) => a - b)[1];
|
|
273
|
+
/**
|
|
274
|
+
* @returns {HTMLInputElement | null}
|
|
275
|
+
*/
|
|
276
|
+
_getBaseInput() {
|
|
277
|
+
return this.shadowRoot.querySelector(".range--base");
|
|
269
278
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
*/
|
|
276
|
-
_getBaseInput() {
|
|
277
|
-
return this.shadowRoot.querySelector(".range--base");
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* @returns {HTMLInputElement | null}
|
|
282
|
-
*/
|
|
283
|
-
_getGhostInput() {
|
|
284
|
-
return this.shadowRoot.querySelector(".range--ghost");
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
*
|
|
289
|
-
* @param {number} _index
|
|
290
|
-
* @param {InputEvent & {target: HTMLInputElement}} _e
|
|
291
|
-
*/
|
|
292
|
-
_handleInput(_index, _e) {
|
|
293
|
-
this._updateStyles();
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
*
|
|
298
|
-
* @param {number} value
|
|
299
|
-
* @returns {number}
|
|
300
|
-
*/
|
|
301
|
-
_getNormalizedValue(value) {
|
|
302
|
-
return (value - this.min) / (this.max - this.min);
|
|
303
|
-
}
|
|
304
|
-
_getNormalizedRange() {
|
|
305
|
-
if (this.multiple) {
|
|
306
|
-
return this.valueAsArray.map(value => this._getNormalizedValue(value)).sort((a, b) => a - b);
|
|
279
|
+
/**
|
|
280
|
+
* @returns {HTMLInputElement | null}
|
|
281
|
+
*/
|
|
282
|
+
_getGhostInput() {
|
|
283
|
+
return this.shadowRoot.querySelector(".range--ghost");
|
|
307
284
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
*/
|
|
316
|
-
_handlePointerDown(e) {
|
|
317
|
-
const clickValue = this.min + (this.max - this.min) * e.offsetX / this.offsetWidth;
|
|
318
|
-
const middleValue = (this.valueAsArray[0] + this.valueAsArray[1]) / 2;
|
|
319
|
-
if (e.target.valueAsNumber === this.valueLow === clickValue > middleValue) {
|
|
320
|
-
/**
|
|
321
|
-
* As the pointerdown event is fired before the input event, we first overwrite the value
|
|
322
|
-
* of the input element that was not clicked on. The active input element will update itself.
|
|
323
|
-
*/
|
|
324
|
-
// this._value = [e.target.valueAsNumber, e.target.valueAsNumber]
|
|
325
|
-
this._getGhostInput().value = e.target.value;
|
|
285
|
+
/**
|
|
286
|
+
*
|
|
287
|
+
* @param {number} _index
|
|
288
|
+
* @param {InputEvent & {target: HTMLInputElement}} _e
|
|
289
|
+
*/
|
|
290
|
+
_handleInput(_index, _e) {
|
|
291
|
+
this._updateStyles();
|
|
326
292
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* @param {number} value
|
|
296
|
+
* @returns {number}
|
|
297
|
+
*/
|
|
298
|
+
_getNormalizedValue(value) {
|
|
299
|
+
return (value - this.min) / (this.max - this.min);
|
|
300
|
+
}
|
|
301
|
+
_getNormalizedRange() {
|
|
302
|
+
if (this.multiple) {
|
|
303
|
+
return this.valueAsArray
|
|
304
|
+
.map((value) => this._getNormalizedValue(value))
|
|
305
|
+
.sort((a, b) => a - b);
|
|
306
|
+
}
|
|
307
|
+
return [0, this._getNormalizedValue(this.valueAsArray[0])];
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Determine if the "click" (pointer event) is closer the
|
|
311
|
+
* the value of the other input element. Swap the values if this is the case.
|
|
312
|
+
* @param {PointerEvent & {target: HTMLInputElement}} e
|
|
313
|
+
*/
|
|
314
|
+
_handlePointerDown(e) {
|
|
315
|
+
const clickValue = this.min + ((this.max - this.min) * e.offsetX) / this.offsetWidth;
|
|
316
|
+
const middleValue = (this.valueAsArray[0] + this.valueAsArray[1]) / 2;
|
|
317
|
+
if ((e.target.valueAsNumber === this.valueLow) ===
|
|
318
|
+
clickValue > middleValue) {
|
|
319
|
+
/**
|
|
320
|
+
* As the pointerdown event is fired before the input event, we first overwrite the value
|
|
321
|
+
* of the input element that was not clicked on. The active input element will update itself.
|
|
322
|
+
*/
|
|
323
|
+
// this._value = [e.target.valueAsNumber, e.target.valueAsNumber]
|
|
324
|
+
this._getGhostInput().value = e.target.value;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
render() {
|
|
328
|
+
const inputs = this.multiple ? ["base", "ghost"] : ["base"];
|
|
329
|
+
const { multiple, disabled, label, defaultValue } = this;
|
|
330
|
+
return html `
|
|
337
331
|
<div
|
|
338
332
|
role=${multiple ? "group" : undefined}
|
|
339
333
|
aria-labelledby=${multiple ? "group-label" : undefined}
|
|
340
334
|
>
|
|
341
|
-
${multiple
|
|
335
|
+
${multiple
|
|
336
|
+
? html `<span id="group-label" class="label">${label}</span>`
|
|
337
|
+
: html `<label for="input-base" class="label">${label}</label>`}
|
|
342
338
|
<div class="outputs">
|
|
343
|
-
${inputs.map((type, index) => html`<output
|
|
339
|
+
${inputs.map((type, index) => html `<output
|
|
344
340
|
class="output"
|
|
345
341
|
for="input-${type}"
|
|
346
342
|
value=${defaultValue[index]}
|
|
347
343
|
></output>`)}
|
|
348
344
|
</div>
|
|
349
345
|
<div class="inputs">
|
|
350
|
-
${inputs.map((type, index) => html`
|
|
346
|
+
${inputs.map((type, index) => html `
|
|
351
347
|
<input
|
|
352
|
-
@input=${e => this._handleInput(index, e)}
|
|
353
|
-
@pointerdown=${multiple && !disabled && index === 0
|
|
348
|
+
@input=${(e) => this._handleInput(index, e)}
|
|
349
|
+
@pointerdown=${multiple && !disabled && index === 0
|
|
350
|
+
? this._handlePointerDown
|
|
351
|
+
: undefined}
|
|
354
352
|
type="range"
|
|
355
353
|
class="range range--${type}"
|
|
356
354
|
id="input-${type}"
|
|
@@ -366,46 +364,22 @@ class LeuRange extends LeuElement {
|
|
|
366
364
|
</div>
|
|
367
365
|
</div>
|
|
368
366
|
`;
|
|
369
|
-
|
|
367
|
+
}
|
|
370
368
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
type:
|
|
383
|
-
reflect: true
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
type: Number,
|
|
387
|
-
reflect: true
|
|
388
|
-
},
|
|
389
|
-
step: {
|
|
390
|
-
type: Number,
|
|
391
|
-
reflect: true
|
|
392
|
-
},
|
|
393
|
-
name: {
|
|
394
|
-
type: String,
|
|
395
|
-
reflect: true
|
|
396
|
-
},
|
|
397
|
-
label: {
|
|
398
|
-
type: String,
|
|
399
|
-
reflect: true
|
|
400
|
-
},
|
|
401
|
-
disabled: {
|
|
402
|
-
type: Boolean,
|
|
403
|
-
reflect: true
|
|
404
|
-
},
|
|
405
|
-
multiple: {
|
|
406
|
-
type: Boolean,
|
|
407
|
-
reflect: true
|
|
408
|
-
}
|
|
409
|
-
});
|
|
369
|
+
LeuRange.styles = [LeuElement.styles, css_248z];
|
|
370
|
+
LeuRange.shadowRootOptions = {
|
|
371
|
+
...LeuElement.shadowRootOptions,
|
|
372
|
+
delegatesFocus: true,
|
|
373
|
+
};
|
|
374
|
+
LeuRange.properties = {
|
|
375
|
+
defaultValue: { converter: defaultValueConverter, attribute: "value" },
|
|
376
|
+
min: { type: Number, reflect: true },
|
|
377
|
+
max: { type: Number, reflect: true },
|
|
378
|
+
step: { type: Number, reflect: true },
|
|
379
|
+
name: { type: String, reflect: true },
|
|
380
|
+
label: { type: String, reflect: true },
|
|
381
|
+
disabled: { type: Boolean, reflect: true },
|
|
382
|
+
multiple: { type: Boolean, reflect: true },
|
|
383
|
+
};
|
|
410
384
|
|
|
411
385
|
export { LeuRange };
|
package/dist/ScrollTop.d.ts
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
|
+
import { LeuButton } from './Button.js';
|
|
5
|
+
import { LeuIcon } from './Icon.js';
|
|
6
|
+
import './hasSlotController.d-emXwVXWF.js';
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* @tagname leu-scroll-top
|
|
3
10
|
*/
|
|
4
|
-
|
|
11
|
+
declare class LeuScrollTop extends LeuElement {
|
|
12
|
+
static dependencies: {
|
|
13
|
+
"leu-button": typeof LeuButton;
|
|
14
|
+
"leu-icon": typeof LeuIcon;
|
|
15
|
+
};
|
|
16
|
+
static styles: lit.CSSResultGroup[];
|
|
17
|
+
static properties: {
|
|
18
|
+
_showButton: {
|
|
19
|
+
state: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
constructor();
|
|
23
|
+
scroll: () => void;
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
disconnectedCallback(): void;
|
|
5
26
|
static scrollToTop(): void;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Only show the button when
|
|
9
|
-
* ... the current scroll position is greater than the window height (below-the-fold) and when
|
|
10
|
-
* ... scrolling up
|
|
11
|
-
*/
|
|
12
|
-
_showButton: boolean;
|
|
13
|
-
_prevYPos: number;
|
|
14
|
-
/** @internal */
|
|
15
|
-
_scrollListener: Function;
|
|
16
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
render(): lit_html.TemplateResult<1>;
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
|
|
30
|
+
export { LeuScrollTop };
|
package/dist/ScrollTop.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
1
|
import { css, html } from 'lit';
|
|
3
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
|
|
4
4
|
import { LeuButton } from './Button.js';
|
|
5
5
|
import { LeuIcon } from './Icon.js';
|
|
6
6
|
import 'lit/directives/if-defined.js';
|
|
7
|
-
import './hasSlotController-
|
|
7
|
+
import './hasSlotController-Bm2tipvG.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Return a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
|
|
@@ -12,7 +12,6 @@ import './hasSlotController-dQsSUUpb.js';
|
|
|
12
12
|
* @param {Number} timeout - Default is 500 ms
|
|
13
13
|
* @returns {Function} - Your function wrapped in a timeout function
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* Return a throttled function that only invokes func at most once per every wait milliseconds.
|
|
18
17
|
* @param {Function} func - Your function
|
|
@@ -20,15 +19,15 @@ import './hasSlotController-dQsSUUpb.js';
|
|
|
20
19
|
* @returns {Function} - Your function wrapped in a timeout function
|
|
21
20
|
*/
|
|
22
21
|
const throttle = function throttle(func, timeout = 500) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
let timer = null;
|
|
23
|
+
return (...args) => {
|
|
24
|
+
if (timer === null) {
|
|
25
|
+
func(...args);
|
|
26
|
+
timer = setTimeout(() => {
|
|
27
|
+
timer = null;
|
|
28
|
+
}, timeout);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
var css_248z = css`.scroll-top {
|
|
@@ -71,58 +70,57 @@ var css_248z = css`.scroll-top {
|
|
|
71
70
|
* @tagname leu-scroll-top
|
|
72
71
|
*/
|
|
73
72
|
class LeuScrollTop extends LeuElement {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return html`
|
|
73
|
+
constructor() {
|
|
74
|
+
super();
|
|
75
|
+
this.scroll = () => {
|
|
76
|
+
const delta = window.scrollY - this._prevYPos;
|
|
77
|
+
if (this._scrollDown) {
|
|
78
|
+
if (delta < 0) {
|
|
79
|
+
this._scrollDown = false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (delta > 0) {
|
|
83
|
+
this._scrollDown = true;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Only show the button when
|
|
87
|
+
* ... the current scroll position is greater than the window height (below-the-fold) and when
|
|
88
|
+
* ... scrolling up
|
|
89
|
+
*/
|
|
90
|
+
this._showButton = window.scrollY > window.innerHeight && !this._scrollDown;
|
|
91
|
+
this._prevYPos = window.scrollY;
|
|
92
|
+
};
|
|
93
|
+
/** @internal */
|
|
94
|
+
this._prevYPos = 0;
|
|
95
|
+
/** @internal */
|
|
96
|
+
this._showButton = false;
|
|
97
|
+
/** @internal */
|
|
98
|
+
this._scrollDown = false;
|
|
99
|
+
/** @internal */
|
|
100
|
+
this._scrollListener = undefined;
|
|
101
|
+
}
|
|
102
|
+
connectedCallback() {
|
|
103
|
+
super.connectedCallback();
|
|
104
|
+
this._scrollListener = throttle(this.scroll, 100);
|
|
105
|
+
document.addEventListener("scroll", this._scrollListener, true);
|
|
106
|
+
}
|
|
107
|
+
disconnectedCallback() {
|
|
108
|
+
document.removeEventListener("scroll", this._scrollListener, true);
|
|
109
|
+
super.disconnectedCallback();
|
|
110
|
+
}
|
|
111
|
+
static scrollToTop() {
|
|
112
|
+
window.scrollTo({
|
|
113
|
+
top: 0,
|
|
114
|
+
left: 0,
|
|
115
|
+
behavior: "smooth",
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
render() {
|
|
119
|
+
const cssClasses = {
|
|
120
|
+
"scroll-top": true,
|
|
121
|
+
hide: !this._showButton,
|
|
122
|
+
};
|
|
123
|
+
return html `
|
|
126
124
|
<div class=${classMap(cssClasses)}>
|
|
127
125
|
<leu-button
|
|
128
126
|
label="Zum Seitenanfang"
|
|
@@ -133,17 +131,15 @@ class LeuScrollTop extends LeuElement {
|
|
|
133
131
|
</leu-button>
|
|
134
132
|
</div>
|
|
135
133
|
`;
|
|
136
|
-
|
|
134
|
+
}
|
|
137
135
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
});
|
|
136
|
+
LeuScrollTop.dependencies = {
|
|
137
|
+
"leu-button": LeuButton,
|
|
138
|
+
"leu-icon": LeuIcon,
|
|
139
|
+
};
|
|
140
|
+
LeuScrollTop.styles = [LeuElement.styles, css_248z];
|
|
141
|
+
LeuScrollTop.properties = {
|
|
142
|
+
_showButton: { state: true },
|
|
143
|
+
};
|
|
148
144
|
|
|
149
145
|
export { LeuScrollTop };
|