@teamix/pro 1.2.32 → 1.3.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 +16443 -17407
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +58 -9
- package/es/form/Filter/AdvancedFilter.js +4 -4
- package/es/form/Filter/LightFilter.js +22 -15
- package/es/form/Filter/index.d.ts +5 -9
- package/es/form/Filter/index.js +463 -152
- package/es/form/Filter/index.scss +33 -11
- package/es/form/Filter/index2.d.ts +9 -5
- package/es/form/Filter/index2.js +154 -370
- package/es/form/Filter/index2.scss +11 -33
- 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 +13 -8
- package/es/form/SchemaForm/index.js +5 -5
- 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/index.d.ts +3 -3
- package/es/form/index.js +3 -3
- package/es/form/typing.d.ts +11 -2
- package/es/index.d.ts +4 -4
- package/es/index.js +4 -4
- package/es/info/components/ProInfoItem/index.js +2 -1
- package/es/info/components/ProInfoItem/index.scss +4 -0
- package/es/nocode/configurators/PageHeader.js +2 -2
- package/es/page-header/index.js +3 -3
- package/es/table/components/Layout/index.js +29 -23
- package/es/table/components/Layout/index.scss +7 -0
- package/es/table/components/Pagination/index.js +11 -1
- package/es/table/components/ToolBar/Fullscreen.js +32 -4
- package/es/table/components/ToolBar/index.scss +1 -0
- package/es/table/index.js +50 -31
- package/es/table/typing.d.ts +3 -0
- 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.js +57 -10
- package/lib/form/Filter/AdvancedFilter.js +4 -4
- package/lib/form/Filter/LightFilter.js +21 -15
- package/lib/form/Filter/index.d.ts +5 -9
- package/lib/form/Filter/index.js +478 -154
- package/lib/form/Filter/index.scss +33 -11
- package/lib/form/Filter/index2.d.ts +9 -5
- package/lib/form/Filter/index2.js +154 -383
- package/lib/form/Filter/index2.scss +11 -33
- 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 +13 -8
- package/lib/form/SchemaForm/index.js +5 -5
- 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/index.d.ts +3 -3
- package/lib/form/index.js +8 -8
- package/lib/form/typing.d.ts +11 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +10 -10
- package/lib/info/components/ProInfoItem/index.js +2 -1
- package/lib/info/components/ProInfoItem/index.scss +4 -0
- package/lib/nocode/configurators/PageHeader.js +2 -2
- package/lib/page-header/index.js +2 -2
- package/lib/table/components/Layout/index.js +29 -23
- package/lib/table/components/Layout/index.scss +7 -0
- package/lib/table/components/Pagination/index.js +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +30 -3
- package/lib/table/components/ToolBar/index.scss +1 -0
- package/lib/table/index.js +50 -31
- package/lib/table/typing.d.ts +3 -0
- 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/dist/212.js +0 -155705
- package/dist/fonts/codicon.ttf +0 -0
- 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
@@ -23,7 +23,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
23
23
|
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; }
|
24
24
|
|
25
25
|
// 自适应宽度的翻页器
|
26
|
-
import React, { useState } from 'react';
|
26
|
+
import React, { useState, useEffect } from 'react';
|
27
27
|
import { Pagination, Balloon, Select, Button, Input, Icon } from '@alicloudfe/components';
|
28
28
|
import { getMessage, baseClass } from '@teamix/utils';
|
29
29
|
import { useResponsiveProps } from '@teamix/hooks';
|
@@ -46,6 +46,13 @@ export default (function (props) {
|
|
46
46
|
responsiveProps = _useResponsiveProps.responsiveProps,
|
47
47
|
paginationWrapperRef = _useResponsiveProps.ref;
|
48
48
|
|
49
|
+
useEffect(function () {
|
50
|
+
// size='mini' 模式下 current 受控
|
51
|
+
if (responsiveProps === 'mini') {
|
52
|
+
setCurrentPage(current);
|
53
|
+
}
|
54
|
+
}, [current]);
|
55
|
+
|
49
56
|
var _useState = useState(false),
|
50
57
|
_useState2 = _slicedToArray(_useState, 2),
|
51
58
|
visible = _useState2[0],
|
@@ -82,6 +89,9 @@ export default (function (props) {
|
|
82
89
|
text: true,
|
83
90
|
onMouseEnter: function onMouseEnter() {
|
84
91
|
return setVisible(true);
|
92
|
+
},
|
93
|
+
style: {
|
94
|
+
lineHeight: '18px'
|
85
95
|
}
|
86
96
|
}, getMessage('total', {
|
87
97
|
total: total
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect } from 'react';
|
2
2
|
import { Message, Overlay } from '@alicloudfe/components';
|
3
3
|
import './index.scss';
|
4
|
-
import { getMessage } from '@teamix/utils';
|
4
|
+
import { getMessage, getValidValues } from '@teamix/utils';
|
5
5
|
|
6
6
|
var FullScreen = function FullScreen(props) {
|
7
7
|
var children = props.children,
|
@@ -9,7 +9,8 @@ var FullScreen = function FullScreen(props) {
|
|
9
9
|
actionRef = props.actionRef;
|
10
10
|
var _actionRef$current = actionRef.current,
|
11
11
|
normalDataFilterForm = _actionRef$current.normalDataFilterForm,
|
12
|
-
fullscreenDataFilterForm = _actionRef$current.fullscreenDataFilterForm
|
12
|
+
fullscreenDataFilterForm = _actionRef$current.fullscreenDataFilterForm,
|
13
|
+
filterEnableRef = _actionRef$current.filterEnableRef;
|
13
14
|
|
14
15
|
var closeByESC = function closeByESC(e) {
|
15
16
|
if (visible && e.code === 'Escape') {
|
@@ -28,12 +29,39 @@ var FullScreen = function FullScreen(props) {
|
|
28
29
|
}, [visible, actionRef]);
|
29
30
|
|
30
31
|
var afterClose = function afterClose() {
|
31
|
-
|
32
|
+
// 判断全屏前后筛选表单值是否有改变
|
33
|
+
var n = JSON.stringify(getValidValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values));
|
34
|
+
var f = JSON.stringify(getValidValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values));
|
35
|
+
|
36
|
+
if (n === f) {
|
37
|
+
// 关闭全屏后,表单值未变化,开启普通表单onFilter
|
38
|
+
filterEnableRef.current.normal = true;
|
39
|
+
} else {
|
40
|
+
// 关闭全屏后,表单值有变化,修改表单值
|
41
|
+
normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values);
|
42
|
+
} // 关闭全屏后,关闭全屏表单onFilter
|
43
|
+
|
44
|
+
|
45
|
+
filterEnableRef.current.fullscreen = false;
|
32
46
|
}; // 全屏开启之后
|
33
47
|
|
34
48
|
|
35
49
|
var afterOpen = function afterOpen() {
|
36
|
-
|
50
|
+
// 判断全屏前后筛选表单值是否有改变
|
51
|
+
var n = JSON.stringify(getValidValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values));
|
52
|
+
var f = JSON.stringify(getValidValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values));
|
53
|
+
|
54
|
+
if (n === f) {
|
55
|
+
// 全屏后,表单值未变化,开启全屏表单onFilter
|
56
|
+
filterEnableRef.current.fullscreen = true;
|
57
|
+
} else {
|
58
|
+
// 全屏后,表单值变化,修改表单值
|
59
|
+
fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.setValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values);
|
60
|
+
} // 全屏后,关闭普通表单onFilter
|
61
|
+
|
62
|
+
|
63
|
+
filterEnableRef.current.normal = false; // 消息提示
|
64
|
+
|
37
65
|
Message.show({
|
38
66
|
type: 'notice',
|
39
67
|
content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, getMessage('press')), /*#__PURE__*/React.createElement("span", {
|
package/es/table/index.js
CHANGED
@@ -121,7 +121,7 @@ var globalFormatSort = function globalFormatSort(sort) {
|
|
121
121
|
};
|
122
122
|
|
123
123
|
var ProTable = function ProTable(props) {
|
124
|
-
var _rowSelection$selecte
|
124
|
+
var _rowSelection$selecte;
|
125
125
|
|
126
126
|
var header = props.header,
|
127
127
|
className = props.className,
|
@@ -287,16 +287,21 @@ var ProTable = function ProTable(props) {
|
|
287
287
|
var _useState27 = useState(false),
|
288
288
|
_useState28 = _slicedToArray(_useState27, 2),
|
289
289
|
fullscreenState = _useState28[0],
|
290
|
-
setFullscreenState = _useState28[1]; //
|
290
|
+
setFullscreenState = _useState28[1]; // 切换全屏搜索开关
|
291
291
|
|
292
292
|
|
293
|
+
var filterEnableRef = useRef({
|
294
|
+
fullscreen: false,
|
295
|
+
normal: true
|
296
|
+
}); // 非全屏状态下的
|
297
|
+
|
293
298
|
var normalDataFilterFormRef = useRef();
|
294
299
|
var fullscreenDataFilterFormRef = useRef();
|
295
300
|
var normalDataFilterForm = normalDataFilterFormRef.current;
|
296
301
|
var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
|
297
302
|
|
298
|
-
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
|
299
|
-
|
303
|
+
var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
|
304
|
+
// 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
|
300
305
|
|
301
306
|
var _useState29 = useState(false),
|
302
307
|
_useState30 = _slicedToArray(_useState29, 2),
|
@@ -505,12 +510,12 @@ var ProTable = function ProTable(props) {
|
|
505
510
|
_request(params);
|
506
511
|
},
|
507
512
|
reset: function reset() {
|
508
|
-
var _actionRef$current4, _actionRef$current4$s,
|
513
|
+
var _actionRef$current4, _actionRef$current4$s, _dataFilterFormRef$cu;
|
509
514
|
|
510
515
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
|
511
516
|
|
512
517
|
(_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, {});
|
513
|
-
(
|
518
|
+
(_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
|
514
519
|
setCurrentPage(1);
|
515
520
|
|
516
521
|
_request(_defineProperty({}, targetPageKey, 1));
|
@@ -532,9 +537,11 @@ var ProTable = function ProTable(props) {
|
|
532
537
|
pageSize: pageSize
|
533
538
|
},
|
534
539
|
data: data,
|
535
|
-
dataFilterForm:
|
540
|
+
dataFilterForm: dataFilterFormRef.current,
|
541
|
+
dataFilterFormRef: dataFilterFormRef,
|
536
542
|
normalDataFilterForm: normalDataFilterForm,
|
537
543
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
544
|
+
filterEnableRef: filterEnableRef,
|
538
545
|
resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
|
539
546
|
getHeaderHeight().then(function (height) {
|
540
547
|
setHeaderHeight(height);
|
@@ -623,8 +630,8 @@ var ProTable = function ProTable(props) {
|
|
623
630
|
}
|
624
631
|
}); // 请求函数
|
625
632
|
|
626
|
-
function _request(params, noLoading) {
|
627
|
-
var
|
633
|
+
function _request(params, noLoading, filterParams) {
|
634
|
+
var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
|
628
635
|
|
629
636
|
// 如果没有传 url 且没有 customRequest,直接返回
|
630
637
|
if (!url && !customRequest) {
|
@@ -637,7 +644,7 @@ var ProTable = function ProTable(props) {
|
|
637
644
|
|
638
645
|
var sortParams = targetFormatSort(sort); // 筛选区请求参数
|
639
646
|
|
640
|
-
var dataFilterParams =
|
647
|
+
var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values; // 列过滤请求参数
|
641
648
|
|
642
649
|
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 : {}; // 格式化后的请求参数
|
643
650
|
|
@@ -688,31 +695,24 @@ var ProTable = function ProTable(props) {
|
|
688
695
|
}
|
689
696
|
|
690
697
|
useEffect(function () {
|
691
|
-
|
698
|
+
var _propsDataFilter$sche, _propsDataFilter$sche2;
|
692
699
|
|
700
|
+
// 监听 浏览器变化 更吸底状态
|
693
701
|
if (footerSuction) {
|
694
702
|
getFooterSuctionState();
|
695
703
|
|
696
704
|
window.onresize = function () {
|
697
705
|
getFooterSuctionState();
|
698
706
|
};
|
699
|
-
}
|
707
|
+
} // 如果不传 dataFilter,则在这里初始化请求
|
700
708
|
|
701
|
-
if (propsDataFilter) {
|
702
|
-
var _dataFilterForm3;
|
703
709
|
|
704
|
-
|
705
|
-
// 在请求发送之前 处理漏斗默认数据
|
706
|
-
processDefaultFilter(propsColumns, actionRef, defaultFilterParams);
|
710
|
+
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;
|
707
711
|
|
708
|
-
|
709
|
-
|
710
|
-
} else {
|
711
|
-
if (requestWhenMount) {
|
712
|
-
processDefaultFilter(propsColumns, actionRef, defaultFilterParams);
|
712
|
+
if (requestWhenMount && !hasDataFilter) {
|
713
|
+
processDefaultFilter(propsColumns, actionRef, defaultFilterParams);
|
713
714
|
|
714
|
-
|
715
|
-
}
|
715
|
+
_request();
|
716
716
|
}
|
717
717
|
|
718
718
|
return function () {
|
@@ -726,7 +726,7 @@ var ProTable = function ProTable(props) {
|
|
726
726
|
|
727
727
|
actionRef.current = undefined;
|
728
728
|
};
|
729
|
-
}, [
|
729
|
+
}, []);
|
730
730
|
|
731
731
|
function onSort(dataIndex, order) {
|
732
732
|
var nextSort = _defineProperty({}, dataIndex, order);
|
@@ -738,26 +738,45 @@ var ProTable = function ProTable(props) {
|
|
738
738
|
|
739
739
|
|
740
740
|
var dataFilter = _objectSpread(_objectSpread({
|
741
|
-
mode: 'inline'
|
741
|
+
mode: 'inline',
|
742
|
+
forceClear: true
|
742
743
|
}, propsDataFilter), {}, {
|
744
|
+
onInit: function onInit(values) {
|
745
|
+
// 表单初始化请求处理
|
746
|
+
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit(values));
|
747
|
+
!fullscreenState && _request({}, false, values);
|
748
|
+
return true;
|
749
|
+
},
|
743
750
|
onFilter: function onFilter(values) {
|
744
751
|
var _actionRef$current6, _actionRef$current6$c;
|
745
752
|
|
753
|
+
// 全屏状态,判断全屏表单onFilter是否禁用
|
754
|
+
if (fullscreenState && !filterEnableRef.current.fullscreen) {
|
755
|
+
filterEnableRef.current.fullscreen = true;
|
756
|
+
return;
|
757
|
+
} // 非全屏状态,判断普通表单onFiler是否禁用
|
758
|
+
|
759
|
+
|
760
|
+
if (!fullscreenState && !filterEnableRef.current.normal) {
|
761
|
+
filterEnableRef.current.normal = true;
|
762
|
+
return;
|
763
|
+
}
|
764
|
+
|
746
765
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
|
747
766
|
|
748
767
|
(_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);
|
749
768
|
setCurrentPage(1);
|
750
769
|
|
751
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
770
|
+
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
752
771
|
},
|
753
|
-
onReset: function onReset() {
|
754
|
-
var
|
772
|
+
onReset: function onReset(values) {
|
773
|
+
var _dataFilterFormRef$cu3;
|
755
774
|
|
756
775
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
|
757
|
-
(
|
776
|
+
(_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
|
758
777
|
setCurrentPage(1);
|
759
778
|
|
760
|
-
_request(_defineProperty({}, targetPageKey, 1));
|
779
|
+
_request(_defineProperty({}, targetPageKey, 1), false, values);
|
761
780
|
}
|
762
781
|
});
|
763
782
|
|
package/es/table/typing.d.ts
CHANGED
@@ -190,8 +190,11 @@ export declare type ProTableActionType = {
|
|
190
190
|
resetPage?: () => void;
|
191
191
|
/** 获取数据过滤区表单实例 */
|
192
192
|
dataFilterForm?: FormType;
|
193
|
+
/** 用于在 mount 的时候获取到表单 ref */
|
194
|
+
dataFilterFormRef?: React.MutableRefObject<FormType>;
|
193
195
|
normalDataFilterForm?: FormType;
|
194
196
|
fullscreenDataFilterForm?: FormType;
|
197
|
+
filterEnableRef?: any;
|
195
198
|
/** 表格当前的数据 */
|
196
199
|
data?: any[];
|
197
200
|
} & ProTableActionTypeMutations;
|
@@ -223,7 +223,7 @@ var processRenderFunction = function processRenderFunction() {
|
|
223
223
|
var index = arguments.length > 2 ? arguments[2] : undefined;
|
224
224
|
var record = arguments.length > 3 ? arguments[3] : undefined;
|
225
225
|
// 当 ProField render 类型为 function 时。需要表格预先处理以塞入 record
|
226
|
-
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick'];
|
226
|
+
var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick', 'extra', 'prefixExtra'];
|
227
227
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
228
228
|
var _ref4 = _slicedToArray(_ref3, 2),
|
229
229
|
k = _ref4[0],
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["
|
1
|
+
var _excluded = ["_comment", "_shape", "status", "image", "icon", "title", "subTitle", "timeLeft", "content", "animation", "discription", "tags", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "dotRender"];
|
2
2
|
|
3
3
|
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; }
|
4
4
|
|
@@ -24,7 +24,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
24
24
|
|
25
25
|
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; }
|
26
26
|
|
27
|
-
import React, {
|
27
|
+
import React, { useCallback, useState } from 'react';
|
28
28
|
import './index.scss';
|
29
29
|
import { Icon, Timeline } from '@alicloudfe/components';
|
30
30
|
import classnames from 'classnames';
|
@@ -32,10 +32,11 @@ import { baseClass, dateFormat } from '@teamix/utils';
|
|
32
32
|
import { renderTags } from '@teamix/utils';
|
33
33
|
import TeamixIcon from '@teamix/icon';
|
34
34
|
var TimelineItem = Timeline.Item;
|
35
|
-
var cls = baseClass('teamix-pro-
|
35
|
+
var cls = baseClass('teamix-pro-timeline');
|
36
36
|
|
37
|
-
var
|
38
|
-
var
|
37
|
+
var ProTimeLineItem = function ProTimeLineItem(props) {
|
38
|
+
var _props$_comment = props._comment,
|
39
|
+
_comment = _props$_comment === void 0 ? false : _props$_comment,
|
39
40
|
_shape = props._shape,
|
40
41
|
status = props.status,
|
41
42
|
image = props.image,
|
@@ -52,9 +53,6 @@ var VerStepItem = function VerStepItem(props) {
|
|
52
53
|
collapsed = props.collapsed,
|
53
54
|
onCollapse = props.onCollapse,
|
54
55
|
dotRender = props.dotRender,
|
55
|
-
_onClick = props.onClick,
|
56
|
-
percent = props.percent,
|
57
|
-
disabled = props.disabled,
|
58
56
|
others = _objectWithoutProperties(props, _excluded);
|
59
57
|
/** 内容去折叠相关 */
|
60
58
|
|
@@ -81,12 +79,12 @@ var VerStepItem = function VerStepItem(props) {
|
|
81
79
|
|
82
80
|
|
83
81
|
var formatTime = function formatTime(time) {
|
84
|
-
if (typeof time === 'string') return dateFormat(time, '', 'YYYY
|
82
|
+
if (typeof time === 'string') return dateFormat(time, '', 'YYYY-MM-DD hh:mm:ss');
|
85
83
|
return time;
|
86
84
|
};
|
87
85
|
|
88
86
|
var formatShape = function formatShape() {
|
89
|
-
if (['dot', '
|
87
|
+
if (['dot', 'circle'].includes(_shape)) return _shape;
|
90
88
|
return 'dot';
|
91
89
|
};
|
92
90
|
|
@@ -94,8 +92,17 @@ var VerStepItem = function VerStepItem(props) {
|
|
94
92
|
if (['success', 'fail', 'process', 'warning', 'wait'].includes(status)) return status;
|
95
93
|
return 'wait';
|
96
94
|
};
|
97
|
-
|
95
|
+
/**一些复用常数 */
|
96
|
+
|
98
97
|
|
98
|
+
var circle = formatShape() === 'circle';
|
99
|
+
var dot = formatShape() === 'dot';
|
100
|
+
var process = formatStatus() === 'process';
|
101
|
+
var success = formatStatus() === 'success';
|
102
|
+
var error = formatStatus() === 'fail';
|
103
|
+
var warning = formatStatus() === 'warning';
|
104
|
+
var wait = formatStatus() === 'wait';
|
105
|
+
/**对元素进行渲染 */
|
99
106
|
|
100
107
|
var renderImage = function renderImage() {
|
101
108
|
if (typeof image === 'string') {
|
@@ -121,28 +128,18 @@ var VerStepItem = function VerStepItem(props) {
|
|
121
128
|
className: classnames(cls({
|
122
129
|
'time-left': true,
|
123
130
|
'time-left-dot': dot,
|
124
|
-
'time-left-circle':
|
131
|
+
'time-left-circle': circle
|
125
132
|
}))
|
126
133
|
}, formatTime(timeLeft));
|
127
134
|
}, [_shape, timeLeft]);
|
128
|
-
/**一些复用常数 */
|
129
|
-
|
130
|
-
var circle_icon = formatShape() === 'icon';
|
131
|
-
var circle_number = formatShape() === 'number';
|
132
|
-
var dot = formatShape() === 'dot';
|
133
|
-
var process = formatStatus() === 'process' && !disabled;
|
134
|
-
var success = formatStatus() === 'success' && !disabled;
|
135
|
-
var error = formatStatus() === 'fail' && !disabled;
|
136
|
-
var warning = formatStatus() === 'warning' && !disabled;
|
137
|
-
var wait = formatStatus() === 'wait' && !disabled;
|
138
135
|
var renderTitle = useCallback(function () {
|
139
136
|
return /*#__PURE__*/React.createElement("div", {
|
140
137
|
className: classnames(cls({
|
141
138
|
wrapper: true,
|
142
139
|
'wrapper-dot': dot && !timeLeft,
|
143
|
-
'wrapper-circle':
|
140
|
+
'wrapper-circle': circle && !timeLeft,
|
144
141
|
'wrapper-time-left-dot': dot && timeLeft,
|
145
|
-
'wrapper-time-left-circle':
|
142
|
+
'wrapper-time-left-circle': circle && timeLeft
|
146
143
|
}))
|
147
144
|
}, /*#__PURE__*/React.createElement("div", {
|
148
145
|
className: classnames(cls('wrapper-left'))
|
@@ -164,9 +161,7 @@ var VerStepItem = function VerStepItem(props) {
|
|
164
161
|
className: classnames(cls('wrapper-right-top'))
|
165
162
|
}, title && /*#__PURE__*/React.createElement("div", {
|
166
163
|
className: classnames(cls({
|
167
|
-
'wrapper-right-top-title-info
|
168
|
-
'wrapper-right-top-title-info-active': process,
|
169
|
-
'wrapper-right-top-title-info-disabled': disabled
|
164
|
+
'wrapper-right-top-title-info': true
|
170
165
|
}))
|
171
166
|
}, title), tags && /*#__PURE__*/React.createElement("div", {
|
172
167
|
className: classnames(cls('wrapper-right-top-tag-info'))
|
@@ -182,47 +177,45 @@ var VerStepItem = function VerStepItem(props) {
|
|
182
177
|
'wrapper-right-content-info-open': showContent
|
183
178
|
}))
|
184
179
|
}, content))));
|
185
|
-
}, [_shape, timeLeft, image,
|
186
|
-
/**
|
180
|
+
}, [_shape, timeLeft, image, title, tags, subTitle, discription, content, collapsible, collapsed, defaultCollapsed, onCollapseChanged]);
|
181
|
+
/**
|
182
|
+
* 重新渲染 timeline 节点
|
183
|
+
* */
|
187
184
|
|
188
185
|
var renderNode = useCallback(function () {
|
189
|
-
//
|
186
|
+
// shape 取 dot
|
190
187
|
var renderDot = function renderDot() {
|
191
188
|
return !icon ? /*#__PURE__*/React.createElement("div", {
|
192
189
|
className: classnames(cls({
|
193
|
-
'
|
194
|
-
'
|
195
|
-
'
|
196
|
-
'
|
197
|
-
'
|
198
|
-
'
|
199
|
-
'ver-step-item-render-wrapper-dot-wait': wait
|
190
|
+
'item-render-wrapper-dot': true,
|
191
|
+
'item-render-wrapper-dot-process': process,
|
192
|
+
'item-render-wrapper-dot-success': success,
|
193
|
+
'item-render-wrapper-dot-error': error,
|
194
|
+
'item-render-wrapper-dot-warning': warning,
|
195
|
+
'item-render-wrapper-dot-wait': wait
|
200
196
|
}))
|
201
197
|
}) : /*#__PURE__*/React.createElement("div", {
|
202
198
|
className: classnames(cls({
|
203
|
-
'
|
204
|
-
'
|
205
|
-
'
|
206
|
-
'
|
207
|
-
'
|
208
|
-
'ver-step-item-render-wrapper-icon-wait': wait
|
199
|
+
'item-render-wrapper-icon-process': process,
|
200
|
+
'item-render-wrapper-icon-success': success,
|
201
|
+
'item-render-wrapper-icon-error': error,
|
202
|
+
'item-render-wrapper-icon-warning': warning,
|
203
|
+
'item-render-wrapper-icon-wait': wait
|
209
204
|
}))
|
210
205
|
}, /*#__PURE__*/React.createElement(Icon, {
|
211
206
|
type: icon,
|
212
207
|
size: "small"
|
213
208
|
}));
|
214
|
-
}; //
|
209
|
+
}; // shape 取 circle
|
215
210
|
|
216
211
|
|
217
212
|
var renderCircle = function renderCircle() {
|
218
213
|
if (dotRender) return /*#__PURE__*/React.createElement("div", {
|
219
|
-
className: classnames(cls('
|
214
|
+
className: classnames(cls('item-render-wrapper'))
|
220
215
|
}, dotRender());
|
221
216
|
|
222
|
-
var
|
223
|
-
|
224
|
-
className: classnames(cls('ver-step-item-render-wrapper-circle-percent'))
|
225
|
-
}, percent, "%");
|
217
|
+
var renderCircleItem = function renderCircleItem() {
|
218
|
+
// 有传入 icon 渲染 icon
|
226
219
|
if (icon) return /*#__PURE__*/React.createElement(Icon, {
|
227
220
|
type: icon,
|
228
221
|
size: "small"
|
@@ -239,33 +232,30 @@ var VerStepItem = function VerStepItem(props) {
|
|
239
232
|
type: "exclamation-line",
|
240
233
|
size: "small"
|
241
234
|
});
|
242
|
-
if (process &&
|
235
|
+
if (process && circle) return /*#__PURE__*/React.createElement(TeamixIcon, {
|
243
236
|
type: "loading-line",
|
244
237
|
size: "small"
|
245
238
|
});
|
246
|
-
|
239
|
+
return /*#__PURE__*/React.createElement(TeamixIcon, {
|
247
240
|
type: "more-line",
|
248
241
|
size: "small"
|
249
242
|
});
|
250
|
-
return _index + 1;
|
251
243
|
};
|
252
244
|
|
253
245
|
return /*#__PURE__*/React.createElement("div", {
|
254
246
|
className: classnames(cls({
|
255
|
-
'
|
256
|
-
'
|
257
|
-
'
|
258
|
-
'
|
259
|
-
'
|
260
|
-
'
|
261
|
-
'ver-step-item-render-wrapper-circle-wait': wait,
|
262
|
-
'ver-step-item-render-wrapper-percent-color': percent
|
247
|
+
'item-render-wrapper-circle': true,
|
248
|
+
'item-render-wrapper-circle-process': process,
|
249
|
+
'item-render-wrapper-circle-success': success,
|
250
|
+
'item-render-wrapper-circle-error': error,
|
251
|
+
'item-render-wrapper-circle-warning': warning,
|
252
|
+
'item-render-wrapper-circle-wait': wait
|
263
253
|
}))
|
264
|
-
},
|
254
|
+
}, renderCircleItem());
|
265
255
|
};
|
266
256
|
|
267
257
|
var renderStateNode = function renderStateNode() {
|
268
|
-
if (
|
258
|
+
if (circle) {
|
269
259
|
return renderCircle();
|
270
260
|
}
|
271
261
|
|
@@ -273,17 +263,13 @@ var VerStepItem = function VerStepItem(props) {
|
|
273
263
|
};
|
274
264
|
|
275
265
|
return /*#__PURE__*/React.createElement("div", {
|
276
|
-
className: classnames(cls('
|
266
|
+
className: classnames(cls('item'))
|
277
267
|
}, /*#__PURE__*/React.createElement("div", {
|
278
268
|
className: classnames(cls({
|
279
|
-
'
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
return disabled !== null && disabled !== void 0 ? disabled : _onClick === null || _onClick === void 0 ? void 0 : _onClick(_index);
|
284
|
-
}
|
285
|
-
}, renderStateNode()));
|
286
|
-
}, [_index, _shape, icon, disabled, status, percent, dotRender]);
|
269
|
+
'item-render-wrapper': true
|
270
|
+
}))
|
271
|
+
}, !_comment && renderStateNode()));
|
272
|
+
}, [_shape, icon, status, dotRender]);
|
287
273
|
return /*#__PURE__*/React.createElement(TimelineItem, _objectSpread({
|
288
274
|
title: renderTitle(),
|
289
275
|
dot: renderNode(),
|
@@ -292,4 +278,5 @@ var VerStepItem = function VerStepItem(props) {
|
|
292
278
|
}, others));
|
293
279
|
};
|
294
280
|
|
295
|
-
|
281
|
+
ProTimeLineItem.displayName = 'ProTimeLineItem';
|
282
|
+
export default ProTimeLineItem;
|