godown 2.7.7 → 3.0.0-canary.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 +44 -80
- package/alert.d.ts +2 -3
- package/alert.d.ts.map +1 -1
- package/alert.js +5 -4
- package/alert.js.map +1 -1
- package/avatar.d.ts +2 -3
- package/avatar.d.ts.map +1 -1
- package/avatar.js +5 -4
- package/avatar.js.map +1 -1
- package/breath.d.ts +9 -0
- package/breath.d.ts.map +1 -0
- package/breath.js +6 -0
- package/breath.js.map +1 -0
- package/button.d.ts +2 -3
- package/button.d.ts.map +1 -1
- package/button.js +5 -4
- package/button.js.map +1 -1
- package/card.d.ts +2 -3
- package/card.d.ts.map +1 -1
- package/card.js +5 -4
- package/card.js.map +1 -1
- package/carousel.d.ts +2 -3
- package/carousel.d.ts.map +1 -1
- package/carousel.js +5 -4
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +50 -0
- package/components/alert.d.ts.map +1 -0
- package/components/alert.js +167 -0
- package/components/alert.js.map +1 -0
- package/components/avatar.d.ts +26 -0
- package/components/avatar.d.ts.map +1 -0
- package/components/avatar.js +62 -0
- package/components/avatar.js.map +1 -0
- package/components/breath.d.ts +34 -0
- package/components/breath.d.ts.map +1 -0
- package/components/breath.js +80 -0
- package/components/breath.js.map +1 -0
- package/{web-components/button → components}/button.d.ts +6 -5
- package/components/button.d.ts.map +1 -0
- package/components/button.js +167 -0
- package/components/button.js.map +1 -0
- package/components/card.d.ts +20 -0
- package/components/card.d.ts.map +1 -0
- package/components/card.js +55 -0
- package/components/card.js.map +1 -0
- package/components/carousel.d.ts +40 -0
- package/components/carousel.d.ts.map +1 -0
- package/components/carousel.js +113 -0
- package/components/carousel.js.map +1 -0
- package/{web-components/details → components}/details.d.ts +5 -3
- package/components/details.d.ts.map +1 -0
- package/components/details.js +50 -0
- package/components/details.js.map +1 -0
- package/components/dialog.d.ts +33 -0
- package/components/dialog.d.ts.map +1 -0
- package/components/dialog.js +92 -0
- package/components/dialog.js.map +1 -0
- package/components/divider.d.ts +17 -0
- package/components/divider.d.ts.map +1 -0
- package/components/divider.js +37 -0
- package/components/divider.js.map +1 -0
- package/{web-components/wrapper → components}/dragbox.d.ts +15 -5
- package/components/dragbox.d.ts.map +1 -0
- package/components/dragbox.js +110 -0
- package/components/dragbox.js.map +1 -0
- package/components/flex.d.ts +31 -0
- package/components/flex.d.ts.map +1 -0
- package/components/flex.js +55 -0
- package/components/flex.js.map +1 -0
- package/{web-components/form → components}/form.d.ts +4 -2
- package/components/form.d.ts.map +1 -0
- package/components/form.js +78 -0
- package/components/form.js.map +1 -0
- package/components/grid.d.ts +31 -0
- package/components/grid.d.ts.map +1 -0
- package/components/grid.js +56 -0
- package/components/grid.js.map +1 -0
- package/components/input.d.ts +20 -0
- package/components/input.d.ts.map +1 -0
- package/components/input.js +54 -0
- package/components/input.js.map +1 -0
- package/components/layout.d.ts +29 -0
- package/components/layout.d.ts.map +1 -0
- package/components/layout.js +48 -0
- package/components/layout.js.map +1 -0
- package/components/link.d.ts +20 -0
- package/components/link.d.ts.map +1 -0
- package/components/link.js +43 -0
- package/components/link.js.map +1 -0
- package/{web-components/progress → components}/progress.d.ts +5 -3
- package/components/progress.d.ts.map +1 -0
- package/components/progress.js +68 -0
- package/components/progress.js.map +1 -0
- package/components/range.d.ts +60 -0
- package/components/range.d.ts.map +1 -0
- package/components/range.js +193 -0
- package/components/range.js.map +1 -0
- package/{web-components/wrapper → components}/rotate.d.ts +4 -8
- package/components/rotate.d.ts.map +1 -0
- package/components/rotate.js +57 -0
- package/components/rotate.js.map +1 -0
- package/components/router.d.ts +121 -0
- package/components/router.d.ts.map +1 -0
- package/components/router.js +251 -0
- package/components/router.js.map +1 -0
- package/components/select.d.ts +50 -0
- package/components/select.d.ts.map +1 -0
- package/components/select.js +211 -0
- package/components/select.js.map +1 -0
- package/{web-components/skeleton → components}/skeleton.d.ts +6 -6
- package/components/skeleton.d.ts.map +1 -0
- package/components/skeleton.js +56 -0
- package/components/skeleton.js.map +1 -0
- package/components/split.d.ts +32 -0
- package/components/split.d.ts.map +1 -0
- package/components/split.js +121 -0
- package/components/split.js.map +1 -0
- package/{web-components/input/switch-input.d.ts → components/switch.d.ts} +9 -10
- package/components/switch.d.ts.map +1 -0
- package/components/switch.js +93 -0
- package/components/switch.js.map +1 -0
- package/{web-components/text → components}/text.d.ts +5 -3
- package/components/text.d.ts.map +1 -0
- package/components/text.js +44 -0
- package/components/text.js.map +1 -0
- package/{web-components/text → components}/time.d.ts +5 -3
- package/components/time.d.ts.map +1 -0
- package/components/time.js +139 -0
- package/components/time.js.map +1 -0
- package/components/tooltip.d.ts +38 -0
- package/components/tooltip.d.ts.map +1 -0
- package/components/tooltip.js +67 -0
- package/components/tooltip.js.map +1 -0
- package/{web-components/text → components}/typewriter.d.ts +5 -3
- package/components/typewriter.d.ts.map +1 -0
- package/components/typewriter.js +130 -0
- package/components/typewriter.js.map +1 -0
- package/core/global-style.d.ts +21 -0
- package/core/global-style.d.ts.map +1 -0
- package/core/global-style.js +46 -0
- package/core/global-style.js.map +1 -0
- package/core/super-anchor.d.ts +15 -0
- package/core/super-anchor.d.ts.map +1 -0
- package/core/super-anchor.js +39 -0
- package/core/super-anchor.js.map +1 -0
- package/core/super-input.d.ts +39 -0
- package/core/super-input.d.ts.map +1 -0
- package/core/super-input.js +115 -0
- package/core/super-input.js.map +1 -0
- package/{proto → core}/super-openable.d.ts +4 -8
- package/core/super-openable.d.ts.map +1 -0
- package/core/super-openable.js +38 -0
- package/core/super-openable.js.map +1 -0
- package/custom-elements.json +1 -0
- package/details.d.ts +2 -3
- package/details.d.ts.map +1 -1
- package/details.js +5 -4
- package/details.js.map +1 -1
- package/dev/alert.d.ts +8 -0
- package/dev/alert.d.ts.map +1 -0
- package/dev/alert.js +4 -0
- package/dev/alert.js.map +1 -0
- package/dev/avatar.d.ts +8 -0
- package/dev/avatar.d.ts.map +1 -0
- package/dev/avatar.js +4 -0
- package/dev/avatar.js.map +1 -0
- package/dev/breath.d.ts +9 -0
- package/dev/breath.d.ts.map +1 -0
- package/dev/breath.js +5 -0
- package/dev/breath.js.map +1 -0
- package/dev/button.d.ts +8 -0
- package/dev/button.d.ts.map +1 -0
- package/dev/button.js +4 -0
- package/dev/button.js.map +1 -0
- package/dev/card.d.ts +8 -0
- package/dev/card.d.ts.map +1 -0
- package/dev/card.js +4 -0
- package/dev/card.js.map +1 -0
- package/dev/carousel.d.ts +8 -0
- package/dev/carousel.d.ts.map +1 -0
- package/dev/carousel.js +4 -0
- package/dev/carousel.js.map +1 -0
- package/dev/components/alert.d.ts +50 -0
- package/dev/components/alert.d.ts.map +1 -0
- package/dev/components/alert.js +234 -0
- package/dev/components/alert.js.map +1 -0
- package/dev/components/avatar.d.ts +26 -0
- package/dev/components/avatar.d.ts.map +1 -0
- package/dev/components/avatar.js +91 -0
- package/dev/components/avatar.js.map +1 -0
- package/dev/components/breath.d.ts +34 -0
- package/dev/components/breath.d.ts.map +1 -0
- package/dev/components/breath.js +133 -0
- package/dev/components/breath.js.map +1 -0
- package/dev/components/button.d.ts +45 -0
- package/dev/components/button.d.ts.map +1 -0
- package/{web-components/button → dev/components}/button.js +76 -76
- package/dev/components/button.js.map +1 -0
- package/dev/components/card.d.ts +20 -0
- package/dev/components/card.d.ts.map +1 -0
- package/dev/components/card.js +89 -0
- package/dev/components/card.js.map +1 -0
- package/dev/components/carousel.d.ts +40 -0
- package/dev/components/carousel.d.ts.map +1 -0
- package/dev/components/carousel.js +155 -0
- package/dev/components/carousel.js.map +1 -0
- package/dev/components/details.d.ts +20 -0
- package/dev/components/details.d.ts.map +1 -0
- package/dev/components/details.js +115 -0
- package/dev/components/details.js.map +1 -0
- package/dev/components/dialog.d.ts +33 -0
- package/dev/components/dialog.d.ts.map +1 -0
- package/dev/components/dialog.js +154 -0
- package/dev/components/dialog.js.map +1 -0
- package/dev/components/divider.d.ts +17 -0
- package/dev/components/divider.d.ts.map +1 -0
- package/dev/components/divider.js +46 -0
- package/dev/components/divider.js.map +1 -0
- package/dev/components/dragbox.d.ts +40 -0
- package/dev/components/dragbox.d.ts.map +1 -0
- package/{web-components/wrapper → dev/components}/dragbox.js +27 -15
- package/dev/components/dragbox.js.map +1 -0
- package/dev/components/flex.d.ts +31 -0
- package/dev/components/flex.d.ts.map +1 -0
- package/dev/components/flex.js +52 -0
- package/dev/components/flex.js.map +1 -0
- package/dev/components/form.d.ts +24 -0
- package/dev/components/form.d.ts.map +1 -0
- package/{web-components/form → dev/components}/form.js +11 -11
- package/dev/components/form.js.map +1 -0
- package/dev/components/grid.d.ts +31 -0
- package/dev/components/grid.d.ts.map +1 -0
- package/dev/components/grid.js +53 -0
- package/dev/components/grid.js.map +1 -0
- package/dev/components/input.d.ts +20 -0
- package/dev/components/input.d.ts.map +1 -0
- package/dev/components/input.js +89 -0
- package/dev/components/input.js.map +1 -0
- package/dev/components/layout.d.ts +29 -0
- package/dev/components/layout.d.ts.map +1 -0
- package/dev/components/layout.js +69 -0
- package/dev/components/layout.js.map +1 -0
- package/dev/components/link.d.ts +20 -0
- package/dev/components/link.d.ts.map +1 -0
- package/dev/components/link.js +40 -0
- package/dev/components/link.js.map +1 -0
- package/dev/components/progress.d.ts +30 -0
- package/dev/components/progress.d.ts.map +1 -0
- package/{web-components/progress → dev/components}/progress.js +12 -11
- package/dev/components/progress.js.map +1 -0
- package/dev/components/range.d.ts +60 -0
- package/dev/components/range.d.ts.map +1 -0
- package/{web-components/input/range-input.js → dev/components/range.js} +82 -92
- package/dev/components/range.js.map +1 -0
- package/dev/components/rotate.d.ts +26 -0
- package/dev/components/rotate.d.ts.map +1 -0
- package/{web-components/wrapper → dev/components}/rotate.js +14 -20
- package/dev/components/rotate.js.map +1 -0
- package/dev/components/router.d.ts +121 -0
- package/dev/components/router.d.ts.map +1 -0
- package/dev/components/router.js +248 -0
- package/dev/components/router.js.map +1 -0
- package/dev/components/select.d.ts +50 -0
- package/dev/components/select.d.ts.map +1 -0
- package/dev/components/select.js +243 -0
- package/dev/components/select.js.map +1 -0
- package/dev/components/skeleton.d.ts +26 -0
- package/dev/components/skeleton.d.ts.map +1 -0
- package/dev/components/skeleton.js +119 -0
- package/dev/components/skeleton.js.map +1 -0
- package/dev/components/split.d.ts +32 -0
- package/dev/components/split.d.ts.map +1 -0
- package/dev/components/split.js +173 -0
- package/dev/components/split.js.map +1 -0
- package/dev/components/switch.d.ts +39 -0
- package/dev/components/switch.d.ts.map +1 -0
- package/{web-components/input/switch-input.js → dev/components/switch.js} +53 -59
- package/dev/components/switch.js.map +1 -0
- package/dev/components/text.d.ts +19 -0
- package/dev/components/text.d.ts.map +1 -0
- package/{web-components/text → dev/components}/text.js +22 -23
- package/dev/components/text.js.map +1 -0
- package/dev/components/time.d.ts +53 -0
- package/dev/components/time.d.ts.map +1 -0
- package/{web-components/text → dev/components}/time.js +12 -18
- package/dev/components/time.js.map +1 -0
- package/dev/components/tooltip.d.ts +38 -0
- package/dev/components/tooltip.d.ts.map +1 -0
- package/dev/components/tooltip.js +114 -0
- package/dev/components/tooltip.js.map +1 -0
- package/dev/components/typewriter.d.ts +55 -0
- package/dev/components/typewriter.d.ts.map +1 -0
- package/{web-components/text → dev/components}/typewriter.js +21 -19
- package/dev/components/typewriter.js.map +1 -0
- package/dev/core/global-style.d.ts +21 -0
- package/dev/core/global-style.d.ts.map +1 -0
- package/dev/core/global-style.js +77 -0
- package/dev/core/global-style.js.map +1 -0
- package/dev/core/super-anchor.d.ts +15 -0
- package/dev/core/super-anchor.d.ts.map +1 -0
- package/dev/core/super-anchor.js +58 -0
- package/dev/core/super-anchor.js.map +1 -0
- package/dev/core/super-input.d.ts +39 -0
- package/dev/core/super-input.d.ts.map +1 -0
- package/dev/core/super-input.js +181 -0
- package/dev/core/super-input.js.map +1 -0
- package/dev/core/super-openable.d.ts +19 -0
- package/dev/core/super-openable.d.ts.map +1 -0
- package/{proto → dev/core}/super-openable.js +6 -13
- package/dev/core/super-openable.js.map +1 -0
- package/dev/details.d.ts +8 -0
- package/dev/details.d.ts.map +1 -0
- package/dev/details.js +4 -0
- package/dev/details.js.map +1 -0
- package/dev/dialog.d.ts +8 -0
- package/dev/dialog.d.ts.map +1 -0
- package/dev/dialog.js +4 -0
- package/dev/dialog.js.map +1 -0
- package/dev/divider.d.ts +8 -0
- package/dev/divider.d.ts.map +1 -0
- package/dev/divider.js +4 -0
- package/dev/divider.js.map +1 -0
- package/dev/dragbox.d.ts +8 -0
- package/dev/dragbox.d.ts.map +1 -0
- package/dev/dragbox.js +4 -0
- package/dev/dragbox.js.map +1 -0
- package/dev/flex.d.ts +8 -0
- package/dev/flex.d.ts.map +1 -0
- package/dev/flex.js +4 -0
- package/dev/flex.js.map +1 -0
- package/dev/form.d.ts +8 -0
- package/dev/form.d.ts.map +1 -0
- package/dev/form.js +4 -0
- package/dev/form.js.map +1 -0
- package/dev/grid.d.ts +8 -0
- package/dev/grid.d.ts.map +1 -0
- package/dev/grid.js +4 -0
- package/dev/grid.js.map +1 -0
- package/dev/index.d.ts +29 -0
- package/dev/index.d.ts.map +1 -0
- package/dev/index.js +29 -0
- package/dev/index.js.map +1 -0
- package/dev/input.d.ts +9 -0
- package/dev/input.d.ts.map +1 -0
- package/dev/input.js +5 -0
- package/dev/input.js.map +1 -0
- package/dev/layout.d.ts +9 -0
- package/dev/layout.d.ts.map +1 -0
- package/dev/layout.js +5 -0
- package/dev/layout.js.map +1 -0
- package/dev/link.d.ts +9 -0
- package/dev/link.d.ts.map +1 -0
- package/dev/link.js +5 -0
- package/dev/link.js.map +1 -0
- package/dev/progress.d.ts +9 -0
- package/dev/progress.d.ts.map +1 -0
- package/dev/progress.js +5 -0
- package/dev/progress.js.map +1 -0
- package/dev/range.d.ts +9 -0
- package/dev/range.d.ts.map +1 -0
- package/dev/range.js +5 -0
- package/dev/range.js.map +1 -0
- package/dev/rotate.d.ts +9 -0
- package/dev/rotate.d.ts.map +1 -0
- package/dev/rotate.js +5 -0
- package/dev/rotate.js.map +1 -0
- package/dev/router.d.ts +9 -0
- package/dev/router.d.ts.map +1 -0
- package/dev/router.js +5 -0
- package/dev/router.js.map +1 -0
- package/dev/select.d.ts +9 -0
- package/dev/select.d.ts.map +1 -0
- package/dev/select.js +5 -0
- package/dev/select.js.map +1 -0
- package/dev/skeleton.d.ts +9 -0
- package/dev/skeleton.d.ts.map +1 -0
- package/dev/skeleton.js +5 -0
- package/dev/skeleton.js.map +1 -0
- package/dev/split.d.ts +9 -0
- package/dev/split.d.ts.map +1 -0
- package/dev/split.js +5 -0
- package/dev/split.js.map +1 -0
- package/dev/switch.d.ts +9 -0
- package/dev/switch.d.ts.map +1 -0
- package/dev/switch.js +5 -0
- package/dev/switch.js.map +1 -0
- package/dev/text.d.ts +9 -0
- package/dev/text.d.ts.map +1 -0
- package/dev/text.js +5 -0
- package/dev/text.js.map +1 -0
- package/dev/time.d.ts +9 -0
- package/dev/time.d.ts.map +1 -0
- package/dev/time.js +5 -0
- package/dev/time.js.map +1 -0
- package/dev/tooltip.d.ts +9 -0
- package/dev/tooltip.d.ts.map +1 -0
- package/dev/tooltip.js +5 -0
- package/dev/tooltip.js.map +1 -0
- package/dev/typewriter.d.ts +8 -0
- package/dev/typewriter.d.ts.map +1 -0
- package/dev/typewriter.js +4 -0
- package/dev/typewriter.js.map +1 -0
- package/dialog.d.ts +2 -3
- package/dialog.d.ts.map +1 -1
- package/dialog.js +5 -4
- package/dialog.js.map +1 -1
- package/divider.d.ts +2 -3
- package/divider.d.ts.map +1 -1
- package/divider.js +5 -4
- package/divider.js.map +1 -1
- package/dragbox.d.ts +2 -3
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +5 -4
- package/dragbox.js.map +1 -1
- package/flex.d.ts +8 -0
- package/flex.d.ts.map +1 -0
- package/flex.js +6 -0
- package/flex.js.map +1 -0
- package/form.d.ts +2 -3
- package/form.d.ts.map +1 -1
- package/form.js +5 -4
- package/form.js.map +1 -1
- package/grid.d.ts +8 -0
- package/grid.d.ts.map +1 -0
- package/grid.js +6 -0
- package/grid.js.map +1 -0
- package/index.d.ts +28 -32
- package/index.d.ts.map +1 -1
- package/index.js +57 -33
- package/index.js.map +1 -1
- package/input.d.ts +3 -3
- package/input.d.ts.map +1 -1
- package/input.js +5 -4
- package/input.js.map +1 -1
- package/layout.d.ts +3 -3
- package/layout.d.ts.map +1 -1
- package/layout.js +5 -4
- package/layout.js.map +1 -1
- package/link.d.ts +3 -3
- package/link.d.ts.map +1 -1
- package/link.js +5 -4
- package/link.js.map +1 -1
- package/package.json +42 -81
- package/progress.d.ts +3 -3
- package/progress.d.ts.map +1 -1
- package/progress.js +5 -4
- package/progress.js.map +1 -1
- package/range.d.ts +9 -0
- package/range.d.ts.map +1 -0
- package/range.js +6 -0
- package/range.js.map +1 -0
- package/rotate.d.ts +3 -3
- package/rotate.d.ts.map +1 -1
- package/rotate.js +5 -4
- package/rotate.js.map +1 -1
- package/router.d.ts +3 -3
- package/router.d.ts.map +1 -1
- package/router.js +5 -4
- package/router.js.map +1 -1
- package/select.d.ts +9 -0
- package/select.d.ts.map +1 -0
- package/select.js +6 -0
- package/select.js.map +1 -0
- package/skeleton.d.ts +3 -3
- package/skeleton.d.ts.map +1 -1
- package/skeleton.js +5 -4
- package/skeleton.js.map +1 -1
- package/split.d.ts +9 -0
- package/split.d.ts.map +1 -0
- package/split.js +6 -0
- package/split.js.map +1 -0
- package/switch.d.ts +9 -0
- package/switch.d.ts.map +1 -0
- package/switch.js +6 -0
- package/switch.js.map +1 -0
- package/text.d.ts +3 -3
- package/text.d.ts.map +1 -1
- package/text.js +5 -4
- package/text.js.map +1 -1
- package/time.d.ts +3 -3
- package/time.d.ts.map +1 -1
- package/time.js +5 -4
- package/time.js.map +1 -1
- package/tooltip.d.ts +3 -3
- package/tooltip.d.ts.map +1 -1
- package/tooltip.js +5 -4
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +2 -3
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +5 -4
- package/typewriter.js.map +1 -1
- package/vscode.css-custom-data.json +1 -0
- package/vscode.html-custom-data.json +1 -0
- package/web-types.json +1 -0
- package/_deps.d.ts +0 -4
- package/_deps.d.ts.map +0 -1
- package/_deps.js +0 -4
- package/_deps.js.map +0 -1
- package/avatar-group.d.ts +0 -9
- package/avatar-group.d.ts.map +0 -1
- package/avatar-group.js +0 -5
- package/avatar-group.js.map +0 -1
- package/components.json +0 -194
- package/conf.d.ts +0 -12
- package/conf.d.ts.map +0 -1
- package/conf.js +0 -24
- package/conf.js.map +0 -1
- package/decorators/godown.d.ts +0 -4
- package/decorators/godown.d.ts.map +0 -1
- package/decorators/godown.js +0 -9
- package/decorators/godown.js.map +0 -1
- package/decorators/part.d.ts +0 -7
- package/decorators/part.d.ts.map +0 -1
- package/decorators/part.js +0 -8
- package/decorators/part.js.map +0 -1
- package/decorators/styles.d.ts +0 -3
- package/decorators/styles.d.ts.map +0 -1
- package/decorators/styles.js +0 -8
- package/decorators/styles.js.map +0 -1
- package/flex-flow.d.ts +0 -9
- package/flex-flow.d.ts.map +0 -1
- package/flex-flow.js +0 -5
- package/flex-flow.js.map +0 -1
- package/grid-flow.d.ts +0 -9
- package/grid-flow.d.ts.map +0 -1
- package/grid-flow.js +0 -5
- package/grid-flow.js.map +0 -1
- package/label-input.d.ts +0 -9
- package/label-input.d.ts.map +0 -1
- package/label-input.js +0 -5
- package/label-input.js.map +0 -1
- package/lib/css.d.ts +0 -13
- package/lib/css.d.ts.map +0 -1
- package/lib/css.js +0 -29
- package/lib/css.js.map +0 -1
- package/lib/directives.d.ts +0 -25
- package/lib/directives.d.ts.map +0 -1
- package/lib/directives.js +0 -40
- package/lib/directives.js.map +0 -1
- package/lib/event-coll.d.ts +0 -13
- package/lib/event-coll.d.ts.map +0 -1
- package/lib/event-coll.js +0 -45
- package/lib/event-coll.js.map +0 -1
- package/lib/icons.d.ts +0 -25
- package/lib/icons.d.ts.map +0 -1
- package/lib/icons.js +0 -73
- package/lib/icons.js.map +0 -1
- package/lib/jsx.d.ts +0 -4
- package/lib/jsx.d.ts.map +0 -1
- package/lib/jsx.js +0 -52
- package/lib/jsx.js.map +0 -1
- package/lib/route-tree.d.ts +0 -28
- package/lib/route-tree.d.ts.map +0 -1
- package/lib/route-tree.js +0 -141
- package/lib/route-tree.js.map +0 -1
- package/lib/utils.d.ts +0 -10
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -71
- package/lib/utils.js.map +0 -1
- package/overbreath.d.ts +0 -9
- package/overbreath.d.ts.map +0 -1
- package/overbreath.js +0 -5
- package/overbreath.js.map +0 -1
- package/proto/godown-config.d.ts +0 -41
- package/proto/godown-config.d.ts.map +0 -1
- package/proto/godown-config.js +0 -27
- package/proto/godown-config.js.map +0 -1
- package/proto/godown-element.d.ts +0 -125
- package/proto/godown-element.d.ts.map +0 -1
- package/proto/godown-element.js +0 -204
- package/proto/godown-element.js.map +0 -1
- package/proto/super-a.d.ts +0 -30
- package/proto/super-a.d.ts.map +0 -1
- package/proto/super-a.js +0 -141
- package/proto/super-a.js.map +0 -1
- package/proto/super-input.d.ts +0 -44
- package/proto/super-input.d.ts.map +0 -1
- package/proto/super-input.js +0 -119
- package/proto/super-input.js.map +0 -1
- package/proto/super-openable.d.ts.map +0 -1
- package/proto/super-openable.js.map +0 -1
- package/range-input.d.ts +0 -9
- package/range-input.d.ts.map +0 -1
- package/range-input.js +0 -5
- package/range-input.js.map +0 -1
- package/react/create.d.ts +0 -5
- package/react/create.d.ts.map +0 -1
- package/react/create.js +0 -16
- package/react/create.js.map +0 -1
- package/react/index.d.ts +0 -65
- package/react/index.d.ts.map +0 -1
- package/react/index.js +0 -132
- package/react/index.js.map +0 -1
- package/router-link.d.ts +0 -9
- package/router-link.d.ts.map +0 -1
- package/router-link.js +0 -5
- package/router-link.js.map +0 -1
- package/search-input.d.ts +0 -9
- package/search-input.d.ts.map +0 -1
- package/search-input.js +0 -5
- package/search-input.js.map +0 -1
- package/select-input.d.ts +0 -9
- package/select-input.d.ts.map +0 -1
- package/select-input.js +0 -5
- package/select-input.js.map +0 -1
- package/split-input.d.ts +0 -9
- package/split-input.d.ts.map +0 -1
- package/split-input.js +0 -5
- package/split-input.js.map +0 -1
- package/styles/colors/presets.d.ts +0 -13
- package/styles/colors/presets.d.ts.map +0 -1
- package/styles/colors/presets.js +0 -6
- package/styles/colors/presets.js.map +0 -1
- package/styles/colors/presetsRGB.d.ts +0 -16
- package/styles/colors/presetsRGB.d.ts.map +0 -1
- package/styles/colors/presetsRGB.js +0 -134
- package/styles/colors/presetsRGB.js.map +0 -1
- package/styles/global.d.ts +0 -18
- package/styles/global.d.ts.map +0 -1
- package/styles/global.js +0 -78
- package/styles/global.js.map +0 -1
- package/styles/inputStyle.d.ts +0 -3
- package/styles/inputStyle.d.ts.map +0 -1
- package/styles/inputStyle.js +0 -59
- package/styles/inputStyle.js.map +0 -1
- package/switch-input.d.ts +0 -9
- package/switch-input.d.ts.map +0 -1
- package/switch-input.js +0 -5
- package/switch-input.js.map +0 -1
- package/web-components/alert/alert.d.ts +0 -36
- package/web-components/alert/alert.d.ts.map +0 -1
- package/web-components/alert/alert.js +0 -161
- package/web-components/alert/alert.js.map +0 -1
- package/web-components/avatar/avatar-group.d.ts +0 -21
- package/web-components/avatar/avatar-group.d.ts.map +0 -1
- package/web-components/avatar/avatar-group.js +0 -86
- package/web-components/avatar/avatar-group.js.map +0 -1
- package/web-components/avatar/avatar.d.ts +0 -28
- package/web-components/avatar/avatar.d.ts.map +0 -1
- package/web-components/avatar/avatar.js +0 -120
- package/web-components/avatar/avatar.js.map +0 -1
- package/web-components/button/button.d.ts.map +0 -1
- package/web-components/button/button.js.map +0 -1
- package/web-components/card/card.d.ts +0 -9
- package/web-components/card/card.d.ts.map +0 -1
- package/web-components/card/card.js +0 -75
- package/web-components/card/card.js.map +0 -1
- package/web-components/carousel/carousel.d.ts +0 -29
- package/web-components/carousel/carousel.d.ts.map +0 -1
- package/web-components/carousel/carousel.js +0 -185
- package/web-components/carousel/carousel.js.map +0 -1
- package/web-components/details/details.d.ts.map +0 -1
- package/web-components/details/details.js +0 -124
- package/web-components/details/details.js.map +0 -1
- package/web-components/dialog/dialog.d.ts +0 -31
- package/web-components/dialog/dialog.d.ts.map +0 -1
- package/web-components/dialog/dialog.js +0 -143
- package/web-components/dialog/dialog.js.map +0 -1
- package/web-components/divider/divider.d.ts +0 -13
- package/web-components/divider/divider.d.ts.map +0 -1
- package/web-components/divider/divider.js +0 -95
- package/web-components/divider/divider.js.map +0 -1
- package/web-components/form/form.d.ts.map +0 -1
- package/web-components/form/form.js.map +0 -1
- package/web-components/input/input.d.ts +0 -37
- package/web-components/input/input.d.ts.map +0 -1
- package/web-components/input/input.js +0 -152
- package/web-components/input/input.js.map +0 -1
- package/web-components/input/label-input.d.ts +0 -15
- package/web-components/input/label-input.d.ts.map +0 -1
- package/web-components/input/label-input.js +0 -96
- package/web-components/input/label-input.js.map +0 -1
- package/web-components/input/range-input.d.ts +0 -53
- package/web-components/input/range-input.d.ts.map +0 -1
- package/web-components/input/range-input.js.map +0 -1
- package/web-components/input/search-input.d.ts +0 -42
- package/web-components/input/search-input.d.ts.map +0 -1
- package/web-components/input/search-input.js +0 -214
- package/web-components/input/search-input.js.map +0 -1
- package/web-components/input/select-input.d.ts +0 -36
- package/web-components/input/select-input.d.ts.map +0 -1
- package/web-components/input/select-input.js +0 -210
- package/web-components/input/select-input.js.map +0 -1
- package/web-components/input/split-input.d.ts +0 -29
- package/web-components/input/split-input.d.ts.map +0 -1
- package/web-components/input/split-input.js +0 -184
- package/web-components/input/split-input.js.map +0 -1
- package/web-components/input/switch-input.d.ts.map +0 -1
- package/web-components/input/switch-input.js.map +0 -1
- package/web-components/layout/flex-flow.d.ts +0 -17
- package/web-components/layout/flex-flow.d.ts.map +0 -1
- package/web-components/layout/flex-flow.js +0 -73
- package/web-components/layout/flex-flow.js.map +0 -1
- package/web-components/layout/grid-flow.d.ts +0 -14
- package/web-components/layout/grid-flow.d.ts.map +0 -1
- package/web-components/layout/grid-flow.js +0 -56
- package/web-components/layout/grid-flow.js.map +0 -1
- package/web-components/layout/layout.d.ts +0 -18
- package/web-components/layout/layout.d.ts.map +0 -1
- package/web-components/layout/layout.js +0 -76
- package/web-components/layout/layout.js.map +0 -1
- package/web-components/link/link.d.ts +0 -10
- package/web-components/link/link.d.ts.map +0 -1
- package/web-components/link/link.js +0 -17
- package/web-components/link/link.js.map +0 -1
- package/web-components/link/router-link.d.ts +0 -19
- package/web-components/link/router-link.d.ts.map +0 -1
- package/web-components/link/router-link.js +0 -60
- package/web-components/link/router-link.js.map +0 -1
- package/web-components/progress/progress.d.ts.map +0 -1
- package/web-components/progress/progress.js.map +0 -1
- package/web-components/router/router.d.ts +0 -86
- package/web-components/router/router.d.ts.map +0 -1
- package/web-components/router/router.js +0 -246
- package/web-components/router/router.js.map +0 -1
- package/web-components/skeleton/skeleton.d.ts.map +0 -1
- package/web-components/skeleton/skeleton.js +0 -130
- package/web-components/skeleton/skeleton.js.map +0 -1
- package/web-components/text/overbreath.d.ts +0 -22
- package/web-components/text/overbreath.d.ts.map +0 -1
- package/web-components/text/overbreath.js +0 -132
- package/web-components/text/overbreath.js.map +0 -1
- package/web-components/text/text.d.ts.map +0 -1
- package/web-components/text/text.js.map +0 -1
- package/web-components/text/time.d.ts.map +0 -1
- package/web-components/text/time.js.map +0 -1
- package/web-components/text/typewriter.d.ts.map +0 -1
- package/web-components/text/typewriter.js.map +0 -1
- package/web-components/tooltip/tooltip.d.ts +0 -30
- package/web-components/tooltip/tooltip.d.ts.map +0 -1
- package/web-components/tooltip/tooltip.js +0 -123
- package/web-components/tooltip/tooltip.js.map +0 -1
- package/web-components/wrapper/dragbox.d.ts.map +0 -1
- package/web-components/wrapper/dragbox.js.map +0 -1
- package/web-components/wrapper/rotate.d.ts.map +0 -1
- package/web-components/wrapper/rotate.js.map +0 -1
@@ -1,19 +1,28 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
2
|
+
import { godown } from "@godown/element/decorators/godown.js";
|
3
|
+
import { part } from "@godown/element/decorators/part.js";
|
4
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
5
|
+
import { classList } from "@godown/element/directives/class-list.js";
|
6
|
+
import { conditionIf } from "@godown/element/directives/condition-if.js";
|
7
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
8
|
+
import { joinProperties } from "@godown/element/tools/css.js";
|
9
|
+
import { isNil } from "@godown/element/tools/lib.js";
|
10
|
+
import { css, html } from "lit";
|
11
|
+
import { property, state } from "lit/decorators.js";
|
12
|
+
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
13
|
+
import SuperInput from "../core/super-input.js";
|
14
|
+
const protoName = "range";
|
15
|
+
const cssScope = scopePrefix(protoName);
|
13
16
|
/**
|
14
|
-
* {@linkcode
|
17
|
+
* {@linkcode Range} is similar to <input type="range">.
|
18
|
+
*
|
19
|
+
* Value accepts a number, or an array of two numbers.
|
20
|
+
*
|
21
|
+
* Number have one handle, array have two.
|
22
|
+
*
|
23
|
+
* @category input
|
15
24
|
*/
|
16
|
-
let
|
25
|
+
let Range = class Range extends SuperInput {
|
17
26
|
constructor() {
|
18
27
|
super(...arguments);
|
19
28
|
/**
|
@@ -35,57 +44,55 @@ let RangeInput = class RangeInput extends GodownInput {
|
|
35
44
|
get reverse() {
|
36
45
|
return this.range ? this.value[0] > this.value[1] : false;
|
37
46
|
}
|
47
|
+
/**
|
48
|
+
* Enable range sliding.
|
49
|
+
*/
|
50
|
+
get range() {
|
51
|
+
return Array.isArray(this.value);
|
52
|
+
}
|
53
|
+
get rangeValue() {
|
54
|
+
return (this.range ? this.value : [0, this.value]);
|
55
|
+
}
|
38
56
|
render() {
|
39
|
-
const [from, to] =
|
57
|
+
const [from, to] = this.rangeValue;
|
40
58
|
const gap = this.max - this.min;
|
41
|
-
const style = joinProperties({
|
42
|
-
"--start": `${((from - this.min) / gap) * 100}%`,
|
43
|
-
"--end": `${((to - this.min) / gap) * 100}%`,
|
44
|
-
});
|
45
59
|
return html `<div
|
46
60
|
part="root"
|
47
|
-
class="${
|
61
|
+
class="${classList({
|
48
62
|
vertical: this.vertical,
|
49
63
|
range: this.range,
|
50
64
|
reverse: this.reverse,
|
51
65
|
})}"
|
52
|
-
@mousedown="${this._handleMousedownRoot}"
|
53
|
-
style="${
|
54
|
-
>
|
66
|
+
@mousedown="${this.disabled ? null : this._handleMousedownRoot}"
|
67
|
+
style="${joinProperties({ "--start": `${((from - this.min) / gap) * 100}%`, "--end": `${((to - this.min) / gap) * 100}%` })}">
|
55
68
|
<div part="track"></div>
|
56
|
-
|
69
|
+
${conditionIf(this.range, html `<i
|
57
70
|
part="handle"
|
58
|
-
class="${
|
59
|
-
|
60
|
-
}, "start")}"
|
61
|
-
@mousedown="${this._handleMousedownStart}"
|
62
|
-
>
|
71
|
+
class="${classList({ "last-focus": this.lastFocus === 1 }, "start")}"
|
72
|
+
@mousedown="${this.disabled ? null : this._handleMousedownStart}">
|
63
73
|
${htmlSlot("start")}
|
64
|
-
</i
|
74
|
+
</i>`)}
|
65
75
|
<i
|
66
76
|
part="handle"
|
67
|
-
class="${
|
68
|
-
|
69
|
-
}, "end")}"
|
70
|
-
@mousedown="${this._handleMousedownEnd}"
|
71
|
-
>
|
77
|
+
class="${classList({ "last-focus": this.lastFocus === 2 }, "end")}"
|
78
|
+
@mousedown="${this.disabled ? null : this._handleMousedownEnd}">
|
72
79
|
${htmlSlot("end")}
|
73
80
|
</i>
|
74
81
|
</div>`;
|
75
82
|
}
|
76
83
|
_handleMousedownStart(e) {
|
84
|
+
this.lastFocus = 1;
|
77
85
|
this.createMousedownListener(this.setStart)(e);
|
78
86
|
}
|
79
87
|
_handleMousedownEnd(e) {
|
88
|
+
this.lastFocus = 2;
|
80
89
|
this.createMousedownListener(this.setEnd)(e);
|
81
90
|
}
|
82
91
|
setStart(value) {
|
83
|
-
this.lastFocus = 1;
|
84
92
|
const i = this.value[1];
|
85
93
|
this.value = this.range ? [value, i] : value;
|
86
94
|
}
|
87
95
|
setEnd(value) {
|
88
|
-
this.lastFocus = 2;
|
89
96
|
const i = this.value[0];
|
90
97
|
this.value = this.range ? [i, value] : value;
|
91
98
|
}
|
@@ -137,10 +144,10 @@ let RangeInput = class RangeInput extends GodownInput {
|
|
137
144
|
_connectedInit() {
|
138
145
|
const gap = this.max - this.min;
|
139
146
|
this.step ||= gap / 100;
|
140
|
-
if (
|
147
|
+
if (!isNil(this.default) && isNil(this.value)) {
|
141
148
|
this.value = this.default;
|
142
149
|
}
|
143
|
-
else if (isNil(this.default) &&
|
150
|
+
else if (isNil(this.default) && !isNil(this.value)) {
|
144
151
|
this.default = this.value;
|
145
152
|
}
|
146
153
|
else {
|
@@ -171,61 +178,52 @@ let RangeInput = class RangeInput extends GodownInput {
|
|
171
178
|
};
|
172
179
|
__decorate([
|
173
180
|
property({ type: Number })
|
174
|
-
],
|
181
|
+
], Range.prototype, "min", void 0);
|
175
182
|
__decorate([
|
176
183
|
property({ type: Number })
|
177
|
-
],
|
184
|
+
], Range.prototype, "max", void 0);
|
178
185
|
__decorate([
|
179
186
|
property({ type: Number })
|
180
|
-
],
|
181
|
-
__decorate([
|
182
|
-
property({ type: Boolean, reflect: true })
|
183
|
-
], RangeInput.prototype, "range", void 0);
|
187
|
+
], Range.prototype, "step", void 0);
|
184
188
|
__decorate([
|
185
189
|
property({ type: Boolean, reflect: true })
|
186
|
-
],
|
190
|
+
], Range.prototype, "vertical", void 0);
|
187
191
|
__decorate([
|
188
192
|
property({ type: Array })
|
189
|
-
],
|
193
|
+
], Range.prototype, "value", void 0);
|
190
194
|
__decorate([
|
191
195
|
property({ type: Array })
|
192
|
-
],
|
196
|
+
], Range.prototype, "default", void 0);
|
193
197
|
__decorate([
|
194
198
|
part("root")
|
195
|
-
],
|
196
|
-
|
199
|
+
], Range.prototype, "_root", void 0);
|
200
|
+
__decorate([
|
201
|
+
state()
|
202
|
+
], Range.prototype, "lastFocus", void 0);
|
203
|
+
Range = __decorate([
|
197
204
|
godown(protoName),
|
198
|
-
styles(
|
199
|
-
inputStyle,
|
200
|
-
css `
|
205
|
+
styles(css `
|
201
206
|
:host {
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
--${cssScope}--handle-active: rgb(0 118 200);
|
207
|
-
--${cssScope}--track-width: .5em;
|
207
|
+
${cssScope}-handle-active: var(${cssGlobalVars._colors.blue[7]});
|
208
|
+
${cssScope}-track-width: .5em;
|
209
|
+
background: var(${cssGlobalVars.input}-background);
|
210
|
+
width: var(${cssGlobalVars.input}-width);
|
208
211
|
display: inline-block;
|
209
|
-
|
212
|
+
margin: 0.25em 0;
|
210
213
|
}
|
211
214
|
|
212
215
|
:host([vertical]) {
|
213
|
-
height:
|
214
|
-
width: -moz-fit-content;
|
216
|
+
height: var(${cssGlobalVars.input}-width);
|
215
217
|
width: fit-content;
|
216
218
|
}
|
217
219
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
i:active {
|
223
|
-
--${cssScope}--handle-scale:1.05;
|
224
|
-
background: var(--${cssScope}--handle-active);
|
220
|
+
:host(:not([disabled])) i:active {
|
221
|
+
${cssScope}-handle-scale:1.05;
|
222
|
+
background: var(${cssScope}-handle-active);
|
225
223
|
}
|
226
224
|
|
227
225
|
.last-focus {
|
228
|
-
z-index:
|
226
|
+
z-index: 1;
|
229
227
|
}
|
230
228
|
|
231
229
|
[part="root"] {
|
@@ -235,10 +233,11 @@ RangeInput = __decorate([
|
|
235
233
|
width: 100%;
|
236
234
|
--start: 0%;
|
237
235
|
--end: 50%;
|
238
|
-
height: var(
|
236
|
+
height: var(${cssScope}-track-width);
|
239
237
|
}
|
240
238
|
|
241
239
|
[part="track"] {
|
240
|
+
height: 100%;
|
242
241
|
min-height:inherit;
|
243
242
|
display: flex;
|
244
243
|
position: absolute;
|
@@ -246,31 +245,29 @@ RangeInput = __decorate([
|
|
246
245
|
border-radius: inherit;
|
247
246
|
justify-content: space-between;
|
248
247
|
left: min(var(--start), var(--end));
|
249
|
-
background: var(
|
248
|
+
background: var(${cssGlobalVars.active});
|
250
249
|
width: max(calc(var(--end) - var(--start)), calc(var(--start) - var(--end)));
|
251
250
|
}
|
252
251
|
|
253
|
-
[part=handle] {
|
252
|
+
[part="handle"] {
|
254
253
|
width: 1em;
|
255
254
|
height: 1em;
|
256
255
|
display: flex;
|
257
256
|
align-items: center;
|
258
257
|
justify-content: center;
|
259
|
-
|
260
|
-
user-select: none;
|
258
|
+
user-select: none;
|
261
259
|
position: absolute;
|
262
260
|
border: 0.1em solid;
|
263
261
|
border-radius: 50%;
|
264
262
|
transform-origin: 0% 25%;
|
265
|
-
transform: scale(var(
|
266
|
-
background: var(
|
267
|
-
border-color: var(
|
263
|
+
transform: scale(var(${cssScope}-handle-scale, 1)) translate(-50%, -25%);
|
264
|
+
background: var(${cssGlobalVars.active});
|
265
|
+
border-color: var(${cssGlobalVars.input}-control);
|
268
266
|
}
|
269
|
-
`,
|
270
|
-
css `
|
267
|
+
`, css `
|
271
268
|
.vertical {
|
272
269
|
height: 100%;
|
273
|
-
width: var(
|
270
|
+
width: var(${cssScope}-track-width);
|
274
271
|
}
|
275
272
|
|
276
273
|
.vertical i {
|
@@ -283,12 +280,7 @@ RangeInput = __decorate([
|
|
283
280
|
top: min(var(--start), var(--end));
|
284
281
|
left: 0;
|
285
282
|
}
|
286
|
-
`,
|
287
|
-
css `
|
288
|
-
:host(:not([range])) .start {
|
289
|
-
visibility: hidden;
|
290
|
-
}
|
291
|
-
|
283
|
+
`, css `
|
292
284
|
.start {
|
293
285
|
left: var(--start);
|
294
286
|
top: 0;
|
@@ -308,9 +300,7 @@ RangeInput = __decorate([
|
|
308
300
|
top: var(--end);
|
309
301
|
left: 0;
|
310
302
|
}
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
export default RangeInput;
|
316
|
-
//# sourceMappingURL=range-input.js.map
|
303
|
+
`)
|
304
|
+
], Range);
|
305
|
+
export default Range;
|
306
|
+
//# sourceMappingURL=range.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"range.js","sourceRoot":"","sources":["../../src/components/range.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;;GAQG;AAyGH,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,UAAU;IAA9B;;QACE;;WAEG;QAEH,QAAG,GAAG,CAAC,CAAC;QACR;;WAEG;QAEH,QAAG,GAAG,GAAG,CAAC;QACV;;WAEG;QAEH,SAAI,GAAG,CAAC,CAAC;IAgLX,CAAC;IA1JC;;OAEG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC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E,CAAC;kCACnB;AAKR;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kCACjB;AAKV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAClB;AAGT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACzB;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oCACO;AAKjC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;sCACS;AAGnC;IADC,IAAI,CAAC,MAAM,CAAC;oCACM;AAGnB;IADC,KAAK,EAAE;wCACqB;AAnCzB,KAAK;IAxGV,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;QAEG,QAAQ,uBAAuB,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5D,QAAQ;wBACQ,aAAa,CAAC,KAAK;mBACxB,aAAa,CAAC,KAAK;;;;;;oBAMlB,aAAa,CAAC,KAAK;;;;;QAK/B,QAAQ;wBACQ,QAAQ;;;;;;;;;;;;;;oBAcZ,QAAQ;;;;;;;;;;;;wBAYJ,aAAa,CAAC,MAAM;;;;;;;;;;;;;;;6BAef,QAAQ;wBACb,aAAa,CAAC,MAAM;0BAClB,aAAa,CAAC,KAAK;;GAE1C,EACD,GAAG,CAAA;;;mBAGc,QAAQ;;;;;;;;;;;;;GAaxB,EACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;GAoBF,CACF;GACK,KAAK,CA+LV;AAED,eAAe,KAAK,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { GlobalStyle } from "../core/global-style.js";
|
2
|
+
/**
|
3
|
+
* {@linkcode Rotate} Make child elements rotate.
|
4
|
+
*
|
5
|
+
* @category wrapper
|
6
|
+
*/
|
7
|
+
declare class Rotate extends GlobalStyle {
|
8
|
+
_root: HTMLElement;
|
9
|
+
protected render(): import("lit").TemplateResult<1>;
|
10
|
+
reset(): void;
|
11
|
+
protected _handleRotate(e: MouseEvent): void;
|
12
|
+
/**
|
13
|
+
* Compute offset.
|
14
|
+
* ```
|
15
|
+
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`
|
16
|
+
* ```
|
17
|
+
* @param e Mouse move event.
|
18
|
+
* @returns rotateX, rotateY
|
19
|
+
*/
|
20
|
+
_computeOffset(e: MouseEvent): {
|
21
|
+
rotateX: number;
|
22
|
+
rotateY: number;
|
23
|
+
};
|
24
|
+
}
|
25
|
+
export default Rotate;
|
26
|
+
//# sourceMappingURL=rotate.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/components/rotate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cAiCM,MAAO,SAAQ,WAAW;IAE9B,KAAK,EAAE,WAAW,CAAC;IAEnB,SAAS,CAAC,MAAM;IAOhB,KAAK;IAKL,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU;IAMrC;;;;;;;OAOG;IACH,cAAc,CAAC,CAAC,EAAE,UAAU;;;;CAU7B;AAED,eAAe,MAAM,CAAC"}
|
@@ -1,33 +1,28 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import { createScope } from "../../styles/global.js";
|
2
|
+
import { godown } from "@godown/element/decorators/godown.js";
|
3
|
+
import { part } from "@godown/element/decorators/part.js";
|
4
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
5
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
6
|
+
import { css, html } from "lit";
|
7
|
+
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
9
8
|
const protoName = "rotate";
|
10
|
-
const cssScope =
|
9
|
+
const cssScope = scopePrefix(protoName);
|
11
10
|
/**
|
12
11
|
* {@linkcode Rotate} Make child elements rotate.
|
12
|
+
*
|
13
|
+
* @category wrapper
|
13
14
|
*/
|
14
|
-
let Rotate = class Rotate extends
|
15
|
+
let Rotate = class Rotate extends GlobalStyle {
|
15
16
|
render() {
|
16
17
|
return html `<div part="root">
|
17
18
|
<div part="slot" @mousemove="${this._handleRotate}">${htmlSlot()}</div>
|
18
19
|
<i @mouseleave="${this.reset}"></i>
|
19
20
|
</div>`;
|
20
21
|
}
|
21
|
-
/**
|
22
|
-
* Cancel the offset.
|
23
|
-
*/
|
24
22
|
reset() {
|
25
23
|
this._root.style.removeProperty("transform");
|
26
24
|
this._root.style.removeProperty("transition");
|
27
25
|
}
|
28
|
-
/**
|
29
|
-
* Apply offset.
|
30
|
-
*/
|
31
26
|
_handleRotate(e) {
|
32
27
|
const { rotateX, rotateY } = this._computeOffset(e);
|
33
28
|
this._root.style.setProperty("transform", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);
|
@@ -62,8 +57,8 @@ Rotate = __decorate([
|
|
62
57
|
width: -moz-fit-content;
|
63
58
|
width: fit-content;
|
64
59
|
transition: all 0.5s ease-in-out;
|
65
|
-
|
66
|
-
|
60
|
+
${cssScope}--padding: .75em;
|
61
|
+
${cssScope}--offset: .5em;
|
67
62
|
}
|
68
63
|
|
69
64
|
div {
|
@@ -78,8 +73,8 @@ Rotate = __decorate([
|
|
78
73
|
position: absolute;
|
79
74
|
top: 0;
|
80
75
|
box-sizing: content-box;
|
81
|
-
padding: var(
|
82
|
-
margin: calc(-1 * var(
|
76
|
+
padding: var(${cssScope}--offset);
|
77
|
+
margin: calc(-1 * var(${cssScope}--offset));
|
83
78
|
}
|
84
79
|
|
85
80
|
[part="slot"]{
|
@@ -87,6 +82,5 @@ Rotate = __decorate([
|
|
87
82
|
}
|
88
83
|
`)
|
89
84
|
], Rotate);
|
90
|
-
export { Rotate };
|
91
85
|
export default Rotate;
|
92
86
|
//# sourceMappingURL=rotate.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rotate.js","sourceRoot":"","sources":["../../src/components/rotate.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;GAIG;AAkCH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,WAAW;IAIpB,MAAM;QACd,OAAO,IAAI,CAAA;qCACsB,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE;wBAC9C,IAAI,CAAC,KAAK;WACvB,CAAC;IACV,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;IAES,aAAa,CAAC,CAAa;QACnC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,OAAO,gBAAgB,OAAO,MAAM,CAAC,CAAC;QAC3F,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,CAAa;QAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;QACxE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;QAC/B,MAAM,OAAO,GAAG,OAAO,GAAG,GAAG,CAAC;QAE9B,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC;CACF,CAAA;AAtCC;IADC,IAAI,CAAC,MAAM,CAAC;qCACM;AAFf,MAAM;IAjCX,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;;;;;MAMC,QAAQ;MACR,QAAQ;;;;;;;;;;;;;;;mBAeK,QAAQ;4BACC,QAAQ;;;;;;CAMnC,CACA;GACK,MAAM,CAwCX;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import { type PropertyValueMap, type TemplateResult } from "lit";
|
2
|
+
import { GlobalStyle } from "../core/global-style.js";
|
3
|
+
/**
|
4
|
+
* {@linkcode Router} has basic routing control.
|
5
|
+
*
|
6
|
+
* To switch routes, use `router-link component`.
|
7
|
+
*
|
8
|
+
* It has two methods to collect routes.
|
9
|
+
*
|
10
|
+
* 1. From field `routes`, an array, each elements require "path" and "component".
|
11
|
+
* 2. From child elements, which have the slot attribute for matching routes.
|
12
|
+
*
|
13
|
+
* If only the method 1 is used, set `type` to `"field"`.
|
14
|
+
*
|
15
|
+
* If only the method 2 is used, set `type` to `"slotted"`.
|
16
|
+
*
|
17
|
+
* `type` defaults to `"united"`, which will try method 1, then method 2.
|
18
|
+
*
|
19
|
+
* If no routes are matched, the default value (no named slot) will be rendered.
|
20
|
+
*
|
21
|
+
* @category navigation
|
22
|
+
*/
|
23
|
+
declare class Router<C = unknown> extends GlobalStyle {
|
24
|
+
static routerInstances: Set<Router<unknown>>;
|
25
|
+
private __fieldRouteTree;
|
26
|
+
private __slottedRouteTree;
|
27
|
+
private __cacheRecord;
|
28
|
+
private __routes;
|
29
|
+
/**
|
30
|
+
* Render result.
|
31
|
+
*/
|
32
|
+
component: C | TemplateResult;
|
33
|
+
/**
|
34
|
+
* Dynamic parameters record.
|
35
|
+
*/
|
36
|
+
params: Record<string, string>;
|
37
|
+
/**
|
38
|
+
* Value of matched path in routes.
|
39
|
+
*/
|
40
|
+
path: string;
|
41
|
+
/**
|
42
|
+
* Current pathname (equals to location.pathname).
|
43
|
+
*/
|
44
|
+
pathname: string;
|
45
|
+
/**
|
46
|
+
* Path prefix.
|
47
|
+
*/
|
48
|
+
baseURL: string;
|
49
|
+
/**
|
50
|
+
* Rendered content when there is no match.
|
51
|
+
*/
|
52
|
+
default: TemplateResult;
|
53
|
+
/**
|
54
|
+
* The type of routing sources.
|
55
|
+
*
|
56
|
+
* If field, it won't collect the slot attribute of the child elements.
|
57
|
+
*
|
58
|
+
* This property should not be changed after the rendering is complete.
|
59
|
+
*/
|
60
|
+
type: "united" | "slotted" | "field";
|
61
|
+
/**
|
62
|
+
* Cache accessed records.
|
63
|
+
*
|
64
|
+
* Emptied at each re-collection.
|
65
|
+
*/
|
66
|
+
cache: boolean;
|
67
|
+
set routes(value: (Record<string, any> & {
|
68
|
+
path: string;
|
69
|
+
component?: C;
|
70
|
+
})[]);
|
71
|
+
get routes(): (Record<string, any> & {
|
72
|
+
path: string;
|
73
|
+
component?: C;
|
74
|
+
})[];
|
75
|
+
clear(): void;
|
76
|
+
protected render(): C | TemplateResult;
|
77
|
+
connectedCallback(): void;
|
78
|
+
disconnectedCallback(): void;
|
79
|
+
useRouter(): {
|
80
|
+
pathname: string;
|
81
|
+
params: Record<string, string>;
|
82
|
+
path: string;
|
83
|
+
component: C | TemplateResult;
|
84
|
+
};
|
85
|
+
/**
|
86
|
+
* @param params value of useRouter()
|
87
|
+
* @param first whether this path is loaded for the first time.
|
88
|
+
*/
|
89
|
+
routeChangeCallback: (params: {
|
90
|
+
pathname: string;
|
91
|
+
params: Record<string, string>;
|
92
|
+
path: string;
|
93
|
+
component: C | TemplateResult;
|
94
|
+
}, first: boolean) => void;
|
95
|
+
protected updated(changedProperties: PropertyValueMap<this>): void;
|
96
|
+
/**
|
97
|
+
* Find components from {@linkcode __fieldRouteTree} matching query.
|
98
|
+
* @param query Query string.
|
99
|
+
* @returns Components or null.
|
100
|
+
*/
|
101
|
+
fieldComponent(query?: string): C;
|
102
|
+
/**
|
103
|
+
* Find components from {@linkcode __slottedRouteTree} matching query.
|
104
|
+
* @param query Query string.
|
105
|
+
* @returns Named slot element template result or null.
|
106
|
+
*/
|
107
|
+
slottedComponent(usedRouteTemplate?: string): TemplateResult<1>;
|
108
|
+
/**
|
109
|
+
* Reset the route tree, clear cache, collect routes from child elements.
|
110
|
+
*/
|
111
|
+
collectSlottedRoutes(): void;
|
112
|
+
/**
|
113
|
+
* Reset the route tree, clear cache, collect routes from value.
|
114
|
+
*/
|
115
|
+
collectFieldRoutes(value: typeof this.routes): void;
|
116
|
+
useWhich(path: string): string;
|
117
|
+
parseParams(routeTemplate: string, path: string): Record<string, string>;
|
118
|
+
static updateAll(): void;
|
119
|
+
}
|
120
|
+
export default Router;
|
121
|
+
//# sourceMappingURL=router.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/components/router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAA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