domql 1.6.21 → 1.6.23
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/dist/cjs/element/create.js +47 -42
- package/dist/cjs/element/extend.js +2 -2
- package/dist/cjs/element/iterate.js +36 -32
- package/dist/cjs/element/methods.js +1 -1
- package/dist/cjs/element/node.js +4 -4
- package/dist/cjs/element/update.js +75 -41
- package/dist/esm/element/applyParam.js +2538 -2369
- package/dist/esm/element/create.js +2737 -2570
- package/dist/esm/element/define.js +2557 -2388
- package/dist/esm/element/extend.js +1535 -2313
- package/dist/esm/element/index.js +2448 -2277
- package/dist/esm/element/iterate.js +1524 -2298
- package/dist/esm/element/methods.js +2544 -2375
- package/dist/esm/element/node.js +2802 -2633
- package/dist/esm/element/parse.js +2772 -2605
- package/dist/esm/element/remove.js +289 -282
- package/dist/esm/element/set.js +2737 -2570
- package/dist/esm/element/update.js +2744 -2575
- package/dist/esm/index.js +2451 -2280
- package/dist/iife/index.js +2451 -2280
- package/package.json +2 -2
- package/src/element/create.js +2 -2
- package/src/element/iterate.js +2 -1
|
@@ -10,10 +10,6 @@ var __esm = (fn, res) => function __init() {
|
|
|
10
10
|
var __commonJS = (cb, mod) => function __require() {
|
|
11
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
12
|
};
|
|
13
|
-
var __export = (target, all) => {
|
|
14
|
-
for (var name in all)
|
|
15
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
-
};
|
|
17
13
|
var __copyProps = (to, from, except, desc) => {
|
|
18
14
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
15
|
for (let key of __getOwnPropNames(from))
|
|
@@ -29,18 +25,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
26
|
|
|
31
27
|
// ../refactor/domql/packages/key/dist/cjs/index.js
|
|
32
|
-
var
|
|
33
|
-
|
|
28
|
+
var cjs_exports = {};
|
|
29
|
+
var __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __export, __copyProps2, __toCommonJS2, key_exports, createKey, createSnapshotId;
|
|
30
|
+
var init_cjs = __esm({
|
|
31
|
+
"../refactor/domql/packages/key/dist/cjs/index.js"() {
|
|
34
32
|
"use strict";
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
__defProp2 = Object.defineProperty;
|
|
34
|
+
__getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
35
|
+
__getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
36
|
+
__hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
37
|
+
__export = (target, all) => {
|
|
40
38
|
for (var name in all)
|
|
41
39
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
42
40
|
};
|
|
43
|
-
|
|
41
|
+
__copyProps2 = (to, from, except, desc) => {
|
|
44
42
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
45
43
|
for (let key of __getOwnPropNames2(from))
|
|
46
44
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
@@ -48,14 +46,14 @@ var require_cjs = __commonJS({
|
|
|
48
46
|
}
|
|
49
47
|
return to;
|
|
50
48
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
createKey: () =>
|
|
55
|
-
createSnapshotId: () =>
|
|
49
|
+
__toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
50
|
+
key_exports = {};
|
|
51
|
+
__export(key_exports, {
|
|
52
|
+
createKey: () => createKey,
|
|
53
|
+
createSnapshotId: () => createSnapshotId
|
|
56
54
|
});
|
|
57
55
|
module.exports = __toCommonJS2(key_exports);
|
|
58
|
-
|
|
56
|
+
createKey = function() {
|
|
59
57
|
let index = 0;
|
|
60
58
|
function newId() {
|
|
61
59
|
index++;
|
|
@@ -63,37 +61,39 @@ var require_cjs = __commonJS({
|
|
|
63
61
|
}
|
|
64
62
|
return newId;
|
|
65
63
|
}();
|
|
66
|
-
|
|
64
|
+
createSnapshotId = createKey;
|
|
67
65
|
}
|
|
68
66
|
});
|
|
69
67
|
|
|
70
68
|
// ../refactor/domql/packages/tags/dist/cjs/htmlTags.js
|
|
71
|
-
var
|
|
72
|
-
|
|
69
|
+
var htmlTags_exports = {};
|
|
70
|
+
var __defProp3, __getOwnPropDesc3, __getOwnPropNames3, __hasOwnProp3, __export2, __copyProps3, __toCommonJS3, htmlTags_exports2, HTML_TAGS;
|
|
71
|
+
var init_htmlTags = __esm({
|
|
72
|
+
"../refactor/domql/packages/tags/dist/cjs/htmlTags.js"() {
|
|
73
73
|
"use strict";
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
__defProp3 = Object.defineProperty;
|
|
75
|
+
__getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
76
|
+
__getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
77
|
+
__hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
78
|
+
__export2 = (target, all) => {
|
|
79
79
|
for (var name in all)
|
|
80
|
-
|
|
80
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
__copyProps3 = (to, from, except, desc) => {
|
|
83
83
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
84
|
-
for (let key of
|
|
85
|
-
if (!
|
|
86
|
-
|
|
84
|
+
for (let key of __getOwnPropNames3(from))
|
|
85
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
86
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
87
87
|
}
|
|
88
88
|
return to;
|
|
89
89
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
__export2(
|
|
90
|
+
__toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
91
|
+
htmlTags_exports2 = {};
|
|
92
|
+
__export2(htmlTags_exports2, {
|
|
93
93
|
HTML_TAGS: () => HTML_TAGS
|
|
94
94
|
});
|
|
95
|
-
module.exports =
|
|
96
|
-
|
|
95
|
+
module.exports = __toCommonJS3(htmlTags_exports2);
|
|
96
|
+
HTML_TAGS = {
|
|
97
97
|
root: [
|
|
98
98
|
"body",
|
|
99
99
|
"html"
|
|
@@ -230,185 +230,189 @@ var require_htmlTags = __commonJS({
|
|
|
230
230
|
});
|
|
231
231
|
|
|
232
232
|
// ../refactor/domql/packages/tags/dist/cjs/index.js
|
|
233
|
-
var
|
|
234
|
-
|
|
233
|
+
var cjs_exports2 = {};
|
|
234
|
+
var __defProp4, __getOwnPropDesc4, __getOwnPropNames4, __hasOwnProp4, __copyProps4, __reExport, __toCommonJS4, tags_exports;
|
|
235
|
+
var init_cjs2 = __esm({
|
|
236
|
+
"../refactor/domql/packages/tags/dist/cjs/index.js"() {
|
|
235
237
|
"use strict";
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
__defProp4 = Object.defineProperty;
|
|
239
|
+
__getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
240
|
+
__getOwnPropNames4 = Object.getOwnPropertyNames;
|
|
241
|
+
__hasOwnProp4 = Object.prototype.hasOwnProperty;
|
|
242
|
+
__copyProps4 = (to, from, except, desc) => {
|
|
241
243
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
242
|
-
for (let key of
|
|
243
|
-
if (!
|
|
244
|
-
|
|
244
|
+
for (let key of __getOwnPropNames4(from))
|
|
245
|
+
if (!__hasOwnProp4.call(to, key) && key !== except)
|
|
246
|
+
__defProp4(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc4(from, key)) || desc.enumerable });
|
|
245
247
|
}
|
|
246
248
|
return to;
|
|
247
249
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
module.exports =
|
|
252
|
-
__reExport(tags_exports,
|
|
250
|
+
__reExport = (target, mod, secondTarget) => (__copyProps4(target, mod, "default"), secondTarget && __copyProps4(secondTarget, mod, "default"));
|
|
251
|
+
__toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
|
|
252
|
+
tags_exports = {};
|
|
253
|
+
module.exports = __toCommonJS4(tags_exports);
|
|
254
|
+
__reExport(tags_exports, (init_htmlTags(), __toCommonJS(htmlTags_exports)), module.exports);
|
|
253
255
|
}
|
|
254
256
|
});
|
|
255
257
|
|
|
256
258
|
// ../refactor/domql/packages/globals/dist/cjs/index.js
|
|
257
|
-
var
|
|
258
|
-
|
|
259
|
+
var cjs_exports3 = {};
|
|
260
|
+
var __defProp5, __getOwnPropDesc5, __getOwnPropNames5, __hasOwnProp5, __export3, __copyProps5, __toCommonJS5, globals_exports, global, self, window, document;
|
|
261
|
+
var init_cjs3 = __esm({
|
|
262
|
+
"../refactor/domql/packages/globals/dist/cjs/index.js"() {
|
|
259
263
|
"use strict";
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
__defProp5 = Object.defineProperty;
|
|
265
|
+
__getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
|
|
266
|
+
__getOwnPropNames5 = Object.getOwnPropertyNames;
|
|
267
|
+
__hasOwnProp5 = Object.prototype.hasOwnProperty;
|
|
268
|
+
__export3 = (target, all) => {
|
|
265
269
|
for (var name in all)
|
|
266
|
-
|
|
270
|
+
__defProp5(target, name, { get: all[name], enumerable: true });
|
|
267
271
|
};
|
|
268
|
-
|
|
272
|
+
__copyProps5 = (to, from, except, desc) => {
|
|
269
273
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
270
|
-
for (let key of
|
|
271
|
-
if (!
|
|
272
|
-
|
|
274
|
+
for (let key of __getOwnPropNames5(from))
|
|
275
|
+
if (!__hasOwnProp5.call(to, key) && key !== except)
|
|
276
|
+
__defProp5(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc5(from, key)) || desc.enumerable });
|
|
273
277
|
}
|
|
274
278
|
return to;
|
|
275
279
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
document: () =>
|
|
280
|
+
__toCommonJS5 = (mod) => __copyProps5(__defProp5({}, "__esModule", { value: true }), mod);
|
|
281
|
+
globals_exports = {};
|
|
282
|
+
__export3(globals_exports, {
|
|
283
|
+
document: () => document,
|
|
280
284
|
global: () => global,
|
|
281
285
|
self: () => self,
|
|
282
|
-
window: () =>
|
|
286
|
+
window: () => window
|
|
283
287
|
});
|
|
284
|
-
module.exports =
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
module.exports = __toCommonJS5(globals_exports);
|
|
289
|
+
global = globalThis;
|
|
290
|
+
self = globalThis;
|
|
291
|
+
window = globalThis;
|
|
292
|
+
document = window.document;
|
|
289
293
|
}
|
|
290
294
|
});
|
|
291
295
|
|
|
292
296
|
// ../refactor/domql/packages/utils/dist/cjs/node.js
|
|
293
297
|
var require_node = __commonJS({
|
|
294
|
-
"../refactor/domql/packages/utils/dist/cjs/node.js"(exports,
|
|
298
|
+
"../refactor/domql/packages/utils/dist/cjs/node.js"(exports, module2) {
|
|
295
299
|
"use strict";
|
|
296
|
-
var
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
var
|
|
300
|
+
var __defProp14 = Object.defineProperty;
|
|
301
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
302
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
303
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
304
|
+
var __export11 = (target, all) => {
|
|
301
305
|
for (var name in all)
|
|
302
|
-
|
|
306
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
303
307
|
};
|
|
304
|
-
var
|
|
308
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
305
309
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
306
|
-
for (let key of
|
|
307
|
-
if (!
|
|
308
|
-
|
|
310
|
+
for (let key of __getOwnPropNames14(from))
|
|
311
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
312
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
309
313
|
}
|
|
310
314
|
return to;
|
|
311
315
|
};
|
|
312
|
-
var
|
|
316
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
313
317
|
var node_exports = {};
|
|
314
|
-
|
|
318
|
+
__export11(node_exports, {
|
|
315
319
|
isHtmlElement: () => isHtmlElement,
|
|
316
|
-
isNode: () =>
|
|
320
|
+
isNode: () => isNode
|
|
317
321
|
});
|
|
318
|
-
|
|
319
|
-
var
|
|
320
|
-
var
|
|
321
|
-
return (typeof Node === "object" ? obj instanceof
|
|
322
|
+
module2.exports = __toCommonJS14(node_exports);
|
|
323
|
+
var import_globals = (init_cjs3(), __toCommonJS(cjs_exports3));
|
|
324
|
+
var isNode = (obj) => {
|
|
325
|
+
return (typeof Node === "object" ? obj instanceof import_globals.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
322
326
|
};
|
|
323
327
|
var isHtmlElement = (obj) => {
|
|
324
|
-
return (typeof HTMLElement === "object" ? obj instanceof
|
|
328
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
325
329
|
};
|
|
326
330
|
}
|
|
327
331
|
});
|
|
328
332
|
|
|
329
333
|
// ../refactor/domql/packages/utils/dist/cjs/types.js
|
|
330
334
|
var require_types = __commonJS({
|
|
331
|
-
"../refactor/domql/packages/utils/dist/cjs/types.js"(exports,
|
|
335
|
+
"../refactor/domql/packages/utils/dist/cjs/types.js"(exports, module2) {
|
|
332
336
|
"use strict";
|
|
333
|
-
var
|
|
334
|
-
var
|
|
335
|
-
var
|
|
336
|
-
var
|
|
337
|
-
var
|
|
337
|
+
var __defProp14 = Object.defineProperty;
|
|
338
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
339
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
340
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
341
|
+
var __export11 = (target, all) => {
|
|
338
342
|
for (var name in all)
|
|
339
|
-
|
|
343
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
340
344
|
};
|
|
341
|
-
var
|
|
345
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
342
346
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
343
|
-
for (let key of
|
|
344
|
-
if (!
|
|
345
|
-
|
|
347
|
+
for (let key of __getOwnPropNames14(from))
|
|
348
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
349
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
346
350
|
}
|
|
347
351
|
return to;
|
|
348
352
|
};
|
|
349
|
-
var
|
|
353
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
350
354
|
var types_exports = {};
|
|
351
|
-
|
|
355
|
+
__export11(types_exports, {
|
|
352
356
|
TYPES: () => TYPES,
|
|
353
|
-
is: () =>
|
|
354
|
-
isArray: () =>
|
|
357
|
+
is: () => is,
|
|
358
|
+
isArray: () => isArray3,
|
|
355
359
|
isBoolean: () => isBoolean,
|
|
356
|
-
isDefined: () =>
|
|
357
|
-
isFunction: () =>
|
|
358
|
-
isNot: () =>
|
|
360
|
+
isDefined: () => isDefined,
|
|
361
|
+
isFunction: () => isFunction4,
|
|
362
|
+
isNot: () => isNot,
|
|
359
363
|
isNull: () => isNull,
|
|
360
|
-
isNumber: () =>
|
|
361
|
-
isObject: () =>
|
|
362
|
-
isObjectLike: () =>
|
|
363
|
-
isString: () =>
|
|
364
|
-
isUndefined: () =>
|
|
364
|
+
isNumber: () => isNumber2,
|
|
365
|
+
isObject: () => isObject4,
|
|
366
|
+
isObjectLike: () => isObjectLike2,
|
|
367
|
+
isString: () => isString4,
|
|
368
|
+
isUndefined: () => isUndefined,
|
|
365
369
|
isValidHtmlTag: () => isValidHtmlTag
|
|
366
370
|
});
|
|
367
|
-
|
|
368
|
-
var import_tags =
|
|
369
|
-
var
|
|
371
|
+
module2.exports = __toCommonJS14(types_exports);
|
|
372
|
+
var import_tags = (init_cjs2(), __toCommonJS(cjs_exports2));
|
|
373
|
+
var import_node = require_node();
|
|
370
374
|
var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.includes(arg);
|
|
371
|
-
var
|
|
375
|
+
var isObject4 = (arg) => {
|
|
372
376
|
if (arg === null)
|
|
373
377
|
return false;
|
|
374
378
|
return typeof arg === "object" && arg.constructor === Object;
|
|
375
379
|
};
|
|
376
|
-
var
|
|
377
|
-
var
|
|
378
|
-
var
|
|
380
|
+
var isString4 = (arg) => typeof arg === "string";
|
|
381
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
382
|
+
var isFunction4 = (arg) => typeof arg === "function";
|
|
379
383
|
var isBoolean = (arg) => arg === true || arg === false;
|
|
380
384
|
var isNull = (arg) => arg === null;
|
|
381
|
-
var
|
|
382
|
-
var
|
|
385
|
+
var isArray3 = (arg) => Array.isArray(arg);
|
|
386
|
+
var isObjectLike2 = (arg) => {
|
|
383
387
|
if (arg === null)
|
|
384
388
|
return false;
|
|
385
389
|
return typeof arg === "object";
|
|
386
390
|
};
|
|
387
|
-
var
|
|
388
|
-
return
|
|
391
|
+
var isDefined = (arg) => {
|
|
392
|
+
return isObject4(arg) || isObjectLike2(arg) || isString4(arg) || isNumber2(arg) || isFunction4(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isNull(arg);
|
|
389
393
|
};
|
|
390
|
-
var
|
|
394
|
+
var isUndefined = (arg) => {
|
|
391
395
|
return arg === void 0;
|
|
392
396
|
};
|
|
393
397
|
var TYPES = {
|
|
394
398
|
boolean: isBoolean,
|
|
395
|
-
array:
|
|
396
|
-
object:
|
|
397
|
-
string:
|
|
398
|
-
number:
|
|
399
|
+
array: isArray3,
|
|
400
|
+
object: isObject4,
|
|
401
|
+
string: isString4,
|
|
402
|
+
number: isNumber2,
|
|
399
403
|
null: isNull,
|
|
400
|
-
function:
|
|
401
|
-
objectLike:
|
|
402
|
-
node:
|
|
403
|
-
htmlElement:
|
|
404
|
-
defined:
|
|
404
|
+
function: isFunction4,
|
|
405
|
+
objectLike: isObjectLike2,
|
|
406
|
+
node: import_node.isNode,
|
|
407
|
+
htmlElement: import_node.isHtmlElement,
|
|
408
|
+
defined: isDefined
|
|
405
409
|
};
|
|
406
|
-
var
|
|
410
|
+
var is = (arg) => {
|
|
407
411
|
return (...args) => {
|
|
408
412
|
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
409
413
|
};
|
|
410
414
|
};
|
|
411
|
-
var
|
|
415
|
+
var isNot = (arg) => {
|
|
412
416
|
return (...args) => {
|
|
413
417
|
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
414
418
|
};
|
|
@@ -416,89 +420,158 @@ var require_types = __commonJS({
|
|
|
416
420
|
}
|
|
417
421
|
});
|
|
418
422
|
|
|
423
|
+
// ../refactor/domql/packages/utils/dist/cjs/array.js
|
|
424
|
+
var require_array = __commonJS({
|
|
425
|
+
"../refactor/domql/packages/utils/dist/cjs/array.js"(exports, module2) {
|
|
426
|
+
"use strict";
|
|
427
|
+
var __defProp14 = Object.defineProperty;
|
|
428
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
429
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
430
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
431
|
+
var __export11 = (target, all) => {
|
|
432
|
+
for (var name in all)
|
|
433
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
434
|
+
};
|
|
435
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
436
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
437
|
+
for (let key of __getOwnPropNames14(from))
|
|
438
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
439
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
440
|
+
}
|
|
441
|
+
return to;
|
|
442
|
+
};
|
|
443
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
444
|
+
var array_exports = {};
|
|
445
|
+
__export11(array_exports, {
|
|
446
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
447
|
+
joinArrays: () => joinArrays2,
|
|
448
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
449
|
+
mergeArray: () => mergeArray,
|
|
450
|
+
removeFromArray: () => removeFromArray,
|
|
451
|
+
swapItemsInArray: () => swapItemsInArray
|
|
452
|
+
});
|
|
453
|
+
module2.exports = __toCommonJS14(array_exports);
|
|
454
|
+
var import_object = require_object();
|
|
455
|
+
var import_types = require_types();
|
|
456
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
457
|
+
return arr2.every((val) => arr1.includes(val));
|
|
458
|
+
};
|
|
459
|
+
var removeFromArray = (arr, index) => {
|
|
460
|
+
if ((0, import_types.isString)(index))
|
|
461
|
+
index = parseInt(index);
|
|
462
|
+
if ((0, import_types.isNumber)(index)) {
|
|
463
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
464
|
+
throw new Error("Invalid index");
|
|
465
|
+
}
|
|
466
|
+
arr.splice(index, 1);
|
|
467
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
468
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
469
|
+
} else {
|
|
470
|
+
throw new Error("Invalid index");
|
|
471
|
+
}
|
|
472
|
+
return arr;
|
|
473
|
+
};
|
|
474
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
475
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
476
|
+
};
|
|
477
|
+
var joinArrays2 = (...arrays) => {
|
|
478
|
+
return [].concat(...arrays);
|
|
479
|
+
};
|
|
480
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
481
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
482
|
+
};
|
|
483
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
484
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
|
|
419
489
|
// ../refactor/domql/packages/utils/dist/cjs/object.js
|
|
420
490
|
var require_object = __commonJS({
|
|
421
|
-
"../refactor/domql/packages/utils/dist/cjs/object.js"(exports,
|
|
491
|
+
"../refactor/domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
422
492
|
"use strict";
|
|
423
|
-
var
|
|
424
|
-
var
|
|
425
|
-
var
|
|
426
|
-
var
|
|
427
|
-
var
|
|
493
|
+
var __defProp14 = Object.defineProperty;
|
|
494
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
495
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
496
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
497
|
+
var __export11 = (target, all) => {
|
|
428
498
|
for (var name in all)
|
|
429
|
-
|
|
499
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
430
500
|
};
|
|
431
|
-
var
|
|
501
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
432
502
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
433
|
-
for (let key of
|
|
434
|
-
if (!
|
|
435
|
-
|
|
503
|
+
for (let key of __getOwnPropNames14(from))
|
|
504
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
505
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
436
506
|
}
|
|
437
507
|
return to;
|
|
438
508
|
};
|
|
439
|
-
var
|
|
509
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
440
510
|
var object_exports = {};
|
|
441
|
-
|
|
511
|
+
__export11(object_exports, {
|
|
442
512
|
clone: () => clone,
|
|
443
|
-
deepClone: () =>
|
|
513
|
+
deepClone: () => deepClone,
|
|
444
514
|
deepCloneExclude: () => deepCloneExclude,
|
|
445
515
|
deepDestringify: () => deepDestringify,
|
|
446
|
-
deepMerge: () =>
|
|
516
|
+
deepMerge: () => deepMerge,
|
|
447
517
|
deepStringify: () => deepStringify,
|
|
448
518
|
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
449
519
|
diff: () => diff,
|
|
450
520
|
diffArrays: () => diffArrays,
|
|
451
521
|
diffObjects: () => diffObjects,
|
|
452
|
-
exec: () =>
|
|
522
|
+
exec: () => exec3,
|
|
453
523
|
flattenRecursive: () => flattenRecursive,
|
|
454
|
-
isEqualDeep: () =>
|
|
455
|
-
map: () =>
|
|
456
|
-
merge: () =>
|
|
524
|
+
isEqualDeep: () => isEqualDeep,
|
|
525
|
+
map: () => map,
|
|
526
|
+
merge: () => merge,
|
|
527
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
457
528
|
mergeIfExisted: () => mergeIfExisted,
|
|
458
529
|
overwrite: () => overwrite2,
|
|
459
|
-
overwriteDeep: () =>
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
removeFromObject: () => removeFromObject3
|
|
530
|
+
overwriteDeep: () => overwriteDeep,
|
|
531
|
+
overwriteShallow: () => overwriteShallow,
|
|
532
|
+
removeFromObject: () => removeFromObject
|
|
463
533
|
});
|
|
464
|
-
|
|
465
|
-
var
|
|
534
|
+
module2.exports = __toCommonJS14(object_exports);
|
|
535
|
+
var import_globals = (init_cjs3(), __toCommonJS(cjs_exports3));
|
|
466
536
|
var import_types = require_types();
|
|
467
|
-
var
|
|
537
|
+
var import_array = require_array();
|
|
538
|
+
var exec3 = (param, element, state, context) => {
|
|
468
539
|
if ((0, import_types.isFunction)(param)) {
|
|
469
540
|
return param(
|
|
470
541
|
element,
|
|
471
|
-
|
|
542
|
+
state || element.state,
|
|
472
543
|
context || element.context
|
|
473
544
|
);
|
|
474
545
|
}
|
|
475
546
|
return param;
|
|
476
547
|
};
|
|
477
|
-
var
|
|
478
|
-
for (const
|
|
479
|
-
obj[
|
|
548
|
+
var map = (obj, extention, element) => {
|
|
549
|
+
for (const e in extention) {
|
|
550
|
+
obj[e] = exec3(extention[e], element);
|
|
480
551
|
}
|
|
481
552
|
};
|
|
482
|
-
var
|
|
483
|
-
for (const
|
|
484
|
-
|
|
485
|
-
|
|
553
|
+
var merge = (element, obj, excludeFrom = []) => {
|
|
554
|
+
for (const e in obj) {
|
|
555
|
+
if (excludeFrom.includes(e) || e.includes("__"))
|
|
556
|
+
continue;
|
|
557
|
+
const elementProp = element[e];
|
|
558
|
+
const objProp = obj[e];
|
|
486
559
|
if (elementProp === void 0) {
|
|
487
|
-
element[
|
|
560
|
+
element[e] = objProp;
|
|
488
561
|
}
|
|
489
562
|
}
|
|
490
563
|
return element;
|
|
491
564
|
};
|
|
492
|
-
var
|
|
493
|
-
for (const
|
|
494
|
-
if (excludeFrom.includes(
|
|
565
|
+
var deepMerge = (element, extend, excludeFrom = []) => {
|
|
566
|
+
for (const e in extend) {
|
|
567
|
+
if (excludeFrom.includes(e) || e.includes("__"))
|
|
495
568
|
continue;
|
|
496
|
-
const elementProp = element[
|
|
497
|
-
const extendProp = extend[
|
|
569
|
+
const elementProp = element[e];
|
|
570
|
+
const extendProp = extend[e];
|
|
498
571
|
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
499
|
-
|
|
572
|
+
deepMerge(elementProp, extendProp);
|
|
500
573
|
} else if (elementProp === void 0) {
|
|
501
|
-
element[
|
|
574
|
+
element[e] = extendProp;
|
|
502
575
|
}
|
|
503
576
|
}
|
|
504
577
|
return element;
|
|
@@ -506,7 +579,7 @@ var require_object = __commonJS({
|
|
|
506
579
|
var clone = (obj, excludeFrom = []) => {
|
|
507
580
|
const o = {};
|
|
508
581
|
for (const prop in obj) {
|
|
509
|
-
if (excludeFrom.includes(
|
|
582
|
+
if (excludeFrom.includes(prop) || prop.includes("__"))
|
|
510
583
|
continue;
|
|
511
584
|
o[prop] = obj[prop];
|
|
512
585
|
}
|
|
@@ -533,17 +606,20 @@ var require_object = __commonJS({
|
|
|
533
606
|
}
|
|
534
607
|
return o;
|
|
535
608
|
};
|
|
536
|
-
var
|
|
609
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
610
|
+
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {});
|
|
611
|
+
};
|
|
612
|
+
var deepClone = (obj, excludeFrom = []) => {
|
|
537
613
|
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
538
614
|
for (const prop in obj) {
|
|
539
615
|
if (excludeFrom.includes(prop) || prop.includes("__"))
|
|
540
616
|
continue;
|
|
541
617
|
let objProp = obj[prop];
|
|
542
618
|
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
543
|
-
objProp = mergeArray(objProp);
|
|
619
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
544
620
|
}
|
|
545
621
|
if ((0, import_types.isObjectLike)(objProp)) {
|
|
546
|
-
o[prop] =
|
|
622
|
+
o[prop] = deepClone(objProp, excludeFrom);
|
|
547
623
|
} else
|
|
548
624
|
o[prop] = objProp;
|
|
549
625
|
}
|
|
@@ -607,10 +683,10 @@ var require_object = __commonJS({
|
|
|
607
683
|
if ((0, import_types.isString)(objProp)) {
|
|
608
684
|
if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
|
|
609
685
|
try {
|
|
610
|
-
const evalProp =
|
|
686
|
+
const evalProp = import_globals.window.eval(`(${objProp})`);
|
|
611
687
|
stringified[prop] = evalProp;
|
|
612
|
-
} catch (
|
|
613
|
-
if (
|
|
688
|
+
} catch (e) {
|
|
689
|
+
if (e)
|
|
614
690
|
stringified[prop] = objProp;
|
|
615
691
|
}
|
|
616
692
|
} else {
|
|
@@ -622,10 +698,10 @@ var require_object = __commonJS({
|
|
|
622
698
|
if ((0, import_types.isString)(arrProp)) {
|
|
623
699
|
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
624
700
|
try {
|
|
625
|
-
const evalProp =
|
|
701
|
+
const evalProp = import_globals.window.eval(`(${arrProp})`);
|
|
626
702
|
stringified[prop].push(evalProp);
|
|
627
|
-
} catch (
|
|
628
|
-
if (
|
|
703
|
+
} catch (e) {
|
|
704
|
+
if (e)
|
|
629
705
|
stringified[prop].push(arrProp);
|
|
630
706
|
}
|
|
631
707
|
} else {
|
|
@@ -645,32 +721,17 @@ var require_object = __commonJS({
|
|
|
645
721
|
}
|
|
646
722
|
return stringified;
|
|
647
723
|
};
|
|
648
|
-
var overwrite2 = (element, params, excludeFrom = []) => {
|
|
649
|
-
const { ref } = element;
|
|
650
|
-
const changes = {};
|
|
651
|
-
for (const e2 in params) {
|
|
652
|
-
if (excludeFrom.includes(e2) || e2.includes("__"))
|
|
653
|
-
continue;
|
|
654
|
-
const elementProp = element[e2];
|
|
655
|
-
const paramsProp = params[e2];
|
|
656
|
-
if (paramsProp) {
|
|
657
|
-
ref.__cache[e2] = changes[e2] = elementProp;
|
|
658
|
-
ref[e2] = paramsProp;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
return changes;
|
|
662
|
-
};
|
|
663
724
|
var diffObjects = (original, objToDiff, cache) => {
|
|
664
|
-
for (const
|
|
665
|
-
if (
|
|
725
|
+
for (const e in objToDiff) {
|
|
726
|
+
if (e === "ref")
|
|
666
727
|
continue;
|
|
667
|
-
const originalProp = original[
|
|
668
|
-
const objToDiffProp = objToDiff[
|
|
728
|
+
const originalProp = original[e];
|
|
729
|
+
const objToDiffProp = objToDiff[e];
|
|
669
730
|
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
670
|
-
cache[
|
|
671
|
-
diff(originalProp, objToDiffProp, cache[
|
|
731
|
+
cache[e] = {};
|
|
732
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
672
733
|
} else if (objToDiffProp !== void 0) {
|
|
673
|
-
cache[
|
|
734
|
+
cache[e] = objToDiffProp;
|
|
674
735
|
}
|
|
675
736
|
}
|
|
676
737
|
return cache;
|
|
@@ -701,46 +762,50 @@ var require_object = __commonJS({
|
|
|
701
762
|
}
|
|
702
763
|
return cache;
|
|
703
764
|
};
|
|
704
|
-
var
|
|
765
|
+
var overwrite2 = (element, params, excludeFrom = []) => {
|
|
766
|
+
const { ref } = element;
|
|
705
767
|
const changes = {};
|
|
706
|
-
for (const
|
|
707
|
-
|
|
708
|
-
|
|
768
|
+
for (const e in params) {
|
|
769
|
+
if (excludeFrom.includes(e) || e.includes("__"))
|
|
770
|
+
continue;
|
|
771
|
+
const elementProp = element[e];
|
|
772
|
+
const paramsProp = params[e];
|
|
709
773
|
if (paramsProp) {
|
|
710
|
-
|
|
774
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
775
|
+
ref[e] = paramsProp;
|
|
711
776
|
}
|
|
712
777
|
}
|
|
713
778
|
return changes;
|
|
714
779
|
};
|
|
715
|
-
var
|
|
716
|
-
for (const
|
|
717
|
-
if (excludeFrom.includes(
|
|
780
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
781
|
+
for (const e in params) {
|
|
782
|
+
if (excludeFrom.includes(e) || e.includes("__"))
|
|
718
783
|
continue;
|
|
719
|
-
obj[
|
|
784
|
+
obj[e] = params[e];
|
|
720
785
|
}
|
|
721
786
|
return obj;
|
|
722
787
|
};
|
|
723
|
-
var
|
|
724
|
-
for (const
|
|
725
|
-
if (excludeFrom.includes(
|
|
788
|
+
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
789
|
+
for (const e in params) {
|
|
790
|
+
if (excludeFrom.includes(e) || e.includes("__"))
|
|
726
791
|
continue;
|
|
727
|
-
const objProp = obj[
|
|
728
|
-
const paramsProp = params[
|
|
792
|
+
const objProp = obj[e];
|
|
793
|
+
const paramsProp = params[e];
|
|
729
794
|
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
730
|
-
|
|
795
|
+
overwriteDeep(objProp, paramsProp);
|
|
731
796
|
} else if (paramsProp !== void 0) {
|
|
732
|
-
obj[
|
|
797
|
+
obj[e] = paramsProp;
|
|
733
798
|
}
|
|
734
799
|
}
|
|
735
800
|
return obj;
|
|
736
801
|
};
|
|
737
802
|
var mergeIfExisted = (a, b) => {
|
|
738
803
|
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
739
|
-
return
|
|
804
|
+
return deepMerge(a, b);
|
|
740
805
|
return a || b;
|
|
741
806
|
};
|
|
742
807
|
var flattenRecursive = (param, prop, stack = []) => {
|
|
743
|
-
const objectized = mergeAndCloneIfArray(param);
|
|
808
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
744
809
|
stack.push(objectized);
|
|
745
810
|
const extendOfExtend = objectized[prop];
|
|
746
811
|
if (extendOfExtend)
|
|
@@ -748,7 +813,7 @@ var require_object = __commonJS({
|
|
|
748
813
|
delete objectized[prop];
|
|
749
814
|
return stack;
|
|
750
815
|
};
|
|
751
|
-
var
|
|
816
|
+
var isEqualDeep = (param, element) => {
|
|
752
817
|
if (param === element)
|
|
753
818
|
return true;
|
|
754
819
|
if (!param || !element)
|
|
@@ -757,7 +822,7 @@ var require_object = __commonJS({
|
|
|
757
822
|
const paramProp = param[prop];
|
|
758
823
|
const elementProp = element[prop];
|
|
759
824
|
if ((0, import_types.isObjectLike)(paramProp)) {
|
|
760
|
-
const isEqual =
|
|
825
|
+
const isEqual = isEqualDeep(paramProp, elementProp);
|
|
761
826
|
if (!isEqual)
|
|
762
827
|
return false;
|
|
763
828
|
} else {
|
|
@@ -768,7 +833,7 @@ var require_object = __commonJS({
|
|
|
768
833
|
}
|
|
769
834
|
return true;
|
|
770
835
|
};
|
|
771
|
-
var
|
|
836
|
+
var removeFromObject = (obj, props) => {
|
|
772
837
|
if (props === void 0 || props === null)
|
|
773
838
|
return obj;
|
|
774
839
|
if ((0, import_types.is)(props)("string", "number")) {
|
|
@@ -785,31 +850,31 @@ var require_object = __commonJS({
|
|
|
785
850
|
|
|
786
851
|
// ../refactor/domql/packages/utils/dist/cjs/function.js
|
|
787
852
|
var require_function = __commonJS({
|
|
788
|
-
"../refactor/domql/packages/utils/dist/cjs/function.js"(exports,
|
|
853
|
+
"../refactor/domql/packages/utils/dist/cjs/function.js"(exports, module2) {
|
|
789
854
|
"use strict";
|
|
790
|
-
var
|
|
791
|
-
var
|
|
792
|
-
var
|
|
793
|
-
var
|
|
794
|
-
var
|
|
855
|
+
var __defProp14 = Object.defineProperty;
|
|
856
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
857
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
858
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
859
|
+
var __export11 = (target, all) => {
|
|
795
860
|
for (var name in all)
|
|
796
|
-
|
|
861
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
797
862
|
};
|
|
798
|
-
var
|
|
863
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
799
864
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
800
|
-
for (let key of
|
|
801
|
-
if (!
|
|
802
|
-
|
|
865
|
+
for (let key of __getOwnPropNames14(from))
|
|
866
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
867
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
803
868
|
}
|
|
804
869
|
return to;
|
|
805
870
|
};
|
|
806
|
-
var
|
|
871
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
807
872
|
var function_exports = {};
|
|
808
|
-
|
|
873
|
+
__export11(function_exports, {
|
|
809
874
|
debounce: () => debounce,
|
|
810
875
|
memoize: () => memoize
|
|
811
876
|
});
|
|
812
|
-
|
|
877
|
+
module2.exports = __toCommonJS14(function_exports);
|
|
813
878
|
var debounce = (element, func, timeout = 300) => {
|
|
814
879
|
let timer;
|
|
815
880
|
return (...args) => {
|
|
@@ -835,99 +900,33 @@ var require_function = __commonJS({
|
|
|
835
900
|
}
|
|
836
901
|
});
|
|
837
902
|
|
|
838
|
-
// ../refactor/domql/packages/utils/dist/cjs/array.js
|
|
839
|
-
var require_array = __commonJS({
|
|
840
|
-
"../refactor/domql/packages/utils/dist/cjs/array.js"(exports, module) {
|
|
841
|
-
"use strict";
|
|
842
|
-
var __defProp2 = Object.defineProperty;
|
|
843
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
844
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
845
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
846
|
-
var __export2 = (target, all) => {
|
|
847
|
-
for (var name in all)
|
|
848
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
849
|
-
};
|
|
850
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
851
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
852
|
-
for (let key of __getOwnPropNames2(from))
|
|
853
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
854
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
855
|
-
}
|
|
856
|
-
return to;
|
|
857
|
-
};
|
|
858
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
859
|
-
var array_exports = {};
|
|
860
|
-
__export2(array_exports, {
|
|
861
|
-
arrayContainsOtherArray: () => arrayContainsOtherArray3,
|
|
862
|
-
joinArrays: () => joinArrays2,
|
|
863
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray2,
|
|
864
|
-
mergeArray: () => mergeArray2,
|
|
865
|
-
removeFromArray: () => removeFromArray3,
|
|
866
|
-
swapItemsInArray: () => swapItemsInArray
|
|
867
|
-
});
|
|
868
|
-
module.exports = __toCommonJS2(array_exports);
|
|
869
|
-
var import_object = require_object();
|
|
870
|
-
var import_types = require_types();
|
|
871
|
-
var arrayContainsOtherArray3 = (arr1, arr2) => {
|
|
872
|
-
return arr2.every((val) => arr1.includes(val));
|
|
873
|
-
};
|
|
874
|
-
var removeFromArray3 = (arr, index) => {
|
|
875
|
-
if ((0, import_types.isString)(index))
|
|
876
|
-
index = parseInt(index);
|
|
877
|
-
if ((0, import_types.isNumber)(index)) {
|
|
878
|
-
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
879
|
-
throw new Error("Invalid index");
|
|
880
|
-
}
|
|
881
|
-
arr.splice(index, 1);
|
|
882
|
-
} else if ((0, import_types.isArray)(index)) {
|
|
883
|
-
index.forEach((idx) => removeFromArray3(arr, idx));
|
|
884
|
-
} else {
|
|
885
|
-
throw new Error("Invalid index");
|
|
886
|
-
}
|
|
887
|
-
return arr;
|
|
888
|
-
};
|
|
889
|
-
var swapItemsInArray = (arr, i, j) => {
|
|
890
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
891
|
-
};
|
|
892
|
-
var joinArrays2 = (...arrays) => {
|
|
893
|
-
return [].concat(...arrays);
|
|
894
|
-
};
|
|
895
|
-
var mergeArray2 = (arr, excludeFrom = []) => {
|
|
896
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
897
|
-
};
|
|
898
|
-
var mergeAndCloneIfArray2 = (obj) => {
|
|
899
|
-
return (0, import_types.isArray)(obj) ? mergeArray2(obj) : (0, import_object.deepClone)(obj);
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
});
|
|
903
|
-
|
|
904
903
|
// ../refactor/domql/packages/utils/dist/cjs/log.js
|
|
905
904
|
var require_log = __commonJS({
|
|
906
|
-
"../refactor/domql/packages/utils/dist/cjs/log.js"(exports,
|
|
905
|
+
"../refactor/domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
907
906
|
"use strict";
|
|
908
|
-
var
|
|
909
|
-
var
|
|
910
|
-
var
|
|
911
|
-
var
|
|
912
|
-
var
|
|
907
|
+
var __defProp14 = Object.defineProperty;
|
|
908
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
909
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
910
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
911
|
+
var __export11 = (target, all) => {
|
|
913
912
|
for (var name in all)
|
|
914
|
-
|
|
913
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
915
914
|
};
|
|
916
|
-
var
|
|
915
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
917
916
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
918
|
-
for (let key of
|
|
919
|
-
if (!
|
|
920
|
-
|
|
917
|
+
for (let key of __getOwnPropNames14(from))
|
|
918
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
919
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
921
920
|
}
|
|
922
921
|
return to;
|
|
923
922
|
};
|
|
924
|
-
var
|
|
923
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
925
924
|
var log_exports = {};
|
|
926
|
-
|
|
925
|
+
__export11(log_exports, {
|
|
927
926
|
logGroupIf: () => logGroupIf,
|
|
928
927
|
logIf: () => logIf
|
|
929
928
|
});
|
|
930
|
-
|
|
929
|
+
module2.exports = __toCommonJS14(log_exports);
|
|
931
930
|
var logIf = (bool, ...arg) => {
|
|
932
931
|
if (bool)
|
|
933
932
|
arg.map((v) => console.log(v));
|
|
@@ -943,87 +942,142 @@ var require_log = __commonJS({
|
|
|
943
942
|
});
|
|
944
943
|
|
|
945
944
|
// ../refactor/domql/packages/utils/dist/cjs/index.js
|
|
946
|
-
var
|
|
947
|
-
"../refactor/domql/packages/utils/dist/cjs/index.js"(exports,
|
|
945
|
+
var require_cjs = __commonJS({
|
|
946
|
+
"../refactor/domql/packages/utils/dist/cjs/index.js"(exports, module2) {
|
|
948
947
|
"use strict";
|
|
949
|
-
var
|
|
950
|
-
var
|
|
951
|
-
var
|
|
952
|
-
var
|
|
953
|
-
var
|
|
948
|
+
var __defProp14 = Object.defineProperty;
|
|
949
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
950
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
951
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
952
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
954
953
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
955
|
-
for (let key of
|
|
956
|
-
if (!
|
|
957
|
-
|
|
954
|
+
for (let key of __getOwnPropNames14(from))
|
|
955
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
956
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
958
957
|
}
|
|
959
958
|
return to;
|
|
960
959
|
};
|
|
961
|
-
var
|
|
962
|
-
var
|
|
960
|
+
var __reExport3 = (target, mod, secondTarget) => (__copyProps14(target, mod, "default"), secondTarget && __copyProps14(secondTarget, mod, "default"));
|
|
961
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
963
962
|
var utils_exports = {};
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
963
|
+
module2.exports = __toCommonJS14(utils_exports);
|
|
964
|
+
__reExport3(utils_exports, (init_cjs(), __toCommonJS(cjs_exports)), module2.exports);
|
|
965
|
+
__reExport3(utils_exports, require_types(), module2.exports);
|
|
966
|
+
__reExport3(utils_exports, require_object(), module2.exports);
|
|
967
|
+
__reExport3(utils_exports, require_function(), module2.exports);
|
|
968
|
+
__reExport3(utils_exports, require_array(), module2.exports);
|
|
969
|
+
__reExport3(utils_exports, require_node(), module2.exports);
|
|
970
|
+
__reExport3(utils_exports, require_log(), module2.exports);
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
|
|
974
|
+
// ../refactor/domql/packages/state/dist/cjs/ignore.js
|
|
975
|
+
var require_ignore = __commonJS({
|
|
976
|
+
"../refactor/domql/packages/state/dist/cjs/ignore.js"(exports, module2) {
|
|
977
|
+
"use strict";
|
|
978
|
+
var __defProp14 = Object.defineProperty;
|
|
979
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
980
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
981
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
982
|
+
var __export11 = (target, all) => {
|
|
983
|
+
for (var name in all)
|
|
984
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
985
|
+
};
|
|
986
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
987
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
988
|
+
for (let key of __getOwnPropNames14(from))
|
|
989
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
990
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
991
|
+
}
|
|
992
|
+
return to;
|
|
993
|
+
};
|
|
994
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
995
|
+
var ignore_exports3 = {};
|
|
996
|
+
__export11(ignore_exports3, {
|
|
997
|
+
IGNORE_STATE_PARAMS: () => IGNORE_STATE_PARAMS2
|
|
998
|
+
});
|
|
999
|
+
module2.exports = __toCommonJS14(ignore_exports3);
|
|
1000
|
+
var IGNORE_STATE_PARAMS2 = [
|
|
1001
|
+
"update",
|
|
1002
|
+
"parse",
|
|
1003
|
+
"clean",
|
|
1004
|
+
"create",
|
|
1005
|
+
"destroy",
|
|
1006
|
+
"add",
|
|
1007
|
+
"toggle",
|
|
1008
|
+
"remove",
|
|
1009
|
+
"apply",
|
|
1010
|
+
"set",
|
|
1011
|
+
"rootUpdate",
|
|
1012
|
+
"parentUpdate",
|
|
1013
|
+
"parent",
|
|
1014
|
+
"__element",
|
|
1015
|
+
"__depends",
|
|
1016
|
+
"__ref",
|
|
1017
|
+
"__children",
|
|
1018
|
+
"__root"
|
|
1019
|
+
];
|
|
972
1020
|
}
|
|
973
1021
|
});
|
|
974
1022
|
|
|
975
1023
|
// ../refactor/domql/packages/event/dist/cjs/on.js
|
|
976
1024
|
var require_on = __commonJS({
|
|
977
|
-
"../refactor/domql/packages/event/dist/cjs/on.js"(exports,
|
|
1025
|
+
"../refactor/domql/packages/event/dist/cjs/on.js"(exports, module2) {
|
|
978
1026
|
"use strict";
|
|
979
|
-
var
|
|
980
|
-
var
|
|
981
|
-
var
|
|
982
|
-
var
|
|
983
|
-
var
|
|
1027
|
+
var __defProp14 = Object.defineProperty;
|
|
1028
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1029
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1030
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1031
|
+
var __export11 = (target, all) => {
|
|
984
1032
|
for (var name in all)
|
|
985
|
-
|
|
1033
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
986
1034
|
};
|
|
987
|
-
var
|
|
1035
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
988
1036
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
989
|
-
for (let key of
|
|
990
|
-
if (!
|
|
991
|
-
|
|
1037
|
+
for (let key of __getOwnPropNames14(from))
|
|
1038
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1039
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
992
1040
|
}
|
|
993
1041
|
return to;
|
|
994
1042
|
};
|
|
995
|
-
var
|
|
1043
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
996
1044
|
var on_exports = {};
|
|
997
|
-
|
|
998
|
-
applyEvent: () =>
|
|
999
|
-
|
|
1000
|
-
|
|
1045
|
+
__export11(on_exports, {
|
|
1046
|
+
applyEvent: () => applyEvent,
|
|
1047
|
+
applyEventUpdate: () => applyEventUpdate,
|
|
1048
|
+
applyEventsOnNode: () => applyEventsOnNode,
|
|
1049
|
+
triggerEventOn: () => triggerEventOn,
|
|
1050
|
+
triggerEventOnUpdate: () => triggerEventOnUpdate
|
|
1001
1051
|
});
|
|
1002
|
-
|
|
1003
|
-
var
|
|
1004
|
-
var
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1052
|
+
module2.exports = __toCommonJS14(on_exports);
|
|
1053
|
+
var import_utils9 = require_cjs();
|
|
1054
|
+
var applyEvent = (param, element, state, context, options) => {
|
|
1055
|
+
return param(element, state || element.state, context || element.context, options);
|
|
1056
|
+
};
|
|
1057
|
+
var triggerEventOn = (param, element, options) => {
|
|
1058
|
+
if (element.on && (0, import_utils9.isFunction)(element.on[param])) {
|
|
1059
|
+
const { state, context } = element;
|
|
1060
|
+
return applyEvent(element.on[param], element, state, context, options);
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
var applyEventUpdate = (param, updatedObj, element, state, context, options) => {
|
|
1064
|
+
return param(updatedObj, element, state || element.state, context || element.context, options);
|
|
1065
|
+
};
|
|
1066
|
+
var triggerEventOnUpdate = (param, updatedObj, element, options) => {
|
|
1067
|
+
if (element.on && (0, import_utils9.isFunction)(element.on[param])) {
|
|
1068
|
+
const { state, context } = element;
|
|
1069
|
+
return applyEventUpdate(element.on[param], updatedObj, element, state, context, options);
|
|
1016
1070
|
}
|
|
1017
1071
|
};
|
|
1018
|
-
var
|
|
1072
|
+
var applyEventsOnNode = (element) => {
|
|
1019
1073
|
const { node, on } = element;
|
|
1020
1074
|
for (const param in on) {
|
|
1021
1075
|
if (param === "init" || param === "beforeClassAssign" || param === "render" || param === "renderRouter" || param === "attachNode" || param === "stateInit" || param === "stateCreated" || param === "initStateUpdated" || param === "stateUpdated" || param === "initUpdate" || param === "update")
|
|
1022
1076
|
continue;
|
|
1023
1077
|
const appliedFunction = element.on[param];
|
|
1024
|
-
if ((0,
|
|
1025
|
-
const { state
|
|
1026
|
-
node.addEventListener(param, (event) => appliedFunction(event, element,
|
|
1078
|
+
if ((0, import_utils9.isFunction)(appliedFunction)) {
|
|
1079
|
+
const { state, context } = element;
|
|
1080
|
+
node.addEventListener(param, (event) => appliedFunction(event, element, state, context));
|
|
1027
1081
|
}
|
|
1028
1082
|
}
|
|
1029
1083
|
};
|
|
@@ -1031,33 +1085,35 @@ var require_on = __commonJS({
|
|
|
1031
1085
|
});
|
|
1032
1086
|
|
|
1033
1087
|
// ../refactor/domql/packages/report/dist/cjs/index.js
|
|
1034
|
-
var
|
|
1035
|
-
|
|
1088
|
+
var cjs_exports4 = {};
|
|
1089
|
+
var __defProp6, __getOwnPropDesc6, __getOwnPropNames6, __hasOwnProp6, __export4, __copyProps6, __toCommonJS6, report_exports, ERRORS_REGISTRY, report;
|
|
1090
|
+
var init_cjs4 = __esm({
|
|
1091
|
+
"../refactor/domql/packages/report/dist/cjs/index.js"() {
|
|
1036
1092
|
"use strict";
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1093
|
+
__defProp6 = Object.defineProperty;
|
|
1094
|
+
__getOwnPropDesc6 = Object.getOwnPropertyDescriptor;
|
|
1095
|
+
__getOwnPropNames6 = Object.getOwnPropertyNames;
|
|
1096
|
+
__hasOwnProp6 = Object.prototype.hasOwnProperty;
|
|
1097
|
+
__export4 = (target, all) => {
|
|
1042
1098
|
for (var name in all)
|
|
1043
|
-
|
|
1099
|
+
__defProp6(target, name, { get: all[name], enumerable: true });
|
|
1044
1100
|
};
|
|
1045
|
-
|
|
1101
|
+
__copyProps6 = (to, from, except, desc) => {
|
|
1046
1102
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1047
|
-
for (let key of
|
|
1048
|
-
if (!
|
|
1049
|
-
|
|
1103
|
+
for (let key of __getOwnPropNames6(from))
|
|
1104
|
+
if (!__hasOwnProp6.call(to, key) && key !== except)
|
|
1105
|
+
__defProp6(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc6(from, key)) || desc.enumerable });
|
|
1050
1106
|
}
|
|
1051
1107
|
return to;
|
|
1052
1108
|
};
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1109
|
+
__toCommonJS6 = (mod) => __copyProps6(__defProp6({}, "__esModule", { value: true }), mod);
|
|
1110
|
+
report_exports = {};
|
|
1111
|
+
__export4(report_exports, {
|
|
1056
1112
|
ERRORS_REGISTRY: () => ERRORS_REGISTRY,
|
|
1057
|
-
report: () =>
|
|
1113
|
+
report: () => report
|
|
1058
1114
|
});
|
|
1059
|
-
module.exports =
|
|
1060
|
-
|
|
1115
|
+
module.exports = __toCommonJS6(report_exports);
|
|
1116
|
+
ERRORS_REGISTRY = {
|
|
1061
1117
|
en: {
|
|
1062
1118
|
DocumentNotDefined: {
|
|
1063
1119
|
title: "Document is undefined",
|
|
@@ -1102,10 +1158,14 @@ var require_cjs5 = __commonJS({
|
|
|
1102
1158
|
HTMLInvalidText: {
|
|
1103
1159
|
title: "Text string is invalid",
|
|
1104
1160
|
description: "Please pass a valid string to apply text to DOM node"
|
|
1161
|
+
},
|
|
1162
|
+
ElementOnStateIsNotDefined: {
|
|
1163
|
+
title: "Element on state is not defined",
|
|
1164
|
+
description: "Please check the element object"
|
|
1105
1165
|
}
|
|
1106
1166
|
}
|
|
1107
1167
|
};
|
|
1108
|
-
|
|
1168
|
+
report = (err, arg, element) => {
|
|
1109
1169
|
const currentLang = "en";
|
|
1110
1170
|
let errObj;
|
|
1111
1171
|
if (err && typeof err === "string")
|
|
@@ -1125,164 +1185,730 @@ ${element}` : ""
|
|
|
1125
1185
|
|
|
1126
1186
|
// ../refactor/domql/packages/event/dist/cjs/can.js
|
|
1127
1187
|
var require_can = __commonJS({
|
|
1128
|
-
"../refactor/domql/packages/event/dist/cjs/can.js"(exports,
|
|
1188
|
+
"../refactor/domql/packages/event/dist/cjs/can.js"(exports, module2) {
|
|
1129
1189
|
"use strict";
|
|
1130
|
-
var
|
|
1131
|
-
var
|
|
1132
|
-
var
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1190
|
+
var __defProp14 = Object.defineProperty;
|
|
1191
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1192
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1193
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1194
|
+
var __export11 = (target, all) => {
|
|
1135
1195
|
for (var name in all)
|
|
1136
|
-
|
|
1196
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1137
1197
|
};
|
|
1138
|
-
var
|
|
1198
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1139
1199
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1140
|
-
for (let key of
|
|
1141
|
-
if (!
|
|
1142
|
-
|
|
1200
|
+
for (let key of __getOwnPropNames14(from))
|
|
1201
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1202
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1143
1203
|
}
|
|
1144
1204
|
return to;
|
|
1145
1205
|
};
|
|
1146
|
-
var
|
|
1206
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1147
1207
|
var can_exports = {};
|
|
1148
|
-
|
|
1208
|
+
__export11(can_exports, {
|
|
1149
1209
|
canRender: () => canRender
|
|
1150
1210
|
});
|
|
1151
|
-
|
|
1152
|
-
var
|
|
1153
|
-
var
|
|
1211
|
+
module2.exports = __toCommonJS14(can_exports);
|
|
1212
|
+
var import_report = (init_cjs4(), __toCommonJS(cjs_exports4));
|
|
1213
|
+
var import_utils9 = require_cjs();
|
|
1154
1214
|
var canRender = (element) => {
|
|
1155
1215
|
const tag = element.tag || "div";
|
|
1156
|
-
return (0,
|
|
1216
|
+
return (0, import_utils9.isValidHtmlTag)(tag) || (0, import_report.report)("HTMLInvalidTag");
|
|
1157
1217
|
};
|
|
1158
1218
|
}
|
|
1159
1219
|
});
|
|
1160
1220
|
|
|
1161
1221
|
// ../refactor/domql/packages/event/dist/cjs/index.js
|
|
1162
|
-
var
|
|
1163
|
-
"../refactor/domql/packages/event/dist/cjs/index.js"(exports,
|
|
1222
|
+
var require_cjs2 = __commonJS({
|
|
1223
|
+
"../refactor/domql/packages/event/dist/cjs/index.js"(exports, module2) {
|
|
1164
1224
|
"use strict";
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1167
|
-
var
|
|
1168
|
-
var
|
|
1169
|
-
var
|
|
1225
|
+
var __defProp14 = Object.defineProperty;
|
|
1226
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1227
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1228
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1229
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1170
1230
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1171
|
-
for (let key of
|
|
1172
|
-
if (!
|
|
1173
|
-
|
|
1231
|
+
for (let key of __getOwnPropNames14(from))
|
|
1232
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1233
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1174
1234
|
}
|
|
1175
1235
|
return to;
|
|
1176
1236
|
};
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1237
|
+
var __reExport3 = (target, mod, secondTarget) => (__copyProps14(target, mod, "default"), secondTarget && __copyProps14(secondTarget, mod, "default"));
|
|
1238
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1179
1239
|
var event_exports = {};
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1240
|
+
module2.exports = __toCommonJS14(event_exports);
|
|
1241
|
+
__reExport3(event_exports, require_on(), module2.exports);
|
|
1242
|
+
__reExport3(event_exports, require_can(), module2.exports);
|
|
1183
1243
|
}
|
|
1184
1244
|
});
|
|
1185
1245
|
|
|
1186
|
-
// ../refactor/domql/packages/
|
|
1187
|
-
var
|
|
1188
|
-
"../refactor/domql/packages/
|
|
1246
|
+
// ../refactor/domql/packages/state/dist/cjs/methods.js
|
|
1247
|
+
var require_methods = __commonJS({
|
|
1248
|
+
"../refactor/domql/packages/state/dist/cjs/methods.js"(exports, module2) {
|
|
1189
1249
|
"use strict";
|
|
1190
|
-
var
|
|
1191
|
-
var
|
|
1192
|
-
var
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1250
|
+
var __defProp14 = Object.defineProperty;
|
|
1251
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1252
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1253
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1254
|
+
var __export11 = (target, all) => {
|
|
1195
1255
|
for (var name in all)
|
|
1196
|
-
|
|
1256
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1197
1257
|
};
|
|
1198
|
-
var
|
|
1258
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1199
1259
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1200
|
-
for (let key of
|
|
1201
|
-
if (!
|
|
1202
|
-
|
|
1260
|
+
for (let key of __getOwnPropNames14(from))
|
|
1261
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1262
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1203
1263
|
}
|
|
1204
1264
|
return to;
|
|
1205
1265
|
};
|
|
1206
|
-
var
|
|
1207
|
-
var
|
|
1208
|
-
|
|
1209
|
-
|
|
1266
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1267
|
+
var methods_exports4 = {};
|
|
1268
|
+
__export11(methods_exports4, {
|
|
1269
|
+
add: () => add,
|
|
1270
|
+
apply: () => apply,
|
|
1271
|
+
clean: () => clean,
|
|
1272
|
+
destroy: () => destroy,
|
|
1273
|
+
parentUpdate: () => parentUpdate,
|
|
1274
|
+
parse: () => parse2,
|
|
1275
|
+
remove: () => remove2,
|
|
1276
|
+
rootUpdate: () => rootUpdate,
|
|
1277
|
+
set: () => set,
|
|
1278
|
+
toggle: () => toggle
|
|
1210
1279
|
});
|
|
1211
|
-
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1215
|
-
|
|
1216
|
-
|
|
1280
|
+
module2.exports = __toCommonJS14(methods_exports4);
|
|
1281
|
+
var import_utils9 = require_cjs();
|
|
1282
|
+
var import_ignore2 = require_ignore();
|
|
1283
|
+
var parse2 = function() {
|
|
1284
|
+
const state = this;
|
|
1285
|
+
if ((0, import_utils9.isObject)(state)) {
|
|
1286
|
+
const obj = {};
|
|
1287
|
+
for (const param in state) {
|
|
1288
|
+
if (!import_ignore2.IGNORE_STATE_PARAMS.includes(param)) {
|
|
1289
|
+
obj[param] = state[param];
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
return obj;
|
|
1293
|
+
} else if ((0, import_utils9.isArray)(state)) {
|
|
1294
|
+
return state.filter((item) => !import_ignore2.IGNORE_STATE_PARAMS.includes(item));
|
|
1295
|
+
}
|
|
1217
1296
|
};
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
var __export2 = (target, all) => {
|
|
1230
|
-
for (var name in all)
|
|
1231
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1297
|
+
var clean = function(options = {}) {
|
|
1298
|
+
const state = this;
|
|
1299
|
+
for (const param in state) {
|
|
1300
|
+
if (!import_ignore2.IGNORE_STATE_PARAMS.includes(param)) {
|
|
1301
|
+
delete state[param];
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
if (!options.preventStateUpdate) {
|
|
1305
|
+
state.update(state, { replace: true, options });
|
|
1306
|
+
}
|
|
1307
|
+
return state;
|
|
1232
1308
|
};
|
|
1233
|
-
var
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1309
|
+
var destroy = function(options = {}) {
|
|
1310
|
+
const state = this;
|
|
1311
|
+
const element = state.__element;
|
|
1312
|
+
const stateKey2 = element.__ref.__state;
|
|
1313
|
+
if ((0, import_utils9.isString)(stateKey2)) {
|
|
1314
|
+
element.parent.state.remove(stateKey2, { isHoisted: true, ...options });
|
|
1315
|
+
return element.state;
|
|
1316
|
+
}
|
|
1317
|
+
delete element.state;
|
|
1318
|
+
element.state = state.parent;
|
|
1319
|
+
if (state.parent) {
|
|
1320
|
+
delete state.parent.__children[element.key];
|
|
1321
|
+
}
|
|
1322
|
+
if (state.__children) {
|
|
1323
|
+
for (const key in state.__children) {
|
|
1324
|
+
const child = state.__children[key];
|
|
1325
|
+
if (child.state) {
|
|
1326
|
+
child.parent = state.parent;
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
element.state.update({}, { isHoisted: true, ...options });
|
|
1331
|
+
return element.state;
|
|
1332
|
+
};
|
|
1333
|
+
var parentUpdate = function(obj, options = {}) {
|
|
1334
|
+
const state = this;
|
|
1335
|
+
if (!state || !state.parent)
|
|
1336
|
+
return;
|
|
1337
|
+
return state.parent.update(obj, { isHoisted: true, ...options });
|
|
1338
|
+
};
|
|
1339
|
+
var rootUpdate = function(obj, options = {}) {
|
|
1340
|
+
const state = this;
|
|
1341
|
+
if (!state)
|
|
1342
|
+
return;
|
|
1343
|
+
const rootState = state.__element.__ref.__root.state;
|
|
1344
|
+
return rootState.update(obj, { isHoisted: false, options });
|
|
1345
|
+
};
|
|
1346
|
+
var add = function(value, options = {}) {
|
|
1347
|
+
const state = this;
|
|
1348
|
+
if ((0, import_utils9.isArray)(state)) {
|
|
1349
|
+
state.push(value);
|
|
1350
|
+
state.update(state.parse(), { overwrite: "replace", ...options });
|
|
1351
|
+
} else if ((0, import_utils9.isObject)(state)) {
|
|
1352
|
+
const key = Object.keys(state).length;
|
|
1353
|
+
state.update({ [key]: value }, options);
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
var toggle = function(key, options = {}) {
|
|
1357
|
+
const state = this;
|
|
1358
|
+
state.update({ [key]: !state[key] }, options);
|
|
1359
|
+
};
|
|
1360
|
+
var remove2 = function(key, options = {}) {
|
|
1361
|
+
const state = this;
|
|
1362
|
+
if ((0, import_utils9.isArray)(state))
|
|
1363
|
+
(0, import_utils9.removeFromArray)(state, key);
|
|
1364
|
+
if ((0, import_utils9.isObject)(state))
|
|
1365
|
+
(0, import_utils9.removeFromObject)(state, key);
|
|
1366
|
+
return state.update(state.parse(), { replace: true, ...options });
|
|
1367
|
+
};
|
|
1368
|
+
var set = function(value, options = {}) {
|
|
1369
|
+
const state = this;
|
|
1370
|
+
return state.clean({ preventStateUpdate: true }).update(value, { replace: true, ...options });
|
|
1371
|
+
};
|
|
1372
|
+
var apply = function(func, options = {}) {
|
|
1373
|
+
const state = this;
|
|
1374
|
+
if ((0, import_utils9.isFunction)(func)) {
|
|
1375
|
+
func(state);
|
|
1376
|
+
return state.update(state, { overwrite: "replace", ...options });
|
|
1238
1377
|
}
|
|
1239
|
-
return to;
|
|
1240
1378
|
};
|
|
1241
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1242
|
-
var tree_exports = {};
|
|
1243
|
-
__export2(tree_exports, {
|
|
1244
|
-
ROOT: () => import_root2.ROOT,
|
|
1245
|
-
TREE: () => TREE2
|
|
1246
|
-
});
|
|
1247
|
-
module.exports = __toCommonJS2(tree_exports);
|
|
1248
|
-
var import_root = require_root();
|
|
1249
|
-
var import_root2 = require_root();
|
|
1250
|
-
var TREE2 = import_root.ROOT;
|
|
1251
1379
|
}
|
|
1252
1380
|
});
|
|
1253
1381
|
|
|
1254
|
-
// ../refactor/domql/packages/
|
|
1255
|
-
var
|
|
1256
|
-
"../refactor/domql/packages/
|
|
1382
|
+
// ../refactor/domql/packages/state/dist/cjs/inherit.js
|
|
1383
|
+
var require_inherit = __commonJS({
|
|
1384
|
+
"../refactor/domql/packages/state/dist/cjs/inherit.js"(exports, module2) {
|
|
1257
1385
|
"use strict";
|
|
1258
|
-
var
|
|
1259
|
-
var
|
|
1260
|
-
var
|
|
1261
|
-
var
|
|
1262
|
-
var
|
|
1386
|
+
var __defProp14 = Object.defineProperty;
|
|
1387
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1388
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1389
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1390
|
+
var __export11 = (target, all) => {
|
|
1263
1391
|
for (var name in all)
|
|
1264
|
-
|
|
1392
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1265
1393
|
};
|
|
1266
|
-
var
|
|
1394
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1267
1395
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1268
|
-
for (let key of
|
|
1269
|
-
if (!
|
|
1270
|
-
|
|
1396
|
+
for (let key of __getOwnPropNames14(from))
|
|
1397
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1398
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1271
1399
|
}
|
|
1272
1400
|
return to;
|
|
1273
1401
|
};
|
|
1274
|
-
var
|
|
1275
|
-
var
|
|
1276
|
-
|
|
1277
|
-
|
|
1402
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1403
|
+
var inherit_exports = {};
|
|
1404
|
+
__export11(inherit_exports, {
|
|
1405
|
+
checkIfInherits: () => checkIfInherits,
|
|
1406
|
+
createChangesByKey: () => createChangesByKey,
|
|
1407
|
+
createInheritedState: () => createInheritedState,
|
|
1408
|
+
findInheritedState: () => findInheritedState,
|
|
1409
|
+
getChildStateInKey: () => getChildStateInKey,
|
|
1410
|
+
getParentStateInKey: () => getParentStateInKey,
|
|
1411
|
+
isState: () => isState
|
|
1278
1412
|
});
|
|
1279
|
-
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1413
|
+
module2.exports = __toCommonJS14(inherit_exports);
|
|
1414
|
+
var import_utils9 = require_cjs();
|
|
1415
|
+
var import_ignore2 = require_ignore();
|
|
1416
|
+
var getParentStateInKey = (stateKey2, parentState) => {
|
|
1417
|
+
if (!stateKey2.includes("../"))
|
|
1418
|
+
return;
|
|
1419
|
+
const arr = stateKey2.split("../");
|
|
1420
|
+
const arrLength = arr.length - 1;
|
|
1421
|
+
for (let i = 0; i < arrLength; i++) {
|
|
1422
|
+
if (!parentState.parent)
|
|
1423
|
+
return null;
|
|
1424
|
+
parentState = parentState.parent;
|
|
1425
|
+
}
|
|
1426
|
+
return parentState;
|
|
1427
|
+
};
|
|
1428
|
+
var getChildStateInKey = (stateKey2, parentState, options) => {
|
|
1429
|
+
const arr = stateKey2.split("/");
|
|
1430
|
+
const arrLength = arr.length - 1;
|
|
1431
|
+
for (let i = 0; i < arrLength; i++) {
|
|
1432
|
+
const childKey = arr[i];
|
|
1433
|
+
const grandChildKey = arr[i + 1];
|
|
1434
|
+
const childInParent = parentState[childKey];
|
|
1435
|
+
if (childInParent && childInParent[grandChildKey]) {
|
|
1436
|
+
stateKey2 = grandChildKey;
|
|
1437
|
+
parentState = childInParent;
|
|
1438
|
+
} else
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
if (options.returnParent)
|
|
1442
|
+
return parentState;
|
|
1443
|
+
return parentState[stateKey2];
|
|
1444
|
+
};
|
|
1445
|
+
var findInheritedState = (element, parent, options = {}) => {
|
|
1446
|
+
const ref = element.__ref;
|
|
1447
|
+
let stateKey2 = ref.__state;
|
|
1448
|
+
if (!checkIfInherits(element))
|
|
1449
|
+
return;
|
|
1450
|
+
let parentState = parent.state;
|
|
1451
|
+
const findGrandParentState = getParentStateInKey(stateKey2, parent.state);
|
|
1452
|
+
if (findGrandParentState) {
|
|
1453
|
+
parentState = findGrandParentState;
|
|
1454
|
+
stateKey2 = stateKey2.replaceAll("../", "");
|
|
1455
|
+
}
|
|
1456
|
+
if (!parentState)
|
|
1457
|
+
return;
|
|
1458
|
+
return getChildStateInKey(stateKey2, parentState, options);
|
|
1459
|
+
};
|
|
1460
|
+
var createInheritedState = (element, parent) => {
|
|
1461
|
+
const ref = element.__ref;
|
|
1462
|
+
const inheritedState = findInheritedState(element, parent);
|
|
1463
|
+
if (!inheritedState)
|
|
1464
|
+
return element.state;
|
|
1465
|
+
if ((0, import_utils9.is)(inheritedState)("object", "array")) {
|
|
1466
|
+
return (0, import_utils9.deepClone)(inheritedState, import_ignore2.IGNORE_STATE_PARAMS);
|
|
1467
|
+
} else if ((0, import_utils9.is)(inheritedState)("string", "number")) {
|
|
1468
|
+
ref.__stateType = "string";
|
|
1469
|
+
return { value: inheritedState };
|
|
1470
|
+
}
|
|
1471
|
+
console.warn(stateKey, "is not present. Replacing with", {});
|
|
1472
|
+
};
|
|
1473
|
+
var checkIfInherits = (element) => {
|
|
1474
|
+
const ref = element.__ref;
|
|
1475
|
+
const stateKey2 = ref.__state;
|
|
1476
|
+
if (!stateKey2 || (0, import_utils9.isNot)(stateKey2)("number", "string"))
|
|
1477
|
+
return false;
|
|
1478
|
+
return true;
|
|
1479
|
+
};
|
|
1480
|
+
var isState = function(state) {
|
|
1481
|
+
if (!(0, import_utils9.isObjectLike)(state))
|
|
1482
|
+
return false;
|
|
1483
|
+
const keys2 = Object.keys(state);
|
|
1484
|
+
return (0, import_utils9.arrayContainsOtherArray)(keys2, ["update", "parse", "clean", "create", "parent", "rootUpdate"]);
|
|
1485
|
+
};
|
|
1486
|
+
var createChangesByKey = (path, value) => {
|
|
1487
|
+
if (!path) {
|
|
1488
|
+
return value || {};
|
|
1489
|
+
}
|
|
1490
|
+
const keys2 = path.split("/");
|
|
1491
|
+
let obj = {};
|
|
1492
|
+
let ref = obj;
|
|
1493
|
+
keys2.forEach((key, index) => {
|
|
1494
|
+
ref[key] = index === keys2.length - 1 ? value || {} : {};
|
|
1495
|
+
ref = ref[key];
|
|
1496
|
+
});
|
|
1497
|
+
return obj;
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1502
|
+
// ../refactor/domql/packages/state/dist/cjs/updateState.js
|
|
1503
|
+
var require_updateState = __commonJS({
|
|
1504
|
+
"../refactor/domql/packages/state/dist/cjs/updateState.js"(exports, module2) {
|
|
1505
|
+
"use strict";
|
|
1506
|
+
var __defProp14 = Object.defineProperty;
|
|
1507
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1508
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1509
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1510
|
+
var __export11 = (target, all) => {
|
|
1511
|
+
for (var name in all)
|
|
1512
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1513
|
+
};
|
|
1514
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1515
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1516
|
+
for (let key of __getOwnPropNames14(from))
|
|
1517
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1518
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1519
|
+
}
|
|
1520
|
+
return to;
|
|
1521
|
+
};
|
|
1522
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1523
|
+
var updateState_exports = {};
|
|
1524
|
+
__export11(updateState_exports, {
|
|
1525
|
+
updateState: () => updateState
|
|
1526
|
+
});
|
|
1527
|
+
module2.exports = __toCommonJS14(updateState_exports);
|
|
1528
|
+
var import_report = (init_cjs4(), __toCommonJS(cjs_exports4));
|
|
1529
|
+
var import_event = require_cjs2();
|
|
1530
|
+
var import_ignore2 = require_ignore();
|
|
1531
|
+
var import_utils9 = require_cjs();
|
|
1532
|
+
var import_inherit = require_inherit();
|
|
1533
|
+
var STATE_UPDATE_OPTIONS = {
|
|
1534
|
+
overwrite: true,
|
|
1535
|
+
preventHoistElementUpdate: false,
|
|
1536
|
+
updateByState: true,
|
|
1537
|
+
execStateFunction: true,
|
|
1538
|
+
isHoisted: true,
|
|
1539
|
+
stateFunctionOverwrite: true
|
|
1540
|
+
};
|
|
1541
|
+
var updateState = function(obj, options = STATE_UPDATE_OPTIONS) {
|
|
1542
|
+
const state = this;
|
|
1543
|
+
const element = state.__element;
|
|
1544
|
+
if (!options.updateByState)
|
|
1545
|
+
(0, import_utils9.merge)(options, STATE_UPDATE_OPTIONS);
|
|
1546
|
+
if (!state.__element)
|
|
1547
|
+
(0, import_report.report)("ElementOnStateIsNotDefined");
|
|
1548
|
+
if (options.preventInheritAtCurrentState === true) {
|
|
1549
|
+
options.preventInheritAtCurrentState = state;
|
|
1550
|
+
} else if (options.preventInheritAtCurrentState)
|
|
1551
|
+
return;
|
|
1552
|
+
if (!options.preventInitStateUpdateListener) {
|
|
1553
|
+
const initStateUpdateReturns = (0, import_event.triggerEventOnUpdate)("initStateUpdated", obj, element, options);
|
|
1554
|
+
if (initStateUpdateReturns === false)
|
|
1555
|
+
return element;
|
|
1556
|
+
}
|
|
1557
|
+
applyOverwrite(state, obj, options);
|
|
1558
|
+
const updateIsHoisted = hoistStateUpdate(state, obj, options);
|
|
1559
|
+
if (updateIsHoisted)
|
|
1560
|
+
return state;
|
|
1561
|
+
updateDependentState(state, obj, options);
|
|
1562
|
+
applyElementUpdate(state, obj, options);
|
|
1563
|
+
if (!options.preventStateUpdateListener) {
|
|
1564
|
+
(0, import_event.triggerEventOnUpdate)("stateUpdated", obj, element, options);
|
|
1565
|
+
}
|
|
1566
|
+
return state;
|
|
1567
|
+
};
|
|
1568
|
+
var applyOverwrite = (state, obj, options) => {
|
|
1569
|
+
const { overwrite: overwrite2 } = options;
|
|
1570
|
+
if (!overwrite2)
|
|
1571
|
+
return;
|
|
1572
|
+
const shallow = overwrite2 === "shallow";
|
|
1573
|
+
const merge2 = overwrite2 === "merge";
|
|
1574
|
+
if (merge2) {
|
|
1575
|
+
(0, import_utils9.deepMerge)(state, obj, import_ignore2.IGNORE_STATE_PARAMS);
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
const overwriteFunc = shallow ? import_utils9.overwriteShallow : import_utils9.overwriteDeep;
|
|
1579
|
+
overwriteFunc(state, obj, import_ignore2.IGNORE_STATE_PARAMS);
|
|
1580
|
+
};
|
|
1581
|
+
var hoistStateUpdate = (state, obj, options) => {
|
|
1582
|
+
const element = state.__element;
|
|
1583
|
+
const { parent, __ref: ref } = element;
|
|
1584
|
+
const stateKey2 = ref.__state;
|
|
1585
|
+
if (!stateKey2)
|
|
1586
|
+
return;
|
|
1587
|
+
const asksForInherit = (0, import_inherit.checkIfInherits)(element);
|
|
1588
|
+
const inheritedState = (0, import_inherit.findInheritedState)(element, parent, { returnParent: true });
|
|
1589
|
+
const shouldPropagateState = asksForInherit && inheritedState && !options.stopStatePropagation;
|
|
1590
|
+
if (!shouldPropagateState)
|
|
1591
|
+
return;
|
|
1592
|
+
const isStringState = ref.__stateType === "string";
|
|
1593
|
+
const value = isStringState ? state.value : state.parse();
|
|
1594
|
+
const passedValue = isStringState ? state.value : obj;
|
|
1595
|
+
const findGrandParentState = (0, import_inherit.getParentStateInKey)(stateKey2, parent.state);
|
|
1596
|
+
const changesValue = (0, import_inherit.createChangesByKey)(stateKey2, passedValue);
|
|
1597
|
+
const targetParent = findGrandParentState || parent.state;
|
|
1598
|
+
if (options.replace)
|
|
1599
|
+
targetParent[stateKey2] = value;
|
|
1600
|
+
targetParent.update(changesValue, {
|
|
1601
|
+
execStateFunction: false,
|
|
1602
|
+
stateFunctionOverwrite: false,
|
|
1603
|
+
isHoisted: true,
|
|
1604
|
+
...options,
|
|
1605
|
+
preventUpdate: options.preventHoistElementUpdate,
|
|
1606
|
+
overwrite: !options.replace
|
|
1607
|
+
});
|
|
1608
|
+
const hasNotUpdated = !options.preventUpdate || !options.preventHoistElementUpdate;
|
|
1609
|
+
if (!options.preventStateUpdateListener && hasNotUpdated) {
|
|
1610
|
+
(0, import_event.triggerEventOnUpdate)("stateUpdated", obj, element, options);
|
|
1611
|
+
}
|
|
1612
|
+
return true;
|
|
1613
|
+
};
|
|
1614
|
+
var updateDependentState = (state, obj, options) => {
|
|
1615
|
+
if (!state.__depends)
|
|
1616
|
+
return;
|
|
1617
|
+
for (const el in state.__depends) {
|
|
1618
|
+
const dependentState = state.__depends[el];
|
|
1619
|
+
dependentState.clean().update(state.parse(), options);
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
var applyElementUpdate = (state, obj, options) => {
|
|
1623
|
+
const element = state.__element;
|
|
1624
|
+
if (!options.preventUpdate) {
|
|
1625
|
+
element.update({}, {
|
|
1626
|
+
...options,
|
|
1627
|
+
updateByState: true
|
|
1628
|
+
});
|
|
1629
|
+
} else if (options.preventUpdate === "recursive") {
|
|
1630
|
+
element.update({}, {
|
|
1631
|
+
...options,
|
|
1632
|
+
isHoisted: false,
|
|
1633
|
+
updateByState: true,
|
|
1634
|
+
preventUpdate: true
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1639
|
+
});
|
|
1640
|
+
|
|
1641
|
+
// ../refactor/domql/packages/state/dist/cjs/createState.js
|
|
1642
|
+
var require_createState = __commonJS({
|
|
1643
|
+
"../refactor/domql/packages/state/dist/cjs/createState.js"(exports, module2) {
|
|
1644
|
+
"use strict";
|
|
1645
|
+
var __defProp14 = Object.defineProperty;
|
|
1646
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1647
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1648
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1649
|
+
var __export11 = (target, all) => {
|
|
1650
|
+
for (var name in all)
|
|
1651
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1652
|
+
};
|
|
1653
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1654
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1655
|
+
for (let key of __getOwnPropNames14(from))
|
|
1656
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1657
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1658
|
+
}
|
|
1659
|
+
return to;
|
|
1660
|
+
};
|
|
1661
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1662
|
+
var createState_exports = {};
|
|
1663
|
+
__export11(createState_exports, {
|
|
1664
|
+
createState: () => createState
|
|
1665
|
+
});
|
|
1666
|
+
module2.exports = __toCommonJS14(createState_exports);
|
|
1667
|
+
var import_event = require_cjs2();
|
|
1668
|
+
var import_utils9 = require_cjs();
|
|
1669
|
+
var import_ignore2 = require_ignore();
|
|
1670
|
+
var import_methods3 = require_methods();
|
|
1671
|
+
var import_updateState = require_updateState();
|
|
1672
|
+
var import_inherit = require_inherit();
|
|
1673
|
+
var createState = function(element, parent, options) {
|
|
1674
|
+
const skip = options && options.skip ? options.skip : false;
|
|
1675
|
+
const objectizeState = checkForTypes(element);
|
|
1676
|
+
if (objectizeState === false)
|
|
1677
|
+
return parent.state || {};
|
|
1678
|
+
else
|
|
1679
|
+
element.state = (0, import_utils9.deepClone)(objectizeState, import_ignore2.IGNORE_STATE_PARAMS);
|
|
1680
|
+
const whatInitReturns = (0, import_event.triggerEventOn)("stateInit", element, options);
|
|
1681
|
+
if (whatInitReturns === false)
|
|
1682
|
+
return element.state;
|
|
1683
|
+
if ((0, import_inherit.checkIfInherits)(element)) {
|
|
1684
|
+
const inheritedState = (0, import_inherit.createInheritedState)(element, parent);
|
|
1685
|
+
element.state = inheritedState || {};
|
|
1686
|
+
}
|
|
1687
|
+
const dependentState = applyDependentState(element, element.state);
|
|
1688
|
+
if (dependentState)
|
|
1689
|
+
element.state = dependentState;
|
|
1690
|
+
if (skip)
|
|
1691
|
+
return element.state;
|
|
1692
|
+
applyMethods(element);
|
|
1693
|
+
(0, import_event.triggerEventOn)("stateCreated", element);
|
|
1694
|
+
return element.state;
|
|
1695
|
+
};
|
|
1696
|
+
var applyDependentState = (element, state) => {
|
|
1697
|
+
const { __ref: ref } = state;
|
|
1698
|
+
if (!ref)
|
|
1699
|
+
return;
|
|
1700
|
+
const dependentState = (0, import_utils9.deepClone)(ref, import_ignore2.IGNORE_STATE_PARAMS);
|
|
1701
|
+
const newDepends = { [element.key]: dependentState };
|
|
1702
|
+
ref.__depends = (0, import_utils9.isObject)(ref.__depends) ? { ...ref.__depends, ...newDepends } : newDepends;
|
|
1703
|
+
return dependentState;
|
|
1704
|
+
};
|
|
1705
|
+
var checkForTypes = (element) => {
|
|
1706
|
+
const { state, __ref: ref } = element;
|
|
1707
|
+
if ((0, import_utils9.isFunction)(state)) {
|
|
1708
|
+
ref.__state = state;
|
|
1709
|
+
return (0, import_utils9.exec)(state, element);
|
|
1710
|
+
}
|
|
1711
|
+
if ((0, import_utils9.is)(state)("string", "number")) {
|
|
1712
|
+
ref.__state = state;
|
|
1713
|
+
return {};
|
|
1714
|
+
}
|
|
1715
|
+
if (state === true) {
|
|
1716
|
+
ref.__state = element.key;
|
|
1717
|
+
return {};
|
|
1718
|
+
}
|
|
1719
|
+
if (state) {
|
|
1720
|
+
ref.__hasRootState = true;
|
|
1721
|
+
return state;
|
|
1722
|
+
}
|
|
1723
|
+
return false;
|
|
1724
|
+
};
|
|
1725
|
+
var applyMethods = (element) => {
|
|
1726
|
+
const state = element.state;
|
|
1727
|
+
const ref = element.__ref;
|
|
1728
|
+
state.clean = import_methods3.clean;
|
|
1729
|
+
state.parse = import_methods3.parse;
|
|
1730
|
+
state.destroy = import_methods3.destroy;
|
|
1731
|
+
state.update = import_updateState.updateState;
|
|
1732
|
+
state.rootUpdate = import_methods3.rootUpdate;
|
|
1733
|
+
state.parentUpdate = import_methods3.parentUpdate;
|
|
1734
|
+
state.create = createState;
|
|
1735
|
+
state.add = import_methods3.add;
|
|
1736
|
+
state.toggle = import_methods3.toggle;
|
|
1737
|
+
state.remove = import_methods3.remove;
|
|
1738
|
+
state.apply = import_methods3.apply;
|
|
1739
|
+
state.parent = element.parent.state;
|
|
1740
|
+
state.set = import_methods3.set;
|
|
1741
|
+
state.__element = element;
|
|
1742
|
+
state.__children = {};
|
|
1743
|
+
state.__root = ref.__root ? ref.__root.state : state;
|
|
1744
|
+
if (state.parent)
|
|
1745
|
+
state.parent.__children[element.key] = state;
|
|
1746
|
+
};
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
|
|
1750
|
+
// ../refactor/domql/packages/state/dist/cjs/index.js
|
|
1751
|
+
var require_cjs3 = __commonJS({
|
|
1752
|
+
"../refactor/domql/packages/state/dist/cjs/index.js"(exports, module2) {
|
|
1753
|
+
"use strict";
|
|
1754
|
+
var __defProp14 = Object.defineProperty;
|
|
1755
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1756
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1757
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1758
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1759
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1760
|
+
for (let key of __getOwnPropNames14(from))
|
|
1761
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1762
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1763
|
+
}
|
|
1764
|
+
return to;
|
|
1765
|
+
};
|
|
1766
|
+
var __reExport3 = (target, mod, secondTarget) => (__copyProps14(target, mod, "default"), secondTarget && __copyProps14(secondTarget, mod, "default"));
|
|
1767
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1768
|
+
var state_exports = {};
|
|
1769
|
+
module2.exports = __toCommonJS14(state_exports);
|
|
1770
|
+
__reExport3(state_exports, require_ignore(), module2.exports);
|
|
1771
|
+
__reExport3(state_exports, require_createState(), module2.exports);
|
|
1772
|
+
__reExport3(state_exports, require_updateState(), module2.exports);
|
|
1773
|
+
__reExport3(state_exports, require_methods(), module2.exports);
|
|
1774
|
+
__reExport3(state_exports, require_inherit(), module2.exports);
|
|
1775
|
+
}
|
|
1776
|
+
});
|
|
1777
|
+
|
|
1778
|
+
// ../refactor/domql/packages/props/dist/cjs/ignore.js
|
|
1779
|
+
var ignore_exports = {};
|
|
1780
|
+
var __defProp7, __getOwnPropDesc7, __getOwnPropNames7, __hasOwnProp7, __export5, __copyProps7, __toCommonJS7, ignore_exports2, IGNORE_PROPS_PARAMS;
|
|
1781
|
+
var init_ignore = __esm({
|
|
1782
|
+
"../refactor/domql/packages/props/dist/cjs/ignore.js"() {
|
|
1783
|
+
"use strict";
|
|
1784
|
+
__defProp7 = Object.defineProperty;
|
|
1785
|
+
__getOwnPropDesc7 = Object.getOwnPropertyDescriptor;
|
|
1786
|
+
__getOwnPropNames7 = Object.getOwnPropertyNames;
|
|
1787
|
+
__hasOwnProp7 = Object.prototype.hasOwnProperty;
|
|
1788
|
+
__export5 = (target, all) => {
|
|
1789
|
+
for (var name in all)
|
|
1790
|
+
__defProp7(target, name, { get: all[name], enumerable: true });
|
|
1791
|
+
};
|
|
1792
|
+
__copyProps7 = (to, from, except, desc) => {
|
|
1793
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1794
|
+
for (let key of __getOwnPropNames7(from))
|
|
1795
|
+
if (!__hasOwnProp7.call(to, key) && key !== except)
|
|
1796
|
+
__defProp7(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc7(from, key)) || desc.enumerable });
|
|
1797
|
+
}
|
|
1798
|
+
return to;
|
|
1799
|
+
};
|
|
1800
|
+
__toCommonJS7 = (mod) => __copyProps7(__defProp7({}, "__esModule", { value: true }), mod);
|
|
1801
|
+
ignore_exports2 = {};
|
|
1802
|
+
__export5(ignore_exports2, {
|
|
1803
|
+
IGNORE_PROPS_PARAMS: () => IGNORE_PROPS_PARAMS
|
|
1804
|
+
});
|
|
1805
|
+
module.exports = __toCommonJS7(ignore_exports2);
|
|
1806
|
+
IGNORE_PROPS_PARAMS = ["update", "__element"];
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
|
|
1810
|
+
// ../refactor/domql/packages/tree/dist/cjs/root.js
|
|
1811
|
+
var require_root = __commonJS({
|
|
1812
|
+
"../refactor/domql/packages/tree/dist/cjs/root.js"(exports, module2) {
|
|
1813
|
+
"use strict";
|
|
1814
|
+
var __defProp14 = Object.defineProperty;
|
|
1815
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1816
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1817
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1818
|
+
var __export11 = (target, all) => {
|
|
1819
|
+
for (var name in all)
|
|
1820
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1821
|
+
};
|
|
1822
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1823
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1824
|
+
for (let key of __getOwnPropNames14(from))
|
|
1825
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1826
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1827
|
+
}
|
|
1828
|
+
return to;
|
|
1829
|
+
};
|
|
1830
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1831
|
+
var root_exports = {};
|
|
1832
|
+
__export11(root_exports, {
|
|
1833
|
+
ROOT: () => ROOT
|
|
1834
|
+
});
|
|
1835
|
+
module2.exports = __toCommonJS14(root_exports);
|
|
1836
|
+
var import_globals = (init_cjs3(), __toCommonJS(cjs_exports3));
|
|
1837
|
+
var import_report = (init_cjs4(), __toCommonJS(cjs_exports4));
|
|
1838
|
+
var ROOT = {
|
|
1839
|
+
key: ":root",
|
|
1840
|
+
node: import_globals.document ? import_globals.document.body : (0, import_report.report)("DocumentNotDefined", import_globals.document)
|
|
1841
|
+
};
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1844
|
+
|
|
1845
|
+
// ../refactor/domql/packages/tree/dist/cjs/index.js
|
|
1846
|
+
var require_cjs4 = __commonJS({
|
|
1847
|
+
"../refactor/domql/packages/tree/dist/cjs/index.js"(exports, module2) {
|
|
1848
|
+
"use strict";
|
|
1849
|
+
var __defProp14 = Object.defineProperty;
|
|
1850
|
+
var __getOwnPropDesc14 = Object.getOwnPropertyDescriptor;
|
|
1851
|
+
var __getOwnPropNames14 = Object.getOwnPropertyNames;
|
|
1852
|
+
var __hasOwnProp14 = Object.prototype.hasOwnProperty;
|
|
1853
|
+
var __export11 = (target, all) => {
|
|
1854
|
+
for (var name in all)
|
|
1855
|
+
__defProp14(target, name, { get: all[name], enumerable: true });
|
|
1856
|
+
};
|
|
1857
|
+
var __copyProps14 = (to, from, except, desc) => {
|
|
1858
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1859
|
+
for (let key of __getOwnPropNames14(from))
|
|
1860
|
+
if (!__hasOwnProp14.call(to, key) && key !== except)
|
|
1861
|
+
__defProp14(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc14(from, key)) || desc.enumerable });
|
|
1862
|
+
}
|
|
1863
|
+
return to;
|
|
1864
|
+
};
|
|
1865
|
+
var __toCommonJS14 = (mod) => __copyProps14(__defProp14({}, "__esModule", { value: true }), mod);
|
|
1866
|
+
var tree_exports = {};
|
|
1867
|
+
__export11(tree_exports, {
|
|
1868
|
+
ROOT: () => import_root2.ROOT,
|
|
1869
|
+
TREE: () => TREE
|
|
1870
|
+
});
|
|
1871
|
+
module2.exports = __toCommonJS14(tree_exports);
|
|
1872
|
+
var import_root = require_root();
|
|
1873
|
+
var import_root2 = require_root();
|
|
1874
|
+
var TREE = import_root.ROOT;
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
|
|
1878
|
+
// ../refactor/domql/packages/registry/dist/cjs/methods.js
|
|
1879
|
+
var methods_exports = {};
|
|
1880
|
+
var __defProp9, __getOwnPropDesc9, __getOwnPropNames9, __hasOwnProp9, __export7, __copyProps9, __toCommonJS9, methods_exports2, import_utils2, DEFAULT_METHODS;
|
|
1881
|
+
var init_methods = __esm({
|
|
1882
|
+
"../refactor/domql/packages/registry/dist/cjs/methods.js"() {
|
|
1883
|
+
"use strict";
|
|
1884
|
+
__defProp9 = Object.defineProperty;
|
|
1885
|
+
__getOwnPropDesc9 = Object.getOwnPropertyDescriptor;
|
|
1886
|
+
__getOwnPropNames9 = Object.getOwnPropertyNames;
|
|
1887
|
+
__hasOwnProp9 = Object.prototype.hasOwnProperty;
|
|
1888
|
+
__export7 = (target, all) => {
|
|
1889
|
+
for (var name in all)
|
|
1890
|
+
__defProp9(target, name, { get: all[name], enumerable: true });
|
|
1891
|
+
};
|
|
1892
|
+
__copyProps9 = (to, from, except, desc) => {
|
|
1893
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1894
|
+
for (let key of __getOwnPropNames9(from))
|
|
1895
|
+
if (!__hasOwnProp9.call(to, key) && key !== except)
|
|
1896
|
+
__defProp9(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc9(from, key)) || desc.enumerable });
|
|
1897
|
+
}
|
|
1898
|
+
return to;
|
|
1899
|
+
};
|
|
1900
|
+
__toCommonJS9 = (mod) => __copyProps9(__defProp9({}, "__esModule", { value: true }), mod);
|
|
1901
|
+
methods_exports2 = {};
|
|
1902
|
+
__export7(methods_exports2, {
|
|
1903
|
+
DEFAULT_METHODS: () => DEFAULT_METHODS
|
|
1904
|
+
});
|
|
1905
|
+
module.exports = __toCommonJS9(methods_exports2);
|
|
1906
|
+
import_utils2 = require_cjs();
|
|
1907
|
+
DEFAULT_METHODS = {
|
|
1908
|
+
key: {},
|
|
1909
|
+
tag: {},
|
|
1910
|
+
if: {},
|
|
1911
|
+
define: {},
|
|
1286
1912
|
attr: {},
|
|
1287
1913
|
style: {},
|
|
1288
1914
|
content: {},
|
|
@@ -1295,10 +1921,10 @@ var require_methods = __commonJS({
|
|
|
1295
1921
|
ref: {},
|
|
1296
1922
|
extend: {},
|
|
1297
1923
|
childExtend: {},
|
|
1298
|
-
text: (element,
|
|
1924
|
+
text: (element, state) => {
|
|
1299
1925
|
element.ref.text = {
|
|
1300
1926
|
tag: "text",
|
|
1301
|
-
text: (0,
|
|
1927
|
+
text: (0, import_utils2.exec)(element.text, element, state)
|
|
1302
1928
|
};
|
|
1303
1929
|
},
|
|
1304
1930
|
innerHTML: {},
|
|
@@ -1310,32 +1936,34 @@ var require_methods = __commonJS({
|
|
|
1310
1936
|
});
|
|
1311
1937
|
|
|
1312
1938
|
// ../refactor/domql/packages/registry/dist/cjs/tags.js
|
|
1313
|
-
var
|
|
1314
|
-
|
|
1939
|
+
var tags_exports2 = {};
|
|
1940
|
+
var __defProp10, __getOwnPropDesc10, __getOwnPropNames10, __hasOwnProp10, __export8, __copyProps10, __toCommonJS10, tags_exports3, TAGS;
|
|
1941
|
+
var init_tags = __esm({
|
|
1942
|
+
"../refactor/domql/packages/registry/dist/cjs/tags.js"() {
|
|
1315
1943
|
"use strict";
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1944
|
+
__defProp10 = Object.defineProperty;
|
|
1945
|
+
__getOwnPropDesc10 = Object.getOwnPropertyDescriptor;
|
|
1946
|
+
__getOwnPropNames10 = Object.getOwnPropertyNames;
|
|
1947
|
+
__hasOwnProp10 = Object.prototype.hasOwnProperty;
|
|
1948
|
+
__export8 = (target, all) => {
|
|
1321
1949
|
for (var name in all)
|
|
1322
|
-
|
|
1950
|
+
__defProp10(target, name, { get: all[name], enumerable: true });
|
|
1323
1951
|
};
|
|
1324
|
-
|
|
1952
|
+
__copyProps10 = (to, from, except, desc) => {
|
|
1325
1953
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1326
|
-
for (let key of
|
|
1327
|
-
if (!
|
|
1328
|
-
|
|
1954
|
+
for (let key of __getOwnPropNames10(from))
|
|
1955
|
+
if (!__hasOwnProp10.call(to, key) && key !== except)
|
|
1956
|
+
__defProp10(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc10(from, key)) || desc.enumerable });
|
|
1329
1957
|
}
|
|
1330
1958
|
return to;
|
|
1331
1959
|
};
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
TAGS: () =>
|
|
1960
|
+
__toCommonJS10 = (mod) => __copyProps10(__defProp10({}, "__esModule", { value: true }), mod);
|
|
1961
|
+
tags_exports3 = {};
|
|
1962
|
+
__export8(tags_exports3, {
|
|
1963
|
+
TAGS: () => TAGS
|
|
1336
1964
|
});
|
|
1337
|
-
module.exports =
|
|
1338
|
-
|
|
1965
|
+
module.exports = __toCommonJS10(tags_exports3);
|
|
1966
|
+
TAGS = {
|
|
1339
1967
|
root: [
|
|
1340
1968
|
"body",
|
|
1341
1969
|
"html"
|
|
@@ -1474,1856 +2102,454 @@ var require_tags = __commonJS({
|
|
|
1474
2102
|
});
|
|
1475
2103
|
|
|
1476
2104
|
// ../refactor/domql/packages/registry/dist/cjs/index.js
|
|
1477
|
-
var
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1482
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1483
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1484
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1485
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1486
|
-
for (let key of __getOwnPropNames2(from))
|
|
1487
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1488
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1489
|
-
}
|
|
1490
|
-
return to;
|
|
1491
|
-
};
|
|
1492
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
|
|
1493
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1494
|
-
var registry_exports = {};
|
|
1495
|
-
module.exports = __toCommonJS2(registry_exports);
|
|
1496
|
-
__reExport(registry_exports, require_methods(), module.exports);
|
|
1497
|
-
__reExport(registry_exports, require_tags(), module.exports);
|
|
1498
|
-
}
|
|
1499
|
-
});
|
|
1500
|
-
|
|
1501
|
-
// ../refactor/domql/packages/render/dist/cjs/index.js
|
|
1502
|
-
var require_cjs9 = __commonJS({
|
|
1503
|
-
"../refactor/domql/packages/render/dist/cjs/index.js"(exports, module) {
|
|
2105
|
+
var cjs_exports5 = {};
|
|
2106
|
+
var __defProp11, __getOwnPropDesc11, __getOwnPropNames11, __hasOwnProp11, __copyProps11, __reExport2, __toCommonJS11, registry_exports;
|
|
2107
|
+
var init_cjs5 = __esm({
|
|
2108
|
+
"../refactor/domql/packages/registry/dist/cjs/index.js"() {
|
|
1504
2109
|
"use strict";
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
for (var name in all)
|
|
1511
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1512
|
-
};
|
|
1513
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
2110
|
+
__defProp11 = Object.defineProperty;
|
|
2111
|
+
__getOwnPropDesc11 = Object.getOwnPropertyDescriptor;
|
|
2112
|
+
__getOwnPropNames11 = Object.getOwnPropertyNames;
|
|
2113
|
+
__hasOwnProp11 = Object.prototype.hasOwnProperty;
|
|
2114
|
+
__copyProps11 = (to, from, except, desc) => {
|
|
1514
2115
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1515
|
-
for (let key of
|
|
1516
|
-
if (!
|
|
1517
|
-
|
|
2116
|
+
for (let key of __getOwnPropNames11(from))
|
|
2117
|
+
if (!__hasOwnProp11.call(to, key) && key !== except)
|
|
2118
|
+
__defProp11(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc11(from, key)) || desc.enumerable });
|
|
1518
2119
|
}
|
|
1519
2120
|
return to;
|
|
1520
2121
|
};
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
});
|
|
1528
|
-
module.exports = __toCommonJS2(render_exports);
|
|
1529
|
-
var appendNode2 = (node, parentNode) => {
|
|
1530
|
-
parentNode.appendChild(node);
|
|
1531
|
-
return node;
|
|
1532
|
-
};
|
|
1533
|
-
var insertNodeAfter = (node, siblingNode) => {
|
|
1534
|
-
siblingNode.parentNode.insertBefore(node, siblingNode.nextSibling);
|
|
1535
|
-
};
|
|
1536
|
-
var assignNode3 = (element, parent, key, insertAfter) => {
|
|
1537
|
-
parent[key || element.key] = element;
|
|
1538
|
-
if (element.tag !== "shadow") {
|
|
1539
|
-
(insertAfter ? insertNodeAfter : appendNode2)(element.node, parent.node);
|
|
1540
|
-
}
|
|
1541
|
-
return element;
|
|
1542
|
-
};
|
|
2122
|
+
__reExport2 = (target, mod, secondTarget) => (__copyProps11(target, mod, "default"), secondTarget && __copyProps11(secondTarget, mod, "default"));
|
|
2123
|
+
__toCommonJS11 = (mod) => __copyProps11(__defProp11({}, "__esModule", { value: true }), mod);
|
|
2124
|
+
registry_exports = {};
|
|
2125
|
+
module.exports = __toCommonJS11(registry_exports);
|
|
2126
|
+
__reExport2(registry_exports, (init_methods(), __toCommonJS(methods_exports)), module.exports);
|
|
2127
|
+
__reExport2(registry_exports, (init_tags(), __toCommonJS(tags_exports2)), module.exports);
|
|
1543
2128
|
}
|
|
1544
2129
|
});
|
|
1545
2130
|
|
|
1546
2131
|
// ../refactor/domql/packages/env/dist/cjs/index.js
|
|
1547
|
-
var
|
|
1548
|
-
|
|
2132
|
+
var cjs_exports6 = {};
|
|
2133
|
+
var __defProp12, __getOwnPropDesc12, __getOwnPropNames12, __hasOwnProp12, __export9, __copyProps12, __toCommonJS12, env_exports, NODE_ENV, isProduction, isTest, isDevelopment, getNev;
|
|
2134
|
+
var init_cjs6 = __esm({
|
|
2135
|
+
"../refactor/domql/packages/env/dist/cjs/index.js"() {
|
|
1549
2136
|
"use strict";
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
2137
|
+
__defProp12 = Object.defineProperty;
|
|
2138
|
+
__getOwnPropDesc12 = Object.getOwnPropertyDescriptor;
|
|
2139
|
+
__getOwnPropNames12 = Object.getOwnPropertyNames;
|
|
2140
|
+
__hasOwnProp12 = Object.prototype.hasOwnProperty;
|
|
2141
|
+
__export9 = (target, all) => {
|
|
1555
2142
|
for (var name in all)
|
|
1556
|
-
|
|
2143
|
+
__defProp12(target, name, { get: all[name], enumerable: true });
|
|
1557
2144
|
};
|
|
1558
|
-
|
|
2145
|
+
__copyProps12 = (to, from, except, desc) => {
|
|
1559
2146
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1560
|
-
for (let key of
|
|
1561
|
-
if (!
|
|
1562
|
-
|
|
2147
|
+
for (let key of __getOwnPropNames12(from))
|
|
2148
|
+
if (!__hasOwnProp12.call(to, key) && key !== except)
|
|
2149
|
+
__defProp12(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc12(from, key)) || desc.enumerable });
|
|
1563
2150
|
}
|
|
1564
2151
|
return to;
|
|
1565
2152
|
};
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
2153
|
+
__toCommonJS12 = (mod) => __copyProps12(__defProp12({}, "__esModule", { value: true }), mod);
|
|
2154
|
+
env_exports = {};
|
|
2155
|
+
__export9(env_exports, {
|
|
1569
2156
|
NODE_ENV: () => NODE_ENV,
|
|
1570
2157
|
getNev: () => getNev,
|
|
1571
2158
|
isDevelopment: () => isDevelopment,
|
|
1572
2159
|
isProduction: () => isProduction,
|
|
1573
2160
|
isTest: () => isTest
|
|
1574
2161
|
});
|
|
1575
|
-
module.exports =
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
2162
|
+
module.exports = __toCommonJS12(env_exports);
|
|
2163
|
+
NODE_ENV = "development";
|
|
2164
|
+
isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
2165
|
+
isTest = (env = NODE_ENV) => env === "test";
|
|
2166
|
+
isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
2167
|
+
getNev = (key, env = NODE_ENV) => env[key];
|
|
1581
2168
|
}
|
|
1582
2169
|
});
|
|
1583
2170
|
|
|
1584
|
-
//
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
var methods_exports = {};
|
|
1606
|
-
__export2(methods_exports, {
|
|
1607
|
-
METHODS: () => METHODS2,
|
|
1608
|
-
defineSetter: () => defineSetter,
|
|
1609
|
-
get: () => get2,
|
|
1610
|
-
isMethod: () => isMethod6,
|
|
1611
|
-
keys: () => keys2,
|
|
1612
|
-
log: () => log2,
|
|
1613
|
-
lookup: () => lookup3,
|
|
1614
|
-
parse: () => parse3,
|
|
1615
|
-
parseDeep: () => parseDeep2,
|
|
1616
|
-
remove: () => remove4,
|
|
1617
|
-
setProps: () => setProps2,
|
|
1618
|
-
spotByPath: () => spotByPath2
|
|
1619
|
-
});
|
|
1620
|
-
module.exports = __toCommonJS2(methods_exports);
|
|
1621
|
-
var import_tree4 = require_cjs7();
|
|
1622
|
-
var import_utils40 = require_cjs4();
|
|
1623
|
-
var import_registry4 = require_cjs8();
|
|
1624
|
-
var import_env = require_cjs10();
|
|
1625
|
-
var spotByPath2 = function(path) {
|
|
1626
|
-
const element = this;
|
|
1627
|
-
const arr = [].concat(path);
|
|
1628
|
-
let active = import_tree4.TREE[arr[0]];
|
|
1629
|
-
if (!arr || !arr.length)
|
|
1630
|
-
return console.log(arr, "on", element.key, "is undefined");
|
|
1631
|
-
while (active.key === arr[0]) {
|
|
1632
|
-
arr.shift();
|
|
1633
|
-
if (!arr.length)
|
|
1634
|
-
break;
|
|
1635
|
-
active = active[arr[0]];
|
|
1636
|
-
if (!active)
|
|
1637
|
-
return;
|
|
1638
|
-
}
|
|
1639
|
-
return active;
|
|
1640
|
-
};
|
|
1641
|
-
var lookup3 = function(key) {
|
|
1642
|
-
const element = this;
|
|
1643
|
-
let { parent } = element;
|
|
1644
|
-
while (parent.key !== key) {
|
|
1645
|
-
if (parent[key])
|
|
1646
|
-
return parent[key];
|
|
1647
|
-
parent = parent.parent;
|
|
1648
|
-
if (!parent)
|
|
1649
|
-
return;
|
|
1650
|
-
}
|
|
1651
|
-
return parent;
|
|
1652
|
-
};
|
|
1653
|
-
var remove4 = function(params) {
|
|
1654
|
-
const element = this;
|
|
1655
|
-
if ((0, import_utils40.isFunction)(element.node.remove))
|
|
1656
|
-
element.node.remove();
|
|
1657
|
-
else if (!(0, import_env.isProduction)()) {
|
|
1658
|
-
console.warn("This item cant be removed");
|
|
1659
|
-
element.log();
|
|
1660
|
-
}
|
|
1661
|
-
delete element.parent[element.key];
|
|
1662
|
-
};
|
|
1663
|
-
var get2 = function(param) {
|
|
1664
|
-
const element = this;
|
|
1665
|
-
return element[param];
|
|
1666
|
-
};
|
|
1667
|
-
var setProps2 = function(param, options) {
|
|
1668
|
-
const element = this;
|
|
1669
|
-
if (!param || !element.props)
|
|
1670
|
-
return;
|
|
1671
|
-
element.update({ props: param }, options);
|
|
1672
|
-
return element;
|
|
1673
|
-
};
|
|
1674
|
-
var defineSetter = (element, key, get22, set2) => Object.defineProperty(element, key, { get: get22, set: set2 });
|
|
1675
|
-
var keys2 = function() {
|
|
1676
|
-
const element = this;
|
|
1677
|
-
const keys22 = [];
|
|
1678
|
-
for (const param in element) {
|
|
1679
|
-
if (!(0, import_utils40.isObject)(import_registry4.DEFAULT_METHODS[param])) {
|
|
1680
|
-
keys22.push(param);
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
return keys22;
|
|
1684
|
-
};
|
|
1685
|
-
var parse3 = function() {
|
|
1686
|
-
const element = this;
|
|
1687
|
-
const obj = {};
|
|
1688
|
-
const keys22 = element.keys();
|
|
1689
|
-
keys22.forEach((v) => obj[v] = element[v]);
|
|
1690
|
-
return obj;
|
|
1691
|
-
};
|
|
1692
|
-
var parseDeep2 = function(param) {
|
|
1693
|
-
const element = this;
|
|
1694
|
-
const orig = param || element;
|
|
1695
|
-
const obj = {};
|
|
1696
|
-
const keys22 = orig.keys && orig.keys();
|
|
1697
|
-
if (!keys22)
|
|
1698
|
-
return;
|
|
1699
|
-
keys22.forEach((v) => {
|
|
1700
|
-
const prop = orig[v];
|
|
1701
|
-
if ((0, import_utils40.isObjectLike)(prop))
|
|
1702
|
-
parseDeep2(prop);
|
|
1703
|
-
else
|
|
1704
|
-
obj[v] = prop;
|
|
1705
|
-
});
|
|
1706
|
-
return obj;
|
|
1707
|
-
};
|
|
1708
|
-
var log2 = function(...args) {
|
|
1709
|
-
const element = this;
|
|
1710
|
-
console.group(element.key);
|
|
1711
|
-
if (args.length) {
|
|
1712
|
-
args.forEach((v) => console.log(`%c${v}:
|
|
1713
|
-
`, "font-weight: bold", element[v]));
|
|
1714
|
-
} else {
|
|
1715
|
-
console.log(element.path);
|
|
1716
|
-
const keys22 = element.keys();
|
|
1717
|
-
keys22.forEach((v) => console.log(`%c${v}:
|
|
1718
|
-
`, "font-weight: bold", element[v]));
|
|
1719
|
-
}
|
|
1720
|
-
console.groupEnd(element.key);
|
|
1721
|
-
return element;
|
|
1722
|
-
};
|
|
1723
|
-
var METHODS2 = [
|
|
1724
|
-
"set",
|
|
1725
|
-
"update",
|
|
1726
|
-
"remove",
|
|
1727
|
-
"removeContent",
|
|
1728
|
-
"lookup",
|
|
1729
|
-
"spotByPath",
|
|
1730
|
-
"keys",
|
|
1731
|
-
"parse",
|
|
1732
|
-
"setProps",
|
|
1733
|
-
"parseDeep",
|
|
1734
|
-
"if",
|
|
1735
|
-
"log",
|
|
1736
|
-
"nextElement",
|
|
1737
|
-
"previousElement"
|
|
1738
|
-
];
|
|
1739
|
-
var isMethod6 = function(param) {
|
|
1740
|
-
return METHODS2.includes(param);
|
|
1741
|
-
};
|
|
2171
|
+
// src/element/iterate.js
|
|
2172
|
+
var import_utils7 = __toESM(require_cjs());
|
|
2173
|
+
|
|
2174
|
+
// src/element/utils/object.js
|
|
2175
|
+
var import_utils4 = __toESM(require_cjs());
|
|
2176
|
+
var import_state = __toESM(require_cjs3());
|
|
2177
|
+
|
|
2178
|
+
// ../refactor/domql/packages/props/dist/cjs/index.js
|
|
2179
|
+
var __defProp8 = Object.defineProperty;
|
|
2180
|
+
var __getOwnPropDesc8 = Object.getOwnPropertyDescriptor;
|
|
2181
|
+
var __getOwnPropNames8 = Object.getOwnPropertyNames;
|
|
2182
|
+
var __hasOwnProp8 = Object.prototype.hasOwnProperty;
|
|
2183
|
+
var __export6 = (target, all) => {
|
|
2184
|
+
for (var name in all)
|
|
2185
|
+
__defProp8(target, name, { get: all[name], enumerable: true });
|
|
2186
|
+
};
|
|
2187
|
+
var __copyProps8 = (to, from, except, desc) => {
|
|
2188
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2189
|
+
for (let key of __getOwnPropNames8(from))
|
|
2190
|
+
if (!__hasOwnProp8.call(to, key) && key !== except)
|
|
2191
|
+
__defProp8(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc8(from, key)) || desc.enumerable });
|
|
1742
2192
|
}
|
|
2193
|
+
return to;
|
|
2194
|
+
};
|
|
2195
|
+
var __toCommonJS8 = (mod) => __copyProps8(__defProp8({}, "__esModule", { value: true }), mod);
|
|
2196
|
+
var props_exports = {};
|
|
2197
|
+
__export6(props_exports, {
|
|
2198
|
+
IGNORE_PROPS_PARAMS: () => import_ignore.IGNORE_PROPS_PARAMS,
|
|
2199
|
+
createProps: () => createProps,
|
|
2200
|
+
syncProps: () => syncProps,
|
|
2201
|
+
updateProps: () => updateProps
|
|
1743
2202
|
});
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
var
|
|
1747
|
-
var
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
2203
|
+
module.exports = __toCommonJS8(props_exports);
|
|
2204
|
+
var import_utils = require_cjs();
|
|
2205
|
+
var import_ignore = (init_ignore(), __toCommonJS(ignore_exports));
|
|
2206
|
+
var objectizeStringProperty = (propValue) => {
|
|
2207
|
+
if ((0, import_utils.is)(propValue)("string", "number"))
|
|
2208
|
+
return { inheritedString: propValue };
|
|
2209
|
+
return propValue;
|
|
2210
|
+
};
|
|
2211
|
+
var inheritParentProps = (element, parent) => {
|
|
2212
|
+
let propsStack = [];
|
|
2213
|
+
const parentProps = (0, import_utils.exec)(parent, parent.state).props;
|
|
2214
|
+
const matchParent = parent.props && parentProps[element.key];
|
|
2215
|
+
const matchParentIsString = (0, import_utils.isString)(matchParent);
|
|
2216
|
+
const matchParentChildProps = parentProps && parentProps.childProps;
|
|
2217
|
+
if (matchParent) {
|
|
2218
|
+
if (matchParentIsString) {
|
|
2219
|
+
const inheritedStringExists = propsStack.filter((v) => v.inheritedString)[0];
|
|
2220
|
+
if (inheritedStringExists)
|
|
2221
|
+
inheritedStringExists.inheritedString = matchParent;
|
|
2222
|
+
else {
|
|
2223
|
+
propsStack = [].concat(objectizeStringProperty(matchParent), propsStack);
|
|
2224
|
+
}
|
|
2225
|
+
} else {
|
|
2226
|
+
propsStack.push(objectizeStringProperty(matchParent));
|
|
2227
|
+
}
|
|
1765
2228
|
}
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
var
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
};
|
|
1786
|
-
}
|
|
1787
|
-
});
|
|
1788
|
-
|
|
1789
|
-
// ../refactor/domql/packages/mixins/html.js
|
|
1790
|
-
var import_utils4, html;
|
|
1791
|
-
var init_html = __esm({
|
|
1792
|
-
"../refactor/domql/packages/mixins/html.js"() {
|
|
1793
|
-
"use strict";
|
|
1794
|
-
import_utils4 = __toESM(require_cjs4());
|
|
1795
|
-
html = (param, element, node) => {
|
|
1796
|
-
const prop = (0, import_utils4.exec)(param, element);
|
|
1797
|
-
const { __ref } = element;
|
|
1798
|
-
if (prop !== __ref.__html) {
|
|
1799
|
-
if (node.nodeName === "SVG")
|
|
1800
|
-
node.textContent = prop;
|
|
1801
|
-
else
|
|
1802
|
-
node.innerHTML = prop;
|
|
1803
|
-
__ref.__html = prop;
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
}
|
|
1807
|
-
});
|
|
1808
|
-
|
|
1809
|
-
// ../refactor/domql/packages/mixins/style.js
|
|
1810
|
-
var import_utils5, import_report3, style;
|
|
1811
|
-
var init_style = __esm({
|
|
1812
|
-
"../refactor/domql/packages/mixins/style.js"() {
|
|
1813
|
-
"use strict";
|
|
1814
|
-
import_utils5 = __toESM(require_cjs4());
|
|
1815
|
-
import_report3 = __toESM(require_cjs5());
|
|
1816
|
-
style = (params, element, node) => {
|
|
1817
|
-
if (params) {
|
|
1818
|
-
if ((0, import_utils5.isObject)(params))
|
|
1819
|
-
(0, import_utils5.map)(node.style, params, element);
|
|
1820
|
-
else
|
|
1821
|
-
(0, import_report3.report)("HTMLInvalidStyles", params);
|
|
1822
|
-
}
|
|
1823
|
-
};
|
|
1824
|
-
}
|
|
1825
|
-
});
|
|
1826
|
-
|
|
1827
|
-
// ../refactor/domql/packages/state/ignore.js
|
|
1828
|
-
var IGNORE_STATE_PARAMS2;
|
|
1829
|
-
var init_ignore = __esm({
|
|
1830
|
-
"../refactor/domql/packages/state/ignore.js"() {
|
|
1831
|
-
"use strict";
|
|
1832
|
-
IGNORE_STATE_PARAMS2 = [
|
|
1833
|
-
"update",
|
|
1834
|
-
"parse",
|
|
1835
|
-
"clean",
|
|
1836
|
-
"create",
|
|
1837
|
-
"destroy",
|
|
1838
|
-
"remove",
|
|
1839
|
-
"apply",
|
|
1840
|
-
"rootUpdate",
|
|
1841
|
-
"parent",
|
|
1842
|
-
"__element",
|
|
1843
|
-
"__depends",
|
|
1844
|
-
"__ref",
|
|
1845
|
-
"__children",
|
|
1846
|
-
"__root"
|
|
1847
|
-
];
|
|
1848
|
-
}
|
|
1849
|
-
});
|
|
1850
|
-
|
|
1851
|
-
// ../refactor/domql/packages/state/index.js
|
|
1852
|
-
var import_event, import_utils6, parse, clean, destroy, rootUpdate, updateState, remove, apply, getParentStateInKey, getChildStateInKey, createInheritedState, createState, applyMethods;
|
|
1853
|
-
var init_state = __esm({
|
|
1854
|
-
"../refactor/domql/packages/state/index.js"() {
|
|
1855
|
-
"use strict";
|
|
1856
|
-
init_ignore();
|
|
1857
|
-
import_event = __toESM(require_cjs6());
|
|
1858
|
-
import_utils6 = __toESM(require_cjs4());
|
|
1859
|
-
parse = function() {
|
|
1860
|
-
const state2 = this;
|
|
1861
|
-
if ((0, import_utils6.isObject)(state2)) {
|
|
1862
|
-
const obj = {};
|
|
1863
|
-
for (const param in state2) {
|
|
1864
|
-
if (!IGNORE_STATE_PARAMS2.includes(param)) {
|
|
1865
|
-
obj[param] = state2[param];
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
return obj;
|
|
1869
|
-
} else if ((0, import_utils6.isArray)(state2)) {
|
|
1870
|
-
return state2.filter((item) => !IGNORE_STATE_PARAMS2.includes(item));
|
|
1871
|
-
}
|
|
1872
|
-
};
|
|
1873
|
-
clean = function(options = {}) {
|
|
1874
|
-
const state2 = this;
|
|
1875
|
-
for (const param in state2) {
|
|
1876
|
-
if (!IGNORE_STATE_PARAMS2.includes(param)) {
|
|
1877
|
-
delete state2[param];
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
state2.update(state2, { skipOverwrite: true, options });
|
|
1881
|
-
return state2;
|
|
1882
|
-
};
|
|
1883
|
-
destroy = function() {
|
|
1884
|
-
const state2 = this;
|
|
1885
|
-
const element = state2.__element;
|
|
1886
|
-
delete element.state;
|
|
1887
|
-
element.state = state2.parent;
|
|
1888
|
-
if (state2.parent) {
|
|
1889
|
-
delete state2.parent.__children[element.key];
|
|
1890
|
-
}
|
|
1891
|
-
if (state2.__children) {
|
|
1892
|
-
for (const key in state2.__children) {
|
|
1893
|
-
const child = state2.__children[key];
|
|
1894
|
-
if (child.state) {
|
|
1895
|
-
child.parent = state2.parent;
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
element.state.update();
|
|
1900
|
-
return element.state;
|
|
1901
|
-
};
|
|
1902
|
-
rootUpdate = function(obj, options = {}) {
|
|
1903
|
-
const state2 = this;
|
|
1904
|
-
if (!state2)
|
|
1905
|
-
return;
|
|
1906
|
-
const rootState = state2.__element.__ref.__root.state;
|
|
1907
|
-
return rootState.update(obj, options);
|
|
1908
|
-
};
|
|
1909
|
-
updateState = function(obj, options = {}) {
|
|
1910
|
-
const state2 = this;
|
|
1911
|
-
const element = state2.__element;
|
|
1912
|
-
const __elementRef = element.__ref;
|
|
1913
|
-
const parentState = element.parent.state;
|
|
1914
|
-
state2.parent = parentState;
|
|
1915
|
-
for (const param in state2) {
|
|
1916
|
-
if ((0, import_utils6.isUndefined)(state2[param])) {
|
|
1917
|
-
delete state2[param];
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
if (!state2.__element) {
|
|
1921
|
-
create(element, element.parent);
|
|
1922
|
-
}
|
|
1923
|
-
const initStateUpdateReturns = (0, import_event.triggerEventOn)("initStateUpdated", element, obj);
|
|
1924
|
-
if (initStateUpdateReturns === false)
|
|
1925
|
-
return element;
|
|
1926
|
-
if (!options.skipOverwrite) {
|
|
1927
|
-
if (options.shallow) {
|
|
1928
|
-
(0, import_utils6.overwriteShallow)(state2, obj, IGNORE_STATE_PARAMS2);
|
|
1929
|
-
} else {
|
|
1930
|
-
(0, import_utils6.overwriteDeep)(state2, obj, IGNORE_STATE_PARAMS2);
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
const stateKey = __elementRef.__state;
|
|
1934
|
-
const shouldPropagateState = stateKey && parentState && parentState[stateKey] && !options.stopStatePropagation;
|
|
1935
|
-
if (shouldPropagateState) {
|
|
1936
|
-
const isStringState = __elementRef.__stateType === "string";
|
|
1937
|
-
const value = isStringState ? state2.value : state2.parse();
|
|
1938
|
-
parentState[stateKey] = value;
|
|
1939
|
-
parentState.update(value, { skipOverwrite: true, ...options });
|
|
1940
|
-
return state2;
|
|
1941
|
-
}
|
|
1942
|
-
if (!options.preventUpdate) {
|
|
1943
|
-
element.update({}, options);
|
|
1944
|
-
} else if (options.preventUpdate === "recursive") {
|
|
1945
|
-
element.update({}, { ...options, preventUpdate: true });
|
|
1946
|
-
}
|
|
1947
|
-
if (state2.__depends) {
|
|
1948
|
-
for (const el in state2.__depends) {
|
|
1949
|
-
const findElement = state2.__depends[el];
|
|
1950
|
-
findElement.clean().update(state2.parse(), options);
|
|
1951
|
-
}
|
|
1952
|
-
}
|
|
1953
|
-
if (!options.preventUpdateListener) {
|
|
1954
|
-
(0, import_event.triggerEventOn)("stateUpdated", element, obj);
|
|
1955
|
-
}
|
|
1956
|
-
return state2;
|
|
1957
|
-
};
|
|
1958
|
-
remove = function(key, options) {
|
|
1959
|
-
const state2 = this;
|
|
1960
|
-
if ((0, import_utils6.isArray)(state2))
|
|
1961
|
-
(0, import_utils6.removeFromArray)(state2, key);
|
|
1962
|
-
if ((0, import_utils6.isObject)(state2))
|
|
1963
|
-
(0, import_utils6.removeFromObject)(state2, key);
|
|
1964
|
-
return state2.update(state2, { skipOverwrite: true, options });
|
|
1965
|
-
};
|
|
1966
|
-
apply = function(func, options) {
|
|
1967
|
-
const state2 = this;
|
|
1968
|
-
if ((0, import_utils6.isFunction)(func)) {
|
|
1969
|
-
func(state2);
|
|
1970
|
-
return state2.update(state2, { skipOverwrite: true, options });
|
|
1971
|
-
}
|
|
1972
|
-
};
|
|
1973
|
-
getParentStateInKey = (stateKey, parentState) => {
|
|
1974
|
-
const arr = stateKey.split("../");
|
|
1975
|
-
const arrLength = arr.length - 1;
|
|
1976
|
-
for (let i = 0; i < arrLength; i++) {
|
|
1977
|
-
if (!parentState.parent)
|
|
1978
|
-
return null;
|
|
1979
|
-
parentState = parentState.parent;
|
|
1980
|
-
}
|
|
1981
|
-
return parentState;
|
|
1982
|
-
};
|
|
1983
|
-
getChildStateInKey = (stateKey, parentState) => {
|
|
1984
|
-
const arr = stateKey.split("/");
|
|
1985
|
-
const arrLength = arr.length - 1;
|
|
1986
|
-
for (let i = 0; i < arrLength; i++) {
|
|
1987
|
-
const childKey = arr[i];
|
|
1988
|
-
const grandChildKey = arr[i + 1];
|
|
1989
|
-
const childInParent = parentState[childKey];
|
|
1990
|
-
if (childInParent && childInParent[grandChildKey]) {
|
|
1991
|
-
stateKey = grandChildKey;
|
|
1992
|
-
parentState = childInParent;
|
|
1993
|
-
} else
|
|
1994
|
-
return;
|
|
1995
|
-
}
|
|
1996
|
-
return parentState[stateKey];
|
|
1997
|
-
};
|
|
1998
|
-
createInheritedState = function(element, parent) {
|
|
1999
|
-
const __elementRef = element.__ref;
|
|
2000
|
-
let stateKey = __elementRef.__state;
|
|
2001
|
-
if (!stateKey)
|
|
2002
|
-
return element.state;
|
|
2003
|
-
let parentState = parent.state;
|
|
2004
|
-
if (stateKey.includes("../")) {
|
|
2005
|
-
parentState = getParentStateInKey(stateKey, parent.state);
|
|
2006
|
-
stateKey = stateKey.replaceAll("../", "");
|
|
2007
|
-
}
|
|
2008
|
-
if (!parentState)
|
|
2009
|
-
return {};
|
|
2010
|
-
const keyInParentState = getChildStateInKey(stateKey, parentState);
|
|
2011
|
-
if (!keyInParentState)
|
|
2012
|
-
return {};
|
|
2013
|
-
if ((0, import_utils6.is)(keyInParentState)("object", "array")) {
|
|
2014
|
-
return (0, import_utils6.deepClone)(keyInParentState, IGNORE_STATE_PARAMS2);
|
|
2015
|
-
} else if ((0, import_utils6.is)(keyInParentState)("string", "number")) {
|
|
2016
|
-
__elementRef.__stateType = "string";
|
|
2017
|
-
return { value: keyInParentState };
|
|
2018
|
-
}
|
|
2019
|
-
console.warn(stateKey, "is not present. Replacing with", {});
|
|
2020
|
-
return {};
|
|
2021
|
-
};
|
|
2022
|
-
createState = function(element, parent, opts) {
|
|
2023
|
-
const skip = opts && opts.skip ? opts.skip : false;
|
|
2024
|
-
let { state: state2, __ref: __elementRef } = element;
|
|
2025
|
-
if ((0, import_utils6.isFunction)(state2))
|
|
2026
|
-
element.state = (0, import_utils6.exec)(state2, element);
|
|
2027
|
-
if ((0, import_utils6.is)(state2)("string", "number")) {
|
|
2028
|
-
__elementRef.__state = state2;
|
|
2029
|
-
element.state = {};
|
|
2030
|
-
}
|
|
2031
|
-
if (state2 === true) {
|
|
2032
|
-
__elementRef.__state = element.key;
|
|
2033
|
-
element.state = {};
|
|
2034
|
-
}
|
|
2035
|
-
(0, import_event.triggerEventOn)("stateInit", element);
|
|
2036
|
-
state2 = element.state = createInheritedState(element, parent);
|
|
2037
|
-
if (!state2) {
|
|
2038
|
-
if (parent && parent.state)
|
|
2039
|
-
return parent.state;
|
|
2040
|
-
return {};
|
|
2041
|
-
} else {
|
|
2042
|
-
__elementRef.__hasRootState = true;
|
|
2043
|
-
}
|
|
2044
|
-
const { __ref } = state2;
|
|
2045
|
-
if (__ref) {
|
|
2046
|
-
state2 = (0, import_utils6.deepClone)(__ref, IGNORE_STATE_PARAMS2);
|
|
2047
|
-
if ((0, import_utils6.isObject)(__ref.__depends)) {
|
|
2048
|
-
__ref.__depends[element.key] = state2;
|
|
2049
|
-
} else
|
|
2050
|
-
__ref.__depends = { [element.key]: state2 };
|
|
2051
|
-
} else {
|
|
2052
|
-
state2 = (0, import_utils6.deepClone)(state2, IGNORE_STATE_PARAMS2);
|
|
2053
|
-
}
|
|
2054
|
-
element.state = state2;
|
|
2055
|
-
if (skip)
|
|
2056
|
-
return state2;
|
|
2057
|
-
applyMethods(element, state2);
|
|
2058
|
-
(0, import_event.triggerEventOn)("stateCreated", element);
|
|
2059
|
-
return state2;
|
|
2060
|
-
};
|
|
2061
|
-
applyMethods = (element, state2) => {
|
|
2062
|
-
const __elementRef = element.__ref;
|
|
2063
|
-
state2.clean = clean;
|
|
2064
|
-
state2.parse = parse;
|
|
2065
|
-
state2.destroy = destroy;
|
|
2066
|
-
state2.update = updateState;
|
|
2067
|
-
state2.rootUpdate = rootUpdate;
|
|
2068
|
-
state2.create = createState;
|
|
2069
|
-
state2.remove = remove;
|
|
2070
|
-
state2.apply = apply;
|
|
2071
|
-
state2.parent = element.parent.state;
|
|
2072
|
-
state2.__element = element;
|
|
2073
|
-
state2.__children = {};
|
|
2074
|
-
state2.__root = __elementRef.__root ? __elementRef.__root.state : state2;
|
|
2075
|
-
if (state2.parent)
|
|
2076
|
-
state2.parent.__children[element.key] = state2;
|
|
2077
|
-
};
|
|
2078
|
-
}
|
|
2079
|
-
});
|
|
2080
|
-
|
|
2081
|
-
// ../refactor/domql/packages/props/index.js
|
|
2082
|
-
function update(props, options) {
|
|
2083
|
-
const element = this.__element;
|
|
2084
|
-
element.update({ props }, options);
|
|
2085
|
-
}
|
|
2086
|
-
var import_utils7, IGNORE_PROPS_PARAMS, objectizeStringProperty, inheritParentProps, createPropsStack, syncProps, createProps;
|
|
2087
|
-
var init_props = __esm({
|
|
2088
|
-
"../refactor/domql/packages/props/index.js"() {
|
|
2089
|
-
"use strict";
|
|
2090
|
-
import_utils7 = __toESM(require_cjs4());
|
|
2091
|
-
IGNORE_PROPS_PARAMS = ["update", "__element"];
|
|
2092
|
-
objectizeStringProperty = (propValue) => {
|
|
2093
|
-
if ((0, import_utils7.is)(propValue)("string", "number"))
|
|
2094
|
-
return { inheritedString: propValue };
|
|
2095
|
-
return propValue;
|
|
2096
|
-
};
|
|
2097
|
-
inheritParentProps = (element, parent) => {
|
|
2098
|
-
let propsStack = [];
|
|
2099
|
-
const parentProps = (0, import_utils7.exec)(parent, parent.state).props;
|
|
2100
|
-
const matchParent = parent.props && parentProps[element.key];
|
|
2101
|
-
const matchParentIsString = (0, import_utils7.isString)(matchParent);
|
|
2102
|
-
const matchParentChildProps = parentProps && parentProps.childProps;
|
|
2103
|
-
if (matchParent) {
|
|
2104
|
-
if (matchParentIsString) {
|
|
2105
|
-
const inheritedStringExists = propsStack.filter((v) => v.inheritedString)[0];
|
|
2106
|
-
if (inheritedStringExists)
|
|
2107
|
-
inheritedStringExists.inheritedString = matchParent;
|
|
2108
|
-
else {
|
|
2109
|
-
propsStack = [].concat(objectizeStringProperty(matchParent), propsStack);
|
|
2110
|
-
}
|
|
2111
|
-
} else {
|
|
2112
|
-
propsStack.push(objectizeStringProperty(matchParent));
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
if (matchParentChildProps)
|
|
2116
|
-
propsStack.push(matchParentChildProps);
|
|
2117
|
-
return propsStack;
|
|
2118
|
-
};
|
|
2119
|
-
createPropsStack = (element, parent) => {
|
|
2120
|
-
const { props, __ref } = element;
|
|
2121
|
-
const propsStack = __ref.__props = inheritParentProps(element, parent);
|
|
2122
|
-
if ((0, import_utils7.isObject)(props))
|
|
2123
|
-
propsStack.push(props);
|
|
2124
|
-
else if (props === "inherit" && parent.props)
|
|
2125
|
-
propsStack.push(parent.props);
|
|
2126
|
-
else if (props)
|
|
2127
|
-
propsStack.push(props);
|
|
2128
|
-
if ((0, import_utils7.isArray)(__ref.__extend)) {
|
|
2129
|
-
__ref.__extend.map((extend) => {
|
|
2130
|
-
if (extend.props)
|
|
2131
|
-
propsStack.push(extend.props);
|
|
2132
|
-
return extend.props;
|
|
2133
|
-
});
|
|
2134
|
-
}
|
|
2135
|
-
__ref.__props = propsStack;
|
|
2136
|
-
return propsStack;
|
|
2137
|
-
};
|
|
2138
|
-
syncProps = (props, element) => {
|
|
2139
|
-
element.props = {};
|
|
2140
|
-
const mergedProps = { update, __element: element };
|
|
2141
|
-
props.forEach((v) => {
|
|
2142
|
-
if (IGNORE_PROPS_PARAMS.includes(v))
|
|
2143
|
-
return;
|
|
2144
|
-
const execProps = (0, import_utils7.exec)(v, element);
|
|
2145
|
-
if ((0, import_utils7.isObject)(execProps) && execProps.__element)
|
|
2146
|
-
return;
|
|
2147
|
-
element.props = (0, import_utils7.deepMerge)(mergedProps, (0, import_utils7.deepClone)(execProps, IGNORE_PROPS_PARAMS), IGNORE_PROPS_PARAMS);
|
|
2148
|
-
});
|
|
2149
|
-
element.props = mergedProps;
|
|
2150
|
-
return element.props;
|
|
2151
|
-
};
|
|
2152
|
-
createProps = function(element, parent, cached) {
|
|
2153
|
-
const propsStack = cached || createPropsStack(element, parent);
|
|
2154
|
-
const { __ref } = element;
|
|
2155
|
-
if (propsStack.length) {
|
|
2156
|
-
__ref.__props = propsStack;
|
|
2157
|
-
syncProps(propsStack, element);
|
|
2158
|
-
element.props.update = update;
|
|
2159
|
-
}
|
|
2160
|
-
return element;
|
|
2161
|
-
};
|
|
2162
|
-
}
|
|
2163
|
-
});
|
|
2164
|
-
|
|
2165
|
-
// ../refactor/domql/packages/extends/extendUtils.js
|
|
2166
|
-
var import_utils8, generateHash, extendStackRegistry, getHashedExtend, setHashedExtend, getExtendStackRegistry, extractArrayExtend, deepExtend, flattenExtend, deepCloneExtend, deepMergeExtend, cloneAndMergeArrayExtend, jointStacks, getExtendStack;
|
|
2167
|
-
var init_extendUtils = __esm({
|
|
2168
|
-
"../refactor/domql/packages/extends/extendUtils.js"() {
|
|
2169
|
-
"use strict";
|
|
2170
|
-
import_utils8 = __toESM(require_cjs4());
|
|
2171
|
-
generateHash = () => Math.random().toString(36).substring(2);
|
|
2172
|
-
extendStackRegistry = {};
|
|
2173
|
-
getHashedExtend = (extend) => {
|
|
2174
|
-
return extendStackRegistry[extend.__hash];
|
|
2175
|
-
};
|
|
2176
|
-
setHashedExtend = (extend, stack) => {
|
|
2177
|
-
const hash = generateHash();
|
|
2178
|
-
extend.__hash = hash;
|
|
2179
|
-
extendStackRegistry[hash] = stack;
|
|
2180
|
-
return extendStackRegistry[hash];
|
|
2181
|
-
};
|
|
2182
|
-
getExtendStackRegistry = (extend, stack) => {
|
|
2183
|
-
if (extend.__hash) {
|
|
2184
|
-
return stack.concat(getHashedExtend(extend));
|
|
2185
|
-
} else {
|
|
2186
|
-
setHashedExtend(extend, stack);
|
|
2187
|
-
}
|
|
2188
|
-
return stack;
|
|
2189
|
-
};
|
|
2190
|
-
extractArrayExtend = (extend, stack) => {
|
|
2191
|
-
extend.forEach((each) => flattenExtend(each, stack));
|
|
2192
|
-
return stack;
|
|
2193
|
-
};
|
|
2194
|
-
deepExtend = (extend, stack) => {
|
|
2195
|
-
const extendOflattenExtend = extend.extends;
|
|
2196
|
-
if (extendOflattenExtend) {
|
|
2197
|
-
flattenExtend(extendOflattenExtend, stack);
|
|
2198
|
-
}
|
|
2199
|
-
return stack;
|
|
2200
|
-
};
|
|
2201
|
-
flattenExtend = (extend, stack) => {
|
|
2202
|
-
if (!extend)
|
|
2203
|
-
return stack;
|
|
2204
|
-
if ((0, import_utils8.isArray)(extend))
|
|
2205
|
-
return extractArrayExtend(extend, stack);
|
|
2206
|
-
stack.push(extend);
|
|
2207
|
-
if (extend.extends)
|
|
2208
|
-
deepExtend(extend, stack);
|
|
2209
|
-
return stack;
|
|
2210
|
-
};
|
|
2211
|
-
deepCloneExtend = (obj) => {
|
|
2212
|
-
const o = {};
|
|
2213
|
-
for (const prop in obj) {
|
|
2214
|
-
if (["ref"].indexOf(prop) > -1)
|
|
2215
|
-
continue;
|
|
2216
|
-
const objProp = obj[prop];
|
|
2217
|
-
if ((0, import_utils8.isObject)(objProp)) {
|
|
2218
|
-
o[prop] = deepCloneExtend(objProp);
|
|
2219
|
-
} else if ((0, import_utils8.isArray)(objProp)) {
|
|
2220
|
-
o[prop] = objProp.map((x) => x);
|
|
2221
|
-
} else
|
|
2222
|
-
o[prop] = objProp;
|
|
2223
|
-
}
|
|
2224
|
-
return o;
|
|
2225
|
-
};
|
|
2226
|
-
deepMergeExtend = (element, extend) => {
|
|
2227
|
-
for (const e2 in extend) {
|
|
2228
|
-
if (e2 === "ref")
|
|
2229
|
-
continue;
|
|
2230
|
-
const elementProp = element[e2];
|
|
2231
|
-
const extendProp = extend[e2];
|
|
2232
|
-
if (elementProp === void 0) {
|
|
2233
|
-
element[e2] = extendProp;
|
|
2234
|
-
} else if ((0, import_utils8.isObject)(elementProp) && (0, import_utils8.isObject)(extendProp)) {
|
|
2235
|
-
deepMergeExtend(elementProp, extendProp);
|
|
2236
|
-
} else if ((0, import_utils8.isArray)(elementProp) && (0, import_utils8.isArray)(extendProp)) {
|
|
2237
|
-
element[e2] = elementProp.concat(extendProp);
|
|
2238
|
-
} else if ((0, import_utils8.isArray)(elementProp) && (0, import_utils8.isObject)(extendProp)) {
|
|
2239
|
-
const obj = deepMergeExtend({}, elementProp);
|
|
2240
|
-
element[e2] = deepMergeExtend(obj, extendProp);
|
|
2241
|
-
} else if (elementProp === void 0 && (0, import_utils8.isFunction)(extendProp)) {
|
|
2242
|
-
element[e2] = extendProp;
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
return element;
|
|
2246
|
-
};
|
|
2247
|
-
cloneAndMergeArrayExtend = (stack) => {
|
|
2248
|
-
return stack.reduce((a, c) => {
|
|
2249
|
-
return deepMergeExtend(a, deepCloneExtend(c));
|
|
2250
|
-
}, {});
|
|
2251
|
-
};
|
|
2252
|
-
jointStacks = (extendStack, childExtendStack) => {
|
|
2253
|
-
return [].concat(extendStack.slice(0, 1)).concat(childExtendStack.slice(0, 1)).concat(extendStack.slice(1)).concat(childExtendStack.slice(1));
|
|
2254
|
-
};
|
|
2255
|
-
getExtendStack = (extend) => {
|
|
2256
|
-
if (!extend)
|
|
2257
|
-
return [];
|
|
2258
|
-
if (extend.__hash)
|
|
2259
|
-
return getHashedExtend(extend);
|
|
2260
|
-
const stack = flattenExtend(extend, []);
|
|
2261
|
-
return getExtendStackRegistry(extend, stack);
|
|
2262
|
-
};
|
|
2263
|
-
}
|
|
2264
|
-
});
|
|
2265
|
-
|
|
2266
|
-
// ../refactor/domql/packages/extends/index.js
|
|
2267
|
-
var import_utils9, ENV, extendElement;
|
|
2268
|
-
var init_extends = __esm({
|
|
2269
|
-
"../refactor/domql/packages/extends/index.js"() {
|
|
2270
|
-
"use strict";
|
|
2271
|
-
import_utils9 = __toESM(require_cjs4());
|
|
2272
|
-
init_extendUtils();
|
|
2273
|
-
ENV = "development";
|
|
2274
|
-
extendElement = (element, parent, options = {}) => {
|
|
2275
|
-
if ((0, import_utils9.isFunction)(element))
|
|
2276
|
-
element = (0, import_utils9.exec)(element, parent);
|
|
2277
|
-
const { extend: ext } = element;
|
|
2278
|
-
const extendStack = getExtendStack(ext);
|
|
2279
|
-
if (ENV !== "development")
|
|
2280
|
-
delete element.extends;
|
|
2281
|
-
let childExtendStack = [];
|
|
2282
|
-
if (!options.ignoreChildExtend) {
|
|
2283
|
-
childExtendStack = getExtendStack(parent.childExtends);
|
|
2284
|
-
}
|
|
2285
|
-
const extendLength = extendStack.length;
|
|
2286
|
-
const childExtendLength = childExtendStack.length;
|
|
2287
|
-
let stack = [];
|
|
2288
|
-
if (extendLength && childExtendLength) {
|
|
2289
|
-
stack = jointStacks(extendStack, childExtendStack);
|
|
2290
|
-
} else if (extendLength) {
|
|
2291
|
-
stack = extendStack;
|
|
2292
|
-
} else if (childExtendLength) {
|
|
2293
|
-
stack = childExtendStack;
|
|
2294
|
-
} else
|
|
2295
|
-
return element;
|
|
2296
|
-
if (options.extends) {
|
|
2297
|
-
const defaultOptionsExtend = getExtendStack(options.extends);
|
|
2298
|
-
stack = [].concat(defaultOptionsExtend, stack);
|
|
2299
|
-
}
|
|
2300
|
-
element.ref.extends = stack;
|
|
2301
|
-
const mergedExtend = cloneAndMergeArrayExtend(stack);
|
|
2302
|
-
delete mergedExtend.__hash;
|
|
2303
|
-
return deepMergeExtend(element, mergedExtend);
|
|
2304
|
-
};
|
|
2305
|
-
}
|
|
2306
|
-
});
|
|
2307
|
-
|
|
2308
|
-
// ../refactor/domql/packages/create/index.js
|
|
2309
|
-
var create_exports = {};
|
|
2310
|
-
__export(create_exports, {
|
|
2311
|
-
applyTransform: () => applyTransform,
|
|
2312
|
-
create: () => create2,
|
|
2313
|
-
onEach: () => onEach
|
|
2314
|
-
});
|
|
2315
|
-
var import_registry, import_tree, import_key, import_utils10, OPTIONS, init, assignKey, applyParent, applyState, applyExtends, applyTag, applyProps, applyAttr, onEachAvailable, onEach, applyTransform, addChildren, applyGlobalTransform, create2;
|
|
2316
|
-
var init_create = __esm({
|
|
2317
|
-
"../refactor/domql/packages/create/index.js"() {
|
|
2318
|
-
"use strict";
|
|
2319
|
-
import_registry = __toESM(require_cjs8());
|
|
2320
|
-
import_tree = __toESM(require_cjs7());
|
|
2321
|
-
import_key = __toESM(require_cjs());
|
|
2322
|
-
import_utils10 = __toESM(require_cjs4());
|
|
2323
|
-
init_state();
|
|
2324
|
-
init_props();
|
|
2325
|
-
init_extends();
|
|
2326
|
-
OPTIONS = {};
|
|
2327
|
-
init = (element, key, options, parent) => {
|
|
2328
|
-
const ref = {};
|
|
2329
|
-
if (!element)
|
|
2330
|
-
return { ref };
|
|
2331
|
-
if ((0, import_utils10.isString)(element) || (0, import_utils10.isNumber)(element)) {
|
|
2332
|
-
return {
|
|
2333
|
-
key,
|
|
2334
|
-
ref,
|
|
2335
|
-
tag: "string",
|
|
2336
|
-
text: element
|
|
2337
|
-
};
|
|
2338
|
-
} else if ((0, import_utils10.isArray)(element))
|
|
2339
|
-
return Object.assign({}, element);
|
|
2340
|
-
else if ((0, import_utils10.isObject)(element)) {
|
|
2341
|
-
const { extendLibrary } = options;
|
|
2342
|
-
const extendFromLibrary = (0, import_utils10.isString)(element.extends) && extendLibrary[element.extends];
|
|
2343
|
-
if (extendFromLibrary && extendLibrary) {
|
|
2344
|
-
element = {
|
|
2345
|
-
props: element,
|
|
2346
|
-
ref,
|
|
2347
|
-
extend: extendFromLibrary
|
|
2348
|
-
};
|
|
2349
|
-
}
|
|
2350
|
-
if (!element.ref)
|
|
2351
|
-
element.ref = ref;
|
|
2352
|
-
if (element.on && element.on.init)
|
|
2353
|
-
element.on.init(element, element.state);
|
|
2354
|
-
return element;
|
|
2355
|
-
} else if ((0, import_utils10.isFunction)(element))
|
|
2356
|
-
return { ref, ...(0, import_utils10.exec)(parent, parent.ref.state) };
|
|
2357
|
-
return element;
|
|
2358
|
-
};
|
|
2359
|
-
assignKey = (element, key) => {
|
|
2360
|
-
if (element.key)
|
|
2361
|
-
return element;
|
|
2362
|
-
element.key = key || import_key.createKey.next().value;
|
|
2363
|
-
return element;
|
|
2364
|
-
};
|
|
2365
|
-
applyParent = (element, key) => {
|
|
2366
|
-
const { ref } = element;
|
|
2367
|
-
const { parent } = ref;
|
|
2368
|
-
if ((0, import_utils10.isNode)(parent)) {
|
|
2369
|
-
ref.parent = import_tree.ROOT.ref.parent = { node: parent };
|
|
2370
|
-
}
|
|
2371
|
-
if (!parent)
|
|
2372
|
-
ref.parent = import_tree.ROOT;
|
|
2373
|
-
return element;
|
|
2374
|
-
};
|
|
2375
|
-
applyState = (element, key) => {
|
|
2376
|
-
const { ref } = element;
|
|
2377
|
-
ref.state = createState(element, element.ref.parent);
|
|
2378
|
-
return element;
|
|
2379
|
-
};
|
|
2380
|
-
applyExtends = (element, key, options) => {
|
|
2381
|
-
extendElement(element, element.ref.parent, options);
|
|
2382
|
-
return element;
|
|
2383
|
-
};
|
|
2384
|
-
applyTag = (element, key) => {
|
|
2385
|
-
if (element.tag) {
|
|
2386
|
-
element.ref.tag = element.tag;
|
|
2387
|
-
return element;
|
|
2388
|
-
}
|
|
2389
|
-
const keyIsTag = import_registry.TAGS.body.indexOf(key) > -1;
|
|
2390
|
-
element.tag = element.ref.tag = keyIsTag ? key : "div";
|
|
2391
|
-
return element;
|
|
2392
|
-
};
|
|
2393
|
-
applyProps = (element, key) => {
|
|
2394
|
-
const { ref } = element;
|
|
2395
|
-
ref.props = createProps(element, ref.parent);
|
|
2396
|
-
return element;
|
|
2397
|
-
};
|
|
2398
|
-
applyAttr = (element, key) => {
|
|
2399
|
-
if (!(0, import_utils10.isObject)(element.attr))
|
|
2400
|
-
return element;
|
|
2401
|
-
const { ref } = element;
|
|
2402
|
-
if (!ref.attr)
|
|
2403
|
-
ref.attr = {};
|
|
2404
|
-
for (const attrKey in element.attr) {
|
|
2405
|
-
ref.attr[attrKey] = (0, import_utils10.exec)(element.attr[attrKey], element, element.state);
|
|
2406
|
-
}
|
|
2407
|
-
return element;
|
|
2408
|
-
};
|
|
2409
|
-
onEachAvailable = (element, key, options) => {
|
|
2410
|
-
const { ref } = element;
|
|
2411
|
-
const value = element[key];
|
|
2412
|
-
let { children, childrenKeys } = ref;
|
|
2413
|
-
if (!children)
|
|
2414
|
-
children = ref.children = [];
|
|
2415
|
-
if (!childrenKeys)
|
|
2416
|
-
childrenKeys = ref.childrenKeys = [];
|
|
2417
|
-
children.push(value);
|
|
2418
|
-
childrenKeys.push(key);
|
|
2419
|
-
const useOption = options[onEachAvailable];
|
|
2420
|
-
if (useOption)
|
|
2421
|
-
useOption(element, key);
|
|
2422
|
-
};
|
|
2423
|
-
onEach = (element, key, options) => {
|
|
2424
|
-
for (const key2 in element) {
|
|
2425
|
-
const isMethod6 = import_registry.DEFAULT_METHODS[key2];
|
|
2426
|
-
if (isMethod6 && (0, import_utils10.isFunction)(isMethod6))
|
|
2427
|
-
isMethod6(element, element.ref.state);
|
|
2428
|
-
const hasDefine = element.define && element.define[key2];
|
|
2429
|
-
if (hasDefine && (0, import_utils10.isFunction)(hasDefine))
|
|
2430
|
-
element.ref[key2] = hasDefine(element, element.ref.state);
|
|
2431
|
-
if (!isMethod6 && !hasDefine)
|
|
2432
|
-
onEachAvailable(element, key2, options);
|
|
2433
|
-
}
|
|
2434
|
-
return element;
|
|
2435
|
-
};
|
|
2436
|
-
applyTransform = (element, key, options) => {
|
|
2437
|
-
const { ref, transform } = element;
|
|
2438
|
-
if (!transform)
|
|
2439
|
-
return element;
|
|
2440
|
-
if (!ref.transform)
|
|
2441
|
-
ref.transform = {};
|
|
2442
|
-
const keys2 = Object.keys(transform || {});
|
|
2443
|
-
keys2.map((key2) => {
|
|
2444
|
-
const transformer = transform[key2];
|
|
2445
|
-
ref.transform[key2] = transformer(element, key2);
|
|
2446
|
-
return key2;
|
|
2447
|
-
});
|
|
2448
|
-
return element;
|
|
2449
|
-
};
|
|
2450
|
-
addChildren = (element, key, options) => {
|
|
2451
|
-
const { ref } = element;
|
|
2452
|
-
const { children, childrenKeys } = ref;
|
|
2453
|
-
if (children && children.length) {
|
|
2454
|
-
ref.children = children.map((child, key2) => {
|
|
2455
|
-
return create2(child, element, childrenKeys[key2], options);
|
|
2456
|
-
});
|
|
2457
|
-
}
|
|
2458
|
-
return element;
|
|
2459
|
-
};
|
|
2460
|
-
applyGlobalTransform = (element, key, options) => {
|
|
2461
|
-
const { ref } = element;
|
|
2462
|
-
const { transform } = options;
|
|
2463
|
-
if (!transform)
|
|
2464
|
-
return element;
|
|
2465
|
-
if (!ref.transform)
|
|
2466
|
-
ref.transform = {};
|
|
2467
|
-
const keys2 = Object.keys(transform || {});
|
|
2468
|
-
keys2.map((key2) => {
|
|
2469
|
-
const transformer = transform[key2];
|
|
2470
|
-
ref.transform[key2] = transformer(element, key2);
|
|
2471
|
-
return key2;
|
|
2472
|
-
});
|
|
2473
|
-
return element;
|
|
2474
|
-
};
|
|
2475
|
-
create2 = (element, parent, key, options = OPTIONS) => [
|
|
2476
|
-
init,
|
|
2477
|
-
assignKey,
|
|
2478
|
-
applyParent,
|
|
2479
|
-
applyState,
|
|
2480
|
-
applyExtends,
|
|
2481
|
-
applyTag,
|
|
2482
|
-
applyProps,
|
|
2483
|
-
applyAttr,
|
|
2484
|
-
onEach,
|
|
2485
|
-
applyTransform,
|
|
2486
|
-
addChildren,
|
|
2487
|
-
applyGlobalTransform
|
|
2488
|
-
].reduce((prev, current) => current(prev, key, options, parent), element);
|
|
2489
|
-
}
|
|
2490
|
-
});
|
|
2491
|
-
|
|
2492
|
-
// ../refactor/domql/packages/mixins/text.js
|
|
2493
|
-
var import_utils11, text;
|
|
2494
|
-
var init_text = __esm({
|
|
2495
|
-
"../refactor/domql/packages/mixins/text.js"() {
|
|
2496
|
-
"use strict";
|
|
2497
|
-
import_utils11 = __toESM(require_cjs4());
|
|
2498
|
-
init_create();
|
|
2499
|
-
text = (param, element, node) => {
|
|
2500
|
-
const prop = (0, import_utils11.exec)(param, element);
|
|
2501
|
-
if (element.tag === "string")
|
|
2502
|
-
node.nodeValue = prop;
|
|
2503
|
-
else if (param) {
|
|
2504
|
-
if (element.__text) {
|
|
2505
|
-
element.__text.text = prop;
|
|
2506
|
-
if (element.__text.node)
|
|
2507
|
-
element.__text.node.nodeValue = prop;
|
|
2508
|
-
} else
|
|
2509
|
-
create2({ tag: "string", text: prop }, element, "__text");
|
|
2510
|
-
}
|
|
2511
|
-
};
|
|
2512
|
-
}
|
|
2513
|
-
});
|
|
2514
|
-
|
|
2515
|
-
// ../refactor/domql/packages/mixins/state.js
|
|
2516
|
-
var import_utils12, state;
|
|
2517
|
-
var init_state2 = __esm({
|
|
2518
|
-
"../refactor/domql/packages/mixins/state.js"() {
|
|
2519
|
-
"use strict";
|
|
2520
|
-
import_utils12 = __toESM(require_cjs4());
|
|
2521
|
-
state = (params, element, node) => {
|
|
2522
|
-
const state2 = (0, import_utils12.exec)(params, element);
|
|
2523
|
-
if ((0, import_utils12.isObject)(state2)) {
|
|
2524
|
-
for (const param in state2) {
|
|
2525
|
-
if (IGNORE_STATE_PARAMS.includes(param))
|
|
2526
|
-
continue;
|
|
2527
|
-
element.state[param] = (0, import_utils12.exec)(state2[param], element);
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
return element;
|
|
2531
|
-
};
|
|
2532
|
-
}
|
|
2533
|
-
});
|
|
2534
|
-
|
|
2535
|
-
// ../refactor/domql/packages/mixins/classList.js
|
|
2536
|
-
var import_utils13, assignClass, classify, classList;
|
|
2537
|
-
var init_classList = __esm({
|
|
2538
|
-
"../refactor/domql/packages/mixins/classList.js"() {
|
|
2539
|
-
"use strict";
|
|
2540
|
-
import_utils13 = __toESM(require_cjs4());
|
|
2541
|
-
assignClass = (element) => {
|
|
2542
|
-
const { key } = element;
|
|
2543
|
-
if (element.class === true)
|
|
2544
|
-
element.class = keyw;
|
|
2545
|
-
else if (!element.class && typeof key === "string" && key.charAt(0) === "_" && key.charAt(1) !== "_") {
|
|
2546
|
-
element.class = key.slice(1);
|
|
2547
|
-
}
|
|
2548
|
-
};
|
|
2549
|
-
classify = (obj, element) => {
|
|
2550
|
-
let className = "";
|
|
2551
|
-
for (const item in obj) {
|
|
2552
|
-
const param = obj[item];
|
|
2553
|
-
if (typeof param === "boolean" && param)
|
|
2554
|
-
className += ` ${item}`;
|
|
2555
|
-
else if (typeof param === "string")
|
|
2556
|
-
className += ` ${param}`;
|
|
2557
|
-
else if (typeof param === "function") {
|
|
2558
|
-
className += ` ${(0, import_utils13.exec)(param, element)}`;
|
|
2559
|
-
}
|
|
2560
|
-
}
|
|
2561
|
-
return className;
|
|
2562
|
-
};
|
|
2563
|
-
classList = (params, element) => {
|
|
2564
|
-
if (!params)
|
|
2565
|
-
return;
|
|
2566
|
-
const { key } = element;
|
|
2567
|
-
if (params === true)
|
|
2568
|
-
params = element.class = { key };
|
|
2569
|
-
if ((0, import_utils13.isString)(params))
|
|
2570
|
-
params = element.class = { default: params };
|
|
2571
|
-
if ((0, import_utils13.isObject)(params))
|
|
2572
|
-
params = classify(params, element);
|
|
2573
|
-
const className = params.replace(/\s+/g, " ").trim();
|
|
2574
|
-
element.ref.class = className;
|
|
2575
|
-
return className;
|
|
2576
|
-
};
|
|
2577
|
-
}
|
|
2578
|
-
});
|
|
2579
|
-
|
|
2580
|
-
// ../refactor/domql/packages/mixins/methods.js
|
|
2581
|
-
var defaultMethods, parseFilters;
|
|
2582
|
-
var init_methods = __esm({
|
|
2583
|
-
"../refactor/domql/packages/mixins/methods.js"() {
|
|
2584
|
-
"use strict";
|
|
2585
|
-
init_mixins();
|
|
2586
|
-
defaultMethods = {
|
|
2587
|
-
attr,
|
|
2588
|
-
style,
|
|
2589
|
-
text,
|
|
2590
|
-
html,
|
|
2591
|
-
content,
|
|
2592
|
-
data,
|
|
2593
|
-
class: classList,
|
|
2594
|
-
state,
|
|
2595
|
-
extend: {},
|
|
2596
|
-
childExtend: {},
|
|
2597
|
-
childExtendRecursive: {},
|
|
2598
|
-
props: {},
|
|
2599
|
-
path: {},
|
|
2600
|
-
if: {},
|
|
2601
|
-
define: {},
|
|
2602
|
-
transform: {},
|
|
2603
|
-
__ref: {},
|
|
2604
|
-
__hash: {},
|
|
2605
|
-
__text: {},
|
|
2606
|
-
nextElement: {},
|
|
2607
|
-
previousElement: {},
|
|
2608
|
-
key: {},
|
|
2609
|
-
tag: {},
|
|
2610
|
-
query: {},
|
|
2611
|
-
parent: {},
|
|
2612
|
-
node: {},
|
|
2613
|
-
set: {},
|
|
2614
|
-
update: {},
|
|
2615
|
-
setProps: {},
|
|
2616
|
-
remove: {},
|
|
2617
|
-
removeContent: {},
|
|
2618
|
-
lookup: {},
|
|
2619
|
-
spotByPath: {},
|
|
2620
|
-
keys: {},
|
|
2621
|
-
log: {},
|
|
2622
|
-
parse: {},
|
|
2623
|
-
parseDeep: {},
|
|
2624
|
-
on: {},
|
|
2625
|
-
component: {},
|
|
2626
|
-
context: {}
|
|
2627
|
-
};
|
|
2628
|
-
parseFilters = {
|
|
2629
|
-
elementKeys: [
|
|
2630
|
-
"tag",
|
|
2631
|
-
"text",
|
|
2632
|
-
"style",
|
|
2633
|
-
"attr",
|
|
2634
|
-
"class",
|
|
2635
|
-
"state",
|
|
2636
|
-
"class",
|
|
2637
|
-
"data",
|
|
2638
|
-
"content",
|
|
2639
|
-
"html",
|
|
2640
|
-
"on"
|
|
2641
|
-
],
|
|
2642
|
-
propsKeys: ["__element"],
|
|
2643
|
-
stateKeys: []
|
|
2644
|
-
};
|
|
2645
|
-
}
|
|
2646
|
-
});
|
|
2647
|
-
|
|
2648
|
-
// ../refactor/domql/packages/set/index.js
|
|
2649
|
-
var removeContentElement, set;
|
|
2650
|
-
var init_set = __esm({
|
|
2651
|
-
"../refactor/domql/packages/set/index.js"() {
|
|
2652
|
-
"use strict";
|
|
2653
|
-
init_create();
|
|
2654
|
-
removeContentElement = (params, element) => {
|
|
2655
|
-
if (params && element.content) {
|
|
2656
|
-
if (element.content.node) {
|
|
2657
|
-
if (element.content.tag === "fragment")
|
|
2658
|
-
element.node.innerHTML = "";
|
|
2659
|
-
else
|
|
2660
|
-
element.node.removeChild(element.content.node);
|
|
2661
|
-
}
|
|
2662
|
-
if (element.__cache && element.__cache.content) {
|
|
2663
|
-
if (element.__cache.content.tag === "fragment")
|
|
2664
|
-
element.__cache.content.parent.node.innerHTML = "";
|
|
2665
|
-
else
|
|
2666
|
-
element.__cache.content.remove();
|
|
2667
|
-
}
|
|
2668
|
-
delete element.content;
|
|
2669
|
-
}
|
|
2670
|
-
};
|
|
2671
|
-
set = function(params, enter, leave) {
|
|
2672
|
-
const element = this;
|
|
2673
|
-
removeContentElement(params, element);
|
|
2674
|
-
if (params) {
|
|
2675
|
-
const { childExtend } = params;
|
|
2676
|
-
if (!childExtend && element.childExtend)
|
|
2677
|
-
params.childExtend = element.childExtend;
|
|
2678
|
-
create2(params, element, "content", {
|
|
2679
|
-
ignoreChildExtend: true
|
|
2680
|
-
});
|
|
2681
|
-
}
|
|
2682
|
-
return element;
|
|
2683
|
-
};
|
|
2684
|
-
}
|
|
2685
|
-
});
|
|
2686
|
-
|
|
2687
|
-
// ../refactor/domql/packages/mixins/content.js
|
|
2688
|
-
var content;
|
|
2689
|
-
var init_content = __esm({
|
|
2690
|
-
"../refactor/domql/packages/mixins/content.js"() {
|
|
2691
|
-
"use strict";
|
|
2692
|
-
init_set();
|
|
2693
|
-
content = (param, element, node) => {
|
|
2694
|
-
if (param && element) {
|
|
2695
|
-
if (param.__hash === element.content.__hash && element.content.update) {
|
|
2696
|
-
element.content.update(param);
|
|
2697
|
-
} else {
|
|
2698
|
-
set.call(element, param);
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
};
|
|
2702
|
-
}
|
|
2703
|
-
});
|
|
2704
|
-
|
|
2705
|
-
// ../refactor/domql/packages/mixins/index.js
|
|
2706
|
-
var mixins_exports = {};
|
|
2707
|
-
__export(mixins_exports, {
|
|
2708
|
-
assignClass: () => assignClass,
|
|
2709
|
-
attr: () => attr,
|
|
2710
|
-
classList: () => classList,
|
|
2711
|
-
classify: () => classify,
|
|
2712
|
-
content: () => content,
|
|
2713
|
-
data: () => data,
|
|
2714
|
-
defaultMethods: () => defaultMethods,
|
|
2715
|
-
html: () => html,
|
|
2716
|
-
parseFilters: () => parseFilters,
|
|
2717
|
-
state: () => state,
|
|
2718
|
-
style: () => style,
|
|
2719
|
-
text: () => text
|
|
2720
|
-
});
|
|
2721
|
-
var init_mixins = __esm({
|
|
2722
|
-
"../refactor/domql/packages/mixins/index.js"() {
|
|
2723
|
-
"use strict";
|
|
2724
|
-
init_attr();
|
|
2725
|
-
init_data();
|
|
2726
|
-
init_html();
|
|
2727
|
-
init_style();
|
|
2728
|
-
init_text();
|
|
2729
|
-
init_state2();
|
|
2730
|
-
init_classList();
|
|
2731
|
-
init_methods();
|
|
2732
|
-
init_content();
|
|
2733
|
-
}
|
|
2734
|
-
});
|
|
2735
|
-
|
|
2736
|
-
// ../refactor/domql/packages/cache/dist/cjs/index.js
|
|
2737
|
-
var require_cjs12 = __commonJS({
|
|
2738
|
-
"../refactor/domql/packages/cache/dist/cjs/index.js"(exports, module) {
|
|
2739
|
-
"use strict";
|
|
2740
|
-
var __defProp2 = Object.defineProperty;
|
|
2741
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
2742
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
2743
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
2744
|
-
var __export2 = (target, all) => {
|
|
2745
|
-
for (var name in all)
|
|
2746
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
2747
|
-
};
|
|
2748
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
2749
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2750
|
-
for (let key of __getOwnPropNames2(from))
|
|
2751
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
2752
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2753
|
-
}
|
|
2754
|
-
return to;
|
|
2755
|
-
};
|
|
2756
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
2757
|
-
var cache_exports = {};
|
|
2758
|
-
__export2(cache_exports, {
|
|
2759
|
-
cache: () => cache
|
|
2229
|
+
if (matchParentChildProps)
|
|
2230
|
+
propsStack.push(matchParentChildProps);
|
|
2231
|
+
return propsStack;
|
|
2232
|
+
};
|
|
2233
|
+
var createPropsStack = (element, parent) => {
|
|
2234
|
+
const { props, __ref } = element;
|
|
2235
|
+
const propsStack = __ref.__props = inheritParentProps(element, parent);
|
|
2236
|
+
if ((0, import_utils.isObject)(props))
|
|
2237
|
+
propsStack.push(props);
|
|
2238
|
+
else if (props === "inherit" && parent.props)
|
|
2239
|
+
propsStack.push(parent.props);
|
|
2240
|
+
else if (props)
|
|
2241
|
+
propsStack.push(props);
|
|
2242
|
+
if ((0, import_utils.isArray)(__ref.__extend)) {
|
|
2243
|
+
__ref.__extend.forEach((extend) => {
|
|
2244
|
+
if (extend.props)
|
|
2245
|
+
propsStack.push(extend.props);
|
|
2760
2246
|
});
|
|
2761
|
-
module.exports = __toCommonJS2(cache_exports);
|
|
2762
|
-
var cache = {};
|
|
2763
2247
|
}
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
var
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
});
|
|
2793
|
-
module.exports = __toCommonJS2(cache_exports);
|
|
2794
|
-
var import_report8 = require_cjs5();
|
|
2795
|
-
var import_event6 = require_cjs6();
|
|
2796
|
-
var import_utils40 = require_cjs4();
|
|
2797
|
-
var import_cache = require_cjs12();
|
|
2798
|
-
var createHTMLNode = (element) => {
|
|
2799
|
-
const { tag } = element;
|
|
2800
|
-
if (tag) {
|
|
2801
|
-
if (tag === "string")
|
|
2802
|
-
return document.createTextNode(element.text);
|
|
2803
|
-
else if (tag === "fragment") {
|
|
2804
|
-
return document.createDocumentFragment();
|
|
2805
|
-
} else if (tag === "svg" || tag === "path") {
|
|
2806
|
-
return document.createElementNS("http://www.w3.org/2000/svg", tag);
|
|
2807
|
-
} else
|
|
2808
|
-
return document.createElement(tag);
|
|
2809
|
-
} else {
|
|
2810
|
-
return document.createElement("div");
|
|
2811
|
-
}
|
|
2812
|
-
};
|
|
2813
|
-
var detectTag2 = (element) => {
|
|
2814
|
-
let { tag, key } = element;
|
|
2815
|
-
tag = (0, import_utils40.exec)(tag, element);
|
|
2816
|
-
if (tag === true)
|
|
2817
|
-
tag = key;
|
|
2818
|
-
if ((0, import_utils40.isString)(tag)) {
|
|
2819
|
-
const tagExists = (0, import_utils40.isValidHtmlTag)(tag);
|
|
2820
|
-
if (tagExists)
|
|
2821
|
-
return tag;
|
|
2822
|
-
} else {
|
|
2823
|
-
const isKeyATag = (0, import_utils40.isValidHtmlTag)(key);
|
|
2824
|
-
if (isKeyATag)
|
|
2825
|
-
return key;
|
|
2826
|
-
}
|
|
2827
|
-
return "div";
|
|
2828
|
-
};
|
|
2829
|
-
var cacheNode3 = (element) => {
|
|
2830
|
-
const tag = element.tag = detectTag2(element);
|
|
2831
|
-
if (!(0, import_event6.canRender)(element)) {
|
|
2832
|
-
return (0, import_report8.report)("HTMLInvalidTag", element.tag, element);
|
|
2833
|
-
}
|
|
2834
|
-
let cachedTag = import_cache.cache[tag];
|
|
2835
|
-
if (!cachedTag)
|
|
2836
|
-
cachedTag = import_cache.cache[tag] = createHTMLNode(element);
|
|
2837
|
-
const clonedNode = cachedTag.cloneNode(true);
|
|
2838
|
-
if (tag === "string")
|
|
2839
|
-
clonedNode.nodeValue = element.text;
|
|
2840
|
-
return clonedNode;
|
|
2841
|
-
};
|
|
2248
|
+
__ref.__props = propsStack;
|
|
2249
|
+
return propsStack;
|
|
2250
|
+
};
|
|
2251
|
+
var syncProps = (props, element) => {
|
|
2252
|
+
element.props = {};
|
|
2253
|
+
const mergedProps = { update, __element: element };
|
|
2254
|
+
props.forEach((v) => {
|
|
2255
|
+
if (import_ignore.IGNORE_PROPS_PARAMS.includes(v))
|
|
2256
|
+
return;
|
|
2257
|
+
const execProps = (0, import_utils.exec)(v, element);
|
|
2258
|
+
if ((0, import_utils.isObject)(execProps) && execProps.__element)
|
|
2259
|
+
return;
|
|
2260
|
+
element.props = (0, import_utils.deepMerge)(
|
|
2261
|
+
mergedProps,
|
|
2262
|
+
(0, import_utils.deepClone)(execProps, import_ignore.IGNORE_PROPS_PARAMS),
|
|
2263
|
+
import_ignore.IGNORE_PROPS_PARAMS
|
|
2264
|
+
);
|
|
2265
|
+
});
|
|
2266
|
+
element.props = mergedProps;
|
|
2267
|
+
return element.props;
|
|
2268
|
+
};
|
|
2269
|
+
var createProps = function(element, parent, cached) {
|
|
2270
|
+
const propsStack = cached || createPropsStack(element, parent);
|
|
2271
|
+
const { __ref } = element;
|
|
2272
|
+
if (propsStack.length) {
|
|
2273
|
+
__ref.__props = propsStack;
|
|
2274
|
+
syncProps(propsStack, element);
|
|
2275
|
+
element.props.update = update;
|
|
2842
2276
|
}
|
|
2843
|
-
|
|
2277
|
+
return element;
|
|
2278
|
+
};
|
|
2279
|
+
var updateProps = (newProps, element, parent) => {
|
|
2280
|
+
const { __ref } = element;
|
|
2281
|
+
let propsStack = __ref.__props;
|
|
2282
|
+
const parentProps = inheritParentProps(element, parent);
|
|
2283
|
+
if (parentProps)
|
|
2284
|
+
propsStack = __ref.__props = [].concat(parentProps, propsStack);
|
|
2285
|
+
if (newProps)
|
|
2286
|
+
propsStack = __ref.__props = [].concat(newProps, propsStack);
|
|
2287
|
+
if (propsStack)
|
|
2288
|
+
syncProps(propsStack, element);
|
|
2289
|
+
return element;
|
|
2290
|
+
};
|
|
2291
|
+
function update(props, options) {
|
|
2292
|
+
const element = this.__element;
|
|
2293
|
+
element.update({ props }, options);
|
|
2294
|
+
}
|
|
2844
2295
|
|
|
2845
|
-
// ../refactor/domql/packages/
|
|
2846
|
-
var
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
});
|
|
2853
|
-
|
|
2854
|
-
var
|
|
2855
|
-
"
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
throughInitialDefine = (element) => {
|
|
2860
|
-
const { define } = element;
|
|
2861
|
-
for (const param in define) {
|
|
2862
|
-
let prop = element[param];
|
|
2863
|
-
if ((0, import_utils14.isFunction)(prop) && !(0, import_methods.isMethod)(param)) {
|
|
2864
|
-
element.__exec[param] = prop;
|
|
2865
|
-
element[param] = prop = (0, import_utils14.exec)(prop, element);
|
|
2866
|
-
}
|
|
2867
|
-
element.__cache[param] = prop;
|
|
2868
|
-
element[param] = define[param](prop, element, element.state);
|
|
2869
|
-
}
|
|
2870
|
-
return element;
|
|
2871
|
-
};
|
|
2872
|
-
throughUpdatedDefine = (element) => {
|
|
2873
|
-
const { define, __exec } = element;
|
|
2874
|
-
const changes = {};
|
|
2875
|
-
for (const param in define) {
|
|
2876
|
-
const execParam = __exec[param];
|
|
2877
|
-
if (execParam)
|
|
2878
|
-
element.__cache[param] = execParam(element, element.state);
|
|
2879
|
-
const cached = (0, import_utils14.exec)(element.__cache[param], element);
|
|
2880
|
-
element[param] = define[param](cached, element, element.state);
|
|
2881
|
-
}
|
|
2882
|
-
return changes;
|
|
2883
|
-
};
|
|
2884
|
-
throughInitialExec = (element) => {
|
|
2885
|
-
};
|
|
2886
|
-
throughUpdatedExec = (element, options) => {
|
|
2887
|
-
};
|
|
2296
|
+
// ../refactor/domql/packages/methods/dist/cjs/index.js
|
|
2297
|
+
var __defProp13 = Object.defineProperty;
|
|
2298
|
+
var __getOwnPropDesc13 = Object.getOwnPropertyDescriptor;
|
|
2299
|
+
var __getOwnPropNames13 = Object.getOwnPropertyNames;
|
|
2300
|
+
var __hasOwnProp13 = Object.prototype.hasOwnProperty;
|
|
2301
|
+
var __export10 = (target, all) => {
|
|
2302
|
+
for (var name in all)
|
|
2303
|
+
__defProp13(target, name, { get: all[name], enumerable: true });
|
|
2304
|
+
};
|
|
2305
|
+
var __copyProps13 = (to, from, except, desc) => {
|
|
2306
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2307
|
+
for (let key of __getOwnPropNames13(from))
|
|
2308
|
+
if (!__hasOwnProp13.call(to, key) && key !== except)
|
|
2309
|
+
__defProp13(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc13(from, key)) || desc.enumerable });
|
|
2888
2310
|
}
|
|
2311
|
+
return to;
|
|
2312
|
+
};
|
|
2313
|
+
var __toCommonJS13 = (mod) => __copyProps13(__defProp13({}, "__esModule", { value: true }), mod);
|
|
2314
|
+
var methods_exports3 = {};
|
|
2315
|
+
__export10(methods_exports3, {
|
|
2316
|
+
METHODS: () => METHODS,
|
|
2317
|
+
defineSetter: () => defineSetter,
|
|
2318
|
+
get: () => get,
|
|
2319
|
+
isMethod: () => isMethod,
|
|
2320
|
+
keys: () => keys,
|
|
2321
|
+
log: () => log,
|
|
2322
|
+
lookup: () => lookup,
|
|
2323
|
+
parse: () => parse,
|
|
2324
|
+
parseDeep: () => parseDeep,
|
|
2325
|
+
remove: () => remove,
|
|
2326
|
+
setProps: () => setProps,
|
|
2327
|
+
spotByPath: () => spotByPath
|
|
2889
2328
|
});
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
var
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
}
|
|
2909
|
-
return to;
|
|
2910
|
-
};
|
|
2911
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
2912
|
-
var create_exports2 = {};
|
|
2913
|
-
__export2(create_exports2, {
|
|
2914
|
-
createNode: () => createNode
|
|
2915
|
-
});
|
|
2916
|
-
module.exports = __toCommonJS2(create_exports2);
|
|
2917
|
-
var import_utils40 = require_cjs4();
|
|
2918
|
-
var import_event6 = require_cjs6();
|
|
2919
|
-
var import_mixins8 = (init_mixins(), __toCommonJS(mixins_exports));
|
|
2920
|
-
var import_cache = require_cache();
|
|
2921
|
-
var import_create8 = (init_create(), __toCommonJS(create_exports));
|
|
2922
|
-
var import_methods10 = require_cjs11();
|
|
2923
|
-
var import_iterate4 = (init_iterate(), __toCommonJS(iterate_exports));
|
|
2924
|
-
var ENV2 = "development";
|
|
2925
|
-
var createNode = (element) => {
|
|
2926
|
-
let { node, tag } = element;
|
|
2927
|
-
let isNewNode;
|
|
2928
|
-
if (!node) {
|
|
2929
|
-
isNewNode = true;
|
|
2930
|
-
if (tag === "shadow") {
|
|
2931
|
-
node = element.node = element.parent.node.attachShadow({ mode: "open" });
|
|
2932
|
-
} else
|
|
2933
|
-
node = element.node = (0, import_cache.cacheNode)(element);
|
|
2934
|
-
triggerEventOn("attachNode", element);
|
|
2935
|
-
}
|
|
2936
|
-
if (ENV2 === "test" || ENV2 === "development") {
|
|
2937
|
-
node.ref = element;
|
|
2938
|
-
if ((0, import_utils40.isFunction)(node.setAttribute))
|
|
2939
|
-
node.setAttribute("key", element.key);
|
|
2940
|
-
}
|
|
2941
|
-
if (element.tag !== "string" || element.tag !== "fragment") {
|
|
2942
|
-
if ((0, import_utils40.isObject)(element.define))
|
|
2943
|
-
(0, import_iterate4.throughInitialDefine)(element);
|
|
2944
|
-
(0, import_iterate4.throughInitialExec)(element);
|
|
2945
|
-
if (isNewNode && (0, import_utils40.isObject)(element.on))
|
|
2946
|
-
(0, import_event6.applyEventsOnNode)(element);
|
|
2947
|
-
for (const param in element) {
|
|
2948
|
-
const prop = element[param];
|
|
2949
|
-
if ((0, import_methods10.isMethod)(param) || (0, import_utils40.isObject)(import_mixins8.defaultMethods[param]) || prop === void 0)
|
|
2950
|
-
continue;
|
|
2951
|
-
const hasDefined = element.define && element.define[param];
|
|
2952
|
-
const ourMethod = import_mixins8.defaultMethods[param];
|
|
2953
|
-
if (ourMethod) {
|
|
2954
|
-
if ((0, import_utils40.isFunction)(ourMethod))
|
|
2955
|
-
ourMethod(prop, element, node);
|
|
2956
|
-
} else if (element[param] && !hasDefined) {
|
|
2957
|
-
(0, import_create8.create)(prop, element, param);
|
|
2958
|
-
}
|
|
2959
|
-
}
|
|
2960
|
-
}
|
|
2961
|
-
return element;
|
|
2962
|
-
};
|
|
2329
|
+
module.exports = __toCommonJS13(methods_exports3);
|
|
2330
|
+
var import_tree = require_cjs4();
|
|
2331
|
+
var import_utils3 = require_cjs();
|
|
2332
|
+
var import_registry = (init_cjs5(), __toCommonJS(cjs_exports5));
|
|
2333
|
+
var import_env = (init_cjs6(), __toCommonJS(cjs_exports6));
|
|
2334
|
+
var spotByPath = function(path) {
|
|
2335
|
+
const element = this;
|
|
2336
|
+
const arr = [].concat(path);
|
|
2337
|
+
let active = import_tree.TREE[arr[0]];
|
|
2338
|
+
if (!arr || !arr.length)
|
|
2339
|
+
return console.log(arr, "on", element.key, "is undefined");
|
|
2340
|
+
while (active.key === arr[0]) {
|
|
2341
|
+
arr.shift();
|
|
2342
|
+
if (!arr.length)
|
|
2343
|
+
break;
|
|
2344
|
+
active = active[arr[0]];
|
|
2345
|
+
if (!active)
|
|
2346
|
+
return;
|
|
2963
2347
|
}
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2976
|
-
for (let key of __getOwnPropNames2(from))
|
|
2977
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
2978
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2979
|
-
}
|
|
2980
|
-
return to;
|
|
2981
|
-
};
|
|
2982
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
|
|
2983
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
2984
|
-
var node_exports = {};
|
|
2985
|
-
module.exports = __toCommonJS2(node_exports);
|
|
2986
|
-
__reExport(node_exports, require_create(), module.exports);
|
|
2987
|
-
__reExport(node_exports, require_cache(), module.exports);
|
|
2348
|
+
return active;
|
|
2349
|
+
};
|
|
2350
|
+
var lookup = function(key) {
|
|
2351
|
+
const element = this;
|
|
2352
|
+
let { parent } = element;
|
|
2353
|
+
while (parent.key !== key) {
|
|
2354
|
+
if (parent[key])
|
|
2355
|
+
return parent[key];
|
|
2356
|
+
parent = parent.parent;
|
|
2357
|
+
if (!parent)
|
|
2358
|
+
return;
|
|
2988
2359
|
}
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
2999
|
-
var __export2 = (target, all) => {
|
|
3000
|
-
for (var name in all)
|
|
3001
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
3002
|
-
};
|
|
3003
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
3004
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
3005
|
-
for (let key of __getOwnPropNames2(from))
|
|
3006
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
3007
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3008
|
-
}
|
|
3009
|
-
return to;
|
|
3010
|
-
};
|
|
3011
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
3012
|
-
var report_exports = {};
|
|
3013
|
-
__export2(report_exports, {
|
|
3014
|
-
ERRORS_REGISTRY: () => ERRORS_REGISTRY,
|
|
3015
|
-
report: () => report8
|
|
3016
|
-
});
|
|
3017
|
-
module.exports = __toCommonJS2(report_exports);
|
|
3018
|
-
var ERRORS_REGISTRY = {
|
|
3019
|
-
en: {
|
|
3020
|
-
DocumentNotDefined: {
|
|
3021
|
-
title: "Document is undefined",
|
|
3022
|
-
description: "To tweak with DOM, you should use browser."
|
|
3023
|
-
},
|
|
3024
|
-
OverwriteToBuiltin: {
|
|
3025
|
-
title: "Overwriting to builtin method",
|
|
3026
|
-
description: "Overwriting a builtin method in the window define is not possible, please choose different name"
|
|
3027
|
-
},
|
|
3028
|
-
BrowserNotDefined: {
|
|
3029
|
-
title: "Can't recognize environment",
|
|
3030
|
-
description: "Environment should be browser application, that can run Javascript"
|
|
3031
|
-
},
|
|
3032
|
-
SetQuickPreferancesIsNotObject: {
|
|
3033
|
-
title: "Quick preferances object is required",
|
|
3034
|
-
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
3035
|
-
},
|
|
3036
|
-
InvalidParams: {
|
|
3037
|
-
title: "Params are invalid",
|
|
3038
|
-
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
3039
|
-
},
|
|
3040
|
-
CantCreateWithoutNode: {
|
|
3041
|
-
title: "You must provide node",
|
|
3042
|
-
description: "Can't create DOM element without setting node or text"
|
|
3043
|
-
},
|
|
3044
|
-
HTMLInvalidTag: {
|
|
3045
|
-
title: "Element tag name (or DOM nodeName) is invalid",
|
|
3046
|
-
description: "To create element, you must provide valid DOM node. See full list of them at here: http://www.w3schools.com/tags/"
|
|
3047
|
-
},
|
|
3048
|
-
HTMLInvalidAttr: {
|
|
3049
|
-
title: "Attibutes object is invalid",
|
|
3050
|
-
description: "Please pass a valid plain object to apply as an attributes for a DOM node"
|
|
3051
|
-
},
|
|
3052
|
-
HTMLInvalidData: {
|
|
3053
|
-
title: "Data object is invalid",
|
|
3054
|
-
description: "Please pass a valid plain object to apply as an dataset for a DOM node"
|
|
3055
|
-
},
|
|
3056
|
-
HTMLInvalidStyles: {
|
|
3057
|
-
title: "Styles object is invalid",
|
|
3058
|
-
description: "Please pass a valid plain object to apply as an style for a DOM node"
|
|
3059
|
-
},
|
|
3060
|
-
HTMLInvalidText: {
|
|
3061
|
-
title: "Text string is invalid",
|
|
3062
|
-
description: "Please pass a valid string to apply text to DOM node"
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
};
|
|
3066
|
-
var report8 = (err, arg, element) => {
|
|
3067
|
-
const currentLang = "en";
|
|
3068
|
-
let errObj;
|
|
3069
|
-
if (err && typeof err === "string")
|
|
3070
|
-
errObj = ERRORS_REGISTRY[currentLang][err];
|
|
3071
|
-
return new Error(
|
|
3072
|
-
`"${err}", "${arg}"
|
|
3073
|
-
|
|
3074
|
-
`,
|
|
3075
|
-
`${errObj.description}`,
|
|
3076
|
-
element ? `
|
|
3077
|
-
|
|
3078
|
-
${element}` : ""
|
|
3079
|
-
);
|
|
3080
|
-
};
|
|
2360
|
+
return parent;
|
|
2361
|
+
};
|
|
2362
|
+
var remove = function(params) {
|
|
2363
|
+
const element = this;
|
|
2364
|
+
if ((0, import_utils3.isFunction)(element.node.remove))
|
|
2365
|
+
element.node.remove();
|
|
2366
|
+
else if (!(0, import_env.isProduction)()) {
|
|
2367
|
+
console.warn("This item cant be removed");
|
|
2368
|
+
element.log();
|
|
3081
2369
|
}
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
};
|
|
3104
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
3105
|
-
var globals_exports = {};
|
|
3106
|
-
__export2(globals_exports, {
|
|
3107
|
-
document: () => document2,
|
|
3108
|
-
global: () => global,
|
|
3109
|
-
self: () => self,
|
|
3110
|
-
window: () => window2
|
|
3111
|
-
});
|
|
3112
|
-
module.exports = __toCommonJS2(globals_exports);
|
|
3113
|
-
var global = globalThis;
|
|
3114
|
-
var self = globalThis;
|
|
3115
|
-
var window2 = globalThis;
|
|
3116
|
-
var document2 = window2.document;
|
|
2370
|
+
delete element.parent[element.key];
|
|
2371
|
+
};
|
|
2372
|
+
var get = function(param) {
|
|
2373
|
+
const element = this;
|
|
2374
|
+
return element[param];
|
|
2375
|
+
};
|
|
2376
|
+
var setProps = function(param, options) {
|
|
2377
|
+
const element = this;
|
|
2378
|
+
if (!param || !element.props)
|
|
2379
|
+
return;
|
|
2380
|
+
element.update({ props: param }, options);
|
|
2381
|
+
return element;
|
|
2382
|
+
};
|
|
2383
|
+
var defineSetter = (element, key, get2, set) => Object.defineProperty(element, key, { get: get2, set });
|
|
2384
|
+
var keys = function() {
|
|
2385
|
+
const element = this;
|
|
2386
|
+
const keys2 = [];
|
|
2387
|
+
for (const param in element) {
|
|
2388
|
+
if (!(0, import_utils3.isObject)(import_registry.DEFAULT_METHODS[param])) {
|
|
2389
|
+
keys2.push(param);
|
|
2390
|
+
}
|
|
3117
2391
|
}
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
var
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
var
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
// src/element/remove.js
|
|
3162
|
-
var import_utils16 = __toESM(require_cjs4());
|
|
3163
|
-
|
|
3164
|
-
// src/element/mixins/data.js
|
|
3165
|
-
var import_utils18 = __toESM(require_cjs4());
|
|
3166
|
-
var import_report5 = __toESM(require_cjs14());
|
|
3167
|
-
|
|
3168
|
-
// src/element/mixins/html.js
|
|
3169
|
-
var import_utils19 = __toESM(require_cjs4());
|
|
3170
|
-
|
|
3171
|
-
// src/element/mixins/style.js
|
|
3172
|
-
var import_utils20 = __toESM(require_cjs4());
|
|
3173
|
-
var import_report6 = __toESM(require_cjs14());
|
|
3174
|
-
|
|
3175
|
-
// src/element/mixins/text.js
|
|
3176
|
-
var import_utils21 = __toESM(require_cjs4());
|
|
3177
|
-
|
|
3178
|
-
// src/element/mixins/state.js
|
|
3179
|
-
var import_utils22 = __toESM(require_cjs4());
|
|
3180
|
-
|
|
3181
|
-
// src/element/applyParam.js
|
|
3182
|
-
var import_utils23 = __toESM(require_cjs4());
|
|
3183
|
-
|
|
3184
|
-
// src/element/extend.js
|
|
3185
|
-
var import_utils25 = __toESM(require_cjs4());
|
|
3186
|
-
|
|
3187
|
-
// src/element/props.js
|
|
3188
|
-
var import_utils27 = __toESM(require_cjs4());
|
|
3189
|
-
var IGNORE_PROPS_PARAMS2 = ["update", "__element"];
|
|
3190
|
-
|
|
3191
|
-
// src/element/update.js
|
|
3192
|
-
var import_globals = __toESM(require_cjs15());
|
|
3193
|
-
var import_utils29 = __toESM(require_cjs4());
|
|
3194
|
-
var import_event3 = __toESM(require_cjs6());
|
|
3195
|
-
var import_methods3 = __toESM(require_cjs11());
|
|
3196
|
-
var import_key2 = __toESM(require_cjs());
|
|
3197
|
-
|
|
3198
|
-
// src/element/methods.js
|
|
3199
|
-
var import_utils31 = __toESM(require_cjs4());
|
|
3200
|
-
|
|
3201
|
-
// src/utils/component.js
|
|
3202
|
-
var import_utils32 = __toESM(require_cjs4());
|
|
3203
|
-
|
|
3204
|
-
// src/element/define.js
|
|
3205
|
-
var import_report7 = __toESM(require_cjs14());
|
|
3206
|
-
|
|
3207
|
-
// src/element/parse.js
|
|
3208
|
-
var import_render2 = __toESM(require_cjs9());
|
|
3209
|
-
|
|
3210
|
-
// src/element/index.js
|
|
3211
|
-
var import_methods7 = __toESM(require_cjs11());
|
|
3212
|
-
|
|
3213
|
-
// src/element/state.js
|
|
3214
|
-
var IGNORE_STATE_PARAMS3 = [
|
|
2392
|
+
return keys2;
|
|
2393
|
+
};
|
|
2394
|
+
var parse = function() {
|
|
2395
|
+
const element = this;
|
|
2396
|
+
const obj = {};
|
|
2397
|
+
const keys2 = element.keys();
|
|
2398
|
+
keys2.forEach((v) => obj[v] = element[v]);
|
|
2399
|
+
return obj;
|
|
2400
|
+
};
|
|
2401
|
+
var parseDeep = function(param) {
|
|
2402
|
+
const element = this;
|
|
2403
|
+
const orig = param || element;
|
|
2404
|
+
const obj = {};
|
|
2405
|
+
const keys2 = orig.keys && orig.keys();
|
|
2406
|
+
if (!keys2)
|
|
2407
|
+
return;
|
|
2408
|
+
keys2.forEach((v) => {
|
|
2409
|
+
const prop = orig[v];
|
|
2410
|
+
if ((0, import_utils3.isObjectLike)(prop))
|
|
2411
|
+
parseDeep(prop);
|
|
2412
|
+
else
|
|
2413
|
+
obj[v] = prop;
|
|
2414
|
+
});
|
|
2415
|
+
return obj;
|
|
2416
|
+
};
|
|
2417
|
+
var log = function(...args) {
|
|
2418
|
+
const element = this;
|
|
2419
|
+
console.group(element.key);
|
|
2420
|
+
if (args.length) {
|
|
2421
|
+
args.forEach((v) => console.log(`%c${v}:
|
|
2422
|
+
`, "font-weight: bold", element[v]));
|
|
2423
|
+
} else {
|
|
2424
|
+
console.log(element.path);
|
|
2425
|
+
const keys2 = element.keys();
|
|
2426
|
+
keys2.forEach((v) => console.log(`%c${v}:
|
|
2427
|
+
`, "font-weight: bold", element[v]));
|
|
2428
|
+
}
|
|
2429
|
+
console.groupEnd(element.key);
|
|
2430
|
+
return element;
|
|
2431
|
+
};
|
|
2432
|
+
var METHODS = [
|
|
2433
|
+
"set",
|
|
3215
2434
|
"update",
|
|
3216
|
-
"parse",
|
|
3217
|
-
"clean",
|
|
3218
|
-
"create",
|
|
3219
|
-
"destroy",
|
|
3220
2435
|
"remove",
|
|
3221
|
-
"
|
|
3222
|
-
"
|
|
3223
|
-
"
|
|
3224
|
-
"
|
|
3225
|
-
"
|
|
3226
|
-
"
|
|
3227
|
-
"
|
|
3228
|
-
"
|
|
2436
|
+
"removeContent",
|
|
2437
|
+
"lookup",
|
|
2438
|
+
"spotByPath",
|
|
2439
|
+
"keys",
|
|
2440
|
+
"parse",
|
|
2441
|
+
"setProps",
|
|
2442
|
+
"parseDeep",
|
|
2443
|
+
"if",
|
|
2444
|
+
"log",
|
|
2445
|
+
"nextElement",
|
|
2446
|
+
"previousElement"
|
|
3229
2447
|
];
|
|
2448
|
+
var isMethod = function(param) {
|
|
2449
|
+
return METHODS.includes(param);
|
|
2450
|
+
};
|
|
3230
2451
|
|
|
3231
|
-
// src/utils/object.js
|
|
3232
|
-
var
|
|
3233
|
-
var METHODS_EXL = (0, import_utils36.joinArrays)(
|
|
2452
|
+
// src/element/utils/object.js
|
|
2453
|
+
var METHODS_EXL = (0, import_utils4.joinArrays)(
|
|
3234
2454
|
["node", "state", "context", "extend"],
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
2455
|
+
void 0,
|
|
2456
|
+
import_state.IGNORE_STATE_PARAMS,
|
|
2457
|
+
void 0
|
|
3238
2458
|
);
|
|
3239
2459
|
var overwrite = (element, params, options) => {
|
|
3240
2460
|
const changes = {};
|
|
3241
2461
|
const { __ref } = element;
|
|
3242
2462
|
const { __exec, __cached } = __ref;
|
|
3243
|
-
for (const
|
|
3244
|
-
if (
|
|
2463
|
+
for (const e in params) {
|
|
2464
|
+
if (e === "props" || e === "state" || e === "__ref")
|
|
3245
2465
|
continue;
|
|
3246
|
-
const elementProp = element[
|
|
3247
|
-
const paramsProp = params[
|
|
2466
|
+
const elementProp = element[e];
|
|
2467
|
+
const paramsProp = params[e];
|
|
3248
2468
|
if (paramsProp !== void 0) {
|
|
3249
|
-
__cached[
|
|
3250
|
-
element[
|
|
2469
|
+
__cached[e] = changes[e] = elementProp;
|
|
2470
|
+
element[e] = paramsProp;
|
|
3251
2471
|
}
|
|
3252
2472
|
if (options.cleanExec)
|
|
3253
|
-
delete __exec[
|
|
2473
|
+
delete __exec[e];
|
|
3254
2474
|
}
|
|
3255
2475
|
return changes;
|
|
3256
2476
|
};
|
|
3257
2477
|
|
|
3258
|
-
// src/utils/extendUtils.js
|
|
3259
|
-
var
|
|
2478
|
+
// src/element/utils/extendUtils.js
|
|
2479
|
+
var import_utils5 = __toESM(require_cjs());
|
|
2480
|
+
|
|
2481
|
+
// src/element/utils/component.js
|
|
2482
|
+
var import_utils6 = __toESM(require_cjs());
|
|
3260
2483
|
|
|
3261
2484
|
// src/element/iterate.js
|
|
3262
|
-
var
|
|
3263
|
-
|
|
3264
|
-
const { __ref } = element;
|
|
3265
|
-
const { __exec } = __ref;
|
|
2485
|
+
var throughInitialExec = (element, exclude = {}) => {
|
|
2486
|
+
const { __ref: ref } = element;
|
|
3266
2487
|
for (const param in element) {
|
|
2488
|
+
if (exclude[param])
|
|
2489
|
+
continue;
|
|
3267
2490
|
const prop = element[param];
|
|
3268
|
-
if ((0,
|
|
3269
|
-
__exec[param] = prop;
|
|
2491
|
+
if ((0, import_utils7.isFunction)(prop) && !(void 0)(param)) {
|
|
2492
|
+
ref.__exec[param] = prop;
|
|
3270
2493
|
element[param] = prop(element, element.state);
|
|
3271
2494
|
}
|
|
3272
2495
|
}
|
|
3273
2496
|
};
|
|
3274
|
-
var
|
|
3275
|
-
const { __ref } = element;
|
|
3276
|
-
const { __exec, __cached } = __ref;
|
|
2497
|
+
var throughUpdatedExec = (element, options = { excludes: METHODS_EXL }) => {
|
|
2498
|
+
const { __ref: ref } = element;
|
|
3277
2499
|
const changes = {};
|
|
3278
|
-
for (const param in __exec) {
|
|
2500
|
+
for (const param in ref.__exec) {
|
|
3279
2501
|
const prop = element[param];
|
|
3280
|
-
const
|
|
3281
|
-
if (
|
|
2502
|
+
const isDefinedParam = ref.__defineCache[param];
|
|
2503
|
+
if (isDefinedParam)
|
|
2504
|
+
continue;
|
|
2505
|
+
const newExec = ref.__exec[param](element, element.state);
|
|
2506
|
+
const execReturnsString = (0, import_utils7.isString)(newExec) || (0, import_utils7.isNumber)(newExec);
|
|
2507
|
+
if (prop && prop.node && execReturnsString) {
|
|
3282
2508
|
overwrite(prop, { text: newExec }, options);
|
|
3283
2509
|
} else if (newExec !== prop) {
|
|
3284
|
-
__cached[param] = changes[param] = prop;
|
|
2510
|
+
ref.__cached[param] = changes[param] = prop;
|
|
3285
2511
|
element[param] = newExec;
|
|
3286
2512
|
}
|
|
3287
2513
|
}
|
|
3288
2514
|
return changes;
|
|
3289
2515
|
};
|
|
3290
|
-
var
|
|
3291
|
-
const { define, context, __ref } = element;
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
if ((0,
|
|
3295
|
-
|
|
3296
|
-
if (
|
|
3297
|
-
|
|
3298
|
-
for (const param in
|
|
3299
|
-
let
|
|
3300
|
-
if ((0,
|
|
3301
|
-
__exec[param] =
|
|
3302
|
-
const execParam2 =
|
|
3303
|
-
if (execParam2)
|
|
3304
|
-
element[param] = execParam2;
|
|
2516
|
+
var throughInitialDefine = (element) => {
|
|
2517
|
+
const { define, context, __ref: ref } = element;
|
|
2518
|
+
let defineObj = {};
|
|
2519
|
+
const hasGlobalDefine = context && (0, import_utils7.isObject)(context.define);
|
|
2520
|
+
if ((0, import_utils7.isObject)(define))
|
|
2521
|
+
defineObj = { ...define };
|
|
2522
|
+
if (hasGlobalDefine)
|
|
2523
|
+
defineObj = { ...defineObj, ...context.define };
|
|
2524
|
+
for (const param in defineObj) {
|
|
2525
|
+
let elementProp = element[param];
|
|
2526
|
+
if ((0, import_utils7.isFunction)(elementProp) && !(void 0)(param)) {
|
|
2527
|
+
ref.__exec[param] = elementProp;
|
|
2528
|
+
const execParam2 = elementProp = (0, import_utils7.exec)(elementProp, element);
|
|
2529
|
+
if (execParam2) {
|
|
2530
|
+
elementProp = element[param] = execParam2.parse ? execParam2.parse() : execParam2;
|
|
2531
|
+
ref.__defineCache[param] = elementProp;
|
|
2532
|
+
}
|
|
3305
2533
|
}
|
|
3306
|
-
|
|
3307
|
-
const execParam = obj[param](prop, element, element.state);
|
|
2534
|
+
const execParam = defineObj[param](elementProp, element, element.state);
|
|
3308
2535
|
if (execParam)
|
|
3309
2536
|
element[param] = execParam;
|
|
3310
2537
|
}
|
|
3311
2538
|
return element;
|
|
3312
2539
|
};
|
|
3313
|
-
var
|
|
3314
|
-
const { context, define, __ref } = element;
|
|
3315
|
-
const { __exec, __cached } = __ref;
|
|
2540
|
+
var throughUpdatedDefine = (element) => {
|
|
2541
|
+
const { context, define, __ref: ref } = element;
|
|
3316
2542
|
const changes = {};
|
|
3317
2543
|
let obj = {};
|
|
3318
|
-
if ((0,
|
|
2544
|
+
if ((0, import_utils7.isObject)(define))
|
|
3319
2545
|
obj = { ...define };
|
|
3320
|
-
if ((0,
|
|
2546
|
+
if ((0, import_utils7.isObject)(context && context.define))
|
|
3321
2547
|
obj = { ...obj, ...context.define };
|
|
3322
2548
|
for (const param in obj) {
|
|
3323
|
-
const execParam = __exec[param];
|
|
2549
|
+
const execParam = ref.__exec[param];
|
|
3324
2550
|
if (execParam)
|
|
3325
|
-
|
|
3326
|
-
const cached = (0,
|
|
2551
|
+
ref.__defineCache[param] = execParam(element, element.state);
|
|
2552
|
+
const cached = (0, import_utils7.exec)(ref.__defineCache[param], element);
|
|
3327
2553
|
const newExecParam = obj[param](cached, element, element.state);
|
|
3328
2554
|
if (newExecParam)
|
|
3329
2555
|
element[param] = newExecParam;
|
|
@@ -3331,8 +2557,8 @@ var throughUpdatedDefine2 = (element) => {
|
|
|
3331
2557
|
return changes;
|
|
3332
2558
|
};
|
|
3333
2559
|
export {
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
2560
|
+
throughInitialDefine,
|
|
2561
|
+
throughInitialExec,
|
|
2562
|
+
throughUpdatedDefine,
|
|
2563
|
+
throughUpdatedExec
|
|
3338
2564
|
};
|