godown 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{deps.d.ts → .deps.d.ts} +1 -1
- package/.deps.d.ts.map +1 -0
- package/{deps.js → .deps.js} +1 -1
- package/.deps.js.map +1 -0
- package/README.md +166 -43
- package/a.d.ts +2 -0
- package/a.d.ts.map +1 -0
- package/a.js +2 -0
- package/a.js.map +1 -0
- package/alert.d.ts +2 -0
- package/alert.d.ts.map +1 -0
- package/alert.js +2 -0
- package/alert.js.map +1 -0
- package/avatar-group.js.map +1 -1
- package/avatar.d.ts +2 -0
- package/avatar.d.ts.map +1 -0
- package/avatar.js +2 -0
- package/avatar.js.map +1 -0
- package/button.d.ts +2 -0
- package/button.d.ts.map +1 -0
- package/button.js +2 -0
- package/button.js.map +1 -0
- package/card.d.ts +2 -0
- package/card.d.ts.map +1 -0
- package/card.js +2 -0
- package/card.js.map +1 -0
- package/carousel.d.ts +2 -0
- package/carousel.d.ts.map +1 -0
- package/carousel.js +2 -0
- package/carousel.js.map +1 -0
- package/clip.d.ts +2 -0
- package/clip.d.ts.map +1 -0
- package/clip.js +2 -0
- package/clip.js.map +1 -0
- package/conf.d.ts +23 -3
- package/conf.d.ts.map +1 -1
- package/conf.js +19 -16
- package/conf.js.map +1 -1
- package/decorators/define.d.ts +7 -0
- package/decorators/define.d.ts.map +1 -0
- package/decorators/define.js +11 -0
- package/decorators/define.js.map +1 -0
- package/details-group.js.map +1 -1
- package/details.d.ts +2 -0
- package/details.d.ts.map +1 -0
- package/details.js +2 -0
- package/details.js.map +1 -0
- package/dialog.d.ts +2 -0
- package/dialog.d.ts.map +1 -0
- package/dialog.js +2 -0
- package/dialog.js.map +1 -0
- package/divider.d.ts +2 -0
- package/divider.d.ts.map +1 -0
- package/divider.js +2 -0
- package/divider.js.map +1 -0
- package/dragbox.d.ts +2 -0
- package/dragbox.d.ts.map +1 -0
- package/dragbox.js +2 -0
- package/dragbox.js.map +1 -0
- package/flex-flow.js.map +1 -1
- package/form.d.ts +2 -0
- package/form.d.ts.map +1 -0
- package/form.js +2 -0
- package/form.js.map +1 -0
- package/godown-element.d.ts +1 -1
- package/godown-element.d.ts.map +1 -1
- package/godown-element.js +12 -4
- package/godown-element.js.map +1 -1
- package/input.d.ts +2 -0
- package/input.d.ts.map +1 -0
- package/input.js +2 -0
- package/input.js.map +1 -0
- package/label-input.js.map +1 -1
- package/lib/directives.d.ts +2 -4
- package/lib/directives.d.ts.map +1 -1
- package/lib/directives.js.map +1 -1
- package/lib/event-collection.d.ts +1 -1
- package/lib/event-collection.d.ts.map +1 -1
- package/lib/utils.d.ts +2 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +11 -7
- package/lib/utils.js.map +1 -1
- package/naming.d.ts +91 -0
- package/naming.d.ts.map +1 -0
- package/naming.js +67 -0
- package/naming.js.map +1 -0
- package/nav-layout.js.map +1 -1
- package/open-offset.d.ts +1 -1
- package/open-offset.d.ts.map +1 -1
- package/open-offset.js +1 -1
- package/open-offset.js.map +1 -1
- package/overbreath.d.ts +2 -0
- package/overbreath.d.ts.map +1 -0
- package/overbreath.js +2 -0
- package/overbreath.js.map +1 -0
- package/package.json +29 -35
- package/progress.d.ts +2 -0
- package/progress.d.ts.map +1 -0
- package/progress.js +2 -0
- package/progress.js.map +1 -0
- package/react/index.d.ts +24 -27
- package/react/index.d.ts.map +1 -1
- package/react/index.js +51 -61
- package/react/index.js.map +1 -1
- package/router-a.d.ts +2 -0
- package/router-a.d.ts.map +1 -0
- package/router-a.js +2 -0
- package/router-a.js.map +1 -0
- package/router.d.ts +2 -0
- package/router.d.ts.map +1 -0
- package/router.js +2 -0
- package/router.js.map +1 -0
- package/search-input.js.map +1 -1
- package/select-input.js.map +1 -1
- package/skeleton.d.ts +2 -0
- package/skeleton.d.ts.map +1 -0
- package/skeleton.js +2 -0
- package/skeleton.js.map +1 -0
- package/split-input.js.map +1 -1
- package/supers/anchor.d.ts +21 -0
- package/supers/anchor.d.ts.map +1 -0
- package/{web-components/a/super-a.js → supers/anchor.js} +11 -21
- package/supers/anchor.js.map +1 -0
- package/supers/input.d.ts +28 -0
- package/supers/input.d.ts.map +1 -0
- package/supers/input.js +117 -0
- package/supers/input.js.map +1 -0
- package/{web-components/open/open.d.ts → supers/openable.d.ts} +6 -6
- package/supers/openable.d.ts.map +1 -0
- package/{web-components/open/open.js → supers/openable.js} +11 -11
- package/supers/openable.js.map +1 -0
- package/supers/root.d.ts +18 -0
- package/supers/root.d.ts.map +1 -0
- package/{root.js → supers/root.js} +4 -11
- package/supers/root.js.map +1 -0
- package/switch-input.js.map +1 -1
- package/tabs.d.ts +2 -0
- package/tabs.d.ts.map +1 -0
- package/tabs.js +2 -0
- package/tabs.js.map +1 -0
- package/time.d.ts +2 -0
- package/time.d.ts.map +1 -0
- package/time.js +2 -0
- package/time.js.map +1 -0
- package/tooltip.d.ts +2 -0
- package/tooltip.d.ts.map +1 -0
- package/tooltip.js +2 -0
- package/tooltip.js.map +1 -0
- package/typewriter.d.ts +2 -0
- package/typewriter.d.ts.map +1 -0
- package/typewriter.js +2 -0
- package/typewriter.js.map +1 -0
- package/web-components/a/a.d.ts +16 -0
- package/web-components/a/a.d.ts.map +1 -0
- package/web-components/a/a.js +17 -0
- package/web-components/a/a.js.map +1 -0
- package/web-components/{items/alert-item.d.ts → alert/alert.d.ts} +8 -7
- package/web-components/alert/alert.d.ts.map +1 -0
- package/web-components/{items/alert-item.js → alert/alert.js} +18 -17
- package/web-components/alert/alert.js.map +1 -0
- package/web-components/{a/avatar-a.d.ts → avatar/avatar.d.ts} +9 -8
- package/web-components/avatar/avatar.d.ts.map +1 -0
- package/web-components/{a/avatar-a.js → avatar/avatar.js} +20 -19
- package/web-components/avatar/avatar.js.map +1 -0
- package/web-components/button/{base-button.d.ts → button.d.ts} +7 -6
- package/web-components/button/button.d.ts.map +1 -0
- package/web-components/button/{base-button.js → button.js} +21 -20
- package/web-components/button/button.js.map +1 -0
- package/web-components/{items/card-item.d.ts → card/card.d.ts} +8 -7
- package/web-components/card/card.d.ts.map +1 -0
- package/web-components/{items/card-item.js → card/card.js} +15 -14
- package/web-components/card/card.js.map +1 -0
- package/web-components/carousel/{carousel-slider.d.ts → carousel.d.ts} +7 -6
- package/web-components/carousel/carousel.d.ts.map +1 -0
- package/web-components/carousel/{carousel-slider.js → carousel.js} +16 -16
- package/web-components/carousel/carousel.js.map +1 -0
- package/web-components/{open/open-details.d.ts → details/details.d.ts} +8 -7
- package/web-components/details/details.d.ts.map +1 -0
- package/web-components/{open/open-details.js → details/details.js} +17 -16
- package/web-components/details/details.js.map +1 -0
- package/web-components/{open/open-dialog.d.ts → dialog/dialog.d.ts} +8 -7
- package/web-components/dialog/dialog.d.ts.map +1 -0
- package/web-components/{open/open-dialog.js → dialog/dialog.js} +19 -18
- package/web-components/dialog/dialog.js.map +1 -0
- package/web-components/form/{base-form.d.ts → form.d.ts} +8 -7
- package/web-components/form/form.d.ts.map +1 -0
- package/web-components/form/{base-form.js → form.js} +16 -15
- package/web-components/form/form.js.map +1 -0
- package/web-components/group/avatar-group.d.ts +6 -5
- package/web-components/group/avatar-group.d.ts.map +1 -1
- package/web-components/group/avatar-group.js +8 -7
- package/web-components/group/avatar-group.js.map +1 -1
- package/web-components/group/details-group.d.ts +3 -2
- package/web-components/group/details-group.d.ts.map +1 -1
- package/web-components/group/details-group.js +4 -3
- package/web-components/group/details-group.js.map +1 -1
- package/web-components/index.d.ts +24 -27
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +24 -28
- package/web-components/index.js.map +1 -1
- package/web-components/input/input.d.ts +44 -22
- package/web-components/input/input.d.ts.map +1 -1
- package/web-components/input/input.js +210 -80
- package/web-components/input/input.js.map +1 -1
- package/web-components/input/label-input.d.ts +5 -4
- package/web-components/input/label-input.d.ts.map +1 -1
- package/web-components/input/label-input.js +7 -6
- package/web-components/input/label-input.js.map +1 -1
- package/web-components/input/search-input.d.ts +5 -4
- package/web-components/input/search-input.d.ts.map +1 -1
- package/web-components/input/search-input.js +7 -6
- package/web-components/input/search-input.js.map +1 -1
- package/web-components/input/select-input.d.ts +5 -4
- package/web-components/input/select-input.d.ts.map +1 -1
- package/web-components/input/select-input.js +7 -6
- package/web-components/input/select-input.js.map +1 -1
- package/web-components/input/split-input.d.ts +5 -4
- package/web-components/input/split-input.d.ts.map +1 -1
- package/web-components/input/split-input.js +7 -6
- package/web-components/input/split-input.js.map +1 -1
- package/web-components/input/switch-input.d.ts +5 -4
- package/web-components/input/switch-input.d.ts.map +1 -1
- package/web-components/input/switch-input.js +7 -6
- package/web-components/input/switch-input.js.map +1 -1
- package/web-components/layout/{divider-line.d.ts → divider.d.ts} +7 -6
- package/web-components/layout/divider.d.ts.map +1 -0
- package/web-components/layout/{divider-line.js → divider.js} +13 -12
- package/web-components/layout/divider.js.map +1 -0
- package/web-components/layout/flex-flow.d.ts +3 -2
- package/web-components/layout/flex-flow.d.ts.map +1 -1
- package/web-components/layout/flex-flow.js +4 -3
- package/web-components/layout/flex-flow.js.map +1 -1
- package/web-components/layout/nav-layout.d.ts +14 -6
- package/web-components/layout/nav-layout.d.ts.map +1 -1
- package/web-components/layout/nav-layout.js +26 -95
- package/web-components/layout/nav-layout.js.map +1 -1
- package/web-components/{open → offset}/open-offset.d.ts +5 -4
- package/web-components/offset/open-offset.d.ts.map +1 -0
- package/web-components/{open → offset}/open-offset.js +5 -5
- package/web-components/offset/open-offset.js.map +1 -0
- package/web-components/{loading/loading-progress.d.ts → progress/progress.d.ts} +8 -7
- package/web-components/progress/progress.d.ts.map +1 -0
- package/web-components/{loading/loading-progress.js → progress/progress.js} +15 -14
- package/web-components/progress/progress.js.map +1 -0
- package/web-components/{a/link-a.d.ts → router/router-a.d.ts} +9 -8
- package/web-components/router/router-a.d.ts.map +1 -0
- package/web-components/{a/link-a.js → router/router-a.js} +21 -21
- package/web-components/router/router-a.js.map +1 -0
- package/web-components/{view/route-view.d.ts → router/router.d.ts} +10 -9
- package/web-components/router/router.d.ts.map +1 -0
- package/web-components/{view/route-view.js → router/router.js} +21 -21
- package/web-components/router/router.js.map +1 -0
- package/web-components/{loading/skeleton-screen.d.ts → skeleton/skeleton.d.ts} +8 -7
- package/web-components/skeleton/skeleton.d.ts.map +1 -0
- package/web-components/{loading/skeleton-screen.js → skeleton/skeleton.js} +15 -14
- package/web-components/skeleton/skeleton.js.map +1 -0
- package/web-components/{group/tab-group.d.ts → tabs/tabs.d.ts} +9 -8
- package/web-components/tabs/tabs.d.ts.map +1 -0
- package/web-components/{group/tab-group.js → tabs/tabs.js} +17 -16
- package/web-components/tabs/tabs.js.map +1 -0
- package/web-components/text/clip.d.ts +21 -0
- package/web-components/text/clip.d.ts.map +1 -0
- package/web-components/text/{clip-text.js → clip.js} +13 -12
- package/web-components/text/clip.js.map +1 -0
- package/web-components/text/{overbreath-text.d.ts → overbreath.d.ts} +6 -6
- package/web-components/text/overbreath.d.ts.map +1 -0
- package/web-components/text/{overbreath-text.js → overbreath.js} +14 -13
- package/web-components/text/overbreath.js.map +1 -0
- package/web-components/{items/time-bar.d.ts → text/time.d.ts} +7 -7
- package/web-components/text/time.d.ts.map +1 -0
- package/web-components/{items/time-bar.js → text/time.js} +19 -18
- package/web-components/text/time.js.map +1 -0
- package/web-components/text/{typewriter-text.d.ts → typewriter.d.ts} +8 -8
- package/web-components/text/typewriter.d.ts.map +1 -0
- package/web-components/text/{typewriter-text.js → typewriter.js} +22 -21
- package/web-components/text/typewriter.js.map +1 -0
- package/web-components/tooltip/tooltip.d.ts +25 -0
- package/web-components/tooltip/tooltip.d.ts.map +1 -0
- package/web-components/{open/open-tooltip.js → tooltip/tooltip.js} +15 -14
- package/web-components/tooltip/tooltip.js.map +1 -0
- package/web-components/{items/drag-box.d.ts → wrapper/dragbox.d.ts} +7 -6
- package/web-components/wrapper/dragbox.d.ts.map +1 -0
- package/web-components/{items/drag-box.js → wrapper/dragbox.js} +14 -13
- package/web-components/wrapper/dragbox.js.map +1 -0
- package/web-components/{view/wrap-view.d.ts → wrapper/wrapper.d.ts} +6 -5
- package/web-components/wrapper/wrapper.d.ts.map +1 -0
- package/web-components/{view/wrap-view.js → wrapper/wrapper.js} +13 -12
- package/web-components/wrapper/wrapper.js.map +1 -0
- package/wrapper.d.ts +2 -0
- package/wrapper.d.ts.map +1 -0
- package/wrapper.js +2 -0
- package/wrapper.js.map +1 -0
- package/alert-item.d.ts +0 -2
- package/alert-item.d.ts.map +0 -1
- package/alert-item.js +0 -2
- package/alert-item.js.map +0 -1
- package/avatar-a.d.ts +0 -2
- package/avatar-a.d.ts.map +0 -1
- package/avatar-a.js +0 -2
- package/avatar-a.js.map +0 -1
- package/base-button.d.ts +0 -2
- package/base-button.d.ts.map +0 -1
- package/base-button.js +0 -2
- package/base-button.js.map +0 -1
- package/base-form.d.ts +0 -2
- package/base-form.d.ts.map +0 -1
- package/base-form.js +0 -2
- package/base-form.js.map +0 -1
- package/base-input.d.ts +0 -2
- package/base-input.d.ts.map +0 -1
- package/base-input.js +0 -2
- package/base-input.js.map +0 -1
- package/card-item.d.ts +0 -2
- package/card-item.d.ts.map +0 -1
- package/card-item.js +0 -2
- package/card-item.js.map +0 -1
- package/carousel-slider.d.ts +0 -2
- package/carousel-slider.d.ts.map +0 -1
- package/carousel-slider.js +0 -2
- package/carousel-slider.js.map +0 -1
- package/clip-text.d.ts +0 -2
- package/clip-text.d.ts.map +0 -1
- package/clip-text.js +0 -2
- package/clip-text.js.map +0 -1
- package/deps.d.ts.map +0 -1
- package/deps.js.map +0 -1
- package/divider-line.d.ts +0 -2
- package/divider-line.d.ts.map +0 -1
- package/divider-line.js +0 -2
- package/divider-line.js.map +0 -1
- package/drag-box.d.ts +0 -2
- package/drag-box.d.ts.map +0 -1
- package/drag-box.js +0 -2
- package/drag-box.js.map +0 -1
- package/link-a.d.ts +0 -2
- package/link-a.d.ts.map +0 -1
- package/link-a.js +0 -2
- package/link-a.js.map +0 -1
- package/loading-progress.d.ts +0 -2
- package/loading-progress.d.ts.map +0 -1
- package/loading-progress.js +0 -2
- package/loading-progress.js.map +0 -1
- package/nav-aside.d.ts +0 -2
- package/nav-aside.d.ts.map +0 -1
- package/nav-aside.js +0 -2
- package/nav-aside.js.map +0 -1
- package/open-details.d.ts +0 -2
- package/open-details.d.ts.map +0 -1
- package/open-details.js +0 -2
- package/open-details.js.map +0 -1
- package/open-dialog.d.ts +0 -2
- package/open-dialog.d.ts.map +0 -1
- package/open-dialog.js +0 -2
- package/open-dialog.js.map +0 -1
- package/open-tooltip.d.ts +0 -2
- package/open-tooltip.d.ts.map +0 -1
- package/open-tooltip.js +0 -2
- package/open-tooltip.js.map +0 -1
- package/overbreath-text.d.ts +0 -2
- package/overbreath-text.d.ts.map +0 -1
- package/overbreath-text.js +0 -2
- package/overbreath-text.js.map +0 -1
- package/root.d.ts +0 -23
- package/root.d.ts.map +0 -1
- package/root.js.map +0 -1
- package/route-view.d.ts +0 -2
- package/route-view.d.ts.map +0 -1
- package/route-view.js +0 -2
- package/route-view.js.map +0 -1
- package/scroll-x.d.ts +0 -2
- package/scroll-x.d.ts.map +0 -1
- package/scroll-x.js +0 -2
- package/scroll-x.js.map +0 -1
- package/sign-form.d.ts +0 -2
- package/sign-form.d.ts.map +0 -1
- package/sign-form.js +0 -2
- package/sign-form.js.map +0 -1
- package/skeleton-screen.d.ts +0 -2
- package/skeleton-screen.d.ts.map +0 -1
- package/skeleton-screen.js +0 -2
- package/skeleton-screen.js.map +0 -1
- package/super-a.d.ts +0 -2
- package/super-a.d.ts.map +0 -1
- package/super-a.js +0 -2
- package/super-a.js.map +0 -1
- package/tab-group.d.ts +0 -2
- package/tab-group.d.ts.map +0 -1
- package/tab-group.js +0 -2
- package/tab-group.js.map +0 -1
- package/time-bar.d.ts +0 -2
- package/time-bar.d.ts.map +0 -1
- package/time-bar.js +0 -2
- package/time-bar.js.map +0 -1
- package/typewriter-text.d.ts +0 -2
- package/typewriter-text.d.ts.map +0 -1
- package/typewriter-text.js +0 -2
- package/typewriter-text.js.map +0 -1
- package/web-components/a/avatar-a.d.ts.map +0 -1
- package/web-components/a/avatar-a.js.map +0 -1
- package/web-components/a/link-a.d.ts.map +0 -1
- package/web-components/a/link-a.js.map +0 -1
- package/web-components/a/super-a.d.ts +0 -31
- package/web-components/a/super-a.d.ts.map +0 -1
- package/web-components/a/super-a.js.map +0 -1
- package/web-components/button/base-button.d.ts.map +0 -1
- package/web-components/button/base-button.js.map +0 -1
- package/web-components/carousel/carousel-slider.d.ts.map +0 -1
- package/web-components/carousel/carousel-slider.js.map +0 -1
- package/web-components/form/base-form.d.ts.map +0 -1
- package/web-components/form/base-form.js.map +0 -1
- package/web-components/form/sign-form.d.ts +0 -19
- package/web-components/form/sign-form.d.ts.map +0 -1
- package/web-components/form/sign-form.js +0 -16
- package/web-components/form/sign-form.js.map +0 -1
- package/web-components/group/tab-group.d.ts.map +0 -1
- package/web-components/group/tab-group.js.map +0 -1
- package/web-components/input/base-input.d.ts +0 -49
- package/web-components/input/base-input.d.ts.map +0 -1
- package/web-components/input/base-input.js +0 -246
- package/web-components/input/base-input.js.map +0 -1
- package/web-components/items/alert-item.d.ts.map +0 -1
- package/web-components/items/alert-item.js.map +0 -1
- package/web-components/items/card-item.d.ts.map +0 -1
- package/web-components/items/card-item.js.map +0 -1
- package/web-components/items/drag-box.d.ts.map +0 -1
- package/web-components/items/drag-box.js.map +0 -1
- package/web-components/items/index.d.ts +0 -5
- package/web-components/items/index.d.ts.map +0 -1
- package/web-components/items/index.js +0 -6
- package/web-components/items/index.js.map +0 -1
- package/web-components/items/time-bar.d.ts.map +0 -1
- package/web-components/items/time-bar.js.map +0 -1
- package/web-components/layout/divider-line.d.ts.map +0 -1
- package/web-components/layout/divider-line.js.map +0 -1
- package/web-components/layout/nav-aside.d.ts +0 -25
- package/web-components/layout/nav-aside.d.ts.map +0 -1
- package/web-components/layout/nav-aside.js +0 -70
- package/web-components/layout/nav-aside.js.map +0 -1
- package/web-components/loading/loading-progress.d.ts.map +0 -1
- package/web-components/loading/loading-progress.js.map +0 -1
- package/web-components/loading/skeleton-screen.d.ts.map +0 -1
- package/web-components/loading/skeleton-screen.js.map +0 -1
- package/web-components/open/open-details.d.ts.map +0 -1
- package/web-components/open/open-details.js.map +0 -1
- package/web-components/open/open-dialog.d.ts.map +0 -1
- package/web-components/open/open-dialog.js.map +0 -1
- package/web-components/open/open-offset.d.ts.map +0 -1
- package/web-components/open/open-offset.js.map +0 -1
- package/web-components/open/open-tooltip.d.ts +0 -24
- package/web-components/open/open-tooltip.d.ts.map +0 -1
- package/web-components/open/open-tooltip.js.map +0 -1
- package/web-components/open/open.d.ts.map +0 -1
- package/web-components/open/open.js.map +0 -1
- package/web-components/text/clip-text.d.ts +0 -21
- package/web-components/text/clip-text.d.ts.map +0 -1
- package/web-components/text/clip-text.js.map +0 -1
- package/web-components/text/overbreath-text.d.ts.map +0 -1
- package/web-components/text/overbreath-text.js.map +0 -1
- package/web-components/text/typewriter-text.d.ts.map +0 -1
- package/web-components/text/typewriter-text.js.map +0 -1
- package/web-components/view/route-view.d.ts.map +0 -1
- package/web-components/view/route-view.js.map +0 -1
- package/web-components/view/scroll-x.d.ts +0 -25
- package/web-components/view/scroll-x.d.ts.map +0 -1
- package/web-components/view/scroll-x.js +0 -97
- package/web-components/view/scroll-x.js.map +0 -1
- package/web-components/view/wrap-view.d.ts.map +0 -1
- package/web-components/view/wrap-view.js.map +0 -1
- package/wrap-view.d.ts +0 -2
- package/wrap-view.d.ts.map +0 -1
- package/wrap-view.js +0 -2
- package/wrap-view.js.map +0 -1
@@ -1,45 +1,28 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html
|
2
|
+
import { css, html } from "../../.deps.js";
|
3
|
+
import { define } from "../../decorators/define.js";
|
3
4
|
import { htmlSlot } from "../../lib/templates.js";
|
4
|
-
import { createScope, cssvarValues,
|
5
|
+
import { createScope, cssvarValues, GodownElement } from "../../supers/root.js";
|
5
6
|
const defineName = "nav-layout";
|
6
7
|
const cssvarScope = createScope(defineName);
|
7
8
|
/**
|
8
|
-
* NavLayout renders a navigation, an optional top header, an optional bottom footer.
|
9
|
+
* {@linkcode NavLayout} renders a navigation, an optional top header, an optional bottom footer.
|
10
|
+
*
|
11
|
+
* @slot - The main content of the layout.
|
12
|
+
*
|
13
|
+
* @slot nav - The navigation of the layout.
|
14
|
+
*
|
15
|
+
* @slot header - The header of the layout.
|
16
|
+
*
|
17
|
+
* @slot footer - The footer of the layout.
|
9
18
|
*/
|
10
19
|
let NavLayout = class NavLayout extends GodownElement {
|
11
|
-
constructor() {
|
12
|
-
super(...arguments);
|
13
|
-
/**
|
14
|
-
* Main heading.
|
15
|
-
*/
|
16
|
-
this.host = "";
|
17
|
-
/**
|
18
|
-
* Subheading.
|
19
|
-
*/
|
20
|
-
this.subhead = "";
|
21
|
-
}
|
22
20
|
render() {
|
23
|
-
return html
|
21
|
+
return html `${htmlSlot("header")}
|
22
|
+
<nav>${htmlSlot("nav")}</nav>
|
24
23
|
<main>${htmlSlot()}</main>
|
25
24
|
${htmlSlot("footer")}`;
|
26
25
|
}
|
27
|
-
renderNav() {
|
28
|
-
if (this.querySelector("[slot=nav]")) {
|
29
|
-
return htmlSlot("nav");
|
30
|
-
}
|
31
|
-
return html `<nav>
|
32
|
-
<h1>
|
33
|
-
<slot name="host"></slot>
|
34
|
-
<a href="/">${this.host}</a>${this.subhead &&
|
35
|
-
html `<span></span>
|
36
|
-
<div>${this.subhead}</div>`}
|
37
|
-
</h1>
|
38
|
-
<div>
|
39
|
-
<slot name="opt"></slot>
|
40
|
-
</div>
|
41
|
-
</nav>`;
|
42
|
-
}
|
43
26
|
};
|
44
27
|
NavLayout.styles = [
|
45
28
|
GodownElement.styles,
|
@@ -47,89 +30,37 @@ NavLayout.styles = [
|
|
47
30
|
:host {
|
48
31
|
${cssvarScope}--text: var(${cssvarValues.text});
|
49
32
|
${cssvarScope}--background: var(${cssvarValues.main});
|
50
|
-
${cssvarScope}--
|
51
|
-
${cssvarScope}--
|
52
|
-
${cssvarScope}--
|
33
|
+
${cssvarScope}--nav-height: 2.4em;
|
34
|
+
${cssvarScope}--title-font-size: 1.4em;
|
35
|
+
${cssvarScope}--nav-padding: 0 2.5%;
|
36
|
+
${cssvarScope}--main-flex: 1;
|
37
|
+
${cssvarScope}--main-padding: 0;
|
53
38
|
width: 100%;
|
54
39
|
height: 100%;
|
55
|
-
display: flex;
|
56
|
-
flex-
|
40
|
+
display: flex !important;
|
41
|
+
flex-direction: column;
|
57
42
|
justify-content: space-between;
|
58
43
|
align-items: center;
|
59
44
|
min-height: 100%;
|
45
|
+
color: var(${cssvarScope}--text);
|
60
46
|
}
|
61
47
|
|
62
48
|
nav {
|
63
49
|
color: var(${cssvarScope}--text);
|
64
50
|
background: var(${cssvarScope}--background);
|
65
|
-
|
66
|
-
|
67
|
-
nav {
|
68
|
-
height: var(${cssvarScope}--height);
|
69
|
-
min-height: var(${cssvarScope}--height);
|
70
|
-
display: flex;
|
71
|
-
justify-content: space-between;
|
72
|
-
align-items: center;
|
51
|
+
padding: var(${cssvarScope}--nav-padding);
|
52
|
+
height: var(${cssvarScope}--nav-height);
|
73
53
|
width: 100%;
|
74
|
-
padding: 0 2.5%;
|
75
|
-
box-sizing: border-box;
|
76
|
-
margin: auto;
|
77
54
|
position: relative;
|
78
|
-
z-index: 2;
|
79
|
-
}
|
80
|
-
|
81
|
-
a {
|
82
|
-
text-decoration: none;
|
83
|
-
color: currentColor;
|
84
|
-
}
|
85
|
-
|
86
|
-
h1 {
|
87
|
-
font-weight: normal;
|
88
|
-
font-size: var(${cssvarScope}--h1-size);
|
89
|
-
margin: 0;
|
90
|
-
display: flex;
|
91
|
-
align-items: center;
|
92
|
-
}
|
93
|
-
|
94
|
-
h1 span {
|
95
|
-
height: 1em;
|
96
|
-
width: 0.1em;
|
97
|
-
background: currentColor;
|
98
|
-
margin: 0.24em;
|
99
|
-
}
|
100
|
-
|
101
|
-
h1 > * {
|
102
|
-
white-space: nowrap;
|
103
55
|
}
|
104
56
|
|
105
57
|
main {
|
106
|
-
flex: 1;
|
107
|
-
width: inherit;
|
108
|
-
display: flex;
|
109
|
-
flex-direction: column;
|
110
|
-
z-index: 1;
|
111
58
|
position: relative;
|
112
|
-
|
113
|
-
|
114
|
-
nav > div {
|
115
|
-
height: 100%;
|
116
|
-
display: flex;
|
117
|
-
flex-direction: row;
|
118
|
-
}
|
119
|
-
|
120
|
-
@media screen and (max-width: 540px) {
|
121
|
-
h1 a ~ * {
|
122
|
-
display: none;
|
123
|
-
}
|
59
|
+
flex: 1;
|
60
|
+
width: 100%;
|
124
61
|
}
|
125
62
|
`,
|
126
63
|
];
|
127
|
-
__decorate([
|
128
|
-
property()
|
129
|
-
], NavLayout.prototype, "host", void 0);
|
130
|
-
__decorate([
|
131
|
-
property()
|
132
|
-
], NavLayout.prototype, "subhead", void 0);
|
133
64
|
NavLayout = __decorate([
|
134
65
|
define(defineName)
|
135
66
|
], NavLayout);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nav-layout.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/nav-layout.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"nav-layout.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/nav-layout.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;;;;;;;;;GAUG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,aAAa;IAoDhC,MAAM;QACd,OAAO,IAAI,CAAA,GAAG,QAAQ,CAAC,QAAQ,CAAC;aACvB,QAAQ,CAAC,KAAK,CAAC;cACd,QAAQ,EAAE;QAChB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC3B,CAAC;;AA3CM,gBAAM,GAAG;IACd,aAAa,CAAC,MAAM;IACpB,GAAG,CAAA;;UAEG,WAAW,eAAe,YAAY,CAAC,IAAI;UAC3C,WAAW,qBAAqB,YAAY,CAAC,IAAI;UACjD,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;;;;;;;;qBAQA,WAAW;;;;qBAIX,WAAW;0BACN,WAAW;uBACd,WAAW;sBACZ,WAAW;;;;;;;;;;KAU5B;CACgB,AApCN,CAoCO;AAlDT,SAAS;IADrB,MAAM,CAAC,UAAU,CAAC;GACN,SAAS,CA0DrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["import { css, type CSSResultGroup, html } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"nav-layout\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode NavLayout} renders a navigation, an optional top header, an optional bottom footer.\n *\n * @slot - The main content of the layout.\n *\n * @slot nav - The navigation of the layout.\n *\n * @slot header - The header of the layout.\n *\n * @slot footer - The footer of the layout.\n */\n@define(defineName)\nexport class NavLayout extends GodownElement {\n /**\n * @deprecated\n */\n host: string;\n /**\n * @deprecated\n */\n subhead: string;\n /**\n * @deprecated\n */\n set: 0 | 1 | 2;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n ${cssvarScope}--text: var(${cssvarValues.text});\n ${cssvarScope}--background: var(${cssvarValues.main});\n ${cssvarScope}--nav-height: 2.4em;\n ${cssvarScope}--title-font-size: 1.4em;\n ${cssvarScope}--nav-padding: 0 2.5%;\n ${cssvarScope}--main-flex: 1;\n ${cssvarScope}--main-padding: 0;\n width: 100%;\n height: 100%;\n display: flex !important;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n min-height: 100%;\n color: var(${cssvarScope}--text);\n }\n\n nav {\n color: var(${cssvarScope}--text);\n background: var(${cssvarScope}--background);\n padding: var(${cssvarScope}--nav-padding);\n height: var(${cssvarScope}--nav-height);\n width: 100%;\n position: relative;\n }\n\n main {\n position: relative;\n flex: 1;\n width: 100%;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`${htmlSlot(\"header\")}\n <nav>${htmlSlot(\"nav\")}</nav>\n <main>${htmlSlot()}</main>\n ${htmlSlot(\"footer\")}`;\n }\n}\n\nexport default NavLayout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nav-layout\": NavLayout;\n \"g-nav-layout\": NavLayout;\n }\n}\n"]}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { type CSSResultGroup } from "
|
1
|
+
import { type CSSResultGroup } from "../../.deps.js";
|
2
2
|
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
-
import { type Direction4,
|
3
|
+
import { type Direction4, GodownOpenable } from "../../supers/openable.js";
|
4
4
|
/**
|
5
|
-
* OpenOffset will calculate a lateral offset to try to keep the content within the allowable range.
|
5
|
+
* {@linkcode OpenOffset} will calculate a lateral offset to try to keep the content within the allowable range.
|
6
6
|
*
|
7
7
|
* Content can be opened in 4 directions.
|
8
8
|
*/
|
9
|
-
export declare class OpenOffset extends
|
9
|
+
export declare class OpenOffset extends GodownOpenable {
|
10
10
|
direction: Direction4;
|
11
11
|
private _balancer;
|
12
12
|
static styles: CSSResultGroup;
|
@@ -21,6 +21,7 @@ export default OpenOffset;
|
|
21
21
|
declare global {
|
22
22
|
interface HTMLElementTagNameMap {
|
23
23
|
"open-offset": OpenOffset;
|
24
|
+
"g-open-offset": OpenOffset;
|
24
25
|
}
|
25
26
|
}
|
26
27
|
//# sourceMappingURL=open-offset.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"open-offset.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/offset/open-offset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,KAAK,UAAU,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI3E;;;;GAIG;AACH,qBACa,UAAW,SAAQ,cAAc;IAC5C,SAAS,EAAE,UAAU,CAAC;IAEN,OAAO,CAAC,SAAS,CAAc;IAE/C,MAAM,CAAC,MAAM,iBAiDO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAOhC,iBAAiB;cAKD,YAAY;IAM5B,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAQpC,SAAS,CAAC,aAAa;IAKvB,MAAM;CA2BP;AAED,eAAe,UAAU,CAAC;AAE1B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;QAC1B,eAAe,EAAE,UAAU,CAAC;KAC7B;CACF"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html, query } from "
|
2
|
+
import { css, html, query } from "../../.deps.js";
|
3
|
+
import { define } from "../../decorators/define.js";
|
3
4
|
import { htmlSlot } from "../../lib/templates.js";
|
4
5
|
import { debounce } from "../../lib/utils.js";
|
5
|
-
import {
|
6
|
-
import { OpenableElement } from "./open.js";
|
6
|
+
import { GodownOpenable } from "../../supers/openable.js";
|
7
7
|
const defineName = "open-offset";
|
8
8
|
/**
|
9
|
-
* OpenOffset will calculate a lateral offset to try to keep the content within the allowable range.
|
9
|
+
* {@linkcode OpenOffset} will calculate a lateral offset to try to keep the content within the allowable range.
|
10
10
|
*
|
11
11
|
* Content can be opened in 4 directions.
|
12
12
|
*/
|
13
|
-
let OpenOffset = class OpenOffset extends
|
13
|
+
let OpenOffset = class OpenOffset extends GodownOpenable {
|
14
14
|
render() {
|
15
15
|
return html `<main class="${this.direction || "bottom"}">
|
16
16
|
<span>${this.summary || htmlSlot("summary")}</span>
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"open-offset.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/offset/open-offset.ts"],"names":[],"mappings":"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","sourcesContent":["import { css, type CSSResultGroup, html, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { debounce } from \"../../lib/utils.js\";\nimport { type Direction4, GodownOpenable } from \"../../supers/openable.js\";\n\nconst defineName = \"open-offset\";\n\n/**\n * {@linkcode OpenOffset} will calculate a lateral offset to try to keep the content within the allowable range.\n *\n * Content can be opened in 4 directions.\n */\n@define(defineName)\nexport class OpenOffset extends GodownOpenable {\n direction: Direction4;\n\n @query(\"aside\") private _balancer: HTMLElement;\n\n static styles = [\n css`\n :host {\n display: block;\n height: fit-content;\n width: fit-content;\n }\n\n span {\n user-select: none;\n }\n\n main {\n height: inherit;\n width: inherit;\n display: flex;\n position: relative;\n align-items: center;\n }\n\n aside {\n background-color: inherit;\n visibility: hidden;\n top: 100%;\n z-index: 1;\n }\n\n :host([open]) aside {\n visibility: visible;\n }\n\n :host([float]) aside {\n position: absolute;\n }\n `,\n css`\n .left {\n flex-direction: row-reverse;\n }\n .right {\n flex-direction: row;\n }\n .top {\n flex-direction: column-reverse;\n }\n .bottom {\n flex-direction: column;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<main class=\"${this.direction || \"bottom\"}\">\n <span>${this.summary || htmlSlot(\"summary\")}</span>\n <aside>${htmlSlot()}</aside>\n </main>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.addEvent(window, \"resize\", debounce(this._handelResize.bind(this), 500));\n }\n\n protected async firstUpdated() {\n await this.updateComplete;\n this.addEvent(document, \"click\", this._handelClick.bind(this));\n this.resize();\n }\n\n protected _handelClick(e: MouseEvent) {\n if (e.target === this) {\n this.show();\n } else if (!this.contains(e.target as HTMLElement)) {\n this.close();\n }\n }\n\n protected _handelResize() {\n this._balancer.style.transform = \"none\";\n this.resize();\n }\n\n resize() {\n if (!this._balancer) {\n return;\n }\n const offsets = this.offsetParent?.getBoundingClientRect() || document.body.getBoundingClientRect();\n const { left, right, top, bottom, height } = this._balancer.getBoundingClientRect();\n if (this.direction === \"left\" || this.direction === \"right\") {\n if (top < offsets.y) {\n const topTranslate = -top;\n this._balancer.style.transform = `translateY(${topTranslate}px)`;\n }\n if (bottom > offsets.bottom) {\n const bottomTranslate = offsets.height - (top + height);\n this._balancer.style.transform = `translateY(${bottomTranslate}px)`;\n }\n } else {\n if (right > offsets.right) {\n const rightTranslate = offsets.width - (right - offsets.x);\n this._balancer.style.transform = `translateX(${rightTranslate}px)`;\n } else if (left < 0) {\n const leftTranslate = -left;\n this._balancer.style.transform = `translateX(${leftTranslate}px)`;\n } else {\n this._balancer.style.transform = \"\";\n }\n }\n }\n}\n\nexport default OpenOffset;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"open-offset\": OpenOffset;\n \"g-open-offset\": OpenOffset;\n }\n}\n"]}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { type CSSResultGroup } from "
|
1
|
+
import { type CSSResultGroup } from "../../.deps.js";
|
2
2
|
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
-
import { GodownElement } from "../../root.js";
|
3
|
+
import { GodownElement } from "../../supers/root.js";
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* {@linkcode Progress} similar to progress.
|
6
6
|
*/
|
7
|
-
export declare class
|
7
|
+
export declare class Progress extends GodownElement {
|
8
8
|
/**
|
9
9
|
* Maximum.
|
10
10
|
*/
|
@@ -27,10 +27,11 @@ export declare class LoadingProgress extends GodownElement {
|
|
27
27
|
*/
|
28
28
|
parsePercent(s?: string | number): number;
|
29
29
|
}
|
30
|
-
export default
|
30
|
+
export default Progress;
|
31
31
|
declare global {
|
32
32
|
interface HTMLElementTagNameMap {
|
33
|
-
"loading-progress":
|
33
|
+
"loading-progress": Progress;
|
34
|
+
"g-progress": Progress;
|
34
35
|
}
|
35
36
|
}
|
36
|
-
//# sourceMappingURL=
|
37
|
+
//# sourceMappingURL=progress.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/progress/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAkB,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAInE;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACwC,KAAK,MAAQ;IAExD,MAAM,CAAC,MAAM,iBAuCO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAYhC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,GAAE,MAAM,GAAG,MAAY,GAAG,MAAM;CAM/C;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,QAAQ,CAAC;QAC7B,YAAY,EAAE,QAAQ,CAAC;KACxB;CACF"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html, property } from "
|
3
|
-
import {
|
4
|
-
|
2
|
+
import { css, html, property } from "../../.deps.js";
|
3
|
+
import { define } from "../../decorators/define.js";
|
4
|
+
import { cssvarValues, GodownElement } from "../../supers/root.js";
|
5
|
+
const defineName = "progress";
|
5
6
|
/**
|
6
|
-
*
|
7
|
+
* {@linkcode Progress} similar to progress.
|
7
8
|
*/
|
8
|
-
let
|
9
|
+
let Progress = class Progress extends GodownElement {
|
9
10
|
constructor() {
|
10
11
|
super(...arguments);
|
11
12
|
/**
|
@@ -45,7 +46,7 @@ let LoadingProgress = class LoadingProgress extends GodownElement {
|
|
45
46
|
return (parseFloat(String(s)) / (this.max - this.min)) * 100;
|
46
47
|
}
|
47
48
|
};
|
48
|
-
|
49
|
+
Progress.styles = [
|
49
50
|
GodownElement.styles,
|
50
51
|
css `
|
51
52
|
:host,
|
@@ -87,16 +88,16 @@ LoadingProgress.styles = [
|
|
87
88
|
];
|
88
89
|
__decorate([
|
89
90
|
property({ type: Number })
|
90
|
-
],
|
91
|
+
], Progress.prototype, "max", void 0);
|
91
92
|
__decorate([
|
92
93
|
property({ type: Number })
|
93
|
-
],
|
94
|
+
], Progress.prototype, "min", void 0);
|
94
95
|
__decorate([
|
95
96
|
property({ type: Number, reflect: true })
|
96
|
-
],
|
97
|
-
|
97
|
+
], Progress.prototype, "value", void 0);
|
98
|
+
Progress = __decorate([
|
98
99
|
define(defineName)
|
99
|
-
],
|
100
|
-
export {
|
101
|
-
export default
|
102
|
-
//# sourceMappingURL=
|
100
|
+
], Progress);
|
101
|
+
export { Progress };
|
102
|
+
export default Progress;
|
103
|
+
//# sourceMappingURL=progress.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/progress/progress.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;QACpC;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;QACpC;;WAEG;QACwC,UAAK,GAAG,IAAI,CAAC;IAmE1D,CAAC;IAxBW,MAAM;QACd,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,SAAiB,CAAC;QACtB,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,SAAS,GAAG,GAAG,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAA,eAAe,SAAS;wBACf,KAAK;WAClB,CAAC;IACV,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,IAAqB,GAAG;QACnC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/D,CAAC;;AAhEM,eAAM,GAAG;IACd,aAAa,CAAC,MAAM;IACpB,GAAG,CAAA;;;;;;;;0BAQmB,YAAY,CAAC,KAAK;;;;;;;;;;0BAUlB,YAAY,CAAC,MAAM;;;;;;;;;;;;;;;;;;KAkBxC;CACgB,AAvCN,CAuCO;AAjDQ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCAAS;AAIR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCAAS;AAIO;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAc;AAZ7C,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CA+EpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { type HTMLTemplate } from \"../../lib/templates.js\";\nimport { cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"progress\";\n\n/**\n * {@linkcode Progress} similar to progress.\n */\n@define(defineName)\nexport class Progress extends GodownElement {\n /**\n * Maximum.\n */\n @property({ type: Number }) max = 1;\n /**\n * Minimum.\n */\n @property({ type: Number }) min = 0;\n /**\n * Input value.\n */\n @property({ type: Number, reflect: true }) value = null;\n\n static styles = [\n GodownElement.styles,\n css`\n :host,\n div {\n display: inline-flex;\n position: relative;\n width: 10em;\n height: 0.5em;\n border-radius: 0.25em;\n background: var(${cssvarValues.input}--false);\n z-index: 1;\n }\n\n div i {\n position: absolute;\n border-radius: inherit;\n top: 0;\n left: 0;\n height: 100%;\n background: var(${cssvarValues.cssvar}--accept);\n z-index: 2;\n transition: all 0.3s;\n animation: progress 1.5s ease-in-out infinite alternate;\n }\n\n @keyframes progress {\n from {\n left: 0;\n }\n to {\n left: 80%;\n }\n }\n\n div.v i {\n animation: none;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n let width = 20;\n let className: string;\n if (this.value !== null) {\n width = this.parsePercent(this.value);\n className = \"v\";\n }\n return html`<div class=\"${className}\">\n <i style=\"width:${width}%;\"></i>\n </div>`;\n }\n\n /**\n * Convert s to a percentage without a percent sign.\n *\n * @param s String or number to convert.\n * @returns Percentage without a percent sign.\n */\n parsePercent(s: string | number = \"0\"): number {\n if (String(s).includes(\"%\")) {\n return parseFloat(String(s));\n }\n return (parseFloat(String(s)) / (this.max - this.min)) * 100;\n }\n}\n\nexport default Progress;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"loading-progress\": Progress;\n \"g-progress\": Progress;\n }\n}\n"]}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import GodownAnchor from "../../supers/anchor.js";
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* {@linkcode RouterA} works with {@linkcode Router}.
|
4
4
|
*
|
5
|
-
* @extends
|
5
|
+
* @extends A
|
6
6
|
*/
|
7
|
-
export declare class
|
7
|
+
export declare class RouterA extends GodownAnchor {
|
8
8
|
/**
|
9
9
|
* True when the href is in the same pathname as the location.
|
10
10
|
*/
|
@@ -15,7 +15,7 @@ export declare class LinkA extends SuperA {
|
|
15
15
|
replace: boolean;
|
16
16
|
connectedCallback(): void;
|
17
17
|
/**
|
18
|
-
* Set active to true when the {@linkcode
|
18
|
+
* Set active to true when the {@linkcode RouterA.href} is in the same pathname as the location.
|
19
19
|
*/
|
20
20
|
useActive(): void;
|
21
21
|
protected _handleClick(e: MouseEvent): void;
|
@@ -24,10 +24,11 @@ export declare class LinkA extends SuperA {
|
|
24
24
|
static pushState(data: any, unused: string, url?: string): void;
|
25
25
|
static replaceState(data: any, unused: string, url?: string): void;
|
26
26
|
}
|
27
|
-
export default
|
27
|
+
export default RouterA;
|
28
28
|
declare global {
|
29
29
|
interface HTMLElementTagNameMap {
|
30
|
-
"link-a":
|
30
|
+
"link-a": RouterA;
|
31
|
+
"router-a": RouterA;
|
31
32
|
}
|
32
33
|
}
|
33
|
-
//# sourceMappingURL=
|
34
|
+
//# sourceMappingURL=router-a.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"router-a.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router-a.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAKlD;;;;GAIG;AACH,qBACa,OAAQ,SAAQ,YAAY;IACvC;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IAC0B,OAAO,UAAS;IAE7C,iBAAiB;IAOjB;;OAEG;IACH,SAAS;IAOT,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAapC,SAAS,CAAC,GAAG,SAAY,EAAE,IAAI,MAAO;IAKtC,YAAY,CAAC,GAAG,SAAY,EAAE,IAAI,MAAO;IAKzC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAKxD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAI5D;AAED,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,OAAO,CAAC;QAClB,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
var
|
1
|
+
var RouterA_1;
|
2
2
|
import { __decorate } from "tslib";
|
3
|
-
import { property } from "
|
4
|
-
import { define } from "../../
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
const defineName = "
|
3
|
+
import { property } from "../../.deps.js";
|
4
|
+
import { define } from "../../decorators/define.js";
|
5
|
+
import GodownAnchor from "../../supers/anchor.js";
|
6
|
+
import { Router } from "./router.js";
|
7
|
+
const defineName = "router-a";
|
8
8
|
/**
|
9
|
-
*
|
9
|
+
* {@linkcode RouterA} works with {@linkcode Router}.
|
10
10
|
*
|
11
|
-
* @extends
|
11
|
+
* @extends A
|
12
12
|
*/
|
13
|
-
let
|
13
|
+
let RouterA = RouterA_1 = class RouterA extends GodownAnchor {
|
14
14
|
constructor() {
|
15
15
|
super(...arguments);
|
16
16
|
/**
|
@@ -29,7 +29,7 @@ let LinkA = LinkA_1 = class LinkA extends SuperA {
|
|
29
29
|
this.useActive();
|
30
30
|
}
|
31
31
|
/**
|
32
|
-
* Set active to true when the {@linkcode
|
32
|
+
* Set active to true when the {@linkcode RouterA.href} is in the same pathname as the location.
|
33
33
|
*/
|
34
34
|
useActive() {
|
35
35
|
const url = new URL(this.href, location.href);
|
@@ -51,31 +51,31 @@ let LinkA = LinkA_1 = class LinkA extends SuperA {
|
|
51
51
|
}
|
52
52
|
}
|
53
53
|
pushState(url = this.href, data = null) {
|
54
|
-
|
54
|
+
RouterA_1.pushState(data, "", url);
|
55
55
|
this.useActive();
|
56
56
|
}
|
57
57
|
replaceState(url = this.href, data = null) {
|
58
|
-
|
58
|
+
RouterA_1.replaceState(data, "", url);
|
59
59
|
this.useActive();
|
60
60
|
}
|
61
61
|
static pushState(data, unused, url) {
|
62
62
|
history.pushState(data, unused, url);
|
63
|
-
|
63
|
+
Router.updateAll();
|
64
64
|
}
|
65
65
|
static replaceState(data, unused, url) {
|
66
66
|
history.replaceState(data, unused, url);
|
67
|
-
|
67
|
+
Router.updateAll();
|
68
68
|
}
|
69
69
|
};
|
70
70
|
__decorate([
|
71
71
|
property({ type: Boolean, reflect: true })
|
72
|
-
],
|
72
|
+
], RouterA.prototype, "active", void 0);
|
73
73
|
__decorate([
|
74
74
|
property({ type: Boolean })
|
75
|
-
],
|
76
|
-
|
75
|
+
], RouterA.prototype, "replace", void 0);
|
76
|
+
RouterA = RouterA_1 = __decorate([
|
77
77
|
define(defineName)
|
78
|
-
],
|
79
|
-
export {
|
80
|
-
export default
|
81
|
-
//# sourceMappingURL=
|
78
|
+
], RouterA);
|
79
|
+
export { RouterA };
|
80
|
+
export default RouterA;
|
81
|
+
//# sourceMappingURL=router-a.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"router-a.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router-a.ts"],"names":[],"mappings":"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","sourcesContent":["import { property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport GodownAnchor from \"../../supers/anchor.js\";\nimport { Router } from \"./router.js\";\n\nconst defineName = \"router-a\";\n\n/**\n * {@linkcode RouterA} works with {@linkcode Router}.\n *\n * @extends A\n */\n@define(defineName)\nexport class RouterA extends GodownAnchor {\n /**\n * True when the href is in the same pathname as the location.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n /**\n * If true, replaceState, or pushState.\n */\n @property({ type: Boolean }) replace = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEvent(this, \"click\", this._handleClick);\n this.addEvent(window, \"popstate\", this.useActive.bind(this));\n this.useActive();\n }\n\n /**\n * Set active to true when the {@linkcode RouterA.href} is in the same pathname as the location.\n */\n useActive() {\n const url = new URL(this.href, location.href);\n if (url.origin === location.origin) {\n this.active = url.pathname === location.pathname;\n }\n }\n\n protected _handleClick(e: MouseEvent) {\n const href = this.href ?? this.querySelector(\"[href]\")?.getAttribute(\"href\");\n const url = new URL(href, location.href);\n if (url.origin === location.origin) {\n e.preventDefault();\n if (this.replace) {\n this.replaceState(href);\n } else {\n this.pushState(href);\n }\n }\n }\n\n pushState(url = this.href, data = null) {\n RouterA.pushState(data, \"\", url);\n this.useActive();\n }\n\n replaceState(url = this.href, data = null) {\n RouterA.replaceState(data, \"\", url);\n this.useActive();\n }\n\n static pushState(data: any, unused: string, url?: string) {\n history.pushState(data, unused, url);\n Router.updateAll();\n }\n\n static replaceState(data: any, unused: string, url?: string) {\n history.replaceState(data, unused, url);\n Router.updateAll();\n }\n}\n\nexport default RouterA;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"link-a\": RouterA;\n \"router-a\": RouterA;\n }\n}\n"]}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { type PropertyValueMap } from "
|
1
|
+
import { type PropertyValueMap } from "../../.deps.js";
|
2
2
|
import RouteTree from "../../lib/route-tree.js";
|
3
3
|
import { type HTMLTemplate } from "../../lib/templates.js";
|
4
|
-
import { GodownElement } from "../../root.js";
|
4
|
+
import { GodownElement } from "../../supers/root.js";
|
5
5
|
/**
|
6
|
-
*
|
6
|
+
* {@linkcode Router} has basic routing control.
|
7
7
|
*/
|
8
|
-
export declare class
|
8
|
+
export declare class Router<T = unknown> extends GodownElement {
|
9
9
|
private _routes;
|
10
10
|
private _routeTree;
|
11
11
|
/**
|
@@ -51,7 +51,7 @@ export declare class RouteView<T = unknown> extends GodownElement {
|
|
51
51
|
pathname: string;
|
52
52
|
params: Record<string, string>;
|
53
53
|
path: string;
|
54
|
-
component: import("lit").TemplateResult<1
|
54
|
+
component: T | import("lit").TemplateResult<1>;
|
55
55
|
}>;
|
56
56
|
set routes(v: (Record<string, any> & Record<"path", string> & {
|
57
57
|
component?: T;
|
@@ -66,7 +66,7 @@ export declare class RouteView<T = unknown> extends GodownElement {
|
|
66
66
|
pathname: string;
|
67
67
|
params: Record<string, string>;
|
68
68
|
path: string;
|
69
|
-
component: import("lit").TemplateResult<1
|
69
|
+
component: T | import("lit").TemplateResult<1>;
|
70
70
|
};
|
71
71
|
connectedCallback(): void;
|
72
72
|
/**
|
@@ -82,10 +82,11 @@ export declare class RouteView<T = unknown> extends GodownElement {
|
|
82
82
|
parseRouterParams(routeTemplate: string, originpath: string, appl?: RouteTree): Record<string, string>;
|
83
83
|
static updateAll(): void;
|
84
84
|
}
|
85
|
-
export default
|
85
|
+
export default Router;
|
86
86
|
declare global {
|
87
87
|
interface HTMLElementTagNameMap {
|
88
|
-
"route-view":
|
88
|
+
"route-view": Router;
|
89
|
+
router: Router;
|
89
90
|
}
|
90
91
|
}
|
91
|
-
//# sourceMappingURL=
|
92
|
+
//# sourceMappingURL=router.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,gBAAgB,EAAS,MAAM,gBAAgB,CAAC;AAG7E,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAMrD;;GAEG;AACH,qBACa,MAAM,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,aAAa;IACpD,OAAO,CAAC,OAAO,CAAkD;IACjE,OAAO,CAAC,UAAU,CAA8B;IAEhD;;OAEG;IACM,SAAS,EAAE,CAAC,GAAG,YAAY,CAAQ;IAC5C;;OAEG;IACM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAC7C;;OAEG;IACM,IAAI,EAAE,MAAM,CAAQ;IAC7B;;OAEG;IACS,QAAQ,SAAM;IAC1B;;OAEG;IACS,OAAO,SAAM;IACzB;;OAEG;IACM,GAAG,kCAAc;IAC1B;;OAEG;IACS,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAY;IACtE;;OAEG;IACM,QAAQ,UAAQ;IACzB;;OAEG;IAC0B,KAAK,UAAS;IAE3C;;OAEG;IACH,MAAM;;;;;OAAwD;IAE9D,IAAI,MAAM,CAAC,CAAC;;QAAA,EAUX;IAED,IAAI,MAAM;;SAET;IAED,MAAM,CAAC,MAAM,4BAMX;IAEF,KAAK;IAKL,SAAS,CAAC,MAAM,IAAI,CAAC,GAAG,YAAY;IAwBpC,SAAS;;;;;;IAST,iBAAiB;IAsBjB;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAQ;IAE5F,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAa3D,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC;IAgBpD,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY;IA6BjE,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,SAAe,EAAE,IAAI,GAAE,SAA2B,GAAG,MAAM,GAAG,IAAI;IAIrG,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,SAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIvH,MAAM,CAAC,SAAS;CAYjB;AAED,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;KAChB;CACF"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
+
import { css, property, state } from "../../.deps.js";
|
2
3
|
import { conf } from "../../conf.js";
|
3
|
-
import {
|
4
|
+
import { define } from "../../decorators/define.js";
|
4
5
|
import RouteTree from "../../lib/route-tree.js";
|
5
6
|
import { htmlSlot } from "../../lib/templates.js";
|
6
7
|
import { deepQuerySelectorAll } from "../../lib/utils.js";
|
7
|
-
import {
|
8
|
-
|
9
|
-
const defineName = "route-view";
|
8
|
+
import { GodownElement } from "../../supers/root.js";
|
9
|
+
const defineName = "router";
|
10
10
|
/**
|
11
|
-
*
|
11
|
+
* {@linkcode Router} has basic routing control.
|
12
12
|
*/
|
13
|
-
let
|
13
|
+
let Router = class Router extends GodownElement {
|
14
14
|
constructor() {
|
15
15
|
super(...arguments);
|
16
16
|
this._routes = [];
|
@@ -206,7 +206,7 @@ let RouteView = class RouteView extends GodownElement {
|
|
206
206
|
});
|
207
207
|
}
|
208
208
|
};
|
209
|
-
|
209
|
+
Router.styles = [
|
210
210
|
css `
|
211
211
|
:host {
|
212
212
|
display: contents;
|
@@ -215,34 +215,34 @@ RouteView.styles = [
|
|
215
215
|
];
|
216
216
|
__decorate([
|
217
217
|
state()
|
218
|
-
],
|
218
|
+
], Router.prototype, "component", void 0);
|
219
219
|
__decorate([
|
220
220
|
state()
|
221
|
-
],
|
221
|
+
], Router.prototype, "params", void 0);
|
222
222
|
__decorate([
|
223
223
|
state()
|
224
|
-
],
|
224
|
+
], Router.prototype, "path", void 0);
|
225
225
|
__decorate([
|
226
226
|
property()
|
227
|
-
],
|
227
|
+
], Router.prototype, "pathname", void 0);
|
228
228
|
__decorate([
|
229
229
|
property()
|
230
|
-
],
|
230
|
+
], Router.prototype, "baseURL", void 0);
|
231
231
|
__decorate([
|
232
232
|
state()
|
233
|
-
],
|
233
|
+
], Router.prototype, "def", void 0);
|
234
234
|
__decorate([
|
235
235
|
property()
|
236
|
-
],
|
236
|
+
], Router.prototype, "type", void 0);
|
237
237
|
__decorate([
|
238
238
|
state()
|
239
|
-
],
|
239
|
+
], Router.prototype, "override", void 0);
|
240
240
|
__decorate([
|
241
241
|
property({ type: Boolean })
|
242
|
-
],
|
243
|
-
|
242
|
+
], Router.prototype, "cache", void 0);
|
243
|
+
Router = __decorate([
|
244
244
|
define(defineName)
|
245
|
-
],
|
246
|
-
export {
|
247
|
-
export default
|
248
|
-
//# sourceMappingURL=
|
245
|
+
], Router);
|
246
|
+
export { Router };
|
247
|
+
export default Router;
|
248
|
+
//# sourceMappingURL=router.js.map
|