amis-core 2.9.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.d.ts +89 -4
- package/esm/Root.js +15 -4
- package/esm/RootRenderer.d.ts +3 -1
- package/esm/RootRenderer.js +9 -3
- package/esm/SchemaRenderer.d.ts +4 -2
- package/esm/SchemaRenderer.js +32 -24
- package/esm/Scoped.d.ts +8 -0
- package/esm/Scoped.js +20 -5
- package/esm/StatusScoped.d.ts +58 -0
- package/esm/StatusScoped.js +54 -0
- package/esm/WithRootStore.d.ts +2 -2
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +6 -2
- package/esm/actions/Action.d.ts +1 -0
- package/esm/actions/Action.js +19 -5
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +8 -7
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +4 -4
- package/esm/actions/DialogAction.d.ts +16 -2
- package/esm/actions/DialogAction.js +23 -7
- package/esm/actions/DrawerAction.js +1 -1
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/components/CustomStyle.d.ts +13 -0
- package/esm/components/CustomStyle.js +18 -0
- package/esm/components/LazyComponent.d.ts +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.d.ts +3 -3
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.d.ts +2 -2
- package/esm/components/PopOver.js +1 -1
- package/esm/env.d.ts +10 -2
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -5
- package/esm/factory.d.ts +5 -3
- package/esm/factory.js +3 -3
- package/esm/index.d.ts +11 -4
- package/esm/index.js +55 -33
- package/esm/locale.d.ts +2 -2
- package/esm/locale.js +10 -3
- package/esm/renderers/Form.d.ts +3 -2
- package/esm/renderers/Form.js +216 -180
- package/esm/renderers/Item.d.ts +55 -41
- package/esm/renderers/Item.js +30 -19
- package/esm/renderers/Options.js +11 -4
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/register.js +1 -1
- package/esm/renderers/wrapControl.d.ts +2 -2
- package/esm/renderers/wrapControl.js +13 -16
- package/esm/store/app.d.ts +1 -0
- package/esm/store/app.js +1 -1
- package/esm/store/combo.d.ts +3 -0
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +2 -0
- package/esm/store/crud.js +31 -9
- package/esm/store/form.d.ts +1 -0
- package/esm/store/form.js +10 -4
- package/esm/store/formItem.js +2 -2
- package/esm/store/iRenderer.d.ts +1 -0
- package/esm/store/iRenderer.js +54 -13
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +1 -0
- package/esm/store/list.js +7 -3
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +1 -0
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +1 -0
- package/esm/store/pagination.js +2 -2
- package/esm/store/root.d.ts +4 -6
- package/esm/store/root.js +53 -24
- package/esm/store/service.d.ts +1 -0
- package/esm/store/service.js +1 -1
- package/esm/store/status.d.ts +12 -0
- package/esm/store/status.js +38 -0
- package/esm/store/table.d.ts +28 -23
- package/esm/store/table.js +26 -5
- package/esm/store/table2.d.ts +7 -6
- package/esm/store/table2.js +27 -23
- package/esm/theme.d.ts +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +7 -1
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.d.ts +3 -5
- package/esm/utils/DataScope.js +88 -31
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.js +14 -5
- package/esm/utils/attachmentAdpator.js +2 -2
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.d.ts +7 -0
- package/esm/utils/date.js +34 -2
- package/esm/utils/debug.js +4 -4
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.d.ts +3 -0
- package/esm/utils/dom.js +47 -10
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.js +2 -2
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +3 -3
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +9 -2
- package/esm/utils/helper.js +52 -20
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +6 -1
- package/esm/utils/icon.js +6 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/isPureVariable.js +3 -3
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/memoryParse.d.ts +17 -0
- package/esm/utils/memoryParse.js +26 -0
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +4 -2
- package/esm/utils/object.d.ts +2 -0
- package/esm/utils/object.js +27 -2
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/renderer-event.js +35 -32
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.d.ts +1 -0
- package/esm/utils/resolveCondition.js +19 -4
- package/esm/utils/resolveVariable.js +4 -3
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.d.ts +6 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +23 -5
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.d.ts +12 -4
- package/esm/utils/style-helper.js +96 -19
- package/esm/utils/style.js +2 -2
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.d.ts +2 -1
- package/esm/utils/tpl-builtin.js +19 -2
- package/esm/utils/tpl-lodash.js +3 -2
- package/esm/utils/tpl.d.ts +2 -0
- package/esm/utils/tpl.js +24 -2
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validations.d.ts +4 -1
- package/esm/utils/validations.js +27 -12
- package/lib/Root.d.ts +89 -4
- package/lib/Root.js +15 -4
- package/lib/RootRenderer.d.ts +3 -1
- package/lib/RootRenderer.js +8 -2
- package/lib/SchemaRenderer.d.ts +4 -2
- package/lib/SchemaRenderer.js +32 -23
- package/lib/Scoped.d.ts +8 -0
- package/lib/Scoped.js +20 -4
- package/lib/StatusScoped.d.ts +58 -0
- package/lib/StatusScoped.js +63 -0
- package/lib/WithRootStore.d.ts +2 -2
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +6 -2
- package/lib/actions/Action.d.ts +1 -0
- package/lib/actions/Action.js +19 -5
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +8 -7
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +4 -4
- package/lib/actions/DialogAction.d.ts +16 -2
- package/lib/actions/DialogAction.js +23 -7
- package/lib/actions/DrawerAction.js +1 -1
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/components/CustomStyle.d.ts +13 -0
- package/lib/components/CustomStyle.js +22 -0
- package/lib/components/LazyComponent.d.ts +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.d.ts +3 -3
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.d.ts +2 -2
- package/lib/components/PopOver.js +1 -1
- package/lib/env.d.ts +10 -2
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -5
- package/lib/factory.d.ts +5 -3
- package/lib/factory.js +3 -3
- package/lib/index.d.ts +11 -4
- package/lib/index.js +61 -23
- package/lib/locale.d.ts +2 -2
- package/lib/locale.js +10 -3
- package/lib/renderers/Form.d.ts +3 -2
- package/lib/renderers/Form.js +215 -179
- package/lib/renderers/Item.d.ts +55 -41
- package/lib/renderers/Item.js +30 -19
- package/lib/renderers/Options.js +11 -4
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/register.js +1 -1
- package/lib/renderers/wrapControl.d.ts +2 -2
- package/lib/renderers/wrapControl.js +12 -15
- package/lib/store/app.d.ts +1 -0
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +3 -0
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +2 -0
- package/lib/store/crud.js +31 -9
- package/lib/store/form.d.ts +1 -0
- package/lib/store/form.js +10 -4
- package/lib/store/formItem.js +2 -2
- package/lib/store/iRenderer.d.ts +1 -0
- package/lib/store/iRenderer.js +53 -12
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +1 -0
- package/lib/store/list.js +7 -3
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +1 -0
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +1 -0
- package/lib/store/pagination.js +2 -2
- package/lib/store/root.d.ts +4 -6
- package/lib/store/root.js +52 -23
- package/lib/store/service.d.ts +1 -0
- package/lib/store/service.js +1 -1
- package/lib/store/status.d.ts +12 -0
- package/lib/store/status.js +42 -0
- package/lib/store/table.d.ts +28 -23
- package/lib/store/table.js +26 -5
- package/lib/store/table2.d.ts +7 -6
- package/lib/store/table2.js +27 -23
- package/lib/theme.d.ts +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +7 -1
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.d.ts +3 -5
- package/lib/utils/DataScope.js +86 -29
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.js +13 -4
- package/lib/utils/attachmentAdpator.js +2 -2
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.d.ts +7 -0
- package/lib/utils/date.js +34 -1
- package/lib/utils/debug.js +4 -4
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.d.ts +3 -0
- package/lib/utils/dom.js +48 -9
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.js +2 -2
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +3 -3
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +9 -2
- package/lib/utils/helper.js +53 -19
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.d.ts +6 -1
- package/lib/utils/icon.js +6 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/isPureVariable.js +3 -3
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/memoryParse.d.ts +17 -0
- package/lib/utils/memoryParse.js +30 -0
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +4 -2
- package/lib/utils/object.d.ts +2 -0
- package/lib/utils/object.js +28 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/renderer-event.js +35 -32
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.d.ts +1 -0
- package/lib/utils/resolveCondition.js +19 -3
- package/lib/utils/resolveVariable.js +3 -2
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.d.ts +6 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +22 -3
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.d.ts +12 -4
- package/lib/utils/style-helper.js +101 -18
- package/lib/utils/style.js +2 -2
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.d.ts +2 -1
- package/lib/utils/tpl-builtin.js +19 -2
- package/lib/utils/tpl-lodash.js +3 -2
- package/lib/utils/tpl.d.ts +2 -0
- package/lib/utils/tpl.js +24 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validations.d.ts +4 -1
- package/lib/utils/validations.js +27 -12
- package/package.json +3 -3
package/esm/utils/helper.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -544,22 +544,23 @@ var uuidv4 = function () {
|
|
|
544
544
|
* @param {Function} iterator 处理函数,返回的数据会被替换成新的。
|
|
545
545
|
* @return {Tree} 返回处理过的 tree
|
|
546
546
|
*/
|
|
547
|
-
function mapTree(tree, iterator, level, depthFirst, paths) {
|
|
547
|
+
function mapTree(tree, iterator, level, depthFirst, paths, indexes) {
|
|
548
548
|
if (level === void 0) { level = 1; }
|
|
549
549
|
if (depthFirst === void 0) { depthFirst = false; }
|
|
550
550
|
if (paths === void 0) { paths = []; }
|
|
551
|
+
if (indexes === void 0) { indexes = []; }
|
|
551
552
|
return tree.map(function (item, index) {
|
|
552
553
|
if (depthFirst) {
|
|
553
554
|
var children = item.children
|
|
554
|
-
? mapTree(item.children, iterator, level + 1, depthFirst, paths.concat(item))
|
|
555
|
+
? mapTree(item.children, iterator, level + 1, depthFirst, paths.concat(item), indexes.concat(index))
|
|
555
556
|
: undefined;
|
|
556
557
|
children && (item = __assign(__assign({}, item), { children: children }));
|
|
557
|
-
item = iterator(item, index, level, paths) || __assign({}, item);
|
|
558
|
+
item = iterator(item, index, level, paths, indexes.concat(index)) || __assign({}, item);
|
|
558
559
|
return item;
|
|
559
560
|
}
|
|
560
|
-
item = iterator(item, index, level, paths) || __assign({}, item);
|
|
561
|
+
item = iterator(item, index, level, paths, indexes.concat(index)) || __assign({}, item);
|
|
561
562
|
if (item.children && item.children.splice) {
|
|
562
|
-
item.children = mapTree(item.children, iterator, level + 1, depthFirst, paths.concat(item));
|
|
563
|
+
item.children = mapTree(item.children, iterator, level + 1, depthFirst, paths.concat(item), indexes.concat(index));
|
|
563
564
|
}
|
|
564
565
|
return item;
|
|
565
566
|
});
|
|
@@ -574,10 +575,9 @@ function eachTree(tree, iterator, level, paths) {
|
|
|
574
575
|
if (paths === void 0) { paths = []; }
|
|
575
576
|
tree.map(function (item, index) {
|
|
576
577
|
var _a;
|
|
577
|
-
|
|
578
|
-
iterator(item, index, level, currentPath);
|
|
578
|
+
iterator(item, index, level, paths);
|
|
579
579
|
if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.splice) {
|
|
580
|
-
eachTree(item.children, iterator, level + 1,
|
|
580
|
+
eachTree(item.children, iterator, level + 1, paths.concat(item));
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
583
|
}
|
|
@@ -597,6 +597,21 @@ function findTree(tree, iterator) {
|
|
|
597
597
|
});
|
|
598
598
|
return result;
|
|
599
599
|
}
|
|
600
|
+
/**
|
|
601
|
+
* 在树中查找节点。
|
|
602
|
+
* @param tree
|
|
603
|
+
* @param iterator
|
|
604
|
+
*/
|
|
605
|
+
function findTreeAll(tree, iterator) {
|
|
606
|
+
var result = [];
|
|
607
|
+
everyTree(tree, function (item, key, level, paths) {
|
|
608
|
+
if (iterator(item, key, level, paths)) {
|
|
609
|
+
result.push(item);
|
|
610
|
+
}
|
|
611
|
+
return true;
|
|
612
|
+
});
|
|
613
|
+
return result;
|
|
614
|
+
}
|
|
600
615
|
/**
|
|
601
616
|
* 在树中查找节点, 返回下标数组。
|
|
602
617
|
* @param tree
|
|
@@ -642,28 +657,29 @@ function getTree(tree, idx) {
|
|
|
642
657
|
* @param tree
|
|
643
658
|
* @param iterator
|
|
644
659
|
*/
|
|
645
|
-
function filterTree(tree, iterator, level, depthFirst) {
|
|
660
|
+
function filterTree(tree, iterator, level, depthFirst, paths) {
|
|
646
661
|
if (level === void 0) { level = 1; }
|
|
647
662
|
if (depthFirst === void 0) { depthFirst = false; }
|
|
663
|
+
if (paths === void 0) { paths = []; }
|
|
648
664
|
if (depthFirst) {
|
|
649
665
|
return tree
|
|
650
666
|
.map(function (item) {
|
|
651
667
|
var children = item.children
|
|
652
|
-
? filterTree(item.children, iterator, level + 1, depthFirst)
|
|
668
|
+
? filterTree(item.children, iterator, level + 1, depthFirst, paths.concat(item))
|
|
653
669
|
: undefined;
|
|
654
670
|
if (Array.isArray(children) && Array.isArray(item.children)) {
|
|
655
671
|
item = __assign(__assign({}, item), { children: children });
|
|
656
672
|
}
|
|
657
673
|
return item;
|
|
658
674
|
})
|
|
659
|
-
.filter(function (item, index) { return iterator(item, index, level); });
|
|
675
|
+
.filter(function (item, index) { return iterator(item, index, level, paths); });
|
|
660
676
|
}
|
|
661
677
|
return tree
|
|
662
|
-
.filter(function (item, index) { return iterator(item, index, level); })
|
|
678
|
+
.filter(function (item, index) { return iterator(item, index, level, paths); })
|
|
663
679
|
.map(function (item) {
|
|
664
680
|
var _a;
|
|
665
681
|
if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.splice) {
|
|
666
|
-
var children = filterTree(item.children, iterator, level + 1, depthFirst);
|
|
682
|
+
var children = filterTree(item.children, iterator, level + 1, depthFirst, paths.concat(item));
|
|
667
683
|
if (Array.isArray(children) && Array.isArray(item.children)) {
|
|
668
684
|
item = __assign(__assign({}, item), { children: children });
|
|
669
685
|
}
|
|
@@ -763,6 +779,9 @@ function spliceTree(tree, idx, deleteCount) {
|
|
|
763
779
|
* @param tree
|
|
764
780
|
*/
|
|
765
781
|
function getTreeDepth(tree) {
|
|
782
|
+
if (Array.isArray(tree) && tree.length === 0) {
|
|
783
|
+
return 0;
|
|
784
|
+
}
|
|
766
785
|
return Math.max.apply(Math, __spreadArray([], __read(tree.map(function (item) {
|
|
767
786
|
if (Array.isArray(item.children)) {
|
|
768
787
|
return 1 + getTreeDepth(item.children);
|
|
@@ -1003,6 +1022,16 @@ function loadScript(src) {
|
|
|
1003
1022
|
document.head.appendChild(script);
|
|
1004
1023
|
});
|
|
1005
1024
|
}
|
|
1025
|
+
function loadStyle(href) {
|
|
1026
|
+
return new Promise(function (ok, fail) {
|
|
1027
|
+
var link = document.createElement('link');
|
|
1028
|
+
link.rel = 'stylesheet';
|
|
1029
|
+
link.onerror = function (reason) { return fail(reason); };
|
|
1030
|
+
link.onload = function () { return ok(); };
|
|
1031
|
+
link.href = href;
|
|
1032
|
+
document.head.appendChild(link);
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1006
1035
|
var SkipOperation = /** @class */ (function (_super) {
|
|
1007
1036
|
__extends(SkipOperation, _super);
|
|
1008
1037
|
function SkipOperation() {
|
|
@@ -1177,7 +1206,7 @@ function isClickOnInput(e) {
|
|
|
1177
1206
|
var formItem;
|
|
1178
1207
|
if (!e.currentTarget.contains(target) ||
|
|
1179
1208
|
~['INPUT', 'TEXTAREA'].indexOf(target.tagName) ||
|
|
1180
|
-
((formItem = target.closest("button, a, [data-role=\"form-item\"]")) &&
|
|
1209
|
+
((formItem = target.closest("button, a, [data-role=\"form-item\"], label[data-role=\"checkbox\"]")) &&
|
|
1181
1210
|
e.currentTarget.contains(formItem))) {
|
|
1182
1211
|
return true;
|
|
1183
1212
|
}
|
|
@@ -1246,16 +1275,19 @@ function isNumeric(value) {
|
|
|
1246
1275
|
* @param location Location对象,或者类Location结构的对象
|
|
1247
1276
|
*/
|
|
1248
1277
|
function parseQuery(location) {
|
|
1249
|
-
var _a
|
|
1278
|
+
var _a;
|
|
1250
1279
|
var query = (location && !(location instanceof Location) && (location === null || location === void 0 ? void 0 : location.query)) ||
|
|
1251
1280
|
(location && (location === null || location === void 0 ? void 0 : location.search) && qsparse(location.search.substring(1))) ||
|
|
1252
1281
|
(window.location.search && qsparse(window.location.search.substring(1)));
|
|
1253
1282
|
/* 处理hash中的query */
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1256
|
-
|
|
1283
|
+
var hash = (_a = window.location) === null || _a === void 0 ? void 0 : _a.hash;
|
|
1284
|
+
var hashQuery = {};
|
|
1285
|
+
var idx = -1;
|
|
1286
|
+
if (typeof hash === 'string' && ~(idx = hash.indexOf('?'))) {
|
|
1287
|
+
hashQuery = qsparse(hash.substring(idx + 1));
|
|
1288
|
+
}
|
|
1257
1289
|
var normalizedQuery = isPlainObject(query) ? query : {};
|
|
1258
1290
|
return merge(normalizedQuery, hashQuery);
|
|
1259
1291
|
}
|
|
1260
1292
|
|
|
1261
|
-
export { JSONTraverse, SkipOperation, __uri, anyChanged, autobind, bulkBindFunctions, camel, chainEvents, chainFunctions, convertArrayValueToMoment, detectPropValueChanged, difference, eachTree, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, findTreeIndex, flattenTree, flattenTreeWithLeafNodes, getLevelFromClassName, getPropValue, getRange, getScrollParent, getScrollbarWidth, getTree, getTreeAncestors, getTreeDepth, getTreeParent, getWidthRate, guid, hasAbility, hasFile, hasOwnPropertyInPath, hasVisibleExpression, hashCode, immutableExtends, injectPropsToObject, isArrayChildrenModified, isBreakpoint, isClickOnInput, isDisabled, isEmpty, isMobile, isNumeric, isObjectShallowModified, isSuperDataModified, isUnfolded, isVisible, lcFirst, loadScript, makeColumnClassBuild, makeHorizontalDeeper, mapObject, mapTree, noop, normalizeNodePath, object2formData, omitControls, padArr, parseQuery, pickEventsProps, preventDefault, promisify, qsparse, qsstringify, range, removeHTMLTag, repeatCount, rmUndefined, someTree, sortArray, spliceTree, syncDataFromSuper, ucFirst, until, uuid, uuidv4, visibilityFilter };
|
|
1293
|
+
export { JSONTraverse, SkipOperation, __uri, anyChanged, autobind, bulkBindFunctions, camel, chainEvents, chainFunctions, convertArrayValueToMoment, detectPropValueChanged, difference, eachTree, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, findTreeAll, findTreeIndex, flattenTree, flattenTreeWithLeafNodes, getLevelFromClassName, getPropValue, getRange, getScrollParent, getScrollbarWidth, getTree, getTreeAncestors, getTreeDepth, getTreeParent, getWidthRate, guid, hasAbility, hasFile, hasOwnPropertyInPath, hasVisibleExpression, hashCode, immutableExtends, injectPropsToObject, isArrayChildrenModified, isBreakpoint, isClickOnInput, isDisabled, isEmpty, isMobile, isNumeric, isObjectShallowModified, isSuperDataModified, isUnfolded, isVisible, lcFirst, loadScript, loadStyle, makeColumnClassBuild, makeHorizontalDeeper, mapObject, mapTree, noop, normalizeNodePath, object2formData, omitControls, padArr, parseQuery, pickEventsProps, preventDefault, promisify, qsparse, qsstringify, range, removeHTMLTag, repeatCount, rmUndefined, someTree, sortArray, spliceTree, syncDataFromSuper, ucFirst, until, uuid, uuidv4, visibilityFilter };
|
package/esm/utils/highlight.js
CHANGED
package/esm/utils/icon.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ import { ClassNamesFn } from '../theme';
|
|
|
6
6
|
export interface IconCheckedSchema {
|
|
7
7
|
id: string;
|
|
8
8
|
name?: string;
|
|
9
|
+
svg?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IconCheckedSchemaNew {
|
|
12
|
+
type: 'icon';
|
|
13
|
+
icon: IconCheckedSchema;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
16
|
* 判断字符串来生成 i 或 img
|
|
@@ -13,4 +18,4 @@ export interface IconCheckedSchema {
|
|
|
13
18
|
* @param className 内部用的 className
|
|
14
19
|
* @param classNameProp amis 配置里设置的 className
|
|
15
20
|
*/
|
|
16
|
-
export declare const generateIcon: (cx: ClassNamesFn, icon?: string | IconCheckedSchema | React.ReactNode, className?: string, classNameProp?: string) => JSX.Element | null | undefined;
|
|
21
|
+
export declare const generateIcon: (cx: ClassNamesFn, icon?: string | IconCheckedSchema | React.ReactNode | IconCheckedSchemaNew, className?: string, classNameProp?: string) => React.JSX.Element | null | undefined;
|
package/esm/utils/icon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -16,6 +16,11 @@ import { isObject } from 'lodash';
|
|
|
16
16
|
* @param classNameProp amis 配置里设置的 className
|
|
17
17
|
*/
|
|
18
18
|
var generateIcon = function (cx, icon, className, classNameProp) {
|
|
19
|
+
if (isObject(icon) &&
|
|
20
|
+
icon.type === 'icon' &&
|
|
21
|
+
icon.icon) {
|
|
22
|
+
icon = icon.icon;
|
|
23
|
+
}
|
|
19
24
|
if (React.isValidElement(icon)) {
|
|
20
25
|
return icon;
|
|
21
26
|
}
|
package/esm/utils/image.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { memoryParse } from './memoryParse.js';
|
|
7
7
|
|
|
8
8
|
function isPureVariable(path) {
|
|
9
9
|
if (typeof path === 'string') {
|
|
10
10
|
try {
|
|
11
|
-
var ast =
|
|
11
|
+
var ast = memoryParse(path);
|
|
12
12
|
// 只有一个成员说明是纯表达式模式
|
|
13
13
|
return ast.body.length === 1 && ast.body[0].type === 'script';
|
|
14
14
|
}
|
package/esm/utils/keyToPath.js
CHANGED
package/esm/utils/makeSorter.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function memoryParse(input: string, options?: {
|
|
2
|
+
/**
|
|
3
|
+
* 直接是运算表达式?还是从模板开始 ${} 里面才算运算表达式
|
|
4
|
+
*/
|
|
5
|
+
evalMode?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* 只支持取变量。
|
|
8
|
+
*/
|
|
9
|
+
variableMode?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 是否允许 filter 语法,比如:
|
|
12
|
+
*
|
|
13
|
+
* ${abc | html}
|
|
14
|
+
*/
|
|
15
|
+
allowFilter?: boolean;
|
|
16
|
+
variableNamespaces?: Array<string>;
|
|
17
|
+
}): any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-core v3.1.0
|
|
3
|
+
* Copyright 2018-2023 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { parse } from 'amis-formula';
|
|
7
|
+
|
|
8
|
+
var cache = {};
|
|
9
|
+
function memoryParse(input, options) {
|
|
10
|
+
if (options === void 0) { options = {
|
|
11
|
+
evalMode: false
|
|
12
|
+
}; }
|
|
13
|
+
// @todo 优化内存缓存释放,比如只缓存最高频的模版
|
|
14
|
+
if (typeof input !== 'string') {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
var key = input + JSON.stringify(options);
|
|
18
|
+
if (cache[key]) {
|
|
19
|
+
return cache[key];
|
|
20
|
+
}
|
|
21
|
+
var ast = parse(input, options);
|
|
22
|
+
cache[key] = ast;
|
|
23
|
+
return ast;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { memoryParse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -50,7 +50,9 @@ function normalizeOptions(options, share, valueField) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
else if (Array.isArray(options)) {
|
|
53
|
-
return options
|
|
53
|
+
return options
|
|
54
|
+
.filter(function (item) { return item !== null && item !== undefined; })
|
|
55
|
+
.map(function (item) {
|
|
54
56
|
var _a;
|
|
55
57
|
var value = item && item[valueField];
|
|
56
58
|
var idx = value !== undefined && !item.children
|
package/esm/utils/object.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export declare function createObject(superProps?: {
|
|
|
3
3
|
}, props?: {
|
|
4
4
|
[propName: string]: any;
|
|
5
5
|
}, properties?: any): object;
|
|
6
|
+
export declare function extractObjectChain(value: any): object[];
|
|
7
|
+
export declare function createObjectFromChain(chain: Array<object>): object;
|
|
6
8
|
export declare function cloneObject(target: any, persistOwnProps?: boolean): any;
|
|
7
9
|
export declare function extendObject(target: any, src?: any, persistOwnProps?: boolean): any;
|
|
8
10
|
export declare function isObject(obj: any): any;
|
package/esm/utils/object.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -25,6 +25,31 @@ function createObject(superProps, props, properties) {
|
|
|
25
25
|
Object.keys(props).forEach(function (key) { return (obj[key] = props[key]); });
|
|
26
26
|
return obj;
|
|
27
27
|
}
|
|
28
|
+
function extractObjectChain(value) {
|
|
29
|
+
var result = value ? [value] : [];
|
|
30
|
+
while (value === null || value === void 0 ? void 0 : value.__super) {
|
|
31
|
+
result.unshift(value.__super);
|
|
32
|
+
value = value.__super;
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
function createObjectFromChain(chain) {
|
|
37
|
+
return chain
|
|
38
|
+
.filter(function (item) { return item; })
|
|
39
|
+
.reduce(function (proto, value) {
|
|
40
|
+
proto = proto || Object.prototype;
|
|
41
|
+
if (Object.isFrozen(proto)) {
|
|
42
|
+
proto = cloneObject(proto);
|
|
43
|
+
}
|
|
44
|
+
return Object.assign(Object.create(proto, {
|
|
45
|
+
__super: {
|
|
46
|
+
value: proto,
|
|
47
|
+
writable: false,
|
|
48
|
+
enumerable: false
|
|
49
|
+
}
|
|
50
|
+
}), value);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
28
53
|
function cloneObject(target, persistOwnProps) {
|
|
29
54
|
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
30
55
|
var obj = target && target.__super
|
|
@@ -139,4 +164,4 @@ function pickValues(names, data) {
|
|
|
139
164
|
return ret;
|
|
140
165
|
}
|
|
141
166
|
|
|
142
|
-
export { cloneObject, createObject, deleteVariable, extendObject, isObject, pickValues, setVariable };
|
|
167
|
+
export { cloneObject, createObject, createObjectFromChain, deleteVariable, extendObject, extractObjectChain, isObject, pickValues, setVariable };
|
package/esm/utils/offset.js
CHANGED
package/esm/utils/position.js
CHANGED
package/esm/utils/prettyBytes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -34,7 +34,7 @@ function createRendererEvent(type, context) {
|
|
|
34
34
|
// 绑定事件
|
|
35
35
|
var bindEvent = function (renderer) {
|
|
36
36
|
var e_1, _a;
|
|
37
|
-
var _b, _c;
|
|
37
|
+
var _b, _c, _d;
|
|
38
38
|
if (!renderer) {
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
@@ -49,15 +49,16 @@ var bindEvent = function (renderer) {
|
|
|
49
49
|
rendererEventListeners = rendererEventListeners.filter(function (item) {
|
|
50
50
|
return !(item.renderer === listener.renderer && item.type === listener.type);
|
|
51
51
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
listener.actions.length &&
|
|
53
|
+
rendererEventListeners.push({
|
|
54
|
+
renderer: renderer,
|
|
55
|
+
type: key,
|
|
56
|
+
debounce: listener.debounce || null,
|
|
57
|
+
weight: listener.weight || 0,
|
|
58
|
+
actions: listener.actions
|
|
59
|
+
});
|
|
59
60
|
}
|
|
60
|
-
if (!listener) {
|
|
61
|
+
if (!listener && ((_d = listeners[key].actions) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
61
62
|
rendererEventListeners.push({
|
|
62
63
|
renderer: renderer,
|
|
63
64
|
type: key,
|
|
@@ -69,15 +70,15 @@ var bindEvent = function (renderer) {
|
|
|
69
70
|
};
|
|
70
71
|
try {
|
|
71
72
|
// 暂存
|
|
72
|
-
for (var
|
|
73
|
-
var key =
|
|
73
|
+
for (var _e = __values(Object.keys(listeners)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
74
|
+
var key = _f.value;
|
|
74
75
|
_loop_1(key);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
78
79
|
finally {
|
|
79
80
|
try {
|
|
80
|
-
if (
|
|
81
|
+
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
81
82
|
}
|
|
82
83
|
finally { if (e_1) throw e_1.error; }
|
|
83
84
|
}
|
|
@@ -89,19 +90,20 @@ var bindEvent = function (renderer) {
|
|
|
89
90
|
};
|
|
90
91
|
// 触发事件
|
|
91
92
|
function dispatchEvent(e, renderer, scoped, data, broadcast) {
|
|
92
|
-
var _a, _b, _c, _d, _e, _f;
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
93
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
95
|
var unbindEvent, eventName, eventConfig, rendererEvent, listeners, executedCount, checkExecuted, _loop_2, listeners_1, listeners_1_1, listener, state_1, e_2_1;
|
|
95
|
-
var e_2,
|
|
96
|
+
var e_2, _j;
|
|
96
97
|
var _this = this;
|
|
97
|
-
return __generator(this, function (
|
|
98
|
-
switch (
|
|
98
|
+
return __generator(this, function (_k) {
|
|
99
|
+
switch (_k.label) {
|
|
99
100
|
case 0:
|
|
100
101
|
unbindEvent = null;
|
|
101
102
|
eventName = typeof e === 'string' ? e : e.type;
|
|
102
103
|
(_c = (_b = (_a = renderer === null || renderer === void 0 ? void 0 : renderer.props) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.beforeDispatchEvent) === null || _c === void 0 ? void 0 : _c.call(_b, e, renderer, scoped, data, broadcast);
|
|
104
|
+
broadcast && ((_e = (_d = renderer.props).onBroadcast) === null || _e === void 0 ? void 0 : _e.call(_d, e, broadcast, data));
|
|
103
105
|
if (!broadcast) {
|
|
104
|
-
eventConfig = (
|
|
106
|
+
eventConfig = (_g = (_f = renderer === null || renderer === void 0 ? void 0 : renderer.props) === null || _f === void 0 ? void 0 : _f.onEvent) === null || _g === void 0 ? void 0 : _g[eventName];
|
|
105
107
|
if (!eventConfig) {
|
|
106
108
|
// 没命中也没关系
|
|
107
109
|
return [2 /*return*/, Promise.resolve()];
|
|
@@ -114,7 +116,7 @@ function dispatchEvent(e, renderer, scoped, data, broadcast) {
|
|
|
114
116
|
}
|
|
115
117
|
rendererEvent = broadcast ||
|
|
116
118
|
createRendererEvent(eventName, {
|
|
117
|
-
env: (
|
|
119
|
+
env: (_h = renderer === null || renderer === void 0 ? void 0 : renderer.props) === null || _h === void 0 ? void 0 : _h.env,
|
|
118
120
|
nativeEvent: e,
|
|
119
121
|
data: data,
|
|
120
122
|
scoped: scoped
|
|
@@ -135,11 +137,11 @@ function dispatchEvent(e, renderer, scoped, data, broadcast) {
|
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
139
|
_loop_2 = function (listener) {
|
|
138
|
-
var
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
140
|
+
var _l, _m, wait, _o, trailing, _p, leading, _q, maxWait, debounced_1;
|
|
141
|
+
return __generator(this, function (_r) {
|
|
142
|
+
switch (_r.label) {
|
|
141
143
|
case 0:
|
|
142
|
-
|
|
144
|
+
_l = (listener === null || listener === void 0 ? void 0 : listener.debounce) || {}, _m = _l.wait, wait = _m === void 0 ? 100 : _m, _o = _l.trailing, trailing = _o === void 0 ? true : _o, _p = _l.leading, leading = _p === void 0 ? false : _p, _q = _l.maxWait, maxWait = _q === void 0 ? 10000 : _q;
|
|
143
145
|
if (!(listener === null || listener === void 0 ? void 0 : listener.debounce)) return [3 /*break*/, 1];
|
|
144
146
|
debounced_1 = debounce(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
145
147
|
return __generator(this, function (_a) {
|
|
@@ -168,9 +170,9 @@ function dispatchEvent(e, renderer, scoped, data, broadcast) {
|
|
|
168
170
|
return [3 /*break*/, 3];
|
|
169
171
|
case 1: return [4 /*yield*/, runActions(listener.actions, listener.renderer, rendererEvent)];
|
|
170
172
|
case 2:
|
|
171
|
-
|
|
173
|
+
_r.sent();
|
|
172
174
|
checkExecuted();
|
|
173
|
-
|
|
175
|
+
_r.label = 3;
|
|
174
176
|
case 3:
|
|
175
177
|
// 停止后续监听器执行
|
|
176
178
|
if (rendererEvent.stoped) {
|
|
@@ -180,31 +182,31 @@ function dispatchEvent(e, renderer, scoped, data, broadcast) {
|
|
|
180
182
|
}
|
|
181
183
|
});
|
|
182
184
|
};
|
|
183
|
-
|
|
185
|
+
_k.label = 1;
|
|
184
186
|
case 1:
|
|
185
|
-
|
|
187
|
+
_k.trys.push([1, 6, 7, 8]);
|
|
186
188
|
listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next();
|
|
187
|
-
|
|
189
|
+
_k.label = 2;
|
|
188
190
|
case 2:
|
|
189
191
|
if (!!listeners_1_1.done) return [3 /*break*/, 5];
|
|
190
192
|
listener = listeners_1_1.value;
|
|
191
193
|
return [5 /*yield**/, _loop_2(listener)];
|
|
192
194
|
case 3:
|
|
193
|
-
state_1 =
|
|
195
|
+
state_1 = _k.sent();
|
|
194
196
|
if (state_1 === "break")
|
|
195
197
|
return [3 /*break*/, 5];
|
|
196
|
-
|
|
198
|
+
_k.label = 4;
|
|
197
199
|
case 4:
|
|
198
200
|
listeners_1_1 = listeners_1.next();
|
|
199
201
|
return [3 /*break*/, 2];
|
|
200
202
|
case 5: return [3 /*break*/, 8];
|
|
201
203
|
case 6:
|
|
202
|
-
e_2_1 =
|
|
204
|
+
e_2_1 = _k.sent();
|
|
203
205
|
e_2 = { error: e_2_1 };
|
|
204
206
|
return [3 /*break*/, 8];
|
|
205
207
|
case 7:
|
|
206
208
|
try {
|
|
207
|
-
if (listeners_1_1 && !listeners_1_1.done && (
|
|
209
|
+
if (listeners_1_1 && !listeners_1_1.done && (_j = listeners_1.return)) _j.call(listeners_1);
|
|
208
210
|
}
|
|
209
211
|
finally { if (e_2) throw e_2.error; }
|
|
210
212
|
return [7 /*endfinally*/];
|
|
@@ -224,6 +226,7 @@ var getRendererEventListeners = function () {
|
|
|
224
226
|
*/
|
|
225
227
|
var resolveEventData = function (props, data, valueKey) {
|
|
226
228
|
var _a, _b;
|
|
229
|
+
if (valueKey === void 0) { valueKey = 'value'; }
|
|
227
230
|
return createObject(props.data, props.name && valueKey
|
|
228
231
|
? __assign(__assign({}, data), (_a = {}, _a[props.name] = data[valueKey], _a.__rendererData = __assign(__assign({}, props.data), (_b = {}, _b[props.name] = data[valueKey], _b)), _a)) : data);
|
|
229
232
|
};
|
package/esm/utils/replaceText.js
CHANGED
|
@@ -3,3 +3,4 @@ export declare function registerConditionComputer(op: string, func: (left: any,
|
|
|
3
3
|
export declare function getConditionComputers(): {
|
|
4
4
|
[op: string]: (left: any, right: any, fieldType?: string | undefined) => boolean;
|
|
5
5
|
};
|
|
6
|
+
export declare function setConditionComputeErrorHandler(fn: (conditions: any, data: any, defaultResult: boolean) => boolean | Promise<boolean>): void;
|