@teamix/pro 1.2.31 → 1.2.32
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 +149 -84
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/common.scss +22 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoValueItem/index.js +38 -12
- package/es/info/components/InfoValueItem/index.scss +1 -0
- package/es/info/components/ProInfoItem/index.js +4 -2
- package/es/info/components/ProInfoItem/index.scss +5 -0
- package/es/info/components/baseInfo/index.js +2 -1
- package/es/info/components/headerInfo/index.js +2 -1
- package/es/info/components/tableInfo/index.js +2 -1
- package/es/info/index.scss +2 -0
- package/es/info/typing.d.ts +3 -0
- package/es/table/components/ToolBar/Fullscreen.js +7 -11
- package/es/table/index.js +15 -12
- package/lib/common.scss +22 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoValueItem/index.js +38 -12
- package/lib/info/components/InfoValueItem/index.scss +1 -0
- package/lib/info/components/ProInfoItem/index.js +4 -2
- package/lib/info/components/ProInfoItem/index.scss +5 -0
- package/lib/info/components/baseInfo/index.js +2 -1
- package/lib/info/components/headerInfo/index.js +2 -1
- package/lib/info/components/tableInfo/index.js +2 -1
- package/lib/info/index.scss +2 -0
- package/lib/info/typing.d.ts +3 -0
- package/lib/table/components/ToolBar/Fullscreen.js +7 -11
- package/lib/table/index.js +15 -12
- package/package.json +1 -1
package/lib/info/typing.d.ts
CHANGED
@@ -94,6 +94,8 @@ export interface ProInfoColumnsProps {
|
|
94
94
|
actions?: ProActionButtonProps[];
|
95
95
|
/** 追加在列后 */
|
96
96
|
extra?: React.ReactNode;
|
97
|
+
/** 其他 ProField 配置 */
|
98
|
+
props?: any;
|
97
99
|
}
|
98
100
|
export declare type ProInfoActionType = {
|
99
101
|
/** 刷新Info */
|
@@ -168,6 +170,7 @@ export declare type InfoValueItemProps = {
|
|
168
170
|
render?: ProInfoCellRender;
|
169
171
|
dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
|
170
172
|
context?: object;
|
173
|
+
props?: any;
|
171
174
|
} & Omit<ProFieldProps, 'render' | 'dataSource'>;
|
172
175
|
export declare type ProInfoHeaderProps = Omit<ProCardProps, 'loading'>;
|
173
176
|
/** ProInfoGroupContextProps */
|
@@ -27,25 +27,21 @@ var FullScreen = function FullScreen(props) {
|
|
27
27
|
normalDataFilterForm = _actionRef$current.normalDataFilterForm,
|
28
28
|
fullscreenDataFilterForm = _actionRef$current.fullscreenDataFilterForm;
|
29
29
|
|
30
|
-
function closeByESC(e) {
|
30
|
+
var closeByESC = function closeByESC(e) {
|
31
31
|
if (visible && e.code === 'Escape') {
|
32
|
-
var _actionRef$current2, _actionRef$current2$
|
32
|
+
var _actionRef$current2, _actionRef$current2$f;
|
33
33
|
|
34
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$
|
35
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$f = _actionRef$current3.fullScreen) === null || _actionRef$current3$f === void 0 ? void 0 : _actionRef$current3$f.call(_actionRef$current3);
|
34
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.fullScreen) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2);
|
36
35
|
}
|
37
|
-
} // 监听esc按钮
|
36
|
+
}; // 监听esc按钮
|
38
37
|
|
39
38
|
|
40
39
|
(0, _react.useEffect)(function () {
|
41
|
-
var _actionRef$current4, _actionRef$current4$s;
|
42
|
-
|
43
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFullScreenState) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, visible);
|
44
40
|
window.addEventListener('keydown', closeByESC);
|
45
41
|
return function () {
|
46
42
|
window.removeEventListener('keydown', closeByESC);
|
47
43
|
};
|
48
|
-
}, [visible]);
|
44
|
+
}, [visible, actionRef]);
|
49
45
|
|
50
46
|
var afterClose = function afterClose() {
|
51
47
|
normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm.values);
|
@@ -84,9 +80,9 @@ var FullScreen = function FullScreen(props) {
|
|
84
80
|
zIndex: 999
|
85
81
|
},
|
86
82
|
onRequestClose: function onRequestClose() {
|
87
|
-
var _actionRef$
|
83
|
+
var _actionRef$current3, _actionRef$current3$f;
|
88
84
|
|
89
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
85
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$f = _actionRef$current3.fullScreen) === null || _actionRef$current3$f === void 0 ? void 0 : _actionRef$current3$f.call(_actionRef$current3);
|
90
86
|
}
|
91
87
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
92
88
|
className: "teamix-pro-table-full-screen"
|
package/lib/table/index.js
CHANGED
@@ -507,21 +507,24 @@ var ProTable = function ProTable(props) {
|
|
507
507
|
|
508
508
|
(0, _utils2.useActionType)(actionRef, {
|
509
509
|
fullScreen: function fullScreen() {
|
510
|
+
var _actionRef$current2, _actionRef$current2$s;
|
511
|
+
|
510
512
|
var state = !fullscreenState; // 全屏时需要重新计算header高度
|
511
513
|
|
512
514
|
getHeaderHeight().then(function (height) {
|
513
515
|
setHeaderHeight(height);
|
514
516
|
});
|
515
517
|
setFullscreenState(state);
|
518
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'fullScreenState', state);
|
516
519
|
return state;
|
517
520
|
},
|
518
521
|
setColumn: function setColumn(newColumns) {
|
519
|
-
var _actionRef$
|
522
|
+
var _actionRef$current3, _actionRef$current3$s;
|
520
523
|
|
521
524
|
var update = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
522
525
|
var columns = processColumns(newColumns, propsColumns);
|
523
526
|
setFilteredColumns(columns);
|
524
|
-
(_actionRef$
|
527
|
+
(_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, 'filterColumns', columns);
|
525
528
|
|
526
529
|
if (update) {
|
527
530
|
(0, _utils2.emit)('refreshFilterState', newColumns);
|
@@ -546,11 +549,11 @@ var ProTable = function ProTable(props) {
|
|
546
549
|
_request(params);
|
547
550
|
},
|
548
551
|
reset: function reset() {
|
549
|
-
var _actionRef$
|
552
|
+
var _actionRef$current4, _actionRef$current4$s, _dataFilterForm;
|
550
553
|
|
551
554
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
|
552
555
|
|
553
|
-
(_actionRef$
|
556
|
+
(_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, {});
|
554
557
|
(_dataFilterForm = dataFilterForm) === null || _dataFilterForm === void 0 ? void 0 : _dataFilterForm.reset();
|
555
558
|
setCurrentPage(1);
|
556
559
|
|
@@ -665,7 +668,7 @@ var ProTable = function ProTable(props) {
|
|
665
668
|
}); // 请求函数
|
666
669
|
|
667
670
|
function _request(params, noLoading) {
|
668
|
-
var _dataFilterForm2, _actionRef$current$ge, _actionRef$
|
671
|
+
var _dataFilterForm2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
669
672
|
|
670
673
|
// 如果没有传 url 且没有 customRequest,直接返回
|
671
674
|
if (!url && !customRequest) {
|
@@ -680,7 +683,7 @@ var ProTable = function ProTable(props) {
|
|
680
683
|
|
681
684
|
var dataFilterParams = toJS((_dataFilterForm2 = dataFilterForm) === null || _dataFilterForm2 === void 0 ? void 0 : _dataFilterForm2.values); // 列过滤请求参数
|
682
685
|
|
683
|
-
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$
|
686
|
+
var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
|
684
687
|
|
685
688
|
var requestData = formatParams(_objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, targetPageKey, currentPage), _defineProperty(_objectSpread2, targetPageSizeKey, pageSize), _objectSpread2), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params));
|
686
689
|
|
@@ -782,11 +785,11 @@ var ProTable = function ProTable(props) {
|
|
782
785
|
mode: 'inline'
|
783
786
|
}, propsDataFilter), {}, {
|
784
787
|
onFilter: function onFilter(values) {
|
785
|
-
var _actionRef$
|
788
|
+
var _actionRef$current6, _actionRef$current6$c;
|
786
789
|
|
787
790
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
|
788
791
|
|
789
|
-
(_actionRef$
|
792
|
+
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$c = _actionRef$current6.clearRowSelection) === null || _actionRef$current6$c === void 0 ? void 0 : _actionRef$current6$c.call(_actionRef$current6);
|
790
793
|
setCurrentPage(1);
|
791
794
|
|
792
795
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -882,21 +885,21 @@ var ProTable = function ProTable(props) {
|
|
882
885
|
|
883
886
|
var renderFooter = function renderFooter() {
|
884
887
|
function onChangePagination(currentPage) {
|
885
|
-
var _actionRef$
|
888
|
+
var _actionRef$current7, _actionRef$current7$c;
|
886
889
|
|
887
890
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
888
891
|
// 翻页暂时先清空选择
|
889
|
-
(_actionRef$
|
892
|
+
(_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);
|
890
893
|
setCurrentPage(currentPage);
|
891
894
|
|
892
895
|
_request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
|
893
896
|
}
|
894
897
|
|
895
898
|
function onChangePaginationSize(currentPageSize) {
|
896
|
-
var _actionRef$
|
899
|
+
var _actionRef$current8, _actionRef$current8$c, _request5;
|
897
900
|
|
898
901
|
// 翻页暂时先清空选择
|
899
|
-
(_actionRef$
|
902
|
+
(_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);
|
900
903
|
setPageSize(currentPageSize);
|
901
904
|
setCurrentPage(1);
|
902
905
|
|