godown 3.13.1 → 3.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alert.d.ts +0 -1
- package/alert.d.ts.map +1 -1
- package/alert.js.map +1 -1
- package/avatar.d.ts +0 -1
- package/avatar.d.ts.map +1 -1
- package/avatar.js.map +1 -1
- package/badge.d.ts +0 -1
- package/badge.d.ts.map +1 -1
- package/badge.js.map +1 -1
- package/breath.d.ts +0 -1
- package/breath.d.ts.map +1 -1
- package/breath.js.map +1 -1
- package/build/godown+lit.iife.js +16 -57
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +16 -57
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +16 -57
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +15 -47
- package/build/godown.iife.js.map +1 -1
- package/build/godown.js +15 -47
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +15 -47
- package/build/godown.umd.js.map +1 -1
- package/button.d.ts +0 -1
- package/button.d.ts.map +1 -1
- package/button.js.map +1 -1
- package/card.d.ts +0 -1
- package/card.d.ts.map +1 -1
- package/card.js.map +1 -1
- package/carousel.d.ts +0 -1
- package/carousel.d.ts.map +1 -1
- package/carousel.js.map +1 -1
- package/chip.d.ts +0 -1
- package/chip.d.ts.map +1 -1
- package/chip.js.map +1 -1
- package/custom-elements.json +1 -1
- package/details.d.ts +0 -1
- package/details.d.ts.map +1 -1
- package/details.js.map +1 -1
- package/dialog.d.ts +0 -1
- package/dialog.d.ts.map +1 -1
- package/dialog.js.map +1 -1
- package/divider.d.ts +0 -1
- package/divider.d.ts.map +1 -1
- package/divider.js.map +1 -1
- package/dragbox.d.ts +0 -1
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js.map +1 -1
- package/flex.d.ts +0 -1
- package/flex.d.ts.map +1 -1
- package/flex.js.map +1 -1
- package/form.d.ts +0 -1
- package/form.d.ts.map +1 -1
- package/form.js.map +1 -1
- package/grid.d.ts +0 -1
- package/grid.d.ts.map +1 -1
- package/grid.js.map +1 -1
- package/heading.d.ts +0 -1
- package/heading.d.ts.map +1 -1
- package/heading.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/input.d.ts +0 -1
- package/input.d.ts.map +1 -1
- package/input.js.map +1 -1
- package/internal/global-style.d.ts +13 -15
- package/internal/global-style.d.ts.map +1 -1
- package/internal/global-style.js +1 -1
- package/internal/global-style.js.map +1 -1
- package/internal/icons/caret-down.d.ts +0 -1
- package/internal/icons/caret-down.d.ts.map +1 -1
- package/internal/icons/caret-down.js +1 -1
- package/internal/icons/caret-down.js.map +1 -1
- package/internal/icons/caret-left.d.ts +0 -1
- package/internal/icons/caret-left.d.ts.map +1 -1
- package/internal/icons/caret-left.js +1 -1
- package/internal/icons/caret-left.js.map +1 -1
- package/internal/icons/caret-right.d.ts +0 -1
- package/internal/icons/caret-right.d.ts.map +1 -1
- package/internal/icons/caret-right.js +1 -1
- package/internal/icons/caret-right.js.map +1 -1
- package/internal/icons/eye-slash.d.ts +0 -1
- package/internal/icons/eye-slash.d.ts.map +1 -1
- package/internal/icons/eye-slash.js +1 -1
- package/internal/icons/eye-slash.js.map +1 -1
- package/internal/popover.d.ts +0 -1
- package/internal/popover.d.ts.map +1 -1
- package/internal/popover.js +1 -1
- package/internal/popover.js.map +1 -1
- package/internal/reset-style.d.ts +0 -1
- package/internal/reset-style.d.ts.map +1 -1
- package/internal/reset-style.js +2 -1
- package/internal/reset-style.js.map +1 -1
- package/internal/ring.d.ts +9 -10
- package/internal/ring.d.ts.map +1 -1
- package/internal/ring.js +1 -1
- package/internal/ring.js.map +1 -1
- package/internal/super-input.d.ts +32 -33
- package/internal/super-input.d.ts.map +1 -1
- package/internal/super-input.js +2 -1
- package/internal/super-input.js.map +1 -1
- package/internal/utils.d.ts +0 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.js +1 -1
- package/internal/utils.js.map +1 -1
- package/layout.d.ts +0 -1
- package/layout.d.ts.map +1 -1
- package/layout.js.map +1 -1
- package/link.d.ts +0 -1
- package/link.d.ts.map +1 -1
- package/link.js.map +1 -1
- package/package.json +5 -5
- package/popover.d.ts +0 -1
- package/popover.d.ts.map +1 -1
- package/popover.js.map +1 -1
- package/progress.d.ts +0 -1
- package/progress.d.ts.map +1 -1
- package/progress.js.map +1 -1
- package/range.d.ts +0 -1
- package/range.d.ts.map +1 -1
- package/range.js.map +1 -1
- package/rotate.d.ts +0 -1
- package/rotate.d.ts.map +1 -1
- package/rotate.js.map +1 -1
- package/router.d.ts +0 -1
- package/router.d.ts.map +1 -1
- package/router.js.map +1 -1
- package/select.d.ts +0 -1
- package/select.d.ts.map +1 -1
- package/select.js.map +1 -1
- package/skeleton.d.ts +0 -1
- package/skeleton.d.ts.map +1 -1
- package/skeleton.js.map +1 -1
- package/split.d.ts +0 -1
- package/split.d.ts.map +1 -1
- package/split.js.map +1 -1
- package/src/internal/popover.ts +1 -1
- package/src/web-components/alert/component.ts +1 -1
- package/src/web-components/breath/component.ts +1 -1
- package/src/web-components/router/component.ts +12 -12
- package/src/web-components/skeleton/component.ts +2 -2
- package/src/web-components/time/component.ts +1 -1
- package/switch.d.ts +0 -1
- package/switch.d.ts.map +1 -1
- package/switch.js.map +1 -1
- package/tabs.d.ts +0 -1
- package/tabs.d.ts.map +1 -1
- package/tabs.js.map +1 -1
- package/text.d.ts +0 -1
- package/text.d.ts.map +1 -1
- package/text.js.map +1 -1
- package/time.d.ts +0 -1
- package/time.d.ts.map +1 -1
- package/time.js.map +1 -1
- package/tooltip.d.ts +0 -1
- package/tooltip.d.ts.map +1 -1
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +0 -1
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js.map +1 -1
- package/web-components/alert/component.d.ts +20 -21
- package/web-components/alert/component.d.ts.map +1 -1
- package/web-components/alert/component.js +1 -1
- package/web-components/alert/component.js.map +1 -1
- package/web-components/alert/definition.d.ts +3 -4
- package/web-components/alert/definition.d.ts.map +1 -1
- package/web-components/alert/definition.js +1 -1
- package/web-components/alert/definition.js.map +1 -1
- package/web-components/avatar/component.d.ts +25 -26
- package/web-components/avatar/component.d.ts.map +1 -1
- package/web-components/avatar/component.js +1 -1
- package/web-components/avatar/component.js.map +1 -1
- package/web-components/avatar/definition.d.ts +3 -4
- package/web-components/avatar/definition.d.ts.map +1 -1
- package/web-components/avatar/definition.js +1 -1
- package/web-components/avatar/definition.js.map +1 -1
- package/web-components/badge/component.d.ts +7 -8
- package/web-components/badge/component.d.ts.map +1 -1
- package/web-components/badge/component.js +2 -1
- package/web-components/badge/component.js.map +1 -1
- package/web-components/badge/definition.d.ts +3 -4
- package/web-components/badge/definition.d.ts.map +1 -1
- package/web-components/badge/definition.js +1 -1
- package/web-components/badge/definition.js.map +1 -1
- package/web-components/breath/component.d.ts +28 -29
- package/web-components/breath/component.d.ts.map +1 -1
- package/web-components/breath/component.js +1 -1
- package/web-components/breath/component.js.map +1 -1
- package/web-components/breath/definition.d.ts +3 -4
- package/web-components/breath/definition.d.ts.map +1 -1
- package/web-components/breath/definition.js +1 -1
- package/web-components/breath/definition.js.map +1 -1
- package/web-components/button/component.d.ts +35 -36
- package/web-components/button/component.d.ts.map +1 -1
- package/web-components/button/component.js +1 -1
- package/web-components/button/component.js.map +1 -1
- package/web-components/button/definition.d.ts +3 -4
- package/web-components/button/definition.d.ts.map +1 -1
- package/web-components/button/definition.js +1 -1
- package/web-components/button/definition.js.map +1 -1
- package/web-components/card/component.d.ts +21 -22
- package/web-components/card/component.d.ts.map +1 -1
- package/web-components/card/component.js +1 -1
- package/web-components/card/component.js.map +1 -1
- package/web-components/card/definition.d.ts +3 -4
- package/web-components/card/definition.d.ts.map +1 -1
- package/web-components/card/definition.js +1 -1
- package/web-components/card/definition.js.map +1 -1
- package/web-components/carousel/component.d.ts +32 -33
- package/web-components/carousel/component.d.ts.map +1 -1
- package/web-components/carousel/component.js +2 -1
- package/web-components/carousel/component.js.map +1 -1
- package/web-components/carousel/definition.d.ts +3 -4
- package/web-components/carousel/definition.d.ts.map +1 -1
- package/web-components/carousel/definition.js +1 -1
- package/web-components/carousel/definition.js.map +1 -1
- package/web-components/chip/component.d.ts +21 -22
- package/web-components/chip/component.d.ts.map +1 -1
- package/web-components/chip/component.js +1 -1
- package/web-components/chip/component.js.map +1 -1
- package/web-components/chip/definition.d.ts +3 -4
- package/web-components/chip/definition.d.ts.map +1 -1
- package/web-components/chip/definition.js +1 -1
- package/web-components/chip/definition.js.map +1 -1
- package/web-components/details/component.d.ts +16 -17
- package/web-components/details/component.d.ts.map +1 -1
- package/web-components/details/component.js +1 -1
- package/web-components/details/component.js.map +1 -1
- package/web-components/details/definition.d.ts +3 -4
- package/web-components/details/definition.d.ts.map +1 -1
- package/web-components/details/definition.js +1 -1
- package/web-components/details/definition.js.map +1 -1
- package/web-components/dialog/component.d.ts +30 -31
- package/web-components/dialog/component.d.ts.map +1 -1
- package/web-components/dialog/component.js +1 -1
- package/web-components/dialog/component.js.map +1 -1
- package/web-components/dialog/definition.d.ts +3 -4
- package/web-components/dialog/definition.d.ts.map +1 -1
- package/web-components/dialog/definition.js +1 -1
- package/web-components/dialog/definition.js.map +1 -1
- package/web-components/divider/component.d.ts +9 -10
- package/web-components/divider/component.d.ts.map +1 -1
- package/web-components/divider/component.js +1 -1
- package/web-components/divider/component.js.map +1 -1
- package/web-components/divider/definition.d.ts +3 -4
- package/web-components/divider/definition.d.ts.map +1 -1
- package/web-components/divider/definition.js +1 -1
- package/web-components/divider/definition.js.map +1 -1
- package/web-components/dragbox/component.d.ts +31 -32
- package/web-components/dragbox/component.d.ts.map +1 -1
- package/web-components/dragbox/component.js +2 -1
- package/web-components/dragbox/component.js.map +1 -1
- package/web-components/dragbox/definition.d.ts +3 -4
- package/web-components/dragbox/definition.d.ts.map +1 -1
- package/web-components/dragbox/definition.js +1 -1
- package/web-components/dragbox/definition.js.map +1 -1
- package/web-components/flex/component.d.ts +26 -27
- package/web-components/flex/component.d.ts.map +1 -1
- package/web-components/flex/component.js +2 -1
- package/web-components/flex/component.js.map +1 -1
- package/web-components/flex/definition.d.ts +3 -4
- package/web-components/flex/definition.d.ts.map +1 -1
- package/web-components/flex/definition.js +1 -1
- package/web-components/flex/definition.js.map +1 -1
- package/web-components/form/component.d.ts +16 -17
- package/web-components/form/component.d.ts.map +1 -1
- package/web-components/form/component.js +2 -1
- package/web-components/form/component.js.map +1 -1
- package/web-components/form/definition.d.ts +3 -4
- package/web-components/form/definition.d.ts.map +1 -1
- package/web-components/form/definition.js +1 -1
- package/web-components/form/definition.js.map +1 -1
- package/web-components/grid/component.d.ts +30 -31
- package/web-components/grid/component.d.ts.map +1 -1
- package/web-components/grid/component.js +2 -1
- package/web-components/grid/component.js.map +1 -1
- package/web-components/grid/definition.d.ts +3 -4
- package/web-components/grid/definition.d.ts.map +1 -1
- package/web-components/grid/definition.js +1 -1
- package/web-components/grid/definition.js.map +1 -1
- package/web-components/heading/component.d.ts +23 -24
- package/web-components/heading/component.d.ts.map +1 -1
- package/web-components/heading/component.js +2 -1
- package/web-components/heading/component.js.map +1 -1
- package/web-components/heading/definition.d.ts +3 -4
- package/web-components/heading/definition.d.ts.map +1 -1
- package/web-components/heading/definition.js +1 -1
- package/web-components/heading/definition.js.map +1 -1
- package/web-components/input/component.d.ts +17 -18
- package/web-components/input/component.d.ts.map +1 -1
- package/web-components/input/component.js +1 -1
- package/web-components/input/component.js.map +1 -1
- package/web-components/input/definition.d.ts +3 -4
- package/web-components/input/definition.d.ts.map +1 -1
- package/web-components/input/definition.js +1 -1
- package/web-components/input/definition.js.map +1 -1
- package/web-components/layout/component.d.ts +18 -19
- package/web-components/layout/component.d.ts.map +1 -1
- package/web-components/layout/component.js +2 -1
- package/web-components/layout/component.js.map +1 -1
- package/web-components/layout/definition.d.ts +3 -4
- package/web-components/layout/definition.d.ts.map +1 -1
- package/web-components/layout/definition.js +1 -1
- package/web-components/layout/definition.js.map +1 -1
- package/web-components/link/component.d.ts +54 -55
- package/web-components/link/component.d.ts.map +1 -1
- package/web-components/link/component.js +2 -1
- package/web-components/link/component.js.map +1 -1
- package/web-components/link/definition.d.ts +3 -4
- package/web-components/link/definition.d.ts.map +1 -1
- package/web-components/link/definition.js +1 -1
- package/web-components/link/definition.js.map +1 -1
- package/web-components/popover/component.d.ts +28 -29
- package/web-components/popover/component.d.ts.map +1 -1
- package/web-components/popover/component.js +2 -1
- package/web-components/popover/component.js.map +1 -1
- package/web-components/popover/definition.d.ts +3 -4
- package/web-components/popover/definition.d.ts.map +1 -1
- package/web-components/popover/definition.js +1 -1
- package/web-components/popover/definition.js.map +1 -1
- package/web-components/progress/component.d.ts +8 -9
- package/web-components/progress/component.d.ts.map +1 -1
- package/web-components/progress/component.js +1 -1
- package/web-components/progress/component.js.map +1 -1
- package/web-components/progress/definition.d.ts +3 -4
- package/web-components/progress/definition.d.ts.map +1 -1
- package/web-components/progress/definition.js +1 -1
- package/web-components/progress/definition.js.map +1 -1
- package/web-components/range/component.d.ts +108 -109
- package/web-components/range/component.d.ts.map +1 -1
- package/web-components/range/component.js +1 -1
- package/web-components/range/component.js.map +1 -1
- package/web-components/range/definition.d.ts +3 -4
- package/web-components/range/definition.d.ts.map +1 -1
- package/web-components/range/definition.js +1 -1
- package/web-components/range/definition.js.map +1 -1
- package/web-components/rotate/component.d.ts +22 -23
- package/web-components/rotate/component.d.ts.map +1 -1
- package/web-components/rotate/component.js +1 -1
- package/web-components/rotate/component.js.map +1 -1
- package/web-components/rotate/definition.d.ts +3 -4
- package/web-components/rotate/definition.d.ts.map +1 -1
- package/web-components/rotate/definition.js +1 -1
- package/web-components/rotate/definition.js.map +1 -1
- package/web-components/router/component.d.ts +99 -100
- package/web-components/router/component.d.ts.map +1 -1
- package/web-components/router/component.js +2 -1
- package/web-components/router/component.js.map +1 -1
- package/web-components/router/definition.d.ts +3 -4
- package/web-components/router/definition.d.ts.map +1 -1
- package/web-components/router/definition.js +1 -1
- package/web-components/router/definition.js.map +1 -1
- package/web-components/select/component.d.ts +30 -31
- package/web-components/select/component.d.ts.map +1 -1
- package/web-components/select/component.js +2 -1
- package/web-components/select/component.js.map +1 -1
- package/web-components/select/definition.d.ts +3 -4
- package/web-components/select/definition.d.ts.map +1 -1
- package/web-components/select/definition.js +1 -1
- package/web-components/select/definition.js.map +1 -1
- package/web-components/skeleton/component.d.ts +11 -12
- package/web-components/skeleton/component.d.ts.map +1 -1
- package/web-components/skeleton/component.js +1 -1
- package/web-components/skeleton/component.js.map +1 -1
- package/web-components/skeleton/definition.d.ts +3 -4
- package/web-components/skeleton/definition.d.ts.map +1 -1
- package/web-components/skeleton/definition.js +1 -1
- package/web-components/skeleton/definition.js.map +1 -1
- package/web-components/split/component.d.ts +48 -49
- package/web-components/split/component.d.ts.map +1 -1
- package/web-components/split/component.js +1 -1
- package/web-components/split/component.js.map +1 -1
- package/web-components/split/definition.d.ts +3 -4
- package/web-components/split/definition.d.ts.map +1 -1
- package/web-components/split/definition.js +1 -1
- package/web-components/split/definition.js.map +1 -1
- package/web-components/switch/component.d.ts +20 -21
- package/web-components/switch/component.d.ts.map +1 -1
- package/web-components/switch/component.js +1 -1
- package/web-components/switch/component.js.map +1 -1
- package/web-components/switch/definition.d.ts +3 -4
- package/web-components/switch/definition.d.ts.map +1 -1
- package/web-components/switch/definition.js +1 -1
- package/web-components/switch/definition.js.map +1 -1
- package/web-components/tabs/component.d.ts +39 -40
- package/web-components/tabs/component.d.ts.map +1 -1
- package/web-components/tabs/component.js +1 -1
- package/web-components/tabs/component.js.map +1 -1
- package/web-components/tabs/definition.d.ts +3 -4
- package/web-components/tabs/definition.d.ts.map +1 -1
- package/web-components/tabs/definition.js +1 -1
- package/web-components/tabs/definition.js.map +1 -1
- package/web-components/text/component.d.ts +10 -11
- package/web-components/text/component.d.ts.map +1 -1
- package/web-components/text/component.js +1 -1
- package/web-components/text/component.js.map +1 -1
- package/web-components/text/definition.d.ts +3 -4
- package/web-components/text/definition.d.ts.map +1 -1
- package/web-components/text/definition.js +1 -1
- package/web-components/text/definition.js.map +1 -1
- package/web-components/time/component.d.ts +28 -29
- package/web-components/time/component.d.ts.map +1 -1
- package/web-components/time/component.js +1 -1
- package/web-components/time/component.js.map +1 -1
- package/web-components/time/definition.d.ts +3 -4
- package/web-components/time/definition.d.ts.map +1 -1
- package/web-components/time/definition.js +1 -1
- package/web-components/time/definition.js.map +1 -1
- package/web-components/tooltip/component.d.ts +19 -20
- package/web-components/tooltip/component.d.ts.map +1 -1
- package/web-components/tooltip/component.js +1 -1
- package/web-components/tooltip/component.js.map +1 -1
- package/web-components/tooltip/definition.d.ts +3 -4
- package/web-components/tooltip/definition.d.ts.map +1 -1
- package/web-components/tooltip/definition.js +1 -1
- package/web-components/tooltip/definition.js.map +1 -1
- package/web-components/typewriter/component.d.ts +43 -44
- package/web-components/typewriter/component.d.ts.map +1 -1
- package/web-components/typewriter/component.js +1 -1
- package/web-components/typewriter/component.js.map +1 -1
- package/web-components/typewriter/definition.d.ts +3 -4
- package/web-components/typewriter/definition.d.ts.map +1 -1
- package/web-components/typewriter/definition.js +1 -1
- package/web-components/typewriter/definition.js.map +1 -1
- package/web-types.json +1 -1
@@ -1,19 +1,18 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "../../internal/global-style.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
* {@linkcode Skeleton} renders a skeleton screen.
|
5
|
+
*
|
6
|
+
* @slot loading - The content if loading is true.
|
7
|
+
* @slot - The content if loading is false.
|
8
|
+
* @category feedback
|
9
|
+
*/
|
10
10
|
declare class Skeleton extends GlobalStyle {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
/**
|
12
|
+
* If false, render slot only.
|
13
|
+
*/
|
14
|
+
loading: boolean;
|
15
|
+
protected render(): TemplateResult<1>;
|
16
16
|
}
|
17
17
|
export default Skeleton;
|
18
18
|
export { Skeleton };
|
19
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAA+C,gCAAiC;;;;;;;;AAYzF,cAwCM,iBAAiB,YAAY;;;;CAIjC,AACA;CAEA,UAAU,UAAU,eAAe;AAQpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../src/web-components/skeleton/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { state } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\n\nconst protoName = \"skeleton\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Skeleton} renders a skeleton screen.\n *\n * @slot loading - The content if loading is true.\n * @slot - The content if loading is false.\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n ${cssScope}--from: var(${cssGlobalVars.background});\n ${cssScope}--to: var(${cssGlobalVars.passive});\n ${cssScope}--deg: 95deg;\n ${cssScope}--duration: 2s;\n height: 2em;\n width: 100%;\n flex-shrink: 0;\n overflow: hidden;\n background-color: transparent;\n background-size: 200% 100%;\n background-image: linear-gradient(\n var(${cssScope}--deg),\n var(${cssScope}--from) 36%,\n var(${cssScope}--to) 50%,\n var(${cssScope}--from) 64%\n );\n animation: _ var(${cssScope}--duration) ease-in-out infinite none running;\n }\n\n @keyframes _ {\n from {\n background-position: 150% center;\n }\n to {\n background-position: -50% center;\n }\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: block;\n }\n`)\nclass Skeleton extends GlobalStyle {\n /**\n * If false, render slot only.\n */\n @state()\n loading = true;\n\n protected render(): TemplateResult<1> {\n if (!this.loading) {\n return htmlSlot();\n }\n return html`\n <div part=\"root\">${htmlSlot(\"loading\")}</div>\n `;\n }\n}\n\nexport default Skeleton;\nexport { Skeleton };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,styles,htmlSlot}from"@godown/element";import{css,html}from"lit";import{state}from"lit/decorators.js";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`skeleton`,cssScope=scopePrefix(protoName);let Skeleton=class e extends GlobalStyle{constructor(...e){super(...e),this.loading=!0}render(){return this.loading?html`<div part="root">${htmlSlot(`loading`)}</div>`:htmlSlot()}};_decorate([state()],Skeleton.prototype,`loading`,void 0),Skeleton=_decorate([godown(protoName),styles(css`:host{${cssScope}--from:var(${cssGlobalVars.background});${cssScope}--to:var(${cssGlobalVars.passive});${cssScope}--deg:95deg;${cssScope}--duration:2s;height:2em;width:100%;flex-shrink:0;overflow:hidden;background-color:transparent;background-size:200% 100%;background-image:linear-gradient(var(${cssScope}--deg),var(${cssScope}--from) 36%,var(${cssScope}--to) 50%,var(${cssScope}--from) 64%);animation:_ var(${cssScope}--duration) ease-in-out infinite none running}@keyframes _{0%{background-position:150%center}to{background-position:-50%center}}[part=root]{display:contents}:host,:host([contents]) [part=root]{display:block}`)],Skeleton);var Skeleton$1=Skeleton;export{Skeleton,Skeleton$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/skeleton/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/skeleton/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { state } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\n\nconst protoName = \"skeleton\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Skeleton} renders a skeleton screen.\n *\n * @slot loading - The content if loading is true.\n * @slot - The content if loading is false.\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n ${cssScope}--from: var(${cssGlobalVars.background});\n ${cssScope}--to: var(${cssGlobalVars.passive});\n ${cssScope}--deg: 95deg;\n ${cssScope}--duration: 2s;\n height: 2em;\n width: 100%;\n flex-shrink: 0;\n overflow: hidden;\n background-color: transparent;\n background-size: 200% 100%;\n background-image: linear-gradient(\n var(${cssScope}--deg),\n var(${cssScope}--from) 36%,\n var(${cssScope}--to) 50%,\n var(${cssScope}--from) 64%\n );\n animation: _ var(${cssScope}--duration) ease-in-out infinite none running;\n }\n\n @keyframes _ {\n from {\n background-position: 150% center;\n }\n to {\n background-position: -50% center;\n }\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: block;\n }\n`)\nclass Skeleton extends GlobalStyle {\n /**\n * If false, render slot only.\n */\n @state()\n loading = true;\n\n protected render(): TemplateResult<1> {\n if (!this.loading) {\n return htmlSlot();\n }\n return html`\n <div part=\"root\">${htmlSlot(\"loading\")}</div>\n `;\n }\n}\n\nexport default Skeleton;\nexport { Skeleton };\n"],"names":["Skeleton"],"mappings":"kQAMA,MAAM,UAAY,WACZ,SAAW,YAAY,UAAU,CASvC,IAAA,SAAA,MAwCMA,UAAiB,WAAY,oCAKjC,SAAU,EAEA,QAA4B,CAIpC,OAHK,KAAK,QAGH,IAAI,CAAA,iBACQ,EAAE,SAAS,UAAU,CAAC,MACzC,CAAC,CAJQ,UAAU,AAKpB,CACF,EAvDA,WA4CE,OAAO,AAAA,EAAA,SAAA,UAAA,iBAAA,CA5CT,SAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,MAER,EAAE,SAAS,WAAY,EAAE,cAAc,WAAW,EAClD,EAAE,SAAS,SAAU,EAAE,cAAc,QAAQ,EAC7C,EAAE,SAAS,YACX,EAAE,SAAS,8JAQL,EAAE,SAAS,WACX,EAAE,SAAS,gBACX,EAAE,SAAS,cACX,EAAE,SAAS,6BAEA,EAAE,SAAS,+MAoBhC,CAAC,CAAC,AAAA,EAAA,SAAA,CAkBF,IAAA,WAAe"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import Skeleton from "./component.js";
|
2
2
|
export default Skeleton;
|
3
3
|
declare global {
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
interface HTMLElementTagNameMap {
|
5
|
+
"godown-skeleton": Skeleton;
|
6
|
+
}
|
7
7
|
}
|
8
|
-
//# sourceMappingURL=definition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,cAAc,gBAAiB;AAItC,eAAe;eAEA;WACH,sBAAsB;EAC9B,mBAAmB;CACpB;AACF","names":[],"sources":["../../../src/web-components/skeleton/definition.ts"],"sourcesContent":["import Skeleton from \"./component.js\";\n\nSkeleton.define();\n\nexport default Skeleton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-skeleton\": Skeleton;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Skeleton from"./component.js";Skeleton.define();export{Skeleton as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/skeleton/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/skeleton/definition.ts"],"sourcesContent":["import Skeleton from \"./component.js\";\n\nSkeleton.define();\n\nexport default Skeleton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-skeleton\": Skeleton;\n }\n}\n"],"names":[],"mappings":"qCAEA,SAAS,QAAQ"}
|
@@ -2,56 +2,55 @@ import { type HandlerEvent } from "@godown/element";
|
|
2
2
|
import { type TemplateResult } from "lit";
|
3
3
|
import { SuperInput } from "../../internal/super-input.js";
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
* {@linkcode Split} renders multiple input boxes.
|
6
|
+
*
|
7
|
+
* Input: will move the focus box backward until the complete input from start to end.
|
8
|
+
*
|
9
|
+
* Delete: will move the focus box forward until the first and no inputs for each.
|
10
|
+
*
|
11
|
+
* @fires input - Fires when the input value changes.
|
12
|
+
* @fires change - Fires when the input value changes.
|
13
|
+
* @fires focus - Fires when the input is focused.
|
14
|
+
* @fires blur - Fires when the input is blurred.
|
15
|
+
* @category input
|
16
|
+
*/
|
17
17
|
declare class Split extends SuperInput {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
18
|
+
/**
|
19
|
+
* The number of input boxes.
|
20
|
+
*/
|
21
|
+
len: number;
|
22
|
+
/**
|
23
|
+
* Focus index.
|
24
|
+
*/
|
25
|
+
index: number;
|
26
|
+
current: number;
|
27
|
+
currentValue: (string | void)[];
|
28
|
+
constructor();
|
29
|
+
get observedRecord(): Record<string, any>;
|
30
|
+
protected render(): TemplateResult<1>;
|
31
|
+
connectedCallback(): void;
|
32
|
+
protected _handleInput(e: HandlerEvent<HTMLInputElement, InputEvent>): void;
|
33
|
+
/**
|
34
|
+
* Fill input with data.
|
35
|
+
*
|
36
|
+
* If data is null
|
37
|
+
* - If current value is null, move to before.
|
38
|
+
* - If current value is not null, delete it.
|
39
|
+
*
|
40
|
+
* If data is not null
|
41
|
+
* - If current value is null, input data.
|
42
|
+
* - If current value is not null, input data and move to after.
|
43
|
+
*
|
44
|
+
* If data is multiple characters,
|
45
|
+
* Fill input with data[0] and call fillInput with data.slice(1).
|
46
|
+
*
|
47
|
+
* @param data Input event data.
|
48
|
+
*/
|
49
|
+
protected fillInput(data: string | null): void;
|
50
|
+
focus(): void;
|
51
|
+
focusAt(i: number): void;
|
52
|
+
blur(): void;
|
53
|
+
reset(): void;
|
54
54
|
}
|
55
55
|
export default Split;
|
56
56
|
export { Split };
|
57
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,cAAc,oBAAkF,iBAAkB;AAClH,cAAc,sBAAiC,KAAM;AAIrD,SAAS,kBAAkB,+BAAgC;;;;;;;;;;;;;;AAmB3D,cA2CM,cAAc,WAAW;;;;CAI7B,AACA;;;;CAKA,AACA;CAEA,AACA;CAEA,AACA;CAEA;CAYA,IAAI,kBAAkB;CAItB,UAAU,UAAU,eAAe;CAiCnC;CAKA,UAAU,aAAaA,GAAG,aAAa,kBAAkB;;;;;;;;;;;;;;;;;CA4BzD,UAAU,UAAUC;CA2CpB;CAKA,QAAQC;CAKR;CAMA;AAQD;AAED,eAAe;AACf,SAAS","names":["e: HandlerEvent<HTMLInputElement, InputEvent>","data: string | null","i: number"],"sources":["../../../src/web-components/split/component.ts"],"sourcesContent":["import { type HandlerEvent, attr, tokenList, godown, styles, loop, omit, StyleController } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder, ringTypeAttribute } from \"../../internal/ring.js\";\n\nconst protoName = \"split\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Split} renders multiple input boxes.\n *\n * Input: will move the focus box backward until the complete input from start to end.\n *\n * Delete: will move the focus box forward until the first and no inputs for each.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @fires focus - Fires when the input is focused.\n * @fires blur - Fires when the input is blurred.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n border-radius: 0.1em;\n width: fit-content;\n ${cssScope}--size: 2em;\n ${cssScope}--gap: .25em;\n }\n\n [part=\"root\"] {\n gap: var(${cssScope}--gap);\n position: relative;\n vertical-align: top;\n display: flex;\n justify-content: space-between;\n border-radius: inherit;\n }\n\n [part=\"input-box\"] {\n width: var(${cssScope}--size);\n height: var(${cssScope}--size);\n vertical-align: top;\n border-radius: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n opacity: 0;\n background: none;\n position: absolute;\n z-index: -1;\n }\n\n .focus,\n [part=\"input-box\"]:active {\n ${cssGlobalVars.ringColor}: var(${cssGlobalVars.active});\n }\n`)\nclass Split extends SuperInput {\n /**\n * The number of input boxes.\n */\n @property({ type: Number })\n len = 6;\n\n /**\n * Focus index.\n */\n @property({ type: Number })\n index = -1;\n\n @state()\n current = -1;\n\n @state()\n currentValue: (string | void)[] = [];\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({\n selector: \"[part=input-box]\",\n type: this.ringType,\n }).css,\n );\n }\n\n get observedRecord(): Record<string, any> {\n return omit(super.observedRecord, ringTypeAttribute);\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${loop(\n this.len,\n (index: number) => html`\n <span\n part=\"input-box\"\n ring-type=\"${this.ringType}\"\n class=\"${tokenList({ focus: this.current === index })}\"\n @click=\"${this.disabled ? null : () => this.focusAt(index)}\"\n >\n ${this.currentValue[index]}\n </span>\n `,\n )}\n <input\n part=\"input\"\n @blur=${this.blur}\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n .value=\"${\n /* Ensure that input always has a value of length this.len */\n this.value.padStart(this.len, \" \")\n }\"\n />\n </div>\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.reset();\n }\n\n protected _handleInput(e: HandlerEvent<HTMLInputElement, InputEvent>): void {\n e.stopPropagation();\n if (this.compositing) {\n return;\n }\n\n this.fillInput(e.data);\n this.value = this.currentValue.join(\"\");\n\n this.dispatchCustomEvent(\"input\", this.value, { bubbles: true });\n }\n\n /**\n * Fill input with data.\n *\n * If data is null\n * - If current value is null, move to before.\n * - If current value is not null, delete it.\n *\n * If data is not null\n * - If current value is null, input data.\n * - If current value is not null, input data and move to after.\n *\n * If data is multiple characters,\n * Fill input with data[0] and call fillInput with data.slice(1).\n *\n * @param data Input event data.\n */\n protected fillInput(data: string | null): void {\n if (data === null) {\n // delete\n\n if (this.currentValue[this.current] !== null) {\n // delete exist value\n\n this.currentValue[this.current] = null;\n } else {\n // go to before\n\n this.currentValue[this.current - 1] = null;\n const lastNotNull = this.currentValue.findLastIndex((a) => a !== null);\n this.current = this.current - 1 < 0 ? (lastNotNull < 0 ? 0 : lastNotNull) : this.current - 1;\n }\n return;\n }\n\n const multiple = data.length > 1;\n\n // input\n this.currentValue[this.current] = data[0];\n if (this.current + 1 >= this.len) {\n // index overflow\n\n this.current = this.currentValue.indexOf(null);\n if (this.current === -1) {\n this.blur();\n }\n } else {\n // go to after\n\n this.current += 1;\n }\n\n if (multiple) {\n const after = data.slice(1);\n if (after) {\n this.fillInput(after);\n }\n }\n }\n\n focus(): void {\n this.focusAt(this.current);\n super.focus();\n }\n\n focusAt(i: number): void {\n this.current = i;\n this._input.focus();\n }\n\n blur(): void {\n this._input.blur();\n this.current = -1;\n super.blur();\n }\n\n reset(): void {\n this.current = -1;\n this.value = this.default;\n this.currentValue = this.value.split(\"\").concat(Array(this.len - this.value.length).fill(null));\n if (this.index > -1) {\n this.current = this.index;\n }\n }\n}\n\nexport default Split;\nexport { Split };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,styles,StyleController,omit,attr,loop,tokenList}from"@godown/element";import{css,html}from"lit";import{property,state}from"lit/decorators.js";import{scopePrefix,cssGlobalVars}from"../../internal/global-style.js";import{SuperInput}from"../../internal/super-input.js";import{RingBuilder,ringTypeAttribute}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`split`,cssScope=scopePrefix(protoName);let Split=class e extends SuperInput{constructor(){super(),this.len=6,this.index=-1,this.current=-1,this.currentValue=[],new StyleController(this,()=>new RingBuilder({selector:`[part=input-box]`,type:this.ringType}).css)}get observedRecord(){return omit(super.observedRecord,ringTypeAttribute)}render(){return html`<div part="root" ${attr(this.observedRecord)}> ${loop(this.len,e=>html`<span part="input-box" ring-type="${this.ringType}" class="${tokenList({focus:this.current===e})}" @click="${this.disabled?null:()=>this.focusAt(e)}"> ${this.currentValue[e]} </span>`)} <input part="input" @blur=${this.blur} @input="${this._handleInput}" @change="${this._handleChange}" .value="${this.value.padStart(this.len,` `)}"/> </div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(e){e.stopPropagation(),!this.compositing&&(this.fillInput(e.data),this.value=this.currentValue.join(``),this.dispatchCustomEvent(`input`,this.value,{bubbles:!0}))}fillInput(e){if(e===null){if(this.currentValue[this.current]!==null)this.currentValue[this.current]=null;else{this.currentValue[this.current-1]=null;let e=this.currentValue.findLastIndex(e=>e!==null);this.current=this.current-1<0?e<0?0:e:this.current-1}return}let b=e.length>1;if(this.currentValue[this.current]=e[0],this.current+1>=this.len?(this.current=this.currentValue.indexOf(null),this.current===-1&&this.blur()):this.current+=1,b){let b=e.slice(1);b&&this.fillInput(b)}}focus(){this.focusAt(this.current),super.focus()}focusAt(e){this.current=e,this._input.focus()}blur(){this._input.blur(),this.current=-1,super.blur()}reset(){this.current=-1,this.value=this.default,this.currentValue=this.value.split(``).concat(Array(this.len-this.value.length).fill(null)),this.index>-1&&(this.current=this.index)}};_decorate([property({type:Number})],Split.prototype,`len`,void 0),_decorate([property({type:Number})],Split.prototype,`index`,void 0),_decorate([state()],Split.prototype,`current`,void 0),_decorate([state()],Split.prototype,`currentValue`,void 0),Split=_decorate([godown(protoName),styles(css`:host{display:block;border-radius:.1em;width:-moz-fit-content;width:fit-content;${cssScope}--size:2em;${cssScope}--gap:.25em}[part=root]{gap:var(${cssScope}--gap);position:relative;vertical-align:top;display:flex;justify-content:space-between;border-radius:inherit}[part=input-box]{width:var(${cssScope}--size);height:var(${cssScope}--size);vertical-align:top;border-radius:inherit;display:inline-flex;align-items:center;justify-content:center}[part=input]{width:100%;height:100%;opacity:0;background:0 0;position:absolute;z-index:-1}.focus,[part=input-box]:active{${cssGlobalVars.ringColor}:var(${cssGlobalVars.active})}`)],Split);var Split$1=Split;export{Split,Split$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/split/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/split/component.ts"],"sourcesContent":["import { type HandlerEvent, attr, tokenList, godown, styles, loop, omit, StyleController } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder, ringTypeAttribute } from \"../../internal/ring.js\";\n\nconst protoName = \"split\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Split} renders multiple input boxes.\n *\n * Input: will move the focus box backward until the complete input from start to end.\n *\n * Delete: will move the focus box forward until the first and no inputs for each.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @fires focus - Fires when the input is focused.\n * @fires blur - Fires when the input is blurred.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n border-radius: 0.1em;\n width: fit-content;\n ${cssScope}--size: 2em;\n ${cssScope}--gap: .25em;\n }\n\n [part=\"root\"] {\n gap: var(${cssScope}--gap);\n position: relative;\n vertical-align: top;\n display: flex;\n justify-content: space-between;\n border-radius: inherit;\n }\n\n [part=\"input-box\"] {\n width: var(${cssScope}--size);\n height: var(${cssScope}--size);\n vertical-align: top;\n border-radius: inherit;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n opacity: 0;\n background: none;\n position: absolute;\n z-index: -1;\n }\n\n .focus,\n [part=\"input-box\"]:active {\n ${cssGlobalVars.ringColor}: var(${cssGlobalVars.active});\n }\n`)\nclass Split extends SuperInput {\n /**\n * The number of input boxes.\n */\n @property({ type: Number })\n len = 6;\n\n /**\n * Focus index.\n */\n @property({ type: Number })\n index = -1;\n\n @state()\n current = -1;\n\n @state()\n currentValue: (string | void)[] = [];\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({\n selector: \"[part=input-box]\",\n type: this.ringType,\n }).css,\n );\n }\n\n get observedRecord(): Record<string, any> {\n return omit(super.observedRecord, ringTypeAttribute);\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${loop(\n this.len,\n (index: number) => html`\n <span\n part=\"input-box\"\n ring-type=\"${this.ringType}\"\n class=\"${tokenList({ focus: this.current === index })}\"\n @click=\"${this.disabled ? null : () => this.focusAt(index)}\"\n >\n ${this.currentValue[index]}\n </span>\n `,\n )}\n <input\n part=\"input\"\n @blur=${this.blur}\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n .value=\"${\n /* Ensure that input always has a value of length this.len */\n this.value.padStart(this.len, \" \")\n }\"\n />\n </div>\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.reset();\n }\n\n protected _handleInput(e: HandlerEvent<HTMLInputElement, InputEvent>): void {\n e.stopPropagation();\n if (this.compositing) {\n return;\n }\n\n this.fillInput(e.data);\n this.value = this.currentValue.join(\"\");\n\n this.dispatchCustomEvent(\"input\", this.value, { bubbles: true });\n }\n\n /**\n * Fill input with data.\n *\n * If data is null\n * - If current value is null, move to before.\n * - If current value is not null, delete it.\n *\n * If data is not null\n * - If current value is null, input data.\n * - If current value is not null, input data and move to after.\n *\n * If data is multiple characters,\n * Fill input with data[0] and call fillInput with data.slice(1).\n *\n * @param data Input event data.\n */\n protected fillInput(data: string | null): void {\n if (data === null) {\n // delete\n\n if (this.currentValue[this.current] !== null) {\n // delete exist value\n\n this.currentValue[this.current] = null;\n } else {\n // go to before\n\n this.currentValue[this.current - 1] = null;\n const lastNotNull = this.currentValue.findLastIndex((a) => a !== null);\n this.current = this.current - 1 < 0 ? (lastNotNull < 0 ? 0 : lastNotNull) : this.current - 1;\n }\n return;\n }\n\n const multiple = data.length > 1;\n\n // input\n this.currentValue[this.current] = data[0];\n if (this.current + 1 >= this.len) {\n // index overflow\n\n this.current = this.currentValue.indexOf(null);\n if (this.current === -1) {\n this.blur();\n }\n } else {\n // go to after\n\n this.current += 1;\n }\n\n if (multiple) {\n const after = data.slice(1);\n if (after) {\n this.fillInput(after);\n }\n }\n }\n\n focus(): void {\n this.focusAt(this.current);\n super.focus();\n }\n\n focusAt(i: number): void {\n this.current = i;\n this._input.focus();\n }\n\n blur(): void {\n this._input.blur();\n this.current = -1;\n super.blur();\n }\n\n reset(): void {\n this.current = -1;\n this.value = this.default;\n this.currentValue = this.value.split(\"\").concat(Array(this.len - this.value.length).fill(null));\n if (this.index > -1) {\n this.current = this.index;\n }\n }\n}\n\nexport default Split;\nexport { Split };\n"],"names":["Split","index: number","index","e: HandlerEvent<HTMLInputElement, InputEvent>","data: string | null","data","lastNotNull","a","multiple","after","i: number","i"],"mappings":"uZAQA,MAAM,UAAY,QACZ,SAAW,YAAY,UAAU,CAevC,IAAA,MAAA,MA2CMA,UAAc,UAAW,CAmB7B,aAAc,CAEZ,AADA,OAAO,MAfT,IAAM,OAMN,MAAA,QAGA,QAAA,GAGA,KAAA,aAAkC,CAAE,EAIlC,IAAI,gBACF,KACA,IACE,IAAI,YAAY,CACd,SAAU,mBACV,KAAM,KAAK,QACZ,GAAE,IAER,CAED,IAAI,gBAAsC,CACxC,MAAO,MAAK,MAAM,eAAgB,kBAAkB,AACrD,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,KACA,KAAK,IACL,AAACC,GAAkB,IAAI,CAAA,kCAGR,EAAE,KAAK,SAAS,SACpB,EAAE,UAAU,CAAE,MAAO,KAAK,UAAYC,GAAQ,CAAC,UAC9C,EAAE,KAAK,SAAW,KAAO,IAAM,KAAK,QAAQA,EAAM,CAAC,GAE3D,EAAE,KAAK,aAAaA,GAAA,QAExB,CAAC,CACF,CAAA,2BAGO,EAAE,KAAK,KAAA,SACL,EAAE,KAAK,aAAa,WACnB,EAAE,KAAK,cAAc,UACtB,EAEN,KAAK,MAAM,SAAS,KAAK,IAAK,IAAI,CACnC,UAGP,CAAC,AACF,CAED,mBAA0B,CAExB,AADA,MAAM,mBAAmB,CACzB,KAAK,OAAO,AACb,CAES,aAAaC,EAAqD,CAC1E,EAAE,iBAAiB,EACf,KAAK,cAIT,KAAK,UAAU,EAAE,KAAK,CACtB,KAAK,MAAQ,KAAK,aAAa,KAAK,GAAG,CAEvC,KAAK,oBAAoB,QAAS,KAAK,MAAO,CAAE,SAAS,CAAM,EAAC,CACjE,CAkBS,UAAUC,EAA2B,CAC7C,GAAIC,IAAS,KAAM,CAGjB,GAAI,KAAK,aAAa,KAAK,WAAa,KAGtC,KAAK,aAAa,KAAK,SAAW,SAC7B,CAGL,KAAK,aAAa,KAAK,QAAU,GAAK,KACtC,IAAMC,EAAc,KAAK,aAAa,cAAc,AAACC,GAAMA,IAAM,KAAK,CACtE,KAAK,QAAU,KAAK,QAAU,EAAI,EAAKD,EAAc,EAAI,EAAIA,EAAe,KAAK,QAAU,CAC5F,CACD,MACD,CAED,IAAME,EAAWH,EAAK,OAAS,EAiB/B,GAdA,KAAK,aAAa,KAAK,SAAWA,EAAK,GACnC,KAAK,QAAU,GAAK,KAAK,KAG3B,KAAK,QAAU,KAAK,aAAa,QAAQ,KAAK,CAC1C,KAAK,cACP,KAAK,MAAM,EAKb,KAAK,SAAW,EAGdG,EAAU,CACZ,IAAMC,EAAQ,EAAK,MAAM,EAAE,CAC3B,AAAIA,GACF,KAAK,UAAUA,EAAM,AAExB,CACF,CAED,OAAc,CAEZ,AADA,KAAK,QAAQ,KAAK,QAAQ,CAC1B,MAAM,OAAO,AACd,CAED,QAAQC,EAAiB,CAEvB,AADA,KAAK,QAAUC,EACf,KAAK,OAAO,OAAO,AACpB,CAED,MAAa,CAGX,AAFA,KAAK,OAAO,MAAM,CAClB,KAAK,QAAA,GACL,MAAM,MAAM,AACb,CAED,OAAc,CAIZ,AAHA,KAAK,QAAA,GACL,KAAK,MAAQ,KAAK,QAClB,KAAK,aAAe,KAAK,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,KAAK,IAAM,KAAK,MAAM,OAAO,CAAC,KAAK,KAAK,CAAC,CAC3F,KAAK,WACP,KAAK,QAAU,KAAK,MAEvB,CACF,EAnNA,WA+CE,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,MAAA,UAAA,aAAA,YAM1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,MAAA,UAAA,eAAA,YAG1B,OAAO,AAAA,EAAA,MAAA,UAAA,iBAAA,YAGP,OAAO,AAAA,EAAA,MAAA,UAAA,sBAAA,CA3DT,MAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,gFAKR,EAAE,SAAS,WACX,EAAE,SAAS,gCAIF,EAAE,SAAS,wIAST,EAAE,SAAS,mBACV,EAAE,SAAS,wOAmBvB,EAAE,cAAc,UAAU,KAAM,EAAE,cAAc,OAAO,EAE3D,CAAC,CAAC,AAAA,EAAA,MAAA,CA2KF,IAAA,QAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,WAAW,gBAAiB;AAInC,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB;CACjB;AACF","names":[],"sources":["../../../src/web-components/split/definition.ts"],"sourcesContent":["import Split from \"./component.js\";\n\nSplit.define();\n\nexport default Split;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-split\": Split;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Split from"./component.js";Split.define();export{Split as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/split/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/split/definition.ts"],"sourcesContent":["import Split from \"./component.js\";\n\nSplit.define();\n\nexport default Split;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-split\": Split;\n }\n}\n"],"names":[],"mappings":"kCAEA,MAAM,QAAQ"}
|
@@ -1,28 +1,27 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { SuperInput } from "../../internal/super-input.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
* {@linkcode Switch} renders a switch.
|
5
|
+
*
|
6
|
+
* @fires change - Fires when the switch is switched.
|
7
|
+
* @category input
|
8
|
+
*/
|
9
9
|
declare class Switch extends SuperInput<boolean> {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
10
|
+
set checked(v: boolean);
|
11
|
+
get checked(): boolean;
|
12
|
+
/**
|
13
|
+
* Default checked state.
|
14
|
+
*/
|
15
|
+
default: boolean;
|
16
|
+
/**
|
17
|
+
* The current value of the switch component. Reflects the "checked" attribute.
|
18
|
+
*/
|
19
|
+
value: boolean;
|
20
|
+
get observedRecord(): Record<string, any>;
|
21
|
+
protected render(): TemplateResult<1>;
|
22
|
+
reset(): void;
|
23
|
+
protected _connectedInit(): void;
|
24
|
+
protected _handleChange(): void;
|
25
25
|
}
|
26
26
|
export default Switch;
|
27
27
|
export { Switch };
|
28
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC,KAAM;AAIrD,SAAS,kBAAkB,+BAAgC;;;;;;;AAY3D,cA0DM,eAAe,oBAAoB;CACvC,IAAI,QAAQA;CAIZ,IAAI;;;;CAOJ,AACA;;;;CAKA,AACA;CAEA,IAAI,kBAAkB;CAItB,UAAU,UAAU,eAAe;CAmBnC;CAKA,UAAU;CAWV,UAAU;AAKX;AAED,eAAe;AACf,SAAS","names":["v: boolean"],"sources":["../../../src/web-components/switch/component.ts"],"sourcesContent":["import { attr, godown, omit, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { ringTypeAttribute } from \"../../internal/ring.js\";\n\nconst protoName = \"switch\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Switch} renders a switch.\n *\n * @fires change - Fires when the switch is switched.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: inline-block;\n }\n\n :host {\n ${cssScope}-width: 3em;\n ${cssScope}-height: calc(var(${cssScope}-width) / 2);\n ${cssScope}-handle-size: 1.25em;\n ${cssScope}-handle-space: calc(var(${cssScope}-width) / 4 - var(${cssScope}-handle-size) / 2);\n width: var(${cssScope}-width);\n height: var(${cssScope}-height);\n border-radius: calc(var(${cssScope}-height) / 2);\n background: var(${cssGlobalVars.passive});\n vertical-align: bottom;\n transition: 0.2s ease-in-out;\n transition-property: background, left;\n }\n\n :host([checked]) {\n background: var(${cssGlobalVars.active});\n }\n\n [part=\"root\"] {\n display: flex;\n align-items: center;\n position: relative;\n transition: inherit;\n }\n\n [part=\"handle\"] {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n transition: inherit;\n left: 0;\n top: 50%;\n pointer-events: none;\n border-radius: 100%;\n background: var(${cssGlobalVars.background});\n width: var(${cssScope}-handle-size);\n height: var(${cssScope}-handle-size);\n transform: translateY(-50%) translateX(var(${cssScope}-handle-space));\n }\n\n :host([checked]) [part=\"handle\"] {\n left: 50%;\n }\n\n [part=\"input\"] {\n opacity: 0;\n width: 100%;\n height: 100%;\n }\n`)\nclass Switch extends SuperInput<boolean> {\n set checked(v: boolean) {\n this.value = v;\n }\n\n get checked(): boolean {\n return this.value;\n }\n\n /**\n * Default checked state.\n */\n @property({ type: Boolean })\n default = false;\n\n /**\n * The current value of the switch component. Reflects the \"checked\" attribute.\n */\n @property({ type: Boolean, attribute: \"checked\", reflect: true })\n value = false;\n\n get observedRecord(): Record<string, any> {\n return omit(super.observedRecord, ringTypeAttribute);\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n class=\"round\"\n >\n <input\n part=\"input\"\n type=\"checkbox\"\n ?disabled=\"${this.disabled}\"\n ?checked=\"${this.value}\"\n @change=\"${this._handleChange}\"\n />\n <span part=\"handle\"></span>\n </div>\n `;\n }\n\n reset(): void {\n this.value = this.default;\n this._input.checked = this.value;\n }\n\n protected _connectedInit(): void {\n if (this.default) {\n this.value = true;\n } else {\n if (this.value) {\n this.value = true;\n this.default = true;\n }\n }\n }\n\n protected _handleChange(): void {\n const { checked } = this._input;\n this.value = checked;\n this.dispatchCustomEvent(\"change\", this.value);\n }\n}\n\nexport default Switch;\nexport { Switch };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,styles,omit,attr}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{scopePrefix,cssGlobalVars}from"../../internal/global-style.js";import{SuperInput}from"../../internal/super-input.js";import{ringTypeAttribute}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`switch`,cssScope=scopePrefix(protoName);let Switch=class e extends SuperInput{constructor(...e){super(...e),this.default=!1,this.value=!1}set checked(e){this.value=e}get checked(){return this.value}get observedRecord(){return omit(super.observedRecord,ringTypeAttribute)}render(){return html`<div part="root" ${attr(this.observedRecord)} class="round"> <input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.value}" @change="${this._handleChange}"/> <span part="handle"></span> </div>`}reset(){this.value=this.default,this._input.checked=this.value}_connectedInit(){this.default?this.value=!0:this.value&&(this.value=!0,this.default=!0)}_handleChange(){let{checked:e}=this._input;this.value=e,this.dispatchCustomEvent(`change`,this.value)}};_decorate([property({type:Boolean})],Switch.prototype,`default`,void 0),_decorate([property({type:Boolean,attribute:`checked`,reflect:!0})],Switch.prototype,`value`,void 0),Switch=_decorate([godown(protoName),styles(css`:host,:host([contents]) [part=root]{display:inline-block}:host{${cssScope}-width:3em;${cssScope}-height:calc(var(${cssScope}-width)/2);${cssScope}-handle-size:1.25em;${cssScope}-handle-space:calc(var(${cssScope}-width)/4 - var(${cssScope}-handle-size)/2);width:var(${cssScope}-width);height:var(${cssScope}-height);border-radius:calc(var(${cssScope}-height)/2);background:var(${cssGlobalVars.passive});vertical-align:bottom;transition:.2s ease-in-out;transition-property:background,left}:host([checked]){background:var(${cssGlobalVars.active})}[part=root]{display:flex;align-items:center;position:relative;transition:inherit}[part=handle]{display:flex;align-items:center;justify-content:center;position:absolute;transition:inherit;left:0;top:50%;pointer-events:none;border-radius:100%;background:var(${cssGlobalVars.background});width:var(${cssScope}-handle-size);height:var(${cssScope}-handle-size);transform:translateY(-50%) translateX(var(${cssScope}-handle-space))}:host([checked]) [part=handle]{left:50%}[part=input]{opacity:0;width:100%;height:100%}`)],Switch);var Switch$1=Switch;export{Switch,Switch$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/switch/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/switch/component.ts"],"sourcesContent":["import { attr, godown, omit, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { ringTypeAttribute } from \"../../internal/ring.js\";\n\nconst protoName = \"switch\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Switch} renders a switch.\n *\n * @fires change - Fires when the switch is switched.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: inline-block;\n }\n\n :host {\n ${cssScope}-width: 3em;\n ${cssScope}-height: calc(var(${cssScope}-width) / 2);\n ${cssScope}-handle-size: 1.25em;\n ${cssScope}-handle-space: calc(var(${cssScope}-width) / 4 - var(${cssScope}-handle-size) / 2);\n width: var(${cssScope}-width);\n height: var(${cssScope}-height);\n border-radius: calc(var(${cssScope}-height) / 2);\n background: var(${cssGlobalVars.passive});\n vertical-align: bottom;\n transition: 0.2s ease-in-out;\n transition-property: background, left;\n }\n\n :host([checked]) {\n background: var(${cssGlobalVars.active});\n }\n\n [part=\"root\"] {\n display: flex;\n align-items: center;\n position: relative;\n transition: inherit;\n }\n\n [part=\"handle\"] {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n transition: inherit;\n left: 0;\n top: 50%;\n pointer-events: none;\n border-radius: 100%;\n background: var(${cssGlobalVars.background});\n width: var(${cssScope}-handle-size);\n height: var(${cssScope}-handle-size);\n transform: translateY(-50%) translateX(var(${cssScope}-handle-space));\n }\n\n :host([checked]) [part=\"handle\"] {\n left: 50%;\n }\n\n [part=\"input\"] {\n opacity: 0;\n width: 100%;\n height: 100%;\n }\n`)\nclass Switch extends SuperInput<boolean> {\n set checked(v: boolean) {\n this.value = v;\n }\n\n get checked(): boolean {\n return this.value;\n }\n\n /**\n * Default checked state.\n */\n @property({ type: Boolean })\n default = false;\n\n /**\n * The current value of the switch component. Reflects the \"checked\" attribute.\n */\n @property({ type: Boolean, attribute: \"checked\", reflect: true })\n value = false;\n\n get observedRecord(): Record<string, any> {\n return omit(super.observedRecord, ringTypeAttribute);\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n class=\"round\"\n >\n <input\n part=\"input\"\n type=\"checkbox\"\n ?disabled=\"${this.disabled}\"\n ?checked=\"${this.value}\"\n @change=\"${this._handleChange}\"\n />\n <span part=\"handle\"></span>\n </div>\n `;\n }\n\n reset(): void {\n this.value = this.default;\n this._input.checked = this.value;\n }\n\n protected _connectedInit(): void {\n if (this.default) {\n this.value = true;\n } else {\n if (this.value) {\n this.value = true;\n this.default = true;\n }\n }\n }\n\n protected _handleChange(): void {\n const { checked } = this._input;\n this.value = checked;\n this.dispatchCustomEvent(\"change\", this.value);\n }\n}\n\nexport default Switch;\nexport { Switch };\n"],"names":["Switch","v: boolean","v","checked"],"mappings":"sWAQA,MAAM,UAAY,SACZ,SAAW,YAAY,UAAU,CAQvC,IAAA,OAAA,MA0DMA,UAAe,UAAoB,oCAavC,SAAU,OAMV,OAAQ,EAlBR,IAAI,QAAQC,EAAY,CACtB,KAAK,MAAQC,CACd,CAED,IAAI,SAAmB,CACrB,OAAO,KAAK,KACb,CAcD,IAAI,gBAAsC,CACxC,MAAO,MAAK,MAAM,eAAgB,kBAAkB,AACrD,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,+DAMd,EAAE,KAAK,SAAS,YACjB,EAAE,KAAK,MAAM,WACd,EAAE,KAAK,cAAc,sCAIpC,CAAC,AACF,CAED,OAAc,CAEZ,AADA,KAAK,MAAQ,KAAK,QAClB,KAAK,OAAO,QAAU,KAAK,KAC5B,CAES,gBAAuB,CAC/B,AAAI,KAAK,QACP,KAAK,OAAQ,EAET,KAAK,QACP,KAAK,OAAQ,EACb,KAAK,SAAU,EAGpB,CAES,eAAsB,CAC9B,GAAM,CAAE,UAAS,CAAG,KAAK,OAEzB,AADA,KAAK,MAAQC,EACb,KAAK,oBAAoB,SAAU,KAAK,MAAM,AAC/C,CACF,EA3HA,WAsEE,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,OAAA,UAAA,iBAAA,YAM3B,SAAS,CAAE,KAAM,QAAS,UAAW,UAAW,SAAS,CAAM,EAAC,AAAA,EAAA,OAAA,UAAA,YAAA,GAAA,CA5ElE,OAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,+DAOR,EAAE,SAAS,WACX,EAAE,SAAS,iBAAkB,EAAE,SAAS,WACxC,EAAE,SAAS,oBACX,EAAE,SAAS,uBAAwB,EAAE,SAAS,gBAAkB,EAAE,SAAS,2BAChE,EAAE,SAAS,mBACV,EAAE,SAAS,gCACC,EAAE,SAAS,2BACnB,EAAE,cAAc,QAAQ,uHAOxB,EAAE,cAAc,OAAO,kQAoBvB,EAAE,cAAc,WAAW,YAChC,EAAE,SAAS,yBACV,EAAE,SAAS,wDACoB,EAAE,SAAS,sGAY1D,CAAC,CAAC,AAAA,EAAA,OAAA,CAoEF,IAAA,SAAe"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import Switch from "./component.js";
|
2
2
|
export default Switch;
|
3
3
|
declare global {
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
interface HTMLElementTagNameMap {
|
5
|
+
"godown-switch": Switch;
|
6
|
+
}
|
7
7
|
}
|
8
|
-
//# sourceMappingURL=definition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,YAAY,gBAAiB;AAIpC,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB;CAClB;AACF","names":[],"sources":["../../../src/web-components/switch/definition.ts"],"sourcesContent":["import Switch from \"./component.js\";\n\nSwitch.define();\n\nexport default Switch;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-switch\": Switch;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Switch from"./component.js";Switch.define();export{Switch as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/switch/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/switch/definition.ts"],"sourcesContent":["import Switch from \"./component.js\";\n\nSwitch.define();\n\nexport default Switch;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-switch\": Switch;\n }\n}\n"],"names":[],"mappings":"mCAEA,OAAO,QAAQ"}
|
@@ -2,47 +2,46 @@ import { GlobalStyle } from "../../internal/global-style.js";
|
|
2
2
|
import { type TemplateResult } from "lit";
|
3
3
|
import { type RingType } from "../../internal/ring.js";
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
* {@linkcode Tabs} used to render a set of tabs.
|
6
|
+
*
|
7
|
+
* @fires select - Fires when the tab index is changed.
|
8
|
+
* @category display
|
9
|
+
*/
|
10
10
|
declare class Tabs extends GlobalStyle {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
11
|
+
ringType: RingType;
|
12
|
+
/**
|
13
|
+
* If it is "select", the indicator moves from the selected content to the hover position.
|
14
|
+
*
|
15
|
+
* If it is "previous", the indicator moves from the last moved position to the hover position.
|
16
|
+
*
|
17
|
+
* If "none", the indicator will not move.
|
18
|
+
*/
|
19
|
+
beginning: "selected" | "previous" | "none";
|
20
|
+
/**
|
21
|
+
* The behavior of the indicator:
|
22
|
+
*
|
23
|
+
* If "background", its size will be consistent with that of a single tab.
|
24
|
+
*
|
25
|
+
* If "underline", an underline will be displayed at the bottom of the tab.
|
26
|
+
*/
|
27
|
+
indicator: "background" | "underline";
|
28
|
+
/**
|
29
|
+
* Tab list or slot list.
|
30
|
+
*/
|
31
|
+
tabs: string[];
|
32
|
+
/**
|
33
|
+
* The index of the currently selected tab.
|
34
|
+
*/
|
35
|
+
index: number;
|
36
|
+
protected previousIndex: number;
|
37
|
+
protected _items: HTMLCollectionOf<HTMLLIElement>;
|
38
|
+
protected _indicators: HTMLCollectionOf<HTMLDivElement>;
|
39
|
+
constructor();
|
40
|
+
render(): TemplateResult<1>;
|
41
|
+
connectedCallback(): void;
|
42
|
+
protected _handleMouseLeave(): void;
|
43
|
+
move(sourceIndex: number, targetIndex: number): void;
|
44
|
+
select(selected: number): void;
|
45
45
|
}
|
46
46
|
export default Tabs;
|
47
47
|
export { Tabs };
|
48
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,SAAwB,mBAAgC,gCAAiC;AACzF,cAAyB,sBAAsB,KAAM;AAErD,cAA8C,gBAAgB,wBAAyB;;;;;;;AAavF,cAyEM,aAAa,YAAY;CAC7B,AACA,UAAU;;;;;;;;CASV,AACA,WAAW,aAAa,aAAa;;;;;;;;CASrC,AACA,WAAW,eAAe;;;;CAK1B,AACA;;;;CAKA,AACA;CAEA,UAAU;CAEV,UACU,QAAQ,iBAAiB;CAEnC,UACU,aAAa,iBAAiB;CAExC;CAKA,UAAU,eAAe;CA0BzB;CAKA,UAAU;CAQV,KAAKA,qBAAqBC;CAsC1B,OAAOC;AASR;AAED,eAAe;AACf,SAAS","names":["sourceIndex: number","targetIndex: number","selected: number"],"sources":["../../../src/web-components/tabs/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles, tokenList } from \"@godown/element\";\nimport { cssGlobalVars, GlobalStyle, scopePrefix } from \"../../internal/global-style.js\";\nimport { css, html, type TemplateResult } from \"lit\";\nimport { property, queryAll } from \"lit/decorators.js\";\nimport { RingBuilder, ringTypeAttribute, type RingType } from \"../../internal/ring.js\";\n\nconst protoName = \"tabs\";\nconst cssScope = scopePrefix(protoName);\n\nconst hoverToken = \"hover\";\n\n/**\n * {@linkcode Tabs} used to render a set of tabs.\n *\n * @fires select - Fires when the tab index is changed.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n ${cssScope}--indicator-background: var(${cssGlobalVars.passive});\n ${cssScope}--selected-background: var(${cssGlobalVars.passive});\n transition: 0.2s ease-in-out;\n display: flex;\n cursor: default;\n }\n\n [part=\"root\"] {\n gap: 0.25em;\n padding: 0.25em;\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: inherit;\n overflow-x: clip;\n border-radius: inherit;\n transition: inherit;\n transition-property: width, transform, opacity;\n }\n\n [part~=\"item\"] {\n position: relative;\n width: 100%;\n display: block;\n text-align: center;\n position: relative;\n white-space: nowrap;\n transition: inherit;\n border-radius: inherit;\n transition-property: inherit;\n }\n\n [part=\"indicator\"],\n [part~=\"item\"]::after {\n width: 100%;\n height: 100%;\n inset: 0;\n position: absolute;\n transition: inherit;\n border-radius: inherit;\n transition-property: inherit;\n background: var(${cssScope}--indicator-background);\n }\n\n [part=\"indicator\"] {\n opacity: 0;\n z-index: -1;\n }\n\n [part~=\"item\"]::after {\n z-index: -2;\n }\n\n [indicator=\"underline\"] [part=\"indicator\"],\n [indicator=\"underline\"] [part~=\"item\"]::after {\n top: 100%;\n height: 0.15em;\n border-radius: 0.075em;\n margin-top: 0.15em;\n }\n\n [part~=\"selected\"]::after {\n content: \"\";\n background: var(${cssScope}--selected-background);\n }\n\n [part~=\"hover\"] [part=\"indicator\"] {\n opacity: 1;\n }\n`)\nclass Tabs extends GlobalStyle {\n @property({ attribute: ringTypeAttribute })\n ringType: RingType = \"border\";\n\n /**\n * If it is \"select\", the indicator moves from the selected content to the hover position.\n *\n * If it is \"previous\", the indicator moves from the last moved position to the hover position.\n *\n * If \"none\", the indicator will not move.\n */\n @property()\n beginning: \"selected\" | \"previous\" | \"none\" = \"selected\";\n\n /**\n * The behavior of the indicator:\n *\n * If \"background\", its size will be consistent with that of a single tab.\n *\n * If \"underline\", an underline will be displayed at the bottom of the tab.\n */\n @property()\n indicator: \"background\" | \"underline\" = \"background\";\n\n /**\n * Tab list or slot list.\n */\n @property({ type: Array })\n tabs: string[];\n\n /**\n * The index of the currently selected tab.\n */\n @property({ type: Number })\n index = 0;\n\n protected previousIndex: number;\n\n @queryAll(\"[part~=item]\")\n protected _items: HTMLCollectionOf<HTMLLIElement>;\n\n @queryAll(\"[part=indicator]\")\n protected _indicators: HTMLCollectionOf<HTMLDivElement>;\n\n constructor() {\n super();\n new StyleController(this, () => new RingBuilder({ type: this.ringType }).css);\n }\n\n render(): TemplateResult<1> {\n return html`\n <ul\n part=\"root\"\n ${attr(this.observedRecord)}\n @mouseleave=\"${this._handleMouseLeave}\"\n >\n ${this.tabs?.map(\n (tab, index) => html`\n <li\n part=\"${tokenList(\"item\", this.index === index && \"selected\")}\"\n @mouseenter=${() => {\n this.move(this.previousIndex, index);\n this.previousIndex = index;\n }}\n @click=${() => this.select(index)}\n >\n ${htmlSlot(tab, tab)}\n <div part=\"indicator\"></div>\n </li>\n `,\n )}\n </ul>\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.previousIndex = this.beginning === \"selected\" ? this.index : -1;\n }\n\n protected _handleMouseLeave(): void {\n const lastItem = this._items[this.previousIndex];\n if (lastItem) {\n lastItem.part.remove(hoverToken);\n }\n this.previousIndex = this.beginning === \"selected\" ? this.index : -1;\n }\n\n move(sourceIndex: number, targetIndex: number): void {\n if (sourceIndex === targetIndex) {\n return;\n }\n const { _items, _indicators } = this;\n const targetElement = _items[targetIndex];\n if (!targetElement) {\n return;\n }\n targetElement.part.add(hoverToken);\n const fromItem = _items[sourceIndex];\n if (!fromItem) {\n return;\n }\n fromItem.part.remove(hoverToken);\n if (this.beginning === \"none\") {\n return;\n }\n const targetIndicator = _indicators[targetIndex];\n const sourceIndicator = _indicators[sourceIndex];\n if (!targetIndicator || !sourceIndicator) {\n return;\n }\n const { x: sourceX, y: sourceY, width: sourceWidth } = sourceIndicator.getBoundingClientRect();\n const { x, y } = targetIndicator.getBoundingClientRect();\n const transformX = sourceX - x;\n const transformY = sourceY - y;\n\n const { style: targetStyle } = targetIndicator;\n const { style: sourceStyle } = sourceIndicator;\n\n targetStyle.transform = `translate3d(${transformX}px,${transformY}px,0)`;\n targetStyle.width = `${sourceWidth}px`;\n targetStyle.transition = sourceStyle.transition = \"none\";\n targetIndicator.getBoundingClientRect();\n targetStyle.width = targetStyle.transform = targetStyle.transition = sourceStyle.transition = \"\";\n }\n\n select(selected: number): void {\n const { index, previousIndex } = this;\n this.move(previousIndex, selected);\n if (selected !== index) {\n this.previousIndex = selected;\n this.index = selected;\n this.dispatchCustomEvent(\"select\", selected);\n }\n }\n}\n\nexport default Tabs;\nexport { Tabs };\n"],"version":3,"file":"component.d.ts"}
|