@zat-design/sisyphus-react 3.5.1 → 3.5.2
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/index.esm.css +14 -6
- package/dist/less.esm.css +11 -6
- package/es/ProDownload/index.js +6 -3
- package/es/ProDownload/propsType.d.ts +18 -13
- package/es/ProDownload/utils.d.ts +5 -0
- package/es/ProDownload/utils.js +14 -13
- package/es/ProEditTable/components/DndWrapper/index.d.ts +3 -1
- package/es/ProEditTable/components/DndWrapper/index.js +17 -8
- package/es/ProEditTable/index.js +6 -2
- package/es/ProEditTable/propsType.d.ts +3 -0
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Group.js +3 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/components/Tag.js +3 -1
- package/es/ProEnum/index.js +2 -1
- package/es/ProEnum/propsType.d.ts +2 -0
- package/es/ProForm/components/base/DatePicker/index.js +21 -3
- package/es/ProForm/components/base/RangePicker/index.js +22 -3
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +3 -1
- package/es/ProForm/components/combination/FormList/components/LineFields.js +3 -1
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/Group/index.js +3 -1
- package/es/ProForm/components/combination/Group/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/es/ProForm/components/combination/Group/utils.js +2 -0
- package/es/ProForm/components/combination/ProCombination/index.js +3 -1
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +10 -5
- package/es/ProForm/components/combination/ProNumberRange/index.js +8 -6
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -6
- package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.js +16 -8
- package/es/ProForm/components/render/Render.js +1 -1
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/utils/useForm.js +2 -1
- package/es/ProForm/utils/valueType.d.ts +10 -5
- package/es/ProForm/utils/valueType.js +30 -9
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -2
- package/es/ProSelect/index.js +1 -1
- package/es/ProStep/components/Anchor/index.js +5 -2
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/components/Step/index.js +3 -1
- package/es/ProStep/index.js +5 -2
- package/es/ProStep/propsType.d.ts +2 -0
- package/es/ProStep/utils/index.js +3 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/es/ProTable/components/RenderColumn/index.js +10 -6
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/utils.js +19 -9
- package/es/ProTree/components/ProTreeSelect/index.js +19 -1
- package/es/ProTree/components/Tree.js +10 -9
- package/es/ProTree/style/index.less +8 -3
- package/es/ProTreeModal/components/Trigger.d.ts +4 -0
- package/es/ProTreeModal/components/Trigger.js +10 -0
- package/es/ProTreeModal/index.js +3 -1
- package/es/ProTreeModal/propsType.d.ts +5 -0
- package/es/ProUpload/components/ImageRender.d.ts +1 -0
- package/es/ProUpload/components/ImageRender.js +4 -2
- package/es/ProUpload/index.js +11 -1
- package/es/ProUpload/propsType.d.ts +9 -3
- package/es/style/theme/antd.less +4 -1
- package/lib/ProDownload/index.js +6 -3
- package/lib/ProDownload/propsType.d.ts +18 -13
- package/lib/ProDownload/utils.d.ts +5 -0
- package/lib/ProDownload/utils.js +14 -13
- package/lib/ProEditTable/components/DndWrapper/index.d.ts +3 -1
- package/lib/ProEditTable/components/DndWrapper/index.js +17 -8
- package/lib/ProEditTable/index.js +6 -2
- package/lib/ProEditTable/propsType.d.ts +3 -0
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Group.js +3 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/components/Tag.js +3 -1
- package/lib/ProEnum/index.js +2 -1
- package/lib/ProEnum/propsType.d.ts +2 -0
- package/lib/ProForm/components/base/DatePicker/index.js +19 -2
- package/lib/ProForm/components/base/RangePicker/index.js +23 -3
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +3 -1
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +3 -1
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/index.js +3 -1
- package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +2 -0
- package/lib/ProForm/components/combination/ProCombination/index.js +3 -1
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +10 -5
- package/lib/ProForm/components/combination/ProNumberRange/index.js +8 -6
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -6
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +16 -8
- package/lib/ProForm/components/render/Render.js +1 -1
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/utils/useForm.js +2 -1
- package/lib/ProForm/utils/valueType.d.ts +10 -5
- package/lib/ProForm/utils/valueType.js +30 -9
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -2
- package/lib/ProSelect/index.js +1 -1
- package/lib/ProStep/components/Anchor/index.js +5 -2
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/components/Step/index.js +3 -1
- package/lib/ProStep/index.js +5 -2
- package/lib/ProStep/propsType.d.ts +2 -0
- package/lib/ProStep/utils/index.js +3 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/lib/ProTable/components/RenderColumn/index.js +10 -6
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/utils.js +19 -9
- package/lib/ProTree/components/ProTreeSelect/index.js +17 -1
- package/lib/ProTree/components/Tree.js +10 -9
- package/lib/ProTree/style/index.less +8 -3
- package/lib/ProTreeModal/components/Trigger.d.ts +4 -0
- package/lib/ProTreeModal/components/Trigger.js +10 -0
- package/lib/ProTreeModal/index.js +3 -1
- package/lib/ProTreeModal/propsType.d.ts +5 -0
- package/lib/ProUpload/components/ImageRender.d.ts +1 -0
- package/lib/ProUpload/components/ImageRender.js +4 -2
- package/lib/ProUpload/index.js +11 -1
- package/lib/ProUpload/propsType.d.ts +9 -3
- package/lib/style/theme/antd.less +4 -1
- package/package.json +2 -2
package/dist/index.esm.css
CHANGED
|
@@ -2497,12 +2497,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2497
2497
|
cursor: pointer;
|
|
2498
2498
|
fill: #c5c7cd;
|
|
2499
2499
|
}
|
|
2500
|
-
.pro-modal-select .ant-select-status-error + .ant-btn,
|
|
2501
|
-
.pro-tree-modal .ant-select-status-error + .ant-btn {
|
|
2502
|
-
border: 1px solid var(--ant-error-color);
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2500
|
+
.pro-modal-select .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item,
|
|
2501
|
+
.pro-tree-modal .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item {
|
|
2502
|
+
border-top: 1px solid var(--ant-error-color);
|
|
2503
|
+
border-right: 1px solid var(--ant-error-color);
|
|
2504
|
+
border-bottom: 1px solid var(--ant-error-color);
|
|
2505
|
+
}
|
|
2506
|
+
.pro-modal-select .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item > .viewSvg,
|
|
2507
|
+
.pro-tree-modal .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item > .viewSvg {
|
|
2506
2508
|
color: var(--ant-error-color);
|
|
2507
2509
|
}
|
|
2508
2510
|
.pro-modal-select .ant-input-group-addon,
|
|
@@ -3737,6 +3739,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3737
3739
|
.pro-tree {
|
|
3738
3740
|
height: 100%;
|
|
3739
3741
|
}
|
|
3742
|
+
.pro-tree .ant-tree-iconEle {
|
|
3743
|
+
margin-right: 8px;
|
|
3744
|
+
}
|
|
3740
3745
|
.pro-tree .ant-tree-node-content-wrapper {
|
|
3741
3746
|
display: -webkit-box;
|
|
3742
3747
|
display: -webkit-flex;
|
|
@@ -5802,6 +5807,9 @@ input[type='button'] {
|
|
|
5802
5807
|
width: max-content;
|
|
5803
5808
|
}
|
|
5804
5809
|
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-inner {
|
|
5810
|
+
max-height: 360px;
|
|
5811
|
+
overflow: auto;
|
|
5812
|
+
line-height: 23px;
|
|
5805
5813
|
color: #1d2129;
|
|
5806
5814
|
background-color: #fff;
|
|
5807
5815
|
-webkit-box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
package/dist/less.esm.css
CHANGED
|
@@ -2497,12 +2497,14 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2497
2497
|
cursor: pointer;
|
|
2498
2498
|
fill: #c5c7cd;
|
|
2499
2499
|
}
|
|
2500
|
-
.pro-modal-select .ant-select-status-error + .ant-btn,
|
|
2501
|
-
.pro-tree-modal .ant-select-status-error + .ant-btn {
|
|
2502
|
-
border: 1px solid var(--ant-error-color);
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2500
|
+
.pro-modal-select .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item,
|
|
2501
|
+
.pro-tree-modal .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item {
|
|
2502
|
+
border-top: 1px solid var(--ant-error-color);
|
|
2503
|
+
border-right: 1px solid var(--ant-error-color);
|
|
2504
|
+
border-bottom: 1px solid var(--ant-error-color);
|
|
2505
|
+
}
|
|
2506
|
+
.pro-modal-select .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item > .viewSvg,
|
|
2507
|
+
.pro-tree-modal .ant-space-compact .ant-select-compact-item-div:has(.ant-select-status-error) + .ant-btn-compact-last-item > .viewSvg {
|
|
2506
2508
|
color: var(--ant-error-color);
|
|
2507
2509
|
}
|
|
2508
2510
|
.pro-modal-select .ant-input-group-addon,
|
|
@@ -3737,6 +3739,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3737
3739
|
.pro-tree {
|
|
3738
3740
|
height: 100%;
|
|
3739
3741
|
}
|
|
3742
|
+
.pro-tree .ant-tree-iconEle {
|
|
3743
|
+
margin-right: 8px;
|
|
3744
|
+
}
|
|
3740
3745
|
.pro-tree .ant-tree-node-content-wrapper {
|
|
3741
3746
|
display: -webkit-box;
|
|
3742
3747
|
display: -webkit-flex;
|
package/es/ProDownload/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
-
var _excluded = ["source", "action", "url", "method", "params", "fileName", "children", "onFinish", "beforeDownload", "className", "transformResponse"];
|
|
8
|
+
var _excluded = ["source", "action", "url", "method", "params", "fileName", "children", "onFinish", "beforeDownload", "className", "transformResponse", "onError"];
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { useSetState } from 'ahooks';
|
|
11
11
|
import classNames from 'classnames';
|
|
@@ -24,6 +24,7 @@ var ProDownload = function ProDownload(props) {
|
|
|
24
24
|
beforeDownload = props.beforeDownload,
|
|
25
25
|
className = props.className,
|
|
26
26
|
transformResponse = props.transformResponse,
|
|
27
|
+
onError = props.onError,
|
|
27
28
|
defaultProps = _objectWithoutProperties(props, _excluded);
|
|
28
29
|
var _useSetState = useSetState({
|
|
29
30
|
loading: false
|
|
@@ -32,7 +33,8 @@ var ProDownload = function ProDownload(props) {
|
|
|
32
33
|
loading = _useSetState2[0].loading,
|
|
33
34
|
setState = _useSetState2[1];
|
|
34
35
|
var _ref = useProConfig('ProDownload') || {},
|
|
35
|
-
headers = _ref.headers
|
|
36
|
+
headers = _ref.headers,
|
|
37
|
+
onErrorConfig = _ref.onError;
|
|
36
38
|
defaultProps.headers = _objectSpread(_objectSpread({}, headers), defaultProps.headers);
|
|
37
39
|
var handDownload = /*#__PURE__*/function () {
|
|
38
40
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -94,7 +96,8 @@ var ProDownload = function ProDownload(props) {
|
|
|
94
96
|
params: _params,
|
|
95
97
|
transformResponse: transformResponse,
|
|
96
98
|
fileName: fileName,
|
|
97
|
-
onFinish: onFinish
|
|
99
|
+
onFinish: onFinish,
|
|
100
|
+
onError: onError || onErrorConfig
|
|
98
101
|
});
|
|
99
102
|
case 17:
|
|
100
103
|
_context.next = 23;
|
|
@@ -8,9 +8,9 @@ export interface IProDownloadProps extends ButtonProps {
|
|
|
8
8
|
*/
|
|
9
9
|
source?: string;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* @description 下载请求的地址
|
|
12
|
+
* @default (必选)
|
|
13
|
+
*/
|
|
14
14
|
url: string;
|
|
15
15
|
/**
|
|
16
16
|
* @description 下载请求的地址
|
|
@@ -39,21 +39,26 @@ export interface IProDownloadProps extends ButtonProps {
|
|
|
39
39
|
*/
|
|
40
40
|
headers?: object;
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
* @description 禁用状态
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
45
|
disabled?: boolean;
|
|
46
46
|
/** 格式化数据 */
|
|
47
47
|
transformResponse?: (data: any) => any;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
beforeDownload?: (
|
|
49
|
+
* @description 上传文件之前的钩子,若返回 false 则停止下载。支持返回一个 Promise 对象,Promise 对象 reject 时则停止下载
|
|
50
|
+
* @default -
|
|
51
|
+
*/
|
|
52
|
+
beforeDownload?: () => boolean | Promise<any>;
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
* @description service 执行完成时触发
|
|
55
|
+
* @default -
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* @description 下载出错的回调
|
|
59
|
+
* @default -
|
|
60
|
+
*/
|
|
61
|
+
onError?: (response: object) => void;
|
|
57
62
|
onFinish?: () => void;
|
|
58
63
|
/**
|
|
59
64
|
* @description 下载按钮的填充内容
|
package/es/ProDownload/utils.js
CHANGED
|
@@ -71,11 +71,11 @@ export function getFilenameFromContentDisposition(contentDisposition) {
|
|
|
71
71
|
// 发起请求获取下载文件
|
|
72
72
|
export var DownloadRequest = /*#__PURE__*/function () {
|
|
73
73
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
|
74
|
-
var url, _ref2$method, method, params, headers, transformResponse, fileName, onFinish, config, res, fileBlob, data, contentFileName;
|
|
74
|
+
var url, _ref2$method, method, params, headers, transformResponse, fileName, onFinish, onError, config, res, fileBlob, data, contentFileName;
|
|
75
75
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
76
76
|
while (1) switch (_context2.prev = _context2.next) {
|
|
77
77
|
case 0:
|
|
78
|
-
url = _ref2.url, _ref2$method = _ref2.method, method = _ref2$method === void 0 ? 'post' : _ref2$method, params = _ref2.params, headers = _ref2.headers, transformResponse = _ref2.transformResponse, fileName = _ref2.fileName, onFinish = _ref2.onFinish;
|
|
78
|
+
url = _ref2.url, _ref2$method = _ref2.method, method = _ref2$method === void 0 ? 'post' : _ref2$method, params = _ref2.params, headers = _ref2.headers, transformResponse = _ref2.transformResponse, fileName = _ref2.fileName, onFinish = _ref2.onFinish, onError = _ref2.onError;
|
|
79
79
|
config = {
|
|
80
80
|
method: method,
|
|
81
81
|
credentials: 'include',
|
|
@@ -116,37 +116,38 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
|
116
116
|
return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
|
|
117
117
|
case 7:
|
|
118
118
|
if (!((_data === null || _data === void 0 ? void 0 : _data.status) > 200 || (_data === null || _data === void 0 ? void 0 : _data.code) === 401)) {
|
|
119
|
-
_context.next =
|
|
119
|
+
_context.next = 12;
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
122
|
errorMsg = (_data === null || _data === void 0 ? void 0 : _data.message) || (_data === null || _data === void 0 ? void 0 : _data.msg);
|
|
123
123
|
errorMsg && _message.error(errorMsg);
|
|
124
|
+
onError && onError(_data);
|
|
124
125
|
return _context.abrupt("return", Promise.reject(errorMsg));
|
|
125
|
-
case
|
|
126
|
+
case 12:
|
|
126
127
|
if (!isFunction(transformResponse)) {
|
|
127
|
-
_context.next =
|
|
128
|
+
_context.next = 14;
|
|
128
129
|
break;
|
|
129
130
|
}
|
|
130
131
|
return _context.abrupt("return", Promise.resolve(transformResponse(_data)));
|
|
131
|
-
case
|
|
132
|
+
case 14:
|
|
132
133
|
Promise.resolve(_data);
|
|
133
|
-
_context.next =
|
|
134
|
+
_context.next = 21;
|
|
134
135
|
break;
|
|
135
|
-
case
|
|
136
|
-
_context.prev =
|
|
136
|
+
case 17:
|
|
137
|
+
_context.prev = 17;
|
|
137
138
|
_context.t0 = _context["catch"](0);
|
|
138
139
|
if (!response.ok) {
|
|
139
|
-
_context.next =
|
|
140
|
+
_context.next = 21;
|
|
140
141
|
break;
|
|
141
142
|
}
|
|
142
143
|
return _context.abrupt("return", Promise.resolve(response));
|
|
143
|
-
case 20:
|
|
144
|
-
return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
|
|
145
144
|
case 21:
|
|
145
|
+
return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
|
|
146
|
+
case 22:
|
|
146
147
|
case "end":
|
|
147
148
|
return _context.stop();
|
|
148
149
|
}
|
|
149
|
-
}, _callee, null, [[0,
|
|
150
|
+
}, _callee, null, [[0, 17]]);
|
|
150
151
|
}));
|
|
151
152
|
return function (_x2) {
|
|
152
153
|
return _ref4.apply(this, arguments);
|
|
@@ -3,12 +3,14 @@ interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
|
3
3
|
'data-row-key': string;
|
|
4
4
|
'data-hide'?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
rowDraggable?: any;
|
|
6
7
|
}
|
|
7
8
|
export declare const Row: FC<RowProps>;
|
|
8
|
-
declare const DndWrapper: ({ draggable, value, onChange, disabled, children }: {
|
|
9
|
+
declare const DndWrapper: ({ draggable, value, onChange, onDrag, disabled, children }: {
|
|
9
10
|
draggable: any;
|
|
10
11
|
value: any;
|
|
11
12
|
onChange: any;
|
|
13
|
+
onDrag: any;
|
|
12
14
|
disabled: any;
|
|
13
15
|
children: any;
|
|
14
16
|
}) => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["disabled", "children"];
|
|
3
|
+
var _excluded = ["disabled", "rowDraggable", "children"];
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { DndContext } from '@dnd-kit/core';
|
|
@@ -9,6 +9,7 @@ import { CSS } from '@dnd-kit/utilities';
|
|
|
9
9
|
import ProIcon from '../../../ProIcon';
|
|
10
10
|
export var Row = function Row(props) {
|
|
11
11
|
var disabled = props.disabled,
|
|
12
|
+
rowDraggable = props.rowDraggable,
|
|
12
13
|
children = props.children,
|
|
13
14
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
14
15
|
var data = useSortable({
|
|
@@ -35,16 +36,16 @@ export var Row = function Row(props) {
|
|
|
35
36
|
style: style
|
|
36
37
|
}, attributes), {}, {
|
|
37
38
|
children: React.Children.map(children, function (child) {
|
|
38
|
-
if (child.key === 'RC_TABLE_KEY') {
|
|
39
|
-
console.log('走这里么', child.key);
|
|
39
|
+
if (child.key === 'RC_TABLE_KEY' && !disabled) {
|
|
40
40
|
var _ref = (child === null || child === void 0 ? void 0 : child.props) || {},
|
|
41
41
|
render = _ref.render,
|
|
42
42
|
record = _ref.record,
|
|
43
43
|
renderIndex = _ref.renderIndex;
|
|
44
|
+
var isDrag = rowDraggable ? rowDraggable === null || rowDraggable === void 0 ? void 0 : rowDraggable(record) : true;
|
|
44
45
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
45
46
|
children: _jsxs("span", {
|
|
46
47
|
className: "drag-wrapper".concat(props['data-hide'] ? ' no-check' : ''),
|
|
47
|
-
children: [_jsx(ProIcon, _objectSpread({
|
|
48
|
+
children: [isDrag ? _jsx(ProIcon, _objectSpread({
|
|
48
49
|
className: "drag-icon",
|
|
49
50
|
style: {
|
|
50
51
|
touchAction: 'none',
|
|
@@ -52,7 +53,9 @@ export var Row = function Row(props) {
|
|
|
52
53
|
},
|
|
53
54
|
type: "drag",
|
|
54
55
|
size: 20
|
|
55
|
-
}, listeners))
|
|
56
|
+
}, listeners)) : _jsx(ProIcon, {
|
|
57
|
+
size: 20
|
|
58
|
+
}), props['data-hide'] ? null : render === null || render === void 0 ? void 0 : render(null, record, renderIndex)]
|
|
56
59
|
})
|
|
57
60
|
});
|
|
58
61
|
}
|
|
@@ -65,12 +68,18 @@ var DndWrapper = function DndWrapper(_ref2) {
|
|
|
65
68
|
var draggable = _ref2.draggable,
|
|
66
69
|
value = _ref2.value,
|
|
67
70
|
onChange = _ref2.onChange,
|
|
71
|
+
onDrag = _ref2.onDrag,
|
|
68
72
|
disabled = _ref2.disabled,
|
|
69
73
|
children = _ref2.children;
|
|
70
|
-
var onDragEnd = function onDragEnd(
|
|
71
|
-
var active =
|
|
72
|
-
over =
|
|
74
|
+
var onDragEnd = function onDragEnd(event) {
|
|
75
|
+
var active = event.active,
|
|
76
|
+
over = event.over;
|
|
73
77
|
if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
|
|
78
|
+
if (onDrag) {
|
|
79
|
+
var nextList = onDrag(event, value);
|
|
80
|
+
onChange(nextList);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
74
83
|
var activeIndex = value.findIndex(function (i) {
|
|
75
84
|
return i.rowKey === active.id;
|
|
76
85
|
});
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
9
9
|
import "antd/es/form/style";
|
|
10
10
|
import _Form from "antd/es/form";
|
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
|
-
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalDiffTip", "rowKey", "rowDisabled", "footerRender", "scroll"];
|
|
12
|
+
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalDiffTip", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll"];
|
|
13
13
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
15
15
|
import { get, isArray } from 'lodash';
|
|
@@ -25,6 +25,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
25
25
|
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _value$2;
|
|
26
26
|
var value = _ref.value,
|
|
27
27
|
onChange = _ref.onChange,
|
|
28
|
+
onDrag = _ref.onDrag,
|
|
28
29
|
className = _ref.className,
|
|
29
30
|
columns = _ref.columns,
|
|
30
31
|
type = _ref.type,
|
|
@@ -50,6 +51,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
50
51
|
originalDiffTip = _ref.originalDiffTip,
|
|
51
52
|
rowKey = _ref.rowKey,
|
|
52
53
|
rowDisabled = _ref.rowDisabled,
|
|
54
|
+
rowDraggable = _ref.rowDraggable,
|
|
53
55
|
footerRender = _ref.footerRender,
|
|
54
56
|
scroll = _ref.scroll,
|
|
55
57
|
resetProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -317,6 +319,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
317
319
|
children: [_jsxs(DndWrapper, {
|
|
318
320
|
value: value,
|
|
319
321
|
onChange: onChange,
|
|
322
|
+
onDrag: onDrag,
|
|
320
323
|
disabled: disabled,
|
|
321
324
|
draggable: draggable,
|
|
322
325
|
children: [headerRender ? _jsx("div", {
|
|
@@ -338,7 +341,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
338
341
|
return {
|
|
339
342
|
disabled: disabled || virtualKey && !!editingKeys.length,
|
|
340
343
|
'data-hide': isHideCheckBox,
|
|
341
|
-
onClick: function onClick() {}
|
|
344
|
+
onClick: function onClick() {},
|
|
345
|
+
rowDraggable: rowDraggable
|
|
342
346
|
};
|
|
343
347
|
}
|
|
344
348
|
}, resetProps), {}, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Key, ReactNode } from 'react';
|
|
2
|
+
import { DragEndEvent } from '@dnd-kit/core';
|
|
2
3
|
import type { ButtonProps } from 'antd/es/button';
|
|
3
4
|
import type { TooltipProps } from 'antd/es/tooltip';
|
|
4
5
|
import type { NamePath } from 'antd/es/form/interface';
|
|
@@ -253,5 +254,7 @@ export interface ProEditTableProps<T = any> extends Omit<TableProps<T>, 'onChang
|
|
|
253
254
|
*/
|
|
254
255
|
headerRender?: ReactNode;
|
|
255
256
|
rowDisabled?: (record?: T) => string | boolean;
|
|
257
|
+
rowDraggable?: (record?: T) => string | boolean;
|
|
258
|
+
onDrag?: (event: DragEndEvent, dataSource: T[]) => T[];
|
|
256
259
|
ref?: any;
|
|
257
260
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProEnum } from '../propsType';
|
|
2
|
-
interface Props extends Pick<ProEnum, 'value' | 'onChange' | 'dataSource'> {
|
|
2
|
+
interface Props extends Pick<ProEnum, 'id' | 'value' | 'onChange' | 'dataSource'> {
|
|
3
3
|
fieldValue: string;
|
|
4
4
|
fieldLabel: string;
|
|
5
5
|
disabled?: boolean;
|
|
@@ -10,7 +10,8 @@ var Group = function Group(props) {
|
|
|
10
10
|
fieldLabel = props.fieldLabel,
|
|
11
11
|
disabled = props.disabled,
|
|
12
12
|
_props$allowClear = props.allowClear,
|
|
13
|
-
allowClear = _props$allowClear === void 0 ? true : _props$allowClear
|
|
13
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
14
|
+
id = props.id;
|
|
14
15
|
var _useState = useState(false),
|
|
15
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
17
|
refresh = _useState2[0],
|
|
@@ -41,6 +42,7 @@ var Group = function Group(props) {
|
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
return _jsx("div", {
|
|
45
|
+
id: id,
|
|
44
46
|
className: classNames('pro-enum-group-root', disabled ? 'pro-enum-group-root-disabled' : ''),
|
|
45
47
|
children: dataSource.map(function (item, index) {
|
|
46
48
|
return _jsx("div", {
|
|
@@ -7,7 +7,8 @@ var ProEnumTag = function ProEnumTag(props) {
|
|
|
7
7
|
onChange = props.onChange,
|
|
8
8
|
dataSource = props.dataSource,
|
|
9
9
|
fieldValue = props.fieldValue,
|
|
10
|
-
fieldLabel = props.fieldLabel
|
|
10
|
+
fieldLabel = props.fieldLabel,
|
|
11
|
+
id = props.id;
|
|
11
12
|
var _useState = useState(),
|
|
12
13
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13
14
|
checked = _useState2[0],
|
|
@@ -25,6 +26,7 @@ var ProEnumTag = function ProEnumTag(props) {
|
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
return _jsx("div", {
|
|
29
|
+
id: id,
|
|
28
30
|
className: "pro-enum-tag-root",
|
|
29
31
|
children: dataSource.map(function (item) {
|
|
30
32
|
return _jsx("div", {
|
package/es/ProEnum/index.js
CHANGED
|
@@ -166,7 +166,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
166
166
|
}
|
|
167
167
|
switch (type) {
|
|
168
168
|
case 'ProSelect':
|
|
169
|
-
return _jsx(ProSelect, _objectSpread(_objectSpread({},
|
|
169
|
+
return _jsx(ProSelect, _objectSpread(_objectSpread({}, enumProps), {}, {
|
|
170
170
|
otherProps: otherProps,
|
|
171
171
|
dataSource: list,
|
|
172
172
|
fieldNames: {
|
|
@@ -204,6 +204,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
204
204
|
}));
|
|
205
205
|
case 'Tag':
|
|
206
206
|
return _jsx(ProEnumTag, {
|
|
207
|
+
id: enumProps.id,
|
|
207
208
|
value: value,
|
|
208
209
|
onChange: onChange,
|
|
209
210
|
fieldLabel: label,
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import "antd/es/date-picker/style";
|
|
2
2
|
import _DatePicker from "antd/es/date-picker";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
7
|
var _excluded = ["className", "format"];
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
+
/*
|
|
10
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
11
|
+
* @Date: 2024-01-19 18:27:41
|
|
12
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
13
|
+
* @LastEditTime: 2024-05-29 11:19:12
|
|
14
|
+
* @FilePath: /za-material-warehouse/src/ProForm/components/base/DatePicker/index.tsx
|
|
15
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { isFunction, isString, isObject, uniq } from 'lodash';
|
|
9
19
|
import classNames from 'classnames';
|
|
10
20
|
import moment from 'moment';
|
|
11
21
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
@@ -25,6 +35,14 @@ var DatePicker = function DatePicker(props) {
|
|
|
25
35
|
var _className = classNames(_defineProperty({
|
|
26
36
|
'full-form-item': true
|
|
27
37
|
}, className, !!className));
|
|
38
|
+
var _viewFormat = Array.isArray(format) ? format[0] : format;
|
|
39
|
+
var tempFormat = Array.isArray(format) ? format : [format];
|
|
40
|
+
if (isFunction(format)) {
|
|
41
|
+
tempFormat = [];
|
|
42
|
+
}
|
|
43
|
+
var _format = uniq([].concat(_toConsumableArray(tempFormat), ['YYYY-MM-DD', 'YYYYMMDD', 'YYYY/MM/DD', 'YYYY_MM_DD', 'YYYY.MM.DD'])).filter(function (formatKey) {
|
|
44
|
+
return !!formatKey;
|
|
45
|
+
});
|
|
28
46
|
if (isView) {
|
|
29
47
|
var value = rest.value;
|
|
30
48
|
var viewChildren = null;
|
|
@@ -35,7 +53,7 @@ var DatePicker = function DatePicker(props) {
|
|
|
35
53
|
} else if (isFunction(format)) {
|
|
36
54
|
viewChildren = format(value);
|
|
37
55
|
} else if (isString(value)) {
|
|
38
|
-
viewChildren = moment(value).format(
|
|
56
|
+
viewChildren = moment(value).format(_viewFormat);
|
|
39
57
|
}
|
|
40
58
|
return _jsx(Container, {
|
|
41
59
|
viewEmpty: viewEmpty,
|
|
@@ -57,7 +75,7 @@ var DatePicker = function DatePicker(props) {
|
|
|
57
75
|
};
|
|
58
76
|
}
|
|
59
77
|
return _jsx(_DatePicker, _objectSpread(_objectSpread(_objectSpread({}, initialConfig), {}, {
|
|
60
|
-
format:
|
|
78
|
+
format: _format
|
|
61
79
|
}, _rest), {}, {
|
|
62
80
|
className: _className
|
|
63
81
|
}));
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
4
|
import "antd/es/date-picker/style";
|
|
4
5
|
import _DatePicker from "antd/es/date-picker";
|
|
5
6
|
var _excluded = ["format", "otherProps", "separator", "range"];
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
/*
|
|
9
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
10
|
+
* @Date: 2024-04-10 11:39:17
|
|
11
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
12
|
+
* @LastEditTime: 2024-05-29 11:50:49
|
|
13
|
+
* @FilePath: /za-material-warehouse/src/ProForm/components/base/RangePicker/index.tsx
|
|
14
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
15
|
+
*/
|
|
7
16
|
// @ts-check
|
|
8
17
|
|
|
9
|
-
import { isFunction, isString, omit } from 'lodash';
|
|
18
|
+
import { isFunction, isString, omit, uniq } from 'lodash';
|
|
10
19
|
import moment from 'moment';
|
|
11
20
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
12
21
|
import ProForm from '../../../../ProForm';
|
|
@@ -39,6 +48,14 @@ var RangePicker = function RangePicker(props) {
|
|
|
39
48
|
if (Array.isArray(_res.value) && isString(_res.value[0]) && isString(_res.value[1])) {
|
|
40
49
|
_res.value = [moment(_res.value[0]), moment(_res.value[1])];
|
|
41
50
|
}
|
|
51
|
+
var _viewFormat = Array.isArray(format) ? format[0] : format;
|
|
52
|
+
var tempFormat = Array.isArray(format) ? format : [format];
|
|
53
|
+
if (isFunction(format)) {
|
|
54
|
+
tempFormat = [];
|
|
55
|
+
}
|
|
56
|
+
var _format = uniq([].concat(_toConsumableArray(tempFormat), ['YYYY-MM-DD', 'YYYYMMDD', 'YYYY/MM/DD', 'YYYY_MM_DD', 'YYYY.MM.DD'])).filter(function (formatKey) {
|
|
57
|
+
return !!formatKey;
|
|
58
|
+
});
|
|
42
59
|
if (isView) {
|
|
43
60
|
var _res$value = _res.value,
|
|
44
61
|
value = _res$value === void 0 ? [] : _res$value;
|
|
@@ -56,13 +73,15 @@ var RangePicker = function RangePicker(props) {
|
|
|
56
73
|
} else if (isFunction(format)) {
|
|
57
74
|
viewChildren = "".concat(format(value[0]), " ").concat(separator, " ").concat(format(value[1]));
|
|
58
75
|
} else {
|
|
59
|
-
viewChildren = "".concat(value[0].format(
|
|
76
|
+
viewChildren = "".concat(value[0].format(_viewFormat), " ").concat(separator, " ").concat(value[1].format(_viewFormat));
|
|
60
77
|
}
|
|
61
78
|
return _jsx(Container, {
|
|
62
79
|
viewEmpty: viewEmpty,
|
|
63
80
|
children: viewChildren
|
|
64
81
|
});
|
|
65
82
|
}
|
|
66
|
-
return _jsx(AntRangePicker, _objectSpread(_objectSpread(_objectSpread({}, initialConfig), omit(_res, ['separator'])), rangeRegulator)
|
|
83
|
+
return _jsx(AntRangePicker, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, initialConfig), omit(_res, ['separator'])), rangeRegulator), {}, {
|
|
84
|
+
format: _format
|
|
85
|
+
}));
|
|
67
86
|
};
|
|
68
87
|
export default RangePicker;
|
|
@@ -28,7 +28,8 @@ var BlockFields = function BlockFields(props) {
|
|
|
28
28
|
isView = props.isView,
|
|
29
29
|
_props$level = props.level,
|
|
30
30
|
level = _props$level === void 0 ? '2' : _props$level,
|
|
31
|
-
towCollapse = props.towCollapse
|
|
31
|
+
towCollapse = props.towCollapse,
|
|
32
|
+
id = props.id;
|
|
32
33
|
var _title = useMemo(function () {
|
|
33
34
|
if (isFunction(title)) {
|
|
34
35
|
var record = form.getFieldValue(namePath);
|
|
@@ -40,6 +41,7 @@ var BlockFields = function BlockFields(props) {
|
|
|
40
41
|
return _jsx(_Space, {
|
|
41
42
|
direction: "vertical",
|
|
42
43
|
className: cls,
|
|
44
|
+
id: id,
|
|
43
45
|
children: _jsx(ProCollapse, {
|
|
44
46
|
title: _title,
|
|
45
47
|
index: index,
|
|
@@ -25,7 +25,8 @@ var LineFields = function LineFields(props) {
|
|
|
25
25
|
disabled = props.disabled,
|
|
26
26
|
isView = props.isView,
|
|
27
27
|
draggable = props.draggable,
|
|
28
|
-
className = props.className
|
|
28
|
+
className = props.className,
|
|
29
|
+
id = props.id;
|
|
29
30
|
var isLess = mode === 'less';
|
|
30
31
|
var _useSortable = useSortable({
|
|
31
32
|
id: field.key,
|
|
@@ -51,6 +52,7 @@ var LineFields = function LineFields(props) {
|
|
|
51
52
|
className: classnames,
|
|
52
53
|
ref: setNodeRef,
|
|
53
54
|
style: style,
|
|
55
|
+
id: id,
|
|
54
56
|
children: [!disabled && draggable && _jsx("div", _objectSpread(_objectSpread(_objectSpread({}, attributes), listeners), {}, {
|
|
55
57
|
className: "pro-form-list-drag-handle",
|
|
56
58
|
ref: setActivatorNodeRef,
|
|
@@ -26,7 +26,8 @@ var Group = function Group(props) {
|
|
|
26
26
|
value = props.value,
|
|
27
27
|
onChange = props.onChange,
|
|
28
28
|
otherProps = props.otherProps,
|
|
29
|
-
disabled = props.disabled
|
|
29
|
+
disabled = props.disabled,
|
|
30
|
+
id = props.id;
|
|
30
31
|
var contextProps = ProForm.useFieldProps() || {};
|
|
31
32
|
var names = contextProps.names,
|
|
32
33
|
name = contextProps.name,
|
|
@@ -65,6 +66,7 @@ var Group = function Group(props) {
|
|
|
65
66
|
}, "".concat(className), className));
|
|
66
67
|
return _jsx("div", {
|
|
67
68
|
className: _className,
|
|
69
|
+
id: id,
|
|
68
70
|
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? _jsx(_Space.Compact, {
|
|
69
71
|
children: columns.map(function (column, index) {
|
|
70
72
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
|
@@ -43,6 +43,7 @@ export type GroupColumnProps<Values = any> = {
|
|
|
43
43
|
trim?: boolean;
|
|
44
44
|
upperCase?: boolean;
|
|
45
45
|
toISOString?: boolean;
|
|
46
|
+
toCSTString?: boolean;
|
|
46
47
|
clearNotShow?: boolean;
|
|
47
48
|
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
48
49
|
valuePropName?: string;
|