@thednp/shorty 2.0.0 → 2.0.2
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 +4 -4
- package/dist/shorty.cjs +1 -1
- package/dist/shorty.cjs.map +1 -1
- package/dist/shorty.d.ts +79 -73
- package/dist/shorty.js +1 -1
- package/dist/shorty.js.map +1 -1
- package/dist/shorty.mjs +13 -25
- package/dist/shorty.mjs.map +1 -1
- package/dts.config.ts +1 -0
- package/package.json +12 -12
- package/src/index.ts +33 -1
package/dist/shorty.mjs
CHANGED
|
@@ -173,8 +173,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
173
173
|
* @param instance the component instance
|
|
174
174
|
*/
|
|
175
175
|
set: (t, e, n) => {
|
|
176
|
-
if (!u(t))
|
|
177
|
-
return;
|
|
176
|
+
if (!u(t)) return;
|
|
178
177
|
E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);
|
|
179
178
|
},
|
|
180
179
|
/**
|
|
@@ -192,8 +191,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
192
191
|
* @returns the instance
|
|
193
192
|
*/
|
|
194
193
|
get: (t, e) => {
|
|
195
|
-
if (!u(t) || !e)
|
|
196
|
-
return null;
|
|
194
|
+
if (!u(t) || !e) return null;
|
|
197
195
|
const n = L.getAllFor(e);
|
|
198
196
|
return t && n && n.get(t) || null;
|
|
199
197
|
},
|
|
@@ -208,23 +206,19 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
208
206
|
!n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));
|
|
209
207
|
}
|
|
210
208
|
}, Hn = (t, e) => L.get(t, e), k = (t) => typeof t == "string" || !1, W = (t) => v(t) && t.constructor.name === "Window" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, M = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {
|
|
211
|
-
if (!t)
|
|
212
|
-
return;
|
|
209
|
+
if (!t) return;
|
|
213
210
|
if (k(t))
|
|
214
211
|
return d().createElement(t);
|
|
215
212
|
const { tagName: e } = t, n = Zt(e);
|
|
216
|
-
if (!n)
|
|
217
|
-
return;
|
|
213
|
+
if (!n) return;
|
|
218
214
|
const o = { ...t };
|
|
219
215
|
return delete o.tagName, M(n, o);
|
|
220
216
|
}, $t = (t, e) => {
|
|
221
|
-
if (!t || !e)
|
|
222
|
-
return;
|
|
217
|
+
if (!t || !e) return;
|
|
223
218
|
if (k(e))
|
|
224
219
|
return d().createElementNS(t, e);
|
|
225
220
|
const { tagName: n } = e, o = $t(t, n);
|
|
226
|
-
if (!o)
|
|
227
|
-
return;
|
|
221
|
+
if (!o) return;
|
|
228
222
|
const s = { ...e };
|
|
229
223
|
return delete s.tagName, M(o, s);
|
|
230
224
|
}, Q = (t, e) => t.dispatchEvent(e), Pn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {
|
|
@@ -341,8 +335,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
341
335
|
* @returns the timer
|
|
342
336
|
*/
|
|
343
337
|
get: (t, e) => {
|
|
344
|
-
if (!u(t))
|
|
345
|
-
return null;
|
|
338
|
+
if (!u(t)) return null;
|
|
346
339
|
const n = f.get(t);
|
|
347
340
|
return e && n && I(n) ? n.get(e) || /* istanbul ignore next */
|
|
348
341
|
null : se(n) ? n : null;
|
|
@@ -354,8 +347,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
354
347
|
* @param key a unique key
|
|
355
348
|
*/
|
|
356
349
|
clear: (t, e) => {
|
|
357
|
-
if (!u(t))
|
|
358
|
-
return;
|
|
350
|
+
if (!u(t)) return;
|
|
359
351
|
const n = f.get(t);
|
|
360
352
|
e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));
|
|
361
353
|
}
|
|
@@ -389,8 +381,7 @@ const gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.b
|
|
|
389
381
|
i(t) && t.parentNode || // DOM Element detected
|
|
390
382
|
ce(t) && t.host || // ShadowRoot detected
|
|
391
383
|
T(t), re = (t) => {
|
|
392
|
-
if (!u(t))
|
|
393
|
-
return !1;
|
|
384
|
+
if (!u(t)) return !1;
|
|
394
385
|
const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;
|
|
395
386
|
return Math.round(e) !== o || Math.round(n) !== s;
|
|
396
387
|
}, co = (t, e, n) => {
|
|
@@ -421,18 +412,15 @@ const b = /* @__PURE__ */ new Map(), ae = (t, e) => {
|
|
|
421
412
|
var e;
|
|
422
413
|
return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;
|
|
423
414
|
}, ie = (t) => Array.isArray(t) || !1, ao = (t) => i(t) && t.nodeName === "CANVAS" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, io = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, uo = (t) => {
|
|
424
|
-
if (!i(t))
|
|
425
|
-
return !1;
|
|
415
|
+
if (!i(t)) return !1;
|
|
426
416
|
const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);
|
|
427
417
|
return e <= o && n >= 0;
|
|
428
418
|
}, lo = (t) => {
|
|
429
|
-
if (!i(t))
|
|
430
|
-
return !1;
|
|
419
|
+
if (!i(t)) return !1;
|
|
431
420
|
const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);
|
|
432
421
|
return o >= 0 && s >= 0 && r <= n && a <= e;
|
|
433
422
|
}, po = (t) => ie(t) && t.every(u) || !1, mo = (t) => typeof t == "function" || !1, fo = (t) => v(t) && t.constructor.name === "HTMLCollection" || !1, go = (t) => u(t) && t.tagName === "IMG" || !1, vo = (t) => {
|
|
434
|
-
if (!k(t))
|
|
435
|
-
return !1;
|
|
423
|
+
if (!k(t)) return !1;
|
|
436
424
|
try {
|
|
437
425
|
JSON.parse(t);
|
|
438
426
|
} catch {
|
|
@@ -442,7 +430,7 @@ const b = /* @__PURE__ */ new Map(), ae = (t, e) => {
|
|
|
442
430
|
}, Eo = (t) => v(t) && t.constructor.name === "WeakMap" || !1, bo = (t) => i(t) && ["SVG", "Image", "Video", "Canvas"].some((e) => t.constructor.name.includes(e)) || !1, ho = (t) => v(t) && t.constructor.name === "NodeList" || !1, yo = (t) => T(t).dir === "rtl", wo = (t) => i(t) && t.constructor.name.includes("SVG") || !1, Ao = (t) => i(t) && ["TABLE", "TD", "TH"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`
|
|
443
431
|
le(t.getRootNode().host, e) : null, So = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), No = (t) => [...de("*", t)].filter(ue), ko = (t, e) => d(e).getElementById(t) || null, Mo = (t, e) => (i(e) ? e : d()).querySelectorAll(t), To = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(
|
|
444
432
|
t
|
|
445
|
-
), Do = (t, e) => t.matches(e), Co = "2.0.
|
|
433
|
+
), Do = (t, e) => t.matches(e), Co = "2.0.2";
|
|
446
434
|
export {
|
|
447
435
|
Bn as ArrayFrom,
|
|
448
436
|
P as DOMContentLoadedEvent,
|