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
@@ -0,0 +1,248 @@
|
|
1
|
+
var Router_1;
|
2
|
+
import { __decorate } from "tslib";
|
3
|
+
import { godown } from "@godown/element/decorators/godown.js";
|
4
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
5
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
6
|
+
import { RouteTree } from "@godown/element/tools/route-tree.js";
|
7
|
+
import { css } from "lit";
|
8
|
+
import { property, state } from "lit/decorators.js";
|
9
|
+
import { GlobalStyle } from "../core/global-style.js";
|
10
|
+
const protoName = "router";
|
11
|
+
/**
|
12
|
+
* {@linkcode Router} has basic routing control.
|
13
|
+
*
|
14
|
+
* To switch routes, use `router-link component`.
|
15
|
+
*
|
16
|
+
* It has two methods to collect routes.
|
17
|
+
*
|
18
|
+
* 1. From field `routes`, an array, each elements require "path" and "component".
|
19
|
+
* 2. From child elements, which have the slot attribute for matching routes.
|
20
|
+
*
|
21
|
+
* If only the method 1 is used, set `type` to `"field"`.
|
22
|
+
*
|
23
|
+
* If only the method 2 is used, set `type` to `"slotted"`.
|
24
|
+
*
|
25
|
+
* `type` defaults to `"united"`, which will try method 1, then method 2.
|
26
|
+
*
|
27
|
+
* If no routes are matched, the default value (no named slot) will be rendered.
|
28
|
+
*
|
29
|
+
* @category navigation
|
30
|
+
*/
|
31
|
+
let Router = Router_1 = class Router extends GlobalStyle {
|
32
|
+
constructor() {
|
33
|
+
super(...arguments);
|
34
|
+
this.__fieldRouteTree = new RouteTree();
|
35
|
+
this.__slottedRouteTree = new RouteTree();
|
36
|
+
this.__cacheRecord = new Map();
|
37
|
+
/**
|
38
|
+
* Render result.
|
39
|
+
*/
|
40
|
+
this.component = null;
|
41
|
+
/**
|
42
|
+
* Dynamic parameters record.
|
43
|
+
*/
|
44
|
+
this.params = {};
|
45
|
+
/**
|
46
|
+
* Current pathname (equals to location.pathname).
|
47
|
+
*/
|
48
|
+
this.pathname = "";
|
49
|
+
/**
|
50
|
+
* Path prefix.
|
51
|
+
*/
|
52
|
+
this.baseURL = "";
|
53
|
+
/**
|
54
|
+
* Rendered content when there is no match.
|
55
|
+
*/
|
56
|
+
this.default = htmlSlot();
|
57
|
+
/**
|
58
|
+
* The type of routing sources.
|
59
|
+
*
|
60
|
+
* If field, it won't collect the slot attribute of the child elements.
|
61
|
+
*
|
62
|
+
* This property should not be changed after the rendering is complete.
|
63
|
+
*/
|
64
|
+
this.type = "united";
|
65
|
+
/**
|
66
|
+
* Cache accessed records.
|
67
|
+
*
|
68
|
+
* Emptied at each re-collection.
|
69
|
+
*/
|
70
|
+
this.cache = false;
|
71
|
+
/**
|
72
|
+
* @param params value of useRouter()
|
73
|
+
* @param first whether this path is loaded for the first time.
|
74
|
+
*/
|
75
|
+
this.routeChangeCallback = null;
|
76
|
+
}
|
77
|
+
set routes(value) {
|
78
|
+
this.__routes = value;
|
79
|
+
this.collectFieldRoutes(value);
|
80
|
+
}
|
81
|
+
get routes() {
|
82
|
+
return this.__routes;
|
83
|
+
}
|
84
|
+
clear() {
|
85
|
+
this.__cacheRecord.clear();
|
86
|
+
}
|
87
|
+
render() {
|
88
|
+
this.params = {};
|
89
|
+
if (this.cache) {
|
90
|
+
const cached = this.__cacheRecord.get(this.pathname);
|
91
|
+
if (cached) {
|
92
|
+
Object.assign(this, cached);
|
93
|
+
return this.component;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
switch (this.type) {
|
97
|
+
case "field":
|
98
|
+
this.component = this.fieldComponent();
|
99
|
+
break;
|
100
|
+
case "slotted":
|
101
|
+
this.component = this.slottedComponent();
|
102
|
+
break;
|
103
|
+
default:
|
104
|
+
this.component = this.fieldComponent() ?? this.slottedComponent();
|
105
|
+
}
|
106
|
+
return this.component ?? this.default ?? null;
|
107
|
+
}
|
108
|
+
connectedCallback() {
|
109
|
+
super.connectedCallback();
|
110
|
+
Router_1.routerInstances.add(this);
|
111
|
+
this.pathname = window.location.pathname;
|
112
|
+
if (this.type !== "field") {
|
113
|
+
const mutationObserver = new MutationObserver(this.collectSlottedRoutes);
|
114
|
+
mutationObserver.observe(this, {
|
115
|
+
attributeFilter: ["slot"],
|
116
|
+
attributes: true,
|
117
|
+
subtree: true,
|
118
|
+
});
|
119
|
+
this.collectSlottedRoutes();
|
120
|
+
}
|
121
|
+
}
|
122
|
+
disconnectedCallback() {
|
123
|
+
super.disconnectedCallback();
|
124
|
+
Router_1.routerInstances.delete(this);
|
125
|
+
}
|
126
|
+
useRouter() {
|
127
|
+
return {
|
128
|
+
pathname: this.pathname,
|
129
|
+
params: this.params,
|
130
|
+
path: this.path,
|
131
|
+
component: this.component,
|
132
|
+
};
|
133
|
+
}
|
134
|
+
updated(changedProperties) {
|
135
|
+
const shouldDispatch = changedProperties.has("pathname") || changedProperties.has("path");
|
136
|
+
if (shouldDispatch) {
|
137
|
+
const ur = this.useRouter();
|
138
|
+
const noRecord = !this.__cacheRecord.has(this.pathname);
|
139
|
+
if (noRecord) {
|
140
|
+
this.__cacheRecord.set(this.pathname, ur);
|
141
|
+
}
|
142
|
+
this.routeChangeCallback?.(ur, noRecord);
|
143
|
+
this.dispatchEvent(new CustomEvent("change", { detail: ur }));
|
144
|
+
}
|
145
|
+
}
|
146
|
+
/**
|
147
|
+
* Find components from {@linkcode __fieldRouteTree} matching query.
|
148
|
+
* @param query Query string.
|
149
|
+
* @returns Components or null.
|
150
|
+
*/
|
151
|
+
fieldComponent(query) {
|
152
|
+
query ||= this.useWhich(this.pathname);
|
153
|
+
this.path = query;
|
154
|
+
if (!query) {
|
155
|
+
return null;
|
156
|
+
}
|
157
|
+
this.params = this.parseParams(this.path, this.pathname);
|
158
|
+
const route = this.routes.find((r) => r.path === query);
|
159
|
+
if (!route) {
|
160
|
+
return null;
|
161
|
+
}
|
162
|
+
return route.component;
|
163
|
+
}
|
164
|
+
/**
|
165
|
+
* Find components from {@linkcode __slottedRouteTree} matching query.
|
166
|
+
* @param query Query string.
|
167
|
+
* @returns Named slot element template result or null.
|
168
|
+
*/
|
169
|
+
slottedComponent(usedRouteTemplate) {
|
170
|
+
const slottedPaths = this._slottedNames;
|
171
|
+
usedRouteTemplate ||= this.__slottedRouteTree.useWhich(this.pathname);
|
172
|
+
this.path = usedRouteTemplate;
|
173
|
+
if (!usedRouteTemplate) {
|
174
|
+
return null;
|
175
|
+
}
|
176
|
+
this.path = slottedPaths.find((s) => s === usedRouteTemplate);
|
177
|
+
if (!this.path) {
|
178
|
+
return null;
|
179
|
+
}
|
180
|
+
this.params = this.parseParams(usedRouteTemplate, this.pathname);
|
181
|
+
return htmlSlot(this.path);
|
182
|
+
}
|
183
|
+
/**
|
184
|
+
* Reset the route tree, clear cache, collect routes from child elements.
|
185
|
+
*/
|
186
|
+
collectSlottedRoutes() {
|
187
|
+
this.__slottedRouteTree = new RouteTree();
|
188
|
+
this.clear();
|
189
|
+
this._slottedNames.forEach(slotName => {
|
190
|
+
this.__slottedRouteTree.insert(slotName);
|
191
|
+
});
|
192
|
+
}
|
193
|
+
/**
|
194
|
+
* Reset the route tree, clear cache, collect routes from value.
|
195
|
+
*/
|
196
|
+
collectFieldRoutes(value) {
|
197
|
+
this.__fieldRouteTree = new RouteTree();
|
198
|
+
this.clear();
|
199
|
+
value.forEach(({ path }) => {
|
200
|
+
this.__fieldRouteTree.insert(path);
|
201
|
+
});
|
202
|
+
}
|
203
|
+
useWhich(path) {
|
204
|
+
return this.__fieldRouteTree.useWhich(this.baseURL + path);
|
205
|
+
}
|
206
|
+
parseParams(routeTemplate, path) {
|
207
|
+
return this.__fieldRouteTree.parseParams(path, routeTemplate);
|
208
|
+
}
|
209
|
+
static updateAll() {
|
210
|
+
this.routerInstances.forEach((i) => {
|
211
|
+
i.pathname = window.location.pathname;
|
212
|
+
});
|
213
|
+
}
|
214
|
+
};
|
215
|
+
Router.routerInstances = new Set();
|
216
|
+
__decorate([
|
217
|
+
state()
|
218
|
+
], Router.prototype, "component", void 0);
|
219
|
+
__decorate([
|
220
|
+
state()
|
221
|
+
], Router.prototype, "params", void 0);
|
222
|
+
__decorate([
|
223
|
+
state()
|
224
|
+
], Router.prototype, "path", void 0);
|
225
|
+
__decorate([
|
226
|
+
property()
|
227
|
+
], Router.prototype, "pathname", void 0);
|
228
|
+
__decorate([
|
229
|
+
property()
|
230
|
+
], Router.prototype, "baseURL", void 0);
|
231
|
+
__decorate([
|
232
|
+
state()
|
233
|
+
], Router.prototype, "default", void 0);
|
234
|
+
__decorate([
|
235
|
+
property()
|
236
|
+
], Router.prototype, "type", void 0);
|
237
|
+
__decorate([
|
238
|
+
property({ type: Boolean })
|
239
|
+
], Router.prototype, "cache", void 0);
|
240
|
+
__decorate([
|
241
|
+
state()
|
242
|
+
], Router.prototype, "routes", null);
|
243
|
+
Router = Router_1 = __decorate([
|
244
|
+
godown(protoName),
|
245
|
+
styles(css `:host{display:contents;}`)
|
246
|
+
], Router);
|
247
|
+
export default Router;
|
248
|
+
//# sourceMappingURL=router.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/components/router.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,GAAG,EAA8C,MAAM,KAAK,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,QAAQ,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,IAAM,MAAM,cAAZ,MAAM,MAAoB,SAAQ,WAAW;IAA7C;;QAGU,qBAAgB,GAAc,IAAI,SAAS,EAAE,CAAC;QAC9C,uBAAkB,GAAc,IAAI,SAAS,EAAE,CAAC;QAChD,kBAAa,GAAG,IAAI,GAAG,EAA6C,CAAC;QAS7E;;WAEG;QAEH,cAAS,GAAuB,IAAI,CAAC;QACrC;;WAEG;QAEH,W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AAC;IAED,MAAM,CAAC,SAAS;QACd,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACjC,CAAC,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;;AAlOM,sBAAe,GAAG,IAAI,GAAG,EAAU,AAApB,CAAqB;AAiB3C;IADC,KAAK,EAAE;yCAC6B;AAKrC;IADC,KAAK,EAAE;sCAC4B;AAKpC;IADC,KAAK,EAAE;oCACK;AAKb;IADC,QAAQ,EAAE;wCACG;AAKd;IADC,QAAQ,EAAE;uCACE;AAKb;IADC,KAAK,EAAE;uCAC6B;AASrC;IADC,QAAQ,EAAE;oCACqC;AAOhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACd;AAGd;IADC,KAAK,EAAE;oCAIP;AAjEG,MAAM;IAFX,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA,0BAA0B,CAAC;GAChC,MAAM,CAoOX;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { HandlerEvent } from "@godown/element";
|
2
|
+
import Input from "./input.js";
|
3
|
+
/**
|
4
|
+
* {@linkcode Select} is similar to <select>.
|
5
|
+
*
|
6
|
+
* Elements with the value attribute/property can be used as options.
|
7
|
+
*
|
8
|
+
* The checked attribute will be added to the selected element.
|
9
|
+
*
|
10
|
+
* Multi-selected state looks the same as single-selected.
|
11
|
+
*
|
12
|
+
* Input will filter the element.
|
13
|
+
*
|
14
|
+
* @slot - Options.
|
15
|
+
* @category input
|
16
|
+
*/
|
17
|
+
declare class Select extends Input {
|
18
|
+
_cache: WeakMap<HTMLElement, boolean>;
|
19
|
+
value: string | string[];
|
20
|
+
/**
|
21
|
+
* Open content.
|
22
|
+
*/
|
23
|
+
open: boolean;
|
24
|
+
/**
|
25
|
+
* Selected texts.
|
26
|
+
*/
|
27
|
+
text: string;
|
28
|
+
_content: HTMLElement;
|
29
|
+
visible: boolean;
|
30
|
+
direction: "top" | "bottom" | undefined;
|
31
|
+
multiple: boolean;
|
32
|
+
protected autoDirection: "top" | "bottom";
|
33
|
+
protected lastChecked: HTMLElement;
|
34
|
+
protected defaultText: string;
|
35
|
+
protected defaultChecked: HTMLElement[];
|
36
|
+
private _store;
|
37
|
+
protected render(): import("lit").TemplateResult<1>;
|
38
|
+
protected _handleFocus(): void;
|
39
|
+
protected _connectedInit(): void;
|
40
|
+
reset(): void;
|
41
|
+
select(value: string, text?: string): 0 | 1;
|
42
|
+
filter(query?: string): void;
|
43
|
+
filterCallback(element: HTMLElement, match: boolean, query: string): void;
|
44
|
+
protected _handleInput(e: HandlerEvent<HTMLInputElement>): void;
|
45
|
+
focus(options?: FocusOptions): void;
|
46
|
+
blur(): void;
|
47
|
+
optionValue(option: HTMLElement): string;
|
48
|
+
}
|
49
|
+
export default Select;
|
50
|
+
//# sourceMappingURL=select.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,OAAO,KAAK,MAAM,YAAY,CAAC;AAyB/B;;;;;;;;;;;;;GAaG;AACH,cAsBM,MAAO,SAAQ,KAAK;IACxB,MAAM,gCAAuC;IAE7C,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzB;;OAEG;IAEH,IAAI,UAAS;IAEb;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,WAAW,CAAC;IAGtB,OAAO,EAAE,OAAO,CAAC;IAGjB,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;IAGxC,QAAQ,EAAE,OAAO,CAAC;IAElB,SAAS,CAAC,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC1C,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;IACxC,OAAO,CAAC,MAAM,CAA0C;IAExD,SAAS,CAAC,MAAM;IA4BhB,SAAS,CAAC,YAAY;IAmCtB,SAAS,CAAC,cAAc;IAmBxB,KAAK,IAAI,IAAI;IAOb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IA4BnC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM;IAcrB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IAIlE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC;IAUxD,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAK5B,IAAI;IAKJ,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;CAGzC;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,243 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
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/index.js";
|
6
|
+
import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
|
7
|
+
import { css, html, nothing } from "lit";
|
8
|
+
import { property } from "lit/decorators.js";
|
9
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
10
|
+
import Input from "./input.js";
|
11
|
+
function contain(a, b) {
|
12
|
+
return a && b && a.toLowerCase().includes(b.toLowerCase());
|
13
|
+
}
|
14
|
+
function betweenAt(i, s, c) {
|
15
|
+
const start = s.slice(0, i).lastIndexOf(c) + 1 || 0;
|
16
|
+
const end = s.indexOf(c, i) || s.length;
|
17
|
+
return s.slice(start, end);
|
18
|
+
}
|
19
|
+
function updateChecked(element, operation) {
|
20
|
+
if (element) {
|
21
|
+
const name = "checked";
|
22
|
+
if (operation) {
|
23
|
+
element.setAttribute(name, "");
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
element.removeAttribute(name);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
const protoName = "select";
|
31
|
+
/**
|
32
|
+
* {@linkcode Select} is similar to <select>.
|
33
|
+
*
|
34
|
+
* Elements with the value attribute/property can be used as options.
|
35
|
+
*
|
36
|
+
* The checked attribute will be added to the selected element.
|
37
|
+
*
|
38
|
+
* Multi-selected state looks the same as single-selected.
|
39
|
+
*
|
40
|
+
* Input will filter the element.
|
41
|
+
*
|
42
|
+
* @slot - Options.
|
43
|
+
* @category input
|
44
|
+
*/
|
45
|
+
let Select = class Select extends Input {
|
46
|
+
constructor() {
|
47
|
+
super(...arguments);
|
48
|
+
this._cache = new WeakMap();
|
49
|
+
/**
|
50
|
+
* Open content.
|
51
|
+
*/
|
52
|
+
this.open = false;
|
53
|
+
this._store = [];
|
54
|
+
}
|
55
|
+
render() {
|
56
|
+
return html `<div part="root" class="input-field">
|
57
|
+
${[
|
58
|
+
this._renderPrefix(),
|
59
|
+
html `<input
|
60
|
+
part="input"
|
61
|
+
dir="${ifDefined(this.dir)}"
|
62
|
+
id="${this.makeId}"
|
63
|
+
.value="${this.text}"
|
64
|
+
type="${this.type}"
|
65
|
+
placeholder="${this.placeholder || nothing}"
|
66
|
+
?autofocus="${this.autofocus}"
|
67
|
+
autocapitalize="${this.autocapitalize || nothing}"
|
68
|
+
autocomplete="${this.autocomplete || nothing}"
|
69
|
+
?disabled="${this.disabled}"
|
70
|
+
@focus="${this._handleFocus}"
|
71
|
+
@input="${this._handleInput}"
|
72
|
+
>`,
|
73
|
+
html `<label for="${this.makeId}" part="suffix">
|
74
|
+
<i part="space"></i><i part="icon">${svgCaretDown()}</i><i part="space"></i>
|
75
|
+
</label>`,
|
76
|
+
html `<div part="content" direction="${this.direction || this.autoDirection}" style="visibility:${this.visible ? "visible" : "hidden"}">${htmlSlot()}</div>`,
|
77
|
+
]}
|
78
|
+
</div>`;
|
79
|
+
}
|
80
|
+
_handleFocus() {
|
81
|
+
if (!this.direction) {
|
82
|
+
const { top, bottom } = this.getBoundingClientRect();
|
83
|
+
if (window.innerHeight - bottom < this._content.clientHeight && top > this._content.clientHeight) {
|
84
|
+
this.autoDirection = "top";
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
this.autoDirection = "bottom";
|
88
|
+
}
|
89
|
+
}
|
90
|
+
if (!this.visible) {
|
91
|
+
const event = this.events.add(document, "click", (e) => {
|
92
|
+
const { target } = e;
|
93
|
+
if (!this.contains(target)) {
|
94
|
+
this.events.remove(document, "click", event);
|
95
|
+
this.visible = false;
|
96
|
+
}
|
97
|
+
else if (target !== this) {
|
98
|
+
const value = this.optionValue(target);
|
99
|
+
if (value) {
|
100
|
+
const operation = this.select(value, target.textContent);
|
101
|
+
if (!this.multiple) {
|
102
|
+
updateChecked(this.lastChecked, 0);
|
103
|
+
}
|
104
|
+
updateChecked(target, operation);
|
105
|
+
this.lastChecked = target;
|
106
|
+
}
|
107
|
+
this.visible = this.multiple;
|
108
|
+
if (!this.visible) {
|
109
|
+
this.events.remove(document, "click", event);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
});
|
113
|
+
}
|
114
|
+
this.visible = true;
|
115
|
+
}
|
116
|
+
_connectedInit() {
|
117
|
+
if (!this.value) {
|
118
|
+
const checked = [...this.querySelectorAll("[checked]")];
|
119
|
+
const list = this.multiple
|
120
|
+
? checked
|
121
|
+
: checked.length
|
122
|
+
? [this.lastChecked = checked[0]]
|
123
|
+
: [];
|
124
|
+
list.forEach((element) => {
|
125
|
+
const operation = this.select(this.optionValue(element), element.textContent);
|
126
|
+
updateChecked(element, operation);
|
127
|
+
});
|
128
|
+
this.default = this.value;
|
129
|
+
this.defaultText = this.text;
|
130
|
+
this.defaultChecked = checked;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
reset() {
|
134
|
+
this.value = this.default;
|
135
|
+
this.text = this.defaultText;
|
136
|
+
this.querySelectorAll("[checked]").forEach(element => updateChecked(element, 0));
|
137
|
+
this.defaultChecked.forEach(element => updateChecked(element, 1));
|
138
|
+
}
|
139
|
+
select(value, text) {
|
140
|
+
text ||= value;
|
141
|
+
let operation = 0;
|
142
|
+
if (this.multiple) {
|
143
|
+
const i = this._store.findIndex(s => s.value === value);
|
144
|
+
if (i > -1) {
|
145
|
+
this._store.splice(i, 1);
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
this._store.push({ value, text });
|
149
|
+
operation = 1;
|
150
|
+
}
|
151
|
+
this.value = this._store.map(s => s.value);
|
152
|
+
this.text = this._store.map(s => s.text).join(", ");
|
153
|
+
}
|
154
|
+
else {
|
155
|
+
if (this.value === value) {
|
156
|
+
this.value = "";
|
157
|
+
this.text = "";
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
this.value = value;
|
161
|
+
this.text = text;
|
162
|
+
operation = 1;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.namevalue() }));
|
166
|
+
this.filter();
|
167
|
+
return operation;
|
168
|
+
}
|
169
|
+
filter(query) {
|
170
|
+
query = query?.trim();
|
171
|
+
[...this.children].forEach((element) => {
|
172
|
+
this.filterCallback(element, !query
|
173
|
+
|| contain(this.optionValue(element), query)
|
174
|
+
|| contain(element.textContent, query), query);
|
175
|
+
});
|
176
|
+
}
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
178
|
+
filterCallback(element, match, query) {
|
179
|
+
element.style.display = match ? "" : "none";
|
180
|
+
}
|
181
|
+
_handleInput(e) {
|
182
|
+
e.stopPropagation();
|
183
|
+
if (this.compositing) {
|
184
|
+
return;
|
185
|
+
}
|
186
|
+
const s = this._input.value;
|
187
|
+
this.filter(this.multiple ? betweenAt(this._input.selectionStart, s, ",") : s);
|
188
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.namevalue() }));
|
189
|
+
}
|
190
|
+
focus(options) {
|
191
|
+
this._input.focus(options);
|
192
|
+
this.visible = true;
|
193
|
+
}
|
194
|
+
blur() {
|
195
|
+
this._input.blur();
|
196
|
+
this.visible = false;
|
197
|
+
}
|
198
|
+
optionValue(option) {
|
199
|
+
return option.value || option.getAttribute("value") || "";
|
200
|
+
}
|
201
|
+
};
|
202
|
+
__decorate([
|
203
|
+
property({ type: Boolean, reflect: true })
|
204
|
+
], Select.prototype, "open", void 0);
|
205
|
+
__decorate([
|
206
|
+
property()
|
207
|
+
], Select.prototype, "text", void 0);
|
208
|
+
__decorate([
|
209
|
+
part("content")
|
210
|
+
], Select.prototype, "_content", void 0);
|
211
|
+
__decorate([
|
212
|
+
property({ type: Boolean })
|
213
|
+
], Select.prototype, "visible", void 0);
|
214
|
+
__decorate([
|
215
|
+
property()
|
216
|
+
], Select.prototype, "direction", void 0);
|
217
|
+
__decorate([
|
218
|
+
property({ type: Boolean })
|
219
|
+
], Select.prototype, "multiple", void 0);
|
220
|
+
Select = __decorate([
|
221
|
+
godown(protoName),
|
222
|
+
styles(css `
|
223
|
+
[part="input"] {
|
224
|
+
text-overflow: ellipsis;
|
225
|
+
}
|
226
|
+
|
227
|
+
[part="content"] {
|
228
|
+
position: absolute;
|
229
|
+
width: 100%;
|
230
|
+
visibility: hidden;
|
231
|
+
}
|
232
|
+
|
233
|
+
[direction="bottom"] {
|
234
|
+
top: 100%;
|
235
|
+
}
|
236
|
+
|
237
|
+
[direction="top"] {
|
238
|
+
bottom: 100%;
|
239
|
+
}
|
240
|
+
`)
|
241
|
+
], Select);
|
242
|
+
export default Select;
|
243
|
+
//# sourceMappingURL=select.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/components/select.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,E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AAsB;QAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,WAAW,CAAC,MAAmB;QAC7B,OAAQ,MAAc,CAAC,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrE,CAAC;CACF,CAAA;AAxLC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oCAC9B;AAMb;IADC,QAAQ,EAAE;oCACE;AAGb;IADC,IAAI,CAAC,SAAS,CAAC;wCACM;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCACX;AAGjB;IADC,QAAQ,EAAE;yCAC6B;AAGxC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACV;AA3Bd,MAAM;IAtBX,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;GAkBF,CACF;GACK,MAAM,CAiMX;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { GlobalStyle } from "../core/global-style.js";
|
2
|
+
/**
|
3
|
+
* {@linkcode Skeleton} renders a skeleton screen.
|
4
|
+
*
|
5
|
+
* @slot loading - The content if loading is true.
|
6
|
+
* @slot - The content if loading is false.
|
7
|
+
* @category feedback
|
8
|
+
*/
|
9
|
+
declare class Skeleton extends GlobalStyle {
|
10
|
+
/**
|
11
|
+
* If "image", render a image placeholder.
|
12
|
+
*/
|
13
|
+
type: "text" | "image";
|
14
|
+
/**
|
15
|
+
* Animation type.
|
16
|
+
* opacity animation only effect on slotted element and image icon.
|
17
|
+
*/
|
18
|
+
animation: "position" | "opacity";
|
19
|
+
/**
|
20
|
+
* If false, render slot only.
|
21
|
+
*/
|
22
|
+
loading: boolean;
|
23
|
+
protected render(): import("lit").TemplateResult<1>;
|
24
|
+
}
|
25
|
+
export default Skeleton;
|
26
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKlF;;;;;;GAMG;AACH,cAoEM,QAAS,SAAQ,WAAW;IAChC;;OAEG;IAEH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB;;;OAGG;IAEH,SAAS,EAAE,UAAU,GAAG,SAAS,CAAc;IAC/C;;OAEG;IAEH,OAAO,UAAQ;IAEf,SAAS,CAAC,MAAM;CAQjB;AAED,eAAe,QAAQ,CAAC"}
|