godown 3.0.0-canary.14 → 3.0.0-canary.15
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/components/alert.js +1 -1
- package/components/alert.js.map +1 -1
- package/components/avatar.js.map +1 -1
- package/components/breath.d.ts +2 -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 +1 -1
- package/components/button.d.ts.map +1 -1
- package/components/card.d.ts.map +1 -1
- package/components/card.js.map +1 -1
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +0 -1
- 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 +1 -1
- package/components/dialog.d.ts.map +1 -1
- package/components/dragbox.d.ts +1 -1
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js.map +1 -1
- package/components/flex.d.ts.map +1 -1
- package/components/flex.js.map +1 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js.map +1 -1
- package/components/input.js.map +1 -1
- package/components/layout.d.ts.map +1 -1
- package/components/layout.js.map +1 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts.map +1 -1
- package/components/range.js.map +1 -1
- package/components/router.d.ts +3 -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 +1 -1
- package/components/select.d.ts.map +1 -1
- package/components/select.js.map +1 -1
- package/components/skeleton.js.map +1 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/components/text.d.ts.map +1 -1
- package/components/text.js.map +1 -1
- package/components/time.d.ts +1 -1
- package/components/time.d.ts.map +1 -1
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js.map +1 -1
- package/components/typewriter.d.ts +1 -1
- package/components/typewriter.d.ts.map +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-openable.d.ts +1 -1
- package/core/super-openable.d.ts.map +1 -1
- package/custom-elements.json +1 -1
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +5 -7
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +3 -5
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/breath.d.ts +2 -2
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +13 -20
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +1 -1
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +1 -1
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +1 -5
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +4 -10
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +0 -1
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +14 -23
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +1 -1
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/divider.js +22 -22
- package/dev/components/divider.js.map +1 -1
- package/dev/components/dragbox.d.ts +1 -1
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +2 -1
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/flex.d.ts.map +1 -1
- package/dev/components/flex.js +1 -1
- package/dev/components/flex.js.map +1 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +2 -2
- package/dev/components/grid.js.map +1 -1
- package/dev/components/input.js +12 -12
- package/dev/components/input.js.map +1 -1
- package/dev/components/layout.d.ts.map +1 -1
- package/dev/components/layout.js +3 -7
- package/dev/components/layout.js.map +1 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +38 -38
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +6 -9
- package/dev/components/range.js.map +1 -1
- package/dev/components/router.d.ts +3 -5
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +10 -18
- package/dev/components/router.js.map +1 -1
- package/dev/components/select.d.ts +1 -1
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +23 -21
- package/dev/components/select.js.map +1 -1
- package/dev/components/skeleton.d.ts.map +1 -1
- package/dev/components/skeleton.js +3 -2
- package/dev/components/skeleton.js.map +1 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +7 -6
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +6 -9
- package/dev/components/switch.js.map +1 -1
- package/dev/components/text.d.ts.map +1 -1
- package/dev/components/text.js +2 -6
- package/dev/components/text.js.map +1 -1
- package/dev/components/time.d.ts +1 -1
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +1 -3
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +8 -11
- package/dev/components/tooltip.js.map +1 -1
- package/dev/components/typewriter.d.ts +1 -1
- package/dev/components/typewriter.d.ts.map +1 -1
- 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 +1 -1
- 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 +34 -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/package.json +3 -3
- package/src/components/alert.ts +5 -7
- package/src/components/avatar.ts +3 -5
- package/src/components/breath.ts +17 -22
- package/src/components/button.ts +2 -2
- package/src/components/card.ts +1 -5
- package/src/components/carousel.ts +4 -10
- package/src/components/details.ts +14 -23
- package/src/components/dialog.ts +1 -1
- package/src/components/divider.ts +25 -25
- package/src/components/dragbox.ts +3 -2
- package/src/components/flex.ts +4 -2
- package/src/components/grid.ts +5 -3
- package/src/components/input.ts +12 -12
- package/src/components/layout.ts +3 -11
- package/src/components/progress.ts +41 -39
- package/src/components/range.ts +6 -11
- package/src/components/router.ts +14 -14
- package/src/components/select.ts +24 -22
- package/src/components/skeleton.ts +3 -2
- package/src/components/split.ts +12 -8
- package/src/components/switch.ts +6 -9
- package/src/components/text.ts +5 -7
- package/src/components/time.ts +2 -4
- package/src/components/tooltip.ts +8 -13
- package/src/components/typewriter.ts +5 -3
- package/src/core/global-style.ts +2 -2
- package/src/core/super-anchor.ts +23 -19
- package/src/core/super-input.ts +35 -35
- package/src/core/super-openable.ts +1 -1
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
package/src/components/select.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { HandlerEvent } from "@godown/element";
|
1
|
+
import type { HandlerEvent } from "@godown/element";
|
2
2
|
import { godown } from "@godown/element/decorators/godown.js";
|
3
3
|
import { part } from "@godown/element/decorators/part.js";
|
4
4
|
import { styles } from "@godown/element/decorators/styles.js";
|
@@ -105,34 +105,36 @@ class Select extends Input {
|
|
105
105
|
private _store: { value: string; text: string; }[] = [];
|
106
106
|
|
107
107
|
protected render(): TemplateResult<1> {
|
108
|
-
return html`<div
|
108
|
+
return html`<div
|
109
|
+
part="root"
|
110
|
+
${
|
109
111
|
attr({
|
110
112
|
...this.observedRecord,
|
111
113
|
direction: this.direction || this.autoDirection,
|
112
114
|
})
|
113
|
-
}
|
114
|
-
|
115
|
+
}
|
116
|
+
class="input-field"
|
117
|
+
>
|
118
|
+
${[
|
115
119
|
this._renderPrefix(),
|
116
120
|
html`<input
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
121
|
+
part="input"
|
122
|
+
dir="${ifDefined(this.dir)}"
|
123
|
+
id="${this.makeId}"
|
124
|
+
.value="${this.text}"
|
125
|
+
type="${this.type}"
|
126
|
+
placeholder="${this.placeholder || nothing}"
|
127
|
+
?autofocus="${this.autofocus}"
|
128
|
+
autocapitalize="${this.autocapitalize || nothing}"
|
129
|
+
autocomplete="${this.autocomplete || nothing}"
|
130
|
+
?disabled="${this.disabled}"
|
131
|
+
@focus="${this._handleFocus}"
|
132
|
+
@input="${this._handleInput}"
|
133
|
+
>`,
|
130
134
|
html`<label for="${this.makeId}" part="suffix">
|
131
|
-
|
132
|
-
|
133
|
-
html`<label for="${this.makeId}" part="content">
|
134
|
-
${htmlSlot()}
|
135
|
-
</label>`,
|
135
|
+
<i part="icon">${svgCaretDown()}</i>
|
136
|
+
</label>`,
|
137
|
+
html`<label for="${this.makeId}" part="content"> ${htmlSlot()} </label>`,
|
136
138
|
]}
|
137
139
|
</div>`;
|
138
140
|
}
|
@@ -111,8 +111,9 @@ class Skeleton extends GlobalStyle {
|
|
111
111
|
return htmlSlot();
|
112
112
|
}
|
113
113
|
return html`<div part="root" ${attr(this.observedRecord)}>
|
114
|
-
|
115
|
-
|
114
|
+
${this.type === "image" ? iconPhoto() : ""}
|
115
|
+
${htmlSlot("loading")}
|
116
|
+
</div>`;
|
116
117
|
}
|
117
118
|
}
|
118
119
|
|
package/src/components/split.ts
CHANGED
@@ -99,12 +99,17 @@ class Split extends SuperInput {
|
|
99
99
|
|
100
100
|
protected render(): TemplateResult<1> {
|
101
101
|
return html`<div part="root" ${attr(this.observedRecord)}>
|
102
|
-
|
103
|
-
loop(
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
102
|
+
${
|
103
|
+
loop(
|
104
|
+
this.len,
|
105
|
+
(index: number) =>
|
106
|
+
html`<span
|
107
|
+
part="input-box"
|
108
|
+
@click="${this.disabled ? null : () => this.focusAt(index)}"
|
109
|
+
class="${classList({ focus: this.current === index }) || nothing}"
|
110
|
+
>${this.currentValue[index]}</span
|
111
|
+
>`,
|
112
|
+
)
|
108
113
|
}
|
109
114
|
<input
|
110
115
|
part="input"
|
@@ -115,8 +120,7 @@ class Split extends SuperInput {
|
|
115
120
|
/* Ensure that input always has a value of length this.len */
|
116
121
|
this.value.padStart(this.len, " ")}"
|
117
122
|
>
|
118
|
-
</div>
|
119
|
-
`;
|
123
|
+
</div> `;
|
120
124
|
}
|
121
125
|
|
122
126
|
connectedCallback(): void {
|
package/src/components/switch.ts
CHANGED
@@ -40,7 +40,7 @@ const cssScope = scopePrefix(protoName);
|
|
40
40
|
}
|
41
41
|
|
42
42
|
[part=root],
|
43
|
-
|
43
|
+
[part=handle] {
|
44
44
|
transition: var(${cssScope}-transition);
|
45
45
|
}
|
46
46
|
|
@@ -50,14 +50,14 @@ const cssScope = scopePrefix(protoName);
|
|
50
50
|
height: inherit;
|
51
51
|
}
|
52
52
|
|
53
|
-
input {
|
53
|
+
[part=input] {
|
54
54
|
opacity: 0;
|
55
55
|
width: 100%;
|
56
56
|
height: 100%;
|
57
57
|
appearance: none;
|
58
58
|
}
|
59
59
|
|
60
|
-
|
60
|
+
[part=handle] {
|
61
61
|
height: 100%;
|
62
62
|
display: inline-flex;
|
63
63
|
align-items: center;
|
@@ -74,7 +74,7 @@ const cssScope = scopePrefix(protoName);
|
|
74
74
|
background: var(${cssGlobalVars.passive});
|
75
75
|
}
|
76
76
|
|
77
|
-
:host([checked])
|
77
|
+
:host([checked]) [part=handle] {
|
78
78
|
left: 50%;
|
79
79
|
}
|
80
80
|
|
@@ -86,7 +86,7 @@ const cssScope = scopePrefix(protoName);
|
|
86
86
|
background: var(${cssGlobalVars.passive});
|
87
87
|
}
|
88
88
|
|
89
|
-
.round
|
89
|
+
.round [part=handle] {
|
90
90
|
--size: var(${cssScope}-handle-size);
|
91
91
|
border-radius: 100%;
|
92
92
|
background: var(--godown--input-control);
|
@@ -135,10 +135,7 @@ class Switch extends SuperInput {
|
|
135
135
|
protected _input: HTMLInputElement;
|
136
136
|
|
137
137
|
protected render(): TemplateResult<1> {
|
138
|
-
return html`<div part="root"
|
139
|
-
${attr(this.observedRecord)}
|
140
|
-
class="${this.round ? "round" : "rect"}"
|
141
|
-
>
|
138
|
+
return html`<div part="root" ${attr(this.observedRecord)} class="${this.round ? "round" : "rect"}">
|
142
139
|
<input
|
143
140
|
part="input"
|
144
141
|
@change="${this._handleChange}"
|
package/src/components/text.ts
CHANGED
@@ -18,7 +18,8 @@ const cssScope = scopePrefix(protoName);
|
|
18
18
|
* @category display
|
19
19
|
*/
|
20
20
|
@godown(protoName)
|
21
|
-
@styles(
|
21
|
+
@styles(
|
22
|
+
css`
|
22
23
|
:host {
|
23
24
|
${cssScope}--color: currentColor;
|
24
25
|
${cssScope}--color-hover: currentColor;
|
@@ -65,7 +66,8 @@ const cssScope = scopePrefix(protoName);
|
|
65
66
|
background-clip: text;
|
66
67
|
-webkit-background-clip: text;
|
67
68
|
}
|
68
|
-
|
69
|
+
`,
|
70
|
+
)
|
69
71
|
class Text extends GlobalStyle {
|
70
72
|
/**
|
71
73
|
* Underline behavior.
|
@@ -80,11 +82,7 @@ class Text extends GlobalStyle {
|
|
80
82
|
clip = false;
|
81
83
|
|
82
84
|
protected render(): TemplateResult<1> {
|
83
|
-
return html`<span
|
84
|
-
part="root"
|
85
|
-
${attr(this.observedRecord)}
|
86
|
-
class="${classList(this.underline)}"
|
87
|
-
>
|
85
|
+
return html`<span part="root" ${attr(this.observedRecord)} class="${classList(this.underline)}">
|
88
86
|
${htmlSlot()}
|
89
87
|
</span>`;
|
90
88
|
}
|
package/src/components/time.ts
CHANGED
@@ -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 fmtime from "fmtime";
|
5
|
-
import { css, html, type PropertyValues, TemplateResult } from "lit";
|
5
|
+
import { css, html, type PropertyValues, type TemplateResult } from "lit";
|
6
6
|
import { property } from "lit/decorators.js";
|
7
7
|
|
8
8
|
import { GlobalStyle } from "../core/global-style.js";
|
@@ -50,9 +50,7 @@ class Time extends GlobalStyle {
|
|
50
50
|
protected timeoutId: number;
|
51
51
|
|
52
52
|
protected render(): TemplateResult<1> {
|
53
|
-
return html`<span part="root" ${attr(this.observedRecord)}>
|
54
|
-
${fmtime(this.format, this.time, this.escape)}
|
55
|
-
</span>`;
|
53
|
+
return html`<span part="root" ${attr(this.observedRecord)}> ${fmtime(this.format, this.time, this.escape)} </span>`;
|
56
54
|
}
|
57
55
|
|
58
56
|
protected firstUpdated(): void {
|
@@ -126,23 +126,18 @@ class Tooltip extends SuperOpenable {
|
|
126
126
|
protected render(): TemplateResult<1> {
|
127
127
|
const align = Tooltip.aligns[this.align] || "inherit";
|
128
128
|
const isFocusable = this.type === "focus";
|
129
|
-
return html`<div
|
129
|
+
return html`<div
|
130
130
|
part="root"
|
131
131
|
${attr(this.observedRecord)}
|
132
132
|
tabindex="${isFocusable ? 0 : -1}"
|
133
|
-
@focus="${isFocusable ? () => this.open = true : null}"
|
134
|
-
@blur="${isFocusable ? () => this.open = false : null}"
|
135
|
-
@mouseenter="${isFocusable ? null : () => this.open = true}"
|
136
|
-
@mouseleave="${isFocusable ? null : () => this.open = false}"
|
137
|
-
style="justify-content:${align};align-items:${align}"
|
133
|
+
@focus="${isFocusable ? () => (this.open = true) : null}"
|
134
|
+
@blur="${isFocusable ? () => (this.open = false) : null}"
|
135
|
+
@mouseenter="${isFocusable ? null : () => (this.open = true)}"
|
136
|
+
@mouseleave="${isFocusable ? null : () => (this.open = false)}"
|
137
|
+
style="justify-content:${align};align-items:${align}"
|
138
|
+
>
|
138
139
|
${htmlSlot()}
|
139
|
-
<div part="tip">
|
140
|
-
${
|
141
|
-
this.tip
|
142
|
-
? html`<span class="passive">${this.tip}</span>`
|
143
|
-
: htmlSlot("tip")
|
144
|
-
}
|
145
|
-
</div>
|
140
|
+
<div part="tip">${this.tip ? html`<span class="passive">${this.tip}</span>` : htmlSlot("tip")}</div>
|
146
141
|
</div>`;
|
147
142
|
}
|
148
143
|
}
|
@@ -4,7 +4,7 @@ import { attr } from "@godown/element/directives/attr.js";
|
|
4
4
|
import { classList } from "@godown/element/directives/class-list.js";
|
5
5
|
import { htmlSlot } from "@godown/element/directives/html-slot.js";
|
6
6
|
import { random } from "@godown/element/tools/lib.js";
|
7
|
-
import { css, html, type PropertyValueMap, TemplateResult } from "lit";
|
7
|
+
import { css, html, type PropertyValueMap, type TemplateResult } from "lit";
|
8
8
|
import { property, query, state } from "lit/decorators.js";
|
9
9
|
|
10
10
|
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
@@ -18,7 +18,8 @@ const cssScope = scopePrefix(protoName);
|
|
18
18
|
* @category effect
|
19
19
|
*/
|
20
20
|
@godown(protoName)
|
21
|
-
@styles(
|
21
|
+
@styles(
|
22
|
+
css`
|
22
23
|
:host {
|
23
24
|
${cssScope}--cursor-width: .05em;
|
24
25
|
}
|
@@ -50,7 +51,8 @@ const cssScope = scopePrefix(protoName);
|
|
50
51
|
.hidden {
|
51
52
|
visibility: hidden;
|
52
53
|
}
|
53
|
-
|
54
|
+
`,
|
55
|
+
)
|
54
56
|
class Typewriter extends GlobalStyle {
|
55
57
|
/**
|
56
58
|
* Raw text.
|
package/src/core/global-style.ts
CHANGED
@@ -4,7 +4,7 @@ import GodownElement from "@godown/element";
|
|
4
4
|
import GodownConfig from "@godown/element/config.js";
|
5
5
|
import { joinProperties } from "@godown/element/tools/css.js";
|
6
6
|
import { trim } from "@godown/element/tools/lib.js";
|
7
|
-
import { css, CSSResult, unsafeCSS } from "lit";
|
7
|
+
import { css, type CSSResult, unsafeCSS } from "lit";
|
8
8
|
|
9
9
|
GodownElement.godownConfig ||= new GodownConfig();
|
10
10
|
|
@@ -18,7 +18,7 @@ export function scopePrefix(scope: string, len = 1): CSSResult {
|
|
18
18
|
}
|
19
19
|
|
20
20
|
export function variablePrefix(variable: string): CSSResult {
|
21
|
-
return unsafeCSS(
|
21
|
+
return unsafeCSS(`--${variable}`);
|
22
22
|
}
|
23
23
|
|
24
24
|
export const cssGlobalVars: {
|
package/src/core/super-anchor.ts
CHANGED
@@ -7,25 +7,27 @@ import { ifDefined } from "lit/directives/if-defined.js";
|
|
7
7
|
|
8
8
|
import { GlobalStyle } from "./global-style.js";
|
9
9
|
|
10
|
-
@styles(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
@styles(
|
11
|
+
css`
|
12
|
+
:host {
|
13
|
+
display: inline-block;
|
14
|
+
color: currentColor;
|
15
|
+
text-decoration: none;
|
16
|
+
cursor: default;
|
17
|
+
}
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
:host([href]) {
|
20
|
+
cursor: pointer;
|
21
|
+
}
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
[part=root] {
|
24
|
+
width: 100%;
|
25
|
+
color: inherit;
|
26
|
+
display: inline-block;
|
27
|
+
text-decoration: inherit;
|
28
|
+
}
|
29
|
+
`,
|
30
|
+
)
|
29
31
|
class SuperAnchor extends GlobalStyle {
|
30
32
|
/**
|
31
33
|
* A element href.
|
@@ -39,11 +41,13 @@ class SuperAnchor extends GlobalStyle {
|
|
39
41
|
target: "_blank" | "_self" | "_parent" | "_top" = "_self";
|
40
42
|
|
41
43
|
protected render(): TemplateResult<1> {
|
42
|
-
return html`<a
|
44
|
+
return html`<a
|
45
|
+
part="root"
|
43
46
|
${attr(this.observedRecord)}
|
44
47
|
href="${ifDefined(this.href)}"
|
45
48
|
target="${this.target}"
|
46
|
-
@click=${this._handleClick}
|
49
|
+
@click=${this._handleClick}
|
50
|
+
>
|
47
51
|
${htmlSlot()}
|
48
52
|
</a>`;
|
49
53
|
}
|
package/src/core/super-input.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { part } from "@godown/element/decorators/part.js";
|
2
2
|
import { styles } from "@godown/element/decorators/styles.js";
|
3
3
|
import { htmlSlot } from "@godown/element/directives/index.js";
|
4
|
-
import {
|
4
|
+
import type { HandlerEvent } from "@godown/element/element.js";
|
5
5
|
import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
|
6
6
|
import { css, html, type TemplateResult } from "lit";
|
7
7
|
import { property } from "lit/decorators.js";
|
@@ -9,46 +9,46 @@ import { property } from "lit/decorators.js";
|
|
9
9
|
import { cssGlobalVars, GlobalStyle } from "./global-style.js";
|
10
10
|
|
11
11
|
const fieldStyle = css`
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
.input-field {
|
13
|
+
display: flex;
|
14
|
+
position: relative;
|
15
|
+
align-items: center;
|
16
|
+
border-radius: inherit;
|
17
|
+
height: inherit;
|
18
|
+
}
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
.input-field [part=input] {
|
21
|
+
background: transparent;
|
22
|
+
height: 100%;
|
23
|
+
width: 100%;
|
24
|
+
color: inherit;
|
25
|
+
padding: 0 var(${cssGlobalVars.input}-space);
|
26
|
+
}
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
.input-field:focus-within,
|
29
|
+
.input-field.outline {
|
30
|
+
box-shadow: var(${cssGlobalVars.input}-box-shadow);
|
31
|
+
}
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
.input-field [part=icon] {
|
34
|
+
display: flex;
|
35
|
+
align-items: center;
|
36
|
+
justify-content: center;
|
37
|
+
}
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
.input-field [part=prefix],
|
40
|
+
.input-field [part=suffix] {
|
41
|
+
height: 100%;
|
42
|
+
display: flex;
|
43
|
+
}
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
.input-field [part=suffix] [part=icon] {
|
46
|
+
padding-inline-end: var(${cssGlobalVars.input}-space);
|
47
|
+
}
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
.input-field [part=prefix] [part=icon] {
|
50
|
+
padding-inline-start: var(${cssGlobalVars.input}-space);
|
51
|
+
}
|
52
52
|
`;
|
53
53
|
|
54
54
|
const inputStyle = css`
|
@@ -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":"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","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":"suppress","description":"Suppress the update of the Router.","values":[]},{"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":[]}]}
|
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","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(query: _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":"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":"suppress","description":"Suppress the update of the Router.","values":[]},{"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":[]}]}
|