@zat-design/sisyphus-react 3.5.1-beta.1 → 3.5.1-beta.13

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.
Files changed (86) hide show
  1. package/es/ProEditTable/components/DndWrapper/index.d.ts +3 -1
  2. package/es/ProEditTable/components/DndWrapper/index.js +17 -8
  3. package/es/ProEditTable/index.js +6 -2
  4. package/es/ProEditTable/propsType.d.ts +3 -0
  5. package/es/ProEnum/index.js +1 -1
  6. package/es/ProForm/components/base/DatePicker/index.js +21 -3
  7. package/es/ProForm/components/base/RangePicker/index.js +22 -3
  8. package/es/ProForm/components/combination/Group/propsType.d.ts +1 -0
  9. package/es/ProForm/components/combination/Group/utils.d.ts +1 -1
  10. package/es/ProForm/components/combination/Group/utils.js +2 -0
  11. package/es/ProForm/components/combination/ProNumberRange/index.js +5 -5
  12. package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -3
  13. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
  14. package/es/ProForm/components/combination/ProTimeLimit/index.js +16 -8
  15. package/es/ProForm/components/render/Render.js +1 -1
  16. package/es/ProForm/components/render/propsType.d.ts +1 -0
  17. package/es/ProForm/utils/valueType.d.ts +10 -5
  18. package/es/ProForm/utils/valueType.js +30 -9
  19. package/es/ProSelect/index.js +1 -1
  20. package/es/ProTable/components/RenderColumn/index.d.ts +2 -0
  21. package/es/ProTable/components/RenderColumn/index.js +10 -6
  22. package/es/ProTable/propsType.d.ts +2 -0
  23. package/es/ProTable/utils.js +19 -9
  24. package/lib/ProEditTable/components/DndWrapper/index.d.ts +3 -1
  25. package/lib/ProEditTable/components/DndWrapper/index.js +17 -8
  26. package/lib/ProEditTable/index.js +6 -2
  27. package/lib/ProEditTable/propsType.d.ts +3 -0
  28. package/lib/ProEnum/index.js +1 -1
  29. package/lib/ProForm/components/base/DatePicker/index.js +19 -2
  30. package/lib/ProForm/components/base/RangePicker/index.js +23 -3
  31. package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -0
  32. package/lib/ProForm/components/combination/Group/utils.d.ts +1 -1
  33. package/lib/ProForm/components/combination/Group/utils.js +2 -0
  34. package/lib/ProForm/components/combination/ProNumberRange/index.js +5 -5
  35. package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -3
  36. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
  37. package/lib/ProForm/components/combination/ProTimeLimit/index.js +16 -8
  38. package/lib/ProForm/components/render/Render.js +1 -1
  39. package/lib/ProForm/components/render/propsType.d.ts +1 -0
  40. package/lib/ProForm/utils/valueType.d.ts +10 -5
  41. package/lib/ProForm/utils/valueType.js +30 -9
  42. package/lib/ProSelect/index.js +1 -1
  43. package/lib/ProTable/components/RenderColumn/index.d.ts +2 -0
  44. package/lib/ProTable/components/RenderColumn/index.js +10 -6
  45. package/lib/ProTable/propsType.d.ts +2 -0
  46. package/lib/ProTable/utils.js +19 -9
  47. package/package.json +2 -2
  48. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +0 -241
  49. package/coverage/lcov-report/src/.umi/core/history.ts.html +0 -148
  50. package/coverage/lcov-report/src/.umi/core/index.html +0 -206
  51. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +0 -109
  52. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +0 -160
  53. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +0 -97
  54. package/coverage/lcov-report/src/.umi/core/routes.ts.html +0 -26050
  55. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +0 -112
  56. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +0 -116
  57. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
  58. package/coverage/lcov-report/src/.umi/dumi/index.html +0 -116
  59. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +0 -109
  60. package/coverage/lcov-report/src/.umi/index.html +0 -116
  61. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +0 -116
  62. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +0 -172
  63. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +0 -94
  64. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +0 -116
  65. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +0 -196
  66. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +0 -106
  67. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +0 -146
  68. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +0 -116
  69. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +0 -88
  70. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +0 -124
  71. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +0 -1246
  72. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +0 -161
  73. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +0 -268
  74. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +0 -778
  75. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +0 -115
  76. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +0 -202
  77. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +0 -97
  78. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +0 -142
  79. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +0 -334
  80. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +0 -146
  81. package/coverage/lcov-report/src/.umi/plugin-model/index.html +0 -146
  82. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +0 -121
  83. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +0 -298
  84. package/coverage/lcov-report/src/.umi/plugin-request/index.html +0 -116
  85. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +0 -919
  86. package/coverage/lcov-report/src/.umi/umi.ts.html +0 -268
