godown 1.1.5 → 1.2.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/LICENSE +9 -9
- package/conf.d.ts +17 -18
- package/conf.d.ts.map +1 -1
- package/conf.js +24 -22
- package/deps.d.ts +7 -7
- package/deps.d.ts.map +1 -1
- 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.js +85 -85
- package/effect/ro-effect.d.ts +19 -19
- package/effect/ro-effect.js +76 -76
- package/effect/std.d.ts +3 -3
- package/effect/std.js +3 -3
- package/effect/tw-effect.d.ts +21 -21
- package/effect/tw-effect.js +90 -90
- package/glob.d.ts +11 -8
- package/glob.d.ts.map +1 -1
- package/glob.js +20 -9
- package/group/avatar-group.d.ts +20 -20
- package/group/avatar-group.js +88 -88
- package/group/button-group.d.ts +12 -12
- package/group/button-group.js +26 -26
- package/group/details-group.d.ts +16 -16
- package/group/details-group.js +51 -51
- package/group/index.d.ts +3 -3
- package/group/index.js +3 -3
- package/group/std.d.ts +3 -3
- package/group/std.js +3 -3
- package/index.d.ts +7 -7
- package/index.js +7 -7
- package/input-form/base-input.d.ts +33 -32
- package/input-form/base-input.d.ts.map +1 -1
- package/input-form/base-input.js +129 -129
- package/input-form/exp-input.d.ts +23 -22
- package/input-form/exp-input.d.ts.map +1 -1
- package/input-form/exp-input.js +67 -67
- package/input-form/index.d.ts +8 -8
- package/input-form/index.js +8 -8
- package/input-form/label-input.d.ts +22 -21
- package/input-form/label-input.d.ts.map +1 -1
- package/input-form/label-input.js +69 -69
- package/input-form/search-input.d.ts +37 -36
- package/input-form/search-input.d.ts.map +1 -1
- package/input-form/search-input.js +163 -163
- package/input-form/select-input.d.ts +35 -31
- package/input-form/select-input.d.ts.map +1 -1
- package/input-form/select-input.js +290 -259
- package/input-form/sign-form.d.ts +26 -25
- package/input-form/sign-form.d.ts.map +1 -1
- package/input-form/sign-form.js +147 -147
- package/input-form/split-input.d.ts +27 -26
- package/input-form/split-input.d.ts.map +1 -1
- package/input-form/split-input.js +127 -127
- package/input-form/std.d.ts +20 -19
- package/input-form/std.d.ts.map +1 -1
- package/input-form/std.js +56 -55
- package/input-form/switch-input.d.ts +23 -22
- package/input-form/switch-input.d.ts.map +1 -1
- package/input-form/switch-input.js +73 -73
- package/items/alert-item.d.ts +16 -16
- package/items/alert-item.js +69 -69
- package/items/avatar-anchor.d.ts +19 -19
- package/items/avatar-anchor.js +71 -71
- package/items/base-button.d.ts +16 -16
- package/items/base-button.js +117 -117
- package/items/dialog-item.d.ts +24 -24
- package/items/dialog-item.js +92 -92
- 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.js +76 -76
- package/items/load-track.d.ts +21 -20
- package/items/load-track.d.ts.map +1 -1
- package/items/load-track.js +76 -76
- package/items/std.d.ts +3 -3
- package/items/std.js +3 -3
- package/items/super-a.d.ts +15 -15
- package/items/super-a.js +46 -46
- package/layout/div-line.d.ts +15 -15
- package/layout/div-line.js +39 -39
- package/layout/drag-box.d.ts +25 -25
- package/layout/drag-box.js +88 -88
- package/layout/flex-flow.d.ts +13 -13
- package/layout/flex-flow.js +32 -32
- package/layout/index.d.ts +5 -5
- package/layout/index.js +5 -5
- package/layout/nav-aside.d.ts +14 -13
- package/layout/nav-aside.d.ts.map +1 -1
- package/layout/nav-aside.js +38 -38
- package/layout/nav-layout.d.ts +17 -16
- package/layout/nav-layout.d.ts.map +1 -1
- package/layout/nav-layout.js +51 -51
- package/layout/std.d.ts +4 -4
- package/layout/std.js +4 -4
- package/package.json +17 -13
- 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 +19 -18
- package/view/details-expand.d.ts.map +1 -1
- package/view/details-expand.js +53 -53
- package/view/down-drop.d.ts +19 -18
- package/view/down-drop.d.ts.map +1 -1
- package/view/down-drop.js +71 -71
- package/view/index.d.ts +5 -5
- package/view/index.js +5 -5
- package/view/menu-list.d.ts +17 -16
- package/view/menu-list.d.ts.map +1 -1
- package/view/menu-list.js +48 -48
- package/view/route-view.d.ts +46 -57
- package/view/route-view.d.ts.map +1 -1
- package/view/route-view.js +256 -257
- package/view/scroll-x.d.ts +14 -14
- package/view/scroll-x.js +47 -47
- package/view/std.d.ts +4 -4
- package/view/std.js +4 -4
- package/with.d.ts +23 -27
- package/with.d.ts.map +1 -1
- package/with.js +70 -77
- package/items/no-support.d.ts +0 -7
- package/items/no-support.d.ts.map +0 -1
- package/items/no-support.js +0 -23
@@ -1,32 +1,36 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
import { CSSResultGroup } from "../deps.js";
|
2
|
+
import STD from "./std.js";
|
3
|
+
export declare class SelectInput extends STD {
|
4
|
+
static styles: CSSResultGroup[];
|
5
|
+
open: boolean;
|
6
|
+
selcls: string;
|
7
|
+
pla?: string;
|
8
|
+
only: boolean;
|
9
|
+
def: string;
|
10
|
+
value: any[];
|
11
|
+
name: string;
|
12
|
+
text: Array<string>;
|
13
|
+
autofocus: boolean;
|
14
|
+
get assigned(): any;
|
15
|
+
_input: HTMLInputElement;
|
16
|
+
_aside: HTMLInputElement;
|
17
|
+
render(): import("lit").TemplateResult<1>;
|
18
|
+
lists(): any[];
|
19
|
+
_focusCheck(): void;
|
20
|
+
focus(options?: FocusOptions): void;
|
21
|
+
connectedCallback(): void;
|
22
|
+
getIndexFunc(option: HTMLOptionElement | any): any;
|
23
|
+
firstUpdated(): void;
|
24
|
+
disconnectedCallback(): void;
|
25
|
+
select(value: string, text?: string): void;
|
26
|
+
_handleInput(): void;
|
27
|
+
namevalue(): [string, any[]] | [string, any];
|
28
|
+
reset(): void;
|
29
|
+
}
|
30
|
+
export default SelectInput;
|
31
|
+
declare global {
|
32
|
+
interface HTMLElementTagNameMap {
|
33
|
+
"select-input": SelectInput;
|
34
|
+
}
|
35
|
+
}
|
32
36
|
//# sourceMappingURL=select-input.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select-input.d.ts","sourceRoot":"","sources":["../../src/input-form/select-input.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"select-input.d.ts","sourceRoot":"","sources":["../../src/input-form/select-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgF,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1H,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,qBACa,WAAY,SAAQ,GAAG;IAClC,MAAM,CAAC,MAAM,mBA8ES;IACsB,IAAI,UAAS;IAC7C,MAAM,SAA0C;IAChD,GAAG,CAAC,EAAE,MAAM,CAAa;IACO,IAAI,UAAS;IAC7C,GAAG,EAAE,MAAM,CAAM;IACF,KAAK,QAAM;IACT,IAAI,SAAY;IAClB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAM;IACvB,SAAS,UAAS;IAE/C,IAAI,QAAQ,IAAI,GAAG,CAElB;IACe,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzC,MAAM;IAiBN,KAAK;IAqBL,WAAW;IAMX,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAI5B,iBAAiB;IAGjB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,GAAG;IAG5C,YAAY;IAmCZ,oBAAoB,IAAI,IAAI;IAa5B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAsDnC,YAAY;IAwCZ,SAAS,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAM5C,KAAK;CAuBN;AAGD,eAAe,WAAW,CAAC;AAC3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
@@ -1,34 +1,34 @@
|
|
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,
|
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() {
|
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, define, conf, cssvar, DisableWarning, LitElement } 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
26
|
return html `<div>
|
27
27
|
<section>${this.lists()}</section>
|
28
28
|
<input
|
29
29
|
id="input"
|
30
|
-
@focus=${() => {
|
31
|
-
this.open = true;
|
30
|
+
@focus=${() => {
|
31
|
+
this.open = true;
|
32
32
|
}}
|
33
33
|
@input=${this._handleInput}
|
34
34
|
placeholder=${this.pla}
|
@@ -37,206 +37,236 @@ let SelectInput = class SelectInput extends STD {
|
|
37
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
38
|
</label>
|
39
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) {
|
40
|
+
</div>`;
|
41
|
+
}
|
42
|
+
lists() {
|
43
|
+
const itemTemplates = [];
|
44
|
+
if (this.value.length)
|
45
|
+
for (const i in this.value) {
|
46
46
|
itemTemplates.push(html `<i class="selected-item">
|
47
47
|
${this.text[i] || this.value[i]}
|
48
48
|
<svg
|
49
|
-
@click=${() => {
|
50
|
-
this.select(this.value[i]);
|
49
|
+
@click=${() => {
|
50
|
+
this.select(this.value[i]);
|
51
51
|
}}
|
52
|
-
t="1678769821062"
|
53
52
|
viewBox="0 0 1024 1024"
|
54
53
|
version="1.1"
|
55
|
-
p-id="2770"
|
56
54
|
>
|
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"
|
55
|
+
<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"></path>
|
58
56
|
</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
|
-
|
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
|
-
|
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
|
-
if (option
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
if (
|
181
|
-
option.
|
182
|
-
}
|
183
|
-
else {
|
184
|
-
option.
|
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
|
-
option.
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
57
|
+
</i>`);
|
58
|
+
}
|
59
|
+
return itemTemplates;
|
60
|
+
}
|
61
|
+
_focusCheck() {
|
62
|
+
var _a;
|
63
|
+
if (this.autofocus) {
|
64
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus();
|
65
|
+
this.open = true;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
focus(options) {
|
69
|
+
var _a;
|
70
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus(options);
|
71
|
+
this.open = true;
|
72
|
+
}
|
73
|
+
connectedCallback() {
|
74
|
+
LitElement.prototype.connectedCallback.call(this);
|
75
|
+
}
|
76
|
+
getIndexFunc(option) {
|
77
|
+
return this.getIndexFunc(option);
|
78
|
+
}
|
79
|
+
firstUpdated() {
|
80
|
+
if (this.def) {
|
81
|
+
if (this.only) {
|
82
|
+
this.select(this.def);
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
for (const i of this.def.split(";")) {
|
86
|
+
if (i.trim()) {
|
87
|
+
this.select(i);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
this._focusCheck();
|
93
|
+
this.assigned.forEach((option) => {
|
94
|
+
if (this.getIndexFunc(option)) {
|
95
|
+
option.addEventListener("click", () => {
|
96
|
+
this.select(this.getIndexFunc(option), option.innerText);
|
97
|
+
});
|
98
|
+
}
|
99
|
+
else if (option.children) {
|
100
|
+
[...option.children].forEach((option) => {
|
101
|
+
option.addEventListener("click", () => {
|
102
|
+
this.select(this.getIndexFunc(option), option.innerText);
|
103
|
+
});
|
104
|
+
});
|
105
|
+
}
|
106
|
+
});
|
107
|
+
this.addEventListener("change", () => {
|
108
|
+
this.open = !this.only;
|
109
|
+
});
|
110
|
+
document.addEventListener("click", (e) => {
|
111
|
+
if (!this.contains(e.target)) {
|
112
|
+
this.open = false;
|
113
|
+
}
|
114
|
+
});
|
115
|
+
}
|
116
|
+
disconnectedCallback() {
|
117
|
+
this.assigned.forEach((option) => {
|
118
|
+
if (this.getIndexFunc(option)) {
|
119
|
+
option.removeEventListener("click", () => { });
|
120
|
+
}
|
121
|
+
else if (option.children) {
|
122
|
+
[...option.children].forEach((option) => {
|
123
|
+
option.removeEventListener("click", () => {
|
124
|
+
this.select(this.getIndexFunc(option), option.innerText);
|
125
|
+
});
|
126
|
+
});
|
127
|
+
}
|
128
|
+
});
|
129
|
+
}
|
130
|
+
select(value, text) {
|
131
|
+
if (text === undefined || text === null) {
|
132
|
+
this.assigned.forEach((option) => {
|
133
|
+
if (this.getIndexFunc(option)) {
|
134
|
+
if (this.getIndexFunc(option) == value) {
|
135
|
+
text = option.innerText;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
else if (option.children) {
|
139
|
+
[...option.children].forEach((option) => {
|
140
|
+
if (this.getIndexFunc(option) == value) {
|
141
|
+
text = option.innerText;
|
142
|
+
}
|
143
|
+
});
|
144
|
+
}
|
145
|
+
});
|
146
|
+
}
|
147
|
+
if (this.value.includes(value)) {
|
148
|
+
if (!this.only) {
|
149
|
+
this.value = this.value.filter((v) => v != value);
|
150
|
+
this.text = this.text.filter((v) => v != text);
|
151
|
+
}
|
152
|
+
else {
|
153
|
+
this.value = [];
|
154
|
+
this.text = [];
|
155
|
+
}
|
156
|
+
}
|
157
|
+
else {
|
158
|
+
if (!this.only) {
|
159
|
+
this.value.push(value);
|
160
|
+
this.text.push(text);
|
161
|
+
}
|
162
|
+
else {
|
163
|
+
this.value = [value];
|
164
|
+
this.text = [text];
|
165
|
+
}
|
166
|
+
}
|
167
|
+
this.assigned.forEach((option) => {
|
168
|
+
if (this.getIndexFunc(option)) {
|
169
|
+
if (this.value.includes(this.getIndexFunc(option))) {
|
170
|
+
option.classList.add(this.selcls);
|
171
|
+
}
|
172
|
+
else {
|
173
|
+
option.classList.remove(this.selcls);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
else if (option.children) {
|
177
|
+
[...option.children].forEach((option) => {
|
178
|
+
if (this.value.includes(this.getIndexFunc(option))) {
|
179
|
+
option.classList.add(this.selcls);
|
180
|
+
}
|
181
|
+
else {
|
182
|
+
option.classList.remove(this.selcls);
|
183
|
+
}
|
184
|
+
});
|
185
|
+
}
|
186
|
+
});
|
187
|
+
this._input.value = "";
|
188
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.namevalue() }));
|
189
|
+
this.requestUpdate();
|
190
|
+
}
|
191
|
+
_handleInput() {
|
192
|
+
let value = this._input.value.trim();
|
193
|
+
if (!this.only && value.includes(";")) {
|
194
|
+
value = value.split(";").pop().trim();
|
195
|
+
}
|
196
|
+
this.assigned.forEach((option) => {
|
197
|
+
if (this.getIndexFunc(option)) {
|
198
|
+
option.style.display = "block";
|
199
|
+
}
|
200
|
+
if (option.children) {
|
201
|
+
option.style.display = "block";
|
202
|
+
[...option.children].forEach((option) => {
|
203
|
+
option.style.display = "block";
|
204
|
+
});
|
205
|
+
}
|
206
|
+
});
|
207
|
+
if (value) {
|
208
|
+
this.assigned.forEach((option) => {
|
209
|
+
if (this.getIndexFunc(option)) {
|
210
|
+
if (this.getIndexFunc(option).toLowerCase().includes(value.toLowerCase()) || option.innerText.toLowerCase().includes(value.toLowerCase())) {
|
211
|
+
option.style.display = "block";
|
212
|
+
}
|
213
|
+
else {
|
214
|
+
option.style.display = "none";
|
215
|
+
}
|
216
|
+
}
|
217
|
+
else if (option.children) {
|
218
|
+
[...option.children].forEach((option) => {
|
219
|
+
if (this.getIndexFunc(option).toLowerCase().includes(value.toLowerCase()) || option.innerText.toLowerCase().includes(value.toLowerCase())) {
|
220
|
+
option.style.display = "block";
|
221
|
+
}
|
222
|
+
else {
|
223
|
+
option.style.display = "none";
|
224
|
+
}
|
225
|
+
});
|
226
|
+
if ([...option.children].filter((option) => option.style.display == "block").length == 0) {
|
227
|
+
option.style.display = "none";
|
228
|
+
}
|
229
|
+
}
|
230
|
+
});
|
231
|
+
}
|
232
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.namevalue() }));
|
233
|
+
}
|
234
|
+
namevalue() {
|
235
|
+
if (!this.only) {
|
236
|
+
return [this.name, this.value];
|
237
|
+
}
|
238
|
+
return [this.name, this.value[0]];
|
239
|
+
}
|
240
|
+
reset() {
|
241
|
+
this.value = [];
|
242
|
+
this.text = [];
|
243
|
+
this._input.value = "";
|
244
|
+
this.assigned.forEach((option) => {
|
245
|
+
if (this.getIndexFunc(option)) {
|
246
|
+
option.classList.remove(this.selcls);
|
247
|
+
}
|
248
|
+
else if (option.children) {
|
249
|
+
[...option.children].forEach((option) => {
|
250
|
+
option.classList.remove(this.selcls);
|
251
|
+
});
|
252
|
+
}
|
253
|
+
});
|
254
|
+
if (this.def) {
|
255
|
+
if (!this.only) {
|
256
|
+
this.def.split(";").forEach((def) => {
|
257
|
+
if (def.trim())
|
258
|
+
this.select(def.trim(), null);
|
259
|
+
});
|
260
|
+
}
|
261
|
+
else {
|
262
|
+
if (this.def.split(";")[0].trim())
|
263
|
+
this.select(this.def.split(";")[0].trim(), null);
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
};
|
268
|
+
SelectInput.styles = [
|
269
|
+
STD.styles,
|
240
270
|
css `
|
241
271
|
:host {
|
242
272
|
background: var(${cssvar}--input-background);
|
@@ -312,43 +342,44 @@ SelectInput.styles = [
|
|
312
342
|
aside[open] {
|
313
343
|
visibility: visible;
|
314
344
|
}
|
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
|
-
|
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
|
-
|
345
|
+
`,
|
346
|
+
];
|
347
|
+
__decorate([
|
348
|
+
property({ type: Boolean, reflect: true })
|
349
|
+
], SelectInput.prototype, "open", void 0);
|
350
|
+
__decorate([
|
351
|
+
property()
|
352
|
+
], SelectInput.prototype, "selcls", void 0);
|
353
|
+
__decorate([
|
354
|
+
property()
|
355
|
+
], SelectInput.prototype, "pla", void 0);
|
356
|
+
__decorate([
|
357
|
+
property({ type: Boolean, reflect: true })
|
358
|
+
], SelectInput.prototype, "only", void 0);
|
359
|
+
__decorate([
|
360
|
+
property()
|
361
|
+
], SelectInput.prototype, "def", void 0);
|
362
|
+
__decorate([
|
363
|
+
property({ type: Array })
|
364
|
+
], SelectInput.prototype, "value", void 0);
|
365
|
+
__decorate([
|
366
|
+
property({ reflect: true })
|
367
|
+
], SelectInput.prototype, "name", void 0);
|
368
|
+
__decorate([
|
369
|
+
property({ type: Array })
|
370
|
+
], SelectInput.prototype, "text", void 0);
|
371
|
+
__decorate([
|
372
|
+
property({ type: Boolean })
|
373
|
+
], SelectInput.prototype, "autofocus", void 0);
|
374
|
+
__decorate([
|
375
|
+
query("input")
|
376
|
+
], SelectInput.prototype, "_input", void 0);
|
377
|
+
__decorate([
|
378
|
+
query("aside")
|
379
|
+
], SelectInput.prototype, "_aside", void 0);
|
380
|
+
SelectInput = __decorate([
|
381
|
+
define("select-input")
|
382
|
+
], SelectInput);
|
383
|
+
export { SelectInput };
|
384
|
+
DisableWarning(SelectInput);
|
385
|
+
export default SelectInput;
|