@teamix/pro 1.2.33 → 1.3.1
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 +17242 -17233
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +9 -4
- package/es/actions/dialog-form.js +16 -9
- package/es/form/Filter/AdvancedFilter.js +4 -4
- package/es/form/Filter/LightFilter.js +22 -15
- package/es/form/Filter/index.js +200 -106
- package/es/form/Filter/useSpecialProps.d.ts +1 -1
- package/es/form/Filter/useSpecialProps.js +9 -9
- package/es/form/ProForm/index.js +4 -4
- package/es/form/ProForm/index.scss +8 -8
- package/es/form/SchemaForm/index.js +4 -4
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +40 -5
- package/es/form/SchemaForm/reactions.d.ts +2 -2
- package/es/form/SchemaForm/reactions.js +39 -21
- package/es/form/typing.d.ts +10 -2
- package/es/index.d.ts +4 -4
- package/es/index.js +4 -4
- package/es/nocode/configurators/PageHeader.js +2 -2
- package/es/page-header/index.js +7 -3
- package/es/table/components/Layout/index.js +2 -2
- package/es/table/components/Pagination/index.js +11 -1
- package/es/table/components/ToolBar/Fullscreen.js +32 -4
- package/es/table/index.js +70 -40
- package/es/table/index.scss +6 -0
- package/es/table/typing.d.ts +10 -6
- package/es/table/utils/columnRender.js +1 -1
- package/es/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +59 -72
- package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
- package/es/timeline/index.d.ts +10 -0
- package/es/{step → timeline}/index.js +33 -57
- package/es/timeline/index.scss +7 -0
- package/es/timeline/typing.d.ts +101 -0
- package/es/{step → timeline}/typing.js +0 -0
- package/lib/actions/dialog-form.d.ts +9 -4
- package/lib/actions/dialog-form.js +16 -9
- package/lib/form/Filter/AdvancedFilter.js +4 -4
- package/lib/form/Filter/LightFilter.js +21 -15
- package/lib/form/Filter/index.js +199 -105
- package/lib/form/Filter/useSpecialProps.d.ts +1 -1
- package/lib/form/Filter/useSpecialProps.js +8 -8
- package/lib/form/ProForm/index.js +4 -4
- package/lib/form/ProForm/index.scss +8 -8
- package/lib/form/SchemaForm/index.js +4 -4
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +40 -5
- package/lib/form/SchemaForm/reactions.d.ts +2 -2
- package/lib/form/SchemaForm/reactions.js +38 -20
- package/lib/form/typing.d.ts +10 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +10 -10
- package/lib/nocode/configurators/PageHeader.js +2 -2
- package/lib/page-header/index.js +6 -2
- package/lib/table/components/Layout/index.js +2 -2
- package/lib/table/components/Pagination/index.js +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +30 -3
- package/lib/table/index.js +70 -40
- package/lib/table/index.scss +6 -0
- package/lib/table/typing.d.ts +10 -6
- package/lib/table/utils/columnRender.js +1 -1
- package/lib/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +58 -72
- package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
- package/lib/timeline/index.d.ts +10 -0
- package/lib/{step → timeline}/index.js +38 -58
- package/lib/timeline/index.scss +7 -0
- package/lib/timeline/typing.d.ts +101 -0
- package/lib/{step → timeline}/typing.js +0 -0
- package/package.json +1 -1
- package/es/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
- package/es/step/ProStepItem/components/HozStepItem/index.js +0 -235
- package/es/step/ProStepItem/components/HozStepItem/index.scss +0 -279
- package/es/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
- package/es/step/ProStepItem/index.d.ts +0 -4
- package/es/step/ProStepItem/index.js +0 -57
- package/es/step/index.d.ts +0 -9
- package/es/step/typing.d.ts +0 -96
- package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
- package/lib/step/ProStepItem/components/HozStepItem/index.js +0 -258
- package/lib/step/ProStepItem/components/HozStepItem/index.scss +0 -279
- package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
- package/lib/step/ProStepItem/index.d.ts +0 -4
- package/lib/step/ProStepItem/index.js +0 -69
- package/lib/step/index.d.ts +0 -9
- package/lib/step/typing.d.ts +0 -96
package/lib/table/index.js
CHANGED
@@ -55,7 +55,7 @@ Object.keys(_typing).forEach(function (key) {
|
|
55
55
|
}
|
56
56
|
});
|
57
57
|
});
|
58
|
-
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams"];
|
58
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords"];
|
59
59
|
|
60
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
61
61
|
|
@@ -165,7 +165,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
165
165
|
};
|
166
166
|
|
167
167
|
var ProTable = function ProTable(props) {
|
168
|
-
var _rowSelection$selecte
|
168
|
+
var _rowSelection$selecte;
|
169
169
|
|
170
170
|
var header = props.header,
|
171
171
|
className = props.className,
|
@@ -220,6 +220,8 @@ var ProTable = function ProTable(props) {
|
|
220
220
|
_props$filterColumnTy = props.filterColumnType,
|
221
221
|
filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
|
222
222
|
defaultFilterParams = props.defaultFilterParams,
|
223
|
+
_props$reserveSelecte = props.reserveSelectedRecords,
|
224
|
+
reserveSelectedRecords = _props$reserveSelecte === void 0 ? false : _props$reserveSelecte,
|
223
225
|
otherProps = _objectWithoutProperties(props, _excluded);
|
224
226
|
|
225
227
|
var targetPageKey = pageKey || globalPageKey;
|
@@ -331,16 +333,21 @@ var ProTable = function ProTable(props) {
|
|
331
333
|
var _useState27 = (0, _react.useState)(false),
|
332
334
|
_useState28 = _slicedToArray(_useState27, 2),
|
333
335
|
fullscreenState = _useState28[0],
|
334
|
-
setFullscreenState = _useState28[1]; //
|
336
|
+
setFullscreenState = _useState28[1]; // 切换全屏搜索开关
|
335
337
|
|
336
338
|
|
339
|
+
var filterEnableRef = (0, _react.useRef)({
|
340
|
+
fullscreen: false,
|
341
|
+
normal: true
|
342
|
+
}); // 非全屏状态下的
|
343
|
+
|
337
344
|
var normalDataFilterFormRef = (0, _react.useRef)();
|
338
345
|
var fullscreenDataFilterFormRef = (0, _react.useRef)();
|
339
346
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
340
347
|
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
|
341
348
|
|
342
|
-
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
343
|
-
|
349
|
+
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
|
350
|
+
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
344
351
|
|
345
352
|
var _useState29 = (0, _react.useState)(false),
|
346
353
|
_useState30 = _slicedToArray(_useState29, 2),
|
@@ -378,7 +385,7 @@ var ProTable = function ProTable(props) {
|
|
378
385
|
result = propsRowSelection.getProps(record, index);
|
379
386
|
}
|
380
387
|
|
381
|
-
if (showSkeleton) {
|
388
|
+
if (showSkeleton && result) {
|
382
389
|
result.disabled = true;
|
383
390
|
}
|
384
391
|
|
@@ -549,12 +556,12 @@ var ProTable = function ProTable(props) {
|
|
549
556
|
_request(params);
|
550
557
|
},
|
551
558
|
reset: function reset() {
|
552
|
-
var _actionRef$current4, _actionRef$current4$s,
|
559
|
+
var _actionRef$current4, _actionRef$current4$s, _dataFilterFormRef$cu;
|
553
560
|
|
554
561
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
|
555
562
|
|
556
563
|
(_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, {});
|
557
|
-
(
|
564
|
+
(_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
|
558
565
|
setCurrentPage(1);
|
559
566
|
|
560
567
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -576,9 +583,11 @@ var ProTable = function ProTable(props) {
|
|
576
583
|
pageSize: pageSize
|
577
584
|
},
|
578
585
|
data: data,
|
579
|
-
dataFilterForm:
|
586
|
+
dataFilterForm: dataFilterFormRef.current,
|
587
|
+
dataFilterFormRef: dataFilterFormRef,
|
580
588
|
normalDataFilterForm: normalDataFilterForm,
|
581
589
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
590
|
+
filterEnableRef: filterEnableRef,
|
582
591
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
|
583
592
|
getHeaderHeight().then(function (height) {
|
584
593
|
setHeaderHeight(height);
|
@@ -667,8 +676,8 @@ var ProTable = function ProTable(props) {
|
|
667
676
|
}
|
668
677
|
}); // 请求函数
|
669
678
|
|
670
|
-
function _request(params, noLoading) {
|
671
|
-
var
|
679
|
+
function _request(params, noLoading, filterParams) {
|
680
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
672
681
|
|
673
682
|
// 如果没有传 url 且没有 customRequest,直接返回
|
674
683
|
if (!url && !customRequest) {
|
@@ -681,7 +690,7 @@ var ProTable = function ProTable(props) {
|
|
681
690
|
|
682
691
|
var sortParams = targetFormatSort(sort); // 筛选区请求参数
|
683
692
|
|
684
|
-
var dataFilterParams =
|
693
|
+
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values; // 列过滤请求参数
|
685
694
|
|
686
695
|
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 : {}; // 格式化后的请求参数
|
687
696
|
|
@@ -732,31 +741,24 @@ var ProTable = function ProTable(props) {
|
|
732
741
|
}
|
733
742
|
|
734
743
|
(0, _react.useEffect)(function () {
|
735
|
-
|
744
|
+
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
736
745
|
|
746
|
+
// 监听 浏览器变化 更吸底状态
|
737
747
|
if (footerSuction) {
|
738
748
|
getFooterSuctionState();
|
739
749
|
|
740
750
|
window.onresize = function () {
|
741
751
|
getFooterSuctionState();
|
742
752
|
};
|
743
|
-
}
|
753
|
+
} // 如果不传 dataFilter,则在这里初始化请求
|
744
754
|
|
745
|
-
if (propsDataFilter) {
|
746
|
-
var _dataFilterForm3;
|
747
755
|
|
748
|
-
|
749
|
-
// 在请求发送之前 处理漏斗默认数据
|
750
|
-
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
756
|
+
var hasDataFilter = (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche = propsDataFilter.schema) === null || _propsDataFilter$sche === void 0 ? void 0 : _propsDataFilter$sche.length) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : (_propsDataFilter$sche2 = propsDataFilter.schema) === null || _propsDataFilter$sche2 === void 0 ? void 0 : _propsDataFilter$sche2.length) > 0;
|
751
757
|
|
752
|
-
|
753
|
-
|
754
|
-
} else {
|
755
|
-
if (requestWhenMount) {
|
756
|
-
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
758
|
+
if (requestWhenMount && !hasDataFilter) {
|
759
|
+
(0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
|
757
760
|
|
758
|
-
|
759
|
-
}
|
761
|
+
_request();
|
760
762
|
}
|
761
763
|
|
762
764
|
return function () {
|
@@ -770,7 +772,7 @@ var ProTable = function ProTable(props) {
|
|
770
772
|
|
771
773
|
actionRef.current = undefined;
|
772
774
|
};
|
773
|
-
}, [
|
775
|
+
}, []);
|
774
776
|
|
775
777
|
function onSort(dataIndex, order) {
|
776
778
|
var nextSort = _defineProperty({}, dataIndex, order);
|
@@ -782,26 +784,45 @@ var ProTable = function ProTable(props) {
|
|
782
784
|
|
783
785
|
|
784
786
|
var dataFilter = _objectSpread(_objectSpread({
|
785
|
-
mode: 'inline'
|
787
|
+
mode: 'inline',
|
788
|
+
forceClear: true
|
786
789
|
}, propsDataFilter), {}, {
|
790
|
+
onInit: function onInit(values) {
|
791
|
+
// 表单初始化请求处理
|
792
|
+
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit(values));
|
793
|
+
!fullscreenState && _request({}, false, values);
|
794
|
+
return true;
|
795
|
+
},
|
787
796
|
onFilter: function onFilter(values) {
|
788
797
|
var _actionRef$current6, _actionRef$current6$c;
|
789
798
|
|
799
|
+
// 全屏状态,判断全屏表单onFilter是否禁用
|
800
|
+
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
801
|
+
filterEnableRef.current.fullscreen = true;
|
802
|
+
return;
|
803
|
+
} // 非全屏状态,判断普通表单onFiler是否禁用
|
804
|
+
|
805
|
+
|
806
|
+
if (!fullscreenState && !filterEnableRef.current.normal) {
|
807
|
+
filterEnableRef.current.normal = true;
|
808
|
+
return;
|
809
|
+
}
|
810
|
+
|
790
811
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
|
791
812
|
|
792
813
|
(_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);
|
793
814
|
setCurrentPage(1);
|
794
815
|
|
795
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
816
|
+
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
796
817
|
},
|
797
|
-
onReset: function onReset() {
|
798
|
-
var
|
818
|
+
onReset: function onReset(values) {
|
819
|
+
var _dataFilterFormRef$cu3;
|
799
820
|
|
800
821
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
801
|
-
(
|
822
|
+
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
802
823
|
setCurrentPage(1);
|
803
824
|
|
804
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
825
|
+
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
805
826
|
}
|
806
827
|
});
|
807
828
|
|
@@ -885,21 +906,30 @@ var ProTable = function ProTable(props) {
|
|
885
906
|
|
886
907
|
var renderFooter = function renderFooter() {
|
887
908
|
function onChangePagination(currentPage) {
|
888
|
-
var _actionRef$current7, _actionRef$current7$c;
|
889
|
-
|
890
909
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
891
|
-
|
892
|
-
|
910
|
+
|
911
|
+
// 翻页默认清空选择
|
912
|
+
if (!reserveSelectedRecords) {
|
913
|
+
var _actionRef$current7, _actionRef$current7$c;
|
914
|
+
|
915
|
+
(_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);
|
916
|
+
}
|
917
|
+
|
893
918
|
setCurrentPage(currentPage);
|
894
919
|
|
895
920
|
_request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
|
896
921
|
}
|
897
922
|
|
898
923
|
function onChangePaginationSize(currentPageSize) {
|
899
|
-
var
|
924
|
+
var _request5;
|
925
|
+
|
926
|
+
// 翻页默认清空选择
|
927
|
+
if (!reserveSelectedRecords) {
|
928
|
+
var _actionRef$current8, _actionRef$current8$c;
|
929
|
+
|
930
|
+
(_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);
|
931
|
+
}
|
900
932
|
|
901
|
-
// 翻页暂时先清空选择
|
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);
|
903
933
|
setPageSize(currentPageSize);
|
904
934
|
setCurrentPage(1);
|
905
935
|
|
package/lib/table/index.scss
CHANGED
package/lib/table/typing.d.ts
CHANGED
@@ -3,13 +3,12 @@
|
|
3
3
|
*/
|
4
4
|
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
5
|
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
|
6
|
-
import { QueryFilterProps } from '../form';
|
6
|
+
import { QueryFilterProps, ProFormType } from '../form';
|
7
7
|
import { ProActionGroupProps, ProActionButtonProps } from '../actions';
|
8
8
|
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
9
9
|
import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
|
10
10
|
import { Method } from 'axios';
|
11
11
|
import React from 'react';
|
12
|
-
import type { Form as FormType } from '@formily/core';
|
13
12
|
declare type IFieldRenderProps = keyof ProFieldRenderProps;
|
14
13
|
/** 列record函数 */
|
15
14
|
declare type ProTableCellFunProp = (value: any, index: number, record: any, ...others: any) => any;
|
@@ -102,7 +101,7 @@ export declare type ProTableProps = {
|
|
102
101
|
/** 内置 rowSelection 变化时的回调 */
|
103
102
|
onChangeRowSelection?: (selectedRowKeys: string[]) => void;
|
104
103
|
/** 获取内置 rowSelection */
|
105
|
-
getRowSelection?: (rowSelection:
|
104
|
+
getRowSelection?: (rowSelection: innerRowSelectionType) => void;
|
106
105
|
/** 表格底部(左侧)配置 */
|
107
106
|
footerAction?: ProActionGroupProps | React.ReactNode;
|
108
107
|
/** 表格底部(右层)配置 */
|
@@ -130,6 +129,8 @@ export declare type ProTableProps = {
|
|
130
129
|
data: any[];
|
131
130
|
total?: number;
|
132
131
|
}>;
|
132
|
+
/** 翻页时是否保留之前批量选择数据 */
|
133
|
+
reserveSelectedRecords?: boolean;
|
133
134
|
/** 默认漏斗过滤条件 */
|
134
135
|
defaultFilterParams?: {
|
135
136
|
[key: string]: any[] | any;
|
@@ -189,9 +190,12 @@ export declare type ProTableActionType = {
|
|
189
190
|
/** 重置翻页器为1,不发送请求 */
|
190
191
|
resetPage?: () => void;
|
191
192
|
/** 获取数据过滤区表单实例 */
|
192
|
-
dataFilterForm?:
|
193
|
-
|
194
|
-
|
193
|
+
dataFilterForm?: ProFormType;
|
194
|
+
/** 用于在 mount 的时候获取到表单 ref */
|
195
|
+
dataFilterFormRef?: React.MutableRefObject<ProFormType>;
|
196
|
+
normalDataFilterForm?: ProFormType;
|
197
|
+
fullscreenDataFilterForm?: ProFormType;
|
198
|
+
filterEnableRef?: any;
|
195
199
|
/** 表格当前的数据 */
|
196
200
|
data?: any[];
|
197
201
|
} & ProTableActionTypeMutations;
|
@@ -239,7 +239,7 @@ var processRenderFunction = function processRenderFunction() {
|
|
239
239
|
var index = arguments.length > 2 ? arguments[2] : undefined;
|
240
240
|
var record = arguments.length > 3 ? arguments[3] : undefined;
|
241
241
|
// 当 ProField render 类型为 function 时。需要表格预先处理以塞入 record
|
242
|
-
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick'];
|
242
|
+
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
243
243
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
244
244
|
var _ref4 = _slicedToArray(_ref3, 2),
|
245
245
|
k = _ref4[0],
|
@@ -17,7 +17,7 @@ var _utils = require("@teamix/utils");
|
|
17
17
|
|
18
18
|
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
19
19
|
|
20
|
-
var _excluded = ["
|
20
|
+
var _excluded = ["_comment", "_shape", "status", "image", "icon", "title", "subTitle", "timeLeft", "content", "animation", "discription", "tags", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "dotRender"];
|
21
21
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
23
|
|
@@ -50,10 +50,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
50
50
|
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; }
|
51
51
|
|
52
52
|
var TimelineItem = _components.Timeline.Item;
|
53
|
-
var cls = (0, _utils.baseClass)('teamix-pro-
|
53
|
+
var cls = (0, _utils.baseClass)('teamix-pro-timeline');
|
54
54
|
|
55
|
-
var
|
56
|
-
var
|
55
|
+
var ProTimeLineItem = function ProTimeLineItem(props) {
|
56
|
+
var _props$_comment = props._comment,
|
57
|
+
_comment = _props$_comment === void 0 ? false : _props$_comment,
|
57
58
|
_shape = props._shape,
|
58
59
|
status = props.status,
|
59
60
|
image = props.image,
|
@@ -70,9 +71,6 @@ var VerStepItem = function VerStepItem(props) {
|
|
70
71
|
collapsed = props.collapsed,
|
71
72
|
onCollapse = props.onCollapse,
|
72
73
|
dotRender = props.dotRender,
|
73
|
-
_onClick = props.onClick,
|
74
|
-
percent = props.percent,
|
75
|
-
disabled = props.disabled,
|
76
74
|
others = _objectWithoutProperties(props, _excluded);
|
77
75
|
/** 内容去折叠相关 */
|
78
76
|
|
@@ -99,12 +97,12 @@ var VerStepItem = function VerStepItem(props) {
|
|
99
97
|
|
100
98
|
|
101
99
|
var formatTime = function formatTime(time) {
|
102
|
-
if (typeof time === 'string') return (0, _utils.dateFormat)(time, '', 'YYYY
|
100
|
+
if (typeof time === 'string') return (0, _utils.dateFormat)(time, '', 'YYYY-MM-DD hh:mm:ss');
|
103
101
|
return time;
|
104
102
|
};
|
105
103
|
|
106
104
|
var formatShape = function formatShape() {
|
107
|
-
if (['dot', '
|
105
|
+
if (['dot', 'circle'].includes(_shape)) return _shape;
|
108
106
|
return 'dot';
|
109
107
|
};
|
110
108
|
|
@@ -112,8 +110,17 @@ var VerStepItem = function VerStepItem(props) {
|
|
112
110
|
if (['success', 'fail', 'process', 'warning', 'wait'].includes(status)) return status;
|
113
111
|
return 'wait';
|
114
112
|
};
|
115
|
-
|
113
|
+
/**一些复用常数 */
|
114
|
+
|
116
115
|
|
116
|
+
var circle = formatShape() === 'circle';
|
117
|
+
var dot = formatShape() === 'dot';
|
118
|
+
var process = formatStatus() === 'process';
|
119
|
+
var success = formatStatus() === 'success';
|
120
|
+
var error = formatStatus() === 'fail';
|
121
|
+
var warning = formatStatus() === 'warning';
|
122
|
+
var wait = formatStatus() === 'wait';
|
123
|
+
/**对元素进行渲染 */
|
117
124
|
|
118
125
|
var renderImage = function renderImage() {
|
119
126
|
if (typeof image === 'string') {
|
@@ -139,28 +146,18 @@ var VerStepItem = function VerStepItem(props) {
|
|
139
146
|
className: (0, _classnames.default)(cls({
|
140
147
|
'time-left': true,
|
141
148
|
'time-left-dot': dot,
|
142
|
-
'time-left-circle':
|
149
|
+
'time-left-circle': circle
|
143
150
|
}))
|
144
151
|
}, formatTime(timeLeft));
|
145
152
|
}, [_shape, timeLeft]);
|
146
|
-
/**一些复用常数 */
|
147
|
-
|
148
|
-
var circle_icon = formatShape() === 'icon';
|
149
|
-
var circle_number = formatShape() === 'number';
|
150
|
-
var dot = formatShape() === 'dot';
|
151
|
-
var process = formatStatus() === 'process' && !disabled;
|
152
|
-
var success = formatStatus() === 'success' && !disabled;
|
153
|
-
var error = formatStatus() === 'fail' && !disabled;
|
154
|
-
var warning = formatStatus() === 'warning' && !disabled;
|
155
|
-
var wait = formatStatus() === 'wait' && !disabled;
|
156
153
|
var renderTitle = (0, _react.useCallback)(function () {
|
157
154
|
return /*#__PURE__*/_react.default.createElement("div", {
|
158
155
|
className: (0, _classnames.default)(cls({
|
159
156
|
wrapper: true,
|
160
157
|
'wrapper-dot': dot && !timeLeft,
|
161
|
-
'wrapper-circle':
|
158
|
+
'wrapper-circle': circle && !timeLeft,
|
162
159
|
'wrapper-time-left-dot': dot && timeLeft,
|
163
|
-
'wrapper-time-left-circle':
|
160
|
+
'wrapper-time-left-circle': circle && timeLeft
|
164
161
|
}))
|
165
162
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
166
163
|
className: (0, _classnames.default)(cls('wrapper-left'))
|
@@ -182,9 +179,7 @@ var VerStepItem = function VerStepItem(props) {
|
|
182
179
|
className: (0, _classnames.default)(cls('wrapper-right-top'))
|
183
180
|
}, title && /*#__PURE__*/_react.default.createElement("div", {
|
184
181
|
className: (0, _classnames.default)(cls({
|
185
|
-
'wrapper-right-top-title-info
|
186
|
-
'wrapper-right-top-title-info-active': process,
|
187
|
-
'wrapper-right-top-title-info-disabled': disabled
|
182
|
+
'wrapper-right-top-title-info': true
|
188
183
|
}))
|
189
184
|
}, title), tags && /*#__PURE__*/_react.default.createElement("div", {
|
190
185
|
className: (0, _classnames.default)(cls('wrapper-right-top-tag-info'))
|
@@ -200,47 +195,45 @@ var VerStepItem = function VerStepItem(props) {
|
|
200
195
|
'wrapper-right-content-info-open': showContent
|
201
196
|
}))
|
202
197
|
}, content))));
|
203
|
-
}, [_shape, timeLeft, image,
|
204
|
-
/**
|
198
|
+
}, [_shape, timeLeft, image, title, tags, subTitle, discription, content, collapsible, collapsed, defaultCollapsed, onCollapseChanged]);
|
199
|
+
/**
|
200
|
+
* 重新渲染 timeline 节点
|
201
|
+
* */
|
205
202
|
|
206
203
|
var renderNode = (0, _react.useCallback)(function () {
|
207
|
-
//
|
204
|
+
// shape 取 dot
|
208
205
|
var renderDot = function renderDot() {
|
209
206
|
return !icon ? /*#__PURE__*/_react.default.createElement("div", {
|
210
207
|
className: (0, _classnames.default)(cls({
|
211
|
-
'
|
212
|
-
'
|
213
|
-
'
|
214
|
-
'
|
215
|
-
'
|
216
|
-
'
|
217
|
-
'ver-step-item-render-wrapper-dot-wait': wait
|
208
|
+
'item-render-wrapper-dot': true,
|
209
|
+
'item-render-wrapper-dot-process': process,
|
210
|
+
'item-render-wrapper-dot-success': success,
|
211
|
+
'item-render-wrapper-dot-error': error,
|
212
|
+
'item-render-wrapper-dot-warning': warning,
|
213
|
+
'item-render-wrapper-dot-wait': wait
|
218
214
|
}))
|
219
215
|
}) : /*#__PURE__*/_react.default.createElement("div", {
|
220
216
|
className: (0, _classnames.default)(cls({
|
221
|
-
'
|
222
|
-
'
|
223
|
-
'
|
224
|
-
'
|
225
|
-
'
|
226
|
-
'ver-step-item-render-wrapper-icon-wait': wait
|
217
|
+
'item-render-wrapper-icon-process': process,
|
218
|
+
'item-render-wrapper-icon-success': success,
|
219
|
+
'item-render-wrapper-icon-error': error,
|
220
|
+
'item-render-wrapper-icon-warning': warning,
|
221
|
+
'item-render-wrapper-icon-wait': wait
|
227
222
|
}))
|
228
223
|
}, /*#__PURE__*/_react.default.createElement(_components.Icon, {
|
229
224
|
type: icon,
|
230
225
|
size: "small"
|
231
226
|
}));
|
232
|
-
}; //
|
227
|
+
}; // shape 取 circle
|
233
228
|
|
234
229
|
|
235
230
|
var renderCircle = function renderCircle() {
|
236
231
|
if (dotRender) return /*#__PURE__*/_react.default.createElement("div", {
|
237
|
-
className: (0, _classnames.default)(cls('
|
232
|
+
className: (0, _classnames.default)(cls('item-render-wrapper'))
|
238
233
|
}, dotRender());
|
239
234
|
|
240
|
-
var
|
241
|
-
|
242
|
-
className: (0, _classnames.default)(cls('ver-step-item-render-wrapper-circle-percent'))
|
243
|
-
}, percent, "%");
|
235
|
+
var renderCircleItem = function renderCircleItem() {
|
236
|
+
// 有传入 icon 渲染 icon
|
244
237
|
if (icon) return /*#__PURE__*/_react.default.createElement(_components.Icon, {
|
245
238
|
type: icon,
|
246
239
|
size: "small"
|
@@ -257,33 +250,30 @@ var VerStepItem = function VerStepItem(props) {
|
|
257
250
|
type: "exclamation-line",
|
258
251
|
size: "small"
|
259
252
|
});
|
260
|
-
if (process &&
|
253
|
+
if (process && circle) return /*#__PURE__*/_react.default.createElement(_icon.default, {
|
261
254
|
type: "loading-line",
|
262
255
|
size: "small"
|
263
256
|
});
|
264
|
-
|
257
|
+
return /*#__PURE__*/_react.default.createElement(_icon.default, {
|
265
258
|
type: "more-line",
|
266
259
|
size: "small"
|
267
260
|
});
|
268
|
-
return _index + 1;
|
269
261
|
};
|
270
262
|
|
271
263
|
return /*#__PURE__*/_react.default.createElement("div", {
|
272
264
|
className: (0, _classnames.default)(cls({
|
273
|
-
'
|
274
|
-
'
|
275
|
-
'
|
276
|
-
'
|
277
|
-
'
|
278
|
-
'
|
279
|
-
'ver-step-item-render-wrapper-circle-wait': wait,
|
280
|
-
'ver-step-item-render-wrapper-percent-color': percent
|
265
|
+
'item-render-wrapper-circle': true,
|
266
|
+
'item-render-wrapper-circle-process': process,
|
267
|
+
'item-render-wrapper-circle-success': success,
|
268
|
+
'item-render-wrapper-circle-error': error,
|
269
|
+
'item-render-wrapper-circle-warning': warning,
|
270
|
+
'item-render-wrapper-circle-wait': wait
|
281
271
|
}))
|
282
|
-
},
|
272
|
+
}, renderCircleItem());
|
283
273
|
};
|
284
274
|
|
285
275
|
var renderStateNode = function renderStateNode() {
|
286
|
-
if (
|
276
|
+
if (circle) {
|
287
277
|
return renderCircle();
|
288
278
|
}
|
289
279
|
|
@@ -291,17 +281,13 @@ var VerStepItem = function VerStepItem(props) {
|
|
291
281
|
};
|
292
282
|
|
293
283
|
return /*#__PURE__*/_react.default.createElement("div", {
|
294
|
-
className: (0, _classnames.default)(cls('
|
284
|
+
className: (0, _classnames.default)(cls('item'))
|
295
285
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
296
286
|
className: (0, _classnames.default)(cls({
|
297
|
-
'
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
return disabled !== null && disabled !== void 0 ? disabled : _onClick === null || _onClick === void 0 ? void 0 : _onClick(_index);
|
302
|
-
}
|
303
|
-
}, renderStateNode()));
|
304
|
-
}, [_index, _shape, icon, disabled, status, percent, dotRender]);
|
287
|
+
'item-render-wrapper': true
|
288
|
+
}))
|
289
|
+
}, !_comment && renderStateNode()));
|
290
|
+
}, [_shape, icon, status, dotRender]);
|
305
291
|
return /*#__PURE__*/_react.default.createElement(TimelineItem, _objectSpread({
|
306
292
|
title: renderTitle(),
|
307
293
|
dot: renderNode(),
|
@@ -310,6 +296,6 @@ var VerStepItem = function VerStepItem(props) {
|
|
310
296
|
}, others));
|
311
297
|
};
|
312
298
|
|
313
|
-
|
314
|
-
|
299
|
+
ProTimeLineItem.displayName = 'ProTimeLineItem';
|
300
|
+
var _default = ProTimeLineItem;
|
315
301
|
exports.default = _default;
|