godown 1.1.4 → 1.1.6
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 +35 -35
- package/conf.d.ts +18 -18
- package/conf.js +22 -22
- package/deps.d.ts +7 -7
- package/deps.js +7 -7
- package/effect/index.d.ts +3 -3
- package/effect/index.js +3 -3
- package/effect/ov-effect.d.ts +23 -23
- package/effect/ov-effect.d.ts.map +1 -1
- package/effect/ov-effect.js +299 -275
- package/effect/ro-effect.d.ts +19 -19
- package/effect/ro-effect.d.ts.map +1 -1
- package/effect/ro-effect.js +125 -120
- package/effect/std.d.ts +3 -3
- package/effect/std.d.ts.map +1 -1
- package/effect/std.js +3 -3
- package/effect/tw-effect.d.ts +21 -21
- package/effect/tw-effect.d.ts.map +1 -1
- package/effect/tw-effect.js +108 -107
- package/glob.d.ts +8 -8
- package/glob.d.ts.map +1 -1
- package/glob.js +25 -24
- package/group/avatar-group.d.ts +20 -20
- package/group/avatar-group.d.ts.map +1 -1
- package/group/avatar-group.js +112 -88
- package/group/button-group.d.ts +12 -12
- package/group/button-group.d.ts.map +1 -1
- package/group/button-group.js +79 -74
- package/group/details-group.d.ts +16 -16
- package/group/details-group.d.ts.map +1 -1
- package/group/details-group.js +55 -53
- package/group/index.d.ts +3 -3
- package/group/index.js +3 -3
- package/group/std.d.ts +3 -3
- package/group/std.d.ts.map +1 -1
- package/group/std.js +3 -3
- package/index.d.ts +7 -7
- package/index.js +7 -7
- package/input-form/base-input.d.ts +32 -32
- package/input-form/base-input.d.ts.map +1 -1
- package/input-form/base-input.js +229 -226
- package/input-form/exp-input.d.ts +22 -22
- package/input-form/exp-input.d.ts.map +1 -1
- package/input-form/exp-input.js +218 -205
- package/input-form/index.d.ts +8 -8
- package/input-form/index.js +8 -8
- package/input-form/label-input.d.ts +21 -21
- package/input-form/label-input.d.ts.map +1 -1
- package/input-form/label-input.js +150 -137
- package/input-form/search-input.d.ts +36 -36
- package/input-form/search-input.d.ts.map +1 -1
- package/input-form/search-input.js +311 -297
- package/input-form/select-input.d.ts +31 -31
- package/input-form/select-input.d.ts.map +1 -1
- package/input-form/select-input.js +354 -330
- package/input-form/sign-form.d.ts +25 -23
- package/input-form/sign-form.d.ts.map +1 -1
- package/input-form/sign-form.js +165 -160
- package/input-form/split-input.d.ts +26 -26
- package/input-form/split-input.d.ts.map +1 -1
- package/input-form/split-input.js +181 -173
- package/input-form/std.d.ts +19 -19
- package/input-form/std.d.ts.map +1 -1
- package/input-form/std.js +72 -68
- package/input-form/switch-input.d.ts +22 -22
- package/input-form/switch-input.d.ts.map +1 -1
- package/input-form/switch-input.js +181 -175
- package/items/alert-item.d.ts +16 -16
- package/items/alert-item.d.ts.map +1 -1
- package/items/alert-item.js +143 -142
- package/items/avatar-anchor.d.ts +19 -19
- package/items/avatar-anchor.d.ts.map +1 -1
- package/items/avatar-anchor.js +150 -148
- package/items/base-button.d.ts +16 -16
- package/items/base-button.d.ts.map +1 -1
- package/items/base-button.js +170 -167
- package/items/dialog-item.d.ts +24 -24
- package/items/dialog-item.d.ts.map +1 -1
- package/items/dialog-item.js +157 -156
- package/items/index.d.ts +7 -7
- package/items/index.js +7 -7
- package/items/link-a.d.ts +19 -19
- package/items/link-a.d.ts.map +1 -1
- package/items/link-a.js +98 -97
- package/items/load-track.d.ts +20 -20
- package/items/load-track.d.ts.map +1 -1
- package/items/load-track.js +115 -109
- package/items/std.d.ts +3 -3
- package/items/std.d.ts.map +1 -1
- package/items/std.js +3 -3
- package/items/super-a.d.ts +15 -15
- package/items/super-a.d.ts.map +1 -1
- package/items/super-a.js +99 -88
- package/layout/div-line.d.ts +15 -15
- package/layout/div-line.d.ts.map +1 -1
- package/layout/div-line.js +71 -65
- package/layout/drag-box.d.ts +25 -25
- package/layout/drag-box.d.ts.map +1 -1
- package/layout/drag-box.js +95 -94
- package/layout/flex-flow.d.ts +13 -13
- package/layout/flex-flow.d.ts.map +1 -1
- package/layout/flex-flow.js +39 -34
- package/layout/index.d.ts +5 -5
- package/layout/index.js +5 -5
- package/layout/nav-aside.d.ts +13 -13
- package/layout/nav-aside.d.ts.map +1 -1
- package/layout/nav-aside.js +61 -54
- package/layout/nav-layout.d.ts +16 -16
- package/layout/nav-layout.d.ts.map +1 -1
- package/layout/nav-layout.js +167 -146
- package/layout/std.d.ts +4 -4
- package/layout/std.d.ts.map +1 -1
- package/layout/std.js +10 -8
- package/package.json +48 -40
- package/react/effect.d.ts +9 -9
- package/react/effect.d.ts.map +1 -1
- package/react/effect.js +33 -33
- package/react/group.d.ts +4 -4
- package/react/group.d.ts.map +1 -1
- package/react/group.js +19 -19
- package/react/index.d.ts +7 -7
- package/react/index.d.ts.map +1 -1
- package/react/index.js +7 -7
- package/react/input-form.d.ts +32 -32
- package/react/input-form.d.ts.map +1 -1
- package/react/input-form.js +65 -65
- package/react/items.d.ts +8 -8
- package/react/items.d.ts.map +1 -1
- package/react/items.js +39 -39
- package/react/layout.d.ts +6 -6
- package/react/layout.d.ts.map +1 -1
- package/react/layout.js +29 -29
- package/react/view.d.ts +6 -6
- package/react/view.d.ts.map +1 -1
- package/react/view.js +29 -29
- package/view/details-expand.d.ts +18 -18
- package/view/details-expand.d.ts.map +1 -1
- package/view/details-expand.js +85 -80
- package/view/down-drop.d.ts +18 -18
- package/view/down-drop.d.ts.map +1 -1
- package/view/down-drop.js +98 -94
- package/view/index.d.ts +5 -5
- package/view/index.js +5 -5
- package/view/menu-list.d.ts +16 -16
- package/view/menu-list.d.ts.map +1 -1
- package/view/menu-list.js +77 -72
- package/view/route-view.d.ts +57 -57
- package/view/route-view.d.ts.map +1 -1
- package/view/route-view.js +261 -258
- package/view/scroll-x.d.ts +14 -14
- package/view/scroll-x.d.ts.map +1 -1
- package/view/scroll-x.js +77 -72
- package/view/std.d.ts +4 -4
- package/view/std.d.ts.map +1 -1
- package/view/std.js +37 -37
- package/with.d.ts +27 -27
- package/with.d.ts.map +1 -1
- package/with.js +77 -78
- package/view/react/effect.d.ts +0 -10
- package/view/react/effect.d.ts.map +0 -1
- package/view/react/effect.js +0 -32
- package/view/react/group.d.ts +0 -5
- package/view/react/group.d.ts.map +0 -1
- package/view/react/group.js +0 -18
- package/view/react/index.d.ts +0 -7
- package/view/react/index.d.ts.map +0 -1
- package/view/react/index.js +0 -6
- package/view/react/input-form.d.ts +0 -33
- package/view/react/input-form.d.ts.map +0 -1
- package/view/react/input-form.js +0 -64
- package/view/react/items.d.ts +0 -9
- package/view/react/items.d.ts.map +0 -1
- package/view/react/items.js +0 -38
- package/view/react/layout.d.ts +0 -7
- package/view/react/layout.d.ts.map +0 -1
- package/view/react/layout.js +0 -28
- package/view/react/view.d.ts +0 -7
- package/view/react/view.d.ts.map +0 -1
- package/view/react/view.js +0 -28
@@ -1,33 +1,33 @@
|
|
1
|
-
import STD from "./std.js";
|
2
|
-
type inputtype = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
|
3
|
-
export declare class BaseInput extends STD {
|
4
|
-
_input: HTMLInputElement;
|
5
|
-
_ranged: HTMLElement;
|
6
|
-
accept: any;
|
7
|
-
label: string;
|
8
|
-
name: string;
|
9
|
-
pla: any;
|
10
|
-
type: inputtype;
|
11
|
-
value: string | File | FileList;
|
12
|
-
def: string;
|
13
|
-
only: boolean;
|
14
|
-
min: number;
|
15
|
-
max: number;
|
16
|
-
step: number;
|
17
|
-
autofocus: boolean;
|
18
|
-
static styles: (import("lit").CSSResult | import("@lit/reactive-element/css-tag.js").CSSResultGroup[])[];
|
19
|
-
render(): import("lit").TemplateResult<1>;
|
20
|
-
connectedCallback(): void;
|
21
|
-
firstUpdated(): void;
|
22
|
-
_handleRange(e: any): void;
|
23
|
-
_handleFile(e: any): void;
|
24
|
-
reset(): void;
|
25
|
-
_typeSwitcher(): import("lit").TemplateResult<1>;
|
26
|
-
}
|
27
|
-
export default BaseInput;
|
28
|
-
declare global {
|
29
|
-
interface HTMLElementTagNameMap {
|
30
|
-
"base-input": BaseInput;
|
31
|
-
}
|
32
|
-
}
|
1
|
+
import STD from "./std.js";
|
2
|
+
type inputtype = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
|
3
|
+
export declare class BaseInput extends STD {
|
4
|
+
_input: HTMLInputElement;
|
5
|
+
_ranged: HTMLElement;
|
6
|
+
accept: any;
|
7
|
+
label: string;
|
8
|
+
name: string;
|
9
|
+
pla: any;
|
10
|
+
type: inputtype;
|
11
|
+
value: string | File | FileList;
|
12
|
+
def: string;
|
13
|
+
only: boolean;
|
14
|
+
min: number;
|
15
|
+
max: number;
|
16
|
+
step: number;
|
17
|
+
autofocus: boolean;
|
18
|
+
static styles: (import("lit").CSSResult | import("@lit/reactive-element/css-tag.js").CSSResultGroup[])[];
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
20
|
+
connectedCallback(): void;
|
21
|
+
firstUpdated(): void;
|
22
|
+
_handleRange(e: any): void;
|
23
|
+
_handleFile(e: any): void;
|
24
|
+
reset(): void;
|
25
|
+
_typeSwitcher(): import("lit-html").TemplateResult<1>;
|
26
|
+
}
|
27
|
+
export default BaseInput;
|
28
|
+
declare global {
|
29
|
+
interface HTMLElementTagNameMap {
|
30
|
+
"base-input": BaseInput;
|
31
|
+
}
|
32
|
+
}
|
33
33
|
//# sourceMappingURL=base-input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base-input.d.ts","sourceRoot":"","sources":["../../src/input-form/base-input.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,KAAK,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,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K;IACR,SAAS,UAAS;IAC/C,MAAM,CAAC,MAAM,4FAkGX;IACF,MAAM;IASN,iBAAiB,IAAI,IAAI;IAKzB,YAAY;IAUZ,YAAY,CAAC,CAAC,KAAA;IAKd,WAAW,CAAC,CAAC,KAAA;IAIb,KAAK;IAUL,aAAa;CAUd;AACD,eAAe,SAAS,CAAC;AACzB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
package/input-form/base-input.js
CHANGED
@@ -1,226 +1,229 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
import { html, css, property, query, ifDefined, define, cssvar } from "../deps.js";
|
8
|
-
import STD from "./std.js";
|
9
|
-
let BaseInput = class BaseInput extends STD {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.accept = undefined;
|
13
|
-
this.label = "";
|
14
|
-
this.name = "";
|
15
|
-
this.pla = undefined;
|
16
|
-
this.type = "text";
|
17
|
-
this.value = undefined;
|
18
|
-
this.def = "";
|
19
|
-
this.only = false;
|
20
|
-
this.min = 0;
|
21
|
-
this.max = 100;
|
22
|
-
this.step = 1;
|
23
|
-
this.autofocus = false;
|
24
|
-
}
|
25
|
-
render() {
|
26
|
-
var _a;
|
27
|
-
if (!this.name)
|
28
|
-
this.name = ((_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || this.type;
|
29
|
-
return html `<label for="input">
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</label>`;
|
35
|
-
}
|
36
|
-
connectedCallback() {
|
37
|
-
super.connectedCallback();
|
38
|
-
if (!this.def && this.type !== "file")
|
39
|
-
this.def = this.value || "";
|
40
|
-
if (!this.value)
|
41
|
-
this.value = this.def;
|
42
|
-
}
|
43
|
-
firstUpdated() {
|
44
|
-
if (this.type === "range") {
|
45
|
-
this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + "%";
|
46
|
-
if (this.childNodes.length) {
|
47
|
-
this.shadowRoot.querySelector("div").style.margin = "0";
|
48
|
-
}
|
49
|
-
}
|
50
|
-
this._focusCheck();
|
51
|
-
this._compositionCheck();
|
52
|
-
}
|
53
|
-
_handleRange(e) {
|
54
|
-
this.value = e.target.value;
|
55
|
-
this._ranged.style.width = 100 * parseInt(e.target.value) / (this.max - this.min) + "%";
|
56
|
-
this.dispatchEvent(new CustomEvent("input", { detail: this.value }));
|
57
|
-
}
|
58
|
-
_handleFile(e) {
|
59
|
-
this.value = !this.only ? e.target.files : e.target.files[0];
|
60
|
-
this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
|
61
|
-
}
|
62
|
-
reset() {
|
63
|
-
if (this.type === "range") {
|
64
|
-
this._input.value = this.def || ((this.max - this.min) / 2).toString();
|
65
|
-
this.value = this._input.value;
|
66
|
-
this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + "%";
|
67
|
-
}
|
68
|
-
else {
|
69
|
-
this._input.value = this.def.toString();
|
70
|
-
this.value = this.def;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
_typeSwitcher() {
|
74
|
-
switch (this.type) {
|
75
|
-
case "range":
|
76
|
-
return html `<input id="input" type="range" min=${this.min} max=${this.max} step=${this.step} value=${this.value} @input=${this._handleRange} @change=${this._handleChange}
|
77
|
-
case "file":
|
78
|
-
return html `<input id="input" type="file" accept=${ifDefined(this.accept)} ?multiple=${!this.only} class="input" @change=${this._handleFile}
|
79
|
-
default:
|
80
|
-
return html `<input id="input" class="input" type=${this.type} placeholder=${this.pla} value=${this.value} @input=${this._handleInput} @change=${this._handleChange}/>`;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
};
|
84
|
-
BaseInput.styles = [
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
]
|
183
|
-
__decorate([
|
184
|
-
query("
|
185
|
-
], BaseInput.prototype, "
|
186
|
-
__decorate([
|
187
|
-
|
188
|
-
], BaseInput.prototype, "
|
189
|
-
__decorate([
|
190
|
-
property()
|
191
|
-
], BaseInput.prototype, "
|
192
|
-
__decorate([
|
193
|
-
property()
|
194
|
-
], BaseInput.prototype, "
|
195
|
-
__decorate([
|
196
|
-
property()
|
197
|
-
], BaseInput.prototype, "
|
198
|
-
__decorate([
|
199
|
-
property()
|
200
|
-
], BaseInput.prototype, "
|
201
|
-
__decorate([
|
202
|
-
property()
|
203
|
-
], BaseInput.prototype, "
|
204
|
-
__decorate([
|
205
|
-
property()
|
206
|
-
], BaseInput.prototype, "
|
207
|
-
__decorate([
|
208
|
-
property(
|
209
|
-
], BaseInput.prototype, "
|
210
|
-
__decorate([
|
211
|
-
property({ type:
|
212
|
-
], BaseInput.prototype, "
|
213
|
-
__decorate([
|
214
|
-
property({ type: Number })
|
215
|
-
], BaseInput.prototype, "
|
216
|
-
__decorate([
|
217
|
-
property({ type: Number })
|
218
|
-
], BaseInput.prototype, "
|
219
|
-
__decorate([
|
220
|
-
property({ type:
|
221
|
-
], BaseInput.prototype, "
|
222
|
-
|
223
|
-
|
224
|
-
], BaseInput);
|
225
|
-
|
226
|
-
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import { html, css, property, query, ifDefined, define, cssvar } from "../deps.js";
|
8
|
+
import STD from "./std.js";
|
9
|
+
let BaseInput = class BaseInput extends STD {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.accept = undefined;
|
13
|
+
this.label = "";
|
14
|
+
this.name = "";
|
15
|
+
this.pla = undefined;
|
16
|
+
this.type = "text";
|
17
|
+
this.value = undefined;
|
18
|
+
this.def = "";
|
19
|
+
this.only = false;
|
20
|
+
this.min = 0;
|
21
|
+
this.max = 100;
|
22
|
+
this.step = 1;
|
23
|
+
this.autofocus = false;
|
24
|
+
}
|
25
|
+
render() {
|
26
|
+
var _a;
|
27
|
+
if (!this.name)
|
28
|
+
this.name = ((_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || this.type;
|
29
|
+
return html `<label for="input">
|
30
|
+
<slot name="pre"></slot>
|
31
|
+
<slot></slot>
|
32
|
+
<div class=${this.type}>${this._typeSwitcher()}</div>
|
33
|
+
<slot name="suf"></slot>
|
34
|
+
</label>`;
|
35
|
+
}
|
36
|
+
connectedCallback() {
|
37
|
+
super.connectedCallback();
|
38
|
+
if (!this.def && this.type !== "file")
|
39
|
+
this.def = this.value || "";
|
40
|
+
if (!this.value)
|
41
|
+
this.value = this.def;
|
42
|
+
}
|
43
|
+
firstUpdated() {
|
44
|
+
if (this.type === "range") {
|
45
|
+
this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + "%";
|
46
|
+
if (this.childNodes.length) {
|
47
|
+
this.shadowRoot.querySelector("div").style.margin = "0";
|
48
|
+
}
|
49
|
+
}
|
50
|
+
this._focusCheck();
|
51
|
+
this._compositionCheck();
|
52
|
+
}
|
53
|
+
_handleRange(e) {
|
54
|
+
this.value = e.target.value;
|
55
|
+
this._ranged.style.width = (100 * parseInt(e.target.value)) / (this.max - this.min) + "%";
|
56
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.value }));
|
57
|
+
}
|
58
|
+
_handleFile(e) {
|
59
|
+
this.value = !this.only ? e.target.files : e.target.files[0];
|
60
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
|
61
|
+
}
|
62
|
+
reset() {
|
63
|
+
if (this.type === "range") {
|
64
|
+
this._input.value = this.def || ((this.max - this.min) / 2).toString();
|
65
|
+
this.value = this._input.value;
|
66
|
+
this._ranged.style.width = 100 * (parseInt(this.value) / (this.max - this.min)) + "%";
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
this._input.value = this.def.toString();
|
70
|
+
this.value = this.def;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
_typeSwitcher() {
|
74
|
+
switch (this.type) {
|
75
|
+
case "range":
|
76
|
+
return html `<input id="input" type="range" min=${this.min} max=${this.max} step=${this.step} value=${this.value} @input=${this._handleRange} @change=${this._handleChange} /><i></i>`;
|
77
|
+
case "file":
|
78
|
+
return html `<input id="input" type="file" accept=${ifDefined(this.accept)} ?multiple=${!this.only} class="input" @change=${this._handleFile} />`;
|
79
|
+
default:
|
80
|
+
return html `<input id="input" class="input" type=${this.type} placeholder=${this.pla} value=${this.value} @input=${this._handleInput} @change=${this._handleChange} />`;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
};
|
84
|
+
BaseInput.styles = [
|
85
|
+
STD.styles,
|
86
|
+
css `
|
87
|
+
:host {
|
88
|
+
width: var(${cssvar}--input-width);
|
89
|
+
height: 1em;
|
90
|
+
display: inline-flex;
|
91
|
+
background-color: var(${cssvar}--input-background);
|
92
|
+
border-radius: 0.2em;
|
93
|
+
outline: 0.18em solid transparent;
|
94
|
+
color: var(${cssvar}--text);
|
95
|
+
}
|
96
|
+
:host(:focus-within) {
|
97
|
+
outline-color: var(${cssvar}--input-outline-focus);
|
98
|
+
}
|
99
|
+
:host([type="range"]) {
|
100
|
+
outline: none;
|
101
|
+
height: auto;
|
102
|
+
}
|
103
|
+
:host([type="file"]) {
|
104
|
+
height: auto;
|
105
|
+
width: auto;
|
106
|
+
min-height: 0.5em;
|
107
|
+
min-width: 0.5em;
|
108
|
+
}
|
109
|
+
div,
|
110
|
+
label {
|
111
|
+
display: flex;
|
112
|
+
flex: 1;
|
113
|
+
}
|
114
|
+
* {
|
115
|
+
border-radius: inherit;
|
116
|
+
cursor: inherit;
|
117
|
+
font-family: inherit;
|
118
|
+
}
|
119
|
+
.input[type="color"] {
|
120
|
+
padding: 0;
|
121
|
+
height: 100% !important;
|
122
|
+
}
|
123
|
+
.input[type="file"] {
|
124
|
+
display: none;
|
125
|
+
}
|
126
|
+
.input {
|
127
|
+
box-sizing: border-box;
|
128
|
+
height: 100%;
|
129
|
+
width: 100%;
|
130
|
+
font-size: 0.8em;
|
131
|
+
outline: 0;
|
132
|
+
border: 0;
|
133
|
+
margin: 0;
|
134
|
+
border: none;
|
135
|
+
color: inherit;
|
136
|
+
background: transparent;
|
137
|
+
padding: 0 0.25em;
|
138
|
+
border-radius: 0.25em;
|
139
|
+
}
|
140
|
+
.range {
|
141
|
+
position: relative;
|
142
|
+
display: inline-flex;
|
143
|
+
justify-content: center;
|
144
|
+
align-items: center;
|
145
|
+
box-shadow: 0 0.5px 0.1em var(${cssvar}--shadow);
|
146
|
+
background-color: var(${cssvar}--input-false);
|
147
|
+
}
|
148
|
+
.range input ~ i {
|
149
|
+
position: absolute;
|
150
|
+
left: 0;
|
151
|
+
width: 50%;
|
152
|
+
pointer-events: none;
|
153
|
+
background-color: var(${cssvar}--input-true);
|
154
|
+
height: calc(0.6em - 1.1px);
|
155
|
+
}
|
156
|
+
.range input {
|
157
|
+
height: 0.6em;
|
158
|
+
margin: 0px -0.5em;
|
159
|
+
width: calc(100% + 0.5em);
|
160
|
+
appearance: none;
|
161
|
+
-webkit-appearance: none;
|
162
|
+
outline: none;
|
163
|
+
background-color: transparent;
|
164
|
+
}
|
165
|
+
.range input::-webkit-slider-runnable-track {
|
166
|
+
height: 0.6em;
|
167
|
+
}
|
168
|
+
.range input::-webkit-slider-thumb {
|
169
|
+
z-index: 1;
|
170
|
+
appearance: none;
|
171
|
+
-webkit-appearance: none;
|
172
|
+
position: relative;
|
173
|
+
height: 1.2em;
|
174
|
+
width: 1.2em;
|
175
|
+
margin-top: -0.3em;
|
176
|
+
background-color: var(${cssvar}--input-control);
|
177
|
+
border-radius: 50%;
|
178
|
+
border: solid 0.125em rgba(0, 221, 255, 0.5);
|
179
|
+
box-shadow: 0 0.1em 0.1em var(${cssvar}--shadow);
|
180
|
+
}
|
181
|
+
`,
|
182
|
+
];
|
183
|
+
__decorate([
|
184
|
+
query("input")
|
185
|
+
], BaseInput.prototype, "_input", void 0);
|
186
|
+
__decorate([
|
187
|
+
query(".range i")
|
188
|
+
], BaseInput.prototype, "_ranged", void 0);
|
189
|
+
__decorate([
|
190
|
+
property()
|
191
|
+
], BaseInput.prototype, "accept", void 0);
|
192
|
+
__decorate([
|
193
|
+
property()
|
194
|
+
], BaseInput.prototype, "label", void 0);
|
195
|
+
__decorate([
|
196
|
+
property()
|
197
|
+
], BaseInput.prototype, "name", void 0);
|
198
|
+
__decorate([
|
199
|
+
property()
|
200
|
+
], BaseInput.prototype, "pla", void 0);
|
201
|
+
__decorate([
|
202
|
+
property()
|
203
|
+
], BaseInput.prototype, "type", void 0);
|
204
|
+
__decorate([
|
205
|
+
property()
|
206
|
+
], BaseInput.prototype, "value", void 0);
|
207
|
+
__decorate([
|
208
|
+
property()
|
209
|
+
], BaseInput.prototype, "def", void 0);
|
210
|
+
__decorate([
|
211
|
+
property({ type: Boolean })
|
212
|
+
], BaseInput.prototype, "only", void 0);
|
213
|
+
__decorate([
|
214
|
+
property({ type: Number })
|
215
|
+
], BaseInput.prototype, "min", void 0);
|
216
|
+
__decorate([
|
217
|
+
property({ type: Number })
|
218
|
+
], BaseInput.prototype, "max", void 0);
|
219
|
+
__decorate([
|
220
|
+
property({ type: Number })
|
221
|
+
], BaseInput.prototype, "step", void 0);
|
222
|
+
__decorate([
|
223
|
+
property({ type: Boolean })
|
224
|
+
], BaseInput.prototype, "autofocus", void 0);
|
225
|
+
BaseInput = __decorate([
|
226
|
+
define("base-input")
|
227
|
+
], BaseInput);
|
228
|
+
export { BaseInput };
|
229
|
+
export default BaseInput;
|
@@ -1,23 +1,23 @@
|
|
1
|
-
import STD from "./std.js";
|
2
|
-
type inputtype = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
|
3
|
-
export declare class ExpInput extends STD {
|
4
|
-
static styles: (import("lit").CSSResult | import("@lit/reactive-element/css-tag.js").CSSResultGroup[])[];
|
5
|
-
label: string;
|
6
|
-
name: string;
|
7
|
-
pla: any;
|
8
|
-
type: inputtype | "textarea";
|
9
|
-
value: string;
|
10
|
-
def: string;
|
11
|
-
base: "outline" | "filed" | "underline";
|
12
|
-
offset: string;
|
13
|
-
autofocus: boolean;
|
14
|
-
_input: HTMLInputElement;
|
15
|
-
render(): import("lit").TemplateResult<1>;
|
16
|
-
}
|
17
|
-
export default ExpInput;
|
18
|
-
declare global {
|
19
|
-
interface HTMLElementTagNameMap {
|
20
|
-
"exp-input": ExpInput;
|
21
|
-
}
|
22
|
-
}
|
1
|
+
import STD from "./std.js";
|
2
|
+
type inputtype = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
|
3
|
+
export declare class ExpInput extends STD {
|
4
|
+
static styles: (import("lit").CSSResult | import("@lit/reactive-element/css-tag.js").CSSResultGroup[])[];
|
5
|
+
label: string;
|
6
|
+
name: string;
|
7
|
+
pla: any;
|
8
|
+
type: inputtype | "textarea";
|
9
|
+
value: string;
|
10
|
+
def: string;
|
11
|
+
base: "outline" | "filed" | "underline";
|
12
|
+
offset: string;
|
13
|
+
autofocus: boolean;
|
14
|
+
_input: HTMLInputElement;
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
16
|
+
}
|
17
|
+
export default ExpInput;
|
18
|
+
declare global {
|
19
|
+
interface HTMLElementTagNameMap {
|
20
|
+
"exp-input": ExpInput;
|
21
|
+
}
|
22
|
+
}
|
23
23
|
//# sourceMappingURL=exp-input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"exp-input.d.ts","sourceRoot":"","sources":["../../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