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,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
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/time/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","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"],"names":["Time","changedProperties: PropertyValues"],"mappings":"iOAOA,MAAM,UAAY,OAQlB,IAAA,KAAA,MACMA,UAAa,IAAK,mBAiBtB,iBAZA,OAAS,SAMT,OAAS,sBAMT,KAAA,KAAa,IAAI,KAgBP,QAA4B,CACpC,MAAO,KAAI,CAAA,eACM,EAAE,OAAO,KAAK,OAAQ,KAAK,KAAM,KAAK,OAAO,CAAC,IAC/D,CAAC,AACF,CAES,QAAQC,EAAyC,CACzD,AAAI,EAAkB,IAAI,UAAU,EAAI,KAAK,UAC3C,KAAK,SAAS,OAAO,KAAK,UAAU,CACpC,KAAK,UAAY,KAAK,SAAS,IAC7B,YAAY,IAAM,CAEhB,AADA,KAAK,oBAAoB,OAAQ,KAAK,KAAK,CAC3C,KAAK,KAAO,IAAI,KAAK,KAAK,KAAK,SAAS,EAAI,KAAK,KAAO,KAAK,SAC9D,EAAE,KAAK,IAAI,KAAK,QAAQ,CAAC,CAC3B,CAEJ,CACF,EAnDA,WAKE,UAAU,AAAA,EAAA,KAAA,UAAA,gBAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,gBAAA,YAMV,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,KAAA,UAAA,cAAA,YAM1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,KAAA,UAAA,iBAAA,YAM1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,KAAA,UAAA,aAAA,CA7B5B,KAAA,UAAA,CAAA,OAAO,UAAU,AAAA,EAAA,KAAA,CAqDlB,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/time/definition.ts"],"sourcesContent":["import Time from \"./component.js\";\n\nTime.define();\n\nexport default Time;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-time\": Time;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Time from"./component.js";Time.define();export{Time as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/time/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/time/definition.ts"],"sourcesContent":["import Time from \"./component.js\";\n\nTime.define();\n\nexport default Time;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-time\": Time;\n }\n}\n"],"names":[],"mappings":"iCAEA,KAAK,QAAQ"}
|
@@ -1,27 +1,26 @@
|
|
1
1
|
import { type TemplateResult } from "lit";
|
2
2
|
import Popover from "../popover/component.js";
|
3
3
|
/**
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
* {@linkcode Tooltip} is similar to {@linkcode Popover}.
|
5
|
+
*
|
6
|
+
* It listens for the mouseenter event and displays the tip or popover after a specified delay.
|
7
|
+
*
|
8
|
+
* When it is clicked or the mouseleave event occurs followed by another delay, closes the tip.
|
9
|
+
*
|
10
|
+
* @fires toggle - Fired when the popover is toggled.
|
11
|
+
* @slot tip - Tip content.
|
12
|
+
* @slot - Tip trigger.
|
13
|
+
* @category feedback
|
14
|
+
*/
|
15
15
|
declare class Tooltip extends Popover {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
action: "hide";
|
17
|
+
span: "span" | "isolated";
|
18
|
+
tip: string;
|
19
|
+
delay: number;
|
20
|
+
protected render(): TemplateResult<1>;
|
21
|
+
_hoverTimeout: number;
|
22
|
+
_leaveTimeout: number;
|
23
|
+
connectedCallback(): void;
|
24
24
|
}
|
25
25
|
export default Tooltip;
|
26
26
|
export { Tooltip };
|
27
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AACA,cAAc,sBAA4B,KAAM;AAGhD,OAAO,aAAa,yBAA0B;;;;;;;;;;;;;AAgB9C,cACM,gBAAgB,QAAQ;CAC5B,QAAQ;CACR,MAAM,SAAS;CAEf,AACA;CAEA,AACA;CAEA,UAAU,UAAU,eAAe;CAmBnC;CACA;CAEA;AAeD;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../src/web-components/tooltip/component.ts"],"sourcesContent":["import { godown, htmlSlot } from \"@godown/element\";\nimport { type TemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Popover from \"../popover/component.js\";\n\nconst protoName = \"tooltip\";\n\n/**\n * {@linkcode Tooltip} is similar to {@linkcode Popover}.\n *\n * It listens for the mouseenter event and displays the tip or popover after a specified delay.\n *\n * When it is clicked or the mouseleave event occurs followed by another delay, closes the tip.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot tip - Tip content.\n * @slot - Tip trigger.\n * @category feedback\n */\n@godown(protoName)\nclass Tooltip extends Popover {\n action: \"hide\";\n span: \"span\" | \"isolated\";\n\n @property()\n tip: string;\n\n @property({ type: Number })\n delay = 300;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this.hide}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"tip\", this.tip)}\n </div>\n </div>\n `;\n }\n\n _hoverTimeout: number;\n _leaveTimeout: number;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.events.add(this, \"mouseenter\", () => {\n clearTimeout(this._leaveTimeout);\n this._hoverTimeout = setTimeout(() => {\n this.show();\n }, this.delay);\n });\n this.events.add(this, \"mouseleave\", () => {\n clearTimeout(this._hoverTimeout);\n this._leaveTimeout = setTimeout(() => {\n this.hide();\n }, this.delay);\n });\n }\n}\n\nexport default Tooltip;\nexport { Tooltip };\n"],"version":3,"file":"component.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{godown,htmlSlot}from"@godown/element";import{html}from"lit";import{property}from"lit/decorators.js";import{Popover}from"../popover/component.js";import _decorate from"@oxc-project/runtime/helpers/decorate";const protoName=`tooltip`;let Tooltip=class e extends Popover{constructor(...e){super(...e),this.delay=300}render(){return html`<div part="root"> <div part="trigger" @click=${this.hide}> ${htmlSlot()} </div> <div part="popover" popover="manual"> ${htmlSlot(`tip`,this.tip)} </div> </div>`}connectedCallback(){super.connectedCallback(),this.events.add(this,`mouseenter`,()=>{clearTimeout(this._leaveTimeout),this._hoverTimeout=setTimeout(()=>{this.show()},this.delay)}),this.events.add(this,`mouseleave`,()=>{clearTimeout(this._hoverTimeout),this._leaveTimeout=setTimeout(()=>{this.hide()},this.delay)})}};_decorate([property()],Tooltip.prototype,`tip`,void 0),_decorate([property({type:Number})],Tooltip.prototype,`delay`,void 0),Tooltip=_decorate([godown(protoName)],Tooltip);var Tooltip$1=Tooltip;export{Tooltip,Tooltip$1 as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/tooltip/component.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/tooltip/component.ts"],"sourcesContent":["import { godown, htmlSlot } from \"@godown/element\";\nimport { type TemplateResult, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Popover from \"../popover/component.js\";\n\nconst protoName = \"tooltip\";\n\n/**\n * {@linkcode Tooltip} is similar to {@linkcode Popover}.\n *\n * It listens for the mouseenter event and displays the tip or popover after a specified delay.\n *\n * When it is clicked or the mouseleave event occurs followed by another delay, closes the tip.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot tip - Tip content.\n * @slot - Tip trigger.\n * @category feedback\n */\n@godown(protoName)\nclass Tooltip extends Popover {\n action: \"hide\";\n span: \"span\" | \"isolated\";\n\n @property()\n tip: string;\n\n @property({ type: Number })\n delay = 300;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this.hide}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"tip\", this.tip)}\n </div>\n </div>\n `;\n }\n\n _hoverTimeout: number;\n _leaveTimeout: number;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.events.add(this, \"mouseenter\", () => {\n clearTimeout(this._leaveTimeout);\n this._hoverTimeout = setTimeout(() => {\n this.show();\n }, this.delay);\n });\n this.events.add(this, \"mouseleave\", () => {\n clearTimeout(this._hoverTimeout);\n this._leaveTimeout = setTimeout(() => {\n this.hide();\n }, this.delay);\n });\n }\n}\n\nexport default Tooltip;\nexport { Tooltip };\n"],"names":["Tooltip"],"mappings":"qNAMA,MAAM,UAAY,UAclB,IAAA,QAAA,MACMA,UAAgB,OAAQ,oCAQ5B,MAAQ,IAEE,QAA4B,CACpC,MAAO,KAAI,CAAA,6CAIE,EAAE,KAAK,KAAA,EAEd,EAAE,UAAU,CAAA,8CAMZ,EAAE,SAAS,MAAO,KAAK,IAAI,CAAA,cAGjC,CAAC,AACF,CAKD,mBAA0B,CAQxB,AAPA,MAAM,mBAAmB,CACzB,KAAK,OAAO,IAAI,KAAM,aAAc,IAAM,CAExC,AADA,aAAa,KAAK,cAAc,CAChC,KAAK,cAAgB,WAAW,IAAM,CACpC,KAAK,MAAM,AACZ,EAAE,KAAK,MAAM,AACf,EAAC,CACF,KAAK,OAAO,IAAI,KAAM,aAAc,IAAM,CAExC,AADA,aAAa,KAAK,cAAc,CAChC,KAAK,cAAgB,WAAW,IAAM,CACpC,KAAK,MAAM,AACZ,EAAE,KAAK,MAAM,AACf,EAAC,AACH,CACF,EAhDA,WAKE,UAAU,AAAA,EAAA,QAAA,UAAA,aAAA,YAGV,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,QAAA,UAAA,eAAA,CAR5B,QAAA,UAAA,CAAA,OAAO,UAAU,AAAA,EAAA,QAAA,CAkDlB,IAAA,UAAe"}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import Tooltip from "./component.js";
|
2
2
|
export default Tooltip;
|
3
3
|
declare global {
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
interface HTMLElementTagNameMap {
|
5
|
+
"godown-tooltip": Tooltip;
|
6
|
+
}
|
7
7
|
}
|
8
|
-
//# sourceMappingURL=definition.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,OAAO,aAAa,gBAAiB;AAIrC,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB;CACnB;AACF","names":[],"sources":["../../../src/web-components/tooltip/definition.ts"],"sourcesContent":["import Tooltip from \"./component.js\";\n\nTooltip.define();\n\nexport default Tooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-tooltip\": Tooltip;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
1
|
+
import Tooltip from"./component.js";Tooltip.define();export{Tooltip as default};
|
2
2
|
//# sourceMappingURL=definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definition.js","sources":["../../src/web-components/tooltip/definition.ts"],"sourcesContent":
|
1
|
+
{"version":3,"file":"definition.js","sources":["../../src/web-components/tooltip/definition.ts"],"sourcesContent":["import Tooltip from \"./component.js\";\n\nTooltip.define();\n\nexport default Tooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-tooltip\": Tooltip;\n }\n}\n"],"names":[],"mappings":"oCAEA,QAAQ,QAAQ"}
|
@@ -2,51 +2,50 @@ import { Ranger } from "@godown/element";
|
|
2
2
|
import { type PropertyValueMap, type TemplateResult } from "lit";
|
3
3
|
import { GlobalStyle } from "../../internal/global-style.js";
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
* {@linkcode Typewriter} renders a typewriter effect to text.
|
6
|
+
*
|
7
|
+
* @category effect
|
8
|
+
*/
|
9
9
|
declare class Typewriter extends GlobalStyle {
|
10
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
10
|
+
/**
|
11
|
+
* Raw text.
|
12
|
+
*/
|
13
|
+
content: string;
|
14
|
+
/**
|
15
|
+
* If true, hide the cursor
|
16
|
+
*/
|
17
|
+
ended: boolean;
|
18
|
+
/**
|
19
|
+
* Maximum random time.
|
20
|
+
*/
|
21
|
+
max: number;
|
22
|
+
/**
|
23
|
+
* Minimum random time.
|
24
|
+
*/
|
25
|
+
min: number;
|
26
|
+
/**
|
27
|
+
* Fixed time.
|
28
|
+
*/
|
29
|
+
delay: number;
|
30
|
+
/**
|
31
|
+
* The index at the beginning.
|
32
|
+
*/
|
33
|
+
index: number;
|
34
|
+
contentInternal: string;
|
35
|
+
protected timeoutID: number;
|
36
|
+
protected _i: HTMLElement;
|
37
|
+
protected _ranger: Ranger;
|
38
|
+
/**
|
39
|
+
* {@linkcode Typewriter.content} length.
|
40
|
+
*/
|
41
|
+
get len(): number;
|
42
|
+
protected render(): TemplateResult<1>;
|
43
|
+
connectedCallback(): void;
|
44
|
+
protected firstUpdated(): void;
|
45
|
+
protected updated(changedProperties: PropertyValueMap<this>): void;
|
46
|
+
write(at?: number): void;
|
47
|
+
stop(): void;
|
48
|
+
end(): void;
|
49
49
|
}
|
50
50
|
export default Typewriter;
|
51
51
|
export { Typewriter };
|
52
|
-
//# sourceMappingURL=component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"mappings":"AAAA,SAAiC,cAAsB,iBAAkB;AACzE,cAAc,uBAAuB,sBAAiC,KAAM;AAG5E,SAAS,mBAAgC,gCAAiC;;;;;;AAU1E,cA8BM,mBAAmB,YAAY;;;;CAInC,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;CAEA,AACA;CAEA,UAAU;CAEV,UACU,IAAI;CACd,UAAU,SAAS;;;;CAKnB,IAAI;CAIJ,UAAU,UAAU,eAAe;CAenC;CAKA,UAAU;CAOV,UAAU,QAAQA,mBAAmB;CAMrC,MAAMC;CAcN;CAIA;AAGD;AAED,eAAe;AACf,SAAS","names":["changedProperties: PropertyValueMap<this>","at: number"],"sources":["../../../src/web-components/typewriter/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, Ranger, styles } from \"@godown/element\";\nimport { type PropertyValueMap, type TemplateResult, css, html } from \"lit\";\nimport { property, query, state } from \"lit/decorators.js\";\n\nimport { GlobalStyle, scopePrefix } from \"../../internal/global-style.js\";\n\nconst protoName = \"typewriter\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Typewriter} renders a typewriter effect to text.\n *\n * @category effect\n */\n@godown(protoName)\n@styles(css`\n :host {\n ${cssScope}--cursor-width: .05em;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: inline-block;\n }\n\n i {\n border-right: var(${cssScope}--cursor-width) solid;\n margin-left: 0.02em;\n animation: s 1.5s steps(1) infinite;\n }\n\n @keyframes s {\n 0% {\n border-color: currentColor;\n }\n 50% {\n border-color: transparent;\n }\n }\n\n slot {\n display: none;\n }\n`)\nclass Typewriter extends GlobalStyle {\n /**\n * Raw text.\n */\n @property()\n content = \"\";\n\n /**\n * If true, hide the cursor\n */\n @property({ type: Boolean })\n ended = false;\n\n /**\n * Maximum random time.\n */\n @property({ type: Number })\n max = 100;\n\n /**\n * Minimum random time.\n */\n @property({ type: Number })\n min = 50;\n\n /**\n * Fixed time.\n */\n @property({ type: Number })\n delay = 0;\n\n /**\n * The index at the beginning.\n */\n @property({ type: Number })\n index = 0;\n\n @state()\n contentInternal = \"\";\n\n protected timeoutID: number;\n\n @query(\"i\")\n protected _i: HTMLElement;\n protected _ranger: Ranger;\n\n /**\n * {@linkcode Typewriter.content} length.\n */\n get len(): number {\n return this.content.length;\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot()} ${this.contentInternal}\n <i\n part=\"cursor\"\n ?hidden=\"${this.ended}\"\n ></i>\n </div>\n `;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this._ranger = new Ranger(this.min, this.max);\n }\n\n protected firstUpdated(): void {\n this.content ||= this._slot?.assignedNodes()[0]?.textContent.trim() || \"\";\n if (!this.ended && this.len) {\n this.write();\n }\n }\n\n protected updated(changedProperties: PropertyValueMap<this>): void {\n if (changedProperties.has(\"index\")) {\n this.dispatchCustomEvent(this.index === this.len ? \"done\" : \"write\", this.contentInternal);\n }\n }\n\n write(at: number = this.index): void {\n this.contentInternal = this.content.slice(0, at + 1);\n const timeout = this.delay || this._ranger.random();\n this.timeoutID = this.timeouts.add(\n setTimeout(() => {\n const nx = at + 1;\n if (nx <= this.len) {\n this.index = nx;\n this.write();\n }\n }, timeout),\n );\n }\n\n stop(): void {\n clearTimeout(this.timeoutID);\n }\n\n end(): void {\n this.ended = true;\n }\n}\n\nexport default Typewriter;\nexport { Typewriter };\n"],"version":3,"file":"component.d.ts"}
|