godown 3.0.0-canary.0 → 3.0.0-canary.10
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 +37 -8
- package/components/alert.d.ts +5 -3
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +24 -14
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +5 -1
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +7 -3
- package/components/avatar.js.map +1 -1
- package/components/breath.d.ts +2 -1
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +5 -4
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +16 -9
- package/components/button.d.ts.map +1 -1
- package/components/button.js +22 -20
- package/components/button.js.map +1 -1
- package/components/card.d.ts +1 -2
- package/components/card.d.ts.map +1 -1
- package/components/card.js +5 -11
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +6 -5
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +3 -2
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +5 -2
- package/components/details.d.ts.map +1 -1
- package/components/details.js +5 -2
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +8 -4
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +17 -12
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +1 -1
- package/components/divider.js +1 -1
- package/components/divider.js.map +1 -1
- package/components/dragbox.d.ts +7 -7
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +1 -1
- package/components/dragbox.js.map +1 -1
- package/components/flex.d.ts +2 -1
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js +8 -0
- package/components/flex.js.map +1 -1
- package/components/form.d.ts +0 -2
- package/components/form.d.ts.map +1 -1
- package/components/form.js +0 -2
- package/components/form.js.map +1 -1
- package/components/grid.d.ts +8 -3
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +1 -0
- package/components/grid.js.map +1 -1
- package/components/input.d.ts +2 -3
- package/components/input.d.ts.map +1 -1
- package/components/input.js +3 -6
- package/components/input.js.map +1 -1
- package/components/layout.d.ts +3 -6
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +21 -10
- package/components/layout.js.map +1 -1
- package/components/link.d.ts +3 -1
- package/components/link.d.ts.map +1 -1
- package/components/link.js +3 -1
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +2 -11
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +6 -15
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +43 -17
- package/components/range.d.ts.map +1 -1
- package/components/range.js +132 -58
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +1 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js +1 -1
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +6 -8
- package/components/router.d.ts.map +1 -1
- package/components/router.js +10 -10
- package/components/router.js.map +1 -1
- package/components/select.d.ts +4 -8
- package/components/select.d.ts.map +1 -1
- package/components/select.js +42 -41
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +3 -4
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts +18 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +52 -19
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +4 -4
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +6 -6
- package/components/switch.js.map +1 -1
- package/components/text.js +3 -3
- package/components/text.js.map +1 -1
- package/components/time.d.ts +4 -20
- package/components/time.d.ts.map +1 -1
- package/components/time.js +5 -66
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +11 -1
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +23 -5
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts +2 -2
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +2 -2
- package/components/typewriter.js.map +1 -1
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +8 -1
- package/core/global-style.js.map +1 -1
- package/core/super-anchor.js +1 -1
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +2 -3
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +3 -6
- package/core/super-input.js.map +1 -1
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/dev/alert.d.ts +8 -0
- package/dev/alert.d.ts.map +1 -0
- package/dev/alert.js +4 -0
- package/dev/alert.js.map +1 -0
- package/dev/avatar.d.ts +8 -0
- package/dev/avatar.d.ts.map +1 -0
- package/dev/avatar.js +4 -0
- package/dev/avatar.js.map +1 -0
- package/dev/breath.d.ts +9 -0
- package/dev/breath.d.ts.map +1 -0
- package/dev/breath.js +5 -0
- package/dev/breath.js.map +1 -0
- package/dev/button.d.ts +8 -0
- package/dev/button.d.ts.map +1 -0
- package/dev/button.js +4 -0
- package/dev/button.js.map +1 -0
- package/dev/card.d.ts +8 -0
- package/dev/card.d.ts.map +1 -0
- package/dev/card.js +4 -0
- package/dev/card.js.map +1 -0
- package/dev/carousel.d.ts +8 -0
- package/dev/carousel.d.ts.map +1 -0
- package/dev/carousel.js +4 -0
- package/dev/carousel.js.map +1 -0
- package/dev/components/alert.d.ts +52 -0
- package/dev/components/alert.d.ts.map +1 -0
- package/dev/components/alert.js +245 -0
- package/dev/components/alert.js.map +1 -0
- package/dev/components/avatar.d.ts +30 -0
- package/dev/components/avatar.d.ts.map +1 -0
- package/dev/components/avatar.js +92 -0
- package/dev/components/avatar.js.map +1 -0
- package/dev/components/breath.d.ts +35 -0
- package/dev/components/breath.d.ts.map +1 -0
- package/dev/components/breath.js +135 -0
- package/dev/components/breath.js.map +1 -0
- package/dev/components/button.d.ts +52 -0
- package/dev/components/button.d.ts.map +1 -0
- package/dev/components/button.js +260 -0
- package/dev/components/button.js.map +1 -0
- package/dev/components/card.d.ts +19 -0
- package/dev/components/card.d.ts.map +1 -0
- package/dev/components/card.js +81 -0
- package/dev/components/card.js.map +1 -0
- package/dev/components/carousel.d.ts +41 -0
- package/dev/components/carousel.d.ts.map +1 -0
- package/dev/components/carousel.js +157 -0
- package/dev/components/carousel.js.map +1 -0
- package/dev/components/details.d.ts +23 -0
- package/dev/components/details.d.ts.map +1 -0
- package/dev/components/details.js +118 -0
- package/dev/components/details.js.map +1 -0
- package/dev/components/dialog.d.ts +37 -0
- package/dev/components/dialog.d.ts.map +1 -0
- package/dev/components/dialog.js +159 -0
- package/dev/components/dialog.js.map +1 -0
- package/dev/components/divider.d.ts +17 -0
- package/dev/components/divider.d.ts.map +1 -0
- package/dev/components/divider.js +46 -0
- package/dev/components/divider.js.map +1 -0
- package/dev/components/dragbox.d.ts +40 -0
- package/dev/components/dragbox.d.ts.map +1 -0
- package/dev/components/dragbox.js +117 -0
- package/dev/components/dragbox.js.map +1 -0
- package/dev/components/flex.d.ts +32 -0
- package/dev/components/flex.d.ts.map +1 -0
- package/dev/components/flex.js +60 -0
- package/dev/components/flex.js.map +1 -0
- package/dev/components/form.d.ts +22 -0
- package/dev/components/form.d.ts.map +1 -0
- package/dev/components/form.js +77 -0
- package/dev/components/form.js.map +1 -0
- package/dev/components/grid.d.ts +36 -0
- package/dev/components/grid.d.ts.map +1 -0
- package/dev/components/grid.js +54 -0
- package/dev/components/grid.js.map +1 -0
- package/dev/components/input.d.ts +19 -0
- package/dev/components/input.d.ts.map +1 -0
- package/dev/components/input.js +70 -0
- package/dev/components/input.js.map +1 -0
- package/dev/components/layout.d.ts +26 -0
- package/dev/components/layout.d.ts.map +1 -0
- package/dev/components/layout.js +82 -0
- package/dev/components/layout.js.map +1 -0
- package/dev/components/link.d.ts +22 -0
- package/dev/components/link.d.ts.map +1 -0
- package/dev/components/link.js +42 -0
- package/dev/components/link.js.map +1 -0
- package/dev/components/progress.d.ts +21 -0
- package/dev/components/progress.d.ts.map +1 -0
- package/dev/components/progress.js +99 -0
- package/dev/components/progress.js.map +1 -0
- package/dev/components/range.d.ts +86 -0
- package/dev/components/range.d.ts.map +1 -0
- package/dev/components/range.js +364 -0
- package/dev/components/range.js.map +1 -0
- package/dev/components/rotate.d.ts +26 -0
- package/dev/components/rotate.d.ts.map +1 -0
- package/dev/components/rotate.js +86 -0
- package/dev/components/rotate.js.map +1 -0
- package/dev/components/router.d.ts +119 -0
- package/dev/components/router.d.ts.map +1 -0
- package/dev/components/router.js +248 -0
- package/dev/components/router.js.map +1 -0
- package/dev/components/select.d.ts +46 -0
- package/dev/components/select.d.ts.map +1 -0
- package/dev/components/select.js +245 -0
- package/dev/components/select.js.map +1 -0
- package/dev/components/skeleton.d.ts +26 -0
- package/dev/components/skeleton.d.ts.map +1 -0
- package/dev/components/skeleton.js +118 -0
- package/dev/components/skeleton.js.map +1 -0
- package/dev/components/split.d.ts +49 -0
- package/dev/components/split.d.ts.map +1 -0
- package/dev/components/split.js +206 -0
- package/dev/components/split.js.map +1 -0
- package/dev/components/switch.d.ts +39 -0
- package/dev/components/switch.d.ts.map +1 -0
- package/dev/components/switch.js +182 -0
- package/dev/components/switch.js.map +1 -0
- package/dev/components/text.d.ts +19 -0
- package/dev/components/text.d.ts.map +1 -0
- package/dev/components/text.js +93 -0
- package/dev/components/text.js.map +1 -0
- package/dev/components/time.d.ts +37 -0
- package/dev/components/time.d.ts.map +1 -0
- package/dev/components/time.js +75 -0
- package/dev/components/time.js.map +1 -0
- package/dev/components/tooltip.d.ts +48 -0
- package/dev/components/tooltip.d.ts.map +1 -0
- package/dev/components/tooltip.js +137 -0
- package/dev/components/tooltip.js.map +1 -0
- package/dev/components/typewriter.d.ts +55 -0
- package/dev/components/typewriter.d.ts.map +1 -0
- package/dev/components/typewriter.js +155 -0
- package/dev/components/typewriter.js.map +1 -0
- package/dev/core/global-style.d.ts +21 -0
- package/dev/core/global-style.d.ts.map +1 -0
- package/dev/core/global-style.js +76 -0
- package/dev/core/global-style.js.map +1 -0
- package/dev/core/super-anchor.d.ts +15 -0
- package/dev/core/super-anchor.d.ts.map +1 -0
- package/dev/core/super-anchor.js +58 -0
- package/dev/core/super-anchor.js.map +1 -0
- package/dev/core/super-input.d.ts +38 -0
- package/dev/core/super-input.d.ts.map +1 -0
- package/dev/core/super-input.js +182 -0
- package/dev/core/super-input.js.map +1 -0
- package/dev/core/super-openable.d.ts +19 -0
- package/dev/core/super-openable.d.ts.map +1 -0
- package/dev/core/super-openable.js +36 -0
- package/dev/core/super-openable.js.map +1 -0
- package/dev/details.d.ts +8 -0
- package/dev/details.d.ts.map +1 -0
- package/dev/details.js +4 -0
- package/dev/details.js.map +1 -0
- package/dev/dialog.d.ts +8 -0
- package/dev/dialog.d.ts.map +1 -0
- package/dev/dialog.js +4 -0
- package/dev/dialog.js.map +1 -0
- package/dev/divider.d.ts +8 -0
- package/dev/divider.d.ts.map +1 -0
- package/dev/divider.js +4 -0
- package/dev/divider.js.map +1 -0
- package/dev/dragbox.d.ts +8 -0
- package/dev/dragbox.d.ts.map +1 -0
- package/dev/dragbox.js +4 -0
- package/dev/dragbox.js.map +1 -0
- package/dev/flex.d.ts +8 -0
- package/dev/flex.d.ts.map +1 -0
- package/dev/flex.js +4 -0
- package/dev/flex.js.map +1 -0
- package/dev/form.d.ts +8 -0
- package/dev/form.d.ts.map +1 -0
- package/dev/form.js +4 -0
- package/dev/form.js.map +1 -0
- package/dev/grid.d.ts +8 -0
- package/dev/grid.d.ts.map +1 -0
- package/dev/grid.js +4 -0
- package/dev/grid.js.map +1 -0
- package/dev/index.d.ts +29 -0
- package/dev/index.d.ts.map +1 -0
- package/dev/index.js +29 -0
- package/dev/index.js.map +1 -0
- package/dev/input.d.ts +9 -0
- package/dev/input.d.ts.map +1 -0
- package/dev/input.js +5 -0
- package/dev/input.js.map +1 -0
- package/dev/layout.d.ts +9 -0
- package/dev/layout.d.ts.map +1 -0
- package/dev/layout.js +5 -0
- package/dev/layout.js.map +1 -0
- package/dev/link.d.ts +9 -0
- package/dev/link.d.ts.map +1 -0
- package/dev/link.js +5 -0
- package/dev/link.js.map +1 -0
- package/dev/progress.d.ts +9 -0
- package/dev/progress.d.ts.map +1 -0
- package/dev/progress.js +5 -0
- package/dev/progress.js.map +1 -0
- package/dev/range.d.ts +9 -0
- package/dev/range.d.ts.map +1 -0
- package/dev/range.js +5 -0
- package/dev/range.js.map +1 -0
- package/dev/rotate.d.ts +9 -0
- package/dev/rotate.d.ts.map +1 -0
- package/dev/rotate.js +5 -0
- package/dev/rotate.js.map +1 -0
- package/dev/router.d.ts +9 -0
- package/dev/router.d.ts.map +1 -0
- package/dev/router.js +5 -0
- package/dev/router.js.map +1 -0
- package/dev/select.d.ts +9 -0
- package/dev/select.d.ts.map +1 -0
- package/dev/select.js +5 -0
- package/dev/select.js.map +1 -0
- package/dev/skeleton.d.ts +9 -0
- package/dev/skeleton.d.ts.map +1 -0
- package/dev/skeleton.js +5 -0
- package/dev/skeleton.js.map +1 -0
- package/dev/split.d.ts +9 -0
- package/dev/split.d.ts.map +1 -0
- package/dev/split.js +5 -0
- package/dev/split.js.map +1 -0
- package/dev/switch.d.ts +9 -0
- package/dev/switch.d.ts.map +1 -0
- package/dev/switch.js +5 -0
- package/dev/switch.js.map +1 -0
- package/dev/text.d.ts +9 -0
- package/dev/text.d.ts.map +1 -0
- package/dev/text.js +5 -0
- package/dev/text.js.map +1 -0
- package/dev/time.d.ts +9 -0
- package/dev/time.d.ts.map +1 -0
- package/dev/time.js +5 -0
- package/dev/time.js.map +1 -0
- package/dev/tooltip.d.ts +9 -0
- package/dev/tooltip.d.ts.map +1 -0
- package/dev/tooltip.js +5 -0
- package/dev/tooltip.js.map +1 -0
- package/dev/typewriter.d.ts +8 -0
- package/dev/typewriter.d.ts.map +1 -0
- package/dev/typewriter.js +4 -0
- package/dev/typewriter.js.map +1 -0
- package/index.js +13 -13
- package/package.json +10 -8
- package/range.d.ts +1 -1
- package/range.d.ts.map +1 -1
- package/src/alert.ts +11 -0
- package/src/avatar.ts +11 -0
- package/src/breath.ts +13 -0
- package/src/button.ts +11 -0
- package/src/card.ts +11 -0
- package/src/carousel.ts +11 -0
- package/src/components/alert.ts +282 -0
- package/src/components/avatar.ts +95 -0
- package/src/components/breath.ts +153 -0
- package/src/components/button.ts +286 -0
- package/src/components/card.ts +80 -0
- package/src/components/carousel.ts +169 -0
- package/src/components/details.ts +116 -0
- package/src/components/dialog.ts +165 -0
- package/src/components/divider.ts +44 -0
- package/src/components/dragbox.ts +127 -0
- package/src/components/flex.ts +70 -0
- package/src/components/form.ts +82 -0
- package/src/components/grid.ts +75 -0
- package/src/components/input.ts +72 -0
- package/src/components/layout.ts +82 -0
- package/src/components/link.ts +38 -0
- package/src/components/progress.ts +95 -0
- package/src/components/range.ts +404 -0
- package/src/components/rotate.ts +92 -0
- package/src/components/router.ts +273 -0
- package/src/components/select.ts +268 -0
- package/src/components/skeleton.ts +118 -0
- package/src/components/split.ts +221 -0
- package/src/components/switch.ts +180 -0
- package/src/components/text.ts +95 -0
- package/src/components/time.ts +81 -0
- package/src/components/tooltip.ts +138 -0
- package/src/components/typewriter.ts +154 -0
- package/src/core/global-style.ts +86 -0
- package/src/core/super-anchor.ts +52 -0
- package/src/core/super-input.ts +230 -0
- package/src/core/super-openable.ts +51 -0
- package/src/details.ts +11 -0
- package/src/dialog.ts +11 -0
- package/src/divider.ts +11 -0
- package/src/dragbox.ts +11 -0
- package/src/flex.ts +11 -0
- package/src/form.ts +11 -0
- package/src/grid.ts +11 -0
- package/src/index.ts +28 -0
- package/src/input.ts +13 -0
- package/src/layout.ts +12 -0
- package/src/link.ts +13 -0
- package/src/progress.ts +12 -0
- package/src/range.ts +13 -0
- package/src/rotate.ts +13 -0
- package/src/router.ts +12 -0
- package/src/select.ts +13 -0
- package/src/skeleton.ts +13 -0
- package/src/split.ts +13 -0
- package/src/switch.ts +13 -0
- package/src/text.ts +13 -0
- package/src/time.ts +13 -0
- package/src/tooltip.ts +13 -0
- package/src/typewriter.ts +11 -0
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
@@ -0,0 +1,157 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { godown } from "@godown/element/decorators/godown.js";
|
3
|
+
import { part } from "@godown/element/decorators/part.js";
|
4
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
5
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
6
|
+
import { htmlStyle } from "@godown/element/directives/html-style.js";
|
7
|
+
import iconChevronLeft from "@godown/f7-icon/icons/chevron-left.js";
|
8
|
+
import iconChevronRight from "@godown/f7-icon/icons/chevron-right.js";
|
9
|
+
import { css, html } from "lit";
|
10
|
+
import { property } from "lit/decorators.js";
|
11
|
+
import { GlobalStyle } from "../core/global-style.js";
|
12
|
+
const protoName = "carousel";
|
13
|
+
/**
|
14
|
+
* {@linkcode Carousel} make the content display as a carousel.
|
15
|
+
*
|
16
|
+
* When this component is `firstUpdated`,
|
17
|
+
* clone the first and last element and make the matching element visible when switching index.
|
18
|
+
*
|
19
|
+
* Child elements should maintain the same size.
|
20
|
+
*
|
21
|
+
* If no width, it will be the width of the first element.
|
22
|
+
*
|
23
|
+
* @slot - Carousel items, should maintain the same size.
|
24
|
+
* @category display
|
25
|
+
*/
|
26
|
+
let Carousel = class Carousel extends GlobalStyle {
|
27
|
+
constructor() {
|
28
|
+
super(...arguments);
|
29
|
+
/**
|
30
|
+
* The index of the element is displayed for the first time.
|
31
|
+
*/
|
32
|
+
this.index = 0;
|
33
|
+
/**
|
34
|
+
* If autoChange > 0, the rotation will be automated.
|
35
|
+
*/
|
36
|
+
this.autoChange = 0;
|
37
|
+
}
|
38
|
+
render() {
|
39
|
+
return [
|
40
|
+
html `<div part="root">
|
41
|
+
<i part="prev" @click="${this.prev}">${iconChevronLeft()}</i>
|
42
|
+
<div part="move-root" style="transform:${`translateX(-${this.index + 1}00%)`}">${htmlSlot()}</div>
|
43
|
+
<i part="next" @click="${this.next}">${iconChevronRight()}</i>
|
44
|
+
</div>`,
|
45
|
+
htmlStyle(`:host{width:${this.width};}`),
|
46
|
+
];
|
47
|
+
}
|
48
|
+
async firstUpdated() {
|
49
|
+
await this.updateComplete;
|
50
|
+
if (this.children.length) {
|
51
|
+
this.width ||= `${this.firstElementChild.offsetWidth}px`;
|
52
|
+
this._cloneFirst?.remove();
|
53
|
+
this._cloneLast?.remove();
|
54
|
+
this._cloneLast = this.firstElementChild.cloneNode(true);
|
55
|
+
this._cloneFirst = this.lastElementChild.cloneNode(true);
|
56
|
+
this.appendChild(this._cloneLast);
|
57
|
+
this.insertBefore(this._cloneFirst, this.firstElementChild);
|
58
|
+
this.show(this.index);
|
59
|
+
}
|
60
|
+
if (this.autoChange) {
|
61
|
+
this.intervalID = window.setInterval(() => {
|
62
|
+
this.next();
|
63
|
+
}, this.autoChange);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
disconnectedCallback() {
|
67
|
+
clearInterval(this.intervalID);
|
68
|
+
}
|
69
|
+
show(i) {
|
70
|
+
this.index = i;
|
71
|
+
}
|
72
|
+
next() {
|
73
|
+
if (this.index === this.childElementCount - 3) {
|
74
|
+
this._doTranslateX("0", true);
|
75
|
+
this.show(0);
|
76
|
+
}
|
77
|
+
else {
|
78
|
+
this.show(this.index + 1);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
prev() {
|
82
|
+
if (this.index === 0) {
|
83
|
+
this._doTranslateX(`-${this.childElementCount - 1}00%`, true);
|
84
|
+
this.show(this.children.length - 3);
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
this.show(this.index - 1);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
_doTranslateX(xValue, noTransition) {
|
91
|
+
this._moveRoot.style.transform = `translateX(${xValue})`;
|
92
|
+
if (noTransition) {
|
93
|
+
this._moveRoot.style.transition = `none`;
|
94
|
+
}
|
95
|
+
this._moveRoot.getBoundingClientRect();
|
96
|
+
}
|
97
|
+
};
|
98
|
+
__decorate([
|
99
|
+
property({ type: Number })
|
100
|
+
], Carousel.prototype, "index", void 0);
|
101
|
+
__decorate([
|
102
|
+
property({ type: Number })
|
103
|
+
], Carousel.prototype, "autoChange", void 0);
|
104
|
+
__decorate([
|
105
|
+
property()
|
106
|
+
], Carousel.prototype, "width", void 0);
|
107
|
+
__decorate([
|
108
|
+
part("move-root")
|
109
|
+
], Carousel.prototype, "_moveRoot", void 0);
|
110
|
+
Carousel = __decorate([
|
111
|
+
godown(protoName),
|
112
|
+
styles(css `
|
113
|
+
:host {
|
114
|
+
display: block;
|
115
|
+
transition: .3s;
|
116
|
+
}
|
117
|
+
|
118
|
+
[part=root] {
|
119
|
+
overflow: hidden;
|
120
|
+
}
|
121
|
+
|
122
|
+
[part=root],
|
123
|
+
[part=move-root] {
|
124
|
+
height: 100%;
|
125
|
+
width: 100%;
|
126
|
+
display: flex;
|
127
|
+
position: relative;
|
128
|
+
transition: inherit;
|
129
|
+
}
|
130
|
+
|
131
|
+
[part=prev],
|
132
|
+
[part=next] {
|
133
|
+
height: 100%;
|
134
|
+
width: 1.5em;
|
135
|
+
z-index: 1;
|
136
|
+
position: absolute;
|
137
|
+
display: flex;
|
138
|
+
align-items: center;
|
139
|
+
justify-content: center;
|
140
|
+
user-select: none;
|
141
|
+
}
|
142
|
+
|
143
|
+
[part=prev] {
|
144
|
+
left: 0;
|
145
|
+
}
|
146
|
+
|
147
|
+
[part=next] {
|
148
|
+
right: 0;
|
149
|
+
}
|
150
|
+
|
151
|
+
slot::slotted(*) {
|
152
|
+
flex-shrink: 0 !important;
|
153
|
+
}
|
154
|
+
`)
|
155
|
+
], Carousel);
|
156
|
+
export default Carousel;
|
157
|
+
//# sourceMappingURL=carousel.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../src/components/carousel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,SAAS,E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AAK,GAAG,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAES,aAAa,CAAC,MAAc,EAAE,YAAsB;QAC5D,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,cAAc,MAAM,GAAG,CAAC;QACzD,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,CAAC;IACzC,CAAC;CACF,CAAA;AAxFC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACjB;AAMV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACZ;AAMf;IADC,QAAQ,EAAE;uCACG;AAGJ;IADT,IAAI,CAAC,WAAW,CAAC;2CACe;AApB7B,QAAQ;IA9Cb,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CF,CACF;GACK,QAAQ,CA6Fb;AAED,eAAe,QAAQ,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import SuperOpenable from "../core/super-openable.js";
|
2
|
+
/**
|
3
|
+
* {@linkcode Details} similar to `<details>`.
|
4
|
+
*
|
5
|
+
* @slot summary - Details summary if no `summary` is provided.
|
6
|
+
* @slot - Details content.
|
7
|
+
* @fires change - Fired when the details is toggled.
|
8
|
+
* @category display
|
9
|
+
*/
|
10
|
+
declare class Details extends SuperOpenable {
|
11
|
+
/**
|
12
|
+
* If it is true, the summary event scope will fill the element.
|
13
|
+
*/
|
14
|
+
fill: boolean;
|
15
|
+
/**
|
16
|
+
* Summary text.
|
17
|
+
*/
|
18
|
+
summary: string;
|
19
|
+
protected _dd: HTMLDataListElement;
|
20
|
+
protected render(): import("lit").TemplateResult<1>;
|
21
|
+
}
|
22
|
+
export default Details;
|
23
|
+
//# sourceMappingURL=details.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../src/components/details.ts"],"names":[],"mappings":"AAQA,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAMtD;;;;;;;GAOG;AACH,cAgEM,OAAQ,SAAQ,aAAa;IACjC;;OAEG;IAEH,IAAI,UAAS;IAEb;;OAEG;IAEH,OAAO,SAAM;IAGb,SAAS,CAAC,GAAG,EAAE,mBAAmB,CAAC;IAEnC,SAAS,CAAC,MAAM;CAWjB;AAED,eAAe,OAAO,CAAC"}
|
@@ -0,0 +1,118 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { godown } from "@godown/element/decorators/godown.js";
|
3
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
4
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
|
+
import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
|
6
|
+
import { css, html } from "lit";
|
7
|
+
import { property, query } from "lit/decorators.js";
|
8
|
+
import { scopePrefix } from "../core/global-style.js";
|
9
|
+
import SuperOpenable from "../core/super-openable.js";
|
10
|
+
const protoName = "details";
|
11
|
+
const cssScope = scopePrefix(protoName);
|
12
|
+
/**
|
13
|
+
* {@linkcode Details} similar to `<details>`.
|
14
|
+
*
|
15
|
+
* @slot summary - Details summary if no `summary` is provided.
|
16
|
+
* @slot - Details content.
|
17
|
+
* @fires change - Fired when the details is toggled.
|
18
|
+
* @category display
|
19
|
+
*/
|
20
|
+
let Details = class Details extends SuperOpenable {
|
21
|
+
constructor() {
|
22
|
+
super(...arguments);
|
23
|
+
/**
|
24
|
+
* If it is true, the summary event scope will fill the element.
|
25
|
+
*/
|
26
|
+
this.fill = false;
|
27
|
+
/**
|
28
|
+
* Summary text.
|
29
|
+
*/
|
30
|
+
this.summary = "";
|
31
|
+
}
|
32
|
+
render() {
|
33
|
+
return html `<dl part="root">
|
34
|
+
<dt part="title" @click="${this._handelClick}">
|
35
|
+
<span part="summary">${this.summary || htmlSlot("summary")} </span>
|
36
|
+
<span><i part="icon">${svgCaretDown()}</i></span>
|
37
|
+
</dt>
|
38
|
+
<dd part="details" @click=${this.fill ? () => this.toggle() : null}>
|
39
|
+
<div style="min-height: 0;">${htmlSlot()}</div>
|
40
|
+
</dd>
|
41
|
+
</dl>`;
|
42
|
+
}
|
43
|
+
};
|
44
|
+
__decorate([
|
45
|
+
property({ type: Boolean })
|
46
|
+
], Details.prototype, "fill", void 0);
|
47
|
+
__decorate([
|
48
|
+
property()
|
49
|
+
], Details.prototype, "summary", void 0);
|
50
|
+
__decorate([
|
51
|
+
query("dd")
|
52
|
+
], Details.prototype, "_dd", void 0);
|
53
|
+
Details = __decorate([
|
54
|
+
godown(protoName),
|
55
|
+
styles(css `
|
56
|
+
:host {
|
57
|
+
${cssScope}--icon-deg-open: 0deg;
|
58
|
+
${cssScope}--icon-deg-close: 90deg;
|
59
|
+
${cssScope}--icon-deg: 0deg;
|
60
|
+
${cssScope}--icon-space: 0.3em;
|
61
|
+
${cssScope}--summary-direction: row;
|
62
|
+
${cssScope}--transition: .3s;
|
63
|
+
height: fit-content;
|
64
|
+
display: block;
|
65
|
+
transition: var(${cssScope}--transition);
|
66
|
+
}
|
67
|
+
|
68
|
+
dl {
|
69
|
+
height: 100%;
|
70
|
+
position: relative;
|
71
|
+
overflow: hidden;
|
72
|
+
}
|
73
|
+
|
74
|
+
dt {
|
75
|
+
height: 100%;
|
76
|
+
display: flex;
|
77
|
+
flex-wrap: nowrap;
|
78
|
+
justify-content: space-between;
|
79
|
+
background: inherit;
|
80
|
+
align-items: center;
|
81
|
+
flex-direction: var(${cssScope}--summary-direction);
|
82
|
+
}
|
83
|
+
|
84
|
+
dd {
|
85
|
+
display: grid;
|
86
|
+
overflow: hidden;
|
87
|
+
grid-template-rows: 0fr;
|
88
|
+
transition: var(${cssScope}--transition);
|
89
|
+
transition-property: grid-template-rows;
|
90
|
+
}
|
91
|
+
|
92
|
+
i {
|
93
|
+
display: flex;
|
94
|
+
backface-visibility: hidden;
|
95
|
+
padding: var(${cssScope}--icon-space);
|
96
|
+
transition: var(${cssScope}--transition);
|
97
|
+
transform: rotate(var(${cssScope}--icon-deg));
|
98
|
+
}
|
99
|
+
|
100
|
+
:host([open]) dd {
|
101
|
+
grid-template-rows: 1fr;
|
102
|
+
}
|
103
|
+
|
104
|
+
:host([float]) dd {
|
105
|
+
top: 100%;
|
106
|
+
position: absolute;
|
107
|
+
}
|
108
|
+
|
109
|
+
i {
|
110
|
+
transform: rotate(var(${cssScope}--icon-deg-close));
|
111
|
+
}
|
112
|
+
:host([open]) i {
|
113
|
+
transform: rotate(var(${cssScope}--icon-deg-open));
|
114
|
+
}
|
115
|
+
`)
|
116
|
+
], Details);
|
117
|
+
export default Details;
|
118
|
+
//# sourceMappingURL=details.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"details.js","sourceRoot":"","sources":["../../src/components/details.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,YAAY,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;GAOG;AAiEH,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QACE;;WAEG;QAEH,SAAI,GAAG,KAAK,CAAC;QAEb;;WAEG;QAEH,YAAO,GAAG,EAAE,CAAC;IAgBf,CAAC;IAXW,MAAM;QACd,OAAO,IAAI,CAAA;iCACkB,IAAI,CAAC,YAAY;+BACnB,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC;+BACnC,YAAY,EAAE;;kCAEX,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI;sCAClC,QAAQ,EAAE;;UAEtC,CAAC;IACT,CAAC;CACF,CAAA;AAtBC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCACf;AAMb;IADC,QAAQ,EAAE;wCACE;AAGH;IADT,KAAK,CAAC,IAAI,CAAC;oCACuB;AAd/B,OAAO;IAhEZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;QAEG,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;;;wBAGQ,QAAQ;;;;;;;;;;;;;;;;4BAgBJ,QAAQ;;;;;;;wBAOZ,QAAQ;;;;;;;qBAOX,QAAQ;wBACL,QAAQ;8BACF,QAAQ;;;;;;;;;;;;;8BAaR,QAAQ;;;8BAGR,QAAQ;;GAEnC,CACF;GACK,OAAO,CA2BZ;AAED,eAAe,OAAO,CAAC"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { type HandlerEvent } from "@godown/element";
|
2
|
+
import { type PropertyValues } from "lit";
|
3
|
+
import SuperOpenable, { type Direction9 } from "../core/super-openable.js";
|
4
|
+
/**
|
5
|
+
* {@linkcode Dialog} similar to `<dialog>`.
|
6
|
+
*
|
7
|
+
* Like dialog, it listens for submit events and closes itself when the target method is "dialog".
|
8
|
+
*
|
9
|
+
* It listens for the keydown event and also closes itself when the {@linkcode key} contained in the key is pressed.
|
10
|
+
*
|
11
|
+
* @category feedback
|
12
|
+
*/
|
13
|
+
declare class Dialog extends SuperOpenable {
|
14
|
+
/**
|
15
|
+
* Direction of the opening animation.
|
16
|
+
*/
|
17
|
+
direction: Direction9;
|
18
|
+
/**
|
19
|
+
* Enable modal, blocking event penetration.
|
20
|
+
*/
|
21
|
+
modal: boolean;
|
22
|
+
/**
|
23
|
+
* Close key.
|
24
|
+
*/
|
25
|
+
key: string;
|
26
|
+
private _modalInvoke;
|
27
|
+
protected render(): import("lit").TemplateResult<1>;
|
28
|
+
showModal(): void;
|
29
|
+
private _submitEvent;
|
30
|
+
private _keydownEvent;
|
31
|
+
protected updated(changedProperties: PropertyValues): void;
|
32
|
+
protected _handleKeydown(e: KeyboardEvent): void;
|
33
|
+
protected _handelSubmit(e: HandlerEvent<HTMLFormElement>): void;
|
34
|
+
close(): void;
|
35
|
+
}
|
36
|
+
export default Dialog;
|
37
|
+
//# sourceMappingURL=dialog.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrD,OAAO,aAAa,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK3E;;;;;;;;GAQG;AACH,cAkEM,MAAO,SAAQ,aAAa;IAChC;;OAEG;IAEH,SAAS,EAAE,UAAU,CAAY;IAEjC;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,GAAG,SAAY;IAEf,OAAO,CAAC,YAAY,CAAU;IAE9B,SAAS,CAAC,MAAM;IAOhB,SAAS;IAQT,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,aAAa,CAAqC;IAE1D,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAcnD,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa;IAQzC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC;IAMxD,KAAK;CAON;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { godown } from "@godown/element/decorators/godown.js";
|
3
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
4
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
|
+
import { css, html } from "lit";
|
6
|
+
import { property } from "lit/decorators.js";
|
7
|
+
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
8
|
+
import SuperOpenable from "../core/super-openable.js";
|
9
|
+
const protoName = "dialog";
|
10
|
+
const cssScope = scopePrefix(protoName);
|
11
|
+
/**
|
12
|
+
* {@linkcode Dialog} similar to `<dialog>`.
|
13
|
+
*
|
14
|
+
* Like dialog, it listens for submit events and closes itself when the target method is "dialog".
|
15
|
+
*
|
16
|
+
* It listens for the keydown event and also closes itself when the {@linkcode key} contained in the key is pressed.
|
17
|
+
*
|
18
|
+
* @category feedback
|
19
|
+
*/
|
20
|
+
let Dialog = class Dialog extends SuperOpenable {
|
21
|
+
constructor() {
|
22
|
+
super(...arguments);
|
23
|
+
/**
|
24
|
+
* Direction of the opening animation.
|
25
|
+
*/
|
26
|
+
this.direction = "center";
|
27
|
+
/**
|
28
|
+
* Enable modal, blocking event penetration.
|
29
|
+
*/
|
30
|
+
this.modal = false;
|
31
|
+
/**
|
32
|
+
* Close key.
|
33
|
+
*/
|
34
|
+
this.key = "Escape";
|
35
|
+
}
|
36
|
+
render() {
|
37
|
+
return html `<div part="root">
|
38
|
+
<div part="modal"></div>
|
39
|
+
<div part="container" direction="${this.direction}">${htmlSlot()}</div>
|
40
|
+
</div>`;
|
41
|
+
}
|
42
|
+
showModal() {
|
43
|
+
if (!this.modal) {
|
44
|
+
this.modal = true;
|
45
|
+
this._modalInvoke = true;
|
46
|
+
}
|
47
|
+
this.show();
|
48
|
+
}
|
49
|
+
updated(changedProperties) {
|
50
|
+
if (changedProperties.has("open")) {
|
51
|
+
if (this.open) {
|
52
|
+
this._submitEvent = this.events.add(this, "submit", this._handelSubmit);
|
53
|
+
if (this.key) {
|
54
|
+
this._keydownEvent = this.events.add(document, "keydown", this._handleKeydown.bind(this));
|
55
|
+
}
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
this.events.remove(this, "submit", this._submitEvent);
|
59
|
+
this.events.remove(document, "keydown", this._keydownEvent);
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
_handleKeydown(e) {
|
64
|
+
e.preventDefault();
|
65
|
+
const keys = this.key.split(/[\s,]/);
|
66
|
+
if (keys.includes(e.key) || keys.includes(e.code)) {
|
67
|
+
this.close();
|
68
|
+
}
|
69
|
+
}
|
70
|
+
_handelSubmit(e) {
|
71
|
+
if (e.target.method === "dialog") {
|
72
|
+
this.close();
|
73
|
+
}
|
74
|
+
}
|
75
|
+
close() {
|
76
|
+
if (this._modalInvoke) {
|
77
|
+
this.modal = false;
|
78
|
+
this._modalInvoke = false;
|
79
|
+
}
|
80
|
+
this.open = false;
|
81
|
+
}
|
82
|
+
};
|
83
|
+
__decorate([
|
84
|
+
property()
|
85
|
+
], Dialog.prototype, "direction", void 0);
|
86
|
+
__decorate([
|
87
|
+
property({ type: Boolean, reflect: true })
|
88
|
+
], Dialog.prototype, "modal", void 0);
|
89
|
+
__decorate([
|
90
|
+
property()
|
91
|
+
], Dialog.prototype, "key", void 0);
|
92
|
+
Dialog = __decorate([
|
93
|
+
godown(protoName),
|
94
|
+
styles(css `
|
95
|
+
:host {
|
96
|
+
${cssScope}--background: none;
|
97
|
+
${cssScope}--background-modal: var(${cssGlobalVars.background});
|
98
|
+
${cssScope}--opacity-modal: 0.2;
|
99
|
+
background: var(${cssScope}--background);
|
100
|
+
pointer-events: none;
|
101
|
+
visibility: hidden;
|
102
|
+
position: fixed;
|
103
|
+
z-index: 1;
|
104
|
+
inset:0;
|
105
|
+
}
|
106
|
+
|
107
|
+
:host([open]) {
|
108
|
+
visibility: visible;
|
109
|
+
}
|
110
|
+
|
111
|
+
:host([open][modal]) [part=modal] {
|
112
|
+
pointer-events: all;
|
113
|
+
visibility: visible;
|
114
|
+
opacity: var(${cssScope}--opacity-modal);
|
115
|
+
|
116
|
+
}
|
117
|
+
|
118
|
+
[part=modal] {
|
119
|
+
visibility: hidden;
|
120
|
+
opacity: 0;
|
121
|
+
width: 100%;
|
122
|
+
height: 100%;
|
123
|
+
position: absolute;
|
124
|
+
background: var(${cssScope}--background-modal);
|
125
|
+
}
|
126
|
+
|
127
|
+
[part=root] {
|
128
|
+
width: 100%;
|
129
|
+
height: 100%;
|
130
|
+
display: flex;
|
131
|
+
position: relative;
|
132
|
+
align-items: center;
|
133
|
+
justify-content: center;
|
134
|
+
}
|
135
|
+
|
136
|
+
[direction] {
|
137
|
+
pointer-events: all;
|
138
|
+
position: absolute;
|
139
|
+
}
|
140
|
+
|
141
|
+
[direction^=top] {
|
142
|
+
top: 0;
|
143
|
+
}
|
144
|
+
|
145
|
+
[direction^=bottom] {
|
146
|
+
bottom: 0;
|
147
|
+
}
|
148
|
+
|
149
|
+
[direction$=right] {
|
150
|
+
right: 0%;
|
151
|
+
}
|
152
|
+
|
153
|
+
[direction$=left] {
|
154
|
+
left: 0%;
|
155
|
+
}
|
156
|
+
`)
|
157
|
+
], Dialog);
|
158
|
+
export default Dialog;
|
159
|
+
//# sourceMappingURL=dialog.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,IAAI,EA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,2BAA2B,aAAa,CAAC,UAAU;QAC3D,QAAQ;wBACQ,QAAQ;;;;;;;;;;;;;;;qBAeX,QAAQ;;;;;;;;;;wBAUL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgC7B,CACF;GACK,MAAM,CA0EX;AAED,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { GlobalStyle } from "../core/global-style.js";
|
2
|
+
/**
|
3
|
+
* {@linkcode Divider} similar to `<hr>`.
|
4
|
+
*
|
5
|
+
* This component does not render content.
|
6
|
+
*
|
7
|
+
* @category layout
|
8
|
+
*/
|
9
|
+
declare class Divider extends GlobalStyle {
|
10
|
+
/**
|
11
|
+
* Vertical display.
|
12
|
+
*/
|
13
|
+
vertical: boolean;
|
14
|
+
connectedCallback(): void;
|
15
|
+
}
|
16
|
+
export default Divider;
|
17
|
+
//# sourceMappingURL=divider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/components/divider.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;;GAMG;AACH,cAgBM,OAAQ,SAAQ,WAAW;IAC/B;;OAEG;IAEH,QAAQ,UAAS;IAEjB,iBAAiB;CAGlB;AAED,eAAe,OAAO,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { godown, styles } from "@godown/element/decorators/index.js";
|
3
|
+
import { css } from "lit";
|
4
|
+
import { property } from "lit/decorators.js";
|
5
|
+
import { GlobalStyle } from "../core/global-style.js";
|
6
|
+
const protoName = "divider";
|
7
|
+
/**
|
8
|
+
* {@linkcode Divider} similar to `<hr>`.
|
9
|
+
*
|
10
|
+
* This component does not render content.
|
11
|
+
*
|
12
|
+
* @category layout
|
13
|
+
*/
|
14
|
+
let Divider = class Divider extends GlobalStyle {
|
15
|
+
constructor() {
|
16
|
+
super(...arguments);
|
17
|
+
/**
|
18
|
+
* Vertical display.
|
19
|
+
*/
|
20
|
+
this.vertical = false;
|
21
|
+
}
|
22
|
+
connectedCallback() {
|
23
|
+
this.createRenderRoot();
|
24
|
+
}
|
25
|
+
};
|
26
|
+
__decorate([
|
27
|
+
property({ type: Boolean, reflect: true })
|
28
|
+
], Divider.prototype, "vertical", void 0);
|
29
|
+
Divider = __decorate([
|
30
|
+
godown(protoName),
|
31
|
+
styles(css `
|
32
|
+
:host{
|
33
|
+
width: 100%;
|
34
|
+
height: .05em;
|
35
|
+
margin: auto;
|
36
|
+
display: block;
|
37
|
+
background: currentColor;
|
38
|
+
}
|
39
|
+
:host([vertical]) {
|
40
|
+
width: .05em;
|
41
|
+
height: max(1em, 100%);
|
42
|
+
}
|
43
|
+
`)
|
44
|
+
], Divider);
|
45
|
+
export default Divider;
|
46
|
+
//# sourceMappingURL=divider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../src/components/divider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;;;;;GAMG;AAiBH,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QACE;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;IAKnB,CAAC;IAHC,iBAAiB;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;CACF,CAAA;AALC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC1B;AALb,OAAO;IAhBZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;;;;;;;;;;;GAYF,CACF;GACK,OAAO,CAUZ;AAED,eAAe,OAAO,CAAC"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { EventListenerFunc } from "@godown/element/tools/events.js";
|
2
|
+
import { GlobalStyle } from "../core/global-style.js";
|
3
|
+
/**
|
4
|
+
* {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.
|
5
|
+
*
|
6
|
+
* @category wrapper
|
7
|
+
*/
|
8
|
+
declare class Dragbox extends GlobalStyle {
|
9
|
+
/**
|
10
|
+
* Width of (`this.offsetParent` or `document.body`).
|
11
|
+
*/
|
12
|
+
get offsetsWidth(): number;
|
13
|
+
/**
|
14
|
+
* Height of (`this.offsetParent` or `document.body`).
|
15
|
+
*/
|
16
|
+
get offsetsHeight(): number;
|
17
|
+
private drag;
|
18
|
+
private t;
|
19
|
+
private l;
|
20
|
+
private cx;
|
21
|
+
private cy;
|
22
|
+
/**
|
23
|
+
* Position x.
|
24
|
+
*/
|
25
|
+
x: string;
|
26
|
+
/**
|
27
|
+
* Position y.
|
28
|
+
*/
|
29
|
+
y: string;
|
30
|
+
protected render(): import("lit").TemplateResult<1>;
|
31
|
+
protected firstUpdated(): void;
|
32
|
+
protected _handleDragStart(e: MouseEvent): void;
|
33
|
+
protected _handleMouseMove: EventListenerFunc;
|
34
|
+
protected _handleMouseLeave: EventListenerFunc;
|
35
|
+
protected _handleDragEnd(): void;
|
36
|
+
protected _handleDrag(e: MouseEvent): void;
|
37
|
+
reset(): void;
|
38
|
+
}
|
39
|
+
export default Dragbox;
|
40
|
+
//# sourceMappingURL=dragbox.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dragbox.d.ts","sourceRoot":"","sources":["../../src/components/dragbox.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;GAIG;AACH,cAcM,OAAQ,SAAQ,WAAW;IAC/B;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,EAAE,CAAS;IAEnB;;OAEG;IAEH,CAAC,SAAU;IAEX;;OAEG;IAEH,CAAC,SAAU;IAEX,SAAS,CAAC,MAAM;IAIhB,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,UAAU;IAUxC,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAC9C,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,cAAc;IAMxB,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU;IAuBnC,KAAK;CAWN;AAED,eAAe,OAAO,CAAC"}
|