@teamix/pro 1.4.25-bugfix → 1.4.25-bugfix.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro.all.min.css +1 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +78506 -59443
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +13 -6
- package/dist/pro.xconsole.min.css +1 -0
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +2 -9
- package/es/actions/dialog-form.js +37 -75
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.js +57 -95
- package/es/actions/index.d.ts +7 -0
- package/es/actions/index.js +93 -153
- package/es/actions/index.scss +6 -1
- package/es/actions/link.js +3 -5
- package/es/actions/quick.d.ts +2 -0
- package/es/actions/quick.js +26 -0
- package/es/actions/request.js +12 -27
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +0 -5
- package/es/card/divider.js +0 -5
- package/es/card/index.js +61 -100
- package/es/card/index.scss +15 -0
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- package/es/card/xconsole.scss +3 -0
- package/es/form/Components/Editable/index.js +16 -55
- package/es/form/Components/FormGroup/index.d.ts +1 -0
- package/es/form/Components/FormGroup/index.js +7 -22
- package/es/form/Components/LightFilter/index.js +15 -35
- package/es/form/Components/ProField/index.js +2 -14
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.d.ts +1 -0
- package/es/form/Components/Text/index.js +2 -11
- package/es/form/Filter/AdvancedFilter.js +11 -26
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +13 -24
- package/es/form/Filter/SimpleFilter.js +7 -21
- package/es/form/Filter/index.js +117 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/es/form/ProForm/addCascadeEffect.js +203 -0
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +30 -38
- package/es/form/ProForm/useAutoLayout.js +21 -42
- package/es/form/ProForm/useAutoSubmit.js +3 -8
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -28
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +0 -3
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +0 -8
- package/es/form/SchemaForm/adapterType.js +0 -2
- package/es/form/SchemaForm/index.js +78 -114
- package/es/form/SchemaForm/initializeArrayCards.js +0 -6
- package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
- package/es/form/SchemaForm/initializeArrayItems.js +2 -9
- package/es/form/SchemaForm/initializeArrayTable.js +21 -34
- package/es/form/SchemaForm/initializeDataSource.js +2 -6
- package/es/form/SchemaForm/initializeFormButton.js +14 -31
- package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/es/form/SchemaForm/initializeFormGroup.js +10 -20
- package/es/form/SchemaForm/initializeFormStep.js +11 -23
- package/es/form/SchemaForm/initializeFormTab.js +10 -20
- package/es/form/SchemaForm/initializeReactions.js +9 -33
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +7 -33
- package/es/form/SchemaForm/reactions.js +19 -34
- package/es/form/docs/ActionResponse.d.ts +1 -0
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +0 -9
- package/es/form/typing.d.ts +26 -4
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +4 -49
- package/es/form/warning.js +2 -7
- package/es/global.scss +3 -1
- package/es/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +18 -8
- package/es/info/components/InfoGroup/index.js +21 -32
- package/es/info/components/InfoValueItem/index.js +66 -119
- package/es/info/components/ProInfoItem/index.js +13 -21
- package/es/info/components/baseInfo/index.js +17 -27
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +61 -86
- package/es/info/typing.d.ts +2 -0
- package/es/info/utils/index.js +0 -11
- package/es/next-xconsole.scss +34 -0
- package/es/nocode/configurators/ProTable.js +1 -22
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +2 -3
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +5 -30
- package/es/nocode/pages/playground.js +18 -35
- package/es/nocode/pages/renderer.js +9 -42
- package/es/nocode/playground.js +10 -23
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +40 -76
- package/es/page-header/index.scss +2 -1
- package/es/page-header/xconsole.scss +5 -0
- package/es/sidebar/components/sidebar-container/index.js +54 -69
- package/es/sidebar/components/sidebar-container/index.scss +21 -14
- package/es/sidebar/components/tree/index.js +100 -138
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
- package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +42 -84
- package/es/sidebar/components/tree-node/index.scss +6 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +72 -95
- package/es/sidebar/typing.d.ts +4 -0
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.d.ts +5 -2
- package/es/sidebar/utils/index.js +41 -98
- package/es/table/components/CardView/index.d.ts +5 -0
- package/es/table/components/CardView/index.js +392 -0
- package/es/table/components/CardView/index.scss +46 -0
- package/es/table/components/Filter/index.d.ts +6 -3
- package/es/table/components/Filter/index.js +115 -128
- package/es/table/components/Layout/index.js +32 -47
- package/es/table/components/Layout/index.scss +2 -1
- package/es/table/components/LoadMore/index.d.ts +20 -0
- package/es/table/components/LoadMore/index.js +88 -0
- package/es/table/components/LoadMore/index.scss +19 -0
- package/es/table/components/Pagination/index.js +25 -58
- package/es/table/components/QuickAction/index.d.ts +1 -0
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/es/table/components/ToolBar/CardSwitch.js +52 -0
- package/es/table/components/ToolBar/DensityIcon.js +19 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +87 -125
- package/es/table/components/ToolBar/FullScreenIcon.js +7 -62
- package/es/table/components/ToolBar/Fullscreen.js +25 -28
- package/es/table/components/ToolBar/RefreshIcon.js +162 -27
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +130 -38
- package/es/table/components/ToolBar/index.scss +49 -3
- package/es/table/index.js +455 -423
- package/es/table/index.scss +8 -0
- package/es/table/typing.d.ts +125 -6
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +39 -79
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +13 -16
- package/es/table/utils/index.js +14 -47
- package/es/table/utils/pureColumnRender.js +21 -53
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/table/utils/util.d.ts +5 -0
- package/es/table/utils/util.js +19 -0
- package/es/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +25 -65
- package/es/timeline/index.js +8 -22
- package/es/timeline/typing.d.ts +1 -0
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +0 -5
- package/es/xconsole.scss +503 -0
- package/lib/actions/base.js +8 -24
- package/lib/actions/confirm.js +0 -5
- package/lib/actions/danger-confirm.js +0 -5
- package/lib/actions/danger-pop-confirm.js +0 -4
- package/lib/actions/dialog-component.js +2 -15
- package/lib/actions/dialog-form.js +36 -89
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.js +55 -112
- package/lib/actions/drawer-form.js +0 -3
- package/lib/actions/drawer-info.js +0 -3
- package/lib/actions/drawer-table.js +0 -3
- package/lib/actions/drawer.js +0 -4
- package/lib/actions/error.js +0 -5
- package/lib/actions/index.d.ts +7 -0
- package/lib/actions/index.js +115 -184
- package/lib/actions/index.scss +6 -1
- package/lib/actions/link.js +1 -10
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/quick.d.ts +2 -0
- package/lib/actions/quick.js +33 -0
- package/lib/actions/request.js +8 -32
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +0 -9
- package/lib/card/divider.js +0 -7
- package/lib/card/index.js +61 -127
- package/lib/card/index.scss +15 -0
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- package/lib/card/xconsole.scss +3 -0
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +15 -65
- package/lib/form/Components/FormGroup/index.d.ts +1 -0
- package/lib/form/Components/FormGroup/index.js +7 -28
- package/lib/form/Components/LightFilter/index.js +15 -47
- package/lib/form/Components/ProField/index.js +2 -21
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.d.ts +1 -0
- package/lib/form/Components/Text/index.js +2 -16
- package/lib/form/Filter/AdvancedFilter.js +11 -34
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +13 -32
- package/lib/form/Filter/SimpleFilter.js +5 -27
- package/lib/form/Filter/index.js +116 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.d.ts +2 -0
- package/lib/form/ProForm/addCascadeEffect.js +210 -0
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +30 -60
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +1 -10
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -34
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +0 -6
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +0 -5
- package/lib/form/SchemaForm/index.js +78 -144
- package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
- package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
- package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
- package/lib/form/SchemaForm/initializeDataSource.js +2 -8
- package/lib/form/SchemaForm/initializeFormButton.js +14 -32
- package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
- package/lib/form/SchemaForm/initializeFormStep.js +11 -23
- package/lib/form/SchemaForm/initializeFormTab.js +10 -20
- package/lib/form/SchemaForm/initializeReactions.js +9 -37
- package/lib/form/SchemaForm/initializeRequest.js +2 -18
- package/lib/form/SchemaForm/initializeRules.js +4 -24
- package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
- package/lib/form/SchemaForm/reactions.js +17 -37
- package/lib/form/docs/ActionResponse.d.ts +1 -0
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +0 -25
- package/lib/form/typing.d.ts +26 -4
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +4 -61
- package/lib/form/warning.js +2 -8
- package/lib/global.scss +3 -1
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +13 -40
- package/lib/info/components/InfoGroup/index.js +21 -42
- package/lib/info/components/InfoValueItem/index.js +66 -134
- package/lib/info/components/ProInfoItem/index.js +13 -29
- package/lib/info/components/baseInfo/index.js +17 -39
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +61 -101
- package/lib/info/typing.d.ts +2 -0
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/next-xconsole.scss +34 -0
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +1 -24
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +2 -10
- package/lib/nocode/configurators/map.js +0 -5
- package/lib/nocode/index.js +0 -11
- package/lib/nocode/pages/editor.js +5 -19
- package/lib/nocode/pages/index.js +3 -35
- package/lib/nocode/pages/playground.js +18 -52
- package/lib/nocode/pages/renderer.js +9 -53
- package/lib/nocode/playground.js +10 -35
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +39 -90
- package/lib/page-header/index.scss +2 -1
- package/lib/page-header/xconsole.scss +5 -0
- package/lib/sidebar/components/sidebar-container/index.js +54 -81
- package/lib/sidebar/components/sidebar-container/index.scss +21 -14
- package/lib/sidebar/components/tree/index.js +100 -152
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +42 -100
- package/lib/sidebar/components/tree-node/index.scss +6 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +79 -111
- package/lib/sidebar/typing.d.ts +4 -0
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.d.ts +5 -2
- package/lib/sidebar/utils/index.js +41 -106
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/CardView/index.d.ts +5 -0
- package/lib/table/components/CardView/index.js +402 -0
- package/lib/table/components/CardView/index.scss +46 -0
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.d.ts +6 -3
- package/lib/table/components/Filter/index.js +114 -137
- package/lib/table/components/Layout/index.js +32 -60
- package/lib/table/components/Layout/index.scss +2 -1
- package/lib/table/components/LoadMore/index.d.ts +20 -0
- package/lib/table/components/LoadMore/index.js +99 -0
- package/lib/table/components/LoadMore/index.scss +19 -0
- package/lib/table/components/Pagination/index.js +25 -68
- package/lib/table/components/QuickAction/index.d.ts +1 -0
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.d.ts +8 -0
- package/lib/table/components/ToolBar/CardSwitch.js +60 -0
- package/lib/table/components/ToolBar/DensityIcon.js +19 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +86 -136
- package/lib/table/components/ToolBar/FullScreenIcon.js +10 -74
- package/lib/table/components/ToolBar/Fullscreen.js +25 -35
- package/lib/table/components/ToolBar/RefreshIcon.js +164 -36
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +133 -47
- package/lib/table/components/ToolBar/index.scss +49 -3
- package/lib/table/index.js +454 -445
- package/lib/table/index.scss +8 -0
- package/lib/table/typing.d.ts +125 -6
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +39 -92
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +13 -21
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +12 -55
- package/lib/table/utils/pureColumnRender.js +21 -64
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/table/utils/util.d.ts +5 -0
- package/lib/table/utils/util.js +25 -0
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +2 -19
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +25 -76
- package/lib/timeline/index.js +8 -33
- package/lib/timeline/typing.d.ts +1 -0
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +0 -10
- package/lib/xconsole.scss +503 -0
- package/package.json +1 -1
@@ -1,97 +1,79 @@
|
|
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
|
exports.default = void 0;
|
9
|
-
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
11
|
-
|
12
9
|
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
13
|
-
|
14
10
|
var _components = require("@alicloudfe/components");
|
15
|
-
|
16
11
|
var _utils = require("@teamix/utils");
|
17
|
-
|
18
12
|
require("./index.scss");
|
19
|
-
|
13
|
+
var _hooks = require("@teamix/hooks");
|
20
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
-
|
22
15
|
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); }
|
23
|
-
|
24
16
|
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; }
|
25
|
-
|
26
17
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
27
|
-
|
28
18
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
29
|
-
|
30
19
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
31
|
-
|
32
20
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
33
|
-
|
34
21
|
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; }
|
35
|
-
|
36
22
|
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; }
|
37
|
-
|
38
23
|
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; }
|
39
|
-
|
40
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
41
|
-
|
42
25
|
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."); }
|
43
|
-
|
44
26
|
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); }
|
45
|
-
|
46
27
|
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; }
|
47
|
-
|
48
28
|
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; }
|
49
|
-
|
50
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
51
|
-
|
52
30
|
var CheckboxItem = _components.Menu.CheckboxItem;
|
53
31
|
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-toolbar-filter');
|
54
32
|
var RadioItem = _components.Menu.RadioItem;
|
55
|
-
|
56
33
|
var Filter = function Filter(props) {
|
34
|
+
var _urlState$split, _urlState, _urlState$split2;
|
57
35
|
var column = props.column,
|
58
|
-
|
36
|
+
actionRef = props.actionRef,
|
37
|
+
switchCardView = props.switchCardView,
|
38
|
+
bindUrlProps = props.bindUrlProps,
|
39
|
+
bindUrl = props.bindUrl;
|
59
40
|
var _column$filtersWidth = column.filtersWidth,
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
41
|
+
filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth;
|
42
|
+
var _ref = bindUrl ? (0, _hooks.useUrlState)() : [],
|
43
|
+
_ref2 = _slicedToArray(_ref, 2),
|
44
|
+
urlState = _ref2[0],
|
45
|
+
setUrlState = _ref2[1];
|
46
|
+
// 选中过滤项
|
47
|
+
var _useState = (0, _react.useState)((_urlState$split = urlState === null || urlState === void 0 ? void 0 : (_urlState = urlState["filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex)]) === null || _urlState === void 0 ? void 0 : (_urlState$split2 = _urlState.split) === null || _urlState$split2 === void 0 ? void 0 : _urlState$split2.call(_urlState, ',')) !== null && _urlState$split !== void 0 ? _urlState$split : []),
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
49
|
+
selected = _useState2[0],
|
50
|
+
setSelected = _useState2[1];
|
67
51
|
var _useState3 = (0, _react.useState)(false),
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
53
|
+
visible = _useState4[0],
|
54
|
+
setVisible = _useState4[1];
|
72
55
|
(0, _react.useEffect)(function () {
|
73
56
|
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2, _actionRef$current$ge3, _actionRef$current$ge4, _actionRef$current$ge5;
|
74
|
-
|
75
57
|
// 从全局状态中读取上次存储的条件
|
76
58
|
var rules = (_actionRef$current$ge = (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge2 = _actionRef$current.getState) === null || _actionRef$current$ge2 === void 0 ? void 0 : (_actionRef$current$ge3 = _actionRef$current$ge2.call(_actionRef$current)) === null || _actionRef$current$ge3 === void 0 ? void 0 : (_actionRef$current$ge4 = _actionRef$current$ge3.filterRules) === null || _actionRef$current$ge4 === void 0 ? void 0 : (_actionRef$current$ge5 = _actionRef$current$ge4[column.dataIndex]) === null || _actionRef$current$ge5 === void 0 ? void 0 : _actionRef$current$ge5.rules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : [];
|
77
|
-
|
78
|
-
|
79
|
-
|
59
|
+
// 全局状态中需要有值才赋值。优先级:全局状态 > urlState
|
60
|
+
if (rules && rules.length > 0) {
|
61
|
+
setSelected(rules);
|
62
|
+
}
|
63
|
+
}, []);
|
64
|
+
// 获取过滤项
|
80
65
|
var filters = (0, _react.useMemo)(function () {
|
81
66
|
if (Array.isArray(column.filters)) {
|
82
67
|
return column.filters;
|
83
68
|
}
|
84
|
-
|
85
|
-
|
86
|
-
|
69
|
+
var filters = column.dataSource;
|
70
|
+
// 转换 valueEnum 为 options
|
87
71
|
if (!Array.isArray(column.dataSource)) {
|
88
|
-
filters = Object.entries(column.dataSource).map(function (
|
72
|
+
filters = Object.entries(column.dataSource).map(function (_ref3) {
|
89
73
|
var _nv$label, _nv$color;
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
v = _ref2[1];
|
94
|
-
|
74
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
75
|
+
k = _ref4[0],
|
76
|
+
v = _ref4[1];
|
95
77
|
var nv = v;
|
96
78
|
return _objectSpread(_objectSpread({
|
97
79
|
value: k
|
@@ -100,18 +82,82 @@ var Filter = function Filter(props) {
|
|
100
82
|
color: (_nv$color = nv.color) !== null && _nv$color !== void 0 ? _nv$color : k
|
101
83
|
});
|
102
84
|
});
|
103
|
-
}
|
104
|
-
|
105
|
-
|
85
|
+
}
|
86
|
+
// console.log(filters);
|
106
87
|
return filters;
|
107
|
-
}, []);
|
108
|
-
|
88
|
+
}, []);
|
89
|
+
// 点击确定回调
|
90
|
+
var onFilterOk = function onFilterOk() {
|
91
|
+
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$r, _actionRef$current9, _actionRef$current9$c;
|
92
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex);
|
93
|
+
// 先获取此列的param
|
94
|
+
var param = '';
|
95
|
+
if (column.beforeFilter) {
|
96
|
+
var _column$beforeFilter;
|
97
|
+
param = (_column$beforeFilter = column.beforeFilter) === null || _column$beforeFilter === void 0 ? void 0 : _column$beforeFilter.call(column, selected);
|
98
|
+
} else {
|
99
|
+
param = selected.join(',');
|
100
|
+
}
|
101
|
+
// 需要带上其他所有的信息
|
102
|
+
var rules = (_actionRef$current$ge6 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
|
103
|
+
// 再设置所有的列筛选状态
|
104
|
+
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
105
|
+
rules: selected,
|
106
|
+
params: param
|
107
|
+
})));
|
108
|
+
var targetPageKey = 'currentPage';
|
109
|
+
var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
|
110
|
+
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
111
|
+
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
112
|
+
}
|
113
|
+
if (switchCardView === 'card') {
|
114
|
+
var _actionRef$current6, _actionRef$current6$s;
|
115
|
+
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$s = _actionRef$current6.setData) === null || _actionRef$current6$s === void 0 ? void 0 : _actionRef$current6$s.call(_actionRef$current6, []);
|
116
|
+
}
|
117
|
+
// 发送请求
|
118
|
+
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.request) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7, _defineProperty({}, targetPageKey, 1));
|
119
|
+
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$r = _actionRef$current8.resetPage) === null || _actionRef$current8$r === void 0 ? void 0 : _actionRef$current8$r.call(_actionRef$current8);
|
120
|
+
// 清空表格选择
|
121
|
+
(_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$c = _actionRef$current9.clearRowSelection) === null || _actionRef$current9$c === void 0 ? void 0 : _actionRef$current9$c.call(_actionRef$current9);
|
122
|
+
setVisible(false);
|
123
|
+
// 设置 url
|
124
|
+
if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && (urlState === null || urlState === void 0 ? void 0 : urlState["filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex)]) !== selected.join(',')) {
|
125
|
+
setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState(_defineProperty({}, "filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex), selected.join(',')));
|
126
|
+
}
|
127
|
+
};
|
128
|
+
// 重置回调
|
129
|
+
var onFilterReset = function onFilterReset() {
|
130
|
+
var _actionRef$current$ge7, _actionRef$current10, _actionRef$current10$, _actionRef$current10$2, _actionRef$current11, _actionRef$current11$, _actionRef$current12, _actionRef$current12$;
|
131
|
+
setSelected([]);
|
132
|
+
var rules = (_actionRef$current$ge7 = (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.getState) === null || _actionRef$current10$ === void 0 ? void 0 : (_actionRef$current10$2 = _actionRef$current10$.call(_actionRef$current10)) === null || _actionRef$current10$2 === void 0 ? void 0 : _actionRef$current10$2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
|
133
|
+
(_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.setFilterRules) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
134
|
+
rules: [],
|
135
|
+
params: ''
|
136
|
+
})));
|
137
|
+
(_actionRef$current12 = actionRef.current) === null || _actionRef$current12 === void 0 ? void 0 : (_actionRef$current12$ = _actionRef$current12.filterDataSource) === null || _actionRef$current12$ === void 0 ? void 0 : _actionRef$current12$.call(_actionRef$current12, column.dataIndex);
|
138
|
+
if (selected.length > 0) {
|
139
|
+
var _actionRef$current13, _actionRef$current14, _actionRef$current14$, _actionRef$current15, _actionRef$current15$, _actionRef$current16, _actionRef$current16$;
|
140
|
+
var targetPageKey = 'currentPage';
|
141
|
+
var pageInfo = (_actionRef$current13 = actionRef.current) === null || _actionRef$current13 === void 0 ? void 0 : _actionRef$current13.pageInfo;
|
142
|
+
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
143
|
+
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
144
|
+
}
|
145
|
+
// 发送请求
|
146
|
+
(_actionRef$current14 = actionRef.current) === null || _actionRef$current14 === void 0 ? void 0 : (_actionRef$current14$ = _actionRef$current14.request) === null || _actionRef$current14$ === void 0 ? void 0 : _actionRef$current14$.call(_actionRef$current14, _defineProperty({}, targetPageKey, 1));
|
147
|
+
(_actionRef$current15 = actionRef.current) === null || _actionRef$current15 === void 0 ? void 0 : (_actionRef$current15$ = _actionRef$current15.resetPage) === null || _actionRef$current15$ === void 0 ? void 0 : _actionRef$current15$.call(_actionRef$current15);
|
148
|
+
// 清空表格选择
|
149
|
+
(_actionRef$current16 = actionRef.current) === null || _actionRef$current16 === void 0 ? void 0 : (_actionRef$current16$ = _actionRef$current16.clearRowSelection) === null || _actionRef$current16$ === void 0 ? void 0 : _actionRef$current16$.call(_actionRef$current16);
|
150
|
+
if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false) {
|
151
|
+
setUrlState === null || setUrlState === void 0 ? void 0 : setUrlState(_defineProperty({}, "filter".concat(column === null || column === void 0 ? void 0 : column.dataIndex), undefined));
|
152
|
+
}
|
153
|
+
}
|
154
|
+
};
|
155
|
+
// 渲染单选
|
109
156
|
var renderSingle = function renderSingle() {
|
110
|
-
return filters === null || filters === void 0 ? void 0 : filters.map(function (
|
157
|
+
return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref5) {
|
111
158
|
var _value$toString;
|
112
|
-
|
113
|
-
|
114
|
-
value = _ref3.value;
|
159
|
+
var label = _ref5.label,
|
160
|
+
value = _ref5.value;
|
115
161
|
var valueStr = (_value$toString = value === null || value === void 0 ? void 0 : value.toString()) !== null && _value$toString !== void 0 ? _value$toString : '';
|
116
162
|
return /*#__PURE__*/_react.default.createElement(RadioItem, {
|
117
163
|
id: valueStr,
|
@@ -122,15 +168,13 @@ var Filter = function Filter(props) {
|
|
122
168
|
}
|
123
169
|
}, label);
|
124
170
|
});
|
125
|
-
};
|
126
|
-
|
127
|
-
|
171
|
+
};
|
172
|
+
// 渲染多选
|
128
173
|
var renderMultiple = function renderMultiple() {
|
129
|
-
return filters === null || filters === void 0 ? void 0 : filters.map(function (
|
174
|
+
return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref6) {
|
130
175
|
var _value$toString2;
|
131
|
-
|
132
|
-
|
133
|
-
value = _ref4.value;
|
176
|
+
var label = _ref6.label,
|
177
|
+
value = _ref6.value;
|
134
178
|
var valueStr = (_value$toString2 = value === null || value === void 0 ? void 0 : value.toString()) !== null && _value$toString2 !== void 0 ? _value$toString2 : '';
|
135
179
|
return /*#__PURE__*/_react.default.createElement(CheckboxItem, {
|
136
180
|
key: valueStr,
|
@@ -146,17 +190,14 @@ var Filter = function Filter(props) {
|
|
146
190
|
}
|
147
191
|
}, label);
|
148
192
|
});
|
149
|
-
};
|
150
|
-
|
151
|
-
|
193
|
+
};
|
194
|
+
// 渲染选择区域
|
152
195
|
var renderSelect = function renderSelect() {
|
153
196
|
if (column.filterMode === 'multiple') {
|
154
197
|
return renderMultiple();
|
155
198
|
}
|
156
|
-
|
157
199
|
return renderSingle();
|
158
200
|
};
|
159
|
-
|
160
201
|
return /*#__PURE__*/_react.default.createElement(_components.Dropdown, {
|
161
202
|
trigger: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
162
203
|
size: "small",
|
@@ -190,79 +231,15 @@ var Filter = function Filter(props) {
|
|
190
231
|
className: cls({
|
191
232
|
btn: true
|
192
233
|
}),
|
193
|
-
onClick:
|
194
|
-
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$c;
|
195
|
-
|
196
|
-
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
|
197
|
-
|
198
|
-
var param = '';
|
199
|
-
|
200
|
-
if (column.beforeFilter) {
|
201
|
-
var _column$beforeFilter;
|
202
|
-
|
203
|
-
param = (_column$beforeFilter = column.beforeFilter) === null || _column$beforeFilter === void 0 ? void 0 : _column$beforeFilter.call(column, selected);
|
204
|
-
} else {
|
205
|
-
param = selected.join(',');
|
206
|
-
} // 需要带上其他所有的信息
|
207
|
-
|
208
|
-
|
209
|
-
var rules = (_actionRef$current$ge6 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {}; // 再设置所有的列筛选状态
|
210
|
-
|
211
|
-
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
212
|
-
rules: selected,
|
213
|
-
params: param
|
214
|
-
})));
|
215
|
-
var targetPageKey = 'currentPage';
|
216
|
-
var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
|
217
|
-
|
218
|
-
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
219
|
-
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
220
|
-
} // 发送请求
|
221
|
-
|
222
|
-
|
223
|
-
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
|
224
|
-
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
|
225
|
-
|
226
|
-
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
227
|
-
setVisible(false);
|
228
|
-
}
|
234
|
+
onClick: onFilterOk
|
229
235
|
}, (0, _utils.getMessage)('ok')), /*#__PURE__*/_react.default.createElement(_components.Button, {
|
230
236
|
type: "normal",
|
231
237
|
size: "small",
|
232
238
|
className: cls({
|
233
239
|
btn: true
|
234
240
|
}),
|
235
|
-
onClick:
|
236
|
-
var _actionRef$current$ge7, _actionRef$current9, _actionRef$current9$g, _actionRef$current9$g2, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _actionRef$current11$;
|
237
|
-
|
238
|
-
setSelected([]);
|
239
|
-
var rules = (_actionRef$current$ge7 = (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$g = _actionRef$current9.getState) === null || _actionRef$current9$g === void 0 ? void 0 : (_actionRef$current9$g2 = _actionRef$current9$g.call(_actionRef$current9)) === null || _actionRef$current9$g2 === void 0 ? void 0 : _actionRef$current9$g2.filterRules) !== null && _actionRef$current$ge7 !== void 0 ? _actionRef$current$ge7 : {};
|
240
|
-
(_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.setFilterRules) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
|
241
|
-
rules: [],
|
242
|
-
params: ''
|
243
|
-
})));
|
244
|
-
(_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.filterDataSource) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11, column.dataIndex);
|
245
|
-
|
246
|
-
if (selected.length > 0) {
|
247
|
-
var _actionRef$current12, _actionRef$current13, _actionRef$current13$, _actionRef$current14, _actionRef$current14$, _actionRef$current15, _actionRef$current15$;
|
248
|
-
|
249
|
-
var targetPageKey = 'currentPage';
|
250
|
-
var pageInfo = (_actionRef$current12 = actionRef.current) === null || _actionRef$current12 === void 0 ? void 0 : _actionRef$current12.pageInfo;
|
251
|
-
|
252
|
-
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
253
|
-
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
254
|
-
} // 发送请求
|
255
|
-
|
256
|
-
|
257
|
-
(_actionRef$current13 = actionRef.current) === null || _actionRef$current13 === void 0 ? void 0 : (_actionRef$current13$ = _actionRef$current13.request) === null || _actionRef$current13$ === void 0 ? void 0 : _actionRef$current13$.call(_actionRef$current13, _defineProperty({}, targetPageKey, 1));
|
258
|
-
(_actionRef$current14 = actionRef.current) === null || _actionRef$current14 === void 0 ? void 0 : (_actionRef$current14$ = _actionRef$current14.resetPage) === null || _actionRef$current14$ === void 0 ? void 0 : _actionRef$current14$.call(_actionRef$current14); // 清空表格选择
|
259
|
-
|
260
|
-
(_actionRef$current15 = actionRef.current) === null || _actionRef$current15 === void 0 ? void 0 : (_actionRef$current15$ = _actionRef$current15.clearRowSelection) === null || _actionRef$current15$ === void 0 ? void 0 : _actionRef$current15$.call(_actionRef$current15);
|
261
|
-
} // setVisible(!visible);
|
262
|
-
|
263
|
-
}
|
241
|
+
onClick: onFilterReset
|
264
242
|
}, (0, _utils.getMessage)('reset'))))));
|
265
243
|
};
|
266
|
-
|
267
|
-
var _default = Filter;
|
244
|
+
var _default = /*#__PURE__*/(0, _react.memo)(Filter);
|
268
245
|
exports.default = _default;
|
@@ -4,72 +4,51 @@ 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 _utils = require("@teamix/utils");
|
11
|
-
|
12
9
|
var _field = require("../../../field");
|
13
|
-
|
14
10
|
var _actions = require("../../../actions");
|
15
|
-
|
16
11
|
var _form = require("../../../form");
|
17
|
-
|
18
12
|
var _ToolBar = _interopRequireDefault(require("../ToolBar"));
|
19
|
-
|
20
13
|
var _QuickAction = _interopRequireDefault(require("../QuickAction"));
|
21
|
-
|
22
14
|
require("./index.scss");
|
23
|
-
|
24
|
-
var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "afterDataFilter", "rowSelection", "toolBar"];
|
25
|
-
|
15
|
+
var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "afterDataFilter", "rowSelection", "toolBar", "dataTeamixSpm", "bindUrl", "bindUrlProps"];
|
26
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27
|
-
|
28
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); }
|
29
|
-
|
30
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; }
|
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 _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); }
|
39
|
-
|
40
23
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
41
|
-
|
42
24
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
43
|
-
|
44
25
|
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-layout');
|
45
|
-
|
46
26
|
var Layout = function Layout(props) {
|
47
27
|
var header = props.header,
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
28
|
+
mainAction = props.mainAction,
|
29
|
+
extra = props.extra,
|
30
|
+
actionRef = props.actionRef,
|
31
|
+
dataFilter = props.dataFilter,
|
32
|
+
dataFilterFormRef = props.dataFilterFormRef,
|
33
|
+
afterDataFilter = props.afterDataFilter,
|
34
|
+
rowSelection = props.rowSelection,
|
35
|
+
toolBar = props.toolBar,
|
36
|
+
dataTeamixSpm = props.dataTeamixSpm,
|
37
|
+
bindUrl = props.bindUrl,
|
38
|
+
bindUrlProps = props.bindUrlProps,
|
39
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
40
|
+
// 渲染主操作区
|
59
41
|
var renderMainAction = function renderMainAction() {
|
60
42
|
var _mainAction$actions;
|
61
|
-
|
62
43
|
if (_typeof(mainAction) === 'object' && (mainAction === null || mainAction === void 0 ? void 0 : (_mainAction$actions = mainAction.actions) === null || _mainAction$actions === void 0 ? void 0 : _mainAction$actions.length) > 0) {
|
63
44
|
// 判断 actions 是否 visible 都为 false,是的话也不渲染
|
64
45
|
var isEmptyActions = mainAction === null || mainAction === void 0 ? void 0 : mainAction.actions.every(function (action) {
|
65
46
|
return (action === null || action === void 0 ? void 0 : action.visible) === false;
|
66
47
|
});
|
67
|
-
|
68
48
|
if (isEmptyActions) {
|
69
49
|
return;
|
70
|
-
}
|
71
|
-
|
72
|
-
|
50
|
+
}
|
51
|
+
// 默认 context
|
73
52
|
var defaultContext = {
|
74
53
|
action: actionRef.current,
|
75
54
|
rowSelection: rowSelection
|
@@ -77,12 +56,12 @@ var Layout = function Layout(props) {
|
|
77
56
|
return /*#__PURE__*/_react.default.createElement("div", {
|
78
57
|
className: cls('main-action')
|
79
58
|
}, /*#__PURE__*/_react.default.createElement(_actions.ProActionGroup, _objectSpread(_objectSpread({}, mainAction), {}, {
|
80
|
-
context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
|
59
|
+
context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context),
|
60
|
+
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-mainAction") : undefined
|
81
61
|
})));
|
82
62
|
} else return mainAction;
|
83
|
-
};
|
84
|
-
|
85
|
-
|
63
|
+
};
|
64
|
+
// 渲染 addonAfter
|
86
65
|
var renderAddonAfter = function renderAddonAfter() {
|
87
66
|
return /*#__PURE__*/_react.default.createElement("div", {
|
88
67
|
className: cls('addon-after-wrapper')
|
@@ -94,15 +73,12 @@ var Layout = function Layout(props) {
|
|
94
73
|
actionRef: actionRef,
|
95
74
|
toolBar: toolBar
|
96
75
|
}, otherProps)));
|
97
|
-
};
|
98
|
-
|
99
|
-
|
76
|
+
};
|
77
|
+
// 渲染新版 QueryFilter
|
100
78
|
var renderQueryFilter = function renderQueryFilter() {
|
101
79
|
var _dataFilter$schema;
|
102
|
-
|
103
80
|
if (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) {
|
104
81
|
var _dataFilter$schema2;
|
105
|
-
|
106
82
|
if ( /*#__PURE__*/(0, _react.isValidElement)(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content)) {
|
107
83
|
// 自定义渲染内容
|
108
84
|
return /*#__PURE__*/_react.default.createElement(_form.QueryFilterLayout, _objectSpread({
|
@@ -110,11 +86,12 @@ var Layout = function Layout(props) {
|
|
110
86
|
// 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
|
111
87
|
setTimeout(function () {
|
112
88
|
var _actionRef$current, _actionRef$current$re;
|
113
|
-
|
114
89
|
// if (actionRef.current?.getState?.().fullScreenState) {
|
115
90
|
// 偏移量8像素为面板展开后的下margin
|
116
|
-
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.resetTableMaxBodyHeight) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current, expand ? 8 : 0);
|
91
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.resetTableMaxBodyHeight) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current, expand ? 8 : 0);
|
92
|
+
// }
|
117
93
|
});
|
94
|
+
|
118
95
|
(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
|
119
96
|
},
|
120
97
|
panelContent: dataFilter.content,
|
@@ -128,15 +105,17 @@ var Layout = function Layout(props) {
|
|
128
105
|
// 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
|
129
106
|
setTimeout(function () {
|
130
107
|
var _actionRef$current2, _actionRef$current2$r;
|
131
|
-
|
132
108
|
// if (actionRef.current?.getState?.().fullScreenState) {
|
133
109
|
// 偏移量8像素为面板展开后的下margin
|
134
|
-
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2, expand ? 8 : 0);
|
110
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2, expand ? 8 : 0);
|
111
|
+
// }
|
135
112
|
});
|
113
|
+
|
136
114
|
(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
|
137
115
|
},
|
138
116
|
addonBefore: renderMainAction(),
|
139
|
-
addonAfter: renderAddonAfter()
|
117
|
+
addonAfter: renderAddonAfter(),
|
118
|
+
bindUrl: bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.filters) !== false
|
140
119
|
}, dataFilter)), afterDataFilter && /*#__PURE__*/_react.default.createElement("div", {
|
141
120
|
className: "mb8 ".concat(cls('after-data-filter-wrapper'))
|
142
121
|
}, afterDataFilter));
|
@@ -158,9 +137,8 @@ var Layout = function Layout(props) {
|
|
158
137
|
}, afterDataFilter) : null
|
159
138
|
}));
|
160
139
|
}
|
161
|
-
};
|
162
|
-
|
163
|
-
|
140
|
+
};
|
141
|
+
// 区域组合渲染
|
164
142
|
var renderLayout = function renderLayout() {
|
165
143
|
if (header && mainAction) {
|
166
144
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
@@ -176,7 +154,6 @@ var Layout = function Layout(props) {
|
|
176
154
|
}))), renderQueryFilter());
|
177
155
|
} else if (header && !mainAction) {
|
178
156
|
var _dataFilter$schema3, _dataFilter$schema4;
|
179
|
-
|
180
157
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
181
158
|
className: cls('wrapper')
|
182
159
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
@@ -194,20 +171,15 @@ var Layout = function Layout(props) {
|
|
194
171
|
if (!dataFilterFormRef && !extra) {
|
195
172
|
return null;
|
196
173
|
}
|
197
|
-
|
198
174
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderQueryFilter());
|
199
175
|
}
|
200
176
|
};
|
201
|
-
|
202
177
|
if ((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.schema) || mainAction || header || extra || toolBar !== false) {
|
203
178
|
return /*#__PURE__*/_react.default.createElement("div", {
|
204
179
|
className: cls()
|
205
180
|
}, renderLayout());
|
206
181
|
}
|
207
|
-
|
208
182
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
209
183
|
};
|
210
|
-
|
211
184
|
var _default = /*#__PURE__*/_react.default.memo(Layout);
|
212
|
-
|
213
185
|
exports.default = _default;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
$prefix: 'teamix-pro-table-layout';
|
2
2
|
|
3
3
|
.theme-hybridcloud-dark {
|
4
|
-
--panel-filter-bg: #
|
4
|
+
--panel-filter-bg: #141414;
|
5
5
|
}
|
6
6
|
|
7
7
|
.#{$prefix} {
|
@@ -43,5 +43,6 @@ $prefix: 'teamix-pro-table-layout';
|
|
43
43
|
&-addon-after-wrapper {
|
44
44
|
display: flex;
|
45
45
|
align-items: center;
|
46
|
+
margin-bottom: 8px;
|
46
47
|
}
|
47
48
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.scss';
|
3
|
+
export declare type LoadMoreProps = {
|
4
|
+
/** 内容 **/
|
5
|
+
children?: React.ReactNode;
|
6
|
+
/** 加载状态 受控 **/
|
7
|
+
loadState?: 'loading' | 'loadMore' | 'noMore' | 'none';
|
8
|
+
/** 滚动条滚动到底部触发事件 **/
|
9
|
+
onScrollBottom?: () => void;
|
10
|
+
/** 加载状态改变回调 **/
|
11
|
+
onChangeLoadState?: (state: LoadMoreProps['loadState']) => void;
|
12
|
+
/** 点击加载更多回调 **/
|
13
|
+
onLoadMore?: () => void;
|
14
|
+
/** 滚动区域高度 **/
|
15
|
+
scrollHeight?: number | string;
|
16
|
+
/** 当前滚动区域位置 **/
|
17
|
+
scrollPosition?: number;
|
18
|
+
};
|
19
|
+
declare const LoadMore: React.FC<LoadMoreProps>;
|
20
|
+
export default LoadMore;
|