godown 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/alert-item.d.ts +2 -0
- package/alert-item.d.ts.map +1 -0
- package/alert-item.js +2 -0
- package/alert-item.js.map +1 -0
- package/avatar-a.d.ts +2 -0
- package/avatar-a.d.ts.map +1 -0
- package/avatar-a.js +2 -0
- package/avatar-a.js.map +1 -0
- package/avatar-group.d.ts +2 -0
- package/avatar-group.d.ts.map +1 -0
- package/avatar-group.js +2 -0
- package/avatar-group.js.map +1 -0
- package/base-button.d.ts +2 -0
- package/base-button.d.ts.map +1 -0
- package/base-button.js +2 -0
- package/base-button.js.map +1 -0
- package/base-form.d.ts +2 -0
- package/base-form.d.ts.map +1 -0
- package/base-form.js +2 -0
- package/base-form.js.map +1 -0
- package/base-input.d.ts +2 -0
- package/base-input.d.ts.map +1 -0
- package/base-input.js +2 -0
- package/base-input.js.map +1 -0
- package/card-item.d.ts +2 -0
- package/card-item.d.ts.map +1 -0
- package/card-item.js +2 -0
- package/card-item.js.map +1 -0
- package/carousel-slider.d.ts +2 -0
- package/carousel-slider.d.ts.map +1 -0
- package/carousel-slider.js +2 -0
- package/carousel-slider.js.map +1 -0
- package/clip-text.d.ts +2 -0
- package/clip-text.d.ts.map +1 -0
- package/clip-text.js +2 -0
- package/clip-text.js.map +1 -0
- package/conf.d.ts.map +1 -1
- package/conf.js.map +1 -1
- package/deps.d.ts +4 -3
- package/deps.d.ts.map +1 -1
- package/deps.js +4 -3
- package/deps.js.map +1 -1
- package/details-group.d.ts +2 -0
- package/details-group.d.ts.map +1 -0
- package/details-group.js +2 -0
- package/details-group.js.map +1 -0
- package/divider-line.d.ts +2 -0
- package/divider-line.d.ts.map +1 -0
- package/divider-line.js +2 -0
- package/divider-line.js.map +1 -0
- package/drag-box.d.ts +2 -0
- package/drag-box.d.ts.map +1 -0
- package/drag-box.js +2 -0
- package/drag-box.js.map +1 -0
- package/flex-flow.d.ts +2 -0
- package/flex-flow.d.ts.map +1 -0
- package/flex-flow.js +2 -0
- package/flex-flow.js.map +1 -0
- package/godown-element.d.ts +2 -2
- package/godown-element.d.ts.map +1 -1
- package/godown-element.js +1 -1
- package/godown-element.js.map +1 -1
- package/index.d.ts +2 -6
- package/index.d.ts.map +1 -1
- package/index.js +2 -6
- package/index.js.map +1 -1
- package/label-input.d.ts +2 -0
- package/label-input.d.ts.map +1 -0
- package/label-input.js +2 -0
- package/label-input.js.map +1 -0
- 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/event-collection.js.map +1 -1
- package/lib/route-tree.d.ts.map +1 -1
- package/lib/route-tree.js.map +1 -1
- package/lib/templates.d.ts.map +1 -1
- package/lib/templates.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js.map +1 -1
- package/link-a.d.ts +2 -0
- package/link-a.d.ts.map +1 -0
- package/link-a.js +2 -0
- package/link-a.js.map +1 -0
- package/loading-progress.d.ts +2 -0
- package/loading-progress.d.ts.map +1 -0
- package/loading-progress.js +2 -0
- package/loading-progress.js.map +1 -0
- package/nav-aside.d.ts +2 -0
- package/nav-aside.d.ts.map +1 -0
- package/nav-aside.js +2 -0
- package/nav-aside.js.map +1 -0
- package/nav-layout.d.ts +2 -0
- package/nav-layout.d.ts.map +1 -0
- package/nav-layout.js +2 -0
- package/nav-layout.js.map +1 -0
- package/open-details.d.ts +2 -0
- package/open-details.d.ts.map +1 -0
- package/open-details.js +2 -0
- package/open-details.js.map +1 -0
- package/open-dialog.d.ts +2 -0
- package/open-dialog.d.ts.map +1 -0
- package/open-dialog.js +2 -0
- package/open-dialog.js.map +1 -0
- package/open-list.d.ts +2 -0
- package/open-list.d.ts.map +1 -0
- package/open-list.js +2 -0
- package/open-list.js.map +1 -0
- package/open-offset.d.ts +2 -0
- package/open-offset.d.ts.map +1 -0
- package/open-offset.js +2 -0
- package/open-offset.js.map +1 -0
- package/open-tooltip.d.ts +2 -0
- package/open-tooltip.d.ts.map +1 -0
- package/open-tooltip.js +2 -0
- package/open-tooltip.js.map +1 -0
- package/overbreath-text.d.ts +2 -0
- package/overbreath-text.d.ts.map +1 -0
- package/overbreath-text.js +2 -0
- package/overbreath-text.js.map +1 -0
- package/package.json +57 -10
- package/react/create.d.ts.map +1 -1
- package/react/create.js.map +1 -1
- package/react/index.d.ts +37 -7
- package/react/index.d.ts.map +1 -1
- package/react/index.js +114 -7
- package/react/index.js.map +1 -1
- package/root.d.ts.map +1 -1
- package/root.js +3 -2
- package/root.js.map +1 -1
- package/route-view.d.ts +2 -0
- package/route-view.d.ts.map +1 -0
- package/route-view.js +2 -0
- package/route-view.js.map +1 -0
- package/scroll-x.d.ts +2 -0
- package/scroll-x.d.ts.map +1 -0
- package/scroll-x.js +2 -0
- package/scroll-x.js.map +1 -0
- package/search-input.d.ts +2 -0
- package/search-input.d.ts.map +1 -0
- package/search-input.js +2 -0
- package/search-input.js.map +1 -0
- package/select-input.d.ts +2 -0
- package/select-input.d.ts.map +1 -0
- package/select-input.js +2 -0
- package/select-input.js.map +1 -0
- package/sign-form.d.ts +2 -0
- package/sign-form.d.ts.map +1 -0
- package/sign-form.js +2 -0
- package/sign-form.js.map +1 -0
- package/skeleton-screen.d.ts +2 -0
- package/skeleton-screen.d.ts.map +1 -0
- package/skeleton-screen.js +2 -0
- package/skeleton-screen.js.map +1 -0
- package/split-input.d.ts +2 -0
- package/split-input.d.ts.map +1 -0
- package/split-input.js +2 -0
- package/split-input.js.map +1 -0
- package/super-a.d.ts +2 -0
- package/super-a.d.ts.map +1 -0
- package/super-a.js +2 -0
- package/super-a.js.map +1 -0
- package/switch-input.d.ts +2 -0
- package/switch-input.d.ts.map +1 -0
- package/switch-input.js +2 -0
- package/switch-input.js.map +1 -0
- package/tab-group.d.ts +2 -0
- package/tab-group.d.ts.map +1 -0
- package/tab-group.js +2 -0
- package/tab-group.js.map +1 -0
- package/time-bar.d.ts +2 -0
- package/time-bar.d.ts.map +1 -0
- package/time-bar.js +2 -0
- package/time-bar.js.map +1 -0
- package/typewriter-text.d.ts +2 -0
- package/typewriter-text.d.ts.map +1 -0
- package/typewriter-text.js +2 -0
- package/typewriter-text.js.map +1 -0
- package/{items → web-components/a}/avatar-a.d.ts +7 -7
- package/web-components/a/avatar-a.d.ts.map +1 -0
- package/{items → web-components/a}/avatar-a.js +57 -62
- package/web-components/a/avatar-a.js.map +1 -0
- package/{items → web-components/a}/link-a.d.ts +6 -6
- package/web-components/a/link-a.d.ts.map +1 -0
- package/{items → web-components/a}/link-a.js +16 -21
- package/web-components/a/link-a.js.map +1 -0
- package/{items → web-components/a}/super-a.d.ts +5 -5
- package/web-components/a/super-a.d.ts.map +1 -0
- package/{items → web-components/a}/super-a.js +34 -40
- package/web-components/a/super-a.js.map +1 -0
- package/{items → web-components/button}/base-button.d.ts +3 -3
- package/web-components/button/base-button.d.ts.map +1 -0
- package/{items → web-components/button}/base-button.js +99 -105
- package/web-components/button/base-button.js.map +1 -0
- package/{view/rotation-pool.d.ts → web-components/carousel/carousel-slider.d.ts} +7 -7
- package/web-components/carousel/carousel-slider.d.ts.map +1 -0
- package/{view/rotation-pool.js → web-components/carousel/carousel-slider.js} +87 -92
- package/web-components/carousel/carousel-slider.js.map +1 -0
- package/{input-form/sign-form.d.ts → web-components/form/base-form.d.ts} +9 -18
- package/web-components/form/base-form.d.ts.map +1 -0
- package/{input-form/sign-form.js → web-components/form/base-form.js} +32 -40
- package/web-components/form/base-form.js.map +1 -0
- package/web-components/form/sign-form.d.ts +19 -0
- package/web-components/form/sign-form.d.ts.map +1 -0
- package/web-components/form/sign-form.js +16 -0
- package/web-components/form/sign-form.js.map +1 -0
- package/{group → web-components/group}/avatar-group.d.ts +6 -6
- package/web-components/group/avatar-group.d.ts.map +1 -0
- package/{group → web-components/group}/avatar-group.js +24 -30
- package/web-components/group/avatar-group.js.map +1 -0
- package/{group → web-components/group}/details-group.d.ts +3 -3
- package/web-components/group/details-group.d.ts.map +1 -0
- package/{group → web-components/group}/details-group.js +12 -18
- package/web-components/group/details-group.js.map +1 -0
- package/{group → web-components/group}/tab-group.d.ts +4 -4
- package/web-components/group/tab-group.d.ts.map +1 -0
- package/{group → web-components/group}/tab-group.js +50 -56
- package/web-components/group/tab-group.js.map +1 -0
- package/web-components/index.d.ts +38 -0
- package/web-components/index.d.ts.map +1 -0
- package/web-components/index.js +39 -0
- package/web-components/index.js.map +1 -0
- package/{input-form → web-components/input}/base-input.d.ts +4 -4
- package/web-components/input/base-input.d.ts.map +1 -0
- package/{input-form → web-components/input}/base-input.js +79 -84
- package/web-components/input/base-input.js.map +1 -0
- package/{input-form/std.d.ts → web-components/input/input.d.ts} +4 -16
- package/web-components/input/input.d.ts.map +1 -0
- package/{input-form/std.js → web-components/input/input.js} +27 -54
- package/web-components/input/input.js.map +1 -0
- package/{input-form → web-components/input}/label-input.d.ts +4 -4
- package/web-components/input/label-input.d.ts.map +1 -0
- package/{input-form → web-components/input}/label-input.js +55 -60
- package/web-components/input/label-input.js.map +1 -0
- package/{input-form → web-components/input}/search-input.d.ts +4 -4
- package/web-components/input/search-input.d.ts.map +1 -0
- package/{input-form → web-components/input}/search-input.js +59 -64
- package/web-components/input/search-input.js.map +1 -0
- package/{input-form → web-components/input}/select-input.d.ts +4 -4
- package/web-components/input/select-input.d.ts.map +1 -0
- package/{input-form → web-components/input}/select-input.js +95 -100
- package/web-components/input/select-input.js.map +1 -0
- package/{input-form → web-components/input}/split-input.d.ts +4 -4
- package/web-components/input/split-input.d.ts.map +1 -0
- package/{input-form → web-components/input}/split-input.js +56 -61
- package/web-components/input/split-input.js.map +1 -0
- package/{input-form → web-components/input}/switch-input.d.ts +4 -4
- package/web-components/input/switch-input.d.ts.map +1 -0
- package/{input-form → web-components/input}/switch-input.js +42 -47
- package/web-components/input/switch-input.js.map +1 -0
- package/{items → web-components/items}/alert-item.d.ts +3 -3
- package/web-components/items/alert-item.d.ts.map +1 -0
- package/{items → web-components/items}/alert-item.js +38 -43
- package/web-components/items/alert-item.js.map +1 -0
- package/{items → web-components/items}/card-item.d.ts +4 -4
- package/web-components/items/card-item.d.ts.map +1 -0
- package/{items → web-components/items}/card-item.js +57 -63
- package/web-components/items/card-item.js.map +1 -0
- package/{layout → web-components/items}/drag-box.d.ts +3 -3
- package/web-components/items/drag-box.d.ts.map +1 -0
- package/{layout → web-components/items}/drag-box.js +13 -19
- package/web-components/items/drag-box.js.map +1 -0
- package/web-components/items/index.d.ts +5 -0
- package/web-components/items/index.d.ts.map +1 -0
- package/web-components/items/index.js +6 -0
- package/web-components/items/index.js.map +1 -0
- package/{items → web-components/items}/time-bar.d.ts +3 -3
- package/web-components/items/time-bar.d.ts.map +1 -0
- package/{items → web-components/items}/time-bar.js +12 -17
- package/web-components/items/time-bar.js.map +1 -0
- package/web-components/layout/divider-line.d.ts +20 -0
- package/web-components/layout/divider-line.d.ts.map +1 -0
- package/{layout/div-line.js → web-components/layout/divider-line.js} +24 -30
- package/web-components/layout/divider-line.js.map +1 -0
- package/{layout → web-components/layout}/flex-flow.d.ts +3 -3
- package/web-components/layout/flex-flow.d.ts.map +1 -0
- package/{layout → web-components/layout}/flex-flow.js +12 -18
- package/web-components/layout/flex-flow.js.map +1 -0
- package/web-components/layout/index.d.ts +5 -0
- package/web-components/layout/index.d.ts.map +1 -0
- package/web-components/layout/index.js +6 -0
- package/web-components/layout/index.js.map +1 -0
- package/{layout → web-components/layout}/nav-aside.d.ts +4 -4
- package/web-components/layout/nav-aside.d.ts.map +1 -0
- package/{layout → web-components/layout}/nav-aside.js +19 -25
- package/web-components/layout/nav-aside.js.map +1 -0
- package/{layout → web-components/layout}/nav-layout.d.ts +4 -4
- package/web-components/layout/nav-layout.d.ts.map +1 -0
- package/{layout → web-components/layout}/nav-layout.js +31 -37
- package/web-components/layout/nav-layout.js.map +1 -0
- package/{items/load-progress.d.ts → web-components/loading/loading-progress.d.ts} +7 -7
- package/web-components/loading/loading-progress.d.ts.map +1 -0
- package/{items/load-progress.js → web-components/loading/loading-progress.js} +41 -47
- package/web-components/loading/loading-progress.js.map +1 -0
- package/{layout → web-components/loading}/skeleton-screen.d.ts +4 -4
- package/web-components/loading/skeleton-screen.d.ts.map +1 -0
- package/{layout → web-components/loading}/skeleton-screen.js +24 -30
- package/web-components/loading/skeleton-screen.js.map +1 -0
- package/{view/details-expand.d.ts → web-components/open/open-details.d.ts} +8 -8
- package/web-components/open/open-details.d.ts.map +1 -0
- package/{view/details-expand.js → web-components/open/open-details.js} +35 -40
- package/web-components/open/open-details.js.map +1 -0
- package/{items/dialog-item.d.ts → web-components/open/open-dialog.d.ts} +8 -8
- package/web-components/open/open-dialog.d.ts.map +1 -0
- package/{items/dialog-item.js → web-components/open/open-dialog.js} +83 -89
- package/web-components/open/open-dialog.js.map +1 -0
- package/web-components/open/open-list.d.ts +20 -0
- package/web-components/open/open-list.d.ts.map +1 -0
- package/web-components/open/open-list.js +71 -0
- package/web-components/open/open-list.js.map +1 -0
- package/{view/offset-expand.d.ts → web-components/open/open-offset.d.ts} +8 -8
- package/web-components/open/open-offset.d.ts.map +1 -0
- package/{view/offset-expand.js → web-components/open/open-offset.js} +66 -71
- package/web-components/open/open-offset.js.map +1 -0
- package/web-components/open/open-tooltip.d.ts +24 -0
- package/web-components/open/open-tooltip.d.ts.map +1 -0
- package/{view/tool-tip.js → web-components/open/open-tooltip.js} +28 -33
- package/web-components/open/open-tooltip.js.map +1 -0
- package/{view/std.d.ts → web-components/open/open.d.ts} +6 -6
- package/web-components/open/open.d.ts.map +1 -0
- package/{view/std.js → web-components/open/open.js} +35 -40
- package/web-components/open/open.js.map +1 -0
- package/{effect → web-components/text}/clip-text.d.ts +4 -4
- package/web-components/text/clip-text.d.ts.map +1 -0
- package/web-components/text/clip-text.js +44 -0
- package/web-components/text/clip-text.js.map +1 -0
- package/{effect → web-components/text}/overbreath-text.d.ts +4 -4
- package/web-components/text/overbreath-text.d.ts.map +1 -0
- package/{effect → web-components/text}/overbreath-text.js +21 -27
- package/web-components/text/overbreath-text.js.map +1 -0
- package/{effect → web-components/text}/typewriter-text.d.ts +4 -4
- package/web-components/text/typewriter-text.d.ts.map +1 -0
- package/{effect → web-components/text}/typewriter-text.js +38 -44
- package/web-components/text/typewriter-text.js.map +1 -0
- package/{view → web-components/view}/route-view.d.ts +4 -4
- package/web-components/view/route-view.d.ts.map +1 -0
- package/{view → web-components/view}/route-view.js +15 -20
- package/web-components/view/route-view.js.map +1 -0
- package/{view → web-components/view}/scroll-x.d.ts +2 -2
- package/web-components/view/scroll-x.d.ts.map +1 -0
- package/{view → web-components/view}/scroll-x.js +35 -40
- package/web-components/view/scroll-x.js.map +1 -0
- package/{view/with-wrap.d.ts → web-components/view/wrap-view.d.ts} +7 -7
- package/web-components/view/wrap-view.d.ts.map +1 -0
- package/{view/with-wrap.js → web-components/view/wrap-view.js} +29 -34
- package/web-components/view/wrap-view.js.map +1 -0
- package/wrap-view.d.ts +2 -0
- package/wrap-view.d.ts.map +1 -0
- package/wrap-view.js +2 -0
- package/wrap-view.js.map +1 -0
- package/effect/clip-text.d.ts.map +0 -1
- package/effect/clip-text.js +0 -50
- package/effect/clip-text.js.map +0 -1
- package/effect/index.d.ts +0 -4
- package/effect/index.d.ts.map +0 -1
- package/effect/index.js +0 -4
- package/effect/index.js.map +0 -1
- package/effect/overbreath-text.d.ts.map +0 -1
- package/effect/overbreath-text.js.map +0 -1
- package/effect/std.d.ts +0 -4
- package/effect/std.d.ts.map +0 -1
- package/effect/std.js +0 -4
- package/effect/std.js.map +0 -1
- package/effect/typewriter-text.d.ts.map +0 -1
- package/effect/typewriter-text.js.map +0 -1
- package/group/avatar-group.d.ts.map +0 -1
- package/group/avatar-group.js.map +0 -1
- package/group/details-group.d.ts.map +0 -1
- package/group/details-group.js.map +0 -1
- package/group/index.d.ts +0 -4
- package/group/index.d.ts.map +0 -1
- package/group/index.js +0 -4
- package/group/index.js.map +0 -1
- package/group/std.d.ts +0 -4
- package/group/std.d.ts.map +0 -1
- package/group/std.js +0 -4
- package/group/std.js.map +0 -1
- package/group/tab-group.d.ts.map +0 -1
- package/group/tab-group.js.map +0 -1
- package/input-form/base-input.d.ts.map +0 -1
- package/input-form/base-input.js.map +0 -1
- package/input-form/index.d.ts +0 -8
- package/input-form/index.d.ts.map +0 -1
- package/input-form/index.js +0 -8
- package/input-form/index.js.map +0 -1
- package/input-form/label-input.d.ts.map +0 -1
- package/input-form/label-input.js.map +0 -1
- package/input-form/search-input.d.ts.map +0 -1
- package/input-form/search-input.js.map +0 -1
- package/input-form/select-input.d.ts.map +0 -1
- package/input-form/select-input.js.map +0 -1
- package/input-form/sign-form.d.ts.map +0 -1
- package/input-form/sign-form.js.map +0 -1
- package/input-form/split-input.d.ts.map +0 -1
- package/input-form/split-input.js.map +0 -1
- package/input-form/std.d.ts.map +0 -1
- package/input-form/std.js.map +0 -1
- package/input-form/switch-input.d.ts.map +0 -1
- package/input-form/switch-input.js.map +0 -1
- package/items/alert-item.d.ts.map +0 -1
- package/items/alert-item.js.map +0 -1
- package/items/avatar-a.d.ts.map +0 -1
- package/items/avatar-a.js.map +0 -1
- package/items/base-button.d.ts.map +0 -1
- package/items/base-button.js.map +0 -1
- package/items/card-item.d.ts.map +0 -1
- package/items/card-item.js.map +0 -1
- package/items/dialog-item.d.ts.map +0 -1
- package/items/dialog-item.js.map +0 -1
- package/items/index.d.ts +0 -10
- package/items/index.d.ts.map +0 -1
- package/items/index.js +0 -10
- package/items/index.js.map +0 -1
- package/items/link-a.d.ts.map +0 -1
- package/items/link-a.js.map +0 -1
- package/items/load-progress.d.ts.map +0 -1
- package/items/load-progress.js.map +0 -1
- package/items/std.d.ts +0 -4
- package/items/std.d.ts.map +0 -1
- package/items/std.js +0 -4
- package/items/std.js.map +0 -1
- package/items/super-a.d.ts.map +0 -1
- package/items/super-a.js.map +0 -1
- package/items/time-bar.d.ts.map +0 -1
- package/items/time-bar.js.map +0 -1
- package/layout/div-line.d.ts +0 -20
- package/layout/div-line.d.ts.map +0 -1
- package/layout/div-line.js.map +0 -1
- package/layout/drag-box.d.ts.map +0 -1
- package/layout/drag-box.js.map +0 -1
- package/layout/flex-flow.d.ts.map +0 -1
- package/layout/flex-flow.js.map +0 -1
- package/layout/index.d.ts +0 -7
- package/layout/index.d.ts.map +0 -1
- package/layout/index.js +0 -7
- package/layout/index.js.map +0 -1
- package/layout/nav-aside.d.ts.map +0 -1
- package/layout/nav-aside.js.map +0 -1
- package/layout/nav-layout.d.ts.map +0 -1
- package/layout/nav-layout.js.map +0 -1
- package/layout/skeleton-screen.d.ts.map +0 -1
- package/layout/skeleton-screen.js.map +0 -1
- package/layout/std.d.ts +0 -4
- package/layout/std.d.ts.map +0 -1
- package/layout/std.js +0 -4
- package/layout/std.js.map +0 -1
- package/react/effect.d.ts +0 -5
- package/react/effect.d.ts.map +0 -1
- package/react/effect.js +0 -13
- package/react/effect.js.map +0 -1
- package/react/group.d.ts +0 -5
- package/react/group.d.ts.map +0 -1
- package/react/group.js +0 -13
- package/react/group.js.map +0 -1
- package/react/input-form.d.ts +0 -28
- package/react/input-form.d.ts.map +0 -1
- package/react/input-form.js +0 -38
- package/react/input-form.js.map +0 -1
- package/react/items.d.ts +0 -11
- package/react/items.d.ts.map +0 -1
- package/react/items.js +0 -31
- package/react/items.js.map +0 -1
- package/react/layout.d.ts +0 -8
- package/react/layout.d.ts.map +0 -1
- package/react/layout.js +0 -22
- package/react/layout.js.map +0 -1
- package/react/view.d.ts +0 -10
- package/react/view.d.ts.map +0 -1
- package/react/view.js +0 -28
- package/react/view.js.map +0 -1
- package/view/details-expand.d.ts.map +0 -1
- package/view/details-expand.js.map +0 -1
- package/view/index.d.ts +0 -9
- package/view/index.d.ts.map +0 -1
- package/view/index.js +0 -9
- package/view/index.js.map +0 -1
- package/view/menu-list.d.ts +0 -20
- package/view/menu-list.d.ts.map +0 -1
- package/view/menu-list.js +0 -76
- package/view/menu-list.js.map +0 -1
- package/view/offset-expand.d.ts.map +0 -1
- package/view/offset-expand.js.map +0 -1
- package/view/rotation-pool.d.ts.map +0 -1
- package/view/rotation-pool.js.map +0 -1
- package/view/route-view.d.ts.map +0 -1
- package/view/route-view.js.map +0 -1
- package/view/scroll-x.d.ts.map +0 -1
- package/view/scroll-x.js.map +0 -1
- package/view/std.d.ts.map +0 -1
- package/view/std.js.map +0 -1
- package/view/tool-tip.d.ts +0 -24
- package/view/tool-tip.d.ts.map +0 -1
- package/view/tool-tip.js.map +0 -1
- package/view/with-wrap.d.ts.map +0 -1
- package/view/with-wrap.js.map +0 -1
@@ -1,19 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
import { createScope, cssvarValues, define } from "../root.js";
|
8
|
-
import { css, html, property, query, queryAll } from "../deps.js";
|
9
|
-
import { InputSTD } from "./std.js";
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { css, html, property, query, queryAll } from "../../deps.js";
|
3
|
+
import { createScope, cssvarValues, define } from "../../root.js";
|
4
|
+
import { InputElement } from "./input.js";
|
10
5
|
const FOCUS = "focus";
|
11
6
|
const defineName = "split-input";
|
12
7
|
const cssScope = createScope(defineName);
|
13
8
|
/**
|
14
9
|
* SplitInput renders multiple inputs.
|
15
10
|
*/
|
16
|
-
let SplitInput = class SplitInput extends
|
11
|
+
let SplitInput = class SplitInput extends InputElement {
|
17
12
|
constructor() {
|
18
13
|
super(...arguments);
|
19
14
|
/**
|
@@ -27,6 +22,57 @@ let SplitInput = class SplitInput extends InputSTD {
|
|
27
22
|
this.current = 0;
|
28
23
|
this.currentValue = [];
|
29
24
|
}
|
25
|
+
static { this.styles = [
|
26
|
+
InputElement.styles,
|
27
|
+
css `
|
28
|
+
:host {
|
29
|
+
${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);
|
30
|
+
margin: var(${cssvarValues.input}--outline-width);
|
31
|
+
width: fit-content;
|
32
|
+
border-radius: 1px;
|
33
|
+
}
|
34
|
+
|
35
|
+
* {
|
36
|
+
font-size: 1em;
|
37
|
+
border-radius: inherit;
|
38
|
+
}
|
39
|
+
|
40
|
+
div {
|
41
|
+
vertical-align: top;
|
42
|
+
position: relative;
|
43
|
+
display: inline-flex;
|
44
|
+
gap: 0.25em;
|
45
|
+
}
|
46
|
+
|
47
|
+
span {
|
48
|
+
box-sizing: content-box;
|
49
|
+
vertical-align: top;
|
50
|
+
display: inline-flex;
|
51
|
+
width: 1.45em;
|
52
|
+
height: 1.45em;
|
53
|
+
pointer-events: all;
|
54
|
+
}
|
55
|
+
|
56
|
+
i {
|
57
|
+
height: inherit;
|
58
|
+
width: 100%;
|
59
|
+
z-index: 1;
|
60
|
+
background-color: var(${cssvarValues.input}--false);
|
61
|
+
text-align: center;
|
62
|
+
}
|
63
|
+
|
64
|
+
input {
|
65
|
+
position: absolute;
|
66
|
+
opacity: 0;
|
67
|
+
left: 0;
|
68
|
+
top: 0;
|
69
|
+
}
|
70
|
+
|
71
|
+
.focus i {
|
72
|
+
outline: var(${cssScope}--outline);
|
73
|
+
}
|
74
|
+
`,
|
75
|
+
]; }
|
30
76
|
render() {
|
31
77
|
return html `
|
32
78
|
<div>
|
@@ -107,57 +153,6 @@ let SplitInput = class SplitInput extends InputSTD {
|
|
107
153
|
this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
|
108
154
|
}
|
109
155
|
};
|
110
|
-
SplitInput.styles = [
|
111
|
-
InputSTD.styles,
|
112
|
-
css `
|
113
|
-
:host {
|
114
|
-
${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);
|
115
|
-
margin: var(${cssvarValues.input}--outline-width);
|
116
|
-
width: fit-content;
|
117
|
-
border-radius: 1px;
|
118
|
-
}
|
119
|
-
|
120
|
-
* {
|
121
|
-
font-size: 1em;
|
122
|
-
border-radius: inherit;
|
123
|
-
}
|
124
|
-
|
125
|
-
div {
|
126
|
-
vertical-align: top;
|
127
|
-
position: relative;
|
128
|
-
display: inline-flex;
|
129
|
-
gap: 0.25em;
|
130
|
-
}
|
131
|
-
|
132
|
-
span {
|
133
|
-
box-sizing: content-box;
|
134
|
-
vertical-align: top;
|
135
|
-
display: inline-flex;
|
136
|
-
width: 1.45em;
|
137
|
-
height: 1.45em;
|
138
|
-
pointer-events: all;
|
139
|
-
}
|
140
|
-
|
141
|
-
i {
|
142
|
-
height: inherit;
|
143
|
-
width: 100%;
|
144
|
-
z-index: 1;
|
145
|
-
background-color: var(${cssvarValues.input}--false);
|
146
|
-
text-align: center;
|
147
|
-
}
|
148
|
-
|
149
|
-
input {
|
150
|
-
position: absolute;
|
151
|
-
opacity: 0;
|
152
|
-
left: 0;
|
153
|
-
top: 0;
|
154
|
-
}
|
155
|
-
|
156
|
-
.focus i {
|
157
|
-
outline: var(${cssScope}--outline);
|
158
|
-
}
|
159
|
-
`,
|
160
|
-
];
|
161
156
|
__decorate([
|
162
157
|
property({ type: Number })
|
163
158
|
], SplitInput.prototype, "max", void 0);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"split-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/split-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,MAAM,UAAU,GAAG,aAAa,CAAC;AAEjC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;GAEG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,YAAY;IAArC;;QACL;;WAEG;QACyB,QAAG,GAAG,CAA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AC,OAAO;QACnB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;;AAhJ2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAS;AAIR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AAEvB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AACvB;IAAjB,QAAQ,CAAC,MAAM,CAAC;0CAAqC;AAX3C,UAAU;IADtB,MAAM,CAAC,UAAU,CAAC;GACN,UAAU,CAqJtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query, queryAll } from \"../../deps.js\";\nimport { type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define } from \"../../root.js\";\nimport { InputElement } from \"./input.js\";\n\nconst FOCUS = \"focus\";\n\nconst defineName = \"split-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * SplitInput renders multiple inputs.\n */\n@define(defineName)\nexport class SplitInput extends InputElement {\n /**\n * The number of simulated input boxes.\n */\n @property({ type: Number }) max = 6;\n /**\n * Active index.\n */\n @property({ type: Number }) index = -1;\n\n @query(\"input\") _input: HTMLInputElement;\n @queryAll(\"span\") _spans: NodeListOf<HTMLSpanElement>;\n current = 0;\n currentValue: (string | null)[] = [];\n\n static styles = [\n InputElement.styles,\n css`\n :host {\n ${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);\n margin: var(${cssvarValues.input}--outline-width);\n width: fit-content;\n border-radius: 1px;\n }\n\n * {\n font-size: 1em;\n border-radius: inherit;\n }\n\n div {\n vertical-align: top;\n position: relative;\n display: inline-flex;\n gap: 0.25em;\n }\n\n span {\n box-sizing: content-box;\n vertical-align: top;\n display: inline-flex;\n width: 1.45em;\n height: 1.45em;\n pointer-events: all;\n }\n\n i {\n height: inherit;\n width: 100%;\n z-index: 1;\n background-color: var(${cssvarValues.input}--false);\n text-align: center;\n }\n\n input {\n position: absolute;\n opacity: 0;\n left: 0;\n top: 0;\n }\n\n .focus i {\n outline: var(${cssScope}--outline);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`\n <div>\n ${Array(this.max)\n .fill(0)\n .map(() => html`<span><i></i></span>`)}\n <input @input=\"${this._handleInput}\" />\n </div>\n `;\n }\n\n protected firstUpdated() {\n this.currentValue = this.value.split(\"\").concat(Array(this.max - this.value.length).fill(null));\n this.current = this.index < 0 || this.index > this.max ? this.currentValue.indexOf(null) : this.index;\n this._spans.forEach((span, index) => {\n this.addEvent(span, \"click\", () => {\n this.current = index;\n this.focusAt();\n this._input.focus();\n });\n });\n this.addEvent(document, \"click\", (e) => {\n if (!this.contains(e.target as Node)) {\n this.blur();\n }\n });\n }\n\n protected _handleInput(e: InputEvent) {\n if (e.data === null) {\n if (this.currentValue[this.current] !== null) {\n this.currentValue[this.current] = null;\n } else {\n this.currentValue[this.current - 1] = null;\n this.current = this.current - 1 < 0 ? 0 : this.current - 1;\n }\n } else {\n this.currentValue[this.current] = e.data;\n if (this.current + 1 >= this.max) {\n this.current = this.currentValue.indexOf(null);\n if (this.current === -1) {\n this.blur();\n }\n } else {\n this.current += 1;\n }\n }\n this.focus();\n this._spans.forEach((span, index) => {\n span.querySelector(\"i\").innerText = this.currentValue[index] || \"\";\n });\n this.value = this.currentValue.join(\"\");\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.value, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value, composed: true }));\n }\n\n focus() {\n this.focusAt();\n }\n\n focusAt(i = this.current) {\n this._spans.forEach((span) => {\n span.classList.remove(FOCUS);\n });\n this._spans[i]?.classList.add(FOCUS);\n this._input.value = \"\";\n }\n\n blur(i = this.current) {\n this._spans[i]?.classList.remove(FOCUS);\n this._input.blur();\n }\n\n reset() {\n this.currentValue = Array(this.max).fill(null);\n this.current = 0;\n this._spans.forEach((span) => {\n span.querySelector(\"i\").innerText = \"\";\n });\n this.value = \"\";\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value }));\n }\n}\n\nexport default SplitInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"split-input\": SplitInput;\n }\n}\n"]}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { type CSSResultGroup } from "
|
2
|
-
import { type HTMLTemplate } from "
|
3
|
-
import {
|
1
|
+
import { type CSSResultGroup } from "../../deps.js";
|
2
|
+
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
+
import { InputElement } from "./input.js";
|
4
4
|
/**
|
5
5
|
* Switch renders a switch.
|
6
6
|
*
|
7
7
|
* Inspired by Steam.
|
8
8
|
*/
|
9
|
-
export declare class SwitchInput extends
|
9
|
+
export declare class SwitchInput extends InputElement {
|
10
10
|
/**
|
11
11
|
* Border style.
|
12
12
|
*/
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"switch-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/switch-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C;;;;GAIG;AACH,qBACa,WAAY,SAAQ,YAAY;IAC3C;;OAEG;IACS,IAAI,EAAE,KAAK,GAAG,MAAM,CAAU;IAC1C;;OAEG;IAC0B,OAAO,UAAS;IAC7C;;OAEG;IAC0B,QAAQ,UAAS;IAC9C;;OAEG;IACS,GAAG,SAAW;IAC1B;;OAEG;IACS,IAAI,SAAc;IAC9B;;OAEG;IACS,KAAK,SAAQ;IAET,MAAM,EAAE,gBAAgB,CAAC;IAEzC,MAAM,CAAC,MAAM,iBA4HO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAWhC,KAAK;IAKL,iBAAiB;IASjB,SAAS,CAAC,aAAa;IAMvB,SAAS,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;CAG/B;AAED,eAAe,WAAW,CAAC;AAE3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
@@ -1,13 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
};
|
7
|
-
import { createScope, cssvarValues, define } from "../root.js";
|
8
|
-
import { css, html, property, query } from "../deps.js";
|
9
|
-
import { htmlSlot } from "../lib/templates.js";
|
10
|
-
import { InputSTD } from "./std.js";
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { css, html, property, query } from "../../deps.js";
|
3
|
+
import { htmlSlot } from "../../lib/templates.js";
|
4
|
+
import { createScope, cssvarValues, define } from "../../root.js";
|
5
|
+
import { InputElement } from "./input.js";
|
11
6
|
const defineName = "switch-input";
|
12
7
|
const cssScope = createScope(defineName);
|
13
8
|
/**
|
@@ -15,7 +10,7 @@ const cssScope = createScope(defineName);
|
|
15
10
|
*
|
16
11
|
* Inspired by Steam.
|
17
12
|
*/
|
18
|
-
let SwitchInput = class SwitchInput extends
|
13
|
+
let SwitchInput = class SwitchInput extends InputElement {
|
19
14
|
constructor() {
|
20
15
|
super(...arguments);
|
21
16
|
/**
|
@@ -43,41 +38,9 @@ let SwitchInput = class SwitchInput extends InputSTD {
|
|
43
38
|
*/
|
44
39
|
this.value = "on";
|
45
40
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<aside>
|
50
|
-
<div class="false"><slot name="false"></slot></div>
|
51
|
-
<div class="always">${htmlSlot()}<slot name="always"></slot></div>
|
52
|
-
<div class="true"><slot name="true"></slot></div>
|
53
|
-
</aside>
|
54
|
-
</span>`;
|
55
|
-
}
|
56
|
-
reset() {
|
57
|
-
this.checked = this.def === "true";
|
58
|
-
this._input.checked = this.checked;
|
59
|
-
}
|
60
|
-
connectedCallback() {
|
61
|
-
super.connectedCallback();
|
62
|
-
if (this.checked) {
|
63
|
-
this.def = "true";
|
64
|
-
}
|
65
|
-
else if (this.def === "true") {
|
66
|
-
this.checked = true;
|
67
|
-
}
|
68
|
-
}
|
69
|
-
_handleChange() {
|
70
|
-
this.checked = this._input.checked;
|
71
|
-
this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
|
72
|
-
this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
|
73
|
-
}
|
74
|
-
namevalue() {
|
75
|
-
return [this.name, this.checked];
|
76
|
-
}
|
77
|
-
};
|
78
|
-
SwitchInput.styles = [
|
79
|
-
InputSTD.styles,
|
80
|
-
css `
|
41
|
+
static { this.styles = [
|
42
|
+
InputElement.styles,
|
43
|
+
css `
|
81
44
|
:host {
|
82
45
|
${cssScope}--width: 3em;
|
83
46
|
${cssScope}--height: calc(var(${cssScope}--width) / 2);
|
@@ -199,7 +162,39 @@ SwitchInput.styles = [
|
|
199
162
|
display: none;
|
200
163
|
}
|
201
164
|
`,
|
202
|
-
];
|
165
|
+
]; }
|
166
|
+
render() {
|
167
|
+
return html `<span class="${this.base}">
|
168
|
+
<input @change="${this._handleChange}" ?disabled="${this.disabled}" ?checked="${this.checked}" name="${this.name}" type="checkbox" />
|
169
|
+
<aside>
|
170
|
+
<div class="false"><slot name="false"></slot></div>
|
171
|
+
<div class="always">${htmlSlot()}<slot name="always"></slot></div>
|
172
|
+
<div class="true"><slot name="true"></slot></div>
|
173
|
+
</aside>
|
174
|
+
</span>`;
|
175
|
+
}
|
176
|
+
reset() {
|
177
|
+
this.checked = this.def === "true";
|
178
|
+
this._input.checked = this.checked;
|
179
|
+
}
|
180
|
+
connectedCallback() {
|
181
|
+
super.connectedCallback();
|
182
|
+
if (this.checked) {
|
183
|
+
this.def = "true";
|
184
|
+
}
|
185
|
+
else if (this.def === "true") {
|
186
|
+
this.checked = true;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
_handleChange() {
|
190
|
+
this.checked = this._input.checked;
|
191
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
|
192
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
|
193
|
+
}
|
194
|
+
namevalue() {
|
195
|
+
return [this.name, this.checked];
|
196
|
+
}
|
197
|
+
};
|
203
198
|
__decorate([
|
204
199
|
property()
|
205
200
|
], SwitchInput.prototype, "base", void 0);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"switch-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/switch-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAA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Group, html, property, query } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define } from \"../../root.js\";\nimport { InputElement } from \"./input.js\";\n\nconst defineName = \"switch-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * Switch renders a switch.\n *\n * Inspired by Steam.\n */\n@define(defineName)\nexport class SwitchInput extends InputElement {\n /**\n * Border style.\n */\n @property() base: \"fat\" | \"rect\" = \"rect\";\n /**\n * Whether this element is selected or not.\n */\n @property({ type: Boolean }) checked = false;\n /**\n * Whether this element is disabled or not.\n */\n @property({ type: Boolean }) disabled = false;\n /**\n * Parsed by JSON.parse to checked.\n */\n @property() def = \"false\";\n /**\n * Input name.\n */\n @property() name = \"checkbox\";\n /**\n * Input value.\n */\n @property() value = \"on\";\n\n @query(\"input\") _input: HTMLInputElement;\n\n static styles = [\n InputElement.styles,\n css`\n :host {\n ${cssScope}--width: 3em;\n ${cssScope}--height: calc(var(${cssScope}--width) / 2);\n width: var(${cssScope}--width);\n height: var(${cssScope}--height);\n }\n\n :host,\n span {\n display: inline-flex;\n font-size: inherit;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n span {\n width: inherit;\n height: inherit;\n }\n\n input {\n width: inherit;\n height: inherit;\n margin: 0;\n outline: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n position: relative;\n font-size: inherit;\n background: var(${cssvarValues.input}--false);\n border-radius: inherit;\n transition: all 0.3s;\n }\n\n aside {\n pointer-events: none;\n transition: 0.3s;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n font-size: inherit;\n overflow: hidden;\n border-radius: inherit;\n }\n\n aside div {\n height: 100%;\n }\n\n input[disabled] ~ aside {\n filter: brightness(0.87);\n }\n\n .rect div.always {\n display: none;\n }\n\n .always {\n position: absolute;\n }\n\n .rect aside {\n height: 100%;\n width: 100%;\n left: 0;\n }\n\n .rect .true,\n .rect .false {\n width: 50%;\n text-align: center;\n transition: all 0.3s;\n }\n\n .rect input:checked ~ aside div.true,\n .rect .false {\n background-color: var(${cssvarValues.input}--true);\n }\n\n .rect input:checked ~ aside div.false,\n .rect .true {\n background: var(${cssvarValues.input}--false);\n }\n\n .fat aside {\n width: 1.2em;\n height: 1.2em;\n border-radius: 50%;\n background: var(${cssvarValues.input}--control);\n transition: 0.3s;\n left: 0.15em;\n top: 0.15em;\n bottom: 0.15em;\n }\n\n .fat {\n border-radius: 0.75em;\n }\n\n .fat input:checked {\n background: var(${cssvarValues.input}--true);\n }\n\n .fat input:checked ~ aside {\n left: calc(100% - 0.15em - 1.2em);\n right: 0.15em;\n }\n\n .fat input:checked ~ aside div.true,\n .fat div.false {\n display: block;\n }\n\n .fat input:checked ~ aside div.false,\n .fat div.true {\n display: none;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<span class=\"${this.base}\">\n <input @change=\"${this._handleChange}\" ?disabled=\"${this.disabled}\" ?checked=\"${this.checked}\" name=\"${this.name}\" type=\"checkbox\" />\n <aside>\n <div class=\"false\"><slot name=\"false\"></slot></div>\n <div class=\"always\">${htmlSlot()}<slot name=\"always\"></slot></div>\n <div class=\"true\"><slot name=\"true\"></slot></div>\n </aside>\n </span>`;\n }\n\n reset() {\n this.checked = this.def === \"true\";\n this._input.checked = this.checked;\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.checked) {\n this.def = \"true\";\n } else if (this.def === \"true\") {\n this.checked = true;\n }\n }\n\n protected _handleChange() {\n this.checked = this._input.checked;\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.checked, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.checked, composed: true }));\n }\n\n namevalue(): [string, boolean] {\n return [this.name, this.checked];\n }\n}\n\nexport default SwitchInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"switch-input\": SwitchInput;\n }\n}\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { type HTMLTemplate } from "
|
2
|
-
import
|
1
|
+
import { type HTMLTemplate } from "../../lib/templates.js";
|
2
|
+
import { GodownElement } from "../../root.js";
|
3
3
|
declare const colors: {
|
4
4
|
success: string[];
|
5
5
|
info: string[];
|
@@ -12,7 +12,7 @@ declare const colors: {
|
|
12
12
|
*
|
13
13
|
* Inspired by Ant-design.
|
14
14
|
*/
|
15
|
-
export declare class AlertItem extends
|
15
|
+
export declare class AlertItem extends GodownElement {
|
16
16
|
/**
|
17
17
|
* Type of performance.
|
18
18
|
*/
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"alert-item.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/alert-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,YAAY,EAAQ,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAuB,aAAa,EAAE,MAAM,eAAe,CAAC;AAQnE,QAAA,MAAM,MAAM;;;;;;CAMX,CAAC;AAEF;;;;GAIG;AACH,qBACa,SAAU,SAAQ,aAAa;IAC1C;;OAEG;IACS,IAAI,EAAE,MAAM,OAAO,MAAM,GAAG,MAAM,CAAU;IACxD;;OAEG;IACyB,SAAS,SAAQ;IAC7C;;OAEG;IACS,KAAK,SAAM;IACvB;;OAEG;IACS,OAAO,SAAM;IAEzB,MAAM,CAAC,MAAM,4BA0EX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAahC,KAAK;IAOL,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS;CAMvE;AAED,eAAe,SAAS,CAAC;AACzB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
@@ -1,15 +1,9 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
1
|
var AlertItem_1;
|
8
|
-
import {
|
9
|
-
import { css, html, property, unsafeCSS } from "
|
10
|
-
import { htmlSlot, svgX } from "
|
11
|
-
import { constructCSS } from "
|
12
|
-
import
|
2
|
+
import { __decorate } from "tslib";
|
3
|
+
import { css, html, property, unsafeCSS } from "../../deps.js";
|
4
|
+
import { htmlSlot, svgX } from "../../lib/templates.js";
|
5
|
+
import { constructCSS } from "../../lib/utils.js";
|
6
|
+
import { createScope, define, GodownElement } from "../../root.js";
|
13
7
|
const defineName = "alert-item";
|
14
8
|
const cssvarScope = createScope(defineName);
|
15
9
|
const currentColor = "currentColor";
|
@@ -26,7 +20,7 @@ const colors = {
|
|
26
20
|
*
|
27
21
|
* Inspired by Ant-design.
|
28
22
|
*/
|
29
|
-
let AlertItem =
|
23
|
+
let AlertItem = class AlertItem extends GodownElement {
|
30
24
|
constructor() {
|
31
25
|
super(...arguments);
|
32
26
|
/**
|
@@ -46,36 +40,12 @@ let AlertItem = AlertItem_1 = class AlertItem extends ItemsSTD {
|
|
46
40
|
*/
|
47
41
|
this.content = "";
|
48
42
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<strong> ${this.title || htmlSlot("title")}</strong>
|
56
|
-
${this.content || htmlSlot()}
|
57
|
-
</div>
|
58
|
-
<aside class="close" @click="${this.close}">${htmlSlot("close", svgX(), this)}</aside>
|
59
|
-
</main>`;
|
60
|
-
}
|
61
|
-
close() {
|
62
|
-
this.shadowRoot.querySelector(".alert").classList.add("hide");
|
63
|
-
setTimeout(() => {
|
64
|
-
this.remove();
|
65
|
-
}, 250);
|
66
|
-
}
|
67
|
-
static alert(root, option) {
|
68
|
-
const ai = new AlertItem_1();
|
69
|
-
Object.assign(ai, option);
|
70
|
-
root.appendChild(ai);
|
71
|
-
return ai;
|
72
|
-
}
|
73
|
-
};
|
74
|
-
AlertItem.styles = [
|
75
|
-
unsafeCSS(constructCSS(vars, colors, (raw) => {
|
76
|
-
return `.${raw}`;
|
77
|
-
})),
|
78
|
-
css `
|
43
|
+
static { AlertItem_1 = this; }
|
44
|
+
static { this.styles = [
|
45
|
+
unsafeCSS(constructCSS(vars, colors, (raw) => {
|
46
|
+
return `.${raw}`;
|
47
|
+
})),
|
48
|
+
css `
|
79
49
|
:host {
|
80
50
|
${cssvarScope}--padding: .05em .25em .05em .35em;
|
81
51
|
${cssvarScope}--border-width: 0.15em;
|
@@ -143,7 +113,32 @@ AlertItem.styles = [
|
|
143
113
|
stroke: var(${cssvarScope}--color);
|
144
114
|
}
|
145
115
|
`,
|
146
|
-
];
|
116
|
+
]; }
|
117
|
+
render() {
|
118
|
+
if (this.autoclose) {
|
119
|
+
setTimeout(() => this.close(), this.autoclose);
|
120
|
+
}
|
121
|
+
return html `<main class="${this.call} alert">
|
122
|
+
<div>
|
123
|
+
<strong> ${this.title || htmlSlot("title")}</strong>
|
124
|
+
${this.content || htmlSlot()}
|
125
|
+
</div>
|
126
|
+
<aside class="close" @click="${this.close}">${htmlSlot("close", svgX(), this)}</aside>
|
127
|
+
</main>`;
|
128
|
+
}
|
129
|
+
close() {
|
130
|
+
this.shadowRoot.querySelector(".alert").classList.add("hide");
|
131
|
+
setTimeout(() => {
|
132
|
+
this.remove();
|
133
|
+
}, 250);
|
134
|
+
}
|
135
|
+
static alert(root, option) {
|
136
|
+
const ai = new AlertItem_1();
|
137
|
+
Object.assign(ai, option);
|
138
|
+
root.appendChild(ai);
|
139
|
+
return ai;
|
140
|
+
}
|
141
|
+
};
|
147
142
|
__decorate([
|
148
143
|
property()
|
149
144
|
], AlertItem.prototype, "call", void 0);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"alert-item.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/alert-item.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAqB,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,WAAW,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3F,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IACrD,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IAClD,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IACrD,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IACpD,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC;CAC/D,CAAC;AAEF;;;;GAIG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,aAAa;IAArC;;QACL;;WAEG;QACS,S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MAAM,CAAC,KAAK,CAAC,IAAiB,EAAE,MAA0B;QACxD,MAAM,EAAE,GAAG,IAAI,WAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;;AAnHW;IAAX,QAAQ,EAAE;uCAA6C;AAI5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAkB;AAIjC;IAAX,QAAQ,EAAE;wCAAY;AAIX;IAAX,QAAQ,EAAE;0CAAc;AAhBd,SAAS;IADrB,MAAM,CAAC,UAAU,CAAC;GACN,SAAS,CAwHrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["import { css, html, property, unsafeCSS } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate, svgX } from \"../../lib/templates.js\";\nimport { constructCSS } from \"../../lib/utils.js\";\nimport { createScope, define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"alert-item\";\nconst cssvarScope = createScope(defineName);\n\nconst currentColor = \"currentColor\";\n\nconst vars = [\"color\", \"background\", \"border\", \"super\"].map((v) => `${cssvarScope}--${v}`);\nconst colors = {\n success: [\"#3c763d\", \"#dff0d8\", \"#d6e9c6\", \"#2b542c\"],\n info: [\"#31708f\", \"#d9edf7\", \"#bce8f1\", \"#245269\"],\n warning: [\"#8a6d3b\", \"#fcf8e3\", \"#faebcc\", \"#66512c\"],\n danger: [\"#a94442\", \"#f2dede\", \"#ebccd1\", \"#843534\"],\n inherit: [currentColor, \"inherit\", currentColor, currentColor],\n};\n\n/**\n * AlertItem renders a alert.\n *\n * Inspired by Ant-design.\n */\n@define(defineName)\nexport class AlertItem extends GodownElement {\n /**\n * Type of performance.\n */\n @property() call: keyof typeof colors | \"hide\" = \"info\";\n /**\n * Close delay.\n */\n @property({ type: Number }) autoclose = 3000;\n /**\n * Alert title.\n */\n @property() title = \"\";\n /**\n * Alert content.\n */\n @property() content = \"\";\n\n static styles = [\n unsafeCSS(\n constructCSS(vars, colors, (raw) => {\n return `.${raw}`;\n }),\n ),\n css`\n :host {\n ${cssvarScope}--padding: .05em .25em .05em .35em;\n ${cssvarScope}--border-width: 0.15em;\n ${cssvarScope}--border-radius: 0.4em;\n border-radius: var(${cssvarScope}--border-radius);\n margin: 0 auto;\n display: block;\n }\n\n .hide {\n opacity: 0;\n transform: translateY(-100%);\n }\n\n .alert {\n transition: 0.25s;\n display: flex;\n justify-content: space-between;\n padding: var(${cssvarScope}--padding);\n border-radius: inherit;\n border: var(${cssvarScope}--border-width) solid var(${cssvarScope}--border);\n color: var(${cssvarScope}--color);\n background: var(${cssvarScope}--background);\n animation: alert 0.25s ease-in-out;\n }\n\n @keyframes alert {\n 0% {\n opacity: 0;\n transform: translateY(-50%);\n }\n 100% {\n opacity: 1;\n transform: none;\n }\n }\n\n div {\n min-height: 1.5em;\n line-height: 1.5em;\n }\n\n .close {\n height: fit-content;\n width: fit-content;\n border-radius: 50%;\n transition: inherit;\n }\n\n .close:hover {\n backdrop-filter: contrast(115%);\n }\n\n svg {\n display: block;\n height: 1.6em;\n width: 1.6em;\n }\n\n .close:hover path {\n stroke: var(${cssvarScope}--super);\n }\n\n path {\n stroke: var(${cssvarScope}--color);\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n if (this.autoclose) {\n setTimeout(() => this.close(), this.autoclose);\n }\n return html`<main class=\"${this.call} alert\">\n <div>\n <strong> ${this.title || htmlSlot(\"title\")}</strong>\n ${this.content || htmlSlot()}\n </div>\n <aside class=\"close\" @click=\"${this.close}\">${htmlSlot(\"close\", svgX(), this)}</aside>\n </main>`;\n }\n\n close() {\n this.shadowRoot.querySelector(\".alert\").classList.add(\"hide\");\n setTimeout(() => {\n this.remove();\n }, 250);\n }\n\n static alert(root: HTMLElement, option: Partial<AlertItem>): AlertItem {\n const ai = new AlertItem();\n Object.assign(ai, option);\n root.appendChild(ai);\n return ai;\n }\n}\n\nexport default AlertItem;\ndeclare global {\n interface HTMLElementTagNameMap {\n \"alert-item\": AlertItem;\n }\n}\n"]}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { type CSSResultGroup } from "
|
2
|
-
import { type HTMLTemplate } from "
|
3
|
-
import
|
1
|
+
import { type CSSResultGroup } from "../../deps.js";
|
2
|
+
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
+
import { GodownElement } from "../../root.js";
|
4
4
|
/**
|
5
5
|
* CardItem renders a card.
|
6
6
|
*/
|
7
|
-
export declare class CardItem extends
|
7
|
+
export declare class CardItem extends GodownElement {
|
8
8
|
/**
|
9
9
|
* Enable rotate.
|
10
10
|
*/
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"card-item.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/card-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAqC,aAAa,EAAE,MAAM,eAAe,CAAC;AAKjF;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IAC0B,MAAM,UAAS;IAE7B,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAC7B,SAAS,CAAC,MAAM,EAAG,WAAW,CAAC;IAE/C,MAAM,CAAC,MAAM,iBAoEO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAyBhC,SAAS,CAAC,YAAY;IAOtB;;OAEG;IACH,KAAK;IAKL;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU;CAWpC;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
@@ -1,20 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
};
|
7
|
-
import { createScope, cssvarValues, define } from "../root.js";
|
8
|
-
import { css, html, property, query } from "../deps.js";
|
9
|
-
import { htmlSlot } from "../lib/templates.js";
|
10
|
-
import { ifValue } from "../lib/directives.js";
|
11
|
-
import ItemsSTD from "./std.js";
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { css, html, property, query } from "../../deps.js";
|
3
|
+
import { ifValue } from "../../lib/directives.js";
|
4
|
+
import { htmlSlot } from "../../lib/templates.js";
|
5
|
+
import { createScope, cssvarValues, define, GodownElement } from "../../root.js";
|
12
6
|
const defineName = "card-item";
|
13
7
|
const cssvarScope = createScope(defineName);
|
14
8
|
/**
|
15
9
|
* CardItem renders a card.
|
16
10
|
*/
|
17
|
-
let CardItem = class CardItem extends
|
11
|
+
let CardItem = class CardItem extends GodownElement {
|
18
12
|
constructor() {
|
19
13
|
super(...arguments);
|
20
14
|
/**
|
@@ -22,56 +16,9 @@ let CardItem = class CardItem extends ItemsSTD {
|
|
22
16
|
*/
|
23
17
|
this.rotate = false;
|
24
18
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
return html `<div>
|
29
|
-
<aside></aside>
|
30
|
-
<main>
|
31
|
-
${ifValue(this.querySlot(HEADER), html `
|
32
|
-
${htmlSlot(HEADER)}
|
33
|
-
<hr />
|
34
|
-
`)}
|
35
|
-
${htmlSlot()}
|
36
|
-
${ifValue(this.querySlot(FOOTER), html `
|
37
|
-
<hr />
|
38
|
-
${htmlSlot(FOOTER)}
|
39
|
-
`)}
|
40
|
-
</main>
|
41
|
-
</div>`;
|
42
|
-
}
|
43
|
-
firstUpdated() {
|
44
|
-
if (this.rotate) {
|
45
|
-
this.addEvent(this._main, "mousemove", this._drawRotate.bind(this));
|
46
|
-
this.addEvent(this._aside, "mouseleave", this.reset.bind(this));
|
47
|
-
}
|
48
|
-
}
|
49
|
-
/**
|
50
|
-
* Cancel the aside offset.
|
51
|
-
*/
|
52
|
-
reset() {
|
53
|
-
this._main.style.transition = ".5s";
|
54
|
-
this._main.style.transform = "none";
|
55
|
-
}
|
56
|
-
/**
|
57
|
-
* Offset aside.
|
58
|
-
* @param e Mouse move event.
|
59
|
-
*/
|
60
|
-
_drawRotate(e) {
|
61
|
-
const { left, top, width, height } = this._main.getBoundingClientRect();
|
62
|
-
const { clientX, clientY } = e;
|
63
|
-
const offsetX = clientX - left;
|
64
|
-
const offsetY = clientY - top;
|
65
|
-
const rotate = 30;
|
66
|
-
const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;
|
67
|
-
const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;
|
68
|
-
this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
|
69
|
-
this._main.style.transition = "none";
|
70
|
-
}
|
71
|
-
};
|
72
|
-
CardItem.styles = [
|
73
|
-
ItemsSTD.styles,
|
74
|
-
css `
|
19
|
+
static { this.styles = [
|
20
|
+
GodownElement.styles,
|
21
|
+
css `
|
75
22
|
:host {
|
76
23
|
${cssvarScope}--offset: .25em;
|
77
24
|
${cssvarScope}--background: var(${cssvarValues.main});
|
@@ -137,7 +84,54 @@ CardItem.styles = [
|
|
137
84
|
padding: var(${cssvarScope}--padding);
|
138
85
|
}
|
139
86
|
`,
|
140
|
-
];
|
87
|
+
]; }
|
88
|
+
render() {
|
89
|
+
const HEADER = "header";
|
90
|
+
const FOOTER = "footer";
|
91
|
+
return html `<div>
|
92
|
+
<aside></aside>
|
93
|
+
<main>
|
94
|
+
${ifValue(this.querySlot(HEADER), html `
|
95
|
+
${htmlSlot(HEADER)}
|
96
|
+
<hr />
|
97
|
+
`)}
|
98
|
+
${htmlSlot()}
|
99
|
+
${ifValue(this.querySlot(FOOTER), html `
|
100
|
+
<hr />
|
101
|
+
${htmlSlot(FOOTER)}
|
102
|
+
`)}
|
103
|
+
</main>
|
104
|
+
</div>`;
|
105
|
+
}
|
106
|
+
firstUpdated() {
|
107
|
+
if (this.rotate) {
|
108
|
+
this.addEvent(this._main, "mousemove", this._drawRotate.bind(this));
|
109
|
+
this.addEvent(this._aside, "mouseleave", this.reset.bind(this));
|
110
|
+
}
|
111
|
+
}
|
112
|
+
/**
|
113
|
+
* Cancel the aside offset.
|
114
|
+
*/
|
115
|
+
reset() {
|
116
|
+
this._main.style.transition = ".5s";
|
117
|
+
this._main.style.transform = "none";
|
118
|
+
}
|
119
|
+
/**
|
120
|
+
* Offset aside.
|
121
|
+
* @param e Mouse move event.
|
122
|
+
*/
|
123
|
+
_drawRotate(e) {
|
124
|
+
const { left, top, width, height } = this._main.getBoundingClientRect();
|
125
|
+
const { clientX, clientY } = e;
|
126
|
+
const offsetX = clientX - left;
|
127
|
+
const offsetY = clientY - top;
|
128
|
+
const rotate = 30;
|
129
|
+
const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;
|
130
|
+
const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;
|
131
|
+
this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
|
132
|
+
this._main.style.transition = "none";
|
133
|
+
}
|
134
|
+
};
|
141
135
|
__decorate([
|
142
136
|
property({ type: Boolean })
|
143
137
|
], CardItem.prototype, "rotate", void 0);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"card-item.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/card-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjF,MAAM,UAAU,GAAG,WAAW,CAAC;AAC/B,MAAM,W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QAAQ,CAsIpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../deps.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"card-item\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * CardItem renders a card.\n */\n@define(defineName)\nexport class CardItem extends GodownElement {\n /**\n * Enable rotate.\n */\n @property({ type: Boolean }) rotate = false;\n\n @query(\"main\") protected _main!: HTMLElement;\n @query(\"aside\") protected _aside!: HTMLElement;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n ${cssvarScope}--offset: .25em;\n ${cssvarScope}--background: var(${cssvarValues.main});\n ${cssvarScope}--wapper-background: none;\n ${cssvarScope}--outline: 0;\n ${cssvarScope}--box-shadow: 0 .05em .4em 0 rgb(var(${cssvarValues.mainRGB}) / 60%);\n ${cssvarScope}--hr-width: 100%;\n ${cssvarScope}--hr-height: .05em;\n ${cssvarScope}--padding: .75em;\n margin: auto;\n display: block;\n width: fit-content;\n color: var(${cssvarValues.text});\n border-radius: 0.2em;\n }\n\n * {\n border-radius: inherit;\n min-height: inherit;\n min-width: inherit;\n }\n\n main {\n outline: var(${cssvarScope}--outline);\n box-shadow: var(${cssvarScope}--box-shadow);\n background: var(${cssvarScope}--background);\n z-index: 2;\n position: relative;\n }\n\n aside {\n box-sizing: content-box;\n z-index: 0;\n height: 100%;\n width: 100%;\n position: absolute;\n background: var(${cssvarScope}--wapper-background);\n filter: blur(1em);\n padding: var(${cssvarScope}--offset);\n margin: calc(-1 * var(${cssvarScope}--offset));\n }\n\n div {\n width: fit-content;\n position: relative;\n }\n\n i {\n position: absolute;\n }\n\n hr {\n width: var(${cssvarScope}--hr-width);\n height: var(${cssvarScope}--hr-height);\n margin: auto;\n display: block;\n background: currentColor;\n opacity: 0.5;\n }\n\n slot {\n display: block;\n padding: var(${cssvarScope}--padding);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n const HEADER = \"header\";\n const FOOTER = \"footer\";\n return html`<div>\n <aside></aside>\n <main>\n ${ifValue(\n this.querySlot(HEADER) as unknown as boolean,\n html`\n ${htmlSlot(HEADER)}\n <hr />\n `,\n )}\n ${htmlSlot()}\n ${ifValue(\n this.querySlot(FOOTER) as unknown as boolean,\n html`\n <hr />\n ${htmlSlot(FOOTER)}\n `,\n )}\n </main>\n </div>`;\n }\n\n protected firstUpdated() {\n if (this.rotate) {\n this.addEvent(this._main, \"mousemove\", this._drawRotate.bind(this));\n this.addEvent(this._aside, \"mouseleave\", this.reset.bind(this));\n }\n }\n\n /**\n * Cancel the aside offset.\n */\n reset() {\n this._main.style.transition = \".5s\";\n this._main.style.transform = \"none\";\n }\n\n /**\n * Offset aside.\n * @param e Mouse move event.\n */\n protected _drawRotate(e: MouseEvent) {\n const { left, top, width, height } = this._main.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n const rotate = 30;\n const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;\n const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;\n this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;\n this._main.style.transition = \"none\";\n }\n}\n\nexport default CardItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"card-item\": CardItem;\n }\n}\n"]}
|