godown 3.0.0-canary.10 → 3.0.0-canary.11
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 +1 -1
- package/components/alert.d.ts +2 -1
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +5 -7
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +2 -1
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +7 -4
- 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 +4 -3
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +5 -3
- package/components/button.d.ts.map +1 -1
- package/components/button.js +3 -2
- package/components/button.js.map +1 -1
- package/components/card.d.ts +2 -1
- package/components/card.d.ts.map +1 -1
- package/components/card.js +4 -3
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +3 -1
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +15 -9
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +2 -1
- package/components/details.d.ts.map +1 -1
- package/components/details.js +2 -1
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +2 -2
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +3 -2
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +2 -3
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +5 -6
- package/components/divider.js.map +1 -1
- package/components/dragbox.d.ts +2 -1
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +2 -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 +5 -4
- package/components/flex.js.map +1 -1
- package/components/form.d.ts +2 -1
- package/components/form.d.ts.map +1 -1
- package/components/form.js.map +1 -1
- package/components/grid.d.ts +2 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +5 -4
- package/components/grid.js.map +1 -1
- package/components/input.d.ts +2 -1
- package/components/input.d.ts.map +1 -1
- package/components/input.js +2 -1
- package/components/input.js.map +1 -1
- package/components/layout.d.ts +2 -1
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js +5 -5
- package/components/layout.js.map +1 -1
- package/components/link.d.ts.map +1 -1
- package/components/progress.d.ts +2 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +3 -2
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +3 -2
- package/components/range.d.ts.map +1 -1
- package/components/range.js +3 -6
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +2 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +9 -9
- package/components/router.d.ts.map +1 -1
- package/components/router.js.map +1 -1
- package/components/select.d.ts +2 -1
- package/components/select.d.ts.map +1 -1
- package/components/select.js +8 -4
- package/components/select.js.map +1 -1
- package/components/skeleton.d.ts +2 -1
- package/components/skeleton.d.ts.map +1 -1
- package/components/skeleton.js +3 -2
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts +2 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +3 -2
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +2 -1
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +3 -2
- package/components/switch.js.map +1 -1
- package/components/text.d.ts +2 -1
- package/components/text.d.ts.map +1 -1
- package/components/text.js +3 -4
- package/components/text.js.map +1 -1
- package/components/time.d.ts +2 -2
- package/components/time.d.ts.map +1 -1
- package/components/time.js +3 -2
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +2 -1
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +3 -2
- 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 +3 -4
- package/components/typewriter.js.map +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 +2 -1
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +3 -2
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +3 -2
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js.map +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/dev/components/alert.d.ts +2 -1
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +12 -10
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +2 -1
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +21 -7
- 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 +17 -5
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +5 -3
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +6 -1
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +2 -1
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +8 -5
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +3 -1
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +26 -13
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +2 -1
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +8 -3
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +2 -2
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +11 -10
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +2 -3
- package/dev/components/divider.d.ts.map +1 -1
- package/dev/components/divider.js +19 -7
- 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 +8 -1
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts +2 -1
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +16 -4
- package/dev/components/flex.js.map +1 -1
- package/dev/components/form.d.ts +2 -1
- package/dev/components/form.d.ts.map +1 -1
- package/dev/components/form.js.map +1 -1
- package/dev/components/grid.d.ts +2 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +16 -4
- package/dev/components/grid.js.map +1 -1
- package/dev/components/input.d.ts +2 -1
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +2 -1
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts +2 -1
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +13 -6
- package/dev/components/layout.js.map +1 -1
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/progress.d.ts +2 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +7 -2
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +3 -2
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +9 -12
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +2 -1
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +1 -1
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +9 -9
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +2 -1
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +18 -7
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts +2 -1
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +4 -3
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts +2 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +14 -10
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +2 -1
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +13 -9
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts +2 -1
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +4 -4
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts +2 -2
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +5 -2
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +2 -1
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +24 -12
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts +2 -2
- package/dev/components/typewriter.d.ts.map +1 -1
- package/dev/components/typewriter.js +11 -4
- package/dev/components/typewriter.js.map +1 -1
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +10 -1
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts +2 -1
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +8 -5
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +3 -2
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +1 -1
- package/dev/core/super-input.js.map +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/package.json +5 -4
- package/src/components/alert.ts +18 -16
- package/src/components/avatar.ts +25 -11
- package/src/components/breath.ts +22 -10
- package/src/components/button.ts +16 -10
- package/src/components/card.ts +9 -6
- package/src/components/carousel.ts +35 -21
- package/src/components/details.ts +10 -5
- package/src/components/dialog.ts +18 -17
- package/src/components/divider.ts +19 -7
- package/src/components/dragbox.ts +15 -8
- package/src/components/flex.ts +17 -5
- package/src/components/form.ts +4 -4
- package/src/components/grid.ts +17 -5
- package/src/components/input.ts +5 -4
- package/src/components/layout.ts +15 -8
- package/src/components/link.ts +1 -1
- package/src/components/progress.ts +9 -4
- package/src/components/range.ts +29 -34
- package/src/components/rotate.ts +9 -6
- package/src/components/router.ts +27 -19
- package/src/components/select.ts +31 -18
- package/src/components/skeleton.ts +6 -5
- package/src/components/split.ts +22 -18
- package/src/components/switch.ts +18 -14
- package/src/components/text.ts +6 -8
- package/src/components/time.ts +12 -9
- package/src/components/tooltip.ts +26 -14
- package/src/components/typewriter.ts +19 -14
- package/src/core/global-style.ts +23 -4
- package/src/core/super-anchor.ts +11 -8
- package/src/core/super-input.ts +14 -14
- package/src/core/super-openable.ts +5 -5
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
@@ -1,7 +1,8 @@
|
|
1
1
|
import { godown } from "@godown/element/decorators/godown.js";
|
2
2
|
import { styles } from "@godown/element/decorators/styles.js";
|
3
|
+
import { attr } from "@godown/element/directives/attr.js";
|
3
4
|
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
4
|
-
import { css, html } from "lit";
|
5
|
+
import { css, html, type TemplateResult } from "lit";
|
5
6
|
import { property } from "lit/decorators.js";
|
6
7
|
|
7
8
|
import { scopePrefix } from "../core/global-style.js";
|
@@ -24,12 +25,15 @@ const cssScope = scopePrefix(protoName);
|
|
24
25
|
css`
|
25
26
|
:host {
|
26
27
|
${cssScope}--tip-background: inherit;
|
27
|
-
display: inline-block;
|
28
28
|
width: fit-content;
|
29
29
|
}
|
30
|
+
|
31
|
+
:host,
|
32
|
+
[part=root] {
|
33
|
+
display: inline-flex;
|
34
|
+
}
|
30
35
|
|
31
36
|
[part=root] {
|
32
|
-
display: flex;
|
33
37
|
position: relative;
|
34
38
|
transition: inherit;
|
35
39
|
border-radius: inherit;
|
@@ -51,18 +55,25 @@ const cssScope = scopePrefix(protoName);
|
|
51
55
|
.passive {
|
52
56
|
background: var(${cssScope}--tip-background);
|
53
57
|
}
|
58
|
+
|
59
|
+
[propagation] [part=tip] {
|
60
|
+
pointer-events: none;
|
61
|
+
}
|
54
62
|
`,
|
55
63
|
css`
|
56
|
-
[direction^=top] {
|
64
|
+
[direction^=top] [part=tip] {
|
57
65
|
bottom: 100%;
|
58
66
|
}
|
59
|
-
|
67
|
+
|
68
|
+
[direction^=bottom] [part=tip] {
|
60
69
|
top: 100%;
|
61
70
|
}
|
62
|
-
|
71
|
+
|
72
|
+
[direction$=right] [part=tip] {
|
63
73
|
left: 100%;
|
64
74
|
}
|
65
|
-
|
75
|
+
|
76
|
+
[direction$=left] [part=tip] {
|
66
77
|
right: 100%;
|
67
78
|
}
|
68
79
|
`,
|
@@ -112,10 +123,12 @@ class Tooltip extends SuperOpenable {
|
|
112
123
|
"flex-end": "flex-end",
|
113
124
|
};
|
114
125
|
|
115
|
-
protected render() {
|
126
|
+
protected render(): TemplateResult<1> {
|
116
127
|
const align = Tooltip.aligns[this.align] || "inherit";
|
117
128
|
const isFocusable = this.type === "focus";
|
118
|
-
return html`<div
|
129
|
+
return html`<div
|
130
|
+
part="root"
|
131
|
+
${attr(this.observedRecord)}
|
119
132
|
tabindex="${isFocusable ? 0 : -1}"
|
120
133
|
@focus="${isFocusable ? () => this.open = true : null}"
|
121
134
|
@blur="${isFocusable ? () => this.open = false : null}"
|
@@ -123,14 +136,13 @@ class Tooltip extends SuperOpenable {
|
|
123
136
|
@mouseleave="${isFocusable ? null : () => this.open = false}"
|
124
137
|
style="justify-content:${align};align-items:${align}">
|
125
138
|
${htmlSlot()}
|
126
|
-
<div part="tip"
|
127
|
-
|
128
|
-
style="pointer-events:${this.propagation ? "none" : "all"}">
|
129
|
-
${
|
139
|
+
<div part="tip">
|
140
|
+
${
|
130
141
|
this.tip
|
131
142
|
? html`<span class="passive">${this.tip}</span>`
|
132
143
|
: htmlSlot("tip")
|
133
|
-
}
|
144
|
+
}
|
145
|
+
</div>
|
134
146
|
</div>`;
|
135
147
|
}
|
136
148
|
}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { godown } from "@godown/element/decorators/godown.js";
|
2
2
|
import { styles } from "@godown/element/decorators/styles.js";
|
3
|
+
import { attr } from "@godown/element/directives/attr.js";
|
3
4
|
import { classList } from "@godown/element/directives/class-list.js";
|
4
5
|
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
5
6
|
import { random } from "@godown/element/tools/lib.js";
|
6
|
-
import { css, html, type PropertyValueMap } from "lit";
|
7
|
+
import { css, html, type PropertyValueMap, TemplateResult } from "lit";
|
7
8
|
import { property, query, state } from "lit/decorators.js";
|
8
9
|
|
9
10
|
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
@@ -20,7 +21,11 @@ const cssScope = scopePrefix(protoName);
|
|
20
21
|
@styles(css`
|
21
22
|
:host {
|
22
23
|
${cssScope}--cursor-width: .05em;
|
23
|
-
|
24
|
+
}
|
25
|
+
|
26
|
+
:host,
|
27
|
+
:host([contents]) [part=root] {
|
28
|
+
display: inline-block;
|
24
29
|
}
|
25
30
|
|
26
31
|
i {
|
@@ -103,19 +108,19 @@ class Typewriter extends GlobalStyle {
|
|
103
108
|
/**
|
104
109
|
* {@linkcode Typewriter.text} length.
|
105
110
|
*/
|
106
|
-
get len() {
|
111
|
+
get len(): number {
|
107
112
|
return this.text.length;
|
108
113
|
}
|
109
114
|
|
110
|
-
protected render() {
|
111
|
-
return html
|
112
|
-
|
113
|
-
|
114
|
-
})
|
115
|
-
|
115
|
+
protected render(): TemplateResult<1> {
|
116
|
+
return html`<div part="root" ${attr(this.observedRecord)}>
|
117
|
+
${htmlSlot()}
|
118
|
+
${this.content}
|
119
|
+
<i part="cursor" class="${classList({ hidden: this.ended })}"></i>
|
120
|
+
</div>`;
|
116
121
|
}
|
117
122
|
|
118
|
-
protected firstUpdated() {
|
123
|
+
protected firstUpdated(): void {
|
119
124
|
if (!this.text) {
|
120
125
|
this.text = this._slot?.assignedNodes()[0]?.textContent.trim() || "";
|
121
126
|
}
|
@@ -124,13 +129,13 @@ class Typewriter extends GlobalStyle {
|
|
124
129
|
}
|
125
130
|
}
|
126
131
|
|
127
|
-
protected updated(changedProperties: PropertyValueMap<this>) {
|
132
|
+
protected updated(changedProperties: PropertyValueMap<this>): void {
|
128
133
|
if (changedProperties.has("index")) {
|
129
134
|
this.dispatchEvent(new CustomEvent(this.index === this.len ? "done" : "write", { detail: this.content }));
|
130
135
|
}
|
131
136
|
}
|
132
137
|
|
133
|
-
write(at = this.index) {
|
138
|
+
write(at: number = this.index): void {
|
134
139
|
this.content = this.text.slice(0, at + 1);
|
135
140
|
const timeout = this.delay || random(this.max, this.min);
|
136
141
|
this.timeoutID = window.setTimeout(() => {
|
@@ -142,11 +147,11 @@ class Typewriter extends GlobalStyle {
|
|
142
147
|
}, timeout);
|
143
148
|
}
|
144
149
|
|
145
|
-
stop() {
|
150
|
+
stop(): void {
|
146
151
|
clearTimeout(this.timeoutID);
|
147
152
|
}
|
148
153
|
|
149
|
-
end() {
|
154
|
+
end(): void {
|
150
155
|
this.ended = true;
|
151
156
|
}
|
152
157
|
}
|
package/src/core/global-style.ts
CHANGED
@@ -13,15 +13,25 @@ export class GlobalStyle extends GodownElement {
|
|
13
13
|
|
14
14
|
const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
|
15
15
|
|
16
|
-
export function scopePrefix(scope: string, len = 1) {
|
16
|
+
export function scopePrefix(scope: string, len = 1): CSSResult {
|
17
17
|
return variablePrefix(cssvar + "-".repeat(len) + scope);
|
18
18
|
}
|
19
19
|
|
20
|
-
export function variablePrefix(variable: string) {
|
20
|
+
export function variablePrefix(variable: string): CSSResult {
|
21
21
|
return unsafeCSS("--" + variable);
|
22
22
|
}
|
23
23
|
|
24
|
-
export const cssGlobalVars
|
24
|
+
export const cssGlobalVars: {
|
25
|
+
foreground: CSSResult;
|
26
|
+
background: CSSResult;
|
27
|
+
clipBackground: CSSResult;
|
28
|
+
active: CSSResult;
|
29
|
+
passive: CSSResult;
|
30
|
+
_colors: PresetsGradientsCSSResult;
|
31
|
+
input: CSSResult;
|
32
|
+
white: CSSResult;
|
33
|
+
black: CSSResult;
|
34
|
+
} = {
|
25
35
|
foreground: scopePrefix("foreground", 2),
|
26
36
|
background: scopePrefix("background", 2),
|
27
37
|
clipBackground: scopePrefix("clip-background", 2),
|
@@ -82,5 +92,14 @@ GlobalStyle.styles = [
|
|
82
92
|
svg {
|
83
93
|
user-select: none;
|
84
94
|
}
|
85
|
-
|
95
|
+
|
96
|
+
:host([contents]) {
|
97
|
+
display: contents;
|
98
|
+
}
|
99
|
+
|
100
|
+
:where(:host([contents]) [part=root]) {
|
101
|
+
all: inherit;
|
102
|
+
display: revert;
|
103
|
+
}
|
104
|
+
`,
|
86
105
|
];
|
package/src/core/super-anchor.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { styles } from "@godown/element/decorators/index.js";
|
2
|
+
import { attr } from "@godown/element/directives/attr.js";
|
2
3
|
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
3
|
-
import { css, html } from "lit";
|
4
|
+
import { css, html, type TemplateResult } from "lit";
|
4
5
|
import { property } from "lit/decorators.js";
|
5
6
|
import { ifDefined } from "lit/directives/if-defined.js";
|
6
7
|
|
@@ -18,13 +19,11 @@ import { GlobalStyle } from "./global-style.js";
|
|
18
19
|
cursor: pointer;
|
19
20
|
}
|
20
21
|
|
21
|
-
|
22
|
+
[part=root] {
|
22
23
|
width: 100%;
|
23
|
-
display: flex;
|
24
24
|
color: inherit;
|
25
|
+
display: inline-block;
|
25
26
|
text-decoration: inherit;
|
26
|
-
justify-content: space-between;
|
27
|
-
align-items: center;
|
28
27
|
}
|
29
28
|
`)
|
30
29
|
class SuperAnchor extends GlobalStyle {
|
@@ -39,14 +38,18 @@ class SuperAnchor extends GlobalStyle {
|
|
39
38
|
@property()
|
40
39
|
target: "_blank" | "_self" | "_parent" | "_top" = "_self";
|
41
40
|
|
42
|
-
protected render() {
|
43
|
-
return html`<a part="root"
|
41
|
+
protected render(): TemplateResult<1> {
|
42
|
+
return html`<a part="root"
|
43
|
+
${attr(this.observedRecord)}
|
44
|
+
href="${ifDefined(this.href)}"
|
45
|
+
target="${this.target}"
|
46
|
+
@click=${this._handleClick}>
|
44
47
|
${htmlSlot()}
|
45
48
|
</a>`;
|
46
49
|
}
|
47
50
|
|
48
51
|
// eslint-disable-next-line
|
49
|
-
protected _handleClick(_: MouseEvent) {}
|
52
|
+
protected _handleClick(_: MouseEvent): void {}
|
50
53
|
}
|
51
54
|
|
52
55
|
export default SuperAnchor;
|
package/src/core/super-input.ts
CHANGED
@@ -3,7 +3,7 @@ import { styles } from "@godown/element/decorators/styles.js";
|
|
3
3
|
import { htmlSlot } from "@godown/element/directives/index.js";
|
4
4
|
import { type HandlerEvent } from "@godown/element/element.js";
|
5
5
|
import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
|
6
|
-
import { css, html } from "lit";
|
6
|
+
import { css, html, type TemplateResult } from "lit";
|
7
7
|
import { property } from "lit/decorators.js";
|
8
8
|
|
9
9
|
import { cssGlobalVars, GlobalStyle } from "./global-style.js";
|
@@ -41,7 +41,7 @@ const fieldStyle = css`
|
|
41
41
|
display: flex;
|
42
42
|
}
|
43
43
|
|
44
|
-
.input-field [part=space]{
|
44
|
+
.input-field [part=space] {
|
45
45
|
width: var(${cssGlobalVars.input}-space);
|
46
46
|
}
|
47
47
|
`;
|
@@ -117,20 +117,20 @@ class SuperInput extends GlobalStyle {
|
|
117
117
|
return this.default;
|
118
118
|
}
|
119
119
|
|
120
|
-
protected makeId = Math.random().toString(36).slice(1);
|
120
|
+
protected makeId: string = Math.random().toString(36).slice(1);
|
121
121
|
|
122
122
|
namevalue(): [string, any] {
|
123
123
|
return [this.name, this.value];
|
124
124
|
}
|
125
125
|
|
126
|
-
nameValue = this.namevalue;
|
126
|
+
nameValue: () => [string, any] = this.namevalue;
|
127
127
|
|
128
|
-
reset() {
|
128
|
+
reset(): void {
|
129
129
|
this.value = this.default;
|
130
130
|
this._input.value = this.default;
|
131
131
|
}
|
132
132
|
|
133
|
-
protected _handleInput(e: HandlerEvent<HTMLInputElement>) {
|
133
|
+
protected _handleInput(e: HandlerEvent<HTMLInputElement>): void {
|
134
134
|
e.stopPropagation();
|
135
135
|
if (this.compositing) {
|
136
136
|
return;
|
@@ -146,17 +146,17 @@ class SuperInput extends GlobalStyle {
|
|
146
146
|
this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
|
147
147
|
}
|
148
148
|
|
149
|
-
connectedCallback() {
|
149
|
+
connectedCallback(): void {
|
150
150
|
super.connectedCallback();
|
151
151
|
this._connectedInit();
|
152
152
|
}
|
153
153
|
|
154
|
-
protected _connectedInit() {
|
154
|
+
protected _connectedInit(): void {
|
155
155
|
this.default ??= this.value || "";
|
156
156
|
this.value ??= this.default;
|
157
157
|
}
|
158
158
|
|
159
|
-
protected _compositionInit() {
|
159
|
+
protected _compositionInit(): void {
|
160
160
|
if (this._input) {
|
161
161
|
this.events.add(this._input, "compositionstart", () => this.compositing = true);
|
162
162
|
this.events.add(this._input, "compositionend", (e: HandlerEvent<HTMLInputElement>) => {
|
@@ -166,27 +166,27 @@ class SuperInput extends GlobalStyle {
|
|
166
166
|
}
|
167
167
|
}
|
168
168
|
|
169
|
-
protected _changeInputType(t: typeof this.type) {
|
169
|
+
protected _changeInputType(t: typeof this.type): void {
|
170
170
|
if (this._input) {
|
171
171
|
this._input.type = t;
|
172
172
|
}
|
173
173
|
}
|
174
174
|
|
175
|
-
focus(options?: FocusOptions) {
|
175
|
+
focus(options?: FocusOptions): void {
|
176
176
|
this._input?.focus(options);
|
177
177
|
}
|
178
178
|
|
179
|
-
protected firstUpdated() {
|
179
|
+
protected firstUpdated(): void {
|
180
180
|
this._compositionInit();
|
181
181
|
}
|
182
182
|
|
183
|
-
protected _renderPrefix() {
|
183
|
+
protected _renderPrefix(): TemplateResult<1> {
|
184
184
|
return html`<label for=${this.makeId} part="prefix">
|
185
185
|
<i part="space"></i>
|
186
186
|
${htmlSlot("prefix")}</label>`;
|
187
187
|
}
|
188
188
|
|
189
|
-
protected _renderSuffix() {
|
189
|
+
protected _renderSuffix(): TemplateResult<1> {
|
190
190
|
const PASSWORD = "password";
|
191
191
|
return html`<label for=${this.makeId} part="suffix">${
|
192
192
|
this.type === "password"
|
@@ -10,19 +10,19 @@ class SuperOpenable extends GlobalStyle {
|
|
10
10
|
@property({ type: Boolean, reflect: true })
|
11
11
|
open = false;
|
12
12
|
|
13
|
-
toggle(to = !this.open) {
|
13
|
+
toggle(to: boolean = (!this.open) satisfies boolean): void {
|
14
14
|
this.open = to;
|
15
15
|
}
|
16
16
|
|
17
|
-
close() {
|
17
|
+
close(): void {
|
18
18
|
this.open = false;
|
19
19
|
}
|
20
20
|
|
21
|
-
show() {
|
21
|
+
show(): void {
|
22
22
|
this.open = true;
|
23
23
|
}
|
24
24
|
|
25
|
-
protected updated(changedProperties: PropertyValueMap<this>) {
|
25
|
+
protected updated(changedProperties: PropertyValueMap<this>): void {
|
26
26
|
const open = changedProperties.get("open");
|
27
27
|
if (open !== undefined) {
|
28
28
|
this.dispatchEvent(new CustomEvent("change", { detail: this.open }));
|
@@ -30,7 +30,7 @@ class SuperOpenable extends GlobalStyle {
|
|
30
30
|
}
|
31
31
|
|
32
32
|
// eslint-disable-next-line
|
33
|
-
protected _handelClick(_: MouseEvent) {
|
33
|
+
protected _handelClick(_: MouseEvent): void {
|
34
34
|
this.toggle();
|
35
35
|
}
|
36
36
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":1.1,"tags":[{"name":"godown-typewriter","description":"Typewriter renders a typewriter effect to text.\n---\n### **Events:**\n ","attributes":[{"name":"text","description":"Raw text.","values":[]},{"name":"stopped","description":"Start immediately after Typewriter.firstUpdated.","values":[]},{"name":"ended","description":"If true, hide the cursor","values":[]},{"name":"max","description":"Maximum random time.","values":[]},{"name":"min","description":"Minimum random time.","values":[]},{"name":"delay","description":"Fixed time.","values":[]},{"name":"index","description":"The index at the beginning.","values":[]}],"references":[]},{"name":"godown-tooltip","description":"Tooltip provide tooltip for slot elements.\nIf it has the tip property, ignore the slot tip.\n---\n### **Events:**\n - **change**\n### **Slots:**\n - **tip** - Tip element if no `tip` provided.\n- _default_ - Content.","attributes":[{"name":"tip","description":"Tip text, if there is a value, the slot will be ignored.","values":[]},{"name":"direction","description":"Direction of opening the tip.","values":[{"name":"Direction8"}]},{"name":"align","description":"Content alignment.","values":[{"name":"center"},{"name":"flex-start"},{"name":"flex-end"},{"name":"start"},{"name":"end"}]},{"name":"propagation","description":"If true, allow penetration of the tip.","values":[]},{"name":"type","description":"How can tips be triggered.\nIf `focus`, element will be focusable, open tip when focused.\nIf `hover`, element will open tip when hovered.","values":[{"name":"hover"},{"name":"focus"}]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-time","description":"Time renders a formatting time.\n---\n","attributes":[{"name":"escape","description":"Escape symbol.","values":[]},{"name":"format","description":"Format strings.","values":[]},{"name":"time","description":"Time.","values":[]},{"name":"timeout","description":"If there is a value, update every gap or timeout.","values":[]},{"name":"gap","description":"The number of milliseconds that change with each update.","values":[]}],"references":[]},{"name":"godown-text","description":"Text renders nowrap text.\n---\n","attributes":[{"name":"underline","description":"Underline behavior.","values":[{"name":"none"},{"name":"hover"},{"name":"active"},{"name":"always"}]},{"name":"clip","description":"Set background-clip to text.","values":[]}],"references":[]},{"name":"godown-switch","description":"Switch renders a switch.\nThe switch is rectangular by default,\nset the round property to rounded switch.\n---\n### **Events:**\n - **input**\n- **change**","attributes":[{"name":"round","description":"Display rounded.","values":[]},{"name":"checked","description":"Whether this element is selected or not.","values":[]},{"name":"disabled","description":"Disable this element.","values":[]},{"name":"default","description":"Default checked state.","values":[]},{"name":"value","description":"Input value.","values":[]},{"name":"autocomplete","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]}],"references":[]},{"name":"godown-split-input","description":"Split renders multiple input boxes.\nInput: will move the focus box backward until the complete input from start to end.\nDelete: will move the focus box forward until the first and no inputs for each.\n---\n### **Events:**\n - **input**\n- **change**\n### **Methods:**\n ","attributes":[{"name":"len","description":"The number of input boxes.","values":[]},{"name":"index","description":"Focus index.","values":[]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-skeleton","description":"Skeleton renders a skeleton screen.\n---\n### **Slots:**\n - **loading** - The content if loading is true.\n- _default_ - The content if loading is false.","attributes":[{"name":"type","description":"If \"image\", render a image placeholder.","values":[{"name":"text"},{"name":"image"}]},{"name":"animation","description":"Animation type.\nopacity animation only effect on slotted element and image icon.","values":[{"name":"position"},{"name":"opacity"}]}],"references":[]},{"name":"godown-select","description":"Select is similar to `<select>`.\nElements with the value attribute/property can be used as options.\nThe checked attribute will be added to the selected element.\nMulti-selected state looks the same as single-selected.\nInput will filter the element.\n---\n### **Events:**\n - **change**\n- **input**\n### **Slots:**\n - _default_ - Options.","attributes":[{"name":"text","description":"Selected texts.","values":[]},{"name":"direction","values":[{"name":"top"},{"name":"bottom"}]},{"name":"multiple","values":[]},{"name":"visible","values":[]},{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-router","description":"Router has basic routing control.\nTo switch routes, use `router-link component`.\nIt has two methods to collect routes.\n1. From field `routes`, an array, each elements require \"path\" and \"component\".\n2. From child elements, which have the slot attribute for matching routes.\nIf only the method 1 is used, set `type` to `\"field\"`.\nIf only the method 2 is used, set `type` to `\"slotted\"`.\n`type` defaults to `\"united\"`, which will try method 1, then method 2.\nIf no routes are matched, the default value (no named slot) will be rendered.\n---\n### **Events:**\n - **change**\n### **Methods:**\n - **fieldComponent(query: _string_)** - Get component from routes by query.\n- **slottedComponent(usedRouteTemplate: _string_)** - Get component from slotted elements by query.\n- **collectSlottedRoutes()** - Reset the route tree, clear cache, collect routes from child elements.\n- **collectFieldRoutes(value: _typeof this.routes_)** - Reset the route tree, clear cache, collect routes from value.\n### **Slots:**\n - _default_ - Display slot when there is no match.\n- ***** - Matching slot will be displayed.","attributes":[{"name":"pathname","description":"Current pathname (equals to location.pathname).","values":[]},{"name":"baseURL","description":"Path prefix.","values":[]},{"name":"type","description":"The type of routing sources.\nIf field, it won't collect the slot attribute of the child elements.\nThis property should not be changed after the rendering is complete.","values":[{"name":"united"},{"name":"slotted"},{"name":"field"}]},{"name":"cache","description":"Cache accessed records.\nEmptied at each re-collection.","values":[]}],"references":[]},{"name":"godown-rotate","description":"Rotate Make child elements rotate.\n---\n### **Methods:**\n - **_computeOffset(e: _MouseEvent_): __** - Compute offset.\n```\n`rotateX(${rotateX}rad) rotateY(${rotateY}rad)`\n```","attributes":[],"references":[]},{"name":"godown-range","description":"Range is similar to `<input type=\"range\">`.\nValue accepts number, or array.\nNumber has 1 handle, the array has the number of its elements and the minimum is 2.\n---\n### **Events:**\n - **input**\n- **change**\n### **Methods:**\n \n","attributes":[{"name":"min","description":"Minimum value.","values":[]},{"name":"max","description":"Maximum value.","values":[]},{"name":"step","description":"Sliding step length.","values":[]},{"name":"vertical","description":"Display vertically.","values":[]},{"name":"value","description":"Value, or each of values, will render a handle.\nAccepts number or array of numbers.","values":[]},{"name":"default","description":"The default of `this.value`.","values":[]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]}],"references":[]},{"name":"godown-progress","description":"Progress similar to `<progress>`.\n---\n### **Methods:**\n - **parsePercent(s: _string | number_): __** - Convert s to a percentage without a percent sign.","attributes":[{"name":"max","values":[]},{"name":"min","values":[]},{"name":"value","values":[]}],"references":[]},{"name":"godown-link","description":"Link is used for link jumping.\nSet `type` to `\"push\" `or `\"replace\"`,\nwill invoke the history api and trigger the Router.updateAll.\n---\n","attributes":[{"name":"type","description":"If \"push\", call `history.pushState`.\nIf \"replace\", call `history.replaceState`.\nIf \"normal\", behave like a normal anchor.","values":[{"name":"push"},{"name":"replace"},{"name":"normal"}]},{"name":"href","description":"A element href.","values":[]},{"name":"target","description":"A element target.","values":[{"name":"_blank"},{"name":"_self"},{"name":"_parent"},{"name":"_top"}]}],"references":[]},{"name":"godown-input","description":"Input renders a text input.\n---\n### **Events:**\n - **input**\n- **change**","attributes":[{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-grid","description":"Grid provides gird layout.\n---\n### **Slots:**\n - _default_ - Grid items.","attributes":[{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"columns","description":"CSS property `grid-template-columns`.\nIf columns is numerical, divide columns equally.","values":[]},{"name":"rows","description":"CSS property `grid-template-rows`.\nIf rows is numerical, divide rows equally.","values":[]},{"name":"content","description":"CSS property `place-content` (`align-content justify-content`).","values":[]},{"name":"items","description":"CSS property `place-items` (`align-items justify-items`).","values":[]}],"references":[]},{"name":"godown-form","description":"Form Gets child element key-value object,\nwhich will be nested if the child element is the same as this element.\n---\n","attributes":[{"name":"name","values":[]}],"references":[]},{"name":"godown-flex","description":"Flex provides flex layout.\n---\n### **Slots:**\n - _default_ - Flex items.","attributes":[{"name":"flex-flow","description":"CSS property `flex-flow` (`flex-direction flex-wrap`).","values":[]},{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"content","description":"CSS property `justify-content`.","values":[]},{"name":"items","description":"CSS property `align-items`.","values":[]},{"name":"vertical","description":"If true, set flex-direction to \"column\".","values":[]}],"references":[]},{"name":"godown-dragbox","description":"Dragbox does not extend beyond the range of Dragbox.offsetsWidth and Dragbox.offsetsHeight.\n---\n","attributes":[{"name":"x","description":"Position x.","values":[]},{"name":"y","description":"Position y.","values":[]}],"references":[]},{"name":"godown-divider","description":"Divider similar to `<hr>`.\nThis component does not render content.\n---\n","attributes":[{"name":"vertical","description":"Vertical display.","values":[]}],"references":[]},{"name":"godown-dialog","description":"Dialog similar to `<dialog>`.\nLike dialog, it listens for submit events and closes itself when the target method is \"dialog\".\nIt listens for the keydown event and also closes itself when the key contained in the key is pressed.\n---\n### **Events:**\n - **change**","attributes":[{"name":"direction","description":"Direction of the opening animation.","values":[{"name":"Direction9"}]},{"name":"modal","description":"Enable modal, blocking event penetration.","values":[]},{"name":"key","description":"Close key.","values":[]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-details","description":"Details similar to `<details>`.\n---\n### **Events:**\n - **change** - Fired when the details is toggled.\n### **Slots:**\n - **summary** - Details summary if no `summary` is provided.\n- _default_ - Details content.","attributes":[{"name":"fill","description":"If it is true, the summary event scope will fill the element.","values":[]},{"name":"summary","description":"Summary text.","values":[]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-carousel","description":"Carousel make the content display as a carousel.\nWhen this component is `firstUpdated`,\nclone the first and last element and make the matching element visible when switching index.\nChild elements should maintain the same size.\nIf no width, it will be the width of the first element.\n---\n### **Slots:**\n - _default_ - Carousel items, should maintain the same size.","attributes":[{"name":"index","description":"The index of the element is displayed for the first time.","values":[]},{"name":"autoChange","description":"If autoChange > 0, the rotation will be automated.","values":[]},{"name":"width","description":"Element width.","values":[]}],"references":[]},{"name":"godown-card","description":"Card renders a card.\nThis may be similar to Layout,\nbut it needs to be specified to enable header and footer.\n---\n### **Slots:**\n - _default_ - The main content of the card.\n- **header** - The header of the card.\n- **footer** - The footer of the card.","attributes":[{"name":"footer","values":[]},{"name":"header","values":[]}],"references":[]},{"name":"godown-button","description":"Button renders a button.\nCreate modal animation upon clicking.\nAvailable colors (background): none, black, gray, white, blue, green, red, orange, pink, purple, yellow, teal.\nDefault color is `black`.\nSet the color to `none` to prevent applying styles.\n---\n","attributes":[{"name":"disabled","description":"Whether to disable this element.","values":[]},{"name":"ghost","description":"Display ghost.","values":[]},{"name":"active","description":"Whether this element is active or not.","values":[]},{"name":"round","description":"Display rounded.","values":[]},{"name":"color","description":"The primary color.","values":[{"name":"none"},{"name":"keyof typeof colors"}]},{"name":"content","description":"Content text.","values":[]}],"references":[]},{"name":"godown-breath","description":"Breath render the text with a breathing effect.\nDynamically generate a breathing effect based on the length of the split text.\nIf there is not enough CSS variable, overrun elements will use the.\ngodown was a css library in its earliest days,\nand this is the component version of its first effect.\nInspired by Vercel home page (2023).\n---\n### **Slots:**\n - _default_ - Breathing parts.","attributes":[{"name":"text","description":"Strings or array of strings,\nif array, divided each element into chunks,\notherwise split strings by whitespace.","values":[{"name":"string[]"}]},{"name":"duration","description":"Effect duration, ending in s or ms.","values":[]}],"references":[]},{"name":"godown-avatar","description":"Avatar renders a avatar.\nRenders as an image if it has a src property,\notherwise falls back to name or nameless slot.\n---\n### **Slots:**\n - _default_ - Display content if no `src` or `name` provided.","attributes":[{"name":"src","description":"Image src.","values":[]},{"name":"name","description":"If the image is not available, display name (call Avatar.format).","values":[]},{"name":"round","description":"Display rounded.","values":[]}],"references":[]},{"name":"godown-alert","description":"Alert renders a alert.\nColor defaults to blue.\n---\n### **Events:**\n - **close**\n### **Slots:**\n - _default_ - Alert content.\n- **title** - Alert title.\n- **icon** - Alert icon.","attributes":[{"name":"call","description":"If it is a legal value, the icon and preset color will be rendered.","values":[{"name":"tip"},{"name":"success"},{"name":"info"},{"name":"warning"},{"name":"danger"},{"name":"error"},{"name":"help"},{"name":"deprecated"}]},{"name":"color","description":"The tone of the component.\nOverrides the color of the call.","values":[{"name":""},{"name":"white"},{"name":"black"},{"name":"gray"},{"name":"green"},{"name":"teal"},{"name":"blue"},{"name":"red"},{"name":"purple"},{"name":"orange"},{"name":"yellow"},{"name":"pink"},{"name":"none"}]},{"name":"autoclose","description":"Close delay, if 0, it will not be closed automatically.","values":[]},{"name":"title","description":"The title is bold and the icon height is the same as it.","values":[]},{"name":"content","description":"Content, if zero value, will be rendered as an unnamed slot.","values":[]},{"name":"hideClose","description":"Set true to hide the close button.\nThe behavior may change due to the variant property.","values":[]},{"name":"variant","description":"Alert variant, if set to `blockquote`, the alert will be rendered as a blockquote.\nIf variant is `\"blockquote\"`, hide the close button.","values":[{"name":"blockquote"},{"name":"dark"},{"name":"light"}]}],"references":[]}]}
|
1
|
+
{"version":1.1,"tags":[{"name":"godown-typewriter","description":"Typewriter renders a typewriter effect to text.\n---\n### **Events:**\n ","attributes":[{"name":"text","description":"Raw text.","values":[]},{"name":"stopped","description":"Start immediately after Typewriter.firstUpdated.","values":[]},{"name":"ended","description":"If true, hide the cursor","values":[]},{"name":"max","description":"Maximum random time.","values":[]},{"name":"min","description":"Minimum random time.","values":[]},{"name":"delay","description":"Fixed time.","values":[]},{"name":"index","description":"The index at the beginning.","values":[]}],"references":[]},{"name":"godown-tooltip","description":"Tooltip provide tooltip for slot elements.\nIf it has the tip property, ignore the slot tip.\n---\n### **Events:**\n - **change**\n### **Slots:**\n - **tip** - Tip element if no `tip` provided.\n- _default_ - Content.","attributes":[{"name":"tip","description":"Tip text, if there is a value, the slot will be ignored.","values":[]},{"name":"direction","description":"Direction of opening the tip.","values":[{"name":"Direction8"}]},{"name":"align","description":"Content alignment.","values":[{"name":"center"},{"name":"flex-start"},{"name":"flex-end"},{"name":"start"},{"name":"end"}]},{"name":"propagation","description":"If true, allow penetration of the tip.","values":[]},{"name":"type","description":"How can tips be triggered.\nIf `focus`, element will be focusable, open tip when focused.\nIf `hover`, element will open tip when hovered.","values":[{"name":"hover"},{"name":"focus"}]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-time","description":"Time renders a formatting time.\n---\n","attributes":[{"name":"escape","description":"Escape symbol.","values":[]},{"name":"format","description":"Format strings.","values":[]},{"name":"time","description":"Time.","values":[{"name":"Date"}]},{"name":"timeout","description":"If there is a value, update every gap or timeout.","values":[]},{"name":"gap","description":"The number of milliseconds that change with each update.","values":[]}],"references":[]},{"name":"godown-text","description":"Text renders nowrap text.\n---\n","attributes":[{"name":"underline","description":"Underline behavior.","values":[{"name":"none"},{"name":"hover"},{"name":"active"},{"name":"always"}]},{"name":"clip","description":"Set background-clip to text.","values":[]}],"references":[]},{"name":"godown-switch","description":"Switch renders a switch.\nThe switch is rectangular by default,\nset the round property to rounded switch.\n---\n### **Events:**\n - **input**\n- **change**","attributes":[{"name":"round","description":"Display rounded.","values":[]},{"name":"checked","description":"Whether this element is selected or not.","values":[]},{"name":"disabled","description":"Disable this element.","values":[]},{"name":"default","description":"Default checked state.","values":[]},{"name":"value","description":"Input value.","values":[]},{"name":"autocomplete","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]}],"references":[]},{"name":"godown-split-input","description":"Split renders multiple input boxes.\nInput: will move the focus box backward until the complete input from start to end.\nDelete: will move the focus box forward until the first and no inputs for each.\n---\n### **Events:**\n - **input**\n- **change**\n### **Methods:**\n ","attributes":[{"name":"len","description":"The number of input boxes.","values":[]},{"name":"index","description":"Focus index.","values":[]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-skeleton","description":"Skeleton renders a skeleton screen.\n---\n### **Slots:**\n - **loading** - The content if loading is true.\n- _default_ - The content if loading is false.","attributes":[{"name":"type","description":"If \"image\", render a image placeholder.","values":[{"name":"text"},{"name":"image"}]},{"name":"animation","description":"Animation type.\nopacity animation only effect on slotted element and image icon.","values":[{"name":"position"},{"name":"opacity"}]}],"references":[]},{"name":"godown-select","description":"Select is similar to `<select>`.\nElements with the value attribute/property can be used as options.\nThe checked attribute will be added to the selected element.\nMulti-selected state looks the same as single-selected.\nInput will filter the element.\n---\n### **Events:**\n - **change**\n- **input**\n### **Slots:**\n - _default_ - Options.","attributes":[{"name":"text","description":"Selected texts.","values":[]},{"name":"direction","values":[{"name":"top"},{"name":"bottom"}]},{"name":"multiple","values":[]},{"name":"visible","values":[]},{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-router","description":"Router has basic routing control.\nTo switch routes, use `router-link component`.\nIt has two methods to collect routes.\n1. From field `routes`, an array, each elements require \"path\" and \"component\".\n2. From child elements, which have the slot attribute for matching routes.\nIf only the method 1 is used, set `type` to `\"field\"`.\nIf only the method 2 is used, set `type` to `\"slotted\"`.\n`type` defaults to `\"united\"`, which will try method 1, then method 2.\nIf no routes are matched, the default value (no named slot) will be rendered.\n---\n### **Events:**\n - **change**\n### **Methods:**\n - **fieldComponent(query: _string_): _unknown_** - Get component from routes by query.\n- **slottedComponent(usedRouteTemplate: _string_): _TemplateResult<1>_** - Get component from slotted elements by query.\n- **collectSlottedRoutes(): _void_** - Reset the route tree, clear cache, collect routes from child elements.\n- **collectFieldRoutes(value: _typeof this.routes_): _void_** - Reset the route tree, clear cache, collect routes from value.\n### **Slots:**\n - _default_ - Display slot when there is no match.\n- ***** - Matching slot will be displayed.","attributes":[{"name":"pathname","description":"Current pathname (equals to location.pathname).","values":[]},{"name":"baseURL","description":"Path prefix.","values":[]},{"name":"type","description":"The type of routing sources.\nIf field, it won't collect the slot attribute of the child elements.\nThis property should not be changed after the rendering is complete.","values":[{"name":"united"},{"name":"slotted"},{"name":"field"}]},{"name":"cache","description":"Cache accessed records.\nEmptied at each re-collection.","values":[]}],"references":[]},{"name":"godown-rotate","description":"Rotate Make child elements rotate.\n---\n### **Methods:**\n - **_computeOffset(e: _MouseEvent_): __** - Compute offset.\n```\n`rotateX(${rotateX}rad) rotateY(${rotateY}rad)`\n```","attributes":[],"references":[]},{"name":"godown-range","description":"Range is similar to `<input type=\"range\">`.\nValue accepts number, or array.\nNumber has 1 handle, the array has the number of its elements and the minimum is 2.\n---\n### **Events:**\n - **input**\n- **change**\n### **Methods:**\n \n","attributes":[{"name":"min","description":"Minimum value.","values":[]},{"name":"max","description":"Maximum value.","values":[]},{"name":"step","description":"Sliding step length.","values":[]},{"name":"vertical","description":"Display vertically.","values":[]},{"name":"value","description":"Value, or each of values, will render a handle.\nAccepts number or array of numbers.","values":[]},{"name":"default","description":"The default of `this.value`.","values":[]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]}],"references":[]},{"name":"godown-progress","description":"Progress similar to `<progress>`.\n---\n### **Methods:**\n - **parsePercent(s: _string | number_): __** - Convert s to a percentage without a percent sign.","attributes":[{"name":"max","values":[]},{"name":"min","values":[]},{"name":"value","values":[]}],"references":[]},{"name":"godown-link","description":"Link is used for link jumping.\nSet `type` to `\"push\" `or `\"replace\"`,\nwill invoke the history api and trigger the Router.updateAll.\n---\n","attributes":[{"name":"type","description":"If \"push\", call `history.pushState`.\nIf \"replace\", call `history.replaceState`.\nIf \"normal\", behave like a normal anchor.","values":[{"name":"push"},{"name":"replace"},{"name":"normal"}]},{"name":"href","description":"A element href.","values":[]},{"name":"target","description":"A element target.","values":[{"name":"_blank"},{"name":"_self"},{"name":"_parent"},{"name":"_top"}]}],"references":[]},{"name":"godown-input","description":"Input renders a text input.\n---\n### **Events:**\n - **input**\n- **change**","attributes":[{"name":"variant","description":"If outline, the outline is always present.","values":[{"name":"default"},{"name":"outline"}]},{"name":"autocomplete","values":[]},{"name":"disabled","values":[]},{"name":"type","values":[{"name":"InputType"}]},{"name":"placeholder","values":[]},{"name":"name","values":[]},{"name":"value","values":[]},{"name":"default","description":"default property records the default or initial value and is used to reset the input.","values":[]}],"references":[]},{"name":"godown-grid","description":"Grid provides gird layout.\n---\n### **Slots:**\n - _default_ - Grid items.","attributes":[{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"columns","description":"CSS property `grid-template-columns`.\nIf columns is numerical, divide columns equally.","values":[]},{"name":"rows","description":"CSS property `grid-template-rows`.\nIf rows is numerical, divide rows equally.","values":[]},{"name":"content","description":"CSS property `place-content` (`align-content justify-content`).","values":[]},{"name":"items","description":"CSS property `place-items` (`align-items justify-items`).","values":[]}],"references":[]},{"name":"godown-form","description":"Form Gets child element key-value object,\nwhich will be nested if the child element is the same as this element.\n---\n","attributes":[{"name":"name","values":[]}],"references":[]},{"name":"godown-flex","description":"Flex provides flex layout.\n---\n### **Slots:**\n - _default_ - Flex items.","attributes":[{"name":"flex-flow","description":"CSS property `flex-flow` (`flex-direction flex-wrap`).","values":[]},{"name":"gap","description":"CSS property `gap`.","values":[]},{"name":"content","description":"CSS property `justify-content`.","values":[]},{"name":"items","description":"CSS property `align-items`.","values":[]},{"name":"vertical","description":"If true, set flex-direction to \"column\".","values":[]}],"references":[]},{"name":"godown-dragbox","description":"Dragbox does not extend beyond the range of Dragbox.offsetsWidth and Dragbox.offsetsHeight.\n---\n","attributes":[{"name":"x","description":"Position x.","values":[]},{"name":"y","description":"Position y.","values":[]}],"references":[]},{"name":"godown-divider","description":"Divider similar to `<hr>`.\n---\n","attributes":[{"name":"vertical","description":"Vertical display.","values":[]}],"references":[]},{"name":"godown-dialog","description":"Dialog similar to `<dialog>`.\nLike dialog, it listens for submit events and closes itself when the target method is \"dialog\".\nIt listens for the keydown event and also closes itself when the key contained in the key is pressed.\n---\n### **Events:**\n - **change**","attributes":[{"name":"direction","description":"Direction of the opening animation.","values":[{"name":"Direction9"}]},{"name":"modal","description":"Enable modal, blocking event penetration.","values":[]},{"name":"key","description":"Close key.","values":[]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-details","description":"Details similar to `<details>`.\n---\n### **Events:**\n - **change** - Fired when the details is toggled.\n### **Slots:**\n - **summary** - Details summary if no `summary` is provided.\n- _default_ - Details content.","attributes":[{"name":"fill","description":"If it is true, the summary event scope will fill the element.","values":[]},{"name":"summary","description":"Summary text.","values":[]},{"name":"open","description":"Open the content.","values":[]}],"references":[]},{"name":"godown-carousel","description":"Carousel make the content display as a carousel.\nWhen this component is `firstUpdated`,\nclone the first and last element and make the matching element visible when switching index.\nChild elements should maintain the same size.\nIf no width, it will be the width of the first element.\n---\n### **Slots:**\n - _default_ - Carousel items, should maintain the same size.","attributes":[{"name":"index","description":"The index of the element is displayed for the first time.","values":[]},{"name":"autoChange","description":"If autoChange > 0, the rotation will be automated.","values":[]},{"name":"width","description":"Element width.","values":[]}],"references":[]},{"name":"godown-card","description":"Card renders a card.\nThis may be similar to Layout,\nbut it needs to be specified to enable header and footer.\n---\n### **Slots:**\n - _default_ - The main content of the card.\n- **header** - The header of the card.\n- **footer** - The footer of the card.","attributes":[{"name":"footer","values":[]},{"name":"header","values":[]}],"references":[]},{"name":"godown-button","description":"Button renders a button.\nCreate modal animation upon clicking.\nAvailable colors (background): none, black, gray, white, blue, green, red, orange, pink, purple, yellow, teal.\nDefault color is `black`.\nSet the color to `none` to prevent applying styles.\n---\n","attributes":[{"name":"disabled","description":"Whether to disable this element.","values":[]},{"name":"ghost","description":"Display ghost.","values":[]},{"name":"active","description":"Whether this element is active or not.","values":[]},{"name":"round","description":"Display rounded.","values":[]},{"name":"color","description":"The primary color.","values":[{"name":"none"},{"name":"keyof typeof colors"}]},{"name":"content","description":"Content text.","values":[]}],"references":[]},{"name":"godown-breath","description":"Breath render the text with a breathing effect.\nDynamically generate a breathing effect based on the length of the split text.\nIf there is not enough CSS variable, overrun elements will use the.\ngodown was a css library in its earliest days,\nand this is the component version of its first effect.\nInspired by Vercel home page (2023).\n---\n### **Slots:**\n - _default_ - Breathing parts.","attributes":[{"name":"text","description":"Strings or array of strings,\nif array, divided each element into chunks,\notherwise split strings by whitespace.","values":[{"name":"string[]"}]},{"name":"duration","description":"Effect duration, ending in s or ms.","values":[]}],"references":[]},{"name":"godown-avatar","description":"Avatar renders a avatar.\nRenders as an image if it has a src property,\notherwise falls back to name or nameless slot.\n---\n### **Slots:**\n - _default_ - Display content if no `src` or `name` provided.","attributes":[{"name":"src","description":"Image src.","values":[]},{"name":"name","description":"If the image is not available, display name (call Avatar.format).","values":[]},{"name":"round","description":"Display rounded.","values":[]}],"references":[]},{"name":"godown-alert","description":"Alert renders a alert.\nColor defaults to blue.\n---\n### **Events:**\n - **close**\n### **Slots:**\n - _default_ - Alert content.\n- **title** - Alert title.\n- **icon** - Alert icon.","attributes":[{"name":"call","description":"If it is a legal value, the icon and preset color will be rendered.","values":[{"name":"tip"},{"name":"success"},{"name":"info"},{"name":"warning"},{"name":"danger"},{"name":"error"},{"name":"help"},{"name":"deprecated"}]},{"name":"color","description":"The tone of the component.\nOverrides the color of the call.","values":[{"name":""},{"name":"white"},{"name":"black"},{"name":"gray"},{"name":"green"},{"name":"teal"},{"name":"blue"},{"name":"red"},{"name":"purple"},{"name":"orange"},{"name":"yellow"},{"name":"pink"},{"name":"none"}]},{"name":"autoclose","description":"Close delay, if 0, it will not be closed automatically.","values":[]},{"name":"title","description":"The title is bold and the icon height is the same as it.","values":[]},{"name":"content","description":"Content, if zero value, will be rendered as an unnamed slot.","values":[]},{"name":"hideClose","description":"Set true to hide the close button.\nThe behavior may change due to the variant property.","values":[]},{"name":"variant","description":"Alert variant, if set to `blockquote`, the alert will be rendered as a blockquote.\nIf variant is `\"blockquote\"`, hide the close button.","values":[{"name":"blockquote"},{"name":"dark"},{"name":"light"}]}],"references":[]}]}
|