@zat-design/sisyphus-react 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/index.esm.css +121 -124
  2. package/es/ProEditTable/components/DndWrapper/index.d.ts +1 -1
  3. package/es/ProEditTable/components/DndWrapper/index.js +5 -5
  4. package/es/ProEditTable/components/RenderField/index.js +1 -1
  5. package/es/ProEditTable/index.js +15 -9
  6. package/es/ProEditTable/style/index.less +36 -55
  7. package/es/ProEditTable/utils/index.js +2 -2
  8. package/es/ProEnum/components/Group.d.ts +7 -0
  9. package/es/ProEnum/components/Group.js +51 -0
  10. package/es/ProEnum/index.js +25 -2
  11. package/es/ProEnum/propsType.d.ts +2 -2
  12. package/es/ProEnum/propsType.js +1 -1
  13. package/es/ProEnum/style/index.less +65 -1
  14. package/es/ProForm/components/base/InputNumber/index.js +2 -2
  15. package/es/ProForm/components/base/Radio/index.js +1 -1
  16. package/es/ProForm/components/base/Select/index.js +0 -13
  17. package/es/ProForm/components/combination/FormList/components/LineFields.js +1 -0
  18. package/es/ProForm/components/combination/ProNumberRange/style/index.less +20 -19
  19. package/es/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
  20. package/es/ProForm/components/render/ConfirmWrapper.js +66 -0
  21. package/es/ProForm/components/render/Render.js +19 -6
  22. package/es/ProForm/components/render/RenderFields.js +9 -9
  23. package/es/ProForm/components/render/propsType.d.ts +5 -2
  24. package/es/ProForm/style/index.less +6 -1
  25. package/es/ProForm/utils/useShouldUpdate.js +1 -1
  26. package/es/ProForm/utils/valueType.js +37 -3
  27. package/es/ProIcon/index.d.ts +0 -1
  28. package/es/ProIcon/index.js +6 -4
  29. package/es/ProIcon/style/index.less +4 -6
  30. package/es/ProIcon/symbolIcon.js +20 -20
  31. package/es/ProLayout/components/ProCollapse/style/index.less +17 -7
  32. package/es/ProLayout/components/ProHeader/style/index.less +109 -101
  33. package/es/ProTable/components/RenderColumn/index.js +1 -2
  34. package/es/ProTable/propsType.d.ts +1 -1
  35. package/es/ProTable/style/index.less +196 -99
  36. package/es/ProTable/utils.js +1 -1
  37. package/es/ProThemeTools/component/PrdTools/index.js +3 -3
  38. package/es/ProThemeTools/index.js +4 -2
  39. package/es/ProTreeModal/components/SortableItem.js +5 -7
  40. package/es/ProTreeModal/style/index.less +0 -6
  41. package/es/style/core/mixins.less +12 -5
  42. package/lib/ProEditTable/components/DndWrapper/index.d.ts +1 -1
  43. package/lib/ProEditTable/components/DndWrapper/index.js +5 -5
  44. package/lib/ProEditTable/components/RenderField/index.js +1 -1
  45. package/lib/ProEditTable/index.js +13 -7
  46. package/lib/ProEditTable/style/index.less +36 -55
  47. package/lib/ProEditTable/utils/index.js +2 -2
  48. package/lib/ProEnum/components/Group.d.ts +7 -0
  49. package/lib/ProEnum/components/Group.js +58 -0
  50. package/lib/ProEnum/index.js +25 -2
  51. package/lib/ProEnum/propsType.d.ts +2 -2
  52. package/lib/ProEnum/propsType.js +1 -1
  53. package/lib/ProEnum/style/index.less +65 -1
  54. package/lib/ProForm/components/base/InputNumber/index.js +2 -2
  55. package/lib/ProForm/components/base/Radio/index.js +1 -1
  56. package/lib/ProForm/components/base/Select/index.js +0 -13
  57. package/lib/ProForm/components/combination/FormList/components/LineFields.js +1 -0
  58. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +20 -19
  59. package/lib/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
  60. package/lib/ProForm/components/render/ConfirmWrapper.js +72 -0
  61. package/lib/ProForm/components/render/Render.js +19 -6
  62. package/lib/ProForm/components/render/RenderFields.js +9 -9
  63. package/lib/ProForm/components/render/propsType.d.ts +5 -2
  64. package/lib/ProForm/style/index.less +6 -1
  65. package/lib/ProForm/utils/useShouldUpdate.js +1 -1
  66. package/lib/ProForm/utils/valueType.js +37 -3
  67. package/lib/ProIcon/index.d.ts +0 -1
  68. package/lib/ProIcon/index.js +6 -4
  69. package/lib/ProIcon/style/index.less +4 -6
  70. package/lib/ProIcon/symbolIcon.js +20 -20
  71. package/lib/ProLayout/components/ProCollapse/style/index.less +17 -7
  72. package/lib/ProLayout/components/ProHeader/style/index.less +109 -101
  73. package/lib/ProTable/components/RenderColumn/index.js +1 -2
  74. package/lib/ProTable/propsType.d.ts +1 -1
  75. package/lib/ProTable/style/index.less +196 -99
  76. package/lib/ProTable/utils.js +1 -1
  77. package/lib/ProThemeTools/component/PrdTools/index.js +2 -2
  78. package/lib/ProThemeTools/index.js +3 -1
  79. package/lib/ProTreeModal/components/SortableItem.js +5 -7
  80. package/lib/ProTreeModal/style/index.less +0 -6
  81. package/lib/style/core/mixins.less +12 -5
  82. package/package.json +1 -1
