@polyv/utils-dom 3.0.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/dom-wrap.d.ts +751 -0
- package/event-wrap.d.ts +69 -0
- package/index.cjs +1 -0
- package/index.d.ts +57 -0
- package/index.js +1036 -0
- package/interfaces.d.ts +27 -0
- package/internal/data-space.d.ts +96 -0
- package/internal/dom-attr.d.ts +35 -0
- package/internal/dom-base.d.ts +77 -0
- package/internal/dom-class.d.ts +26 -0
- package/internal/dom-data.d.ts +43 -0
- package/internal/dom-event.d.ts +24 -0
- package/internal/dom-id.d.ts +17 -0
- package/internal/dom-insertion.d.ts +35 -0
- package/internal/dom-offset.d.ts +8 -0
- package/internal/dom-scroll.d.ts +16 -0
- package/internal/dom-size.d.ts +11 -0
- package/internal/dom-style.d.ts +25 -0
- package/internal/dom-traversal.d.ts +46 -0
- package/package.json +22 -0
- package/selector.d.ts +18 -0
- package/types.d.ts +16 -0
package/index.js
ADDED
|
@@ -0,0 +1,1036 @@
|
|
|
1
|
+
import { isArrayLike as e, mergeArray as t, toArray as n } from "@polyv/utils-array";
|
|
2
|
+
import { hasOwnProp as r, isEmpty as i } from "@polyv/utils-object";
|
|
3
|
+
//#region src/internal/dom-base.ts
|
|
4
|
+
function a(e) {
|
|
5
|
+
return e != null && e == e.window;
|
|
6
|
+
}
|
|
7
|
+
function o(e) {
|
|
8
|
+
return e != null && !a(e) && typeof e.nodeType == "number";
|
|
9
|
+
}
|
|
10
|
+
function s(e) {
|
|
11
|
+
return o(e) && e.nodeType === 9;
|
|
12
|
+
}
|
|
13
|
+
function c(e) {
|
|
14
|
+
return e != null && !a(e) && e.nodeType === 1 && "style" in e;
|
|
15
|
+
}
|
|
16
|
+
function l(e) {
|
|
17
|
+
let t;
|
|
18
|
+
return t = typeof e == "string" ? e.split(/\s+/) : e || [], t;
|
|
19
|
+
}
|
|
20
|
+
function u(t, n) {
|
|
21
|
+
if (e(t)) {
|
|
22
|
+
let e = t, r = e.length;
|
|
23
|
+
for (let t = 0; t < r; t++) u(e[t], n);
|
|
24
|
+
} else if (c(t)) return n(t);
|
|
25
|
+
}
|
|
26
|
+
function d(e, t, n, i = !1, a) {
|
|
27
|
+
if (typeof t == "object" && t) {
|
|
28
|
+
for (let n in t) r(t, n) && d(e, n, t[n], i, a);
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
let o = e.length;
|
|
32
|
+
if (n !== void 0) {
|
|
33
|
+
i &&= typeof n == "function";
|
|
34
|
+
let r = -1;
|
|
35
|
+
for (; ++r < o;) a.set.call(e, e[r], t, i ? n.call(e[r], e[r], a.get.call(e, e[r], t), r) : n);
|
|
36
|
+
return e;
|
|
37
|
+
}
|
|
38
|
+
return o ? a.get.call(e, e[0], t) : null;
|
|
39
|
+
}
|
|
40
|
+
var f = !1;
|
|
41
|
+
function ee(e, t) {
|
|
42
|
+
if (e === t) return f = !0, 0;
|
|
43
|
+
let n = !e.compareDocumentPosition - !t.compareDocumentPosition;
|
|
44
|
+
return n || (n = e.compareDocumentPosition(t), n & 1 ? e.compareDocumentPosition(document) & 1 ? 1 : t.compareDocumentPosition(document) & 1 ? -1 : 0 : n & 4 || n & 16 ? -1 : 1);
|
|
45
|
+
}
|
|
46
|
+
function p(e) {
|
|
47
|
+
if (e.length <= 1) return e;
|
|
48
|
+
if (f = !1, e.sort(ee), f) {
|
|
49
|
+
let t = 0, n = 0, r, i = [];
|
|
50
|
+
for (; r = e[t++];) r === e[t] && (n = i.push(t));
|
|
51
|
+
for (; n--;) e.splice(i[n], 1);
|
|
52
|
+
}
|
|
53
|
+
return e;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/selector.ts
|
|
57
|
+
var te = "just4__query__context";
|
|
58
|
+
function m(e, t = document) {
|
|
59
|
+
let n;
|
|
60
|
+
if (t.nodeType === 9 || !(n = t.parentElement)) return t.querySelectorAll(e);
|
|
61
|
+
let r = t, i = r.getAttribute("id"), a = 0;
|
|
62
|
+
i || (a = i == null ? 1 : 2, i = te, r.setAttribute("id", i));
|
|
63
|
+
let o = "#" + i + " ";
|
|
64
|
+
e = o + e.replace(/\s*,\s*/g, function(e) {
|
|
65
|
+
return e + o;
|
|
66
|
+
});
|
|
67
|
+
try {
|
|
68
|
+
return n.querySelectorAll(e);
|
|
69
|
+
} finally {
|
|
70
|
+
switch (a) {
|
|
71
|
+
case 1:
|
|
72
|
+
r.removeAttribute("id");
|
|
73
|
+
break;
|
|
74
|
+
case 2:
|
|
75
|
+
r.setAttribute("id", "");
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
var h = document.documentElement, ne = h.matches || h.webkitMatchesSelector || h.mozMatchesSelector || h.oMatchesSelector || h.msMatchesSelector;
|
|
81
|
+
function g(e, t) {
|
|
82
|
+
try {
|
|
83
|
+
return ne.call(e, t);
|
|
84
|
+
} catch {
|
|
85
|
+
return !1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/internal/dom-traversal.ts
|
|
90
|
+
function _(e) {
|
|
91
|
+
if (!e) return [];
|
|
92
|
+
let n = e;
|
|
93
|
+
if (n.nodeType !== 1 && n.nodeType !== 9 && n.nodeType !== 11) return [n];
|
|
94
|
+
let r = n;
|
|
95
|
+
return t([r], r.querySelectorAll("*"));
|
|
96
|
+
}
|
|
97
|
+
function v(e, t) {
|
|
98
|
+
return t ? e.filter(function(e) {
|
|
99
|
+
return g(e, t);
|
|
100
|
+
}) : e;
|
|
101
|
+
}
|
|
102
|
+
function re(e, t, n) {
|
|
103
|
+
return e.length ? (p(e), (t === "parentNode" || t === "previousElementSibling") && e.reverse(), v(e, n)) : e;
|
|
104
|
+
}
|
|
105
|
+
function y(e, t, n, r) {
|
|
106
|
+
let i;
|
|
107
|
+
typeof n == "string" ? i = function(e) {
|
|
108
|
+
return g(e, n);
|
|
109
|
+
} : o(n) ? i = function(e) {
|
|
110
|
+
return e === n;
|
|
111
|
+
} : Array.isArray(n) && (i = function(e) {
|
|
112
|
+
return n.indexOf(e) !== -1;
|
|
113
|
+
});
|
|
114
|
+
let a = [];
|
|
115
|
+
return u(e, function(e) {
|
|
116
|
+
for (; (e = e[t]) && (!i || !i(e));) a.push(e);
|
|
117
|
+
}), re(a, t, r);
|
|
118
|
+
}
|
|
119
|
+
function b(e, t, n, r) {
|
|
120
|
+
let i = [];
|
|
121
|
+
return u(e, function(e) {
|
|
122
|
+
for (; (e = e[t]) && (i.push(e), !r););
|
|
123
|
+
}), re(i, t, n);
|
|
124
|
+
}
|
|
125
|
+
function ie(e, t) {
|
|
126
|
+
let n = [];
|
|
127
|
+
return u(e, function(e) {
|
|
128
|
+
let t = e.firstElementChild;
|
|
129
|
+
for (; t;) n.push(t), t = t.nextElementSibling;
|
|
130
|
+
}), p(n), v(n, t);
|
|
131
|
+
}
|
|
132
|
+
function ae(e, t) {
|
|
133
|
+
let n = [];
|
|
134
|
+
return u(e, function(e) {
|
|
135
|
+
let t = e;
|
|
136
|
+
for (; t = t.previousElementSibling;) n.push(t);
|
|
137
|
+
for (t = e; t = t.nextElementSibling;) n.push(t);
|
|
138
|
+
}), v(p(n), t);
|
|
139
|
+
}
|
|
140
|
+
function oe(e) {
|
|
141
|
+
return u(e, function(e) {
|
|
142
|
+
let t = e.parentElement;
|
|
143
|
+
if (t) {
|
|
144
|
+
let n = t.lastElementChild, r = t.childElementCount - 1;
|
|
145
|
+
for (; n && n !== e;) r--, n = n.previousElementSibling;
|
|
146
|
+
return r;
|
|
147
|
+
}
|
|
148
|
+
}) ?? -1;
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/internal/dom-id.ts
|
|
152
|
+
var se = {
|
|
153
|
+
OBJECT: !0,
|
|
154
|
+
EMBED: !0,
|
|
155
|
+
APPLET: !0
|
|
156
|
+
};
|
|
157
|
+
function x(e) {
|
|
158
|
+
if (e == null) return 0;
|
|
159
|
+
if (o(e)) {
|
|
160
|
+
let t = e;
|
|
161
|
+
return se[t.nodeName] || t.nodeType === 9 ? 2 : +(t.nodeType === 1);
|
|
162
|
+
} else return 2;
|
|
163
|
+
}
|
|
164
|
+
var S = "_just4_nodeid_" + +/* @__PURE__ */ new Date() + "_", C = 0, ce = Object.create(null), w = Object.create(null);
|
|
165
|
+
function T(e, t = !1) {
|
|
166
|
+
let n, r;
|
|
167
|
+
switch (x(e)) {
|
|
168
|
+
case 1:
|
|
169
|
+
r = e[S], r ? n = r.valueOf() : t || (r = e[S] = new Number(++C), ce[n = r.valueOf()] = function() {
|
|
170
|
+
e[S];
|
|
171
|
+
});
|
|
172
|
+
break;
|
|
173
|
+
case 2:
|
|
174
|
+
for (let t in w) if (w[t] === e) {
|
|
175
|
+
n = Number(t);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
!n && !t && (n = ++C, w[n] = e);
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
return n;
|
|
182
|
+
}
|
|
183
|
+
function le(e) {
|
|
184
|
+
if (e[S]) {
|
|
185
|
+
delete ce[e[S]];
|
|
186
|
+
try {
|
|
187
|
+
delete e[S];
|
|
188
|
+
} catch {
|
|
189
|
+
e[S] = null;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function ue(e) {
|
|
194
|
+
switch (x(e)) {
|
|
195
|
+
case 1:
|
|
196
|
+
le(e);
|
|
197
|
+
break;
|
|
198
|
+
case 2:
|
|
199
|
+
for (let t in w) if (w[t] === e) {
|
|
200
|
+
delete w[t];
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/internal/data-space.ts
|
|
208
|
+
var de = class {
|
|
209
|
+
constructor(e = {}) {
|
|
210
|
+
this._space = Object.create(null), this._cloneable = e.cloneable !== !1, this._onClone = e.onClone;
|
|
211
|
+
}
|
|
212
|
+
findSpace(e) {
|
|
213
|
+
let t = T(e, !0);
|
|
214
|
+
if (t) return this._space[t];
|
|
215
|
+
}
|
|
216
|
+
keys(e) {
|
|
217
|
+
let t = this.findSpace(e);
|
|
218
|
+
return t ? Object.keys(t) : [];
|
|
219
|
+
}
|
|
220
|
+
getData(e, t) {
|
|
221
|
+
let n = this.findSpace(e);
|
|
222
|
+
if (n && t in n) return n[t];
|
|
223
|
+
}
|
|
224
|
+
setData(e, t, n) {
|
|
225
|
+
let r = T(e);
|
|
226
|
+
r && (this._space[r] || (this._space[r] = Object.create(null)), this._space[r][t] = n);
|
|
227
|
+
}
|
|
228
|
+
clearData(e) {
|
|
229
|
+
let t = T(e, !0);
|
|
230
|
+
t && delete this._space[t];
|
|
231
|
+
}
|
|
232
|
+
removeData(e, t) {
|
|
233
|
+
let n = this.findSpace(e);
|
|
234
|
+
n && (delete n[t], i(n) && this.clearData(e));
|
|
235
|
+
}
|
|
236
|
+
cloneData(e, t) {
|
|
237
|
+
if (!this._cloneable) return;
|
|
238
|
+
let n = this.findSpace(t);
|
|
239
|
+
if (n) {
|
|
240
|
+
let r = T(e);
|
|
241
|
+
if (!r) return;
|
|
242
|
+
let i = this._space[r] = this._space[r] || Object.create(null);
|
|
243
|
+
for (let e in n) i[e] = n[e];
|
|
244
|
+
this._onClone && this._onClone(e, t);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}, E = (function() {
|
|
248
|
+
let e = [];
|
|
249
|
+
return {
|
|
250
|
+
add: function(t) {
|
|
251
|
+
return e.push(t) - 1;
|
|
252
|
+
},
|
|
253
|
+
clear: function(t) {
|
|
254
|
+
for (let n = e.length - 1; n >= 0; n--) e[n].clearData(t);
|
|
255
|
+
},
|
|
256
|
+
clone: function(t, n) {
|
|
257
|
+
for (let r = e.length - 1; r >= 0; r--) e[r].cloneData(t, n);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
})();
|
|
261
|
+
function fe(e) {
|
|
262
|
+
let t = new de(e);
|
|
263
|
+
return E.add(t), t;
|
|
264
|
+
}
|
|
265
|
+
function D(e) {
|
|
266
|
+
E.clear(e), ue(e);
|
|
267
|
+
}
|
|
268
|
+
function pe(e, t) {
|
|
269
|
+
E.clone(e, t);
|
|
270
|
+
}
|
|
271
|
+
var O = fe();
|
|
272
|
+
function me(e, t) {
|
|
273
|
+
return O.getData(e, t);
|
|
274
|
+
}
|
|
275
|
+
function he(e, t, n) {
|
|
276
|
+
O.setData(e, t, n);
|
|
277
|
+
}
|
|
278
|
+
function ge(e, t) {
|
|
279
|
+
l(t).forEach(function(t) {
|
|
280
|
+
for (let n = 0; n < e.length; n++) O.removeData(e[n], t);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function _e(e) {
|
|
284
|
+
for (let t = 0; t < e.length; t++) O.clearData(e[t]);
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/internal/dom-insertion.ts
|
|
288
|
+
function k(e, t) {
|
|
289
|
+
t ||= document;
|
|
290
|
+
let n = t.createElement("div");
|
|
291
|
+
n.innerHTML = e.trim();
|
|
292
|
+
let r = [];
|
|
293
|
+
for (; n.firstChild;) r.push(n.removeChild(n.firstChild));
|
|
294
|
+
return n = null, r;
|
|
295
|
+
}
|
|
296
|
+
function A(e, t = !1, n = !1) {
|
|
297
|
+
let r = e.cloneNode(!0);
|
|
298
|
+
if (n) {
|
|
299
|
+
let t = _(e);
|
|
300
|
+
if (t) {
|
|
301
|
+
let e = _(r);
|
|
302
|
+
for (let n = t.length - 1; n >= 0; n--) pe(e[n], t[n]);
|
|
303
|
+
}
|
|
304
|
+
} else t && pe(r, e);
|
|
305
|
+
return r;
|
|
306
|
+
}
|
|
307
|
+
function j(e, t = document) {
|
|
308
|
+
let n = e.length;
|
|
309
|
+
if (n) {
|
|
310
|
+
let r = t.createDocumentFragment(), i = -1;
|
|
311
|
+
for (; ++i < n;) o(e[i]) && r.appendChild(e[i]);
|
|
312
|
+
return r;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function ve(e, t = document) {
|
|
316
|
+
if (!e || o(e)) return e;
|
|
317
|
+
let n = typeof e == "string" ? k(e, t) : e;
|
|
318
|
+
if (n.length === 1) {
|
|
319
|
+
if (o(n[0])) return n[0];
|
|
320
|
+
} else return j(n, t);
|
|
321
|
+
}
|
|
322
|
+
function M(e, t, n, r) {
|
|
323
|
+
let i = t.length;
|
|
324
|
+
if (!i) return;
|
|
325
|
+
let a = ve(e);
|
|
326
|
+
if (a) {
|
|
327
|
+
let e = -1;
|
|
328
|
+
for (; ++e < i;) o(t[e]) && (!r || r(t[e]) !== !1) && n(e === i - 1 ? a : A(a, !0, !0), t[e]);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function ye(e) {
|
|
332
|
+
return typeof e == "string" ? m(e) : o(e) ? [e] : n(e);
|
|
333
|
+
}
|
|
334
|
+
function N(e, n, r, i) {
|
|
335
|
+
let s = [];
|
|
336
|
+
if (e == null || a(e)) return s;
|
|
337
|
+
let c = ye(e), l = c.length;
|
|
338
|
+
if (!l) return s;
|
|
339
|
+
let u = j(n);
|
|
340
|
+
if (u) {
|
|
341
|
+
let e, n = -1;
|
|
342
|
+
for (; ++n < l;) o(c[n]) && (!i || i(c[n]) !== !1) && (e = n === l - 1 ? u : A(u, !0, !0), t(s, e.childNodes), r(e, c[n]));
|
|
343
|
+
}
|
|
344
|
+
return p(s);
|
|
345
|
+
}
|
|
346
|
+
function P(e) {
|
|
347
|
+
return e.parentNode != null;
|
|
348
|
+
}
|
|
349
|
+
function F(e) {
|
|
350
|
+
return e.nodeType === 1 || e.nodeType === 11;
|
|
351
|
+
}
|
|
352
|
+
function I(e, t) {
|
|
353
|
+
t.appendChild(e);
|
|
354
|
+
}
|
|
355
|
+
function L(e, t) {
|
|
356
|
+
let n = t.firstChild;
|
|
357
|
+
n ? t.insertBefore(e, n) : t.appendChild(e);
|
|
358
|
+
}
|
|
359
|
+
function R(e, t) {
|
|
360
|
+
t.parentNode && t.parentNode.insertBefore(e, t);
|
|
361
|
+
}
|
|
362
|
+
function z(e, t) {
|
|
363
|
+
if (!t.parentNode) return;
|
|
364
|
+
let n = t.nextSibling;
|
|
365
|
+
n ? t.parentNode.insertBefore(e, n) : t.parentNode.appendChild(e);
|
|
366
|
+
}
|
|
367
|
+
function be(e, t) {
|
|
368
|
+
D(t), t.parentNode && t.parentNode.replaceChild(e, t);
|
|
369
|
+
}
|
|
370
|
+
function xe(e) {
|
|
371
|
+
let t;
|
|
372
|
+
for (let n = 0; n < e.length; n++) {
|
|
373
|
+
if (!o(e[n])) continue;
|
|
374
|
+
t = e[n];
|
|
375
|
+
let r = _(t);
|
|
376
|
+
if (r) {
|
|
377
|
+
for (let e = r.length - 1; e >= 0; e--) D(r[e]);
|
|
378
|
+
t.parentNode && t.parentNode.removeChild(t);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function Se(e) {
|
|
383
|
+
let t;
|
|
384
|
+
for (let n = 0; n < e.length; n++) {
|
|
385
|
+
if (!o(e[n])) continue;
|
|
386
|
+
t = e[n];
|
|
387
|
+
let r = _(t);
|
|
388
|
+
if (r) {
|
|
389
|
+
for (let e = r.length - 1; e >= 1; e--) D(r[e]);
|
|
390
|
+
for (; t.firstChild;) t.removeChild(t.firstChild);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/internal/dom-attr.ts
|
|
396
|
+
var B = Object.create(null);
|
|
397
|
+
B.for = "htmlFor", B.class = "className", [
|
|
398
|
+
"tabIndex",
|
|
399
|
+
"readOnly",
|
|
400
|
+
"maxLength",
|
|
401
|
+
"cellSpacing",
|
|
402
|
+
"cellPadding",
|
|
403
|
+
"rowSpan",
|
|
404
|
+
"colSpan",
|
|
405
|
+
"useMap",
|
|
406
|
+
"frameBorder",
|
|
407
|
+
"contentEditable",
|
|
408
|
+
"isMap"
|
|
409
|
+
].forEach(function(e) {
|
|
410
|
+
B[e.toLowerCase()] = e;
|
|
411
|
+
});
|
|
412
|
+
var V = Object.create(null);
|
|
413
|
+
[
|
|
414
|
+
"checked",
|
|
415
|
+
"selected",
|
|
416
|
+
"async",
|
|
417
|
+
"autofocus",
|
|
418
|
+
"autoplay",
|
|
419
|
+
"controls",
|
|
420
|
+
"defer",
|
|
421
|
+
"disabled",
|
|
422
|
+
"hidden",
|
|
423
|
+
"ismap",
|
|
424
|
+
"loop",
|
|
425
|
+
"multiple",
|
|
426
|
+
"open",
|
|
427
|
+
"readonly",
|
|
428
|
+
"required",
|
|
429
|
+
"scoped"
|
|
430
|
+
].forEach(function(e) {
|
|
431
|
+
V[e] = !0;
|
|
432
|
+
});
|
|
433
|
+
function Ce(e) {
|
|
434
|
+
return B[e] || e;
|
|
435
|
+
}
|
|
436
|
+
function we(e, t) {
|
|
437
|
+
return e[Ce(t)];
|
|
438
|
+
}
|
|
439
|
+
function Te(e, t, n) {
|
|
440
|
+
e[Ce(t)] = n;
|
|
441
|
+
}
|
|
442
|
+
function Ee(e, t) {
|
|
443
|
+
return u(e, function(e) {
|
|
444
|
+
t = t.toLowerCase();
|
|
445
|
+
let n = e.getAttribute(t);
|
|
446
|
+
return n != null && V[t] && (n = we(e, t) ? t : ""), n;
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
function De(e, t) {
|
|
450
|
+
let n = l(t);
|
|
451
|
+
n.length && u(e, function(e) {
|
|
452
|
+
n.forEach(function(t) {
|
|
453
|
+
e.removeAttribute(t.toLowerCase());
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
function Oe(e, t, n) {
|
|
458
|
+
u(e, function(e) {
|
|
459
|
+
if (t = t.toLowerCase(), V[t]) if (n = n === !0 || n === "true" || t === n, n) Te(e, t, n), n = t;
|
|
460
|
+
else {
|
|
461
|
+
e.removeAttribute(t.toLowerCase());
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
e.setAttribute(t, n.toString());
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/internal/dom-style.ts
|
|
469
|
+
var H = Object.create(null);
|
|
470
|
+
H.float = "cssFloat";
|
|
471
|
+
var ke = document.documentElement, Ae = [
|
|
472
|
+
"O",
|
|
473
|
+
"Moz",
|
|
474
|
+
"ms",
|
|
475
|
+
"Webkit"
|
|
476
|
+
];
|
|
477
|
+
function je(e) {
|
|
478
|
+
if (e in ke.style) return e;
|
|
479
|
+
let t = e.charAt(0).toUpperCase() + e.slice(1), n;
|
|
480
|
+
for (let e = Ae.length - 1; e >= 0; e--) if (n = Ae[e] + t, n in ke.style) return n;
|
|
481
|
+
return e;
|
|
482
|
+
}
|
|
483
|
+
var Me = /-([a-z])/g;
|
|
484
|
+
function Ne(e) {
|
|
485
|
+
let t = e.replace(Me, function(e, t) {
|
|
486
|
+
return t.toUpperCase();
|
|
487
|
+
});
|
|
488
|
+
return H[t] || (H[t] = je(t)), H[t];
|
|
489
|
+
}
|
|
490
|
+
var Pe = {
|
|
491
|
+
animationIterationCount: !0,
|
|
492
|
+
columnCount: !0,
|
|
493
|
+
fillOpacity: !0,
|
|
494
|
+
flexGrow: !0,
|
|
495
|
+
flexShrink: !0,
|
|
496
|
+
fontWeight: !0,
|
|
497
|
+
gridArea: !0,
|
|
498
|
+
gridColumn: !0,
|
|
499
|
+
gridColumnEnd: !0,
|
|
500
|
+
gridColumnStart: !0,
|
|
501
|
+
gridRow: !0,
|
|
502
|
+
gridRowEnd: !0,
|
|
503
|
+
gridRowStart: !0,
|
|
504
|
+
lineHeight: !0,
|
|
505
|
+
opacity: !0,
|
|
506
|
+
order: !0,
|
|
507
|
+
orphans: !0,
|
|
508
|
+
widows: !0,
|
|
509
|
+
zIndex: !0,
|
|
510
|
+
zoom: !0
|
|
511
|
+
};
|
|
512
|
+
function Fe(e, t) {
|
|
513
|
+
return r(Pe, e) || t === "" || isNaN(Number(t)) ? t.toString() : t + "px";
|
|
514
|
+
}
|
|
515
|
+
function Ie(e, t) {
|
|
516
|
+
let n = "", r = e.ownerDocument?.defaultView;
|
|
517
|
+
return r && (n = r.getComputedStyle(e, null)[t]), n == null ? "" : String(n);
|
|
518
|
+
}
|
|
519
|
+
function U(e, t) {
|
|
520
|
+
return u(e, function(e) {
|
|
521
|
+
if (t = Ne(t), t in e.style) return Ie(e, t);
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
function Le(e, t, n) {
|
|
525
|
+
u(e, function(e) {
|
|
526
|
+
t = Ne(t), n = Fe(t, n), t in e.style && (e.style[t] = n);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
function Re(e) {
|
|
530
|
+
e.style.display === "none" && (e.style.display = ""), Ie(e, "display") === "none" && (e.style.display = "block");
|
|
531
|
+
}
|
|
532
|
+
function ze(e) {
|
|
533
|
+
u(e, Re);
|
|
534
|
+
}
|
|
535
|
+
function Be(e) {
|
|
536
|
+
e.style.display = "none";
|
|
537
|
+
}
|
|
538
|
+
function Ve(e) {
|
|
539
|
+
u(e, Be);
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region src/internal/dom-class.ts
|
|
543
|
+
function W(e, t) {
|
|
544
|
+
t = t.trim(), e.className !== t && (e.className = t);
|
|
545
|
+
}
|
|
546
|
+
function He(e, t) {
|
|
547
|
+
return u(e, function(e) {
|
|
548
|
+
return (" " + e.className + " ").indexOf(" " + t + " ") !== -1;
|
|
549
|
+
}) || !1;
|
|
550
|
+
}
|
|
551
|
+
function Ue(e, t) {
|
|
552
|
+
let n = l(t), r = n.length;
|
|
553
|
+
r && u(e, function(e) {
|
|
554
|
+
let t = " " + e.className + " ", i = -1;
|
|
555
|
+
for (; ++i < r;) t.indexOf(" " + n[i] + " ") === -1 && (t += n[i] + " ");
|
|
556
|
+
W(e, t);
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
function We(e, t) {
|
|
560
|
+
let n, r, i = t == null;
|
|
561
|
+
!i && (n = l(t), r = n.length, !r) || u(e, function(e) {
|
|
562
|
+
let t = e.className;
|
|
563
|
+
if (t) if (i) e.className = "";
|
|
564
|
+
else {
|
|
565
|
+
let i = " " + t + " ", a = -1;
|
|
566
|
+
for (; ++a < r;) i = i.replace(" " + n[a] + " ", " ");
|
|
567
|
+
W(e, i);
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
function Ge(e, t) {
|
|
572
|
+
let n = l(t), r = n.length;
|
|
573
|
+
r && u(e, function(e) {
|
|
574
|
+
let t = " " + e.className + " ", i = -1, a;
|
|
575
|
+
for (; ++i < r;) a = " " + n[i] + " ", t.indexOf(a) === -1 ? t += n[i] + " " : t = t.replace(a, " ");
|
|
576
|
+
W(e, t);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/internal/dom-size.ts
|
|
581
|
+
function G(e, t, n, r) {
|
|
582
|
+
return t + (n ? 1 : -1) * (parseFloat(U(e, r)) || 0);
|
|
583
|
+
}
|
|
584
|
+
function K(e, t, n = !1, r = !1, i = !1) {
|
|
585
|
+
if (e == null) return 0;
|
|
586
|
+
if (a(e)) return e.document.documentElement["client" + t];
|
|
587
|
+
if (s(e)) return e.documentElement["scroll" + t];
|
|
588
|
+
if (!e.ownerDocument || e.nodeType !== 1) return 0;
|
|
589
|
+
let o = e["offset" + t];
|
|
590
|
+
return (t === "Width" ? ["Left", "Right"] : ["Top", "Bottom"]).forEach(function(t) {
|
|
591
|
+
n || (o = G(e, o, !1, "padding" + t)), !r && U(e, "border" + t + "Style") !== "none" && (o = G(e, o, !1, "border" + t + "Width")), i && (o = G(e, o, !0, "margin" + t));
|
|
592
|
+
}), o;
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region src/internal/dom-scroll.ts
|
|
596
|
+
var q = Object.create(null);
|
|
597
|
+
q.scrollTop = "pageYOffset", q.scrollLeft = "pageXOffset";
|
|
598
|
+
function J(e, t) {
|
|
599
|
+
let n = 0, r = t;
|
|
600
|
+
return a(e) ? n = e[q[r]] : c(e) && (n = e[r]), n;
|
|
601
|
+
}
|
|
602
|
+
function Y(e, t, n) {
|
|
603
|
+
let r = t;
|
|
604
|
+
if (a(e)) switch (r) {
|
|
605
|
+
case "scrollTop":
|
|
606
|
+
window.scrollTo(J(e, "scrollLeft"), n);
|
|
607
|
+
break;
|
|
608
|
+
case "scrollLeft":
|
|
609
|
+
window.scrollTo(n, J(e, "scrollTop"));
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
else c(e) && (e[r] = n);
|
|
613
|
+
}
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region src/internal/dom-offset.ts
|
|
616
|
+
function Ke(e) {
|
|
617
|
+
return u(e, function(e) {
|
|
618
|
+
let t = e.ownerDocument, n = t.documentElement;
|
|
619
|
+
if (e !== n && n.contains(e)) {
|
|
620
|
+
let n = t.defaultView, r = e.getBoundingClientRect();
|
|
621
|
+
return {
|
|
622
|
+
top: r.top + J(n, "scrollTop"),
|
|
623
|
+
left: r.left + J(n, "scrollLeft")
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
}) || {
|
|
627
|
+
top: 0,
|
|
628
|
+
left: 0
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/event-wrap.ts
|
|
633
|
+
var qe = /^(?:mouse|contextmenu)|click/, Je = /^touch/, Ye = /^pointer/, Xe = class {
|
|
634
|
+
constructor(e, t) {
|
|
635
|
+
if (this.originalEvent = e, this.type = e.type, this.timeStamp = e.timeStamp, this.target = e.target, this.currentTarget = e.currentTarget || t, qe.test(this.type) || Ye.test(this.type)) {
|
|
636
|
+
let t = e;
|
|
637
|
+
this.clientX = t.clientX, this.clientY = t.clientY, this.pageX = t.pageX, this.pageY = t.pageY;
|
|
638
|
+
} else if (Je.test(this.type)) {
|
|
639
|
+
let t = e.touches[0];
|
|
640
|
+
t && (this.clientX = t.clientX, this.clientY = t.clientY, this.pageX = t.pageX, this.pageY = t.pageY);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
preventDefault() {
|
|
644
|
+
this.originalEvent.preventDefault();
|
|
645
|
+
}
|
|
646
|
+
stopPropagation() {
|
|
647
|
+
this.originalEvent.stopPropagation();
|
|
648
|
+
}
|
|
649
|
+
isDefaultPrevented() {
|
|
650
|
+
return this.originalEvent.defaultPrevented;
|
|
651
|
+
}
|
|
652
|
+
isPropagationStopped() {
|
|
653
|
+
return this.originalEvent.bubbles;
|
|
654
|
+
}
|
|
655
|
+
}, X = (function() {
|
|
656
|
+
let e = [
|
|
657
|
+
"o",
|
|
658
|
+
"moz",
|
|
659
|
+
"ms",
|
|
660
|
+
"webkit"
|
|
661
|
+
], t = Object.create(null), n = document.documentElement;
|
|
662
|
+
return [
|
|
663
|
+
"TransitionEnd",
|
|
664
|
+
"AnimationStart",
|
|
665
|
+
"AnimationIteration",
|
|
666
|
+
"AnimationEnd",
|
|
667
|
+
"fullscreenchange",
|
|
668
|
+
"fullscreenerror"
|
|
669
|
+
].forEach(function(r) {
|
|
670
|
+
let i = r.toLowerCase();
|
|
671
|
+
"on" + i in n || e.some(function(e) {
|
|
672
|
+
if ("on" + e + i in n) return t[i] = e + r, !0;
|
|
673
|
+
});
|
|
674
|
+
}), function(e) {
|
|
675
|
+
return e != null && t[e] ? t[e] : e;
|
|
676
|
+
};
|
|
677
|
+
})(), Z = (function() {
|
|
678
|
+
let e = fe({ onClone: function(e) {
|
|
679
|
+
this.keys(e).forEach(function(t) {
|
|
680
|
+
e.addEventListener(t, n, !1);
|
|
681
|
+
});
|
|
682
|
+
} });
|
|
683
|
+
function t(e, t) {
|
|
684
|
+
let n = e.target;
|
|
685
|
+
for (; n && n !== e.currentTarget;) if (g(n, t)) return n;
|
|
686
|
+
else n = n.parentNode;
|
|
687
|
+
}
|
|
688
|
+
function n(n) {
|
|
689
|
+
let r = new Xe(n, this), i = r.type, a = e.getData(r.currentTarget, i);
|
|
690
|
+
a && a.forEach(function(e) {
|
|
691
|
+
let n, i = r.target;
|
|
692
|
+
if (e.delegator && o(i)) {
|
|
693
|
+
if (n = t(r, e.delegator), !n) return;
|
|
694
|
+
} else n = r.currentTarget;
|
|
695
|
+
e.handler.call(n, r) === !1 && r.preventDefault();
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
function r(e, t, n) {
|
|
699
|
+
for (let r = e.length - 1; r >= 0; r--) (!n || e[r].handler === n) && (!t || t === e[r].delegator) && e.splice(r, 1);
|
|
700
|
+
}
|
|
701
|
+
return {
|
|
702
|
+
add(t, r, i) {
|
|
703
|
+
let a = e.getData(t, r);
|
|
704
|
+
a || (a = [], e.setData(t, r, a), t.addEventListener(r, n, !1)), a.push(i);
|
|
705
|
+
},
|
|
706
|
+
remove(t, i, a, o) {
|
|
707
|
+
if (i && (a || o)) {
|
|
708
|
+
let n = e.getData(t, i);
|
|
709
|
+
if (n) {
|
|
710
|
+
if (r(n, a, o), n.length) return;
|
|
711
|
+
} else return;
|
|
712
|
+
}
|
|
713
|
+
if (i) {
|
|
714
|
+
e.removeData(t, i), t.removeEventListener(i, n, !1);
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
e.keys(t).forEach(function(e) {
|
|
718
|
+
t.removeEventListener(e, n, !1);
|
|
719
|
+
}), e.clearData(t);
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
})();
|
|
723
|
+
function Q(t, n) {
|
|
724
|
+
if (e(t)) {
|
|
725
|
+
let e = t;
|
|
726
|
+
for (let t = 0; t < e.length; t++) Q(e[t], n);
|
|
727
|
+
} else t != null && typeof t.addEventListener == "function" && n(t);
|
|
728
|
+
}
|
|
729
|
+
function Ze(e, t, n, r) {
|
|
730
|
+
let i = l(t).map(X);
|
|
731
|
+
!i.length || !r || Q(e, function(e) {
|
|
732
|
+
i.forEach(function(t) {
|
|
733
|
+
Z.add(e, t, {
|
|
734
|
+
handler: r,
|
|
735
|
+
delegator: n
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
function Qe(e, t, n, r) {
|
|
741
|
+
let i = l(t).map(X);
|
|
742
|
+
Q(e, function(e) {
|
|
743
|
+
i.length ? i.forEach(function(t) {
|
|
744
|
+
Z.remove(e, t, n, r);
|
|
745
|
+
}) : Z.remove(e);
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
var $e = {
|
|
749
|
+
focus(e) {
|
|
750
|
+
return /^(?:input|select|textarea|button)$/i.test(e.nodeName);
|
|
751
|
+
},
|
|
752
|
+
blur(e) {
|
|
753
|
+
return e.ownerDocument != null && e.ownerDocument.activeElement === e;
|
|
754
|
+
},
|
|
755
|
+
reset(e) {
|
|
756
|
+
return e.nodeName === "FORM";
|
|
757
|
+
},
|
|
758
|
+
submit(e) {
|
|
759
|
+
return e.nodeName === "FORM";
|
|
760
|
+
},
|
|
761
|
+
click() {
|
|
762
|
+
return !0;
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
function et(e, t) {
|
|
766
|
+
t = X(t), Q(e, function(e) {
|
|
767
|
+
if (o(e) && typeof e[t] == "function" && r($e, t) && $e[t](e)) {
|
|
768
|
+
e[t]();
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
let n = null;
|
|
772
|
+
if (o(e) ? n = e.ownerDocument : a(e) && (n = e.document), n) {
|
|
773
|
+
let r = n.createEvent("Event");
|
|
774
|
+
r.initEvent(t, !0, !0), e.dispatchEvent(r);
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
//#endregion
|
|
779
|
+
//#region src/dom-wrap.ts
|
|
780
|
+
var $ = class r {
|
|
781
|
+
constructor(e) {
|
|
782
|
+
this.length = 0;
|
|
783
|
+
let t = e ? e.length : -1;
|
|
784
|
+
if (isNaN(t) || t < 0) return;
|
|
785
|
+
let n = -1;
|
|
786
|
+
for (; ++n < t;) this[n] = e[n];
|
|
787
|
+
this.length = t;
|
|
788
|
+
}
|
|
789
|
+
toArray() {
|
|
790
|
+
return n(this);
|
|
791
|
+
}
|
|
792
|
+
indexOf(e) {
|
|
793
|
+
return Array.prototype.indexOf.call(this, e);
|
|
794
|
+
}
|
|
795
|
+
forEach(e) {
|
|
796
|
+
return Array.prototype.forEach.call(this, e);
|
|
797
|
+
}
|
|
798
|
+
some(e) {
|
|
799
|
+
return Array.prototype.some.call(this, e);
|
|
800
|
+
}
|
|
801
|
+
every(e) {
|
|
802
|
+
return Array.prototype.every.call(this, e);
|
|
803
|
+
}
|
|
804
|
+
filter(e) {
|
|
805
|
+
return new r(Array.prototype.filter.call(this, e));
|
|
806
|
+
}
|
|
807
|
+
get(e) {
|
|
808
|
+
return e = 0 | e, e < 0 ? this[this.length + e] : this[e];
|
|
809
|
+
}
|
|
810
|
+
eq(e) {
|
|
811
|
+
let t = this.get(e);
|
|
812
|
+
return new r(t ? [t] : []);
|
|
813
|
+
}
|
|
814
|
+
first() {
|
|
815
|
+
return this.eq(0);
|
|
816
|
+
}
|
|
817
|
+
last() {
|
|
818
|
+
return this.eq(this.length - 1);
|
|
819
|
+
}
|
|
820
|
+
add(n, i = document) {
|
|
821
|
+
return new r(p(t(this.toArray(), e(n) ? n : m(n, i))));
|
|
822
|
+
}
|
|
823
|
+
each(e) {
|
|
824
|
+
for (let t = 0; t < this.length && e.call(this[t], t, this[t]) !== !1; t++);
|
|
825
|
+
return this;
|
|
826
|
+
}
|
|
827
|
+
attr(e, t) {
|
|
828
|
+
return d(this, e, t, !0, {
|
|
829
|
+
get: Ee,
|
|
830
|
+
set: Oe
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
removeAttr(e) {
|
|
834
|
+
return De(this, e), this;
|
|
835
|
+
}
|
|
836
|
+
prop(e, t) {
|
|
837
|
+
return d(this, e, t, !0, {
|
|
838
|
+
get: we,
|
|
839
|
+
set: Te
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
data(e, t) {
|
|
843
|
+
return d(this, e, t, !0, {
|
|
844
|
+
get: me,
|
|
845
|
+
set: he
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
removeData(e) {
|
|
849
|
+
return e == null ? _e(this) : ge(this, e), this;
|
|
850
|
+
}
|
|
851
|
+
html(e) {
|
|
852
|
+
return this.prop("innerHTML", e);
|
|
853
|
+
}
|
|
854
|
+
text(e) {
|
|
855
|
+
return arguments.length ? this.prop("textContent", e) : this.prop("textContent");
|
|
856
|
+
}
|
|
857
|
+
val(e) {
|
|
858
|
+
return this.prop("value", e);
|
|
859
|
+
}
|
|
860
|
+
css(e, t) {
|
|
861
|
+
return d(this, e, t, !0, {
|
|
862
|
+
get: U,
|
|
863
|
+
set: Le
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
show() {
|
|
867
|
+
return ze(this), this;
|
|
868
|
+
}
|
|
869
|
+
hide() {
|
|
870
|
+
return Ve(this), this;
|
|
871
|
+
}
|
|
872
|
+
addClass(e) {
|
|
873
|
+
return Ue(this, e), this;
|
|
874
|
+
}
|
|
875
|
+
removeClass(e) {
|
|
876
|
+
return We(this, e), this;
|
|
877
|
+
}
|
|
878
|
+
hasClass(e) {
|
|
879
|
+
return this.some(function(t) {
|
|
880
|
+
return He(t, e);
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
toggleClass(e) {
|
|
884
|
+
return Ge(this, e), this;
|
|
885
|
+
}
|
|
886
|
+
width() {
|
|
887
|
+
return K(this[0], "Width");
|
|
888
|
+
}
|
|
889
|
+
height() {
|
|
890
|
+
return K(this[0], "Height");
|
|
891
|
+
}
|
|
892
|
+
innerWidth() {
|
|
893
|
+
return K(this[0], "Width", !0);
|
|
894
|
+
}
|
|
895
|
+
innerHeight() {
|
|
896
|
+
return K(this[0], "Height", !0);
|
|
897
|
+
}
|
|
898
|
+
outerWidth(e) {
|
|
899
|
+
return K(this[0], "Width", !0, !0, e);
|
|
900
|
+
}
|
|
901
|
+
outerHeight(e) {
|
|
902
|
+
return K(this[0], "Height", !0, !0, e);
|
|
903
|
+
}
|
|
904
|
+
scrollTop(e) {
|
|
905
|
+
return d(this, "scrollTop", e, !0, {
|
|
906
|
+
get: J,
|
|
907
|
+
set: Y
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
scrollLeft(e) {
|
|
911
|
+
return d(this, "scrollLeft", e, !0, {
|
|
912
|
+
get: J,
|
|
913
|
+
set: Y
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
offset() {
|
|
917
|
+
return Ke(this[0]);
|
|
918
|
+
}
|
|
919
|
+
index() {
|
|
920
|
+
return oe(this[0]);
|
|
921
|
+
}
|
|
922
|
+
children(e) {
|
|
923
|
+
return new r(ie(this, e));
|
|
924
|
+
}
|
|
925
|
+
siblings(e) {
|
|
926
|
+
return new r(ae(this, e));
|
|
927
|
+
}
|
|
928
|
+
next(e) {
|
|
929
|
+
return new r(b(this, "nextElementSibling", e, !0));
|
|
930
|
+
}
|
|
931
|
+
nextAll(e) {
|
|
932
|
+
return new r(b(this, "nextElementSibling", e));
|
|
933
|
+
}
|
|
934
|
+
prev(e) {
|
|
935
|
+
return new r(b(this, "previousElementSibling", e, !0));
|
|
936
|
+
}
|
|
937
|
+
prevAll(e) {
|
|
938
|
+
return new r(b(this, "previousElementSibling", e));
|
|
939
|
+
}
|
|
940
|
+
parent(e) {
|
|
941
|
+
return new r(b(this, "parentNode", e, !0));
|
|
942
|
+
}
|
|
943
|
+
parents(e) {
|
|
944
|
+
return new r(b(this, "parentNode", e));
|
|
945
|
+
}
|
|
946
|
+
nextUntil(e, t) {
|
|
947
|
+
return new r(y(this, "nextElementSibling", e, t));
|
|
948
|
+
}
|
|
949
|
+
prevUntil(e, t) {
|
|
950
|
+
return new r(y(this, "previousElementSibling", e, t));
|
|
951
|
+
}
|
|
952
|
+
parentsUntil(e, t) {
|
|
953
|
+
return new r(y(this, "parentNode", e, t));
|
|
954
|
+
}
|
|
955
|
+
append(e) {
|
|
956
|
+
return M(e, this, I, F), this;
|
|
957
|
+
}
|
|
958
|
+
appendTo(e) {
|
|
959
|
+
return new r(N(e, this, I, F));
|
|
960
|
+
}
|
|
961
|
+
prepend(e) {
|
|
962
|
+
return M(e, this, L, F), this;
|
|
963
|
+
}
|
|
964
|
+
prependTo(e) {
|
|
965
|
+
return new r(N(e, this, L, F));
|
|
966
|
+
}
|
|
967
|
+
before(e) {
|
|
968
|
+
return M(e, this, R, P), this;
|
|
969
|
+
}
|
|
970
|
+
insertBefore(e) {
|
|
971
|
+
return new r(N(e, this, R, P));
|
|
972
|
+
}
|
|
973
|
+
after(e) {
|
|
974
|
+
return M(e, this, z, P), this;
|
|
975
|
+
}
|
|
976
|
+
insertAfter(e) {
|
|
977
|
+
return new r(N(e, this, z, P));
|
|
978
|
+
}
|
|
979
|
+
replaceWith(e) {
|
|
980
|
+
return M(e, this, be, P), this;
|
|
981
|
+
}
|
|
982
|
+
replaceAll(e) {
|
|
983
|
+
return new r(N(e, this, be, P));
|
|
984
|
+
}
|
|
985
|
+
remove() {
|
|
986
|
+
return xe(this), this;
|
|
987
|
+
}
|
|
988
|
+
empty() {
|
|
989
|
+
return Se(this), this;
|
|
990
|
+
}
|
|
991
|
+
clone(e, t) {
|
|
992
|
+
let n = [];
|
|
993
|
+
return this.forEach(function(r) {
|
|
994
|
+
o(r) && n.push(A(r, e, t));
|
|
995
|
+
}), new r(n);
|
|
996
|
+
}
|
|
997
|
+
on(e, t, n) {
|
|
998
|
+
return typeof t == "function" && (n = t, t = void 0), Ze(this, e, t, n), this;
|
|
999
|
+
}
|
|
1000
|
+
off(e, t, n) {
|
|
1001
|
+
return typeof t == "function" && (n = t, t = void 0), Qe(this, e, t, n), this;
|
|
1002
|
+
}
|
|
1003
|
+
trigger(e) {
|
|
1004
|
+
return et(this, e), this;
|
|
1005
|
+
}
|
|
1006
|
+
focus() {
|
|
1007
|
+
return this.trigger("focus");
|
|
1008
|
+
}
|
|
1009
|
+
blur() {
|
|
1010
|
+
return this.trigger("blur");
|
|
1011
|
+
}
|
|
1012
|
+
click() {
|
|
1013
|
+
return this.trigger("click");
|
|
1014
|
+
}
|
|
1015
|
+
reset() {
|
|
1016
|
+
return this.trigger("reset");
|
|
1017
|
+
}
|
|
1018
|
+
submit() {
|
|
1019
|
+
return this.trigger("submit");
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/index.ts
|
|
1024
|
+
function tt(e, n) {
|
|
1025
|
+
if (Array.isArray(n)) {
|
|
1026
|
+
let r = [], i = n.length, a = -1;
|
|
1027
|
+
for (; ++a < i;) t(r, m(e, n[a]));
|
|
1028
|
+
return p(r);
|
|
1029
|
+
} else return m(e, n);
|
|
1030
|
+
}
|
|
1031
|
+
function nt(e, t = document) {
|
|
1032
|
+
let n;
|
|
1033
|
+
return typeof e == "string" ? (e = e.trim(), n = e.charAt(0) === "<" && e.charAt(e.length - 1) === ">" ? k(e, s(t) ? t : null) : tt(e, t)) : n = e == null ? [] : o(e) || a(e) ? [e] : e, new $(n);
|
|
1034
|
+
}
|
|
1035
|
+
//#endregion
|
|
1036
|
+
export { nt as $, $ as DOMWrap, Xe as EventWrap, g as matchesSelector, m as querySelectorAll };
|