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,297 +1,311 @@
|
|
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, define, query, cssvar } from
|
8
|
-
import STD from
|
9
|
-
let SearchInput = class SearchInput extends STD {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.query = "";
|
13
|
-
this.target = "";
|
14
|
-
this.infer = false;
|
15
|
-
this.remote = false;
|
16
|
-
this.action = "./";
|
17
|
-
this.method = "get";
|
18
|
-
this.name = "q";
|
19
|
-
this.value = "";
|
20
|
-
this.pla = undefined;
|
21
|
-
this.list = [];
|
22
|
-
this.autofocus = false;
|
23
|
-
this.useinfer = async (x) => {
|
24
|
-
await new Promise((resolve) => {
|
25
|
-
setTimeout(() => {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
</
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
this.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
this.list =
|
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
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
]
|
148
|
-
__decorate([
|
149
|
-
|
150
|
-
], SearchInput.prototype, "
|
151
|
-
__decorate([
|
152
|
-
property()
|
153
|
-
], SearchInput.prototype, "
|
154
|
-
__decorate([
|
155
|
-
property()
|
156
|
-
], SearchInput.prototype, "
|
157
|
-
__decorate([
|
158
|
-
property()
|
159
|
-
], SearchInput.prototype, "
|
160
|
-
__decorate([
|
161
|
-
property()
|
162
|
-
], SearchInput.prototype, "
|
163
|
-
__decorate([
|
164
|
-
property()
|
165
|
-
], SearchInput.prototype, "
|
166
|
-
__decorate([
|
167
|
-
property(
|
168
|
-
], SearchInput.prototype, "
|
169
|
-
__decorate([
|
170
|
-
property(
|
171
|
-
], SearchInput.prototype, "
|
172
|
-
__decorate([
|
173
|
-
property(
|
174
|
-
], SearchInput.prototype, "
|
175
|
-
|
176
|
-
|
177
|
-
], SearchInput);
|
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
|
-
|
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, define, query, cssvar } from "../deps.js";
|
8
|
+
import STD from "./std.js";
|
9
|
+
let SearchInput = class SearchInput extends STD {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.query = "";
|
13
|
+
this.target = "";
|
14
|
+
this.infer = false;
|
15
|
+
this.remote = false;
|
16
|
+
this.action = "./";
|
17
|
+
this.method = "get";
|
18
|
+
this.name = "q";
|
19
|
+
this.value = "";
|
20
|
+
this.pla = undefined;
|
21
|
+
this.list = [];
|
22
|
+
this.autofocus = false;
|
23
|
+
this.useinfer = async (x) => {
|
24
|
+
await new Promise((resolve) => {
|
25
|
+
setTimeout(() => {
|
26
|
+
resolve();
|
27
|
+
}, 400);
|
28
|
+
});
|
29
|
+
return ["Undefine: useinfer", `Use: useinfer(${x} :string)`, "Return Array<string>"];
|
30
|
+
};
|
31
|
+
}
|
32
|
+
render() {
|
33
|
+
var _a;
|
34
|
+
return html `<form action=${this.action} method=${this.method}>
|
35
|
+
<div>
|
36
|
+
<input name=${this.name} @input=${this._handleInput} @change=${this._handleChange} value=${this.value} title="" placeholder=${this.pla} />
|
37
|
+
<button @click=${this._handleSubmit}>
|
38
|
+
<svg viewBox="0 0 1024 1024" width="95%" height="100%">
|
39
|
+
<path fill="currentColor" d="M745.429333 655.658667c1.173333 0.746667 2.325333 1.578667 3.413334 2.496l114.410666 96a32 32 0 0 1-41.152 49.024l-114.389333-96a32 32 0 0 1-6.208-6.976A297.429333 297.429333 0 0 1 512 768c-164.949333 0-298.666667-133.717333-298.666667-298.666667S347.050667 170.666667 512 170.666667s298.666667 133.717333 298.666667 298.666666a297.386667 297.386667 0 0 1-65.237334 186.325334zM512 704c129.6 0 234.666667-105.066667 234.666667-234.666667s-105.066667-234.666667-234.666667-234.666666-234.666667 105.066667-234.666667 234.666666 105.066667 234.666667 234.666667 234.666667z" p-id="9859"></path>
|
40
|
+
</svg>
|
41
|
+
</button>
|
42
|
+
</div>
|
43
|
+
<slot></slot>
|
44
|
+
${((_a = this.list) === null || _a === void 0 ? void 0 : _a.length)
|
45
|
+
? html `<ul>
|
46
|
+
${this.list.map((v, i) => html `<li key=${i}>${v}</li>`)}
|
47
|
+
</ul>`
|
48
|
+
: undefined}
|
49
|
+
</form>`;
|
50
|
+
}
|
51
|
+
_handleSubmit(e) {
|
52
|
+
if (!this.remote)
|
53
|
+
e.preventDefault();
|
54
|
+
this.dispatchEvent(new CustomEvent("submit", { detail: this.value }));
|
55
|
+
}
|
56
|
+
async _handleInput(e) {
|
57
|
+
const value = e.target.value.trim();
|
58
|
+
this.value = value;
|
59
|
+
if (this.compositing)
|
60
|
+
return;
|
61
|
+
if (value && this.infer) {
|
62
|
+
this.list = await this.useinfer(value);
|
63
|
+
if (!this.value) {
|
64
|
+
this.list = [];
|
65
|
+
}
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
this.list = [];
|
69
|
+
}
|
70
|
+
if (this.target && this.query) {
|
71
|
+
const targetElement = document.querySelector(this.target);
|
72
|
+
const queryElementCollection = document.querySelectorAll(this.query);
|
73
|
+
console.log();
|
74
|
+
if (!value || !targetElement || !queryElementCollection.length) {
|
75
|
+
document.querySelector(this.target).replaceChildren();
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
for (const e of queryElementCollection) {
|
79
|
+
if (e.textContent.includes(value)) {
|
80
|
+
targetElement.appendChild(e.cloneNode(true));
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
this.dispatchEvent(new CustomEvent("input", { detail: value }));
|
85
|
+
this.dispatchEvent(new CustomEvent("change", { detail: value }));
|
86
|
+
}
|
87
|
+
};
|
88
|
+
SearchInput.styles = [
|
89
|
+
STD.styles,
|
90
|
+
css `
|
91
|
+
:host {
|
92
|
+
color: var(${cssvar}--text);
|
93
|
+
display: inline-block;
|
94
|
+
min-height: 1.5rem;
|
95
|
+
width: var(${cssvar}--input-width);
|
96
|
+
border-radius: 0.75em;
|
97
|
+
background: var(${cssvar}--input-background);
|
98
|
+
}
|
99
|
+
:host(:focus) form {
|
100
|
+
outline-color: var(${cssvar}--input-outline);
|
101
|
+
}
|
102
|
+
div {
|
103
|
+
flex: 1;
|
104
|
+
display: flex;
|
105
|
+
}
|
106
|
+
form {
|
107
|
+
min-height: 100%;
|
108
|
+
outline: 0.145em solid transparent;
|
109
|
+
display: flex;
|
110
|
+
flex-direction: column;
|
111
|
+
background: inherit;
|
112
|
+
border-radius: inherit;
|
113
|
+
padding: 0;
|
114
|
+
width: 100%;
|
115
|
+
margin: 0;
|
116
|
+
overflow: hidden;
|
117
|
+
}
|
118
|
+
ul {
|
119
|
+
list-style: none;
|
120
|
+
}
|
121
|
+
li {
|
122
|
+
padding: 0.1em 0.5em;
|
123
|
+
font-size: 0.95rem;
|
124
|
+
}
|
125
|
+
li:hover {
|
126
|
+
background: var(${cssvar}--input-background-hover);
|
127
|
+
}
|
128
|
+
button,
|
129
|
+
input {
|
130
|
+
border: 0;
|
131
|
+
background: none;
|
132
|
+
outline: none;
|
133
|
+
}
|
134
|
+
button {
|
135
|
+
width: 1.8rem;
|
136
|
+
height: 1.5rem;
|
137
|
+
}
|
138
|
+
input {
|
139
|
+
flex: 1;
|
140
|
+
min-width: 0;
|
141
|
+
box-sizing: border-box;
|
142
|
+
padding-left: 0.75em;
|
143
|
+
padding-right: 0;
|
144
|
+
font-size: 1rem;
|
145
|
+
}
|
146
|
+
`,
|
147
|
+
];
|
148
|
+
__decorate([
|
149
|
+
query("input")
|
150
|
+
], SearchInput.prototype, "_input", void 0);
|
151
|
+
__decorate([
|
152
|
+
property()
|
153
|
+
], SearchInput.prototype, "query", void 0);
|
154
|
+
__decorate([
|
155
|
+
property()
|
156
|
+
], SearchInput.prototype, "target", void 0);
|
157
|
+
__decorate([
|
158
|
+
property({ type: Boolean })
|
159
|
+
], SearchInput.prototype, "infer", void 0);
|
160
|
+
__decorate([
|
161
|
+
property({ type: Boolean })
|
162
|
+
], SearchInput.prototype, "remote", void 0);
|
163
|
+
__decorate([
|
164
|
+
property()
|
165
|
+
], SearchInput.prototype, "action", void 0);
|
166
|
+
__decorate([
|
167
|
+
property()
|
168
|
+
], SearchInput.prototype, "method", void 0);
|
169
|
+
__decorate([
|
170
|
+
property()
|
171
|
+
], SearchInput.prototype, "name", void 0);
|
172
|
+
__decorate([
|
173
|
+
property()
|
174
|
+
], SearchInput.prototype, "value", void 0);
|
175
|
+
__decorate([
|
176
|
+
property()
|
177
|
+
], SearchInput.prototype, "pla", void 0);
|
178
|
+
__decorate([
|
179
|
+
property({ type: Array })
|
180
|
+
], SearchInput.prototype, "list", void 0);
|
181
|
+
__decorate([
|
182
|
+
property({ type: Boolean })
|
183
|
+
], SearchInput.prototype, "autofocus", void 0);
|
184
|
+
__decorate([
|
185
|
+
property({ attribute: false })
|
186
|
+
], SearchInput.prototype, "useinfer", void 0);
|
187
|
+
SearchInput = __decorate([
|
188
|
+
define("search-input")
|
189
|
+
], SearchInput);
|
190
|
+
export { SearchInput };
|
191
|
+
const e = [
|
192
|
+
{ action: "https://www.google.com/search", name: "q", pla: "Google" },
|
193
|
+
{ action: "https://quark.sm.cn/s", name: "q", pla: "Quark" },
|
194
|
+
{ action: "https://www.bing.com/search", name: "q", pla: "Bing" },
|
195
|
+
{ action: "https://www.sogou.com/web", name: "query", pla: "搜狗" },
|
196
|
+
{ action: "https://yandex.com/search/", name: "text", pla: "Yandex" },
|
197
|
+
{ action: "https://www.qwant.com/", name: "q", pla: "Qwant" },
|
198
|
+
];
|
199
|
+
let SearchW = class SearchW extends STD {
|
200
|
+
constructor() {
|
201
|
+
super();
|
202
|
+
Object.assign(this, e[Math.floor(Math.random() * e.length)]);
|
203
|
+
}
|
204
|
+
render() {
|
205
|
+
if (this.origin) {
|
206
|
+
Object.assign(this, e.find((v) => v.pla === this.origin));
|
207
|
+
}
|
208
|
+
return html `<form action=${this.action} method="get" target="_blank">
|
209
|
+
<input name=${this.name} placeholder=${this.pla} />
|
210
|
+
<button type="submit" aria-label="Search">
|
211
|
+
<svg viewBox="0 0 18 18"><path d="M7.25 0C3.254 0 0 3.254 0 7.25s3.254 7.25 7.25 7.25c1.727 0 3.316-.61 4.563-1.625l4.906 4.906a.757.757 0 0 0 .73.207.766.766 0 0 0 .54-.539.757.757 0 0 0-.208-.73l-4.906-4.907A7.202 7.202 0 0 0 14.5 7.25C14.5 3.254 11.246 0 7.25 0Zm0 1.5A5.74 5.74 0 0 1 13 7.25c0 1.55-.613 2.953-1.605 3.984a1.035 1.035 0 0 0-.16.16A5.726 5.726 0 0 1 7.25 13 5.74 5.74 0 0 1 1.5 7.25 5.74 5.74 0 0 1 7.25 1.5Z" fill="currentColor" fill-rule="nonzero"></path></svg>
|
212
|
+
</button>
|
213
|
+
</form>`;
|
214
|
+
}
|
215
|
+
};
|
216
|
+
SearchW.styles = [
|
217
|
+
STD.styles,
|
218
|
+
css `
|
219
|
+
:host {
|
220
|
+
width: 10em;
|
221
|
+
height: 1.5em;
|
222
|
+
display: inline-block;
|
223
|
+
border-radius: 0.75em;
|
224
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
|
225
|
+
--search: aliceblue;
|
226
|
+
--ground: currentColor;
|
227
|
+
--search-hover: rgb(20 69 155);
|
228
|
+
}
|
229
|
+
form {
|
230
|
+
color: currentColor;
|
231
|
+
display: inline-flex;
|
232
|
+
height: 100%;
|
233
|
+
box-sizing: border-box;
|
234
|
+
position: relative;
|
235
|
+
border-radius: inherit;
|
236
|
+
margin: 0;
|
237
|
+
}
|
238
|
+
input {
|
239
|
+
border-top-left-radius: inherit;
|
240
|
+
border-bottom-left-radius: inherit;
|
241
|
+
border-right: 0 !important;
|
242
|
+
box-sizing: border-box;
|
243
|
+
height: 100%;
|
244
|
+
width: 100%;
|
245
|
+
margin-top: 0px;
|
246
|
+
margin-bottom: 0px;
|
247
|
+
margin-left: 0px;
|
248
|
+
outline: none;
|
249
|
+
flex: 1 1 0%;
|
250
|
+
padding-left: 1em;
|
251
|
+
padding-right: 3.05em;
|
252
|
+
border-width: 0.08em;
|
253
|
+
border-style: solid;
|
254
|
+
border-image: initial;
|
255
|
+
border-color: var(--ground);
|
256
|
+
background-color: transparent;
|
257
|
+
color: var(--ground);
|
258
|
+
transition: all 0.2s;
|
259
|
+
}
|
260
|
+
button:hover {
|
261
|
+
background-color: var(--search-hover);
|
262
|
+
}
|
263
|
+
button {
|
264
|
+
background: currentColor;
|
265
|
+
border-top-right-radius: inherit;
|
266
|
+
border-bottom-right-radius: inherit;
|
267
|
+
margin: 0;
|
268
|
+
background: none transparent;
|
269
|
+
border-spacing: 0;
|
270
|
+
text-align: left;
|
271
|
+
align-items: center;
|
272
|
+
justify-content: center;
|
273
|
+
outline: none;
|
274
|
+
border: none;
|
275
|
+
display: inline-flex;
|
276
|
+
transition: all 0.2s;
|
277
|
+
padding: 0;
|
278
|
+
font-size: 1em;
|
279
|
+
height: 100%;
|
280
|
+
width: 2.5em;
|
281
|
+
background-color: var(--ground);
|
282
|
+
}
|
283
|
+
svg {
|
284
|
+
text-indent: 0;
|
285
|
+
font-size: 1em;
|
286
|
+
color: var(--search);
|
287
|
+
width: 0.8em;
|
288
|
+
height: 0.8em;
|
289
|
+
}
|
290
|
+
path {
|
291
|
+
mix-blend-mode: exclusion;
|
292
|
+
}
|
293
|
+
`,
|
294
|
+
];
|
295
|
+
__decorate([
|
296
|
+
property()
|
297
|
+
], SearchW.prototype, "action", void 0);
|
298
|
+
__decorate([
|
299
|
+
property()
|
300
|
+
], SearchW.prototype, "name", void 0);
|
301
|
+
__decorate([
|
302
|
+
property()
|
303
|
+
], SearchW.prototype, "pla", void 0);
|
304
|
+
__decorate([
|
305
|
+
property()
|
306
|
+
], SearchW.prototype, "origin", void 0);
|
307
|
+
SearchW = __decorate([
|
308
|
+
define("search-w")
|
309
|
+
], SearchW);
|
310
|
+
export { SearchW };
|
311
|
+
export default SearchInput;
|