godown 2.6.2 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{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/event-collection.d.ts +1 -1
- package/lib/event-collection.d.ts.map +1 -1
- package/lib/templates.d.ts +2 -0
- package/lib/templates.d.ts.map +1 -1
- package/lib/templates.js +4 -0
- package/lib/templates.js.map +1 -1
- package/lib/utils.d.ts +0 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +0 -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 -33
- 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 -25
- package/react/index.d.ts.map +1 -1
- package/react/index.js +52 -56
- 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 +26 -0
- package/supers/anchor.d.ts.map +1 -0
- package/{web-components/a/super-a.js → supers/anchor.js} +27 -22
- 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} +3 -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 -10
- package/web-components/button/button.d.ts.map +1 -0
- package/web-components/button/{base-button.js → button.js} +22 -46
- 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} +8 -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} +9 -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 -25
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +24 -26
- 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.d.ts +22 -0
- 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 +4 -3
- package/web-components/layout/nav-layout.d.ts.map +1 -1
- package/web-components/layout/nav-layout.js +4 -3
- 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} +9 -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/router/router-a.d.ts +25 -0
- package/web-components/router/router-a.d.ts.map +1 -0
- package/web-components/router/router-a.js +70 -0
- 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 +22 -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} +8 -7
- package/web-components/text/overbreath.d.ts.map +1 -0
- package/web-components/text/{overbreath-text.js → overbreath.js} +15 -14
- package/web-components/text/overbreath.js.map +1 -0
- package/web-components/text/time.d.ts +60 -0
- package/web-components/text/time.d.ts.map +1 -0
- package/web-components/{items/time-bar.js → text/time.js} +53 -36
- package/web-components/text/time.js.map +1 -0
- package/web-components/text/{typewriter-text.d.ts → typewriter.d.ts} +10 -9
- package/web-components/text/typewriter.d.ts.map +1 -0
- package/web-components/text/{typewriter-text.js → typewriter.js} +23 -22
- package/web-components/text/typewriter.js.map +1 -0
- package/web-components/tooltip/tooltip.d.ts +26 -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} +7 -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/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/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 +0 -33
- package/web-components/a/link-a.d.ts.map +0 -1
- package/web-components/a/link-a.js +0 -81
- 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 +0 -54
- 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 +0 -20
- package/web-components/layout/divider-line.d.ts.map +0 -1
- package/web-components/layout/divider-line.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/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,28 +1,50 @@
|
|
1
|
-
import { type CSSResultGroup } from "
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
import { type CSSResultGroup } from "../../.deps.js";
|
2
|
+
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
+
import { GodownInput } from "../../supers/input.js";
|
4
|
+
/**
|
5
|
+
* {@linkcode Input }.
|
6
|
+
*/
|
7
|
+
export declare class Input extends GodownInput {
|
8
|
+
/**
|
9
|
+
* Input sccept.
|
10
|
+
*/
|
11
|
+
accept: any;
|
12
|
+
/**
|
13
|
+
* Value.
|
14
|
+
*/
|
15
|
+
value: string | File | FileList;
|
16
|
+
/**
|
17
|
+
* Only single files are allowed to be selected.
|
18
|
+
*/
|
19
|
+
only: boolean;
|
20
|
+
/**
|
21
|
+
* Input min.
|
22
|
+
*/
|
23
|
+
min: number;
|
24
|
+
/**
|
25
|
+
* Input max.
|
26
|
+
*/
|
27
|
+
max: number;
|
28
|
+
/**
|
29
|
+
* Input step.
|
30
|
+
*/
|
31
|
+
step: number;
|
12
32
|
_input: HTMLInputElement;
|
13
|
-
|
33
|
+
_ranged: HTMLElement;
|
14
34
|
static styles: CSSResultGroup;
|
15
|
-
|
16
|
-
nameValue: () => [string, any];
|
17
|
-
reset(): void;
|
18
|
-
protected _handleInput(e: any): void;
|
19
|
-
protected _handleChange(): void;
|
35
|
+
protected render(): HTMLTemplate;
|
20
36
|
connectedCallback(): void;
|
21
|
-
protected _initName(): void;
|
22
|
-
protected _compositionCheck(): void;
|
23
|
-
protected _changeInputType(t: InputType): void;
|
24
|
-
focus(options?: FocusOptions): void;
|
25
37
|
protected firstUpdated(): void;
|
26
|
-
protected
|
38
|
+
protected _handleRange(e: any | Event): void;
|
39
|
+
protected _handleFile(e: any | Event): void;
|
40
|
+
reset(): void;
|
41
|
+
protected _typeSwitcher(): HTMLTemplate;
|
42
|
+
}
|
43
|
+
export default Input;
|
44
|
+
declare global {
|
45
|
+
interface HTMLElementTagNameMap {
|
46
|
+
"base-input": Input;
|
47
|
+
"g-input": Input;
|
48
|
+
}
|
27
49
|
}
|
28
50
|
//# sourceMappingURL=input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD;;GAEG;AACH,qBACa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACS,MAAM,MAAa;IAC/B;;OAEG;IACS,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAa;IACxD;;OAEG;IAC0B,IAAI,UAAS;IAC1C;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACyB,GAAG,SAAO;IACtC;;OAEG;IACyB,IAAI,SAAK;IAEpB,MAAM,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IAExC,MAAM,CAAC,MAAM,iBA8GO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAahC,iBAAiB;IAejB,SAAS,CAAC,YAAY;IAOtB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK;IAMrC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK;IAKpC,KAAK;IAeL,SAAS,CAAC,aAAa,IAAI,YAAY;CAYxC;AAED,eAAe,KAAK,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,KAAK,CAAC;QACpB,SAAS,EAAE,KAAK,CAAC;KAClB;CACF"}
|
@@ -1,117 +1,247 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, property } from "
|
3
|
-
import {
|
4
|
-
|
2
|
+
import { css, html, property, query } from "../../.deps.js";
|
3
|
+
import { define } from "../../decorators/define.js";
|
4
|
+
import { htmlSlot } from "../../lib/templates.js";
|
5
|
+
import { GodownInput } from "../../supers/input.js";
|
6
|
+
import { cssvar, cssvarValues } from "../../supers/root.js";
|
7
|
+
const defineName = "input";
|
8
|
+
/**
|
9
|
+
* {@linkcode Input }.
|
10
|
+
*/
|
11
|
+
let Input = class Input extends GodownInput {
|
5
12
|
constructor() {
|
6
13
|
super(...arguments);
|
7
|
-
|
8
|
-
|
14
|
+
/**
|
15
|
+
* Input sccept.
|
16
|
+
*/
|
17
|
+
this.accept = undefined;
|
18
|
+
/**
|
19
|
+
* Value.
|
20
|
+
*/
|
9
21
|
this.value = undefined;
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
this.
|
14
|
-
|
22
|
+
/**
|
23
|
+
* Only single files are allowed to be selected.
|
24
|
+
*/
|
25
|
+
this.only = false;
|
26
|
+
/**
|
27
|
+
* Input min.
|
28
|
+
*/
|
29
|
+
this.min = 0;
|
30
|
+
/**
|
31
|
+
* Input max.
|
32
|
+
*/
|
33
|
+
this.max = 100;
|
34
|
+
/**
|
35
|
+
* Input step.
|
36
|
+
*/
|
37
|
+
this.step = 1;
|
15
38
|
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
this.value = e.target.value?.trim();
|
26
|
-
if (this.compositing) {
|
27
|
-
return;
|
39
|
+
render() {
|
40
|
+
if (this.type === "range") {
|
41
|
+
return html `<div class="range">
|
42
|
+
<input id="input" type="range" min="${this.min}" max="${this.max}" step="${this.step}" @input="${this._handleRange}" @change="${this._handleRange}" />
|
43
|
+
<b></b>
|
44
|
+
<b>
|
45
|
+
<i></i>
|
46
|
+
</b>
|
47
|
+
</div>`;
|
28
48
|
}
|
29
|
-
|
30
|
-
this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
|
31
|
-
}
|
32
|
-
_handleChange() {
|
33
|
-
this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
|
49
|
+
return html `<label for="input"> ${htmlSlot("pre")} ${this._typeSwitcher()} ${htmlSlot("suf")} </label>`;
|
34
50
|
}
|
35
51
|
connectedCallback() {
|
36
52
|
super.connectedCallback();
|
37
|
-
if (
|
38
|
-
this.
|
53
|
+
if (this.type === "file") {
|
54
|
+
this.value = null;
|
39
55
|
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
if (!this.name) {
|
47
|
-
if (this.label || this.type) {
|
48
|
-
this.name = this.label || this.type;
|
56
|
+
else {
|
57
|
+
if (!this.def) {
|
58
|
+
this.def = this.value || "";
|
59
|
+
}
|
60
|
+
if (!this.value) {
|
61
|
+
this.value = this.def;
|
49
62
|
}
|
50
63
|
}
|
64
|
+
this._initName();
|
51
65
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
});
|
57
|
-
this.addEvent(this._input, "compositionend", (e) => {
|
58
|
-
this.compositing = false;
|
59
|
-
this._handleInput(e);
|
60
|
-
});
|
66
|
+
firstUpdated() {
|
67
|
+
super.firstUpdated();
|
68
|
+
if (this.type === "range") {
|
69
|
+
this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + "%";
|
61
70
|
}
|
62
71
|
}
|
63
|
-
|
64
|
-
this.
|
72
|
+
_handleRange(e) {
|
73
|
+
this.value = e.target.value;
|
74
|
+
this._ranged.style.width = (100 * parseInt(e.target.value)) / (this.max - this.min) + "%";
|
75
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.value }));
|
65
76
|
}
|
66
|
-
|
67
|
-
this.
|
77
|
+
_handleFile(e) {
|
78
|
+
this.value = !this.only ? e.target.files : e.target.files[0];
|
79
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
|
68
80
|
}
|
69
|
-
|
70
|
-
this.
|
71
|
-
|
81
|
+
reset() {
|
82
|
+
if (this.type === "file") {
|
83
|
+
this.value = null;
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
if (this.type === "range") {
|
87
|
+
this._input.value = this.def || ((this.max - this.min) / 2).toString();
|
88
|
+
this.value = this._input.value;
|
89
|
+
this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + "%";
|
90
|
+
}
|
91
|
+
else {
|
92
|
+
this._input.value = this.def.toString();
|
93
|
+
this.value = this.def;
|
94
|
+
}
|
72
95
|
}
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
96
|
+
_typeSwitcher() {
|
97
|
+
switch (this.type) {
|
98
|
+
case "file":
|
99
|
+
return html `<input id="input" class="input" type="file" accept="${this.accept}" ?multiple="${!this.only}" @change="${this._handleFile}" />${htmlSlot()}`;
|
100
|
+
case "number":
|
101
|
+
return html `<input .value="${this.value}" ?autofocus="${this.autofocus}" id="input" class="input" type="number" placeholder="${this.pla}" min="${this.min}" max="${this.max}" @input="${this._handleInput}" @change="${this._handleChange}" />`;
|
102
|
+
default:
|
103
|
+
return html `<input .value="${this.value}" ?autofocus="${this.autofocus}" id="input" class="input" type="${this.type}" placeholder="${this.pla}" @input="${this._handleInput}" @change="${this._handleChange}" />`;
|
77
104
|
}
|
78
|
-
return target.value;
|
79
105
|
}
|
80
|
-
}
|
81
|
-
|
82
|
-
|
106
|
+
};
|
107
|
+
Input.styles = [
|
108
|
+
GodownInput.styles,
|
83
109
|
css `
|
84
110
|
:host {
|
85
|
-
|
111
|
+
width: var(${cssvarValues.input}--width);
|
112
|
+
height: var(${cssvarValues.input}--height);
|
113
|
+
background: var(${cssvarValues.input}--background);
|
114
|
+
margin: var(${cssvarValues.input}--outline-width);
|
115
|
+
outline: var(${cssvarValues.input}--outline);
|
116
|
+
border-radius: var(${cssvarValues.input}--radius);
|
86
117
|
}
|
87
|
-
|
118
|
+
|
119
|
+
input[type="file"] {
|
88
120
|
display: none;
|
89
121
|
}
|
90
|
-
|
91
|
-
|
92
|
-
|
122
|
+
|
123
|
+
label,
|
124
|
+
div {
|
125
|
+
width: 100%;
|
126
|
+
display: flex;
|
127
|
+
align-items: center;
|
128
|
+
}
|
129
|
+
|
130
|
+
* {
|
131
|
+
border-radius: inherit;
|
132
|
+
cursor: inherit;
|
133
|
+
}
|
134
|
+
|
135
|
+
input {
|
136
|
+
box-sizing: border-box;
|
137
|
+
height: 100%;
|
138
|
+
width: 100%;
|
139
|
+
margin: 0;
|
140
|
+
color: inherit;
|
141
|
+
background: transparent;
|
142
|
+
padding: 0 0.25em;
|
143
|
+
border-radius: 0.25em;
|
144
|
+
}
|
145
|
+
`,
|
146
|
+
css `
|
147
|
+
:host([type="range"]) {
|
148
|
+
height: auto !important;
|
149
|
+
margin: 0.3em 0;
|
150
|
+
background: var(${cssvarValues.input}--false);
|
151
|
+
border-radius: 2em;
|
152
|
+
}
|
153
|
+
|
154
|
+
.range b:nth-of-type(1) {
|
155
|
+
width: 1em;
|
156
|
+
left: 0;
|
157
|
+
background: var(${cssvarValues.input}--true);
|
158
|
+
border-top-right-radius: 0;
|
159
|
+
border-bottom-right-radius: 0;
|
160
|
+
}
|
161
|
+
|
162
|
+
.range b {
|
163
|
+
pointer-events: none;
|
164
|
+
width: calc(100% - 1em);
|
165
|
+
height: 100%;
|
166
|
+
left: 1em;
|
167
|
+
position: absolute;
|
168
|
+
}
|
169
|
+
|
170
|
+
.range {
|
171
|
+
height: fit-content;
|
172
|
+
position: relative;
|
173
|
+
display: inline-flex;
|
174
|
+
justify-content: center;
|
175
|
+
align-items: center;
|
176
|
+
}
|
177
|
+
|
178
|
+
.range input {
|
179
|
+
padding: 0;
|
180
|
+
height: 0.6em;
|
181
|
+
margin: 0px -0.5em;
|
182
|
+
appearance: none;
|
183
|
+
-webkit-appearance: none;
|
184
|
+
outline: none;
|
185
|
+
background: transparent;
|
186
|
+
}
|
187
|
+
|
188
|
+
.range i {
|
189
|
+
position: absolute;
|
190
|
+
left: 0;
|
191
|
+
width: 50%;
|
192
|
+
height: 100%;
|
193
|
+
pointer-events: none;
|
194
|
+
background: var(${cssvarValues.input}--true);
|
195
|
+
border-top-left-radius: 0;
|
196
|
+
border-bottom-left-radius: 0;
|
197
|
+
}
|
198
|
+
|
199
|
+
.range input::-webkit-slider-runnable-track {
|
200
|
+
height: 0.6em;
|
201
|
+
}
|
202
|
+
|
203
|
+
.range input::-webkit-slider-thumb {
|
204
|
+
z-index: 1;
|
205
|
+
appearance: none;
|
206
|
+
-webkit-appearance: none;
|
207
|
+
position: relative;
|
208
|
+
height: 1.2em;
|
209
|
+
width: 1.2em;
|
210
|
+
margin-top: -0.3em;
|
211
|
+
background: var(${cssvarValues.input}--control);
|
212
|
+
border-radius: 50%;
|
213
|
+
border: solid 0.125em var(${cssvarValues.input}--control-edge);
|
214
|
+
box-shadow: 0 0.1em 0.1em var(${cssvar}--shadow);
|
93
215
|
}
|
94
216
|
`,
|
95
217
|
];
|
96
|
-
__decorate([
|
97
|
-
property({ reflect: true })
|
98
|
-
], InputElement.prototype, "type", void 0);
|
99
218
|
__decorate([
|
100
219
|
property()
|
101
|
-
],
|
220
|
+
], Input.prototype, "accept", void 0);
|
102
221
|
__decorate([
|
103
222
|
property()
|
104
|
-
],
|
223
|
+
], Input.prototype, "value", void 0);
|
105
224
|
__decorate([
|
106
|
-
property({
|
107
|
-
],
|
225
|
+
property({ type: Boolean })
|
226
|
+
], Input.prototype, "only", void 0);
|
108
227
|
__decorate([
|
109
|
-
property()
|
110
|
-
],
|
228
|
+
property({ type: Number })
|
229
|
+
], Input.prototype, "min", void 0);
|
230
|
+
__decorate([
|
231
|
+
property({ type: Number })
|
232
|
+
], Input.prototype, "max", void 0);
|
233
|
+
__decorate([
|
234
|
+
property({ type: Number })
|
235
|
+
], Input.prototype, "step", void 0);
|
111
236
|
__decorate([
|
112
|
-
|
113
|
-
],
|
237
|
+
query("#input")
|
238
|
+
], Input.prototype, "_input", void 0);
|
114
239
|
__decorate([
|
115
|
-
|
116
|
-
],
|
240
|
+
query(".range i")
|
241
|
+
], Input.prototype, "_ranged", void 0);
|
242
|
+
Input = __decorate([
|
243
|
+
define(defineName)
|
244
|
+
], Input);
|
245
|
+
export { Input };
|
246
|
+
export default Input;
|
117
247
|
//# sourceMappingURL=input.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI5D,MA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AAC;IAC9B,CAAC;IAES,YAAY;QACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAES,WAAW,CAAC,CAAQ;QAC5B,MAAM,MAAM,GAAG,CAAC,CAAC,MAA0B,CAAC;QAC5C,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;;AA3FM,mBAAM,GAAG;IACd,aAAa,CAAC,MAAM;IACpB,GAAG,CAAA;;;;;;;;gCAQyB,YAAY,CAAC,KAAK;;;KAG7C;CACgB,AAdN,CAcO;AAzBS;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAA0B;AAC1C;IAAX,QAAQ,EAAE;0CAA0B;AACzB;IAAX,QAAQ,EAAE;2CAAiC;AACf;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAY;AAC5B;IAAX,QAAQ,EAAE;yCAAU;AACQ;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAA0B;AACV;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAmB","sourcesContent":["import { css, type CSSResultGroup, property } from \"../../deps.js\";\nimport { cssvarValues, GodownElement } from \"../../root.js\";\n\nexport type InputType = \"hidden\" | \"text\" | \"search\" | \"tel\" | \"url\" | \"email\" | \"password\" | \"datetime\" | \"date\" | \"month\" | \"week\" | \"time\" | \"datetime-local\" | \"number\" | \"range\" | \"color\" | \"checkbox\" | \"radio\" | \"file\" | \"image\";\n\nexport class InputElement extends GodownElement {\n @property({ reflect: true }) type: InputType = \"text\";\n @property() name: string = undefined;\n @property() value: string | any = undefined;\n @property({ reflect: true }) label = \"\";\n @property() def = \"\";\n @property({ reflect: true }) pla?: string = undefined;\n @property({ type: Boolean, reflect: true }) autofocus = false;\n\n _input: HTMLInputElement;\n compositing: boolean;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n display: flex;\n }\n ::-ms-reveal {\n display: none;\n }\n ::-webkit-calendar-picker-indicator {\n background-color: var(${cssvarValues.input}-true);\n border-radius: 0.1rem;\n }\n `,\n ] as CSSResultGroup;\n\n namevalue(): [string, any] {\n return [this.name, this.value];\n }\n\n nameValue = () => this.namevalue();\n\n reset() {\n this.value = this.def;\n this._input.value = this.def;\n }\n\n protected _handleInput(e: any) {\n e.stopPropagation();\n this.value = e.target.value?.trim();\n if (this.compositing) {\n return;\n }\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 protected _handleChange() {\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value, composed: true }));\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.def) {\n this.def = this.value || \"\";\n }\n if (!this.value) {\n this.value = this.def;\n }\n this._initName();\n }\n\n protected _initName() {\n if (!this.name) {\n if (this.label || this.type) {\n this.name = this.label || this.type;\n }\n }\n }\n\n protected _compositionCheck() {\n if (this._input) {\n this.addEvent(this._input, \"compositionstart\", () => {\n this.compositing = true;\n });\n this.addEvent(this._input, \"compositionend\", (e: MouseEvent) => {\n this.compositing = false;\n this._handleInput(e);\n });\n }\n }\n\n protected _changeInputType(t: InputType) {\n this._input.type = t;\n }\n\n focus(options?: FocusOptions) {\n this._input?.focus(options);\n }\n\n protected firstUpdated() {\n this._compositionCheck();\n this.reset();\n }\n\n protected targetValue(e: Event): string | any {\n const target = e.target as HTMLInputElement;\n if (target.value.trim) {\n return target.value.trim();\n }\n return target.value;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources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QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAAU;AAEpB;IAAhB,KAAK,CAAC,QAAQ,CAAC;qCAA0B;AACvB;IAAlB,KAAK,CAAC,UAAU,CAAC;sCAAsB;AA3B7B,KAAK;IADjB,MAAM,CAAC,UAAU,CAAC;GACN,KAAK,CAsNjB;;AAED,eAAe,KAAK,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { GodownInput } from \"../../supers/input.js\";\nimport { cssvar, cssvarValues } from \"../../supers/root.js\";\n\nconst defineName = \"input\";\n\n/**\n * {@linkcode Input }.\n */\n@define(defineName)\nexport class Input extends GodownInput {\n /**\n * Input sccept.\n */\n @property() accept = undefined;\n /**\n * Value.\n */\n @property() value: string | File | FileList = undefined;\n /**\n * Only single files are allowed to be selected.\n */\n @property({ type: Boolean }) only = false;\n /**\n * Input min.\n */\n @property({ type: Number }) min = 0;\n /**\n * Input max.\n */\n @property({ type: Number }) max = 100;\n /**\n * Input step.\n */\n @property({ type: Number }) step = 1;\n\n @query(\"#input\") _input: HTMLInputElement;\n @query(\".range i\") _ranged: HTMLElement;\n\n static styles = [\n GodownInput.styles,\n css`\n :host {\n width: var(${cssvarValues.input}--width);\n height: var(${cssvarValues.input}--height);\n background: var(${cssvarValues.input}--background);\n margin: var(${cssvarValues.input}--outline-width);\n outline: var(${cssvarValues.input}--outline);\n border-radius: var(${cssvarValues.input}--radius);\n }\n\n input[type=\"file\"] {\n display: none;\n }\n\n label,\n div {\n width: 100%;\n display: flex;\n align-items: center;\n }\n\n * {\n border-radius: inherit;\n cursor: inherit;\n }\n\n input {\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n margin: 0;\n color: inherit;\n background: transparent;\n padding: 0 0.25em;\n border-radius: 0.25em;\n }\n `,\n css`\n :host([type=\"range\"]) {\n height: auto !important;\n margin: 0.3em 0;\n background: var(${cssvarValues.input}--false);\n border-radius: 2em;\n }\n\n .range b:nth-of-type(1) {\n width: 1em;\n left: 0;\n background: var(${cssvarValues.input}--true);\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n .range b {\n pointer-events: none;\n width: calc(100% - 1em);\n height: 100%;\n left: 1em;\n position: absolute;\n }\n\n .range {\n height: fit-content;\n position: relative;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n }\n\n .range input {\n padding: 0;\n height: 0.6em;\n margin: 0px -0.5em;\n appearance: none;\n -webkit-appearance: none;\n outline: none;\n background: transparent;\n }\n\n .range i {\n position: absolute;\n left: 0;\n width: 50%;\n height: 100%;\n pointer-events: none;\n background: var(${cssvarValues.input}--true);\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n .range input::-webkit-slider-runnable-track {\n height: 0.6em;\n }\n\n .range input::-webkit-slider-thumb {\n z-index: 1;\n appearance: none;\n -webkit-appearance: none;\n position: relative;\n height: 1.2em;\n width: 1.2em;\n margin-top: -0.3em;\n background: var(${cssvarValues.input}--control);\n border-radius: 50%;\n border: solid 0.125em var(${cssvarValues.input}--control-edge);\n box-shadow: 0 0.1em 0.1em var(${cssvar}--shadow);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n if (this.type === \"range\") {\n return html`<div class=\"range\">\n <input id=\"input\" type=\"range\" min=\"${this.min}\" max=\"${this.max}\" step=\"${this.step}\" @input=\"${this._handleRange}\" @change=\"${this._handleRange}\" />\n <b></b>\n <b>\n <i></i>\n </b>\n </div>`;\n }\n return html`<label for=\"input\"> ${htmlSlot(\"pre\")} ${this._typeSwitcher()} ${htmlSlot(\"suf\")} </label>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.type === \"file\") {\n this.value = null;\n } else {\n if (!this.def) {\n this.def = (this.value as string) || \"\";\n }\n if (!this.value) {\n this.value = this.def;\n }\n }\n this._initName();\n }\n\n protected firstUpdated() {\n super.firstUpdated();\n if (this.type === \"range\") {\n this._ranged.style.width = 100 * (parseInt(this.value as string) / (this.max - this.min)) + \"%\";\n }\n }\n\n protected _handleRange(e: any | Event) {\n this.value = e.target.value;\n this._ranged.style.width = (100 * parseInt(e.target.value)) / (this.max - this.min) + \"%\";\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.value }));\n }\n\n protected _handleFile(e: any | Event) {\n this.value = !this.only ? e.target.files : e.target.files[0];\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value }));\n }\n\n reset() {\n if (this.type === \"file\") {\n this.value = null;\n return;\n }\n if (this.type === \"range\") {\n this._input.value = this.def || ((this.max - this.min) / 2).toString();\n this.value = this._input.value;\n this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + \"%\";\n } else {\n this._input.value = this.def.toString();\n this.value = this.def;\n }\n }\n\n protected _typeSwitcher(): HTMLTemplate {\n switch (this.type) {\n case \"file\":\n return html`<input id=\"input\" class=\"input\" type=\"file\" accept=\"${this.accept}\" ?multiple=\"${!this.only}\" @change=\"${this._handleFile}\" />${htmlSlot()}`;\n\n case \"number\":\n return html`<input .value=\"${this.value}\" ?autofocus=\"${this.autofocus}\" id=\"input\" class=\"input\" type=\"number\" placeholder=\"${this.pla}\" min=\"${this.min}\" max=\"${this.max}\" @input=\"${this._handleInput}\" @change=\"${this._handleChange}\" />`;\n\n default:\n return html`<input .value=\"${this.value}\" ?autofocus=\"${this.autofocus}\" id=\"input\" class=\"input\" type=\"${this.type}\" placeholder=\"${this.pla}\" @input=\"${this._handleInput}\" @change=\"${this._handleChange}\" />`;\n }\n }\n}\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"base-input\": Input;\n \"g-input\": Input;\n }\n}\n"]}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { type CSSResultGroup } from "
|
1
|
+
import { type CSSResultGroup } from "../../.deps.js";
|
2
2
|
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
-
import {
|
3
|
+
import { GodownInput } from "../../supers/input.js";
|
4
4
|
/**
|
5
|
-
* LabelInput renders label and input.
|
5
|
+
* {@linkcode LabelInput } renders label and input.
|
6
6
|
*
|
7
7
|
* When there is a label, the layout will be adjusted according to the width of the screen.
|
8
8
|
*
|
9
9
|
* Otherwise it behaves similarly to the `BaseInput`.
|
10
10
|
*/
|
11
|
-
export declare class LabelInput extends
|
11
|
+
export declare class LabelInput extends GodownInput {
|
12
12
|
/**
|
13
13
|
* Conditions for adjust layout.
|
14
14
|
*/
|
@@ -23,6 +23,7 @@ export default LabelInput;
|
|
23
23
|
declare global {
|
24
24
|
interface HTMLElementTagNameMap {
|
25
25
|
"label-input": LabelInput;
|
26
|
+
"g-label-input": LabelInput;
|
26
27
|
}
|
27
28
|
}
|
28
29
|
//# sourceMappingURL=label-input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"label-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/label-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,
|
1
|
+
{"version":3,"file":"label-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/label-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAuB,KAAK,YAAY,EAAU,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAgCpD;;;;;;GAMG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACS,MAAM,SAAW;IAEb,MAAM,EAAE,gBAAgB,CAAC;IAEzC,MAAM,CAAC,MAAM,iBA4DO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY,EAAE;IAmBlC,OAAO,CAAC,SAAS;IAkBjB,SAAS,CAAC,iBAAiB;CAO5B;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,8 +1,9 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html, property, query } from "
|
2
|
+
import { css, html, property, query } from "../../.deps.js";
|
3
|
+
import { define } from "../../decorators/define.js";
|
3
4
|
import { htmlSlot, htmlStyle, svgEye } from "../../lib/templates.js";
|
4
|
-
import {
|
5
|
-
import {
|
5
|
+
import { GodownInput } from "../../supers/input.js";
|
6
|
+
import { cssvarValues } from "../../supers/root.js";
|
6
7
|
const PASSWORD = "password";
|
7
8
|
const styleInMedia = css `
|
8
9
|
label[for] {
|
@@ -28,13 +29,13 @@ const styleWithLabel = css `
|
|
28
29
|
`;
|
29
30
|
const defineName = "label-input";
|
30
31
|
/**
|
31
|
-
* LabelInput renders label and input.
|
32
|
+
* {@linkcode LabelInput } renders label and input.
|
32
33
|
*
|
33
34
|
* When there is a label, the layout will be adjusted according to the width of the screen.
|
34
35
|
*
|
35
36
|
* Otherwise it behaves similarly to the `BaseInput`.
|
36
37
|
*/
|
37
|
-
let LabelInput = class LabelInput extends
|
38
|
+
let LabelInput = class LabelInput extends GodownInput {
|
38
39
|
constructor() {
|
39
40
|
super(...arguments);
|
40
41
|
/**
|
@@ -88,7 +89,7 @@ let LabelInput = class LabelInput extends InputElement {
|
|
88
89
|
}
|
89
90
|
};
|
90
91
|
LabelInput.styles = [
|
91
|
-
|
92
|
+
GodownInput.styles,
|
92
93
|
css `
|
93
94
|
:host {
|
94
95
|
margin: var(${cssvarValues.input}--outline-width);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"label-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/label-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"label-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/label-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAqB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;iBAQP,YAAY,CAAC,KAAK;;;CAGlC,CAAC;AAEF,MAAM,YAAY,GAAG,GAAG,CAAA;;iBAEP,YAAY,CAAC,KAAK;;CAElC,CAAC;AAEF,MAAM,cAAc,GAAG,GAAG,CAAA;;sBAEJ,YAAY,CAAC,KAAK;;CAEvC,CAAC;AAEF,MAAM,UAAU,GAAG,aAAa,CAAC;AAEjC;;;;;;GAMG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW;IAApC;;QACL;;WAEG;QACS,WAAM,GAAG,OAAO,CAAC;IA8G/B,CAAC;IA5CW,MAAM;QACd,MAAM,MAAM,GAAG,IAAI,CAAA;WACZ,QAAQ,CAAC,KAAK,CAAC;uBACH,IAAI,CAAC,KAAK,iBAAiB,IAAI,CAAC,SAAS,SAAS,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,IAAI,kBAAkB,IAAI,CAAC,GAAG,YAAY,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,YAAY,cAAc,IAAI,CAAC,aAAa;QAC3M,IAAI,CAAC,SAAS,EAAE;gBACR,CAAC;QACb,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAA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AAC,KAAK;;;;;;;;;;;;;;;;;;gCAkBT,YAAY,CAAC,KAAK;;;;sBAI5B,YAAY,CAAC,KAAK;qBACnB,YAAY,CAAC,KAAK;yBACd,YAAY,CAAC,KAAK;;KAEtC;CACgB,AA5DN,CA4DO;AAhER;IAAX,QAAQ,EAAE;0CAAkB;AAEb;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AAN9B,UAAU;IADtB,MAAM,CAAC,UAAU,CAAC;GACN,UAAU,CAkHtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate, svgEye } from \"../../lib/templates.js\";\nimport { GodownInput } from \"../../supers/input.js\";\nimport { cssvarValues } from \"../../supers/root.js\";\n\nconst PASSWORD = \"password\";\n\nconst styleInMedia = css`\n label[for] {\n justify-content: flex-start;\n flex-direction: column;\n align-items: inherit;\n width: fit-content;\n }\n :host {\n width: var(${cssvarValues.input}--width);\n margin: auto;\n }\n`;\n\nconst styleNoLabel = css`\n :host {\n width: var(${cssvarValues.input}--width);\n }\n`;\n\nconst styleWithLabel = css`\n :host {\n width: calc(var(${cssvarValues.input}--width) * 2);\n }\n`;\n\nconst defineName = \"label-input\";\n\n/**\n * {@linkcode LabelInput } renders label and input.\n *\n * When there is a label, the layout will be adjusted according to the width of the screen.\n *\n * Otherwise it behaves similarly to the `BaseInput`.\n */\n@define(defineName)\nexport class LabelInput extends GodownInput {\n /**\n * Conditions for adjust layout.\n */\n @property() mobile = \"540px\";\n\n @query(\"input\") _input: HTMLInputElement;\n\n static styles = [\n GodownInput.styles,\n css`\n :host {\n margin: var(${cssvarValues.input}--outline-width);\n border-radius: var(${cssvarValues.input}--radius);\n }\n\n label {\n width: 100%;\n margin: auto;\n box-sizing: border-box;\n height: fit-content;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: inherit;\n }\n\n span {\n white-space: nowrap;\n }\n\n input {\n padding: 0 0.25em;\n background-color: transparent;\n border-radius: inherit;\n flex: 1;\n width: 100%;\n height: inherit;\n }\n\n fieldset:focus-within {\n outline: var(${cssvarValues.input}--outline);\n }\n\n i {\n margin: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n i > svg {\n height: 1em;\n width: 1em;\n margin: 0.25em;\n }\n\n fieldset {\n position: relative;\n background-color: var(${cssvarValues.input}--background);\n display: flex;\n align-items: center;\n border-radius: inherit;\n height: var(${cssvarValues.input}--height);\n width: var(${cssvarValues.input}--width);\n min-width: var(${cssvarValues.input}--width);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate[] {\n const result = html`<fieldset>\n <i>${htmlSlot(\"pre\")}</i>\n <input .value=\"${this.value}\" ?autofocus=\"${this.autofocus}\" id=\"${this.name}\" type=\"${this.type}\" placeholder=\"${this.pla}\" class=\"${this.type}\" @input=\"${this._handleInput}\" @change=\"${this._handleChange}\" />\n ${this.renderSuf()}\n </fieldset>`;\n if (this.label) {\n const style = this.mobile && `${styleWithLabel}@media (max-width: ${this.mobile}){${styleInMedia}}`;\n return [\n html`<label for=\"${this.name}\">\n <span>${this.label}${htmlSlot()}</span>\n ${result}\n </label>`,\n htmlStyle(style),\n ];\n }\n return [result, htmlStyle(styleNoLabel.toString())];\n }\n\n private renderSuf(): HTMLTemplate {\n if (this.type === PASSWORD) {\n return html`<i\n @mousedown=\"${this._passwordSwitcher}\"\n @mouseup=\"${() => {\n this._changeInputType(PASSWORD);\n }}\"\n @mouseleave=\"${() => {\n this._changeInputType(PASSWORD);\n }}\"\n >\n ${htmlSlot(\"suf\", svgEye(), this)}\n </i>`;\n } else {\n return html`<i>${htmlSlot(\"suf\")}</i>`;\n }\n }\n\n protected _passwordSwitcher() {\n if (this._input.type === PASSWORD) {\n this._changeInputType(\"text\");\n } else {\n this._changeInputType(PASSWORD);\n }\n }\n}\n\nexport default LabelInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"label-input\": LabelInput;\n \"g-label-input\": LabelInput;\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 {
|
3
|
+
import { GodownInput } from "../../supers/input.js";
|
4
4
|
/**
|
5
|
-
* SearchInput
|
5
|
+
* {@linkcode SearchInput} used for search behavior.
|
6
6
|
*/
|
7
|
-
export declare class SearchInput extends
|
7
|
+
export declare class SearchInput extends GodownInput {
|
8
8
|
/**
|
9
9
|
* Query selectors.
|
10
10
|
*/
|
@@ -44,6 +44,7 @@ export default SearchInput;
|
|
44
44
|
declare global {
|
45
45
|
interface HTMLElementTagNameMap {
|
46
46
|
"search-input": SearchInput;
|
47
|
+
"g-search-input": SearchInput;
|
47
48
|
}
|
48
49
|
}
|
49
50
|
//# sourceMappingURL=search-input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"search-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/search-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,
|
1
|
+
{"version":3,"file":"search-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/search-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAY,KAAK,YAAY,EAAa,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAOpD;;GAEG;AACH,qBACa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACS,KAAK,SAAM;IACvB;;OAEG;IACS,MAAM,SAAM;IACxB;;OAEG;IAC0B,KAAK,UAAS;IAC3C;;OAEG;IACyC,KAAK,UAAS;IAC1D;;OAEG;IACS,MAAM,SAAM;IACxB;;OAEG;IACS,MAAM,EAAE,KAAK,GAAG,MAAM,CAAS;IAC3C;;OAEG;IACS,IAAI,SAAO;IAEP,MAAM,EAAG,gBAAgB,CAAC;IAE1C,MAAM,CAAC,MAAM,iBAsFO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAYhC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK;IAOhC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK;IAiB/B,cAAc,CAAC,CAAC,EAAE,MAAM;CAezB;AAED,eAAe,WAAW,CAAC;AAE3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;QAC5B,gBAAgB,EAAE,WAAW,CAAC;KAC/B;CACF"}
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html, property, query } from "
|
2
|
+
import { css, html, property, query } from "../../.deps.js";
|
3
|
+
import { define } from "../../decorators/define.js";
|
3
4
|
import { htmlSlot, svgSearch } from "../../lib/templates.js";
|
4
|
-
import {
|
5
|
-
import {
|
5
|
+
import { GodownInput } from "../../supers/input.js";
|
6
|
+
import { createScope, cssvarValues } from "../../supers/root.js";
|
6
7
|
const defineName = "search-input";
|
7
8
|
const cssScope = createScope(defineName);
|
8
9
|
/**
|
9
|
-
* SearchInput
|
10
|
+
* {@linkcode SearchInput} used for search behavior.
|
10
11
|
*/
|
11
|
-
let SearchInput = class SearchInput extends
|
12
|
+
let SearchInput = class SearchInput extends GodownInput {
|
12
13
|
constructor() {
|
13
14
|
super(...arguments);
|
14
15
|
/**
|
@@ -90,7 +91,7 @@ let SearchInput = class SearchInput extends InputElement {
|
|
90
91
|
}
|
91
92
|
};
|
92
93
|
SearchInput.styles = [
|
93
|
-
|
94
|
+
GodownInput.styles,
|
94
95
|
css `
|
95
96
|
:host {
|
96
97
|
${cssScope}--width:var(${cssvarValues.input}--width);
|