@bquery/bquery 1.2.0 → 1.4.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/README.md +127 -27
- package/dist/batch-x7b2eZST.js +13 -0
- package/dist/batch-x7b2eZST.js.map +1 -0
- package/dist/component/component.d.ts +69 -0
- package/dist/component/component.d.ts.map +1 -0
- package/dist/component/html.d.ts +35 -0
- package/dist/component/html.d.ts.map +1 -0
- package/dist/component/index.d.ts +3 -126
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/props.d.ts +18 -0
- package/dist/component/props.d.ts.map +1 -0
- package/dist/component/types.d.ts +77 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component.es.mjs +90 -59
- package/dist/component.es.mjs.map +1 -1
- package/dist/core/collection.d.ts +55 -3
- package/dist/core/collection.d.ts.map +1 -1
- package/dist/core/dom.d.ts +6 -0
- package/dist/core/dom.d.ts.map +1 -0
- package/dist/core/element.d.ts +31 -4
- package/dist/core/element.d.ts.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/utils/array.d.ts +74 -0
- package/dist/core/utils/array.d.ts.map +1 -0
- package/dist/core/utils/function.d.ts +87 -0
- package/dist/core/utils/function.d.ts.map +1 -0
- package/dist/core/utils/index.d.ts +70 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/misc.d.ts +63 -0
- package/dist/core/utils/misc.d.ts.map +1 -0
- package/dist/core/utils/number.d.ts +65 -0
- package/dist/core/utils/number.d.ts.map +1 -0
- package/dist/core/utils/object.d.ts +133 -0
- package/dist/core/utils/object.d.ts.map +1 -0
- package/dist/core/utils/string.d.ts +80 -0
- package/dist/core/utils/string.d.ts.map +1 -0
- package/dist/core/utils/type-guards.d.ts +79 -0
- package/dist/core/utils/type-guards.d.ts.map +1 -0
- package/dist/core-BhpuvPhy.js +170 -0
- package/dist/core-BhpuvPhy.js.map +1 -0
- package/dist/core.es.mjs +495 -489
- package/dist/core.es.mjs.map +1 -1
- package/dist/full.d.ts +2 -2
- package/dist/full.d.ts.map +1 -1
- package/dist/full.es.mjs +87 -64
- package/dist/full.es.mjs.map +1 -1
- package/dist/full.iife.js +2 -2
- package/dist/full.iife.js.map +1 -1
- package/dist/full.umd.js +2 -2
- package/dist/full.umd.js.map +1 -1
- package/dist/index.es.mjs +138 -68
- package/dist/index.es.mjs.map +1 -1
- package/dist/motion/animate.d.ts +25 -0
- package/dist/motion/animate.d.ts.map +1 -0
- package/dist/motion/easing.d.ts +30 -0
- package/dist/motion/easing.d.ts.map +1 -0
- package/dist/motion/flip.d.ts +55 -0
- package/dist/motion/flip.d.ts.map +1 -0
- package/dist/motion/index.d.ts +11 -138
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/keyframes.d.ts +21 -0
- package/dist/motion/keyframes.d.ts.map +1 -0
- package/dist/motion/reduced-motion.d.ts +12 -0
- package/dist/motion/reduced-motion.d.ts.map +1 -0
- package/dist/motion/scroll.d.ts +15 -0
- package/dist/motion/scroll.d.ts.map +1 -0
- package/dist/motion/spring.d.ts +42 -0
- package/dist/motion/spring.d.ts.map +1 -0
- package/dist/motion/stagger.d.ts +22 -0
- package/dist/motion/stagger.d.ts.map +1 -0
- package/dist/motion/timeline.d.ts +21 -0
- package/dist/motion/timeline.d.ts.map +1 -0
- package/dist/motion/transition.d.ts +22 -0
- package/dist/motion/transition.d.ts.map +1 -0
- package/dist/motion/types.d.ts +182 -0
- package/dist/motion/types.d.ts.map +1 -0
- package/dist/motion.es.mjs +320 -61
- package/dist/motion.es.mjs.map +1 -1
- package/dist/persisted-DHoi3uEs.js +278 -0
- package/dist/persisted-DHoi3uEs.js.map +1 -0
- package/dist/platform/storage.d.ts.map +1 -1
- package/dist/platform.es.mjs +12 -7
- package/dist/platform.es.mjs.map +1 -1
- package/dist/reactive/batch.d.ts +13 -0
- package/dist/reactive/batch.d.ts.map +1 -0
- package/dist/reactive/computed.d.ts +50 -0
- package/dist/reactive/computed.d.ts.map +1 -0
- package/dist/reactive/core.d.ts +72 -0
- package/dist/reactive/core.d.ts.map +1 -0
- package/dist/reactive/effect.d.ts +15 -0
- package/dist/reactive/effect.d.ts.map +1 -0
- package/dist/reactive/index.d.ts +2 -2
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/internals.d.ts +42 -0
- package/dist/reactive/internals.d.ts.map +1 -0
- package/dist/reactive/linked.d.ts +36 -0
- package/dist/reactive/linked.d.ts.map +1 -0
- package/dist/reactive/persisted.d.ts +14 -0
- package/dist/reactive/persisted.d.ts.map +1 -0
- package/dist/reactive/readonly.d.ts +26 -0
- package/dist/reactive/readonly.d.ts.map +1 -0
- package/dist/reactive/signal.d.ts +13 -312
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive/type-guards.d.ts +20 -0
- package/dist/reactive/type-guards.d.ts.map +1 -0
- package/dist/reactive/untrack.d.ts +29 -0
- package/dist/reactive/untrack.d.ts.map +1 -0
- package/dist/reactive/watch.d.ts +42 -0
- package/dist/reactive/watch.d.ts.map +1 -0
- package/dist/reactive.es.mjs +30 -163
- package/dist/reactive.es.mjs.map +1 -1
- package/dist/router/index.d.ts +6 -252
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/links.d.ts +44 -0
- package/dist/router/links.d.ts.map +1 -0
- package/dist/router/match.d.ts +20 -0
- package/dist/router/match.d.ts.map +1 -0
- package/dist/router/navigation.d.ts +45 -0
- package/dist/router/navigation.d.ts.map +1 -0
- package/dist/router/query.d.ts +16 -0
- package/dist/router/query.d.ts.map +1 -0
- package/dist/router/router.d.ts +34 -0
- package/dist/router/router.d.ts.map +1 -0
- package/dist/router/state.d.ts +27 -0
- package/dist/router/state.d.ts.map +1 -0
- package/dist/router/types.d.ts +88 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/utils.d.ts +65 -0
- package/dist/router/utils.d.ts.map +1 -0
- package/dist/router.es.mjs +168 -132
- package/dist/router.es.mjs.map +1 -1
- package/dist/sanitize-Cxvxa-DX.js +283 -0
- package/dist/sanitize-Cxvxa-DX.js.map +1 -0
- package/dist/security/constants.d.ts +42 -0
- package/dist/security/constants.d.ts.map +1 -0
- package/dist/security/csp.d.ts +24 -0
- package/dist/security/csp.d.ts.map +1 -0
- package/dist/security/index.d.ts +4 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/sanitize-core.d.ts +13 -0
- package/dist/security/sanitize-core.d.ts.map +1 -0
- package/dist/security/sanitize.d.ts +5 -57
- package/dist/security/sanitize.d.ts.map +1 -1
- package/dist/security/trusted-types.d.ts +25 -0
- package/dist/security/trusted-types.d.ts.map +1 -0
- package/dist/security/types.d.ts +36 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security.es.mjs +50 -277
- package/dist/security.es.mjs.map +1 -1
- package/dist/store/create-store.d.ts +15 -0
- package/dist/store/create-store.d.ts.map +1 -0
- package/dist/store/define-store.d.ts +28 -0
- package/dist/store/define-store.d.ts.map +1 -0
- package/dist/store/devtools.d.ts +22 -0
- package/dist/store/devtools.d.ts.map +1 -0
- package/dist/store/index.d.ts +10 -286
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/mapping.d.ts +28 -0
- package/dist/store/mapping.d.ts.map +1 -0
- package/dist/store/persisted.d.ts +13 -0
- package/dist/store/persisted.d.ts.map +1 -0
- package/dist/store/plugins.d.ts +13 -0
- package/dist/store/plugins.d.ts.map +1 -0
- package/dist/store/registry.d.ts +28 -0
- package/dist/store/registry.d.ts.map +1 -0
- package/dist/store/types.d.ts +71 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/utils.d.ts +28 -0
- package/dist/store/utils.d.ts.map +1 -0
- package/dist/store/watch.d.ts +23 -0
- package/dist/store/watch.d.ts.map +1 -0
- package/dist/store.es.mjs +22 -224
- package/dist/store.es.mjs.map +1 -1
- package/dist/type-guards-BdKlYYlS.js +32 -0
- package/dist/type-guards-BdKlYYlS.js.map +1 -0
- package/dist/untrack-DNnnqdlR.js +6 -0
- package/dist/untrack-DNnnqdlR.js.map +1 -0
- package/dist/view/directives/bind.d.ts +7 -0
- package/dist/view/directives/bind.d.ts.map +1 -0
- package/dist/view/directives/class.d.ts +8 -0
- package/dist/view/directives/class.d.ts.map +1 -0
- package/dist/view/directives/for.d.ts +23 -0
- package/dist/view/directives/for.d.ts.map +1 -0
- package/dist/view/directives/html.d.ts +7 -0
- package/dist/view/directives/html.d.ts.map +1 -0
- package/dist/view/directives/if.d.ts +7 -0
- package/dist/view/directives/if.d.ts.map +1 -0
- package/dist/view/directives/index.d.ts +12 -0
- package/dist/view/directives/index.d.ts.map +1 -0
- package/dist/view/directives/model.d.ts +7 -0
- package/dist/view/directives/model.d.ts.map +1 -0
- package/dist/view/directives/on.d.ts +7 -0
- package/dist/view/directives/on.d.ts.map +1 -0
- package/dist/view/directives/ref.d.ts +7 -0
- package/dist/view/directives/ref.d.ts.map +1 -0
- package/dist/view/directives/show.d.ts +7 -0
- package/dist/view/directives/show.d.ts.map +1 -0
- package/dist/view/directives/style.d.ts +7 -0
- package/dist/view/directives/style.d.ts.map +1 -0
- package/dist/view/directives/text.d.ts +7 -0
- package/dist/view/directives/text.d.ts.map +1 -0
- package/dist/view/evaluate.d.ts +43 -0
- package/dist/view/evaluate.d.ts.map +1 -0
- package/dist/view/index.d.ts +3 -93
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/mount.d.ts +69 -0
- package/dist/view/mount.d.ts.map +1 -0
- package/dist/view/process.d.ts +26 -0
- package/dist/view/process.d.ts.map +1 -0
- package/dist/view/types.d.ts +36 -0
- package/dist/view/types.d.ts.map +1 -0
- package/dist/view.es.mjs +358 -251
- package/dist/view.es.mjs.map +1 -1
- package/dist/watch-DXXv3iAI.js +58 -0
- package/dist/watch-DXXv3iAI.js.map +1 -0
- package/package.json +14 -14
- package/src/component/component.ts +289 -0
- package/src/component/html.ts +53 -0
- package/src/component/index.ts +40 -414
- package/src/component/props.ts +116 -0
- package/src/component/types.ts +85 -0
- package/src/core/collection.ts +181 -7
- package/src/core/dom.ts +38 -0
- package/src/core/element.ts +59 -25
- package/src/core/index.ts +48 -4
- package/src/core/utils/array.ts +102 -0
- package/src/core/utils/function.ts +151 -0
- package/src/core/utils/index.ts +83 -0
- package/src/core/utils/misc.ts +82 -0
- package/src/core/utils/number.ts +78 -0
- package/src/core/utils/object.ts +206 -0
- package/src/core/utils/string.ts +112 -0
- package/src/core/utils/type-guards.ts +112 -0
- package/src/full.ts +187 -150
- package/src/index.ts +36 -36
- package/src/motion/animate.ts +113 -0
- package/src/motion/easing.ts +40 -0
- package/src/motion/flip.ts +176 -0
- package/src/motion/index.ts +41 -358
- package/src/motion/keyframes.ts +46 -0
- package/src/motion/reduced-motion.ts +17 -0
- package/src/motion/scroll.ts +57 -0
- package/src/motion/spring.ts +150 -0
- package/src/motion/stagger.ts +43 -0
- package/src/motion/timeline.ts +246 -0
- package/src/motion/transition.ts +51 -0
- package/src/motion/types.ts +198 -0
- package/src/platform/storage.ts +215 -208
- package/src/reactive/batch.ts +22 -0
- package/src/reactive/computed.ts +92 -0
- package/src/reactive/core.ts +114 -0
- package/src/reactive/effect.ts +54 -0
- package/src/reactive/index.ts +23 -22
- package/src/reactive/internals.ts +122 -0
- package/src/reactive/linked.ts +56 -0
- package/src/reactive/persisted.ts +74 -0
- package/src/reactive/readonly.ts +35 -0
- package/src/reactive/signal.ts +20 -520
- package/src/reactive/type-guards.ts +22 -0
- package/src/reactive/untrack.ts +31 -0
- package/src/reactive/watch.ts +73 -0
- package/src/router/index.ts +41 -718
- package/src/router/links.ts +130 -0
- package/src/router/match.ts +106 -0
- package/src/router/navigation.ts +71 -0
- package/src/router/query.ts +35 -0
- package/src/router/router.ts +211 -0
- package/src/router/state.ts +46 -0
- package/src/router/types.ts +93 -0
- package/src/router/utils.ts +116 -0
- package/src/security/constants.ts +209 -0
- package/src/security/csp.ts +77 -0
- package/src/security/index.ts +4 -12
- package/src/security/sanitize-core.ts +364 -0
- package/src/security/sanitize.ts +66 -625
- package/src/security/trusted-types.ts +69 -0
- package/src/security/types.ts +40 -0
- package/src/store/create-store.ts +329 -0
- package/src/store/define-store.ts +48 -0
- package/src/store/devtools.ts +45 -0
- package/src/store/index.ts +22 -848
- package/src/store/mapping.ts +73 -0
- package/src/store/persisted.ts +61 -0
- package/src/store/plugins.ts +32 -0
- package/src/store/registry.ts +51 -0
- package/src/store/types.ts +94 -0
- package/src/store/utils.ts +141 -0
- package/src/store/watch.ts +52 -0
- package/src/view/directives/bind.ts +23 -0
- package/src/view/directives/class.ts +70 -0
- package/src/view/directives/for.ts +275 -0
- package/src/view/directives/html.ts +19 -0
- package/src/view/directives/if.ts +30 -0
- package/src/view/directives/index.ts +11 -0
- package/src/view/directives/model.ts +56 -0
- package/src/view/directives/on.ts +41 -0
- package/src/view/directives/ref.ts +41 -0
- package/src/view/directives/show.ts +26 -0
- package/src/view/directives/style.ts +47 -0
- package/src/view/directives/text.ts +15 -0
- package/src/view/evaluate.ts +290 -0
- package/src/view/index.ts +112 -1041
- package/src/view/mount.ts +200 -0
- package/src/view/process.ts +92 -0
- package/src/view/types.ts +44 -0
- package/dist/core/utils.d.ts +0 -313
- package/dist/core/utils.d.ts.map +0 -1
- package/src/core/utils.ts +0 -444
package/dist/core.es.mjs
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
for (const t of
|
|
1
|
+
import { s as f } from "./sanitize-Cxvxa-DX.js";
|
|
2
|
+
const g = (n) => Array.isArray(n) ? n : [n], l = (n, e) => {
|
|
3
|
+
for (const t of n)
|
|
4
4
|
e(t);
|
|
5
|
+
}, p = (n) => f(n), w = (n, e) => {
|
|
6
|
+
n.innerHTML = f(e);
|
|
7
|
+
}, y = (n) => {
|
|
8
|
+
const e = document.createElement("template");
|
|
9
|
+
return e.innerHTML = f(n), e.content.firstElementChild ?? document.createElement("div");
|
|
10
|
+
}, b = (n, e, t) => {
|
|
11
|
+
if (typeof e == "string") {
|
|
12
|
+
n.insertAdjacentHTML(t, f(e));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const r = g(e), i = t === "afterbegin" || t === "afterend" ? r.slice().reverse() : r;
|
|
16
|
+
l(i, (o) => {
|
|
17
|
+
n.insertAdjacentElement(t, o);
|
|
18
|
+
});
|
|
5
19
|
};
|
|
6
|
-
class
|
|
20
|
+
class h {
|
|
7
21
|
/**
|
|
8
22
|
* Creates a new BQueryElement wrapper.
|
|
9
23
|
* @param element - The DOM element to wrap
|
|
@@ -41,14 +55,23 @@ class a {
|
|
|
41
55
|
attr(e, t) {
|
|
42
56
|
return t === void 0 ? this.element.getAttribute(e) ?? "" : (this.element.setAttribute(e, t), this);
|
|
43
57
|
}
|
|
58
|
+
/** Remove an attribute. */
|
|
59
|
+
removeAttr(e) {
|
|
60
|
+
return this.element.removeAttribute(e), this;
|
|
61
|
+
}
|
|
62
|
+
/** Toggle an attribute on/off. */
|
|
63
|
+
toggleAttr(e, t) {
|
|
64
|
+
const r = this.element.hasAttribute(e);
|
|
65
|
+
return t ?? !r ? this.element.setAttribute(e, "") : this.element.removeAttribute(e), this;
|
|
66
|
+
}
|
|
44
67
|
/** Get or set a property. */
|
|
45
68
|
prop(e, t) {
|
|
46
69
|
return t === void 0 ? this.element[e] : (this.element[e] = t, this);
|
|
47
70
|
}
|
|
48
71
|
/** Read or write data attributes in camelCase. */
|
|
49
72
|
data(e, t) {
|
|
50
|
-
const
|
|
51
|
-
return t === void 0 ? this.element.getAttribute(`data-${
|
|
73
|
+
const r = e.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`);
|
|
74
|
+
return t === void 0 ? this.element.getAttribute(`data-${r}`) ?? "" : (this.element.setAttribute(`data-${r}`, t), this);
|
|
52
75
|
}
|
|
53
76
|
/** Get or set text content. */
|
|
54
77
|
text(e) {
|
|
@@ -68,7 +91,7 @@ class a {
|
|
|
68
91
|
* ```
|
|
69
92
|
*/
|
|
70
93
|
html(e) {
|
|
71
|
-
return this.element
|
|
94
|
+
return w(this.element, e), this;
|
|
72
95
|
}
|
|
73
96
|
/**
|
|
74
97
|
* Sets HTML content without sanitization.
|
|
@@ -82,27 +105,15 @@ class a {
|
|
|
82
105
|
htmlUnsafe(e) {
|
|
83
106
|
return this.element.innerHTML = e, this;
|
|
84
107
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Gets or sets CSS styles on the element.
|
|
87
|
-
*
|
|
88
|
-
* @param property - A CSS property name or an object of property-value pairs
|
|
89
|
-
* @param value - The value when setting a single property
|
|
90
|
-
* @returns The instance for method chaining
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```ts
|
|
94
|
-
* // Single property
|
|
95
|
-
* $('#box').css('color', 'red');
|
|
96
|
-
*
|
|
97
|
-
* // Multiple properties
|
|
98
|
-
* $('#box').css({ color: 'red', 'font-size': '16px' });
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
108
|
css(e, t) {
|
|
102
|
-
if (typeof e == "string")
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.element.
|
|
109
|
+
if (typeof e == "string") {
|
|
110
|
+
if (t !== void 0)
|
|
111
|
+
return this.element.style.setProperty(e, t), this;
|
|
112
|
+
const r = this.element.ownerDocument?.defaultView;
|
|
113
|
+
return !r || typeof r.getComputedStyle != "function" ? "" : r.getComputedStyle(this.element).getPropertyValue(e);
|
|
114
|
+
}
|
|
115
|
+
for (const [r, s] of Object.entries(e))
|
|
116
|
+
this.element.style.setProperty(r, s);
|
|
106
117
|
return this;
|
|
107
118
|
}
|
|
108
119
|
/**
|
|
@@ -161,6 +172,10 @@ class a {
|
|
|
161
172
|
* Removes the parent element, keeping this element in its place.
|
|
162
173
|
* Essentially the opposite of wrap().
|
|
163
174
|
*
|
|
175
|
+
* **Important**: This method only moves the current element out of its parent
|
|
176
|
+
* before removing the parent. Any sibling elements will be removed along with
|
|
177
|
+
* the parent. For unwrapping multiple siblings, use a collection: `$$(siblings).unwrap()`.
|
|
178
|
+
*
|
|
164
179
|
* @returns The instance for method chaining
|
|
165
180
|
*
|
|
166
181
|
* @example
|
|
@@ -186,13 +201,8 @@ class a {
|
|
|
186
201
|
* ```
|
|
187
202
|
*/
|
|
188
203
|
replaceWith(e) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const n = document.createElement("template");
|
|
192
|
-
n.innerHTML = f(e), t = n.content.firstElementChild ?? document.createElement("div");
|
|
193
|
-
} else
|
|
194
|
-
t = e;
|
|
195
|
-
return this.element.replaceWith(t), new a(t);
|
|
204
|
+
const t = typeof e == "string" ? y(e) : e;
|
|
205
|
+
return this.element.replaceWith(t), new h(t);
|
|
196
206
|
}
|
|
197
207
|
/**
|
|
198
208
|
* Scrolls the element into view with configurable behavior.
|
|
@@ -232,7 +242,7 @@ class a {
|
|
|
232
242
|
* @returns A new BQueryElement wrapping the cloned element
|
|
233
243
|
*/
|
|
234
244
|
clone(e = !0) {
|
|
235
|
-
return new
|
|
245
|
+
return new h(this.element.cloneNode(e));
|
|
236
246
|
}
|
|
237
247
|
/**
|
|
238
248
|
* Finds all descendant elements matching the selector.
|
|
@@ -363,12 +373,12 @@ class a {
|
|
|
363
373
|
* $('#list').undelegate('click', '.item', handler);
|
|
364
374
|
* ```
|
|
365
375
|
*/
|
|
366
|
-
delegate(e, t,
|
|
367
|
-
const s = `${e}:${t}`, i = (
|
|
368
|
-
const
|
|
369
|
-
|
|
376
|
+
delegate(e, t, r) {
|
|
377
|
+
const s = `${e}:${t}`, i = (o) => {
|
|
378
|
+
const u = o.target.closest(t);
|
|
379
|
+
u && this.element.contains(u) && r(o, u);
|
|
370
380
|
};
|
|
371
|
-
return this.delegatedHandlers.has(s) || this.delegatedHandlers.set(s, /* @__PURE__ */ new Map()), this.delegatedHandlers.get(s).set(
|
|
381
|
+
return this.delegatedHandlers.has(s) || this.delegatedHandlers.set(s, /* @__PURE__ */ new Map()), this.delegatedHandlers.get(s).set(r, i), this.element.addEventListener(e, i), this;
|
|
372
382
|
}
|
|
373
383
|
/**
|
|
374
384
|
* Removes a delegated event listener previously added with `delegate()`.
|
|
@@ -387,11 +397,11 @@ class a {
|
|
|
387
397
|
* $('#list').undelegate('click', '.item', handler);
|
|
388
398
|
* ```
|
|
389
399
|
*/
|
|
390
|
-
undelegate(e, t,
|
|
400
|
+
undelegate(e, t, r) {
|
|
391
401
|
const s = `${e}:${t}`, i = this.delegatedHandlers.get(s);
|
|
392
402
|
if (i) {
|
|
393
|
-
const
|
|
394
|
-
|
|
403
|
+
const o = i.get(r);
|
|
404
|
+
o && (this.element.removeEventListener(e, o), i.delete(r), i.size === 0 && this.delegatedHandlers.delete(s));
|
|
395
405
|
}
|
|
396
406
|
return this;
|
|
397
407
|
}
|
|
@@ -404,6 +414,22 @@ class a {
|
|
|
404
414
|
matches(e) {
|
|
405
415
|
return this.element.matches(e);
|
|
406
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* Alias for `matches()`. Checks if the element matches a CSS selector.
|
|
419
|
+
*
|
|
420
|
+
* @param selector - CSS selector to match against
|
|
421
|
+
* @returns True if the element matches the selector
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* if ($('#el').is('.active')) {
|
|
426
|
+
* console.log('Element is active');
|
|
427
|
+
* }
|
|
428
|
+
* ```
|
|
429
|
+
*/
|
|
430
|
+
is(e) {
|
|
431
|
+
return this.matches(e);
|
|
432
|
+
}
|
|
407
433
|
/**
|
|
408
434
|
* Checks if the element has a specific class.
|
|
409
435
|
*
|
|
@@ -483,12 +509,12 @@ class a {
|
|
|
483
509
|
const e = this.element;
|
|
484
510
|
if (e.tagName.toLowerCase() !== "form")
|
|
485
511
|
return {};
|
|
486
|
-
const t = {},
|
|
487
|
-
for (const [s, i] of
|
|
512
|
+
const t = {}, r = new FormData(e);
|
|
513
|
+
for (const [s, i] of r.entries())
|
|
488
514
|
if (typeof i == "string")
|
|
489
515
|
if (s in t) {
|
|
490
|
-
const
|
|
491
|
-
Array.isArray(
|
|
516
|
+
const o = t[s];
|
|
517
|
+
Array.isArray(o) ? o.push(i) : t[s] = [o, i];
|
|
492
518
|
} else
|
|
493
519
|
t[s] = i;
|
|
494
520
|
return t;
|
|
@@ -508,10 +534,10 @@ class a {
|
|
|
508
534
|
const e = this.element;
|
|
509
535
|
if (e.tagName.toLowerCase() !== "form")
|
|
510
536
|
return "";
|
|
511
|
-
const t = new FormData(e),
|
|
537
|
+
const t = new FormData(e), r = new URLSearchParams();
|
|
512
538
|
for (const [s, i] of t.entries())
|
|
513
|
-
typeof i == "string" &&
|
|
514
|
-
return
|
|
539
|
+
typeof i == "string" && r.append(s, i);
|
|
540
|
+
return r.toString();
|
|
515
541
|
}
|
|
516
542
|
/**
|
|
517
543
|
* Gets the bounding client rectangle of the element.
|
|
@@ -540,17 +566,10 @@ class a {
|
|
|
540
566
|
* @internal
|
|
541
567
|
*/
|
|
542
568
|
insertContent(e, t) {
|
|
543
|
-
|
|
544
|
-
this.element.insertAdjacentHTML(t, f(e));
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
const n = p(e);
|
|
548
|
-
o(n, (s) => {
|
|
549
|
-
this.element.insertAdjacentElement(t, s);
|
|
550
|
-
});
|
|
569
|
+
b(this.element, e, t);
|
|
551
570
|
}
|
|
552
571
|
}
|
|
553
|
-
class
|
|
572
|
+
class c {
|
|
554
573
|
/**
|
|
555
574
|
* Creates a new collection wrapper.
|
|
556
575
|
* @param elements - Array of DOM elements to wrap
|
|
@@ -579,7 +598,7 @@ class m {
|
|
|
579
598
|
*/
|
|
580
599
|
eq(e) {
|
|
581
600
|
const t = this.elements[e];
|
|
582
|
-
return t ? new
|
|
601
|
+
return t ? new h(t) : void 0;
|
|
583
602
|
}
|
|
584
603
|
/**
|
|
585
604
|
* Gets the first element as a BQueryElement wrapper.
|
|
@@ -604,8 +623,8 @@ class m {
|
|
|
604
623
|
* @returns The instance for method chaining
|
|
605
624
|
*/
|
|
606
625
|
each(e) {
|
|
607
|
-
return this.elements.forEach((t,
|
|
608
|
-
e(new
|
|
626
|
+
return this.elements.forEach((t, r) => {
|
|
627
|
+
e(new h(t), r);
|
|
609
628
|
}), this;
|
|
610
629
|
}
|
|
611
630
|
/**
|
|
@@ -624,7 +643,7 @@ class m {
|
|
|
624
643
|
* @returns New BQueryCollection with matching elements
|
|
625
644
|
*/
|
|
626
645
|
filter(e) {
|
|
627
|
-
return new
|
|
646
|
+
return new c(this.elements.filter(e));
|
|
628
647
|
}
|
|
629
648
|
/**
|
|
630
649
|
* Reduces the collection to a single value.
|
|
@@ -642,19 +661,19 @@ class m {
|
|
|
642
661
|
* @returns Array of BQueryElement instances
|
|
643
662
|
*/
|
|
644
663
|
toArray() {
|
|
645
|
-
return this.elements.map((e) => new
|
|
664
|
+
return this.elements.map((e) => new h(e));
|
|
646
665
|
}
|
|
647
666
|
/** Add one or more classes to all elements. */
|
|
648
667
|
addClass(...e) {
|
|
649
|
-
return
|
|
668
|
+
return l(this.elements, (t) => t.classList.add(...e)), this;
|
|
650
669
|
}
|
|
651
670
|
/** Remove one or more classes from all elements. */
|
|
652
671
|
removeClass(...e) {
|
|
653
|
-
return
|
|
672
|
+
return l(this.elements, (t) => t.classList.remove(...e)), this;
|
|
654
673
|
}
|
|
655
674
|
/** Toggle a class on all elements. */
|
|
656
675
|
toggleClass(e, t) {
|
|
657
|
-
return
|
|
676
|
+
return l(this.elements, (r) => r.classList.toggle(e, t)), this;
|
|
658
677
|
}
|
|
659
678
|
/**
|
|
660
679
|
* Sets an attribute on all elements or gets from first.
|
|
@@ -664,7 +683,7 @@ class m {
|
|
|
664
683
|
* @returns Attribute value when getting, instance when setting
|
|
665
684
|
*/
|
|
666
685
|
attr(e, t) {
|
|
667
|
-
return t === void 0 ? this.first()?.getAttribute(e) ?? "" : (
|
|
686
|
+
return t === void 0 ? this.first()?.getAttribute(e) ?? "" : (l(this.elements, (r) => r.setAttribute(e, t)), this);
|
|
668
687
|
}
|
|
669
688
|
/**
|
|
670
689
|
* Removes an attribute from all elements.
|
|
@@ -673,7 +692,14 @@ class m {
|
|
|
673
692
|
* @returns The instance for method chaining
|
|
674
693
|
*/
|
|
675
694
|
removeAttr(e) {
|
|
676
|
-
return
|
|
695
|
+
return l(this.elements, (t) => t.removeAttribute(e)), this;
|
|
696
|
+
}
|
|
697
|
+
/** Toggle an attribute on all elements. */
|
|
698
|
+
toggleAttr(e, t) {
|
|
699
|
+
return l(this.elements, (r) => {
|
|
700
|
+
const s = r.hasAttribute(e);
|
|
701
|
+
t ?? !s ? r.setAttribute(e, "") : r.removeAttribute(e);
|
|
702
|
+
}), this;
|
|
677
703
|
}
|
|
678
704
|
/**
|
|
679
705
|
* Sets text content on all elements or gets from first.
|
|
@@ -682,7 +708,7 @@ class m {
|
|
|
682
708
|
* @returns Text content when getting, instance when setting
|
|
683
709
|
*/
|
|
684
710
|
text(e) {
|
|
685
|
-
return e === void 0 ? this.first()?.textContent ?? "" : (
|
|
711
|
+
return e === void 0 ? this.first()?.textContent ?? "" : (l(this.elements, (t) => {
|
|
686
712
|
t.textContent = e;
|
|
687
713
|
}), this);
|
|
688
714
|
}
|
|
@@ -695,9 +721,9 @@ class m {
|
|
|
695
721
|
html(e) {
|
|
696
722
|
if (e === void 0)
|
|
697
723
|
return this.first()?.innerHTML ?? "";
|
|
698
|
-
const t =
|
|
699
|
-
return
|
|
700
|
-
|
|
724
|
+
const t = p(e);
|
|
725
|
+
return l(this.elements, (r) => {
|
|
726
|
+
r.innerHTML = t;
|
|
701
727
|
}), this;
|
|
702
728
|
}
|
|
703
729
|
/**
|
|
@@ -708,24 +734,88 @@ class m {
|
|
|
708
734
|
* @warning Bypasses XSS protection
|
|
709
735
|
*/
|
|
710
736
|
htmlUnsafe(e) {
|
|
711
|
-
return
|
|
737
|
+
return l(this.elements, (t) => {
|
|
712
738
|
t.innerHTML = e;
|
|
713
739
|
}), this;
|
|
714
740
|
}
|
|
741
|
+
/** Append content to all elements. */
|
|
742
|
+
append(e) {
|
|
743
|
+
return this.insertAll(e, "beforeend"), this;
|
|
744
|
+
}
|
|
745
|
+
/** Prepend content to all elements. */
|
|
746
|
+
prepend(e) {
|
|
747
|
+
return this.insertAll(e, "afterbegin"), this;
|
|
748
|
+
}
|
|
749
|
+
/** Insert content before all elements. */
|
|
750
|
+
before(e) {
|
|
751
|
+
return this.insertAll(e, "beforebegin"), this;
|
|
752
|
+
}
|
|
753
|
+
/** Insert content after all elements. */
|
|
754
|
+
after(e) {
|
|
755
|
+
return this.insertAll(e, "afterend"), this;
|
|
756
|
+
}
|
|
757
|
+
css(e, t) {
|
|
758
|
+
if (typeof e == "string") {
|
|
759
|
+
if (t !== void 0)
|
|
760
|
+
return l(this.elements, (i) => {
|
|
761
|
+
i.style.setProperty(e, t);
|
|
762
|
+
}), this;
|
|
763
|
+
const r = this.first();
|
|
764
|
+
if (!r)
|
|
765
|
+
return "";
|
|
766
|
+
const s = r.ownerDocument?.defaultView;
|
|
767
|
+
return !s || typeof s.getComputedStyle != "function" ? "" : s.getComputedStyle(r).getPropertyValue(e);
|
|
768
|
+
}
|
|
769
|
+
return l(this.elements, (r) => {
|
|
770
|
+
for (const [s, i] of Object.entries(e))
|
|
771
|
+
r.style.setProperty(s, i);
|
|
772
|
+
}), this;
|
|
773
|
+
}
|
|
774
|
+
/** Wrap each element with a wrapper element or tag. */
|
|
775
|
+
wrap(e) {
|
|
776
|
+
return this.elements.forEach((t, r) => {
|
|
777
|
+
const s = typeof e == "string" ? document.createElement(e) : r === 0 ? e : e.cloneNode(!0);
|
|
778
|
+
t.parentNode?.insertBefore(s, t), s.appendChild(t);
|
|
779
|
+
}), this;
|
|
780
|
+
}
|
|
715
781
|
/**
|
|
716
|
-
*
|
|
782
|
+
* Remove the parent element of each element, keeping the elements in place.
|
|
717
783
|
*
|
|
718
|
-
*
|
|
719
|
-
*
|
|
720
|
-
*
|
|
784
|
+
* **Important**: This method unwraps ALL children of each parent element,
|
|
785
|
+
* not just the elements in the collection. If you call `unwrap()` on a
|
|
786
|
+
* collection containing only some children of a parent, all siblings will
|
|
787
|
+
* also be unwrapped. This behavior is consistent with jQuery's `.unwrap()`.
|
|
788
|
+
*
|
|
789
|
+
* @returns The collection for chaining
|
|
790
|
+
*
|
|
791
|
+
* @example
|
|
792
|
+
* ```ts
|
|
793
|
+
* // HTML: <div><section><span>A</span><span>B</span></section></div>
|
|
794
|
+
* const spans = $$('span');
|
|
795
|
+
* spans.unwrap(); // Removes <section>, both spans move to <div>
|
|
796
|
+
* // Result: <div><span>A</span><span>B</span></div>
|
|
797
|
+
* ```
|
|
721
798
|
*/
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
799
|
+
unwrap() {
|
|
800
|
+
const e = /* @__PURE__ */ new Set();
|
|
801
|
+
for (const t of this.elements)
|
|
802
|
+
t.parentElement && e.add(t.parentElement);
|
|
803
|
+
return e.forEach((t) => {
|
|
804
|
+
const r = t.parentNode;
|
|
805
|
+
if (r) {
|
|
806
|
+
for (; t.firstChild; )
|
|
807
|
+
r.insertBefore(t.firstChild, t);
|
|
808
|
+
t.remove();
|
|
809
|
+
}
|
|
810
|
+
}), this;
|
|
811
|
+
}
|
|
812
|
+
/** Replace each element with provided content. */
|
|
813
|
+
replaceWith(e) {
|
|
814
|
+
const t = [];
|
|
815
|
+
return this.elements.forEach((r, s) => {
|
|
816
|
+
const i = typeof e == "string" ? y(e) : s === 0 ? e : e.cloneNode(!0);
|
|
817
|
+
r.replaceWith(i), t.push(i);
|
|
818
|
+
}), new c(t);
|
|
729
819
|
}
|
|
730
820
|
/**
|
|
731
821
|
* Shows all elements.
|
|
@@ -734,7 +824,7 @@ class m {
|
|
|
734
824
|
* @returns The instance for method chaining
|
|
735
825
|
*/
|
|
736
826
|
show(e = "") {
|
|
737
|
-
return
|
|
827
|
+
return l(this.elements, (t) => {
|
|
738
828
|
t.removeAttribute("hidden"), t.style.display = e;
|
|
739
829
|
}), this;
|
|
740
830
|
}
|
|
@@ -744,7 +834,7 @@ class m {
|
|
|
744
834
|
* @returns The instance for method chaining
|
|
745
835
|
*/
|
|
746
836
|
hide() {
|
|
747
|
-
return
|
|
837
|
+
return l(this.elements, (e) => {
|
|
748
838
|
e.style.display = "none";
|
|
749
839
|
}), this;
|
|
750
840
|
}
|
|
@@ -756,7 +846,7 @@ class m {
|
|
|
756
846
|
* @returns The instance for method chaining
|
|
757
847
|
*/
|
|
758
848
|
on(e, t) {
|
|
759
|
-
return
|
|
849
|
+
return l(this.elements, (r) => r.addEventListener(e, t)), this;
|
|
760
850
|
}
|
|
761
851
|
/**
|
|
762
852
|
* Adds a one-time event listener to all elements.
|
|
@@ -766,7 +856,7 @@ class m {
|
|
|
766
856
|
* @returns The instance for method chaining
|
|
767
857
|
*/
|
|
768
858
|
once(e, t) {
|
|
769
|
-
return
|
|
859
|
+
return l(this.elements, (r) => r.addEventListener(e, t, { once: !0 })), this;
|
|
770
860
|
}
|
|
771
861
|
/**
|
|
772
862
|
* Removes an event listener from all elements.
|
|
@@ -776,7 +866,7 @@ class m {
|
|
|
776
866
|
* @returns The instance for method chaining
|
|
777
867
|
*/
|
|
778
868
|
off(e, t) {
|
|
779
|
-
return
|
|
869
|
+
return l(this.elements, (r) => r.removeEventListener(e, t)), this;
|
|
780
870
|
}
|
|
781
871
|
/**
|
|
782
872
|
* Triggers a custom event on all elements.
|
|
@@ -786,8 +876,8 @@ class m {
|
|
|
786
876
|
* @returns The instance for method chaining
|
|
787
877
|
*/
|
|
788
878
|
trigger(e, t) {
|
|
789
|
-
return
|
|
790
|
-
|
|
879
|
+
return l(this.elements, (r) => {
|
|
880
|
+
r.dispatchEvent(new CustomEvent(e, { detail: t, bubbles: !0, cancelable: !0 }));
|
|
791
881
|
}), this;
|
|
792
882
|
}
|
|
793
883
|
/**
|
|
@@ -810,16 +900,16 @@ class m {
|
|
|
810
900
|
* $$('.container').undelegate('click', '.item', handler);
|
|
811
901
|
* ```
|
|
812
902
|
*/
|
|
813
|
-
delegate(e, t,
|
|
903
|
+
delegate(e, t, r) {
|
|
814
904
|
const s = `${e}:${t}`;
|
|
815
|
-
return
|
|
816
|
-
const
|
|
817
|
-
const
|
|
818
|
-
|
|
905
|
+
return l(this.elements, (i) => {
|
|
906
|
+
const o = (a) => {
|
|
907
|
+
const m = a.target.closest(t);
|
|
908
|
+
m && i.contains(m) && r(a, m);
|
|
819
909
|
};
|
|
820
910
|
this.delegatedHandlers.has(i) || this.delegatedHandlers.set(i, /* @__PURE__ */ new Map());
|
|
821
|
-
const
|
|
822
|
-
|
|
911
|
+
const u = this.delegatedHandlers.get(i);
|
|
912
|
+
u.has(s) || u.set(s, /* @__PURE__ */ new Map()), u.get(s).set(r, o), i.addEventListener(e, o);
|
|
823
913
|
}), this;
|
|
824
914
|
}
|
|
825
915
|
/**
|
|
@@ -839,24 +929,45 @@ class m {
|
|
|
839
929
|
* $$('.container').undelegate('click', '.item', handler);
|
|
840
930
|
* ```
|
|
841
931
|
*/
|
|
842
|
-
undelegate(e, t,
|
|
932
|
+
undelegate(e, t, r) {
|
|
843
933
|
const s = `${e}:${t}`;
|
|
844
|
-
return
|
|
845
|
-
const
|
|
846
|
-
if (!
|
|
847
|
-
const
|
|
848
|
-
if (!
|
|
849
|
-
const
|
|
850
|
-
|
|
934
|
+
return l(this.elements, (i) => {
|
|
935
|
+
const o = this.delegatedHandlers.get(i);
|
|
936
|
+
if (!o) return;
|
|
937
|
+
const u = o.get(s);
|
|
938
|
+
if (!u) return;
|
|
939
|
+
const a = u.get(r);
|
|
940
|
+
a && (i.removeEventListener(e, a), u.delete(r), u.size === 0 && o.delete(s), o.size === 0 && this.delegatedHandlers.delete(i));
|
|
851
941
|
}), this;
|
|
852
942
|
}
|
|
943
|
+
/**
|
|
944
|
+
* Finds all descendant elements matching the selector across all elements
|
|
945
|
+
* in the collection. Returns a new BQueryCollection with the results.
|
|
946
|
+
*
|
|
947
|
+
* @param selector - CSS selector to match
|
|
948
|
+
* @returns A new BQueryCollection with all matching descendants
|
|
949
|
+
*
|
|
950
|
+
* @example
|
|
951
|
+
* ```ts
|
|
952
|
+
* $$('.container').find('.item').addClass('highlight');
|
|
953
|
+
* ```
|
|
954
|
+
*/
|
|
955
|
+
find(e) {
|
|
956
|
+
const t = /* @__PURE__ */ new Set(), r = [];
|
|
957
|
+
for (const s of this.elements) {
|
|
958
|
+
const i = s.querySelectorAll(e);
|
|
959
|
+
for (let o = 0; o < i.length; o++)
|
|
960
|
+
t.has(i[o]) || (t.add(i[o]), r.push(i[o]));
|
|
961
|
+
}
|
|
962
|
+
return new c(r);
|
|
963
|
+
}
|
|
853
964
|
/**
|
|
854
965
|
* Removes all elements from the DOM.
|
|
855
966
|
*
|
|
856
967
|
* @returns The instance for method chaining
|
|
857
968
|
*/
|
|
858
969
|
remove() {
|
|
859
|
-
return
|
|
970
|
+
return l(this.elements, (e) => e.remove()), this;
|
|
860
971
|
}
|
|
861
972
|
/**
|
|
862
973
|
* Clears all child nodes from all elements.
|
|
@@ -864,395 +975,290 @@ class m {
|
|
|
864
975
|
* @returns The instance for method chaining
|
|
865
976
|
*/
|
|
866
977
|
empty() {
|
|
867
|
-
return
|
|
978
|
+
return l(this.elements, (e) => {
|
|
868
979
|
e.innerHTML = "";
|
|
869
980
|
}), this;
|
|
870
981
|
}
|
|
982
|
+
/** @internal */
|
|
983
|
+
insertAll(e, t) {
|
|
984
|
+
if (typeof e == "string") {
|
|
985
|
+
const s = p(e);
|
|
986
|
+
l(this.elements, (i) => {
|
|
987
|
+
i.insertAdjacentHTML(t, s);
|
|
988
|
+
});
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
const r = g(e);
|
|
992
|
+
this.elements.forEach((s, i) => {
|
|
993
|
+
const o = i === 0 ? r : r.map((u) => u.cloneNode(!0));
|
|
994
|
+
b(s, o, t);
|
|
995
|
+
});
|
|
996
|
+
}
|
|
871
997
|
}
|
|
872
|
-
const
|
|
873
|
-
if (typeof
|
|
874
|
-
return new
|
|
875
|
-
const e = document.querySelector(
|
|
998
|
+
const oe = (n) => {
|
|
999
|
+
if (typeof n != "string")
|
|
1000
|
+
return new h(n);
|
|
1001
|
+
const e = document.querySelector(n);
|
|
876
1002
|
if (!e)
|
|
877
|
-
throw new Error(`bQuery: element not found for selector "${
|
|
878
|
-
return new
|
|
879
|
-
},
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
* ```
|
|
915
|
-
*
|
|
916
|
-
* @security This method is protected against prototype pollution attacks.
|
|
917
|
-
* Keys like `__proto__`, `constructor`, and `prototype` are ignored.
|
|
918
|
-
*/
|
|
919
|
-
merge(...r) {
|
|
920
|
-
const e = {};
|
|
921
|
-
for (const t of r)
|
|
922
|
-
for (const [n, s] of Object.entries(t))
|
|
923
|
-
c.isPrototypePollutionKey(n) || (c.isPlainObject(s) && c.isPlainObject(e[n]) ? e[n] = c.merge(
|
|
924
|
-
e[n],
|
|
925
|
-
s
|
|
926
|
-
) : e[n] = s);
|
|
927
|
-
return e;
|
|
928
|
-
},
|
|
929
|
-
/**
|
|
930
|
-
* Checks if a key could cause prototype pollution.
|
|
931
|
-
* These keys are dangerous when used in object merging operations.
|
|
932
|
-
*
|
|
933
|
-
* @param key - The key to check
|
|
934
|
-
* @returns True if the key is a prototype pollution vector
|
|
935
|
-
*
|
|
936
|
-
* @internal
|
|
937
|
-
*/
|
|
938
|
-
isPrototypePollutionKey(r) {
|
|
939
|
-
return r === "__proto__" || r === "constructor" || r === "prototype";
|
|
940
|
-
},
|
|
941
|
-
/**
|
|
942
|
-
* Creates a debounced function that delays execution until after
|
|
943
|
-
* the specified delay has elapsed since the last call.
|
|
944
|
-
*
|
|
945
|
-
* @template TArgs - The argument types of the function
|
|
946
|
-
* @param fn - The function to debounce
|
|
947
|
-
* @param delayMs - Delay in milliseconds
|
|
948
|
-
* @returns A debounced version of the function
|
|
949
|
-
*
|
|
950
|
-
* @example
|
|
951
|
-
* ```ts
|
|
952
|
-
* const search = utils.debounce((query: string) => {
|
|
953
|
-
* console.log('Searching:', query);
|
|
954
|
-
* }, 300);
|
|
955
|
-
*
|
|
956
|
-
* search('h');
|
|
957
|
-
* search('he');
|
|
958
|
-
* search('hello'); // Only this call executes after 300ms
|
|
959
|
-
* ```
|
|
960
|
-
*/
|
|
961
|
-
debounce(r, e) {
|
|
962
|
-
let t;
|
|
963
|
-
return (...n) => {
|
|
964
|
-
t && clearTimeout(t), t = setTimeout(() => r(...n), e);
|
|
965
|
-
};
|
|
966
|
-
},
|
|
967
|
-
/**
|
|
968
|
-
* Creates a throttled function that runs at most once per interval.
|
|
969
|
-
*
|
|
970
|
-
* @template TArgs - The argument types of the function
|
|
971
|
-
* @param fn - The function to throttle
|
|
972
|
-
* @param intervalMs - Minimum interval between calls in milliseconds
|
|
973
|
-
* @returns A throttled version of the function
|
|
974
|
-
*
|
|
975
|
-
* @example
|
|
976
|
-
* ```ts
|
|
977
|
-
* const handleScroll = utils.throttle(() => {
|
|
978
|
-
* console.log('Scroll position:', window.scrollY);
|
|
979
|
-
* }, 100);
|
|
980
|
-
*
|
|
981
|
-
* window.addEventListener('scroll', handleScroll);
|
|
982
|
-
* ```
|
|
983
|
-
*/
|
|
984
|
-
throttle(r, e) {
|
|
985
|
-
let t = 0;
|
|
986
|
-
return (...n) => {
|
|
987
|
-
const s = Date.now();
|
|
988
|
-
s - t >= e && (t = s, r(...n));
|
|
989
|
-
};
|
|
990
|
-
},
|
|
991
|
-
/**
|
|
992
|
-
* Creates a stable unique ID for DOM usage.
|
|
993
|
-
*
|
|
994
|
-
* @param prefix - Optional prefix for the ID (default: 'bQuery')
|
|
995
|
-
* @returns A unique identifier string
|
|
996
|
-
*
|
|
997
|
-
* @example
|
|
998
|
-
* ```ts
|
|
999
|
-
* const id = utils.uid('modal'); // 'modal_x7k2m9p'
|
|
1000
|
-
* ```
|
|
1001
|
-
*/
|
|
1002
|
-
uid(r = "bQuery") {
|
|
1003
|
-
return `${r}_${Math.random().toString(36).slice(2, 9)}`;
|
|
1004
|
-
},
|
|
1005
|
-
/**
|
|
1006
|
-
* Checks if a value is a DOM Element.
|
|
1007
|
-
*
|
|
1008
|
-
* @param value - The value to check
|
|
1009
|
-
* @returns True if the value is an Element
|
|
1010
|
-
*/
|
|
1011
|
-
isElement(r) {
|
|
1012
|
-
return r instanceof Element;
|
|
1013
|
-
},
|
|
1014
|
-
/**
|
|
1015
|
-
* Checks if a value is a BQueryCollection-like object.
|
|
1016
|
-
*
|
|
1017
|
-
* @param value - The value to check
|
|
1018
|
-
* @returns True if the value has an elements array property
|
|
1019
|
-
*/
|
|
1020
|
-
isCollection(r) {
|
|
1021
|
-
return !!(r && typeof r == "object" && "elements" in r);
|
|
1022
|
-
},
|
|
1023
|
-
/**
|
|
1024
|
-
* Checks for emptiness across common value types.
|
|
1025
|
-
*
|
|
1026
|
-
* @param value - The value to check
|
|
1027
|
-
* @returns True if the value is empty (null, undefined, empty string, empty array, or empty object)
|
|
1028
|
-
*
|
|
1029
|
-
* @example
|
|
1030
|
-
* ```ts
|
|
1031
|
-
* utils.isEmpty(''); // true
|
|
1032
|
-
* utils.isEmpty([]); // true
|
|
1033
|
-
* utils.isEmpty({}); // true
|
|
1034
|
-
* utils.isEmpty(null); // true
|
|
1035
|
-
* utils.isEmpty('hello'); // false
|
|
1036
|
-
* utils.isEmpty([1, 2]); // false
|
|
1037
|
-
* ```
|
|
1038
|
-
*/
|
|
1039
|
-
isEmpty(r) {
|
|
1040
|
-
return r == null ? !0 : typeof r == "string" ? r.trim().length === 0 : Array.isArray(r) ? r.length === 0 : typeof r == "object" ? Object.keys(r).length === 0 : !1;
|
|
1041
|
-
},
|
|
1042
|
-
/**
|
|
1043
|
-
* Checks if a value is a plain object (not null, array, or class instance).
|
|
1044
|
-
*
|
|
1045
|
-
* @param value - The value to check
|
|
1046
|
-
* @returns True if the value is a plain object
|
|
1047
|
-
*/
|
|
1048
|
-
isPlainObject(r) {
|
|
1049
|
-
return Object.prototype.toString.call(r) === "[object Object]";
|
|
1050
|
-
},
|
|
1051
|
-
/**
|
|
1052
|
-
* Checks if a value is a function.
|
|
1053
|
-
*
|
|
1054
|
-
* @param value - The value to check
|
|
1055
|
-
* @returns True if the value is a function
|
|
1056
|
-
*/
|
|
1057
|
-
isFunction(r) {
|
|
1058
|
-
return typeof r == "function";
|
|
1059
|
-
},
|
|
1060
|
-
/**
|
|
1061
|
-
* Checks if a value is a string.
|
|
1062
|
-
*
|
|
1063
|
-
* @param value - The value to check
|
|
1064
|
-
* @returns True if the value is a string
|
|
1065
|
-
*/
|
|
1066
|
-
isString(r) {
|
|
1067
|
-
return typeof r == "string";
|
|
1068
|
-
},
|
|
1069
|
-
/**
|
|
1070
|
-
* Checks if a value is a number (excluding NaN).
|
|
1071
|
-
*
|
|
1072
|
-
* @param value - The value to check
|
|
1073
|
-
* @returns True if the value is a valid number
|
|
1074
|
-
*/
|
|
1075
|
-
isNumber(r) {
|
|
1076
|
-
return typeof r == "number" && !Number.isNaN(r);
|
|
1077
|
-
},
|
|
1078
|
-
/**
|
|
1079
|
-
* Checks if a value is a boolean.
|
|
1080
|
-
*
|
|
1081
|
-
* @param value - The value to check
|
|
1082
|
-
* @returns True if the value is a boolean
|
|
1083
|
-
*/
|
|
1084
|
-
isBoolean(r) {
|
|
1085
|
-
return typeof r == "boolean";
|
|
1086
|
-
},
|
|
1087
|
-
/**
|
|
1088
|
-
* Checks if a value is an array.
|
|
1089
|
-
*
|
|
1090
|
-
* @template T - The type of array elements
|
|
1091
|
-
* @param value - The value to check
|
|
1092
|
-
* @returns True if the value is an array
|
|
1093
|
-
*/
|
|
1094
|
-
isArray(r) {
|
|
1095
|
-
return Array.isArray(r);
|
|
1096
|
-
},
|
|
1097
|
-
/**
|
|
1098
|
-
* Safely parses a JSON string, returning a default value on error.
|
|
1099
|
-
*
|
|
1100
|
-
* @template T - The expected type of the parsed value
|
|
1101
|
-
* @param json - The JSON string to parse
|
|
1102
|
-
* @param fallback - The default value if parsing fails
|
|
1103
|
-
* @returns The parsed value or the fallback
|
|
1104
|
-
*
|
|
1105
|
-
* @example
|
|
1106
|
-
* ```ts
|
|
1107
|
-
* utils.parseJson('{"name":"bQuery"}', {}); // { name: 'bQuery' }
|
|
1108
|
-
* utils.parseJson('invalid', {}); // {}
|
|
1109
|
-
* ```
|
|
1110
|
-
*/
|
|
1111
|
-
parseJson(r, e) {
|
|
1112
|
-
try {
|
|
1113
|
-
return JSON.parse(r);
|
|
1114
|
-
} catch {
|
|
1115
|
-
return e;
|
|
1003
|
+
throw new Error(`bQuery: element not found for selector "${n}"`);
|
|
1004
|
+
return new h(e);
|
|
1005
|
+
}, le = (n) => Array.isArray(n) ? new c(n) : n instanceof NodeList ? new c(Array.from(n)) : new c(Array.from(document.querySelectorAll(n)));
|
|
1006
|
+
function E(n) {
|
|
1007
|
+
return n == null ? [] : Array.isArray(n) ? n : [n];
|
|
1008
|
+
}
|
|
1009
|
+
function C(n) {
|
|
1010
|
+
return Array.from(new Set(n));
|
|
1011
|
+
}
|
|
1012
|
+
function L(n, e) {
|
|
1013
|
+
if (e <= 0) return [];
|
|
1014
|
+
const t = [];
|
|
1015
|
+
for (let r = 0; r < n.length; r += e)
|
|
1016
|
+
t.push(n.slice(r, r + e));
|
|
1017
|
+
return t;
|
|
1018
|
+
}
|
|
1019
|
+
function v(n) {
|
|
1020
|
+
return n.filter(Boolean);
|
|
1021
|
+
}
|
|
1022
|
+
function H(n) {
|
|
1023
|
+
const e = [];
|
|
1024
|
+
for (const t of n)
|
|
1025
|
+
Array.isArray(t) ? e.push(...t) : e.push(t);
|
|
1026
|
+
return e;
|
|
1027
|
+
}
|
|
1028
|
+
function N(n, e) {
|
|
1029
|
+
let t;
|
|
1030
|
+
return Object.assign(
|
|
1031
|
+
(...s) => {
|
|
1032
|
+
t !== void 0 && clearTimeout(t), t = setTimeout(() => {
|
|
1033
|
+
t = void 0, n(...s);
|
|
1034
|
+
}, e);
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
cancel: () => {
|
|
1038
|
+
t !== void 0 && (clearTimeout(t), t = void 0);
|
|
1039
|
+
}
|
|
1116
1040
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
* const user = { name: 'John', age: 30, password: 'secret' };
|
|
1151
|
-
* utils.omit(user, ['password']); // { name: 'John', age: 30 }
|
|
1152
|
-
* ```
|
|
1153
|
-
*/
|
|
1154
|
-
omit(r, e) {
|
|
1155
|
-
const t = { ...r };
|
|
1156
|
-
for (const n of e)
|
|
1157
|
-
delete t[n];
|
|
1158
|
-
return t;
|
|
1159
|
-
},
|
|
1160
|
-
/**
|
|
1161
|
-
* Delays execution for a specified number of milliseconds.
|
|
1162
|
-
*
|
|
1163
|
-
* @param ms - Milliseconds to delay
|
|
1164
|
-
* @returns A promise that resolves after the delay
|
|
1165
|
-
*
|
|
1166
|
-
* @example
|
|
1167
|
-
* ```ts
|
|
1168
|
-
* await utils.sleep(1000); // Wait 1 second
|
|
1169
|
-
* console.log('Done!');
|
|
1170
|
-
* ```
|
|
1171
|
-
*/
|
|
1172
|
-
sleep(r) {
|
|
1173
|
-
return new Promise((e) => setTimeout(e, r));
|
|
1174
|
-
},
|
|
1175
|
-
/**
|
|
1176
|
-
* Generates a random integer between min and max (inclusive).
|
|
1177
|
-
*
|
|
1178
|
-
* @param min - Minimum value
|
|
1179
|
-
* @param max - Maximum value
|
|
1180
|
-
* @returns A random integer in the range [min, max]
|
|
1181
|
-
*
|
|
1182
|
-
* @example
|
|
1183
|
-
* ```ts
|
|
1184
|
-
* const roll = utils.randomInt(1, 6); // Random dice roll
|
|
1185
|
-
* ```
|
|
1186
|
-
*/
|
|
1187
|
-
randomInt(r, e) {
|
|
1188
|
-
return Math.floor(Math.random() * (e - r + 1)) + r;
|
|
1189
|
-
},
|
|
1190
|
-
/**
|
|
1191
|
-
* Clamps a number between a minimum and maximum value.
|
|
1192
|
-
*
|
|
1193
|
-
* @param value - The value to clamp
|
|
1194
|
-
* @param min - Minimum value
|
|
1195
|
-
* @param max - Maximum value
|
|
1196
|
-
* @returns The clamped value
|
|
1197
|
-
*
|
|
1198
|
-
* @example
|
|
1199
|
-
* ```ts
|
|
1200
|
-
* utils.clamp(150, 0, 100); // 100
|
|
1201
|
-
* utils.clamp(-10, 0, 100); // 0
|
|
1202
|
-
* utils.clamp(50, 0, 100); // 50
|
|
1203
|
-
* ```
|
|
1204
|
-
*/
|
|
1205
|
-
clamp(r, e, t) {
|
|
1206
|
-
return Math.min(Math.max(r, e), t);
|
|
1207
|
-
},
|
|
1208
|
-
/**
|
|
1209
|
-
* Capitalizes the first letter of a string.
|
|
1210
|
-
*
|
|
1211
|
-
* @param str - The string to capitalize
|
|
1212
|
-
* @returns The capitalized string
|
|
1213
|
-
*
|
|
1214
|
-
* @example
|
|
1215
|
-
* ```ts
|
|
1216
|
-
* utils.capitalize('hello'); // 'Hello'
|
|
1217
|
-
* ```
|
|
1218
|
-
*/
|
|
1219
|
-
capitalize(r) {
|
|
1220
|
-
return r && r.charAt(0).toUpperCase() + r.slice(1);
|
|
1221
|
-
},
|
|
1222
|
-
/**
|
|
1223
|
-
* Converts a string to kebab-case.
|
|
1224
|
-
*
|
|
1225
|
-
* @param str - The string to convert
|
|
1226
|
-
* @returns The kebab-cased string
|
|
1227
|
-
*
|
|
1228
|
-
* @example
|
|
1229
|
-
* ```ts
|
|
1230
|
-
* utils.toKebabCase('myVariableName'); // 'my-variable-name'
|
|
1231
|
-
* ```
|
|
1232
|
-
*/
|
|
1233
|
-
toKebabCase(r) {
|
|
1234
|
-
return r.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
1235
|
-
},
|
|
1236
|
-
/**
|
|
1237
|
-
* Converts a string to camelCase.
|
|
1238
|
-
*
|
|
1239
|
-
* @param str - The string to convert
|
|
1240
|
-
* @returns The camelCased string
|
|
1241
|
-
*
|
|
1242
|
-
* @example
|
|
1243
|
-
* ```ts
|
|
1244
|
-
* utils.toCamelCase('my-variable-name'); // 'myVariableName'
|
|
1245
|
-
* ```
|
|
1246
|
-
*/
|
|
1247
|
-
toCamelCase(r) {
|
|
1248
|
-
return r.replace(/[-_\s]+(.)?/g, (e, t) => t ? t.toUpperCase() : "").replace(/^[A-Z]/, (e) => e.toLowerCase());
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
function S(n, e) {
|
|
1044
|
+
let t = 0;
|
|
1045
|
+
return Object.assign(
|
|
1046
|
+
(...s) => {
|
|
1047
|
+
const i = Date.now();
|
|
1048
|
+
i - t >= e && (t = i, n(...s));
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
cancel: () => {
|
|
1052
|
+
t = 0;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
function $(n) {
|
|
1058
|
+
let e = !1, t;
|
|
1059
|
+
return (...r) => (e || (t = n(...r), e = !0), t);
|
|
1060
|
+
}
|
|
1061
|
+
function M() {
|
|
1062
|
+
}
|
|
1063
|
+
function j(n = "bQuery") {
|
|
1064
|
+
return `${n}_${Math.random().toString(36).slice(2, 9)}`;
|
|
1065
|
+
}
|
|
1066
|
+
function O(n) {
|
|
1067
|
+
return new Promise((e) => setTimeout(e, n));
|
|
1068
|
+
}
|
|
1069
|
+
function T(n, e) {
|
|
1070
|
+
try {
|
|
1071
|
+
return JSON.parse(n);
|
|
1072
|
+
} catch {
|
|
1073
|
+
return e;
|
|
1249
1074
|
}
|
|
1075
|
+
}
|
|
1076
|
+
function P(n) {
|
|
1077
|
+
return n == null ? !0 : typeof n == "string" ? n.trim().length === 0 : Array.isArray(n) ? n.length === 0 : typeof n == "object" ? Object.keys(n).length === 0 : !1;
|
|
1078
|
+
}
|
|
1079
|
+
function k(n, e) {
|
|
1080
|
+
return Math.floor(Math.random() * (e - n + 1)) + n;
|
|
1081
|
+
}
|
|
1082
|
+
function z(n, e, t) {
|
|
1083
|
+
return Math.min(Math.max(n, e), t);
|
|
1084
|
+
}
|
|
1085
|
+
function D(n, e, t, r = !0) {
|
|
1086
|
+
return r ? n >= e && n <= t : n > e && n < t;
|
|
1087
|
+
}
|
|
1088
|
+
function q(n, e = 0) {
|
|
1089
|
+
const t = typeof n == "number" ? n : Number(n);
|
|
1090
|
+
return Number.isNaN(t) ? e : t;
|
|
1091
|
+
}
|
|
1092
|
+
function d(n) {
|
|
1093
|
+
return Object.prototype.toString.call(n) === "[object Object]";
|
|
1094
|
+
}
|
|
1095
|
+
function x(n) {
|
|
1096
|
+
return n === "__proto__" || n === "constructor" || n === "prototype";
|
|
1097
|
+
}
|
|
1098
|
+
function R(n) {
|
|
1099
|
+
return typeof structuredClone == "function" ? structuredClone(n) : JSON.parse(JSON.stringify(n));
|
|
1100
|
+
}
|
|
1101
|
+
function A(...n) {
|
|
1102
|
+
const e = {};
|
|
1103
|
+
for (const t of n)
|
|
1104
|
+
for (const [r, s] of Object.entries(t))
|
|
1105
|
+
x(r) || (d(s) && d(e[r]) ? e[r] = A(
|
|
1106
|
+
e[r],
|
|
1107
|
+
s
|
|
1108
|
+
) : e[r] = s);
|
|
1109
|
+
return e;
|
|
1110
|
+
}
|
|
1111
|
+
function B(n, e) {
|
|
1112
|
+
const t = {};
|
|
1113
|
+
for (const r of e)
|
|
1114
|
+
r in n && (t[r] = n[r]);
|
|
1115
|
+
return t;
|
|
1116
|
+
}
|
|
1117
|
+
function W(n, e) {
|
|
1118
|
+
const t = { ...n };
|
|
1119
|
+
for (const r of e)
|
|
1120
|
+
delete t[r];
|
|
1121
|
+
return t;
|
|
1122
|
+
}
|
|
1123
|
+
function F(n, e) {
|
|
1124
|
+
return Object.prototype.hasOwnProperty.call(n, e);
|
|
1125
|
+
}
|
|
1126
|
+
function U(n) {
|
|
1127
|
+
return n && n.charAt(0).toUpperCase() + n.slice(1);
|
|
1128
|
+
}
|
|
1129
|
+
function J(n) {
|
|
1130
|
+
return n.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
1131
|
+
}
|
|
1132
|
+
function V(n) {
|
|
1133
|
+
return n.replace(/[-_\s]+(.)?/g, (e, t) => t ? t.toUpperCase() : "").replace(/^[A-Z]/, (e) => e.toLowerCase());
|
|
1134
|
+
}
|
|
1135
|
+
function _(n, e, t = "…") {
|
|
1136
|
+
if (e <= 0) return "";
|
|
1137
|
+
if (n.length <= e) return n;
|
|
1138
|
+
const r = Math.max(0, e - t.length);
|
|
1139
|
+
return `${n.slice(0, r)}${t}`;
|
|
1140
|
+
}
|
|
1141
|
+
function I(n) {
|
|
1142
|
+
return n.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\w\s-]/g, "").trim().replace(/[\s_-]+/g, "-").toLowerCase();
|
|
1143
|
+
}
|
|
1144
|
+
function Z(n) {
|
|
1145
|
+
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1146
|
+
}
|
|
1147
|
+
function K(n) {
|
|
1148
|
+
return typeof Element < "u" && n instanceof Element;
|
|
1149
|
+
}
|
|
1150
|
+
function G(n) {
|
|
1151
|
+
return !!(n && typeof n == "object" && "elements" in n);
|
|
1152
|
+
}
|
|
1153
|
+
function X(n) {
|
|
1154
|
+
return typeof n == "function";
|
|
1155
|
+
}
|
|
1156
|
+
function Y(n) {
|
|
1157
|
+
return typeof n == "string";
|
|
1158
|
+
}
|
|
1159
|
+
function Q(n) {
|
|
1160
|
+
return typeof n == "number" && !Number.isNaN(n);
|
|
1161
|
+
}
|
|
1162
|
+
function ee(n) {
|
|
1163
|
+
return typeof n == "boolean";
|
|
1164
|
+
}
|
|
1165
|
+
function te(n) {
|
|
1166
|
+
return Array.isArray(n);
|
|
1167
|
+
}
|
|
1168
|
+
function ne(n) {
|
|
1169
|
+
return n instanceof Date;
|
|
1170
|
+
}
|
|
1171
|
+
function re(n) {
|
|
1172
|
+
return !!(n && (n instanceof Promise || typeof n == "object" && "then" in n && typeof n.then == "function"));
|
|
1173
|
+
}
|
|
1174
|
+
function se(n) {
|
|
1175
|
+
return typeof n == "object" && n !== null;
|
|
1176
|
+
}
|
|
1177
|
+
const ue = {
|
|
1178
|
+
clone: R,
|
|
1179
|
+
merge: A,
|
|
1180
|
+
pick: B,
|
|
1181
|
+
omit: W,
|
|
1182
|
+
hasOwn: F,
|
|
1183
|
+
debounce: N,
|
|
1184
|
+
throttle: S,
|
|
1185
|
+
once: $,
|
|
1186
|
+
noop: M,
|
|
1187
|
+
uid: j,
|
|
1188
|
+
isElement: K,
|
|
1189
|
+
isCollection: G,
|
|
1190
|
+
isEmpty: P,
|
|
1191
|
+
isPlainObject: d,
|
|
1192
|
+
isFunction: X,
|
|
1193
|
+
isString: Y,
|
|
1194
|
+
isNumber: Q,
|
|
1195
|
+
isBoolean: ee,
|
|
1196
|
+
isArray: te,
|
|
1197
|
+
isDate: ne,
|
|
1198
|
+
isPromise: re,
|
|
1199
|
+
isObject: se,
|
|
1200
|
+
parseJson: T,
|
|
1201
|
+
sleep: O,
|
|
1202
|
+
randomInt: k,
|
|
1203
|
+
clamp: z,
|
|
1204
|
+
inRange: D,
|
|
1205
|
+
toNumber: q,
|
|
1206
|
+
capitalize: U,
|
|
1207
|
+
toKebabCase: J,
|
|
1208
|
+
toCamelCase: V,
|
|
1209
|
+
truncate: _,
|
|
1210
|
+
slugify: I,
|
|
1211
|
+
escapeRegExp: Z,
|
|
1212
|
+
ensureArray: E,
|
|
1213
|
+
unique: C,
|
|
1214
|
+
chunk: L,
|
|
1215
|
+
compact: v,
|
|
1216
|
+
flatten: H
|
|
1250
1217
|
};
|
|
1251
1218
|
export {
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1219
|
+
oe as $,
|
|
1220
|
+
le as $$,
|
|
1221
|
+
c as BQueryCollection,
|
|
1222
|
+
h as BQueryElement,
|
|
1223
|
+
U as capitalize,
|
|
1224
|
+
L as chunk,
|
|
1225
|
+
z as clamp,
|
|
1226
|
+
R as clone,
|
|
1227
|
+
v as compact,
|
|
1228
|
+
N as debounce,
|
|
1229
|
+
E as ensureArray,
|
|
1230
|
+
Z as escapeRegExp,
|
|
1231
|
+
H as flatten,
|
|
1232
|
+
F as hasOwn,
|
|
1233
|
+
D as inRange,
|
|
1234
|
+
te as isArray,
|
|
1235
|
+
ee as isBoolean,
|
|
1236
|
+
G as isCollection,
|
|
1237
|
+
ne as isDate,
|
|
1238
|
+
K as isElement,
|
|
1239
|
+
P as isEmpty,
|
|
1240
|
+
X as isFunction,
|
|
1241
|
+
Q as isNumber,
|
|
1242
|
+
se as isObject,
|
|
1243
|
+
d as isPlainObject,
|
|
1244
|
+
re as isPromise,
|
|
1245
|
+
Y as isString,
|
|
1246
|
+
A as merge,
|
|
1247
|
+
M as noop,
|
|
1248
|
+
W as omit,
|
|
1249
|
+
$ as once,
|
|
1250
|
+
T as parseJson,
|
|
1251
|
+
B as pick,
|
|
1252
|
+
k as randomInt,
|
|
1253
|
+
O as sleep,
|
|
1254
|
+
I as slugify,
|
|
1255
|
+
S as throttle,
|
|
1256
|
+
V as toCamelCase,
|
|
1257
|
+
J as toKebabCase,
|
|
1258
|
+
q as toNumber,
|
|
1259
|
+
_ as truncate,
|
|
1260
|
+
j as uid,
|
|
1261
|
+
C as unique,
|
|
1262
|
+
ue as utils
|
|
1257
1263
|
};
|
|
1258
1264
|
//# sourceMappingURL=core.es.mjs.map
|