@@ -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)), props['data-hide'] ? null : render === null || render === void 0 ? void 0 : render(null, record, renderIndex)]
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(_ref3) {
71
- var active = _ref3.active,
72
- over = _ref3.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
  });
@@ -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
  }
@@ -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({}, omit(enumProps, ['showCodeName'])), {}, {
169
+ return _jsx(ProSelect, _objectSpread(_objectSpread({}, enumProps), {}, {
170
170
  otherProps: otherProps,
171
171
  dataSource: list,
172
172
  fieldNames: {
@@ -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
- import { isFunction, isString, isObject } from 'lodash';
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(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: 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(format), " ").concat(separator, " ").concat(value[1].format(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;
@@ -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;
@@ -39,7 +39,7 @@ export declare const getReactiveProps: (params: Params) => {
39
39
  component: any;
40
40
  fieldProps: boolean;
41
41
  };
42
- type ValueTypeGetterParams = Pick<ProFormColumnProps, 'valueType' | 'switchValue' | 'toISOString'> & {
42
+ type ValueTypeGetterParams = Pick<ProFormColumnProps, 'valueType' | 'switchValue' | 'toISOString' | 'toCSTString'> & {
43
43
  type?: any;
44
44
  mode?: string;
45
45
  };
@@ -171,6 +171,7 @@ export var useTransformColumns = function useTransformColumns(params) {
171
171
  valueType = column.valueType,
172
172
  switchValue = column.switchValue,
173
173
  toISOString = column.toISOString,
174
+ toCSTString = column.toCSTString,
174
175
  fieldProps = column.fieldProps,
175
176
  normalize = column.normalize,
176
177
  disabled = column.disabled,
@@ -221,6 +222,7 @@ export var useTransformColumns = function useTransformColumns(params) {
221
222
  valueType: valueType,
222
223
  switchValue: switchValue,
223
224
  toISOString: toISOString,
225
+ toCSTString: toCSTString,
224
226
  mode: mode
225
227
  });
226
228
  var newValue;
@@ -17,7 +17,7 @@ var formatAmount = tools.formatAmount,
17
17
  formatPercent = tools.formatPercent,
18
18
  formatPerMill = tools.formatPerMill;
19
19
  var ProNumberRange = function ProNumberRange(props) {
20
- var _valueProps, _valueProps2, _valueProps3, _valueProps4;
20
+ var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
21
21
  var _props$value = props.value,
22
22
  value = _props$value === void 0 ? [] : _props$value,
23
23
  _props$onChange = props.onChange,
@@ -183,8 +183,8 @@ var ProNumberRange = function ProNumberRange(props) {
183
183
  },
184
184
  addonBefore: addonBefore
185
185
  }, valueProps), {}, {
186
- min: min || ((_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min),
187
- max: (value === null || value === void 0 ? void 0 : value[1]) || range[1] || max || ((_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max)
186
+ min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
187
+ max: (_ref2 = (_ref3 = (_value$ = value === null || value === void 0 ? void 0 : value[1]) !== null && _value$ !== void 0 ? _value$ : range[1]) !== null && _ref3 !== void 0 ? _ref3 : max) !== null && _ref2 !== void 0 ? _ref2 : (_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max
188
188
  }, childProps === null || childProps === void 0 ? void 0 : childProps[0])), _jsx(_Input, {
189
189
  className: classnames({
190
190
  'range-split': true,
@@ -203,8 +203,8 @@ var ProNumberRange = function ProNumberRange(props) {
203
203
  },
204
204
  addonAfter: addonAfter
205
205
  }, valueProps), {}, {
206
- max: max || ((_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.max),
207
- min: (value === null || value === void 0 ? void 0 : value[0]) || range[0] || min || ((_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.min)
206
+ min: (_ref4 = (_ref5 = (_value$2 = value === null || value === void 0 ? void 0 : value[0]) !== null && _value$2 !== void 0 ? _value$2 : range[0]) !== null && _ref5 !== void 0 ? _ref5 : min) !== null && _ref4 !== void 0 ? _ref4 : (_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.min,
207
+ max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
208
208
  }, childProps === null || childProps === void 0 ? void 0 : childProps[1]))]
209
209
  });
210
210
  };
@@ -78,12 +78,13 @@ var ProRangeLimit = function ProRangeLimit(props) {
78
78
  'ant-input-disabled': _disabled === null || _disabled === void 0 ? void 0 : _disabled[1],
79
79
  'forever-checkbox': true
80
80
  });
81
+ var _foreverDate = foreverDate || (initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.foreverDate);
81
82
  var _isForever = useMemo(function () {
82
- return moment(foreverDate, format).isSame(endDate);
83
+ return moment(_foreverDate, format).isSame(endDate);
83
84
  }, [value]);
84
85
  var foreverMoment = useMemo(function () {
85
- return moment(foreverDate, format);
86
- }, [foreverDate, format]);
86
+ return moment(_foreverDate, format);
87
+ }, [_foreverDate, format]);
87
88
  if (isView) {
88
89
  var _props$value3, _props$value4;
89
90
  var _separator = (value === null || value === void 0 ? void 0 : value[0]) && (value === null || value === void 0 ? void 0 : value[1]) ? separator : '';
@@ -9,7 +9,7 @@ export type ProTimeLimitProps = DistributiveOmit<DatePickerProps, 'value' | 'onC
9
9
  value?: string;
10
10
  onChange?: (value: ProTimeLimitProps['value'] | null, valueData: Moment) => void;
11
11
  disabled?: boolean;
12
- foreverTime?: string;
12
+ foreverDate?: string;
13
13
  foreverText?: string;
14
14
  viewEmpty?: React.ReactNode;
15
15
  format?: string;
@@ -7,7 +7,7 @@ import _Input from "antd/es/input";
7
7
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
8
8
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
9
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
10
- var _excluded = ["format", "disabled", "foreverTime", "foreverText", "valueType", "otherProps"],
10
+ var _excluded = ["format", "disabled", "foreverDate", "foreverText", "valueType", "otherProps"],
11
11
  _excluded2 = ["mode"];
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import classNames from 'classnames';
@@ -25,7 +25,8 @@ export var ProTimeLimit = function ProTimeLimit(props) {
25
25
  var _props$format = props.format,
26
26
  format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
27
27
  disabled = props.disabled,
28
- foreverTime = props.foreverTime,
28
+ _props$foreverDate = props.foreverDate,
29
+ foreverDate = _props$foreverDate === void 0 ? '9999-01-01' : _props$foreverDate,
29
30
  _props$foreverText = props.foreverText,
30
31
  foreverText = _props$foreverText === void 0 ? locale.ProTimeLimit.foreverText : _props$foreverText,
31
32
  _props$valueType = props.valueType,
@@ -35,12 +36,14 @@ export var ProTimeLimit = function ProTimeLimit(props) {
35
36
  var _ref = ProForm.useFieldProps() || {},
36
37
  isViewCon = _ref.isView,
37
38
  viewEmpty = _ref.viewEmpty;
39
+ var initialConfig = useProConfig('ProTimeLimit');
38
40
  var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
41
+ var _foreverDate = foreverDate || (initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.foreverDate);
39
42
  var _useMemo = useMemo(function () {
40
- var foreverMoment = foreverTime ? moment(foreverTime, format) : moment('9999-01-01', 'YYYY-MM-DD');
41
- var foreverString = foreverTime || foreverMoment.format(format);
43
+ var foreverMoment = moment(_foreverDate, format);
44
+ var foreverString = _foreverDate || foreverMoment.format(format);
42
45
  return [foreverString, foreverMoment];
43
- }, [format, foreverTime]),
46
+ }, [format, _foreverDate]),
44
47
  _useMemo2 = _slicedToArray(_useMemo, 2),
45
48
  foreverString = _useMemo2[0],
46
49
  foreverMoment = _useMemo2[1];
@@ -51,7 +54,6 @@ export var ProTimeLimit = function ProTimeLimit(props) {
51
54
  _useControlled2 = _slicedToArray(_useControlled, 2),
52
55
  value = _useControlled2[0],
53
56
  onChange = _useControlled2[1];
54
- var initialConfig = useProConfig('ProTimeLimit');
55
57
  var isForever = useMemo(function () {
56
58
  if (isObject(value)) {
57
59
  return foreverMoment.format(format) === value.format(format);
@@ -112,9 +114,15 @@ var LimitPick = function LimitPick(props) {
112
114
  var _props$mode = props.mode,
113
115
  mode = _props$mode === void 0 ? 'DatePicker' : _props$mode,
114
116
  rest = _objectWithoutProperties(props, _excluded2);
117
+ var _ref2 = useProConfig('ProTimeLimit') || {},
118
+ foreverDate = _ref2.foreverDate;
115
119
  if (mode === 'RangePicker') {
116
- return _jsx(ProRangeLimit, _objectSpread({}, rest));
120
+ return _jsx(ProRangeLimit, _objectSpread({
121
+ foreverDate: foreverDate
122
+ }, rest));
117
123
  }
118
- return _jsx(ProTimeLimit, _objectSpread({}, rest));
124
+ return _jsx(ProTimeLimit, _objectSpread({
125
+ foreverDate: foreverDate
126
+ }, rest));
119
127
  };
120
128
  export default LimitPick;
@@ -171,7 +171,7 @@ var Render = function Render(props) {
171
171
  };
172
172
  }
173
173
  /** 移除多余参数,防止透传给formItem报错 */
174
- var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'switchValue', 'precision', 'clearNotShow']);
174
+ var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow']);
175
175
  /**
176
176
  * globalControl 全局控制优先
177
177
  * globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
@@ -205,6 +205,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
205
205
  required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
206
206
  labelRequired?: boolean;
207
207
  toISOString?: boolean;
208
+ toCSTString?: boolean;
208
209
  clearNotShow?: boolean;
209
210
  index?: number;
210
211
  namePath?: NamePath;
@@ -1,32 +1,37 @@
1
1
  declare const _default: {
2
2
  /** 年月日 */
3
- date: ({ type, toISOString, mode }: {
3
+ date: ({ type, toISOString, toCSTString, mode }: {
4
4
  type: any;
5
5
  toISOString: any;
6
+ toCSTString: any;
6
7
  mode: any;
7
8
  }) => {};
8
9
  /** 年月日 时分秒 */
9
- dateTime: ({ type, toISOString, mode }: {
10
+ dateTime: ({ type, toISOString, toCSTString, mode }: {
10
11
  type: any;
11
12
  toISOString: any;
13
+ toCSTString: any;
12
14
  mode: any;
13
15
  }) => {};
14
16
  /** 年月日 00:00:00 */
15
- dateStartTime: ({ type, toISOString, mode }: {
17
+ dateStartTime: ({ type, toISOString, toCSTString, mode }: {
16
18
  type: any;
17
19
  toISOString: any;
20
+ toCSTString: any;
18
21
  mode: any;
19
22
  }) => {};
20
23
  /** 年月日 23:59:59 */
21
- dateEndTime: ({ type, toISOString, mode }: {
24
+ dateEndTime: ({ type, toISOString, toCSTString, mode }: {
22
25
  type: any;
23
26
  toISOString: any;
27
+ toCSTString: any;
24
28
  mode: any;
25
29
  }) => {};
26
30
  /** 年月日 00:00:00 ~ 年月日 23:59:59 */
27
- dateStartEndTime: ({ type, toISOString, mode }: {
31
+ dateStartEndTime: ({ type, toISOString, toCSTString, mode }: {
28
32
  type: any;
29
33
  toISOString: any;
34
+ toCSTString: any;
30
35
  mode: any;
31
36
  }) => {};
32
37
  /** 百分比 */
@@ -93,6 +93,8 @@ var dateTransform = function dateTransform(_ref2) {
93
93
  _valueType = _ref2$_valueType === void 0 ? 'date' : _ref2$_valueType,
94
94
  _ref2$toISOString = _ref2.toISOString,
95
95
  toISOString = _ref2$toISOString === void 0 ? false : _ref2$toISOString,
96
+ _ref2$toCSTString = _ref2.toCSTString,
97
+ toCSTString = _ref2$toCSTString === void 0 ? false : _ref2$toCSTString,
96
98
  mode = _ref2.mode;
97
99
  var result = {};
98
100
  if (type === 'RangePicker' && ['dateStartTime', 'dateEndTime'].includes(_valueType)) {
@@ -103,27 +105,36 @@ var dateTransform = function dateTransform(_ref2) {
103
105
  console.error("Warning: DatePicker valueType can only be set to ['date' | 'dateTime' | 'dateStartTime'| 'dateEndTime']");
104
106
  return result;
105
107
  }
108
+ var newValueType = function () {
109
+ if (toISOString) {
110
+ return 'ISOString';
111
+ }
112
+ if (toCSTString) {
113
+ return 'CSTString';
114
+ }
115
+ return 'string';
116
+ }();
106
117
  switch (type) {
107
118
  case 'DatePicker':
108
119
  if (_valueType === 'date') {
109
120
  result = transformDate({
110
121
  type: 'DatePicker',
111
122
  format: 'YYYY-MM-DD',
112
- valueType: toISOString ? 'ISOString' : 'string'
123
+ valueType: newValueType
113
124
  });
114
125
  }
115
126
  if (_valueType === 'dateTime') {
116
127
  result = transformDate({
117
128
  type: 'DatePicker',
118
129
  format: 'YYYY-MM-DD HH:mm:ss',
119
- valueType: toISOString ? 'ISOString' : 'string'
130
+ valueType: newValueType
120
131
  });
121
132
  }
122
133
  if (_valueType === 'dateStartTime') {
123
134
  result = transformDate({
124
135
  type: 'DatePicker',
125
136
  format: 'YYYY-MM-DD HH:mm:ss',
126
- valueType: toISOString ? 'ISOString' : 'string',
137
+ valueType: newValueType,
127
138
  timeType: 'startTime'
128
139
  });
129
140
  }
@@ -131,7 +142,7 @@ var dateTransform = function dateTransform(_ref2) {
131
142
  result = transformDate({
132
143
  type: 'DatePicker',
133
144
  format: 'YYYY-MM-DD HH:mm:ss',
134
- valueType: toISOString ? 'ISOString' : 'string',
145
+ valueType: newValueType,
135
146
  timeType: 'endTime'
136
147
  });
137
148
  }
@@ -141,21 +152,21 @@ var dateTransform = function dateTransform(_ref2) {
141
152
  result = transformDate({
142
153
  type: 'RangePicker',
143
154
  format: 'YYYY-MM-DD',
144
- valueType: toISOString ? 'ISOString' : 'string'
155
+ valueType: newValueType
145
156
  });
146
157
  }
147
158
  if (_valueType === 'dateTime') {
148
159
  result = transformDate({
149
160
  type: 'RangePicker',
150
161
  format: 'YYYY-MM-DD HH:mm:ss',
151
- valueType: toISOString ? 'ISOString' : 'string'
162
+ valueType: newValueType
152
163
  });
153
164
  }
154
165
  if (_valueType === 'dateStartEndTime') {
155
166
  result = transformDate({
156
167
  type: 'RangePicker',
157
168
  format: 'YYYY-MM-DD HH:mm:ss',
158
- valueType: toISOString ? 'ISOString' : 'string',
169
+ valueType: newValueType,
159
170
  timeType: 'startEndTime'
160
171
  });
161
172
  }
@@ -166,13 +177,13 @@ var dateTransform = function dateTransform(_ref2) {
166
177
  if (type === 'ProTimeLimit' && (!mode || mode === 'DatePicker')) {
167
178
  return transformDate(_objectSpread({
168
179
  type: 'DatePicker',
169
- valueType: toISOString ? 'ISOString' : 'string'
180
+ valueType: newValueType
170
181
  }, formatMap[_valueType]));
171
182
  }
172
183
  if (type === 'ProRangeLimit' || type === 'ProTimeLimit' && mode === 'RangePicker') {
173
184
  return transformDate(_objectSpread({
174
185
  type: 'RangePicker',
175
- valueType: toISOString ? 'ISOString' : 'string'
186
+ valueType: newValueType
176
187
  }, formatMap[_valueType]));
177
188
  }
178
189
  return result;
@@ -182,11 +193,13 @@ export default {
182
193
  date: function date(_ref3) {
183
194
  var type = _ref3.type,
184
195
  toISOString = _ref3.toISOString,
196
+ toCSTString = _ref3.toCSTString,
185
197
  mode = _ref3.mode;
186
198
  return dateTransform({
187
199
  type: type,
188
200
  _valueType: 'date',
189
201
  toISOString: toISOString,
202
+ toCSTString: toCSTString,
190
203
  mode: mode
191
204
  });
192
205
  },
@@ -194,11 +207,13 @@ export default {
194
207
  dateTime: function dateTime(_ref4) {
195
208
  var type = _ref4.type,
196
209
  toISOString = _ref4.toISOString,
210
+ toCSTString = _ref4.toCSTString,
197
211
  mode = _ref4.mode;
198
212
  return dateTransform({
199
213
  type: type,
200
214
  _valueType: 'dateTime',
201
215
  toISOString: toISOString,
216
+ toCSTString: toCSTString,
202
217
  mode: mode
203
218
  });
204
219
  },
@@ -206,11 +221,13 @@ export default {
206
221
  dateStartTime: function dateStartTime(_ref5) {
207
222
  var type = _ref5.type,
208
223
  toISOString = _ref5.toISOString,
224
+ toCSTString = _ref5.toCSTString,
209
225
  mode = _ref5.mode;
210
226
  return dateTransform({
211
227
  type: type,
212
228
  _valueType: 'dateStartTime',
213
229
  toISOString: toISOString,
230
+ toCSTString: toCSTString,
214
231
  mode: mode
215
232
  });
216
233
  },
@@ -218,11 +235,13 @@ export default {
218
235
  dateEndTime: function dateEndTime(_ref6) {
219
236
  var type = _ref6.type,
220
237
  toISOString = _ref6.toISOString,
238
+ toCSTString = _ref6.toCSTString,
221
239
  mode = _ref6.mode;
222
240
  return dateTransform({
223
241
  type: type,
224
242
  _valueType: 'dateEndTime',
225
243
  toISOString: toISOString,
244
+ toCSTString: toCSTString,
226
245
  mode: mode
227
246
  });
228
247
  },
@@ -230,11 +249,13 @@ export default {
230
249
  dateStartEndTime: function dateStartEndTime(_ref7) {
231
250
  var type = _ref7.type,
232
251
  toISOString = _ref7.toISOString,
252
+ toCSTString = _ref7.toCSTString,
233
253
  mode = _ref7.mode;
234
254
  return dateTransform({
235
255
  type: type,
236
256
  _valueType: 'dateStartEndTime',
237
257
  toISOString: toISOString,
258
+ toCSTString: toCSTString,
238
259
  mode: mode
239
260
  });
240
261
  },