godown 3.0.0-canary.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -9
- package/alert.d.ts +1 -0
- package/alert.d.ts.map +1 -1
- package/alert.js +1 -5
- package/alert.js.map +1 -1
- package/avatar.d.ts +1 -0
- package/avatar.d.ts.map +1 -1
- package/avatar.js +1 -5
- package/avatar.js.map +1 -1
- package/badge.d.ts +9 -0
- package/badge.d.ts.map +1 -0
- package/badge.js +2 -0
- package/badge.js.map +1 -0
- package/breath.js +1 -5
- package/breath.js.map +1 -1
- package/build/godown+lit.iife.js +59 -0
- package/build/godown+lit.iife.js.map +1 -0
- package/build/godown+lit.js +59 -0
- package/build/godown+lit.js.map +1 -0
- package/build/godown+lit.umd.js +59 -0
- package/build/godown+lit.umd.js.map +1 -0
- package/build/godown.iife.js +47 -0
- package/build/godown.js +48 -0
- package/build/godown.js.map +1 -0
- package/build/godown.umd.js +48 -0
- package/build/godown.umd.js.map +1 -0
- package/button.d.ts +1 -0
- package/button.d.ts.map +1 -1
- package/button.js +1 -5
- package/button.js.map +1 -1
- package/card.d.ts +1 -0
- package/card.d.ts.map +1 -1
- package/card.js +1 -5
- package/card.js.map +1 -1
- package/carousel.d.ts +1 -0
- package/carousel.d.ts.map +1 -1
- package/carousel.js +1 -5
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +4 -1
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -176
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +7 -2
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -62
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +23 -0
- package/components/badge.d.ts.map +1 -0
- package/components/badge.js +2 -0
- package/components/badge.js.map +1 -0
- package/components/breath.d.ts +6 -4
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -80
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +8 -5
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -168
- package/components/button.js.map +1 -1
- package/components/card.d.ts +3 -1
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -48
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +5 -1
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -113
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +4 -3
- package/components/details.d.ts.map +1 -1
- package/components/details.js +1 -52
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +4 -2
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -96
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +3 -3
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +1 -36
- package/components/divider.js.map +1 -1
- package/components/dragbox.d.ts +4 -2
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +1 -109
- package/components/dragbox.js.map +1 -1
- package/components/flex.d.ts +3 -1
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js +1 -62
- package/components/flex.js.map +1 -1
- package/components/form.d.ts +3 -1
- package/components/form.d.ts.map +1 -1
- package/components/form.js +1 -75
- package/components/form.js.map +1 -1
- package/components/grid.d.ts +3 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +1 -56
- package/components/grid.js.map +1 -1
- package/components/heading.d.ts +29 -0
- package/components/heading.d.ts.map +1 -0
- package/components/heading.js +2 -0
- package/components/heading.js.map +1 -0
- package/components/input.d.ts +5 -1
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -50
- package/components/input.js.map +1 -1
- package/components/layout.d.ts +6 -4
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +1 -58
- package/components/layout.js.map +1 -1
- package/components/link.d.ts +5 -0
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -44
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +3 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -58
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +10 -4
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -266
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +3 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js +1 -56
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +14 -16
- package/components/router.d.ts.map +1 -1
- package/components/router.js +1 -250
- package/components/router.js.map +1 -1
- package/components/select.d.ts +7 -2
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -211
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts +3 -1
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +1 -54
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts +8 -2
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -153
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -2
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -92
- package/components/switch.js.map +1 -1
- package/components/text.d.ts +3 -1
- package/components/text.d.ts.map +1 -1
- package/components/text.js +1 -43
- package/components/text.js.map +1 -1
- package/components/time.d.ts +4 -2
- package/components/time.d.ts.map +1 -1
- package/components/time.js +1 -77
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +4 -2
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -80
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts +6 -12
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +1 -129
- package/components/typewriter.js.map +1 -1
- package/core/global-style.d.ts +2 -2
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -52
- package/core/global-style.js.map +1 -1
- package/core/super-anchor.d.ts +2 -1
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -38
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +4 -3
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -111
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +1 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -37
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/details.d.ts +1 -0
- package/details.d.ts.map +1 -1
- package/details.js +1 -5
- package/details.js.map +1 -1
- package/dev/alert.d.ts +1 -0
- package/dev/alert.d.ts.map +1 -1
- package/dev/alert.js +1 -0
- package/dev/alert.js.map +1 -1
- package/dev/avatar.d.ts +1 -0
- package/dev/avatar.d.ts.map +1 -1
- package/dev/avatar.js +1 -0
- package/dev/avatar.js.map +1 -1
- package/dev/badge.d.ts +9 -0
- package/dev/badge.d.ts.map +1 -0
- package/dev/badge.js +5 -0
- package/dev/badge.js.map +1 -0
- package/dev/button.d.ts +1 -0
- package/dev/button.d.ts.map +1 -1
- package/dev/button.js +1 -0
- package/dev/button.js.map +1 -1
- package/dev/card.d.ts +1 -0
- package/dev/card.d.ts.map +1 -1
- package/dev/card.js +1 -0
- package/dev/card.js.map +1 -1
- package/dev/carousel.d.ts +1 -0
- package/dev/carousel.d.ts.map +1 -1
- package/dev/carousel.js +1 -0
- package/dev/carousel.js.map +1 -1
- package/dev/components/alert.d.ts +4 -1
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +20 -23
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +7 -2
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +22 -10
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +23 -0
- package/dev/components/badge.d.ts.map +1 -0
- package/dev/components/badge.js +107 -0
- package/dev/components/badge.js.map +1 -0
- package/dev/components/breath.d.ts +6 -4
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +29 -26
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +8 -5
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +31 -17
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +3 -1
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +8 -11
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +5 -1
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +32 -26
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +4 -3
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +22 -27
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +4 -2
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +17 -16
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +3 -3
- package/dev/components/divider.d.ts.map +1 -1
- package/dev/components/divider.js +29 -17
- package/dev/components/divider.js.map +1 -1
- package/dev/components/dragbox.d.ts +4 -2
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +11 -4
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts +3 -1
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +17 -9
- package/dev/components/flex.js.map +1 -1
- package/dev/components/form.d.ts +3 -1
- package/dev/components/form.d.ts.map +1 -1
- package/dev/components/form.js +2 -3
- package/dev/components/form.js.map +1 -1
- package/dev/components/grid.d.ts +3 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +17 -10
- package/dev/components/grid.js.map +1 -1
- package/dev/components/heading.d.ts +29 -0
- package/dev/components/heading.d.ts.map +1 -0
- package/dev/components/heading.js +103 -0
- package/dev/components/heading.js.map +1 -0
- package/dev/components/input.d.ts +5 -1
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +17 -17
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts +6 -4
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +23 -22
- package/dev/components/layout.js.map +1 -1
- package/dev/components/link.d.ts +5 -0
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +12 -2
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +3 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +41 -38
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +10 -4
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +53 -51
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +3 -1
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +3 -5
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +14 -16
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +14 -27
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +7 -2
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +44 -31
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts +3 -1
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +9 -9
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts +8 -2
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +32 -24
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +5 -2
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +22 -25
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts +3 -1
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +12 -15
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts +4 -2
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +7 -5
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +4 -2
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +37 -27
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts +6 -12
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +22 -36
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/global-style.d.ts +2 -2
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +11 -6
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts +2 -1
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +25 -23
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +4 -3
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +43 -36
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +1 -1
- package/dev/core/super-openable.d.ts.map +1 -1
- package/dev/core/super-openable.js +2 -2
- package/dev/core/super-openable.js.map +1 -1
- package/dev/details.d.ts +1 -0
- package/dev/details.d.ts.map +1 -1
- package/dev/details.js +1 -0
- package/dev/details.js.map +1 -1
- package/dev/dialog.d.ts +1 -0
- package/dev/dialog.d.ts.map +1 -1
- package/dev/dialog.js +1 -0
- package/dev/dialog.js.map +1 -1
- package/dev/divider.d.ts +1 -0
- package/dev/divider.d.ts.map +1 -1
- package/dev/divider.js +1 -0
- package/dev/divider.js.map +1 -1
- package/dev/dragbox.d.ts +1 -0
- package/dev/dragbox.d.ts.map +1 -1
- package/dev/dragbox.js +1 -0
- package/dev/dragbox.js.map +1 -1
- package/dev/flex.d.ts +1 -0
- package/dev/flex.d.ts.map +1 -1
- package/dev/flex.js +1 -0
- package/dev/flex.js.map +1 -1
- package/dev/form.d.ts +1 -0
- package/dev/form.d.ts.map +1 -1
- package/dev/form.js +1 -0
- package/dev/form.js.map +1 -1
- package/dev/grid.d.ts +1 -0
- package/dev/grid.d.ts.map +1 -1
- package/dev/grid.js +1 -0
- package/dev/grid.js.map +1 -1
- package/dev/heading.d.ts +9 -0
- package/dev/heading.d.ts.map +1 -0
- package/dev/heading.js +5 -0
- package/dev/heading.js.map +1 -0
- package/dev/index.d.ts +2 -0
- package/dev/index.d.ts.map +1 -1
- package/dev/index.js +2 -0
- package/dev/index.js.map +1 -1
- package/dev/layout.d.ts.map +1 -1
- package/dev/progress.d.ts.map +1 -1
- package/dev/router.d.ts.map +1 -1
- package/dev/split.d.ts +1 -1
- package/dev/split.d.ts.map +1 -1
- package/dev/typewriter.d.ts +1 -0
- package/dev/typewriter.d.ts.map +1 -1
- package/dev/typewriter.js +1 -0
- package/dev/typewriter.js.map +1 -1
- package/dialog.d.ts +1 -0
- package/dialog.d.ts.map +1 -1
- package/dialog.js +1 -5
- package/dialog.js.map +1 -1
- package/divider.d.ts +1 -0
- package/divider.d.ts.map +1 -1
- package/divider.js +1 -5
- package/divider.js.map +1 -1
- package/dragbox.d.ts +1 -0
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +1 -5
- package/dragbox.js.map +1 -1
- package/flex.d.ts +1 -0
- package/flex.d.ts.map +1 -1
- package/flex.js +1 -5
- package/flex.js.map +1 -1
- package/form.d.ts +1 -0
- package/form.d.ts.map +1 -1
- package/form.js +1 -5
- package/form.js.map +1 -1
- package/grid.d.ts +1 -0
- package/grid.d.ts.map +1 -1
- package/grid.js +1 -5
- package/grid.js.map +1 -1
- package/heading.d.ts +9 -0
- package/heading.d.ts.map +1 -0
- package/heading.js +2 -0
- package/heading.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -56
- package/index.js.map +1 -1
- package/input.js +1 -5
- package/input.js.map +1 -1
- package/layout.d.ts.map +1 -1
- package/layout.js +1 -5
- package/layout.js.map +1 -1
- package/link.js +1 -5
- package/link.js.map +1 -1
- package/package.json +11 -6
- package/progress.d.ts.map +1 -1
- package/progress.js +1 -5
- package/progress.js.map +1 -1
- package/range.js +1 -5
- package/range.js.map +1 -1
- package/rotate.js +1 -5
- package/rotate.js.map +1 -1
- package/router.d.ts.map +1 -1
- package/router.js +1 -5
- package/router.js.map +1 -1
- package/select.js +1 -5
- package/select.js.map +1 -1
- package/skeleton.js +1 -5
- package/skeleton.js.map +1 -1
- package/split.d.ts +1 -1
- package/split.d.ts.map +1 -1
- package/split.js +1 -5
- package/split.js.map +1 -1
- package/src/alert.ts +2 -0
- package/src/avatar.ts +2 -0
- package/src/badge.ts +13 -0
- package/src/button.ts +2 -0
- package/src/card.ts +2 -0
- package/src/carousel.ts +2 -0
- package/src/components/alert.ts +26 -29
- package/src/components/avatar.ts +26 -14
- package/src/components/badge.ts +107 -0
- package/src/components/breath.ts +36 -31
- package/src/components/button.ts +31 -32
- package/src/components/card.ts +9 -12
- package/src/components/carousel.ts +41 -34
- package/src/components/details.ts +24 -29
- package/src/components/dialog.ts +24 -25
- package/src/components/divider.ts +29 -17
- package/src/components/dragbox.ts +18 -13
- package/src/components/flex.ts +20 -10
- package/src/components/form.ts +6 -7
- package/src/components/grid.ts +20 -11
- package/src/components/heading.ts +105 -0
- package/src/components/input.ts +20 -20
- package/src/components/layout.ts +20 -23
- package/src/components/link.ts +12 -3
- package/src/components/progress.ts +46 -41
- package/src/components/range.ts +69 -76
- package/src/components/rotate.ts +11 -10
- package/src/components/router.ts +42 -40
- package/src/components/select.ts +57 -45
- package/src/components/skeleton.ts +11 -11
- package/src/components/split.ts +45 -35
- package/src/components/switch.ts +27 -30
- package/src/components/text.ts +14 -21
- package/src/components/time.ts +14 -12
- package/src/components/tooltip.ts +36 -32
- package/src/components/typewriter.ts +32 -45
- package/src/core/global-style.ts +25 -11
- package/src/core/super-anchor.ts +30 -26
- package/src/core/super-input.ts +53 -53
- package/src/core/super-openable.ts +7 -7
- package/src/details.ts +2 -0
- package/src/dialog.ts +2 -0
- package/src/divider.ts +2 -0
- package/src/dragbox.ts +2 -0
- package/src/flex.ts +2 -0
- package/src/form.ts +2 -0
- package/src/grid.ts +2 -0
- package/src/heading.ts +13 -0
- package/src/index.ts +2 -0
- package/src/layout.ts +1 -0
- package/src/progress.ts +1 -0
- package/src/router.ts +1 -0
- package/src/split.ts +1 -1
- package/src/typewriter.ts +2 -0
- package/switch.js +1 -5
- package/switch.js.map +1 -1
- package/text.js +1 -5
- package/text.js.map +1 -1
- package/time.js +1 -5
- package/time.js.map +1 -1
- package/tooltip.js +1 -5
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +1 -0
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +1 -5
- package/typewriter.js.map +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
import { godown, styles } from "@godown/element
|
2
|
-
import { css } from "lit";
|
1
|
+
import { attr, godown, styles } from "@godown/element";
|
2
|
+
import { css, html, type TemplateResult } from "lit";
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -9,24 +9,35 @@ const protoName = "divider";
|
|
9
9
|
/**
|
10
10
|
* {@linkcode Divider} similar to `<hr>`.
|
11
11
|
*
|
12
|
-
* This component does not render content.
|
13
|
-
*
|
14
12
|
* @category layout
|
15
13
|
*/
|
16
14
|
@godown(protoName)
|
17
15
|
@styles(
|
18
16
|
css`
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
17
|
+
:host {
|
18
|
+
width: 100%;
|
19
|
+
height: .05em;
|
20
|
+
margin: auto;
|
21
|
+
display: block;
|
22
|
+
background: currentColor;
|
23
|
+
}
|
24
|
+
|
25
|
+
:host([vertical]) {
|
26
|
+
width: .05em;
|
27
|
+
height: max(1em, 100%);
|
28
|
+
}
|
29
|
+
|
30
|
+
:host([contents]) [part=root] {
|
31
|
+
width: 100%;
|
32
|
+
height: .05em;
|
33
|
+
margin: auto;
|
34
|
+
display: block;
|
35
|
+
background: currentColor;
|
36
|
+
}
|
37
|
+
|
38
|
+
[part=root] {
|
39
|
+
display: contents;
|
40
|
+
}
|
30
41
|
`,
|
31
42
|
)
|
32
43
|
class Divider extends GlobalStyle {
|
@@ -36,9 +47,10 @@ class Divider extends GlobalStyle {
|
|
36
47
|
@property({ type: Boolean, reflect: true })
|
37
48
|
vertical = false;
|
38
49
|
|
39
|
-
|
40
|
-
this.
|
50
|
+
protected render(): TemplateResult<1> {
|
51
|
+
return html`<div part="root" ${attr(this.observedRecord)}></div>`;
|
41
52
|
}
|
42
53
|
}
|
43
54
|
|
44
55
|
export default Divider;
|
56
|
+
export { Divider };
|
@@ -1,8 +1,5 @@
|
|
1
|
-
import { godown } from "@godown/element
|
2
|
-
import {
|
3
|
-
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
-
import { EventListenerFunc } from "@godown/element/tools/events.js";
|
5
|
-
import { css, html } from "lit";
|
1
|
+
import { attr, type EventListenerFunc, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { css, html, type TemplateResult } from "lit";
|
6
3
|
import { property } from "lit/decorators.js";
|
7
4
|
|
8
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -43,7 +40,7 @@ class Dragbox extends GlobalStyle {
|
|
43
40
|
return this.offsetParent?.clientHeight ?? document.body.offsetHeight;
|
44
41
|
}
|
45
42
|
|
46
|
-
private drag
|
43
|
+
private drag = false;
|
47
44
|
private t: number;
|
48
45
|
private l: number;
|
49
46
|
private cx: number;
|
@@ -61,15 +58,22 @@ class Dragbox extends GlobalStyle {
|
|
61
58
|
@property()
|
62
59
|
y = "auto";
|
63
60
|
|
64
|
-
protected render() {
|
65
|
-
return html`<div
|
61
|
+
protected render(): TemplateResult<1> {
|
62
|
+
return html`<div
|
63
|
+
part="root"
|
64
|
+
${attr(this.observedRecord)}
|
65
|
+
@mousedown="${this._handleDragStart}"
|
66
|
+
@mouseup="${this._handleDragEnd}"
|
67
|
+
>
|
68
|
+
${htmlSlot()}
|
69
|
+
</div>`;
|
66
70
|
}
|
67
71
|
|
68
|
-
protected firstUpdated() {
|
72
|
+
protected firstUpdated(): void {
|
69
73
|
this.reset();
|
70
74
|
}
|
71
75
|
|
72
|
-
protected _handleDragStart(e: MouseEvent) {
|
76
|
+
protected _handleDragStart(e: MouseEvent): void {
|
73
77
|
this.cx = e.clientX;
|
74
78
|
this.cy = e.clientY;
|
75
79
|
this.t = this.offsetTop;
|
@@ -82,13 +86,13 @@ class Dragbox extends GlobalStyle {
|
|
82
86
|
protected _handleMouseMove: EventListenerFunc;
|
83
87
|
protected _handleMouseLeave: EventListenerFunc;
|
84
88
|
|
85
|
-
protected _handleDragEnd() {
|
89
|
+
protected _handleDragEnd(): void {
|
86
90
|
this.drag = false;
|
87
91
|
this.events.remove(document, "mousemove", this._handleMouseMove);
|
88
92
|
this.events.remove(document, "mouseleave", this._handleMouseLeave);
|
89
93
|
}
|
90
94
|
|
91
|
-
protected _handleDrag(e: MouseEvent) {
|
95
|
+
protected _handleDrag(e: MouseEvent): void {
|
92
96
|
if (!this.drag) {
|
93
97
|
return;
|
94
98
|
}
|
@@ -111,7 +115,7 @@ class Dragbox extends GlobalStyle {
|
|
111
115
|
}
|
112
116
|
}
|
113
117
|
|
114
|
-
reset() {
|
118
|
+
reset(): void {
|
115
119
|
const { x, y, style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight, offsetLeft, offsetTop } = this;
|
116
120
|
style.left = x || "0";
|
117
121
|
style.top = y || "0";
|
@@ -125,3 +129,4 @@ class Dragbox extends GlobalStyle {
|
|
125
129
|
}
|
126
130
|
|
127
131
|
export default Dragbox;
|
132
|
+
export { Dragbox };
|
package/src/components/flex.ts
CHANGED
@@ -1,9 +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 { css } from "lit";
|
1
|
+
import { attr, godown, htmlSlot, htmlStyle, joinRules, styles } from "@godown/element";
|
2
|
+
import { css, html, type TemplateResult } from "lit";
|
7
3
|
import { property } from "lit/decorators.js";
|
8
4
|
|
9
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -17,7 +13,18 @@ const protoName = "flex";
|
|
17
13
|
* @category layout
|
18
14
|
*/
|
19
15
|
@godown(protoName)
|
20
|
-
@styles(
|
16
|
+
@styles(
|
17
|
+
css`
|
18
|
+
:host,
|
19
|
+
:host([contents]) [part=root] {
|
20
|
+
display: flex;
|
21
|
+
}
|
22
|
+
|
23
|
+
[part=root] {
|
24
|
+
display: contents;
|
25
|
+
}
|
26
|
+
`,
|
27
|
+
)
|
21
28
|
class Flex extends GlobalStyle {
|
22
29
|
/**
|
23
30
|
* CSS property `flex-flow` (`flex-direction flex-wrap`).
|
@@ -49,8 +56,9 @@ class Flex extends GlobalStyle {
|
|
49
56
|
@property({ type: Boolean })
|
50
57
|
vertical = false;
|
51
58
|
|
52
|
-
protected render() {
|
53
|
-
return
|
59
|
+
protected render(): TemplateResult<1> {
|
60
|
+
return html`<div part="root" ${attr(this.observedRecord)}>
|
61
|
+
${[
|
54
62
|
htmlSlot(),
|
55
63
|
htmlStyle(
|
56
64
|
joinRules({
|
@@ -63,8 +71,10 @@ class Flex extends GlobalStyle {
|
|
63
71
|
},
|
64
72
|
}),
|
65
73
|
),
|
66
|
-
]
|
74
|
+
]}
|
75
|
+
</div>`;
|
67
76
|
}
|
68
77
|
}
|
69
78
|
|
70
79
|
export default Flex;
|
80
|
+
export { Flex };
|
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 { css, type TemplateResult } from "lit";
|
5
3
|
import { property } from "lit/decorators.js";
|
6
4
|
|
7
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -30,13 +28,13 @@ class Form<T = object> extends GlobalStyle {
|
|
30
28
|
return Form.buildValue(this._slot.assignedElements()) as T;
|
31
29
|
}
|
32
30
|
|
33
|
-
nameValue = this.namevalue;
|
31
|
+
nameValue: () => [string, T] = this.namevalue;
|
34
32
|
|
35
|
-
protected render() {
|
33
|
+
protected render(): TemplateResult<1> {
|
36
34
|
return htmlSlot();
|
37
35
|
}
|
38
36
|
|
39
|
-
reset() {
|
37
|
+
reset(): void {
|
40
38
|
this.deepQuerySelectorAll<HTMLElement & { reset?: () => void; }>("*").forEach((el) => {
|
41
39
|
if (el.tagName === this.tagName) {
|
42
40
|
return;
|
@@ -80,3 +78,4 @@ class Form<T = object> extends GlobalStyle {
|
|
80
78
|
}
|
81
79
|
|
82
80
|
export default Form;
|
81
|
+
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 { css, html, type TemplateResult } from "lit";
|
8
3
|
import { property } from "lit/decorators.js";
|
9
4
|
|
10
5
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -18,7 +13,18 @@ const protoName = "grid";
|
|
18
13
|
* @category layout
|
19
14
|
*/
|
20
15
|
@godown(protoName)
|
21
|
-
@styles(
|
16
|
+
@styles(
|
17
|
+
css`
|
18
|
+
:host,
|
19
|
+
:host([contents]) [part=root] {
|
20
|
+
display: grid;
|
21
|
+
}
|
22
|
+
|
23
|
+
[part=root] {
|
24
|
+
display: contents;
|
25
|
+
}
|
26
|
+
`,
|
27
|
+
)
|
22
28
|
class Grid extends GlobalStyle {
|
23
29
|
/**
|
24
30
|
* CSS property `gap`.
|
@@ -54,8 +60,9 @@ class Grid extends GlobalStyle {
|
|
54
60
|
@property()
|
55
61
|
items: string;
|
56
62
|
|
57
|
-
protected render() {
|
58
|
-
return
|
63
|
+
protected render(): TemplateResult<1> {
|
64
|
+
return html`<div part="root" ${attr(this.observedRecord)}>
|
65
|
+
${[
|
59
66
|
htmlSlot(),
|
60
67
|
htmlStyle(
|
61
68
|
joinRules({
|
@@ -68,8 +75,10 @@ class Grid extends GlobalStyle {
|
|
68
75
|
},
|
69
76
|
}),
|
70
77
|
),
|
71
|
-
]
|
78
|
+
]}
|
79
|
+
</div>`;
|
72
80
|
}
|
73
81
|
}
|
74
82
|
|
75
83
|
export default Grid;
|
84
|
+
export { Grid };
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
2
|
+
import { css, html, nothing, type TemplateResult } 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(
|
19
|
+
css`
|
20
|
+
:host {
|
21
|
+
display: block;
|
22
|
+
text-align: start;
|
23
|
+
}
|
24
|
+
|
25
|
+
[part=anchor] {
|
26
|
+
position: absolute;
|
27
|
+
text-align: center;
|
28
|
+
min-width: 1.25em;
|
29
|
+
right: 100%;
|
30
|
+
}
|
31
|
+
|
32
|
+
[side=left] [part=anchor] {
|
33
|
+
right: 100%;
|
34
|
+
}
|
35
|
+
[side=right] [part=anchor] {
|
36
|
+
left: 100%;
|
37
|
+
}
|
38
|
+
|
39
|
+
a {
|
40
|
+
color: inherit;
|
41
|
+
}
|
42
|
+
|
43
|
+
h1,
|
44
|
+
h2,
|
45
|
+
h3,
|
46
|
+
h4,
|
47
|
+
h5,
|
48
|
+
h6 {
|
49
|
+
direction: ltr;
|
50
|
+
font-size: revert;
|
51
|
+
position: relative;
|
52
|
+
width: fit-content;
|
53
|
+
}
|
54
|
+
`,
|
55
|
+
)
|
56
|
+
class Heading extends GlobalStyle {
|
57
|
+
/**
|
58
|
+
* The heading level.
|
59
|
+
*/
|
60
|
+
@property()
|
61
|
+
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" = "h1";
|
62
|
+
|
63
|
+
/**
|
64
|
+
* The anchor prefix.
|
65
|
+
*/
|
66
|
+
@property()
|
67
|
+
anchor = "#";
|
68
|
+
|
69
|
+
/**
|
70
|
+
* The anchor side.
|
71
|
+
*/
|
72
|
+
@property()
|
73
|
+
side: "left" | "right" = "left";
|
74
|
+
|
75
|
+
protected render(): TemplateResult<1> {
|
76
|
+
return html`<a part="root" href="${this.id ? "#" + this.id : nothing}" ${attr(this.observedRecord)}>
|
77
|
+
${
|
78
|
+
this.wrapHeading(
|
79
|
+
htmlSlot(),
|
80
|
+
this.id ? html`<i part="anchor">${this.anchor}</i>` : "",
|
81
|
+
)
|
82
|
+
}
|
83
|
+
</a> `;
|
84
|
+
}
|
85
|
+
|
86
|
+
protected wrapHeading(...children: any[]): TemplateResult<1> {
|
87
|
+
switch (this.as) {
|
88
|
+
case "h2":
|
89
|
+
return html`<h2>${children}</h2>`;
|
90
|
+
case "h3":
|
91
|
+
return html`<h3>${children}</h3>`;
|
92
|
+
case "h4":
|
93
|
+
return html`<h4>${children}</h4>`;
|
94
|
+
case "h5":
|
95
|
+
return html`<h5>${children}</h5>`;
|
96
|
+
case "h6":
|
97
|
+
return html`<h6>${children}</h6>`;
|
98
|
+
default:
|
99
|
+
return html`<h1>${children}</h1>`;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
export default Heading;
|
105
|
+
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 { css, html, nothing, type TemplateResult } from "lit";
|
6
3
|
import { property } from "lit/decorators.js";
|
7
4
|
|
8
5
|
import { cssGlobalVars } from "../core/global-style.js";
|
@@ -13,6 +10,8 @@ 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)
|
@@ -42,31 +41,32 @@ class Input extends SuperInput {
|
|
42
41
|
@part("input")
|
43
42
|
protected _input: HTMLInputElement;
|
44
43
|
|
45
|
-
protected render() {
|
46
|
-
return html`<div part="root" class="${classList("input-field", this.variant)}">
|
47
|
-
|
44
|
+
protected render(): TemplateResult<1> {
|
45
|
+
return html`<div part="root" ${attr(this.observedRecord)} class="${classList("input-field", this.variant)}">
|
46
|
+
${[
|
48
47
|
this._renderPrefix(),
|
49
48
|
html`<input
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
49
|
+
part="input"
|
50
|
+
type="${this.type}"
|
51
|
+
id="${this.makeId}"
|
52
|
+
.value="${this.value}"
|
53
|
+
placeholder="${this.placeholder || nothing}"
|
54
|
+
?autofocus="${this.autofocus}"
|
55
|
+
autocapitalize="${this.autocapitalize || nothing}"
|
56
|
+
autocomplete="${this.autocomplete || nothing}"
|
57
|
+
?disabled="${this.disabled}"
|
58
|
+
@input="${this._handleInput}"
|
59
|
+
>`,
|
61
60
|
this._renderSuffix(),
|
62
61
|
]}
|
63
62
|
</div>`;
|
64
63
|
}
|
65
64
|
|
66
|
-
reset() {
|
65
|
+
reset(): void {
|
67
66
|
this._input.value = this.default;
|
68
67
|
this.value = this.default;
|
69
68
|
}
|
70
69
|
}
|
71
70
|
|
72
71
|
export default Input;
|
72
|
+
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 { css, html, type TemplateResult } 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.
|
@@ -20,19 +17,24 @@ const protoName = "layout";
|
|
20
17
|
@godown(protoName)
|
21
18
|
@styles(
|
22
19
|
css`
|
23
|
-
:host
|
20
|
+
:host,
|
21
|
+
:host([contents]) [part=root] {
|
24
22
|
min-height: 100%;
|
25
23
|
display: flex;
|
26
24
|
flex-direction: column;
|
27
25
|
}
|
28
26
|
|
29
|
-
|
27
|
+
[part=root] {
|
28
|
+
display: contents;
|
29
|
+
}
|
30
|
+
|
31
|
+
[sticky] header {
|
30
32
|
position: sticky;
|
31
33
|
top: 0;
|
32
34
|
z-index: 1;
|
33
35
|
}
|
34
36
|
|
35
|
-
[part=
|
37
|
+
[part=main] {
|
36
38
|
position: relative;
|
37
39
|
flex: 1;
|
38
40
|
width: 100%;
|
@@ -45,7 +47,7 @@ const protoName = "layout";
|
|
45
47
|
}
|
46
48
|
`,
|
47
49
|
)
|
48
|
-
class
|
50
|
+
class Layout extends GlobalStyle {
|
49
51
|
/**
|
50
52
|
* If true, remove the header slot.
|
51
53
|
*/
|
@@ -64,19 +66,14 @@ class NavLayout extends GlobalStyle {
|
|
64
66
|
@property({ type: Boolean })
|
65
67
|
sticky = false;
|
66
68
|
|
67
|
-
protected render() {
|
68
|
-
return html
|
69
|
-
!this.noHeader
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<main part="main">${htmlSlot()}</main>
|
74
|
-
${
|
75
|
-
!this.noFooter
|
76
|
-
? html`<footer part="footer">${htmlSlot("footer")}</footer>`
|
77
|
-
: ""
|
78
|
-
}`;
|
69
|
+
protected render(): TemplateResult<1> {
|
70
|
+
return html`<div part="root" ${attr(this.observedRecord)}>
|
71
|
+
${!this.noHeader ? html`<header part="header">${htmlSlot("header")}</header>` : ""}
|
72
|
+
<main part="main">${htmlSlot()}</main>
|
73
|
+
${!this.noFooter ? html`<footer part="footer">${htmlSlot("footer")}</footer>` : ""}
|
74
|
+
</div>`;
|
79
75
|
}
|
80
76
|
}
|
81
77
|
|
82
|
-
export default
|
78
|
+
export default Layout;
|
79
|
+
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
38
|
(history[`${this.type}State`])(null, "", this.href);
|
33
|
-
|
39
|
+
if (!this.suppress) {
|
40
|
+
Router.updateAll();
|
41
|
+
}
|
34
42
|
}
|
35
43
|
}
|
36
44
|
}
|
37
45
|
|
38
46
|
export default Link;
|
47
|
+
export { Link };
|