godown 3.0.0-canary.14 → 3.0.0-canary.16
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/alert.js +1 -1
- package/alert.js.map +1 -1
- package/avatar.js +1 -1
- package/avatar.js.map +1 -1
- package/breath.js +1 -1
- package/breath.js.map +1 -1
- package/button.js +1 -1
- package/button.js.map +1 -1
- package/card.js +1 -1
- package/card.js.map +1 -1
- package/carousel.js +1 -1
- package/carousel.js.map +1 -1
- package/components/alert.d.ts +2 -0
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -1
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +1 -0
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -1
- package/components/avatar.js.map +1 -1
- package/components/breath.d.ts +3 -2
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -1
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +2 -1
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -1
- package/components/card.d.ts +1 -0
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +2 -0
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -1
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +2 -2
- package/components/details.d.ts.map +1 -1
- package/components/details.js +1 -1
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +3 -1
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +1 -0
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +1 -1
- package/components/dragbox.d.ts +2 -1
- 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 +1 -0
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js +1 -1
- package/components/flex.js.map +1 -1
- package/components/form.d.ts +1 -0
- package/components/form.d.ts.map +1 -1
- package/components/form.js +1 -1
- package/components/grid.d.ts +1 -0
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +1 -1
- package/components/grid.js.map +1 -1
- package/components/input.d.ts +3 -0
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -1
- package/components/input.js.map +1 -1
- package/components/layout.d.ts +4 -3
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +1 -1
- package/components/layout.js.map +1 -1
- package/components/link.d.ts +1 -0
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -1
- package/components/progress.d.ts +1 -0
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +6 -2
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -1
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +1 -0
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js +1 -1
- package/components/router.d.ts +4 -5
- package/components/router.d.ts.map +1 -1
- package/components/router.js +1 -1
- package/components/router.js.map +1 -1
- package/components/select.d.ts +5 -1
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -1
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts +1 -0
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +1 -1
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts +5 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +2 -0
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/components/text.d.ts +1 -0
- package/components/text.d.ts.map +1 -1
- package/components/text.js +1 -1
- package/components/text.js.map +1 -1
- package/components/time.d.ts +3 -1
- package/components/time.d.ts.map +1 -1
- package/components/time.js +1 -1
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +1 -0
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -1
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts +2 -1
- package/components/typewriter.d.ts.map +1 -1
- package/components/typewriter.js +1 -1
- package/components/typewriter.js.map +1 -1
- package/core/global-style.d.ts +1 -1
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -1
- package/core/global-style.js.map +1 -1
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +1 -1
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +1 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -1
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/details.js +1 -1
- package/details.js.map +1 -1
- package/dev/components/alert.d.ts +2 -0
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +7 -7
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +1 -0
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +4 -5
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/breath.d.ts +3 -2
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +14 -20
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +2 -1
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +2 -1
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +1 -0
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +2 -5
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +2 -0
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +7 -10
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +2 -2
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +16 -24
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +3 -1
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +2 -0
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +1 -0
- package/dev/components/divider.d.ts.map +1 -1
- package/dev/components/divider.js +23 -22
- package/dev/components/divider.js.map +1 -1
- package/dev/components/dragbox.d.ts +2 -1
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +3 -1
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts +1 -0
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +2 -1
- package/dev/components/flex.js.map +1 -1
- package/dev/components/form.d.ts +1 -0
- package/dev/components/form.d.ts.map +1 -1
- package/dev/components/form.js +1 -0
- package/dev/components/form.js.map +1 -1
- package/dev/components/grid.d.ts +1 -0
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +3 -2
- package/dev/components/grid.js.map +1 -1
- package/dev/components/input.d.ts +3 -0
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +15 -12
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts +4 -3
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +12 -15
- package/dev/components/layout.js.map +1 -1
- package/dev/components/link.d.ts +1 -0
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +1 -0
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +1 -0
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +39 -38
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +6 -2
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +15 -17
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +1 -0
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +1 -0
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +4 -5
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +11 -18
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +5 -1
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +30 -23
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts +1 -0
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +4 -2
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts +5 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +14 -8
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +2 -0
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +8 -10
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts +1 -0
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +3 -6
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts +3 -1
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +4 -3
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +1 -0
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +9 -11
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts +2 -1
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +1 -0
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/global-style.d.ts +1 -1
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +2 -4
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +20 -18
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +1 -1
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +35 -34
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +1 -1
- package/dev/core/super-openable.d.ts.map +1 -1
- package/dev/core/super-openable.js +1 -1
- package/dev/core/super-openable.js.map +1 -1
- package/dialog.js +1 -1
- package/dialog.js.map +1 -1
- package/divider.js +1 -1
- package/divider.js.map +1 -1
- package/dragbox.js +1 -1
- package/dragbox.js.map +1 -1
- package/flex.js +1 -1
- package/flex.js.map +1 -1
- package/form.js +1 -1
- package/form.js.map +1 -1
- package/grid.js +1 -1
- package/grid.js.map +1 -1
- package/input.js +1 -1
- package/input.js.map +1 -1
- package/layout.js +1 -1
- package/layout.js.map +1 -1
- package/link.js +1 -1
- package/link.js.map +1 -1
- package/package.json +4 -4
- package/progress.js +1 -1
- package/progress.js.map +1 -1
- package/range.js +1 -1
- package/range.js.map +1 -1
- package/rotate.js +1 -1
- package/rotate.js.map +1 -1
- package/router.js +1 -1
- package/router.js.map +1 -1
- package/select.js +1 -1
- package/select.js.map +1 -1
- package/skeleton.js +1 -1
- package/skeleton.js.map +1 -1
- package/src/components/alert.ts +7 -7
- package/src/components/avatar.ts +4 -5
- package/src/components/breath.ts +18 -22
- package/src/components/button.ts +3 -2
- package/src/components/card.ts +2 -5
- package/src/components/carousel.ts +7 -10
- package/src/components/details.ts +16 -24
- package/src/components/dialog.ts +3 -1
- package/src/components/divider.ts +26 -25
- package/src/components/dragbox.ts +4 -2
- package/src/components/flex.ts +5 -2
- package/src/components/form.ts +1 -0
- package/src/components/grid.ts +6 -3
- package/src/components/input.ts +15 -12
- package/src/components/layout.ts +7 -14
- package/src/components/link.ts +1 -0
- package/src/components/progress.ts +42 -39
- package/src/components/range.ts +15 -21
- package/src/components/rotate.ts +1 -0
- package/src/components/router.ts +15 -14
- package/src/components/select.ts +31 -24
- package/src/components/skeleton.ts +4 -2
- package/src/components/split.ts +20 -11
- package/src/components/switch.ts +8 -10
- package/src/components/text.ts +6 -7
- package/src/components/time.ts +5 -4
- package/src/components/tooltip.ts +9 -13
- package/src/components/typewriter.ts +6 -3
- package/src/core/global-style.ts +3 -6
- package/src/core/super-anchor.ts +23 -19
- package/src/core/super-input.ts +36 -35
- package/src/core/super-openable.ts +2 -2
- package/switch.js +1 -1
- package/switch.js.map +1 -1
- package/text.js +1 -1
- package/text.js.map +1 -1
- package/time.js +1 -1
- package/time.js.map +1 -1
- package/tooltip.js +1 -1
- package/tooltip.js.map +1 -1
- package/typewriter.js +1 -1
- package/typewriter.js.map +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
@@ -4,7 +4,7 @@ import { attr } from "@godown/element/directives/attr.js";
|
|
4
4
|
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
5
|
import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
|
6
6
|
import { css, html, type TemplateResult } from "lit";
|
7
|
-
import { property
|
7
|
+
import { property } from "lit/decorators.js";
|
8
8
|
|
9
9
|
import { scopePrefix } from "../core/global-style.js";
|
10
10
|
import SuperOpenable from "../core/super-openable.js";
|
@@ -18,7 +18,7 @@ const cssScope = scopePrefix(protoName);
|
|
18
18
|
*
|
19
19
|
* @slot summary - Details summary if no `summary` is provided.
|
20
20
|
* @slot - Details content.
|
21
|
-
* @fires change - Fired when the
|
21
|
+
* @fires change - Fired when the open changes.
|
22
22
|
* @category display
|
23
23
|
*/
|
24
24
|
@godown(protoName)
|
@@ -27,7 +27,6 @@ const cssScope = scopePrefix(protoName);
|
|
27
27
|
:host {
|
28
28
|
${cssScope}--icon-deg-open: 0deg;
|
29
29
|
${cssScope}--icon-deg-close: 90deg;
|
30
|
-
${cssScope}--icon-deg: 0deg;
|
31
30
|
${cssScope}--icon-space: 0.3em;
|
32
31
|
${cssScope}--summary-direction: row;
|
33
32
|
${cssScope}--transition: .3s;
|
@@ -36,13 +35,13 @@ const cssScope = scopePrefix(protoName);
|
|
36
35
|
transition: var(${cssScope}--transition);
|
37
36
|
}
|
38
37
|
|
39
|
-
|
38
|
+
[part=root] {
|
40
39
|
height: 100%;
|
41
40
|
position: relative;
|
42
41
|
overflow: hidden;
|
43
42
|
}
|
44
43
|
|
45
|
-
|
44
|
+
[part=title] {
|
46
45
|
height: 100%;
|
47
46
|
display: flex;
|
48
47
|
flex-wrap: nowrap;
|
@@ -52,7 +51,7 @@ const cssScope = scopePrefix(protoName);
|
|
52
51
|
flex-direction: var(${cssScope}--summary-direction);
|
53
52
|
}
|
54
53
|
|
55
|
-
|
54
|
+
[part=details] {
|
56
55
|
display: grid;
|
57
56
|
overflow: hidden;
|
58
57
|
grid-template-rows: 0fr;
|
@@ -60,27 +59,24 @@ const cssScope = scopePrefix(protoName);
|
|
60
59
|
transition-property: grid-template-rows;
|
61
60
|
}
|
62
61
|
|
63
|
-
|
64
|
-
display: flex;
|
65
|
-
backface-visibility: hidden;
|
66
|
-
padding: var(${cssScope}--icon-space);
|
67
|
-
transition: var(${cssScope}--transition);
|
68
|
-
transform: rotate(var(${cssScope}--icon-deg));
|
69
|
-
}
|
70
|
-
|
71
|
-
:host([open]) dd {
|
62
|
+
:host([open]) [part=details] {
|
72
63
|
grid-template-rows: 1fr;
|
73
64
|
}
|
74
65
|
|
75
|
-
:host([float])
|
66
|
+
:host([float]) [part=details] {
|
76
67
|
top: 100%;
|
77
68
|
position: absolute;
|
78
69
|
}
|
79
70
|
|
80
|
-
|
71
|
+
[part=icon] {
|
72
|
+
display: flex;
|
73
|
+
backface-visibility: hidden;
|
74
|
+
padding: var(${cssScope}--icon-space);
|
75
|
+
transition: var(${cssScope}--transition);
|
81
76
|
transform: rotate(var(${cssScope}--icon-deg-close));
|
82
77
|
}
|
83
|
-
|
78
|
+
|
79
|
+
:host([open]) [part=icon] {
|
84
80
|
transform: rotate(var(${cssScope}--icon-deg-open));
|
85
81
|
}
|
86
82
|
`,
|
@@ -98,15 +94,10 @@ class Details extends SuperOpenable {
|
|
98
94
|
@property()
|
99
95
|
summary = "";
|
100
96
|
|
101
|
-
@query("dd")
|
102
|
-
protected _dd: HTMLDataListElement;
|
103
|
-
|
104
97
|
protected render(): TemplateResult<1> {
|
105
98
|
return html`<dl part="root" ${attr(this.observedRecord)}>
|
106
99
|
<dt part="title" @click="${this._handelClick}">
|
107
|
-
<span part="summary">
|
108
|
-
${this.summary || htmlSlot("summary")}
|
109
|
-
</span>
|
100
|
+
<span part="summary">${this.summary || htmlSlot("summary")}</span>
|
110
101
|
<span>
|
111
102
|
<i part="icon">${svgCaretDown()}</i>
|
112
103
|
</span>
|
@@ -119,3 +110,4 @@ class Details extends SuperOpenable {
|
|
119
110
|
}
|
120
111
|
|
121
112
|
export default Details;
|
113
|
+
export { Details };
|
package/src/components/dialog.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import type { HandlerEvent } from "@godown/element";
|
2
2
|
import { godown } from "@godown/element/decorators/godown.js";
|
3
3
|
import { styles } from "@godown/element/decorators/styles.js";
|
4
4
|
import { attr } from "@godown/element/directives/attr.js";
|
@@ -19,6 +19,7 @@ const cssScope = scopePrefix(protoName);
|
|
19
19
|
*
|
20
20
|
* It listens for the keydown event and also closes itself when the {@linkcode key} contained in the key is pressed.
|
21
21
|
*
|
22
|
+
* @fires change - Fires when the open changes.
|
22
23
|
* @category feedback
|
23
24
|
*/
|
24
25
|
@godown(protoName)
|
@@ -164,3 +165,4 @@ class Dialog extends SuperOpenable {
|
|
164
165
|
}
|
165
166
|
|
166
167
|
export default Dialog;
|
168
|
+
export { Dialog };
|
@@ -15,31 +15,31 @@ const protoName = "divider";
|
|
15
15
|
@godown(protoName)
|
16
16
|
@styles(
|
17
17
|
css`
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
`,
|
18
|
+
:host {
|
19
|
+
width: 100%;
|
20
|
+
height: .05em;
|
21
|
+
margin: auto;
|
22
|
+
display: block;
|
23
|
+
background: currentColor;
|
24
|
+
}
|
25
|
+
|
26
|
+
:host([vertical]) {
|
27
|
+
width: .05em;
|
28
|
+
height: max(1em, 100%);
|
29
|
+
}
|
30
|
+
|
31
|
+
:host([contents]) [part=root] {
|
32
|
+
width: 100%;
|
33
|
+
height: .05em;
|
34
|
+
margin: auto;
|
35
|
+
display: block;
|
36
|
+
background: currentColor;
|
37
|
+
}
|
38
|
+
|
39
|
+
[part=root] {
|
40
|
+
display: contents;
|
41
|
+
}
|
42
|
+
`,
|
43
43
|
)
|
44
44
|
class Divider extends GlobalStyle {
|
45
45
|
/**
|
@@ -54,3 +54,4 @@ class Divider extends GlobalStyle {
|
|
54
54
|
}
|
55
55
|
|
56
56
|
export default Divider;
|
57
|
+
export { Divider };
|
@@ -2,7 +2,7 @@ import { godown } from "@godown/element/decorators/godown.js";
|
|
2
2
|
import { styles } from "@godown/element/decorators/styles.js";
|
3
3
|
import { attr } from "@godown/element/directives/attr.js";
|
4
4
|
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
|
-
import { EventListenerFunc } from "@godown/element/tools/events.js";
|
5
|
+
import type { EventListenerFunc } from "@godown/element/tools/events.js";
|
6
6
|
import { css, html, type TemplateResult } from "lit";
|
7
7
|
import { property } from "lit/decorators.js";
|
8
8
|
|
@@ -67,7 +67,8 @@ class Dragbox extends GlobalStyle {
|
|
67
67
|
part="root"
|
68
68
|
${attr(this.observedRecord)}
|
69
69
|
@mousedown="${this._handleDragStart}"
|
70
|
-
@mouseup="${this._handleDragEnd}"
|
70
|
+
@mouseup="${this._handleDragEnd}"
|
71
|
+
>
|
71
72
|
${htmlSlot()}
|
72
73
|
</div>`;
|
73
74
|
}
|
@@ -132,3 +133,4 @@ class Dragbox extends GlobalStyle {
|
|
132
133
|
}
|
133
134
|
|
134
135
|
export default Dragbox;
|
136
|
+
export { Dragbox };
|
package/src/components/flex.ts
CHANGED
@@ -18,7 +18,8 @@ const protoName = "flex";
|
|
18
18
|
* @category layout
|
19
19
|
*/
|
20
20
|
@godown(protoName)
|
21
|
-
@styles(
|
21
|
+
@styles(
|
22
|
+
css`
|
22
23
|
:host,
|
23
24
|
:host([contents]) [part=root] {
|
24
25
|
display: flex;
|
@@ -27,7 +28,8 @@ const protoName = "flex";
|
|
27
28
|
[part=root] {
|
28
29
|
display: contents;
|
29
30
|
}
|
30
|
-
|
31
|
+
`,
|
32
|
+
)
|
31
33
|
class Flex extends GlobalStyle {
|
32
34
|
/**
|
33
35
|
* CSS property `flex-flow` (`flex-direction flex-wrap`).
|
@@ -80,3 +82,4 @@ class Flex extends GlobalStyle {
|
|
80
82
|
}
|
81
83
|
|
82
84
|
export default Flex;
|
85
|
+
export { Flex };
|
package/src/components/form.ts
CHANGED
package/src/components/grid.ts
CHANGED
@@ -19,7 +19,8 @@ const protoName = "grid";
|
|
19
19
|
* @category layout
|
20
20
|
*/
|
21
21
|
@godown(protoName)
|
22
|
-
@styles(
|
22
|
+
@styles(
|
23
|
+
css`
|
23
24
|
:host,
|
24
25
|
:host([contents]) [part=root] {
|
25
26
|
display: grid;
|
@@ -28,7 +29,8 @@ const protoName = "grid";
|
|
28
29
|
[part=root] {
|
29
30
|
display: contents;
|
30
31
|
}
|
31
|
-
|
32
|
+
`,
|
33
|
+
)
|
32
34
|
class Grid extends GlobalStyle {
|
33
35
|
/**
|
34
36
|
* CSS property `gap`.
|
@@ -66,7 +68,7 @@ class Grid extends GlobalStyle {
|
|
66
68
|
|
67
69
|
protected render(): TemplateResult<1> {
|
68
70
|
return html`<div part="root" ${attr(this.observedRecord)}>
|
69
|
-
|
71
|
+
${[
|
70
72
|
htmlSlot(),
|
71
73
|
htmlStyle(
|
72
74
|
joinRules({
|
@@ -85,3 +87,4 @@ class Grid extends GlobalStyle {
|
|
85
87
|
}
|
86
88
|
|
87
89
|
export default Grid;
|
90
|
+
export { Grid };
|
package/src/components/input.ts
CHANGED
@@ -14,6 +14,8 @@ const protoName = "input";
|
|
14
14
|
/**
|
15
15
|
* {@linkcode Input} renders a text input.
|
16
16
|
*
|
17
|
+
* @fires input - Fires when the input value changes.
|
18
|
+
* @fires change - Fires when the input value changes.
|
17
19
|
* @category input
|
18
20
|
*/
|
19
21
|
@godown(protoName)
|
@@ -45,20 +47,20 @@ class Input extends SuperInput {
|
|
45
47
|
|
46
48
|
protected render(): TemplateResult<1> {
|
47
49
|
return html`<div part="root" ${attr(this.observedRecord)} class="${classList("input-field", this.variant)}">
|
48
|
-
|
50
|
+
${[
|
49
51
|
this._renderPrefix(),
|
50
52
|
html`<input
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
53
|
+
part="input"
|
54
|
+
type="${this.type}"
|
55
|
+
id="${this.makeId}"
|
56
|
+
.value="${this.value}"
|
57
|
+
placeholder="${this.placeholder || nothing}"
|
58
|
+
?autofocus="${this.autofocus}"
|
59
|
+
autocapitalize="${this.autocapitalize || nothing}"
|
60
|
+
autocomplete="${this.autocomplete || nothing}"
|
61
|
+
?disabled="${this.disabled}"
|
62
|
+
@input="${this._handleInput}"
|
63
|
+
>`,
|
62
64
|
this._renderSuffix(),
|
63
65
|
]}
|
64
66
|
</div>`;
|
@@ -71,3 +73,4 @@ class Input extends SuperInput {
|
|
71
73
|
}
|
72
74
|
|
73
75
|
export default Input;
|
76
|
+
export { Input };
|
package/src/components/layout.ts
CHANGED
@@ -10,7 +10,7 @@ import { GlobalStyle } from "../core/global-style.js";
|
|
10
10
|
const protoName = "layout";
|
11
11
|
|
12
12
|
/**
|
13
|
-
* {@linkcode
|
13
|
+
* {@linkcode Layout} renders slot and optional top header, bottom footer.
|
14
14
|
*
|
15
15
|
* @slot - The main content of the layout.
|
16
16
|
* @slot header - The header of the layout.
|
@@ -50,7 +50,7 @@ const protoName = "layout";
|
|
50
50
|
}
|
51
51
|
`,
|
52
52
|
)
|
53
|
-
class
|
53
|
+
class Layout extends GlobalStyle {
|
54
54
|
/**
|
55
55
|
* If true, remove the header slot.
|
56
56
|
*/
|
@@ -71,19 +71,12 @@ class NavLayout extends GlobalStyle {
|
|
71
71
|
|
72
72
|
protected render(): TemplateResult<1> {
|
73
73
|
return html`<div part="root" ${attr(this.observedRecord)}>
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
: ""
|
78
|
-
}
|
79
|
-
<main part="main">${htmlSlot()}</main>
|
80
|
-
${
|
81
|
-
!this.noFooter
|
82
|
-
? html`<footer part="footer">${htmlSlot("footer")}</footer>`
|
83
|
-
: ""
|
84
|
-
}
|
74
|
+
${!this.noHeader ? html`<header part="header">${htmlSlot("header")}</header>` : ""}
|
75
|
+
<main part="main">${htmlSlot()}</main>
|
76
|
+
${!this.noFooter ? html`<footer part="footer">${htmlSlot("footer")}</footer>` : ""}
|
85
77
|
</div>`;
|
86
78
|
}
|
87
79
|
}
|
88
80
|
|
89
|
-
export default
|
81
|
+
export default Layout;
|
82
|
+
export { Layout };
|
package/src/components/link.ts
CHANGED
@@ -15,52 +15,54 @@ const protoName = "progress";
|
|
15
15
|
* @category feedback
|
16
16
|
*/
|
17
17
|
@godown(protoName)
|
18
|
-
@styles(
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
:host,
|
28
|
-
[part=root] {
|
29
|
-
display: block;
|
30
|
-
}
|
18
|
+
@styles(
|
19
|
+
css`
|
20
|
+
:host {
|
21
|
+
width: 100%;
|
22
|
+
height: 0.5em;
|
23
|
+
border-radius: 0.25em;
|
24
|
+
background: var(${cssGlobalVars.passive});
|
25
|
+
color: var(${cssGlobalVars.active});
|
26
|
+
}
|
31
27
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
border-radius: inherit;
|
37
|
-
}
|
28
|
+
:host,
|
29
|
+
[part=root] {
|
30
|
+
display: block;
|
31
|
+
}
|
38
32
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
border-radius: inherit;
|
46
|
-
transition: all 0.3s;
|
47
|
-
animation: progress 1.8s ease-in-out infinite alternate;
|
48
|
-
background: currentColor;
|
49
|
-
}
|
33
|
+
[part=root] {
|
34
|
+
height: inherit;
|
35
|
+
z-index: 1;
|
36
|
+
position: relative;
|
37
|
+
border-radius: inherit;
|
38
|
+
}
|
50
39
|
|
51
|
-
|
52
|
-
|
40
|
+
[part=value] {
|
41
|
+
position: absolute;
|
42
|
+
z-index: 2;
|
43
|
+
top: 0;
|
53
44
|
left: 0;
|
45
|
+
height: 100%;
|
46
|
+
border-radius: inherit;
|
47
|
+
transition: all 0.3s;
|
48
|
+
animation: progress 1.8s ease-in-out infinite alternate;
|
49
|
+
background: currentColor;
|
54
50
|
}
|
55
|
-
|
56
|
-
|
51
|
+
|
52
|
+
@keyframes progress {
|
53
|
+
from {
|
54
|
+
left: 0;
|
55
|
+
}
|
56
|
+
to {
|
57
|
+
left: 80%;
|
58
|
+
}
|
57
59
|
}
|
58
|
-
}
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
.static [part=value] {
|
62
|
+
animation: none;
|
63
|
+
}
|
64
|
+
`,
|
65
|
+
)
|
64
66
|
class Progress extends GlobalStyle {
|
65
67
|
@property({ type: Number })
|
66
68
|
max = 1;
|
@@ -98,3 +100,4 @@ class Progress extends GlobalStyle {
|
|
98
100
|
}
|
99
101
|
|
100
102
|
export default Progress;
|
103
|
+
export { Progress };
|
package/src/components/range.ts
CHANGED
@@ -21,6 +21,11 @@ const cssScope = scopePrefix(protoName);
|
|
21
21
|
*
|
22
22
|
* Number has 1 handle, the array has the number of its elements and the minimum is 2.
|
23
23
|
*
|
24
|
+
* @fires input - Fires when the input value changes.
|
25
|
+
* @fires change - Fires when the input value changes.
|
26
|
+
* @fires range - Fires when the value changes.
|
27
|
+
* @fires focus - Fires when the handle is focused.
|
28
|
+
* @fires blur - Fires when the handle is blurred.
|
24
29
|
* @category input
|
25
30
|
*/
|
26
31
|
@godown(protoName)
|
@@ -218,19 +223,14 @@ class Range extends SuperInput {
|
|
218
223
|
"--to": `${((to - this.min) / gap) * 100}%`,
|
219
224
|
...(this.range
|
220
225
|
? Object.fromEntries(
|
221
|
-
rangeValue.map((value, index) => [
|
222
|
-
`--handle-${index}`,
|
223
|
-
`${((value - this.min) / gap) * 100}%`,
|
224
|
-
]),
|
226
|
+
rangeValue.map((value, index) => [`--handle-${index}`, `${((value - this.min) / gap) * 100}%`]),
|
225
227
|
)
|
226
228
|
: {}),
|
227
229
|
})
|
228
|
-
}"
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
: this.renderHandle(0)
|
233
|
-
}
|
230
|
+
}"
|
231
|
+
>
|
232
|
+
<div part="track"></div>
|
233
|
+
${this.range ? (this.value as number[]).map((_, index) => this.renderHandle(index)) : this.renderHandle(0)}
|
234
234
|
</div>`;
|
235
235
|
}
|
236
236
|
|
@@ -246,7 +246,7 @@ class Range extends SuperInput {
|
|
246
246
|
@blur="${this.disabled ? null : this.blurHandle}"
|
247
247
|
style="z-index:${this._focusStack.indexOf(index) + 1};--handle:var(--${
|
248
248
|
/* In single-handle mod or end, it is max value */
|
249
|
-
(!range && end) ?
|
249
|
+
(!range && end) ? "to" : `handle-${index}`})"
|
250
250
|
></i>
|
251
251
|
`;
|
252
252
|
}
|
@@ -265,11 +265,13 @@ class Range extends SuperInput {
|
|
265
265
|
if (!this._keydownEvent) {
|
266
266
|
this._keydownEvent = this.events.add(document, "keydown", this.createKeydownEvent(index));
|
267
267
|
}
|
268
|
+
this.dispatchEvent(new CustomEvent("focus", { detail: index }));
|
268
269
|
}
|
269
270
|
|
270
271
|
blurHandle(): void {
|
271
272
|
this.lastFocus = undefined;
|
272
273
|
this._keydownEvent = this.events.remove(document, "keydown", this._keydownEvent);
|
274
|
+
this.dispatchEvent(new CustomEvent("blur"));
|
273
275
|
}
|
274
276
|
|
275
277
|
protected createKeydownEvent(index: number) {
|
@@ -294,12 +296,6 @@ class Range extends SuperInput {
|
|
294
296
|
};
|
295
297
|
}
|
296
298
|
|
297
|
-
protected _handleMousedownEnd(e: MouseEvent): void {
|
298
|
-
this.lastFocus = 0;
|
299
|
-
this.createMousedownListener(this.setEnd)(e);
|
300
|
-
this.focusHandle(0);
|
301
|
-
}
|
302
|
-
|
303
299
|
createSetValue(index: number) {
|
304
300
|
return (numberOrModifier: number | ((value: number) => number)): void => {
|
305
301
|
const number = typeof numberOrModifier === "number"
|
@@ -311,13 +307,10 @@ class Range extends SuperInput {
|
|
311
307
|
newValue[index] = number;
|
312
308
|
}
|
313
309
|
this.value = newValue;
|
310
|
+
this.dispatchEvent(new CustomEvent("range", { detail: this.value }));
|
314
311
|
};
|
315
312
|
}
|
316
313
|
|
317
|
-
setEnd(value: number): void {
|
318
|
-
this.createSetValue((this.value as any)?.length - 1 || 0)(value);
|
319
|
-
}
|
320
|
-
|
321
314
|
/**
|
322
315
|
* Compute value from event.
|
323
316
|
*/
|
@@ -407,3 +400,4 @@ class Range extends SuperInput {
|
|
407
400
|
}
|
408
401
|
|
409
402
|
export default Range;
|
403
|
+
export { Range };
|
package/src/components/rotate.ts
CHANGED
package/src/components/router.ts
CHANGED
@@ -69,13 +69,7 @@ class Router extends GlobalStyle {
|
|
69
69
|
* Current pathname (equals to location.pathname).
|
70
70
|
*/
|
71
71
|
@property()
|
72
|
-
pathname
|
73
|
-
|
74
|
-
/**
|
75
|
-
* Path prefix.
|
76
|
-
*/
|
77
|
-
@property()
|
78
|
-
baseURL = "";
|
72
|
+
pathname: string;
|
79
73
|
|
80
74
|
/**
|
81
75
|
* Rendered content when there is no match.
|
@@ -109,6 +103,7 @@ class Router extends GlobalStyle {
|
|
109
103
|
|
110
104
|
get routes(): (Record<string, any> & {
|
111
105
|
path: string;
|
106
|
+
render?: (ur: ReturnType<Router["useRouter"]>) => unknown;
|
112
107
|
component?: unknown;
|
113
108
|
})[] {
|
114
109
|
return this.__routes;
|
@@ -202,7 +197,7 @@ class Router extends GlobalStyle {
|
|
202
197
|
* Get component from {@linkcode routes} by query.
|
203
198
|
*/
|
204
199
|
fieldComponent(query?: string): unknown {
|
205
|
-
query ||= this.__fieldRouteTree.search(
|
200
|
+
query ||= this.__fieldRouteTree.search(this.pathname)?.pattern;
|
206
201
|
this.path = query;
|
207
202
|
|
208
203
|
if (!query) {
|
@@ -214,26 +209,31 @@ class Router extends GlobalStyle {
|
|
214
209
|
if (!route) {
|
215
210
|
return null;
|
216
211
|
}
|
212
|
+
|
213
|
+
if ("render" in route) {
|
214
|
+
return route.render?.(this.useRouter()) || null;
|
215
|
+
}
|
216
|
+
|
217
217
|
return route.component;
|
218
218
|
}
|
219
219
|
|
220
220
|
/**
|
221
221
|
* Get component from slotted elements by query.
|
222
222
|
*/
|
223
|
-
slottedComponent(
|
223
|
+
slottedComponent(query?: string): TemplateResult<1> {
|
224
224
|
const slottedPaths = this._slottedNames;
|
225
|
-
|
226
|
-
this.path =
|
225
|
+
query ||= this.__slottedRouteTree.search(this.pathname)?.pattern;
|
226
|
+
this.path = query;
|
227
227
|
|
228
|
-
if (!
|
228
|
+
if (!query) {
|
229
229
|
return null;
|
230
230
|
}
|
231
231
|
|
232
|
-
this.path = slottedPaths.find((s) => s ===
|
232
|
+
this.path = slottedPaths.find((s) => s === query);
|
233
233
|
if (!this.path) {
|
234
234
|
return null;
|
235
235
|
}
|
236
|
-
this.params = this.parseParams(
|
236
|
+
this.params = this.parseParams(query, this.pathname);
|
237
237
|
return htmlSlot(this.path);
|
238
238
|
}
|
239
239
|
|
@@ -275,3 +275,4 @@ class Router extends GlobalStyle {
|
|
275
275
|
}
|
276
276
|
|
277
277
|
export default Router;
|
278
|
+
export { Router };
|