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,55 @@
|
|
1
|
+
import { type PropertyValueMap } from "lit";
|
2
|
+
import { GlobalStyle } from "../core/global-style.js";
|
3
|
+
/**
|
4
|
+
* {@linkcode Typewriter} renders a typewriter effect to text.
|
5
|
+
*
|
6
|
+
* @category effect
|
7
|
+
*/
|
8
|
+
declare class Typewriter extends GlobalStyle {
|
9
|
+
/**
|
10
|
+
* Raw text.
|
11
|
+
*/
|
12
|
+
text: string;
|
13
|
+
/**
|
14
|
+
* Start immediately after {@linkcode Typewriter.firstUpdated}.
|
15
|
+
*/
|
16
|
+
stopped: boolean;
|
17
|
+
/**
|
18
|
+
* If true, hide the cursor
|
19
|
+
*/
|
20
|
+
ended: boolean;
|
21
|
+
/**
|
22
|
+
* Maximum random time.
|
23
|
+
*/
|
24
|
+
max: number;
|
25
|
+
/**
|
26
|
+
* Minimum random time.
|
27
|
+
*/
|
28
|
+
min: number;
|
29
|
+
/**
|
30
|
+
* Fixed time.
|
31
|
+
*/
|
32
|
+
delay: number;
|
33
|
+
/**
|
34
|
+
* The index at the beginning.
|
35
|
+
*/
|
36
|
+
index: number;
|
37
|
+
/**
|
38
|
+
* Internal text.
|
39
|
+
*/
|
40
|
+
content: string;
|
41
|
+
protected timeoutID: number;
|
42
|
+
protected _i: HTMLElement;
|
43
|
+
/**
|
44
|
+
* {@linkcode Typewriter.text} length.
|
45
|
+
*/
|
46
|
+
get len(): number;
|
47
|
+
protected render(): import("lit").TemplateResult<1>;
|
48
|
+
protected firstUpdated(): void;
|
49
|
+
protected updated(changedProperties: PropertyValueMap<this>): void;
|
50
|
+
write(at?: number): void;
|
51
|
+
stop(): void;
|
52
|
+
end(): void;
|
53
|
+
}
|
54
|
+
export default Typewriter;
|
55
|
+
//# sourceMappingURL=typewriter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"typewriter.d.ts","sourceRoot":"","sources":["../../src/components/typewriter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cA8BM,UAAW,SAAQ,WAAW;IAClC;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,GAAG,SAAO;IAEV;;OAEG;IAEH,GAAG,SAAM;IAET;;OAEG;IAEH,KAAK,SAAK;IAEV;;OAEG;IAEH,KAAK,SAAK;IAEV;;OAEG;IAEH,OAAO,SAAM;IAEb,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAG5B,SAAS,CAAC,EAAE,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,IAAI,GAAG,WAEN;IAED,SAAS,CAAC,MAAM;IAQhB,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"}
|
@@ -0,0 +1,155 @@
|
|
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 { classList } from "@godown/element/directives/class-list.js";
|
5
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
6
|
+
import { random } from "@godown/element/tools/lib.js";
|
7
|
+
import { css, html } from "lit";
|
8
|
+
import { property, query, state } from "lit/decorators.js";
|
9
|
+
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
10
|
+
const protoName = "typewriter";
|
11
|
+
const cssScope = scopePrefix(protoName);
|
12
|
+
/**
|
13
|
+
* {@linkcode Typewriter} renders a typewriter effect to text.
|
14
|
+
*
|
15
|
+
* @category effect
|
16
|
+
*/
|
17
|
+
let Typewriter = class Typewriter extends GlobalStyle {
|
18
|
+
constructor() {
|
19
|
+
super(...arguments);
|
20
|
+
/**
|
21
|
+
* Raw text.
|
22
|
+
*/
|
23
|
+
this.text = "";
|
24
|
+
/**
|
25
|
+
* Start immediately after {@linkcode Typewriter.firstUpdated}.
|
26
|
+
*/
|
27
|
+
this.stopped = false;
|
28
|
+
/**
|
29
|
+
* If true, hide the cursor
|
30
|
+
*/
|
31
|
+
this.ended = false;
|
32
|
+
/**
|
33
|
+
* Maximum random time.
|
34
|
+
*/
|
35
|
+
this.max = 100;
|
36
|
+
/**
|
37
|
+
* Minimum random time.
|
38
|
+
*/
|
39
|
+
this.min = 50;
|
40
|
+
/**
|
41
|
+
* Fixed time.
|
42
|
+
*/
|
43
|
+
this.delay = 0;
|
44
|
+
/**
|
45
|
+
* The index at the beginning.
|
46
|
+
*/
|
47
|
+
this.index = 0;
|
48
|
+
/**
|
49
|
+
* Internal text.
|
50
|
+
*/
|
51
|
+
this.content = "";
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* {@linkcode Typewriter.text} length.
|
55
|
+
*/
|
56
|
+
get len() {
|
57
|
+
return this.text.length;
|
58
|
+
}
|
59
|
+
render() {
|
60
|
+
return html `${htmlSlot()}${this.content}<i part="cursor" class="${classList({
|
61
|
+
hidden: this.ended,
|
62
|
+
})}"></i>`;
|
63
|
+
}
|
64
|
+
firstUpdated() {
|
65
|
+
if (!this.text) {
|
66
|
+
this.text = this._slot?.assignedNodes()[0]?.textContent.trim() || "";
|
67
|
+
}
|
68
|
+
if (!this.stopped && this.len) {
|
69
|
+
this.write();
|
70
|
+
}
|
71
|
+
}
|
72
|
+
updated(changedProperties) {
|
73
|
+
if (changedProperties.has("index")) {
|
74
|
+
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.content }));
|
75
|
+
}
|
76
|
+
}
|
77
|
+
write(at = this.index) {
|
78
|
+
this.content = this.text.slice(0, at + 1);
|
79
|
+
const timeout = this.delay || random(this.max, this.min);
|
80
|
+
this.timeoutID = window.setTimeout(() => {
|
81
|
+
const nx = at + 1;
|
82
|
+
if (nx <= this.len) {
|
83
|
+
this.index = nx;
|
84
|
+
this.write();
|
85
|
+
}
|
86
|
+
}, timeout);
|
87
|
+
}
|
88
|
+
stop() {
|
89
|
+
clearTimeout(this.timeoutID);
|
90
|
+
}
|
91
|
+
end() {
|
92
|
+
this.ended = true;
|
93
|
+
}
|
94
|
+
};
|
95
|
+
__decorate([
|
96
|
+
property()
|
97
|
+
], Typewriter.prototype, "text", void 0);
|
98
|
+
__decorate([
|
99
|
+
property({ type: Boolean })
|
100
|
+
], Typewriter.prototype, "stopped", void 0);
|
101
|
+
__decorate([
|
102
|
+
property({ type: Boolean })
|
103
|
+
], Typewriter.prototype, "ended", void 0);
|
104
|
+
__decorate([
|
105
|
+
property({ type: Number })
|
106
|
+
], Typewriter.prototype, "max", void 0);
|
107
|
+
__decorate([
|
108
|
+
property({ type: Number })
|
109
|
+
], Typewriter.prototype, "min", void 0);
|
110
|
+
__decorate([
|
111
|
+
property({ type: Number })
|
112
|
+
], Typewriter.prototype, "delay", void 0);
|
113
|
+
__decorate([
|
114
|
+
property({ type: Number })
|
115
|
+
], Typewriter.prototype, "index", void 0);
|
116
|
+
__decorate([
|
117
|
+
state()
|
118
|
+
], Typewriter.prototype, "content", void 0);
|
119
|
+
__decorate([
|
120
|
+
query("i")
|
121
|
+
], Typewriter.prototype, "_i", void 0);
|
122
|
+
Typewriter = __decorate([
|
123
|
+
godown(protoName),
|
124
|
+
styles(css `
|
125
|
+
:host {
|
126
|
+
${cssScope}--cursor-width: .05em;
|
127
|
+
white-space: nowrap;
|
128
|
+
}
|
129
|
+
|
130
|
+
i {
|
131
|
+
border-right: var(${cssScope}--cursor-width) solid;
|
132
|
+
margin-left: 0.02em;
|
133
|
+
animation: s 1.5s steps(1) infinite;
|
134
|
+
}
|
135
|
+
|
136
|
+
@keyframes s {
|
137
|
+
0% {
|
138
|
+
border-color: currentColor;
|
139
|
+
}
|
140
|
+
50% {
|
141
|
+
border-color: transparent;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
slot {
|
146
|
+
display: none;
|
147
|
+
}
|
148
|
+
|
149
|
+
.hidden {
|
150
|
+
visibility: hidden;
|
151
|
+
}
|
152
|
+
`)
|
153
|
+
], Typewriter);
|
154
|
+
export default Typewriter;
|
155
|
+
//# sourceMappingURL=typewriter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"typewriter.js","sourceRoot":"","sources":["../../src/components/typewriter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAyB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;GAIG;AA+BH,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW;IAApC;;QACE;;WAEG;QAEH,SAAI,GAAG,EAAE,CAAC;QAEV;;WAEG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;WAEG;QAEH,UAAK,GAAG,KAAK,CAAC;QAEd;;WAEG;QAEH,QAAG,GAAG,GAAG,CAAC;QAEV;;WAEG;QAEH,QAAG,GAAG,EAAE,CAAC;QAET;;WAEG;QAEH,UAAK,GAAG,CAAC,CAAC;QAEV;;WAEG;QAEH,UAAK,GAAG,CAAC,CAAC;QAEV;;WAEG;QAEH,YAAO,GAAG,EA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AM,CAAC,UAAU,CAAC,GAAG,EAAE;YACtC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAClB,IAAI,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBAChB,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC;QACH,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;IAED,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF,CAAA;AAlGC;IADC,QAAQ,EAAE;wCACD;AAMV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACZ;AAMhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACd;AAMd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACjB;AAMV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAClB;AAMT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACjB;AAMV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACjB;AAMV;IADC,KAAK,EAAE;2CACK;AAKH;IADT,KAAK,CAAC,GAAG,CAAC;sCACe;AApDtB,UAAU;IA9Bf,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;QAEH,QAAQ;;;;;0BAKU,QAAQ;;;;;;;;;;;;;;;;;;;;;GAqB/B,CAAC;GACE,UAAU,CAuGf;AAED,eAAe,UAAU,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { type Gradients, presetsRGB } from "@godown/colors/presets-rgb.js";
|
2
|
+
import GodownElement from "@godown/element";
|
3
|
+
import { CSSResult } from "lit";
|
4
|
+
export declare class GlobalStyle extends GodownElement {
|
5
|
+
}
|
6
|
+
export declare function scopePrefix(scope: string, len?: number): CSSResult;
|
7
|
+
export declare function variablePrefix(variable: string): CSSResult;
|
8
|
+
export declare const cssGlobalVars: {
|
9
|
+
foreground: CSSResult;
|
10
|
+
background: CSSResult;
|
11
|
+
clipBackground: CSSResult;
|
12
|
+
active: CSSResult;
|
13
|
+
passive: CSSResult;
|
14
|
+
_colors: PresetsGradientsCSSResult;
|
15
|
+
input: CSSResult;
|
16
|
+
white: CSSResult;
|
17
|
+
black: CSSResult;
|
18
|
+
};
|
19
|
+
type PresetsGradientsCSSResult = Record<keyof typeof presetsRGB, Gradients<CSSResult>>;
|
20
|
+
export {};
|
21
|
+
//# sourceMappingURL=global-style.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"global-style.d.ts","sourceRoot":"","sources":["../../src/core/global-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAO,SAAS,EAAa,MAAM,KAAK,CAAC;AAIhD,qBAAa,WAAY,SAAQ,aAAa;CAC7C;AAID,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,aAEjD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,aAE9C;AAED,eAAO,MAAM,aAAa;;;;;;aAMT,yBAAyB;;;;CAIzC,CAAC;AAEF,KAAK,yBAAyB,GAAG,MAAM,CAAC,MAAM,OAAO,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { presetsRGB } from "@godown/colors/presets-rgb.js";
|
2
|
+
import { travel } from "@godown/colors/travel.js";
|
3
|
+
import GodownElement from "@godown/element";
|
4
|
+
import GodownConfig from "@godown/element/config.js";
|
5
|
+
import { joinProperties } from "@godown/element/tools/css.js";
|
6
|
+
import { trim } from "@godown/element/tools/lib.js";
|
7
|
+
import { css, unsafeCSS } from "lit";
|
8
|
+
GodownElement.godownConfig ||= new GodownConfig();
|
9
|
+
export class GlobalStyle extends GodownElement {
|
10
|
+
}
|
11
|
+
const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
|
12
|
+
export function scopePrefix(scope, len = 1) {
|
13
|
+
return variablePrefix(cssvar + "-".repeat(len) + scope);
|
14
|
+
}
|
15
|
+
export function variablePrefix(variable) {
|
16
|
+
return unsafeCSS("--" + variable);
|
17
|
+
}
|
18
|
+
export const cssGlobalVars = {
|
19
|
+
foreground: scopePrefix("foreground", 2),
|
20
|
+
background: scopePrefix("background", 2),
|
21
|
+
clipBackground: scopePrefix("clip-background", 2),
|
22
|
+
active: scopePrefix("active", 2),
|
23
|
+
passive: scopePrefix("passive", 2),
|
24
|
+
_colors: {},
|
25
|
+
input: scopePrefix("input", 2),
|
26
|
+
white: scopePrefix("color-white", 2),
|
27
|
+
black: scopePrefix("color-black", 2),
|
28
|
+
};
|
29
|
+
GlobalStyle.styles = [
|
30
|
+
unsafeCSS(":host{"
|
31
|
+
+ `${cssGlobalVars.black}:rgb(0 0 0);`
|
32
|
+
+ `${cssGlobalVars.white}:rgb(255 255 255);`
|
33
|
+
+ travel((key, gradient, rgb) => {
|
34
|
+
cssGlobalVars._colors[key] ||= [];
|
35
|
+
cssGlobalVars._colors[key].push(unsafeCSS(scopePrefix("color", 2) + "-" + key + "-" + gradient));
|
36
|
+
const endKey = `-${key}-${gradient}`;
|
37
|
+
const colorKey = scopePrefix("color", 2) + endKey;
|
38
|
+
return `${colorKey}:rgb(${rgb});`;
|
39
|
+
}, presetsRGB).join("")
|
40
|
+
+ joinProperties({
|
41
|
+
[cssGlobalVars.background + ""]: `var(${cssGlobalVars._colors.darkgray[9]})`,
|
42
|
+
[cssGlobalVars.foreground + ""]: `var(${cssGlobalVars._colors.lightgray[0]})`,
|
43
|
+
[cssGlobalVars.active + ""]: `var(${cssGlobalVars._colors.blue[6]})`,
|
44
|
+
[cssGlobalVars.passive + ""]: `var(${cssGlobalVars._colors.darkgray[6]})`,
|
45
|
+
[cssGlobalVars.clipBackground + ""]: `linear-gradient(to bottom, var(${cssGlobalVars.foreground}), var(${cssGlobalVars.passive}))`,
|
46
|
+
})
|
47
|
+
+ "}"),
|
48
|
+
css `
|
49
|
+
* {
|
50
|
+
border: 0;
|
51
|
+
outline: 0;
|
52
|
+
margin: 0;
|
53
|
+
padding: 0;
|
54
|
+
font-size: 100%;
|
55
|
+
font-style: normal;
|
56
|
+
box-sizing: border-box;
|
57
|
+
}
|
58
|
+
|
59
|
+
:host {
|
60
|
+
box-sizing: border-box;
|
61
|
+
}
|
62
|
+
|
63
|
+
a {
|
64
|
+
text-decoration: none;
|
65
|
+
}
|
66
|
+
|
67
|
+
span {
|
68
|
+
white-space: nowrap;
|
69
|
+
}
|
70
|
+
|
71
|
+
svg {
|
72
|
+
user-select: none;
|
73
|
+
}
|
74
|
+
`,
|
75
|
+
];
|
76
|
+
//# sourceMappingURL=global-style.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"global-style.js","sourceRoot":"","sources":["../../src/core/global-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAa,SAAS,EAAE,MAAM,KAAK,CAAC;AAEhD,aAAa,CAAC,YAAY,KAAK,IAAI,YAAY,EAAE,CAAC;AAElD,MAAM,OAAO,WAAY,SA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|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
11
|
+
protected render(): import("lit").TemplateResult<1>;
|
12
|
+
protected _handleClick(_: MouseEvent): void;
|
13
|
+
}
|
14
|
+
export default SuperAnchor;
|
15
|
+
//# sourceMappingURL=super-anchor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"super-anchor.d.ts","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAqBM,WAAY,SAAQ,WAAW;IACnC;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAa;IACzB;;OAEG;IAEH,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAW;IAE1D,SAAS,CAAC,MAAM;IAOhB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;CACrC;AAED,eAAe,WAAW,CAAC"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { styles } from "@godown/element/decorators/index.js";
|
3
|
+
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
+
import { css, html } from "lit";
|
5
|
+
import { property } from "lit/decorators.js";
|
6
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
7
|
+
import { GlobalStyle } from "./global-style.js";
|
8
|
+
let SuperAnchor = class SuperAnchor extends GlobalStyle {
|
9
|
+
constructor() {
|
10
|
+
super(...arguments);
|
11
|
+
/**
|
12
|
+
* A element href.
|
13
|
+
*/
|
14
|
+
this.href = undefined;
|
15
|
+
/**
|
16
|
+
* A element target.
|
17
|
+
*/
|
18
|
+
this.target = "_self";
|
19
|
+
}
|
20
|
+
render() {
|
21
|
+
return html `<a part="root" href="${ifDefined(this.href)}" target="${this.target}" @click=${this._handleClick}>
|
22
|
+
${htmlSlot()}
|
23
|
+
</a>`;
|
24
|
+
}
|
25
|
+
// eslint-disable-next-line
|
26
|
+
_handleClick(_) { }
|
27
|
+
};
|
28
|
+
__decorate([
|
29
|
+
property()
|
30
|
+
], SuperAnchor.prototype, "href", void 0);
|
31
|
+
__decorate([
|
32
|
+
property()
|
33
|
+
], SuperAnchor.prototype, "target", void 0);
|
34
|
+
SuperAnchor = __decorate([
|
35
|
+
styles(css `
|
36
|
+
:host {
|
37
|
+
display: inline-block;
|
38
|
+
color: currentColor;
|
39
|
+
text-decoration: none;
|
40
|
+
cursor: default;
|
41
|
+
}
|
42
|
+
|
43
|
+
:host([href]) {
|
44
|
+
cursor: pointer;
|
45
|
+
}
|
46
|
+
|
47
|
+
a {
|
48
|
+
width: 100%;
|
49
|
+
display: flex;
|
50
|
+
color: inherit;
|
51
|
+
text-decoration: inherit;
|
52
|
+
justify-content: space-between;
|
53
|
+
align-items: center;
|
54
|
+
}
|
55
|
+
`)
|
56
|
+
], SuperAnchor);
|
57
|
+
export default SuperAnchor;
|
58
|
+
//# sourceMappingURL=super-anchor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"super-anchor.js","sourceRoot":"","sources":["../../src/core/super-anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAuBhD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QACE;;WAEG;QAEH,SAAI,GAAW,SAAS,CAAC;QACzB;;WAEG;QAEH,WAAM,GAA4C,OAAO,CAAC;IAU5D,CAAC;IARW,MAAM;QACd,OAAO,IAAI,CAAA,wBAAwB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,YAAY;QACxG,QAAQ,EAAE;SACT,CAAC;IACR,CAAC;IAED,2BAA2B;IACjB,YAAY,CAAC,CAAa,IAAG,CAAC;CACzC,CAAA;AAfC;IADC,QAAQ,EAAE;yCACc;AAKzB;IADC,QAAQ,EAAE;2CAC+C;AAVtD,WAAW;IArBhB,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;CAoBV,CAAC;GACI,WAAW,CAoBhB;AAED,eAAe,WAAW,CAAC"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { type HandlerEvent } from "@godown/element/element.js";
|
2
|
+
import { GlobalStyle } from "./global-style.js";
|
3
|
+
declare class SuperInput extends GlobalStyle {
|
4
|
+
autofocus: boolean;
|
5
|
+
autocomplete: string | boolean;
|
6
|
+
disabled: boolean;
|
7
|
+
type: InputType;
|
8
|
+
placeholder: string;
|
9
|
+
name: string;
|
10
|
+
value: any;
|
11
|
+
/**
|
12
|
+
* default property records the default or initial value and is used to reset the input.
|
13
|
+
*/
|
14
|
+
default: any;
|
15
|
+
protected _input: HTMLInputElement;
|
16
|
+
/**
|
17
|
+
* Returns true when the input is compositing.
|
18
|
+
*/
|
19
|
+
compositing: boolean;
|
20
|
+
set defaultValue(value: typeof this.default);
|
21
|
+
get defaultValue(): typeof this.default;
|
22
|
+
protected makeId: string;
|
23
|
+
namevalue(): [string, any];
|
24
|
+
nameValue: () => [string, any];
|
25
|
+
reset(): void;
|
26
|
+
protected _handleInput(e: HandlerEvent<HTMLInputElement>): void;
|
27
|
+
connectedCallback(): void;
|
28
|
+
protected _connectedInit(): void;
|
29
|
+
protected _compositionInit(): void;
|
30
|
+
protected _changeInputType(t: typeof this.type): void;
|
31
|
+
focus(options?: FocusOptions): void;
|
32
|
+
protected firstUpdated(): void;
|
33
|
+
protected _renderPrefix(): import("lit").TemplateResult<1>;
|
34
|
+
protected _renderSuffix(): import("lit").TemplateResult<1>;
|
35
|
+
}
|
36
|
+
export default SuperInput;
|
37
|
+
type InputType = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
|
38
|
+
//# sourceMappingURL=super-input.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"super-input.d.ts","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK/D,OAAO,EAAiB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAoE/D,cACM,UAAW,SAAQ,WAAW;IAClC,SAAS,EAAE,OAAO,CAAC;IAEnB,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAG/B,QAAQ,EAAE,OAAO,CAAC;IAGlB,IAAI,EAAE,SAAS,CAAC;IAGhB,WAAW,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,GAAG,CAAC;IAEX;;OAEG;IAEH,OAAO,EAAE,GAAG,CAAC;IAGb,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,OAAO,EAE1C;IAED,IAAI,YAAY,IAJQ,OAAO,IAAI,CAAC,OAAO,CAM1C;IAED,SAAS,CAAC,MAAM,SAAuC;IAEvD,SAAS,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;IAI1B,SAAS,QAJI,CAAC,MAAM,EAAE,GAAG,CAAC,CAIC;IAE3B,KAAK;IAKL,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC;IAgBxD,iBAAiB;IAKjB,SAAS,CAAC,cAAc;IAKxB,SAAS,CAAC,gBAAgB;IAU1B,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,IAAI;IAM9C,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAI5B,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,aAAa;IAMvB,SAAS,CAAC,aAAa;CAiBxB;AAED,eAAe,UAAU,CAAC;AAE1B,KAAK,SAAS,GACV,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,QAAQ,GACR,OAAO,GACP,OAAO,GACP,UAAU,GACV,OAAO,GACP,MAAM,GACN,OAAO,CAAC"}
|
@@ -0,0 +1,182 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { part } from "@godown/element/decorators/part.js";
|
3
|
+
import { styles } from "@godown/element/decorators/styles.js";
|
4
|
+
import { htmlSlot } from "@godown/element/directives/index.js";
|
5
|
+
import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
|
6
|
+
import { css, html } from "lit";
|
7
|
+
import { property } from "lit/decorators.js";
|
8
|
+
import { cssGlobalVars, GlobalStyle } from "./global-style.js";
|
9
|
+
const fieldStyle = css `
|
10
|
+
.input-field {
|
11
|
+
display: flex;
|
12
|
+
position: relative;
|
13
|
+
align-items: center;
|
14
|
+
border-radius: inherit;
|
15
|
+
height: inherit;
|
16
|
+
}
|
17
|
+
|
18
|
+
.input-field [part=input] {
|
19
|
+
background: transparent;
|
20
|
+
height: 100%;
|
21
|
+
width: 100%;
|
22
|
+
color: inherit;
|
23
|
+
}
|
24
|
+
|
25
|
+
.input-field:focus-within,
|
26
|
+
.input-field.outline {
|
27
|
+
box-shadow: var(${cssGlobalVars.input}-box-shadow);
|
28
|
+
}
|
29
|
+
|
30
|
+
.input-field [part=icon] {
|
31
|
+
display: flex;
|
32
|
+
align-items: center;
|
33
|
+
justify-content: center;
|
34
|
+
}
|
35
|
+
|
36
|
+
.input-field [part=prefix],
|
37
|
+
.input-field [part=suffix] {
|
38
|
+
height: 100%;
|
39
|
+
display: flex;
|
40
|
+
}
|
41
|
+
|
42
|
+
.input-field [part=space]{
|
43
|
+
width: var(${cssGlobalVars.input}-space);
|
44
|
+
}
|
45
|
+
`;
|
46
|
+
const inputStyle = css `
|
47
|
+
:host {
|
48
|
+
${cssGlobalVars.input}-width: 10em;
|
49
|
+
${cssGlobalVars.input}-height: 1.6em;
|
50
|
+
${cssGlobalVars.input}-space: 0.2em;
|
51
|
+
${cssGlobalVars.input}-background: var(${cssGlobalVars.background});
|
52
|
+
${cssGlobalVars.input}-control: var(${cssGlobalVars.foreground});
|
53
|
+
${cssGlobalVars.input}-control-edge: var(${cssGlobalVars.active});
|
54
|
+
${cssGlobalVars.input}-radius: 0.2em;
|
55
|
+
${cssGlobalVars.input}-box-shadow: 0px 0px 0px .1em var(${cssGlobalVars.active});
|
56
|
+
border-radius: var(${cssGlobalVars.input}-radius);
|
57
|
+
}
|
58
|
+
|
59
|
+
:host([disabled]) {
|
60
|
+
cursor: not-allowed;
|
61
|
+
filter: brightness(0.85);
|
62
|
+
}
|
63
|
+
|
64
|
+
input:disabled {
|
65
|
+
cursor: inherit;
|
66
|
+
}
|
67
|
+
|
68
|
+
input::-ms-reveal,
|
69
|
+
input::-ms-clear {
|
70
|
+
display: none;
|
71
|
+
}
|
72
|
+
`;
|
73
|
+
let SuperInput = class SuperInput extends GlobalStyle {
|
74
|
+
constructor() {
|
75
|
+
super(...arguments);
|
76
|
+
this.makeId = Math.random().toString(36).slice(1);
|
77
|
+
this.nameValue = this.namevalue;
|
78
|
+
}
|
79
|
+
set defaultValue(value) {
|
80
|
+
this.default = value;
|
81
|
+
}
|
82
|
+
get defaultValue() {
|
83
|
+
return this.default;
|
84
|
+
}
|
85
|
+
namevalue() {
|
86
|
+
return [this.name, this.value];
|
87
|
+
}
|
88
|
+
reset() {
|
89
|
+
this.value = this.default;
|
90
|
+
this._input.value = this.default;
|
91
|
+
}
|
92
|
+
_handleInput(e) {
|
93
|
+
e.stopPropagation();
|
94
|
+
if (this.compositing) {
|
95
|
+
return;
|
96
|
+
}
|
97
|
+
this.value = e.target.value?.trim();
|
98
|
+
this.dispatchEvent(new CustomEvent("input", {
|
99
|
+
detail: this.value,
|
100
|
+
bubbles: true,
|
101
|
+
composed: true,
|
102
|
+
}));
|
103
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
|
104
|
+
}
|
105
|
+
connectedCallback() {
|
106
|
+
super.connectedCallback();
|
107
|
+
this._connectedInit();
|
108
|
+
}
|
109
|
+
_connectedInit() {
|
110
|
+
this.default ??= this.value || "";
|
111
|
+
this.value ??= this.default;
|
112
|
+
}
|
113
|
+
_compositionInit() {
|
114
|
+
if (this._input) {
|
115
|
+
this.events.add(this._input, "compositionstart", () => this.compositing = true);
|
116
|
+
this.events.add(this._input, "compositionend", (e) => {
|
117
|
+
this.compositing = false;
|
118
|
+
this._handleInput(e);
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
_changeInputType(t) {
|
123
|
+
if (this._input) {
|
124
|
+
this._input.type = t;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
focus(options) {
|
128
|
+
this._input?.focus(options);
|
129
|
+
}
|
130
|
+
firstUpdated() {
|
131
|
+
this._compositionInit();
|
132
|
+
}
|
133
|
+
_renderPrefix() {
|
134
|
+
return html `<label for=${this.makeId} part="prefix">
|
135
|
+
<i part="space"></i>
|
136
|
+
${htmlSlot("prefix")}</label>`;
|
137
|
+
}
|
138
|
+
_renderSuffix() {
|
139
|
+
const PASSWORD = "password";
|
140
|
+
return html `<label for=${this.makeId} part="suffix">${this.type === "password"
|
141
|
+
? html `
|
142
|
+
<i part="space"></i>
|
143
|
+
<i
|
144
|
+
part="icon"
|
145
|
+
@mousedown="${() => this._changeInputType("text")}"
|
146
|
+
@mouseup="${() => this._changeInputType(PASSWORD)}"
|
147
|
+
@mouseleave="${() => this._changeInputType(PASSWORD)}"
|
148
|
+
>${iconEyeSlashFill()}</i>`
|
149
|
+
: htmlSlot("suffix")}
|
150
|
+
<i part="space"></i>
|
151
|
+
</label>`;
|
152
|
+
}
|
153
|
+
};
|
154
|
+
__decorate([
|
155
|
+
property()
|
156
|
+
], SuperInput.prototype, "autocomplete", void 0);
|
157
|
+
__decorate([
|
158
|
+
property({ type: Boolean, reflect: true })
|
159
|
+
], SuperInput.prototype, "disabled", void 0);
|
160
|
+
__decorate([
|
161
|
+
property({ reflect: true })
|
162
|
+
], SuperInput.prototype, "type", void 0);
|
163
|
+
__decorate([
|
164
|
+
property({ reflect: true })
|
165
|
+
], SuperInput.prototype, "placeholder", void 0);
|
166
|
+
__decorate([
|
167
|
+
property({ reflect: true })
|
168
|
+
], SuperInput.prototype, "name", void 0);
|
169
|
+
__decorate([
|
170
|
+
property()
|
171
|
+
], SuperInput.prototype, "value", void 0);
|
172
|
+
__decorate([
|
173
|
+
property()
|
174
|
+
], SuperInput.prototype, "default", void 0);
|
175
|
+
__decorate([
|
176
|
+
part("input")
|
177
|
+
], SuperInput.prototype, "_input", void 0);
|
178
|
+
SuperInput = __decorate([
|
179
|
+
styles(fieldStyle, inputStyle)
|
180
|
+
], SuperInput);
|
181
|
+
export default SuperInput;
|
182
|
+
//# sourceMappingURL=super-input.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAE/D,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE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,EAAE;yCACA;AAMX;IADC,QAAQ,EAAE;2CACE;AAGH;IADT,IAAI,CAAC,OAAO,CAAC;0CACqB;AA3B/B,UAAU;IADf,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC;GACzB,UAAU,CAgIf;AAED,eAAe,UAAU,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { type PropertyValueMap } from "lit";
|
2
|
+
import { GlobalStyle } from "./global-style.js";
|
3
|
+
declare class SuperOpenable extends GlobalStyle {
|
4
|
+
/**
|
5
|
+
* Open the content.
|
6
|
+
*/
|
7
|
+
open: boolean;
|
8
|
+
toggle(to?: boolean): void;
|
9
|
+
close(): void;
|
10
|
+
show(): void;
|
11
|
+
protected updated(changedProperties: PropertyValueMap<this>): void;
|
12
|
+
protected _handelClick(_: MouseEvent): void;
|
13
|
+
}
|
14
|
+
export default SuperOpenable;
|
15
|
+
export type Direction4 = "left" | "right" | "top" | "bottom";
|
16
|
+
export type Direction5 = Direction4 | "center";
|
17
|
+
export type Direction8 = Direction4 | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
18
|
+
export type Direction9 = Direction8 | Direction5;
|
19
|
+
//# sourceMappingURL=super-openable.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,UAAa;IAItB,KAAK;IAIL,IAAI;IAIJ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAQ3D,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;CAGrC;AAED,eAAe,aAAa,CAAC;AAE7B,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC"}
|