@teamix/pro 1.5.3 → 1.5.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro.css +1 -1
- package/dist/pro.js +20239 -19807
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +2 -6
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +2 -9
- package/es/actions/dialog-form.js +37 -75
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.js +57 -95
- package/es/actions/index.d.ts +2 -0
- package/es/actions/index.js +70 -156
- package/es/actions/link.js +3 -5
- package/es/actions/quick.js +0 -6
- package/es/actions/request.js +12 -27
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +0 -5
- package/es/card/divider.js +0 -5
- package/es/card/index.js +56 -95
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- package/es/form/Components/Editable/index.js +16 -55
- package/es/form/Components/FormGroup/index.d.ts +1 -0
- package/es/form/Components/FormGroup/index.js +7 -22
- package/es/form/Components/LightFilter/index.js +15 -35
- package/es/form/Components/ProField/index.js +2 -14
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.d.ts +1 -0
- package/es/form/Components/Text/index.js +2 -11
- package/es/form/Filter/AdvancedFilter.js +11 -26
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +13 -24
- package/es/form/Filter/SimpleFilter.js +7 -21
- package/es/form/Filter/index.js +106 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.js +10 -32
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +23 -34
- package/es/form/ProForm/useAutoLayout.js +21 -42
- package/es/form/ProForm/useAutoSubmit.js +3 -8
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -28
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +0 -3
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +0 -8
- package/es/form/SchemaForm/adapterType.js +0 -2
- package/es/form/SchemaForm/index.js +78 -114
- package/es/form/SchemaForm/initializeArrayCards.js +0 -6
- package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
- package/es/form/SchemaForm/initializeArrayItems.js +2 -9
- package/es/form/SchemaForm/initializeArrayTable.js +21 -34
- package/es/form/SchemaForm/initializeDataSource.js +2 -6
- package/es/form/SchemaForm/initializeFormButton.js +14 -31
- package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/es/form/SchemaForm/initializeFormGroup.js +10 -20
- package/es/form/SchemaForm/initializeFormStep.js +11 -23
- package/es/form/SchemaForm/initializeFormTab.js +10 -20
- package/es/form/SchemaForm/initializeReactions.js +9 -33
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +7 -33
- package/es/form/SchemaForm/reactions.js +19 -34
- package/es/form/docs/ActionResponse.d.ts +1 -0
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +0 -9
- package/es/form/typing.d.ts +6 -4
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +4 -49
- package/es/form/warning.js +2 -7
- package/es/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +7 -8
- package/es/info/components/InfoGroup/index.js +21 -32
- package/es/info/components/InfoValueItem/index.js +66 -119
- package/es/info/components/ProInfoItem/index.js +13 -21
- package/es/info/components/baseInfo/index.js +14 -26
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +53 -82
- package/es/info/utils/index.js +0 -11
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +2 -3
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +4 -4
- package/es/nocode/pages/playground.js +18 -35
- package/es/nocode/pages/renderer.js +9 -42
- package/es/nocode/playground.js +10 -23
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +39 -75
- package/es/sidebar/components/sidebar-container/index.js +41 -72
- package/es/sidebar/components/tree/index.js +88 -144
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
- package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
- package/es/sidebar/components/tree-node/index.js +41 -83
- package/es/sidebar/index.js +69 -94
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.d.ts +5 -2
- package/es/sidebar/utils/index.js +41 -98
- package/es/table/components/CardView/index.js +62 -149
- package/es/table/components/Filter/index.js +42 -83
- package/es/table/components/Layout/index.js +25 -45
- package/es/table/components/LoadMore/index.js +15 -34
- package/es/table/components/Pagination/index.js +25 -58
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.js +6 -17
- package/es/table/components/ToolBar/DensityIcon.js +18 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +50 -106
- package/es/table/components/ToolBar/FullScreenIcon.js +2 -6
- package/es/table/components/ToolBar/Fullscreen.js +19 -35
- package/es/table/components/ToolBar/RefreshIcon.js +2 -5
- package/es/table/components/ToolBar/index.js +23 -45
- package/es/table/index.js +226 -399
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/table/utils/columnRender.js +32 -76
- package/es/table/utils/genProColumnToColumn.js +5 -14
- package/es/table/utils/index.js +14 -47
- package/es/table/utils/pureColumnRender.js +21 -53
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +24 -64
- package/es/timeline/index.js +8 -22
- package/es/timeline/typing.d.ts +1 -0
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +0 -5
- package/es/utils/useRealHistory.d.ts +8 -0
- package/es/utils/useRealHistory.js +23 -0
- package/lib/actions/base.js +8 -24
- package/lib/actions/confirm.js +0 -5
- package/lib/actions/danger-confirm.js +0 -5
- package/lib/actions/danger-pop-confirm.js +0 -4
- package/lib/actions/dialog-component.js +2 -15
- package/lib/actions/dialog-form.js +36 -88
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.js +55 -111
- package/lib/actions/drawer-form.js +0 -3
- package/lib/actions/drawer-info.js +0 -3
- package/lib/actions/drawer-table.js +0 -3
- package/lib/actions/drawer.js +0 -4
- package/lib/actions/error.js +0 -5
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.js +70 -186
- package/lib/actions/link.js +3 -10
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/quick.js +0 -13
- package/lib/actions/request.js +10 -32
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +0 -9
- package/lib/card/divider.js +0 -7
- package/lib/card/index.js +56 -122
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +15 -65
- package/lib/form/Components/FormGroup/index.d.ts +1 -0
- package/lib/form/Components/FormGroup/index.js +7 -28
- package/lib/form/Components/LightFilter/index.js +15 -47
- package/lib/form/Components/ProField/index.js +2 -21
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.d.ts +1 -0
- package/lib/form/Components/Text/index.js +2 -16
- package/lib/form/Filter/AdvancedFilter.js +11 -34
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +13 -32
- package/lib/form/Filter/SimpleFilter.js +5 -27
- package/lib/form/Filter/index.js +105 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.js +10 -35
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +23 -57
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +3 -10
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -34
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +0 -6
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +0 -5
- package/lib/form/SchemaForm/index.js +78 -144
- package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
- package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
- package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
- package/lib/form/SchemaForm/initializeDataSource.js +2 -8
- package/lib/form/SchemaForm/initializeFormButton.js +14 -32
- package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
- package/lib/form/SchemaForm/initializeFormStep.js +11 -23
- package/lib/form/SchemaForm/initializeFormTab.js +10 -20
- package/lib/form/SchemaForm/initializeReactions.js +9 -37
- package/lib/form/SchemaForm/initializeRequest.js +2 -18
- package/lib/form/SchemaForm/initializeRules.js +4 -24
- package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
- package/lib/form/SchemaForm/reactions.js +17 -37
- package/lib/form/docs/ActionResponse.d.ts +1 -0
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +0 -25
- package/lib/form/typing.d.ts +6 -4
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +4 -61
- package/lib/form/warning.js +2 -8
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -39
- package/lib/info/components/InfoGroup/index.js +21 -42
- package/lib/info/components/InfoValueItem/index.js +66 -134
- package/lib/info/components/ProInfoItem/index.js +13 -29
- package/lib/info/components/baseInfo/index.js +14 -38
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +53 -97
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +0 -2
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +2 -10
- package/lib/nocode/configurators/map.js +0 -5
- package/lib/nocode/index.js +0 -11
- package/lib/nocode/pages/editor.js +5 -19
- package/lib/nocode/pages/index.js +2 -9
- package/lib/nocode/pages/playground.js +18 -52
- package/lib/nocode/pages/renderer.js +9 -53
- package/lib/nocode/playground.js +10 -35
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +38 -88
- package/lib/sidebar/components/sidebar-container/index.js +41 -84
- package/lib/sidebar/components/tree/index.js +88 -158
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
- package/lib/sidebar/components/tree-node/index.js +41 -99
- package/lib/sidebar/index.js +69 -112
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.d.ts +5 -2
- package/lib/sidebar/utils/index.js +41 -106
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/CardView/index.js +62 -161
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.js +42 -93
- package/lib/table/components/Layout/index.js +25 -58
- package/lib/table/components/LoadMore/index.js +15 -44
- package/lib/table/components/Pagination/index.js +25 -68
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.js +6 -28
- package/lib/table/components/ToolBar/DensityIcon.js +18 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +50 -118
- package/lib/table/components/ToolBar/FullScreenIcon.js +3 -13
- package/lib/table/components/ToolBar/Fullscreen.js +19 -42
- package/lib/table/components/ToolBar/RefreshIcon.js +3 -12
- package/lib/table/components/ToolBar/index.js +23 -63
- package/lib/table/index.js +226 -423
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/table/utils/columnRender.js +32 -89
- package/lib/table/utils/genProColumnToColumn.js +5 -19
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +12 -55
- package/lib/table/utils/pureColumnRender.js +21 -64
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +2 -19
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +24 -75
- package/lib/timeline/index.js +8 -33
- package/lib/timeline/typing.d.ts +1 -0
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +0 -10
- package/lib/utils/useRealHistory.d.ts +8 -0
- package/lib/utils/useRealHistory.js +32 -0
- package/package.json +1 -1
@@ -10,4 +10,4 @@ export declare const renderColumnsTitle: (item: ProTableColumnProps, actionRef:
|
|
10
10
|
/**
|
11
11
|
* 负责单元格的具体渲染
|
12
12
|
*/
|
13
|
-
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string
|
13
|
+
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string) => JSX.Element;
|
@@ -1,86 +1,56 @@
|
|
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.renderColumnsTitle = exports.renderCell = void 0;
|
9
|
-
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
11
|
-
|
12
9
|
var _utils = require("@teamix/utils");
|
13
|
-
|
14
10
|
var _actions = require("../../actions");
|
15
|
-
|
16
11
|
var _field = _interopRequireWildcard(require("../../field"));
|
17
|
-
|
18
12
|
var _Filter = _interopRequireDefault(require("../components/Filter"));
|
19
|
-
|
20
13
|
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); }
|
21
|
-
|
22
14
|
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; }
|
23
|
-
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
|
-
|
26
16
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
27
|
-
|
28
17
|
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
18
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
31
|
-
|
32
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
33
|
-
|
34
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
35
|
-
|
36
21
|
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."); }
|
37
|
-
|
38
22
|
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); }
|
39
|
-
|
40
23
|
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; }
|
41
|
-
|
42
24
|
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; }
|
43
|
-
|
44
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
45
|
-
|
46
26
|
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; }
|
47
|
-
|
48
27
|
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; }
|
49
|
-
|
50
28
|
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; }
|
51
|
-
|
52
29
|
/**
|
53
30
|
* 增加了 icon 的功能 render title
|
54
31
|
*/
|
55
32
|
var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
56
33
|
var filterMode = item.filterMode,
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
34
|
+
filters = item.filters,
|
35
|
+
dataSource = item.dataSource,
|
36
|
+
dataIndex = item.dataIndex,
|
37
|
+
valueType = item.valueType;
|
38
|
+
// 为列过滤添加状态标题
|
62
39
|
var getItemLabel = function getItemLabel() {
|
63
40
|
if (filters && filterMode !== 'multiple') {
|
64
41
|
var _actionRef$current$ge, _actionRef$current, _actionRef$current$ge2;
|
65
|
-
|
66
42
|
var selectedItem = (_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$ge2.call(_actionRef$current).filterRules) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
67
|
-
|
68
43
|
if (Object.keys(selectedItem).length > 0) {
|
69
44
|
var _selectedItem$dataInd;
|
70
|
-
|
71
45
|
if ((_selectedItem$dataInd = selectedItem[dataIndex]) === null || _selectedItem$dataInd === void 0 ? void 0 : _selectedItem$dataInd.params) {
|
72
46
|
var _targetFilters$find;
|
73
|
-
|
74
47
|
// 找到对应的 label
|
75
48
|
var targetFilters = filters !== null && filters !== void 0 ? filters : [];
|
76
|
-
|
77
49
|
if (filters === true) {
|
78
50
|
targetFilters = dataSource !== null && dataSource !== void 0 ? dataSource : [];
|
79
51
|
}
|
80
|
-
|
81
52
|
var label = (_targetFilters$find = targetFilters.find(function (item) {
|
82
53
|
var _selectedItem$dataInd2;
|
83
|
-
|
84
54
|
return item.value === ((_selectedItem$dataInd2 = selectedItem[dataIndex]) === null || _selectedItem$dataInd2 === void 0 ? void 0 : _selectedItem$dataInd2.params);
|
85
55
|
})) === null || _targetFilters$find === void 0 ? void 0 : _targetFilters$find.label;
|
86
56
|
var value = "".concat(item.title, " (").concat(label, ")");
|
@@ -98,7 +68,6 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
98
68
|
}
|
99
69
|
}
|
100
70
|
}
|
101
|
-
|
102
71
|
return /*#__PURE__*/_react.default.createElement(_field.default, {
|
103
72
|
style: {
|
104
73
|
display: 'inline-flex'
|
@@ -111,7 +80,6 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
111
80
|
}
|
112
81
|
});
|
113
82
|
};
|
114
|
-
|
115
83
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_field.LabelIconTip, {
|
116
84
|
label: item.title,
|
117
85
|
tooltip: item.tooltip,
|
@@ -124,28 +92,23 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
124
92
|
/**
|
125
93
|
* 负责单元格的具体渲染
|
126
94
|
*/
|
127
|
-
|
128
|
-
|
129
95
|
exports.renderColumnsTitle = renderColumnsTitle;
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
context, // 用于埋点
|
96
|
+
var renderCell = function renderCell(value, item, index, record, actionRef, /** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
97
|
+
context,
|
98
|
+
// 用于埋点
|
134
99
|
dataTeamixSpm) {
|
135
100
|
var _actionSchema$actions;
|
136
|
-
|
137
101
|
var _item$valueType = item.valueType,
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
102
|
+
valueType = _item$valueType === void 0 ? 'text' : _item$valueType,
|
103
|
+
render = item.render,
|
104
|
+
actionSchema = item.actionSchema,
|
105
|
+
dataIndex = item.dataIndex,
|
106
|
+
format = item.format;
|
107
|
+
// 如果没传 dataIndex,返回 null
|
144
108
|
if (!dataIndex) {
|
145
109
|
value = null;
|
146
|
-
}
|
147
|
-
|
148
|
-
|
110
|
+
}
|
111
|
+
// 处理 dataIndex 为数组的情况
|
149
112
|
if (Array.isArray(dataIndex)) {
|
150
113
|
value = dataIndex.map(function (item) {
|
151
114
|
return (0, _utils.getTargetValue)("{{".concat(item, "}}"), _objectSpread(_objectSpread({}, record), {}, {
|
@@ -153,18 +116,16 @@ dataTeamixSpm) {
|
|
153
116
|
}));
|
154
117
|
});
|
155
118
|
}
|
156
|
-
|
157
119
|
var newRender = null;
|
158
120
|
var newDataSource = null;
|
159
|
-
var props = item.props;
|
160
|
-
|
121
|
+
var props = item.props;
|
122
|
+
// 如果 render 直接传函数
|
161
123
|
if (typeof render === 'function') {
|
162
124
|
newRender = function newRender() {
|
163
125
|
return render === null || render === void 0 ? void 0 : render(value, index, record);
|
164
126
|
};
|
165
127
|
} else {
|
166
128
|
newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
|
167
|
-
|
168
129
|
if (valueType === 'selectGroup') {
|
169
130
|
newRender = _objectSpread(_objectSpread({
|
170
131
|
maxShowNumber: 'auto',
|
@@ -181,15 +142,13 @@ dataTeamixSpm) {
|
|
181
142
|
}
|
182
143
|
}, props);
|
183
144
|
}
|
184
|
-
|
185
145
|
if ((render === null || render === void 0 ? void 0 : render.type) === 'step') {
|
186
146
|
newRender = _objectSpread(_objectSpread({}, newRender), {}, {
|
187
147
|
ellipsis: false
|
188
148
|
});
|
189
149
|
}
|
190
|
-
}
|
191
|
-
|
192
|
-
|
150
|
+
}
|
151
|
+
// 渲染操作组
|
193
152
|
if (actionSchema && ((_actionSchema$actions = actionSchema.actions) === null || _actionSchema$actions === void 0 ? void 0 : _actionSchema$actions.length)) {
|
194
153
|
// 默认 context
|
195
154
|
var defaultContext = _objectSpread({
|
@@ -198,29 +157,24 @@ dataTeamixSpm) {
|
|
198
157
|
record: record,
|
199
158
|
action: actionRef.current
|
200
159
|
}, context);
|
201
|
-
|
202
160
|
return /*#__PURE__*/_react.default.createElement(_actions.ProActionGroup, _objectSpread(_objectSpread({
|
203
161
|
type: "text"
|
204
162
|
}, actionSchema), {}, {
|
205
163
|
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context),
|
206
164
|
"data-teamix-spm": dataTeamixSpm ? "".concat(dataTeamixSpm, "-columnAction") : undefined
|
207
165
|
}));
|
208
|
-
}
|
209
|
-
|
210
|
-
|
166
|
+
}
|
167
|
+
// dataSource可传函数
|
211
168
|
if (typeof item.dataSource === 'function') {
|
212
169
|
var _item$dataSource;
|
213
|
-
|
214
170
|
newDataSource = (_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.call(item, value, index, record);
|
215
171
|
} else {
|
216
172
|
var _item$dataSource2;
|
217
|
-
|
218
173
|
newDataSource = ((_item$dataSource2 = item.dataSource) !== null && _item$dataSource2 !== void 0 ? _item$dataSource2 : []).map(function (item) {
|
219
174
|
return Object.fromEntries(Object.entries(item).map(function (_ref) {
|
220
175
|
var _ref2 = _slicedToArray(_ref, 2),
|
221
|
-
|
222
|
-
|
223
|
-
|
176
|
+
k = _ref2[0],
|
177
|
+
v = _ref2[1];
|
224
178
|
return [k, (0, _utils.getTargetValue)(v, _objectSpread(_objectSpread({}, record), {}, {
|
225
179
|
record: record,
|
226
180
|
value: value,
|
@@ -228,9 +182,8 @@ dataTeamixSpm) {
|
|
228
182
|
}))];
|
229
183
|
}));
|
230
184
|
});
|
231
|
-
}
|
232
|
-
|
233
|
-
|
185
|
+
}
|
186
|
+
// 渲染 ProField
|
234
187
|
return /*#__PURE__*/_react.default.createElement(_field.default, _objectSpread({
|
235
188
|
type: valueType || 'text',
|
236
189
|
value: value,
|
@@ -247,10 +200,7 @@ dataTeamixSpm) {
|
|
247
200
|
* @param record table cell record
|
248
201
|
* @returns
|
249
202
|
*/
|
250
|
-
|
251
|
-
|
252
203
|
exports.renderCell = renderCell;
|
253
|
-
|
254
204
|
var processRenderFunction = function processRenderFunction() {
|
255
205
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
256
206
|
var value = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -260,25 +210,20 @@ var processRenderFunction = function processRenderFunction() {
|
|
260
210
|
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
261
211
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
262
212
|
var _ref4 = _slicedToArray(_ref3, 2),
|
263
|
-
|
264
|
-
|
265
|
-
|
213
|
+
k = _ref4[0],
|
214
|
+
v = _ref4[1];
|
266
215
|
if (typeof v === 'function') {
|
267
216
|
var _v;
|
268
|
-
|
269
217
|
if (external.includes(k)) {
|
270
218
|
return [k, function () {
|
271
219
|
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
272
220
|
others[_key] = arguments[_key];
|
273
221
|
}
|
274
|
-
|
275
222
|
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, index, record].concat(others));
|
276
223
|
}];
|
277
224
|
}
|
278
|
-
|
279
225
|
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, index, record)) !== null && _v !== void 0 ? _v : ''];
|
280
226
|
}
|
281
|
-
|
282
227
|
return [k, v];
|
283
228
|
}));
|
284
229
|
};
|
@@ -288,20 +233,18 @@ var processRenderFunction = function processRenderFunction() {
|
|
288
233
|
* @param record table cell record
|
289
234
|
* @returns
|
290
235
|
*/
|
291
|
-
|
292
|
-
|
293
236
|
var processBuriedPoint = function processBuriedPoint() {
|
294
237
|
var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
295
238
|
var record = arguments.length > 1 ? arguments[1] : undefined;
|
296
239
|
var value = arguments.length > 2 ? arguments[2] : undefined;
|
297
240
|
var index = arguments.length > 3 ? arguments[3] : undefined;
|
298
|
-
return Object.fromEntries([
|
241
|
+
return Object.fromEntries([
|
242
|
+
// 默认 ellipsis、descriptionEllipsis 为 true
|
299
243
|
// emptyText 默认为 '-'
|
300
244
|
['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
|
301
245
|
var _ref6 = _slicedToArray(_ref5, 2),
|
302
|
-
|
303
|
-
|
304
|
-
|
246
|
+
k = _ref6[0],
|
247
|
+
v = _ref6[1];
|
305
248
|
return [k, (0, _utils.getTargetValue)(v, _objectSpread(_objectSpread({}, record), {}, {
|
306
249
|
record: record,
|
307
250
|
value: value,
|
@@ -4,43 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = genProColumnToColumn;
|
7
|
-
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
8
|
var _columnRender = require("./columnRender");
|
11
|
-
|
12
9
|
var _skeleton = require("../../skeleton");
|
13
|
-
|
14
10
|
var _utils = require("@teamix/utils");
|
15
|
-
|
16
11
|
var _excluded = ["filters", "dataIndex"];
|
17
|
-
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
13
|
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
|
-
|
22
14
|
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; }
|
23
|
-
|
24
15
|
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; }
|
25
|
-
|
26
16
|
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; }
|
27
|
-
|
28
17
|
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; }
|
29
|
-
|
30
18
|
/**
|
31
19
|
* ProColumn => Column
|
32
20
|
*/
|
33
|
-
function genProColumnToColumn(columns,
|
34
|
-
/** 是否渲染骨架屏 */
|
21
|
+
function genProColumnToColumn(columns, /** 是否渲染骨架屏 */
|
35
22
|
showSkeleton, actionRef) {
|
36
23
|
var context = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
37
|
-
var
|
24
|
+
var
|
25
|
+
// 用于埋点
|
38
26
|
dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
|
39
27
|
return columns.map(function (columnProps) {
|
40
28
|
var filters = columnProps.filters,
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
dataIndex = columnProps.dataIndex,
|
30
|
+
others = _objectWithoutProperties(columnProps, _excluded);
|
44
31
|
if (showSkeleton) {
|
45
32
|
return _objectSpread(_objectSpread({}, others), {}, {
|
46
33
|
filters: undefined,
|
@@ -52,7 +39,6 @@ showSkeleton, actionRef) {
|
|
52
39
|
}
|
53
40
|
});
|
54
41
|
}
|
55
|
-
|
56
42
|
return _objectSpread(_objectSpread({
|
57
43
|
// 金钱样式默认右对齐
|
58
44
|
align: columnProps.valueType === 'money' ? 'right' : 'left',
|
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
// 返回 Table 属性列表
|
9
8
|
var _default = function _default() {
|
10
9
|
return ['stickyHeader', 'offsetTop', 'affixProps', 'components', 'useVirtual', 'rowHeight', 'maxBodyHeight', 'primaryKey', 'dataSource', 'onBodyScroll', 'openRowKeys', 'defaultOpenRowKeys', 'onRowOpen', 'indent', 'isTree', 'locale', 'expandedRowRender', 'rowExpandable', 'expandedRowIndent', 'hasExpandedRowCtrl', 'getExpandedColProps', 'onExpandedRowClick', 'rowSelection', 'entireDataSource', 'scrollToCol', 'scrollToRow', 'hasHeader', 'fixedHeader', 'prefix', 'defaultPropsConfig', 'errorBoundary', 'pure', 'warning', 'rtl', 'device', 'children', 'popupContainer', 'tableLayout', 'tableWidth', 'style', 'size', 'onRowClick', 'onRowMouseEnter', 'onRowMouseLeave', 'onSort', 'onFilter', 'onResizeChange', 'rowProps', 'cellProps', 'hasBorder', 'isZebra', 'loading', 'loadingComponent', 'filterParams', 'sort', 'sortIcons', 'columns', 'emptyContent', 'lockType', 'wrapperContent', 'refs', 'expandedIndexSimulate', 'crossline', 'lengths'];
|
11
10
|
};
|
12
|
-
|
13
11
|
exports.default = _default;
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
8
|
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
11
|
-
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
-
|
14
10
|
/** 返回自定义 sortIcons */
|
15
11
|
var _default = function _default() {
|
16
12
|
return {
|
@@ -30,5 +26,4 @@ var _default = function _default() {
|
|
30
26
|
})
|
31
27
|
};
|
32
28
|
};
|
33
|
-
|
34
29
|
exports.default = _default;
|
package/lib/table/utils/index.js
CHANGED
@@ -11,43 +11,28 @@ exports.off = off;
|
|
11
11
|
exports.on = on;
|
12
12
|
exports.processDefaultFilter = processDefaultFilter;
|
13
13
|
exports.useActionType = useActionType;
|
14
|
-
|
15
14
|
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
|
16
|
-
|
17
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
|
-
|
19
16
|
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; }
|
20
|
-
|
21
17
|
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
|
-
|
23
18
|
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; }
|
24
|
-
|
25
19
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
26
|
-
|
27
20
|
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."); }
|
28
|
-
|
29
21
|
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); }
|
30
|
-
|
31
22
|
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; }
|
32
|
-
|
33
23
|
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; }
|
34
|
-
|
35
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
36
|
-
|
37
25
|
// 所有 ProTable 组件公用一套组件内事件转发机制
|
38
|
-
var tableCallback = {};
|
39
|
-
|
26
|
+
var tableCallback = {};
|
27
|
+
// 组件内对全局状态的更改
|
40
28
|
var getMutations = function getMutations(actionRef) {
|
41
29
|
var _actionRef$current2, _actionRef$current2$g, _actionRef$current2$g2;
|
42
|
-
|
43
30
|
return {
|
44
31
|
setFullScreenState: function setFullScreenState(fullScreenState) {
|
45
32
|
var _actionRef$current, _actionRef$current$se;
|
46
|
-
|
47
33
|
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setState) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, 'fullScreenState', fullScreenState);
|
48
34
|
},
|
49
35
|
filterColumns: (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$g = _actionRef$current2.getState) === null || _actionRef$current2$g === void 0 ? void 0 : (_actionRef$current2$g2 = _actionRef$current2$g.call(_actionRef$current2)) === null || _actionRef$current2$g2 === void 0 ? void 0 : _actionRef$current2$g2.filterColumns,
|
50
|
-
|
51
36
|
/**
|
52
37
|
* 设置筛选列规则
|
53
38
|
* @param rules 规则
|
@@ -55,49 +40,40 @@ var getMutations = function getMutations(actionRef) {
|
|
55
40
|
*/
|
56
41
|
setFilterRules: function setFilterRules(rules) {
|
57
42
|
var _actionRef$current3, _actionRef$current3$s;
|
58
|
-
|
59
43
|
(_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$s = _actionRef$current3.setState) === null || _actionRef$current3$s === void 0 ? void 0 : _actionRef$current3$s.call(_actionRef$current3, 'filterRules', rules);
|
60
44
|
},
|
61
|
-
|
62
45
|
/**
|
63
46
|
* 获取筛选规则。为params
|
64
47
|
*/
|
65
48
|
getFilterRules: function getFilterRules() {
|
66
49
|
var _actionRef$current4, _actionRef$current4$g;
|
67
|
-
|
68
50
|
var result = {};
|
69
51
|
var filterRules = (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$g = _actionRef$current4.getState) === null || _actionRef$current4$g === void 0 ? void 0 : _actionRef$current4$g.call(_actionRef$current4).filterRules;
|
70
|
-
|
71
52
|
if (filterRules) {
|
72
53
|
result = Object.entries(filterRules).map(function (_ref) {
|
73
54
|
var _ref2 = _slicedToArray(_ref, 2),
|
74
|
-
|
75
|
-
|
76
|
-
|
55
|
+
k = _ref2[0],
|
56
|
+
v = _ref2[1];
|
77
57
|
return _defineProperty({}, k, v.params);
|
78
58
|
}).reduce(function (acc, cur) {
|
79
59
|
acc = _objectSpread(_objectSpread({}, acc), cur);
|
80
60
|
return acc;
|
81
61
|
}, {});
|
82
62
|
}
|
83
|
-
|
84
63
|
return result;
|
85
64
|
}
|
86
65
|
};
|
87
|
-
};
|
88
|
-
|
89
|
-
|
66
|
+
};
|
67
|
+
// 调用绑定的监听函数
|
90
68
|
function actionRefUseStateOn(callback, state) {
|
91
69
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
92
70
|
args[_key - 2] = arguments[_key];
|
93
71
|
}
|
94
|
-
|
95
72
|
if (callback[state]) {
|
96
73
|
Object.entries(callback[state]).forEach(function (_ref4) {
|
97
74
|
var _ref5 = _slicedToArray(_ref4, 2),
|
98
|
-
|
99
|
-
|
100
|
-
|
75
|
+
k = _ref5[0],
|
76
|
+
v = _ref5[1];
|
101
77
|
if (v) {
|
102
78
|
v === null || v === void 0 ? void 0 : v.apply(void 0, args);
|
103
79
|
}
|
@@ -105,44 +81,32 @@ function actionRefUseStateOn(callback, state) {
|
|
105
81
|
}
|
106
82
|
}
|
107
83
|
/** table 组件内监听 不对外暴露 */
|
108
|
-
|
109
|
-
|
110
84
|
function on(fun, key) {
|
111
85
|
tableCallback[key] = fun;
|
112
86
|
}
|
113
87
|
/** table 组件内销毁监听 不对外暴露 */
|
114
|
-
|
115
|
-
|
116
88
|
function off(key) {
|
117
89
|
if (tableCallback[key]) {
|
118
90
|
delete tableCallback[key];
|
119
91
|
}
|
120
92
|
}
|
121
93
|
/** table 组件内触发事件 不对外暴露 */
|
122
|
-
|
123
|
-
|
124
94
|
function emit(key) {
|
125
95
|
var fun = tableCallback[key];
|
126
|
-
|
127
96
|
if (fun) {
|
128
97
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
129
98
|
args[_key2 - 1] = arguments[_key2];
|
130
99
|
}
|
131
|
-
|
132
100
|
fun.apply(void 0, args);
|
133
101
|
}
|
134
102
|
}
|
135
|
-
|
136
103
|
function initActionRef(ref, action) {
|
137
104
|
var userAction = _objectSpread(_objectSpread({}, action), getMutations(ref));
|
138
|
-
|
139
105
|
ref.current = userAction;
|
140
106
|
}
|
141
|
-
|
142
107
|
function useActionType(ref, action) {
|
143
108
|
ref.current = _objectSpread(_objectSpread({}, ref.current), action);
|
144
109
|
}
|
145
|
-
|
146
110
|
function cloneDeep(obj) {
|
147
111
|
return (0, _lodash.default)(obj);
|
148
112
|
}
|
@@ -151,31 +115,24 @@ function cloneDeep(obj) {
|
|
151
115
|
* @param columns
|
152
116
|
* @param ref
|
153
117
|
*/
|
154
|
-
|
155
|
-
|
156
118
|
function processDefaultFilter(columns, ref, defaultFilterParams) {
|
157
119
|
columns.forEach(function (column) {
|
158
120
|
var _column$dataIndex$toS, _column$dataIndex;
|
159
|
-
|
160
121
|
var defaultRules = defaultFilterParams === null || defaultFilterParams === void 0 ? void 0 : defaultFilterParams[(_column$dataIndex$toS = column === null || column === void 0 ? void 0 : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.toString()) !== null && _column$dataIndex$toS !== void 0 ? _column$dataIndex$toS : ''];
|
161
|
-
|
162
122
|
if (defaultRules) {
|
163
123
|
var _ref$current$getState, _ref$current, _ref$current$getState2, _ref$current$getState3, _ref$current2, _ref$current2$setFilt;
|
164
|
-
|
165
124
|
var params = '';
|
166
125
|
var rules = [];
|
167
|
-
|
168
126
|
if (Array.isArray(defaultRules)) {
|
169
127
|
params = defaultRules.join(',');
|
170
128
|
rules = defaultRules;
|
171
129
|
} else {
|
172
130
|
params = defaultRules;
|
173
131
|
rules = [defaultRules];
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
132
|
+
}
|
133
|
+
// 需要带上其他所有的信息
|
134
|
+
var otherRules = (_ref$current$getState = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$getState2 = _ref$current.getState) === null || _ref$current$getState2 === void 0 ? void 0 : (_ref$current$getState3 = _ref$current$getState2.call(_ref$current)) === null || _ref$current$getState3 === void 0 ? void 0 : _ref$current$getState3.filterRules) !== null && _ref$current$getState !== void 0 ? _ref$current$getState : {};
|
135
|
+
// 再设置所有的列筛选状态
|
179
136
|
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$setFilt = _ref$current2.setFilterRules) === null || _ref$current2$setFilt === void 0 ? void 0 : _ref$current2$setFilt.call(_ref$current2, _objectSpread(_objectSpread({}, otherRules), {}, _defineProperty({}, column.dataIndex, {
|
180
137
|
rules: rules,
|
181
138
|
params: params
|