godown 2.7.5 → 2.7.6
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 +18 -45
- package/{.deps.d.ts → _deps.d.ts} +1 -2
- package/{.deps.d.ts.map → _deps.d.ts.map} +1 -1
- package/{.deps.js → _deps.js} +1 -2
- package/_deps.js.map +1 -0
- package/alert.d.ts +8 -1
- package/alert.d.ts.map +1 -1
- package/alert.js +4 -1
- package/alert.js.map +1 -1
- package/avatar-group.d.ts +8 -1
- package/avatar-group.d.ts.map +1 -1
- package/avatar-group.js +4 -1
- package/avatar-group.js.map +1 -1
- package/avatar.d.ts +8 -1
- package/avatar.d.ts.map +1 -1
- package/avatar.js +4 -1
- package/avatar.js.map +1 -1
- package/button.d.ts +8 -1
- package/button.d.ts.map +1 -1
- package/button.js +4 -1
- package/button.js.map +1 -1
- package/card.d.ts +8 -1
- package/card.d.ts.map +1 -1
- package/card.js +4 -1
- package/card.js.map +1 -1
- package/carousel.d.ts +8 -1
- package/carousel.d.ts.map +1 -1
- package/carousel.js +4 -1
- package/carousel.js.map +1 -1
- package/components.json +194 -0
- package/conf.d.ts +6 -75
- package/conf.d.ts.map +1 -1
- package/conf.js +8 -34
- package/conf.js.map +1 -1
- package/decorators/godown.d.ts +4 -0
- package/decorators/godown.d.ts.map +1 -0
- package/decorators/godown.js +9 -0
- package/decorators/godown.js.map +1 -0
- package/decorators/part.d.ts +7 -0
- package/decorators/part.d.ts.map +1 -0
- package/decorators/part.js +8 -0
- package/decorators/part.js.map +1 -0
- package/decorators/styles.d.ts +3 -0
- package/decorators/styles.d.ts.map +1 -0
- package/decorators/styles.js +8 -0
- package/decorators/styles.js.map +1 -0
- package/details.d.ts +8 -1
- package/details.d.ts.map +1 -1
- package/details.js +4 -1
- package/details.js.map +1 -1
- package/dialog.d.ts +8 -1
- package/dialog.d.ts.map +1 -1
- package/dialog.js +4 -1
- package/dialog.js.map +1 -1
- package/divider.d.ts +8 -1
- package/divider.d.ts.map +1 -1
- package/divider.js +4 -1
- package/divider.js.map +1 -1
- package/dragbox.d.ts +8 -1
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +4 -1
- package/dragbox.js.map +1 -1
- package/flex-flow.d.ts +8 -1
- package/flex-flow.d.ts.map +1 -1
- package/flex-flow.js +4 -1
- package/flex-flow.js.map +1 -1
- package/form.d.ts +8 -1
- package/form.d.ts.map +1 -1
- package/form.js +4 -1
- package/form.js.map +1 -1
- package/grid-flow.d.ts +9 -0
- package/grid-flow.d.ts.map +1 -0
- package/grid-flow.js +5 -0
- package/grid-flow.js.map +1 -0
- package/index.d.ts +32 -3
- package/index.d.ts.map +1 -1
- package/index.js +32 -3
- package/index.js.map +1 -1
- package/input.d.ts +8 -1
- package/input.d.ts.map +1 -1
- package/input.js +4 -1
- package/input.js.map +1 -1
- package/label-input.d.ts +8 -1
- package/label-input.d.ts.map +1 -1
- package/label-input.js +4 -1
- package/label-input.js.map +1 -1
- package/layout.d.ts +9 -0
- package/layout.d.ts.map +1 -0
- package/layout.js +5 -0
- package/layout.js.map +1 -0
- package/lib/css.d.ts +13 -0
- package/lib/css.d.ts.map +1 -0
- package/lib/css.js +29 -0
- package/lib/css.js.map +1 -0
- package/lib/directives.d.ts +16 -20
- package/lib/directives.d.ts.map +1 -1
- package/lib/directives.js +33 -31
- package/lib/directives.js.map +1 -1
- package/lib/event-coll.d.ts +13 -0
- package/lib/event-coll.d.ts.map +1 -0
- package/lib/event-coll.js +45 -0
- package/lib/event-coll.js.map +1 -0
- package/lib/{templates.d.ts → icons.d.ts} +1 -17
- package/lib/icons.d.ts.map +1 -0
- package/lib/icons.js +73 -0
- package/lib/icons.js.map +1 -0
- package/lib/jsx.d.ts +4 -0
- package/lib/jsx.d.ts.map +1 -0
- package/lib/jsx.js +52 -0
- package/lib/jsx.js.map +1 -0
- package/lib/route-tree.d.ts +5 -5
- package/lib/route-tree.js +5 -5
- package/lib/route-tree.js.map +1 -1
- package/lib/utils.d.ts +6 -46
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +25 -110
- package/lib/utils.js.map +1 -1
- package/link.d.ts +9 -0
- package/link.d.ts.map +1 -0
- package/link.js +5 -0
- package/link.js.map +1 -0
- package/overbreath.d.ts +8 -1
- package/overbreath.d.ts.map +1 -1
- package/overbreath.js +4 -1
- package/overbreath.js.map +1 -1
- package/package.json +18 -23
- package/progress.d.ts +8 -1
- package/progress.d.ts.map +1 -1
- package/progress.js +4 -1
- package/progress.js.map +1 -1
- package/proto/godown-config.d.ts +41 -0
- package/proto/godown-config.d.ts.map +1 -0
- package/proto/godown-config.js +27 -0
- package/proto/godown-config.js.map +1 -0
- package/{godown-element.d.ts → proto/godown-element.d.ts} +48 -16
- package/proto/godown-element.d.ts.map +1 -0
- package/{godown-element.js → proto/godown-element.js} +82 -26
- package/proto/godown-element.js.map +1 -0
- package/proto/super-a.d.ts +30 -0
- package/proto/super-a.d.ts.map +1 -0
- package/proto/super-a.js +141 -0
- package/proto/super-a.js.map +1 -0
- package/proto/super-input.d.ts +44 -0
- package/proto/super-input.d.ts.map +1 -0
- package/proto/super-input.js +119 -0
- package/proto/super-input.js.map +1 -0
- package/proto/super-openable.d.ts +23 -0
- package/proto/super-openable.d.ts.map +1 -0
- package/proto/super-openable.js +43 -0
- package/proto/super-openable.js.map +1 -0
- package/range-input.d.ts +9 -0
- package/range-input.d.ts.map +1 -0
- package/range-input.js +5 -0
- package/range-input.js.map +1 -0
- package/react/create.d.ts.map +1 -1
- package/react/create.js +4 -1
- package/react/create.js.map +1 -1
- package/react/index.d.ts +64 -34
- package/react/index.d.ts.map +1 -1
- package/react/index.js +78 -51
- package/react/index.js.map +1 -1
- package/rotate.d.ts +9 -0
- package/rotate.d.ts.map +1 -0
- package/rotate.js +5 -0
- package/rotate.js.map +1 -0
- package/router-link.d.ts +9 -0
- package/router-link.d.ts.map +1 -0
- package/router-link.js +5 -0
- package/router-link.js.map +1 -0
- package/router.d.ts +8 -1
- package/router.d.ts.map +1 -1
- package/router.js +4 -1
- package/router.js.map +1 -1
- package/search-input.d.ts +8 -1
- package/search-input.d.ts.map +1 -1
- package/search-input.js +4 -1
- package/search-input.js.map +1 -1
- package/select-input.d.ts +8 -1
- package/select-input.d.ts.map +1 -1
- package/select-input.js +4 -1
- package/select-input.js.map +1 -1
- package/skeleton.d.ts +8 -1
- package/skeleton.d.ts.map +1 -1
- package/skeleton.js +4 -1
- package/skeleton.js.map +1 -1
- package/split-input.d.ts +8 -1
- package/split-input.d.ts.map +1 -1
- package/split-input.js +4 -1
- package/split-input.js.map +1 -1
- package/styles/colors/presets.d.ts +13 -0
- package/styles/colors/presets.d.ts.map +1 -0
- package/styles/colors/presets.js +6 -0
- package/styles/colors/presets.js.map +1 -0
- package/styles/colors/presetsRGB.d.ts +16 -0
- package/styles/colors/presetsRGB.d.ts.map +1 -0
- package/styles/colors/presetsRGB.js +134 -0
- package/styles/colors/presetsRGB.js.map +1 -0
- package/styles/global.d.ts +18 -0
- package/styles/global.d.ts.map +1 -0
- package/styles/global.js +78 -0
- package/styles/global.js.map +1 -0
- package/styles/inputStyle.d.ts +3 -0
- package/styles/inputStyle.d.ts.map +1 -0
- package/styles/inputStyle.js +59 -0
- package/styles/inputStyle.js.map +1 -0
- package/switch-input.d.ts +8 -1
- package/switch-input.d.ts.map +1 -1
- package/switch-input.js +4 -1
- package/switch-input.js.map +1 -1
- package/text.d.ts +8 -1
- package/text.d.ts.map +1 -1
- package/text.js +4 -1
- package/text.js.map +1 -1
- package/time.d.ts +8 -1
- package/time.d.ts.map +1 -1
- package/time.js +4 -1
- package/time.js.map +1 -1
- package/tooltip.d.ts +8 -1
- package/tooltip.d.ts.map +1 -1
- package/tooltip.js +4 -1
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +8 -1
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +4 -1
- package/typewriter.js.map +1 -1
- package/web-components/alert/alert.d.ts +2 -10
- package/web-components/alert/alert.d.ts.map +1 -1
- package/web-components/alert/alert.js +93 -91
- package/web-components/alert/alert.js.map +1 -1
- package/web-components/avatar/avatar-group.d.ts +21 -0
- package/web-components/avatar/avatar-group.d.ts.map +1 -0
- package/web-components/avatar/avatar-group.js +86 -0
- package/web-components/avatar/avatar-group.js.map +1 -0
- package/web-components/avatar/avatar.d.ts +5 -18
- package/web-components/avatar/avatar.d.ts.map +1 -1
- package/web-components/avatar/avatar.js +70 -85
- package/web-components/avatar/avatar.js.map +1 -1
- package/web-components/button/button.d.ts +10 -43
- package/web-components/button/button.d.ts.map +1 -1
- package/web-components/button/button.js +183 -226
- package/web-components/button/button.js.map +1 -1
- package/web-components/card/card.d.ts +2 -27
- package/web-components/card/card.d.ts.map +1 -1
- package/web-components/card/card.js +57 -132
- package/web-components/card/card.js.map +1 -1
- package/web-components/carousel/carousel.d.ts +5 -16
- package/web-components/carousel/carousel.d.ts.map +1 -1
- package/web-components/carousel/carousel.js +102 -106
- package/web-components/carousel/carousel.js.map +1 -1
- package/web-components/details/details.d.ts +4 -15
- package/web-components/details/details.d.ts.map +1 -1
- package/web-components/details/details.js +91 -97
- package/web-components/details/details.js.map +1 -1
- package/web-components/dialog/dialog.d.ts +6 -17
- package/web-components/dialog/dialog.d.ts.map +1 -1
- package/web-components/dialog/dialog.js +87 -137
- package/web-components/dialog/dialog.js.map +1 -1
- package/web-components/divider/divider.d.ts +13 -0
- package/web-components/divider/divider.d.ts.map +1 -0
- package/web-components/divider/divider.js +95 -0
- package/web-components/divider/divider.js.map +1 -0
- package/web-components/form/form.d.ts +15 -22
- package/web-components/form/form.d.ts.map +1 -1
- package/web-components/form/form.js +47 -117
- package/web-components/form/form.js.map +1 -1
- package/web-components/input/input.d.ts +5 -18
- package/web-components/input/input.d.ts.map +1 -1
- package/web-components/input/input.js +74 -169
- package/web-components/input/input.js.map +1 -1
- package/web-components/input/label-input.d.ts +5 -19
- package/web-components/input/label-input.d.ts.map +1 -1
- package/web-components/input/label-input.js +74 -141
- package/web-components/input/label-input.js.map +1 -1
- package/web-components/input/range-input.d.ts +53 -0
- package/web-components/input/range-input.d.ts.map +1 -0
- package/web-components/input/range-input.js +316 -0
- package/web-components/input/range-input.js.map +1 -0
- package/web-components/input/search-input.d.ts +4 -12
- package/web-components/input/search-input.d.ts.map +1 -1
- package/web-components/input/search-input.js +118 -113
- package/web-components/input/search-input.js.map +1 -1
- package/web-components/input/select-input.d.ts +17 -32
- package/web-components/input/select-input.d.ts.map +1 -1
- package/web-components/input/select-input.js +154 -286
- package/web-components/input/select-input.js.map +1 -1
- package/web-components/input/split-input.d.ts +8 -15
- package/web-components/input/split-input.d.ts.map +1 -1
- package/web-components/input/split-input.js +82 -72
- package/web-components/input/split-input.js.map +1 -1
- package/web-components/input/switch-input.d.ts +8 -17
- package/web-components/input/switch-input.d.ts.map +1 -1
- package/web-components/input/switch-input.js +122 -158
- package/web-components/input/switch-input.js.map +1 -1
- package/web-components/layout/flex-flow.d.ts +11 -19
- package/web-components/layout/flex-flow.d.ts.map +1 -1
- package/web-components/layout/flex-flow.js +57 -35
- package/web-components/layout/flex-flow.js.map +1 -1
- package/web-components/layout/grid-flow.d.ts +14 -0
- package/web-components/layout/grid-flow.d.ts.map +1 -0
- package/web-components/layout/grid-flow.js +56 -0
- package/web-components/layout/grid-flow.js.map +1 -0
- package/web-components/layout/layout.d.ts +18 -0
- package/web-components/layout/layout.d.ts.map +1 -0
- package/web-components/layout/layout.js +76 -0
- package/web-components/layout/layout.js.map +1 -0
- package/web-components/link/link.d.ts +10 -0
- package/web-components/link/link.d.ts.map +1 -0
- package/web-components/link/link.js +17 -0
- package/web-components/link/link.js.map +1 -0
- package/web-components/link/router-link.d.ts +19 -0
- package/web-components/link/router-link.d.ts.map +1 -0
- package/web-components/link/router-link.js +60 -0
- package/web-components/link/router-link.js.map +1 -0
- package/web-components/progress/progress.d.ts +2 -12
- package/web-components/progress/progress.d.ts.map +1 -1
- package/web-components/progress/progress.js +52 -48
- package/web-components/progress/progress.js.map +1 -1
- package/web-components/router/router.d.ts +15 -21
- package/web-components/router/router.d.ts.map +1 -1
- package/web-components/router/router.js +35 -37
- package/web-components/router/router.js.map +1 -1
- package/web-components/skeleton/skeleton.d.ts +5 -12
- package/web-components/skeleton/skeleton.d.ts.map +1 -1
- package/web-components/skeleton/skeleton.js +90 -98
- package/web-components/skeleton/skeleton.js.map +1 -1
- package/web-components/text/overbreath.d.ts +15 -20
- package/web-components/text/overbreath.d.ts.map +1 -1
- package/web-components/text/overbreath.js +108 -202
- package/web-components/text/overbreath.js.map +1 -1
- package/web-components/text/text.d.ts +5 -18
- package/web-components/text/text.d.ts.map +1 -1
- package/web-components/text/text.js +70 -80
- package/web-components/text/text.js.map +1 -1
- package/web-components/text/time.d.ts +5 -14
- package/web-components/text/time.d.ts.map +1 -1
- package/web-components/text/time.js +32 -31
- package/web-components/text/time.js.map +1 -1
- package/web-components/text/typewriter.d.ts +3 -11
- package/web-components/text/typewriter.d.ts.map +1 -1
- package/web-components/text/typewriter.js +42 -40
- package/web-components/text/typewriter.js.map +1 -1
- package/web-components/tooltip/tooltip.d.ts +21 -17
- package/web-components/tooltip/tooltip.d.ts.map +1 -1
- package/web-components/tooltip/tooltip.js +98 -60
- package/web-components/tooltip/tooltip.js.map +1 -1
- package/web-components/wrapper/dragbox.d.ts +5 -10
- package/web-components/wrapper/dragbox.d.ts.map +1 -1
- package/web-components/wrapper/dragbox.js +40 -31
- package/web-components/wrapper/dragbox.js.map +1 -1
- package/web-components/wrapper/rotate.d.ts +30 -0
- package/web-components/wrapper/rotate.d.ts.map +1 -0
- package/web-components/wrapper/rotate.js +92 -0
- package/web-components/wrapper/rotate.js.map +1 -0
- package/.deps.js.map +0 -1
- package/a.d.ts +0 -2
- package/a.d.ts.map +0 -1
- package/a.js +0 -2
- package/a.js.map +0 -1
- package/clip.d.ts +0 -2
- package/clip.d.ts.map +0 -1
- package/clip.js +0 -2
- package/clip.js.map +0 -1
- package/decorators/define.d.ts +0 -7
- package/decorators/define.d.ts.map +0 -1
- package/decorators/define.js +0 -11
- package/decorators/define.js.map +0 -1
- package/details-group.d.ts +0 -2
- package/details-group.d.ts.map +0 -1
- package/details-group.js +0 -2
- package/details-group.js.map +0 -1
- package/godown-element.d.ts.map +0 -1
- package/godown-element.js.map +0 -1
- package/lib/event-collection.d.ts +0 -14
- package/lib/event-collection.d.ts.map +0 -1
- package/lib/event-collection.js +0 -71
- package/lib/event-collection.js.map +0 -1
- package/lib/templates.d.ts.map +0 -1
- package/lib/templates.js +0 -76
- package/lib/templates.js.map +0 -1
- package/naming.d.ts +0 -91
- package/naming.d.ts.map +0 -1
- package/naming.js +0 -67
- package/naming.js.map +0 -1
- package/nav-layout.d.ts +0 -2
- package/nav-layout.d.ts.map +0 -1
- package/nav-layout.js +0 -2
- package/nav-layout.js.map +0 -1
- package/open-offset.d.ts +0 -2
- package/open-offset.d.ts.map +0 -1
- package/open-offset.js +0 -2
- package/open-offset.js.map +0 -1
- package/router-a.d.ts +0 -2
- package/router-a.d.ts.map +0 -1
- package/router-a.js +0 -2
- package/router-a.js.map +0 -1
- package/supers/anchor.d.ts +0 -26
- package/supers/anchor.d.ts.map +0 -1
- package/supers/anchor.js +0 -124
- package/supers/anchor.js.map +0 -1
- package/supers/input.d.ts +0 -28
- package/supers/input.d.ts.map +0 -1
- package/supers/input.js +0 -117
- package/supers/input.js.map +0 -1
- package/supers/openable.d.ts +0 -38
- package/supers/openable.d.ts.map +0 -1
- package/supers/openable.js +0 -77
- package/supers/openable.js.map +0 -1
- package/supers/root.d.ts +0 -18
- package/supers/root.d.ts.map +0 -1
- package/supers/root.js +0 -76
- package/supers/root.js.map +0 -1
- package/tabs.d.ts +0 -2
- package/tabs.d.ts.map +0 -1
- package/tabs.js +0 -2
- package/tabs.js.map +0 -1
- package/web-components/a/a.d.ts +0 -16
- package/web-components/a/a.d.ts.map +0 -1
- package/web-components/a/a.js +0 -17
- package/web-components/a/a.js.map +0 -1
- package/web-components/group/avatar-group.d.ts +0 -29
- package/web-components/group/avatar-group.d.ts.map +0 -1
- package/web-components/group/avatar-group.js +0 -88
- package/web-components/group/avatar-group.js.map +0 -1
- package/web-components/group/details-group.d.ts +0 -28
- package/web-components/group/details-group.d.ts.map +0 -1
- package/web-components/group/details-group.js +0 -59
- package/web-components/group/details-group.js.map +0 -1
- package/web-components/index.d.ts +0 -35
- package/web-components/index.d.ts.map +0 -1
- package/web-components/index.js +0 -35
- package/web-components/index.js.map +0 -1
- package/web-components/layout/divider.d.ts +0 -22
- package/web-components/layout/divider.d.ts.map +0 -1
- package/web-components/layout/divider.js +0 -85
- package/web-components/layout/divider.js.map +0 -1
- package/web-components/layout/nav-layout.d.ts +0 -38
- package/web-components/layout/nav-layout.d.ts.map +0 -1
- package/web-components/layout/nav-layout.js +0 -69
- package/web-components/layout/nav-layout.js.map +0 -1
- package/web-components/offset/open-offset.d.ts +0 -27
- package/web-components/offset/open-offset.d.ts.map +0 -1
- package/web-components/offset/open-offset.js +0 -130
- package/web-components/offset/open-offset.js.map +0 -1
- package/web-components/router/router-a.d.ts +0 -25
- package/web-components/router/router-a.d.ts.map +0 -1
- package/web-components/router/router-a.js +0 -70
- package/web-components/router/router-a.js.map +0 -1
- package/web-components/tabs/tabs.d.ts +0 -52
- package/web-components/tabs/tabs.d.ts.map +0 -1
- package/web-components/tabs/tabs.js +0 -165
- package/web-components/tabs/tabs.js.map +0 -1
- package/web-components/text/clip.d.ts +0 -22
- package/web-components/text/clip.d.ts.map +0 -1
- package/web-components/text/clip.js +0 -45
- package/web-components/text/clip.js.map +0 -1
- package/web-components/wrapper/wrapper.d.ts +0 -27
- package/web-components/wrapper/wrapper.d.ts.map +0 -1
- package/web-components/wrapper/wrapper.js +0 -95
- package/web-components/wrapper/wrapper.js.map +0 -1
- package/wrapper.d.ts +0 -2
- package/wrapper.d.ts.map +0 -1
- package/wrapper.js +0 -2
- package/wrapper.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typewriter.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/typewriter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAyB,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,
|
1
|
+
{"version":3,"file":"typewriter.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/typewriter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAyB,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;GAEG;AAkCI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,aAAa;IAAtC;;QACL;;WAEG;QACS,SAAI,GAAG,EAAE,CAAC;QACtB;;WAEG;QAC0B,YAAO,GAAG,KAAK,CAAC;QAC7C;;WAEG;QAC0B,UAAK,GAAG,KAAK,CAAC;QAC3C;;WAEG;QACyB,QAAG,GAAG,GAAG,CAAC;QACtC;;WAEG;QACyB,QAAG,GAAG,EAAE,CAAC;QACrC;;WAEG;QACyB,UAAK,GAAG,CAAC,CAAC;QACtC;;WAEG;QACyB,UAAK,GAAG,CAAC,CAAC;QACtC;;WAEG;QACM,YAAO,GAAG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AAG,EAAE;YAC/B,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAClB,IAAI,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBAChB,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC;QACH,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;IAED,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF,CAAA;AA9Ea;IAAX,QAAQ,EAAE;wCAAW;AAIO;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAiB;AAIhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAe;AAIf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AAIT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAW;AAI7B;IAAR,KAAK,EAAE;2CAAc;AAGV;IAAX,KAAK,CAAC,GAAG,CAAC;sCAAiB;AAnCjB,UAAU;IAjCtB,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC;QACN,GAAG,CAAA;;UAEK,QAAQ;;;;;;4BAMU,QAAQ;;;;;;;;;;;;;;;;;;;;;GAqBjC;KACF,CAAC;GACW,UAAU,CAkFtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { css, html, property, type PropertyValueMap, query, state } from \"../../_deps.js\";\nimport { godown } from \"../../decorators/godown.js\";\nimport { styles } from \"../../decorators/styles.js\";\nimport { htmlSlot } from \"../../lib/directives.js\";\nimport { random } from \"../../lib/utils.js\";\nimport { GodownElement } from \"../../proto/godown-element.js\";\nimport { createScope } from \"../../styles/global.js\";\n\nconst protoName = \"typewriter\";\nconst cssScope = createScope(protoName);\n\n/**\n * {@linkcode Typewriter} renders a typewriter effect to text.\n */\n@godown(protoName)\n@styles([\n css`\n :host {\n --${cssScope}--cursor-width: .05em;\n font-family: monospace;\n white-space: nowrap;\n }\n\n i {\n border-right: var(--${cssScope}--cursor-width) solid;\n margin-left: 0.02em;\n animation: s 1.5s steps(1) infinite;\n }\n\n @keyframes s {\n 0% {\n border-color: currentColor;\n }\n 50% {\n border-color: transparent;\n }\n }\n\n slot {\n display: none;\n }\n\n .hidden {\n visibility: hidden;\n }\n `,\n])\nexport class Typewriter extends GodownElement {\n /**\n * Raw text.\n */\n @property() text = \"\";\n /**\n * Start immediately after {@linkcode Typewriter.firstUpdated}.\n */\n @property({ type: Boolean }) stopped = false;\n /**\n * If true, hide the cursor\n */\n @property({ type: Boolean }) ended = false;\n /**\n * Maximum random time.\n */\n @property({ type: Number }) max = 100;\n /**\n * Minimum random time.\n */\n @property({ type: Number }) min = 50;\n /**\n * Fixed time.\n */\n @property({ type: Number }) delay = 0;\n /**\n * The index at the beginning.\n */\n @property({ type: Number }) index = 0;\n /**\n * Internal text.\n */\n @state() content = \"\";\n\n timeoutID: number;\n @query(\"i\") _i: HTMLElement;\n\n /**\n * {@linkcode Typewriter.text} length.\n */\n get len() {\n return this.text.length;\n }\n\n protected render() {\n return html`${htmlSlot()}${this.content}<i part=\"cursor\" class=\"${(this.ended && \"hidden\") || \"\"}\"></i>`;\n }\n\n protected firstUpdated() {\n if (!this.text) {\n this.text = this.assignedNodes[0]?.textContent.trim() || \"\";\n }\n if (!this.stopped && this.len) {\n this.write();\n }\n }\n\n protected updated(changedProperties: PropertyValueMap<this>) {\n if (changedProperties.has(\"index\")) {\n this.dispatchEvent(new CustomEvent(this.index === this.len ? \"done\" : \"write\", { detail: this.content }));\n }\n }\n\n write(at = this.index) {\n this.content = this.text.slice(0, at + 1);\n const timeout = this.delay || random(this.max, this.min);\n this.timeoutID = setTimeout(() => {\n const nx = at + 1;\n if (nx <= this.len) {\n this.index = nx;\n this.write();\n }\n }, timeout);\n }\n\n stop() {\n clearTimeout(this.timeoutID);\n }\n\n end() {\n this.ended = true;\n }\n}\n\nexport default Typewriter;\n"]}
|
@@ -1,26 +1,30 @@
|
|
1
|
-
import {
|
2
|
-
import { type HTMLTemplate } from "../../lib/templates.js";
|
3
|
-
import { type Direction8, GodownOpenable } from "../../supers/openable.js";
|
1
|
+
import GodownSuperOpenable, { type Direction8 } from "../../proto/super-openable.js";
|
4
2
|
/**
|
5
|
-
* {@linkcode Tooltip} provide tooltip for slot elements
|
3
|
+
* {@linkcode Tooltip} provide tooltip for slot elements.
|
6
4
|
*
|
7
5
|
* Content can be opened in 8 directions.
|
6
|
+
*
|
7
|
+
* @slot tooltip - Tooltip element.
|
8
|
+
* @slot - Tooltip trigger.
|
9
|
+
*
|
8
10
|
*/
|
9
|
-
export declare class Tooltip extends
|
10
|
-
direction: Direction8 | "";
|
11
|
+
export declare class Tooltip extends GodownSuperOpenable {
|
11
12
|
/**
|
12
|
-
*
|
13
|
+
* Open direction.
|
13
14
|
*/
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
direction: Direction8;
|
16
|
+
/**
|
17
|
+
* Content align.
|
18
|
+
*/
|
19
|
+
align: keyof typeof Tooltip.aligns | "inherit";
|
20
|
+
static aligns: {
|
21
|
+
start: string;
|
22
|
+
end: string;
|
23
|
+
center: string;
|
24
|
+
"flex-start": string;
|
25
|
+
"flex-end": string;
|
26
|
+
};
|
27
|
+
protected render(): import("lit").TemplateResult<1>;
|
17
28
|
}
|
18
29
|
export default Tooltip;
|
19
|
-
declare global {
|
20
|
-
interface HTMLElementTagNameMap {
|
21
|
-
"open-tooltip": Tooltip;
|
22
|
-
"tool-tip": Tooltip;
|
23
|
-
"g-tooltip": Tooltip;
|
24
|
-
}
|
25
|
-
}
|
26
30
|
//# sourceMappingURL=tooltip.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/tooltip/tooltip.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/tooltip/tooltip.ts"],"names":[],"mappings":"AAIA,OAAO,mBAAmB,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAMrF;;;;;;;;GAQG;AACH,qBAkEa,OAAQ,SAAQ,mBAAmB;IAC9C;;OAEG;IACS,SAAS,EAAE,UAAU,CAAS;IAC1C;;OAEG;IACS,KAAK,EAAE,MAAM,OAAO,OAAO,CAAC,MAAM,GAAG,SAAS,CAAY;IAEtE,MAAM,CAAC,MAAM;;;;;;MAMX;IAEF,SAAS,CAAC,MAAM;CAOjB;AAED,eAAe,OAAO,CAAC"}
|
@@ -1,84 +1,122 @@
|
|
1
|
+
var Tooltip_1;
|
1
2
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html, property } from "
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import
|
7
|
-
|
3
|
+
import { css, html, property } from "../../_deps.js";
|
4
|
+
import { godown } from "../../decorators/godown.js";
|
5
|
+
import { styles } from "../../decorators/styles.js";
|
6
|
+
import { htmlSlot } from "../../lib/directives.js";
|
7
|
+
import GodownSuperOpenable from "../../proto/super-openable.js";
|
8
|
+
import { createScope } from "../../styles/global.js";
|
9
|
+
const protoName = "tooltip";
|
10
|
+
const cssScope = createScope(protoName);
|
8
11
|
/**
|
9
|
-
* {@linkcode Tooltip} provide tooltip for slot elements
|
12
|
+
* {@linkcode Tooltip} provide tooltip for slot elements.
|
10
13
|
*
|
11
14
|
* Content can be opened in 8 directions.
|
15
|
+
*
|
16
|
+
* @slot tooltip - Tooltip element.
|
17
|
+
* @slot - Tooltip trigger.
|
18
|
+
*
|
12
19
|
*/
|
13
|
-
let Tooltip = class Tooltip extends
|
20
|
+
let Tooltip = Tooltip_1 = class Tooltip extends GodownSuperOpenable {
|
14
21
|
constructor() {
|
15
22
|
super(...arguments);
|
16
23
|
/**
|
17
|
-
*
|
24
|
+
* Open direction.
|
25
|
+
*/
|
26
|
+
this.direction = "top";
|
27
|
+
/**
|
28
|
+
* Content align.
|
18
29
|
*/
|
19
|
-
this.align = "";
|
30
|
+
this.align = "center";
|
20
31
|
}
|
21
32
|
render() {
|
22
|
-
|
33
|
+
const align = Tooltip_1.aligns[this.align] || "inherit";
|
34
|
+
return html `<div part="root" class="root" style="justify-content:${align};align-items:${align}">
|
23
35
|
${htmlSlot()}
|
24
|
-
<
|
25
|
-
</
|
36
|
+
<div part="tooltip" direction="${this.direction}">${htmlSlot("tooltip")}</div>
|
37
|
+
</div>`;
|
26
38
|
}
|
27
39
|
};
|
28
|
-
Tooltip.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
40
|
+
Tooltip.aligns = {
|
41
|
+
start: "flex-start",
|
42
|
+
end: "flex-end",
|
43
|
+
center: "center",
|
44
|
+
"flex-start": "flex-start",
|
45
|
+
"flex-end": "flex-end",
|
46
|
+
};
|
47
|
+
__decorate([
|
48
|
+
property()
|
49
|
+
], Tooltip.prototype, "direction", void 0);
|
50
|
+
__decorate([
|
51
|
+
property()
|
52
|
+
], Tooltip.prototype, "align", void 0);
|
53
|
+
Tooltip = Tooltip_1 = __decorate([
|
54
|
+
godown(protoName),
|
55
|
+
styles([
|
56
|
+
css `
|
57
|
+
:host {
|
58
|
+
--${cssScope}--tooltip-gap: .15em;
|
59
|
+
transition: 0.3s ease-in-out;
|
60
|
+
border-radius: 0.25em;
|
61
|
+
display: block;
|
62
|
+
height: 100%;
|
63
|
+
}
|
37
64
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
65
|
+
[part="root"] {
|
66
|
+
display: flex;
|
67
|
+
position: relative;
|
68
|
+
transition: inherit;
|
69
|
+
border-radius: inherit;
|
70
|
+
}
|
44
71
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
72
|
+
[part="tooltip"] {
|
73
|
+
z-index: 1;
|
74
|
+
opacity: 0;
|
75
|
+
width: -moz-fit-content;
|
76
|
+
width: fit-content;
|
77
|
+
height: -moz-fit-content;
|
78
|
+
height: fit-content;
|
79
|
+
position: absolute;
|
80
|
+
visibility: hidden;
|
81
|
+
transition: inherit;
|
82
|
+
pointer-events: none;
|
83
|
+
border-radius: inherit;
|
84
|
+
transition-property:opacity;
|
85
|
+
}
|
50
86
|
|
51
|
-
|
87
|
+
:host(:hover) [part="tooltip"],
|
88
|
+
:host([open]) [part="tooltip"] {
|
89
|
+
visibility: visible;
|
90
|
+
animation: open .8s forwards;
|
91
|
+
}
|
92
|
+
@keyframes open {
|
93
|
+
50% {
|
52
94
|
opacity: 0;
|
53
|
-
position: absolute;
|
54
|
-
transition-property: opacity;
|
55
95
|
}
|
56
|
-
|
57
|
-
:host(:hover) aside,
|
58
|
-
:host([open]) aside {
|
96
|
+
100% {
|
59
97
|
opacity: 1;
|
60
98
|
}
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
75
|
-
|
76
|
-
]
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
99
|
+
}
|
100
|
+
`,
|
101
|
+
css `
|
102
|
+
[direction^="top"] {
|
103
|
+
bottom: 100%;
|
104
|
+
padding-bottom: var(--${cssScope}--tooltip-gap);
|
105
|
+
}
|
106
|
+
[direction^="bottom"] {
|
107
|
+
top: 100%;
|
108
|
+
padding-top: var(--${cssScope}--tooltip-gap);
|
109
|
+
}
|
110
|
+
[direction$="right"] {
|
111
|
+
left: 100%;
|
112
|
+
padding-left: var(--${cssScope}--tooltip-gap);
|
113
|
+
}
|
114
|
+
[direction$="left"] {
|
115
|
+
right: 100%;
|
116
|
+
padding-right: var(--${cssScope}--tooltip-gap);
|
117
|
+
}
|
118
|
+
`,
|
119
|
+
])
|
82
120
|
], Tooltip);
|
83
121
|
export { Tooltip };
|
84
122
|
export default Tooltip;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/tooltip/tooltip.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/tooltip/tooltip.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,mBAAwC,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;;GAQG;AAmEI,IAAM,OAAO,eAAb,MAAM,OAAQ,SAAQ,mBAAmB;IAAzC;;QACL;;WAEG;QACS,cAAS,GAAe,KAAK,CAAC;QAC1C;;WAEG;QACS,UAAK,GAA4C,QAAQ,CAAC;IAiBxE,CAAC;IAPW,MAAM;QACd,MAAM,KAAK,GAAG,SAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;QACtD,OAAO,IAAI,CAAA,wDAAwD,KAAK,gBAAgB,KAAK;QACzF,QAAQ,EAAE;uCACqB,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS,CAAC;WAClE,CAAC;IACV,CAAC;;AAdM,cAAM,GAAG;IACd,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,UAAU;CACvB,AANY,CAMX;AAZU;IAAX,QAAQ,EAAE;0CAA+B;AAI9B;IAAX,QAAQ,EAAE;sCAA2D;AAR3D,OAAO;IAlEnB,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC;QACN,GAAG,CAAA;;UAEK,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0Cf;QACD,GAAG,CAAA;;;8BAGyB,QAAQ;;;;2BAIX,QAAQ;;;;4BAIP,QAAQ;;;;6BAIP,QAAQ;;GAElC;KACF,CAAC;GACW,OAAO,CAyBnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property } from \"../../_deps.js\";\nimport { godown } from \"../../decorators/godown.js\";\nimport { styles } from \"../../decorators/styles.js\";\nimport { htmlSlot } from \"../../lib/directives.js\";\nimport GodownSuperOpenable, { type Direction8 } from \"../../proto/super-openable.js\";\nimport { createScope } from \"../../styles/global.js\";\n\nconst protoName = \"tooltip\";\nconst cssScope = createScope(protoName);\n\n/**\n * {@linkcode Tooltip} provide tooltip for slot elements.\n *\n * Content can be opened in 8 directions.\n *\n * @slot tooltip - Tooltip element.\n * @slot - Tooltip trigger.\n *\n */\n@godown(protoName)\n@styles([\n css`\n :host {\n --${cssScope}--tooltip-gap: .15em;\n transition: 0.3s ease-in-out;\n border-radius: 0.25em;\n display: block;\n height: 100%;\n }\n\n [part=\"root\"] {\n display: flex;\n position: relative;\n transition: inherit;\n border-radius: inherit;\n }\n\n [part=\"tooltip\"] {\n z-index: 1;\n opacity: 0;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n position: absolute;\n visibility: hidden;\n transition: inherit;\n pointer-events: none;\n border-radius: inherit;\n transition-property:opacity;\n }\n\n :host(:hover) [part=\"tooltip\"],\n :host([open]) [part=\"tooltip\"] {\n visibility: visible;\n animation: open .8s forwards;\n }\n @keyframes open {\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n `,\n css`\n [direction^=\"top\"] {\n bottom: 100%;\n padding-bottom: var(--${cssScope}--tooltip-gap);\n }\n [direction^=\"bottom\"] {\n top: 100%;\n padding-top: var(--${cssScope}--tooltip-gap);\n }\n [direction$=\"right\"] {\n left: 100%;\n padding-left: var(--${cssScope}--tooltip-gap);\n }\n [direction$=\"left\"] {\n right: 100%;\n padding-right: var(--${cssScope}--tooltip-gap);\n }\n `,\n])\nexport class Tooltip extends GodownSuperOpenable {\n /**\n * Open direction.\n */\n @property() direction: Direction8 = \"top\";\n /**\n * Content align.\n */\n @property() align: keyof typeof Tooltip.aligns | \"inherit\" = \"center\";\n\n static aligns = {\n start: \"flex-start\",\n end: \"flex-end\",\n center: \"center\",\n \"flex-start\": \"flex-start\",\n \"flex-end\": \"flex-end\",\n };\n\n protected render() {\n const align = Tooltip.aligns[this.align] || \"inherit\";\n return html`<div part=\"root\" class=\"root\" style=\"justify-content:${align};align-items:${align}\">\n ${htmlSlot()}\n <div part=\"tooltip\" direction=\"${this.direction}\">${htmlSlot(\"tooltip\")}</div>\n </div>`;\n }\n}\n\nexport default Tooltip;\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { GodownElement } from "../../
|
1
|
+
import { ListenerFunc } from "../../lib/event-coll.js";
|
2
|
+
import { GodownElement } from "../../proto/godown-element.js";
|
3
3
|
/**
|
4
4
|
* {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.
|
5
5
|
*/
|
@@ -17,19 +17,14 @@ export declare class Dragbox extends GodownElement {
|
|
17
17
|
* Position y.
|
18
18
|
*/
|
19
19
|
y: string;
|
20
|
-
|
21
|
-
protected render(): HTMLTemplate;
|
20
|
+
protected render(): import("lit").TemplateResult<1>;
|
22
21
|
protected firstUpdated(): void;
|
23
22
|
protected _handleDragStart(e: MouseEvent): void;
|
23
|
+
mouseMoveEvent: ListenerFunc;
|
24
|
+
mouseLeaveEvent: ListenerFunc;
|
24
25
|
protected _handleDragEnd(): void;
|
25
26
|
protected _handleDrag(e: MouseEvent): void;
|
26
27
|
reset(): void;
|
27
28
|
}
|
28
29
|
export default Dragbox;
|
29
|
-
declare global {
|
30
|
-
interface HTMLElementTagNameMap {
|
31
|
-
"drag-box": Dragbox;
|
32
|
-
"g-dragbox": Dragbox;
|
33
|
-
}
|
34
|
-
}
|
35
30
|
//# sourceMappingURL=dragbox.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dragbox.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/wrapper/dragbox.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"dragbox.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/wrapper/dragbox.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9D;;GAEG;AACH,qBAca,OAAQ,SAAQ,aAAa;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACS,CAAC,SAAU;IACvB;;OAEG;IACS,CAAC,SAAU;IAEvB,SAAS,CAAC,MAAM;IAIhB,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,UAAU;IAUxC,cAAc,EAAE,YAAY,CAAC;IAC7B,eAAe,EAAE,YAAY,CAAC;IAE9B,SAAS,CAAC,cAAc;IAMxB,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU;IAuBnC,KAAK;CAWN;AAED,eAAe,OAAO,CAAC"}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { css, html, property } from "
|
3
|
-
import {
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
|
2
|
+
import { css, html, property } from "../../_deps.js";
|
3
|
+
import { godown } from "../../decorators/godown.js";
|
4
|
+
import styles from "../../decorators/styles.js";
|
5
|
+
import { htmlSlot } from "../../lib/directives.js";
|
6
|
+
import { GodownElement } from "../../proto/godown-element.js";
|
7
|
+
const protoName = "dragbox";
|
7
8
|
/**
|
8
9
|
* {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.
|
9
10
|
*/
|
@@ -24,7 +25,6 @@ let Dragbox = class Dragbox extends GodownElement {
|
|
24
25
|
}
|
25
26
|
firstUpdated() {
|
26
27
|
this.reset();
|
27
|
-
this.addEvent(document, "mouseup", this._handleDragEnd.bind(this));
|
28
28
|
}
|
29
29
|
_handleDragStart(e) {
|
30
30
|
this.cx = e.clientX;
|
@@ -32,11 +32,13 @@ let Dragbox = class Dragbox extends GodownElement {
|
|
32
32
|
this.t = this.offsetTop;
|
33
33
|
this.l = this.offsetLeft;
|
34
34
|
this.drag = true;
|
35
|
-
this.addEvent(document, "mousemove", this._handleDrag.bind(this)
|
35
|
+
this.mouseMoveEvent = this.addEvent(document, "mousemove", this._handleDrag.bind(this));
|
36
|
+
this.mouseLeaveEvent = this.addEvent(document, "mouseleave", this._handleDragEnd.bind(this));
|
36
37
|
}
|
37
38
|
_handleDragEnd() {
|
38
39
|
this.drag = false;
|
39
|
-
this.removeEvent(document, "mousemove",
|
40
|
+
this.removeEvent(document, "mousemove", this.mouseMoveEvent);
|
41
|
+
this.removeEvent(document, "mouseleave", this.mouseLeaveEvent);
|
40
42
|
}
|
41
43
|
_handleDrag(e) {
|
42
44
|
if (!this.drag) {
|
@@ -44,44 +46,38 @@ let Dragbox = class Dragbox extends GodownElement {
|
|
44
46
|
}
|
45
47
|
const nl = e.clientX - (this.cx - this.l);
|
46
48
|
const nt = e.clientY - (this.cy - this.t);
|
49
|
+
const { style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight } = this;
|
47
50
|
if (nl < 0) {
|
48
|
-
|
51
|
+
style.left = "0";
|
49
52
|
}
|
50
|
-
else if (nl <
|
51
|
-
|
53
|
+
else if (nl < offsetsWidth - offsetWidth) {
|
54
|
+
style.left = `${nl}px`;
|
52
55
|
}
|
53
56
|
else {
|
54
|
-
|
57
|
+
style.left = `${offsetsWidth - offsetWidth}"px"`;
|
55
58
|
}
|
56
59
|
if (nt < 0) {
|
57
|
-
|
60
|
+
style.top = "0";
|
58
61
|
}
|
59
|
-
else if (nt <
|
60
|
-
|
62
|
+
else if (nt < offsetsHeight - offsetHeight) {
|
63
|
+
style.top = `${nt}px`;
|
61
64
|
}
|
62
65
|
else {
|
63
|
-
|
66
|
+
style.top = `${offsetsHeight - offsetHeight}px`;
|
64
67
|
}
|
65
68
|
}
|
66
69
|
reset() {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
const { x, y, style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight, offsetLeft, offsetTop } = this;
|
71
|
+
style.left = x || "0";
|
72
|
+
style.top = y || "0";
|
73
|
+
if (offsetLeft > offsetsWidth - offsetWidth) {
|
74
|
+
style.left = `${offsetsWidth - offsetWidth}px`;
|
71
75
|
}
|
72
|
-
if (
|
73
|
-
|
76
|
+
if (offsetTop > offsetsHeight - offsetHeight) {
|
77
|
+
style.top = `${offsetsHeight - offsetHeight}px`;
|
74
78
|
}
|
75
79
|
}
|
76
80
|
};
|
77
|
-
Dragbox.styles = [
|
78
|
-
css `
|
79
|
-
:host {
|
80
|
-
position: relative;
|
81
|
-
display: inline-flex;
|
82
|
-
}
|
83
|
-
`,
|
84
|
-
];
|
85
81
|
__decorate([
|
86
82
|
property()
|
87
83
|
], Dragbox.prototype, "x", void 0);
|
@@ -89,7 +85,20 @@ __decorate([
|
|
89
85
|
property()
|
90
86
|
], Dragbox.prototype, "y", void 0);
|
91
87
|
Dragbox = __decorate([
|
92
|
-
|
88
|
+
godown(protoName),
|
89
|
+
styles([
|
90
|
+
css `
|
91
|
+
:host {
|
92
|
+
position: absolute;
|
93
|
+
display: block;
|
94
|
+
}
|
95
|
+
|
96
|
+
:host(:active) {
|
97
|
+
-webkit-user-select: none;
|
98
|
+
user-select: none;
|
99
|
+
}
|
100
|
+
`,
|
101
|
+
])
|
93
102
|
], Dragbox);
|
94
103
|
export { Dragbox };
|
95
104
|
export default Dragbox;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dragbox.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/wrapper/dragbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,
|
1
|
+
{"version":3,"file":"dragbox.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/wrapper/dragbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,MAAM,SAAS,GAAG,SAAS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AI,GAAG,CAAC;QACrB,IAAI,UAAU,GAAG,YAAY,GAAG,WAAW,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,GAAG,GAAG,YAAY,GAAG,WAAW,IAAI,CAAC;QACjD,CAAC;QACD,IAAI,SAAS,GAAG,aAAa,GAAG,YAAY,EAAE,CAAC;YAC7C,KAAK,CAAC,GAAG,GAAG,GAAG,aAAa,GAAG,YAAY,IAAI,CAAC;QAClD,CAAC;IACH,CAAC;CACF,CAAA;AAnEa;IAAX,QAAQ,EAAE;kCAAY;AAIX;IAAX,QAAQ,EAAE;kCAAY;AAdZ,OAAO;IAdnB,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC;QACN,GAAG,CAAA;;;;;;;;;;GAUF;KACF,CAAC;GACW,OAAO,CA6EnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property } from \"../../_deps.js\";\nimport { godown } from \"../../decorators/godown.js\";\nimport styles from \"../../decorators/styles.js\";\nimport { htmlSlot } from \"../../lib/directives.js\";\nimport { ListenerFunc } from \"../../lib/event-coll.js\";\nimport { GodownElement } from \"../../proto/godown-element.js\";\n\nconst protoName = \"dragbox\";\n\n/**\n * {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.\n */\n@godown(protoName)\n@styles([\n css`\n :host {\n position: absolute;\n display: block;\n }\n\n :host(:active) {\n -webkit-user-select: none;\n user-select: none;\n }\n `,\n])\nexport class Dragbox extends GodownElement {\n drag: boolean;\n t: number;\n l: number;\n cx: number;\n cy: number;\n\n /**\n * Position x.\n */\n @property() x = \"auto\";\n /**\n * Position y.\n */\n @property() y = \"auto\";\n\n protected render() {\n return html`<div @mousedown=\"${this._handleDragStart}\" @mouseup=\"${this._handleDragEnd}\">${htmlSlot()}</div>`;\n }\n\n protected firstUpdated() {\n this.reset();\n }\n\n protected _handleDragStart(e: MouseEvent) {\n this.cx = e.clientX;\n this.cy = e.clientY;\n this.t = this.offsetTop;\n this.l = this.offsetLeft;\n this.drag = true;\n this.mouseMoveEvent = this.addEvent(document, \"mousemove\", this._handleDrag.bind(this));\n this.mouseLeaveEvent = this.addEvent(document, \"mouseleave\", this._handleDragEnd.bind(this));\n }\n\n mouseMoveEvent: ListenerFunc;\n mouseLeaveEvent: ListenerFunc;\n\n protected _handleDragEnd() {\n this.drag = false;\n this.removeEvent(document, \"mousemove\", this.mouseMoveEvent);\n this.removeEvent(document, \"mouseleave\", this.mouseLeaveEvent);\n }\n\n protected _handleDrag(e: MouseEvent) {\n if (!this.drag) {\n return;\n }\n const nl = e.clientX - (this.cx - this.l);\n const nt = e.clientY - (this.cy - this.t);\n const { style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight } = this;\n if (nl < 0) {\n style.left = \"0\";\n } else if (nl < offsetsWidth - offsetWidth) {\n style.left = `${nl}px`;\n } else {\n style.left = `${offsetsWidth - offsetWidth}\"px\"`;\n }\n if (nt < 0) {\n style.top = \"0\";\n } else if (nt < offsetsHeight - offsetHeight) {\n style.top = `${nt}px`;\n } else {\n style.top = `${offsetsHeight - offsetHeight}px`;\n }\n }\n\n reset() {\n const { x, y, style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight, offsetLeft, offsetTop } = this;\n style.left = x || \"0\";\n style.top = y || \"0\";\n if (offsetLeft > offsetsWidth - offsetWidth) {\n style.left = `${offsetsWidth - offsetWidth}px`;\n }\n if (offsetTop > offsetsHeight - offsetHeight) {\n style.top = `${offsetsHeight - offsetHeight}px`;\n }\n }\n}\n\nexport default Dragbox;\n"]}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { GodownElement } from "../../proto/godown-element.js";
|
2
|
+
/**
|
3
|
+
* {@linkcode Rotate} Make child elements rotate.
|
4
|
+
*/
|
5
|
+
export declare class Rotate extends GodownElement {
|
6
|
+
_root: HTMLElement;
|
7
|
+
protected render(): import("lit").TemplateResult<1>;
|
8
|
+
/**
|
9
|
+
* Cancel the offset.
|
10
|
+
*/
|
11
|
+
reset(): void;
|
12
|
+
/**
|
13
|
+
* Apply offset.
|
14
|
+
*/
|
15
|
+
protected _handleRotate(e: MouseEvent): void;
|
16
|
+
/**
|
17
|
+
* Compute offset.
|
18
|
+
* ```
|
19
|
+
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`
|
20
|
+
* ```
|
21
|
+
* @param e Mouse move event.
|
22
|
+
* @returns rotateX, rotateY
|
23
|
+
*/
|
24
|
+
_computeOffset(e: MouseEvent): {
|
25
|
+
rotateX: number;
|
26
|
+
rotateY: number;
|
27
|
+
};
|
28
|
+
}
|
29
|
+
export default Rotate;
|
30
|
+
//# sourceMappingURL=rotate.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rotate.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/wrapper/rotate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAM9D;;GAEG;AACH,qBA+Ba,MAAO,SAAQ,aAAa;IACzB,KAAK,EAAE,WAAW,CAAC;IAEjC,SAAS,CAAC,MAAM;IAOhB;;OAEG;IACH,KAAK;IAKL;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU;IAMrC;;;;;;;OAOG;IACH,cAAc,CAAC,CAAC,EAAE,UAAU;;;;CAU7B;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { css, html } from "../../_deps.js";
|
3
|
+
import { godown } from "../../decorators/godown.js";
|
4
|
+
import { part } from "../../decorators/part.js";
|
5
|
+
import { styles } from "../../decorators/styles.js";
|
6
|
+
import { htmlSlot } from "../../lib/directives.js";
|
7
|
+
import { GodownElement } from "../../proto/godown-element.js";
|
8
|
+
import { createScope } from "../../styles/global.js";
|
9
|
+
const protoName = "rotate";
|
10
|
+
const cssScope = createScope(protoName);
|
11
|
+
/**
|
12
|
+
* {@linkcode Rotate} Make child elements rotate.
|
13
|
+
*/
|
14
|
+
let Rotate = class Rotate extends GodownElement {
|
15
|
+
render() {
|
16
|
+
return html `<div part="root">
|
17
|
+
<div part="slot" @mousemove="${this._handleRotate}">${htmlSlot()}</div>
|
18
|
+
<i @mouseleave="${this.reset}"></i>
|
19
|
+
</div>`;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Cancel the offset.
|
23
|
+
*/
|
24
|
+
reset() {
|
25
|
+
this._root.style.removeProperty("transform");
|
26
|
+
this._root.style.removeProperty("transition");
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Apply offset.
|
30
|
+
*/
|
31
|
+
_handleRotate(e) {
|
32
|
+
const { rotateX, rotateY } = this._computeOffset(e);
|
33
|
+
this._root.style.setProperty("transform", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);
|
34
|
+
this._root.style.setProperty("transition", "0s");
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* Compute offset.
|
38
|
+
* ```
|
39
|
+
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`
|
40
|
+
* ```
|
41
|
+
* @param e Mouse move event.
|
42
|
+
* @returns rotateX, rotateY
|
43
|
+
*/
|
44
|
+
_computeOffset(e) {
|
45
|
+
const { left, top, width, height } = this._root.getBoundingClientRect();
|
46
|
+
const { clientX, clientY } = e;
|
47
|
+
const offsetX = clientX - left;
|
48
|
+
const offsetY = clientY - top;
|
49
|
+
const rotateX = -(offsetY - height / 2) / height / 2;
|
50
|
+
const rotateY = (offsetX - width / 2) / width / 2;
|
51
|
+
return { rotateX, rotateY };
|
52
|
+
}
|
53
|
+
};
|
54
|
+
__decorate([
|
55
|
+
part("root")
|
56
|
+
], Rotate.prototype, "_root", void 0);
|
57
|
+
Rotate = __decorate([
|
58
|
+
godown(protoName),
|
59
|
+
styles(css `
|
60
|
+
:host {
|
61
|
+
display: block;
|
62
|
+
width: -moz-fit-content;
|
63
|
+
width: fit-content;
|
64
|
+
transition: all 0.5s ease-in-out;
|
65
|
+
--${cssScope}--padding: .75em;
|
66
|
+
--${cssScope}--offset: .5em;
|
67
|
+
}
|
68
|
+
|
69
|
+
div {
|
70
|
+
position: relative;
|
71
|
+
transition: inherit;
|
72
|
+
transition-property: transform;
|
73
|
+
}
|
74
|
+
|
75
|
+
i {
|
76
|
+
width: 100%;
|
77
|
+
height: 100%;
|
78
|
+
position: absolute;
|
79
|
+
top: 0;
|
80
|
+
box-sizing: content-box;
|
81
|
+
padding: var(--${cssScope}--offset);
|
82
|
+
margin: calc(-1 * var(--${cssScope}--offset));
|
83
|
+
}
|
84
|
+
|
85
|
+
[part="slot"]{
|
86
|
+
z-index: 2;
|
87
|
+
}
|
88
|
+
`)
|
89
|
+
], Rotate);
|
90
|
+
export { Rotate };
|
91
|
+
export default Rotate;
|
92
|
+
//# sourceMappingURL=rotate.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rotate.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/wrapper/rotate.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;GAEG;AAgCI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,aAAa;IAG7B,MAAM;QACd,OAAO,IAAI,CAAA;q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;qCAAoB;AADtB,MAAM;IA/BlB,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;;;;;QAMH,QAAQ;QACR,QAAQ;;;;;;;;;;;;;;;qBAeK,QAAQ;8BACC,QAAQ;;;;;;CAMrC,CAAC;GACW,MAAM,CA6ClB;;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { css, html } from \"../../_deps.js\";\nimport { godown } from \"../../decorators/godown.js\";\nimport { part } from \"../../decorators/part.js\";\nimport { styles } from \"../../decorators/styles.js\";\nimport { htmlSlot } from \"../../lib/directives.js\";\nimport { GodownElement } from \"../../proto/godown-element.js\";\nimport { createScope } from \"../../styles/global.js\";\n\nconst protoName = \"rotate\";\nconst cssScope = createScope(protoName);\n\n/**\n * {@linkcode Rotate} Make child elements rotate.\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n width: -moz-fit-content;\n width: fit-content;\n transition: all 0.5s ease-in-out;\n --${cssScope}--padding: .75em;\n --${cssScope}--offset: .5em;\n }\n\n div {\n position: relative;\n transition: inherit;\n transition-property: transform;\n }\n\n i {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n box-sizing: content-box;\n padding: var(--${cssScope}--offset);\n margin: calc(-1 * var(--${cssScope}--offset));\n }\n\n [part=\"slot\"]{\n z-index: 2;\n }\n`)\nexport class Rotate extends GodownElement {\n @part(\"root\") _root: HTMLElement;\n\n protected render() {\n return html`<div part=\"root\">\n <div part=\"slot\" @mousemove=\"${this._handleRotate}\">${htmlSlot()}</div>\n <i @mouseleave=\"${this.reset}\"></i>\n </div>`;\n }\n\n /**\n * Cancel the offset.\n */\n reset() {\n this._root.style.removeProperty(\"transform\");\n this._root.style.removeProperty(\"transition\");\n }\n\n /**\n * Apply offset.\n */\n protected _handleRotate(e: MouseEvent) {\n const { rotateX, rotateY } = this._computeOffset(e);\n this._root.style.setProperty(\"transform\", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);\n this._root.style.setProperty(\"transition\", \"0s\");\n }\n\n /**\n * Compute offset.\n * ```\n * `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`\n * ```\n * @param e Mouse move event.\n * @returns rotateX, rotateY\n */\n _computeOffset(e: MouseEvent) {\n const { left, top, width, height } = this._root.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n\n const rotateX = -(offsetY - height / 2) / height / 2;\n const rotateY = (offsetX - width / 2) / width / 2;\n return { rotateX, rotateY };\n }\n}\n\nexport default Rotate;\n"]}
|
package/.deps.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":".deps.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":[".deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAuB,OAAO,EAAyB,MAAM,KAAK,CAAC;AACrG,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { html, svg, css, unsafeCSS, type CSSResultGroup, nothing, type PropertyValueMap } from \"lit\";\nexport * from \"lit/decorators.js\";\nexport { ifDefined } from \"lit/directives/if-defined.js\";\nexport { classMap } from \"lit/directives/class-map.js\";\n"]}
|