godown 3.13.0 → 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/global-style.ts +2 -2
- package/src/internal/popover.ts +9 -9
- package/src/web-components/alert/component.ts +6 -14
- package/src/web-components/breath/component.ts +1 -1
- package/src/web-components/button/component.ts +6 -12
- package/src/web-components/card/component.ts +1 -2
- package/src/web-components/input/component.ts +4 -4
- package/src/web-components/router/component.ts +12 -12
- package/src/web-components/select/component.ts +1 -0
- package/src/web-components/skeleton/component.ts +2 -2
- package/src/web-components/tabs/component.ts +1 -1
- 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,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"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,styles,StyleController,attr,tokenList,htmlSlot}from"@godown/element";import{scopePrefix,cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import{css,html}from"lit";import{property,queryAll}from"lit/decorators.js";import{ringTypeAttribute,RingBuilder}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`tabs`,cssScope=scopePrefix(protoName),hoverToken=`hover`;let Tabs=class e extends GlobalStyle{constructor(){super(),this.ringType=`border`,this.beginning=`selected`,this.indicator=`background`,this.index=0,new StyleController(this,()=>new RingBuilder({type:this.ringType}).css)}render(){return html`<ul part="root" ${attr(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map((e,a)=>html`<li part="${tokenList(`item`,this.index===a&&`selected`)}" @mouseenter=${()=>{this.move(this.previousIndex,a),this.previousIndex=a}} @click=${()=>this.select(a)}> ${htmlSlot(e,e)} <div part="indicator"></div> </li>`)} </ul>`}connectedCallback(){super.connectedCallback(),this.previousIndex=this.beginning===`selected`?this.index:-1}_handleMouseLeave(){let e=this._items[this.previousIndex];e&&e.part.remove(hoverToken),this.previousIndex=this.beginning===`selected`?this.index:-1}move(e,a){if(e===a)return;let{_items:o,_indicators:s}=this,c=o[a];if(!c)return;c.part.add(hoverToken);let l=o[e];if(!l||(l.part.remove(hoverToken),this.beginning===`none`))return;let u=s[a],d=s[e];if(!u||!d)return;let{x:f,y:p,width:m}=d.getBoundingClientRect(),{x:h,y:g}=u.getBoundingClientRect(),_=f-h,v=p-g,{style:y}=u,{style:b}=d;y.transform=`translate3d(${_}px,${v}px,0)`,y.width=`${m}px`,y.transition=b.transition=`none`,u.getBoundingClientRect(),y.width=y.transform=y.transition=b.transition=``}select(e){let{index:a,previousIndex:o}=this;this.move(o,e),e!==a&&(this.previousIndex=e,this.index=e,this.dispatchCustomEvent(`select`,e))}};_decorate([property({attribute:ringTypeAttribute})],Tabs.prototype,`ringType`,void 0),_decorate([property()],Tabs.prototype,`beginning`,void 0),_decorate([property()],Tabs.prototype,`indicator`,void 0),_decorate([property({type:Array})],Tabs.prototype,`tabs`,void 0),_decorate([property({type:Number})],Tabs.prototype,`index`,void 0),_decorate([queryAll(`[part~=item]`)],Tabs.prototype,`_items`,void 0),_decorate([queryAll(`[part=indicator]`)],Tabs.prototype,`_indicators`,void 0),Tabs=_decorate([godown(protoName),styles(css`:host{${cssScope}--indicator-background:var(${cssGlobalVars.passive});${cssScope}--selected-background:var(${cssGlobalVars.passive});transition:.2s ease-in-out;display:flex;cursor:default}[part=root]{gap:.25em;padding:.25em;position:relative;z-index:1;display:flex;flex-direction:inherit;overflow-x:clip;border-radius:inherit;transition:inherit;transition-property:width,transform,opacity}[part~=item]{position:relative;width:100%;display:block;text-align:center;position:relative;white-space:nowrap;transition:inherit;border-radius:inherit;transition-property:inherit}[part=indicator],[part~=item]::after{width:100%;height:100%;inset:0;position:absolute;transition:inherit;border-radius:inherit;transition-property:inherit;background:var(${cssScope}--indicator-background)}[part=indicator]{opacity:0;z-index:-1}[part~=item]::after{z-index:-2}[indicator=underline] [part=indicator],[indicator=underline] [part~=item]::after{top:100%;height:.15em;border-radius:.075em;margin-top:.15em}[part~=selected]::after{content:"";background:var(${cssScope}--selected-background)}[part~=hover] [part=indicator]{opacity:1}`)],Tabs);var Tabs$1=Tabs;export{Tabs,Tabs$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","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"],"names":["Tabs","tab","index","lastItem","sourceIndex: number","targetIndex: number","sourceIndex","targetIndex","targetElement","_items","fromItem","targetIndicator","_indicators","sourceIndicator","sourceX","sourceY","sourceWidth","transformX","x","transformY","y","targetStyle","sourceStyle","selected: number","previousIndex","selected"],"mappings":"+WAMA,MAAM,UAAY,OACZ,SAAW,YAAY,UAAU,CAEjC,WAAa,QAQnB,IAAA,KAAA,MAyEMA,UAAa,WAAY,CA4C7B,aAAc,CAEZ,AADA,OAAO,MA3CT,SAAqB,cAUrB,UAA8C,gBAU9C,UAAwC,kBAYxC,MAAQ,EAYN,IAAI,gBAAgB,KAAM,IAAM,IAAI,YAAY,CAAE,KAAM,KAAK,QAAU,GAAE,IAC1E,CAED,QAA4B,CAC1B,MAAO,KAAI,CAAA,gBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,cACd,EAAE,KAAK,kBAAkB,GAEtC,EAAE,KAAK,MAAM,IACX,CAACC,EAAKC,IAAU,IAAI,CAAA,UAEV,EAAE,UAAU,OAAQ,KAAK,QAAUA,GAAS,WAAW,CAAC,cAClD,EAAE,IAAM,CAElB,AADA,KAAK,KAAK,KAAK,cAAeA,EAAM,CACpC,KAAK,cAAgBA,CACtB,EAAA,QACM,EAAE,IAAM,KAAK,OAAOA,EAAM,CAAA,EAEjC,EAAE,SAASD,EAAKA,EAAI,CAAA,mCAGxB,CAAC,CACF,CAAA,MAEL,CAAC,AACF,CAED,mBAA0B,CAExB,AADA,MAAM,mBAAmB,CACzB,KAAK,cAAgB,KAAK,YAAc,WAAa,KAAK,MAAA,EAC3D,CAES,mBAA0B,CAClC,IAAME,EAAW,KAAK,OAAO,KAAK,eAIlC,AAHIA,GACF,EAAS,KAAK,OAAO,WAAW,CAElC,KAAK,cAAgB,KAAK,YAAc,WAAa,KAAK,MAAA,EAC3D,CAED,KAAKC,EAAqBC,EAA2B,CACnD,GAAIC,IAAgBC,EAClB,OAEF,GAAM,CAAE,SAAQ,cAAa,CAAG,KAC1BC,EAAgBC,EAAOF,GAC7B,IAAKC,EACH,OAEF,EAAc,KAAK,IAAI,WAAW,CAClC,IAAME,EAAWD,EAAOH,GAKxB,IAJKI,IAGL,EAAS,KAAK,OAAO,WAAW,CAC5B,KAAK,YAAc,QACrB,OAEF,IAAMC,EAAkBC,EAAYL,GAC9BM,EAAkBD,EAAYN,GACpC,IAAKK,IAAoBE,EACvB,OAEF,GAAM,CAAE,EAAGC,EAAS,EAAGC,EAAS,MAAOC,EAAa,CAAG,EAAgB,uBAAuB,CACxF,CAAE,IAAG,IAAG,CAAG,EAAgB,uBAAuB,CAClDC,EAAaH,EAAUI,EACvBC,EAAaJ,EAAUK,EAEvB,CAAE,MAAOC,EAAa,CAAGV,EACzB,CAAE,MAAOW,EAAa,CAAGT,EAM/B,AAJAQ,EAAY,UAAY,CAAC,YAAY,EAAEJ,EAAW,GAAG,EAAEE,EAAW,KAAK,CAAC,CACxEE,EAAY,MAAQ,GAAGL,EAAY,EAAE,CAAC,CACtCK,EAAY,WAAaC,EAAY,WAAa,OAClD,EAAgB,uBAAuB,CACvCD,EAAY,MAAQA,EAAY,UAAYA,EAAY,WAAaC,EAAY,WAAa,EAC/F,CAED,OAAOC,EAAwB,CAC7B,GAAM,CAAE,QAAO,gBAAe,CAAG,KAEjC,AADA,KAAK,KAAKC,EAAeC,EAAS,CAC9BA,IAAavB,IACf,KAAK,cAAgBuB,EACrB,KAAK,MAAQA,EACb,KAAK,oBAAoB,SAAUA,EAAS,CAE/C,CACF,EAhNA,WA0EE,SAAS,CAAE,UAAW,iBAAmB,EAAC,AAAA,EAAA,KAAA,UAAA,kBAAA,YAU1C,UAAU,AAAA,EAAA,KAAA,UAAA,mBAAA,YAUV,UAAU,AAAA,EAAA,KAAA,UAAA,mBAAA,YAMV,SAAS,CAAE,KAAM,KAAO,EAAC,AAAA,EAAA,KAAA,UAAA,cAAA,YAMzB,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,KAAA,UAAA,eAAA,CAK1B,UAAA,CAAA,SAAS,eAAe,AAAA,EAAA,KAAA,UAAA,gBAAA,CAGxB,UAAA,CAAA,SAAS,mBAAmB,AAAA,EAAA,KAAA,UAAA,qBAAA,CAlH9B,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,MAER,EAAE,SAAS,2BAA4B,EAAE,cAAc,QAAQ,EAC/D,EAAE,SAAS,0BAA2B,EAAE,cAAc,QAAQ,gmBAwC9C,EAAE,SAAS,4RAsBX,EAAE,SAAS,gEAM/B,CAAC,CAAC,AAAA,EAAA,KAAA,CA0IF,IAAA,OAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../src/web-components/tabs/definition.ts"],"sourcesContent":["import Tabs from \"./component.js\";\n\nTabs.define();\n\nexport default Tabs;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-tabs\": Tabs;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Tabs from"./component.js";Tabs.define();export{Tabs as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/tabs/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/tabs/definition.ts"],"sourcesContent":["import Tabs from \"./component.js\";\n\nTabs.define();\n\nexport default Tabs;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-tabs\": Tabs;\n }\n}\n"],"names":[],"mappings":"iCAEA,KAAK,QAAQ"}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "../../internal/global-style.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
* {@linkcode Text} renders text.
|
5
|
+
*
|
6
|
+
* @category display
|
7
|
+
*/
|
8
8
|
declare class Text extends GlobalStyle {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
underline: "none" | "hover" | "active" | "always" | boolean;
|
10
|
+
nowrap: boolean;
|
11
|
+
italic: boolean;
|
12
|
+
truncate: boolean;
|
13
|
+
clip: boolean;
|
14
|
+
protected render(): TemplateResult<1>;
|
15
15
|
}
|
16
16
|
export default Text;
|
17
17
|
export { Text };
|
18
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAAkC,gCAAiC;;;;;;AAS5E,cAsCM,aAAa,YAAY;CAC7B,AAWA,WAAW,SAAS,UAAU,WAAW;CAEzC,AACA;CAEA,AACA;CAEA,AACA;CAEA,AACA;CAEA,UAAU,UAAU,eAAe;AAKpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../src/web-components/text/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"text\";\n\n/**\n * {@linkcode Text} renders text.\n *\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host([clip]) {\n background: var(${cssGlobalVars.backgroundClip});\n display: inline-block;\n color: transparent;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n -webkit-background-clip: text;\n }\n\n :host([nowrap]) {\n white-space: nowrap;\n }\n\n :host([italic]) {\n font-style: italic;\n }\n\n :host([truncate]),\n :host([truncate]) ::slotted(*) {\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n :host([strikethrough]) {\n text-decoration: line-through;\n }\n\n :host([underline=\"\"]),\n :host([underline=\"always\"]),\n :host(:hover[underline=\"hover\"]),\n :host(:active[underline=\"active\"]),\n :host(:focus[underline=\"focus\"]) {\n text-decoration: underline;\n }\n`)\nclass Text extends GlobalStyle {\n @property({\n converter: {\n fromAttribute(value) {\n return value === \"\" ? true : value;\n },\n toAttribute(value) {\n return value === false ? null : value === true ? \"\" : value;\n },\n },\n reflect: true,\n })\n underline: \"none\" | \"hover\" | \"active\" | \"always\" | boolean = \"none\";\n\n @property({ type: Boolean, reflect: true })\n nowrap = false;\n\n @property({ type: Boolean, reflect: true })\n italic = false;\n\n @property({ type: Boolean, reflect: true })\n truncate = false;\n\n @property({ type: Boolean, reflect: true })\n clip = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <p part=\"root\">${htmlSlot()}</p>\n `;\n }\n}\n\nexport default Text;\nexport { Text };\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{property}from"lit/decorators.js";import{cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`text`;let Text=class e extends GlobalStyle{constructor(...e){super(...e),this.underline=`none`,this.nowrap=!1,this.italic=!1,this.truncate=!1,this.clip=!1}render(){return html`<p part="root">${htmlSlot()}</p>`}};_decorate([property({converter:{fromAttribute(e){return e===``?!0:e},toAttribute(e){return e===!1?null:e===!0?``:e}},reflect:!0})],Text.prototype,`underline`,void 0),_decorate([property({type:Boolean,reflect:!0})],Text.prototype,`nowrap`,void 0),_decorate([property({type:Boolean,reflect:!0})],Text.prototype,`italic`,void 0),_decorate([property({type:Boolean,reflect:!0})],Text.prototype,`truncate`,void 0),_decorate([property({type:Boolean,reflect:!0})],Text.prototype,`clip`,void 0),Text=_decorate([godown(protoName),styles(css`:host([clip]){background:var(${cssGlobalVars.backgroundClip});display:inline-block;color:transparent;-webkit-text-fill-color:transparent;background-clip:text;-webkit-background-clip:text}:host([nowrap]){white-space:nowrap}:host([italic]){font-style:italic}:host([truncate]),:host([truncate]) ::slotted(*){max-width:100%;overflow:hidden;text-overflow:ellipsis}:host([strikethrough]){text-decoration:line-through}:host([underline=""]),:host([underline="always"]),:host(:hover[underline="hover"]),:host(:active[underline="active"]),:host(:focus[underline="focus"]){text-decoration:underline}`)],Text);var Text$1=Text;export{Text,Text$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/text/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/text/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"text\";\n\n/**\n * {@linkcode Text} renders text.\n *\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host([clip]) {\n background: var(${cssGlobalVars.backgroundClip});\n display: inline-block;\n color: transparent;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n -webkit-background-clip: text;\n }\n\n :host([nowrap]) {\n white-space: nowrap;\n }\n\n :host([italic]) {\n font-style: italic;\n }\n\n :host([truncate]),\n :host([truncate]) ::slotted(*) {\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n :host([strikethrough]) {\n text-decoration: line-through;\n }\n\n :host([underline=\"\"]),\n :host([underline=\"always\"]),\n :host(:hover[underline=\"hover\"]),\n :host(:active[underline=\"active\"]),\n :host(:focus[underline=\"focus\"]) {\n text-decoration: underline;\n }\n`)\nclass Text extends GlobalStyle {\n @property({\n converter: {\n fromAttribute(value) {\n return value === \"\" ? true : value;\n },\n toAttribute(value) {\n return value === false ? null : value === true ? \"\" : value;\n },\n },\n reflect: true,\n })\n underline: \"none\" | \"hover\" | \"active\" | \"always\" | boolean = \"none\";\n\n @property({ type: Boolean, reflect: true })\n nowrap = false;\n\n @property({ type: Boolean, reflect: true })\n italic = false;\n\n @property({ type: Boolean, reflect: true })\n truncate = false;\n\n @property({ type: Boolean, reflect: true })\n clip = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <p part=\"root\">${htmlSlot()}</p>\n `;\n }\n}\n\nexport default Text;\nexport { Text };\n"],"names":["Text","value"],"mappings":"yPAMA,MAAM,UAAY,OAOlB,IAAA,KAAA,MAsCMA,UAAa,WAAY,oCAY7B,UAA8D,YAG9D,QAAS,OAGT,QAAS,OAGT,UAAW,OAGX,MAAO,EAEG,QAA4B,CACpC,MAAO,KAAI,CAAA,eACM,EAAE,UAAU,CAAC,IAC9B,CAAC,AACF,CACF,EArEA,WAuCE,SAAS,CACR,UAAW,CACT,cAAcC,EAAO,CACnB,OAAOA,IAAU,IAAK,EAAOA,CAC9B,EACD,YAAYA,EAAO,CACjB,OAAOA,KAAU,EAAQ,KAAOA,KAAU,EAAO,GAAKA,CACvD,CACF,EACD,SAAS,CACV,EAAC,AAAA,EAAA,KAAA,UAAA,gBAAA,GAAA,YAGD,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,KAAA,UAAA,aAAA,GAAA,YAG1C,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,KAAA,UAAA,aAAA,GAAA,YAG1C,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,KAAA,UAAA,eAAA,GAAA,YAG1C,SAAS,CAAE,KAAM,QAAS,SAAS,CAAM,EAAC,AAAA,EAAA,KAAA,UAAA,WAAA,GAAA,CA7D5C,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,6BAEQ,EAAE,cAAc,eAAe,ghBAkCnD,CAAC,CAAC,AAAA,EAAA,KAAA,CAkCF,IAAA,OAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../src/web-components/text/definition.ts"],"sourcesContent":["import Text from \"./component.js\";\n\nText.define();\n\nexport default Text;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-text\": Text;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Text from"./component.js";Text.define();export{Text as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/text/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/text/definition.ts"],"sourcesContent":["import Text from \"./component.js\";\n\nText.define();\n\nexport default Text;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-text\": Text;\n }\n}\n"],"names":[],"mappings":"iCAEA,KAAK,QAAQ"}
|
@@ -1,36 +1,35 @@
|
|
1
1
|
import { type PropertyValues, type TemplateResult } from "lit";
|
2
2
|
import Text from "../text/component.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
* {@linkcode Time} renders a formatting time.
|
5
|
+
*
|
6
|
+
* @fires time - Fires when the time changes.
|
7
|
+
* @category display
|
8
|
+
*/
|
9
9
|
declare class Time extends Text {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
10
|
+
/**
|
11
|
+
* Escape symbol.
|
12
|
+
*/
|
13
|
+
escape: string;
|
14
|
+
/**
|
15
|
+
* Format strings.
|
16
|
+
*/
|
17
|
+
format: string;
|
18
|
+
/**
|
19
|
+
* Time.
|
20
|
+
*/
|
21
|
+
time: Date;
|
22
|
+
/**
|
23
|
+
* If there is a value, update every gap or timeout.
|
24
|
+
*/
|
25
|
+
timeout: number;
|
26
|
+
/**
|
27
|
+
* The number of milliseconds that change with each update.
|
28
|
+
*/
|
29
|
+
gap: number;
|
30
|
+
protected timeoutId: number;
|
31
|
+
protected render(): TemplateResult<1>;
|
32
|
+
protected updated(changedProperties: PropertyValues): void;
|
33
33
|
}
|
34
34
|
export default Time;
|
35
35
|
export { Time };
|
36
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAEA,cAAc,qBAAqB,sBAA4B,KAAM;AAGrE,OAAO,UAAU,sBAAuB;;;;;;;AAUxC,cACM,aAAa,KAAK;;;;CAItB,AACA;;;;CAKA,AACA;;;;CAKA,AACA,MAAM;;;;CAKN,AACA;;;;CAKA,AACA;CAEA,UAAU;CAEV,UAAU,UAAU,eAAe;CAMnC,UAAU,QAAQA,mBAAmB;AAWtC;AAED,eAAe;AACf,SAAS","names":["changedProperties: PropertyValues"],"sources":["../../../src/web-components/time/component.ts"],"sourcesContent":["import { godown } from \"@godown/element\";\nimport fmtime from \"fmtime\";\nimport { type PropertyValues, type TemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Text from \"../text/component.js\";\n\nconst protoName = \"time\";\n\n/**\n * {@linkcode Time} renders a formatting time.\n *\n * @fires time - Fires when the time changes.\n * @category display\n */\n@godown(protoName)\nclass Time extends Text {\n /**\n * Escape symbol.\n */\n @property()\n escape = \"%\";\n\n /**\n * Format strings.\n */\n @property()\n format = \"YYYY-MM-DD hh:mm:ss\";\n\n /**\n * Time.\n */\n @property({ type: Object })\n time: Date = new Date();\n\n /**\n * If there is a value, update every gap or timeout.\n */\n @property({ type: Number })\n timeout: number;\n\n /**\n * The number of milliseconds that change with each update.\n */\n @property({ type: Number })\n gap: number;\n\n protected timeoutId: number;\n\n protected render(): TemplateResult<1> {\n return html`\n <p part=\"root\">${fmtime(this.format, this.time, this.escape)}</p>\n `;\n }\n\n protected updated(changedProperties: PropertyValues): void {\n if (changedProperties.has(\"timeout\") && this.timeout) {\n this.timeouts.remove(this.timeoutId);\n this.timeoutId = this.timeouts.add(\n setInterval(() => {\n this.dispatchCustomEvent(\"time\", this.time);\n this.time = new Date(this.time.getTime() + (this.gap || this.timeout));\n }, Math.abs(this.timeout)),\n );\n }\n }\n}\n\nexport default Time;\nexport { Time };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown}from"@godown/element";import fmtime from"fmtime";import{html}from"lit";import{property}from"lit/decorators.js";import Text from"../text/component.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`time`;let Time=class e extends Text{constructor(...e){super(...e),this.escape=`%`,this.format=`YYYY-MM-DD hh:mm:ss`,this.time=new Date}render(){return html`<p part="root">${fmtime(this.format,this.time,this.escape)}</p>`}updated(e){e.has(`timeout`)&&this.timeout&&(this.timeouts.remove(this.timeoutId),this.timeoutId=this.timeouts.add(setInterval(()=>{this.dispatchCustomEvent(`time`,this.time),this.time=new Date(this.time.getTime()+(this.gap||this.timeout))},Math.abs(this.timeout))))}};_decorate([property()],Time.prototype,`escape`,void 0),_decorate([property()],Time.prototype,`format`,void 0),_decorate([property({type:Object})],Time.prototype,`time`,void 0),_decorate([property({type:Number})],Time.prototype,`timeout`,void 0),_decorate([property({type:Number})],Time.prototype,`gap`,void 0),Time=_decorate([godown(protoName)],Time);var Time$1=Time;export{Time,Time$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|