godown 3.0.0-canary.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -9
- package/alert.d.ts +1 -0
- package/alert.d.ts.map +1 -1
- package/alert.js +1 -5
- package/alert.js.map +1 -1
- package/avatar.d.ts +1 -0
- package/avatar.d.ts.map +1 -1
- package/avatar.js +1 -5
- package/avatar.js.map +1 -1
- package/badge.d.ts +9 -0
- package/badge.d.ts.map +1 -0
- package/badge.js +2 -0
- package/badge.js.map +1 -0
- package/breath.js +1 -5
- package/breath.js.map +1 -1
- package/build/godown+lit.iife.js +59 -0
- package/build/godown+lit.iife.js.map +1 -0
- package/build/godown+lit.js +59 -0
- package/build/godown+lit.js.map +1 -0
- package/build/godown+lit.umd.js +59 -0
- package/build/godown+lit.umd.js.map +1 -0
- package/build/godown.iife.js +47 -0
- package/build/godown.js +48 -0
- package/build/godown.js.map +1 -0
- package/build/godown.umd.js +48 -0
- package/build/godown.umd.js.map +1 -0
- package/button.d.ts +1 -0
- package/button.d.ts.map +1 -1
- package/button.js +1 -5
- package/button.js.map +1 -1
- package/card.d.ts +1 -0
- package/card.d.ts.map +1 -1
- package/card.js +1 -5
- package/card.js.map +1 -1
- package/carousel.d.ts +1 -0
- package/carousel.d.ts.map +1 -1
- package/carousel.js +1 -5
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +4 -1
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -176
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +7 -2
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -62
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +23 -0
- package/components/badge.d.ts.map +1 -0
- package/components/badge.js +2 -0
- package/components/badge.js.map +1 -0
- package/components/breath.d.ts +6 -4
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -80
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +8 -5
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -168
- package/components/button.js.map +1 -1
- package/components/card.d.ts +3 -1
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -48
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +5 -1
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -113
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +4 -3
- package/components/details.d.ts.map +1 -1
- package/components/details.js +1 -52
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +4 -2
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -96
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +3 -3
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +1 -36
- package/components/divider.js.map +1 -1
- package/components/dragbox.d.ts +4 -2
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +1 -109
- package/components/dragbox.js.map +1 -1
- package/components/flex.d.ts +3 -1
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js +1 -62
- package/components/flex.js.map +1 -1
- package/components/form.d.ts +3 -1
- package/components/form.d.ts.map +1 -1
- package/components/form.js +1 -75
- package/components/form.js.map +1 -1
- package/components/grid.d.ts +3 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +1 -56
- package/components/grid.js.map +1 -1
- package/components/heading.d.ts +29 -0
- package/components/heading.d.ts.map +1 -0
- package/components/heading.js +2 -0
- package/components/heading.js.map +1 -0
- package/components/input.d.ts +5 -1
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -50
- package/components/input.js.map +1 -1
- package/components/layout.d.ts +6 -4
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +1 -58
- package/components/layout.js.map +1 -1
- package/components/link.d.ts +5 -0
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -44
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +3 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -58
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +10 -4
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -266
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +3 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js +1 -56
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +14 -16
- package/components/router.d.ts.map +1 -1
- package/components/router.js +1 -250
- package/components/router.js.map +1 -1
- package/components/select.d.ts +7 -2
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -211
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts +3 -1
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +1 -54
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts +8 -2
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -153
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -2
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -92
- package/components/switch.js.map +1 -1
- package/components/text.d.ts +3 -1
- package/components/text.d.ts.map +1 -1
- package/components/text.js +1 -43
- package/components/text.js.map +1 -1
- package/components/time.d.ts +4 -2
- package/components/time.d.ts.map +1 -1
- package/components/time.js +1 -77
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +4 -2
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -80
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts +6 -12
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +1 -129
- package/components/typewriter.js.map +1 -1
- package/core/global-style.d.ts +2 -2
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -52
- package/core/global-style.js.map +1 -1
- package/core/super-anchor.d.ts +2 -1
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -38
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +4 -3
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -111
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +1 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -37
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/details.d.ts +1 -0
- package/details.d.ts.map +1 -1
- package/details.js +1 -5
- package/details.js.map +1 -1
- package/dev/alert.d.ts +1 -0
- package/dev/alert.d.ts.map +1 -1
- package/dev/alert.js +1 -0
- package/dev/alert.js.map +1 -1
- package/dev/avatar.d.ts +1 -0
- package/dev/avatar.d.ts.map +1 -1
- package/dev/avatar.js +1 -0
- package/dev/avatar.js.map +1 -1
- package/dev/badge.d.ts +9 -0
- package/dev/badge.d.ts.map +1 -0
- package/dev/badge.js +5 -0
- package/dev/badge.js.map +1 -0
- package/dev/button.d.ts +1 -0
- package/dev/button.d.ts.map +1 -1
- package/dev/button.js +1 -0
- package/dev/button.js.map +1 -1
- package/dev/card.d.ts +1 -0
- package/dev/card.d.ts.map +1 -1
- package/dev/card.js +1 -0
- package/dev/card.js.map +1 -1
- package/dev/carousel.d.ts +1 -0
- package/dev/carousel.d.ts.map +1 -1
- package/dev/carousel.js +1 -0
- package/dev/carousel.js.map +1 -1
- package/dev/components/alert.d.ts +4 -1
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +20 -23
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +7 -2
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +22 -10
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +23 -0
- package/dev/components/badge.d.ts.map +1 -0
- package/dev/components/badge.js +107 -0
- package/dev/components/badge.js.map +1 -0
- package/dev/components/breath.d.ts +6 -4
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +29 -26
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +8 -5
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +31 -17
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +3 -1
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +8 -11
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +5 -1
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +32 -26
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +4 -3
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +22 -27
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +4 -2
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +17 -16
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +3 -3
- package/dev/components/divider.d.ts.map +1 -1
- package/dev/components/divider.js +29 -17
- package/dev/components/divider.js.map +1 -1
- package/dev/components/dragbox.d.ts +4 -2
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +11 -4
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts +3 -1
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +17 -9
- package/dev/components/flex.js.map +1 -1
- package/dev/components/form.d.ts +3 -1
- package/dev/components/form.d.ts.map +1 -1
- package/dev/components/form.js +2 -3
- package/dev/components/form.js.map +1 -1
- package/dev/components/grid.d.ts +3 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +17 -10
- package/dev/components/grid.js.map +1 -1
- package/dev/components/heading.d.ts +29 -0
- package/dev/components/heading.d.ts.map +1 -0
- package/dev/components/heading.js +103 -0
- package/dev/components/heading.js.map +1 -0
- package/dev/components/input.d.ts +5 -1
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +17 -17
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts +6 -4
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +23 -22
- package/dev/components/layout.js.map +1 -1
- package/dev/components/link.d.ts +5 -0
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +12 -2
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +3 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +41 -38
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +10 -4
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +53 -51
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +3 -1
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +3 -5
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +14 -16
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +14 -27
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +7 -2
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +44 -31
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts +3 -1
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +9 -9
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts +8 -2
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +32 -24
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +5 -2
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +22 -25
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts +3 -1
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +12 -15
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts +4 -2
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +7 -5
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +4 -2
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +37 -27
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts +6 -12
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +22 -36
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/global-style.d.ts +2 -2
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +11 -6
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts +2 -1
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +25 -23
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +4 -3
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +43 -36
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +1 -1
- package/dev/core/super-openable.d.ts.map +1 -1
- package/dev/core/super-openable.js +2 -2
- package/dev/core/super-openable.js.map +1 -1
- package/dev/details.d.ts +1 -0
- package/dev/details.d.ts.map +1 -1
- package/dev/details.js +1 -0
- package/dev/details.js.map +1 -1
- package/dev/dialog.d.ts +1 -0
- package/dev/dialog.d.ts.map +1 -1
- package/dev/dialog.js +1 -0
- package/dev/dialog.js.map +1 -1
- package/dev/divider.d.ts +1 -0
- package/dev/divider.d.ts.map +1 -1
- package/dev/divider.js +1 -0
- package/dev/divider.js.map +1 -1
- package/dev/dragbox.d.ts +1 -0
- package/dev/dragbox.d.ts.map +1 -1
- package/dev/dragbox.js +1 -0
- package/dev/dragbox.js.map +1 -1
- package/dev/flex.d.ts +1 -0
- package/dev/flex.d.ts.map +1 -1
- package/dev/flex.js +1 -0
- package/dev/flex.js.map +1 -1
- package/dev/form.d.ts +1 -0
- package/dev/form.d.ts.map +1 -1
- package/dev/form.js +1 -0
- package/dev/form.js.map +1 -1
- package/dev/grid.d.ts +1 -0
- package/dev/grid.d.ts.map +1 -1
- package/dev/grid.js +1 -0
- package/dev/grid.js.map +1 -1
- package/dev/heading.d.ts +9 -0
- package/dev/heading.d.ts.map +1 -0
- package/dev/heading.js +5 -0
- package/dev/heading.js.map +1 -0
- package/dev/index.d.ts +2 -0
- package/dev/index.d.ts.map +1 -1
- package/dev/index.js +2 -0
- package/dev/index.js.map +1 -1
- package/dev/layout.d.ts.map +1 -1
- package/dev/progress.d.ts.map +1 -1
- package/dev/router.d.ts.map +1 -1
- package/dev/split.d.ts +1 -1
- package/dev/split.d.ts.map +1 -1
- package/dev/typewriter.d.ts +1 -0
- package/dev/typewriter.d.ts.map +1 -1
- package/dev/typewriter.js +1 -0
- package/dev/typewriter.js.map +1 -1
- package/dialog.d.ts +1 -0
- package/dialog.d.ts.map +1 -1
- package/dialog.js +1 -5
- package/dialog.js.map +1 -1
- package/divider.d.ts +1 -0
- package/divider.d.ts.map +1 -1
- package/divider.js +1 -5
- package/divider.js.map +1 -1
- package/dragbox.d.ts +1 -0
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +1 -5
- package/dragbox.js.map +1 -1
- package/flex.d.ts +1 -0
- package/flex.d.ts.map +1 -1
- package/flex.js +1 -5
- package/flex.js.map +1 -1
- package/form.d.ts +1 -0
- package/form.d.ts.map +1 -1
- package/form.js +1 -5
- package/form.js.map +1 -1
- package/grid.d.ts +1 -0
- package/grid.d.ts.map +1 -1
- package/grid.js +1 -5
- package/grid.js.map +1 -1
- package/heading.d.ts +9 -0
- package/heading.d.ts.map +1 -0
- package/heading.js +2 -0
- package/heading.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -56
- package/index.js.map +1 -1
- package/input.js +1 -5
- package/input.js.map +1 -1
- package/layout.d.ts.map +1 -1
- package/layout.js +1 -5
- package/layout.js.map +1 -1
- package/link.js +1 -5
- package/link.js.map +1 -1
- package/package.json +11 -6
- package/progress.d.ts.map +1 -1
- package/progress.js +1 -5
- package/progress.js.map +1 -1
- package/range.js +1 -5
- package/range.js.map +1 -1
- package/rotate.js +1 -5
- package/rotate.js.map +1 -1
- package/router.d.ts.map +1 -1
- package/router.js +1 -5
- package/router.js.map +1 -1
- package/select.js +1 -5
- package/select.js.map +1 -1
- package/skeleton.js +1 -5
- package/skeleton.js.map +1 -1
- package/split.d.ts +1 -1
- package/split.d.ts.map +1 -1
- package/split.js +1 -5
- package/split.js.map +1 -1
- package/src/alert.ts +2 -0
- package/src/avatar.ts +2 -0
- package/src/badge.ts +13 -0
- package/src/button.ts +2 -0
- package/src/card.ts +2 -0
- package/src/carousel.ts +2 -0
- package/src/components/alert.ts +26 -29
- package/src/components/avatar.ts +26 -14
- package/src/components/badge.ts +107 -0
- package/src/components/breath.ts +36 -31
- package/src/components/button.ts +31 -32
- package/src/components/card.ts +9 -12
- package/src/components/carousel.ts +41 -34
- package/src/components/details.ts +24 -29
- package/src/components/dialog.ts +24 -25
- package/src/components/divider.ts +29 -17
- package/src/components/dragbox.ts +18 -13
- package/src/components/flex.ts +20 -10
- package/src/components/form.ts +6 -7
- package/src/components/grid.ts +20 -11
- package/src/components/heading.ts +105 -0
- package/src/components/input.ts +20 -20
- package/src/components/layout.ts +20 -23
- package/src/components/link.ts +12 -3
- package/src/components/progress.ts +46 -41
- package/src/components/range.ts +69 -76
- package/src/components/rotate.ts +11 -10
- package/src/components/router.ts +42 -40
- package/src/components/select.ts +57 -45
- package/src/components/skeleton.ts +11 -11
- package/src/components/split.ts +45 -35
- package/src/components/switch.ts +27 -30
- package/src/components/text.ts +14 -21
- package/src/components/time.ts +14 -12
- package/src/components/tooltip.ts +36 -32
- package/src/components/typewriter.ts +32 -45
- package/src/core/global-style.ts +25 -11
- package/src/core/super-anchor.ts +30 -26
- package/src/core/super-input.ts +53 -53
- package/src/core/super-openable.ts +7 -7
- package/src/details.ts +2 -0
- package/src/dialog.ts +2 -0
- package/src/divider.ts +2 -0
- package/src/dragbox.ts +2 -0
- package/src/flex.ts +2 -0
- package/src/form.ts +2 -0
- package/src/grid.ts +2 -0
- package/src/heading.ts +13 -0
- package/src/index.ts +2 -0
- package/src/layout.ts +1 -0
- package/src/progress.ts +1 -0
- package/src/router.ts +1 -0
- package/src/split.ts +1 -1
- package/src/typewriter.ts +2 -0
- package/switch.js +1 -5
- package/switch.js.map +1 -1
- package/text.js +1 -5
- package/text.js.map +1 -1
- package/time.js +1 -5
- package/time.js.map +1 -1
- package/tooltip.js +1 -5
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +1 -0
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +1 -5
- package/typewriter.js.map +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
package/components/time.js
CHANGED
@@ -1,78 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
import { godown } from '@godown/element/decorators/godown.js';
|
3
|
-
import { styles } from '@godown/element/decorators/styles.js';
|
4
|
-
import fmtime from 'fmtime';
|
5
|
-
import { css } from 'lit';
|
6
|
-
import { property } from 'lit/decorators.js';
|
7
|
-
import { GlobalStyle } from '../core/global-style.js';
|
8
|
-
|
9
|
-
const protoName = "time";
|
10
|
-
/**
|
11
|
-
* {@linkcode Time} renders a formatting time.
|
12
|
-
*
|
13
|
-
* @category display
|
14
|
-
*/
|
15
|
-
let Time = class Time extends GlobalStyle {
|
16
|
-
constructor() {
|
17
|
-
super(...arguments);
|
18
|
-
/**
|
19
|
-
* Escape symbol.
|
20
|
-
*/
|
21
|
-
this.escape = "%";
|
22
|
-
/**
|
23
|
-
* Format strings.
|
24
|
-
*/
|
25
|
-
this.format = "YYYY-MM-DD hh:mm:ss UTFZ";
|
26
|
-
/**
|
27
|
-
* Time.
|
28
|
-
*/
|
29
|
-
this.time = new Date();
|
30
|
-
}
|
31
|
-
render() {
|
32
|
-
return fmtime(this.format, this.time, this.escape);
|
33
|
-
}
|
34
|
-
firstUpdated() {
|
35
|
-
if (this.timeout) {
|
36
|
-
this.timeoutId = this.startTimeout();
|
37
|
-
}
|
38
|
-
}
|
39
|
-
updated(changedProperties) {
|
40
|
-
if (changedProperties.has("timeout")) {
|
41
|
-
clearInterval(this.timeoutId);
|
42
|
-
if (this.timeout) {
|
43
|
-
this.timeoutId = this.startTimeout();
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
disconnectedCallback() {
|
48
|
-
clearInterval(this.timeoutId);
|
49
|
-
}
|
50
|
-
startTimeout() {
|
51
|
-
return window.setInterval(() => {
|
52
|
-
this.time = new Date(this.time.getTime() + (this.gap || this.timeout));
|
53
|
-
}, Math.abs(this.timeout));
|
54
|
-
}
|
55
|
-
};
|
56
|
-
__decorate([
|
57
|
-
property()
|
58
|
-
], Time.prototype, "escape", void 0);
|
59
|
-
__decorate([
|
60
|
-
property()
|
61
|
-
], Time.prototype, "format", void 0);
|
62
|
-
__decorate([
|
63
|
-
property({ type: Object })
|
64
|
-
], Time.prototype, "time", void 0);
|
65
|
-
__decorate([
|
66
|
-
property({ type: Number })
|
67
|
-
], Time.prototype, "timeout", void 0);
|
68
|
-
__decorate([
|
69
|
-
property({ type: Number })
|
70
|
-
], Time.prototype, "gap", void 0);
|
71
|
-
Time = __decorate([
|
72
|
-
godown(protoName),
|
73
|
-
styles(css `:host{text-align:center}`)
|
74
|
-
], Time);
|
75
|
-
var Time$1 = Time;
|
76
|
-
|
77
|
-
export { Time$1 as default };
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,styles as i,attr as o}from"@godown/element";import s from"fmtime";import{css as r,html as m}from"lit";import{property as a}from"lit/decorators.js";import{GlobalStyle as p}from"../core/global-style.js";let h=class Time extends p{constructor(){super(...arguments),this.escape="%",this.format="YYYY-MM-DD hh:mm:ss UTFZ",this.time=new Date}render(){return m`<span part="root" ${o(this.observedRecord)}>${s(this.format,this.time,this.escape)}</span>`}firstUpdated(){this.timeout&&(this.timeoutId=this.startTimeout())}updated(t){t.has("timeout")&&(clearInterval(this.timeoutId),this.timeout&&(this.timeoutId=this.startTimeout()))}disconnectedCallback(){clearInterval(this.timeoutId)}startTimeout(){return setInterval((()=>{this.dispatchEvent(new CustomEvent("time",{detail:this.time,composed:!0})),this.time=new Date(this.time.getTime()+(this.gap||this.timeout))}),Math.abs(this.timeout))}};t([a()],h.prototype,"escape",void 0),t([a()],h.prototype,"format",void 0),t([a({type:Object})],h.prototype,"time",void 0),t([a({type:Number})],h.prototype,"timeout",void 0),t([a({type:Number})],h.prototype,"gap",void 0),h=t([e("time"),i(r`:host{text-align:center}`)],h);var d=h;export{h as Time,d as default};
|
78
2
|
//# sourceMappingURL=time.js.map
|
package/components/time.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"time.js","sources":["../src/components/time.ts"],"sourcesContent":null,"names":[
|
1
|
+
{"version":3,"file":"time.js","sources":["../src/components/time.ts"],"sourcesContent":null,"names":["Time","GlobalStyle","constructor","this","escape","format","time","Date","render","html","attr","observedRecord","fmtime","firstUpdated","timeout","timeoutId","startTimeout","updated","changedProperties","has","clearInterval","disconnectedCallback","setInterval","dispatchEvent","CustomEvent","detail","composed","getTime","gap","Math","abs","__decorate","property","prototype","type","Object","Number","godown","styles","css","Time$1"],"mappings":"+PAiBA,IAAMA,EAAN,MAAMA,aAAaC,EAAnB,WAAAC,uBAKEC,KAAMC,OAAG,IAMTD,KAAME,OAAG,2BAMTF,KAAAG,KAAa,IAAIC,KAgBP,MAAAC,GACR,OAAOC,CAAI,qBAAqBC,EAAKP,KAAKQ,mBAAmBC,EAAOT,KAAKE,OAAQF,KAAKG,KAAMH,KAAKC,iBAGzF,YAAAS,GACJV,KAAKW,UACPX,KAAKY,UAAYZ,KAAKa,gBAIhB,OAAAC,CAAQC,GACZA,EAAkBC,IAAI,aACxBC,cAAcjB,KAAKY,WACfZ,KAAKW,UACPX,KAAKY,UAAYZ,KAAKa,iBAK5B,oBAAAK,GACED,cAAcjB,KAAKY,WAGrB,YAAAC,GACE,OAAOM,aAAY,KACjBnB,KAAKoB,cAAc,IAAIC,YAAY,OAAQ,CAAEC,OAAQtB,KAAKG,KAAMoB,UAAU,KAC1EvB,KAAKG,KAAO,IAAIC,KAAKJ,KAAKG,KAAKqB,WAAaxB,KAAKyB,KAAOzB,KAAKW,SAAS,GACrEe,KAAKC,IAAI3B,KAAKW,YAvDnBiB,EAAA,CADCC,KACWhC,EAAAiC,UAAA,cAAA,GAMZF,EAAA,CADCC,KACkChC,EAAAiC,UAAA,cAAA,GAMnCF,EAAA,CADCC,EAAS,CAAEE,KAAMC,UACKnC,EAAAiC,UAAA,YAAA,GAMvBF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACNpC,EAAAiC,UAAA,eAAA,GAMZF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACVpC,EAAAiC,UAAA,WAAA,GA7BJjC,EAAI+B,EAAA,CAFTM,EARiB,QASjBC,EAAOC,CAAG,6BACLvC,GAgEN,IAAAwC,EAAexC"}
|
package/components/tooltip.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
import { type TemplateResult } from "lit";
|
1
2
|
import SuperOpenable, { type Direction8 } from "../core/super-openable.js";
|
2
3
|
/**
|
3
4
|
* {@linkcode Tooltip} provide tooltip for slot elements.
|
4
5
|
*
|
5
6
|
* If it has the tip property, ignore the slot tip.
|
6
7
|
*
|
7
|
-
* @slot tip - Tip element if no `
|
8
|
+
* @slot tip - Tip element if no `tip` provided.
|
8
9
|
* @slot - Content.
|
9
10
|
* @category feedback
|
10
11
|
*/
|
@@ -42,7 +43,8 @@ declare class Tooltip extends SuperOpenable {
|
|
42
43
|
"flex-start": string;
|
43
44
|
"flex-end": string;
|
44
45
|
};
|
45
|
-
protected render():
|
46
|
+
protected render(): TemplateResult<1>;
|
46
47
|
}
|
47
48
|
export default Tooltip;
|
49
|
+
export { Tooltip };
|
48
50
|
//# sourceMappingURL=tooltip.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/components/tooltip.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/components/tooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrD,OAAO,aAAa,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK3E;;;;;;;;GAQG;AACH,cAKM,OAAQ,SAAQ,aAAa;IACjC;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IAEH,SAAS,EAAE,UAAU,CAAS;IAE9B;;OAEG;IAEH,KAAK,EAAE,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,CAAY;IAEzE;;OAEG;IAEH,WAAW,UAAS;IAEpB;;;;;;;;OAQG;IAEH,IAAI,EAAE,OAAO,GAAG,OAAO,CAAW;IAElC,MAAM,CAAC,MAAM;;;;;;MAMX;IAEF,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAKtC;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/components/tooltip.js
CHANGED
@@ -1,81 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
import { godown } from '@godown/element/decorators/godown.js';
|
3
|
-
import { styles } from '@godown/element/decorators/styles.js';
|
4
|
-
import { htmlSlot } from '@godown/element/directives/html-slot.js';
|
5
|
-
import { html, css } from 'lit';
|
6
|
-
import { property } from 'lit/decorators.js';
|
7
|
-
import { scopePrefix } from '../core/global-style.js';
|
8
|
-
import SuperOpenable from '../core/super-openable.js';
|
9
|
-
|
10
|
-
var Tooltip_1;
|
11
|
-
const protoName = "tooltip";
|
12
|
-
const cssScope = scopePrefix(protoName);
|
13
|
-
/**
|
14
|
-
* {@linkcode Tooltip} provide tooltip for slot elements.
|
15
|
-
*
|
16
|
-
* If it has the tip property, ignore the slot tip.
|
17
|
-
*
|
18
|
-
* @slot tip - Tip element if no `tim` provided.
|
19
|
-
* @slot - Content.
|
20
|
-
* @category feedback
|
21
|
-
*/
|
22
|
-
let Tooltip = Tooltip_1 = class Tooltip extends SuperOpenable {
|
23
|
-
constructor() {
|
24
|
-
super(...arguments);
|
25
|
-
/**
|
26
|
-
* Direction of opening the tip.
|
27
|
-
*/
|
28
|
-
this.direction = "top";
|
29
|
-
/**
|
30
|
-
* Content alignment.
|
31
|
-
*/
|
32
|
-
this.align = "center";
|
33
|
-
/**
|
34
|
-
* How can tips be triggered.
|
35
|
-
*
|
36
|
-
* If `focus`, element will be focusable, open tip when focused.
|
37
|
-
*
|
38
|
-
* If `hover`, element will open tip when hovered.
|
39
|
-
*
|
40
|
-
* @default "hover"
|
41
|
-
*/
|
42
|
-
this.type = "hover";
|
43
|
-
}
|
44
|
-
render() {
|
45
|
-
const align = Tooltip_1.aligns[this.align] || "inherit";
|
46
|
-
const isFocusable = this.type === "focus";
|
47
|
-
return html `<div part="root" tabindex="${isFocusable ? 0 : -1}" @focus="${isFocusable ? () => this.open = true : null}" @blur="${isFocusable ? () => this.open = false : null}" @mouseenter="${isFocusable ? null : () => this.open = true}" @mouseleave="${isFocusable ? null : () => this.open = false}" style="justify-content:${align};align-items:${align}">${htmlSlot()}<div part="tip" direction="${this.direction}" style="pointer-events:${this.propagation ? "none" : "all"}">${this.tip
|
48
|
-
? html `<span class="passive">${this.tip}</span>`
|
49
|
-
: htmlSlot("tip")}</div></div>`;
|
50
|
-
}
|
51
|
-
};
|
52
|
-
Tooltip.aligns = {
|
53
|
-
start: "flex-start",
|
54
|
-
end: "flex-end",
|
55
|
-
center: "center",
|
56
|
-
"flex-start": "flex-start",
|
57
|
-
"flex-end": "flex-end",
|
58
|
-
};
|
59
|
-
__decorate([
|
60
|
-
property()
|
61
|
-
], Tooltip.prototype, "tip", void 0);
|
62
|
-
__decorate([
|
63
|
-
property()
|
64
|
-
], Tooltip.prototype, "direction", void 0);
|
65
|
-
__decorate([
|
66
|
-
property()
|
67
|
-
], Tooltip.prototype, "align", void 0);
|
68
|
-
__decorate([
|
69
|
-
property({ type: Boolean })
|
70
|
-
], Tooltip.prototype, "propagation", void 0);
|
71
|
-
__decorate([
|
72
|
-
property()
|
73
|
-
], Tooltip.prototype, "type", void 0);
|
74
|
-
Tooltip = Tooltip_1 = __decorate([
|
75
|
-
godown(protoName),
|
76
|
-
styles(css `:host{${cssScope}--tip-background:inherit;display:inline-block;width:-moz-fit-content;width:fit-content}[part=root]{display:flex;position:relative;transition:inherit;border-radius:inherit}[part=tip]{width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content;position:absolute;visibility:hidden;transition:inherit;-webkit-user-select:none;user-select:none}:host([open]) [part=tip]{visibility:visible}.passive{background:var(${cssScope}--tip-background);padding:0 .5em}`, css `[direction^=top]{bottom:100%}[direction^=bottom]{top:100%}[direction$=right]{left:100%}[direction$=left]{right:100%}`)
|
77
|
-
], Tooltip);
|
78
|
-
var Tooltip$1 = Tooltip;
|
79
|
-
|
80
|
-
export { Tooltip$1 as default };
|
1
|
+
import{__decorate as t}from"tslib";import{godown as i,styles as o,attr as e,htmlSlot as r}from"@godown/element";import{css as n,html as p}from"lit";import{property as s}from"lit/decorators.js";import{scopePrefix as a}from"../core/global-style.js";import l from"../core/super-openable.js";var d;const c="tooltip",h=a(c);let f=d=class Tooltip extends l{constructor(){super(...arguments),this.direction="top",this.align="center",this.propagation=!1,this.type="hover"}render(){const t=d.aligns[this.align]||"inherit",i="focus"===this.type;return p`<div part="root" ${e(this.observedRecord)} tabindex="${i?0:-1}" @focus="${i?()=>this.open=!0:null}" @blur="${i?()=>this.open=!1:null}" @mouseenter="${i?null:()=>this.open=!0}" @mouseleave="${i?null:()=>this.open=!1}" style="justify-content:${t};align-items:${t}">${r()}<div part="tip">${this.tip?p`<span class="passive">${this.tip}</span>`:r("tip")}</div></div>`}};f.aligns={start:"flex-start",end:"flex-end",center:"center","flex-start":"flex-start","flex-end":"flex-end"},t([s()],f.prototype,"tip",void 0),t([s()],f.prototype,"direction",void 0),t([s()],f.prototype,"align",void 0),t([s({type:Boolean})],f.prototype,"propagation",void 0),t([s()],f.prototype,"type",void 0),f=d=t([i(c),o(n`:host{${h}--tip-background:inherit;width:-moz-fit-content;width:fit-content}:host,[part=root]{display:inline-flex}[part=root]{position:relative;transition:inherit;border-radius:inherit}[part=tip]{width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content;position:absolute;visibility:hidden;transition:inherit;-webkit-user-select:none;user-select:none}:host([open]) [part=tip]{visibility:visible}.passive{background:var(${h}--tip-background)}[propagation] [part=tip]{pointer-events:none}`,n`[direction^=top] [part=tip]{bottom:100%}[direction^=bottom] [part=tip]{top:100%}[direction$=right] [part=tip]{left:100%}[direction$=left] [part=tip]{right:100%}`)],f);var u=f;export{f as Tooltip,u as default};
|
81
2
|
//# sourceMappingURL=tooltip.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../src/components/tooltip.ts"],"sourcesContent":null,"names":[
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../src/components/tooltip.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Tooltip","Tooltip_1","SuperOpenable","constructor","this","direction","align","propagation","type","render","aligns","isFocusable","html","attr","observedRecord","open","htmlSlot","tip","start","end","center","__decorate","property","prototype","Boolean","godown","styles","css","Tooltip$1"],"mappings":"sSAOA,MAAMA,EAAY,UACZC,EAAWC,EAAYF,GAgB7B,IAAMG,EAAOC,EAAb,MAAMD,gBAAgBE,EAAtB,WAAAC,uBAWEC,KAASC,UAAe,MAMxBD,KAAKE,MAA2D,SAMhEF,KAAWG,aAAG,EAYdH,KAAII,KAAsB,QAUhB,MAAAC,GACR,MAAMH,EAAQL,EAAQS,OAAON,KAAKE,QAAU,UACtCK,EAA4B,UAAdP,KAAKI,KACzB,OAAOI,CAAI,oBAEPC,EAAKT,KAAKU,6BACAH,EAAc,GAAK,cACrBA,EAAc,IAAOP,KAAKW,MAAO,EAAQ,gBAC1CJ,EAAc,IAAOP,KAAKW,MAAO,EAAS,sBACpCJ,EAAc,KAAO,IAAOP,KAAKW,MAAO,mBACxCJ,EAAc,KAAO,IAAOP,KAAKW,MAAO,6BAC9BT,iBAAqBA,MAE5CU,sBACgBZ,KAAKa,IAAML,CAAI,yBAAyBR,KAAKa,aAAeD,EAAS,uBAtBpFhB,EAAAU,OAAS,CACdQ,MAAO,aACPC,IAAK,WACLC,OAAQ,SACR,aAAc,aACd,WAAY,YArCdC,EAAA,CADCC,KACUtB,EAAAuB,UAAA,WAAA,GAMXF,EAAA,CADCC,KAC4BtB,EAAAuB,UAAA,iBAAA,GAM7BF,EAAA,CADCC,KACuEtB,EAAAuB,UAAA,aAAA,GAMxEF,EAAA,CADCC,EAAS,CAAEd,KAAMgB,WACCxB,EAAAuB,UAAA,mBAAA,GAYnBF,EAAA,CADCC,KACgCtB,EAAAuB,UAAA,YAAA,GAnC7BvB,EAAOC,EAAAoB,EAAA,CALZI,EAAO5B,GACP6B,EACCC,CAAG,SAAS7B,ubAA8bA,mEAC1c6B,CAAG,qKAEC3B,GAgEN,IAAA4B,EAAe5B"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { type PropertyValueMap } from "lit";
|
1
|
+
import { type PropertyValueMap, type TemplateResult } from "lit";
|
2
2
|
import { GlobalStyle } from "../core/global-style.js";
|
3
3
|
/**
|
4
4
|
* {@linkcode Typewriter} renders a typewriter effect to text.
|
@@ -9,11 +9,7 @@ declare class Typewriter extends GlobalStyle {
|
|
9
9
|
/**
|
10
10
|
* Raw text.
|
11
11
|
*/
|
12
|
-
|
13
|
-
/**
|
14
|
-
* Start immediately after {@linkcode Typewriter.firstUpdated}.
|
15
|
-
*/
|
16
|
-
stopped: boolean;
|
12
|
+
content: string;
|
17
13
|
/**
|
18
14
|
* If true, hide the cursor
|
19
15
|
*/
|
@@ -34,17 +30,14 @@ declare class Typewriter extends GlobalStyle {
|
|
34
30
|
* The index at the beginning.
|
35
31
|
*/
|
36
32
|
index: number;
|
37
|
-
|
38
|
-
* Internal text.
|
39
|
-
*/
|
40
|
-
content: string;
|
33
|
+
contentInternal: string;
|
41
34
|
protected timeoutID: number;
|
42
35
|
protected _i: HTMLElement;
|
43
36
|
/**
|
44
|
-
* {@linkcode Typewriter.
|
37
|
+
* {@linkcode Typewriter.content} length.
|
45
38
|
*/
|
46
39
|
get len(): number;
|
47
|
-
protected render():
|
40
|
+
protected render(): TemplateResult<1>;
|
48
41
|
protected firstUpdated(): void;
|
49
42
|
protected updated(changedProperties: PropertyValueMap<this>): void;
|
50
43
|
write(at?: number): void;
|
@@ -52,4 +45,5 @@ declare class Typewriter extends GlobalStyle {
|
|
52
45
|
end(): void;
|
53
46
|
}
|
54
47
|
export default Typewriter;
|
48
|
+
export { Typewriter };
|
55
49
|
//# sourceMappingURL=typewriter.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typewriter.d.ts","sourceRoot":"","sources":["../src/components/typewriter.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"typewriter.d.ts","sourceRoot":"","sources":["../src/components/typewriter.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cAIM,UAAW,SAAQ,WAAW;IAClC;;OAEG;IAEH,OAAO,SAAM;IAEb;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,GAAG,SAAO;IAEV;;OAEG;IAEH,GAAG,SAAM;IAET;;OAEG;IAEH,KAAK,SAAK;IAEV;;OAEG;IAEH,KAAK,SAAK;IAGV,eAAe,SAAM;IAErB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAG5B,SAAS,CAAC,EAAE,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,SAAS,CAAC,YAAY,IAAI,IAAI;IAO9B,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAMlE,KAAK,CAAC,EAAE,GAAE,MAAmB,GAAG,IAAI;IAYpC,IAAI,IAAI,IAAI;IAIZ,GAAG,IAAI,IAAI;CAGZ;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/components/typewriter.js
CHANGED
@@ -1,130 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
import { godown } from '@godown/element/decorators/godown.js';
|
3
|
-
import { styles } from '@godown/element/decorators/styles.js';
|
4
|
-
import { classList } from '@godown/element/directives/class-list.js';
|
5
|
-
import { htmlSlot } from '@godown/element/directives/html-slot.js';
|
6
|
-
import { random } from '@godown/element/tools/lib.js';
|
7
|
-
import { html, css } from 'lit';
|
8
|
-
import { property, state, query } from 'lit/decorators.js';
|
9
|
-
import { scopePrefix, GlobalStyle } from '../core/global-style.js';
|
10
|
-
|
11
|
-
const protoName = "typewriter";
|
12
|
-
const cssScope = scopePrefix(protoName);
|
13
|
-
/**
|
14
|
-
* {@linkcode Typewriter} renders a typewriter effect to text.
|
15
|
-
*
|
16
|
-
* @category effect
|
17
|
-
*/
|
18
|
-
let Typewriter = class Typewriter extends GlobalStyle {
|
19
|
-
constructor() {
|
20
|
-
super(...arguments);
|
21
|
-
/**
|
22
|
-
* Raw text.
|
23
|
-
*/
|
24
|
-
this.text = "";
|
25
|
-
/**
|
26
|
-
* Start immediately after {@linkcode Typewriter.firstUpdated}.
|
27
|
-
*/
|
28
|
-
this.stopped = false;
|
29
|
-
/**
|
30
|
-
* If true, hide the cursor
|
31
|
-
*/
|
32
|
-
this.ended = false;
|
33
|
-
/**
|
34
|
-
* Maximum random time.
|
35
|
-
*/
|
36
|
-
this.max = 100;
|
37
|
-
/**
|
38
|
-
* Minimum random time.
|
39
|
-
*/
|
40
|
-
this.min = 50;
|
41
|
-
/**
|
42
|
-
* Fixed time.
|
43
|
-
*/
|
44
|
-
this.delay = 0;
|
45
|
-
/**
|
46
|
-
* The index at the beginning.
|
47
|
-
*/
|
48
|
-
this.index = 0;
|
49
|
-
/**
|
50
|
-
* Internal text.
|
51
|
-
*/
|
52
|
-
this.content = "";
|
53
|
-
}
|
54
|
-
/**
|
55
|
-
* {@linkcode Typewriter.text} length.
|
56
|
-
*/
|
57
|
-
get len() {
|
58
|
-
return this.text.length;
|
59
|
-
}
|
60
|
-
render() {
|
61
|
-
return html `${htmlSlot()}${this.content}<i part="cursor" class="${classList({
|
62
|
-
hidden: this.ended,
|
63
|
-
})}"></i>`;
|
64
|
-
}
|
65
|
-
firstUpdated() {
|
66
|
-
if (!this.text) {
|
67
|
-
this.text = this._slot?.assignedNodes()[0]?.textContent.trim() || "";
|
68
|
-
}
|
69
|
-
if (!this.stopped && this.len) {
|
70
|
-
this.write();
|
71
|
-
}
|
72
|
-
}
|
73
|
-
updated(changedProperties) {
|
74
|
-
if (changedProperties.has("index")) {
|
75
|
-
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.content }));
|
76
|
-
}
|
77
|
-
}
|
78
|
-
write(at = this.index) {
|
79
|
-
this.content = this.text.slice(0, at + 1);
|
80
|
-
const timeout = this.delay || random(this.max, this.min);
|
81
|
-
this.timeoutID = window.setTimeout(() => {
|
82
|
-
const nx = at + 1;
|
83
|
-
if (nx <= this.len) {
|
84
|
-
this.index = nx;
|
85
|
-
this.write();
|
86
|
-
}
|
87
|
-
}, timeout);
|
88
|
-
}
|
89
|
-
stop() {
|
90
|
-
clearTimeout(this.timeoutID);
|
91
|
-
}
|
92
|
-
end() {
|
93
|
-
this.ended = true;
|
94
|
-
}
|
95
|
-
};
|
96
|
-
__decorate([
|
97
|
-
property()
|
98
|
-
], Typewriter.prototype, "text", void 0);
|
99
|
-
__decorate([
|
100
|
-
property({ type: Boolean })
|
101
|
-
], Typewriter.prototype, "stopped", void 0);
|
102
|
-
__decorate([
|
103
|
-
property({ type: Boolean })
|
104
|
-
], Typewriter.prototype, "ended", void 0);
|
105
|
-
__decorate([
|
106
|
-
property({ type: Number })
|
107
|
-
], Typewriter.prototype, "max", void 0);
|
108
|
-
__decorate([
|
109
|
-
property({ type: Number })
|
110
|
-
], Typewriter.prototype, "min", void 0);
|
111
|
-
__decorate([
|
112
|
-
property({ type: Number })
|
113
|
-
], Typewriter.prototype, "delay", void 0);
|
114
|
-
__decorate([
|
115
|
-
property({ type: Number })
|
116
|
-
], Typewriter.prototype, "index", void 0);
|
117
|
-
__decorate([
|
118
|
-
state()
|
119
|
-
], Typewriter.prototype, "content", void 0);
|
120
|
-
__decorate([
|
121
|
-
query("i")
|
122
|
-
], Typewriter.prototype, "_i", void 0);
|
123
|
-
Typewriter = __decorate([
|
124
|
-
godown(protoName),
|
125
|
-
styles(css `:host{${cssScope}--cursor-width:.05em;white-space:nowrap}i{border-right:var(${cssScope}--cursor-width) solid;margin-left:.02em;animation:s 1.5s steps(1) infinite}@keyframes s{0%{border-color:currentColor}50%{border-color:transparent}}slot{display:none}.hidden{visibility:hidden}`)
|
126
|
-
], Typewriter);
|
127
|
-
var Typewriter$1 = Typewriter;
|
128
|
-
|
129
|
-
export { Typewriter$1 as default };
|
1
|
+
import{__decorate as t}from"tslib";import{godown as e,styles as i,attr as o,htmlSlot as n,random as r}from"@godown/element";import{css as s,html as d}from"lit";import{property as h,state as p,query as l}from"lit/decorators.js";import{scopePrefix as a,GlobalStyle as m}from"../core/global-style.js";const c="typewriter",y=a(c);let u=class Typewriter extends m{constructor(){super(...arguments),this.content="",this.ended=!1,this.max=100,this.min=50,this.delay=0,this.index=0,this.contentInternal=""}get len(){return this.content.length}render(){return d`<div part="root" ${o(this.observedRecord)}>${n()} ${this.contentInternal} <i part="cursor" ?hidden="${this.ended}"></i></div>`}firstUpdated(){this.content||=this._slot?.assignedNodes()[0]?.textContent.trim()||"",!this.ended&&this.len&&this.write()}updated(t){t.has("index")&&this.dispatchEvent(new CustomEvent(this.index===this.len?"done":"write",{detail:this.contentInternal}))}write(t=this.index){this.contentInternal=this.content.slice(0,t+1);const e=this.delay||r(this.max,this.min);this.timeoutID=setTimeout((()=>{const e=t+1;e<=this.len&&(this.index=e,this.write())}),e)}stop(){clearTimeout(this.timeoutID)}end(){this.ended=!0}};t([h()],u.prototype,"content",void 0),t([h({type:Boolean})],u.prototype,"ended",void 0),t([h({type:Number})],u.prototype,"max",void 0),t([h({type:Number})],u.prototype,"min",void 0),t([h({type:Number})],u.prototype,"delay",void 0),t([h({type:Number})],u.prototype,"index",void 0),t([p()],u.prototype,"contentInternal",void 0),t([l("i")],u.prototype,"_i",void 0),u=t([e(c),i(s`:host{${y}--cursor-width:.05em}:host,:host([contents]) [part=root]{display:inline-block}i{border-right:var(${y}--cursor-width) solid;margin-left:.02em;animation:s 1.5s steps(1) infinite}@keyframes s{0%{border-color:currentColor}50%{border-color:transparent}}slot{display:none}`)],u);var v=u;export{u as Typewriter,v as default};
|
130
2
|
//# sourceMappingURL=typewriter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typewriter.js","sources":["../src/components/typewriter.ts"],"sourcesContent":null,"names":[
|
1
|
+
{"version":3,"file":"typewriter.js","sources":["../src/components/typewriter.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Typewriter","GlobalStyle","constructor","this","content","ended","max","min","delay","index","contentInternal","len","length","render","html","attr","observedRecord","htmlSlot","firstUpdated","_slot","assignedNodes","textContent","trim","write","updated","changedProperties","has","dispatchEvent","CustomEvent","detail","at","slice","timeout","random","timeoutID","setTimeout","nx","stop","clearTimeout","end","__decorate","property","prototype","type","Boolean","Number","state","query","godown","styles","css","Typewriter$1"],"mappings":"0SAMA,MAAMA,EAAY,aACZC,EAAWC,EAAYF,GAW7B,IAAMG,EAAN,MAAMA,mBAAmBC,EAAzB,WAAAC,uBAKEC,KAAOC,QAAG,GAMVD,KAAKE,OAAG,EAMRF,KAAGG,IAAG,IAMNH,KAAGI,IAAG,GAMNJ,KAAKK,MAAG,EAMRL,KAAKM,MAAG,EAGRN,KAAeO,gBAAG,GAUlB,OAAIC,GACF,OAAOR,KAAKC,QAAQQ,OAGZ,MAAAC,GACR,OAAOC,CAAI,oBAAoBC,EAAKZ,KAAKa,mBACrCC,OAAcd,KAAKO,6CACOP,KAAKE,oBAI3B,YAAAa,GACRf,KAAKC,UAAYD,KAAKgB,OAAOC,gBAAgB,IAAIC,YAAYC,QAAU,IAClEnB,KAAKE,OAASF,KAAKQ,KACtBR,KAAKoB,QAIC,OAAAC,CAAQC,GACZA,EAAkBC,IAAI,UACxBvB,KAAKwB,cAAc,IAAIC,YAAYzB,KAAKM,QAAUN,KAAKQ,IAAM,OAAS,QAAS,CAAEkB,OAAQ1B,KAAKO,mBAIlG,KAAAa,CAAMO,EAAa3B,KAAKM,OACtBN,KAAKO,gBAAkBP,KAAKC,QAAQ2B,MAAM,EAAGD,EAAK,GAClD,MAAME,EAAU7B,KAAKK,OAASyB,EAAO9B,KAAKG,IAAKH,KAAKI,KACpDJ,KAAK+B,UAAYC,YAAW,KAC1B,MAAMC,EAAKN,EAAK,EACZM,GAAMjC,KAAKQ,MACbR,KAAKM,MAAQ2B,EACbjC,KAAKoB,WAENS,GAGL,IAAAK,GACEC,aAAanC,KAAK+B,WAGpB,GAAAK,GACEpC,KAAKE,OAAQ,IApFfmC,EAAA,CADCC,KACWzC,EAAA0C,UAAA,eAAA,GAMZF,EAAA,CADCC,EAAS,CAAEE,KAAMC,WACL5C,EAAA0C,UAAA,aAAA,GAMbF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACT7C,EAAA0C,UAAA,WAAA,GAMTF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACV7C,EAAA0C,UAAA,WAAA,GAMRF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACT7C,EAAA0C,UAAA,aAAA,GAMTF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACT7C,EAAA0C,UAAA,aAAA,GAGTF,EAAA,CADCM,KACmB9C,EAAA0C,UAAA,uBAAA,GAKVF,EAAA,CADTO,EAAM,MACkB/C,EAAA0C,UAAA,UAAA,GA3CrB1C,EAAUwC,EAAA,CAJfQ,EAAOnD,GACPoD,EACCC,CAAG,SAASpD,qGAA8GA,2KAEtHE,GA6FN,IAAAmD,EAAenD"}
|
package/core/global-style.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type Gradients, presetsRGB } from "@godown/colors/presets-rgb.js";
|
2
|
-
import GodownElement from "@godown/element";
|
3
|
-
import { CSSResult } from "lit";
|
2
|
+
import { GodownElement } from "@godown/element";
|
3
|
+
import { type CSSResult } from "lit";
|
4
4
|
export declare class GlobalStyle extends GodownElement {
|
5
5
|
}
|
6
6
|
export declare function scopePrefix(scope: string, len?: number): CSSResult;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global-style.d.ts","sourceRoot":"","sources":["../src/core/global-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,aAAa,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"global-style.d.ts","sourceRoot":"","sources":["../src/core/global-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAwB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAO,KAAK,SAAS,EAAa,MAAM,KAAK,CAAC;AAErD,qBAAa,WAAY,SAAQ,aAAa;CAC7C;AAID,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,SAAS,CAE7D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAE1D;AAED,eAAO,MAAM,aAAa,EAAE;IAC1B,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,cAAc,EAAE,SAAS,CAAC;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,yBAAyB,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAWlB,CAAC;AAEF,KAAK,yBAAyB,GAAG,MAAM,CAAC,MAAM,OAAO,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
package/core/global-style.js
CHANGED
@@ -1,53 +1,2 @@
|
|
1
|
-
import
|
2
|
-
import { travel } from '@godown/colors/travel.js';
|
3
|
-
import GodownElement from '@godown/element';
|
4
|
-
import GodownConfig from '@godown/element/config.js';
|
5
|
-
import { joinProperties } from '@godown/element/tools/css.js';
|
6
|
-
import { trim } from '@godown/element/tools/lib.js';
|
7
|
-
import { unsafeCSS, css } from 'lit';
|
8
|
-
|
9
|
-
GodownElement.godownConfig ||= new GodownConfig();
|
10
|
-
class GlobalStyle extends GodownElement {
|
11
|
-
}
|
12
|
-
const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
|
13
|
-
function scopePrefix(scope, len = 1) {
|
14
|
-
return variablePrefix(cssvar + "-".repeat(len) + scope);
|
15
|
-
}
|
16
|
-
function variablePrefix(variable) {
|
17
|
-
return unsafeCSS("--" + variable);
|
18
|
-
}
|
19
|
-
const cssGlobalVars = {
|
20
|
-
foreground: scopePrefix("foreground", 2),
|
21
|
-
background: scopePrefix("background", 2),
|
22
|
-
clipBackground: scopePrefix("clip-background", 2),
|
23
|
-
active: scopePrefix("active", 2),
|
24
|
-
passive: scopePrefix("passive", 2),
|
25
|
-
_colors: {},
|
26
|
-
input: scopePrefix("input", 2),
|
27
|
-
white: scopePrefix("color-white", 2),
|
28
|
-
black: scopePrefix("color-black", 2),
|
29
|
-
};
|
30
|
-
GlobalStyle.styles = [
|
31
|
-
unsafeCSS(":host{"
|
32
|
-
+ `${cssGlobalVars.black}:rgb(0 0 0);`
|
33
|
-
+ `${cssGlobalVars.white}:rgb(255 255 255);`
|
34
|
-
+ travel((key, gradient, rgb) => {
|
35
|
-
cssGlobalVars._colors[key] ||= [];
|
36
|
-
cssGlobalVars._colors[key].push(unsafeCSS(scopePrefix("color", 2) + "-" + key + "-" + gradient));
|
37
|
-
const endKey = `-${key}-${gradient}`;
|
38
|
-
const colorKey = scopePrefix("color", 2) + endKey;
|
39
|
-
return `${colorKey}:rgb(${rgb});`;
|
40
|
-
}, presetsRGB).join("")
|
41
|
-
+ joinProperties({
|
42
|
-
[cssGlobalVars.background + ""]: `var(${cssGlobalVars._colors.darkgray[9]})`,
|
43
|
-
[cssGlobalVars.foreground + ""]: `var(${cssGlobalVars._colors.lightgray[0]})`,
|
44
|
-
[cssGlobalVars.active + ""]: `var(${cssGlobalVars._colors.blue[6]})`,
|
45
|
-
[cssGlobalVars.passive + ""]: `var(${cssGlobalVars._colors.darkgray[6]})`,
|
46
|
-
[cssGlobalVars.clipBackground + ""]: `linear-gradient(to bottom, var(${cssGlobalVars.foreground}), var(${cssGlobalVars.passive}))`,
|
47
|
-
})
|
48
|
-
+ "}"),
|
49
|
-
css `*{border:0;outline:0;margin:0;padding:0;font-size:100%;font-style:normal;box-sizing:border-box}:host{box-sizing:border-box}a{text-decoration:none}span{white-space:nowrap}svg{-webkit-user-select:none;user-select:none}`,
|
50
|
-
];
|
51
|
-
|
52
|
-
export { GlobalStyle, cssGlobalVars, scopePrefix, variablePrefix };
|
1
|
+
import{presetsRGB as o}from"@godown/colors/presets-rgb.js";import{travel as r}from"@godown/colors/travel.js";import{trim as e,joinProperties as t,GodownElement as n}from"@godown/element";import{unsafeCSS as s,css as a}from"lit";class GlobalStyle extends n{}const l=e(GlobalStyle.godownConfig.prefix,"-");function i(o,r=1){return c(l+"-".repeat(r)+o)}function c(o){return s(`--${o}`)}const g={foreground:i("foreground",2),background:i("background",2),clipBackground:i("clip-background",2),active:i("active",2),passive:i("passive",2),_colors:{},input:i("input",2),white:i("color-white",2),black:i("color-black",2)};GlobalStyle.styles=[s(`:host{${g.black}:rgb(0 0 0);${g.white}:rgb(255 255 255);`+r(((o,r,e)=>{g._colors[o]||=[],g._colors[o].push(s(i("color",2)+"-"+o+"-"+r));const t=`-${o}-${r}`;return`${i("color",2)+t}:rgb(${e});`}),o).join("")+t({[g.background+""]:`var(${g._colors.darkgray[9]})`,[g.foreground+""]:`var(${g._colors.lightgray[0]})`,[g.active+""]:`var(${g._colors.blue[6]})`,[g.passive+""]:`var(${g._colors.darkgray[6]})`,[g.clipBackground+""]:`linear-gradient(to bottom, var(${g.foreground}), var(${g.passive}))`})+"}"),a`*{border:0;outline:0;margin:0;padding:0;font-size:100%;font-style:normal;box-sizing:border-box}:host{box-sizing:border-box}a{text-decoration:none}span{white-space:nowrap}svg{-webkit-user-select:none;user-select:none}:host([contents]){display:contents}:where(:host([contents]) [part=root]){all:inherit;display:revert}`];export{GlobalStyle,g as cssGlobalVars,i as scopePrefix,c as variablePrefix};
|
53
2
|
//# sourceMappingURL=global-style.js.map
|
package/core/global-style.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global-style.js","sources":["../src/core/global-style.ts"],"sourcesContent":null,"names":[
|
1
|
+
{"version":3,"file":"global-style.js","sources":["../src/core/global-style.ts"],"sourcesContent":null,"names":["GlobalStyle","GodownElement","cssvar","trim","godownConfig","prefix","scopePrefix","scope","len","variablePrefix","repeat","variable","unsafeCSS","cssGlobalVars","foreground","background","clipBackground","active","passive","_colors","input","white","black","styles","travel","key","gradient","rgb","push","endKey","presetsRGB","join","joinProperties","darkgray","lightgray","blue","css"],"mappings":"oOAKM,MAAOA,oBAAoBC,GAGjC,MAAMC,EAASC,EAAKH,YAAYI,aAAaC,OAAQ,cAErCC,EAAYC,EAAeC,EAAM,GAC/C,OAAOC,EAAeP,EAAS,IAAIQ,OAAOF,GAAOD,EACnD,CAEM,SAAUE,EAAeE,GAC7B,OAAOC,EAAU,KAAKD,IACxB,CAEa,MAAAE,EAUT,CACFC,WAAYR,EAAY,aAAc,GACtCS,WAAYT,EAAY,aAAc,GACtCU,eAAgBV,EAAY,kBAAmB,GAC/CW,OAAQX,EAAY,SAAU,GAC9BY,QAASZ,EAAY,UAAW,GAChCa,QAAS,CAA+B,EACxCC,MAAOd,EAAY,QAAS,GAC5Be,MAAOf,EAAY,cAAe,GAClCgB,MAAOhB,EAAY,cAAe,IAIpCN,YAAYuB,OAAS,CACnBX,EAEM,SAAGC,EAAcS,oBACdT,EAAcQ,0BACjBG,GAAO,CAACC,EAAKC,EAAUC,KACvBd,EAAcM,QAAQM,KAAS,GAC/BZ,EAAcM,QAAQM,GAAKG,KAAKhB,EAAUN,EAAY,QAAS,GAAK,IAAMmB,EAAM,IAAMC,IACtF,MAAMG,EAAS,IAAIJ,KAAOC,IAE1B,MAAO,GADUpB,EAAY,QAAS,GAAKuB,SACjBF,KAAO,GAChCG,GAAYC,KAAK,IAClBC,EAAe,CACf,CAACnB,EAAcE,WAAa,IAAK,OAAOF,EAAcM,QAAQc,SAAS,MACvE,CAACpB,EAAcC,WAAa,IAAK,OAAOD,EAAcM,QAAQe,UAAU,MACxE,CAACrB,EAAcI,OAAS,IAAK,OAAOJ,EAAcM,QAAQgB,KAAK,MAC/D,CAACtB,EAAcK,QAAU,IAAK,OAAOL,EAAcM,QAAQc,SAAS,MACpE,CAACpB,EAAcG,eAAiB,IAC9B,kCAAkCH,EAAcC,oBAAoBD,EAAcK,cAEpF,KAENkB,CAAG"}
|
package/core/super-anchor.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { type TemplateResult } from "lit";
|
1
2
|
import { GlobalStyle } from "./global-style.js";
|
2
3
|
declare class SuperAnchor extends GlobalStyle {
|
3
4
|
/**
|
@@ -8,7 +9,7 @@ declare class SuperAnchor extends GlobalStyle {
|
|
8
9
|
* A element target.
|
9
10
|
*/
|
10
11
|
target: "_blank" | "_self" | "_parent" | "_top";
|
11
|
-
protected render():
|
12
|
+
protected render(): TemplateResult<1>;
|
12
13
|
protected _handleClick(_: MouseEvent): void;
|
13
14
|
}
|
14
15
|
export default SuperAnchor;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-anchor.d.ts","sourceRoot":"","sources":["../src/core/super-anchor.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"super-anchor.d.ts","sourceRoot":"","sources":["../src/core/super-anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAGM,WAAY,SAAQ,WAAW;IACnC;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAa;IACzB;;OAEG;IAEH,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAW;IAE1D,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAKrC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAC5C;AAED,eAAe,WAAW,CAAC"}
|
package/core/super-anchor.js
CHANGED
@@ -1,39 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
import { styles } from '@godown/element/decorators/index.js';
|
3
|
-
import { htmlSlot } from '@godown/element/directives/html-slot.js';
|
4
|
-
import { html, css } from 'lit';
|
5
|
-
import { property } from 'lit/decorators.js';
|
6
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
7
|
-
import { GlobalStyle } from './global-style.js';
|
8
|
-
|
9
|
-
let SuperAnchor = class SuperAnchor extends GlobalStyle {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
/**
|
13
|
-
* A element href.
|
14
|
-
*/
|
15
|
-
this.href = undefined;
|
16
|
-
/**
|
17
|
-
* A element target.
|
18
|
-
*/
|
19
|
-
this.target = "_self";
|
20
|
-
}
|
21
|
-
render() {
|
22
|
-
return html `<a part="root" href="${ifDefined(this.href)}" target="${this.target}" @click="${this._handleClick}">${htmlSlot()}</a>`;
|
23
|
-
}
|
24
|
-
// eslint-disable-next-line
|
25
|
-
_handleClick(_) { }
|
26
|
-
};
|
27
|
-
__decorate([
|
28
|
-
property()
|
29
|
-
], SuperAnchor.prototype, "href", void 0);
|
30
|
-
__decorate([
|
31
|
-
property()
|
32
|
-
], SuperAnchor.prototype, "target", void 0);
|
33
|
-
SuperAnchor = __decorate([
|
34
|
-
styles(css `:host{display:inline-block;color:currentColor;text-decoration:none;cursor:default}:host([href]){cursor:pointer}a{width:100%;display:flex;color:inherit;text-decoration:inherit;justify-content:space-between;align-items:center}`)
|
35
|
-
], SuperAnchor);
|
36
|
-
var SuperAnchor$1 = SuperAnchor;
|
37
|
-
|
38
|
-
export { SuperAnchor$1 as default };
|
1
|
+
import{__decorate as r}from"tslib";import{styles as t,attr as o,htmlSlot as e}from"@godown/element";import{css as i,html as l,nothing as s}from"lit";import{property as a}from"lit/decorators.js";import{GlobalStyle as n}from"./global-style.js";let c=class SuperAnchor extends n{constructor(){super(...arguments),this.href=void 0,this.target="_self"}render(){return l`<a part="root" ${o(this.observedRecord)} href="${this.href||s}" target="${this.target}" @click="${this._handleClick}">${e()}</a>`}_handleClick(r){}};r([a()],c.prototype,"href",void 0),r([a()],c.prototype,"target",void 0),c=r([t(i`:host{display:inline-block;color:currentColor;text-decoration:none;cursor:default}:host([href]){cursor:pointer}[part=root]{width:100%;color:inherit;display:inline-block;text-decoration:inherit}`)],c);var h=c;export{h as default};
|
39
2
|
//# sourceMappingURL=super-anchor.js.map
|
package/core/super-anchor.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-anchor.js","sources":["../src/core/super-anchor.ts"],"sourcesContent":null,"names":[
|
1
|
+
{"version":3,"file":"super-anchor.js","sources":["../src/core/super-anchor.ts"],"sourcesContent":null,"names":["SuperAnchor","GlobalStyle","constructor","this","href","undefined","target","render","html","attr","observedRecord","nothing","_handleClick","htmlSlot","_","__decorate","property","prototype","styles","css","SuperAnchor$1"],"mappings":"kPASA,IAAMA,EAAN,MAAMA,oBAAoBC,EAA1B,WAAAC,uBAKEC,KAAIC,UAAWC,EAKfF,KAAMG,OAA4C,QAExC,MAAAC,GACR,OAAOC,CAAI,kBAEPC,EAAKN,KAAKO,yBACJP,KAAKC,MAAQO,cACXR,KAAKG,mBACNH,KAAKS,iBAEZC,UAKI,YAAAD,CAAaE,GAAa,GApBpCC,EAAA,CADCC,KACuBhB,EAAAiB,UAAA,YAAA,GAKxBF,EAAA,CADCC,KACwDhB,EAAAiB,UAAA,cAAA,GAVrDjB,EAAWe,EAAA,CAHhBG,EACCC,CAAG,sMAECnB,GA4BN,IAAAoB,EAAepB"}
|