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
package/src/components/form.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
-
import { css } from "lit";
|
1
|
+
import { godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css } from "lit";
|
5
3
|
import { property } from "lit/decorators.js";
|
6
4
|
|
7
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -15,13 +13,11 @@ const protoName = "form";
|
|
15
13
|
* @category form
|
16
14
|
*/
|
17
15
|
@godown(protoName)
|
18
|
-
@styles(
|
19
|
-
|
20
|
-
:
|
21
|
-
|
22
|
-
|
23
|
-
`,
|
24
|
-
)
|
16
|
+
@styles(css`
|
17
|
+
:host {
|
18
|
+
display: block;
|
19
|
+
}
|
20
|
+
`)
|
25
21
|
class Form<T = object> extends GlobalStyle {
|
26
22
|
@property()
|
27
23
|
name = "";
|
@@ -30,14 +26,14 @@ class Form<T = object> extends GlobalStyle {
|
|
30
26
|
return Form.buildValue(this._slot.assignedElements()) as T;
|
31
27
|
}
|
32
28
|
|
33
|
-
nameValue = this.namevalue;
|
29
|
+
nameValue: () => [string, T] = this.namevalue;
|
34
30
|
|
35
|
-
protected render() {
|
31
|
+
protected render(): TemplateResult<1> {
|
36
32
|
return htmlSlot();
|
37
33
|
}
|
38
34
|
|
39
|
-
reset() {
|
40
|
-
this.deepQuerySelectorAll<HTMLElement & { reset?: () => void
|
35
|
+
reset(): void {
|
36
|
+
this.deepQuerySelectorAll<HTMLElement & { reset?: () => void }>("*").forEach((el) => {
|
41
37
|
if (el.tagName === this.tagName) {
|
42
38
|
return;
|
43
39
|
}
|
@@ -80,3 +76,4 @@ class Form<T = object> extends GlobalStyle {
|
|
80
76
|
}
|
81
77
|
|
82
78
|
export default Form;
|
79
|
+
export { Form };
|
package/src/components/grid.ts
CHANGED
@@ -1,10 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
-
import { htmlStyle } from "@godown/element/directives/html-style.js";
|
5
|
-
import { joinRules } from "@godown/element/tools/css.js";
|
6
|
-
import { isNumerical } from "@godown/element/tools/lib.js";
|
7
|
-
import { css } from "lit";
|
1
|
+
import { attr, godown, htmlSlot, htmlStyle, isNumerical, joinRules, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
8
3
|
import { property } from "lit/decorators.js";
|
9
4
|
|
10
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -18,7 +13,16 @@ const protoName = "grid";
|
|
18
13
|
* @category layout
|
19
14
|
*/
|
20
15
|
@godown(protoName)
|
21
|
-
@styles(css
|
16
|
+
@styles(css`
|
17
|
+
:host,
|
18
|
+
:host([contents]) [part="root"] {
|
19
|
+
display: grid;
|
20
|
+
}
|
21
|
+
|
22
|
+
[part="root"] {
|
23
|
+
display: contents;
|
24
|
+
}
|
25
|
+
`)
|
22
26
|
class Grid extends GlobalStyle {
|
23
27
|
/**
|
24
28
|
* CSS property `gap`.
|
@@ -54,22 +58,30 @@ class Grid extends GlobalStyle {
|
|
54
58
|
@property()
|
55
59
|
items: string;
|
56
60
|
|
57
|
-
protected render() {
|
58
|
-
return
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
61
|
+
protected render(): TemplateResult<1> {
|
62
|
+
return html`
|
63
|
+
<div
|
64
|
+
part="root"
|
65
|
+
${attr(this.observedRecord)}
|
66
|
+
>
|
67
|
+
${[
|
68
|
+
htmlSlot(),
|
69
|
+
htmlStyle(
|
70
|
+
joinRules({
|
71
|
+
":host": {
|
72
|
+
gap: this.gap,
|
73
|
+
"grid-template-columns": isNumerical(this.columns) ? `repeat(${this.columns},1fr)` : this.columns,
|
74
|
+
"grid-template-rows": isNumerical(this.rows) ? `repeat(${this.rows},1fr)` : this.rows,
|
75
|
+
"place-content": this.content,
|
76
|
+
"place-items": this.items,
|
77
|
+
},
|
78
|
+
}),
|
79
|
+
),
|
80
|
+
]}
|
81
|
+
</div>
|
82
|
+
`;
|
72
83
|
}
|
73
84
|
}
|
74
85
|
|
75
86
|
export default Grid;
|
87
|
+
export { Grid };
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html, nothing } from "lit";
|
3
|
+
import { property } from "lit/decorators.js";
|
4
|
+
|
5
|
+
import { GlobalStyle } from "../core/global-style.js";
|
6
|
+
|
7
|
+
const protoName = "heading";
|
8
|
+
|
9
|
+
/**
|
10
|
+
* {@linkcode Heading} renders a heading.
|
11
|
+
*
|
12
|
+
* If the id is provided, the anchor will be displayed.
|
13
|
+
*
|
14
|
+
* @slot - Heading content.
|
15
|
+
* @category layout
|
16
|
+
*/
|
17
|
+
@godown(protoName)
|
18
|
+
@styles(css`
|
19
|
+
:host {
|
20
|
+
display: block;
|
21
|
+
text-align: start;
|
22
|
+
}
|
23
|
+
|
24
|
+
[part="anchor"] {
|
25
|
+
position: absolute;
|
26
|
+
text-align: center;
|
27
|
+
min-width: 1.25em;
|
28
|
+
right: 100%;
|
29
|
+
}
|
30
|
+
|
31
|
+
[side="left"] [part="anchor"] {
|
32
|
+
right: 100%;
|
33
|
+
}
|
34
|
+
[side="right"] [part="anchor"] {
|
35
|
+
left: 100%;
|
36
|
+
}
|
37
|
+
|
38
|
+
a {
|
39
|
+
color: inherit;
|
40
|
+
}
|
41
|
+
|
42
|
+
h1,
|
43
|
+
h2,
|
44
|
+
h3,
|
45
|
+
h4,
|
46
|
+
h5,
|
47
|
+
h6 {
|
48
|
+
direction: ltr;
|
49
|
+
font-size: revert;
|
50
|
+
position: relative;
|
51
|
+
width: fit-content;
|
52
|
+
}
|
53
|
+
`)
|
54
|
+
class Heading extends GlobalStyle {
|
55
|
+
/**
|
56
|
+
* The heading level.
|
57
|
+
*/
|
58
|
+
@property()
|
59
|
+
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" = "h1";
|
60
|
+
|
61
|
+
/**
|
62
|
+
* The anchor prefix.
|
63
|
+
*/
|
64
|
+
@property()
|
65
|
+
anchor = "#";
|
66
|
+
|
67
|
+
/**
|
68
|
+
* The anchor side.
|
69
|
+
*/
|
70
|
+
@property()
|
71
|
+
side: "left" | "right" = "left";
|
72
|
+
|
73
|
+
protected render(): TemplateResult<1> {
|
74
|
+
return html`
|
75
|
+
<a
|
76
|
+
part="root"
|
77
|
+
href="${this.id ? "#" + this.id : nothing}"
|
78
|
+
${attr(this.observedRecord)}
|
79
|
+
>
|
80
|
+
${this.wrapHeading(
|
81
|
+
htmlSlot(),
|
82
|
+
this.id
|
83
|
+
? html`
|
84
|
+
<i part="anchor">${this.anchor}</i>
|
85
|
+
`
|
86
|
+
: "",
|
87
|
+
)}
|
88
|
+
</a>
|
89
|
+
`;
|
90
|
+
}
|
91
|
+
|
92
|
+
protected wrapHeading(...children: any[]): TemplateResult<1> {
|
93
|
+
switch (this.as) {
|
94
|
+
case "h2":
|
95
|
+
return html`
|
96
|
+
<h2>${children}</h2>
|
97
|
+
`;
|
98
|
+
case "h3":
|
99
|
+
return html`
|
100
|
+
<h3>${children}</h3>
|
101
|
+
`;
|
102
|
+
case "h4":
|
103
|
+
return html`
|
104
|
+
<h4>${children}</h4>
|
105
|
+
`;
|
106
|
+
case "h5":
|
107
|
+
return html`
|
108
|
+
<h5>${children}</h5>
|
109
|
+
`;
|
110
|
+
case "h6":
|
111
|
+
return html`
|
112
|
+
<h6>${children}</h6>
|
113
|
+
`;
|
114
|
+
default:
|
115
|
+
return html`
|
116
|
+
<h1>${children}</h1>
|
117
|
+
`;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
export default Heading;
|
123
|
+
export { Heading };
|
package/src/components/input.ts
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { styles } from "@godown/element/decorators/styles.js";
|
4
|
-
import { classList } from "@godown/element/directives/class-list.js";
|
5
|
-
import { css, html, nothing } from "lit";
|
1
|
+
import { attr, classList, godown, part, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html, nothing } from "lit";
|
6
3
|
import { property } from "lit/decorators.js";
|
7
4
|
|
8
5
|
import { cssGlobalVars } from "../core/global-style.js";
|
@@ -13,21 +10,21 @@ const protoName = "input";
|
|
13
10
|
/**
|
14
11
|
* {@linkcode Input} renders a text input.
|
15
12
|
*
|
13
|
+
* @fires input - Fires when the input value changes.
|
14
|
+
* @fires change - Fires when the input value changes.
|
16
15
|
* @category input
|
17
16
|
*/
|
18
17
|
@godown(protoName)
|
19
|
-
@styles(
|
20
|
-
|
21
|
-
:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
`,
|
30
|
-
)
|
18
|
+
@styles(css`
|
19
|
+
:host {
|
20
|
+
width: var(${cssGlobalVars.input}-width);
|
21
|
+
height: var(${cssGlobalVars.input}-height);
|
22
|
+
color: var(${cssGlobalVars.foreground});
|
23
|
+
background: var(${cssGlobalVars.input}-background);
|
24
|
+
border-radius: var(${cssGlobalVars.input}-radius);
|
25
|
+
display: block;
|
26
|
+
}
|
27
|
+
`)
|
31
28
|
class Input extends SuperInput {
|
32
29
|
type: "text" | "search" | "tel" | "url" | "email" | "password" = "text";
|
33
30
|
|
@@ -42,31 +39,40 @@ class Input extends SuperInput {
|
|
42
39
|
@part("input")
|
43
40
|
protected _input: HTMLInputElement;
|
44
41
|
|
45
|
-
protected render() {
|
46
|
-
return html
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
42
|
+
protected render(): TemplateResult<1> {
|
43
|
+
return html`
|
44
|
+
<div
|
45
|
+
part="root"
|
46
|
+
${attr(this.observedRecord)}
|
47
|
+
class="${classList("input-field", this.variant)}"
|
48
|
+
>
|
49
|
+
${[
|
50
|
+
this._renderPrefix(),
|
51
|
+
html`
|
52
|
+
<input
|
53
|
+
part="input"
|
54
|
+
type="${this.type}"
|
55
|
+
.value="${this.value}"
|
56
|
+
?autofocus="${this.autofocus}"
|
57
|
+
?disabled="${this.disabled}"
|
58
|
+
autocapitalize="${this.autocapitalize || nothing}"
|
59
|
+
autocomplete="${this.autocomplete || nothing}"
|
60
|
+
placeholder="${this.placeholder || nothing}"
|
61
|
+
id="${this.makeId}"
|
62
|
+
@input="${this._handleInput}"
|
63
|
+
/>
|
64
|
+
`,
|
65
|
+
this._renderSuffix(),
|
66
|
+
]}
|
67
|
+
</div>
|
68
|
+
`;
|
64
69
|
}
|
65
70
|
|
66
|
-
reset() {
|
71
|
+
reset(): void {
|
67
72
|
this._input.value = this.default;
|
68
73
|
this.value = this.default;
|
69
74
|
}
|
70
75
|
}
|
71
76
|
|
72
77
|
export default Input;
|
78
|
+
export { Input };
|
package/src/components/layout.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 { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
6
3
|
import { property } from "lit/decorators.js";
|
7
4
|
|
8
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -10,7 +7,7 @@ import { GlobalStyle } from "../core/global-style.js";
|
|
10
7
|
const protoName = "layout";
|
11
8
|
|
12
9
|
/**
|
13
|
-
* {@linkcode
|
10
|
+
* {@linkcode Layout} renders slot and optional top header, bottom footer.
|
14
11
|
*
|
15
12
|
* @slot - The main content of the layout.
|
16
13
|
* @slot header - The header of the layout.
|
@@ -18,34 +15,37 @@ const protoName = "layout";
|
|
18
15
|
* @category layout
|
19
16
|
*/
|
20
17
|
@godown(protoName)
|
21
|
-
@styles(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
@styles(css`
|
19
|
+
:host,
|
20
|
+
:host([contents]) [part="root"] {
|
21
|
+
min-height: 100%;
|
22
|
+
display: flex;
|
23
|
+
flex-direction: column;
|
24
|
+
}
|
25
|
+
|
26
|
+
[part="root"] {
|
27
|
+
display: contents;
|
28
|
+
}
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
[sticky] header {
|
31
|
+
position: sticky;
|
32
|
+
top: 0;
|
33
|
+
z-index: 1;
|
34
|
+
}
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
[part="main"] {
|
37
|
+
position: relative;
|
38
|
+
flex: 1;
|
39
|
+
width: 100%;
|
40
|
+
}
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
class NavLayout extends GlobalStyle {
|
42
|
+
header,
|
43
|
+
main,
|
44
|
+
footer {
|
45
|
+
width: 100%;
|
46
|
+
}
|
47
|
+
`)
|
48
|
+
class Layout extends GlobalStyle {
|
49
49
|
/**
|
50
50
|
* If true, remove the header slot.
|
51
51
|
*/
|
@@ -64,19 +64,27 @@ class NavLayout extends GlobalStyle {
|
|
64
64
|
@property({ type: Boolean })
|
65
65
|
sticky = false;
|
66
66
|
|
67
|
-
protected render() {
|
68
|
-
return html
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
67
|
+
protected render(): TemplateResult<1> {
|
68
|
+
return html`
|
69
|
+
<div
|
70
|
+
part="root"
|
71
|
+
${attr(this.observedRecord)}
|
72
|
+
>
|
73
|
+
${!this.noHeader
|
74
|
+
? html`
|
75
|
+
<header part="header">${htmlSlot("header")}</header>
|
76
|
+
`
|
77
|
+
: ""}
|
78
|
+
<main part="main">${htmlSlot()}</main>
|
79
|
+
${!this.noFooter
|
80
|
+
? html`
|
81
|
+
<footer part="footer">${htmlSlot("footer")}</footer>
|
82
|
+
`
|
83
|
+
: ""}
|
84
|
+
</div>
|
85
|
+
`;
|
79
86
|
}
|
80
87
|
}
|
81
88
|
|
82
|
-
export default
|
89
|
+
export default Layout;
|
90
|
+
export { Layout };
|
package/src/components/link.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { godown } from "@godown/element
|
1
|
+
import { godown } from "@godown/element";
|
2
2
|
import { property } from "lit/decorators.js";
|
3
3
|
|
4
4
|
import SuperAnchor from "../core/super-anchor.js";
|
@@ -26,13 +26,22 @@ class Link extends SuperAnchor {
|
|
26
26
|
@property()
|
27
27
|
type: "push" | "replace" | "normal" = "normal";
|
28
28
|
|
29
|
-
|
29
|
+
/**
|
30
|
+
* Suppress the update of the {@linkcode Router}.
|
31
|
+
*/
|
32
|
+
@property({ type: Boolean })
|
33
|
+
suppress = false;
|
34
|
+
|
35
|
+
protected _handleClick(e: MouseEvent): void {
|
30
36
|
if (this.type === "push" || this.type === "replace") {
|
31
37
|
e.preventDefault();
|
32
|
-
|
33
|
-
|
38
|
+
history[`${this.type}State`](null, "", this.href);
|
39
|
+
if (!this.suppress) {
|
40
|
+
Router.updateAll();
|
41
|
+
}
|
34
42
|
}
|
35
43
|
}
|
36
44
|
}
|
37
45
|
|
38
46
|
export default Link;
|
47
|
+
export { Link };
|
@@ -1,10 +1,8 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { isNil } from "@godown/element/tools/lib.js";
|
4
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, godown, isNil, styles } from "@godown/element";
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
5
3
|
import { property } from "lit/decorators.js";
|
6
4
|
|
7
|
-
import {
|
5
|
+
import { GlobalStyle, cssGlobalVars } from "../core/global-style.js";
|
8
6
|
|
9
7
|
const protoName = "progress";
|
10
8
|
|
@@ -18,12 +16,16 @@ const protoName = "progress";
|
|
18
16
|
:host {
|
19
17
|
width: 100%;
|
20
18
|
height: 0.5em;
|
21
|
-
display: inline-block;
|
22
19
|
border-radius: 0.25em;
|
23
20
|
background: var(${cssGlobalVars.passive});
|
24
21
|
color: var(${cssGlobalVars.active});
|
25
22
|
}
|
26
23
|
|
24
|
+
:host,
|
25
|
+
[part="root"] {
|
26
|
+
display: block;
|
27
|
+
}
|
28
|
+
|
27
29
|
[part="root"] {
|
28
30
|
height: inherit;
|
29
31
|
z-index: 1;
|
@@ -66,16 +68,25 @@ class Progress extends GlobalStyle {
|
|
66
68
|
@property({ type: Number })
|
67
69
|
value: number;
|
68
70
|
|
69
|
-
protected render() {
|
71
|
+
protected render(): TemplateResult<1> {
|
70
72
|
let width = 20;
|
71
73
|
let className: string;
|
72
74
|
if (!isNil(this.value)) {
|
73
75
|
width = this.parsePercent(this.value);
|
74
76
|
className = "static";
|
75
77
|
}
|
76
|
-
return html
|
77
|
-
<
|
78
|
-
|
78
|
+
return html`
|
79
|
+
<div
|
80
|
+
part="root"
|
81
|
+
${attr(this.observedRecord)}
|
82
|
+
class="${className}"
|
83
|
+
>
|
84
|
+
<i
|
85
|
+
part="value"
|
86
|
+
style="width:${width}%;"
|
87
|
+
></i>
|
88
|
+
</div>
|
89
|
+
`;
|
79
90
|
}
|
80
91
|
|
81
92
|
/**
|
@@ -93,3 +104,4 @@ class Progress extends GlobalStyle {
|
|
93
104
|
}
|
94
105
|
|
95
106
|
export default Progress;
|
107
|
+
export { Progress };
|