@teamix/pro 1.4.25-bugfix.2 → 1.4.25-bugfix.3
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/pro.css +1 -1
- package/dist/pro.js +64943 -84006
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +6 -13
- package/es/actions/base.js +21 -8
- package/es/actions/dialog-component.js +9 -2
- package/es/actions/dialog-form.js +75 -37
- package/es/actions/dialog-info.js +5 -1
- package/es/actions/dialog.js +95 -57
- package/es/actions/index.d.ts +0 -7
- package/es/actions/index.js +153 -93
- package/es/actions/index.scss +1 -6
- package/es/actions/link.js +5 -3
- package/es/actions/request.js +27 -12
- package/es/actions/utils.js +9 -1
- package/es/card/card-container.js +5 -0
- package/es/card/divider.js +5 -0
- package/es/card/index.js +100 -61
- package/es/card/index.scss +0 -15
- package/es/card/selectable.js +13 -4
- package/es/card/tab.js +10 -1
- package/es/card/utils.js +2 -0
- package/es/form/Components/Editable/index.js +55 -16
- package/es/form/Components/FormGroup/index.d.ts +0 -1
- package/es/form/Components/FormGroup/index.js +22 -7
- package/es/form/Components/LightFilter/index.js +35 -15
- package/es/form/Components/ProField/index.js +14 -2
- package/es/form/Components/ProField/mapDateFormat.js +28 -2
- package/es/form/Components/Text/index.d.ts +0 -1
- package/es/form/Components/Text/index.js +11 -2
- package/es/form/Filter/AdvancedFilter.js +26 -11
- package/es/form/Filter/Layout.js +24 -11
- package/es/form/Filter/LightFilter.js +24 -13
- package/es/form/Filter/SimpleFilter.js +21 -7
- package/es/form/Filter/index.js +171 -117
- package/es/form/Filter/index2.js +28 -11
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +46 -18
- package/es/form/Filter/useSpecialProps.js +13 -8
- package/es/form/ProForm/customComponent.js +5 -0
- package/es/form/ProForm/index.js +38 -30
- package/es/form/ProForm/useAutoLayout.js +42 -21
- package/es/form/ProForm/useAutoSubmit.js +8 -3
- package/es/form/ProForm/useFieldRequest.js +5 -0
- package/es/form/ProForm/useFormDisplayValues.js +28 -12
- package/es/form/ProForm/useInitialRequest.js +5 -0
- package/es/form/SchemaForm/adapterComponent.js +3 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +8 -0
- package/es/form/SchemaForm/adapterType.js +2 -0
- package/es/form/SchemaForm/index.js +114 -78
- package/es/form/SchemaForm/initializeArrayCards.js +6 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +6 -0
- package/es/form/SchemaForm/initializeArrayItems.js +9 -2
- package/es/form/SchemaForm/initializeArrayTable.js +34 -21
- package/es/form/SchemaForm/initializeDataSource.js +6 -2
- package/es/form/SchemaForm/initializeFormButton.js +31 -14
- package/es/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/es/form/SchemaForm/initializeFormGroup.js +20 -10
- package/es/form/SchemaForm/initializeFormStep.js +23 -11
- package/es/form/SchemaForm/initializeFormTab.js +20 -10
- package/es/form/SchemaForm/initializeReactions.js +33 -9
- package/es/form/SchemaForm/initializeRequest.js +16 -2
- package/es/form/SchemaForm/initializeRules.js +22 -4
- package/es/form/SchemaForm/initializeSelectTable.js +33 -7
- package/es/form/SchemaForm/reactions.js +34 -19
- package/es/form/docs/ActionResponse.d.ts +0 -1
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +9 -0
- package/es/form/typing.d.ts +4 -26
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +49 -4
- package/es/form/warning.js +7 -2
- package/es/global.scss +1 -3
- package/es/index-without-icon.js +3 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +8 -18
- package/es/info/components/InfoGroup/index.js +32 -21
- package/es/info/components/InfoValueItem/index.js +119 -66
- package/es/info/components/ProInfoItem/index.js +21 -13
- package/es/info/components/baseInfo/index.js +27 -17
- package/es/info/components/headerInfo/index.js +20 -8
- package/es/info/components/tableInfo/index.js +50 -20
- package/es/info/index.js +86 -61
- package/es/info/typing.d.ts +0 -2
- package/es/info/utils/index.js +11 -0
- package/es/nocode/configurators/ProTable.js +22 -1
- package/es/nocode/configurators/common.js +6 -5
- package/es/nocode/configurators/index.js +3 -2
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +9 -5
- package/es/nocode/pages/index.js +30 -5
- package/es/nocode/pages/playground.js +35 -18
- package/es/nocode/pages/renderer.js +42 -9
- package/es/nocode/playground.js +23 -10
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +76 -40
- package/es/page-header/index.scss +1 -2
- package/es/sidebar/components/sidebar-container/index.js +69 -54
- package/es/sidebar/components/sidebar-container/index.scss +14 -21
- package/es/sidebar/components/tree/index.js +138 -100
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +26 -11
- package/es/sidebar/components/tree-node/components/IconAction/index.js +35 -9
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +25 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +84 -42
- package/es/sidebar/components/tree-node/index.scss +0 -6
- package/es/sidebar/index.d.ts +0 -2
- package/es/sidebar/index.js +95 -72
- package/es/sidebar/typing.d.ts +0 -4
- package/es/sidebar/utils/action-ref.js +7 -2
- package/es/sidebar/utils/index.d.ts +2 -5
- package/es/sidebar/utils/index.js +98 -41
- package/es/table/components/Filter/index.d.ts +3 -6
- package/es/table/components/Filter/index.js +128 -115
- package/es/table/components/Layout/index.js +47 -32
- package/es/table/components/Layout/index.scss +1 -2
- package/es/table/components/Pagination/index.js +58 -25
- package/es/table/components/QuickAction/index.d.ts +0 -1
- package/es/table/components/QuickAction/index.js +11 -3
- package/es/table/components/ToolBar/DensityIcon.js +31 -19
- package/es/table/components/ToolBar/FilterColumnIcon.js +125 -87
- package/es/table/components/ToolBar/FullScreenIcon.js +62 -7
- package/es/table/components/ToolBar/Fullscreen.js +28 -25
- package/es/table/components/ToolBar/RefreshIcon.js +27 -162
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +38 -130
- package/es/table/components/ToolBar/index.scss +3 -49
- package/es/table/index.js +423 -455
- package/es/table/index.scss +0 -8
- package/es/table/typing.d.ts +6 -125
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +79 -39
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +16 -13
- package/es/table/utils/index.js +47 -14
- package/es/table/utils/pureColumnRender.js +53 -21
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +10 -2
- package/es/table/utils/useTableSelection.js +33 -6
- package/es/templates/List/index.js +9 -2
- package/es/timeline/ProTimeLineItem/index.js +65 -25
- package/es/timeline/index.js +22 -8
- package/es/timeline/typing.d.ts +0 -1
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +5 -0
- package/lib/actions/base.js +24 -8
- package/lib/actions/confirm.js +5 -0
- package/lib/actions/danger-confirm.js +5 -0
- package/lib/actions/danger-pop-confirm.js +4 -0
- package/lib/actions/dialog-component.js +15 -2
- package/lib/actions/dialog-form.js +89 -36
- package/lib/actions/dialog-info.js +10 -1
- package/lib/actions/dialog-table.js +5 -0
- package/lib/actions/dialog.js +112 -55
- package/lib/actions/drawer-form.js +3 -0
- package/lib/actions/drawer-info.js +3 -0
- package/lib/actions/drawer-table.js +3 -0
- package/lib/actions/drawer.js +4 -0
- package/lib/actions/error.js +5 -0
- package/lib/actions/index.d.ts +0 -7
- package/lib/actions/index.js +184 -115
- package/lib/actions/index.scss +1 -6
- package/lib/actions/link.js +10 -1
- package/lib/actions/notice.js +5 -0
- package/lib/actions/pop-confirm.js +5 -0
- package/lib/actions/request.js +32 -8
- package/lib/actions/utils.js +9 -1
- package/lib/card/card-container.js +9 -0
- package/lib/card/divider.js +7 -0
- package/lib/card/index.js +127 -61
- package/lib/card/index.scss +0 -15
- package/lib/card/selectable.js +20 -4
- package/lib/card/tab.js +14 -1
- package/lib/card/utils.js +6 -0
- package/lib/field/index.js +6 -0
- package/lib/form/Components/Editable/index.js +65 -15
- package/lib/form/Components/FormGroup/index.d.ts +0 -1
- package/lib/form/Components/FormGroup/index.js +28 -7
- package/lib/form/Components/LightFilter/index.js +47 -15
- package/lib/form/Components/ProField/index.js +21 -2
- package/lib/form/Components/ProField/mapDateFormat.js +32 -2
- package/lib/form/Components/Text/index.d.ts +0 -1
- package/lib/form/Components/Text/index.js +16 -2
- package/lib/form/Filter/AdvancedFilter.js +34 -11
- package/lib/form/Filter/Layout.js +33 -11
- package/lib/form/Filter/LightFilter.js +32 -13
- package/lib/form/Filter/SimpleFilter.js +27 -5
- package/lib/form/Filter/index.js +191 -116
- package/lib/form/Filter/index2.js +38 -11
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +50 -18
- package/lib/form/Filter/useSpecialProps.js +13 -6
- package/lib/form/ProForm/customComponent.js +8 -0
- package/lib/form/ProForm/index.js +60 -30
- package/lib/form/ProForm/useAutoLayout.js +45 -21
- package/lib/form/ProForm/useAutoSubmit.js +10 -1
- package/lib/form/ProForm/useFieldRequest.js +8 -0
- package/lib/form/ProForm/useFormDisplayValues.js +34 -12
- package/lib/form/ProForm/useInitialRequest.js +6 -0
- package/lib/form/SchemaForm/adapterComponent.js +6 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +12 -0
- package/lib/form/SchemaForm/adapterType.js +5 -0
- package/lib/form/SchemaForm/index.js +144 -78
- package/lib/form/SchemaForm/initializeArrayCards.js +7 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +7 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +10 -2
- package/lib/form/SchemaForm/initializeArrayTable.js +34 -21
- package/lib/form/SchemaForm/initializeDataSource.js +8 -2
- package/lib/form/SchemaForm/initializeFormButton.js +32 -14
- package/lib/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/lib/form/SchemaForm/initializeFormGroup.js +20 -10
- package/lib/form/SchemaForm/initializeFormStep.js +23 -11
- package/lib/form/SchemaForm/initializeFormTab.js +20 -10
- package/lib/form/SchemaForm/initializeReactions.js +37 -9
- package/lib/form/SchemaForm/initializeRequest.js +18 -2
- package/lib/form/SchemaForm/initializeRules.js +24 -4
- package/lib/form/SchemaForm/initializeSelectTable.js +36 -7
- package/lib/form/SchemaForm/reactions.js +37 -17
- package/lib/form/docs/ActionResponse.d.ts +0 -1
- package/lib/form/docs/ActionResponse.js +5 -0
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +25 -0
- package/lib/form/typing.d.ts +4 -26
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +61 -4
- package/lib/form/warning.js +8 -2
- package/lib/global.scss +1 -3
- package/lib/hooks/index.js +5 -0
- package/lib/index-without-icon.js +36 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +40 -13
- package/lib/info/components/InfoGroup/index.js +42 -21
- package/lib/info/components/InfoValueItem/index.js +134 -66
- package/lib/info/components/ProInfoItem/index.js +29 -13
- package/lib/info/components/baseInfo/index.js +39 -17
- package/lib/info/components/headerInfo/index.js +31 -8
- package/lib/info/components/tableInfo/index.js +62 -20
- package/lib/info/index.js +101 -61
- package/lib/info/typing.d.ts +0 -2
- package/lib/info/utils/index.js +19 -0
- package/lib/info/utils/utils.js +1 -0
- package/lib/nocode/configurators/PageHeader.js +2 -0
- package/lib/nocode/configurators/ProTable.js +24 -1
- package/lib/nocode/configurators/common.js +10 -5
- package/lib/nocode/configurators/index.js +10 -2
- package/lib/nocode/configurators/map.js +5 -0
- package/lib/nocode/index.js +11 -0
- package/lib/nocode/pages/editor.js +19 -5
- package/lib/nocode/pages/index.js +35 -3
- package/lib/nocode/pages/playground.js +52 -18
- package/lib/nocode/pages/renderer.js +53 -9
- package/lib/nocode/playground.js +35 -10
- package/lib/page-container/index.js +6 -0
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +90 -39
- package/lib/page-header/index.scss +1 -2
- package/lib/sidebar/components/sidebar-container/index.js +81 -54
- package/lib/sidebar/components/sidebar-container/index.scss +14 -21
- package/lib/sidebar/components/tree/index.js +152 -100
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +34 -11
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +46 -9
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +35 -12
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +100 -42
- package/lib/sidebar/components/tree-node/index.scss +0 -6
- package/lib/sidebar/index.d.ts +0 -2
- package/lib/sidebar/index.js +111 -79
- package/lib/sidebar/typing.d.ts +0 -4
- package/lib/sidebar/utils/action-ref.js +8 -2
- package/lib/sidebar/utils/index.d.ts +2 -5
- package/lib/sidebar/utils/index.js +106 -41
- package/lib/skeleton/index.js +6 -0
- package/lib/table/components/EmptyContent/index.js +6 -0
- package/lib/table/components/Filter/index.d.ts +3 -6
- package/lib/table/components/Filter/index.js +137 -114
- package/lib/table/components/Layout/index.js +60 -32
- package/lib/table/components/Layout/index.scss +1 -2
- package/lib/table/components/Pagination/index.js +68 -25
- package/lib/table/components/QuickAction/index.d.ts +0 -1
- package/lib/table/components/QuickAction/index.js +15 -3
- package/lib/table/components/ToolBar/DensityIcon.js +42 -19
- package/lib/table/components/ToolBar/FilterColumnIcon.js +136 -86
- package/lib/table/components/ToolBar/FullScreenIcon.js +74 -10
- package/lib/table/components/ToolBar/Fullscreen.js +35 -25
- package/lib/table/components/ToolBar/RefreshIcon.js +36 -164
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +47 -133
- package/lib/table/components/ToolBar/index.scss +3 -49
- package/lib/table/index.js +445 -454
- package/lib/table/index.scss +0 -8
- package/lib/table/typing.d.ts +6 -125
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +92 -39
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +21 -13
- package/lib/table/utils/getTableProps.js +2 -0
- package/lib/table/utils/getTableSortIcons.js +5 -0
- package/lib/table/utils/index.js +55 -12
- package/lib/table/utils/pureColumnRender.js +64 -21
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +11 -2
- package/lib/table/utils/useTableSelection.js +35 -6
- package/lib/templates/Detail/index.js +5 -0
- package/lib/templates/Form/index.js +5 -0
- package/lib/templates/List/index.js +19 -2
- package/lib/templates/index.js +6 -0
- package/lib/timeline/ProTimeLineItem/index.js +76 -25
- package/lib/timeline/index.js +33 -8
- package/lib/timeline/typing.d.ts +0 -1
- package/lib/utils/index.js +6 -0
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +10 -0
- package/package.json +1 -1
- package/dist/pro.all.min.css +0 -1
- package/dist/pro.xconsole.min.css +0 -1
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/quick.js +0 -26
- package/es/card/xconsole.scss +0 -3
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/addCascadeEffect.js +0 -203
- package/es/next-xconsole.scss +0 -34
- package/es/page-header/xconsole.scss +0 -5
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/CardView/index.js +0 -392
- package/es/table/components/CardView/index.scss +0 -46
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/LoadMore/index.js +0 -88
- package/es/table/components/LoadMore/index.scss +0 -19
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/CardSwitch.js +0 -52
- package/es/table/utils/util.d.ts +0 -5
- package/es/table/utils/util.js +0 -19
- package/es/xconsole.scss +0 -503
- package/lib/actions/quick.d.ts +0 -2
- package/lib/actions/quick.js +0 -33
- package/lib/card/xconsole.scss +0 -3
- package/lib/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/lib/form/ProForm/addCascadeEffect.js +0 -210
- package/lib/next-xconsole.scss +0 -34
- package/lib/page-header/xconsole.scss +0 -5
- package/lib/table/components/CardView/index.d.ts +0 -5
- package/lib/table/components/CardView/index.js +0 -402
- package/lib/table/components/CardView/index.scss +0 -46
- package/lib/table/components/LoadMore/index.d.ts +0 -20
- package/lib/table/components/LoadMore/index.js +0 -99
- package/lib/table/components/LoadMore/index.scss +0 -19
- package/lib/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/lib/table/components/ToolBar/CardSwitch.js +0 -60
- package/lib/table/utils/util.d.ts +0 -5
- package/lib/table/utils/util.js +0 -25
- package/lib/xconsole.scss +0 -503
@@ -1,9 +1,15 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
|
2
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
|
3
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
+
|
4
7
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
8
|
+
|
5
9
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
10
|
+
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
+
|
7
13
|
import { useForm } from '@formily/react';
|
8
14
|
import { toJS } from '@formily/reactive';
|
9
15
|
import { isArr, isPlainObj, isUsable, getValueByValue } from '@teamix/utils';
|
@@ -19,22 +25,25 @@ import fieldTypeMap from '../fieldTypeMap';
|
|
19
25
|
};
|
20
26
|
console.log(getDisplayValues(example));
|
21
27
|
*/
|
28
|
+
|
22
29
|
var getDisplayValues = function getDisplayValues(form, values) {
|
23
30
|
var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
24
|
-
var displayValues;
|
25
|
-
|
31
|
+
var displayValues; // 拼接路径
|
32
|
+
|
26
33
|
var connectPath = function connectPath(path) {
|
27
34
|
return prefix ? "".concat(prefix, ".").concat(path) : "".concat(path);
|
28
|
-
};
|
29
|
-
|
35
|
+
}; // 根据值路径获取地址
|
36
|
+
|
37
|
+
|
30
38
|
var getAddress = function getAddress(path) {
|
31
39
|
return form.indexes[path];
|
32
|
-
};
|
33
|
-
|
34
|
-
|
35
|
-
// 是否真实字段值(自定义组件、布局组件、自增数组组件为非真实字段)
|
36
|
-
|
37
|
-
// 判断值的类型,递归获取每个值在该结构中的完整路径
|
40
|
+
}; // 当前field
|
41
|
+
|
42
|
+
|
43
|
+
var field = form.query(getAddress(prefix)).take(); // 是否真实字段值(自定义组件、布局组件、自增数组组件为非真实字段)
|
44
|
+
|
45
|
+
var isFieldValue = Object.keys(fieldTypeMap).includes(field === null || field === void 0 ? void 0 : field.component[0]); // 判断值的类型,递归获取每个值在该结构中的完整路径
|
46
|
+
|
38
47
|
if (!isUsable(values)) {
|
39
48
|
displayValues = {};
|
40
49
|
} else if (isPlainObj(values) && !isFieldValue) {
|
@@ -42,8 +51,9 @@ var getDisplayValues = function getDisplayValues(form, values) {
|
|
42
51
|
displayValues = {};
|
43
52
|
Object.entries(values).forEach(function (_ref) {
|
44
53
|
var _ref2 = _slicedToArray(_ref, 2),
|
45
|
-
|
46
|
-
|
54
|
+
key = _ref2[0],
|
55
|
+
value = _ref2[1];
|
56
|
+
|
47
57
|
displayValues[key] = getDisplayValues(form, value, connectPath(key));
|
48
58
|
});
|
49
59
|
} else if (isArr(values) && !isFieldValue) {
|
@@ -56,8 +66,10 @@ var getDisplayValues = function getDisplayValues(form, values) {
|
|
56
66
|
});
|
57
67
|
} else {
|
58
68
|
var _values$value;
|
69
|
+
|
59
70
|
// 通过值的完整路径获取字段address(从form实例的indexes中),然后获取该字段的value在该字段dataSource中对应的label
|
60
71
|
var realValue = (_values$value = values === null || values === void 0 ? void 0 : values.value) !== null && _values$value !== void 0 ? _values$value : values; // 针对单个字段的值是对象,例如Select的useDetailValue
|
72
|
+
|
61
73
|
var displayValue = getValueByValue(field === null || field === void 0 ? void 0 : field.dataSource, realValue);
|
62
74
|
displayValues = {
|
63
75
|
title: field === null || field === void 0 ? void 0 : field.title,
|
@@ -66,13 +78,17 @@ var getDisplayValues = function getDisplayValues(form, values) {
|
|
66
78
|
displayValue: displayValue
|
67
79
|
};
|
68
80
|
}
|
81
|
+
|
69
82
|
return displayValues;
|
70
83
|
};
|
84
|
+
|
71
85
|
var useFormDisplayValues = function useFormDisplayValues() {
|
72
86
|
var form = useForm();
|
73
87
|
return getDisplayValues(form, toJS(form.values));
|
74
88
|
};
|
89
|
+
|
75
90
|
var getFormDisplayValues = function getFormDisplayValues(form) {
|
76
91
|
return getDisplayValues(form, toJS(form.values));
|
77
92
|
};
|
93
|
+
|
78
94
|
export { useFormDisplayValues, getFormDisplayValues };
|
@@ -1,10 +1,15 @@
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
+
|
3
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
4
7
|
import { doCommonRequest } from '@teamix/utils';
|
8
|
+
|
5
9
|
var useInitialRequest = function useInitialRequest(initialRequest, context) {
|
6
10
|
return doCommonRequest(_objectSpread({
|
7
11
|
method: 'GET'
|
8
12
|
}, initialRequest), context);
|
9
13
|
};
|
14
|
+
|
10
15
|
export default useInitialRequest;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
var _componentMap;
|
2
|
+
|
2
3
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
+
|
3
5
|
/**
|
4
6
|
* Formily组件在ProForm的别名
|
5
7
|
*/
|
@@ -10,5 +12,6 @@ export default (function (component) {
|
|
10
12
|
if (componentMap[component]) {
|
11
13
|
return componentMap[component];
|
12
14
|
}
|
15
|
+
|
13
16
|
return component;
|
14
17
|
});
|
@@ -2,5 +2,5 @@
|
|
2
2
|
* 优先使用配置,即非 undefined
|
3
3
|
* 未配置则按默认规则为基础组件和某些聚合组件添加FormItem
|
4
4
|
*/
|
5
|
-
declare const _default: (decorator?: string | null, component?: any) => string | null | undefined;
|
5
|
+
declare const _default: (decorator?: string | null | undefined, component?: any) => string | null | undefined;
|
6
6
|
export default _default;
|
@@ -1,9 +1,15 @@
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
+
|
2
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
|
3
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
+
|
4
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
8
|
+
|
5
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
10
|
+
|
6
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
12
|
+
|
7
13
|
/**
|
8
14
|
* 优先使用配置,即非 undefined
|
9
15
|
* 未配置则按默认规则为基础组件和某些聚合组件添加FormItem
|
@@ -13,8 +19,10 @@ export default (function (decorator, component) {
|
|
13
19
|
if (decorator !== undefined) {
|
14
20
|
return decorator;
|
15
21
|
}
|
22
|
+
|
16
23
|
if ([].concat(_toConsumableArray(Object.keys(fieldTypeMap)), ['Upload', 'SelectTable', 'ArrayCards', 'ArrayCollapse', 'ArrayTable', 'ArrayItems']).includes(component)) {
|
17
24
|
return 'FormItem';
|
18
25
|
}
|
26
|
+
|
19
27
|
return decorator;
|
20
28
|
});
|
@@ -1,19 +1,35 @@
|
|
1
1
|
var _excluded = ["type", "name", "component", "props", "decorator", "decoratorProps", "dataSource", "reactions", "rules", "children", "items", "tooltip", "request", "data"];
|
2
|
+
|
2
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
+
|
3
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
6
|
+
|
4
7
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
8
|
+
|
5
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
10
|
+
|
6
11
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
12
|
+
|
7
13
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
14
|
+
|
8
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
16
|
+
|
9
17
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
18
|
+
|
10
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
20
|
+
|
11
21
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
22
|
+
|
12
23
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
24
|
+
|
13
25
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
26
|
+
|
14
27
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
28
|
+
|
15
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
30
|
+
|
16
31
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
32
|
+
|
17
33
|
import React, { memo, useCallback, useRef, useMemo } from 'react';
|
18
34
|
import { createSchemaField } from '@formily/react';
|
19
35
|
import { cls, isUsable } from '@teamix/utils';
|
@@ -40,14 +56,14 @@ import { getFieldName, mapSchemaName } from '../utils';
|
|
40
56
|
import warning from '../warning';
|
41
57
|
export default /*#__PURE__*/memo(function (_ref) {
|
42
58
|
var schema = _ref.schema,
|
43
|
-
|
44
|
-
|
45
|
-
var schemaScopeRef = useRef({});
|
46
|
-
|
59
|
+
scope = _ref.scope,
|
60
|
+
components = _ref.components;
|
61
|
+
var schemaScopeRef = useRef({}); // 创建 SchemaField
|
62
|
+
|
47
63
|
var SchemaField = useMemo(function () {
|
48
64
|
return createSchemaField();
|
49
|
-
}, []);
|
50
|
-
|
65
|
+
}, []); // 格式化 schema
|
66
|
+
|
51
67
|
var formatSchema = useCallback(function (schema) {
|
52
68
|
var parentSuffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
53
69
|
var schemaProperties = {};
|
@@ -55,113 +71,131 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
55
71
|
var suffix = "".concat(parentSuffix).concat(index);
|
56
72
|
var newItem = warning(item);
|
57
73
|
var _newItem = newItem,
|
58
|
-
|
59
|
-
|
74
|
+
originalComponent = _newItem.component; // 根据component的不同,初始化为内置的item
|
75
|
+
|
60
76
|
if (originalComponent) {
|
61
|
-
if (Object.keys(fieldTypeMap).includes(originalComponent)) {
|
62
|
-
// ProField接管组件
|
77
|
+
if (Object.keys(fieldTypeMap).includes(originalComponent)) {// ProField接管组件
|
63
78
|
} else {
|
64
79
|
// 未接管组件,判断是否为Formily组件别名
|
65
80
|
newItem = _objectSpread(_objectSpread({}, newItem), {}, {
|
66
81
|
component: adapterComponent(originalComponent)
|
67
82
|
});
|
68
|
-
}
|
69
|
-
|
83
|
+
} // 初始化高级组件 - FormButtonGroup/Subimt/Reset
|
84
|
+
|
85
|
+
|
70
86
|
if (['FormButtonGroup', 'Submit', 'Reset'].includes(originalComponent)) {
|
71
87
|
newItem = initializeFormButton(newItem);
|
72
|
-
}
|
73
|
-
|
88
|
+
} // 初始化高级组件 - ArrayCards
|
89
|
+
|
90
|
+
|
74
91
|
if (['ArrayCards'].includes(originalComponent)) {
|
75
92
|
newItem = initializeArrayCards(newItem);
|
76
|
-
}
|
77
|
-
|
93
|
+
} // 初始化高级组件 - ArrayCollapse
|
94
|
+
|
95
|
+
|
78
96
|
if (['ArrayCollapse'].includes(originalComponent)) {
|
79
97
|
newItem = initializeArrayCollapse(newItem);
|
80
|
-
}
|
81
|
-
|
98
|
+
} // 初始化高级组件 - ArrayTable
|
99
|
+
|
100
|
+
|
82
101
|
if (['ArrayTable'].includes(originalComponent)) {
|
83
102
|
newItem = initializeArrayTable(newItem);
|
84
|
-
}
|
85
|
-
|
103
|
+
} // 初始化高级组件 - ArrayItems
|
104
|
+
|
105
|
+
|
86
106
|
if (['ArrayItems'].includes(originalComponent)) {
|
87
107
|
newItem = initializeArrayItems(newItem);
|
88
|
-
}
|
89
|
-
|
108
|
+
} // 初始化布局组件 - FormStep
|
109
|
+
|
110
|
+
|
90
111
|
if (['FormStep'].includes(originalComponent)) {
|
91
112
|
newItem = initializeFormStep(newItem);
|
92
|
-
}
|
93
|
-
|
113
|
+
} // 初始化布局组件 - FormGroup
|
114
|
+
|
115
|
+
|
94
116
|
if (['FormGroup'].includes(originalComponent)) {
|
95
117
|
newItem = initializeFormGroup(newItem);
|
96
|
-
}
|
97
|
-
|
118
|
+
} // 初始化布局组件 - FormTab
|
119
|
+
|
120
|
+
|
98
121
|
if (['FormTab'].includes(originalComponent)) {
|
99
122
|
newItem = initializeFormTab(newItem);
|
100
|
-
}
|
101
|
-
|
123
|
+
} // 初始化布局组件 - FormCollapse
|
124
|
+
|
125
|
+
|
102
126
|
if (['FormCollapse'].includes(originalComponent)) {
|
103
127
|
newItem = initializeFormCollapse(newItem);
|
104
|
-
}
|
105
|
-
|
128
|
+
} // 初始化选择表格 - SelectTable
|
129
|
+
|
130
|
+
|
106
131
|
if (['SelectTable'].includes(originalComponent)) {
|
107
132
|
newItem = initializeSelectTable(newItem);
|
108
133
|
}
|
109
134
|
}
|
135
|
+
|
110
136
|
var _newItem2 = newItem,
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
// 默认类型
|
129
|
-
|
130
|
-
// 默认装饰组件
|
131
|
-
|
132
|
-
// 默认装饰组件属性
|
137
|
+
type = _newItem2.type,
|
138
|
+
name = _newItem2.name,
|
139
|
+
component = _newItem2.component,
|
140
|
+
props = _newItem2.props,
|
141
|
+
decorator = _newItem2.decorator,
|
142
|
+
decoratorProps = _newItem2.decoratorProps,
|
143
|
+
dataSource = _newItem2.dataSource,
|
144
|
+
reactions = _newItem2.reactions,
|
145
|
+
rules = _newItem2.rules,
|
146
|
+
children = _newItem2.children,
|
147
|
+
items = _newItem2.items,
|
148
|
+
tooltip = _newItem2.tooltip,
|
149
|
+
request = _newItem2.request,
|
150
|
+
data = _newItem2.data,
|
151
|
+
otherProps = _objectWithoutProperties(_newItem2, _excluded); // 默认字段名
|
152
|
+
|
153
|
+
|
154
|
+
var defaultName = !name ? getFieldName(component === null || component === void 0 ? void 0 : component.replace(/\./g, ''), suffix) : name; // 默认类型
|
155
|
+
|
156
|
+
var defaultType = adapterType(type, originalComponent); // 默认装饰组件
|
157
|
+
|
158
|
+
var defaultDecorator = adapterDecorator(decorator, originalComponent); // 默认装饰组件属性
|
159
|
+
|
133
160
|
var tooltipProps = tooltip ? {
|
134
161
|
tooltip: tooltip
|
135
162
|
} : {};
|
136
|
-
|
137
|
-
// 初始化request
|
163
|
+
|
164
|
+
var defaultDecoratorProps = _objectSpread(_objectSpread({}, tooltipProps), decoratorProps); // 初始化request
|
165
|
+
|
166
|
+
|
138
167
|
var _initializeRequest = initializeRequest(request, "".concat(suffix, "r")),
|
139
|
-
|
140
|
-
|
141
|
-
|
168
|
+
requestReactions = _initializeRequest.reactions,
|
169
|
+
requestScope = _initializeRequest.scope; // 初始化dataSource
|
170
|
+
|
171
|
+
|
142
172
|
var _initializeDataSource = initializeDataSource(dataSource, "".concat(suffix, "d")),
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
173
|
+
defaultDataSource = _initializeDataSource.dataSource,
|
174
|
+
dataSourceReactions = _initializeDataSource.reactions,
|
175
|
+
dataSourceScope = _initializeDataSource.scope,
|
176
|
+
dataSourceData = _initializeDataSource.data,
|
177
|
+
dataSourceProps = _initializeDataSource.props; // 初始化rules validator
|
178
|
+
|
179
|
+
|
149
180
|
var _initializeRules = initializeRules(rules, "".concat(suffix, "v")),
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
// 合并scope
|
181
|
+
defaultRules = _initializeRules.rules,
|
182
|
+
rulesScope = _initializeRules.scope; // 合并reactions,初始化reactions
|
183
|
+
|
184
|
+
|
185
|
+
var defaultReactions = initializeReactions(reactions, [].concat(_toConsumableArray(requestReactions), _toConsumableArray(dataSourceReactions))); // 合并scope
|
186
|
+
|
155
187
|
Object.entries(_objectSpread(_objectSpread(_objectSpread({}, requestScope), dataSourceScope), rulesScope)).map(function (_ref2) {
|
156
188
|
var _ref3 = _slicedToArray(_ref2, 2),
|
157
|
-
|
158
|
-
|
189
|
+
k = _ref3[0],
|
190
|
+
v = _ref3[1];
|
191
|
+
|
159
192
|
schemaScopeRef.current[k] = v;
|
160
|
-
});
|
161
|
-
|
193
|
+
}); // 合并字段属性
|
194
|
+
|
162
195
|
var defaultProps = _objectSpread(_objectSpread(_objectSpread({}, props), dataSourceProps), {}, {
|
163
196
|
className: cls(props === null || props === void 0 ? void 0 : props.className, dataSourceProps === null || dataSourceProps === void 0 ? void 0 : dataSourceProps.className)
|
164
197
|
});
|
198
|
+
|
165
199
|
var formatParam = mapSchemaName(_objectSpread(_objectSpread({}, otherProps), {}, {
|
166
200
|
type: defaultType,
|
167
201
|
component: component,
|
@@ -174,15 +208,15 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
174
208
|
data: _objectSpread(_objectSpread(_objectSpread({}, data), dataSourceData), {}, {
|
175
209
|
__placeholder: true
|
176
210
|
})
|
177
|
-
}));
|
178
|
-
|
211
|
+
})); // 递归子组件
|
212
|
+
|
179
213
|
var recursiveProperties = (children === null || children === void 0 ? void 0 : children.length) ? {
|
180
214
|
properties: formatSchema(children, suffix)
|
181
|
-
} : {};
|
182
|
-
// 递归items(类似子组件,会先由各initialize方法格式化为固定形式,type不同不统一处理)
|
215
|
+
} : {}; // 递归items(类似子组件,会先由各initialize方法格式化为固定形式,type不同不统一处理)
|
183
216
|
// 例如:[{ name: 'items', type: 'object', children: items }]
|
184
|
-
|
185
|
-
// 配置组件属性
|
217
|
+
|
218
|
+
var recursiveItems = items ? formatSchema([items], suffix) : {}; // 配置组件属性
|
219
|
+
|
186
220
|
if (isUsable(item)) {
|
187
221
|
schemaProperties[defaultName] = _objectSpread(_objectSpread(_objectSpread({}, formatParam), recursiveProperties), recursiveItems);
|
188
222
|
}
|
@@ -195,12 +229,14 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
195
229
|
properties: formatSchema(schema)
|
196
230
|
};
|
197
231
|
}, [schema]);
|
232
|
+
|
198
233
|
var mergedScope = _objectSpread(_objectSpread({}, scope), {}, {
|
199
234
|
$request: $request,
|
200
235
|
$common: $common,
|
201
236
|
$dataSource: $dataSource,
|
202
237
|
$validator: $validator
|
203
238
|
}, schemaScopeRef.current);
|
239
|
+
|
204
240
|
return /*#__PURE__*/React.createElement(SchemaField, {
|
205
241
|
schema: formilySchema,
|
206
242
|
components: components,
|
@@ -1,18 +1,24 @@
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
+
|
3
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
4
7
|
var initializeItems = function initializeItems(items) {
|
5
8
|
if (items) {
|
6
9
|
return _objectSpread(_objectSpread({}, items), {}, {
|
7
10
|
name: 'items'
|
8
11
|
});
|
9
12
|
}
|
13
|
+
|
10
14
|
return items;
|
11
15
|
};
|
16
|
+
|
12
17
|
var initialize = function initialize(item) {
|
13
18
|
var items = item.items;
|
14
19
|
return _objectSpread(_objectSpread({}, item), {}, {
|
15
20
|
items: items ? initializeItems(items) : {}
|
16
21
|
});
|
17
22
|
};
|
23
|
+
|
18
24
|
export default initialize;
|
@@ -1,18 +1,24 @@
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
+
|
3
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
4
7
|
var initializeItems = function initializeItems(items) {
|
5
8
|
if (items) {
|
6
9
|
return _objectSpread(_objectSpread({}, items), {}, {
|
7
10
|
name: 'items'
|
8
11
|
});
|
9
12
|
}
|
13
|
+
|
10
14
|
return items;
|
11
15
|
};
|
16
|
+
|
12
17
|
var initialize = function initialize(item) {
|
13
18
|
var items = item.items;
|
14
19
|
return _objectSpread(_objectSpread({}, item), {}, {
|
15
20
|
items: items ? initializeItems(items) : {}
|
16
21
|
});
|
17
22
|
};
|
23
|
+
|
18
24
|
export default initialize;
|
@@ -1,14 +1,19 @@
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
+
|
3
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
4
7
|
var initializeItems = function initializeItems(items) {
|
5
8
|
if (items) {
|
6
9
|
return _objectSpread(_objectSpread({}, items), {}, {
|
7
10
|
name: 'items'
|
8
11
|
});
|
9
12
|
}
|
13
|
+
|
10
14
|
return items;
|
11
15
|
};
|
16
|
+
|
12
17
|
var initializeChildren = function initializeChildren(item) {
|
13
18
|
var decoratorProps = item.decoratorProps;
|
14
19
|
return _objectSpread(_objectSpread({}, item), decoratorProps ? {
|
@@ -17,10 +22,11 @@ var initializeChildren = function initializeChildren(item) {
|
|
17
22
|
}, decoratorProps)
|
18
23
|
} : {});
|
19
24
|
};
|
25
|
+
|
20
26
|
var initialize = function initialize(item) {
|
21
27
|
var _item$children = item.children,
|
22
|
-
|
23
|
-
|
28
|
+
children = _item$children === void 0 ? [] : _item$children,
|
29
|
+
items = item.items;
|
24
30
|
return _objectSpread(_objectSpread({}, item), {}, {
|
25
31
|
children: children.map(function (item) {
|
26
32
|
return initializeChildren(item);
|
@@ -28,4 +34,5 @@ var initialize = function initialize(item) {
|
|
28
34
|
items: items ? initializeItems(items) : {}
|
29
35
|
});
|
30
36
|
};
|
37
|
+
|
31
38
|
export default initialize;
|
@@ -1,31 +1,39 @@
|
|
1
1
|
var _excluded = ["title", "decoratorProps"],
|
2
|
-
|
2
|
+
_excluded2 = ["title", "dataIndex", "cell", "htmlTitle", "sortable", "width", "align", "alignHeader", "filters", "filterMode", "filterMenuProps", "lock", "resizable", "colSpan"];
|
3
|
+
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
5
|
+
|
4
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
7
|
+
|
5
8
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
9
|
+
|
6
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
11
|
+
|
7
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
13
|
+
|
8
14
|
var initializeColumn = function initializeColumn(item) {
|
9
15
|
var title = item.title,
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
16
|
+
_item$decoratorProps = item.decoratorProps,
|
17
|
+
decoratorProps = _item$decoratorProps === void 0 ? {} : _item$decoratorProps,
|
18
|
+
children = _objectWithoutProperties(item, _excluded); // 将Table.Column属性和组件FormItem属性通过decoratorProps统一传入,再分别赋值
|
19
|
+
|
20
|
+
|
14
21
|
var columnTitle = decoratorProps.title,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
dataIndex = decoratorProps.dataIndex,
|
23
|
+
cell = decoratorProps.cell,
|
24
|
+
htmlTitle = decoratorProps.htmlTitle,
|
25
|
+
sortable = decoratorProps.sortable,
|
26
|
+
width = decoratorProps.width,
|
27
|
+
align = decoratorProps.align,
|
28
|
+
alignHeader = decoratorProps.alignHeader,
|
29
|
+
filters = decoratorProps.filters,
|
30
|
+
filterMode = decoratorProps.filterMode,
|
31
|
+
filterMenuProps = decoratorProps.filterMenuProps,
|
32
|
+
lock = decoratorProps.lock,
|
33
|
+
resizable = decoratorProps.resizable,
|
34
|
+
colSpan = decoratorProps.colSpan,
|
35
|
+
formItemDecoratorProps = _objectWithoutProperties(decoratorProps, _excluded2);
|
36
|
+
|
29
37
|
var columnProperties = {
|
30
38
|
title: title !== null && title !== void 0 ? title : columnTitle,
|
31
39
|
dataIndex: dataIndex,
|
@@ -50,9 +58,11 @@ var initializeColumn = function initializeColumn(item) {
|
|
50
58
|
})]
|
51
59
|
};
|
52
60
|
};
|
61
|
+
|
53
62
|
var initializeItems = function initializeItems(items) {
|
54
63
|
if (items) {
|
55
64
|
var _items$children;
|
65
|
+
|
56
66
|
return _objectSpread(_objectSpread({}, items), {}, {
|
57
67
|
name: 'items',
|
58
68
|
children: (_items$children = items.children) === null || _items$children === void 0 ? void 0 : _items$children.map(function (item) {
|
@@ -60,12 +70,14 @@ var initializeItems = function initializeItems(items) {
|
|
60
70
|
})
|
61
71
|
});
|
62
72
|
}
|
73
|
+
|
63
74
|
return items;
|
64
75
|
};
|
76
|
+
|
65
77
|
var initialize = function initialize(item) {
|
66
78
|
var _item$props = item.props,
|
67
|
-
|
68
|
-
|
79
|
+
props = _item$props === void 0 ? {} : _item$props,
|
80
|
+
items = item.items;
|
69
81
|
return _objectSpread(_objectSpread({}, item), {}, {
|
70
82
|
props: _objectSpread({
|
71
83
|
pagination: {
|
@@ -75,4 +87,5 @@ var initialize = function initialize(item) {
|
|
75
87
|
items: items ? initializeItems(items) : {}
|
76
88
|
});
|
77
89
|
};
|
90
|
+
|
78
91
|
export default initialize;
|