@teamix/pro 1.4.25-bugfix.2 → 1.4.25-bugfix.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro.css +1 -1
- package/dist/pro.js +64943 -84006
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +6 -13
- package/es/actions/base.js +21 -8
- package/es/actions/dialog-component.js +9 -2
- package/es/actions/dialog-form.js +75 -37
- package/es/actions/dialog-info.js +5 -1
- package/es/actions/dialog.js +95 -57
- package/es/actions/index.d.ts +0 -7
- package/es/actions/index.js +153 -93
- package/es/actions/index.scss +1 -6
- package/es/actions/link.js +5 -3
- package/es/actions/request.js +27 -12
- package/es/actions/utils.js +9 -1
- package/es/card/card-container.js +5 -0
- package/es/card/divider.js +5 -0
- package/es/card/index.js +100 -61
- package/es/card/index.scss +0 -15
- package/es/card/selectable.js +13 -4
- package/es/card/tab.js +10 -1
- package/es/card/utils.js +2 -0
- package/es/form/Components/Editable/index.js +55 -16
- package/es/form/Components/FormGroup/index.d.ts +0 -1
- package/es/form/Components/FormGroup/index.js +22 -7
- package/es/form/Components/LightFilter/index.js +35 -15
- package/es/form/Components/ProField/index.js +14 -2
- package/es/form/Components/ProField/mapDateFormat.js +28 -2
- package/es/form/Components/Text/index.d.ts +0 -1
- package/es/form/Components/Text/index.js +11 -2
- package/es/form/Filter/AdvancedFilter.js +26 -11
- package/es/form/Filter/Layout.js +24 -11
- package/es/form/Filter/LightFilter.js +24 -13
- package/es/form/Filter/SimpleFilter.js +21 -7
- package/es/form/Filter/index.js +171 -117
- package/es/form/Filter/index2.js +28 -11
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +46 -18
- package/es/form/Filter/useSpecialProps.js +13 -8
- package/es/form/ProForm/customComponent.js +5 -0
- package/es/form/ProForm/index.js +38 -30
- package/es/form/ProForm/useAutoLayout.js +42 -21
- package/es/form/ProForm/useAutoSubmit.js +8 -3
- package/es/form/ProForm/useFieldRequest.js +5 -0
- package/es/form/ProForm/useFormDisplayValues.js +28 -12
- package/es/form/ProForm/useInitialRequest.js +5 -0
- package/es/form/SchemaForm/adapterComponent.js +3 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +8 -0
- package/es/form/SchemaForm/adapterType.js +2 -0
- package/es/form/SchemaForm/index.js +114 -78
- package/es/form/SchemaForm/initializeArrayCards.js +6 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +6 -0
- package/es/form/SchemaForm/initializeArrayItems.js +9 -2
- package/es/form/SchemaForm/initializeArrayTable.js +34 -21
- package/es/form/SchemaForm/initializeDataSource.js +6 -2
- package/es/form/SchemaForm/initializeFormButton.js +31 -14
- package/es/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/es/form/SchemaForm/initializeFormGroup.js +20 -10
- package/es/form/SchemaForm/initializeFormStep.js +23 -11
- package/es/form/SchemaForm/initializeFormTab.js +20 -10
- package/es/form/SchemaForm/initializeReactions.js +33 -9
- package/es/form/SchemaForm/initializeRequest.js +16 -2
- package/es/form/SchemaForm/initializeRules.js +22 -4
- package/es/form/SchemaForm/initializeSelectTable.js +33 -7
- package/es/form/SchemaForm/reactions.js +34 -19
- package/es/form/docs/ActionResponse.d.ts +0 -1
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +9 -0
- package/es/form/typing.d.ts +4 -26
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +49 -4
- package/es/form/warning.js +7 -2
- package/es/global.scss +1 -3
- package/es/index-without-icon.js +3 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +8 -18
- package/es/info/components/InfoGroup/index.js +32 -21
- package/es/info/components/InfoValueItem/index.js +119 -66
- package/es/info/components/ProInfoItem/index.js +21 -13
- package/es/info/components/baseInfo/index.js +27 -17
- package/es/info/components/headerInfo/index.js +20 -8
- package/es/info/components/tableInfo/index.js +50 -20
- package/es/info/index.js +86 -61
- package/es/info/typing.d.ts +0 -2
- package/es/info/utils/index.js +11 -0
- package/es/nocode/configurators/ProTable.js +22 -1
- package/es/nocode/configurators/common.js +6 -5
- package/es/nocode/configurators/index.js +3 -2
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +9 -5
- package/es/nocode/pages/index.js +30 -5
- package/es/nocode/pages/playground.js +35 -18
- package/es/nocode/pages/renderer.js +42 -9
- package/es/nocode/playground.js +23 -10
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +76 -40
- package/es/page-header/index.scss +1 -2
- package/es/sidebar/components/sidebar-container/index.js +69 -54
- package/es/sidebar/components/sidebar-container/index.scss +14 -21
- package/es/sidebar/components/tree/index.js +138 -100
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +26 -11
- package/es/sidebar/components/tree-node/components/IconAction/index.js +35 -9
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +25 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +84 -42
- package/es/sidebar/components/tree-node/index.scss +0 -6
- package/es/sidebar/index.d.ts +0 -2
- package/es/sidebar/index.js +95 -72
- package/es/sidebar/typing.d.ts +0 -4
- package/es/sidebar/utils/action-ref.js +7 -2
- package/es/sidebar/utils/index.d.ts +2 -5
- package/es/sidebar/utils/index.js +98 -41
- package/es/table/components/Filter/index.d.ts +3 -6
- package/es/table/components/Filter/index.js +128 -115
- package/es/table/components/Layout/index.js +47 -32
- package/es/table/components/Layout/index.scss +1 -2
- package/es/table/components/Pagination/index.js +58 -25
- package/es/table/components/QuickAction/index.d.ts +0 -1
- package/es/table/components/QuickAction/index.js +11 -3
- package/es/table/components/ToolBar/DensityIcon.js +31 -19
- package/es/table/components/ToolBar/FilterColumnIcon.js +125 -87
- package/es/table/components/ToolBar/FullScreenIcon.js +62 -7
- package/es/table/components/ToolBar/Fullscreen.js +28 -25
- package/es/table/components/ToolBar/RefreshIcon.js +27 -162
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +38 -130
- package/es/table/components/ToolBar/index.scss +3 -49
- package/es/table/index.js +423 -455
- package/es/table/index.scss +0 -8
- package/es/table/typing.d.ts +6 -125
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +79 -39
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +16 -13
- package/es/table/utils/index.js +47 -14
- package/es/table/utils/pureColumnRender.js +53 -21
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +10 -2
- package/es/table/utils/useTableSelection.js +33 -6
- package/es/templates/List/index.js +9 -2
- package/es/timeline/ProTimeLineItem/index.js +65 -25
- package/es/timeline/index.js +22 -8
- package/es/timeline/typing.d.ts +0 -1
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +5 -0
- package/lib/actions/base.js +24 -8
- package/lib/actions/confirm.js +5 -0
- package/lib/actions/danger-confirm.js +5 -0
- package/lib/actions/danger-pop-confirm.js +4 -0
- package/lib/actions/dialog-component.js +15 -2
- package/lib/actions/dialog-form.js +89 -36
- package/lib/actions/dialog-info.js +10 -1
- package/lib/actions/dialog-table.js +5 -0
- package/lib/actions/dialog.js +112 -55
- package/lib/actions/drawer-form.js +3 -0
- package/lib/actions/drawer-info.js +3 -0
- package/lib/actions/drawer-table.js +3 -0
- package/lib/actions/drawer.js +4 -0
- package/lib/actions/error.js +5 -0
- package/lib/actions/index.d.ts +0 -7
- package/lib/actions/index.js +184 -115
- package/lib/actions/index.scss +1 -6
- package/lib/actions/link.js +10 -1
- package/lib/actions/notice.js +5 -0
- package/lib/actions/pop-confirm.js +5 -0
- package/lib/actions/request.js +32 -8
- package/lib/actions/utils.js +9 -1
- package/lib/card/card-container.js +9 -0
- package/lib/card/divider.js +7 -0
- package/lib/card/index.js +127 -61
- package/lib/card/index.scss +0 -15
- package/lib/card/selectable.js +20 -4
- package/lib/card/tab.js +14 -1
- package/lib/card/utils.js +6 -0
- package/lib/field/index.js +6 -0
- package/lib/form/Components/Editable/index.js +65 -15
- package/lib/form/Components/FormGroup/index.d.ts +0 -1
- package/lib/form/Components/FormGroup/index.js +28 -7
- package/lib/form/Components/LightFilter/index.js +47 -15
- package/lib/form/Components/ProField/index.js +21 -2
- package/lib/form/Components/ProField/mapDateFormat.js +32 -2
- package/lib/form/Components/Text/index.d.ts +0 -1
- package/lib/form/Components/Text/index.js +16 -2
- package/lib/form/Filter/AdvancedFilter.js +34 -11
- package/lib/form/Filter/Layout.js +33 -11
- package/lib/form/Filter/LightFilter.js +32 -13
- package/lib/form/Filter/SimpleFilter.js +27 -5
- package/lib/form/Filter/index.js +191 -116
- package/lib/form/Filter/index2.js +38 -11
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +50 -18
- package/lib/form/Filter/useSpecialProps.js +13 -6
- package/lib/form/ProForm/customComponent.js +8 -0
- package/lib/form/ProForm/index.js +60 -30
- package/lib/form/ProForm/useAutoLayout.js +45 -21
- package/lib/form/ProForm/useAutoSubmit.js +10 -1
- package/lib/form/ProForm/useFieldRequest.js +8 -0
- package/lib/form/ProForm/useFormDisplayValues.js +34 -12
- package/lib/form/ProForm/useInitialRequest.js +6 -0
- package/lib/form/SchemaForm/adapterComponent.js +6 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +12 -0
- package/lib/form/SchemaForm/adapterType.js +5 -0
- package/lib/form/SchemaForm/index.js +144 -78
- package/lib/form/SchemaForm/initializeArrayCards.js +7 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +7 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +10 -2
- package/lib/form/SchemaForm/initializeArrayTable.js +34 -21
- package/lib/form/SchemaForm/initializeDataSource.js +8 -2
- package/lib/form/SchemaForm/initializeFormButton.js +32 -14
- package/lib/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/lib/form/SchemaForm/initializeFormGroup.js +20 -10
- package/lib/form/SchemaForm/initializeFormStep.js +23 -11
- package/lib/form/SchemaForm/initializeFormTab.js +20 -10
- package/lib/form/SchemaForm/initializeReactions.js +37 -9
- package/lib/form/SchemaForm/initializeRequest.js +18 -2
- package/lib/form/SchemaForm/initializeRules.js +24 -4
- package/lib/form/SchemaForm/initializeSelectTable.js +36 -7
- package/lib/form/SchemaForm/reactions.js +37 -17
- package/lib/form/docs/ActionResponse.d.ts +0 -1
- package/lib/form/docs/ActionResponse.js +5 -0
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +25 -0
- package/lib/form/typing.d.ts +4 -26
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +61 -4
- package/lib/form/warning.js +8 -2
- package/lib/global.scss +1 -3
- package/lib/hooks/index.js +5 -0
- package/lib/index-without-icon.js +36 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +40 -13
- package/lib/info/components/InfoGroup/index.js +42 -21
- package/lib/info/components/InfoValueItem/index.js +134 -66
- package/lib/info/components/ProInfoItem/index.js +29 -13
- package/lib/info/components/baseInfo/index.js +39 -17
- package/lib/info/components/headerInfo/index.js +31 -8
- package/lib/info/components/tableInfo/index.js +62 -20
- package/lib/info/index.js +101 -61
- package/lib/info/typing.d.ts +0 -2
- package/lib/info/utils/index.js +19 -0
- package/lib/info/utils/utils.js +1 -0
- package/lib/nocode/configurators/PageHeader.js +2 -0
- package/lib/nocode/configurators/ProTable.js +24 -1
- package/lib/nocode/configurators/common.js +10 -5
- package/lib/nocode/configurators/index.js +10 -2
- package/lib/nocode/configurators/map.js +5 -0
- package/lib/nocode/index.js +11 -0
- package/lib/nocode/pages/editor.js +19 -5
- package/lib/nocode/pages/index.js +35 -3
- package/lib/nocode/pages/playground.js +52 -18
- package/lib/nocode/pages/renderer.js +53 -9
- package/lib/nocode/playground.js +35 -10
- package/lib/page-container/index.js +6 -0
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +90 -39
- package/lib/page-header/index.scss +1 -2
- package/lib/sidebar/components/sidebar-container/index.js +81 -54
- package/lib/sidebar/components/sidebar-container/index.scss +14 -21
- package/lib/sidebar/components/tree/index.js +152 -100
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +34 -11
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +46 -9
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +35 -12
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +100 -42
- package/lib/sidebar/components/tree-node/index.scss +0 -6
- package/lib/sidebar/index.d.ts +0 -2
- package/lib/sidebar/index.js +111 -79
- package/lib/sidebar/typing.d.ts +0 -4
- package/lib/sidebar/utils/action-ref.js +8 -2
- package/lib/sidebar/utils/index.d.ts +2 -5
- package/lib/sidebar/utils/index.js +106 -41
- package/lib/skeleton/index.js +6 -0
- package/lib/table/components/EmptyContent/index.js +6 -0
- package/lib/table/components/Filter/index.d.ts +3 -6
- package/lib/table/components/Filter/index.js +137 -114
- package/lib/table/components/Layout/index.js +60 -32
- package/lib/table/components/Layout/index.scss +1 -2
- package/lib/table/components/Pagination/index.js +68 -25
- package/lib/table/components/QuickAction/index.d.ts +0 -1
- package/lib/table/components/QuickAction/index.js +15 -3
- package/lib/table/components/ToolBar/DensityIcon.js +42 -19
- package/lib/table/components/ToolBar/FilterColumnIcon.js +136 -86
- package/lib/table/components/ToolBar/FullScreenIcon.js +74 -10
- package/lib/table/components/ToolBar/Fullscreen.js +35 -25
- package/lib/table/components/ToolBar/RefreshIcon.js +36 -164
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +47 -133
- package/lib/table/components/ToolBar/index.scss +3 -49
- package/lib/table/index.js +445 -454
- package/lib/table/index.scss +0 -8
- package/lib/table/typing.d.ts +6 -125
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +92 -39
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +21 -13
- package/lib/table/utils/getTableProps.js +2 -0
- package/lib/table/utils/getTableSortIcons.js +5 -0
- package/lib/table/utils/index.js +55 -12
- package/lib/table/utils/pureColumnRender.js +64 -21
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +11 -2
- package/lib/table/utils/useTableSelection.js +35 -6
- package/lib/templates/Detail/index.js +5 -0
- package/lib/templates/Form/index.js +5 -0
- package/lib/templates/List/index.js +19 -2
- package/lib/templates/index.js +6 -0
- package/lib/timeline/ProTimeLineItem/index.js +76 -25
- package/lib/timeline/index.js +33 -8
- package/lib/timeline/typing.d.ts +0 -1
- package/lib/utils/index.js +6 -0
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +10 -0
- package/package.json +1 -1
- package/dist/pro.all.min.css +0 -1
- package/dist/pro.xconsole.min.css +0 -1
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/quick.js +0 -26
- package/es/card/xconsole.scss +0 -3
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/addCascadeEffect.js +0 -203
- package/es/next-xconsole.scss +0 -34
- package/es/page-header/xconsole.scss +0 -5
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/CardView/index.js +0 -392
- package/es/table/components/CardView/index.scss +0 -46
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/LoadMore/index.js +0 -88
- package/es/table/components/LoadMore/index.scss +0 -19
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/CardSwitch.js +0 -52
- package/es/table/utils/util.d.ts +0 -5
- package/es/table/utils/util.js +0 -19
- package/es/xconsole.scss +0 -503
- package/lib/actions/quick.d.ts +0 -2
- package/lib/actions/quick.js +0 -33
- package/lib/card/xconsole.scss +0 -3
- package/lib/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/lib/form/ProForm/addCascadeEffect.js +0 -210
- package/lib/next-xconsole.scss +0 -34
- package/lib/page-header/xconsole.scss +0 -5
- package/lib/table/components/CardView/index.d.ts +0 -5
- package/lib/table/components/CardView/index.js +0 -402
- package/lib/table/components/CardView/index.scss +0 -46
- package/lib/table/components/LoadMore/index.d.ts +0 -20
- package/lib/table/components/LoadMore/index.js +0 -99
- package/lib/table/components/LoadMore/index.scss +0 -19
- package/lib/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/lib/table/components/ToolBar/CardSwitch.js +0 -60
- package/lib/table/utils/util.d.ts +0 -5
- package/lib/table/utils/util.js +0 -25
- package/lib/xconsole.scss +0 -503
@@ -1,210 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
var _core = require("@formily/core");
|
8
|
-
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
|
-
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; }
|
10
|
-
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; }
|
11
|
-
var OP_MAPS = {
|
12
|
-
'*': function _() {
|
13
|
-
return true;
|
14
|
-
},
|
15
|
-
'=': function _(l, r) {
|
16
|
-
return l === r;
|
17
|
-
},
|
18
|
-
'==': function _(l, r) {
|
19
|
-
return l === r;
|
20
|
-
},
|
21
|
-
'!': function _(l, r) {
|
22
|
-
return l !== r;
|
23
|
-
},
|
24
|
-
'!=': function _(l, r) {
|
25
|
-
return l != r;
|
26
|
-
},
|
27
|
-
'>': function _(l, r) {
|
28
|
-
return l > r;
|
29
|
-
},
|
30
|
-
'<': function _(l, r) {
|
31
|
-
return l < r;
|
32
|
-
},
|
33
|
-
'>=': function _(l, r) {
|
34
|
-
return l >= r;
|
35
|
-
},
|
36
|
-
'<=': function _(l, r) {
|
37
|
-
return l <= r;
|
38
|
-
},
|
39
|
-
ied: function ied(l, r) {
|
40
|
-
if (Array.isArray(l) || typeof l === 'string' && r) {
|
41
|
-
return l.includes(r);
|
42
|
-
} else {
|
43
|
-
return false;
|
44
|
-
}
|
45
|
-
},
|
46
|
-
eed: function eed(l, r) {
|
47
|
-
if (Array.isArray(l) || typeof l === 'string' && r) {
|
48
|
-
return !l.includes(r);
|
49
|
-
} else {
|
50
|
-
return true;
|
51
|
-
}
|
52
|
-
},
|
53
|
-
i: function i(l, r) {
|
54
|
-
if (Array.isArray(r) || typeof r === 'string' && l) {
|
55
|
-
return r.includes(l);
|
56
|
-
} else {
|
57
|
-
return false;
|
58
|
-
}
|
59
|
-
},
|
60
|
-
e: function e(l, r) {
|
61
|
-
if (Array.isArray(r) || typeof r === 'string' && l) {
|
62
|
-
return !r.includes(l);
|
63
|
-
} else {
|
64
|
-
return true;
|
65
|
-
}
|
66
|
-
},
|
67
|
-
isEmpty: function isEmpty(l, r) {
|
68
|
-
return l === null || l === undefined || l === '' || Array.isArray(l) && l.length === 0;
|
69
|
-
},
|
70
|
-
notEmpty: function notEmpty(l, r) {
|
71
|
-
return l !== null && l !== undefined && l !== '' && (!Array.isArray(l) || l.length !== 0);
|
72
|
-
}
|
73
|
-
};
|
74
|
-
var getParsedValue = function getParsedValue(value, scope) {
|
75
|
-
if (typeof value === 'string' && value.startsWith('${') && value.endsWith('}')) {
|
76
|
-
return scope.$form.getValuesIn(value.slice(2, value.length - 1));
|
77
|
-
} else if (typeof value === 'string' && value.startsWith('{{') && value.endsWith('}}')) {
|
78
|
-
var code = value.slice(2, value.length - 2);
|
79
|
-
try {
|
80
|
-
return new Function("with(this){ return ".concat(code, " }")).call(scope);
|
81
|
-
} catch (e) {
|
82
|
-
return undefined;
|
83
|
-
}
|
84
|
-
} else {
|
85
|
-
return value;
|
86
|
-
}
|
87
|
-
};
|
88
|
-
var bingo = function bingo(bingoItem, scope) {
|
89
|
-
var _bingoItem$when = bingoItem.when,
|
90
|
-
when = _bingoItem$when === void 0 ? [] : _bingoItem$when,
|
91
|
-
_bingoItem$logic = bingoItem.logic,
|
92
|
-
logic = _bingoItem$logic === void 0 ? '&&' : _bingoItem$logic;
|
93
|
-
var result = logic === '&&';
|
94
|
-
when.forEach(function (_ref) {
|
95
|
-
var left = _ref.left,
|
96
|
-
op = _ref.op,
|
97
|
-
right = _ref.right;
|
98
|
-
var leftValue = scope.$form.getValuesIn(left);
|
99
|
-
var rightValue = getParsedValue(right, scope);
|
100
|
-
var itemResult = OP_MAPS[op](leftValue, rightValue);
|
101
|
-
if (logic === '&&') {
|
102
|
-
result = result && itemResult;
|
103
|
-
} else {
|
104
|
-
result = result || itemResult;
|
105
|
-
}
|
106
|
-
});
|
107
|
-
return result;
|
108
|
-
};
|
109
|
-
var loopAddFieldEffect = function loopAddFieldEffect(schema, form, scope) {
|
110
|
-
if (Array.isArray(schema)) {
|
111
|
-
schema === null || schema === void 0 ? void 0 : schema.forEach(function (item) {
|
112
|
-
if (item.name) {
|
113
|
-
var _item$cascade, _item$onChange;
|
114
|
-
(_item$cascade = item.cascade) === null || _item$cascade === void 0 ? void 0 : _item$cascade.forEach(function (cascade) {
|
115
|
-
(0, _core.onFieldReact)(item.name, function (field) {
|
116
|
-
var contextScope = _objectSpread(_objectSpread({}, scope), {}, {
|
117
|
-
$form: form,
|
118
|
-
$self: field,
|
119
|
-
$values: form.values
|
120
|
-
});
|
121
|
-
var _cascade$state = cascade.state,
|
122
|
-
state = _cascade$state === void 0 ? {} : _cascade$state,
|
123
|
-
_cascade$props = cascade.props,
|
124
|
-
props = _cascade$props === void 0 ? {} : _cascade$props,
|
125
|
-
dataSourceFilter = cascade.dataSourceFilter,
|
126
|
-
dataSourceHide = cascade.dataSourceHide;
|
127
|
-
if (bingo(cascade, contextScope)) {
|
128
|
-
if (dataSourceFilter || dataSourceHide) {
|
129
|
-
var sourceDataSource = field.getState()._sourceDataSource;
|
130
|
-
if (!sourceDataSource) {
|
131
|
-
var dataSource = field.getState().dataSource;
|
132
|
-
field.setState({
|
133
|
-
_sourceDataSource: dataSource
|
134
|
-
});
|
135
|
-
sourceDataSource = dataSource;
|
136
|
-
}
|
137
|
-
if (sourceDataSource) {
|
138
|
-
var nextDataSource = sourceDataSource.filter(function (item) {
|
139
|
-
if (Array.isArray(dataSourceFilter)) {
|
140
|
-
return dataSourceFilter.includes(item.value);
|
141
|
-
}
|
142
|
-
if (Array.isArray(dataSourceHide)) {
|
143
|
-
return !dataSourceFilter.includes(item.value);
|
144
|
-
}
|
145
|
-
});
|
146
|
-
field.setDataSource(nextDataSource);
|
147
|
-
var value = field.getState().value;
|
148
|
-
if (!nextDataSource.some(function (item) {
|
149
|
-
return item.value === value;
|
150
|
-
})) {
|
151
|
-
field.setValue(undefined);
|
152
|
-
}
|
153
|
-
}
|
154
|
-
}
|
155
|
-
var nextState = {};
|
156
|
-
Object.keys(state).forEach(function (stateKey) {
|
157
|
-
nextState[stateKey] = getParsedValue(state[stateKey], contextScope);
|
158
|
-
});
|
159
|
-
field.setState(nextState);
|
160
|
-
var nextProps = {};
|
161
|
-
Object.keys(props).forEach(function (propsKey) {
|
162
|
-
nextProps[propsKey] = getParsedValue(props[propsKey], contextScope);
|
163
|
-
});
|
164
|
-
field.setComponentProps(nextProps);
|
165
|
-
} else {
|
166
|
-
var formState = form.getState();
|
167
|
-
if (dataSourceFilter || dataSourceHide) {
|
168
|
-
var _sourceDataSource = field.getState()._sourceDataSource;
|
169
|
-
_sourceDataSource && field.setDataSource(_sourceDataSource);
|
170
|
-
}
|
171
|
-
var _nextState = {};
|
172
|
-
Object.keys(state).forEach(function (stateKey) {
|
173
|
-
_nextState[stateKey] = stateKey in item ? item[stateKey] : formState[stateKey];
|
174
|
-
});
|
175
|
-
field.setState(_nextState);
|
176
|
-
var _nextProps = {};
|
177
|
-
Object.keys(props).forEach(function (propsKey) {
|
178
|
-
_nextProps[propsKey] = item.props ? item.props[propsKey] : undefined;
|
179
|
-
});
|
180
|
-
field.setComponentProps(_nextProps);
|
181
|
-
}
|
182
|
-
});
|
183
|
-
});
|
184
|
-
(_item$onChange = item.onChange) === null || _item$onChange === void 0 ? void 0 : _item$onChange.forEach(function (onChange) {
|
185
|
-
(0, _core.onFieldValueChange)(item.name, function (field) {
|
186
|
-
var contextScope = _objectSpread(_objectSpread({}, scope), {}, {
|
187
|
-
$form: form,
|
188
|
-
$self: field,
|
189
|
-
$values: form.values
|
190
|
-
});
|
191
|
-
var values = onChange.values;
|
192
|
-
if (bingo(onChange, contextScope)) {
|
193
|
-
Object.keys(values).forEach(function (valuesKey) {
|
194
|
-
form.setValuesIn(valuesKey, getParsedValue(values[valuesKey], contextScope));
|
195
|
-
});
|
196
|
-
}
|
197
|
-
});
|
198
|
-
});
|
199
|
-
} else if (item.children) {
|
200
|
-
loopAddFieldEffect(item.children, form, scope);
|
201
|
-
}
|
202
|
-
});
|
203
|
-
}
|
204
|
-
};
|
205
|
-
var _default = function _default(form, schema, scope) {
|
206
|
-
form.addEffects('cascade', function () {
|
207
|
-
loopAddFieldEffect(schema, form, scope);
|
208
|
-
});
|
209
|
-
};
|
210
|
-
exports.default = _default;
|
package/lib/next-xconsole.scss
DELETED
@@ -1,34 +0,0 @@
|
|
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,402 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
8
|
-
var _components = require("@alicloudfe/components");
|
9
|
-
var _ = require("../../../");
|
10
|
-
var _skeleton = require("../../../skeleton");
|
11
|
-
var _utils = require("@teamix/utils");
|
12
|
-
require("./index.scss");
|
13
|
-
var _columnRender = require("../../utils/columnRender");
|
14
|
-
var _LoadMore = _interopRequireDefault(require("../LoadMore"));
|
15
|
-
var _result = _interopRequireDefault(require("@teamix/result"));
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
-
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); }
|
18
|
-
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; }
|
19
|
-
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); }
|
20
|
-
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; }
|
21
|
-
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; }
|
22
|
-
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; }
|
23
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
24
|
-
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."); }
|
25
|
-
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); }
|
26
|
-
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; }
|
27
|
-
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; }
|
28
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
29
|
-
var Row = _components.Grid.Row,
|
30
|
-
Col = _components.Grid.Col;
|
31
|
-
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-card-view');
|
32
|
-
var CardView = function CardView(props) {
|
33
|
-
var _cardViewProps$scroll;
|
34
|
-
var _props$dataSource = props.dataSource,
|
35
|
-
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
36
|
-
_props$columns = props.columns,
|
37
|
-
columns = _props$columns === void 0 ? [] : _props$columns,
|
38
|
-
_props$loading = props.loading,
|
39
|
-
loading = _props$loading === void 0 ? false : _props$loading,
|
40
|
-
originColumns = props.originColumns,
|
41
|
-
_props$cardViewProps = props.cardViewProps,
|
42
|
-
cardViewProps = _props$cardViewProps === void 0 ? {} : _props$cardViewProps,
|
43
|
-
actionRef = props.actionRef,
|
44
|
-
context = props.context,
|
45
|
-
scrollHeight = props.scrollHeight,
|
46
|
-
_props$showSkeleton = props.showSkeleton,
|
47
|
-
showSkeleton = _props$showSkeleton === void 0 ? false : _props$showSkeleton;
|
48
|
-
// 加载状态
|
49
|
-
var _useState = (0, _react.useState)('none'),
|
50
|
-
_useState2 = _slicedToArray(_useState, 2),
|
51
|
-
loadState = _useState2[0],
|
52
|
-
setLoadState = _useState2[1];
|
53
|
-
// 骨架屏状态
|
54
|
-
var _useState3 = (0, _react.useState)(true),
|
55
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
56
|
-
skeletonVisible = _useState4[0],
|
57
|
-
setSkeletonVisible = _useState4[1];
|
58
|
-
// 加载状态变化回调
|
59
|
-
(0, _react.useEffect)(function () {
|
60
|
-
setLoadState(loading ? 'loading' : 'loadMore');
|
61
|
-
if (cardViewProps.showSkeleton) {
|
62
|
-
setSkeletonVisible(cardViewProps.showSkeleton);
|
63
|
-
} else {
|
64
|
-
setSkeletonVisible(showSkeleton);
|
65
|
-
}
|
66
|
-
if (showSkeleton) {
|
67
|
-
setLoadState('none');
|
68
|
-
}
|
69
|
-
if (dataSource.length === 0) {
|
70
|
-
setLoadState('none');
|
71
|
-
}
|
72
|
-
}, [loading, skeletonVisible, showSkeleton, cardViewProps.showSkeleton, dataSource]);
|
73
|
-
// 数据源变化毁掉
|
74
|
-
(0, _react.useEffect)(function () {
|
75
|
-
if (dataSource.length === 0) {
|
76
|
-
setLoadState('none');
|
77
|
-
}
|
78
|
-
}, [dataSource]);
|
79
|
-
var getDataIndexValue = function getDataIndexValue(dataIndex, dataSource) {
|
80
|
-
if (Array.isArray(dataIndex)) {
|
81
|
-
return dataIndex.map(function (item) {
|
82
|
-
return (0, _.getDeepValue)(item !== null && item !== void 0 ? item : '', dataSource);
|
83
|
-
});
|
84
|
-
}
|
85
|
-
return (0, _.getDeepValue)(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
86
|
-
};
|
87
|
-
// 获取卡片 columns
|
88
|
-
var cardColumns = (0, _react.useMemo)(function () {
|
89
|
-
return columns.map(function (column) {
|
90
|
-
var _originColumn$title;
|
91
|
-
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns.find(function (item) {
|
92
|
-
return item.dataIndex === column.dataIndex;
|
93
|
-
});
|
94
|
-
var render = column === null || column === void 0 ? void 0 : column.render;
|
95
|
-
if (typeof (column === null || column === void 0 ? void 0 : column.render) === 'function') {
|
96
|
-
render = function render(value, record) {
|
97
|
-
var _column$render;
|
98
|
-
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);
|
99
|
-
};
|
100
|
-
} else {
|
101
|
-
var _Object$entries$map, _Object$entries, _Object$entries$map2, _column$render2;
|
102
|
-
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) {
|
103
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
104
|
-
k = _ref2[0],
|
105
|
-
v = _ref2[1];
|
106
|
-
if (typeof v === 'function') {
|
107
|
-
return [k, function (value, record) {
|
108
|
-
return v === null || v === void 0 ? void 0 : v(value, undefined, record);
|
109
|
-
}];
|
110
|
-
}
|
111
|
-
return [k, v];
|
112
|
-
})) !== null && _Object$entries$map !== void 0 ? _Object$entries$map : []);
|
113
|
-
}
|
114
|
-
return _objectSpread(_objectSpread({}, column), {}, {
|
115
|
-
title: (_originColumn$title = originColumn === null || originColumn === void 0 ? void 0 : originColumn.title) !== null && _originColumn$title !== void 0 ? _originColumn$title : column.title,
|
116
|
-
render: render
|
117
|
-
});
|
118
|
-
}).filter(function (item) {
|
119
|
-
return !(item === null || item === void 0 ? void 0 : item.actionSchema);
|
120
|
-
});
|
121
|
-
}, [columns, originColumns]);
|
122
|
-
// 获取单个渲染数据
|
123
|
-
var renderCardInfoItem = function renderCardInfoItem(itemProps, record, index) {
|
124
|
-
if (itemProps) {
|
125
|
-
if (typeof itemProps === 'string' || Array.isArray(itemProps)) {
|
126
|
-
var _titleColumn$cell, _titleColumn$cell2;
|
127
|
-
var titleColumn = cardColumns.find(function (item) {
|
128
|
-
return item.dataIndex === itemProps;
|
129
|
-
});
|
130
|
-
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 : '';
|
131
|
-
}
|
132
|
-
return (0, _columnRender.renderCell)(getDataIndexValue(itemProps.dataIndex, record), itemProps, index, record, actionRef, context);
|
133
|
-
}
|
134
|
-
};
|
135
|
-
// 渲染卡片title
|
136
|
-
var renderCardTitle = function renderCardTitle(record, index) {
|
137
|
-
var _cardColumns$, _cardColumns$$render, _cardColumns$2, _cardColumns$2$cell, _cardColumns$3;
|
138
|
-
var titleProp = cardViewProps.title;
|
139
|
-
var title = titleProp;
|
140
|
-
if (typeof titleProp === 'function') {
|
141
|
-
title = titleProp === null || titleProp === void 0 ? void 0 : titleProp(index, record);
|
142
|
-
}
|
143
|
-
if (titleProp) {
|
144
|
-
return renderCardInfoItem(title, record, index);
|
145
|
-
}
|
146
|
-
// 【默认情况】看看第一列有没有 description,有的话,只取 title
|
147
|
-
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) {
|
148
|
-
var _originColumn$render;
|
149
|
-
var column = cardColumns === null || cardColumns === void 0 ? void 0 : cardColumns[0];
|
150
|
-
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0];
|
151
|
-
// 转化为新的 table columns
|
152
|
-
var _columns = _objectSpread(_objectSpread({}, originColumn), {}, {
|
153
|
-
render: _objectSpread(_objectSpread({}, originColumn === null || originColumn === void 0 ? void 0 : originColumn.render), {}, {
|
154
|
-
value: originColumn === null || originColumn === void 0 ? void 0 : (_originColumn$render = originColumn.render) === null || _originColumn$render === void 0 ? void 0 : _originColumn$render.value,
|
155
|
-
description: undefined,
|
156
|
-
descriptionCopy: undefined
|
157
|
-
})
|
158
|
-
});
|
159
|
-
return (0, _columnRender.renderCell)(getDataIndexValue(column === null || column === void 0 ? void 0 : column.dataIndex, record), _columns, index, record, actionRef, context);
|
160
|
-
}
|
161
|
-
// 【默认情况】直接拿第一列的 cell
|
162
|
-
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);
|
163
|
-
};
|
164
|
-
// 渲染卡片subTitle
|
165
|
-
var renderCardSubTitle = function renderCardSubTitle(record, index) {
|
166
|
-
var _cardColumns$4, _cardColumns$4$render;
|
167
|
-
var subTitleProp = cardViewProps.subTitle;
|
168
|
-
var subTitle = subTitleProp;
|
169
|
-
if (typeof subTitleProp === 'function') {
|
170
|
-
subTitle = subTitleProp === null || subTitleProp === void 0 ? void 0 : subTitleProp(index, record);
|
171
|
-
}
|
172
|
-
if (subTitle) {
|
173
|
-
return renderCardInfoItem(subTitle, record, index);
|
174
|
-
}
|
175
|
-
// 【默认情况】看看第一列有没有 description,有的话,只取 title
|
176
|
-
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) {
|
177
|
-
var _originColumn$render2, _column$render3;
|
178
|
-
var column = cardColumns === null || cardColumns === void 0 ? void 0 : cardColumns[0];
|
179
|
-
var originColumn = originColumns === null || originColumns === void 0 ? void 0 : originColumns[0];
|
180
|
-
// 转化为新的 table columns
|
181
|
-
var _columns2 = _objectSpread(_objectSpread({}, originColumn), {}, {
|
182
|
-
render: {
|
183
|
-
value: originColumn === null || originColumn === void 0 ? void 0 : (_originColumn$render2 = originColumn.render) === null || _originColumn$render2 === void 0 ? void 0 : _originColumn$render2.description,
|
184
|
-
description: undefined,
|
185
|
-
descriptionCopy: undefined
|
186
|
-
}
|
187
|
-
});
|
188
|
-
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);
|
189
|
-
}
|
190
|
-
};
|
191
|
-
// 获取ProInfoColumns
|
192
|
-
var getPropInfoColumns = function getPropInfoColumns(record, index) {
|
193
|
-
var contentProp = cardViewProps.content;
|
194
|
-
var content = contentProp;
|
195
|
-
if (typeof contentProp === 'function') {
|
196
|
-
content = contentProp === null || contentProp === void 0 ? void 0 : contentProp(index, record);
|
197
|
-
}
|
198
|
-
if (content) {
|
199
|
-
return content.map(function (item) {
|
200
|
-
if (typeof item === 'string') {
|
201
|
-
return cardColumns.find(function (column) {
|
202
|
-
return column.dataIndex === item;
|
203
|
-
});
|
204
|
-
}
|
205
|
-
return content;
|
206
|
-
});
|
207
|
-
}
|
208
|
-
// 默认取4条数据
|
209
|
-
return cardColumns.filter(function (item, index) {
|
210
|
-
return index > 0 && index < 5;
|
211
|
-
});
|
212
|
-
};
|
213
|
-
// 从表格columns获取Action配置
|
214
|
-
var getActionGroupFromColumn = function getActionGroupFromColumn(dataIndex, record, index) {
|
215
|
-
var actionColumn;
|
216
|
-
if (dataIndex) {
|
217
|
-
actionColumn = columns === null || columns === void 0 ? void 0 : columns.find(function (item) {
|
218
|
-
return item.dataIndex.toString() === dataIndex.toString();
|
219
|
-
});
|
220
|
-
} else {
|
221
|
-
// 默认继承表格操作列
|
222
|
-
// 获取操作列,只能获取最后一列
|
223
|
-
actionColumn = columns === null || columns === void 0 ? void 0 : columns[(columns === null || columns === void 0 ? void 0 : columns.length) - 1];
|
224
|
-
}
|
225
|
-
if (actionColumn.actionSchema) {
|
226
|
-
var _actionColumn, _actionColumn$actionS;
|
227
|
-
var newActionColumn = _objectSpread(_objectSpread({}, actionColumn), {}, {
|
228
|
-
actionSchema: {
|
229
|
-
actions: (_actionColumn = actionColumn) === null || _actionColumn === void 0 ? void 0 : (_actionColumn$actionS = _actionColumn.actionSchema) === null || _actionColumn$actionS === void 0 ? void 0 : _actionColumn$actionS.actions,
|
230
|
-
max: 1
|
231
|
-
}
|
232
|
-
});
|
233
|
-
return (0, _columnRender.renderCell)(null, newActionColumn, index, record, actionRef, context);
|
234
|
-
}
|
235
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
236
|
-
};
|
237
|
-
// 获取Card操作列配置
|
238
|
-
var getProCardExtra = function getProCardExtra(record, index) {
|
239
|
-
var extraProp = cardViewProps.extra;
|
240
|
-
var extra = extraProp;
|
241
|
-
if (typeof extraProp === 'function') {
|
242
|
-
extra = extraProp === null || extraProp === void 0 ? void 0 : extraProp(index, record);
|
243
|
-
}
|
244
|
-
if (Array.isArray(extra)) {
|
245
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
246
|
-
className: cls('extra')
|
247
|
-
}, extra.map(function (item) {
|
248
|
-
if (typeof item === 'string') {
|
249
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
250
|
-
className: cls('extra-item')
|
251
|
-
}, getActionGroupFromColumn(item, record, index));
|
252
|
-
}
|
253
|
-
if ( /*#__PURE__*/(0, _react.isValidElement)(item)) {
|
254
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
255
|
-
className: cls('extra-item')
|
256
|
-
}, item);
|
257
|
-
}
|
258
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
259
|
-
className: cls('extra-item')
|
260
|
-
}, (0, _columnRender.renderCell)(null, item, index, record, actionRef, context));
|
261
|
-
}));
|
262
|
-
}
|
263
|
-
return getActionGroupFromColumn(undefined, record, index);
|
264
|
-
};
|
265
|
-
// 渲染Tag
|
266
|
-
var getTags = function getTags(record, index) {
|
267
|
-
var tagProp = cardViewProps.tags;
|
268
|
-
var tags = tagProp !== null && tagProp !== void 0 ? tagProp : [];
|
269
|
-
if (typeof tagProp === 'function') {
|
270
|
-
var _tagProp;
|
271
|
-
tags = (_tagProp = tagProp === null || tagProp === void 0 ? void 0 : tagProp(index, record)) !== null && _tagProp !== void 0 ? _tagProp : [];
|
272
|
-
}
|
273
|
-
var getTagFromColumns = function getTagFromColumns(columns, dataIndex) {
|
274
|
-
var _columns$render, _columns$render2, _columns$render4, _columns$render5, _columns$render7, _columns$render8;
|
275
|
-
var text = getDataIndexValue(dataIndex, record);
|
276
|
-
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') {
|
277
|
-
var _columns$render3;
|
278
|
-
text = columns === null || columns === void 0 ? void 0 : (_columns$render3 = columns.render) === null || _columns$render3 === void 0 ? void 0 : _columns$render3.value;
|
279
|
-
}
|
280
|
-
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') {
|
281
|
-
var _columns$render6;
|
282
|
-
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);
|
283
|
-
}
|
284
|
-
var color = columns === null || columns === void 0 ? void 0 : (_columns$render7 = columns.render) === null || _columns$render7 === void 0 ? void 0 : _columns$render7.color;
|
285
|
-
if (typeof (columns === null || columns === void 0 ? void 0 : (_columns$render8 = columns.render) === null || _columns$render8 === void 0 ? void 0 : _columns$render8.color) === 'function') {
|
286
|
-
var _columns$render9;
|
287
|
-
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);
|
288
|
-
}
|
289
|
-
return {
|
290
|
-
children: text,
|
291
|
-
color: color
|
292
|
-
};
|
293
|
-
};
|
294
|
-
return tags.map(function (tagItem) {
|
295
|
-
if (typeof tagItem === 'string') {
|
296
|
-
var tagColumns = columns.find(function (item) {
|
297
|
-
return item.dataIndex === tagItem;
|
298
|
-
});
|
299
|
-
return getTagFromColumns(tagColumns, tagItem);
|
300
|
-
}
|
301
|
-
if (_typeof(tagItem) === 'object') {
|
302
|
-
return getTagFromColumns(tagItem, tagItem === null || tagItem === void 0 ? void 0 : tagItem.dataIndex);
|
303
|
-
}
|
304
|
-
});
|
305
|
-
};
|
306
|
-
// 加载下一页回调
|
307
|
-
var onLoadMore = function onLoadMore() {
|
308
|
-
var _actionRef$current, _actionRef$current$ne;
|
309
|
-
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);
|
310
|
-
};
|
311
|
-
// 触底回调
|
312
|
-
var onScrollBottom = function onScrollBottom() {
|
313
|
-
if (cardViewProps.autoLoadNextPage !== false) {
|
314
|
-
var _cardViewProps$onScro;
|
315
|
-
onLoadMore();
|
316
|
-
cardViewProps === null || cardViewProps === void 0 ? void 0 : (_cardViewProps$onScro = cardViewProps.onScrollBottom) === null || _cardViewProps$onScro === void 0 ? void 0 : _cardViewProps$onScro.call(cardViewProps);
|
317
|
-
}
|
318
|
-
};
|
319
|
-
// 获取ProCard配置
|
320
|
-
var getProCardProps = function getProCardProps(record, index) {
|
321
|
-
var _cardViewProps$cardPr;
|
322
|
-
var external = ['onCollapse', 'onSelect', 'onClick'];
|
323
|
-
return Object.fromEntries(Object.entries((_cardViewProps$cardPr = cardViewProps.cardProps) !== null && _cardViewProps$cardPr !== void 0 ? _cardViewProps$cardPr : {}).map(function (_ref3) {
|
324
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
325
|
-
key = _ref4[0],
|
326
|
-
value = _ref4[1];
|
327
|
-
if (typeof value === 'function' && !external.includes(key)) {
|
328
|
-
return [key, value === null || value === void 0 ? void 0 : value(index, record)];
|
329
|
-
}
|
330
|
-
if (typeof value === 'function' && external.includes(key)) {
|
331
|
-
return [key, function () {
|
332
|
-
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
333
|
-
others[_key] = arguments[_key];
|
334
|
-
}
|
335
|
-
return value === null || value === void 0 ? void 0 : value.apply(void 0, [index, record].concat(others));
|
336
|
-
}];
|
337
|
-
}
|
338
|
-
return [key, value];
|
339
|
-
}));
|
340
|
-
};
|
341
|
-
// 渲染单个卡片
|
342
|
-
var renderCard = function renderCard(record, index) {
|
343
|
-
var _cardViewProps$cardRe;
|
344
|
-
return /*#__PURE__*/_react.default.createElement(Col, _objectSpread({
|
345
|
-
xxs: 24,
|
346
|
-
xs: 12,
|
347
|
-
s: 12,
|
348
|
-
m: 8,
|
349
|
-
l: 6,
|
350
|
-
xl: 6,
|
351
|
-
key: index,
|
352
|
-
className: cls('card-item')
|
353
|
-
}, (_cardViewProps$cardRe = cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.cardResponsiveProps) !== null && _cardViewProps$cardRe !== void 0 ? _cardViewProps$cardRe : {}), /*#__PURE__*/_react.default.createElement(_.ProCard, _objectSpread({
|
354
|
-
title: renderCardTitle(record, index),
|
355
|
-
subTitle: renderCardSubTitle(record, index),
|
356
|
-
extra: getProCardExtra(record, index),
|
357
|
-
tags: getTags(record, index)
|
358
|
-
}, getProCardProps(record, index)), /*#__PURE__*/_react.default.createElement(_.ProInfo, {
|
359
|
-
columns: getPropInfoColumns(record, index),
|
360
|
-
dataSource: record,
|
361
|
-
context: {
|
362
|
-
record: record,
|
363
|
-
index: index
|
364
|
-
},
|
365
|
-
disabledAutoSize: true
|
366
|
-
})));
|
367
|
-
};
|
368
|
-
// 渲染卡片主体
|
369
|
-
var renderCardBox = function renderCardBox() {
|
370
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, skeletonVisible && /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Content, null), !skeletonVisible && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) === 0 && /*#__PURE__*/_react.default.createElement(_result.default, {
|
371
|
-
theme: "hybridcloud-container",
|
372
|
-
img: "noData",
|
373
|
-
title: (0, _.getMessage)('noData'),
|
374
|
-
style: {
|
375
|
-
padding: '50px 0 60px'
|
376
|
-
}
|
377
|
-
}), !skeletonVisible && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && /*#__PURE__*/_react.default.createElement(Row, {
|
378
|
-
gutter: 16,
|
379
|
-
wrap: true,
|
380
|
-
style: {
|
381
|
-
marginTop: '-16px'
|
382
|
-
}
|
383
|
-
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item, index) {
|
384
|
-
return renderCard(item, index);
|
385
|
-
})));
|
386
|
-
};
|
387
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
388
|
-
className: cls()
|
389
|
-
}, (cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination) && /*#__PURE__*/_react.default.createElement(_components.Loading, {
|
390
|
-
visible: loading,
|
391
|
-
style: {
|
392
|
-
width: '100%'
|
393
|
-
}
|
394
|
-
}, renderCardBox()), !(cardViewProps === null || cardViewProps === void 0 ? void 0 : cardViewProps.useTablePagination) && /*#__PURE__*/_react.default.createElement(_LoadMore.default, {
|
395
|
-
onScrollBottom: onScrollBottom,
|
396
|
-
onLoadMore: onLoadMore,
|
397
|
-
loadState: loadState,
|
398
|
-
scrollHeight: (_cardViewProps$scroll = cardViewProps.scrollHeight) !== null && _cardViewProps$scroll !== void 0 ? _cardViewProps$scroll : scrollHeight
|
399
|
-
}, renderCardBox()));
|
400
|
-
};
|
401
|
-
var _default = CardView;
|
402
|
-
exports.default = _default;
|