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,11 +1,9 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import { styles } from "@godown/element/decorators/styles.js";
|
3
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
1
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
4
2
|
import iconPhoto from "@godown/f7-icon/icons/photo.js";
|
5
|
-
import { css, html } from "lit";
|
3
|
+
import { type TemplateResult, css, html } from "lit";
|
6
4
|
import { property, state } from "lit/decorators.js";
|
7
5
|
|
8
|
-
import {
|
6
|
+
import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
9
7
|
|
10
8
|
const protoName = "skeleton";
|
11
9
|
const cssScope = scopePrefix(protoName);
|
@@ -18,73 +16,71 @@ const cssScope = scopePrefix(protoName);
|
|
18
16
|
* @category feedback
|
19
17
|
*/
|
20
18
|
@godown(protoName)
|
21
|
-
@styles(
|
22
|
-
|
23
|
-
:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
19
|
+
@styles(css`
|
20
|
+
:host {
|
21
|
+
${cssScope}--from: var(${cssGlobalVars._colors.darkgray[9]});
|
22
|
+
${cssScope}--to: var(${cssGlobalVars._colors.darkgray[7]});
|
23
|
+
${cssScope}--deg: 95deg;
|
24
|
+
${cssScope}--duration: 1.5s;
|
25
|
+
${cssScope}--icon-size: 5em;
|
26
|
+
${cssScope}--icon-margin: .25em;
|
27
|
+
color: var(${cssGlobalVars._colors.darkgray[5]});
|
28
|
+
background: var(${cssScope}--from);
|
29
|
+
min-height: 1.5em;
|
30
|
+
width: 100%;
|
31
|
+
flex-shrink: 0;
|
32
|
+
display: block;
|
33
|
+
overflow: hidden;
|
34
|
+
}
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
[part="root"] {
|
37
|
+
height: 100%;
|
38
|
+
min-height: inherit;
|
39
|
+
text-align: center;
|
40
|
+
animation: var(${cssScope}--duration) ease-in-out 0s infinite none running;
|
41
|
+
}
|
45
42
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
svg {
|
44
|
+
--size: var(${cssScope}--icon-size);
|
45
|
+
font-size: var(--size);
|
46
|
+
margin: calc(var(--size) * 0.05);
|
47
|
+
}
|
51
48
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
49
|
+
[animation="position"] {
|
50
|
+
background-image: linear-gradient(
|
51
|
+
var(${cssScope}--deg),
|
52
|
+
var(${cssScope}--from) 36%,
|
53
|
+
var(${cssScope}--to) 50%,
|
54
|
+
var(${cssScope}--from) 64%
|
55
|
+
);
|
56
|
+
background-color: transparent;
|
57
|
+
background-size: 200% 100%;
|
58
|
+
animation-name: po;
|
59
|
+
}
|
63
60
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
to {
|
69
|
-
background-position: -50% center;
|
70
|
-
}
|
61
|
+
@keyframes po {
|
62
|
+
from {
|
63
|
+
background-position: 150% center;
|
71
64
|
}
|
72
|
-
|
73
|
-
|
74
|
-
animation-name: op;
|
75
|
-
animation-direction: alternate;
|
65
|
+
to {
|
66
|
+
background-position: -50% center;
|
76
67
|
}
|
68
|
+
}
|
77
69
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
70
|
+
[animation="opacity"] {
|
71
|
+
animation-name: op;
|
72
|
+
animation-direction: alternate;
|
73
|
+
}
|
74
|
+
|
75
|
+
@keyframes op {
|
76
|
+
50% {
|
77
|
+
opacity: 0.25;
|
78
|
+
}
|
79
|
+
to {
|
80
|
+
opacity: 1;
|
85
81
|
}
|
86
|
-
|
87
|
-
)
|
82
|
+
}
|
83
|
+
`)
|
88
84
|
class Skeleton extends GlobalStyle {
|
89
85
|
/**
|
90
86
|
* If "image", render a image placeholder.
|
@@ -105,14 +101,20 @@ class Skeleton extends GlobalStyle {
|
|
105
101
|
@state()
|
106
102
|
loading = true;
|
107
103
|
|
108
|
-
protected render() {
|
104
|
+
protected render(): TemplateResult<1> {
|
109
105
|
if (!this.loading) {
|
110
106
|
return htmlSlot();
|
111
107
|
}
|
112
|
-
return html
|
113
|
-
|
114
|
-
|
108
|
+
return html`
|
109
|
+
<div
|
110
|
+
part="root"
|
111
|
+
${attr(this.observedRecord)}
|
112
|
+
>
|
113
|
+
${this.type === "image" ? iconPhoto() : ""} ${htmlSlot("loading")}
|
114
|
+
</div>
|
115
|
+
`;
|
115
116
|
}
|
116
117
|
}
|
117
118
|
|
118
119
|
export default Skeleton;
|
120
|
+
export { Skeleton };
|
package/src/components/split.ts
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { classList } from "@godown/element/directives/class-list.js";
|
4
|
-
import { type HandlerEvent } from "@godown/element/element.js";
|
5
|
-
import { css, html, nothing } from "lit";
|
1
|
+
import { type HandlerEvent, attr, classList, godown, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html, nothing } from "lit";
|
6
3
|
import { property, state } from "lit/decorators.js";
|
7
4
|
|
8
5
|
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
@@ -26,53 +23,59 @@ const loop = <T>(len: number, fn: (index?: number) => T) => {
|
|
26
23
|
*
|
27
24
|
* Delete: will move the focus box forward until the first and no inputs for each.
|
28
25
|
*
|
26
|
+
* @fires input - Fires when the input value changes.
|
27
|
+
* @fires change - Fires when the input value changes.
|
28
|
+
* @fires focus - Fires when the input is focused.
|
29
|
+
* @fires blur - Fires when the input is blurred.
|
29
30
|
* @category input
|
30
31
|
*/
|
31
32
|
@godown(protoName)
|
32
|
-
@styles(
|
33
|
-
|
34
|
-
:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
33
|
+
@styles(css`
|
34
|
+
:host {
|
35
|
+
color: var(${cssGlobalVars.foreground});
|
36
|
+
display: block;
|
37
|
+
border-radius: 1px;
|
38
|
+
width: fit-content;
|
39
|
+
${cssScope}--size: 1.45em;
|
40
|
+
${cssScope}--gap: .25em;
|
41
|
+
}
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
position: relative;
|
47
|
-
vertical-align: top;
|
48
|
-
display: inline-flex;
|
49
|
-
justify-content: space-between;
|
50
|
-
border-radius: inherit;
|
51
|
-
}
|
43
|
+
:host([contents]) [part="root"] {
|
44
|
+
width: fit-content;
|
45
|
+
}
|
52
46
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
47
|
+
[part="root"] {
|
48
|
+
gap: var(${cssScope}--gap);
|
49
|
+
width: 100%;
|
50
|
+
position: relative;
|
51
|
+
vertical-align: top;
|
52
|
+
display: flex;
|
53
|
+
justify-content: space-between;
|
54
|
+
border-radius: inherit;
|
55
|
+
}
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
57
|
+
[part="input-box"] {
|
58
|
+
width: var(${cssScope}--size);
|
59
|
+
height: var(${cssScope}--size);
|
60
|
+
vertical-align: top;
|
61
|
+
text-align: center;
|
62
|
+
background-color: var(${cssGlobalVars.input}-background);
|
63
|
+
border-radius: inherit;
|
64
|
+
}
|
70
65
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
66
|
+
[part="input"] {
|
67
|
+
width: 100%;
|
68
|
+
height: 100%;
|
69
|
+
opacity: 0;
|
70
|
+
background: none;
|
71
|
+
position: absolute;
|
72
|
+
z-index: -1;
|
73
|
+
}
|
74
|
+
|
75
|
+
.focus {
|
76
|
+
box-shadow: var(${cssGlobalVars.input}-box-shadow);
|
77
|
+
}
|
78
|
+
`)
|
76
79
|
class Split extends SuperInput {
|
77
80
|
/**
|
78
81
|
* The number of input boxes.
|
@@ -92,25 +95,34 @@ class Split extends SuperInput {
|
|
92
95
|
@state()
|
93
96
|
currentValue: (string | void)[] = [];
|
94
97
|
|
95
|
-
protected render() {
|
98
|
+
protected render(): TemplateResult<1> {
|
96
99
|
return html`
|
97
|
-
<div
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
<div
|
101
|
+
part="root"
|
102
|
+
${attr(this.observedRecord)}
|
103
|
+
>
|
104
|
+
${loop(
|
105
|
+
this.len,
|
106
|
+
(index: number) => html`
|
107
|
+
<span
|
108
|
+
part="input-box"
|
109
|
+
class="${classList({ focus: this.current === index })}"
|
110
|
+
@click="${this.disabled ? null : () => this.focusAt(index)}"
|
111
|
+
>
|
112
|
+
${this.currentValue[index]}
|
113
|
+
</span>
|
114
|
+
`,
|
115
|
+
)}
|
105
116
|
<input
|
106
117
|
part="input"
|
107
118
|
id="${this.makeId}"
|
108
119
|
@blur=${this.blur}
|
109
120
|
@input="${this._handleInput}"
|
110
121
|
.value="${
|
111
|
-
|
112
|
-
|
113
|
-
|
122
|
+
/* Ensure that input always has a value of length this.len */
|
123
|
+
this.value.padStart(this.len, " ")
|
124
|
+
}"
|
125
|
+
/>
|
114
126
|
</div>
|
115
127
|
`;
|
116
128
|
}
|
@@ -120,7 +132,7 @@ class Split extends SuperInput {
|
|
120
132
|
this.reset();
|
121
133
|
}
|
122
134
|
|
123
|
-
protected _handleInput(e: HandlerEvent<HTMLInputElement, InputEvent>) {
|
135
|
+
protected _handleInput(e: HandlerEvent<HTMLInputElement, InputEvent>): void {
|
124
136
|
e.stopPropagation();
|
125
137
|
if (this.compositing) {
|
126
138
|
return;
|
@@ -129,8 +141,7 @@ class Split extends SuperInput {
|
|
129
141
|
this.fillInput(e.data);
|
130
142
|
this.value = this.currentValue.join("");
|
131
143
|
|
132
|
-
this.dispatchEvent(new CustomEvent("input", { detail: this.value,
|
133
|
-
this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
|
144
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.value, composed: true, bubbles: true }));
|
134
145
|
}
|
135
146
|
|
136
147
|
/**
|
@@ -149,7 +160,7 @@ class Split extends SuperInput {
|
|
149
160
|
*
|
150
161
|
* @param data Input event data.
|
151
162
|
*/
|
152
|
-
protected fillInput(data: string | null) {
|
163
|
+
protected fillInput(data: string | null): void {
|
153
164
|
if (data === null) {
|
154
165
|
// delete
|
155
166
|
|
@@ -161,8 +172,8 @@ class Split extends SuperInput {
|
|
161
172
|
// go to before
|
162
173
|
|
163
174
|
this.currentValue[this.current - 1] = null;
|
164
|
-
const lastNotNull = this.currentValue.findLastIndex(a => a !== null);
|
165
|
-
this.current = this.current - 1 < 0 ? lastNotNull < 0 ? 0 : lastNotNull : this.current - 1;
|
175
|
+
const lastNotNull = this.currentValue.findLastIndex((a) => a !== null);
|
176
|
+
this.current = this.current - 1 < 0 ? (lastNotNull < 0 ? 0 : lastNotNull) : this.current - 1;
|
166
177
|
}
|
167
178
|
return;
|
168
179
|
}
|
@@ -192,23 +203,25 @@ class Split extends SuperInput {
|
|
192
203
|
}
|
193
204
|
}
|
194
205
|
|
195
|
-
focus() {
|
206
|
+
focus(): void {
|
196
207
|
this.focusAt(this.current);
|
197
208
|
super.focus();
|
198
209
|
}
|
199
210
|
|
200
|
-
focusAt(i: number) {
|
211
|
+
focusAt(i: number): void {
|
201
212
|
this.current = i;
|
202
213
|
this._input.focus();
|
214
|
+
this.dispatchEvent(new CustomEvent("focus", { detail: i, bubbles: true, composed: true }));
|
203
215
|
}
|
204
216
|
|
205
|
-
blur() {
|
217
|
+
blur(): void {
|
206
218
|
this._input.blur();
|
207
219
|
this.current = -1;
|
208
220
|
super.blur();
|
221
|
+
this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
|
209
222
|
}
|
210
223
|
|
211
|
-
reset() {
|
224
|
+
reset(): void {
|
212
225
|
this.current = -1;
|
213
226
|
this.value = this.default;
|
214
227
|
this.currentValue = this.value.split("").concat(Array(this.len - this.value.length).fill(null));
|
@@ -219,3 +232,4 @@ class Split extends SuperInput {
|
|
219
232
|
}
|
220
233
|
|
221
234
|
export default Split;
|
235
|
+
export { Split };
|
package/src/components/switch.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
4
3
|
import { property, query } from "lit/decorators.js";
|
5
4
|
|
6
5
|
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
@@ -15,96 +14,92 @@ const cssScope = scopePrefix(protoName);
|
|
15
14
|
* The switch is rectangular by default,
|
16
15
|
* set the round property to rounded switch.
|
17
16
|
*
|
17
|
+
* @fires change - Fires when the switch is switched.
|
18
18
|
* @category input
|
19
19
|
*/
|
20
20
|
@godown(protoName)
|
21
|
-
@styles(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
${cssScope}-transition: .2s ease-in-out;
|
29
|
-
background: var(${cssGlobalVars.input}-background);
|
30
|
-
width: var(${cssScope}-width);
|
31
|
-
height: var(${cssScope}-height);
|
32
|
-
display: inline-block;
|
33
|
-
vertical-align: bottom;
|
34
|
-
border-radius: 0;
|
35
|
-
}
|
36
|
-
|
37
|
-
[part="root"],
|
38
|
-
span {
|
39
|
-
transition: var(${cssScope}-transition);
|
40
|
-
}
|
21
|
+
@styles(css`
|
22
|
+
:host,
|
23
|
+
:host([contents]) [part="root"] {
|
24
|
+
width: var(${cssScope}-width);
|
25
|
+
height: var(${cssScope}-height);
|
26
|
+
display: inline-block;
|
27
|
+
}
|
41
28
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
}
|
29
|
+
:host {
|
30
|
+
${cssScope}-width: 3em;
|
31
|
+
${cssScope}-height: calc(var(${cssScope}-width) / 2);
|
32
|
+
${cssScope}-handle-size: 1.25em;
|
33
|
+
${cssScope}-handle-space: .125em;
|
34
|
+
${cssScope}-transition: .2s ease-in-out;
|
35
|
+
background: var(${cssGlobalVars.input}-background);
|
36
|
+
vertical-align: bottom;
|
37
|
+
border-radius: 0;
|
38
|
+
}
|
47
39
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
[part="root"],
|
41
|
+
[part="handle"] {
|
42
|
+
transition: var(${cssScope}-transition);
|
43
|
+
}
|
52
44
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
[part="root"] {
|
46
|
+
border-radius: inherit;
|
47
|
+
position: relative;
|
48
|
+
height: inherit;
|
49
|
+
}
|
58
50
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
left: 0;
|
66
|
-
width: 50%;
|
67
|
-
pointer-events: none;
|
68
|
-
border-radius: inherit;
|
69
|
-
}
|
51
|
+
[part="input"] {
|
52
|
+
opacity: 0;
|
53
|
+
width: 100%;
|
54
|
+
height: 100%;
|
55
|
+
appearance: none;
|
56
|
+
}
|
70
57
|
|
71
|
-
|
72
|
-
|
73
|
-
|
58
|
+
[part="handle"] {
|
59
|
+
height: 100%;
|
60
|
+
display: inline-flex;
|
61
|
+
align-items: center;
|
62
|
+
justify-content: center;
|
63
|
+
position: absolute;
|
64
|
+
left: 0;
|
65
|
+
width: 50%;
|
66
|
+
pointer-events: none;
|
67
|
+
border-radius: inherit;
|
68
|
+
}
|
74
69
|
|
75
|
-
|
76
|
-
|
77
|
-
}
|
70
|
+
:host([round]) {
|
71
|
+
border-radius: calc(var(${cssScope}-height) / 2);
|
72
|
+
background: var(${cssGlobalVars.passive});
|
73
|
+
}
|
78
74
|
|
79
|
-
|
80
|
-
|
81
|
-
|
75
|
+
:host([checked]) [part="handle"] {
|
76
|
+
left: 50%;
|
77
|
+
}
|
82
78
|
|
83
|
-
|
84
|
-
|
85
|
-
|
79
|
+
.rect .true {
|
80
|
+
background: var(${cssGlobalVars.active});
|
81
|
+
}
|
86
82
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
background: var(--godown--input-control);
|
91
|
-
width: var(--size);
|
92
|
-
height: var(--size);
|
93
|
-
margin: var(${cssScope}-handle-space);
|
94
|
-
}
|
83
|
+
.rect .false {
|
84
|
+
background: var(${cssGlobalVars.passive});
|
85
|
+
}
|
95
86
|
|
96
|
-
|
97
|
-
|
98
|
-
|
87
|
+
.round [part="handle"] {
|
88
|
+
--size: var(${cssScope}-handle-size);
|
89
|
+
border-radius: 100%;
|
90
|
+
background: var(--godown--input-control);
|
91
|
+
width: var(--size);
|
92
|
+
height: var(--size);
|
93
|
+
margin: var(${cssScope}-handle-space);
|
94
|
+
}
|
99
95
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
)
|
96
|
+
:host([checked]) .round {
|
97
|
+
background: var(${cssGlobalVars.active});
|
98
|
+
}
|
99
|
+
`)
|
105
100
|
class Switch extends SuperInput {
|
106
101
|
/**
|
107
|
-
*
|
102
|
+
* Display rounded.
|
108
103
|
*/
|
109
104
|
@property({ type: Boolean, reflect: true })
|
110
105
|
round = false;
|
@@ -136,27 +131,36 @@ class Switch extends SuperInput {
|
|
136
131
|
@query("input")
|
137
132
|
protected _input: HTMLInputElement;
|
138
133
|
|
139
|
-
protected render() {
|
140
|
-
return html
|
141
|
-
<
|
142
|
-
part="
|
143
|
-
|
144
|
-
|
145
|
-
?checked="${this.checked}"
|
146
|
-
name="${this.name}"
|
147
|
-
id="${this.makeId}"
|
148
|
-
type="checkbox"
|
134
|
+
protected render(): TemplateResult<1> {
|
135
|
+
return html`
|
136
|
+
<div
|
137
|
+
part="root"
|
138
|
+
${attr(this.observedRecord)}
|
139
|
+
class="${this.round ? "round" : "rect"}"
|
149
140
|
>
|
150
|
-
|
151
|
-
|
141
|
+
<input
|
142
|
+
part="input"
|
143
|
+
type="checkbox"
|
144
|
+
?disabled="${this.disabled}"
|
145
|
+
?checked="${this.checked}"
|
146
|
+
name="${this.name}"
|
147
|
+
id="${this.makeId}"
|
148
|
+
@change="${this._handleChange}"
|
149
|
+
/>
|
150
|
+
<span
|
151
|
+
part="handle"
|
152
|
+
class="${this.checked}"
|
153
|
+
></span>
|
154
|
+
</div>
|
155
|
+
`;
|
152
156
|
}
|
153
157
|
|
154
|
-
reset() {
|
158
|
+
reset(): void {
|
155
159
|
this.checked = this.default === "true";
|
156
160
|
this._input.checked = this.checked;
|
157
161
|
}
|
158
162
|
|
159
|
-
connectedCallback() {
|
163
|
+
connectedCallback(): void {
|
160
164
|
super.connectedCallback();
|
161
165
|
if (this.checked) {
|
162
166
|
this.default = "true";
|
@@ -166,9 +170,8 @@ class Switch extends SuperInput {
|
|
166
170
|
}
|
167
171
|
}
|
168
172
|
|
169
|
-
protected _handleChange() {
|
173
|
+
protected _handleChange(): void {
|
170
174
|
this.checked = this._input.checked;
|
171
|
-
this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
|
172
175
|
this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
|
173
176
|
}
|
174
177
|
|
@@ -178,3 +181,4 @@ class Switch extends SuperInput {
|
|
178
181
|
}
|
179
182
|
|
180
183
|
export default Switch;
|
184
|
+
export { Switch };
|