@@ -206,7 +206,7 @@ var RenderField = function RenderField(_ref) {
206
206
  if (!((_names3 = names) === null || _names3 === void 0 ? void 0 : _names3.length)) {
207
207
  return {};
208
208
  }
209
- var namesStr = [baseName, index, dataIndex];
209
+ var namesStr = [].concat(_toConsumableArray(baseName), [index, dataIndex]);
210
210
  var transform = {};
211
211
  if (valueType) {
212
212
  transform = valueTypeTransform();
@@ -12,9 +12,9 @@ import _Form from "antd/es/form";
12
12
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
13
  var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip", "rowKey"];
14
14
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
- import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
15
+ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
16
16
  import { get, isArray } from 'lodash';
17
- import { useDebounceEffect, useSetState } from 'ahooks';
17
+ import { useDebounceEffect, useLocalStorageState, useSetState } from 'ahooks';
18
18
  import classnames from 'classnames';
19
19
  import { transformColumns } from './utils';
20
20
  import { getRandom, getNamePath } from './utils/tools';
@@ -22,7 +22,7 @@ import { DndWrapper, Row, Validator, Summary, RenderToolbar } from './components
22
22
  import Empty from '../assets/empty.png';
23
23
  import locale, { formatMessage } from '../locale';
24
24
  var ProEditTable = function ProEditTable(_ref, ref) {
25
- var _resetProps$id, _resetProps$id$split, _value$2;
25
+ var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _value$2;
26
26
  var value = _ref.value,
27
27
  onChange = _ref.onChange,
28
28
  className = _ref.className,
@@ -43,7 +43,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
43
43
  mulDeletePoConfirmMsg = _ref.mulDeletePoConfirmMsg,
44
44
  _ref$otherProps = _ref.otherProps,
45
45
  otherProps = _ref$otherProps === void 0 ? {} : _ref$otherProps,
46
- requiredAlign = _ref.requiredAlign,
46
+ configRequiredAlign = _ref.requiredAlign,
47
47
  summary = _ref.summary,
48
48
  max = _ref.max,
49
49
  headerRender = _ref.headerRender,
@@ -65,6 +65,13 @@ var ProEditTable = function ProEditTable(_ref, ref) {
65
65
  getPrefixCls = _React$useContext.getPrefixCls;
66
66
  var prefixCls = getPrefixCls();
67
67
  disabled = (otherProps === null || otherProps === void 0 ? void 0 : otherProps.disabled) || disabled;
68
+ var _useLocalStorageState = useLocalStorageState('themeConfig'),
69
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
70
+ themeConfig = _useLocalStorageState2[0];
71
+ var requiredAlign = useMemo(function () {
72
+ var _ref2, _themeConfig$data$zau, _themeConfig$data;
73
+ return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
74
+ }, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
68
75
  var _useSetState = useSetState({
69
76
  _columns: columns,
70
77
  cellNamePath: [],
@@ -101,8 +108,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
101
108
  var getRowKey = function getRowKey(record) {
102
109
  var key = record.rowKey || getRandom();
103
110
  if (rowKey) {
104
- var _ref2;
105
- key = (_ref2 = typeof rowKey === 'function' ? rowKey(record) : record[rowKey]) !== null && _ref2 !== void 0 ? _ref2 : key;
111
+ var _ref3;
112
+ key = (_ref3 = typeof rowKey === 'function' ? rowKey(record) : record[rowKey]) !== null && _ref3 !== void 0 ? _ref3 : key;
106
113
  }
107
114
  return key;
108
115
  };
@@ -226,7 +233,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
226
233
  return isForbiddenBtn('mulDelete') ? rowSelection : _rowSelection;
227
234
  };
228
235
  var setColumns = /*#__PURE__*/function () {
229
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
236
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
230
237
  var nextColumns;
231
238
  return _regeneratorRuntime().wrap(function _callee$(_context) {
232
239
  while (1) switch (_context.prev = _context.next) {
@@ -245,7 +252,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
245
252
  }, _callee);
246
253
  }));
247
254
  return function setColumns() {
248
- return _ref3.apply(this, arguments);
255
+ return _ref4.apply(this, arguments);
249
256
  };
250
257
  }();
251
258
  useDebounceEffect(function () {
@@ -355,7 +362,6 @@ ForwardProEditTable.defaultProps = {
355
362
  type: 'multiple',
356
363
  mode: 'multiple',
357
364
  insertType: 'after',
358
- requiredAlign: 'right',
359
365
  value: [],
360
366
  actionProps: [],
361
367
  toolbarProps: [],
@@ -63,7 +63,8 @@
63
63
  .drag-wrapper {
64
64
  display: flex;
65
65
  .drag-icon {
66
- margin-right: var(--zaui-space-size-xs, 4px);
66
+ margin-right: var(--zaui-space-size-md, 16px);
67
+ margin-left: var(--zaui-space-size-xs, 4px);
67
68
  cursor: pointer;
68
69
  }
69
70
  }
@@ -92,33 +93,8 @@
92
93
  }
93
94
 
94
95
  .@{ant-prefix}-table-header>table .@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
95
- &::after {
96
- content: "";
97
- }
98
-
99
- &.is-required-left {
100
- &::before {
101
- content: "";
102
- }
103
- }
104
- .pro-edit-table-title {
105
- &::after {
106
- width: auto;
107
- position : static;
108
- top : 0;
109
- display : inline-block;
110
- margin-left: var(--zaui-space-size-xs, 4px);
111
- color : #ff5050;
112
- font-size : 14px;
113
- line-height: 1;
114
- content : "*";
115
- }
116
-
117
- &.is-required-left {
118
- &::after {
119
- display: none;
120
- }
121
-
96
+ &.is-required-right {
97
+ .pro-edit-table-title {
122
98
  &::before {
123
99
  position : static;
124
100
  top : 0;
@@ -131,6 +107,21 @@
131
107
  }
132
108
  }
133
109
  }
110
+ &.is-required-left {
111
+ .pro-edit-table-title {
112
+ &::after {
113
+ width: auto;
114
+ position : static;
115
+ top : 0;
116
+ display : inline-block;
117
+ margin-left: var(--zaui-space-size-xs, 4px);
118
+ color : #ff5050;
119
+ font-size : 14px;
120
+ line-height: 1;
121
+ content : "*";
122
+ }
123
+ }
124
+ }
134
125
  }
135
126
 
136
127
  .@{ant-prefix}-table-scroll-horizontal {
@@ -166,33 +157,8 @@
166
157
  }
167
158
 
168
159
  .@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
169
- &::after {
170
- content: "";
171
- }
172
-
173
- &.is-required-left {
174
- &::before {
175
- content: "";
176
- }
177
- }
178
- .pro-edit-table-title {
179
- &::after {
180
- width: auto;
181
- position : static;
182
- top : 0;
183
- display : inline-block;
184
- margin-left: var(--zaui-space-size-xs, 4px);
185
- color : #ff5050;
186
- font-size : var(--zaui-font-size-md, 14px);
187
- line-height: 1;
188
- content : "*";
189
- }
190
-
191
- &.is-required-left {
192
- &::after {
193
- display: none;
194
- }
195
-
160
+ &.is-required-right {
161
+ .pro-edit-table-title {
196
162
  &::before {
197
163
  position : static;
198
164
  top : 0;
@@ -205,6 +171,21 @@
205
171
  }
206
172
  }
207
173
  }
174
+ &.is-required-left {
175
+ .pro-edit-table-title {
176
+ &::after {
177
+ width: auto;
178
+ position : static;
179
+ top : 0;
180
+ display : inline-block;
181
+ margin-left: var(--zaui-space-size-xs, 4px);
182
+ color : #ff5050;
183
+ font-size : 14px;
184
+ line-height: 1;
185
+ content : "*";
186
+ }
187
+ }
188
+ }
208
189
  }
209
190
  }
210
191
  }
@@ -250,8 +250,8 @@ export var transformColumns = function transformColumns() {
250
250
  item.className = classnames(_defineProperty({
251
251
  'is-hidden': hidden,
252
252
  'is-required': required || labelRequired,
253
- 'is-required-right': requiredAlign === 'right',
254
- 'is-required-left': requiredAlign === 'left'
253
+ 'is-required-left': requiredAlign === 'left',
254
+ 'is-required-right': requiredAlign === 'right'
255
255
  }, className, className));
256
256
  // 防止重复渲染导致className重复添加
257
257
  if (item.className) {
@@ -0,0 +1,7 @@
1
+ import { ProEnum } from '../propsType';
2
+ interface Props extends Pick<ProEnum, 'value' | 'onChange' | 'dataSource'> {
3
+ fieldValue: string;
4
+ fieldLabel: string;
5
+ }
6
+ declare const Group: (props: Props) => JSX.Element;
7
+ export default Group;
@@ -0,0 +1,51 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import classNames from 'classnames';
4
+ import { useSetState } from 'ahooks';
5
+ import { useEffect, useRef } from 'react';
6
+ var Group = function Group(props) {
7
+ var value = props.value,
8
+ onChange = props.onChange,
9
+ dataSource = props.dataSource,
10
+ fieldValue = props.fieldValue,
11
+ fieldLabel = props.fieldLabel;
12
+ var idx = useRef(-1);
13
+ var _useSetState = useSetState({
14
+ checked: ''
15
+ }),
16
+ _useSetState2 = _slicedToArray(_useSetState, 2),
17
+ state = _useSetState2[0],
18
+ setState = _useSetState2[1];
19
+ useEffect(function () {
20
+ setState({
21
+ checked: value
22
+ });
23
+ }, [value]);
24
+ var handleClick = function handleClick(val, index) {
25
+ setState({
26
+ checked: val
27
+ });
28
+ idx.current = index;
29
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
30
+ };
31
+ if (dataSource.length === 0) {
32
+ return _jsx("span", {
33
+ children: "-"
34
+ });
35
+ }
36
+ return _jsx("div", {
37
+ className: "pro-enum-group-root",
38
+ children: dataSource.map(function (item, index) {
39
+ return _jsx("div", {
40
+ onClick: function onClick() {
41
+ if (!item.disabled) {
42
+ handleClick(item[fieldValue], index);
43
+ }
44
+ },
45
+ className: classNames('pro-enum-group-item', state.checked === item[fieldValue] ? 'pro-enum-group-item-selected' : '', index === idx.current || index + 1 === idx.current ? 'pro-enum-group-item-disabled-after' : '', item.disabled ? 'pro-enum-group-item-disabled' : ''),
46
+ children: item[fieldLabel]
47
+ }, item[fieldValue]);
48
+ })
49
+ });
50
+ };
51
+ export default Group;
@@ -20,6 +20,7 @@ import { cloneDeep, isFunction, isString, isArray, omit } from 'lodash';
20
20
  import ProSelect from '../ProSelect';
21
21
  import { useProConfig } from '../ProConfigProvider';
22
22
  import ProEnumTag from './components/Tag';
23
+ import ProEnumGroup from './components/Group';
23
24
  import Container from '../ProForm/components/Container';
24
25
  import { isObject } from './utils';
25
26
  import getEnumLabel from './utils/getEnumLabel';
@@ -175,13 +176,27 @@ var ProEnum = function ProEnum(props) {
175
176
  return _jsx(_Radio.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames'])), {}, {
176
177
  options: list,
177
178
  value: value,
178
- onChange: onChange
179
+ onChange: onChange,
180
+ children: list.map(function (item) {
181
+ return _jsx(_Radio, {
182
+ value: item[fieldValue],
183
+ disabled: !!item.disabled,
184
+ children: item[label]
185
+ }, item[fieldValue]);
186
+ })
179
187
  }));
180
188
  case 'Checkbox':
181
189
  return _jsx(_Checkbox.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames'])), {}, {
182
190
  options: list,
183
191
  value: value,
184
- onChange: onChange
192
+ onChange: onChange,
193
+ children: list.map(function (item) {
194
+ return _jsx(_Checkbox, {
195
+ value: item[fieldValue],
196
+ disabled: !!item.disabled,
197
+ children: item[label]
198
+ }, item[fieldValue]);
199
+ })
185
200
  }));
186
201
  case 'Tag':
187
202
  return _jsx(ProEnumTag, {
@@ -191,6 +206,14 @@ var ProEnum = function ProEnum(props) {
191
206
  fieldValue: fieldValue,
192
207
  dataSource: list
193
208
  });
209
+ case 'Group':
210
+ return _jsx(ProEnumGroup, {
211
+ value: value,
212
+ onChange: onChange,
213
+ fieldLabel: label,
214
+ fieldValue: fieldValue,
215
+ dataSource: list
216
+ });
194
217
  default:
195
218
  return null;
196
219
  }
@@ -42,7 +42,7 @@ export interface ProEnumConfig {
42
42
  };
43
43
  dics: Record<string, DataOption[]>;
44
44
  }
45
- type ProEnumType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag';
45
+ type ProEnumType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag' | 'Group';
46
46
  export interface ProEnum {
47
47
  /** 组件展示类型、默认 ProSelect */
48
48
  type?: ProEnumType;
@@ -86,7 +86,7 @@ export type CheckboxPropsMap = {
86
86
  type?: 'Checkbox';
87
87
  } & CheckboxProps;
88
88
  export interface TagPropsMap {
89
- type?: 'Tag';
89
+ type?: 'Tag' | 'Group';
90
90
  }
91
91
  export type ProEnumProps = Omit<ProEnum, 'type'> & (PropProSelectsMap | PropRadioPropsMap | CheckboxPropsMap | TagPropsMap);
92
92
  export {};
@@ -2,6 +2,6 @@ var proEnum = {
2
2
  code: '22',
3
3
  showCodeName: true,
4
4
  value: 1,
5
- type: 'Tag'
5
+ type: 'Group'
6
6
  };
7
7
  export {};
@@ -12,7 +12,7 @@
12
12
  align-items: center;
13
13
  justify-content: center;
14
14
  margin-right: var(--zaui-space-size-sm);
15
- margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
15
+ margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
16
16
  padding: var(--zaui-space-size-xs) 10px;
17
17
  background-color: #f5f5f5;
18
18
  border-radius: var(--zaui-space-size-xs);
@@ -23,4 +23,68 @@
23
23
  color: #fff;
24
24
  background-color: var(--zaui-brand);
25
25
  }
26
+ &-tag-item-disabled {
27
+ background-color: #f5f5f5;
28
+ pointer-events: none;
29
+ }
30
+
31
+ &-group-root {
32
+ display: flex;
33
+ flex-direction: row;
34
+ flex-wrap: wrap;
35
+
36
+ .pro-enum-group-item {
37
+ position: relative;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
42
+ padding: var(--zaui-space-size-sm) var(--zaui-space-border);
43
+ line-height: 18px;
44
+ background-color: #f1f3f6ff;
45
+ cursor: pointer;
46
+
47
+ &::after {
48
+ position: absolute;
49
+ top: var(--zaui-space-size-sm);
50
+ right: 0;
51
+ bottom: var(--zaui-space-size-sm);
52
+ width: 1px;
53
+ background: var(--zaui-brand);
54
+ opacity: 0.7;
55
+ content: '';
56
+ }
57
+
58
+ &:first-child {
59
+ border-top-left-radius: var(--zaui-space-size-xs);
60
+ border-bottom-left-radius: var(--zaui-space-size-xs);
61
+ }
62
+
63
+ &:last-child {
64
+ border-top-right-radius: var(--zaui-space-size-xs);
65
+ border-bottom-right-radius: var(--zaui-space-size-xs);
66
+ &::after {
67
+ width: 0;
68
+ }
69
+ }
70
+ }
71
+
72
+ .pro-enum-group-item-selected {
73
+ color: var(--zaui-brand);
74
+ border: 1px solid var(--zaui-brand);
75
+ &::after {
76
+ width: 0;
77
+ }
78
+ }
79
+
80
+ .pro-enum-group-item-disabled-after::after {
81
+ width: 0 !important;
82
+ }
83
+
84
+ .pro-enum-group-item-disabled {
85
+ color: rgba(0, 0, 0, 0.25);
86
+ background: #f5f5f5;
87
+ cursor: not-allowed;
88
+ }
89
+ }
26
90
  }
@@ -68,12 +68,12 @@ var InputNumber = function InputNumber(props) {
68
68
  return value;
69
69
  }
70
70
  return num.toLocaleString('en-US', {
71
- maximumFractionDigits: (props === null || props === void 0 ? void 0 : props.precision) || 0
71
+ maximumFractionDigits: (props === null || props === void 0 ? void 0 : props.precision) || 2
72
72
  });
73
73
  },
74
74
  parser: function parser(value) {
75
75
  var num = Number(value.replace(/[\s,]+/g, ''));
76
- return Number.isNaN(num) ? value : num.toFixed((props === null || props === void 0 ? void 0 : props.precision) || 0);
76
+ return Number.isNaN(num) ? value : num.toFixed((props === null || props === void 0 ? void 0 : props.precision) || 2);
77
77
  }
78
78
  };
79
79
  break;
@@ -56,7 +56,7 @@ var Radio = function Radio(props) {
56
56
  onChange: function onChange(e) {
57
57
  _onChange(e, e.target.value);
58
58
  },
59
- children: !!dataSource.length && dataSource.map(function (radioItem) {
59
+ children: !!(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) && dataSource.map(function (radioItem) {
60
60
  return _jsx(_Radio, {
61
61
  value: radioItem[_fieldNames.value],
62
62
  children: radioItem[_fieldNames.label]
@@ -48,19 +48,6 @@ var Select = function Select(props) {
48
48
  children: value ? transToLabel([value]) : null
49
49
  });
50
50
  }
51
- // 假如dataSource包含code,name, fieldNames没有配置,_fieldNames默认为code, name
52
- if (Array.isArray(dataSource) && !fieldNames) {
53
- var _dataSource$filter;
54
- var hasCodeName = Boolean((_dataSource$filter = dataSource.filter(function (item) {
55
- return Object.keys(item).includes('code') && Object.keys(item).includes('name');
56
- })) === null || _dataSource$filter === void 0 ? void 0 : _dataSource$filter.length);
57
- if (hasCodeName) {
58
- _fieldNames = {
59
- label: 'name',
60
- value: 'code'
61
- };
62
- }
63
- }
64
51
  return _jsx(_Select, _objectSpread(_objectSpread(_objectSpread({
65
52
  placeholder: "".concat(locale.ProForm.selectPlaceHolder),
66
53
  allowClear: true,
@@ -55,6 +55,7 @@ var LineFields = function LineFields(props) {
55
55
  className: "pro-form-list-drag-handle",
56
56
  ref: setActivatorNodeRef,
57
57
  children: _jsx(ProIcon, {
58
+ className: "drag-icon",
58
59
  type: "drag"
59
60
  })
60
61
  })), _jsx(_Row, {
@@ -2,13 +2,16 @@
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
4
  .pro-number-range {
5
-
6
5
  .range-split {
7
- width : 40px !important;
8
- border-left : 0px;
9
- border-right : 0px;
6
+ width: 32px !important;
7
+ text-align: center !important;
8
+
9
+ border-right: 0px;
10
+ border-left: 0px;
10
11
  pointer-events: none;
11
- text-align : center !important;
12
+ &.ant-input[disabled] {
13
+ background: #fff !important;
14
+ }
12
15
  }
13
16
 
14
17
  .@{ant-prefix}-input-status-error {
@@ -17,8 +20,6 @@
17
20
  }
18
21
  }
19
22
 
20
-
21
-
22
23
  & .@{ant-prefix}-input-rtl.range-right {
23
24
  border-right-width: 0;
24
25
  }
@@ -34,7 +35,7 @@
34
35
 
35
36
  .range-left,
36
37
  .range-right {
37
- width : calc(50% - 20px);
38
+ width: calc(50% - 20px);
38
39
  text-align: center;
39
40
  }
40
41
 
@@ -50,32 +51,32 @@
50
51
  }
51
52
 
52
53
  .range-right {
53
- width : 100%;
54
- border-top-left-radius : 0;
54
+ width: 100%;
55
+ border-top-left-radius: 0;
55
56
  border-bottom-left-radius: 0;
56
57
  }
57
58
  }
58
59
 
59
- &.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact>*:not(:last-child) {
60
+ &.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > *:not(:last-child) {
60
61
  margin-right: 0;
61
62
  }
62
63
 
63
- >*:first-child {
64
- border-top-right-radius : 0 !important;
64
+ > *:first-child {
65
+ border-top-right-radius: 0 !important;
65
66
  border-bottom-right-radius: 0 !important;
66
67
 
67
- >.@{ant-prefix}-select-selector {
68
- border-top-right-radius : 0 !important;
68
+ > .@{ant-prefix}-select-selector {
69
+ border-top-right-radius: 0 !important;
69
70
  border-bottom-right-radius: 0 !important;
70
71
  }
71
72
  }
72
73
 
73
- >*:last-child {
74
- border-top-left-radius : 0 !important;
74
+ > *:last-child {
75
+ border-top-left-radius: 0 !important;
75
76
  border-bottom-left-radius: 0 !important;
76
77
 
77
- >.@{ant-prefix}-select-selector {
78
- border-top-left-radius : 0 !important;
78
+ > .@{ant-prefix}-select-selector {
79
+ border-top-left-radius: 0 !important;
79
80
  border-bottom-left-radius: 0 !important;
80
81
  }
81
82
  }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ProFormColumnProps } from '../../propsType';
3
+ interface Props<T = any> {
4
+ value?: T;
5
+ onChange?: (value: T, ...rest: any[]) => void;
6
+ confirm: ProFormColumnProps['confirm'];
7
+ [K: string]: any;
8
+ }
9
+ declare const ConfirmWrapper: React.FC<Props>;
10
+ export default ConfirmWrapper;
@@ -0,0 +1,66 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import "antd/es/modal/style";
3
+ import _Modal from "antd/es/modal";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ var _excluded = ["onChange", "children", "confirm"];
6
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
7
+ import { isFunction, isObject } from 'lodash';
8
+ import React from 'react';
9
+ import ProForm from '../../index';
10
+ var defaultConfirmProps = {
11
+ title: '点击确定完成修改'
12
+ };
13
+ var ConfirmWrapper = function ConfirmWrapper(props) {
14
+ var onChange = props.onChange,
15
+ children = props.children,
16
+ confirm = props.confirm,
17
+ rest = _objectWithoutProperties(props, _excluded);
18
+ var _ProForm$useFieldProp = ProForm.useFieldProps(),
19
+ form = _ProForm$useFieldProp.form;
20
+ var handleChange = function handleChange(value) {
21
+ for (var _len = arguments.length, other = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
22
+ other[_key - 1] = arguments[_key];
23
+ }
24
+ var _value = (value === null || value === void 0 ? void 0 : value.target) ? value.target.value : value;
25
+ if (confirm === true) {
26
+ _Modal.confirm(_objectSpread(_objectSpread({}, defaultConfirmProps), {}, {
27
+ onOk: function onOk() {
28
+ return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
29
+ }
30
+ }));
31
+ return;
32
+ }
33
+ if (isFunction(confirm)) {
34
+ var confirmProps = isFunction(confirm) && confirm(form.getFieldsValue());
35
+ if (confirmProps === true) {
36
+ _Modal.confirm(_objectSpread(_objectSpread({}, defaultConfirmProps), {}, {
37
+ onOk: function onOk() {
38
+ return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
39
+ }
40
+ }));
41
+ return;
42
+ }
43
+ if (isObject(confirmProps)) {
44
+ _Modal.confirm(_objectSpread(_objectSpread(_objectSpread({}, defaultConfirmProps), confirmProps), {}, {
45
+ onOk: function onOk() {
46
+ for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
47
+ arg[_key2] = arguments[_key2];
48
+ }
49
+ confirmProps === null || confirmProps === void 0 ? void 0 : confirmProps.onOk.apply(confirmProps, arg);
50
+ onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
51
+ }
52
+ }));
53
+ return;
54
+ }
55
+ }
56
+ onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
57
+ };
58
+ return _jsx(_Fragment, {
59
+ children: /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
60
+ // @ts-ignore
61
+ value: rest.value === undefined ? null : rest.value,
62
+ onChange: handleChange
63
+ }))
64
+ });
65
+ };
66
+ export default ConfirmWrapper;