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,330 +1,354 @@
|
|
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, state, define, conf, cssvar } from
|
8
|
-
import STD from
|
9
|
-
let SelectInput = class SelectInput extends STD {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.open = false;
|
13
|
-
this.selcls = `${conf.tag(
|
14
|
-
this.pla = undefined;
|
15
|
-
this.only = false;
|
16
|
-
this.def = "";
|
17
|
-
this.value = [];
|
18
|
-
this.name = "select";
|
19
|
-
this.text = [];
|
20
|
-
this.autofocus = false;
|
21
|
-
}
|
22
|
-
get assigned() {
|
23
|
-
return this.shadowRoot.querySelector(
|
24
|
-
}
|
25
|
-
render() {
|
26
|
-
return html `<div
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<svg
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
if (this.
|
45
|
-
(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
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
|
-
this.
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
if (option.
|
147
|
-
option.
|
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
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
});
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
]
|
317
|
-
__decorate([
|
318
|
-
property({ type: Boolean })
|
319
|
-
], SelectInput.prototype, "
|
320
|
-
__decorate([
|
321
|
-
|
322
|
-
], SelectInput.prototype, "
|
323
|
-
__decorate([
|
324
|
-
|
325
|
-
], SelectInput.prototype, "
|
326
|
-
|
327
|
-
|
328
|
-
], SelectInput);
|
329
|
-
|
330
|
-
|
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, state, define, conf, cssvar } from "../deps.js";
|
8
|
+
import STD from "./std.js";
|
9
|
+
let SelectInput = class SelectInput extends STD {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.open = false;
|
13
|
+
this.selcls = `${conf.tag("select-input")}-selected`;
|
14
|
+
this.pla = undefined;
|
15
|
+
this.only = false;
|
16
|
+
this.def = "";
|
17
|
+
this.value = [];
|
18
|
+
this.name = "select";
|
19
|
+
this.text = [];
|
20
|
+
this.autofocus = false;
|
21
|
+
}
|
22
|
+
get assigned() {
|
23
|
+
return this.shadowRoot.querySelector("slot").assignedElements();
|
24
|
+
}
|
25
|
+
render() {
|
26
|
+
return html `<div>
|
27
|
+
<section>${this.lists()}</section>
|
28
|
+
<input
|
29
|
+
id="input"
|
30
|
+
@focus=${() => {
|
31
|
+
this.open = true;
|
32
|
+
}}
|
33
|
+
@input=${this._handleInput}
|
34
|
+
placeholder=${this.pla}
|
35
|
+
/>
|
36
|
+
<label for="input">
|
37
|
+
<svg viewBox="0 0 48 48" fill="none"><path d="M36 19L24 31L12 19H36Z" fill="currentColor" stroke="currentColor" stroke-width="3" stroke-linejoin="round" /></svg>
|
38
|
+
</label>
|
39
|
+
<aside ?open=${this.open}><slot></slot></aside>
|
40
|
+
</div>`;
|
41
|
+
}
|
42
|
+
lists() {
|
43
|
+
const itemTemplates = [];
|
44
|
+
if (this.value.length)
|
45
|
+
for (const i in this.value) {
|
46
|
+
itemTemplates.push(html `<i class="selected-item">
|
47
|
+
${this.text[i] || this.value[i]}
|
48
|
+
<svg
|
49
|
+
@click=${() => {
|
50
|
+
this.select(this.value[i]);
|
51
|
+
}}
|
52
|
+
t="1678769821062"
|
53
|
+
viewBox="0 0 1024 1024"
|
54
|
+
version="1.1"
|
55
|
+
p-id="2770"
|
56
|
+
>
|
57
|
+
<path d="M960 512c0-249.6-198.4-448-448-448S64 262.4 64 512s198.4 448 448 448 448-198.4 448-448zM691.2 736L512 556.8 332.8 736c-12.8 12.8-32 12.8-44.8 0-12.8-12.8-12.8-32 0-44.8L467.2 512 288 332.8c-12.8-12.8-12.8-32 0-44.8 12.8-12.8 32-12.8 44.8 0L512 467.2 691.2 288c12.8-12.8 32-12.8 44.8 0 12.8 12.8 12.8 32 0 44.8L556.8 512 736 691.2c12.8 12.8 12.8 32 0 44.8-12.8 12.8-32 12.8-44.8 0z" fill="currentColor" p-id="2771"></path>
|
58
|
+
</svg>
|
59
|
+
</i>`);
|
60
|
+
}
|
61
|
+
return itemTemplates;
|
62
|
+
}
|
63
|
+
_focusCheck() {
|
64
|
+
var _a;
|
65
|
+
if (this.autofocus) {
|
66
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus();
|
67
|
+
this.open = true;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
focus(options) {
|
71
|
+
var _a;
|
72
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus(options);
|
73
|
+
this.open = true;
|
74
|
+
}
|
75
|
+
firstUpdated() {
|
76
|
+
this._focusCheck();
|
77
|
+
this.assigned.forEach((option) => {
|
78
|
+
if (option.value) {
|
79
|
+
option.addEventListener("click", () => {
|
80
|
+
this.select(option.value, option.innerText);
|
81
|
+
});
|
82
|
+
}
|
83
|
+
else if (option.children) {
|
84
|
+
[...option.children].forEach((option) => {
|
85
|
+
option.addEventListener("click", () => {
|
86
|
+
this.select(option.value, option.innerText);
|
87
|
+
});
|
88
|
+
});
|
89
|
+
}
|
90
|
+
});
|
91
|
+
this.addEventListener("change", (e) => {
|
92
|
+
this.open = !this.only;
|
93
|
+
});
|
94
|
+
document.addEventListener("click", (e) => {
|
95
|
+
if (!this.contains(e.target)) {
|
96
|
+
this.open = false;
|
97
|
+
}
|
98
|
+
});
|
99
|
+
}
|
100
|
+
select(value, text) {
|
101
|
+
if (text === undefined || text === null) {
|
102
|
+
this.assigned.forEach((option) => {
|
103
|
+
if (option.value) {
|
104
|
+
if (option.value == value) {
|
105
|
+
text = option.innerText;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
else if (option.children) {
|
109
|
+
[...option.children].forEach((option) => {
|
110
|
+
if (option.value == value) {
|
111
|
+
text = option.innerText;
|
112
|
+
}
|
113
|
+
});
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
if (this.value.includes(value)) {
|
118
|
+
if (!this.only) {
|
119
|
+
this.value = this.value.filter((v) => v != value);
|
120
|
+
this.text = this.text.filter((v) => v != text);
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
this.value = [];
|
124
|
+
this.text = [];
|
125
|
+
}
|
126
|
+
}
|
127
|
+
else {
|
128
|
+
if (!this.only) {
|
129
|
+
this.value.push(value);
|
130
|
+
this.text.push(text);
|
131
|
+
}
|
132
|
+
else {
|
133
|
+
this.value = [value];
|
134
|
+
this.text = [text];
|
135
|
+
}
|
136
|
+
}
|
137
|
+
this.assigned.forEach((option) => {
|
138
|
+
if (option.value) {
|
139
|
+
if (this.value.includes(option.value)) {
|
140
|
+
option.classList.add(this.selcls);
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
option.classList.remove(this.selcls);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
else if (option.children) {
|
147
|
+
[...option.children].forEach((option) => {
|
148
|
+
if (this.value.includes(option.value)) {
|
149
|
+
option.classList.add(this.selcls);
|
150
|
+
}
|
151
|
+
else {
|
152
|
+
option.classList.remove(this.selcls);
|
153
|
+
}
|
154
|
+
});
|
155
|
+
}
|
156
|
+
});
|
157
|
+
this._input.value = "";
|
158
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.namevalue() }));
|
159
|
+
this.requestUpdate();
|
160
|
+
}
|
161
|
+
_handleInput() {
|
162
|
+
let value = this._input.value.trim();
|
163
|
+
if (!this.only && value.includes(";")) {
|
164
|
+
value = value.split(";").pop().trim();
|
165
|
+
}
|
166
|
+
this.assigned.forEach((option) => {
|
167
|
+
if (option.value) {
|
168
|
+
option.style.display = "block";
|
169
|
+
}
|
170
|
+
if (option.children) {
|
171
|
+
option.style.display = "block";
|
172
|
+
[...option.children].forEach((option) => {
|
173
|
+
option.style.display = "block";
|
174
|
+
});
|
175
|
+
}
|
176
|
+
});
|
177
|
+
if (value) {
|
178
|
+
this.assigned.forEach((option) => {
|
179
|
+
if (option.value) {
|
180
|
+
if (option.value.toLowerCase().includes(value.toLowerCase()) || option.innerText.toLowerCase().includes(value.toLowerCase())) {
|
181
|
+
option.style.display = "block";
|
182
|
+
}
|
183
|
+
else {
|
184
|
+
option.style.display = "none";
|
185
|
+
}
|
186
|
+
}
|
187
|
+
else if (option.children) {
|
188
|
+
[...option.children].forEach((option) => {
|
189
|
+
if (option.value.toLowerCase().includes(value.toLowerCase()) || option.innerText.toLowerCase().includes(value.toLowerCase())) {
|
190
|
+
option.style.display = "block";
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
option.style.display = "none";
|
194
|
+
}
|
195
|
+
});
|
196
|
+
if ([...option.children].filter((option) => option.style.display == "block").length == 0) {
|
197
|
+
option.style.display = "none";
|
198
|
+
}
|
199
|
+
}
|
200
|
+
});
|
201
|
+
}
|
202
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.namevalue() }));
|
203
|
+
}
|
204
|
+
namevalue() {
|
205
|
+
if (!this.only) {
|
206
|
+
return [this.name, this.value];
|
207
|
+
}
|
208
|
+
return [this.name, this.value[0]];
|
209
|
+
}
|
210
|
+
reset() {
|
211
|
+
this.value = [];
|
212
|
+
this.text = [];
|
213
|
+
this._input.value = "";
|
214
|
+
this.assigned.forEach((option) => {
|
215
|
+
if (option.value) {
|
216
|
+
option.classList.remove(this.selcls);
|
217
|
+
}
|
218
|
+
else if (option.children) {
|
219
|
+
[...option.children].forEach((option) => {
|
220
|
+
option.classList.remove(this.selcls);
|
221
|
+
});
|
222
|
+
}
|
223
|
+
});
|
224
|
+
if (this.def) {
|
225
|
+
if (!this.only) {
|
226
|
+
this.def.split(";").forEach((def) => {
|
227
|
+
if (def.trim())
|
228
|
+
this.select(def.trim(), null);
|
229
|
+
});
|
230
|
+
}
|
231
|
+
else {
|
232
|
+
if (this.def.split(";")[0].trim())
|
233
|
+
this.select(this.def.split(";")[0].trim(), null);
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
};
|
238
|
+
SelectInput.styles = [
|
239
|
+
STD.styles,
|
240
|
+
css `
|
241
|
+
:host {
|
242
|
+
background: var(${cssvar}--input-background);
|
243
|
+
color: var(${cssvar}--text);
|
244
|
+
display: inline-flex;
|
245
|
+
outline: 0.145em solid transparent;
|
246
|
+
border-radius: 0.25em;
|
247
|
+
height: 1.5em;
|
248
|
+
width: var(${cssvar}--input-width);
|
249
|
+
}
|
250
|
+
:host([open]) {
|
251
|
+
outline-color: var(${cssvar}--input-outline-focus);
|
252
|
+
}
|
253
|
+
input {
|
254
|
+
padding: 0px 0px 0px 0.25em;
|
255
|
+
background: none;
|
256
|
+
cursor: inherit;
|
257
|
+
height: 100%;
|
258
|
+
width: 100%;
|
259
|
+
box-sizing: border-box;
|
260
|
+
border: inherit;
|
261
|
+
outline: none;
|
262
|
+
border-radius: inherit;
|
263
|
+
flex: 1;
|
264
|
+
}
|
265
|
+
div {
|
266
|
+
display: inline-flex;
|
267
|
+
position: relative;
|
268
|
+
width: 100%;
|
269
|
+
border-radius: inherit;
|
270
|
+
z-index: inherit;
|
271
|
+
}
|
272
|
+
label svg {
|
273
|
+
height: 100%;
|
274
|
+
}
|
275
|
+
aside {
|
276
|
+
margin-top: 1px;
|
277
|
+
position: absolute;
|
278
|
+
top: 100%;
|
279
|
+
width: 100%;
|
280
|
+
visibility: hidden;
|
281
|
+
z-index: 1;
|
282
|
+
border-radius: inherit;
|
283
|
+
}
|
284
|
+
section {
|
285
|
+
max-width: calc(100% - 1.2em);
|
286
|
+
height: 100%;
|
287
|
+
overflow: hidden;
|
288
|
+
pointer-events: none;
|
289
|
+
border-radius: inherit;
|
290
|
+
z-index: inherit;
|
291
|
+
}
|
292
|
+
i.selected-item {
|
293
|
+
background: var(${cssvar}--input-true);
|
294
|
+
border-radius: inherit;
|
295
|
+
height: 100%;
|
296
|
+
float: left;
|
297
|
+
display: inline-flex;
|
298
|
+
font-style: normal;
|
299
|
+
align-items: center;
|
300
|
+
padding-left: 0.1em;
|
301
|
+
margin-left: 0.065em;
|
302
|
+
}
|
303
|
+
i:first-child {
|
304
|
+
margin-left: 0;
|
305
|
+
}
|
306
|
+
i.selected-item svg {
|
307
|
+
width: 1em;
|
308
|
+
padding: 0 0.12em;
|
309
|
+
height: 0.8em;
|
310
|
+
pointer-events: all;
|
311
|
+
}
|
312
|
+
aside[open] {
|
313
|
+
visibility: visible;
|
314
|
+
}
|
315
|
+
`,
|
316
|
+
];
|
317
|
+
__decorate([
|
318
|
+
property({ type: Boolean, reflect: true })
|
319
|
+
], SelectInput.prototype, "open", void 0);
|
320
|
+
__decorate([
|
321
|
+
property()
|
322
|
+
], SelectInput.prototype, "selcls", void 0);
|
323
|
+
__decorate([
|
324
|
+
property()
|
325
|
+
], SelectInput.prototype, "pla", void 0);
|
326
|
+
__decorate([
|
327
|
+
property({ type: Boolean })
|
328
|
+
], SelectInput.prototype, "only", void 0);
|
329
|
+
__decorate([
|
330
|
+
property()
|
331
|
+
], SelectInput.prototype, "def", void 0);
|
332
|
+
__decorate([
|
333
|
+
property({ type: Array })
|
334
|
+
], SelectInput.prototype, "value", void 0);
|
335
|
+
__decorate([
|
336
|
+
property()
|
337
|
+
], SelectInput.prototype, "name", void 0);
|
338
|
+
__decorate([
|
339
|
+
state()
|
340
|
+
], SelectInput.prototype, "text", void 0);
|
341
|
+
__decorate([
|
342
|
+
property({ type: Boolean })
|
343
|
+
], SelectInput.prototype, "autofocus", void 0);
|
344
|
+
__decorate([
|
345
|
+
query("input")
|
346
|
+
], SelectInput.prototype, "_input", void 0);
|
347
|
+
__decorate([
|
348
|
+
query("aside")
|
349
|
+
], SelectInput.prototype, "_aside", void 0);
|
350
|
+
SelectInput = __decorate([
|
351
|
+
define("select-input")
|
352
|
+
], SelectInput);
|
353
|
+
export { SelectInput };
|
354
|
+
export default SelectInput;
|