@teamix/pro 1.4.24 → 1.4.25-bugfix.2
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.all.min.css +1 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +76829 -56886
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +13 -6
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +2 -9
- package/es/actions/dialog-form.js +37 -75
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.d.ts +2 -0
- package/es/actions/dialog.js +57 -94
- package/es/actions/index.d.ts +7 -0
- package/es/actions/index.js +93 -153
- package/es/actions/index.scss +6 -1
- package/es/actions/link.js +3 -5
- package/es/actions/quick.d.ts +2 -0
- package/es/actions/quick.js +26 -0
- package/es/actions/request.js +12 -27
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +0 -5
- package/es/card/divider.js +0 -5
- package/es/card/index.js +61 -100
- package/es/card/index.scss +15 -0
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- package/es/card/xconsole.scss +3 -0
- package/es/form/Components/Editable/index.js +16 -55
- package/es/form/Components/FormGroup/index.d.ts +1 -0
- package/es/form/Components/FormGroup/index.js +7 -22
- package/es/form/Components/LightFilter/index.js +15 -35
- package/es/form/Components/ProField/index.js +2 -14
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.d.ts +1 -0
- package/es/form/Components/Text/index.js +2 -11
- package/es/form/Filter/AdvancedFilter.js +18 -27
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +13 -24
- package/es/form/Filter/SimpleFilter.js +7 -21
- package/es/form/Filter/index.js +117 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/es/form/ProForm/addCascadeEffect.js +203 -0
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +30 -38
- package/es/form/ProForm/index.scss +33 -0
- package/es/form/ProForm/useAutoLayout.js +21 -42
- package/es/form/ProForm/useAutoSubmit.js +3 -8
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -28
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +0 -3
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +0 -8
- package/es/form/SchemaForm/adapterType.js +0 -2
- package/es/form/SchemaForm/index.js +78 -114
- package/es/form/SchemaForm/initializeArrayCards.js +0 -6
- package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
- package/es/form/SchemaForm/initializeArrayItems.js +2 -9
- package/es/form/SchemaForm/initializeArrayTable.js +21 -34
- package/es/form/SchemaForm/initializeDataSource.js +2 -6
- package/es/form/SchemaForm/initializeFormButton.js +14 -31
- package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/es/form/SchemaForm/initializeFormGroup.js +10 -20
- package/es/form/SchemaForm/initializeFormStep.js +11 -23
- package/es/form/SchemaForm/initializeFormTab.js +10 -20
- package/es/form/SchemaForm/initializeReactions.js +9 -33
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +7 -33
- package/es/form/SchemaForm/reactions.js +19 -34
- package/es/form/docs/ActionResponse.d.ts +1 -0
- package/es/form/index.d.ts +12 -9
- package/es/form/index.js +0 -9
- package/es/form/typing.d.ts +26 -4
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +4 -49
- package/es/form/warning.js +2 -7
- package/es/global.scss +3 -1
- package/es/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +18 -8
- package/es/info/components/InfoGroup/index.js +21 -32
- package/es/info/components/InfoValueItem/index.js +74 -116
- package/es/info/components/ProInfoItem/index.js +13 -21
- package/es/info/components/baseInfo/index.js +17 -27
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +61 -86
- package/es/info/typing.d.ts +6 -1
- package/es/info/utils/index.js +0 -11
- package/es/next-xconsole.scss +34 -0
- package/es/nocode/configurators/ProTable.js +1 -22
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +2 -3
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +5 -30
- package/es/nocode/pages/playground.js +18 -35
- package/es/nocode/pages/renderer.js +9 -42
- package/es/nocode/playground.js +10 -23
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +40 -76
- package/es/page-header/index.scss +2 -1
- package/es/page-header/xconsole.scss +5 -0
- package/es/sidebar/components/sidebar-container/index.js +54 -69
- package/es/sidebar/components/sidebar-container/index.scss +21 -14
- package/es/sidebar/components/tree/index.js +100 -138
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
- package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +42 -84
- package/es/sidebar/components/tree-node/index.scss +6 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +72 -95
- package/es/sidebar/typing.d.ts +4 -0
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.d.ts +5 -2
- package/es/sidebar/utils/index.js +41 -98
- package/es/table/components/CardView/index.d.ts +5 -0
- package/es/table/components/CardView/index.js +392 -0
- package/es/table/components/CardView/index.scss +46 -0
- package/es/table/components/Filter/index.d.ts +6 -3
- package/es/table/components/Filter/index.js +115 -128
- package/es/table/components/Layout/index.js +32 -47
- package/es/table/components/Layout/index.scss +2 -1
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +88 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/Pagination/index.js +26 -60
- package/es/table/components/QuickAction/index.d.ts +1 -0
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +52 -0
- package/es/table/components/ToolBar/DensityIcon.js +19 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +87 -125
- package/es/table/components/ToolBar/FullScreenIcon.js +7 -62
- package/es/table/components/ToolBar/Fullscreen.js +25 -28
- package/es/table/components/ToolBar/RefreshIcon.js +162 -27
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +130 -38
- package/es/table/components/ToolBar/index.scss +49 -3
- package/es/table/index.js +467 -422
- package/es/table/index.scss +9 -1
- package/es/table/typing.d.ts +125 -6
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +39 -79
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +13 -16
- package/es/table/utils/index.js +14 -47
- package/es/table/utils/pureColumnRender.js +21 -53
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/table/utils/util.d.ts +5 -0
- package/es/table/utils/util.js +19 -0
- package/es/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +25 -65
- package/es/timeline/index.js +8 -22
- package/es/timeline/typing.d.ts +1 -0
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +0 -5
- package/es/xconsole.scss +503 -0
- package/lib/actions/base.js +8 -24
- package/lib/actions/confirm.js +0 -5
- package/lib/actions/danger-confirm.js +0 -5
- package/lib/actions/danger-pop-confirm.js +0 -4
- package/lib/actions/dialog-component.js +2 -15
- package/lib/actions/dialog-form.js +36 -89
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.d.ts +2 -0
- package/lib/actions/dialog.js +55 -111
- package/lib/actions/drawer-form.js +0 -3
- package/lib/actions/drawer-info.js +0 -3
- package/lib/actions/drawer-table.js +0 -3
- package/lib/actions/drawer.js +0 -4
- package/lib/actions/error.js +0 -5
- package/lib/actions/index.d.ts +7 -0
- package/lib/actions/index.js +115 -184
- package/lib/actions/index.scss +6 -1
- package/lib/actions/link.js +1 -10
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/quick.d.ts +2 -0
- package/lib/actions/quick.js +33 -0
- package/lib/actions/request.js +8 -32
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +0 -9
- package/lib/card/divider.js +0 -7
- package/lib/card/index.js +61 -127
- package/lib/card/index.scss +15 -0
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- package/lib/card/xconsole.scss +3 -0
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +15 -65
- package/lib/form/Components/FormGroup/index.d.ts +1 -0
- package/lib/form/Components/FormGroup/index.js +7 -28
- package/lib/form/Components/LightFilter/index.js +15 -47
- package/lib/form/Components/ProField/index.js +2 -21
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.d.ts +1 -0
- package/lib/form/Components/Text/index.js +2 -16
- package/lib/form/Filter/AdvancedFilter.js +17 -34
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +13 -32
- package/lib/form/Filter/SimpleFilter.js +5 -27
- package/lib/form/Filter/index.js +116 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/lib/form/ProForm/addCascadeEffect.js +210 -0
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +30 -60
- package/lib/form/ProForm/index.scss +33 -0
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +1 -10
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -34
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +0 -6
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +0 -5
- package/lib/form/SchemaForm/index.js +78 -144
- package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
- package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
- package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
- package/lib/form/SchemaForm/initializeDataSource.js +2 -8
- package/lib/form/SchemaForm/initializeFormButton.js +14 -32
- package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
- package/lib/form/SchemaForm/initializeFormStep.js +11 -23
- package/lib/form/SchemaForm/initializeFormTab.js +10 -20
- package/lib/form/SchemaForm/initializeReactions.js +9 -37
- package/lib/form/SchemaForm/initializeRequest.js +2 -18
- package/lib/form/SchemaForm/initializeRules.js +4 -24
- package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
- package/lib/form/SchemaForm/reactions.js +17 -37
- package/lib/form/docs/ActionResponse.d.ts +1 -0
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.d.ts +12 -9
- package/lib/form/index.js +0 -25
- package/lib/form/typing.d.ts +26 -4
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +4 -61
- package/lib/form/warning.js +2 -8
- package/lib/global.scss +3 -1
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +13 -40
- package/lib/info/components/InfoGroup/index.js +21 -42
- package/lib/info/components/InfoValueItem/index.js +74 -131
- package/lib/info/components/ProInfoItem/index.js +13 -29
- package/lib/info/components/baseInfo/index.js +17 -39
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +61 -101
- package/lib/info/typing.d.ts +6 -1
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/next-xconsole.scss +34 -0
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +1 -24
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +2 -10
- package/lib/nocode/configurators/map.js +0 -5
- package/lib/nocode/index.js +0 -11
- package/lib/nocode/pages/editor.js +5 -19
- package/lib/nocode/pages/index.js +3 -35
- package/lib/nocode/pages/playground.js +18 -52
- package/lib/nocode/pages/renderer.js +9 -53
- package/lib/nocode/playground.js +10 -35
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +39 -90
- package/lib/page-header/index.scss +2 -1
- package/lib/page-header/xconsole.scss +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +54 -81
- package/lib/sidebar/components/sidebar-container/index.scss +21 -14
- package/lib/sidebar/components/tree/index.js +100 -152
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +42 -100
- package/lib/sidebar/components/tree-node/index.scss +6 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +79 -111
- package/lib/sidebar/typing.d.ts +4 -0
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.d.ts +5 -2
- package/lib/sidebar/utils/index.js +41 -106
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/CardView/index.d.ts +5 -0
- package/lib/table/components/CardView/index.js +402 -0
- package/lib/table/components/CardView/index.scss +46 -0
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.d.ts +6 -3
- package/lib/table/components/Filter/index.js +114 -137
- package/lib/table/components/Layout/index.js +32 -60
- package/lib/table/components/Layout/index.scss +2 -1
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +99 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/Pagination/index.js +26 -70
- package/lib/table/components/QuickAction/index.d.ts +1 -0
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +60 -0
- package/lib/table/components/ToolBar/DensityIcon.js +19 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +86 -136
- package/lib/table/components/ToolBar/FullScreenIcon.js +10 -74
- package/lib/table/components/ToolBar/Fullscreen.js +25 -35
- package/lib/table/components/ToolBar/RefreshIcon.js +164 -36
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +133 -47
- package/lib/table/components/ToolBar/index.scss +49 -3
- package/lib/table/index.js +466 -444
- package/lib/table/index.scss +9 -1
- package/lib/table/typing.d.ts +125 -6
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +39 -92
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +13 -21
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +12 -55
- package/lib/table/utils/pureColumnRender.js +21 -64
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/table/utils/util.d.ts +5 -0
- package/lib/table/utils/util.js +25 -0
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +2 -19
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +25 -76
- package/lib/timeline/index.js +8 -33
- package/lib/timeline/typing.d.ts +1 -0
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +0 -10
- package/lib/xconsole.scss +503 -0
- package/package.json +2 -2
@@ -1,90 +1,68 @@
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
1
2
|
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
|
-
|
3
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
|
-
|
5
4
|
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
|
-
|
5
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
7
6
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
8
|
-
|
9
7
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
10
|
-
|
11
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
12
|
-
|
13
9
|
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."); }
|
14
|
-
|
15
10
|
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
|
-
|
17
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; }
|
18
|
-
|
19
12
|
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; }
|
20
|
-
|
21
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
22
|
-
|
23
|
-
function _extends() { _extends = Object.assign
|
24
|
-
|
14
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
25
16
|
import React, { useState } from 'react';
|
26
17
|
import { useField, observer } from '@formily/react';
|
27
18
|
import { Dialog, Drawer, Balloon } from '@alicloudfe/components';
|
28
19
|
import TeamixIcon from '@teamix/icon';
|
29
20
|
import { BaseItem } from '@teamix/formily';
|
30
21
|
import { usePrefixCls } from '@teamix/utils';
|
31
|
-
|
32
22
|
var useParentPattern = function useParentPattern() {
|
33
23
|
var _field$parent, _field$form;
|
34
|
-
|
35
24
|
var field = useField();
|
36
25
|
return (field === null || field === void 0 ? void 0 : (_field$parent = field.parent) === null || _field$parent === void 0 ? void 0 : _field$parent.pattern) || (field === null || field === void 0 ? void 0 : (_field$form = field.form) === null || _field$form === void 0 ? void 0 : _field$form.pattern);
|
37
26
|
};
|
38
|
-
|
39
27
|
export var Editable = observer(function (props) {
|
40
28
|
return null;
|
41
29
|
});
|
42
|
-
|
43
30
|
Editable.BaseBuilder = function (type) {
|
44
31
|
return observer(function (_ref) {
|
45
|
-
var props = _extends({}, _ref);
|
46
|
-
|
32
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
47
33
|
var field = useField();
|
48
34
|
var pattern = useParentPattern();
|
49
|
-
|
50
35
|
var _useState = useState(false),
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
37
|
+
visible = _useState2[0],
|
38
|
+
setVisible = _useState2[1];
|
55
39
|
var prefixCls = usePrefixCls('formily-editable', {
|
56
40
|
base: true
|
57
41
|
});
|
58
|
-
|
59
42
|
var onOk = /*#__PURE__*/function () {
|
60
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/
|
43
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
61
44
|
var errors;
|
62
|
-
return
|
45
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
63
46
|
while (1) {
|
64
47
|
switch (_context.prev = _context.next) {
|
65
48
|
case 0:
|
66
49
|
_context.prev = 0;
|
67
50
|
_context.next = 3;
|
68
51
|
return field.form.validate("".concat(field.address, ".*"));
|
69
|
-
|
70
52
|
case 3:
|
71
53
|
_context.prev = 3;
|
72
54
|
errors = field.form.queryFeedbacks({
|
73
55
|
type: 'error',
|
74
56
|
address: "".concat(field.address, ".*")
|
75
57
|
});
|
76
|
-
|
77
58
|
if (!(errors === null || errors === void 0 ? void 0 : errors.length)) {
|
78
59
|
_context.next = 7;
|
79
60
|
break;
|
80
61
|
}
|
81
|
-
|
82
62
|
return _context.abrupt("return");
|
83
|
-
|
84
63
|
case 7:
|
85
64
|
setVisible(false);
|
86
65
|
return _context.finish(3);
|
87
|
-
|
88
66
|
case 9:
|
89
67
|
case "end":
|
90
68
|
return _context.stop();
|
@@ -92,20 +70,16 @@ Editable.BaseBuilder = function (type) {
|
|
92
70
|
}
|
93
71
|
}, _callee, null, [[0,, 3, 9]]);
|
94
72
|
}));
|
95
|
-
|
96
73
|
return function onOk() {
|
97
74
|
return _ref2.apply(this, arguments);
|
98
75
|
};
|
99
76
|
}();
|
100
|
-
|
101
77
|
var onCancel = function onCancel() {
|
102
78
|
setVisible(false);
|
103
79
|
};
|
104
|
-
|
105
80
|
var onOpen = function onOpen() {
|
106
81
|
setVisible(true);
|
107
82
|
};
|
108
|
-
|
109
83
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
110
84
|
style: {
|
111
85
|
display: 'inline-flex'
|
@@ -131,51 +105,41 @@ Editable.BaseBuilder = function (type) {
|
|
131
105
|
})));
|
132
106
|
});
|
133
107
|
};
|
134
|
-
|
135
108
|
Editable.Popover = observer(function (_ref3) {
|
136
|
-
var props = _extends({}, _ref3);
|
137
|
-
|
109
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));
|
138
110
|
var field = useField();
|
139
111
|
var pattern = useParentPattern();
|
140
|
-
|
141
112
|
var _useState3 = useState(false),
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
113
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
114
|
+
visible = _useState4[0],
|
115
|
+
setVisible = _useState4[1];
|
146
116
|
var prefixCls = usePrefixCls('formily-editable', {
|
147
117
|
base: true
|
148
118
|
});
|
149
|
-
|
150
119
|
var closePopover = /*#__PURE__*/function () {
|
151
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/
|
120
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
152
121
|
var errors;
|
153
|
-
return
|
122
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
154
123
|
while (1) {
|
155
124
|
switch (_context2.prev = _context2.next) {
|
156
125
|
case 0:
|
157
126
|
_context2.prev = 0;
|
158
127
|
_context2.next = 3;
|
159
128
|
return field.form.validate("".concat(field.address, ".*"));
|
160
|
-
|
161
129
|
case 3:
|
162
130
|
_context2.prev = 3;
|
163
131
|
errors = field.form.queryFeedbacks({
|
164
132
|
type: 'error',
|
165
133
|
address: "".concat(field.address, ".*")
|
166
134
|
});
|
167
|
-
|
168
135
|
if (!(errors === null || errors === void 0 ? void 0 : errors.length)) {
|
169
136
|
_context2.next = 7;
|
170
137
|
break;
|
171
138
|
}
|
172
|
-
|
173
139
|
return _context2.abrupt("return");
|
174
|
-
|
175
140
|
case 7:
|
176
141
|
setVisible(false);
|
177
142
|
return _context2.finish(3);
|
178
|
-
|
179
143
|
case 9:
|
180
144
|
case "end":
|
181
145
|
return _context2.stop();
|
@@ -183,16 +147,13 @@ Editable.Popover = observer(function (_ref3) {
|
|
183
147
|
}
|
184
148
|
}, _callee2, null, [[0,, 3, 9]]);
|
185
149
|
}));
|
186
|
-
|
187
150
|
return function closePopover() {
|
188
151
|
return _ref4.apply(this, arguments);
|
189
152
|
};
|
190
153
|
}();
|
191
|
-
|
192
154
|
var openPopover = function openPopover() {
|
193
155
|
setVisible(true);
|
194
156
|
};
|
195
|
-
|
196
157
|
return /*#__PURE__*/React.createElement(Balloon, _objectSpread(_objectSpread({}, props), {}, {
|
197
158
|
title: field.title,
|
198
159
|
className: props.className,
|
@@ -1,35 +1,25 @@
|
|
1
1
|
var _excluded = ["children", "title", "xIndex"],
|
2
|
-
|
3
|
-
|
2
|
+
_excluded2 = ["children"];
|
4
3
|
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; }
|
5
|
-
|
6
4
|
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; }
|
7
|
-
|
8
5
|
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; }
|
9
|
-
|
10
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; }
|
11
|
-
|
12
7
|
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; }
|
13
|
-
|
14
8
|
import React from 'react';
|
15
9
|
import cls from 'classnames';
|
16
10
|
import { observer, useFieldSchema, useField, RecursionField } from '@formily/react';
|
17
11
|
import { usePrefixCls } from '@teamix/utils';
|
18
12
|
import './index.scss';
|
19
|
-
|
20
13
|
var usePanels = function usePanels() {
|
21
14
|
var groupField = useField();
|
22
15
|
var schema = useFieldSchema();
|
23
16
|
var panels = [];
|
24
17
|
schema.mapProperties(function (schema, name) {
|
25
18
|
var _schema$xComponent;
|
26
|
-
|
27
19
|
var field = groupField.query(groupField.address.concat(name)).take();
|
28
20
|
if ((field === null || field === void 0 ? void 0 : field.display) === 'none' || (field === null || field === void 0 ? void 0 : field.display) === 'hidden') return;
|
29
|
-
|
30
21
|
if (((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.indexOf('GroupPanel')) > -1) {
|
31
22
|
var _schema$xComponentP, _schema$xComponentP2;
|
32
|
-
|
33
23
|
panels.push({
|
34
24
|
name: name,
|
35
25
|
props: _objectSpread(_objectSpread({}, schema === null || schema === void 0 ? void 0 : schema['x-component-props']), {}, {
|
@@ -42,13 +32,11 @@ var usePanels = function usePanels() {
|
|
42
32
|
});
|
43
33
|
return panels;
|
44
34
|
};
|
45
|
-
|
46
35
|
var FormGroupGroupPanel = observer(function (_ref) {
|
47
36
|
var children = _ref.children,
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
37
|
+
title = _ref.title,
|
38
|
+
xIndex = _ref.xIndex,
|
39
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
52
40
|
var prefixCls = usePrefixCls('formily-group-panel', {
|
53
41
|
base: true
|
54
42
|
});
|
@@ -62,8 +50,7 @@ var FormGroupGroupPanel = observer(function (_ref) {
|
|
62
50
|
});
|
63
51
|
var FormGroup = observer(function (_ref2) {
|
64
52
|
var children = _ref2.children,
|
65
|
-
|
66
|
-
|
53
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
67
54
|
var prefixCls = usePrefixCls('formily-group', {
|
68
55
|
base: true
|
69
56
|
});
|
@@ -72,8 +59,8 @@ var FormGroup = observer(function (_ref2) {
|
|
72
59
|
className: cls(prefixCls(), props.className)
|
73
60
|
}), panels.map(function (_ref3, index) {
|
74
61
|
var props = _ref3.props,
|
75
|
-
|
76
|
-
|
62
|
+
schema = _ref3.schema,
|
63
|
+
name = _ref3.name;
|
77
64
|
return /*#__PURE__*/React.createElement(FormGroupGroupPanel, _objectSpread({
|
78
65
|
key: index,
|
79
66
|
xIndex: index
|
@@ -83,11 +70,9 @@ var FormGroup = observer(function (_ref2) {
|
|
83
70
|
}));
|
84
71
|
}));
|
85
72
|
});
|
86
|
-
|
87
73
|
var GroupPanel = function GroupPanel(_ref4) {
|
88
74
|
var children = _ref4.children;
|
89
75
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
90
76
|
};
|
91
|
-
|
92
77
|
FormGroup.GroupPanel = GroupPanel;
|
93
78
|
export default FormGroup;
|
@@ -1,21 +1,12 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
-
|
3
2
|
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
|
-
|
5
3
|
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
|
-
|
7
4
|
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
|
-
|
9
5
|
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
|
-
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
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; }
|
18
|
-
|
19
10
|
import React, { useState, useCallback, useContext, useEffect } from 'react';
|
20
11
|
import { observer, useFieldSchema, RecursionField, SchemaExpressionScopeContext } from '@formily/react';
|
21
12
|
import { Select, Button } from '@alicloudfe/components';
|
@@ -24,20 +15,15 @@ import cls from 'classnames';
|
|
24
15
|
import { usePrefixCls, getTargetValue } from '@teamix/utils';
|
25
16
|
import { componentMap, inputCategory } from './componentMap';
|
26
17
|
import './index.scss';
|
27
|
-
|
28
18
|
var formatComponent = function formatComponent(schema) {
|
29
19
|
var _schema$enum;
|
30
|
-
|
31
20
|
var component = schema['x-component'];
|
32
|
-
|
33
21
|
if (component === 'Checkbox' && ((_schema$enum = schema['enum']) === null || _schema$enum === void 0 ? void 0 : _schema$enum.length)) {
|
34
22
|
component = 'CheckboxGroup';
|
35
23
|
}
|
36
|
-
|
37
24
|
return componentMap[component] || component;
|
38
|
-
};
|
39
|
-
|
40
|
-
|
25
|
+
};
|
26
|
+
// 主激活区内容
|
41
27
|
var useMain = function useMain(active) {
|
42
28
|
var schema = useFieldSchema();
|
43
29
|
var main = [];
|
@@ -53,9 +39,8 @@ var useMain = function useMain(active) {
|
|
53
39
|
}
|
54
40
|
});
|
55
41
|
return main;
|
56
|
-
};
|
57
|
-
|
58
|
-
|
42
|
+
};
|
43
|
+
// 筛选项数据
|
59
44
|
var useFilterItems = function useFilterItems(filterValues, scope) {
|
60
45
|
var schema = useFieldSchema();
|
61
46
|
var filterItems = [];
|
@@ -69,31 +54,26 @@ var useFilterItems = function useFilterItems(filterValues, scope) {
|
|
69
54
|
}
|
70
55
|
});
|
71
56
|
return filterItems;
|
72
|
-
};
|
73
|
-
|
74
|
-
|
57
|
+
};
|
58
|
+
// 是否输入框类型的组件
|
75
59
|
var isInputCategory = function isInputCategory(currentSchema) {
|
76
60
|
var component = currentSchema === null || currentSchema === void 0 ? void 0 : currentSchema['x-component'];
|
77
61
|
return inputCategory.includes(component);
|
78
62
|
};
|
79
|
-
|
80
63
|
var LightFilter = observer(function (props) {
|
81
64
|
var _filterItems$, _main$;
|
82
|
-
|
83
65
|
var size = props.size,
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
66
|
+
defaultFilterValue = props.defaultFilterValue,
|
67
|
+
filterValues = props.filterValues,
|
68
|
+
onFilterChange = props.onFilterChange,
|
69
|
+
filterProps = props.filterProps,
|
70
|
+
buttonProps = props.buttonProps;
|
89
71
|
var scope = useContext(SchemaExpressionScopeContext);
|
90
72
|
var filterItems = useFilterItems(filterValues, scope);
|
91
|
-
|
92
73
|
var _useState = useState(defaultFilterValue || ((_filterItems$ = filterItems[0]) === null || _filterItems$ === void 0 ? void 0 : _filterItems$.value)),
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
74
|
+
_useState2 = _slicedToArray(_useState, 2),
|
75
|
+
active = _useState2[0],
|
76
|
+
setActive = _useState2[1];
|
97
77
|
var main = useMain(active);
|
98
78
|
var currentSchema = (_main$ = main[0]) === null || _main$ === void 0 ? void 0 : _main$.schema;
|
99
79
|
var basePrefix = usePrefixCls('', {
|
@@ -102,7 +82,7 @@ var LightFilter = observer(function (props) {
|
|
102
82
|
var prefixCls = usePrefixCls('teamix-pro-form-light-filter');
|
103
83
|
var content = main.map(function (_ref, key) {
|
104
84
|
var schema = _ref.schema,
|
105
|
-
|
85
|
+
name = _ref.name;
|
106
86
|
return /*#__PURE__*/React.createElement(RecursionField, {
|
107
87
|
key: key,
|
108
88
|
name: name,
|
@@ -1,27 +1,17 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
-
|
3
2
|
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
|
-
|
5
3
|
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
|
-
|
7
4
|
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
|
-
|
9
5
|
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
|
-
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
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; }
|
18
|
-
|
19
10
|
import React from 'react';
|
20
11
|
import { connect, mapProps } from '@formily/react';
|
21
12
|
import { mapSize, mapStatus, mapDataSource, mapMode } from '../../utils';
|
22
13
|
import ProField from '../../../field';
|
23
14
|
import fieldTypeMap from '../../fieldTypeMap';
|
24
|
-
|
25
15
|
var componentBuilder = function componentBuilder(type) {
|
26
16
|
return connect(function (props) {
|
27
17
|
return /*#__PURE__*/React.createElement(ProField, _objectSpread(_objectSpread({}, props), {}, {
|
@@ -29,14 +19,12 @@ var componentBuilder = function componentBuilder(type) {
|
|
29
19
|
}));
|
30
20
|
}, mapProps(mapSize, mapStatus, mapDataSource, mapMode));
|
31
21
|
};
|
32
|
-
|
33
22
|
export default (function () {
|
34
23
|
var components = {};
|
35
24
|
Object.entries(fieldTypeMap).forEach(function (_ref) {
|
36
25
|
var _ref2 = _slicedToArray(_ref, 2),
|
37
|
-
|
38
|
-
|
39
|
-
|
26
|
+
name = _ref2[0],
|
27
|
+
type = _ref2[1];
|
40
28
|
components[name] = componentBuilder(type);
|
41
29
|
});
|
42
30
|
return components;
|
@@ -1,65 +1,46 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
-
|
3
2
|
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
|
-
|
5
3
|
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
|
-
|
7
4
|
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
|
-
|
9
5
|
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
|
-
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
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; }
|
18
|
-
|
19
10
|
import { isEmpty } from '@formily/shared';
|
20
11
|
import { isArr, isFn } from '@teamix/utils';
|
21
12
|
import Moment from 'moment';
|
22
|
-
|
23
13
|
var moment = function moment(date, format) {
|
24
14
|
return Moment((date === null || date === void 0 ? void 0 : date.toDate) ? date.toDate() : date, format);
|
25
15
|
};
|
26
|
-
|
27
16
|
var momentable = function momentable(value, format) {
|
28
17
|
return Array.isArray(value) ? value.map(function (val) {
|
29
18
|
return moment(val, format);
|
30
19
|
}) : value ? moment(value, format) : value;
|
31
20
|
};
|
32
|
-
|
33
21
|
var formatMomentValue = function formatMomentValue(value, format, placeholder) {
|
34
22
|
var formatDate = function formatDate(date, format) {
|
35
23
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
36
24
|
if (!date) return placeholder;
|
37
|
-
|
38
25
|
if (isArr(format)) {
|
39
26
|
var _format = format[i];
|
40
|
-
|
41
27
|
if (isFn(_format)) {
|
42
28
|
return _format(date);
|
43
29
|
}
|
44
|
-
|
45
30
|
if (isEmpty(_format)) {
|
46
31
|
return date;
|
47
32
|
}
|
48
|
-
|
49
33
|
return moment(date).format(_format);
|
50
34
|
} else {
|
51
35
|
if (isFn(format)) {
|
52
36
|
return format(date);
|
53
37
|
}
|
54
|
-
|
55
38
|
if (isEmpty(format)) {
|
56
39
|
return date;
|
57
40
|
}
|
58
|
-
|
59
41
|
return moment(date).format(format);
|
60
42
|
}
|
61
43
|
};
|
62
|
-
|
63
44
|
if (isArr(value)) {
|
64
45
|
return value.map(function (val, index) {
|
65
46
|
return formatDate(val, format, index);
|
@@ -68,11 +49,9 @@ var formatMomentValue = function formatMomentValue(value, format, placeholder) {
|
|
68
49
|
return value ? formatDate(value, format) : value || placeholder;
|
69
50
|
}
|
70
51
|
};
|
71
|
-
|
72
52
|
var mapDateFormatDatePicker2 = function mapDateFormatDatePicker2(type) {
|
73
53
|
var getDefaultFormat = function getDefaultFormat(props) {
|
74
54
|
var _type = props['type'] || type;
|
75
|
-
|
76
55
|
if (_type === 'month') {
|
77
56
|
return 'YYYY-MM';
|
78
57
|
} else if (_type === 'quarter') {
|
@@ -82,10 +61,8 @@ var mapDateFormatDatePicker2 = function mapDateFormatDatePicker2(type) {
|
|
82
61
|
} else if (_type === 'week') {
|
83
62
|
return 'YYYY-wo';
|
84
63
|
}
|
85
|
-
|
86
64
|
return props['showTime'] ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';
|
87
65
|
};
|
88
|
-
|
89
66
|
return function (props) {
|
90
67
|
var format = props['format'] || getDefaultFormat(props);
|
91
68
|
var _onChange = props.onChange;
|
@@ -100,13 +77,10 @@ var mapDateFormatDatePicker2 = function mapDateFormatDatePicker2(type) {
|
|
100
77
|
});
|
101
78
|
};
|
102
79
|
};
|
103
|
-
|
104
80
|
var mapDateFormat = function mapDateFormat(props, field) {
|
105
81
|
var _ref = field.component || [],
|
106
|
-
|
107
|
-
|
108
|
-
|
82
|
+
_ref2 = _slicedToArray(_ref, 1),
|
83
|
+
component = _ref2[0];
|
109
84
|
return {};
|
110
85
|
};
|
111
|
-
|
112
86
|
export default mapDateFormat;
|
@@ -1,29 +1,20 @@
|
|
1
1
|
var _excluded = ["children", "className"];
|
2
|
-
|
3
2
|
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; }
|
4
|
-
|
5
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; }
|
6
|
-
|
7
4
|
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; }
|
8
|
-
|
9
5
|
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; }
|
10
|
-
|
11
6
|
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; }
|
12
|
-
|
13
7
|
import React from 'react';
|
14
8
|
import cls from 'classnames';
|
15
9
|
import { usePrefixCls } from '@teamix/utils';
|
16
10
|
import './index.scss';
|
17
|
-
|
18
11
|
var Text = function Text(_ref) {
|
19
12
|
var children = _ref.children,
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
className = _ref.className,
|
14
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
23
15
|
var prefixCls = usePrefixCls('teamix-pro-form-text');
|
24
16
|
return /*#__PURE__*/React.createElement("span", _objectSpread({
|
25
17
|
className: cls(prefixCls(), className)
|
26
18
|
}, otherProps), children);
|
27
19
|
};
|
28
|
-
|
29
20
|
export default Text;
|