@teamix/pro 1.5.34 → 1.5.36
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 -1
- package/dist/pro.css +1 -1
- package/dist/pro.js +23694 -21714
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.xconsole.min.css +1 -1
- package/es/form/Filter/AdvancedFilter.js +39 -18
- package/es/form/typing.d.ts +12 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/table/components/Cell/index.d.ts +1 -0
- package/es/table/components/Cell/index.js +5 -4
- package/es/table/components/Filter/index.js +0 -1
- package/es/table/components/ToolBar/FilterColumnIcon.js +14 -6
- package/es/table/index.js +17 -9
- package/es/table/index.scss +10 -1
- package/es/table/typing.d.ts +2 -0
- package/es/table/utils/useTableSelection.js +3 -0
- package/lib/form/Filter/AdvancedFilter.js +39 -18
- package/lib/form/typing.d.ts +12 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/Cell/index.d.ts +1 -0
- package/lib/table/components/Cell/index.js +5 -4
- package/lib/table/components/Filter/index.js +0 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +14 -6
- package/lib/table/index.js +17 -9
- package/lib/table/index.scss +10 -1
- package/lib/table/typing.d.ts +2 -0
- package/lib/table/utils/useTableSelection.js +3 -0
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
|
1
|
+
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear", "submitProps", "resetProps", "buttonGroup"];
|
2
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
3
3
|
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."); }
|
4
4
|
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); }
|
@@ -29,9 +29,46 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
29
29
|
breakpoints = props.breakpoints,
|
30
30
|
gridProps = props.gridProps,
|
31
31
|
forceClear = props.forceClear,
|
32
|
+
_props$submitProps = props.submitProps,
|
33
|
+
submitProps = _props$submitProps === void 0 ? {} : _props$submitProps,
|
34
|
+
_props$resetProps = props.resetProps,
|
35
|
+
resetProps = _props$resetProps === void 0 ? {} : _props$resetProps,
|
36
|
+
buttonGroup = props.buttonGroup,
|
32
37
|
otherProps = _objectWithoutProperties(props, _excluded);
|
33
38
|
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-advanced');
|
34
39
|
var gridSchema = useMemo(function () {
|
40
|
+
var resetSchema = _objectSpread(_objectSpread({
|
41
|
+
name: 'AdvancedFilterReset',
|
42
|
+
component: 'Reset'
|
43
|
+
}, resetProps), {}, {
|
44
|
+
props: _objectSpread({
|
45
|
+
onResetValidateSuccess: onReset,
|
46
|
+
forceClear: !!forceClear,
|
47
|
+
children: getMessage('reset')
|
48
|
+
}, resetProps === null || resetProps === void 0 ? void 0 : resetProps.props)
|
49
|
+
});
|
50
|
+
var submitSchema = _objectSpread(_objectSpread({
|
51
|
+
component: 'Submit'
|
52
|
+
}, submitProps), {}, {
|
53
|
+
props: _objectSpread({
|
54
|
+
style: {
|
55
|
+
marginRight: -4
|
56
|
+
},
|
57
|
+
children: getMessage('search')
|
58
|
+
}, submitProps === null || submitProps === void 0 ? void 0 : submitProps.props)
|
59
|
+
});
|
60
|
+
var buttonGroupSchema = [resetSchema, submitSchema];
|
61
|
+
if (buttonGroup) {
|
62
|
+
buttonGroupSchema = buttonGroup.map(function (item) {
|
63
|
+
if (item === 'Submit') {
|
64
|
+
return submitSchema;
|
65
|
+
}
|
66
|
+
if (item === 'Reset') {
|
67
|
+
return resetSchema;
|
68
|
+
}
|
69
|
+
return item;
|
70
|
+
});
|
71
|
+
}
|
35
72
|
return [{
|
36
73
|
name: 'AdvancedFilterFormGrid',
|
37
74
|
component: 'FormGrid',
|
@@ -52,23 +89,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
52
89
|
props: {
|
53
90
|
align: 'right'
|
54
91
|
},
|
55
|
-
children:
|
56
|
-
name: 'AdvancedFilterReset',
|
57
|
-
component: 'Reset',
|
58
|
-
props: {
|
59
|
-
onResetValidateSuccess: onReset,
|
60
|
-
forceClear: !!forceClear,
|
61
|
-
children: getMessage('reset')
|
62
|
-
}
|
63
|
-
}, {
|
64
|
-
component: 'Submit',
|
65
|
-
props: {
|
66
|
-
style: {
|
67
|
-
marginRight: -4
|
68
|
-
},
|
69
|
-
children: getMessage('search')
|
70
|
-
}
|
71
|
-
}]
|
92
|
+
children: _toConsumableArray(buttonGroupSchema)
|
72
93
|
}]
|
73
94
|
}])
|
74
95
|
}];
|
package/es/form/typing.d.ts
CHANGED
@@ -115,6 +115,12 @@ export interface FilterProps extends ProFormProps {
|
|
115
115
|
activeFilterValueRef?: React.MutableRefObject<any>;
|
116
116
|
forceClear?: boolean;
|
117
117
|
onReset?: (payload?: any) => void;
|
118
|
+
/** 搜索按钮配置 */
|
119
|
+
submitProps?: ProFormSchemaItem;
|
120
|
+
/** 重置按钮配置 */
|
121
|
+
resetProps?: ProFormSchemaItem;
|
122
|
+
/** 操作区按钮组配置 */
|
123
|
+
buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
|
118
124
|
}
|
119
125
|
export interface QueryFilterLayoutProps {
|
120
126
|
prefixCls?: string;
|
@@ -164,6 +170,12 @@ export interface QueryFilterProps extends ProFormProps {
|
|
164
170
|
onReset?: (payload?: any) => void;
|
165
171
|
/** 高级筛选按钮切换 */
|
166
172
|
onExpand?: (expand: boolean) => void;
|
173
|
+
/** 搜索按钮配置 */
|
174
|
+
submitProps?: ProFormSchemaItem;
|
175
|
+
/** 重置按钮配置 */
|
176
|
+
resetProps?: ProFormSchemaItem;
|
177
|
+
/** 操作区按钮组配置 */
|
178
|
+
buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
|
167
179
|
}
|
168
180
|
/**
|
169
181
|
* 兼容性导出
|
package/es/index.d.ts
CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
|
|
30
30
|
export * from './utils';
|
31
31
|
export * from './timeline';
|
32
32
|
export * from './image';
|
33
|
-
declare const version = "1.5.
|
33
|
+
declare const version = "1.5.36";
|
34
34
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -12,6 +12,7 @@ interface ICellProps {
|
|
12
12
|
/** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
13
13
|
context?: any;
|
14
14
|
dataTeamixSpm?: string;
|
15
|
+
forcedUpdate?: boolean;
|
15
16
|
}
|
16
17
|
declare const _default: React.MemoExoticComponent<(props: ICellProps) => JSX.Element>;
|
17
18
|
export default _default;
|
@@ -190,13 +190,14 @@ var processBuriedPoint = function processBuriedPoint() {
|
|
190
190
|
};
|
191
191
|
var equalColumns = function equalColumns(prevProps, nextProps) {
|
192
192
|
var preValue = prevProps.value;
|
193
|
-
var nextValue = nextProps.value
|
193
|
+
var nextValue = nextProps.value,
|
194
|
+
item = nextProps.item;
|
194
195
|
// columns 强制更新参数
|
195
|
-
if (
|
196
|
+
if (item === null || item === void 0 ? void 0 : item.forcedUpdate) {
|
196
197
|
return false;
|
197
198
|
}
|
198
|
-
// 操作列的时候强制刷新
|
199
|
-
if (preValue === false && nextValue === false) {
|
199
|
+
// 操作列的时候强制刷新 || 当 value 值拿不到的时候
|
200
|
+
if (preValue === false && nextValue === false || nextValue === undefined) {
|
200
201
|
return false;
|
201
202
|
}
|
202
203
|
if (preValue === nextValue) {
|
@@ -27,7 +27,11 @@ var Row = Grid.Row,
|
|
27
27
|
var cls = usePrefixCls('teamix-pro-table-toolbar-filter-column');
|
28
28
|
var processColumns = function processColumns(columns) {
|
29
29
|
var _getGlobalConfig;
|
30
|
+
var filterColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
30
31
|
var globalFilterColumns = (_getGlobalConfig = getGlobalConfig('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
|
32
|
+
var filterColumnsKey = filterColumns.map(function (item) {
|
33
|
+
return item === null || item === void 0 ? void 0 : item.dataIndex;
|
34
|
+
});
|
31
35
|
// hidden 为 true 时不展示
|
32
36
|
columns = columns.filter(function (item) {
|
33
37
|
return (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
|
@@ -37,11 +41,14 @@ var processColumns = function processColumns(columns) {
|
|
37
41
|
return item;
|
38
42
|
}
|
39
43
|
return _objectSpread(_objectSpread({}, item), {}, {
|
40
|
-
columnFilters:
|
44
|
+
columnFilters: filterColumnsKey.findIndex(function (key) {
|
45
|
+
return item.dataIndex === key;
|
46
|
+
}) >= 0 ? true : false
|
41
47
|
});
|
42
48
|
});
|
43
49
|
};
|
44
50
|
var FilterColumnIcon = function FilterColumnIcon(props) {
|
51
|
+
var _actionRef$current, _actionRef$current3;
|
45
52
|
var _props$columns = props.columns,
|
46
53
|
columns = _props$columns === void 0 ? [] : _props$columns,
|
47
54
|
actionRef = props.actionRef,
|
@@ -54,7 +61,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
54
61
|
_useState4 = _slicedToArray(_useState3, 2),
|
55
62
|
indeterminate = _useState4[0],
|
56
63
|
setIndeterminate = _useState4[1];
|
57
|
-
var _useState5 = useState(processColumns(columns)),
|
64
|
+
var _useState5 = useState(processColumns(columns, (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.filterColumns)),
|
58
65
|
_useState6 = _slicedToArray(_useState5, 2),
|
59
66
|
newColumns = _useState6[0],
|
60
67
|
setNewColumns = _useState6[1];
|
@@ -100,8 +107,9 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
100
107
|
};
|
101
108
|
});
|
102
109
|
useEffect(function () {
|
103
|
-
|
104
|
-
|
110
|
+
var _actionRef$current2;
|
111
|
+
setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
|
112
|
+
}, [columns, (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.filterColumns]);
|
105
113
|
// 全选
|
106
114
|
var onChangeAllColumns = function onChangeAllColumns(check) {
|
107
115
|
setAllVisible(check);
|
@@ -193,10 +201,10 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
193
201
|
};
|
194
202
|
// 通知表格渲染
|
195
203
|
var notifyTableRender = function notifyTableRender(columns) {
|
196
|
-
var _actionRef$
|
204
|
+
var _actionRef$current4, _actionRef$current4$s;
|
197
205
|
calculateSelectAllState(columns);
|
198
206
|
setNewColumns(columns);
|
199
|
-
(_actionRef$
|
207
|
+
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setColumn) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, columns, false);
|
200
208
|
};
|
201
209
|
// 计算全选状态
|
202
210
|
var calculateSelectAllState = function calculateSelectAllState(columns) {
|
package/es/table/index.js
CHANGED
@@ -297,7 +297,9 @@ var ProTable = function ProTable(props) {
|
|
297
297
|
// 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
298
298
|
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
299
299
|
var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
|
300
|
-
if (
|
300
|
+
if (isFullscreen) {
|
301
|
+
// 开启全屏的时候先往下面走
|
302
|
+
} else if (!fixedTableBody) {
|
301
303
|
return;
|
302
304
|
}
|
303
305
|
var tableDom = tableRef.current;
|
@@ -420,9 +422,9 @@ var ProTable = function ProTable(props) {
|
|
420
422
|
if (showSkeleton && result) {
|
421
423
|
result.disabled = true;
|
422
424
|
}
|
423
|
-
return _objectSpread({
|
425
|
+
return _objectSpread(_objectSpread({
|
424
426
|
_primaryKey: props.primaryKey
|
425
|
-
}, result);
|
427
|
+
}, record), result);
|
426
428
|
},
|
427
429
|
titleProps: function titleProps() {
|
428
430
|
var result = {};
|
@@ -834,7 +836,7 @@ var ProTable = function ProTable(props) {
|
|
834
836
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
835
837
|
// 格式化后的请求参数
|
836
838
|
var requestData = {};
|
837
|
-
var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3)
|
839
|
+
var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3))), params);
|
838
840
|
if (typeof formatParams === 'string') {
|
839
841
|
requestData = getTargetValue(formatParams, {
|
840
842
|
params: preParams
|
@@ -947,7 +949,7 @@ var ProTable = function ProTable(props) {
|
|
947
949
|
return true;
|
948
950
|
} : undefined,
|
949
951
|
onFilter: function onFilter(values) {
|
950
|
-
var _actionRef$current7, _actionRef$current7$c;
|
952
|
+
var _actionRef$current7, _actionRef$current7$c, _request8;
|
951
953
|
// 全屏状态,判断全屏表单onFilter是否禁用
|
952
954
|
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
953
955
|
filterEnableRef.current.fullscreen = true;
|
@@ -959,20 +961,26 @@ var ProTable = function ProTable(props) {
|
|
959
961
|
return;
|
960
962
|
}
|
961
963
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
|
964
|
+
if (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) {
|
965
|
+
var filterResult = propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values);
|
966
|
+
if (filterResult === false) {
|
967
|
+
return false;
|
968
|
+
}
|
969
|
+
}
|
962
970
|
// 搜索变化时,暂时先清空选择
|
963
971
|
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
|
964
972
|
setCurrentPage(1);
|
965
|
-
_request(
|
973
|
+
_request((_request8 = {}, _defineProperty(_request8, targetPageKey, 1), _defineProperty(_request8, targetPageSizeKey, pageSize), _request8), false, values);
|
966
974
|
},
|
967
975
|
onReset: function onReset(values) {
|
968
|
-
var _dataFilterFormRef$cu3;
|
976
|
+
var _dataFilterFormRef$cu3, _request9;
|
969
977
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
970
978
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
971
979
|
setCurrentPage(1);
|
972
|
-
_request(
|
980
|
+
_request((_request9 = {}, _defineProperty(_request9, targetPageKey, 1), _defineProperty(_request9, targetPageSizeKey, pageSize), _request9), false, values);
|
973
981
|
}
|
974
982
|
});
|
975
|
-
}, [propsDataFilter, fullscreenState, filterEnableRef, actionRef]);
|
983
|
+
}, [propsDataFilter, fullscreenState, filterEnableRef, actionRef, pageSize]);
|
976
984
|
var isLoading = useMemo(function () {
|
977
985
|
if (!customRequest) {
|
978
986
|
return showLoading && !showSkeleton && (getData.loading || props.loading);
|
package/es/table/index.scss
CHANGED
@@ -71,7 +71,7 @@ $fullscreenPadding: 24px;
|
|
71
71
|
box-shadow: var(--shadow-1-up);
|
72
72
|
background-color: var(--table-row-bg, #ffffff);
|
73
73
|
margin: 0;
|
74
|
-
z-index:
|
74
|
+
z-index: 5;
|
75
75
|
}
|
76
76
|
|
77
77
|
.next-table-body {
|
@@ -126,6 +126,15 @@ $fullscreenPadding: 24px;
|
|
126
126
|
}
|
127
127
|
}
|
128
128
|
|
129
|
+
// .teamix-pro-table-fullscreen {
|
130
|
+
// .teamix-pro-table-container {
|
131
|
+
// height: calc(100vh - 74px);
|
132
|
+
// overflow: hidden;
|
133
|
+
// overflow-y: auto;
|
134
|
+
// }
|
135
|
+
// }
|
136
|
+
|
137
|
+
|
129
138
|
.teamix-pro-table-footer-suction {
|
130
139
|
margin-bottom: 50px;
|
131
140
|
.teamix-pro-table-footer {
|
package/es/table/typing.d.ts
CHANGED
@@ -24,6 +24,8 @@ declare type TDataService = {
|
|
24
24
|
};
|
25
25
|
export declare type responsivePaginationType = 'mini' | 'small' | 'simple' | 'normal';
|
26
26
|
export declare type ProTableColumnProps = {
|
27
|
+
/** 是否强制刷新 */
|
28
|
+
forcedUpdate?: boolean;
|
27
29
|
/** 是否开启了自动计算宽度 */
|
28
30
|
isAutoWidth?: boolean;
|
29
31
|
/** 自动计算宽度时的被挤占的情况 */
|
@@ -94,6 +94,9 @@ function useTableSelection() {
|
|
94
94
|
// console.log('propResult', propResult, selectedRowKeys);
|
95
95
|
var resultProps = _objectSpread(_objectSpread({}, record), propResult);
|
96
96
|
var primaryKey = record === null || record === void 0 ? void 0 : record[resultProps === null || resultProps === void 0 ? void 0 : resultProps['_primaryKey']];
|
97
|
+
if ((config === null || config === void 0 ? void 0 : config.mode) === 'single') {
|
98
|
+
return resultProps;
|
99
|
+
}
|
97
100
|
return _objectSpread(_objectSpread({}, resultProps), {}, {
|
98
101
|
isPreview: true,
|
99
102
|
renderPreview: function renderPreview() {
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _utils = require("@teamix/utils");
|
10
10
|
var _ProForm = _interopRequireDefault(require("../ProForm"));
|
11
11
|
var _utils2 = require("../utils");
|
12
|
-
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
|
12
|
+
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear", "submitProps", "resetProps", "buttonGroup"];
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
14
|
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); }
|
15
15
|
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; }
|
@@ -39,9 +39,46 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
39
39
|
breakpoints = props.breakpoints,
|
40
40
|
gridProps = props.gridProps,
|
41
41
|
forceClear = props.forceClear,
|
42
|
+
_props$submitProps = props.submitProps,
|
43
|
+
submitProps = _props$submitProps === void 0 ? {} : _props$submitProps,
|
44
|
+
_props$resetProps = props.resetProps,
|
45
|
+
resetProps = _props$resetProps === void 0 ? {} : _props$resetProps,
|
46
|
+
buttonGroup = props.buttonGroup,
|
42
47
|
otherProps = _objectWithoutProperties(props, _excluded);
|
43
48
|
var prefixCls = (0, _utils.usePrefixCls)('teamix-pro-form-query-filter-advanced');
|
44
49
|
var gridSchema = (0, _react.useMemo)(function () {
|
50
|
+
var resetSchema = _objectSpread(_objectSpread({
|
51
|
+
name: 'AdvancedFilterReset',
|
52
|
+
component: 'Reset'
|
53
|
+
}, resetProps), {}, {
|
54
|
+
props: _objectSpread({
|
55
|
+
onResetValidateSuccess: onReset,
|
56
|
+
forceClear: !!forceClear,
|
57
|
+
children: (0, _utils.getMessage)('reset')
|
58
|
+
}, resetProps === null || resetProps === void 0 ? void 0 : resetProps.props)
|
59
|
+
});
|
60
|
+
var submitSchema = _objectSpread(_objectSpread({
|
61
|
+
component: 'Submit'
|
62
|
+
}, submitProps), {}, {
|
63
|
+
props: _objectSpread({
|
64
|
+
style: {
|
65
|
+
marginRight: -4
|
66
|
+
},
|
67
|
+
children: (0, _utils.getMessage)('search')
|
68
|
+
}, submitProps === null || submitProps === void 0 ? void 0 : submitProps.props)
|
69
|
+
});
|
70
|
+
var buttonGroupSchema = [resetSchema, submitSchema];
|
71
|
+
if (buttonGroup) {
|
72
|
+
buttonGroupSchema = buttonGroup.map(function (item) {
|
73
|
+
if (item === 'Submit') {
|
74
|
+
return submitSchema;
|
75
|
+
}
|
76
|
+
if (item === 'Reset') {
|
77
|
+
return resetSchema;
|
78
|
+
}
|
79
|
+
return item;
|
80
|
+
});
|
81
|
+
}
|
45
82
|
return [{
|
46
83
|
name: 'AdvancedFilterFormGrid',
|
47
84
|
component: 'FormGrid',
|
@@ -62,23 +99,7 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
62
99
|
props: {
|
63
100
|
align: 'right'
|
64
101
|
},
|
65
|
-
children:
|
66
|
-
name: 'AdvancedFilterReset',
|
67
|
-
component: 'Reset',
|
68
|
-
props: {
|
69
|
-
onResetValidateSuccess: onReset,
|
70
|
-
forceClear: !!forceClear,
|
71
|
-
children: (0, _utils.getMessage)('reset')
|
72
|
-
}
|
73
|
-
}, {
|
74
|
-
component: 'Submit',
|
75
|
-
props: {
|
76
|
-
style: {
|
77
|
-
marginRight: -4
|
78
|
-
},
|
79
|
-
children: (0, _utils.getMessage)('search')
|
80
|
-
}
|
81
|
-
}]
|
102
|
+
children: _toConsumableArray(buttonGroupSchema)
|
82
103
|
}]
|
83
104
|
}])
|
84
105
|
}];
|
package/lib/form/typing.d.ts
CHANGED
@@ -115,6 +115,12 @@ export interface FilterProps extends ProFormProps {
|
|
115
115
|
activeFilterValueRef?: React.MutableRefObject<any>;
|
116
116
|
forceClear?: boolean;
|
117
117
|
onReset?: (payload?: any) => void;
|
118
|
+
/** 搜索按钮配置 */
|
119
|
+
submitProps?: ProFormSchemaItem;
|
120
|
+
/** 重置按钮配置 */
|
121
|
+
resetProps?: ProFormSchemaItem;
|
122
|
+
/** 操作区按钮组配置 */
|
123
|
+
buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
|
118
124
|
}
|
119
125
|
export interface QueryFilterLayoutProps {
|
120
126
|
prefixCls?: string;
|
@@ -164,6 +170,12 @@ export interface QueryFilterProps extends ProFormProps {
|
|
164
170
|
onReset?: (payload?: any) => void;
|
165
171
|
/** 高级筛选按钮切换 */
|
166
172
|
onExpand?: (expand: boolean) => void;
|
173
|
+
/** 搜索按钮配置 */
|
174
|
+
submitProps?: ProFormSchemaItem;
|
175
|
+
/** 重置按钮配置 */
|
176
|
+
resetProps?: ProFormSchemaItem;
|
177
|
+
/** 操作区按钮组配置 */
|
178
|
+
buttonGroup?: (ProFormSchemaItem | 'Submit' | 'Reset')[];
|
167
179
|
}
|
168
180
|
/**
|
169
181
|
* 兼容性导出
|
package/lib/index.d.ts
CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
|
|
30
30
|
export * from './utils';
|
31
31
|
export * from './timeline';
|
32
32
|
export * from './image';
|
33
|
-
declare const version = "1.5.
|
33
|
+
declare const version = "1.5.36";
|
34
34
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -299,7 +299,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
299
299
|
if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
|
300
300
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
301
301
|
}
|
302
|
-
var version = '1.5.
|
302
|
+
var version = '1.5.36';
|
303
303
|
// By TeamixTest
|
304
304
|
exports.version = version;
|
305
305
|
window.postMessage({
|
@@ -12,6 +12,7 @@ interface ICellProps {
|
|
12
12
|
/** 接收外部比如 dialog-table 传过来的 context,用于弹窗关闭等 */
|
13
13
|
context?: any;
|
14
14
|
dataTeamixSpm?: string;
|
15
|
+
forcedUpdate?: boolean;
|
15
16
|
}
|
16
17
|
declare const _default: React.MemoExoticComponent<(props: ICellProps) => JSX.Element>;
|
17
18
|
export default _default;
|
@@ -194,13 +194,14 @@ var processBuriedPoint = function processBuriedPoint() {
|
|
194
194
|
};
|
195
195
|
var equalColumns = function equalColumns(prevProps, nextProps) {
|
196
196
|
var preValue = prevProps.value;
|
197
|
-
var nextValue = nextProps.value
|
197
|
+
var nextValue = nextProps.value,
|
198
|
+
item = nextProps.item;
|
198
199
|
// columns 强制更新参数
|
199
|
-
if (
|
200
|
+
if (item === null || item === void 0 ? void 0 : item.forcedUpdate) {
|
200
201
|
return false;
|
201
202
|
}
|
202
|
-
// 操作列的时候强制刷新
|
203
|
-
if (preValue === false && nextValue === false) {
|
203
|
+
// 操作列的时候强制刷新 || 当 value 值拿不到的时候
|
204
|
+
if (preValue === false && nextValue === false || nextValue === undefined) {
|
204
205
|
return false;
|
205
206
|
}
|
206
207
|
if (preValue === nextValue) {
|
@@ -34,7 +34,11 @@ var Row = _components.Grid.Row,
|
|
34
34
|
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-toolbar-filter-column');
|
35
35
|
var processColumns = function processColumns(columns) {
|
36
36
|
var _getGlobalConfig;
|
37
|
+
var filterColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
37
38
|
var globalFilterColumns = (_getGlobalConfig = (0, _utils.getGlobalConfig)('ProTable')) === null || _getGlobalConfig === void 0 ? void 0 : _getGlobalConfig.filterColumns;
|
39
|
+
var filterColumnsKey = filterColumns.map(function (item) {
|
40
|
+
return item === null || item === void 0 ? void 0 : item.dataIndex;
|
41
|
+
});
|
38
42
|
// hidden 为 true 时不展示
|
39
43
|
columns = columns.filter(function (item) {
|
40
44
|
return (item === null || item === void 0 ? void 0 : item.hidden) !== true && (!globalFilterColumns || globalFilterColumns(item));
|
@@ -44,11 +48,14 @@ var processColumns = function processColumns(columns) {
|
|
44
48
|
return item;
|
45
49
|
}
|
46
50
|
return _objectSpread(_objectSpread({}, item), {}, {
|
47
|
-
columnFilters:
|
51
|
+
columnFilters: filterColumnsKey.findIndex(function (key) {
|
52
|
+
return item.dataIndex === key;
|
53
|
+
}) >= 0 ? true : false
|
48
54
|
});
|
49
55
|
});
|
50
56
|
};
|
51
57
|
var FilterColumnIcon = function FilterColumnIcon(props) {
|
58
|
+
var _actionRef$current, _actionRef$current3;
|
52
59
|
var _props$columns = props.columns,
|
53
60
|
columns = _props$columns === void 0 ? [] : _props$columns,
|
54
61
|
actionRef = props.actionRef,
|
@@ -61,7 +68,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
61
68
|
_useState4 = _slicedToArray(_useState3, 2),
|
62
69
|
indeterminate = _useState4[0],
|
63
70
|
setIndeterminate = _useState4[1];
|
64
|
-
var _useState5 = (0, _react.useState)(processColumns(columns)),
|
71
|
+
var _useState5 = (0, _react.useState)(processColumns(columns, (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.filterColumns)),
|
65
72
|
_useState6 = _slicedToArray(_useState5, 2),
|
66
73
|
newColumns = _useState6[0],
|
67
74
|
setNewColumns = _useState6[1];
|
@@ -107,8 +114,9 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
107
114
|
};
|
108
115
|
});
|
109
116
|
(0, _react.useEffect)(function () {
|
110
|
-
|
111
|
-
|
117
|
+
var _actionRef$current2;
|
118
|
+
setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
|
119
|
+
}, [columns, (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.filterColumns]);
|
112
120
|
// 全选
|
113
121
|
var onChangeAllColumns = function onChangeAllColumns(check) {
|
114
122
|
setAllVisible(check);
|
@@ -200,10 +208,10 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
200
208
|
};
|
201
209
|
// 通知表格渲染
|
202
210
|
var notifyTableRender = function notifyTableRender(columns) {
|
203
|
-
var _actionRef$
|
211
|
+
var _actionRef$current4, _actionRef$current4$s;
|
204
212
|
calculateSelectAllState(columns);
|
205
213
|
setNewColumns(columns);
|
206
|
-
(_actionRef$
|
214
|
+
(_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setColumn) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, columns, false);
|
207
215
|
};
|
208
216
|
// 计算全选状态
|
209
217
|
var calculateSelectAllState = function calculateSelectAllState(columns) {
|
package/lib/table/index.js
CHANGED
@@ -318,7 +318,9 @@ var ProTable = function ProTable(props) {
|
|
318
318
|
// 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
319
319
|
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
320
320
|
var _tableDom$getElements, _tableDom$getElements2, _document$querySelect, _document$querySelect2, _document$querySelect3;
|
321
|
-
if (
|
321
|
+
if (isFullscreen) {
|
322
|
+
// 开启全屏的时候先往下面走
|
323
|
+
} else if (!fixedTableBody) {
|
322
324
|
return;
|
323
325
|
}
|
324
326
|
var tableDom = tableRef.current;
|
@@ -441,9 +443,9 @@ var ProTable = function ProTable(props) {
|
|
441
443
|
if (showSkeleton && result) {
|
442
444
|
result.disabled = true;
|
443
445
|
}
|
444
|
-
return _objectSpread({
|
446
|
+
return _objectSpread(_objectSpread({
|
445
447
|
_primaryKey: props.primaryKey
|
446
|
-
}, result);
|
448
|
+
}, record), result);
|
447
449
|
},
|
448
450
|
titleProps: function titleProps() {
|
449
451
|
var result = {};
|
@@ -855,7 +857,7 @@ var ProTable = function ProTable(props) {
|
|
855
857
|
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
|
856
858
|
// 格式化后的请求参数
|
857
859
|
var requestData = {};
|
858
|
-
var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3)
|
860
|
+
var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3))), params);
|
859
861
|
if (typeof formatParams === 'string') {
|
860
862
|
requestData = (0, _utils.getTargetValue)(formatParams, {
|
861
863
|
params: preParams
|
@@ -968,7 +970,7 @@ var ProTable = function ProTable(props) {
|
|
968
970
|
return true;
|
969
971
|
} : undefined,
|
970
972
|
onFilter: function onFilter(values) {
|
971
|
-
var _actionRef$current7, _actionRef$current7$c;
|
973
|
+
var _actionRef$current7, _actionRef$current7$c, _request8;
|
972
974
|
// 全屏状态,判断全屏表单onFilter是否禁用
|
973
975
|
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
974
976
|
filterEnableRef.current.fullscreen = true;
|
@@ -980,20 +982,26 @@ var ProTable = function ProTable(props) {
|
|
980
982
|
return;
|
981
983
|
}
|
982
984
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
|
985
|
+
if (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) {
|
986
|
+
var filterResult = propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values);
|
987
|
+
if (filterResult === false) {
|
988
|
+
return false;
|
989
|
+
}
|
990
|
+
}
|
983
991
|
// 搜索变化时,暂时先清空选择
|
984
992
|
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
|
985
993
|
setCurrentPage(1);
|
986
|
-
_request(
|
994
|
+
_request((_request8 = {}, _defineProperty(_request8, targetPageKey, 1), _defineProperty(_request8, targetPageSizeKey, pageSize), _request8), false, values);
|
987
995
|
},
|
988
996
|
onReset: function onReset(values) {
|
989
|
-
var _dataFilterFormRef$cu3;
|
997
|
+
var _dataFilterFormRef$cu3, _request9;
|
990
998
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
991
999
|
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
992
1000
|
setCurrentPage(1);
|
993
|
-
_request(
|
1001
|
+
_request((_request9 = {}, _defineProperty(_request9, targetPageKey, 1), _defineProperty(_request9, targetPageSizeKey, pageSize), _request9), false, values);
|
994
1002
|
}
|
995
1003
|
});
|
996
|
-
}, [propsDataFilter, fullscreenState, filterEnableRef, actionRef]);
|
1004
|
+
}, [propsDataFilter, fullscreenState, filterEnableRef, actionRef, pageSize]);
|
997
1005
|
var isLoading = (0, _react.useMemo)(function () {
|
998
1006
|
if (!customRequest) {
|
999
1007
|
return showLoading && !showSkeleton && (getData.loading || props.loading);
|