tiny-essentials 1.22.9 → 1.22.10
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/changelog/1/22/10.md +15 -0
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/libs/TinyHtml.cjs +24 -17
- package/dist/v1/libs/TinyHtml.d.mts +24 -24
- package/dist/v1/libs/TinyHtml.mjs +23 -17
- package/package.json +1 -1
|
@@ -1627,12 +1627,12 @@ class TinyHtml {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
|
|
1629
1629
|
/**
|
|
1630
|
-
*
|
|
1630
|
+
* Returns elements from the current list that contain the given target(s).
|
|
1631
1631
|
* @param {string|TinyElement|TinyElement[]} target - Selector or DOM element(s).
|
|
1632
|
-
* @returns {
|
|
1632
|
+
* @returns {Element[]} Elements that contain the target.
|
|
1633
1633
|
*/
|
|
1634
1634
|
has(target) {
|
|
1635
|
-
return TinyHtml.has(this, target)
|
|
1635
|
+
return TinyHtml.has(this, target);
|
|
1636
1636
|
}
|
|
1637
1637
|
|
|
1638
1638
|
/**
|
|
@@ -2154,7 +2154,7 @@ class TinyHtml {
|
|
|
2154
2154
|
/**
|
|
2155
2155
|
* Normalize and validate nodes before DOM insertion.
|
|
2156
2156
|
* Converts TinyNode-like structures or strings into DOM-compatible nodes.
|
|
2157
|
-
* @type {(where: string, ...nodes: AppendCheckerValues[]) => (Node | string)[]}
|
|
2157
|
+
* @type {(where: string, ...nodes: (AppendCheckerValues|Record<string, AppendCheckerValues>)[]) => (Node | string)[]}
|
|
2158
2158
|
* @readonly
|
|
2159
2159
|
*/
|
|
2160
2160
|
static _appendChecker(where, ...nodes) {
|
|
@@ -2162,9 +2162,16 @@ class TinyHtml {
|
|
|
2162
2162
|
const results = [];
|
|
2163
2163
|
for (const item of nodes) {
|
|
2164
2164
|
if (typeof item === 'undefined' || item === null || item === false) continue;
|
|
2165
|
-
if (typeof item !== 'string') {
|
|
2166
|
-
if (
|
|
2167
|
-
|
|
2165
|
+
if (typeof item !== 'string' && typeof item !== 'number') {
|
|
2166
|
+
if (item instanceof Node || item instanceof TinyHtml)
|
|
2167
|
+
results.push(TinyHtml._preNodeElems(item, where)[0]);
|
|
2168
|
+
else if (Array.isArray(item)) results.push(...TinyHtml._appendChecker(where, ...item));
|
|
2169
|
+
else {
|
|
2170
|
+
for (const name in item) {
|
|
2171
|
+
const elems = item[name];
|
|
2172
|
+
results.push(...TinyHtml._appendChecker(where, elems));
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2168
2175
|
} else results.push(item);
|
|
2169
2176
|
}
|
|
2170
2177
|
return results;
|
|
@@ -2175,7 +2182,7 @@ class TinyHtml {
|
|
|
2175
2182
|
*
|
|
2176
2183
|
* @template {TinyElement} T
|
|
2177
2184
|
* @param {T} el - The target element(s) to receive children.
|
|
2178
|
-
* @param {...AppendCheckerValues} children - The child elements or text to append.
|
|
2185
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to append.
|
|
2179
2186
|
* @returns {T}
|
|
2180
2187
|
*/
|
|
2181
2188
|
static append(el, ...children) {
|
|
@@ -2187,7 +2194,7 @@ class TinyHtml {
|
|
|
2187
2194
|
/**
|
|
2188
2195
|
* Appends child elements or strings to the end of the target element(s).
|
|
2189
2196
|
*
|
|
2190
|
-
* @param {...AppendCheckerValues} children - The child elements or text to append.
|
|
2197
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to append.
|
|
2191
2198
|
* @returns {this}
|
|
2192
2199
|
*/
|
|
2193
2200
|
append(...children) {
|
|
@@ -2199,7 +2206,7 @@ class TinyHtml {
|
|
|
2199
2206
|
*
|
|
2200
2207
|
* @template {TinyElement} T
|
|
2201
2208
|
* @param {T} el - The target element(s) to receive children.
|
|
2202
|
-
* @param {...AppendCheckerValues} children - The child elements or text to prepend.
|
|
2209
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to prepend.
|
|
2203
2210
|
* @returns {T}
|
|
2204
2211
|
*/
|
|
2205
2212
|
static prepend(el, ...children) {
|
|
@@ -2211,7 +2218,7 @@ class TinyHtml {
|
|
|
2211
2218
|
/**
|
|
2212
2219
|
* Prepends child elements or strings to the beginning of the target element(s).
|
|
2213
2220
|
*
|
|
2214
|
-
* @param {...AppendCheckerValues} children - The child elements or text to prepend.
|
|
2221
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to prepend.
|
|
2215
2222
|
* @returns {this}
|
|
2216
2223
|
*/
|
|
2217
2224
|
prepend(...children) {
|
|
@@ -2223,7 +2230,7 @@ class TinyHtml {
|
|
|
2223
2230
|
*
|
|
2224
2231
|
* @template {TinyElement} T
|
|
2225
2232
|
* @param {T} el - The target element(s) before which new content is inserted.
|
|
2226
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert before the target.
|
|
2233
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert before the target.
|
|
2227
2234
|
* @returns {T}
|
|
2228
2235
|
*/
|
|
2229
2236
|
static before(el, ...children) {
|
|
@@ -2235,7 +2242,7 @@ class TinyHtml {
|
|
|
2235
2242
|
/**
|
|
2236
2243
|
* Inserts elements or strings immediately before the target element(s) in the DOM.
|
|
2237
2244
|
*
|
|
2238
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert before the target.
|
|
2245
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert before the target.
|
|
2239
2246
|
* @returns {this}
|
|
2240
2247
|
*/
|
|
2241
2248
|
before(...children) {
|
|
@@ -2247,7 +2254,7 @@ class TinyHtml {
|
|
|
2247
2254
|
*
|
|
2248
2255
|
* @template {TinyElement} T
|
|
2249
2256
|
* @param {T} el - The target element(s) after which new content is inserted.
|
|
2250
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert after the target.
|
|
2257
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert after the target.
|
|
2251
2258
|
* @returns {T}
|
|
2252
2259
|
*/
|
|
2253
2260
|
static after(el, ...children) {
|
|
@@ -2259,7 +2266,7 @@ class TinyHtml {
|
|
|
2259
2266
|
/**
|
|
2260
2267
|
* Inserts elements or strings immediately after the target element(s) in the DOM.
|
|
2261
2268
|
*
|
|
2262
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert after the target.
|
|
2269
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert after the target.
|
|
2263
2270
|
* @returns {this}
|
|
2264
2271
|
*/
|
|
2265
2272
|
after(...children) {
|
|
@@ -2271,7 +2278,7 @@ class TinyHtml {
|
|
|
2271
2278
|
*
|
|
2272
2279
|
* @template {TinyElement} T
|
|
2273
2280
|
* @param {T} el - The element(s) to be replaced.
|
|
2274
|
-
* @param {...AppendCheckerValues} newNodes - New elements or text to replace the target.
|
|
2281
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} newNodes - New elements or text to replace the target.
|
|
2275
2282
|
* @returns {T}
|
|
2276
2283
|
*/
|
|
2277
2284
|
static replaceWith(el, ...newNodes) {
|
|
@@ -2283,7 +2290,7 @@ class TinyHtml {
|
|
|
2283
2290
|
/**
|
|
2284
2291
|
* Replaces the target element(s) in the DOM with new elements or text.
|
|
2285
2292
|
*
|
|
2286
|
-
* @param {...AppendCheckerValues} newNodes - New elements or text to replace the target.
|
|
2293
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} newNodes - New elements or text to replace the target.
|
|
2287
2294
|
* @returns {this}
|
|
2288
2295
|
*/
|
|
2289
2296
|
replaceWith(...newNodes) {
|
|
@@ -977,52 +977,52 @@ declare class TinyHtml<TinyHtmlT extends ConstructorElValues | ConstructorElValu
|
|
|
977
977
|
* @returns {Node[]}
|
|
978
978
|
*/
|
|
979
979
|
static clone(el: TinyNode | TinyNode[], deep?: boolean): Node[];
|
|
980
|
-
static readonly _appendChecker(where: string, ...nodes: AppendCheckerValues[]): (Node | string)[];
|
|
980
|
+
static readonly _appendChecker(where: string, ...nodes: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): (Node | string)[];
|
|
981
981
|
/**
|
|
982
982
|
* Appends child elements or strings to the end of the target element(s).
|
|
983
983
|
*
|
|
984
984
|
* @template {TinyElement} T
|
|
985
985
|
* @param {T} el - The target element(s) to receive children.
|
|
986
|
-
* @param {...AppendCheckerValues} children - The child elements or text to append.
|
|
986
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to append.
|
|
987
987
|
* @returns {T}
|
|
988
988
|
*/
|
|
989
|
-
static append<T extends TinyElement>(el: T, ...children: AppendCheckerValues[]): T;
|
|
989
|
+
static append<T extends TinyElement>(el: T, ...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): T;
|
|
990
990
|
/**
|
|
991
991
|
* Prepends child elements or strings to the beginning of the target element(s).
|
|
992
992
|
*
|
|
993
993
|
* @template {TinyElement} T
|
|
994
994
|
* @param {T} el - The target element(s) to receive children.
|
|
995
|
-
* @param {...AppendCheckerValues} children - The child elements or text to prepend.
|
|
995
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to prepend.
|
|
996
996
|
* @returns {T}
|
|
997
997
|
*/
|
|
998
|
-
static prepend<T extends TinyElement>(el: T, ...children: AppendCheckerValues[]): T;
|
|
998
|
+
static prepend<T extends TinyElement>(el: T, ...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): T;
|
|
999
999
|
/**
|
|
1000
1000
|
* Inserts elements or strings immediately before the target element(s) in the DOM.
|
|
1001
1001
|
*
|
|
1002
1002
|
* @template {TinyElement} T
|
|
1003
1003
|
* @param {T} el - The target element(s) before which new content is inserted.
|
|
1004
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert before the target.
|
|
1004
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert before the target.
|
|
1005
1005
|
* @returns {T}
|
|
1006
1006
|
*/
|
|
1007
|
-
static before<T extends TinyElement>(el: T, ...children: AppendCheckerValues[]): T;
|
|
1007
|
+
static before<T extends TinyElement>(el: T, ...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): T;
|
|
1008
1008
|
/**
|
|
1009
1009
|
* Inserts elements or strings immediately after the target element(s) in the DOM.
|
|
1010
1010
|
*
|
|
1011
1011
|
* @template {TinyElement} T
|
|
1012
1012
|
* @param {T} el - The target element(s) after which new content is inserted.
|
|
1013
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert after the target.
|
|
1013
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert after the target.
|
|
1014
1014
|
* @returns {T}
|
|
1015
1015
|
*/
|
|
1016
|
-
static after<T extends TinyElement>(el: T, ...children: AppendCheckerValues[]): T;
|
|
1016
|
+
static after<T extends TinyElement>(el: T, ...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): T;
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Replaces the target element(s) in the DOM with new elements or text.
|
|
1019
1019
|
*
|
|
1020
1020
|
* @template {TinyElement} T
|
|
1021
1021
|
* @param {T} el - The element(s) to be replaced.
|
|
1022
|
-
* @param {...AppendCheckerValues} newNodes - New elements or text to replace the target.
|
|
1022
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} newNodes - New elements or text to replace the target.
|
|
1023
1023
|
* @returns {T}
|
|
1024
1024
|
*/
|
|
1025
|
-
static replaceWith<T extends TinyElement>(el: T, ...newNodes: AppendCheckerValues[]): T;
|
|
1025
|
+
static replaceWith<T extends TinyElement>(el: T, ...newNodes: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): T;
|
|
1026
1026
|
/**
|
|
1027
1027
|
* Appends the given element(s) to each target element in sequence.
|
|
1028
1028
|
*
|
|
@@ -2821,11 +2821,11 @@ declare class TinyHtml<TinyHtmlT extends ConstructorElValues | ConstructorElValu
|
|
|
2821
2821
|
*/
|
|
2822
2822
|
is(selector: WinnowRequest): boolean;
|
|
2823
2823
|
/**
|
|
2824
|
-
*
|
|
2824
|
+
* Returns elements from the current list that contain the given target(s).
|
|
2825
2825
|
* @param {string|TinyElement|TinyElement[]} target - Selector or DOM element(s).
|
|
2826
|
-
* @returns {
|
|
2826
|
+
* @returns {Element[]} Elements that contain the target.
|
|
2827
2827
|
*/
|
|
2828
|
-
has(target: string | TinyElement | TinyElement[]):
|
|
2828
|
+
has(target: string | TinyElement | TinyElement[]): Element[];
|
|
2829
2829
|
/**
|
|
2830
2830
|
* Finds the closest ancestor (including self) that matches the selector.
|
|
2831
2831
|
*
|
|
@@ -2952,38 +2952,38 @@ declare class TinyHtml<TinyHtmlT extends ConstructorElValues | ConstructorElValu
|
|
|
2952
2952
|
/**
|
|
2953
2953
|
* Appends child elements or strings to the end of the target element(s).
|
|
2954
2954
|
*
|
|
2955
|
-
* @param {...AppendCheckerValues} children - The child elements or text to append.
|
|
2955
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to append.
|
|
2956
2956
|
* @returns {this}
|
|
2957
2957
|
*/
|
|
2958
|
-
append(...children: AppendCheckerValues[]): this;
|
|
2958
|
+
append(...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): this;
|
|
2959
2959
|
/**
|
|
2960
2960
|
* Prepends child elements or strings to the beginning of the target element(s).
|
|
2961
2961
|
*
|
|
2962
|
-
* @param {...AppendCheckerValues} children - The child elements or text to prepend.
|
|
2962
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to prepend.
|
|
2963
2963
|
* @returns {this}
|
|
2964
2964
|
*/
|
|
2965
|
-
prepend(...children: AppendCheckerValues[]): this;
|
|
2965
|
+
prepend(...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): this;
|
|
2966
2966
|
/**
|
|
2967
2967
|
* Inserts elements or strings immediately before the target element(s) in the DOM.
|
|
2968
2968
|
*
|
|
2969
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert before the target.
|
|
2969
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert before the target.
|
|
2970
2970
|
* @returns {this}
|
|
2971
2971
|
*/
|
|
2972
|
-
before(...children: AppendCheckerValues[]): this;
|
|
2972
|
+
before(...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): this;
|
|
2973
2973
|
/**
|
|
2974
2974
|
* Inserts elements or strings immediately after the target element(s) in the DOM.
|
|
2975
2975
|
*
|
|
2976
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert after the target.
|
|
2976
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert after the target.
|
|
2977
2977
|
* @returns {this}
|
|
2978
2978
|
*/
|
|
2979
|
-
after(...children: AppendCheckerValues[]): this;
|
|
2979
|
+
after(...children: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): this;
|
|
2980
2980
|
/**
|
|
2981
2981
|
* Replaces the target element(s) in the DOM with new elements or text.
|
|
2982
2982
|
*
|
|
2983
|
-
* @param {...AppendCheckerValues} newNodes - New elements or text to replace the target.
|
|
2983
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} newNodes - New elements or text to replace the target.
|
|
2984
2984
|
* @returns {this}
|
|
2985
2985
|
*/
|
|
2986
|
-
replaceWith(...newNodes: AppendCheckerValues[]): this;
|
|
2986
|
+
replaceWith(...newNodes: (AppendCheckerValues | Record<string, AppendCheckerValues>)[]): this;
|
|
2987
2987
|
/**
|
|
2988
2988
|
* Appends the given element(s) to each target element in sequence.
|
|
2989
2989
|
*
|
|
@@ -1405,12 +1405,12 @@ class TinyHtml {
|
|
|
1405
1405
|
return TinyHtml._preElems(roots, 'has').filter((root) => targets.some((t) => root && root.contains(t)));
|
|
1406
1406
|
}
|
|
1407
1407
|
/**
|
|
1408
|
-
*
|
|
1408
|
+
* Returns elements from the current list that contain the given target(s).
|
|
1409
1409
|
* @param {string|TinyElement|TinyElement[]} target - Selector or DOM element(s).
|
|
1410
|
-
* @returns {
|
|
1410
|
+
* @returns {Element[]} Elements that contain the target.
|
|
1411
1411
|
*/
|
|
1412
1412
|
has(target) {
|
|
1413
|
-
return TinyHtml.has(this, target)
|
|
1413
|
+
return TinyHtml.has(this, target);
|
|
1414
1414
|
}
|
|
1415
1415
|
/**
|
|
1416
1416
|
* Finds the closest ancestor (including self) that matches the selector.
|
|
@@ -1878,7 +1878,7 @@ class TinyHtml {
|
|
|
1878
1878
|
/**
|
|
1879
1879
|
* Normalize and validate nodes before DOM insertion.
|
|
1880
1880
|
* Converts TinyNode-like structures or strings into DOM-compatible nodes.
|
|
1881
|
-
* @type {(where: string, ...nodes: AppendCheckerValues[]) => (Node | string)[]}
|
|
1881
|
+
* @type {(where: string, ...nodes: (AppendCheckerValues|Record<string, AppendCheckerValues>)[]) => (Node | string)[]}
|
|
1882
1882
|
* @readonly
|
|
1883
1883
|
*/
|
|
1884
1884
|
static _appendChecker(where, ...nodes) {
|
|
@@ -1887,11 +1887,17 @@ class TinyHtml {
|
|
|
1887
1887
|
for (const item of nodes) {
|
|
1888
1888
|
if (typeof item === 'undefined' || item === null || item === false)
|
|
1889
1889
|
continue;
|
|
1890
|
-
if (typeof item !== 'string') {
|
|
1891
|
-
if (
|
|
1890
|
+
if (typeof item !== 'string' && typeof item !== 'number') {
|
|
1891
|
+
if (item instanceof Node || item instanceof TinyHtml)
|
|
1892
1892
|
results.push(TinyHtml._preNodeElems(item, where)[0]);
|
|
1893
|
-
else
|
|
1893
|
+
else if (Array.isArray(item))
|
|
1894
1894
|
results.push(...TinyHtml._appendChecker(where, ...item));
|
|
1895
|
+
else {
|
|
1896
|
+
for (const name in item) {
|
|
1897
|
+
const elems = item[name];
|
|
1898
|
+
results.push(...TinyHtml._appendChecker(where, elems));
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1895
1901
|
}
|
|
1896
1902
|
else
|
|
1897
1903
|
results.push(item);
|
|
@@ -1903,7 +1909,7 @@ class TinyHtml {
|
|
|
1903
1909
|
*
|
|
1904
1910
|
* @template {TinyElement} T
|
|
1905
1911
|
* @param {T} el - The target element(s) to receive children.
|
|
1906
|
-
* @param {...AppendCheckerValues} children - The child elements or text to append.
|
|
1912
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to append.
|
|
1907
1913
|
* @returns {T}
|
|
1908
1914
|
*/
|
|
1909
1915
|
static append(el, ...children) {
|
|
@@ -1914,7 +1920,7 @@ class TinyHtml {
|
|
|
1914
1920
|
/**
|
|
1915
1921
|
* Appends child elements or strings to the end of the target element(s).
|
|
1916
1922
|
*
|
|
1917
|
-
* @param {...AppendCheckerValues} children - The child elements or text to append.
|
|
1923
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to append.
|
|
1918
1924
|
* @returns {this}
|
|
1919
1925
|
*/
|
|
1920
1926
|
append(...children) {
|
|
@@ -1925,7 +1931,7 @@ class TinyHtml {
|
|
|
1925
1931
|
*
|
|
1926
1932
|
* @template {TinyElement} T
|
|
1927
1933
|
* @param {T} el - The target element(s) to receive children.
|
|
1928
|
-
* @param {...AppendCheckerValues} children - The child elements or text to prepend.
|
|
1934
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to prepend.
|
|
1929
1935
|
* @returns {T}
|
|
1930
1936
|
*/
|
|
1931
1937
|
static prepend(el, ...children) {
|
|
@@ -1936,7 +1942,7 @@ class TinyHtml {
|
|
|
1936
1942
|
/**
|
|
1937
1943
|
* Prepends child elements or strings to the beginning of the target element(s).
|
|
1938
1944
|
*
|
|
1939
|
-
* @param {...AppendCheckerValues} children - The child elements or text to prepend.
|
|
1945
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - The child elements or text to prepend.
|
|
1940
1946
|
* @returns {this}
|
|
1941
1947
|
*/
|
|
1942
1948
|
prepend(...children) {
|
|
@@ -1947,7 +1953,7 @@ class TinyHtml {
|
|
|
1947
1953
|
*
|
|
1948
1954
|
* @template {TinyElement} T
|
|
1949
1955
|
* @param {T} el - The target element(s) before which new content is inserted.
|
|
1950
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert before the target.
|
|
1956
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert before the target.
|
|
1951
1957
|
* @returns {T}
|
|
1952
1958
|
*/
|
|
1953
1959
|
static before(el, ...children) {
|
|
@@ -1958,7 +1964,7 @@ class TinyHtml {
|
|
|
1958
1964
|
/**
|
|
1959
1965
|
* Inserts elements or strings immediately before the target element(s) in the DOM.
|
|
1960
1966
|
*
|
|
1961
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert before the target.
|
|
1967
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert before the target.
|
|
1962
1968
|
* @returns {this}
|
|
1963
1969
|
*/
|
|
1964
1970
|
before(...children) {
|
|
@@ -1969,7 +1975,7 @@ class TinyHtml {
|
|
|
1969
1975
|
*
|
|
1970
1976
|
* @template {TinyElement} T
|
|
1971
1977
|
* @param {T} el - The target element(s) after which new content is inserted.
|
|
1972
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert after the target.
|
|
1978
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert after the target.
|
|
1973
1979
|
* @returns {T}
|
|
1974
1980
|
*/
|
|
1975
1981
|
static after(el, ...children) {
|
|
@@ -1980,7 +1986,7 @@ class TinyHtml {
|
|
|
1980
1986
|
/**
|
|
1981
1987
|
* Inserts elements or strings immediately after the target element(s) in the DOM.
|
|
1982
1988
|
*
|
|
1983
|
-
* @param {...AppendCheckerValues} children - Elements or text to insert after the target.
|
|
1989
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} children - Elements or text to insert after the target.
|
|
1984
1990
|
* @returns {this}
|
|
1985
1991
|
*/
|
|
1986
1992
|
after(...children) {
|
|
@@ -1991,7 +1997,7 @@ class TinyHtml {
|
|
|
1991
1997
|
*
|
|
1992
1998
|
* @template {TinyElement} T
|
|
1993
1999
|
* @param {T} el - The element(s) to be replaced.
|
|
1994
|
-
* @param {...AppendCheckerValues} newNodes - New elements or text to replace the target.
|
|
2000
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} newNodes - New elements or text to replace the target.
|
|
1995
2001
|
* @returns {T}
|
|
1996
2002
|
*/
|
|
1997
2003
|
static replaceWith(el, ...newNodes) {
|
|
@@ -2002,7 +2008,7 @@ class TinyHtml {
|
|
|
2002
2008
|
/**
|
|
2003
2009
|
* Replaces the target element(s) in the DOM with new elements or text.
|
|
2004
2010
|
*
|
|
2005
|
-
* @param {...AppendCheckerValues} newNodes - New elements or text to replace the target.
|
|
2011
|
+
* @param {...(AppendCheckerValues|Record<string, AppendCheckerValues>)} newNodes - New elements or text to replace the target.
|
|
2006
2012
|
* @returns {this}
|
|
2007
2013
|
*/
|
|
2008
2014
|
replaceWith(...newNodes) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.10",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "npm run test:mjs && npm run test:cjs && npm run test:js",
|