godown 3.0.1 → 3.1.0
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/build/godown+lit.iife.js +12 -12
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +12 -12
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +12 -12
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +10 -10
- package/build/godown.js +10 -10
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +10 -10
- package/build/godown.umd.js.map +1 -1
- package/components/alert.d.ts +2 -0
- package/components/alert.d.ts.map +1 -1
- package/components/alert.js +1 -1
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +2 -2
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +1 -1
- package/components/badge.d.ts.map +1 -1
- package/components/badge.js.map +1 -1
- package/components/breath.d.ts +3 -3
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -1
- package/components/breath.js.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/carousel.d.ts +4 -4
- package/components/carousel.d.ts.map +1 -1
- package/components/carousel.js +1 -1
- package/components/carousel.js.map +1 -1
- package/components/details.d.ts +1 -1
- package/components/details.js +1 -1
- package/components/details.js.map +1 -1
- package/components/dialog.d.ts +6 -5
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/dragbox.d.ts +5 -5
- package/components/dragbox.d.ts.map +1 -1
- package/components/dragbox.js +1 -1
- package/components/dragbox.js.map +1 -1
- package/components/grid.d.ts.map +1 -1
- package/components/grid.js +1 -1
- package/components/grid.js.map +1 -1
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +4 -4
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -1
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +1 -1
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js.map +1 -1
- package/components/router.d.ts +1 -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 +1 -1
- package/components/select.js.map +1 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/time.d.ts.map +1 -1
- package/components/time.js +1 -1
- package/components/time.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 +1 -0
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -1
- package/core/super-input.d.ts +2 -0
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +1 -0
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -1
- package/custom-elements.json +1 -1
- package/dev/components/alert.d.ts +2 -0
- package/dev/components/alert.d.ts.map +1 -1
- package/dev/components/alert.js +5 -0
- package/dev/components/alert.js.map +1 -1
- package/dev/components/avatar.d.ts +2 -2
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +1 -1
- package/dev/components/badge.d.ts.map +1 -1
- package/dev/components/badge.js.map +1 -1
- package/dev/components/breath.d.ts +3 -3
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +6 -4
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +1 -4
- package/dev/components/button.js.map +1 -1
- package/dev/components/carousel.d.ts +4 -4
- package/dev/components/carousel.d.ts.map +1 -1
- package/dev/components/carousel.js +7 -7
- package/dev/components/carousel.js.map +1 -1
- package/dev/components/details.d.ts +1 -1
- package/dev/components/details.js +1 -1
- package/dev/components/dialog.d.ts +6 -5
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +10 -16
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/dragbox.d.ts +5 -5
- package/dev/components/dragbox.d.ts.map +1 -1
- package/dev/components/dragbox.js +10 -10
- package/dev/components/dragbox.js.map +1 -1
- package/dev/components/grid.d.ts.map +1 -1
- package/dev/components/grid.js +3 -2
- package/dev/components/grid.js.map +1 -1
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +14 -3
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +4 -4
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +10 -10
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +1 -1
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/router.d.ts +1 -5
- package/dev/components/router.d.ts.map +1 -1
- package/dev/components/router.js +4 -6
- 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 +6 -6
- package/dev/components/select.js.map +1 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js.map +1 -1
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js +3 -2
- package/dev/components/time.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 -0
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/super-anchor.d.ts +1 -0
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +1 -0
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +2 -0
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +5 -1
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +1 -0
- package/dev/core/super-openable.d.ts.map +1 -1
- package/dev/core/super-openable.js +1 -0
- package/dev/core/super-openable.js.map +1 -1
- package/package.json +3 -3
- package/src/components/alert.ts +5 -0
- package/src/components/avatar.ts +2 -2
- package/src/components/badge.ts +1 -1
- package/src/components/breath.ts +7 -5
- package/src/components/button.ts +1 -4
- package/src/components/carousel.ts +10 -10
- package/src/components/details.ts +1 -1
- package/src/components/dialog.ts +15 -14
- package/src/components/dragbox.ts +14 -14
- package/src/components/grid.ts +4 -2
- package/src/components/progress.ts +13 -3
- package/src/components/range.ts +12 -12
- package/src/components/rotate.ts +1 -1
- package/src/components/router.ts +4 -7
- package/src/components/select.ts +6 -6
- package/src/components/split.ts +1 -1
- package/src/components/time.ts +3 -2
- package/src/core/global-style.ts +1 -0
- package/src/core/super-anchor.ts +1 -0
- package/src/core/super-input.ts +6 -1
- package/src/core/super-openable.ts +1 -0
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
package/dev/core/super-input.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { htmlSlot, part, styles } from "@godown/element";
|
2
|
+
import { htmlSlot, omit, part, styles } from "@godown/element";
|
3
3
|
import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
|
4
4
|
import { css, html } from "lit";
|
5
5
|
import { property } from "lit/decorators.js";
|
@@ -85,6 +85,9 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
85
85
|
this.makeId = Math.random().toString(36).slice(1);
|
86
86
|
this.nameValue = this.namevalue;
|
87
87
|
}
|
88
|
+
get observedRecord() {
|
89
|
+
return omit(super.observedRecord, "default", "value");
|
90
|
+
}
|
88
91
|
set defaultValue(value) {
|
89
92
|
this.default = value;
|
90
93
|
}
|
@@ -201,4 +204,5 @@ SuperInput = __decorate([
|
|
201
204
|
styles(fieldStyle, inputStyle)
|
202
205
|
], SuperInput);
|
203
206
|
export default SuperInput;
|
207
|
+
export { SuperInput };
|
204
208
|
//# sourceMappingURL=super-input.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;qBAcD,aAAa,CAAC,KAAK;;;;;sBAKlB,aAAa,CAAC,KAAK;;;;;;;;;;;;;;;;8BAgBX,aAAa,CAAC,KAAK;;;;gCAIjB,aAAa,CAAC,KAAK;;CAElD,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,CAAA;;MAEhB,aAAa,CAAC,KAAK;MACnB,aAAa,CAAC,KAAK;MACnB,aAAa,CAAC,KAAK;MACnB,aAAa,CAAC,KAAK,oBAAoB,aAAa,CAAC,UAAU;MAC/D,aAAa,CAAC,KAAK,iBAAiB,aAAa,CAAC,UAAU;MAC5D,aAAa,CAAC,KAAK,sBAAsB,aAAa,CAAC,MAAM;MAC7D,aAAa,CAAC,KAAK;MACnB,aAAa,CAAC,KAAK,qCAAqC,aAAa,CAAC,MAAM;yBACzD,aAAa,CAAC,KAAK;;;;;;;;;;;;;;;;CAgB3C,CAAC;AAGF,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW;IAApC;;QACE,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ected _handelClick(_: MouseEvent): void;
|
13
13
|
}
|
14
14
|
export default SuperOpenable;
|
15
|
+
export { SuperOpenable };
|
15
16
|
export type Direction4 = "left" | "right" | "top" | "bottom";
|
16
17
|
export type Direction5 = Direction4 | "center";
|
17
18
|
export type Direction8 = Direction4 | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,GAAE,OAAsC,GAAG,IAAI;IAIxD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAOlE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAG5C;AAED,eAAe,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,GAAE,OAAsC,GAAG,IAAI;IAIxD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAOlE,SAAS,CAAC,YAAY,CAAC,CAAC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|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "godown",
|
3
|
-
"version": "3.0
|
3
|
+
"version": "3.1.0",
|
4
4
|
"description": "Non Composite Web Components Library",
|
5
5
|
"type": "module",
|
6
6
|
"main": "index.js",
|
@@ -33,8 +33,8 @@
|
|
33
33
|
"lit": "^3.0.0",
|
34
34
|
"tslib": "^2.7.0",
|
35
35
|
"@godown/colors": "^1.0.0",
|
36
|
-
"@godown/
|
37
|
-
"@godown/
|
36
|
+
"@godown/element": "^1.0.0",
|
37
|
+
"@godown/f7-icon": "^1.0.0"
|
38
38
|
},
|
39
39
|
"publishConfig": {
|
40
40
|
"access": "public"
|
package/src/components/alert.ts
CHANGED
@@ -44,6 +44,9 @@ const genLight = (key: string) => {
|
|
44
44
|
return [cssGlobalVars._colors[key][6], cssGlobalVars._colors[key][0]];
|
45
45
|
};
|
46
46
|
|
47
|
+
/**
|
48
|
+
* @deprecated
|
49
|
+
*/
|
47
50
|
const lightStyles = constructCSSObject(
|
48
51
|
vars,
|
49
52
|
{
|
@@ -232,6 +235,8 @@ class Alert extends GlobalStyle {
|
|
232
235
|
* Alert variant, if set to `blockquote`, the alert will be rendered as a blockquote.
|
233
236
|
*
|
234
237
|
* If variant is `"blockquote"`, hide the close button.
|
238
|
+
*
|
239
|
+
* ! __"light" will be deprecated__ in the future.
|
235
240
|
*/
|
236
241
|
@property()
|
237
242
|
variant: "blockquote" | "dark" | "light" = "dark";
|
package/src/components/avatar.ts
CHANGED
@@ -86,7 +86,7 @@ class Avatar extends GlobalStyle {
|
|
86
86
|
`;
|
87
87
|
}
|
88
88
|
|
89
|
-
|
89
|
+
protected _renderAvatar(): TemplateResult<1> {
|
90
90
|
if (this.src) {
|
91
91
|
return html`
|
92
92
|
<img
|
@@ -109,7 +109,7 @@ class Avatar extends GlobalStyle {
|
|
109
109
|
return this.name;
|
110
110
|
}
|
111
111
|
|
112
|
-
_handleError(): void {
|
112
|
+
protected _handleError(): void {
|
113
113
|
this.src = undefined;
|
114
114
|
}
|
115
115
|
}
|
package/src/components/badge.ts
CHANGED
package/src/components/breath.ts
CHANGED
@@ -98,7 +98,7 @@ class Breath extends GlobalStyle {
|
|
98
98
|
* otherwise split strings by whitespace.
|
99
99
|
*/
|
100
100
|
@property()
|
101
|
-
|
101
|
+
content: string | string[];
|
102
102
|
|
103
103
|
/**
|
104
104
|
* Effect duration, ending in s or ms.
|
@@ -113,12 +113,12 @@ class Breath extends GlobalStyle {
|
|
113
113
|
part="root"
|
114
114
|
${attr(this.observedRecord)}
|
115
115
|
>
|
116
|
-
${[texts.map(this.
|
116
|
+
${[texts.map(this._renderText), htmlStyle(this._computeStyle(texts.length))]}
|
117
117
|
</div>
|
118
118
|
`;
|
119
119
|
}
|
120
120
|
|
121
|
-
protected
|
121
|
+
protected _renderText(text: string): TemplateResult<1> {
|
122
122
|
return html`
|
123
123
|
<span class="rel">
|
124
124
|
<span class="nocolor">${text}</span>
|
@@ -128,7 +128,9 @@ class Breath extends GlobalStyle {
|
|
128
128
|
}
|
129
129
|
|
130
130
|
protected getTexts(): string[] {
|
131
|
-
return Array.isArray(this.
|
131
|
+
return Array.isArray(this.content)
|
132
|
+
? this.content
|
133
|
+
: (this.content || this.textContent).split(/\s+/).filter((x) => x);
|
132
134
|
}
|
133
135
|
|
134
136
|
protected _computeStyle(len: number): string {
|
@@ -145,7 +147,7 @@ class Breath extends GlobalStyle {
|
|
145
147
|
}%{opacity:1;}}${style1}`;
|
146
148
|
}
|
147
149
|
|
148
|
-
|
150
|
+
parseDuration(): number | undefined {
|
149
151
|
const { duration } = this;
|
150
152
|
if (duration) {
|
151
153
|
if (duration.endsWith("s")) {
|
package/src/components/button.ts
CHANGED
@@ -114,7 +114,7 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
114
114
|
css`
|
115
115
|
:host {
|
116
116
|
${cssScope}--padding-x: .5em;
|
117
|
-
${cssScope}--padding-y: min(calc(var(${cssScope}--padding-x) / 2), .
|
117
|
+
${cssScope}--padding-y: min(calc(var(${cssScope}--padding-x) / 2), .125em);
|
118
118
|
${cssScope}--padding: var(${cssScope}--padding-y) var(${cssScope}--padding-x);
|
119
119
|
${cssScope}--modal-animation-duration: 1s;
|
120
120
|
${cssScope}--ghost-width: .08em;
|
@@ -150,9 +150,6 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
150
150
|
user-select: none;
|
151
151
|
border-radius: inherit;
|
152
152
|
transition-duration: inherit;
|
153
|
-
}
|
154
|
-
|
155
|
-
[part="content"] {
|
156
153
|
padding: var(${cssScope}--padding);
|
157
154
|
}
|
158
155
|
|
@@ -19,7 +19,7 @@ const protoName = "carousel";
|
|
19
19
|
* If no width, it will be the width of the first element.
|
20
20
|
*
|
21
21
|
* @slot - Carousel items, should maintain the same size.
|
22
|
-
* @fires change -
|
22
|
+
* @fires change - Fires when the index changes.
|
23
23
|
* @category display
|
24
24
|
*/
|
25
25
|
@godown(protoName)
|
@@ -89,11 +89,11 @@ class Carousel extends GlobalStyle {
|
|
89
89
|
@part("move-root")
|
90
90
|
protected _moveRoot: HTMLElement;
|
91
91
|
|
92
|
-
|
92
|
+
intervalID: number;
|
93
93
|
|
94
|
-
private
|
94
|
+
private __cloneFirst: HTMLElement | undefined;
|
95
95
|
|
96
|
-
private
|
96
|
+
private __cloneLast: HTMLElement | undefined;
|
97
97
|
|
98
98
|
protected render(): TemplateResult<1> {
|
99
99
|
return html`
|
@@ -130,12 +130,12 @@ class Carousel extends GlobalStyle {
|
|
130
130
|
if (this.children.length) {
|
131
131
|
this.width ||= `${(this.firstElementChild as HTMLElement).offsetWidth}px`;
|
132
132
|
|
133
|
-
this.
|
134
|
-
this.
|
135
|
-
this.
|
136
|
-
this.
|
137
|
-
this.appendChild(this.
|
138
|
-
this.insertBefore(this.
|
133
|
+
this.__cloneFirst?.remove();
|
134
|
+
this.__cloneLast?.remove();
|
135
|
+
this.__cloneLast = this.firstElementChild.cloneNode(true) as HTMLElement;
|
136
|
+
this.__cloneFirst = this.lastElementChild.cloneNode(true) as HTMLElement;
|
137
|
+
this.appendChild(this.__cloneLast);
|
138
|
+
this.insertBefore(this.__cloneFirst, this.firstElementChild);
|
139
139
|
this.show(this.index);
|
140
140
|
}
|
141
141
|
this.checkInterval();
|
@@ -15,7 +15,7 @@ const cssScope = scopePrefix(protoName);
|
|
15
15
|
*
|
16
16
|
* @slot summary - Details summary if no `summary` is provided.
|
17
17
|
* @slot - Details content.
|
18
|
-
* @fires change -
|
18
|
+
* @fires change - Fires when the open changes.
|
19
19
|
* @category display
|
20
20
|
*/
|
21
21
|
@godown(protoName)
|
package/src/components/dialog.ts
CHANGED
@@ -3,7 +3,7 @@ import { type PropertyValues, type TemplateResult, css, html } from "lit";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
5
|
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
6
|
-
import SuperOpenable
|
6
|
+
import SuperOpenable from "../core/super-openable.js";
|
7
7
|
|
8
8
|
const protoName = "dialog";
|
9
9
|
const cssScope = scopePrefix(protoName);
|
@@ -84,9 +84,9 @@ const cssScope = scopePrefix(protoName);
|
|
84
84
|
class Dialog extends SuperOpenable {
|
85
85
|
/**
|
86
86
|
* Direction of the opening animation.
|
87
|
+
* @deprecated
|
87
88
|
*/
|
88
|
-
|
89
|
-
direction: Direction9 = "center";
|
89
|
+
direction: string;
|
90
90
|
|
91
91
|
/**
|
92
92
|
* Enable modal, blocking event penetration.
|
@@ -100,7 +100,7 @@ class Dialog extends SuperOpenable {
|
|
100
100
|
@property()
|
101
101
|
key = "Escape";
|
102
102
|
|
103
|
-
private
|
103
|
+
private __modalInvoke = false;
|
104
104
|
|
105
105
|
protected render(): TemplateResult<1> {
|
106
106
|
return html`
|
@@ -117,46 +117,47 @@ class Dialog extends SuperOpenable {
|
|
117
117
|
showModal(): void {
|
118
118
|
if (!this.modal) {
|
119
119
|
this.modal = true;
|
120
|
-
this.
|
120
|
+
this.__modalInvoke = true;
|
121
121
|
}
|
122
122
|
this.show();
|
123
123
|
}
|
124
124
|
|
125
|
-
private
|
126
|
-
private
|
125
|
+
private __submitEvent: EventListenerOrEventListenerObject;
|
126
|
+
private __keydownEvent: EventListenerOrEventListenerObject;
|
127
127
|
|
128
128
|
protected updated(changedProperties: PropertyValues): void {
|
129
129
|
if (changedProperties.has("open")) {
|
130
130
|
if (this.open) {
|
131
|
-
this.
|
131
|
+
this.__submitEvent = this.events.add(this, "submit", this._handelSubmit);
|
132
132
|
if (this.key) {
|
133
|
-
this.
|
133
|
+
this.__keydownEvent = this.events.add(document, "keydown", this._handleKeydown.bind(this));
|
134
134
|
}
|
135
135
|
} else {
|
136
|
-
this.events.remove(this, "submit", this.
|
137
|
-
this.events.remove(document, "keydown", this.
|
136
|
+
this.events.remove(this, "submit", this.__submitEvent);
|
137
|
+
this.events.remove(document, "keydown", this.__keydownEvent);
|
138
138
|
}
|
139
139
|
}
|
140
140
|
}
|
141
141
|
|
142
142
|
protected _handleKeydown(e: KeyboardEvent): void {
|
143
|
-
e.preventDefault();
|
144
143
|
const keys = this.key.split(/[\s,]/);
|
145
144
|
if (keys.includes(e.key) || keys.includes(e.code)) {
|
145
|
+
e.preventDefault();
|
146
146
|
this.close();
|
147
147
|
}
|
148
148
|
}
|
149
149
|
|
150
150
|
protected _handelSubmit(e: HandlerEvent<HTMLFormElement>): void {
|
151
151
|
if (e.target.method === "dialog") {
|
152
|
+
e.preventDefault();
|
152
153
|
this.close();
|
153
154
|
}
|
154
155
|
}
|
155
156
|
|
156
157
|
close(): void {
|
157
|
-
if (this.
|
158
|
+
if (this.__modalInvoke) {
|
158
159
|
this.modal = false;
|
159
|
-
this.
|
160
|
+
this.__modalInvoke = false;
|
160
161
|
}
|
161
162
|
this.open = false;
|
162
163
|
}
|
@@ -38,11 +38,11 @@ class Dragbox extends GlobalStyle {
|
|
38
38
|
return this.offsetParent?.clientHeight ?? document.body.offsetHeight;
|
39
39
|
}
|
40
40
|
|
41
|
-
private
|
42
|
-
private
|
43
|
-
private
|
44
|
-
private
|
45
|
-
private
|
41
|
+
private __drag = false;
|
42
|
+
private __t: number;
|
43
|
+
private __l: number;
|
44
|
+
private __cx: number;
|
45
|
+
private __cy: number;
|
46
46
|
|
47
47
|
/**
|
48
48
|
* Position x.
|
@@ -74,11 +74,11 @@ class Dragbox extends GlobalStyle {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
protected _handleDragStart(e: MouseEvent): void {
|
77
|
-
this.
|
78
|
-
this.
|
79
|
-
this.
|
80
|
-
this.
|
81
|
-
this.
|
77
|
+
this.__cx = e.clientX;
|
78
|
+
this.__cy = e.clientY;
|
79
|
+
this.__t = this.offsetTop;
|
80
|
+
this.__l = this.offsetLeft;
|
81
|
+
this.__drag = true;
|
82
82
|
this._handleMouseMove = this.events.add(document, "mousemove", this._handleDrag.bind(this));
|
83
83
|
this._handleMouseLeave = this.events.add(document, "mouseleave", this._handleDragEnd.bind(this));
|
84
84
|
}
|
@@ -87,17 +87,17 @@ class Dragbox extends GlobalStyle {
|
|
87
87
|
protected _handleMouseLeave: EventListenerFunc;
|
88
88
|
|
89
89
|
protected _handleDragEnd(): void {
|
90
|
-
this.
|
90
|
+
this.__drag = false;
|
91
91
|
this.events.remove(document, "mousemove", this._handleMouseMove);
|
92
92
|
this.events.remove(document, "mouseleave", this._handleMouseLeave);
|
93
93
|
}
|
94
94
|
|
95
95
|
protected _handleDrag(e: MouseEvent): void {
|
96
|
-
if (!this.
|
96
|
+
if (!this.__drag) {
|
97
97
|
return;
|
98
98
|
}
|
99
|
-
const nl = e.clientX - (this.
|
100
|
-
const nt = e.clientY - (this.
|
99
|
+
const nl = e.clientX - (this.__cx - this.__l);
|
100
|
+
const nt = e.clientY - (this.__cy - this.__t);
|
101
101
|
const { style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight } = this;
|
102
102
|
if (nl < 0) {
|
103
103
|
style.left = "0";
|
package/src/components/grid.ts
CHANGED
@@ -4,6 +4,8 @@ import { property } from "lit/decorators.js";
|
|
4
4
|
|
5
5
|
import { GlobalStyle } from "../core/global-style.js";
|
6
6
|
|
7
|
+
const toTemplate = (s: number | string) => (isNumerical(s) ? `repeat(${s},1fr)` : s);
|
8
|
+
|
7
9
|
const protoName = "grid";
|
8
10
|
|
9
11
|
/**
|
@@ -70,8 +72,8 @@ class Grid extends GlobalStyle {
|
|
70
72
|
joinRules({
|
71
73
|
":host": {
|
72
74
|
gap: this.gap,
|
73
|
-
"grid-template-columns":
|
74
|
-
"grid-template-rows":
|
75
|
+
"grid-template-columns": toTemplate(this.columns),
|
76
|
+
"grid-template-rows": toTemplate(this.rows),
|
75
77
|
"place-content": this.content,
|
76
78
|
"place-items": this.items,
|
77
79
|
},
|
@@ -73,6 +73,11 @@ class Progress extends GlobalStyle {
|
|
73
73
|
let className: string;
|
74
74
|
if (!isNil(this.value)) {
|
75
75
|
width = this.parsePercent(this.value);
|
76
|
+
if (width > 100) {
|
77
|
+
width = 100;
|
78
|
+
} else if (width < 0) {
|
79
|
+
width = 0;
|
80
|
+
}
|
76
81
|
className = "static";
|
77
82
|
}
|
78
83
|
return html`
|
@@ -96,10 +101,15 @@ class Progress extends GlobalStyle {
|
|
96
101
|
* @returns Percentage without a percent sign.
|
97
102
|
*/
|
98
103
|
parsePercent(s: string | number = "0"): number {
|
99
|
-
|
100
|
-
|
104
|
+
s = String(s);
|
105
|
+
if (s.includes("%")) {
|
106
|
+
return parseFloat(s);
|
101
107
|
}
|
102
|
-
|
108
|
+
const diff = this.max - this.min;
|
109
|
+
if (diff === 0) {
|
110
|
+
return 100;
|
111
|
+
}
|
112
|
+
return (parseFloat(s) / diff) * 100;
|
103
113
|
}
|
104
114
|
}
|
105
115
|
|
package/src/components/range.ts
CHANGED
@@ -164,7 +164,7 @@ class Range extends SuperInput {
|
|
164
164
|
@state()
|
165
165
|
lastFocus?: number;
|
166
166
|
|
167
|
-
|
167
|
+
private __focusStack: number[] = [];
|
168
168
|
|
169
169
|
/**
|
170
170
|
* Returns true when the second number is greater than the first number.
|
@@ -223,12 +223,12 @@ class Range extends SuperInput {
|
|
223
223
|
})}"
|
224
224
|
>
|
225
225
|
<div part="track"></div>
|
226
|
-
${this.range ? (this.value as number[]).map((_, index) => this.
|
226
|
+
${this.range ? (this.value as number[]).map((_, index) => this._renderHandle(index)) : this._renderHandle(0)}
|
227
227
|
</div>
|
228
228
|
`;
|
229
229
|
}
|
230
230
|
|
231
|
-
protected
|
231
|
+
protected _renderHandle(index: number): TemplateResult<1> {
|
232
232
|
const { range } = this;
|
233
233
|
const end = !range || index === (this.value as number[]).length - 1;
|
234
234
|
return html`
|
@@ -239,7 +239,7 @@ class Range extends SuperInput {
|
|
239
239
|
@mousedown="${this.disabled ? null : this.createMouseDown(index)}"
|
240
240
|
@focus="${this.disabled ? null : () => this.focusHandle(index)}"
|
241
241
|
@blur="${this.disabled ? null : this.blurHandle}"
|
242
|
-
style="z-index:${this.
|
242
|
+
style="z-index:${this.__focusStack.indexOf(index) + 1};--handle:var(--${
|
243
243
|
/* In single-handle mod or end, it is max value */
|
244
244
|
!range && end ? "to" : `handle-${index}`
|
245
245
|
})"
|
@@ -247,26 +247,26 @@ class Range extends SuperInput {
|
|
247
247
|
`;
|
248
248
|
}
|
249
249
|
|
250
|
-
private
|
250
|
+
private __keydownEvent: EventListenerOrEventListenerObject;
|
251
251
|
|
252
252
|
focusHandle(index: number): void {
|
253
253
|
this.lastFocus = index;
|
254
|
-
const indexOfFocusStack = this.
|
254
|
+
const indexOfFocusStack = this.__focusStack.indexOf(index);
|
255
255
|
if (indexOfFocusStack !== -1) {
|
256
|
-
this.
|
256
|
+
this.__focusStack.splice(indexOfFocusStack, 1);
|
257
257
|
}
|
258
|
-
this.
|
258
|
+
this.__focusStack.push(index);
|
259
259
|
const handleItem = this._handles.item(index);
|
260
260
|
handleItem?.focus();
|
261
|
-
if (!this.
|
262
|
-
this.
|
261
|
+
if (!this.__keydownEvent) {
|
262
|
+
this.__keydownEvent = this.events.add(document, "keydown", this.createKeydownEvent(index));
|
263
263
|
}
|
264
264
|
this.dispatchEvent(new CustomEvent("focus", { detail: index }));
|
265
265
|
}
|
266
266
|
|
267
267
|
blurHandle(): void {
|
268
268
|
this.lastFocus = undefined;
|
269
|
-
this.
|
269
|
+
this.__keydownEvent = this.events.remove(document, "keydown", this.__keydownEvent);
|
270
270
|
this.dispatchEvent(new CustomEvent("blur"));
|
271
271
|
}
|
272
272
|
|
@@ -321,7 +321,7 @@ class Range extends SuperInput {
|
|
321
321
|
/**
|
322
322
|
* Ensure that the values do not exceed the range of max and min.
|
323
323
|
*/
|
324
|
-
|
324
|
+
normalizeValue(value: number): number {
|
325
325
|
if (value > this.max) {
|
326
326
|
value -= this.step;
|
327
327
|
} else if (value < this.min) {
|
package/src/components/rotate.ts
CHANGED
package/src/components/router.ts
CHANGED
@@ -30,7 +30,7 @@ const protoName = "router";
|
|
30
30
|
*
|
31
31
|
* It has two methods to collect routes.
|
32
32
|
*
|
33
|
-
* 1. From field `routes`, an array, each elements require "path"
|
33
|
+
* 1. From field `routes`, an array, each elements require "path".
|
34
34
|
* 2. From child elements, which have the slot attribute for matching routes.
|
35
35
|
*
|
36
36
|
* If only the method 1 is used, set `type` to `"field"`.
|
@@ -69,6 +69,9 @@ class Router extends GlobalStyle {
|
|
69
69
|
* Dynamic parameters record.
|
70
70
|
*/
|
71
71
|
get params(): Record<string, string> {
|
72
|
+
if (!this.path) {
|
73
|
+
return {};
|
74
|
+
}
|
72
75
|
return RouteTree.parseParams(this.pathname, this.path);
|
73
76
|
}
|
74
77
|
|
@@ -172,11 +175,6 @@ class Router extends GlobalStyle {
|
|
172
175
|
};
|
173
176
|
}
|
174
177
|
|
175
|
-
/**
|
176
|
-
* Callback function when the route changes.
|
177
|
-
*/
|
178
|
-
routeChangeCallback: (params: RouteResult, first: boolean) => void = null;
|
179
|
-
|
180
178
|
protected updated(changedProperties: PropertyValueMap<this>): void {
|
181
179
|
const shouldDispatch = changedProperties.has("pathname") || changedProperties.has("path");
|
182
180
|
if (shouldDispatch) {
|
@@ -185,7 +183,6 @@ class Router extends GlobalStyle {
|
|
185
183
|
if (noRecord) {
|
186
184
|
this.__cacheRecord.set(this.pathname, ur);
|
187
185
|
}
|
188
|
-
this.routeChangeCallback?.(ur, noRecord);
|
189
186
|
this.dispatchEvent(new CustomEvent("change", { detail: ur }));
|
190
187
|
}
|
191
188
|
}
|
package/src/components/select.ts
CHANGED
@@ -97,7 +97,7 @@ class Select extends Input {
|
|
97
97
|
protected lastChecked: HTMLElement;
|
98
98
|
protected defaultText: string;
|
99
99
|
protected defaultChecked: HTMLElement[];
|
100
|
-
private
|
100
|
+
private __store: { value: string; text: string }[] = [];
|
101
101
|
|
102
102
|
protected render(): TemplateResult<1> {
|
103
103
|
return html`
|
@@ -214,15 +214,15 @@ class Select extends Input {
|
|
214
214
|
text ||= value;
|
215
215
|
let operation: 0 | 1 = 0;
|
216
216
|
if (this.multiple) {
|
217
|
-
const i = this.
|
217
|
+
const i = this.__store.findIndex((s) => s.value === value);
|
218
218
|
if (i > -1) {
|
219
|
-
this.
|
219
|
+
this.__store.splice(i, 1);
|
220
220
|
} else {
|
221
|
-
this.
|
221
|
+
this.__store.push({ value, text });
|
222
222
|
operation = 1;
|
223
223
|
}
|
224
|
-
this.value = this.
|
225
|
-
this.text = this.
|
224
|
+
this.value = this.__store.map((s) => s.value);
|
225
|
+
this.text = this.__store.map((s) => s.text).join(", ");
|
226
226
|
} else {
|
227
227
|
if (this.value === value) {
|
228
228
|
this.value = "";
|
package/src/components/split.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type HandlerEvent, attr, classList, godown, styles } from "@godown/element";
|
2
|
-
import { type TemplateResult, css, html
|
2
|
+
import { type TemplateResult, css, html } from "lit";
|
3
3
|
import { property, state } from "lit/decorators.js";
|
4
4
|
|
5
5
|
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
package/src/components/time.ts
CHANGED
@@ -30,7 +30,7 @@ class Time extends GlobalStyle {
|
|
30
30
|
* Format strings.
|
31
31
|
*/
|
32
32
|
@property()
|
33
|
-
format = "YYYY-MM-DD hh:mm:ss
|
33
|
+
format = "YYYY-MM-DD hh:mm:ss";
|
34
34
|
|
35
35
|
/**
|
36
36
|
* Time.
|
@@ -71,8 +71,8 @@ class Time extends GlobalStyle {
|
|
71
71
|
|
72
72
|
protected updated(changedProperties: PropertyValues): void {
|
73
73
|
if (changedProperties.has("timeout")) {
|
74
|
-
clearInterval(this.timeoutId);
|
75
74
|
if (this.timeout) {
|
75
|
+
clearInterval(this.timeoutId);
|
76
76
|
this.timeoutId = this.startTimeout();
|
77
77
|
}
|
78
78
|
}
|
@@ -80,6 +80,7 @@ class Time extends GlobalStyle {
|
|
80
80
|
|
81
81
|
disconnectedCallback(): void {
|
82
82
|
clearInterval(this.timeoutId);
|
83
|
+
this.timeoutId = undefined;
|
83
84
|
}
|
84
85
|
|
85
86
|
startTimeout(): number {
|
package/src/core/global-style.ts
CHANGED
@@ -4,6 +4,7 @@ import { GodownElement, joinProperties, trim } from "@godown/element";
|
|
4
4
|
import { type CSSResult, css, unsafeCSS } from "lit";
|
5
5
|
|
6
6
|
export class GlobalStyle extends GodownElement {}
|
7
|
+
export default GlobalStyle;
|
7
8
|
|
8
9
|
const cssvar = trim(GlobalStyle.godownConfig.prefix, "-");
|
9
10
|
|