@teamix/pro 1.4.25-bugfix → 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 +78506 -59443
- 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.js +57 -95
- 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 +11 -26
- 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/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 +9 -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 +66 -119
- 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 +2 -0
- 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 +25 -58
- 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 +455 -423
- package/es/table/index.scss +8 -0
- 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.js +55 -112
- 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 +11 -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/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 +9 -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 +66 -134
- 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 +2 -0
- 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 +25 -68
- 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 +454 -445
- package/lib/table/index.scss +8 -0
- 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 +1 -1
@@ -1,21 +1,12 @@
|
|
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
|
-
|
3
2
|
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
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; }
|
6
|
-
|
7
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
8
|
-
|
9
5
|
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."); }
|
10
|
-
|
11
6
|
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); }
|
12
|
-
|
13
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
14
|
-
|
15
8
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
16
|
-
|
17
9
|
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
10
|
import React, { useMemo } from 'react';
|
20
11
|
import './index.scss';
|
21
12
|
import { Table } from '@alicloudfe/components';
|
@@ -25,21 +16,19 @@ import InfoValueItem from '../InfoValueItem';
|
|
25
16
|
import { ProSkeletonRaw } from '../../..';
|
26
17
|
import { getDataIndexValue, isHidden } from '../../utils';
|
27
18
|
import cloneDeep from 'lodash.clonedeep';
|
28
|
-
|
29
19
|
var ProTableInfo = function ProTableInfo(props) {
|
30
20
|
var columns = props.columns,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
21
|
+
dataSource = props.dataSource,
|
22
|
+
_props$layout = props.layout,
|
23
|
+
layout = _props$layout === void 0 ? {} : _props$layout,
|
24
|
+
loading = props.loading,
|
25
|
+
result = props.result,
|
26
|
+
actionRef = props.actionRef,
|
27
|
+
context = props.context;
|
38
28
|
var _layout$colNum = layout.colNum,
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
29
|
+
colNum = _layout$colNum === void 0 ? 2 : _layout$colNum,
|
30
|
+
_layout$labelGutter = layout.labelGutter,
|
31
|
+
labelGutter = _layout$labelGutter === void 0 ? '80px' : _layout$labelGutter;
|
43
32
|
var getNewColumns = function getNewColumns() {
|
44
33
|
// 需要 fill 填充 否则有可能不执行
|
45
34
|
return _toConsumableArray(new Array(colNum)).fill(1).map(function (_, index) {
|
@@ -56,10 +45,8 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
56
45
|
return [].concat(_toConsumableArray(acc), _toConsumableArray(cur));
|
57
46
|
}, []);
|
58
47
|
};
|
59
|
-
|
60
48
|
var getInfoValueItem = function getInfoValueItem(item) {
|
61
49
|
var _item$valueType;
|
62
|
-
|
63
50
|
return /*#__PURE__*/React.createElement(InfoValueItem, {
|
64
51
|
type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
|
65
52
|
value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
|
@@ -71,77 +58,66 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
71
58
|
props: item.props
|
72
59
|
});
|
73
60
|
};
|
74
|
-
|
75
61
|
var newDataSource = useMemo(function () {
|
76
62
|
var nResult = [];
|
77
63
|
var columnsCopy = cloneDeep(columns).filter(function (item) {
|
78
64
|
return !isHidden(item.hidden, getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result), dataSource !== null && dataSource !== void 0 ? dataSource : result, context);
|
79
|
-
});
|
80
|
-
|
65
|
+
});
|
66
|
+
// 取当前行的数据。直到取完
|
81
67
|
while (columnsCopy.length > 0) {
|
82
68
|
var filterColumns = [];
|
83
|
-
var col = colNum * 2;
|
84
|
-
|
69
|
+
var col = colNum * 2;
|
70
|
+
// 需要判断是否有合并行情况
|
85
71
|
while (col >= 2) {
|
86
72
|
if (columnsCopy.length > 0) {
|
87
73
|
var _columnsItem$colSpan;
|
88
|
-
|
89
74
|
var columnsItem = columnsCopy.shift();
|
90
|
-
var needCol = 1 + ((_columnsItem$colSpan = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan !== void 0 ? _columnsItem$colSpan : 1);
|
91
|
-
|
75
|
+
var needCol = 1 + ((_columnsItem$colSpan = columnsItem === null || columnsItem === void 0 ? void 0 : columnsItem.colSpan) !== null && _columnsItem$colSpan !== void 0 ? _columnsItem$colSpan : 1);
|
76
|
+
// 如果剩余的col能满足下一组数据那么就放在这一组
|
92
77
|
if (needCol <= col) {
|
93
78
|
col = col - needCol;
|
94
79
|
filterColumns.push(columnsItem);
|
95
80
|
} else {
|
96
81
|
var _filterColumns$0$colS;
|
97
|
-
|
98
82
|
// 不满足条件。再安回去。。。
|
99
|
-
columnsCopy.unshift(columnsItem);
|
100
|
-
|
101
|
-
filterColumns[0].colSpan = ((_filterColumns$0$colS = filterColumns[0].colSpan) !== null && _filterColumns$0$colS !== void 0 ? _filterColumns$0$colS : 1) + col;
|
102
|
-
|
83
|
+
columnsCopy.unshift(columnsItem);
|
84
|
+
// 并且把剩余的col都分配给前一组数据
|
85
|
+
filterColumns[0].colSpan = ((_filterColumns$0$colS = filterColumns[0].colSpan) !== null && _filterColumns$0$colS !== void 0 ? _filterColumns$0$colS : 1) + col;
|
86
|
+
// 置0
|
103
87
|
col = 0;
|
104
88
|
}
|
105
89
|
}
|
106
|
-
|
107
90
|
if (columnsCopy.length === 0) {
|
108
91
|
// 如果剩余仍有列数并且已经没有columns分配了
|
109
92
|
col = 0;
|
110
93
|
}
|
111
94
|
}
|
112
|
-
|
113
95
|
var itemData = filterColumns.map(function (item, index) {
|
114
96
|
var _item$title, _data;
|
115
|
-
|
116
97
|
var data = (_data = {}, _defineProperty(_data, "label_".concat(index), /*#__PURE__*/React.createElement(LabelIconTip, {
|
117
98
|
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
118
99
|
tooltip: item.tooltip,
|
119
100
|
icon: item.tooltipIcon
|
120
101
|
})), _defineProperty(_data, "value_".concat(index), /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null), !loading && getInfoValueItem(item))), _data);
|
121
|
-
|
122
102
|
if (item.colSpan) {
|
123
103
|
data['formatter'] = {
|
124
104
|
colSpan: item.colSpan
|
125
105
|
};
|
126
106
|
}
|
127
|
-
|
128
107
|
return data;
|
129
108
|
}).reduce(function (acc, cur) {
|
130
109
|
return _objectSpread(_objectSpread({}, acc), cur);
|
131
110
|
}, {});
|
132
111
|
nResult.push(itemData);
|
133
112
|
}
|
134
|
-
|
135
113
|
return nResult;
|
136
114
|
}, [loading, result]);
|
137
|
-
|
138
115
|
var setCellProps = function setCellProps(rowIndex, colIndex, dataIndex, record) {
|
139
116
|
if (colIndex % 2 === 0) {
|
140
117
|
return {
|
141
118
|
className: 'key-type'
|
142
119
|
};
|
143
120
|
}
|
144
|
-
|
145
121
|
if (record.formatter) {
|
146
122
|
if (record.formatter.colSpan) {
|
147
123
|
if (colIndex === record.formatter.colSpan) {
|
@@ -149,28 +125,23 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
149
125
|
colSpan: record.formatter.colSpan
|
150
126
|
};
|
151
127
|
}
|
152
|
-
|
153
128
|
var length = Object.keys(record).length;
|
154
|
-
|
155
129
|
if (length <= 3) {
|
156
130
|
return {
|
157
131
|
colSpan: record.formatter.colSpan
|
158
132
|
};
|
159
133
|
}
|
160
|
-
|
161
134
|
if (length > 5) {
|
162
135
|
return {
|
163
136
|
colSpan: record.formatter.colSpan
|
164
137
|
};
|
165
138
|
}
|
166
139
|
}
|
167
|
-
|
168
140
|
return {
|
169
141
|
rowSpan: record.formatter.rowSpan
|
170
142
|
};
|
171
143
|
}
|
172
144
|
};
|
173
|
-
|
174
145
|
return /*#__PURE__*/React.createElement(Table.StickyLock, {
|
175
146
|
className: "teamix-pro-info-table",
|
176
147
|
cellProps: setCellProps,
|
@@ -180,5 +151,4 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
180
151
|
dataSource: newDataSource
|
181
152
|
});
|
182
153
|
};
|
183
|
-
|
184
154
|
export default ProTableInfo;
|
package/es/info/index.js
CHANGED
@@ -1,28 +1,16 @@
|
|
1
|
-
var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra", "context"],
|
2
|
-
|
3
|
-
|
1
|
+
var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra", "context", "disabledAutoSize"],
|
2
|
+
_excluded2 = ["context"];
|
4
3
|
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
|
-
|
6
4
|
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
|
-
|
8
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; }
|
9
|
-
|
10
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
11
|
-
|
12
7
|
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."); }
|
13
|
-
|
14
8
|
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); }
|
15
|
-
|
16
9
|
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; }
|
17
|
-
|
18
10
|
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; }
|
19
|
-
|
20
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
21
|
-
|
22
12
|
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; }
|
23
|
-
|
24
13
|
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; }
|
25
|
-
|
26
14
|
import React, { isValidElement, useContext, useEffect, useRef, useState, useMemo } from 'react';
|
27
15
|
import ProTableInfo from './components/tableInfo';
|
28
16
|
import ProHeaderInfo from './components/headerInfo';
|
@@ -34,67 +22,60 @@ import { doCommonRequest, cls, getTestRequestData, getTestRequestParams } from '
|
|
34
22
|
import { useSize } from '@teamix/hooks';
|
35
23
|
import { ProCard } from '..';
|
36
24
|
export * from './typing';
|
37
|
-
|
38
25
|
var ProInfo = function ProInfo(props) {
|
39
26
|
var _ref;
|
40
|
-
|
41
27
|
var _props$type = props.type,
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
28
|
+
type = _props$type === void 0 ? 'base' : _props$type,
|
29
|
+
url = props.url,
|
30
|
+
_props$method = props.method,
|
31
|
+
method = _props$method === void 0 ? 'post' : _props$method,
|
32
|
+
formatResult = props.formatResult,
|
33
|
+
formatParams = props.formatParams,
|
34
|
+
params = props.params,
|
35
|
+
propsActionRef = props.actionRef,
|
36
|
+
_props$header = props.header,
|
37
|
+
header = _props$header === void 0 ? {} : _props$header,
|
38
|
+
onSuccess = props.onSuccess,
|
39
|
+
onError = props.onError,
|
40
|
+
beforeRequest = props.beforeRequest,
|
41
|
+
extendParams = props.extendParams,
|
42
|
+
className = props.className,
|
43
|
+
style = props.style,
|
44
|
+
columns = props.columns,
|
45
|
+
layout = props.layout,
|
46
|
+
dataSource = props.dataSource,
|
47
|
+
userLoading = props.loading,
|
48
|
+
extra = props.extra,
|
49
|
+
infoContext = props.context,
|
50
|
+
disabledAutoSize = props.disabledAutoSize,
|
51
|
+
others = _objectWithoutProperties(props, _excluded);
|
66
52
|
var _useContext = useContext(ProInfoGroupContext),
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
53
|
+
contextUrl = _useContext.url,
|
54
|
+
contextMethod = _useContext.method,
|
55
|
+
contextParams = _useContext.params,
|
56
|
+
contextFormatResult = _useContext.formatResult,
|
57
|
+
contextVisible = _useContext.visible,
|
58
|
+
contextSize = _useContext.size,
|
59
|
+
contextOnSuccess = _useContext.onSuccess,
|
60
|
+
contextOnError = _useContext.onError,
|
61
|
+
contextFormatParams = _useContext.formatParams,
|
62
|
+
contextBeforeRequest = _useContext.beforeRequest,
|
63
|
+
contextExtendParams = _useContext.extendParams,
|
64
|
+
_useContext$context = _useContext.context,
|
65
|
+
contextContext = _useContext$context === void 0 ? {} : _useContext$context;
|
66
|
+
// 获取容器宽度
|
82
67
|
var ref = useRef();
|
83
68
|
var size = contextVisible ? contextSize : useSize(ref);
|
84
|
-
|
85
69
|
var _useState = useState(false),
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
70
|
+
_useState2 = _slicedToArray(_useState, 2),
|
71
|
+
loading = _useState2[0],
|
72
|
+
setLoading = _useState2[1];
|
73
|
+
// 请求数据
|
91
74
|
var _useState3 = useState(),
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
75
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
76
|
+
data = _useState4[0],
|
77
|
+
setData = _useState4[1];
|
96
78
|
var requestDataKey = (contextMethod !== null && contextMethod !== void 0 ? contextMethod : method).toLowerCase() === 'get' ? 'params' : 'data';
|
97
|
-
|
98
79
|
var requestConfig = _defineProperty({
|
99
80
|
url: (_ref = contextUrl !== null && contextUrl !== void 0 ? contextUrl : url) !== null && _ref !== void 0 ? _ref : '',
|
100
81
|
method: contextMethod !== null && contextMethod !== void 0 ? contextMethod : method,
|
@@ -105,7 +86,6 @@ var ProInfo = function ProInfo(props) {
|
|
105
86
|
beforeRequest: contextBeforeRequest !== null && contextBeforeRequest !== void 0 ? contextBeforeRequest : beforeRequest,
|
106
87
|
extendParams: contextExtendParams !== null && contextExtendParams !== void 0 ? contextExtendParams : extendParams
|
107
88
|
}, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
|
108
|
-
|
109
89
|
useEffect(function () {
|
110
90
|
if (url || contextUrl) {
|
111
91
|
setLoading(false);
|
@@ -118,8 +98,8 @@ var ProInfo = function ProInfo(props) {
|
|
118
98
|
return _objectSpread(_objectSpread({}, infoContext), {}, {
|
119
99
|
record: dataSource !== null && dataSource !== void 0 ? dataSource : data
|
120
100
|
}, contextContext);
|
121
|
-
}, [dataSource, data]);
|
122
|
-
|
101
|
+
}, [dataSource, data]);
|
102
|
+
// 获取数据
|
123
103
|
var request = function request() {
|
124
104
|
setLoading(true);
|
125
105
|
doCommonRequest(requestConfig).then(function (resp) {
|
@@ -128,38 +108,31 @@ var ProInfo = function ProInfo(props) {
|
|
128
108
|
setLoading(false);
|
129
109
|
});
|
130
110
|
};
|
131
|
-
|
132
|
-
|
133
|
-
|
111
|
+
var actionRef = useRef();
|
112
|
+
// 将 Actions 绑定到传入的 propsActionRef 中
|
134
113
|
if (propsActionRef) {
|
135
114
|
propsActionRef.current = actionRef.current;
|
136
|
-
}
|
137
|
-
|
138
|
-
|
115
|
+
}
|
116
|
+
// 绑定 Actions
|
139
117
|
useActionType(actionRef, {
|
140
118
|
refresh: function refresh() {
|
141
119
|
request();
|
142
120
|
}
|
143
121
|
});
|
144
|
-
|
145
122
|
var getExtra = function getExtra() {
|
146
123
|
if (!extra) {
|
147
124
|
return undefined;
|
148
125
|
}
|
149
|
-
|
150
126
|
if ( /*#__PURE__*/isValidElement(extra)) {
|
151
127
|
return extra;
|
152
128
|
}
|
153
|
-
|
154
129
|
var _extra$context = extra.context,
|
155
|
-
|
156
|
-
|
157
|
-
|
130
|
+
actionContext = _extra$context === void 0 ? {} : _extra$context,
|
131
|
+
others = _objectWithoutProperties(extra, _excluded2);
|
158
132
|
return _objectSpread(_objectSpread({}, others), {}, {
|
159
133
|
context: _objectSpread(_objectSpread({}, context), actionContext)
|
160
134
|
});
|
161
135
|
};
|
162
|
-
|
163
136
|
return /*#__PURE__*/React.createElement("div", {
|
164
137
|
ref: ref,
|
165
138
|
style: style,
|
@@ -181,7 +154,8 @@ var ProInfo = function ProInfo(props) {
|
|
181
154
|
result: data,
|
182
155
|
actionRef: actionRef,
|
183
156
|
layout: layout,
|
184
|
-
context: context
|
157
|
+
context: context,
|
158
|
+
disabledAutoSize: disabledAutoSize
|
185
159
|
}), type === 'header' && /*#__PURE__*/React.createElement(ProHeaderInfo, {
|
186
160
|
dataSource: dataSource,
|
187
161
|
columns: columns,
|
@@ -191,7 +165,8 @@ var ProInfo = function ProInfo(props) {
|
|
191
165
|
actionRef: actionRef,
|
192
166
|
layout: layout,
|
193
167
|
size: size,
|
194
|
-
context: context
|
168
|
+
context: context,
|
169
|
+
disabledAutoSize: disabledAutoSize
|
195
170
|
}), type === 'base' && /*#__PURE__*/React.createElement(ProBaseInfo, {
|
196
171
|
dataSource: dataSource,
|
197
172
|
columns: columns,
|
@@ -200,10 +175,10 @@ var ProInfo = function ProInfo(props) {
|
|
200
175
|
actionRef: actionRef,
|
201
176
|
layout: layout,
|
202
177
|
size: size,
|
203
|
-
context: context
|
178
|
+
context: context,
|
179
|
+
disabledAutoSize: disabledAutoSize
|
204
180
|
})));
|
205
181
|
};
|
206
|
-
|
207
182
|
ProInfo.Group = ProInfoGroup;
|
208
183
|
ProInfo.ProInfoGroup = ProInfoGroup;
|
209
184
|
export default ProInfo;
|
package/es/info/typing.d.ts
CHANGED
@@ -51,6 +51,8 @@ export declare type ProInfoBaseProps = {
|
|
51
51
|
loading?: boolean;
|
52
52
|
/** 上下文传递 */
|
53
53
|
context?: object;
|
54
|
+
/** 是否在获取宽度之后才渲染Info 是否忽略首次响应式计算 **/
|
55
|
+
disabledAutoSize?: boolean;
|
54
56
|
} & ProInfoHeaderProps & ProInfoRequestProps;
|
55
57
|
/** ProInfoColumnsProps info 单元格 定义 */
|
56
58
|
export declare type ProInfoItemProps = ProInfoColumnsProps;
|
package/es/info/utils/index.js
CHANGED
@@ -1,19 +1,14 @@
|
|
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
|
-
|
3
2
|
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
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; }
|
6
|
-
|
7
4
|
import { getDeepValue, getTargetValue } from '@teamix/utils';
|
8
5
|
import React from 'react';
|
9
6
|
export function useActionType(ref, action) {
|
10
7
|
// 合并自定义事件
|
11
8
|
var userAction = _objectSpread({}, action);
|
12
|
-
|
13
9
|
ref.current = userAction;
|
14
10
|
}
|
15
11
|
/** ProInfoGroupContext */
|
16
|
-
|
17
12
|
export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
|
18
13
|
/**
|
19
14
|
* 获取 dataIndex 值
|
@@ -21,14 +16,12 @@ export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
|
|
21
16
|
* @param dataSource
|
22
17
|
* @returns
|
23
18
|
*/
|
24
|
-
|
25
19
|
export function getDataIndexValue(dataIndex, dataSource) {
|
26
20
|
if (Array.isArray(dataIndex)) {
|
27
21
|
return dataIndex.map(function (item) {
|
28
22
|
return getDeepValue(item !== null && item !== void 0 ? item : '', dataSource);
|
29
23
|
});
|
30
24
|
}
|
31
|
-
|
32
25
|
return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
33
26
|
}
|
34
27
|
/**
|
@@ -38,7 +31,6 @@ export function getDataIndexValue(dataIndex, dataSource) {
|
|
38
31
|
* @param record
|
39
32
|
* @param context
|
40
33
|
*/
|
41
|
-
|
42
34
|
export function isHidden(hidden, value, record, context) {
|
43
35
|
if (typeof hidden === 'string') {
|
44
36
|
return getTargetValue(hidden, _objectSpread(_objectSpread({}, record), {}, {
|
@@ -47,14 +39,11 @@ export function isHidden(hidden, value, record, context) {
|
|
47
39
|
context: context
|
48
40
|
}));
|
49
41
|
}
|
50
|
-
|
51
42
|
if (typeof hidden === 'boolean') {
|
52
43
|
return hidden;
|
53
44
|
}
|
54
|
-
|
55
45
|
if (typeof hidden === 'function') {
|
56
46
|
return hidden === null || hidden === void 0 ? void 0 : hidden(value, record);
|
57
47
|
}
|
58
|
-
|
59
48
|
return false;
|
60
49
|
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
.theme-xconsole {
|
2
|
+
//.next-drawer-header {
|
3
|
+
// color: var(--color-text-1, #1A1A1A)
|
4
|
+
//}
|
5
|
+
//.next-message.next-message-success.next-toast .next-message-title {
|
6
|
+
// color: var(--color-text-1, #1A1A1A)
|
7
|
+
//}
|
8
|
+
|
9
|
+
--message-success-color-border-toast: var(--color-border-4, #E5E5E5);
|
10
|
+
|
11
|
+
/* --card-border-color: var(--color-text1-4, #E3E4E6); */
|
12
|
+
--card-border-color: var(--color-border-4, #E5E5E5);
|
13
|
+
/* --tab-pure-divider-border-color: var(--color-text1-4, #e5e5e5); */
|
14
|
+
--tab-pure-divider-border-color: var(--color-border-4, #E5E5E5);
|
15
|
+
--drawer-title-border-color: var(--color-border-4, #E5E5E5);
|
16
|
+
|
17
|
+
--popup-local-border-color: var(--color-border-4, #E5E5E5);
|
18
|
+
|
19
|
+
--btn-pure-normal-bg-disabled: var(--color-fill-2, #F7F7F7);
|
20
|
+
--checkbox-disabled-bg-color: var(--color-border-1, #D9D9D9);
|
21
|
+
|
22
|
+
--btn-pure-normal-border-color-disabled: var(--color-border-1, #D9D9D9);
|
23
|
+
--btn-pure-primary-border-color-disabled: var(--color-border-1, #D9D9D9);
|
24
|
+
|
25
|
+
--tab-item-margin-lr-size-m: 16px;
|
26
|
+
--tab-pure-hover-bg: transparent;
|
27
|
+
|
28
|
+
--progress-line-underlay-color: var(--color-border-4, #E5E5E5);
|
29
|
+
--range-normal-unselected-color: var(--color-border-4, #E5E5E5);
|
30
|
+
|
31
|
+
.next-formily-item-inset {
|
32
|
+
border: 1px solid var(--color-border-1, #D9D9D9);
|
33
|
+
}
|
34
|
+
}
|
@@ -1,27 +1,6 @@
|
|
1
1
|
import { array, actions, actionGroup, filter } from './common';
|
2
2
|
var initialValues = {
|
3
|
-
columns: [
|
4
|
-
dataIndex: 'instanceName',
|
5
|
-
title: '实例ID/实例名称'
|
6
|
-
}, {
|
7
|
-
dataIndex: 'organizationName',
|
8
|
-
title: '组织',
|
9
|
-
tooltip: '我这一列是可以被复制的~',
|
10
|
-
render: {
|
11
|
-
copy: true
|
12
|
-
}
|
13
|
-
}],
|
14
|
-
url: 'https://oneapi.alibaba-inc.com/mock/teamix-pro/api/getTableResource',
|
15
|
-
formatResult: {
|
16
|
-
data: 'data',
|
17
|
-
total: 'pageInfo.total'
|
18
|
-
},
|
19
|
-
mainAction: {
|
20
|
-
actions: [{
|
21
|
-
key: 'action',
|
22
|
-
children: '操作按钮'
|
23
|
-
}]
|
24
|
-
}
|
3
|
+
columns: []
|
25
4
|
};
|
26
5
|
var defaultValues = {
|
27
6
|
showSkeleton: true,
|
@@ -55,12 +55,11 @@ export function array(title, name, fields, main, arrayTitle) {
|
|
55
55
|
}
|
56
56
|
export function actions(props) {
|
57
57
|
var _ref = props || {},
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
_ref$title = _ref.title,
|
59
|
+
title = _ref$title === void 0 ? '操作项' : _ref$title,
|
60
|
+
_ref$name = _ref.name,
|
61
|
+
name = _ref$name === void 0 ? 'actions' : _ref$name,
|
62
|
+
arrayTitle = _ref.arrayTitle;
|
64
63
|
return array(title, name, [{
|
65
64
|
name: 'children',
|
66
65
|
title: '文字',
|
@@ -1,19 +1,18 @@
|
|
1
1
|
import React, { useMemo } from 'react';
|
2
2
|
import ProForm, { createForm } from '../../form';
|
3
|
+
// @ts-ignore
|
3
4
|
export var initConfigurator = function initConfigurator(schema, defaultInitialValues, defaultValues) {
|
4
5
|
return function (props) {
|
5
6
|
var initialValues = props.initialValues,
|
6
|
-
|
7
|
+
onValuesChange = props.onValuesChange;
|
7
8
|
var form = useMemo(function () {
|
8
9
|
return createForm({
|
9
10
|
initialValues: Object.assign({}, defaultValues, initialValues || defaultInitialValues)
|
10
11
|
});
|
11
12
|
}, []);
|
12
|
-
|
13
13
|
var onChange = function onChange(values) {
|
14
14
|
onValuesChange && onValuesChange(values);
|
15
15
|
};
|
16
|
-
|
17
16
|
return /*#__PURE__*/React.createElement(ProForm, {
|
18
17
|
labelCol: 6,
|
19
18
|
wrapperCol: 18,
|
package/es/nocode/index.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import './index.scss';
|
2
2
|
import PageContainer from '../page-container';
|
3
|
-
export { PageContainer };
|
4
|
-
|
3
|
+
export { PageContainer };
|
4
|
+
// 配置器,每个 pro 组件对应一个配置器
|
5
5
|
export * from './configurators';
|
6
|
-
export * from './configurators/map';
|
6
|
+
export * from './configurators/map';
|
7
|
+
// 页面编辑器
|
7
8
|
// 页面渲染器
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
export * from './pages';
|
10
|
+
// 提供组件和页面编辑的页面布局
|
11
11
|
export * from './playground';
|
@@ -6,22 +6,19 @@ import { PageMap, PageDefaultInitialValues } from '.';
|
|
6
6
|
var cls = usePrefixCls('teamix-pro-pager');
|
7
7
|
export var PageEditor = function PageEditor(props) {
|
8
8
|
var type = props.type,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
initialValues = props.initialValues,
|
10
|
+
field = props.field,
|
11
|
+
configuratorMap = props.configuratorMap,
|
12
|
+
pageMap = props.pageMap,
|
13
|
+
pageDefaultInitialValues = props.pageDefaultInitialValues;
|
14
14
|
var values = initialValues || PageDefaultInitialValues[type] || (pageDefaultInitialValues === null || pageDefaultInitialValues === void 0 ? void 0 : pageDefaultInitialValues[type]);
|
15
15
|
React.useEffect(function () {
|
16
16
|
field && field.setValues(values);
|
17
17
|
}, []);
|
18
|
-
|
19
18
|
var onValuesChange = function onValuesChange(values) {
|
20
19
|
field && field.setValues(values);
|
21
20
|
};
|
22
|
-
|
23
21
|
var Page = PageMap[type] || (pageMap === null || pageMap === void 0 ? void 0 : pageMap[type]);
|
24
|
-
|
25
22
|
if (!Page) {
|
26
23
|
return /*#__PURE__*/React.createElement("div", {
|
27
24
|
className: cls('empty')
|
@@ -30,7 +27,6 @@ export var PageEditor = function PageEditor(props) {
|
|
30
27
|
height: 160
|
31
28
|
}), /*#__PURE__*/React.createElement("p", null, "\u9519\u8BEF\u7684\u9875\u9762\u7C7B\u578B"));
|
32
29
|
}
|
33
|
-
|
34
30
|
return /*#__PURE__*/React.createElement(PagePlayground, {
|
35
31
|
page: Page,
|
36
32
|
initialValues: values,
|