@teamix/pro 1.5.2 → 1.5.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro.css +1 -1
- package/dist/pro.js +20285 -19928
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +2 -6
- 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 +3 -0
- package/es/actions/index.js +71 -156
- 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 +56 -95
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- 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 +106 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.js +10 -32
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +23 -34
- 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 +6 -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/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +7 -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 +14 -26
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +53 -82
- package/es/info/utils/index.js +0 -11
- 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 +4 -4
- 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 +39 -75
- package/es/sidebar/components/sidebar-container/index.js +41 -72
- package/es/sidebar/components/tree/index.js +88 -144
- 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.js +12 -25
- package/es/sidebar/components/tree-node/index.js +41 -83
- package/es/sidebar/index.js +69 -94
- 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.js +62 -149
- package/es/table/components/Filter/index.js +42 -83
- package/es/table/components/Layout/index.js +25 -45
- package/es/table/components/LoadMore/index.js +15 -34
- package/es/table/components/Pagination/index.js +25 -58
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.js +6 -17
- package/es/table/components/ToolBar/DensityIcon.js +18 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +50 -106
- package/es/table/components/ToolBar/FullScreenIcon.js +2 -6
- package/es/table/components/ToolBar/Fullscreen.js +19 -35
- package/es/table/components/ToolBar/RefreshIcon.js +2 -5
- package/es/table/components/ToolBar/index.js +23 -45
- package/es/table/index.js +227 -401
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/table/utils/columnRender.js +32 -76
- package/es/table/utils/genProColumnToColumn.js +5 -14
- 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/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +24 -64
- 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/utils/useRealHistory.d.ts +8 -0
- package/es/utils/useRealHistory.js +23 -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 -88
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- 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 +3 -0
- package/lib/actions/index.js +93 -186
- package/lib/actions/link.js +3 -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 +10 -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 +56 -122
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- 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 +105 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.js +10 -35
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +23 -57
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +3 -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 +6 -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/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -39
- 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 +14 -38
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +53 -97
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +0 -2
- 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 +2 -9
- 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 +38 -88
- package/lib/sidebar/components/sidebar-container/index.js +41 -84
- package/lib/sidebar/components/tree/index.js +88 -158
- 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.js +12 -35
- package/lib/sidebar/components/tree-node/index.js +41 -99
- package/lib/sidebar/index.js +69 -112
- 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.js +62 -161
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.js +42 -93
- package/lib/table/components/Layout/index.js +25 -58
- package/lib/table/components/LoadMore/index.js +15 -44
- package/lib/table/components/Pagination/index.js +25 -68
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.js +6 -28
- package/lib/table/components/ToolBar/DensityIcon.js +18 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +50 -118
- package/lib/table/components/ToolBar/FullScreenIcon.js +3 -13
- package/lib/table/components/ToolBar/Fullscreen.js +19 -42
- package/lib/table/components/ToolBar/RefreshIcon.js +3 -12
- package/lib/table/components/ToolBar/index.js +23 -63
- package/lib/table/index.js +227 -426
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/table/utils/columnRender.js +32 -89
- package/lib/table/utils/genProColumnToColumn.js +5 -19
- 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/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 +24 -75
- 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/utils/useRealHistory.d.ts +8 -0
- package/lib/utils/useRealHistory.js +32 -0
- package/package.json +1 -1
package/lib/skeleton/index.js
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
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); }
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
var _exportNames = {};
|
9
8
|
exports.default = void 0;
|
10
|
-
|
11
9
|
var _proSkeleton = _interopRequireWildcard(require("@teamix/pro-skeleton"));
|
12
|
-
|
13
10
|
Object.keys(_proSkeleton).forEach(function (key) {
|
14
11
|
if (key === "default" || key === "__esModule") return;
|
15
12
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -21,10 +18,7 @@ Object.keys(_proSkeleton).forEach(function (key) {
|
|
21
18
|
}
|
22
19
|
});
|
23
20
|
});
|
24
|
-
|
25
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
26
|
-
|
27
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
28
|
-
|
29
23
|
var _default = _proSkeleton.default;
|
30
24
|
exports.default = _default;
|
@@ -4,135 +4,98 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
8
|
var _components = require("@alicloudfe/components");
|
11
|
-
|
12
9
|
var _ = require("../../../");
|
13
|
-
|
14
10
|
var _skeleton = require("../../../skeleton");
|
15
|
-
|
16
11
|
var _utils = require("@teamix/utils");
|
17
|
-
|
18
12
|
require("./index.scss");
|
19
|
-
|
20
13
|
var _columnRender = require("../../utils/columnRender");
|
21
|
-
|
22
14
|
var _LoadMore = _interopRequireDefault(require("../LoadMore"));
|
23
|
-
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
|
-
|
26
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
27
|
-
|
28
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
29
|
-
|
30
18
|
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); }
|
31
|
-
|
32
19
|
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; }
|
33
|
-
|
34
20
|
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; }
|
35
|
-
|
36
21
|
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; }
|
37
|
-
|
38
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
39
|
-
|
40
23
|
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."); }
|
41
|
-
|
42
24
|
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); }
|
43
|
-
|
44
25
|
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; }
|
45
|
-
|
46
26
|
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; }
|
47
|
-
|
48
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
49
|
-
|
50
28
|
var Row = _components.Grid.Row,
|
51
|
-
|
29
|
+
Col = _components.Grid.Col;
|
52
30
|
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-card-view');
|
53
|
-
|
54
31
|
var CardView = function CardView(props) {
|
55
32
|
var _cardViewProps$scroll;
|
56
|
-
|
57
33
|
var dataSource = props.dataSource,
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
34
|
+
_props$columns = props.columns,
|
35
|
+
columns = _props$columns === void 0 ? [] : _props$columns,
|
36
|
+
_props$loading = props.loading,
|
37
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
38
|
+
originColumns = props.originColumns,
|
39
|
+
_props$cardViewProps = props.cardViewProps,
|
40
|
+
cardViewProps = _props$cardViewProps === void 0 ? {} : _props$cardViewProps,
|
41
|
+
actionRef = props.actionRef,
|
42
|
+
context = props.context,
|
43
|
+
scrollHeight = props.scrollHeight,
|
44
|
+
_props$showSkeleton = props.showSkeleton,
|
45
|
+
showSkeleton = _props$showSkeleton === void 0 ? false : _props$showSkeleton;
|
46
|
+
// 加载状态
|
71
47
|
var _useState = (0, _react.useState)('none'),
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
49
|
+
loadState = _useState2[0],
|
50
|
+
setLoadState = _useState2[1];
|
51
|
+
// 骨架屏状态
|
77
52
|
var _useState3 = (0, _react.useState)(true),
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
54
|
+
skeletonVisible = _useState4[0],
|
55
|
+
setSkeletonVisible = _useState4[1];
|
56
|
+
// 加载状态变化回调
|
83
57
|
(0, _react.useEffect)(function () {
|
84
58
|
setLoadState(loading ? 'loading' : 'loadMore');
|
85
59
|
setSkeletonVisible(showSkeleton);
|
86
|
-
|
87
60
|
if (showSkeleton) {
|
88
61
|
setLoadState('none');
|
89
62
|
}
|
90
63
|
}, [loading, skeletonVisible, showSkeleton]);
|
91
|
-
|
92
64
|
var getDataIndexValue = function getDataIndexValue(dataIndex, dataSource) {
|
93
65
|
if (Array.isArray(dataIndex)) {
|
94
66
|
return dataIndex.map(function (item) {
|
95
67
|
return (0, _.getDeepValue)(item !== null && item !== void 0 ? item : '', dataSource);
|
96
68
|
});
|
97
69
|
}
|
98
|
-
|
99
70
|
return (0, _.getDeepValue)(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
100
|
-
};
|
101
|
-
|
102
|
-
|
71
|
+
};
|
72
|
+
// 获取卡片 columns
|
103
73
|
var cardColumns = (0, _react.useMemo)(function () {
|
104
74
|
return columns.map(function (column) {
|
105
75
|
var _originColumn$title;
|
106
|
-
|
107
76
|
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns.find(function (item) {
|
108
77
|
return item.dataIndex === column.dataIndex;
|
109
78
|
});
|
110
79
|
var render = column === null || column === void 0 ? void 0 : column.render;
|
111
|
-
|
112
80
|
if (typeof (column === null || column === void 0 ? void 0 : column.render) === 'function') {
|
113
81
|
render = function render(value, record) {
|
114
82
|
var _column$render;
|
115
|
-
|
116
83
|
return column === null || column === void 0 ? void 0 : (_column$render = column.render) === null || _column$render === void 0 ? void 0 : _column$render.call(column, value, undefined, record);
|
117
84
|
};
|
118
85
|
} else {
|
119
86
|
var _Object$entries$map, _Object$entries, _Object$entries$map2, _column$render2;
|
120
|
-
|
121
87
|
render = Object.fromEntries((_Object$entries$map = (_Object$entries = Object.entries((_column$render2 = column === null || column === void 0 ? void 0 : column.render) !== null && _column$render2 !== void 0 ? _column$render2 : {})) === null || _Object$entries === void 0 ? void 0 : (_Object$entries$map2 = _Object$entries.map) === null || _Object$entries$map2 === void 0 ? void 0 : _Object$entries$map2.call(_Object$entries, function (_ref) {
|
122
88
|
var _ref2 = _slicedToArray(_ref, 2),
|
123
|
-
|
124
|
-
|
125
|
-
|
89
|
+
k = _ref2[0],
|
90
|
+
v = _ref2[1];
|
126
91
|
if (typeof v === 'function') {
|
127
92
|
return [k, function (value, record) {
|
128
93
|
return v === null || v === void 0 ? void 0 : v(value, undefined, record);
|
129
94
|
}];
|
130
95
|
}
|
131
|
-
|
132
96
|
return [k, v];
|
133
97
|
})) !== null && _Object$entries$map !== void 0 ? _Object$entries$map : []);
|
134
98
|
}
|
135
|
-
|
136
99
|
return _objectSpread(_objectSpread({}, column), {}, {
|
137
100
|
title: (_originColumn$title = originColumn === null || originColumn === void 0 ? void 0 : originColumn.title) !== null && _originColumn$title !== void 0 ? _originColumn$title : column.title,
|
138
101
|
render: render
|
@@ -140,45 +103,37 @@ var CardView = function CardView(props) {
|
|
140
103
|
}).filter(function (item) {
|
141
104
|
return !(item === null || item === void 0 ? void 0 : item.actionSchema);
|
142
105
|
});
|
143
|
-
}, [columns, originColumns]);
|
144
|
-
|
106
|
+
}, [columns, originColumns]);
|
107
|
+
// 获取单个渲染数据
|
145
108
|
var renderCardInfoItem = function renderCardInfoItem(itemProps, record, index) {
|
146
109
|
if (itemProps) {
|
147
110
|
if (typeof itemProps === 'string' || Array.isArray(itemProps)) {
|
148
111
|
var _titleColumn$cell, _titleColumn$cell2;
|
149
|
-
|
150
112
|
var titleColumn = cardColumns.find(function (item) {
|
151
113
|
return item.dataIndex === itemProps;
|
152
114
|
});
|
153
115
|
return (_titleColumn$cell = titleColumn === null || titleColumn === void 0 ? void 0 : (_titleColumn$cell2 = titleColumn.cell) === null || _titleColumn$cell2 === void 0 ? void 0 : _titleColumn$cell2.call(titleColumn, getDataIndexValue(itemProps, record), index, record)) !== null && _titleColumn$cell !== void 0 ? _titleColumn$cell : '';
|
154
116
|
}
|
155
|
-
|
156
117
|
return (0, _columnRender.renderCell)(getDataIndexValue(itemProps.dataIndex, record), itemProps, index, record, actionRef, context);
|
157
118
|
}
|
158
|
-
};
|
159
|
-
|
160
|
-
|
119
|
+
};
|
120
|
+
// 渲染卡片title
|
161
121
|
var renderCardTitle = function renderCardTitle(record, index) {
|
162
122
|
var _cardColumns$, _cardColumns$$render, _cardColumns$2, _cardColumns$2$cell, _cardColumns$3;
|
163
|
-
|
164
123
|
var titleProp = cardViewProps.title;
|
165
124
|
var title = titleProp;
|
166
|
-
|
167
125
|
if (typeof titleProp === 'function') {
|
168
126
|
title = titleProp === null || titleProp === void 0 ? void 0 : titleProp(index, record);
|
169
127
|
}
|
170
|
-
|
171
128
|
if (titleProp) {
|
172
129
|
return renderCardInfoItem(title, record, index);
|
173
|
-
}
|
174
|
-
|
175
|
-
|
130
|
+
}
|
131
|
+
// 【默认情况】看看第一列有没有 description,有的话,只取 title
|
176
132
|
if (cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$ = cardColumns[0]) === null || _cardColumns$ === void 0 ? void 0 : (_cardColumns$$render = _cardColumns$.render) === null || _cardColumns$$render === void 0 ? void 0 : _cardColumns$$render.description) {
|
177
133
|
var _originColumn$render;
|
178
|
-
|
179
134
|
var column = cardColumns === null || cardColumns === void 0 ? void 0 : cardColumns[0];
|
180
|
-
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0];
|
181
|
-
|
135
|
+
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0];
|
136
|
+
// 转化为新的 table columns
|
182
137
|
var _columns = _objectSpread(_objectSpread({}, originColumn), {}, {
|
183
138
|
render: _objectSpread(_objectSpread({}, originColumn === null || originColumn === void 0 ? void 0 : originColumn.render), {}, {
|
184
139
|
value: originColumn === null || originColumn === void 0 ? void 0 : (_originColumn$render = originColumn.render) === null || _originColumn$render === void 0 ? void 0 : _originColumn$render.value,
|
@@ -186,36 +141,28 @@ var CardView = function CardView(props) {
|
|
186
141
|
descriptionCopy: undefined
|
187
142
|
})
|
188
143
|
});
|
189
|
-
|
190
144
|
return (0, _columnRender.renderCell)(getDataIndexValue(column === null || column === void 0 ? void 0 : column.dataIndex, record), _columns, index, record, actionRef, context);
|
191
|
-
}
|
192
|
-
|
193
|
-
|
145
|
+
}
|
146
|
+
// 【默认情况】直接拿第一列的 cell
|
194
147
|
return cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$2 = cardColumns[0]) === null || _cardColumns$2 === void 0 ? void 0 : (_cardColumns$2$cell = _cardColumns$2.cell) === null || _cardColumns$2$cell === void 0 ? void 0 : _cardColumns$2$cell.call(_cardColumns$2, getDataIndexValue(cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$3 = cardColumns[0]) === null || _cardColumns$3 === void 0 ? void 0 : _cardColumns$3.dataIndex, record), index, record);
|
195
|
-
};
|
196
|
-
|
197
|
-
|
148
|
+
};
|
149
|
+
// 渲染卡片subTitle
|
198
150
|
var renderCardSubTitle = function renderCardSubTitle(record, index) {
|
199
151
|
var _cardColumns$4, _cardColumns$4$render;
|
200
|
-
|
201
152
|
var subTitleProp = cardViewProps.subTitle;
|
202
153
|
var subTitle = subTitleProp;
|
203
|
-
|
204
154
|
if (typeof subTitleProp === 'function') {
|
205
155
|
subTitle = subTitleProp === null || subTitleProp === void 0 ? void 0 : subTitleProp(index, record);
|
206
156
|
}
|
207
|
-
|
208
157
|
if (subTitle) {
|
209
158
|
return renderCardInfoItem(subTitle, record, index);
|
210
|
-
}
|
211
|
-
|
212
|
-
|
159
|
+
}
|
160
|
+
// 【默认情况】看看第一列有没有 description,有的话,只取 title
|
213
161
|
if (cardColumns === null || cardColumns === void 0 ? void 0 : (_cardColumns$4 = cardColumns[0]) === null || _cardColumns$4 === void 0 ? void 0 : (_cardColumns$4$render = _cardColumns$4.render) === null || _cardColumns$4$render === void 0 ? void 0 : _cardColumns$4$render.description) {
|
214
162
|
var _originColumn$render2, _column$render3;
|
215
|
-
|
216
163
|
var column = cardColumns === null || cardColumns === void 0 ? void 0 : cardColumns[0];
|
217
|
-
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0];
|
218
|
-
|
164
|
+
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0];
|
165
|
+
// 转化为新的 table columns
|
219
166
|
var _columns2 = _objectSpread(_objectSpread({}, originColumn), {}, {
|
220
167
|
render: {
|
221
168
|
value: originColumn === null || originColumn === void 0 ? void 0 : (_originColumn$render2 = originColumn.render) === null || _originColumn$render2 === void 0 ? void 0 : _originColumn$render2.description,
|
@@ -223,20 +170,16 @@ var CardView = function CardView(props) {
|
|
223
170
|
descriptionCopy: undefined
|
224
171
|
}
|
225
172
|
});
|
226
|
-
|
227
173
|
return (0, _columnRender.renderCell)(getDataIndexValue(column === null || column === void 0 ? void 0 : (_column$render3 = column.render) === null || _column$render3 === void 0 ? void 0 : _column$render3.value, record), _columns2, index, record, actionRef, context);
|
228
174
|
}
|
229
|
-
};
|
230
|
-
|
231
|
-
|
175
|
+
};
|
176
|
+
// 获取ProInfoColumns
|
232
177
|
var getPropInfoColumns = function getPropInfoColumns(record, index) {
|
233
178
|
var contentProp = cardViewProps.content;
|
234
179
|
var content = contentProp;
|
235
|
-
|
236
180
|
if (typeof contentProp === 'function') {
|
237
181
|
content = contentProp === null || contentProp === void 0 ? void 0 : contentProp(index, record);
|
238
182
|
}
|
239
|
-
|
240
183
|
if (content) {
|
241
184
|
return content.map(function (item) {
|
242
185
|
if (typeof item === 'string') {
|
@@ -244,21 +187,17 @@ var CardView = function CardView(props) {
|
|
244
187
|
return column.dataIndex === item;
|
245
188
|
});
|
246
189
|
}
|
247
|
-
|
248
190
|
return content;
|
249
191
|
});
|
250
|
-
}
|
251
|
-
|
252
|
-
|
192
|
+
}
|
193
|
+
// 默认取4条数据
|
253
194
|
return cardColumns.filter(function (item, index) {
|
254
195
|
return index > 0 && index < 5;
|
255
196
|
});
|
256
|
-
};
|
257
|
-
|
258
|
-
|
197
|
+
};
|
198
|
+
// 从表格columns获取Action配置
|
259
199
|
var getActionGroupFromColumn = function getActionGroupFromColumn(dataIndex, record, index) {
|
260
200
|
var actionColumn;
|
261
|
-
|
262
201
|
if (dataIndex) {
|
263
202
|
actionColumn = columns === null || columns === void 0 ? void 0 : columns.find(function (item) {
|
264
203
|
return item.dataIndex.toString() === dataIndex.toString();
|
@@ -268,32 +207,25 @@ var CardView = function CardView(props) {
|
|
268
207
|
// 获取操作列,只能获取最后一列
|
269
208
|
actionColumn = columns === null || columns === void 0 ? void 0 : columns[(columns === null || columns === void 0 ? void 0 : columns.length) - 1];
|
270
209
|
}
|
271
|
-
|
272
210
|
if (actionColumn.actionSchema) {
|
273
211
|
var _actionColumn, _actionColumn$actionS;
|
274
|
-
|
275
212
|
var newActionColumn = _objectSpread(_objectSpread({}, actionColumn), {}, {
|
276
213
|
actionSchema: {
|
277
214
|
actions: (_actionColumn = actionColumn) === null || _actionColumn === void 0 ? void 0 : (_actionColumn$actionS = _actionColumn.actionSchema) === null || _actionColumn$actionS === void 0 ? void 0 : _actionColumn$actionS.actions,
|
278
215
|
max: 1
|
279
216
|
}
|
280
217
|
});
|
281
|
-
|
282
218
|
return (0, _columnRender.renderCell)(null, newActionColumn, index, record, actionRef, context);
|
283
219
|
}
|
284
|
-
|
285
220
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
286
|
-
};
|
287
|
-
|
288
|
-
|
221
|
+
};
|
222
|
+
// 获取Card操作列配置
|
289
223
|
var getProCardExtra = function getProCardExtra(record, index) {
|
290
224
|
var extraProp = cardViewProps.extra;
|
291
225
|
var extra = extraProp;
|
292
|
-
|
293
226
|
if (typeof extraProp === 'function') {
|
294
227
|
extra = extraProp === null || extraProp === void 0 ? void 0 : extraProp(index, record);
|
295
228
|
}
|
296
|
-
|
297
229
|
if (Array.isArray(extra)) {
|
298
230
|
return /*#__PURE__*/_react.default.createElement("div", {
|
299
231
|
className: cls('extra')
|
@@ -303,64 +235,47 @@ var CardView = function CardView(props) {
|
|
303
235
|
className: cls('extra-item')
|
304
236
|
}, getActionGroupFromColumn(item, record, index));
|
305
237
|
}
|
306
|
-
|
307
238
|
if ( /*#__PURE__*/(0, _react.isValidElement)(item)) {
|
308
239
|
return /*#__PURE__*/_react.default.createElement("div", {
|
309
240
|
className: cls('extra-item')
|
310
241
|
}, item);
|
311
242
|
}
|
312
|
-
|
313
243
|
return /*#__PURE__*/_react.default.createElement("div", {
|
314
244
|
className: cls('extra-item')
|
315
245
|
}, (0, _columnRender.renderCell)(null, item, index, record, actionRef, context));
|
316
246
|
}));
|
317
247
|
}
|
318
|
-
|
319
248
|
return getActionGroupFromColumn(undefined, record, index);
|
320
|
-
};
|
321
|
-
|
322
|
-
|
249
|
+
};
|
250
|
+
// 渲染Tag
|
323
251
|
var getTags = function getTags(record, index) {
|
324
252
|
var tagProp = cardViewProps.tags;
|
325
253
|
var tags = tagProp !== null && tagProp !== void 0 ? tagProp : [];
|
326
|
-
|
327
254
|
if (typeof tagProp === 'function') {
|
328
255
|
var _tagProp;
|
329
|
-
|
330
256
|
tags = (_tagProp = tagProp === null || tagProp === void 0 ? void 0 : tagProp(index, record)) !== null && _tagProp !== void 0 ? _tagProp : [];
|
331
257
|
}
|
332
|
-
|
333
258
|
var getTagFromColumns = function getTagFromColumns(columns, dataIndex) {
|
334
259
|
var _columns$render, _columns$render2, _columns$render4, _columns$render5, _columns$render7, _columns$render8;
|
335
|
-
|
336
260
|
var text = getDataIndexValue(dataIndex, record);
|
337
|
-
|
338
261
|
if ((columns === null || columns === void 0 ? void 0 : (_columns$render = columns.render) === null || _columns$render === void 0 ? void 0 : _columns$render.value) && typeof (columns === null || columns === void 0 ? void 0 : (_columns$render2 = columns.render) === null || _columns$render2 === void 0 ? void 0 : _columns$render2.value) === 'string') {
|
339
262
|
var _columns$render3;
|
340
|
-
|
341
263
|
text = columns === null || columns === void 0 ? void 0 : (_columns$render3 = columns.render) === null || _columns$render3 === void 0 ? void 0 : _columns$render3.value;
|
342
264
|
}
|
343
|
-
|
344
265
|
if ((columns === null || columns === void 0 ? void 0 : (_columns$render4 = columns.render) === null || _columns$render4 === void 0 ? void 0 : _columns$render4.value) && typeof (columns === null || columns === void 0 ? void 0 : (_columns$render5 = columns.render) === null || _columns$render5 === void 0 ? void 0 : _columns$render5.value) === 'function') {
|
345
266
|
var _columns$render6;
|
346
|
-
|
347
267
|
text = columns === null || columns === void 0 ? void 0 : (_columns$render6 = columns.render) === null || _columns$render6 === void 0 ? void 0 : _columns$render6.value(getDataIndexValue(dataIndex, record), index, record);
|
348
268
|
}
|
349
|
-
|
350
269
|
var color = columns === null || columns === void 0 ? void 0 : (_columns$render7 = columns.render) === null || _columns$render7 === void 0 ? void 0 : _columns$render7.color;
|
351
|
-
|
352
270
|
if (typeof (columns === null || columns === void 0 ? void 0 : (_columns$render8 = columns.render) === null || _columns$render8 === void 0 ? void 0 : _columns$render8.color) === 'function') {
|
353
271
|
var _columns$render9;
|
354
|
-
|
355
272
|
color = columns === null || columns === void 0 ? void 0 : (_columns$render9 = columns.render) === null || _columns$render9 === void 0 ? void 0 : _columns$render9.color(getDataIndexValue(dataIndex, record), index, record);
|
356
273
|
}
|
357
|
-
|
358
274
|
return {
|
359
275
|
children: text,
|
360
276
|
color: color
|
361
277
|
};
|
362
278
|
};
|
363
|
-
|
364
279
|
return tags.map(function (tagItem) {
|
365
280
|
if (typeof tagItem === 'string') {
|
366
281
|
var tagColumns = columns.find(function (item) {
|
@@ -368,59 +283,47 @@ var CardView = function CardView(props) {
|
|
368
283
|
});
|
369
284
|
return getTagFromColumns(tagColumns, tagItem);
|
370
285
|
}
|
371
|
-
|
372
286
|
if (_typeof(tagItem) === 'object') {
|
373
287
|
return getTagFromColumns(tagItem, tagItem === null || tagItem === void 0 ? void 0 : tagItem.dataIndex);
|
374
288
|
}
|
375
289
|
});
|
376
|
-
};
|
377
|
-
|
378
|
-
|
290
|
+
};
|
291
|
+
// 加载下一页回调
|
379
292
|
var onLoadMore = function onLoadMore() {
|
380
293
|
var _actionRef$current, _actionRef$current$ne;
|
381
|
-
|
382
294
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ne = _actionRef$current.nextPage) === null || _actionRef$current$ne === void 0 ? void 0 : _actionRef$current$ne.call(_actionRef$current);
|
383
|
-
};
|
384
|
-
|
385
|
-
|
295
|
+
};
|
296
|
+
// 触底回调
|
386
297
|
var onScrollBottom = function onScrollBottom() {
|
387
298
|
if (cardViewProps.autoLoadNextPage !== false) {
|
388
299
|
var _cardViewProps$onScro;
|
389
|
-
|
390
300
|
onLoadMore();
|
391
301
|
cardViewProps === null || cardViewProps === void 0 ? void 0 : (_cardViewProps$onScro = cardViewProps.onScrollBottom) === null || _cardViewProps$onScro === void 0 ? void 0 : _cardViewProps$onScro.call(cardViewProps);
|
392
302
|
}
|
393
|
-
};
|
394
|
-
|
395
|
-
|
303
|
+
};
|
304
|
+
// 获取ProCard配置
|
396
305
|
var getProCardProps = function getProCardProps(record, index) {
|
397
306
|
var _cardViewProps$cardPr;
|
398
|
-
|
399
307
|
var external = ['onCollapse', 'onSelect', 'onClick'];
|
400
308
|
return Object.fromEntries(Object.entries((_cardViewProps$cardPr = cardViewProps.cardProps) !== null && _cardViewProps$cardPr !== void 0 ? _cardViewProps$cardPr : {}).map(function (_ref3) {
|
401
309
|
var _ref4 = _slicedToArray(_ref3, 2),
|
402
|
-
|
403
|
-
|
404
|
-
|
310
|
+
key = _ref4[0],
|
311
|
+
value = _ref4[1];
|
405
312
|
if (typeof value === 'function' && !external.includes(key)) {
|
406
313
|
return [key, value === null || value === void 0 ? void 0 : value(index, record)];
|
407
314
|
}
|
408
|
-
|
409
315
|
if (typeof value === 'function' && external.includes(key)) {
|
410
316
|
return [key, function () {
|
411
317
|
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
412
318
|
others[_key] = arguments[_key];
|
413
319
|
}
|
414
|
-
|
415
320
|
return value === null || value === void 0 ? void 0 : value.apply(void 0, [index, record].concat(others));
|
416
321
|
}];
|
417
322
|
}
|
418
|
-
|
419
323
|
return [key, value];
|
420
324
|
}));
|
421
|
-
};
|
422
|
-
|
423
|
-
|
325
|
+
};
|
326
|
+
// 渲染单个卡片
|
424
327
|
var renderCard = function renderCard(record, index) {
|
425
328
|
return /*#__PURE__*/_react.default.createElement(Col, {
|
426
329
|
xxs: 24,
|
@@ -445,7 +348,6 @@ var CardView = function CardView(props) {
|
|
445
348
|
}
|
446
349
|
})));
|
447
350
|
};
|
448
|
-
|
449
351
|
return /*#__PURE__*/_react.default.createElement("div", {
|
450
352
|
className: cls()
|
451
353
|
}, /*#__PURE__*/_react.default.createElement(_LoadMore.default, {
|
@@ -463,6 +365,5 @@ var CardView = function CardView(props) {
|
|
463
365
|
return renderCard(item, index);
|
464
366
|
}))));
|
465
367
|
};
|
466
|
-
|
467
368
|
var _default = CardView;
|
468
369
|
exports.default = _default;
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
8
|
var _result = _interopRequireDefault(require("@teamix/result"));
|
11
|
-
|
12
9
|
var _utils = require("@teamix/utils");
|
13
|
-
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
11
|
/** ProTable 空状态 */
|
17
12
|
var _default = function _default() {
|
18
13
|
return /*#__PURE__*/_react.default.createElement(_result.default, {
|
@@ -21,5 +16,4 @@ var _default = function _default() {
|
|
21
16
|
title: (0, _utils.getMessage)('noData')
|
22
17
|
});
|
23
18
|
};
|
24
|
-
|
25
19
|
exports.default = _default;
|