@symbo.ls/create 2.11.452 → 2.11.454
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/bundle/index.js +498 -195
- package/package.json +8 -8
package/dist/cjs/bundle/index.js
CHANGED
|
@@ -303,6 +303,8 @@ var require_array = __commonJS({
|
|
|
303
303
|
arraysEqual: () => arraysEqual,
|
|
304
304
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
305
305
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
306
|
+
filterArrays: () => filterArrays,
|
|
307
|
+
filterArraysFast: () => filterArraysFast,
|
|
306
308
|
getFrequencyInArray: () => getFrequencyInArray,
|
|
307
309
|
joinArrays: () => joinArrays,
|
|
308
310
|
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
@@ -411,6 +413,13 @@ var require_array = __commonJS({
|
|
|
411
413
|
}
|
|
412
414
|
return true;
|
|
413
415
|
};
|
|
416
|
+
var filterArrays = (sourceArr, excludeArr) => {
|
|
417
|
+
return sourceArr.filter((item) => !excludeArr.includes(item));
|
|
418
|
+
};
|
|
419
|
+
var filterArraysFast = (sourceArr, excludeArr) => {
|
|
420
|
+
const excludeSet = new Set(excludeArr);
|
|
421
|
+
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
422
|
+
};
|
|
414
423
|
}
|
|
415
424
|
});
|
|
416
425
|
|
|
@@ -604,6 +613,7 @@ var require_object = __commonJS({
|
|
|
604
613
|
diff: () => diff,
|
|
605
614
|
diffArrays: () => diffArrays,
|
|
606
615
|
diffObjects: () => diffObjects,
|
|
616
|
+
excludeKeysFromObject: () => excludeKeysFromObject,
|
|
607
617
|
exec: () => exec7,
|
|
608
618
|
flattenRecursive: () => flattenRecursive,
|
|
609
619
|
hasOwnProperty: () => hasOwnProperty,
|
|
@@ -759,10 +769,10 @@ var require_object = __commonJS({
|
|
|
759
769
|
return o;
|
|
760
770
|
};
|
|
761
771
|
var deepStringify = (obj, stringified = {}) => {
|
|
762
|
-
var _a;
|
|
772
|
+
var _a, _b;
|
|
763
773
|
if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
|
|
764
|
-
|
|
765
|
-
obj = (
|
|
774
|
+
(obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
|
|
775
|
+
obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
|
|
766
776
|
}
|
|
767
777
|
for (const prop in obj) {
|
|
768
778
|
const objProp = obj[prop];
|
|
@@ -931,7 +941,7 @@ var require_object = __commonJS({
|
|
|
931
941
|
};
|
|
932
942
|
var stringToObject = (str, opts = { verbose: true }) => {
|
|
933
943
|
try {
|
|
934
|
-
return import_globals2.window.eval("(" + str + ")");
|
|
944
|
+
return str ? import_globals2.window.eval("(" + str + ")") : {};
|
|
935
945
|
} catch (e) {
|
|
936
946
|
if (opts.verbose)
|
|
937
947
|
console.warn(e);
|
|
@@ -1011,20 +1021,27 @@ var require_object = __commonJS({
|
|
|
1011
1021
|
return acc;
|
|
1012
1022
|
}, deletedValues);
|
|
1013
1023
|
};
|
|
1014
|
-
var overwrite = (element, params,
|
|
1015
|
-
const { ref } = element;
|
|
1016
|
-
const
|
|
1024
|
+
var overwrite = (element, params, opts = {}) => {
|
|
1025
|
+
const { __ref: ref } = element;
|
|
1026
|
+
const excl = opts.exclude || [];
|
|
1027
|
+
const allowUnderscore = opts.preventUnderscore;
|
|
1028
|
+
const preventCaching = opts.preventCaching;
|
|
1017
1029
|
for (const e in params) {
|
|
1018
|
-
if (
|
|
1030
|
+
if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
|
|
1019
1031
|
continue;
|
|
1020
1032
|
const elementProp = element[e];
|
|
1021
1033
|
const paramsProp = params[e];
|
|
1022
|
-
if (paramsProp) {
|
|
1023
|
-
|
|
1024
|
-
ref
|
|
1034
|
+
if (paramsProp !== void 0) {
|
|
1035
|
+
element[e] = paramsProp;
|
|
1036
|
+
if (ref && !preventCaching) {
|
|
1037
|
+
ref.__cache[e] = elementProp;
|
|
1038
|
+
}
|
|
1039
|
+
if ((0, import_types.isObject)(opts.diff)) {
|
|
1040
|
+
diff[e] = elementProp;
|
|
1041
|
+
}
|
|
1025
1042
|
}
|
|
1026
1043
|
}
|
|
1027
|
-
return
|
|
1044
|
+
return element;
|
|
1028
1045
|
};
|
|
1029
1046
|
var overwriteShallow3 = (obj, params, excludeFrom = []) => {
|
|
1030
1047
|
for (const e in params) {
|
|
@@ -1034,23 +1051,26 @@ var require_object = __commonJS({
|
|
|
1034
1051
|
}
|
|
1035
1052
|
return obj;
|
|
1036
1053
|
};
|
|
1037
|
-
var overwriteDeep2 = (obj, params,
|
|
1054
|
+
var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
1055
|
+
const excl = opts.exclude || [];
|
|
1056
|
+
const forcedExclude = opts.preventForce ? [] : ["node", "window"];
|
|
1038
1057
|
if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
|
|
1039
1058
|
return params;
|
|
1040
1059
|
}
|
|
1041
|
-
if (visited.has(obj))
|
|
1060
|
+
if (visited.has(obj))
|
|
1042
1061
|
return visited.get(obj);
|
|
1043
|
-
}
|
|
1044
1062
|
visited.set(obj, obj);
|
|
1045
1063
|
for (const e in params) {
|
|
1046
|
-
if (
|
|
1064
|
+
if (!Object.hasOwnProperty.call(params, e))
|
|
1065
|
+
continue;
|
|
1066
|
+
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
1047
1067
|
continue;
|
|
1048
1068
|
const objProp = obj[e];
|
|
1049
1069
|
const paramsProp = params[e];
|
|
1050
1070
|
if ((0, import_node.isDOMNode)(paramsProp)) {
|
|
1051
1071
|
obj[e] = paramsProp;
|
|
1052
1072
|
} else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
1053
|
-
obj[e] = overwriteDeep2(objProp, paramsProp,
|
|
1073
|
+
obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
|
|
1054
1074
|
} else if (paramsProp !== void 0) {
|
|
1055
1075
|
obj[e] = paramsProp;
|
|
1056
1076
|
}
|
|
@@ -1232,6 +1252,11 @@ var require_object = __commonJS({
|
|
|
1232
1252
|
}
|
|
1233
1253
|
return detect(obj);
|
|
1234
1254
|
};
|
|
1255
|
+
var excludeKeysFromObject = (obj, excludedKeys) => {
|
|
1256
|
+
const result = { ...obj };
|
|
1257
|
+
excludedKeys.forEach((key) => delete result[key]);
|
|
1258
|
+
return result;
|
|
1259
|
+
};
|
|
1235
1260
|
}
|
|
1236
1261
|
});
|
|
1237
1262
|
|
|
@@ -1387,9 +1412,11 @@ var require_cookie = __commonJS({
|
|
|
1387
1412
|
var cookie_exports = {};
|
|
1388
1413
|
__export2(cookie_exports, {
|
|
1389
1414
|
getCookie: () => getCookie,
|
|
1415
|
+
getLocalStorage: () => getLocalStorage,
|
|
1390
1416
|
isMobile: () => isMobile,
|
|
1391
1417
|
removeCookie: () => removeCookie,
|
|
1392
|
-
setCookie: () => setCookie
|
|
1418
|
+
setCookie: () => setCookie,
|
|
1419
|
+
setLocalStorage: () => setLocalStorage
|
|
1393
1420
|
});
|
|
1394
1421
|
module2.exports = __toCommonJS2(cookie_exports);
|
|
1395
1422
|
var import_types = require_types();
|
|
@@ -1423,6 +1450,27 @@ var require_cookie = __commonJS({
|
|
|
1423
1450
|
return;
|
|
1424
1451
|
import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
1425
1452
|
};
|
|
1453
|
+
function getLocalStorage(key) {
|
|
1454
|
+
let savedJSON;
|
|
1455
|
+
if (window.localStorage) {
|
|
1456
|
+
try {
|
|
1457
|
+
savedJSON = JSON.parse(window.localStorage.getItem(key));
|
|
1458
|
+
} catch (e) {
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
if (typeof savedJSON !== "undefined") {
|
|
1462
|
+
return savedJSON;
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
function setLocalStorage(key, data) {
|
|
1466
|
+
if (data && window.localStorage) {
|
|
1467
|
+
if (typeof data === "object") {
|
|
1468
|
+
window.localStorage.setItem(key, JSON.stringify(data));
|
|
1469
|
+
} else {
|
|
1470
|
+
window.localStorage.setItem(key, data);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1426
1474
|
}
|
|
1427
1475
|
});
|
|
1428
1476
|
|
|
@@ -1651,6 +1699,8 @@ var require_component = __commonJS({
|
|
|
1651
1699
|
return /^[a-z]*$/.test(firstCharKey);
|
|
1652
1700
|
};
|
|
1653
1701
|
var addAdditionalExtend2 = (newExtend, element) => {
|
|
1702
|
+
if (!newExtend)
|
|
1703
|
+
return element;
|
|
1654
1704
|
const { extend: elementExtend } = element;
|
|
1655
1705
|
const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
|
|
1656
1706
|
const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
|
|
@@ -1658,24 +1708,39 @@ var require_component = __commonJS({
|
|
|
1658
1708
|
return { ...element, extend };
|
|
1659
1709
|
};
|
|
1660
1710
|
var checkIfSugar = (element, parent, key) => {
|
|
1661
|
-
const {
|
|
1711
|
+
const {
|
|
1712
|
+
extend,
|
|
1713
|
+
props: props2,
|
|
1714
|
+
childExtend,
|
|
1715
|
+
extends: extendProps,
|
|
1716
|
+
childrenExtends,
|
|
1717
|
+
childProps,
|
|
1718
|
+
children,
|
|
1719
|
+
on: on2,
|
|
1720
|
+
$collection,
|
|
1721
|
+
$stateCollection,
|
|
1722
|
+
$propsCollection
|
|
1723
|
+
} = element;
|
|
1662
1724
|
const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
|
|
1725
|
+
if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
|
|
1726
|
+
parent.error("Sugar component includes params for builtin components", { verbose: true });
|
|
1727
|
+
}
|
|
1663
1728
|
return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
|
|
1664
1729
|
};
|
|
1665
1730
|
var extendizeByKey = (element, parent, key) => {
|
|
1666
1731
|
const { context } = parent;
|
|
1667
1732
|
const { tag, extend, childrenExtends } = element;
|
|
1668
|
-
const isSugar = checkIfSugar(element);
|
|
1733
|
+
const isSugar = checkIfSugar(element, parent, key);
|
|
1669
1734
|
const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent2(key.split(".")[1]) ? [key.split(".")[0]] : [key];
|
|
1670
1735
|
const isExtendKeyComponent = context && context.components[extendFromKey];
|
|
1671
1736
|
if (element === isExtendKeyComponent)
|
|
1672
1737
|
return element;
|
|
1673
1738
|
else if (isSugar) {
|
|
1674
|
-
const newElem = {
|
|
1739
|
+
const newElem = addAdditionalExtend2(element.extends, {
|
|
1675
1740
|
extend: extendFromKey,
|
|
1676
1741
|
tag,
|
|
1677
1742
|
props: { ...element }
|
|
1678
|
-
};
|
|
1743
|
+
});
|
|
1679
1744
|
if (childrenExtends)
|
|
1680
1745
|
newElem.childExtend = childrenExtends;
|
|
1681
1746
|
return newElem;
|
|
@@ -1711,7 +1776,7 @@ var require_component = __commonJS({
|
|
|
1711
1776
|
if (!childElem)
|
|
1712
1777
|
element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
|
|
1713
1778
|
else {
|
|
1714
|
-
const isSugar = checkIfSugar(childElem);
|
|
1779
|
+
const isSugar = checkIfSugar(childElem, parent, key);
|
|
1715
1780
|
if (!isSugar)
|
|
1716
1781
|
continue;
|
|
1717
1782
|
const inheritedChildElem = element[childKey].props;
|
|
@@ -2180,6 +2245,8 @@ var require_cjs2 = __commonJS({
|
|
|
2180
2245
|
arraysEqual: () => arraysEqual,
|
|
2181
2246
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2182
2247
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2248
|
+
filterArrays: () => filterArrays,
|
|
2249
|
+
filterArraysFast: () => filterArraysFast,
|
|
2183
2250
|
getFrequencyInArray: () => getFrequencyInArray,
|
|
2184
2251
|
joinArrays: () => joinArrays,
|
|
2185
2252
|
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
@@ -2288,6 +2355,13 @@ var require_cjs2 = __commonJS({
|
|
|
2288
2355
|
}
|
|
2289
2356
|
return true;
|
|
2290
2357
|
};
|
|
2358
|
+
var filterArrays = (sourceArr, excludeArr) => {
|
|
2359
|
+
return sourceArr.filter((item) => !excludeArr.includes(item));
|
|
2360
|
+
};
|
|
2361
|
+
var filterArraysFast = (sourceArr, excludeArr) => {
|
|
2362
|
+
const excludeSet = new Set(excludeArr);
|
|
2363
|
+
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
2364
|
+
};
|
|
2291
2365
|
}
|
|
2292
2366
|
});
|
|
2293
2367
|
var require_string3 = __commonJS2({
|
|
@@ -2477,6 +2551,7 @@ var require_cjs2 = __commonJS({
|
|
|
2477
2551
|
diff: () => diff,
|
|
2478
2552
|
diffArrays: () => diffArrays,
|
|
2479
2553
|
diffObjects: () => diffObjects,
|
|
2554
|
+
excludeKeysFromObject: () => excludeKeysFromObject,
|
|
2480
2555
|
exec: () => exec7,
|
|
2481
2556
|
flattenRecursive: () => flattenRecursive,
|
|
2482
2557
|
hasOwnProperty: () => hasOwnProperty,
|
|
@@ -2804,7 +2879,7 @@ var require_cjs2 = __commonJS({
|
|
|
2804
2879
|
};
|
|
2805
2880
|
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2806
2881
|
try {
|
|
2807
|
-
return import_globals3.window.eval("(" + str + ")");
|
|
2882
|
+
return str ? import_globals3.window.eval("(" + str + ")") : {};
|
|
2808
2883
|
} catch (e) {
|
|
2809
2884
|
if (opts.verbose)
|
|
2810
2885
|
console.warn(e);
|
|
@@ -2884,20 +2959,27 @@ var require_cjs2 = __commonJS({
|
|
|
2884
2959
|
return acc;
|
|
2885
2960
|
}, deletedValues);
|
|
2886
2961
|
};
|
|
2887
|
-
var overwrite = (element, params,
|
|
2888
|
-
const { ref } = element;
|
|
2889
|
-
const
|
|
2962
|
+
var overwrite = (element, params, opts = {}) => {
|
|
2963
|
+
const { __ref: ref } = element;
|
|
2964
|
+
const excl = opts.exclude || [];
|
|
2965
|
+
const allowUnderscore = opts.preventUnderscore;
|
|
2966
|
+
const preventCaching = opts.preventCaching;
|
|
2890
2967
|
for (const e in params) {
|
|
2891
|
-
if (
|
|
2968
|
+
if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
|
|
2892
2969
|
continue;
|
|
2893
2970
|
const elementProp = element[e];
|
|
2894
2971
|
const paramsProp = params[e];
|
|
2895
|
-
if (paramsProp) {
|
|
2896
|
-
|
|
2897
|
-
ref
|
|
2972
|
+
if (paramsProp !== void 0) {
|
|
2973
|
+
element[e] = paramsProp;
|
|
2974
|
+
if (ref && !preventCaching) {
|
|
2975
|
+
ref.__cache[e] = elementProp;
|
|
2976
|
+
}
|
|
2977
|
+
if ((0, import_types.isObject)(opts.diff)) {
|
|
2978
|
+
diff[e] = elementProp;
|
|
2979
|
+
}
|
|
2898
2980
|
}
|
|
2899
2981
|
}
|
|
2900
|
-
return
|
|
2982
|
+
return element;
|
|
2901
2983
|
};
|
|
2902
2984
|
var overwriteShallow3 = (obj, params, excludeFrom = []) => {
|
|
2903
2985
|
for (const e in params) {
|
|
@@ -2907,23 +2989,26 @@ var require_cjs2 = __commonJS({
|
|
|
2907
2989
|
}
|
|
2908
2990
|
return obj;
|
|
2909
2991
|
};
|
|
2910
|
-
var overwriteDeep2 = (obj, params,
|
|
2992
|
+
var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
2993
|
+
const excl = opts.exclude || [];
|
|
2994
|
+
const forcedExclude = opts.preventForce ? [] : ["node", "window"];
|
|
2911
2995
|
if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
|
|
2912
2996
|
return params;
|
|
2913
2997
|
}
|
|
2914
|
-
if (visited.has(obj))
|
|
2998
|
+
if (visited.has(obj))
|
|
2915
2999
|
return visited.get(obj);
|
|
2916
|
-
}
|
|
2917
3000
|
visited.set(obj, obj);
|
|
2918
3001
|
for (const e in params) {
|
|
2919
|
-
if (
|
|
3002
|
+
if (!Object.hasOwnProperty.call(params, e))
|
|
3003
|
+
continue;
|
|
3004
|
+
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
2920
3005
|
continue;
|
|
2921
3006
|
const objProp = obj[e];
|
|
2922
3007
|
const paramsProp = params[e];
|
|
2923
3008
|
if ((0, import_node.isDOMNode)(paramsProp)) {
|
|
2924
3009
|
obj[e] = paramsProp;
|
|
2925
3010
|
} else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2926
|
-
obj[e] = overwriteDeep2(objProp, paramsProp,
|
|
3011
|
+
obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
|
|
2927
3012
|
} else if (paramsProp !== void 0) {
|
|
2928
3013
|
obj[e] = paramsProp;
|
|
2929
3014
|
}
|
|
@@ -3105,6 +3190,11 @@ var require_cjs2 = __commonJS({
|
|
|
3105
3190
|
}
|
|
3106
3191
|
return detect(obj);
|
|
3107
3192
|
};
|
|
3193
|
+
var excludeKeysFromObject = (obj, excludedKeys) => {
|
|
3194
|
+
const result = { ...obj };
|
|
3195
|
+
excludedKeys.forEach((key) => delete result[key]);
|
|
3196
|
+
return result;
|
|
3197
|
+
};
|
|
3108
3198
|
}
|
|
3109
3199
|
});
|
|
3110
3200
|
var require_function3 = __commonJS2({
|
|
@@ -3514,6 +3604,8 @@ var require_cjs2 = __commonJS({
|
|
|
3514
3604
|
return /^[a-z]*$/.test(firstCharKey);
|
|
3515
3605
|
};
|
|
3516
3606
|
var addAdditionalExtend2 = (newExtend, element) => {
|
|
3607
|
+
if (!newExtend)
|
|
3608
|
+
return element;
|
|
3517
3609
|
const { extend: elementExtend } = element;
|
|
3518
3610
|
const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
|
|
3519
3611
|
const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
|
|
@@ -3521,8 +3613,23 @@ var require_cjs2 = __commonJS({
|
|
|
3521
3613
|
return { ...element, extend };
|
|
3522
3614
|
};
|
|
3523
3615
|
var checkIfSugar = (element, parent, key) => {
|
|
3524
|
-
const {
|
|
3616
|
+
const {
|
|
3617
|
+
extend,
|
|
3618
|
+
props: props2,
|
|
3619
|
+
childExtend,
|
|
3620
|
+
extends: extendProps,
|
|
3621
|
+
childrenExtends,
|
|
3622
|
+
childProps,
|
|
3623
|
+
children,
|
|
3624
|
+
on: on2,
|
|
3625
|
+
$collection,
|
|
3626
|
+
$stateCollection,
|
|
3627
|
+
$propsCollection
|
|
3628
|
+
} = element;
|
|
3525
3629
|
const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
|
|
3630
|
+
if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
|
|
3631
|
+
element.error("Sugar component includes params for builtin components");
|
|
3632
|
+
}
|
|
3526
3633
|
return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
|
|
3527
3634
|
};
|
|
3528
3635
|
var extendizeByKey = (element, parent, key) => {
|
|
@@ -3534,11 +3641,11 @@ var require_cjs2 = __commonJS({
|
|
|
3534
3641
|
if (element === isExtendKeyComponent)
|
|
3535
3642
|
return element;
|
|
3536
3643
|
else if (isSugar) {
|
|
3537
|
-
const newElem = {
|
|
3644
|
+
const newElem = addAdditionalExtend2(element.extends, {
|
|
3538
3645
|
extend: extendFromKey,
|
|
3539
3646
|
tag,
|
|
3540
3647
|
props: { ...element }
|
|
3541
|
-
};
|
|
3648
|
+
});
|
|
3542
3649
|
if (childrenExtends)
|
|
3543
3650
|
newElem.childExtend = childrenExtends;
|
|
3544
3651
|
return newElem;
|
|
@@ -4005,6 +4112,8 @@ var require_cjs2 = __commonJS({
|
|
|
4005
4112
|
arraysEqual: () => arraysEqual,
|
|
4006
4113
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
4007
4114
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
4115
|
+
filterArrays: () => filterArrays,
|
|
4116
|
+
filterArraysFast: () => filterArraysFast,
|
|
4008
4117
|
getFrequencyInArray: () => getFrequencyInArray,
|
|
4009
4118
|
joinArrays: () => joinArrays,
|
|
4010
4119
|
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
@@ -4113,6 +4222,13 @@ var require_cjs2 = __commonJS({
|
|
|
4113
4222
|
}
|
|
4114
4223
|
return true;
|
|
4115
4224
|
};
|
|
4225
|
+
var filterArrays = (sourceArr, excludeArr) => {
|
|
4226
|
+
return sourceArr.filter((item) => !excludeArr.includes(item));
|
|
4227
|
+
};
|
|
4228
|
+
var filterArraysFast = (sourceArr, excludeArr) => {
|
|
4229
|
+
const excludeSet = new Set(excludeArr);
|
|
4230
|
+
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
4231
|
+
};
|
|
4116
4232
|
}
|
|
4117
4233
|
});
|
|
4118
4234
|
var require_string22 = __commonJS22({
|
|
@@ -4302,9 +4418,11 @@ var require_cjs2 = __commonJS({
|
|
|
4302
4418
|
diff: () => diff,
|
|
4303
4419
|
diffArrays: () => diffArrays,
|
|
4304
4420
|
diffObjects: () => diffObjects,
|
|
4421
|
+
excludeKeysFromObject: () => excludeKeysFromObject,
|
|
4305
4422
|
exec: () => exec7,
|
|
4306
4423
|
flattenRecursive: () => flattenRecursive,
|
|
4307
4424
|
hasOwnProperty: () => hasOwnProperty,
|
|
4425
|
+
isCyclic: () => isCyclic,
|
|
4308
4426
|
isEmpty: () => isEmpty,
|
|
4309
4427
|
isEmptyObject: () => isEmptyObject,
|
|
4310
4428
|
isEqualDeep: () => isEqualDeep2,
|
|
@@ -4430,20 +4548,28 @@ var require_cjs2 = __commonJS({
|
|
|
4430
4548
|
}
|
|
4431
4549
|
return clone2;
|
|
4432
4550
|
};
|
|
4433
|
-
var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}) => {
|
|
4551
|
+
var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
4552
|
+
if ((0, import_types.isObjectLike)(obj)) {
|
|
4553
|
+
if (visited.has(obj)) {
|
|
4554
|
+
return obj;
|
|
4555
|
+
}
|
|
4556
|
+
visited.add(obj);
|
|
4557
|
+
}
|
|
4434
4558
|
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
4435
4559
|
for (const prop in obj) {
|
|
4436
4560
|
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
4437
4561
|
continue;
|
|
4438
4562
|
const objProp = obj[prop];
|
|
4439
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
4563
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp)) {
|
|
4440
4564
|
continue;
|
|
4565
|
+
}
|
|
4441
4566
|
if ((0, import_types.isObjectLike)(objProp)) {
|
|
4442
|
-
o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options);
|
|
4567
|
+
o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options, visited);
|
|
4443
4568
|
} else if ((0, import_types.isFunction)(objProp) && options.window) {
|
|
4444
4569
|
o[prop] = (options.window || import_globals3.window).eval("(" + objProp.toString() + ")");
|
|
4445
|
-
} else
|
|
4570
|
+
} else {
|
|
4446
4571
|
o[prop] = objProp;
|
|
4572
|
+
}
|
|
4447
4573
|
}
|
|
4448
4574
|
return o;
|
|
4449
4575
|
};
|
|
@@ -4620,7 +4746,7 @@ var require_cjs2 = __commonJS({
|
|
|
4620
4746
|
};
|
|
4621
4747
|
var stringToObject = (str, opts = { verbose: true }) => {
|
|
4622
4748
|
try {
|
|
4623
|
-
return import_globals3.window.eval("(" + str + ")");
|
|
4749
|
+
return str ? import_globals3.window.eval("(" + str + ")") : {};
|
|
4624
4750
|
} catch (e) {
|
|
4625
4751
|
if (opts.verbose)
|
|
4626
4752
|
console.warn(e);
|
|
@@ -4700,20 +4826,27 @@ var require_cjs2 = __commonJS({
|
|
|
4700
4826
|
return acc;
|
|
4701
4827
|
}, deletedValues);
|
|
4702
4828
|
};
|
|
4703
|
-
var overwrite = (element, params,
|
|
4704
|
-
const { ref } = element;
|
|
4705
|
-
const
|
|
4829
|
+
var overwrite = (element, params, opts = {}) => {
|
|
4830
|
+
const { __ref: ref } = element;
|
|
4831
|
+
const excl = opts.exclude || [];
|
|
4832
|
+
const allowUnderscore = opts.preventUnderscore;
|
|
4833
|
+
const preventCaching = opts.preventCaching;
|
|
4706
4834
|
for (const e in params) {
|
|
4707
|
-
if (
|
|
4835
|
+
if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
|
|
4708
4836
|
continue;
|
|
4709
4837
|
const elementProp = element[e];
|
|
4710
4838
|
const paramsProp = params[e];
|
|
4711
|
-
if (paramsProp) {
|
|
4712
|
-
|
|
4713
|
-
ref
|
|
4839
|
+
if (paramsProp !== void 0) {
|
|
4840
|
+
element[e] = paramsProp;
|
|
4841
|
+
if (ref && !preventCaching) {
|
|
4842
|
+
ref.__cache[e] = elementProp;
|
|
4843
|
+
}
|
|
4844
|
+
if ((0, import_types.isObject)(opts.diff)) {
|
|
4845
|
+
diff[e] = elementProp;
|
|
4846
|
+
}
|
|
4714
4847
|
}
|
|
4715
4848
|
}
|
|
4716
|
-
return
|
|
4849
|
+
return element;
|
|
4717
4850
|
};
|
|
4718
4851
|
var overwriteShallow3 = (obj, params, excludeFrom = []) => {
|
|
4719
4852
|
for (const e in params) {
|
|
@@ -4723,23 +4856,26 @@ var require_cjs2 = __commonJS({
|
|
|
4723
4856
|
}
|
|
4724
4857
|
return obj;
|
|
4725
4858
|
};
|
|
4726
|
-
var overwriteDeep2 = (obj, params,
|
|
4859
|
+
var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
4860
|
+
const excl = opts.exclude || [];
|
|
4861
|
+
const forcedExclude = opts.preventForce ? [] : ["node", "window"];
|
|
4727
4862
|
if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
|
|
4728
4863
|
return params;
|
|
4729
4864
|
}
|
|
4730
|
-
if (visited.has(obj))
|
|
4865
|
+
if (visited.has(obj))
|
|
4731
4866
|
return visited.get(obj);
|
|
4732
|
-
}
|
|
4733
4867
|
visited.set(obj, obj);
|
|
4734
4868
|
for (const e in params) {
|
|
4735
|
-
if (
|
|
4869
|
+
if (!Object.hasOwnProperty.call(params, e))
|
|
4870
|
+
continue;
|
|
4871
|
+
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
4736
4872
|
continue;
|
|
4737
4873
|
const objProp = obj[e];
|
|
4738
4874
|
const paramsProp = params[e];
|
|
4739
4875
|
if ((0, import_node.isDOMNode)(paramsProp)) {
|
|
4740
4876
|
obj[e] = paramsProp;
|
|
4741
4877
|
} else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
4742
|
-
obj[e] = overwriteDeep2(objProp, paramsProp,
|
|
4878
|
+
obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
|
|
4743
4879
|
} else if (paramsProp !== void 0) {
|
|
4744
4880
|
obj[e] = paramsProp;
|
|
4745
4881
|
}
|
|
@@ -4902,6 +5038,30 @@ var require_cjs2 = __commonJS({
|
|
|
4902
5038
|
}
|
|
4903
5039
|
}
|
|
4904
5040
|
};
|
|
5041
|
+
var isCyclic = (obj) => {
|
|
5042
|
+
const seenObjects = [];
|
|
5043
|
+
function detect(obj2) {
|
|
5044
|
+
if (obj2 && typeof obj2 === "object") {
|
|
5045
|
+
if (seenObjects.indexOf(obj2) !== -1) {
|
|
5046
|
+
return true;
|
|
5047
|
+
}
|
|
5048
|
+
seenObjects.push(obj2);
|
|
5049
|
+
for (const key in obj2) {
|
|
5050
|
+
if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
|
|
5051
|
+
console.log(obj2, "cycle at " + key);
|
|
5052
|
+
return true;
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5055
|
+
}
|
|
5056
|
+
return false;
|
|
5057
|
+
}
|
|
5058
|
+
return detect(obj);
|
|
5059
|
+
};
|
|
5060
|
+
var excludeKeysFromObject = (obj, excludedKeys) => {
|
|
5061
|
+
const result = { ...obj };
|
|
5062
|
+
excludedKeys.forEach((key) => delete result[key]);
|
|
5063
|
+
return result;
|
|
5064
|
+
};
|
|
4905
5065
|
}
|
|
4906
5066
|
});
|
|
4907
5067
|
var require_function22 = __commonJS22({
|
|
@@ -5311,6 +5471,8 @@ var require_cjs2 = __commonJS({
|
|
|
5311
5471
|
return /^[a-z]*$/.test(firstCharKey);
|
|
5312
5472
|
};
|
|
5313
5473
|
var addAdditionalExtend2 = (newExtend, element) => {
|
|
5474
|
+
if (!newExtend)
|
|
5475
|
+
return element;
|
|
5314
5476
|
const { extend: elementExtend } = element;
|
|
5315
5477
|
const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
|
|
5316
5478
|
const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
|
|
@@ -5318,8 +5480,23 @@ var require_cjs2 = __commonJS({
|
|
|
5318
5480
|
return { ...element, extend };
|
|
5319
5481
|
};
|
|
5320
5482
|
var checkIfSugar = (element, parent, key) => {
|
|
5321
|
-
const {
|
|
5483
|
+
const {
|
|
5484
|
+
extend,
|
|
5485
|
+
props: props2,
|
|
5486
|
+
childExtend,
|
|
5487
|
+
extends: extendProps,
|
|
5488
|
+
childrenExtends,
|
|
5489
|
+
childProps,
|
|
5490
|
+
children,
|
|
5491
|
+
on: on2,
|
|
5492
|
+
$collection,
|
|
5493
|
+
$stateCollection,
|
|
5494
|
+
$propsCollection
|
|
5495
|
+
} = element;
|
|
5322
5496
|
const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
|
|
5497
|
+
if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
|
|
5498
|
+
element.error("Sugar component includes params for builtin components");
|
|
5499
|
+
}
|
|
5323
5500
|
return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
|
|
5324
5501
|
};
|
|
5325
5502
|
var extendizeByKey = (element, parent, key) => {
|
|
@@ -5331,11 +5508,11 @@ var require_cjs2 = __commonJS({
|
|
|
5331
5508
|
if (element === isExtendKeyComponent)
|
|
5332
5509
|
return element;
|
|
5333
5510
|
else if (isSugar) {
|
|
5334
|
-
const newElem = {
|
|
5511
|
+
const newElem = addAdditionalExtend2(element.extends, {
|
|
5335
5512
|
extend: extendFromKey,
|
|
5336
5513
|
tag,
|
|
5337
5514
|
props: { ...element }
|
|
5338
|
-
};
|
|
5515
|
+
});
|
|
5339
5516
|
if (childrenExtends)
|
|
5340
5517
|
newElem.childExtend = childrenExtends;
|
|
5341
5518
|
return newElem;
|
|
@@ -8020,6 +8197,8 @@ var require_cjs3 = __commonJS({
|
|
|
8020
8197
|
arraysEqual: () => arraysEqual,
|
|
8021
8198
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
8022
8199
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
8200
|
+
filterArrays: () => filterArrays,
|
|
8201
|
+
filterArraysFast: () => filterArraysFast,
|
|
8023
8202
|
getFrequencyInArray: () => getFrequencyInArray,
|
|
8024
8203
|
joinArrays: () => joinArrays,
|
|
8025
8204
|
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
@@ -8128,6 +8307,13 @@ var require_cjs3 = __commonJS({
|
|
|
8128
8307
|
}
|
|
8129
8308
|
return true;
|
|
8130
8309
|
};
|
|
8310
|
+
var filterArrays = (sourceArr, excludeArr) => {
|
|
8311
|
+
return sourceArr.filter((item) => !excludeArr.includes(item));
|
|
8312
|
+
};
|
|
8313
|
+
var filterArraysFast = (sourceArr, excludeArr) => {
|
|
8314
|
+
const excludeSet = new Set(excludeArr);
|
|
8315
|
+
return sourceArr.filter((item) => !excludeSet.has(item));
|
|
8316
|
+
};
|
|
8131
8317
|
}
|
|
8132
8318
|
});
|
|
8133
8319
|
var require_string3 = __commonJS2({
|
|
@@ -8317,9 +8503,11 @@ var require_cjs3 = __commonJS({
|
|
|
8317
8503
|
diff: () => diff,
|
|
8318
8504
|
diffArrays: () => diffArrays,
|
|
8319
8505
|
diffObjects: () => diffObjects,
|
|
8506
|
+
excludeKeysFromObject: () => excludeKeysFromObject,
|
|
8320
8507
|
exec: () => exec7,
|
|
8321
8508
|
flattenRecursive: () => flattenRecursive,
|
|
8322
8509
|
hasOwnProperty: () => hasOwnProperty,
|
|
8510
|
+
isCyclic: () => isCyclic,
|
|
8323
8511
|
isEmpty: () => isEmpty,
|
|
8324
8512
|
isEmptyObject: () => isEmptyObject,
|
|
8325
8513
|
isEqualDeep: () => isEqualDeep2,
|
|
@@ -8445,20 +8633,28 @@ var require_cjs3 = __commonJS({
|
|
|
8445
8633
|
}
|
|
8446
8634
|
return clone2;
|
|
8447
8635
|
};
|
|
8448
|
-
var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}) => {
|
|
8636
|
+
var deepCloneWithExtend3 = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
|
|
8637
|
+
if ((0, import_types.isObjectLike)(obj)) {
|
|
8638
|
+
if (visited.has(obj)) {
|
|
8639
|
+
return obj;
|
|
8640
|
+
}
|
|
8641
|
+
visited.add(obj);
|
|
8642
|
+
}
|
|
8449
8643
|
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
8450
8644
|
for (const prop in obj) {
|
|
8451
8645
|
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
8452
8646
|
continue;
|
|
8453
8647
|
const objProp = obj[prop];
|
|
8454
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
8648
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp)) {
|
|
8455
8649
|
continue;
|
|
8650
|
+
}
|
|
8456
8651
|
if ((0, import_types.isObjectLike)(objProp)) {
|
|
8457
|
-
o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options);
|
|
8652
|
+
o[prop] = deepCloneWithExtend3(objProp, excludeFrom, options, visited);
|
|
8458
8653
|
} else if ((0, import_types.isFunction)(objProp) && options.window) {
|
|
8459
8654
|
o[prop] = (options.window || import_globals2.window).eval("(" + objProp.toString() + ")");
|
|
8460
|
-
} else
|
|
8655
|
+
} else {
|
|
8461
8656
|
o[prop] = objProp;
|
|
8657
|
+
}
|
|
8462
8658
|
}
|
|
8463
8659
|
return o;
|
|
8464
8660
|
};
|
|
@@ -8635,7 +8831,7 @@ var require_cjs3 = __commonJS({
|
|
|
8635
8831
|
};
|
|
8636
8832
|
var stringToObject = (str, opts = { verbose: true }) => {
|
|
8637
8833
|
try {
|
|
8638
|
-
return import_globals2.window.eval("(" + str + ")");
|
|
8834
|
+
return str ? import_globals2.window.eval("(" + str + ")") : {};
|
|
8639
8835
|
} catch (e) {
|
|
8640
8836
|
if (opts.verbose)
|
|
8641
8837
|
console.warn(e);
|
|
@@ -8715,20 +8911,27 @@ var require_cjs3 = __commonJS({
|
|
|
8715
8911
|
return acc;
|
|
8716
8912
|
}, deletedValues);
|
|
8717
8913
|
};
|
|
8718
|
-
var overwrite = (element, params,
|
|
8719
|
-
const { ref } = element;
|
|
8720
|
-
const
|
|
8914
|
+
var overwrite = (element, params, opts = {}) => {
|
|
8915
|
+
const { __ref: ref } = element;
|
|
8916
|
+
const excl = opts.exclude || [];
|
|
8917
|
+
const allowUnderscore = opts.preventUnderscore;
|
|
8918
|
+
const preventCaching = opts.preventCaching;
|
|
8721
8919
|
for (const e in params) {
|
|
8722
|
-
if (
|
|
8920
|
+
if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
|
|
8723
8921
|
continue;
|
|
8724
8922
|
const elementProp = element[e];
|
|
8725
8923
|
const paramsProp = params[e];
|
|
8726
|
-
if (paramsProp) {
|
|
8727
|
-
|
|
8728
|
-
ref
|
|
8924
|
+
if (paramsProp !== void 0) {
|
|
8925
|
+
element[e] = paramsProp;
|
|
8926
|
+
if (ref && !preventCaching) {
|
|
8927
|
+
ref.__cache[e] = elementProp;
|
|
8928
|
+
}
|
|
8929
|
+
if ((0, import_types.isObject)(opts.diff)) {
|
|
8930
|
+
diff[e] = elementProp;
|
|
8931
|
+
}
|
|
8729
8932
|
}
|
|
8730
8933
|
}
|
|
8731
|
-
return
|
|
8934
|
+
return element;
|
|
8732
8935
|
};
|
|
8733
8936
|
var overwriteShallow3 = (obj, params, excludeFrom = []) => {
|
|
8734
8937
|
for (const e in params) {
|
|
@@ -8738,23 +8941,26 @@ var require_cjs3 = __commonJS({
|
|
|
8738
8941
|
}
|
|
8739
8942
|
return obj;
|
|
8740
8943
|
};
|
|
8741
|
-
var overwriteDeep2 = (obj, params,
|
|
8944
|
+
var overwriteDeep2 = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
8945
|
+
const excl = opts.exclude || [];
|
|
8946
|
+
const forcedExclude = opts.preventForce ? [] : ["node", "window"];
|
|
8742
8947
|
if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
|
|
8743
8948
|
return params;
|
|
8744
8949
|
}
|
|
8745
|
-
if (visited.has(obj))
|
|
8950
|
+
if (visited.has(obj))
|
|
8746
8951
|
return visited.get(obj);
|
|
8747
|
-
}
|
|
8748
8952
|
visited.set(obj, obj);
|
|
8749
8953
|
for (const e in params) {
|
|
8750
|
-
if (
|
|
8954
|
+
if (!Object.hasOwnProperty.call(params, e))
|
|
8955
|
+
continue;
|
|
8956
|
+
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
8751
8957
|
continue;
|
|
8752
8958
|
const objProp = obj[e];
|
|
8753
8959
|
const paramsProp = params[e];
|
|
8754
8960
|
if ((0, import_node.isDOMNode)(paramsProp)) {
|
|
8755
8961
|
obj[e] = paramsProp;
|
|
8756
8962
|
} else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
8757
|
-
obj[e] = overwriteDeep2(objProp, paramsProp,
|
|
8963
|
+
obj[e] = overwriteDeep2(objProp, paramsProp, opts, visited);
|
|
8758
8964
|
} else if (paramsProp !== void 0) {
|
|
8759
8965
|
obj[e] = paramsProp;
|
|
8760
8966
|
}
|
|
@@ -8917,6 +9123,30 @@ var require_cjs3 = __commonJS({
|
|
|
8917
9123
|
}
|
|
8918
9124
|
}
|
|
8919
9125
|
};
|
|
9126
|
+
var isCyclic = (obj) => {
|
|
9127
|
+
const seenObjects = [];
|
|
9128
|
+
function detect(obj2) {
|
|
9129
|
+
if (obj2 && typeof obj2 === "object") {
|
|
9130
|
+
if (seenObjects.indexOf(obj2) !== -1) {
|
|
9131
|
+
return true;
|
|
9132
|
+
}
|
|
9133
|
+
seenObjects.push(obj2);
|
|
9134
|
+
for (const key in obj2) {
|
|
9135
|
+
if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
|
|
9136
|
+
console.log(obj2, "cycle at " + key);
|
|
9137
|
+
return true;
|
|
9138
|
+
}
|
|
9139
|
+
}
|
|
9140
|
+
}
|
|
9141
|
+
return false;
|
|
9142
|
+
}
|
|
9143
|
+
return detect(obj);
|
|
9144
|
+
};
|
|
9145
|
+
var excludeKeysFromObject = (obj, excludedKeys) => {
|
|
9146
|
+
const result = { ...obj };
|
|
9147
|
+
excludedKeys.forEach((key) => delete result[key]);
|
|
9148
|
+
return result;
|
|
9149
|
+
};
|
|
8920
9150
|
}
|
|
8921
9151
|
});
|
|
8922
9152
|
var require_function3 = __commonJS2({
|
|
@@ -9326,6 +9556,8 @@ var require_cjs3 = __commonJS({
|
|
|
9326
9556
|
return /^[a-z]*$/.test(firstCharKey);
|
|
9327
9557
|
};
|
|
9328
9558
|
var addAdditionalExtend2 = (newExtend, element) => {
|
|
9559
|
+
if (!newExtend)
|
|
9560
|
+
return element;
|
|
9329
9561
|
const { extend: elementExtend } = element;
|
|
9330
9562
|
const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
|
|
9331
9563
|
const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
|
|
@@ -9333,8 +9565,23 @@ var require_cjs3 = __commonJS({
|
|
|
9333
9565
|
return { ...element, extend };
|
|
9334
9566
|
};
|
|
9335
9567
|
var checkIfSugar = (element, parent, key) => {
|
|
9336
|
-
const {
|
|
9568
|
+
const {
|
|
9569
|
+
extend,
|
|
9570
|
+
props: props2,
|
|
9571
|
+
childExtend,
|
|
9572
|
+
extends: extendProps,
|
|
9573
|
+
childrenExtends,
|
|
9574
|
+
childProps,
|
|
9575
|
+
children,
|
|
9576
|
+
on: on2,
|
|
9577
|
+
$collection,
|
|
9578
|
+
$stateCollection,
|
|
9579
|
+
$propsCollection
|
|
9580
|
+
} = element;
|
|
9337
9581
|
const hasComponentAttrs = extend || childExtend || props2 || on2 || $collection || $stateCollection || $propsCollection;
|
|
9582
|
+
if (hasComponentAttrs && (childProps || extendProps || children || childrenExtends)) {
|
|
9583
|
+
element.error("Sugar component includes params for builtin components");
|
|
9584
|
+
}
|
|
9338
9585
|
return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
|
|
9339
9586
|
};
|
|
9340
9587
|
var extendizeByKey = (element, parent, key) => {
|
|
@@ -9346,11 +9593,11 @@ var require_cjs3 = __commonJS({
|
|
|
9346
9593
|
if (element === isExtendKeyComponent)
|
|
9347
9594
|
return element;
|
|
9348
9595
|
else if (isSugar) {
|
|
9349
|
-
const newElem = {
|
|
9596
|
+
const newElem = addAdditionalExtend2(element.extends, {
|
|
9350
9597
|
extend: extendFromKey,
|
|
9351
9598
|
tag,
|
|
9352
9599
|
props: { ...element }
|
|
9353
|
-
};
|
|
9600
|
+
});
|
|
9354
9601
|
if (childrenExtends)
|
|
9355
9602
|
newElem.childExtend = childrenExtends;
|
|
9356
9603
|
return newElem;
|
|
@@ -11421,13 +11668,18 @@ var require_create3 = __commonJS({
|
|
|
11421
11668
|
ref.__props = propsStack;
|
|
11422
11669
|
return propsStack;
|
|
11423
11670
|
};
|
|
11424
|
-
var syncProps = (props2, element) => {
|
|
11671
|
+
var syncProps = (props2, element, opts) => {
|
|
11425
11672
|
element.props = {};
|
|
11426
11673
|
const mergedProps = {};
|
|
11427
11674
|
props2.forEach((v) => {
|
|
11428
11675
|
if (import_ignore.IGNORE_PROPS_PARAMS.includes(v))
|
|
11429
11676
|
return;
|
|
11430
|
-
|
|
11677
|
+
let execProps;
|
|
11678
|
+
try {
|
|
11679
|
+
execProps = (0, import_utils32.exec)(v, element);
|
|
11680
|
+
} catch (e) {
|
|
11681
|
+
element.error(e, opts);
|
|
11682
|
+
}
|
|
11431
11683
|
element.props = (0, import_utils32.deepMerge)(
|
|
11432
11684
|
mergedProps,
|
|
11433
11685
|
(0, import_utils32.deepCloneWithExtend)(execProps, import_ignore.IGNORE_PROPS_PARAMS),
|
|
@@ -11439,15 +11691,15 @@ var require_create3 = __commonJS({
|
|
|
11439
11691
|
Object.setPrototypeOf(element.props, methods);
|
|
11440
11692
|
return element.props;
|
|
11441
11693
|
};
|
|
11442
|
-
var createProps = function(element, parent,
|
|
11694
|
+
var createProps = function(element, parent, options) {
|
|
11443
11695
|
const { __ref: ref } = element;
|
|
11444
11696
|
const applyProps = () => {
|
|
11445
|
-
const propsStack =
|
|
11697
|
+
const propsStack = options.cachedProps || createPropsStack(element, parent);
|
|
11446
11698
|
if (propsStack.length) {
|
|
11447
11699
|
ref.__props = propsStack;
|
|
11448
11700
|
syncProps(propsStack, element);
|
|
11449
11701
|
} else {
|
|
11450
|
-
ref.__props =
|
|
11702
|
+
ref.__props = options.cachedProps || [];
|
|
11451
11703
|
element.props = {};
|
|
11452
11704
|
}
|
|
11453
11705
|
};
|
|
@@ -11458,7 +11710,7 @@ var require_create3 = __commonJS({
|
|
|
11458
11710
|
applyProps();
|
|
11459
11711
|
} catch {
|
|
11460
11712
|
element.props = {};
|
|
11461
|
-
ref.__props =
|
|
11713
|
+
ref.__props = options.cachedProps || [];
|
|
11462
11714
|
}
|
|
11463
11715
|
}
|
|
11464
11716
|
const methods = { update: update.bind(element.props), __element: element };
|
|
@@ -12488,8 +12740,8 @@ var require_data = __commonJS({
|
|
|
12488
12740
|
var import_report = require_cjs5();
|
|
12489
12741
|
var data_default = (params, element, node3) => {
|
|
12490
12742
|
if (params) {
|
|
12491
|
-
if (element.props.
|
|
12492
|
-
(0, import_utils32.deepMerge)(params, element.props.
|
|
12743
|
+
if (element.props.data)
|
|
12744
|
+
(0, import_utils32.deepMerge)(params, element.props.data);
|
|
12493
12745
|
if (params.showOnNode) {
|
|
12494
12746
|
if (!(0, import_utils32.isObject)(params))
|
|
12495
12747
|
(0, import_report.report)("HTMLInvalidData", params);
|
|
@@ -12922,6 +13174,7 @@ var require_methods2 = __commonJS({
|
|
|
12922
13174
|
__export2(methods_exports, {
|
|
12923
13175
|
METHODS: () => METHODS,
|
|
12924
13176
|
defineSetter: () => defineSetter,
|
|
13177
|
+
error: () => error,
|
|
12925
13178
|
get: () => get,
|
|
12926
13179
|
isMethod: () => isMethod,
|
|
12927
13180
|
keys: () => keys,
|
|
@@ -12937,13 +13190,16 @@ var require_methods2 = __commonJS({
|
|
|
12937
13190
|
setNodeStyles: () => setNodeStyles,
|
|
12938
13191
|
setProps: () => setProps,
|
|
12939
13192
|
spotByPath: () => spotByPath,
|
|
12940
|
-
variables: () => variables
|
|
13193
|
+
variables: () => variables,
|
|
13194
|
+
verbose: () => verbose,
|
|
13195
|
+
warn: () => warn
|
|
12941
13196
|
});
|
|
12942
13197
|
module2.exports = __toCommonJS2(methods_exports);
|
|
12943
13198
|
var import_utils32 = require_cjs();
|
|
12944
13199
|
var import_tree = require_tree();
|
|
12945
13200
|
var import_mixins = require_mixins();
|
|
12946
|
-
var
|
|
13201
|
+
var ENV3 = "development";
|
|
13202
|
+
function spotByPath(path) {
|
|
12947
13203
|
const element = this;
|
|
12948
13204
|
const arr = [].concat(path);
|
|
12949
13205
|
let active = import_tree.TREE[arr[0]];
|
|
@@ -12958,8 +13214,8 @@ var require_methods2 = __commonJS({
|
|
|
12958
13214
|
return;
|
|
12959
13215
|
}
|
|
12960
13216
|
return active;
|
|
12961
|
-
}
|
|
12962
|
-
|
|
13217
|
+
}
|
|
13218
|
+
function lookup3(param) {
|
|
12963
13219
|
const el = this;
|
|
12964
13220
|
let { parent } = el;
|
|
12965
13221
|
if ((0, import_utils32.isFunction)(param)) {
|
|
@@ -12980,8 +13236,8 @@ var require_methods2 = __commonJS({
|
|
|
12980
13236
|
return;
|
|
12981
13237
|
}
|
|
12982
13238
|
return parent;
|
|
12983
|
-
}
|
|
12984
|
-
|
|
13239
|
+
}
|
|
13240
|
+
function lookdown(param) {
|
|
12985
13241
|
var _a;
|
|
12986
13242
|
const el = this;
|
|
12987
13243
|
const { __ref: ref } = el;
|
|
@@ -13001,9 +13257,8 @@ var require_methods2 = __commonJS({
|
|
|
13001
13257
|
if (lookdown2)
|
|
13002
13258
|
return lookdown2;
|
|
13003
13259
|
}
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
var lookdownAll = function(param, results = []) {
|
|
13260
|
+
}
|
|
13261
|
+
function lookdownAll(param, results = []) {
|
|
13007
13262
|
var _a;
|
|
13008
13263
|
const el = this;
|
|
13009
13264
|
const { __ref: ref } = el;
|
|
@@ -13020,9 +13275,9 @@ var require_methods2 = __commonJS({
|
|
|
13020
13275
|
}
|
|
13021
13276
|
(_a = childElem == null ? void 0 : childElem.lookdownAll) == null ? void 0 : _a.call(childElem, param, results);
|
|
13022
13277
|
}
|
|
13023
|
-
return results.length ? results :
|
|
13024
|
-
}
|
|
13025
|
-
|
|
13278
|
+
return results.length ? results : void 0;
|
|
13279
|
+
}
|
|
13280
|
+
function setNodeStyles(params = {}) {
|
|
13026
13281
|
var _a;
|
|
13027
13282
|
const el = this;
|
|
13028
13283
|
if (!((_a = el.node) == null ? void 0 : _a.style))
|
|
@@ -13036,8 +13291,8 @@ var require_methods2 = __commonJS({
|
|
|
13036
13291
|
el.node.style[param] = value2;
|
|
13037
13292
|
}
|
|
13038
13293
|
return el;
|
|
13039
|
-
}
|
|
13040
|
-
|
|
13294
|
+
}
|
|
13295
|
+
function remove() {
|
|
13041
13296
|
const element = this;
|
|
13042
13297
|
if ((0, import_utils32.isFunction)(element.node.remove))
|
|
13043
13298
|
element.node.remove();
|
|
@@ -13048,36 +13303,35 @@ var require_methods2 = __commonJS({
|
|
|
13048
13303
|
delete element.parent[element.key];
|
|
13049
13304
|
if (element.parent.__ref)
|
|
13050
13305
|
element.parent.__ref.__children = (0, import_utils32.removeValueFromArray)(element.parent.__ref.__children, element.key);
|
|
13051
|
-
}
|
|
13052
|
-
|
|
13306
|
+
}
|
|
13307
|
+
function get(param) {
|
|
13053
13308
|
const element = this;
|
|
13054
13309
|
return element[param];
|
|
13055
|
-
}
|
|
13056
|
-
|
|
13310
|
+
}
|
|
13311
|
+
function setProps(param, options) {
|
|
13057
13312
|
const element = this;
|
|
13058
13313
|
if (!param || !element.props)
|
|
13059
13314
|
return;
|
|
13060
13315
|
element.update({ props: param }, options);
|
|
13061
13316
|
return element;
|
|
13062
|
-
}
|
|
13317
|
+
}
|
|
13063
13318
|
var defineSetter = (element, key, get2, set3) => Object.defineProperty(element, key, { get: get2, set: set3 });
|
|
13064
|
-
|
|
13319
|
+
function keys() {
|
|
13065
13320
|
const element = this;
|
|
13066
13321
|
const keys2 = [];
|
|
13067
13322
|
for (const param in element) {
|
|
13068
|
-
if (import_mixins.registry[param] && !import_mixins.parseFilters.elementKeys.includes(param)) {
|
|
13323
|
+
if (import_mixins.registry[param] && !import_mixins.parseFilters.elementKeys.includes(param) || Object.hasOwnProperty.call(element, param)) {
|
|
13069
13324
|
continue;
|
|
13070
13325
|
}
|
|
13071
13326
|
keys2.push(param);
|
|
13072
13327
|
}
|
|
13073
13328
|
return keys2;
|
|
13074
|
-
}
|
|
13075
|
-
|
|
13329
|
+
}
|
|
13330
|
+
function parse4(excl = []) {
|
|
13076
13331
|
const element = this;
|
|
13077
13332
|
const obj = {};
|
|
13078
13333
|
const keyList = keys.call(element);
|
|
13079
13334
|
keyList.forEach((v) => {
|
|
13080
|
-
var _a;
|
|
13081
13335
|
if (excl.includes(v))
|
|
13082
13336
|
return;
|
|
13083
13337
|
const val = element[v];
|
|
@@ -13093,12 +13347,12 @@ var require_methods2 = __commonJS({
|
|
|
13093
13347
|
} else if (v === "props") {
|
|
13094
13348
|
const { __element, update, ...props2 } = element[v];
|
|
13095
13349
|
obj[v] = props2;
|
|
13096
|
-
} else if ((0, import_utils32.isDefined)(val) &&
|
|
13350
|
+
} else if ((0, import_utils32.isDefined)(val) && Object.hasOwnProperty.call(element, v))
|
|
13097
13351
|
obj[v] = val;
|
|
13098
13352
|
});
|
|
13099
13353
|
return obj;
|
|
13100
|
-
}
|
|
13101
|
-
|
|
13354
|
+
}
|
|
13355
|
+
function parseDeep(excl = []) {
|
|
13102
13356
|
const element = this;
|
|
13103
13357
|
const obj = parse4.call(element, excl);
|
|
13104
13358
|
for (const v in obj) {
|
|
@@ -13109,32 +13363,54 @@ var require_methods2 = __commonJS({
|
|
|
13109
13363
|
}
|
|
13110
13364
|
}
|
|
13111
13365
|
return obj;
|
|
13112
|
-
}
|
|
13113
|
-
|
|
13366
|
+
}
|
|
13367
|
+
function verbose(...args) {
|
|
13368
|
+
if (ENV3 !== "test" && ENV3 !== "development")
|
|
13369
|
+
return;
|
|
13114
13370
|
const element = this;
|
|
13115
|
-
const { __ref } = element;
|
|
13116
|
-
console.
|
|
13371
|
+
const { __ref: ref } = element;
|
|
13372
|
+
console.groupCollapsed(element.key);
|
|
13117
13373
|
if (args.length) {
|
|
13118
13374
|
args.forEach((v) => console.log(`%c${v}:
|
|
13119
13375
|
`, "font-weight: bold", element[v]));
|
|
13120
13376
|
} else {
|
|
13121
|
-
console.log(
|
|
13377
|
+
console.log(ref.path);
|
|
13122
13378
|
const keys2 = element.keys();
|
|
13123
13379
|
keys2.forEach((v) => console.log(`%c${v}:
|
|
13124
13380
|
`, "font-weight: bold", element[v]));
|
|
13125
13381
|
}
|
|
13126
13382
|
console.groupEnd(element.key);
|
|
13127
13383
|
return element;
|
|
13128
|
-
}
|
|
13129
|
-
|
|
13384
|
+
}
|
|
13385
|
+
function log(...params) {
|
|
13386
|
+
if (ENV3 === "test" || ENV3 === "development") {
|
|
13387
|
+
console.log(...params);
|
|
13388
|
+
}
|
|
13389
|
+
}
|
|
13390
|
+
function warn(...params) {
|
|
13391
|
+
if (ENV3 === "test" || ENV3 === "development") {
|
|
13392
|
+
console.warn(...params);
|
|
13393
|
+
}
|
|
13394
|
+
}
|
|
13395
|
+
function error(...params) {
|
|
13396
|
+
var _a, _b;
|
|
13397
|
+
if (ENV3 === "test" || ENV3 === "development") {
|
|
13398
|
+
if ((_a = params[params.length - 1]) == null ? void 0 : _a.debugger)
|
|
13399
|
+
debugger;
|
|
13400
|
+
console.error(...params);
|
|
13401
|
+
if ((_b = params[params.length - 1]) == null ? void 0 : _b.verbose)
|
|
13402
|
+
this.verbose();
|
|
13403
|
+
}
|
|
13404
|
+
}
|
|
13405
|
+
function nextElement() {
|
|
13130
13406
|
const element = this;
|
|
13131
13407
|
const { key, parent } = element;
|
|
13132
13408
|
const { __children } = parent.__ref;
|
|
13133
13409
|
const currentIndex = __children.indexOf(key);
|
|
13134
13410
|
const nextChild = __children[currentIndex + 1];
|
|
13135
13411
|
return parent[nextChild];
|
|
13136
|
-
}
|
|
13137
|
-
|
|
13412
|
+
}
|
|
13413
|
+
function previousElement(el) {
|
|
13138
13414
|
const element = el || this;
|
|
13139
13415
|
const { key, parent } = element;
|
|
13140
13416
|
const { __children } = parent.__ref;
|
|
@@ -13142,8 +13418,8 @@ var require_methods2 = __commonJS({
|
|
|
13142
13418
|
return;
|
|
13143
13419
|
const currentIndex = __children.indexOf(key);
|
|
13144
13420
|
return parent[__children[currentIndex - 1]];
|
|
13145
|
-
}
|
|
13146
|
-
|
|
13421
|
+
}
|
|
13422
|
+
function variables(obj = {}) {
|
|
13147
13423
|
const element = this;
|
|
13148
13424
|
if (!element.data)
|
|
13149
13425
|
element.data = {};
|
|
@@ -13177,7 +13453,7 @@ var require_methods2 = __commonJS({
|
|
|
13177
13453
|
}, timeout);
|
|
13178
13454
|
}
|
|
13179
13455
|
};
|
|
13180
|
-
}
|
|
13456
|
+
}
|
|
13181
13457
|
var METHODS = [
|
|
13182
13458
|
"set",
|
|
13183
13459
|
"reset",
|
|
@@ -13197,13 +13473,16 @@ var require_methods2 = __commonJS({
|
|
|
13197
13473
|
"variables",
|
|
13198
13474
|
"if",
|
|
13199
13475
|
"log",
|
|
13476
|
+
"verbose",
|
|
13477
|
+
"warn",
|
|
13478
|
+
"error",
|
|
13200
13479
|
"nextElement",
|
|
13201
13480
|
"previousElement"
|
|
13202
13481
|
];
|
|
13203
|
-
|
|
13482
|
+
function isMethod(param, element) {
|
|
13204
13483
|
var _a, _b;
|
|
13205
13484
|
return METHODS.includes(param) || ((_b = (_a = element == null ? void 0 : element.context) == null ? void 0 : _a.methods) == null ? void 0 : _b[param]);
|
|
13206
|
-
}
|
|
13485
|
+
}
|
|
13207
13486
|
}
|
|
13208
13487
|
});
|
|
13209
13488
|
|
|
@@ -13633,7 +13912,7 @@ var require_update2 = __commonJS({
|
|
|
13633
13912
|
if (beforeUpdateReturns === false)
|
|
13634
13913
|
return element;
|
|
13635
13914
|
}
|
|
13636
|
-
(0, import_utils32.overwriteDeep)(element, params, import_utils210.METHODS_EXL);
|
|
13915
|
+
(0, import_utils32.overwriteDeep)(element, params, { exclude: import_utils210.METHODS_EXL });
|
|
13637
13916
|
(0, import_iterate.throughExecProps)(element);
|
|
13638
13917
|
(0, import_iterate.throughUpdatedExec)(element, { ignore: UPDATE_DEFAULT_OPTIONS });
|
|
13639
13918
|
(0, import_iterate.throughUpdatedDefine)(element);
|
|
@@ -13852,7 +14131,7 @@ var require_set2 = __commonJS({
|
|
|
13852
14131
|
var import_update = __toESM2(require_update2(), 1);
|
|
13853
14132
|
var import__ = require_methods2();
|
|
13854
14133
|
var import_content = require_content();
|
|
13855
|
-
var addMethods = (element, parent, options) => {
|
|
14134
|
+
var addMethods = (element, parent, options = {}) => {
|
|
13856
14135
|
const proto = {
|
|
13857
14136
|
set: import_set.default,
|
|
13858
14137
|
reset: import_set.reset,
|
|
@@ -13871,12 +14150,14 @@ var require_set2 = __commonJS({
|
|
|
13871
14150
|
parseDeep: import__.parseDeep,
|
|
13872
14151
|
keys: import__.keys,
|
|
13873
14152
|
nextElement: import__.nextElement,
|
|
13874
|
-
previousElement: import__.previousElement
|
|
14153
|
+
previousElement: import__.previousElement,
|
|
14154
|
+
log: import__.log,
|
|
14155
|
+
verbose: import__.verbose,
|
|
14156
|
+
warn: import__.warn,
|
|
14157
|
+
error: import__.error
|
|
13875
14158
|
};
|
|
13876
14159
|
if (element.context.methods)
|
|
13877
|
-
(
|
|
13878
|
-
if ((0, import_utils32.isDevelopment)())
|
|
13879
|
-
proto.log = import__.log;
|
|
14160
|
+
(options.strict ? import_utils32.merge : import_utils32.overwrite)(proto, element.context.methods);
|
|
13880
14161
|
Object.setPrototypeOf(element, proto);
|
|
13881
14162
|
};
|
|
13882
14163
|
}
|
|
@@ -13955,13 +14236,13 @@ var require_create4 = __commonJS({
|
|
|
13955
14236
|
}
|
|
13956
14237
|
switchDefaultOptions(element, parent, options);
|
|
13957
14238
|
addCaching(element, parent);
|
|
13958
|
-
(0, import_set.addMethods)(element, parent);
|
|
14239
|
+
(0, import_set.addMethods)(element, parent, options);
|
|
13959
14240
|
createScope(element, parent);
|
|
13960
14241
|
(0, import_state2.createState)(element, parent);
|
|
13961
14242
|
if (element.scope === "state")
|
|
13962
14243
|
element.scope = element.state;
|
|
13963
14244
|
createIfConditionFlag(element, parent);
|
|
13964
|
-
(0, import_props.createProps)(element, parent);
|
|
14245
|
+
(0, import_props.createProps)(element, parent, options);
|
|
13965
14246
|
if (element.scope === "props" || element.scope === true)
|
|
13966
14247
|
element.scope = element.props;
|
|
13967
14248
|
createIfConditionFlag(element, parent);
|
|
@@ -14056,7 +14337,7 @@ var require_create4 = __commonJS({
|
|
|
14056
14337
|
};
|
|
14057
14338
|
var visitedElements = /* @__PURE__ */ new WeakMap();
|
|
14058
14339
|
var renderElement = (element, parent, options, attachOptions) => {
|
|
14059
|
-
var _a, _b;
|
|
14340
|
+
var _a, _b, _c, _d;
|
|
14060
14341
|
if (visitedElements.has(element)) {
|
|
14061
14342
|
if (ENV3 === "test" || ENV3 === "development")
|
|
14062
14343
|
console.warn("Cyclic rendering detected:", element.__ref.path);
|
|
@@ -14077,9 +14358,13 @@ var require_create4 = __commonJS({
|
|
|
14077
14358
|
if (path.includes("demoComponent"))
|
|
14078
14359
|
path.splice(0, path.indexOf("demoComponent") + 1);
|
|
14079
14360
|
const isDemoComponent = (_b = (_a = element.lookup((el) => el.state.key)) == null ? void 0 : _a.state) == null ? void 0 : _b.key;
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14361
|
+
element.warn("Error happened in:", isDemoComponent ? isDemoComponent + " " : "" + path.join("."));
|
|
14362
|
+
element.verbose();
|
|
14363
|
+
element.error(e, options);
|
|
14364
|
+
if ((_c = element.on) == null ? void 0 : _c.error)
|
|
14365
|
+
element.on.error(e, element, element.state, element.context, options);
|
|
14366
|
+
if ((_d = element.props) == null ? void 0 : _d.onError)
|
|
14367
|
+
element.props.onError(e, element, element.state, element.context, options);
|
|
14083
14368
|
}
|
|
14084
14369
|
}
|
|
14085
14370
|
if (!ref.__if) {
|
|
@@ -14160,13 +14445,13 @@ var require_create4 = __commonJS({
|
|
|
14160
14445
|
const { __ref: ref } = element;
|
|
14161
14446
|
if (!ref.__skipCreate) {
|
|
14162
14447
|
addCaching(element, parent);
|
|
14163
|
-
(0, import_set.addMethods)(element, parent);
|
|
14448
|
+
(0, import_set.addMethods)(element, parent, options);
|
|
14164
14449
|
createScope(element, parent);
|
|
14165
14450
|
(0, import_state2.createState)(element, parent);
|
|
14166
14451
|
if (element.scope === "state")
|
|
14167
14452
|
element.scope = element.state;
|
|
14168
14453
|
createIfConditionFlag(element, parent);
|
|
14169
|
-
(0, import_props.createProps)(element, parent);
|
|
14454
|
+
(0, import_props.createProps)(element, parent, options);
|
|
14170
14455
|
if (element.scope === "props" || element.scope === true)
|
|
14171
14456
|
element.scope = element.props;
|
|
14172
14457
|
if (element.node && ref.__if) {
|
|
@@ -19010,9 +19295,14 @@ var Circle = {
|
|
|
19010
19295
|
|
|
19011
19296
|
// ../uikit/Icon/index.js
|
|
19012
19297
|
var import_utils15 = __toESM(require_cjs());
|
|
19298
|
+
var inheritFromIsActive = (el) => {
|
|
19299
|
+
const { props: props2 } = el;
|
|
19300
|
+
const propsActive = props2[".isActive"];
|
|
19301
|
+
return el.call("exec", propsActive.name || propsActive.icon);
|
|
19302
|
+
};
|
|
19013
19303
|
var getIconName = (el, s) => {
|
|
19014
19304
|
const { key, props: props2, deps } = el;
|
|
19015
|
-
let iconName = (
|
|
19305
|
+
let iconName = el.call("exec", props2.name || props2.icon || key, el);
|
|
19016
19306
|
if ((0, import_utils15.isString)(iconName) && iconName.includes("{{")) {
|
|
19017
19307
|
iconName = deps.replaceLiteralsWithObjectFields(iconName, s);
|
|
19018
19308
|
}
|
|
@@ -19021,70 +19311,50 @@ var getIconName = (el, s) => {
|
|
|
19021
19311
|
var Icon = {
|
|
19022
19312
|
extend: "Svg",
|
|
19023
19313
|
deps: { isString: import_utils15.isString, replaceLiteralsWithObjectFields: import_utils15.replaceLiteralsWithObjectFields },
|
|
19024
|
-
props: (el, s) => {
|
|
19025
|
-
const { props: props2, parent,
|
|
19026
|
-
const { ICONS,
|
|
19027
|
-
const { toCamelCase } =
|
|
19028
|
-
|
|
19314
|
+
props: (el, s, ctx) => {
|
|
19315
|
+
const { props: props2, parent, deps } = el;
|
|
19316
|
+
const { ICONS, useIconSprite, verbose } = ctx && ctx.designSystem;
|
|
19317
|
+
const { toCamelCase } = ctx && ctx.utils;
|
|
19318
|
+
const iconName = getIconName(el, s);
|
|
19029
19319
|
const camelCase = toCamelCase(iconName);
|
|
19030
19320
|
const isArray5 = camelCase.split(/([a-z])([A-Z])/g);
|
|
19031
|
-
const
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
const iconKey = iconName.includes(".") ? "sfsymbols." + iconName.split(".").slice(1).join(".") : "sfsymbols";
|
|
19035
|
-
iconName = semanticIcon[iconKey] || semanticIcon[iconName.split(".")[0].split(" ")[0]];
|
|
19036
|
-
return {
|
|
19037
|
-
tag: "span",
|
|
19038
|
-
semantic_symbols: true,
|
|
19039
|
-
width: "A",
|
|
19040
|
-
height: "A",
|
|
19041
|
-
lineHeight: "1em",
|
|
19042
|
-
":after": {
|
|
19043
|
-
fontSize: "Z",
|
|
19044
|
-
fontWeight: "300",
|
|
19045
|
-
content: `"${iconName}"`,
|
|
19046
|
-
textAlign: "center",
|
|
19047
|
-
display: "inline-block",
|
|
19048
|
-
style: {
|
|
19049
|
-
color: "currentColor",
|
|
19050
|
-
fontFamily: "'SF Pro Icons', 'SF Pro', 'SF Symbols', 'Segoe UI'"
|
|
19051
|
-
}
|
|
19052
|
-
}
|
|
19053
|
-
};
|
|
19054
|
-
}
|
|
19321
|
+
const semanticIcon = getSemanticIcon(el, s, ctx);
|
|
19322
|
+
if (semanticIcon)
|
|
19323
|
+
return semanticIcon;
|
|
19055
19324
|
let activeIconName;
|
|
19056
|
-
if (props2.isActive)
|
|
19057
|
-
activeIconName =
|
|
19058
|
-
|
|
19059
|
-
|
|
19325
|
+
if (props2.isActive)
|
|
19326
|
+
activeIconName = inheritFromIsActive(el);
|
|
19327
|
+
const parentProps = parent.props;
|
|
19328
|
+
const parentPropsActive = parentProps[".isActive"];
|
|
19329
|
+
if (parent && parentProps && parentProps.isActive && parentPropsActive && parentPropsActive.icon) {
|
|
19060
19330
|
activeIconName = (0, import_utils15.exec)(
|
|
19061
|
-
|
|
19331
|
+
parentPropsActive.icon || parentPropsActive.Icon.name || parentPropsActive.Icon.icon,
|
|
19062
19332
|
el
|
|
19063
19333
|
);
|
|
19064
19334
|
}
|
|
19065
19335
|
if ((0, import_utils15.isString)(activeIconName) && activeIconName.includes("{{")) {
|
|
19066
|
-
activeIconName = deps.replaceLiteralsWithObjectFields(activeIconName,
|
|
19336
|
+
activeIconName = deps.replaceLiteralsWithObjectFields(activeIconName, s);
|
|
19067
19337
|
}
|
|
19068
|
-
let
|
|
19338
|
+
let iconInContext;
|
|
19069
19339
|
if (ICONS[activeIconName])
|
|
19070
|
-
|
|
19340
|
+
iconInContext = activeIconName;
|
|
19071
19341
|
if (ICONS[camelCase])
|
|
19072
|
-
|
|
19342
|
+
iconInContext = camelCase;
|
|
19073
19343
|
else if (ICONS[isArray5[0] + isArray5[1]])
|
|
19074
|
-
|
|
19344
|
+
iconInContext = isArray5[0] + isArray5[1];
|
|
19075
19345
|
else if (ICONS[isArray5[0]])
|
|
19076
|
-
|
|
19346
|
+
iconInContext = isArray5[0];
|
|
19077
19347
|
else {
|
|
19078
19348
|
if (verbose)
|
|
19079
|
-
|
|
19349
|
+
el.warn("Can't find icon:", iconName, iconInContext);
|
|
19080
19350
|
}
|
|
19081
|
-
const iconFromLibrary = ICONS[
|
|
19351
|
+
const iconFromLibrary = ICONS[iconInContext];
|
|
19082
19352
|
const directSrc = parent && parent.props && parent.props.src || props2.src;
|
|
19083
19353
|
return {
|
|
19084
19354
|
width: "A",
|
|
19085
19355
|
height: "A",
|
|
19086
19356
|
display: "inline-block",
|
|
19087
|
-
spriteId: useIconSprite &&
|
|
19357
|
+
spriteId: useIconSprite && iconInContext,
|
|
19088
19358
|
src: iconFromLibrary || directSrc || ICONS.noIcon,
|
|
19089
19359
|
style: { fill: "currentColor", "*": { fill: "currentColor" } }
|
|
19090
19360
|
};
|
|
@@ -19098,7 +19368,7 @@ var IconText = {
|
|
|
19098
19368
|
lineHeight: 1
|
|
19099
19369
|
},
|
|
19100
19370
|
Icon: {
|
|
19101
|
-
props: (
|
|
19371
|
+
props: (el) => ({ icon: el.call("exec", el.parent.props.icon, el.parent) }),
|
|
19102
19372
|
if: ({ parent, props: props2 }) => {
|
|
19103
19373
|
return parent.props.icon || parent.props.Icon || props2.name || props2.icon || props2.sfSymbols || parent.props.sfSymbols;
|
|
19104
19374
|
}
|
|
@@ -19125,6 +19395,37 @@ var FileIcon = {
|
|
|
19125
19395
|
icon: "file"
|
|
19126
19396
|
}
|
|
19127
19397
|
};
|
|
19398
|
+
var getSemanticIcon = (el, s, ctx) => {
|
|
19399
|
+
const { SEMANTIC_ICONS } = ctx && ctx.designSystem;
|
|
19400
|
+
const { toCamelCase } = ctx && ctx.utils;
|
|
19401
|
+
let iconName = getIconName(el, s);
|
|
19402
|
+
const camelCase = toCamelCase(iconName);
|
|
19403
|
+
const isArray5 = camelCase.split(/([a-z])([A-Z])/g);
|
|
19404
|
+
const semanticIconRootName = isArray5[1] ? isArray5[0] : iconName.split(".")[0].split(" ")[0];
|
|
19405
|
+
const semanticIcon = SEMANTIC_ICONS && SEMANTIC_ICONS[semanticIconRootName];
|
|
19406
|
+
if (semanticIcon) {
|
|
19407
|
+
const iconKey = iconName.includes(".") ? "sfsymbols." + iconName.split(".").slice(1).join(".") : "sfsymbols";
|
|
19408
|
+
iconName = semanticIcon[iconKey] || semanticIcon[iconName.split(".")[0].split(" ")[0]];
|
|
19409
|
+
return {
|
|
19410
|
+
tag: "span",
|
|
19411
|
+
semantic_symbols: true,
|
|
19412
|
+
width: "A",
|
|
19413
|
+
height: "A",
|
|
19414
|
+
lineHeight: "1em",
|
|
19415
|
+
":after": {
|
|
19416
|
+
fontSize: "Z",
|
|
19417
|
+
fontWeight: "300",
|
|
19418
|
+
content: `"${iconName}"`,
|
|
19419
|
+
textAlign: "center",
|
|
19420
|
+
display: "inline-block",
|
|
19421
|
+
style: {
|
|
19422
|
+
color: "currentColor",
|
|
19423
|
+
fontFamily: "'SF Pro Icons', 'SF Pro', 'SF Symbols', 'Segoe UI'"
|
|
19424
|
+
}
|
|
19425
|
+
}
|
|
19426
|
+
};
|
|
19427
|
+
}
|
|
19428
|
+
};
|
|
19128
19429
|
|
|
19129
19430
|
// ../uikit/Indicator/StatusIndicator.js
|
|
19130
19431
|
var StatusIndicator = {
|
|
@@ -19513,12 +19814,14 @@ var Input = {
|
|
|
19513
19814
|
name: ({ props: props2 }) => props2.name,
|
|
19514
19815
|
autocomplete: ({ props: props2 }) => props2.autocomplete,
|
|
19515
19816
|
placeholder: ({ props: props2 }) => props2.placeholder,
|
|
19516
|
-
value: (
|
|
19517
|
-
const {
|
|
19518
|
-
|
|
19519
|
-
|
|
19817
|
+
value: (el, s) => {
|
|
19818
|
+
const { props: props2, state, deps } = el;
|
|
19819
|
+
const { isString: isString13, exec: exec7, replaceLiteralsWithObjectFields: replaceLiteralsWithObjectFields3 } = deps;
|
|
19820
|
+
const val = exec7(props2.value, el);
|
|
19821
|
+
if (isString13(val) && val.includes("{{")) {
|
|
19822
|
+
return replaceLiteralsWithObjectFields3(val, state);
|
|
19520
19823
|
}
|
|
19521
|
-
return
|
|
19824
|
+
return val;
|
|
19522
19825
|
},
|
|
19523
19826
|
disabled: ({ props: props2 }) => props2.disabled || null,
|
|
19524
19827
|
readonly: ({ props: props2 }) => props2.readonly,
|