godown 3.0.0-canary.9 → 3.0.1
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 +27 -34
- 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 +87 -77
- 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 +60 -32
- 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 +114 -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 +40 -31
- 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 +38 -21
- 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 +43 -41
- 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 +81 -55
- 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 +76 -70
- 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 +65 -60
- 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 +27 -10
- 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 +22 -13
- 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 +22 -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 +6 -7
- 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 +22 -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 +125 -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 +36 -28
- 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 +53 -39
- 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 +13 -3
- 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 +20 -8
- 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 +69 -64
- 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 +14 -9
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +27 -34
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +25 -38
- 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 +79 -58
- 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 +67 -63
- 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 +67 -51
- 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 +91 -85
- 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 +56 -53
- 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 +19 -6
- 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 +45 -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 +48 -54
- 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 +19 -14
- 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 +15 -12
- 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 +64 -42
- 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 +1 -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 +13 -8
- 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 +92 -86
- package/src/components/avatar.ts +65 -39
- package/src/components/badge.ts +110 -0
- package/src/components/breath.ts +47 -38
- package/src/components/button.ts +38 -36
- package/src/components/card.ts +45 -46
- package/src/components/carousel.ts +91 -66
- package/src/components/details.ts +79 -75
- package/src/components/dialog.ts +74 -73
- package/src/components/divider.ts +28 -13
- package/src/components/dragbox.ts +30 -25
- package/src/components/flex.ts +35 -22
- package/src/components/form.ts +12 -15
- package/src/components/grid.ts +35 -23
- package/src/components/heading.ts +123 -0
- package/src/components/input.ts +43 -37
- package/src/components/layout.ts +52 -44
- package/src/components/link.ts +13 -4
- package/src/components/progress.ts +22 -10
- package/src/components/range.ts +107 -108
- package/src/components/rotate.ts +24 -18
- package/src/components/router.ts +64 -67
- package/src/components/select.ts +94 -78
- package/src/components/skeleton.ts +70 -68
- package/src/components/split.ts +81 -67
- package/src/components/switch.ts +97 -93
- package/src/components/text.ts +55 -58
- package/src/components/time.ts +26 -13
- package/src/components/tooltip.ts +44 -32
- package/src/components/typewriter.ts +54 -61
- package/src/core/global-style.ts +34 -21
- package/src/core/super-anchor.ts +17 -14
- package/src/core/super-input.ts +76 -63
- package/src/core/super-openable.ts +8 -14
- 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
@@ -1,8 +1,6 @@
|
|
1
1
|
var Tooltip_1;
|
2
2
|
import { __decorate } from "tslib";
|
3
|
-
import { godown } from "@godown/element
|
4
|
-
import { styles } from "@godown/element/decorators/styles.js";
|
5
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
3
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
6
4
|
import { css, html } from "lit";
|
7
5
|
import { property } from "lit/decorators.js";
|
8
6
|
import { scopePrefix } from "../core/global-style.js";
|
@@ -14,7 +12,7 @@ const cssScope = scopePrefix(protoName);
|
|
14
12
|
*
|
15
13
|
* If it has the tip property, ignore the slot tip.
|
16
14
|
*
|
17
|
-
* @slot tip - Tip element if no `
|
15
|
+
* @slot tip - Tip element if no `tip` provided.
|
18
16
|
* @slot - Content.
|
19
17
|
* @category feedback
|
20
18
|
*/
|
@@ -29,6 +27,10 @@ let Tooltip = Tooltip_1 = class Tooltip extends SuperOpenable {
|
|
29
27
|
* Content alignment.
|
30
28
|
*/
|
31
29
|
this.align = "center";
|
30
|
+
/**
|
31
|
+
* If true, allow penetration of the tip.
|
32
|
+
*/
|
33
|
+
this.propagation = false;
|
32
34
|
/**
|
33
35
|
* How can tips be triggered.
|
34
36
|
*
|
@@ -43,21 +45,27 @@ let Tooltip = Tooltip_1 = class Tooltip extends SuperOpenable {
|
|
43
45
|
render() {
|
44
46
|
const align = Tooltip_1.aligns[this.align] || "inherit";
|
45
47
|
const isFocusable = this.type === "focus";
|
46
|
-
return html
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
return html `
|
49
|
+
<div
|
50
|
+
part="root"
|
51
|
+
${attr(this.observedRecord)}
|
52
|
+
tabindex="${isFocusable ? 0 : -1}"
|
53
|
+
@focus="${isFocusable ? () => (this.open = true) : null}"
|
54
|
+
@blur="${isFocusable ? () => (this.open = false) : null}"
|
55
|
+
@mouseenter="${isFocusable ? null : () => (this.open = true)}"
|
56
|
+
@mouseleave="${isFocusable ? null : () => (this.open = false)}"
|
57
|
+
style="justify-content:${align};align-items:${align}"
|
58
|
+
>
|
59
|
+
${htmlSlot()}
|
60
|
+
<div part="tip">
|
61
|
+
${this.tip
|
62
|
+
? html `
|
63
|
+
<span class="passive">${this.tip}</span>
|
64
|
+
`
|
65
|
+
: htmlSlot("tip")}
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
`;
|
61
69
|
}
|
62
70
|
};
|
63
71
|
Tooltip.aligns = {
|
@@ -87,12 +95,15 @@ Tooltip = Tooltip_1 = __decorate([
|
|
87
95
|
styles(css `
|
88
96
|
:host {
|
89
97
|
${cssScope}--tip-background: inherit;
|
90
|
-
display: inline-block;
|
91
98
|
width: fit-content;
|
92
99
|
}
|
93
100
|
|
101
|
+
:host,
|
102
|
+
[part="root"] {
|
103
|
+
display: inline-flex;
|
104
|
+
}
|
105
|
+
|
94
106
|
[part="root"] {
|
95
|
-
display: flex;
|
96
107
|
position: relative;
|
97
108
|
transition: inherit;
|
98
109
|
border-radius: inherit;
|
@@ -111,24 +122,31 @@ Tooltip = Tooltip_1 = __decorate([
|
|
111
122
|
visibility: visible;
|
112
123
|
}
|
113
124
|
|
114
|
-
.passive{
|
125
|
+
.passive {
|
115
126
|
background: var(${cssScope}--tip-background);
|
116
|
-
|
127
|
+
}
|
128
|
+
|
129
|
+
[propagation] [part="tip"] {
|
130
|
+
pointer-events: none;
|
117
131
|
}
|
118
132
|
`, css `
|
119
|
-
[direction^="top"] {
|
133
|
+
[direction^="top"] [part="tip"] {
|
120
134
|
bottom: 100%;
|
121
135
|
}
|
122
|
-
|
136
|
+
|
137
|
+
[direction^="bottom"] [part="tip"] {
|
123
138
|
top: 100%;
|
124
139
|
}
|
125
|
-
|
140
|
+
|
141
|
+
[direction$="right"] [part="tip"] {
|
126
142
|
left: 100%;
|
127
143
|
}
|
128
|
-
|
144
|
+
|
145
|
+
[direction$="left"] [part="tip"] {
|
129
146
|
right: 100%;
|
130
147
|
}
|
131
148
|
`)
|
132
149
|
], Tooltip);
|
133
150
|
export default Tooltip;
|
151
|
+
export { Tooltip };
|
134
152
|
//# sourceMappingURL=tooltip.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,aAAkC,MAAM,2BAA2B,CAAC;AAE3E,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;;GAQG;AA2DH,IAAM,OAAO,eAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QAOE;;WAEG;QAEH,cAAS,GAAe,KAAK,CAAC;QAE9B;;WAEG;QAEH,UAAK,GAA2D,QAAQ,CAAC;QAEzE;;WAEG;QAEH,gBAAW,GAAG,KAAK,CAAC;QAEpB;;;;;;;;WAQG;QAEH,SAAI,GAAsB,OAAO,CAAC;IAmCpC,CAAC;IAzBW,MAAM;QACd,MAAM,KAAK,GAAG,SAAO,CAAC,MAA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CACR;AAYpB;IADC,QAAQ,EAAE;qCACuB;AAnC9B,OAAO;IA1DZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;QAEG,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6BQ,QAAQ;;;;;;GAM7B,EACD,GAAG,CAAA;;;;;;;;;;;;;;;;GAgBF,CACF;GACK,OAAO,CAsEZ;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -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,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cA8BM,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;IAerC,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"}
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { godown } from "@godown/element
|
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";
|
2
|
+
import { attr, godown, htmlSlot, random, styles } from "@godown/element";
|
7
3
|
import { css, html } from "lit";
|
8
4
|
import { property, query, state } from "lit/decorators.js";
|
9
5
|
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
@@ -20,11 +16,7 @@ let Typewriter = class Typewriter extends GlobalStyle {
|
|
20
16
|
/**
|
21
17
|
* Raw text.
|
22
18
|
*/
|
23
|
-
this.
|
24
|
-
/**
|
25
|
-
* Start immediately after {@linkcode Typewriter.firstUpdated}.
|
26
|
-
*/
|
27
|
-
this.stopped = false;
|
19
|
+
this.content = "";
|
28
20
|
/**
|
29
21
|
* If true, hide the cursor
|
30
22
|
*/
|
@@ -45,39 +37,43 @@ let Typewriter = class Typewriter extends GlobalStyle {
|
|
45
37
|
* The index at the beginning.
|
46
38
|
*/
|
47
39
|
this.index = 0;
|
48
|
-
|
49
|
-
* Internal text.
|
50
|
-
*/
|
51
|
-
this.content = "";
|
40
|
+
this.contentInternal = "";
|
52
41
|
}
|
53
42
|
/**
|
54
|
-
* {@linkcode Typewriter.
|
43
|
+
* {@linkcode Typewriter.content} length.
|
55
44
|
*/
|
56
45
|
get len() {
|
57
|
-
return this.
|
46
|
+
return this.content.length;
|
58
47
|
}
|
59
48
|
render() {
|
60
|
-
return html
|
61
|
-
|
62
|
-
|
49
|
+
return html `
|
50
|
+
<div
|
51
|
+
part="root"
|
52
|
+
${attr(this.observedRecord)}
|
53
|
+
>
|
54
|
+
${htmlSlot()} ${this.contentInternal}
|
55
|
+
<i
|
56
|
+
part="cursor"
|
57
|
+
?hidden="${this.ended}"
|
58
|
+
></i>
|
59
|
+
</div>
|
60
|
+
`;
|
63
61
|
}
|
64
62
|
firstUpdated() {
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
if (!this.stopped && this.len) {
|
63
|
+
this.content ||= this._slot?.assignedNodes()[0]?.textContent.trim() || "";
|
64
|
+
if (!this.ended && this.len) {
|
69
65
|
this.write();
|
70
66
|
}
|
71
67
|
}
|
72
68
|
updated(changedProperties) {
|
73
69
|
if (changedProperties.has("index")) {
|
74
|
-
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.
|
70
|
+
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.contentInternal }));
|
75
71
|
}
|
76
72
|
}
|
77
73
|
write(at = this.index) {
|
78
|
-
this.
|
74
|
+
this.contentInternal = this.content.slice(0, at + 1);
|
79
75
|
const timeout = this.delay || random(this.max, this.min);
|
80
|
-
this.timeoutID =
|
76
|
+
this.timeoutID = setTimeout(() => {
|
81
77
|
const nx = at + 1;
|
82
78
|
if (nx <= this.len) {
|
83
79
|
this.index = nx;
|
@@ -94,10 +90,7 @@ let Typewriter = class Typewriter extends GlobalStyle {
|
|
94
90
|
};
|
95
91
|
__decorate([
|
96
92
|
property()
|
97
|
-
], Typewriter.prototype, "
|
98
|
-
__decorate([
|
99
|
-
property({ type: Boolean })
|
100
|
-
], Typewriter.prototype, "stopped", void 0);
|
93
|
+
], Typewriter.prototype, "content", void 0);
|
101
94
|
__decorate([
|
102
95
|
property({ type: Boolean })
|
103
96
|
], Typewriter.prototype, "ended", void 0);
|
@@ -115,41 +108,42 @@ __decorate([
|
|
115
108
|
], Typewriter.prototype, "index", void 0);
|
116
109
|
__decorate([
|
117
110
|
state()
|
118
|
-
], Typewriter.prototype, "
|
111
|
+
], Typewriter.prototype, "contentInternal", void 0);
|
119
112
|
__decorate([
|
120
113
|
query("i")
|
121
114
|
], Typewriter.prototype, "_i", void 0);
|
122
115
|
Typewriter = __decorate([
|
123
116
|
godown(protoName),
|
124
117
|
styles(css `
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
}
|
118
|
+
:host {
|
119
|
+
${cssScope}--cursor-width: .05em;
|
120
|
+
}
|
129
121
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
}
|
122
|
+
:host,
|
123
|
+
:host([contents]) [part="root"] {
|
124
|
+
display: inline-block;
|
125
|
+
}
|
135
126
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
border-color: transparent;
|
142
|
-
}
|
143
|
-
}
|
127
|
+
i {
|
128
|
+
border-right: var(${cssScope}--cursor-width) solid;
|
129
|
+
margin-left: 0.02em;
|
130
|
+
animation: s 1.5s steps(1) infinite;
|
131
|
+
}
|
144
132
|
|
145
|
-
|
146
|
-
|
133
|
+
@keyframes s {
|
134
|
+
0% {
|
135
|
+
border-color: currentColor;
|
147
136
|
}
|
148
|
-
|
149
|
-
|
150
|
-
visibility: hidden;
|
137
|
+
50% {
|
138
|
+
border-color: transparent;
|
151
139
|
}
|
152
|
-
|
140
|
+
}
|
141
|
+
|
142
|
+
slot {
|
143
|
+
display: none;
|
144
|
+
}
|
145
|
+
`)
|
153
146
|
], Typewriter);
|
154
147
|
export default Typewriter;
|
148
|
+
export { Typewriter };
|
155
149
|
//# sourceMappingURL=typewriter.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typewriter.js","sourceRoot":"","sources":["../../src/components/typewriter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"typewriter.js","sourceRoot":"","sources":["../../src/components/typewriter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAA8C,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,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ACa;AAKX;IADT,KAAK,CAAC,GAAG,CAAC;sCACe;AA3CtB,UAAU;IA9Bf,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;MAEL,QAAQ;;;;;;;;;wBASU,QAAQ;;;;;;;;;;;;;;;;;CAiB/B,CAAC;GACI,UAAU,CAmGf;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
@@ -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,EAAE,KAAK,SAAS,EAAkB,MAAM,KAAK,CAAC;AAErD,qBAAa,WAAY,SAAQ,aAAa;CAAG;AAIjD,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/dev/core/global-style.js
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
import { presetsRGB } from "@godown/colors/presets-rgb.js";
|
2
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";
|
3
|
+
import { GodownElement, joinProperties, trim } from "@godown/element";
|
7
4
|
import { css, unsafeCSS } from "lit";
|
8
|
-
GodownElement.godownConfig ||= new GodownConfig();
|
9
5
|
export class GlobalStyle extends GodownElement {
|
10
6
|
}
|
11
7
|
const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
|
@@ -13,7 +9,7 @@ export function scopePrefix(scope, len = 1) {
|
|
13
9
|
return variablePrefix(cssvar + "-".repeat(len) + scope);
|
14
10
|
}
|
15
11
|
export function variablePrefix(variable) {
|
16
|
-
return unsafeCSS(
|
12
|
+
return unsafeCSS(`--${variable}`);
|
17
13
|
}
|
18
14
|
export const cssGlobalVars = {
|
19
15
|
foreground: scopePrefix("foreground", 2),
|
@@ -27,24 +23,24 @@ export const cssGlobalVars = {
|
|
27
23
|
black: scopePrefix("color-black", 2),
|
28
24
|
};
|
29
25
|
GlobalStyle.styles = [
|
30
|
-
unsafeCSS(":host{"
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
unsafeCSS(":host{" +
|
27
|
+
`${cssGlobalVars.black}:rgb(0 0 0);` +
|
28
|
+
`${cssGlobalVars.white}:rgb(255 255 255);` +
|
29
|
+
travel((key, gradient, rgb) => {
|
34
30
|
cssGlobalVars._colors[key] ||= [];
|
35
31
|
cssGlobalVars._colors[key].push(unsafeCSS(scopePrefix("color", 2) + "-" + key + "-" + gradient));
|
36
32
|
const endKey = `-${key}-${gradient}`;
|
37
33
|
const colorKey = scopePrefix("color", 2) + endKey;
|
38
34
|
return `${colorKey}:rgb(${rgb});`;
|
39
|
-
}, presetsRGB).join("")
|
40
|
-
|
35
|
+
}, presetsRGB).join("") +
|
36
|
+
joinProperties({
|
41
37
|
[cssGlobalVars.background + ""]: `var(${cssGlobalVars._colors.darkgray[9]})`,
|
42
38
|
[cssGlobalVars.foreground + ""]: `var(${cssGlobalVars._colors.lightgray[0]})`,
|
43
39
|
[cssGlobalVars.active + ""]: `var(${cssGlobalVars._colors.blue[6]})`,
|
44
40
|
[cssGlobalVars.passive + ""]: `var(${cssGlobalVars._colors.darkgray[6]})`,
|
45
41
|
[cssGlobalVars.clipBackground + ""]: `linear-gradient(to bottom, var(${cssGlobalVars.foreground}), var(${cssGlobalVars.passive}))`,
|
46
|
-
})
|
47
|
-
|
42
|
+
}) +
|
43
|
+
"}"),
|
48
44
|
css `
|
49
45
|
* {
|
50
46
|
border: 0;
|
@@ -71,6 +67,15 @@ GlobalStyle.styles = [
|
|
71
67
|
svg {
|
72
68
|
user-select: none;
|
73
69
|
}
|
70
|
+
|
71
|
+
:host([contents]) {
|
72
|
+
display: contents;
|
73
|
+
}
|
74
|
+
|
75
|
+
:where(:host([contents]) [part="root"]) {
|
76
|
+
all: inherit;
|
77
|
+
display: revert;
|
78
|
+
}
|
74
79
|
`,
|
75
80
|
];
|
76
81
|
//# sourceMappingURL=global-style.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global-style.js","sourceRoot":"","sources":["../../src/core/global-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,aAAa,
|
1
|
+
{"version":3,"file":"global-style.js","sourceRoot":"","sources":["../../src/core/global-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAkB,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErD,MAAM,OAAO,WAAY,SAAQ,aAAa;CAAG;AAEjD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE1D,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,GAAG,GAAG,CAAC;IAChD,OAAO,cAAc,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,SAAS,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAUtB;IACF,UAAU,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACxC,cAAc,EAAE,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IAClC,OAAO,EAAE,EAA+B;IACxC,KAAK,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AC,OAAO,GAAG,EAAE,CAAC,EAAE,OAAO,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG;YACzE,CAAC,aAAa,CAAC,cAAc,GAAG,EAAE,CAAC,EACjC,kCAAkC,aAAa,CAAC,UAAU,UAAU,aAAa,CAAC,OAAO,IAAI;SAChG,CAAC;QACF,GAAG,CACN;IACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCF;CACF,CAAC"}
|
@@ -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,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAmBM,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;IAcrC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAC5C;AAED,eAAe,WAAW,CAAC"}
|
package/dev/core/super-anchor.js
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { styles } from "@godown/element
|
3
|
-
import {
|
4
|
-
import { css, html } from "lit";
|
2
|
+
import { attr, htmlSlot, styles } from "@godown/element";
|
3
|
+
import { css, html, nothing } from "lit";
|
5
4
|
import { property } from "lit/decorators.js";
|
6
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
7
5
|
import { GlobalStyle } from "./global-style.js";
|
8
6
|
let SuperAnchor = class SuperAnchor extends GlobalStyle {
|
9
7
|
constructor() {
|
@@ -18,11 +16,18 @@ let SuperAnchor = class SuperAnchor extends GlobalStyle {
|
|
18
16
|
this.target = "_self";
|
19
17
|
}
|
20
18
|
render() {
|
21
|
-
return html
|
22
|
-
|
23
|
-
|
19
|
+
return html `
|
20
|
+
<a
|
21
|
+
part="root"
|
22
|
+
${attr(this.observedRecord)}
|
23
|
+
href="${this.href || nothing}"
|
24
|
+
target="${this.target}"
|
25
|
+
@click=${this._handleClick}
|
26
|
+
>
|
27
|
+
${htmlSlot()}
|
28
|
+
</a>
|
29
|
+
`;
|
24
30
|
}
|
25
|
-
// eslint-disable-next-line
|
26
31
|
_handleClick(_) { }
|
27
32
|
};
|
28
33
|
__decorate([
|
@@ -44,13 +49,11 @@ SuperAnchor = __decorate([
|
|
44
49
|
cursor: pointer;
|
45
50
|
}
|
46
51
|
|
47
|
-
|
52
|
+
[part="root"] {
|
48
53
|
width: 100%;
|
49
|
-
display: flex;
|
50
54
|
color: inherit;
|
55
|
+
display: inline-block;
|
51
56
|
text-decoration: inherit;
|
52
|
-
justify-content: space-between;
|
53
|
-
align-items: center;
|
54
57
|
}
|
55
58
|
`)
|
56
59
|
], SuperAnchor);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-anchor.js","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"super-anchor.js","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqBhD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QACE;;WAEG;QAEH,SAAI,GAAW,SAAS,CAAC;QACzB;;WAEG;QAEH,WAAM,GAA4C,OAAO,CAAC;IAiB5D,CAAC;IAfW,MAAM;QACd,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;gBACnB,IAAI,CAAC,IAAI,IAAI,OAAO;kBAClB,IAAI,CAAC,MAAM;iBACZ,IAAI,CAAC,YAAY;;UAExB,QAAQ,EAAE;;KAEf,CAAC;IACJ,CAAC;IAES,YAAY,CAAC,CAAa,IAAS,CAAC;CAC/C,CAAA;AAtBC;IADC,QAAQ,EAAE;yCACc;AAKzB;IADC,QAAQ,EAAE;2CAC+C;AAVtD,WAAW;IAnBhB,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkBV,CAAC;GACI,WAAW,CA2BhB;AAED,eAAe,WAAW,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { type HandlerEvent } from "@godown/element
|
1
|
+
import { type HandlerEvent } from "@godown/element";
|
2
|
+
import { type TemplateResult } from "lit";
|
2
3
|
import { GlobalStyle } from "./global-style.js";
|
3
4
|
declare class SuperInput extends GlobalStyle {
|
4
5
|
autofocus: boolean;
|
@@ -30,8 +31,8 @@ declare class SuperInput extends GlobalStyle {
|
|
30
31
|
protected _changeInputType(t: typeof this.type): void;
|
31
32
|
focus(options?: FocusOptions): void;
|
32
33
|
protected firstUpdated(): void;
|
33
|
-
protected _renderPrefix():
|
34
|
-
protected _renderSuffix():
|
34
|
+
protected _renderPrefix(): TemplateResult<1>;
|
35
|
+
protected _renderSuffix(): TemplateResult<1>;
|
35
36
|
}
|
36
37
|
export default SuperInput;
|
37
38
|
type InputType = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-input.d.ts","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"super-input.d.ts","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAyE/D,cACM,UAAW,SAAQ,WAAW;IAClC,SAAS,UAAS;IAElB,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAG/B,QAAQ,UAAS;IAGjB,IAAI,EAAE,SAAS,CAAC;IAGhB,WAAW,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,GAAG,CAAC;IAEX;;OAEG;IAEH,OAAO,EAAE,GAAG,CAAC;IAGb,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,WAAW,UAAS;IAEpB,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,OAAO,EAE1C;IAED,IAAI,YAAY,IAJQ,OAAO,IAAI,CAAC,OAAO,CAM1C;IAED,SAAS,CAAC,MAAM,EAAE,MAAM,CAAuC;IAE/D,SAAS,IAA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