godown 2.7.7 → 3.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -80
- package/alert.d.ts +2 -3
- package/alert.d.ts.map +1 -1
- package/alert.js +5 -4
- package/alert.js.map +1 -1
- package/avatar.d.ts +2 -3
- package/avatar.d.ts.map +1 -1
- package/avatar.js +5 -4
- package/avatar.js.map +1 -1
- package/breath.d.ts +9 -0
- package/breath.d.ts.map +1 -0
- package/breath.js +6 -0
- package/breath.js.map +1 -0
- package/button.d.ts +2 -3
- package/button.d.ts.map +1 -1
- package/button.js +5 -4
- package/button.js.map +1 -1
- package/card.d.ts +2 -3
- package/card.d.ts.map +1 -1
- package/card.js +5 -4
- package/card.js.map +1 -1
- package/carousel.d.ts +2 -3
- package/carousel.d.ts.map +1 -1
- package/carousel.js +5 -4
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +50 -0
- package/components/alert.d.ts.map +1 -0
- package/components/alert.js +167 -0
- package/components/alert.js.map +1 -0
- package/components/avatar.d.ts +26 -0
- package/components/avatar.d.ts.map +1 -0
- package/components/avatar.js +62 -0
- package/components/avatar.js.map +1 -0
- package/components/breath.d.ts +34 -0
- package/components/breath.d.ts.map +1 -0
- package/components/breath.js +80 -0
- package/components/breath.js.map +1 -0
- package/{web-components/button → components}/button.d.ts +6 -5
- package/components/button.d.ts.map +1 -0
- package/components/button.js +167 -0
- package/components/button.js.map +1 -0
- package/components/card.d.ts +20 -0
- package/components/card.d.ts.map +1 -0
- package/components/card.js +55 -0
- package/components/card.js.map +1 -0
- package/components/carousel.d.ts +40 -0
- package/components/carousel.d.ts.map +1 -0
- package/components/carousel.js +113 -0
- package/components/carousel.js.map +1 -0
- package/{web-components/details → components}/details.d.ts +5 -3
- package/components/details.d.ts.map +1 -0
- package/components/details.js +50 -0
- package/components/details.js.map +1 -0
- package/components/dialog.d.ts +33 -0
- package/components/dialog.d.ts.map +1 -0
- package/components/dialog.js +92 -0
- package/components/dialog.js.map +1 -0
- package/components/divider.d.ts +17 -0
- package/components/divider.d.ts.map +1 -0
- package/components/divider.js +37 -0
- package/components/divider.js.map +1 -0
- package/{web-components/wrapper → components}/dragbox.d.ts +15 -5
- package/components/dragbox.d.ts.map +1 -0
- package/{web-components/wrapper → components}/dragbox.js +32 -27
- package/components/dragbox.js.map +1 -0
- package/components/flex.d.ts +31 -0
- package/components/flex.d.ts.map +1 -0
- package/components/flex.js +55 -0
- package/components/flex.js.map +1 -0
- package/{web-components/form → components}/form.d.ts +4 -2
- package/components/form.d.ts.map +1 -0
- package/{web-components/form → components}/form.js +16 -17
- package/components/form.js.map +1 -0
- package/components/grid.d.ts +31 -0
- package/components/grid.d.ts.map +1 -0
- package/components/grid.js +56 -0
- package/components/grid.js.map +1 -0
- package/components/input.d.ts +20 -0
- package/components/input.d.ts.map +1 -0
- package/components/input.js +54 -0
- package/components/input.js.map +1 -0
- package/components/layout.d.ts +29 -0
- package/components/layout.d.ts.map +1 -0
- package/components/layout.js +48 -0
- package/components/layout.js.map +1 -0
- package/components/link.d.ts +20 -0
- package/components/link.d.ts.map +1 -0
- package/components/link.js +43 -0
- package/components/link.js.map +1 -0
- package/{web-components/progress → components}/progress.d.ts +5 -3
- package/components/progress.d.ts.map +1 -0
- package/components/progress.js +68 -0
- package/components/progress.js.map +1 -0
- package/components/range.d.ts +60 -0
- package/components/range.d.ts.map +1 -0
- package/components/range.js +193 -0
- package/components/range.js.map +1 -0
- package/{web-components/wrapper → components}/rotate.d.ts +4 -8
- package/components/rotate.d.ts.map +1 -0
- package/components/rotate.js +57 -0
- package/components/rotate.js.map +1 -0
- package/components/router.d.ts +121 -0
- package/components/router.d.ts.map +1 -0
- package/components/router.js +251 -0
- package/components/router.js.map +1 -0
- package/components/select.d.ts +50 -0
- package/components/select.d.ts.map +1 -0
- package/components/select.js +211 -0
- package/components/select.js.map +1 -0
- package/{web-components/skeleton → components}/skeleton.d.ts +6 -6
- package/components/skeleton.d.ts.map +1 -0
- package/components/skeleton.js +56 -0
- package/components/skeleton.js.map +1 -0
- package/components/split.d.ts +32 -0
- package/components/split.d.ts.map +1 -0
- package/components/split.js +121 -0
- package/components/split.js.map +1 -0
- package/{web-components/input/switch-input.d.ts → components/switch.d.ts} +9 -10
- package/components/switch.d.ts.map +1 -0
- package/components/switch.js +93 -0
- package/components/switch.js.map +1 -0
- package/{web-components/text → components}/text.d.ts +5 -3
- package/components/text.d.ts.map +1 -0
- package/components/text.js +44 -0
- package/components/text.js.map +1 -0
- package/{web-components/text → components}/time.d.ts +5 -3
- package/components/time.d.ts.map +1 -0
- package/{web-components/text → components}/time.js +18 -21
- package/components/time.js.map +1 -0
- package/components/tooltip.d.ts +38 -0
- package/components/tooltip.d.ts.map +1 -0
- package/components/tooltip.js +67 -0
- package/components/tooltip.js.map +1 -0
- package/{web-components/text → components}/typewriter.d.ts +5 -3
- package/components/typewriter.d.ts.map +1 -0
- package/{web-components/text → components}/typewriter.js +24 -48
- package/components/typewriter.js.map +1 -0
- package/core/global-style.d.ts +21 -0
- package/core/global-style.d.ts.map +1 -0
- package/core/global-style.js +46 -0
- package/core/global-style.js.map +1 -0
- package/core/super-anchor.d.ts +15 -0
- package/core/super-anchor.d.ts.map +1 -0
- package/core/super-anchor.js +39 -0
- package/core/super-anchor.js.map +1 -0
- package/core/super-input.d.ts +39 -0
- package/core/super-input.d.ts.map +1 -0
- package/core/super-input.js +115 -0
- package/core/super-input.js.map +1 -0
- package/{proto → core}/super-openable.d.ts +4 -8
- package/core/super-openable.d.ts.map +1 -0
- package/{proto → core}/super-openable.js +10 -15
- package/core/super-openable.js.map +1 -0
- package/custom-elements.json +1 -0
- package/details.d.ts +2 -3
- package/details.d.ts.map +1 -1
- package/details.js +5 -4
- package/details.js.map +1 -1
- package/dialog.d.ts +2 -3
- package/dialog.d.ts.map +1 -1
- package/dialog.js +5 -4
- package/dialog.js.map +1 -1
- package/divider.d.ts +2 -3
- package/divider.d.ts.map +1 -1
- package/divider.js +5 -4
- package/divider.js.map +1 -1
- package/dragbox.d.ts +2 -3
- package/dragbox.d.ts.map +1 -1
- package/dragbox.js +5 -4
- package/dragbox.js.map +1 -1
- package/flex.d.ts +8 -0
- package/flex.d.ts.map +1 -0
- package/flex.js +6 -0
- package/flex.js.map +1 -0
- package/form.d.ts +2 -3
- package/form.d.ts.map +1 -1
- package/form.js +5 -4
- package/form.js.map +1 -1
- package/grid.d.ts +8 -0
- package/grid.d.ts.map +1 -0
- package/grid.js +6 -0
- package/grid.js.map +1 -0
- package/index.d.ts +28 -32
- package/index.d.ts.map +1 -1
- package/index.js +57 -33
- package/index.js.map +1 -1
- package/input.d.ts +3 -3
- package/input.d.ts.map +1 -1
- package/input.js +5 -4
- package/input.js.map +1 -1
- package/layout.d.ts +3 -3
- package/layout.d.ts.map +1 -1
- package/layout.js +5 -4
- package/layout.js.map +1 -1
- package/link.d.ts +3 -3
- package/link.d.ts.map +1 -1
- package/link.js +5 -4
- package/link.js.map +1 -1
- package/package.json +42 -81
- package/progress.d.ts +3 -3
- package/progress.d.ts.map +1 -1
- package/progress.js +5 -4
- package/progress.js.map +1 -1
- package/range.d.ts +9 -0
- package/range.d.ts.map +1 -0
- package/range.js +6 -0
- package/range.js.map +1 -0
- package/rotate.d.ts +3 -3
- package/rotate.d.ts.map +1 -1
- package/rotate.js +5 -4
- package/rotate.js.map +1 -1
- package/router.d.ts +3 -3
- package/router.d.ts.map +1 -1
- package/router.js +5 -4
- package/router.js.map +1 -1
- package/select.d.ts +9 -0
- package/select.d.ts.map +1 -0
- package/select.js +6 -0
- package/select.js.map +1 -0
- package/skeleton.d.ts +3 -3
- package/skeleton.d.ts.map +1 -1
- package/skeleton.js +5 -4
- package/skeleton.js.map +1 -1
- package/split.d.ts +9 -0
- package/split.d.ts.map +1 -0
- package/split.js +6 -0
- package/split.js.map +1 -0
- package/switch.d.ts +9 -0
- package/switch.d.ts.map +1 -0
- package/switch.js +6 -0
- package/switch.js.map +1 -0
- package/text.d.ts +3 -3
- package/text.d.ts.map +1 -1
- package/text.js +5 -4
- package/text.js.map +1 -1
- package/time.d.ts +3 -3
- package/time.d.ts.map +1 -1
- package/time.js +5 -4
- package/time.js.map +1 -1
- package/tooltip.d.ts +3 -3
- package/tooltip.d.ts.map +1 -1
- package/tooltip.js +5 -4
- package/tooltip.js.map +1 -1
- package/typewriter.d.ts +2 -3
- package/typewriter.d.ts.map +1 -1
- package/typewriter.js +5 -4
- package/typewriter.js.map +1 -1
- package/vscode.css-custom-data.json +1 -0
- package/vscode.html-custom-data.json +1 -0
- package/web-types.json +1 -0
- package/_deps.d.ts +0 -4
- package/_deps.d.ts.map +0 -1
- package/_deps.js +0 -4
- package/_deps.js.map +0 -1
- package/avatar-group.d.ts +0 -9
- package/avatar-group.d.ts.map +0 -1
- package/avatar-group.js +0 -5
- package/avatar-group.js.map +0 -1
- package/components.json +0 -194
- package/conf.d.ts +0 -12
- package/conf.d.ts.map +0 -1
- package/conf.js +0 -24
- package/conf.js.map +0 -1
- package/decorators/godown.d.ts +0 -4
- package/decorators/godown.d.ts.map +0 -1
- package/decorators/godown.js +0 -9
- package/decorators/godown.js.map +0 -1
- package/decorators/part.d.ts +0 -7
- package/decorators/part.d.ts.map +0 -1
- package/decorators/part.js +0 -8
- package/decorators/part.js.map +0 -1
- package/decorators/styles.d.ts +0 -3
- package/decorators/styles.d.ts.map +0 -1
- package/decorators/styles.js +0 -8
- package/decorators/styles.js.map +0 -1
- package/flex-flow.d.ts +0 -9
- package/flex-flow.d.ts.map +0 -1
- package/flex-flow.js +0 -5
- package/flex-flow.js.map +0 -1
- package/grid-flow.d.ts +0 -9
- package/grid-flow.d.ts.map +0 -1
- package/grid-flow.js +0 -5
- package/grid-flow.js.map +0 -1
- package/label-input.d.ts +0 -9
- package/label-input.d.ts.map +0 -1
- package/label-input.js +0 -5
- package/label-input.js.map +0 -1
- package/lib/css.d.ts +0 -13
- package/lib/css.d.ts.map +0 -1
- package/lib/css.js +0 -29
- package/lib/css.js.map +0 -1
- package/lib/directives.d.ts +0 -25
- package/lib/directives.d.ts.map +0 -1
- package/lib/directives.js +0 -40
- package/lib/directives.js.map +0 -1
- package/lib/event-coll.d.ts +0 -13
- package/lib/event-coll.d.ts.map +0 -1
- package/lib/event-coll.js +0 -45
- package/lib/event-coll.js.map +0 -1
- package/lib/icons.d.ts +0 -25
- package/lib/icons.d.ts.map +0 -1
- package/lib/icons.js +0 -73
- package/lib/icons.js.map +0 -1
- package/lib/jsx.d.ts +0 -4
- package/lib/jsx.d.ts.map +0 -1
- package/lib/jsx.js +0 -52
- package/lib/jsx.js.map +0 -1
- package/lib/route-tree.d.ts +0 -28
- package/lib/route-tree.d.ts.map +0 -1
- package/lib/route-tree.js +0 -141
- package/lib/route-tree.js.map +0 -1
- package/lib/utils.d.ts +0 -10
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -71
- package/lib/utils.js.map +0 -1
- package/overbreath.d.ts +0 -9
- package/overbreath.d.ts.map +0 -1
- package/overbreath.js +0 -5
- package/overbreath.js.map +0 -1
- package/proto/godown-config.d.ts +0 -41
- package/proto/godown-config.d.ts.map +0 -1
- package/proto/godown-config.js +0 -27
- package/proto/godown-config.js.map +0 -1
- package/proto/godown-element.d.ts +0 -125
- package/proto/godown-element.d.ts.map +0 -1
- package/proto/godown-element.js +0 -204
- package/proto/godown-element.js.map +0 -1
- package/proto/super-a.d.ts +0 -30
- package/proto/super-a.d.ts.map +0 -1
- package/proto/super-a.js +0 -141
- package/proto/super-a.js.map +0 -1
- package/proto/super-input.d.ts +0 -44
- package/proto/super-input.d.ts.map +0 -1
- package/proto/super-input.js +0 -119
- package/proto/super-input.js.map +0 -1
- package/proto/super-openable.d.ts.map +0 -1
- package/proto/super-openable.js.map +0 -1
- package/range-input.d.ts +0 -9
- package/range-input.d.ts.map +0 -1
- package/range-input.js +0 -5
- package/range-input.js.map +0 -1
- package/react/create.d.ts +0 -5
- package/react/create.d.ts.map +0 -1
- package/react/create.js +0 -16
- package/react/create.js.map +0 -1
- package/react/index.d.ts +0 -65
- package/react/index.d.ts.map +0 -1
- package/react/index.js +0 -132
- package/react/index.js.map +0 -1
- package/router-link.d.ts +0 -9
- package/router-link.d.ts.map +0 -1
- package/router-link.js +0 -5
- package/router-link.js.map +0 -1
- package/search-input.d.ts +0 -9
- package/search-input.d.ts.map +0 -1
- package/search-input.js +0 -5
- package/search-input.js.map +0 -1
- package/select-input.d.ts +0 -9
- package/select-input.d.ts.map +0 -1
- package/select-input.js +0 -5
- package/select-input.js.map +0 -1
- package/split-input.d.ts +0 -9
- package/split-input.d.ts.map +0 -1
- package/split-input.js +0 -5
- package/split-input.js.map +0 -1
- package/styles/colors/presets.d.ts +0 -13
- package/styles/colors/presets.d.ts.map +0 -1
- package/styles/colors/presets.js +0 -6
- package/styles/colors/presets.js.map +0 -1
- package/styles/colors/presetsRGB.d.ts +0 -16
- package/styles/colors/presetsRGB.d.ts.map +0 -1
- package/styles/colors/presetsRGB.js +0 -134
- package/styles/colors/presetsRGB.js.map +0 -1
- package/styles/global.d.ts +0 -18
- package/styles/global.d.ts.map +0 -1
- package/styles/global.js +0 -78
- package/styles/global.js.map +0 -1
- package/styles/inputStyle.d.ts +0 -3
- package/styles/inputStyle.d.ts.map +0 -1
- package/styles/inputStyle.js +0 -59
- package/styles/inputStyle.js.map +0 -1
- package/switch-input.d.ts +0 -9
- package/switch-input.d.ts.map +0 -1
- package/switch-input.js +0 -5
- package/switch-input.js.map +0 -1
- package/web-components/alert/alert.d.ts +0 -36
- package/web-components/alert/alert.d.ts.map +0 -1
- package/web-components/alert/alert.js +0 -161
- package/web-components/alert/alert.js.map +0 -1
- package/web-components/avatar/avatar-group.d.ts +0 -21
- package/web-components/avatar/avatar-group.d.ts.map +0 -1
- package/web-components/avatar/avatar-group.js +0 -86
- package/web-components/avatar/avatar-group.js.map +0 -1
- package/web-components/avatar/avatar.d.ts +0 -28
- package/web-components/avatar/avatar.d.ts.map +0 -1
- package/web-components/avatar/avatar.js +0 -120
- package/web-components/avatar/avatar.js.map +0 -1
- package/web-components/button/button.d.ts.map +0 -1
- package/web-components/button/button.js +0 -256
- package/web-components/button/button.js.map +0 -1
- package/web-components/card/card.d.ts +0 -9
- package/web-components/card/card.d.ts.map +0 -1
- package/web-components/card/card.js +0 -75
- package/web-components/card/card.js.map +0 -1
- package/web-components/carousel/carousel.d.ts +0 -29
- package/web-components/carousel/carousel.d.ts.map +0 -1
- package/web-components/carousel/carousel.js +0 -185
- package/web-components/carousel/carousel.js.map +0 -1
- package/web-components/details/details.d.ts.map +0 -1
- package/web-components/details/details.js +0 -124
- package/web-components/details/details.js.map +0 -1
- package/web-components/dialog/dialog.d.ts +0 -31
- package/web-components/dialog/dialog.d.ts.map +0 -1
- package/web-components/dialog/dialog.js +0 -143
- package/web-components/dialog/dialog.js.map +0 -1
- package/web-components/divider/divider.d.ts +0 -13
- package/web-components/divider/divider.d.ts.map +0 -1
- package/web-components/divider/divider.js +0 -95
- package/web-components/divider/divider.js.map +0 -1
- package/web-components/form/form.d.ts.map +0 -1
- package/web-components/form/form.js.map +0 -1
- package/web-components/input/input.d.ts +0 -37
- package/web-components/input/input.d.ts.map +0 -1
- package/web-components/input/input.js +0 -152
- package/web-components/input/input.js.map +0 -1
- package/web-components/input/label-input.d.ts +0 -15
- package/web-components/input/label-input.d.ts.map +0 -1
- package/web-components/input/label-input.js +0 -96
- package/web-components/input/label-input.js.map +0 -1
- package/web-components/input/range-input.d.ts +0 -53
- package/web-components/input/range-input.d.ts.map +0 -1
- package/web-components/input/range-input.js +0 -316
- package/web-components/input/range-input.js.map +0 -1
- package/web-components/input/search-input.d.ts +0 -42
- package/web-components/input/search-input.d.ts.map +0 -1
- package/web-components/input/search-input.js +0 -214
- package/web-components/input/search-input.js.map +0 -1
- package/web-components/input/select-input.d.ts +0 -36
- package/web-components/input/select-input.d.ts.map +0 -1
- package/web-components/input/select-input.js +0 -210
- package/web-components/input/select-input.js.map +0 -1
- package/web-components/input/split-input.d.ts +0 -29
- package/web-components/input/split-input.d.ts.map +0 -1
- package/web-components/input/split-input.js +0 -184
- package/web-components/input/split-input.js.map +0 -1
- package/web-components/input/switch-input.d.ts.map +0 -1
- package/web-components/input/switch-input.js +0 -189
- package/web-components/input/switch-input.js.map +0 -1
- package/web-components/layout/flex-flow.d.ts +0 -17
- package/web-components/layout/flex-flow.d.ts.map +0 -1
- package/web-components/layout/flex-flow.js +0 -73
- package/web-components/layout/flex-flow.js.map +0 -1
- package/web-components/layout/grid-flow.d.ts +0 -14
- package/web-components/layout/grid-flow.d.ts.map +0 -1
- package/web-components/layout/grid-flow.js +0 -56
- package/web-components/layout/grid-flow.js.map +0 -1
- package/web-components/layout/layout.d.ts +0 -18
- package/web-components/layout/layout.d.ts.map +0 -1
- package/web-components/layout/layout.js +0 -76
- package/web-components/layout/layout.js.map +0 -1
- package/web-components/link/link.d.ts +0 -10
- package/web-components/link/link.d.ts.map +0 -1
- package/web-components/link/link.js +0 -17
- package/web-components/link/link.js.map +0 -1
- package/web-components/link/router-link.d.ts +0 -19
- package/web-components/link/router-link.d.ts.map +0 -1
- package/web-components/link/router-link.js +0 -60
- package/web-components/link/router-link.js.map +0 -1
- package/web-components/progress/progress.d.ts.map +0 -1
- package/web-components/progress/progress.js +0 -107
- package/web-components/progress/progress.js.map +0 -1
- package/web-components/router/router.d.ts +0 -86
- package/web-components/router/router.d.ts.map +0 -1
- package/web-components/router/router.js +0 -246
- package/web-components/router/router.js.map +0 -1
- package/web-components/skeleton/skeleton.d.ts.map +0 -1
- package/web-components/skeleton/skeleton.js +0 -130
- package/web-components/skeleton/skeleton.js.map +0 -1
- package/web-components/text/overbreath.d.ts +0 -22
- package/web-components/text/overbreath.d.ts.map +0 -1
- package/web-components/text/overbreath.js +0 -132
- package/web-components/text/overbreath.js.map +0 -1
- package/web-components/text/text.d.ts.map +0 -1
- package/web-components/text/text.js +0 -94
- package/web-components/text/text.js.map +0 -1
- package/web-components/text/time.d.ts.map +0 -1
- package/web-components/text/time.js.map +0 -1
- package/web-components/text/typewriter.d.ts.map +0 -1
- package/web-components/text/typewriter.js.map +0 -1
- package/web-components/tooltip/tooltip.d.ts +0 -30
- package/web-components/tooltip/tooltip.d.ts.map +0 -1
- package/web-components/tooltip/tooltip.js +0 -123
- package/web-components/tooltip/tooltip.js.map +0 -1
- package/web-components/wrapper/dragbox.d.ts.map +0 -1
- package/web-components/wrapper/dragbox.js.map +0 -1
- package/web-components/wrapper/rotate.d.ts.map +0 -1
- package/web-components/wrapper/rotate.js +0 -92
- package/web-components/wrapper/rotate.js.map +0 -1
@@ -1,94 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { css, html, property } from "../../_deps.js";
|
3
|
-
import { godown } from "../../decorators/godown.js";
|
4
|
-
import { styles } from "../../decorators/styles.js";
|
5
|
-
import { combine, htmlSlot } from "../../lib/directives.js";
|
6
|
-
import { GodownElement } from "../../proto/godown-element.js";
|
7
|
-
import { createScope, cssGlobalVars } from "../../styles/global.js";
|
8
|
-
const protoName = "text";
|
9
|
-
const cssScope = createScope(protoName);
|
10
|
-
/**
|
11
|
-
* {@linkcode Text } renders nowrap text.
|
12
|
-
*/
|
13
|
-
let Text = class Text extends GodownElement {
|
14
|
-
constructor() {
|
15
|
-
super(...arguments);
|
16
|
-
/**
|
17
|
-
* Underline behavior.
|
18
|
-
*/
|
19
|
-
this.underline = "none";
|
20
|
-
}
|
21
|
-
render() {
|
22
|
-
return html `<span
|
23
|
-
part="root"
|
24
|
-
class="${combine({
|
25
|
-
[this.underline || "always"]: true,
|
26
|
-
clip: this.clip,
|
27
|
-
})}"
|
28
|
-
>
|
29
|
-
${htmlSlot()}
|
30
|
-
</span>`;
|
31
|
-
}
|
32
|
-
};
|
33
|
-
__decorate([
|
34
|
-
property()
|
35
|
-
], Text.prototype, "underline", void 0);
|
36
|
-
__decorate([
|
37
|
-
property({ type: Boolean })
|
38
|
-
], Text.prototype, "clip", void 0);
|
39
|
-
Text = __decorate([
|
40
|
-
godown(protoName),
|
41
|
-
styles([
|
42
|
-
css `
|
43
|
-
:host {
|
44
|
-
--${cssScope}--color: currentColor;
|
45
|
-
--${cssScope}--color-hover: currentColor;
|
46
|
-
--${cssScope}--color-active: currentColor;
|
47
|
-
display: inline-block;
|
48
|
-
text-overflow: ellipsis;
|
49
|
-
overflow-wrap: break-word;
|
50
|
-
}
|
51
|
-
|
52
|
-
span {
|
53
|
-
white-space: nowrap;
|
54
|
-
width: 100%;
|
55
|
-
vertical-align: bottom;
|
56
|
-
display: inline-block;
|
57
|
-
text-overflow: inherit;
|
58
|
-
overflow-wrap: inherit;
|
59
|
-
overflow: hidden;
|
60
|
-
color: var(--${cssScope}--color, inherit);
|
61
|
-
}
|
62
|
-
|
63
|
-
span:hover {
|
64
|
-
color: var(--${cssScope}--color-hover, inherit);
|
65
|
-
}
|
66
|
-
|
67
|
-
span:active {
|
68
|
-
color: var(--${cssScope}--color-active, inherit);
|
69
|
-
}
|
70
|
-
|
71
|
-
.hover:hover,
|
72
|
-
.active:active,
|
73
|
-
.always {
|
74
|
-
text-decoration: underline;
|
75
|
-
}
|
76
|
-
|
77
|
-
.none {
|
78
|
-
text-decoration: none;
|
79
|
-
}
|
80
|
-
|
81
|
-
.clip{
|
82
|
-
background: var(--${cssGlobalVars.clipBackground});
|
83
|
-
display: inline-block;
|
84
|
-
color: transparent;
|
85
|
-
-webkit-text-fill-color: transparent;
|
86
|
-
background-clip: text;
|
87
|
-
-webkit-background-clip: text;
|
88
|
-
}
|
89
|
-
`,
|
90
|
-
])
|
91
|
-
], Text);
|
92
|
-
export { Text };
|
93
|
-
export default Text;
|
94
|
-
//# sourceMappingURL=text.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/text.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,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;GAEG;AAoDI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,aAAa;IAAhC;;QACL;;WAEG;QACS,cAAS,GAA2C,MAAM,CAAC;IAkBzE,CAAC;IAXW,MAAM;QACd,OAAO,IAAI,CAAA;;eAEA,OAAO,CAAC;YACf,CAAC,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,EAAE,IAAI;YAClC,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;;QAEA,QAAQ,EAAE;YACN,CAAC;IACX,CAAC;CACF,CAAA;AAlBa;IAAX,QAAQ,EAAE;uCAA4D;AAK1C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kCAAe;AAThC,IAAI;IAnDhB,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC;QACN,GAAG,CAAA;;UAEK,QAAQ;UACR,QAAQ;UACR,QAAQ;;;;;;;;;;;;;;qBAcG,QAAQ;;;;qBAIR,QAAQ;;;;qBAIR,QAAQ;;;;;;;;;;;;;;0BAcH,aAAa,CAAC,cAAc;;;;;;;GAOnD;KACF,CAAC;GACW,IAAI,CAsBhB;;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { css, html, property } from \"../../_deps.js\";\nimport { godown } from \"../../decorators/godown.js\";\nimport { styles } from \"../../decorators/styles.js\";\nimport { combine, htmlSlot } from \"../../lib/directives.js\";\nimport { GodownElement } from \"../../proto/godown-element.js\";\nimport { createScope, cssGlobalVars } from \"../../styles/global.js\";\n\nconst protoName = \"text\";\n\nconst cssScope = createScope(protoName);\n\n/**\n * {@linkcode Text } renders nowrap text.\n */\n@godown(protoName)\n@styles([\n css`\n :host {\n --${cssScope}--color: currentColor;\n --${cssScope}--color-hover: currentColor;\n --${cssScope}--color-active: currentColor;\n display: inline-block;\n text-overflow: ellipsis;\n overflow-wrap: break-word;\n }\n\n span {\n white-space: nowrap;\n width: 100%;\n vertical-align: bottom;\n display: inline-block;\n text-overflow: inherit;\n overflow-wrap: inherit;\n overflow: hidden;\n color: var(--${cssScope}--color, inherit);\n }\n\n span:hover {\n color: var(--${cssScope}--color-hover, inherit);\n }\n\n span:active {\n color: var(--${cssScope}--color-active, inherit);\n }\n\n .hover:hover,\n .active:active,\n .always {\n text-decoration: underline;\n }\n\n .none {\n text-decoration: none;\n }\n\n .clip{\n background: var(--${cssGlobalVars.clipBackground});\n display: inline-block;\n color: transparent;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n -webkit-background-clip: text;\n }\n `,\n])\nexport class Text extends GodownElement {\n /**\n * Underline behavior.\n */\n @property() underline: \"none\" | \"hover\" | \"active\" | \"always\" = \"none\";\n\n /**\n * Set background-clip to text.\n */\n @property({ type: Boolean }) clip: boolean;\n\n protected render() {\n return html`<span\n part=\"root\"\n class=\"${combine({\n [this.underline || \"always\"]: true,\n clip: this.clip,\n })}\"\n >\n ${htmlSlot()}\n </span>`;\n }\n}\n\nexport default Text;\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9D;;GAEG;AACH,qBAQa,IAAK,SAAQ,aAAa;IACrC;;OAEG;IACS,MAAM,SAAO;IACzB;;;OAGG;IACS,MAAM,SAA8B;IAChD;;OAEG;IACyB,IAAI,OAAc;IAC9C;;OAEG;IACyB,OAAO,SAAK;IACxC;;OAEG;IACyB,GAAG,SAAK;IAEpC,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,CAAC,MAAM,IAAI,MAAM;IAI1B,SAAS,CAAC,YAAY;IAMtB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAS1D,oBAAoB;IAIpB,YAAY;IAMZ;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;CA0CrD;AAED,eAAe,IAAI,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"time.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/time.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;GAEG;AASI,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,aAAa;IAAhC;;QACL;;WAEG;QACS,WAAM,GAAG,GAAG,CAAC;QACzB;;;WAGG;QACS,WAAM,GAAG,0BAA0B,CAAC;QAChD;;WAEG;QACyB,SAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9C;;WAEG;QACyB,YAAO,GAAG,CAAC,CAAC;QACxC;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;IAyFtC,CAAC;IArFW,MAAM;QACd,OAAO,MAAI,CAAC,GAAG,CAAC,IAAI,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C,eAAe,EAAE,EAAE,CAAC,CAAC;SACzC,CAAC;QACF,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,MAAM;aACV,OAAO,EAAE;aACT,IAAI,CAAC,EAAE,CAAC;aACR,OAAO,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE;YACvC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAA;AA1Ga;IAAX,QAAQ,EAAE;oCAAc;AAKb;IAAX,QAAQ,EAAE;oCAAqC;AAIpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kCAAmB;AAIlB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCAAa;AAIZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iCAAS;AArBzB,IAAI;IARhB,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC;QACN,GAAG,CAAA;;;;GAIF;KACF,CAAC;GACW,IAAI,CA8GhB;;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { type PropertyValues } from \"lit\";\n\nimport { css, property } from \"../../_deps.js\";\nimport { godown } from \"../../decorators/godown.js\";\nimport styles from \"../../decorators/styles.js\";\nimport { GodownElement } from \"../../proto/godown-element.js\";\n\nconst protoName = \"time\";\n\n/**\n * {@linkcode Time} renders a formatting time.\n */\n@godown(protoName)\n@styles([\n css`\n :host {\n text-align: center;\n }\n `,\n])\nexport class Time extends GodownElement {\n /**\n * Cancels the next character formatting.\n */\n @property() escape = \"%\";\n /**\n * Format strings.\n * {@linkcode Time.fmt}\n */\n @property() format = \"YYYY-MM-DD hh:mm:ss UTFZ\";\n /**\n * Time.\n */\n @property({ type: Object }) time = new Date();\n /**\n * If there is a value, update every gap or timeout.\n */\n @property({ type: Number }) timeout = 0;\n /**\n * The number of milliseconds that change with each update.\n */\n @property({ type: Number }) gap = 0;\n\n timeoutId: number;\n\n protected render(): string {\n return Time.fmt(this.format, this.time, this.escape);\n }\n\n protected firstUpdated() {\n if (this.timeout) {\n this.timeoutId = this.startTimeout();\n }\n }\n\n protected updated(changedProperties: PropertyValues): void {\n if (changedProperties.has(\"timeout\")) {\n clearInterval(this.timeoutId);\n if (this.timeout) {\n this.timeoutId = this.startTimeout();\n }\n }\n }\n\n disconnectedCallback() {\n clearInterval(this.timeoutId);\n }\n\n startTimeout() {\n return setInterval(() => {\n this.time = new Date(this.time.getTime() + (this.gap || this.timeout));\n }, Math.abs(this.timeout));\n }\n\n /**\n * Y for year\\\n * M for month\\\n * D for day\\\n * h for hour\\\n * m for minute\\\n * s for second\\\n * S for milli Second\\\n * Z for time zone.\n *\n * @param fm Format string.\n * @param tm Time.\n * @returns Format result\n */\n static fmt(fm: string, tm: Date, em: string): string {\n if (!fm) {\n return fm;\n }\n tm = typeof tm === \"string\" ? new Date(tm) : tm;\n if (isNaN(tm.getTime())) {\n return fm;\n }\n const rest = [];\n const replaced = `${em}${em}`;\n fm = fm.replace(new RegExp(`${em}([ZYMDhmsS${em}])`, \"g\"), (_, p1) => {\n rest.push(p1);\n return replaced;\n });\n\n function formatNumber(n: number, max = 2) {\n return n.toString().padStart(max, \"0\").split(\"\");\n }\n\n const z = tm.getTimezoneOffset() / -60;\n const switcher: Record<string, string[]> = {\n Z: [z >= 0 ? \"+\" + z.toString() : z.toString()],\n Y: tm.getFullYear().toString().split(\"\"),\n M: formatNumber(tm.getMonth() + 1),\n D: formatNumber(tm.getDate()),\n h: formatNumber(tm.getHours()),\n m: formatNumber(tm.getMinutes()),\n s: formatNumber(tm.getSeconds()),\n S: formatNumber(tm.getMilliseconds(), 3),\n };\n const result: string[] = [];\n for (const f of fm.split(\"\").reverse()) {\n const s = switcher[f]?.pop();\n result.push(s ? s : f);\n }\n return result\n .reverse()\n .join(\"\")\n .replace(new RegExp(replaced, \"g\"), () => {\n return rest.shift();\n });\n }\n}\n\nexport default Time;\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"typewriter.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/text/typewriter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,gBAAgB,EAAgB,MAAM,gBAAgB,CAAC;AAK1F,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAM9D;;GAEG;AACH,qBAiCa,UAAW,SAAQ,aAAa;IAC3C;;OAEG;IACS,IAAI,SAAM;IACtB;;OAEG;IAC0B,OAAO,UAAS;IAC7C;;OAEG;IAC0B,KAAK,UAAS;IAC3C;;OAEG;IACyB,GAAG,SAAO;IACtC;;OAEG;IACyB,GAAG,SAAM;IACrC;;OAEG;IACyB,KAAK,SAAK;IACtC;;OAEG;IACyB,KAAK,SAAK;IACtC;;OAEG;IACM,OAAO,SAAM;IAEtB,SAAS,EAAE,MAAM,CAAC;IACN,EAAE,EAAE,WAAW,CAAC;IAE5B;;OAEG;IACH,IAAI,GAAG,WAEN;IAED,SAAS,CAAC,MAAM;IAIhB,SAAS,CAAC,YAAY;IAStB,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAM3D,KAAK,CAAC,EAAE,SAAa;IAYrB,IAAI;IAIJ,GAAG;CAGJ;AAED,eAAe,UAAU,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"typewriter.js","sourceRoot":"https://github.com/startracex/godown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AC,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,30 +0,0 @@
|
|
1
|
-
import GodownSuperOpenable, { type Direction8 } from "../../proto/super-openable.js";
|
2
|
-
/**
|
3
|
-
* {@linkcode Tooltip} provide tooltip for slot elements.
|
4
|
-
*
|
5
|
-
* Content can be opened in 8 directions.
|
6
|
-
*
|
7
|
-
* @slot tooltip - Tooltip element.
|
8
|
-
* @slot - Tooltip trigger.
|
9
|
-
*
|
10
|
-
*/
|
11
|
-
export declare class Tooltip extends GodownSuperOpenable {
|
12
|
-
/**
|
13
|
-
* Open direction.
|
14
|
-
*/
|
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>;
|
28
|
-
}
|
29
|
-
export default Tooltip;
|
30
|
-
//# sourceMappingURL=tooltip.d.ts.map
|
@@ -1 +0,0 @@
|
|
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,123 +0,0 @@
|
|
1
|
-
var Tooltip_1;
|
2
|
-
import { __decorate } from "tslib";
|
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);
|
11
|
-
/**
|
12
|
-
* {@linkcode Tooltip} provide tooltip for slot elements.
|
13
|
-
*
|
14
|
-
* Content can be opened in 8 directions.
|
15
|
-
*
|
16
|
-
* @slot tooltip - Tooltip element.
|
17
|
-
* @slot - Tooltip trigger.
|
18
|
-
*
|
19
|
-
*/
|
20
|
-
let Tooltip = Tooltip_1 = class Tooltip extends GodownSuperOpenable {
|
21
|
-
constructor() {
|
22
|
-
super(...arguments);
|
23
|
-
/**
|
24
|
-
* Open direction.
|
25
|
-
*/
|
26
|
-
this.direction = "top";
|
27
|
-
/**
|
28
|
-
* Content align.
|
29
|
-
*/
|
30
|
-
this.align = "center";
|
31
|
-
}
|
32
|
-
render() {
|
33
|
-
const align = Tooltip_1.aligns[this.align] || "inherit";
|
34
|
-
return html `<div part="root" class="root" style="justify-content:${align};align-items:${align}">
|
35
|
-
${htmlSlot()}
|
36
|
-
<div part="tooltip" direction="${this.direction}">${htmlSlot("tooltip")}</div>
|
37
|
-
</div>`;
|
38
|
-
}
|
39
|
-
};
|
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
|
-
}
|
64
|
-
|
65
|
-
[part="root"] {
|
66
|
-
display: flex;
|
67
|
-
position: relative;
|
68
|
-
transition: inherit;
|
69
|
-
border-radius: inherit;
|
70
|
-
}
|
71
|
-
|
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
|
-
}
|
86
|
-
|
87
|
-
:host(:hover) [part="tooltip"],
|
88
|
-
:host([open]) [part="tooltip"] {
|
89
|
-
visibility: visible;
|
90
|
-
animation: open .8s forwards;
|
91
|
-
}
|
92
|
-
@keyframes open {
|
93
|
-
50% {
|
94
|
-
opacity: 0;
|
95
|
-
}
|
96
|
-
100% {
|
97
|
-
opacity: 1;
|
98
|
-
}
|
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
|
-
])
|
120
|
-
], Tooltip);
|
121
|
-
export { Tooltip };
|
122
|
-
export default Tooltip;
|
123
|
-
//# sourceMappingURL=tooltip.js.map
|
@@ -1 +0,0 @@
|
|
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 +0,0 @@
|
|
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 +0,0 @@
|
|
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,CAAC;AAE5B;;GAEG;AAeI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QAOL;;WAEG;QACS,MAAC,GAAG,MAAM,CAAC;QACvB;;WAEG;QACS,MAAC,GAAG,MAAM,CAAC;IA+DzB,CAAC;IA7DW,MAAM;QACd,OAAO,IAAI,CAAA,oBAAoB,IAAI,CAAC,gBAAgB,eAAe,IAAI,CAAC,cAAc,KAAK,QAAQ,EAAE,QAAQ,CAAC;IAChH,CAAC;IAES,YAAY;QACpB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAES,gBAAgB,CAAC,CAAa;QACtC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC;QACpB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC;QACpB,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACzB,IAAI,C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,YAAY,GAAG,WAAW,MAAM,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACX,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QAClB,CAAC;aAAM,IAAI,EAAE,GAAG,aAAa,GAAG,YAAY,EAAE,CAAC;YAC7C,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,GAAG,GAAG,GAAG,aAAa,GAAG,YAAY,IAAI,CAAC;QAClD,CAAC;IACH,CAAC;IAED,KAAK;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC5G,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC;QACtB,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,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"]}
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1,92 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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;qCACsB,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE;wBAC9C,IAAI,CAAC,KAAK;WACvB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AG,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"]}
|