@zat-design/sisyphus-react 3.4.6-beta.11 → 3.4.6-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 (71) hide show
  1. package/dist/index.esm.css +1 -4
  2. package/dist/less.esm.css +1 -4
  3. package/es/ProEditTable/components/RenderField/index.js +4 -8
  4. package/es/ProEditTable/style/index.less +1 -4
  5. package/es/ProForm/components/base/TextArea/index.d.ts +0 -1
  6. package/es/ProForm/components/base/TextArea/index.js +2 -4
  7. package/es/ProForm/components/combination/FormList/index.js +1 -1
  8. package/es/ProForm/components/combination/FormList/utils.js +2 -3
  9. package/es/ProForm/components/combination/Group/index.d.ts +8 -2
  10. package/es/ProForm/components/combination/Group/index.js +59 -76
  11. package/es/ProForm/components/combination/Group/propsType.d.ts +27 -14
  12. package/es/ProForm/components/combination/Group/utils.d.ts +60 -7
  13. package/es/ProForm/components/combination/Group/utils.js +209 -19
  14. package/es/ProForm/components/combination/ProModalSelect/index.js +29 -35
  15. package/es/ProForm/components/combination/_Group/index.d.ts +4 -0
  16. package/es/ProForm/components/combination/_Group/index.js +109 -0
  17. package/es/ProForm/components/combination/_Group/propsType.d.ts +35 -0
  18. package/es/ProForm/components/combination/_Group/utils.d.ts +10 -0
  19. package/es/ProForm/components/combination/_Group/utils.js +46 -0
  20. package/es/ProForm/components/render/Render.js +10 -8
  21. package/es/ProForm/components/render/propsType.d.ts +2 -2
  22. package/es/ProForm/utils/transformNames.js +3 -10
  23. package/es/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
  24. package/es/ProForm/utils/useDeepCompareMemo.js +14 -0
  25. package/es/ProForm/utils/useRules.js +2 -20
  26. package/es/global.less +22 -34
  27. package/es/locale/zh_CN.js +1 -1
  28. package/lib/ProEditTable/components/RenderField/index.js +4 -8
  29. package/lib/ProEditTable/style/index.less +1 -4
  30. package/lib/ProForm/components/base/TextArea/index.d.ts +0 -1
  31. package/lib/ProForm/components/base/TextArea/index.js +2 -4
  32. package/lib/ProForm/components/combination/FormList/index.js +1 -1
  33. package/lib/ProForm/components/combination/FormList/utils.js +2 -3
  34. package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
  35. package/lib/ProForm/components/combination/Group/index.js +58 -72
  36. package/lib/ProForm/components/combination/Group/propsType.d.ts +27 -14
  37. package/lib/ProForm/components/combination/Group/utils.d.ts +60 -7
  38. package/lib/ProForm/components/combination/Group/utils.js +210 -20
  39. package/lib/ProForm/components/combination/ProModalSelect/index.js +29 -35
  40. package/lib/ProForm/components/combination/_Group/index.d.ts +4 -0
  41. package/lib/ProForm/components/combination/_Group/index.js +113 -0
  42. package/lib/ProForm/components/combination/_Group/propsType.d.ts +35 -0
  43. package/lib/ProForm/components/combination/_Group/utils.d.ts +10 -0
  44. package/lib/ProForm/components/combination/_Group/utils.js +53 -0
  45. package/lib/ProForm/components/render/Render.js +9 -7
  46. package/lib/ProForm/components/render/propsType.d.ts +2 -2
  47. package/lib/ProForm/utils/transformNames.js +2 -9
  48. package/lib/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
  49. package/lib/ProForm/utils/useDeepCompareMemo.js +20 -0
  50. package/lib/ProForm/utils/useRules.js +2 -20
  51. package/lib/global.less +22 -34
  52. package/lib/locale/zh_CN.js +1 -1
  53. package/package.json +1 -1
  54. package/es/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
  55. package/es/ProForm/components/combination/GroupCopy/index.js +0 -84
  56. package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
  57. package/es/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
  58. package/es/ProForm/components/combination/GroupCopy/utils.js +0 -180
  59. package/lib/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
  60. package/lib/ProForm/components/combination/GroupCopy/index.js +0 -91
  61. package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
  62. package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
  63. package/lib/ProForm/components/combination/GroupCopy/utils.js +0 -187
  64. /package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
  65. /package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +0 -0
  66. /package/es/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
  67. /package/es/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
  68. /package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
  69. /package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +0 -0
  70. /package/lib/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
  71. /package/lib/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
@@ -4146,9 +4146,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4146
4146
  -webkit-box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
4147
4147
  box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
4148
4148
  }
4149
- .pro-edit-table td[rowspan] {
4150
- vertical-align: middle !important;
4151
- }
4152
4149
  .pro-edit-table .pro-edit-table-tooltip {
4153
4150
  display: -webkit-inline-box;
4154
4151
  display: -webkit-inline-flex;
@@ -4215,7 +4212,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4215
4212
  display: -ms-flexbox;
4216
4213
  display: flex;
4217
4214
  }
4218
- .pro-edit-table .drag-wrapper .anticon {
4215
+ .pro-edit-table .drag-wrapper .drag-icon {
4219
4216
  margin-right: var(--zaui-space-size-md, 16px);
4220
4217
  margin-left: var(--zaui-space-size-xs, 4px);
4221
4218
  cursor: pointer;
package/dist/less.esm.css CHANGED
@@ -4146,9 +4146,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4146
4146
  -webkit-box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
4147
4147
  box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
4148
4148
  }
4149
- .pro-edit-table td[rowspan] {
4150
- vertical-align: middle !important;
4151
- }
4152
4149
  .pro-edit-table .pro-edit-table-tooltip {
4153
4150
  display: -webkit-inline-box;
4154
4151
  display: -webkit-inline-flex;
@@ -4215,7 +4212,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4215
4212
  display: -ms-flexbox;
4216
4213
  display: flex;
4217
4214
  }
4218
- .pro-edit-table .drag-wrapper .anticon {
4215
+ .pro-edit-table .drag-wrapper .drag-icon {
4219
4216
  margin-right: var(--zaui-space-size-md, 16px);
4220
4217
  margin-left: var(--zaui-space-size-xs, 4px);
4221
4218
  cursor: pointer;
@@ -315,7 +315,7 @@ var RenderField = function RenderField(_ref) {
315
315
  }
316
316
  _args = [].concat(args);
317
317
  rowPath = [].concat(_toConsumableArray(namePath), [index]);
318
- row = type === 'Group' ? _args[1] : form.getFieldValue(rowPath, true);
318
+ row = form.getFieldValue(rowPath, true);
319
319
  orgRow = cloneDeep(row);
320
320
  if (!onFieldChange) {
321
321
  _context.next = 18;
@@ -360,7 +360,7 @@ var RenderField = function RenderField(_ref) {
360
360
  return onChange.apply(void 0, _toConsumableArray(_args));
361
361
  case 27:
362
362
  // 判断属性是否变动
363
- type !== 'Group' && form.setFieldValue(rowPath, row);
363
+ form.setFieldValue(rowPath, row);
364
364
  if (!isEqual(orgRow, row)) {
365
365
  diff = difference(row, orgRow) || {};
366
366
  validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
@@ -406,7 +406,7 @@ var RenderField = function RenderField(_ref) {
406
406
  }
407
407
  _args = formatArgs([].concat(args));
408
408
  rowPath = [].concat(_toConsumableArray(namePath), [index]);
409
- row = type === 'Group' ? _args[1] : form.getFieldValue(rowPath, true);
409
+ row = type === form.getFieldValue(rowPath, true);
410
410
  orgRow = cloneDeep(row);
411
411
  _args[1] = row;
412
412
  _context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
@@ -497,11 +497,7 @@ var RenderField = function RenderField(_ref) {
497
497
  isView: isView
498
498
  }
499
499
  });
500
- if (type === 'Group') {
501
- componentProps.onFieldChange = _onchange;
502
- } else {
503
- componentProps = omit(componentProps, ['onFieldChange', 'namePath', 'index']);
504
- }
500
+ componentProps = omit(componentProps, ['onFieldChange', 'namePath', 'index']);
505
501
  // 单元格编辑时,设置各个单元格disabled属性
506
502
  if (isCell) {
507
503
  record["".concat(dataIndex, "-Disabled")] = _disabled;
@@ -2,9 +2,6 @@
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
4
  .pro-edit-table {
5
- td[rowspan]{
6
- vertical-align: middle !important;
7
- }
8
5
  .pro-edit-table-tooltip {
9
6
  display : inline-flex;
10
7
  align-items: center;
@@ -65,7 +62,7 @@
65
62
 
66
63
  .drag-wrapper {
67
64
  display: flex;
68
- .anticon {
65
+ .drag-icon {
69
66
  margin-right: var(--zaui-space-size-md, 16px);
70
67
  margin-left: var(--zaui-space-size-xs, 4px);
71
68
  cursor: pointer;
@@ -5,7 +5,6 @@ import './index.less';
5
5
  export interface Props extends TextAreaProps {
6
6
  otherProps?: ProFormOtherProps;
7
7
  isView?: boolean;
8
- tooltip?: boolean;
9
8
  }
10
9
  declare const TextAreaDef: React.FC<Props>;
11
10
  export default TextAreaDef;
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import "antd/es/input/style";
5
5
  import _Input from "antd/es/input";
6
- var _excluded = ["placeholder", "otherProps", "className", "tooltip"];
6
+ var _excluded = ["placeholder", "otherProps", "className"];
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { omit } from 'lodash';
9
9
  import classnames from 'classnames';
@@ -17,8 +17,6 @@ var TextAreaDef = function TextAreaDef(props) {
17
17
  var placeholder = props.placeholder,
18
18
  otherProps = props.otherProps,
19
19
  className = props.className,
20
- _props$tooltip = props.tooltip,
21
- tooltip = _props$tooltip === void 0 ? true : _props$tooltip,
22
20
  rest = _objectWithoutProperties(props, _excluded);
23
21
  var _ref = ProForm.useFieldProps() || {},
24
22
  label = _ref.label,
@@ -29,7 +27,7 @@ var TextAreaDef = function TextAreaDef(props) {
29
27
  if (isView) {
30
28
  return _jsx(Container, {
31
29
  nowrap: false,
32
- tooltip: tooltip,
30
+ tooltip: true,
33
31
  viewEmpty: viewEmpty,
34
32
  children: rest.value
35
33
  });
@@ -48,7 +48,7 @@ var FormList = function FormList(props, ref) {
48
48
  name: _name,
49
49
  names: (item === null || item === void 0 ? void 0 : item.names) ? item.names.map(function (nameItem) {
50
50
  // 传给Group的names会被渲染成真实FormItem 不能传完整name
51
- return item.type === 'Group' ? [fieldName].concat(_toConsumableArray(toArray(nameItem))) : [].concat(_toConsumableArray(namePath), _toConsumableArray(toArray(nameItem)));
51
+ return [].concat(_toConsumableArray(namePath), _toConsumableArray(toArray(nameItem)));
52
52
  }) : item.names,
53
53
  index: fieldName,
54
54
  namePath: namePath,
@@ -8,12 +8,11 @@ export var namesPathTransform = function namesPathTransform(_ref) {
8
8
  var names = _ref.names,
9
9
  prefixNamePath = _ref.prefixNamePath,
10
10
  type = _ref.type;
11
- if (!Array.isArray(names) || type !== 'Group' && !Array.isArray(prefixNamePath)) {
11
+ if (!Array.isArray(names) || !Array.isArray(prefixNamePath)) {
12
12
  return '';
13
13
  }
14
- var _prefixNamePath = type === 'Group' ? '' : prefixNamePath;
15
14
  var newNamePath = names.map(function (val) {
16
- return _prefixNamePath.concat(val);
15
+ return prefixNamePath.concat(val);
17
16
  });
18
17
  return newNamePath === null || newNamePath === void 0 ? void 0 : newNamePath.map(function (name) {
19
18
  return Array.isArray(name) ? name.join('_') : name;
@@ -1,4 +1,10 @@
1
1
  import React from 'react';
2
2
  import { GroupProps } from './propsType';
3
- declare const Group: React.FC<GroupProps>;
4
- export default Group;
3
+ /**
4
+ * 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
5
+ * 2.
6
+ *
7
+ * render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
8
+ */
9
+ declare const GroupCopy: React.FC<GroupProps>;
10
+ export default GroupCopy;
@@ -1,61 +1,61 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
2
  import "antd/es/space/style";
2
3
  import _Space from "antd/es/space";
3
4
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import "antd/es/button/style";
5
- import _Button from "antd/es/button";
6
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
8
- import { useMemo } from 'react';
9
- import { omit, isFunction, union, isNumber } from 'lodash';
10
- import { useDeepCompareEffect } from 'ahooks';
7
+ import React, { useMemo } from 'react';
8
+ import { omit } from 'lodash';
11
9
  import classnames from 'classnames';
12
- import RenderFields from '../../render/RenderFields';
13
- import { insertSeparator, transformNamesString } from './utils';
10
+ import { insertSeparator, transformColumns } from './utils';
14
11
  import ProForm from '../../../../ProForm';
15
- var Group = function Group(props) {
16
- var columns = props.children,
17
- otherProps = props.otherProps,
12
+ import ComRender from './component/ComRender';
13
+ /**
14
+ * 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
15
+ * 2.
16
+ *
17
+ * render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
18
+ */
19
+ var GroupCopy = function GroupCopy(props) {
20
+ console.log('🚀 ~~> props:', props);
21
+ var children = props.children,
18
22
  className = props.className,
19
23
  _props$space = props.space,
20
24
  space = _props$space === void 0 ? {
21
25
  size: 12
22
26
  } : _props$space,
23
- id = props.id,
24
27
  value = props.value,
25
- isView = props.isView,
26
- index = props.index,
27
- onFieldChange = props.onFieldChange,
28
- namePath = props.namePath;
29
- var _ref = ProForm.useFieldProps() || {},
30
- names = _ref.names,
31
- name = _ref.name,
32
- form = _ref.form,
33
- _namePath = _ref.namePath;
34
- var newNamePath = namePath || _namePath || [];
35
- if (!Array.isArray(names)) {
36
- console.error('Warning: Composite form components whose type is Group must be configured with names');
37
- }
38
- var data = useMemo(function () {
39
- var fieldList = [];
40
- var result = columns.map(function (item) {
41
- return _objectSpread(_objectSpread({
42
- disabled: Boolean(props === null || props === void 0 ? void 0 : props.disabled)
43
- }, item), {}, {
44
- isView: isView !== null && isView !== void 0 ? isView : item.isView,
45
- noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
46
- parentNames: id,
47
- namePath: newNamePath
48
- });
49
- });
50
- var node = _jsx(_Button, {
51
- className: "group-separator",
52
- children: space.separator
28
+ onChange = props.onChange,
29
+ otherProps = props.otherProps,
30
+ disabled = props.disabled;
31
+ var contextProps = ProForm.useFieldProps() || {};
32
+ var names = contextProps.names,
33
+ name = contextProps.name,
34
+ form = contextProps.form,
35
+ namePath = contextProps.namePath,
36
+ index = contextProps.index;
37
+ var _option = React.useRef([]);
38
+ // 组合onChange
39
+ var handleChange = function handleChange(value, option, index) {
40
+ var _value = props.value ? _toConsumableArray(props.value) : [];
41
+ _value[index] = value;
42
+ _option.current[index] = option;
43
+ onChange(_value, _option.current);
44
+ };
45
+ var columns = useMemo(function () {
46
+ var columnsProps = transformColumns({
47
+ columns: children,
48
+ name: name,
49
+ names: names,
50
+ onChange: handleChange,
51
+ namePath: namePath,
52
+ form: form,
53
+ index: index,
54
+ value: value,
55
+ groupProps: props
53
56
  });
54
- return {
55
- columns: insertSeparator(result, space, node, otherProps),
56
- fieldList: fieldList
57
- };
58
- }, [name, columns, space, props, names]);
57
+ return insertSeparator(columnsProps, space);
58
+ }, [name, value, children, space, names, namePath, index]);
59
59
  var _className = classnames(_defineProperty({
60
60
  'pro-group': true,
61
61
  'pro-group-diy-width': columns.some(function (item) {
@@ -66,44 +66,27 @@ var Group = function Group(props) {
66
66
  return ['Radio', 'Checkbox', 'Switch'].includes(item.type);
67
67
  })
68
68
  }, "".concat(className), className));
69
- // 用于formList场景下names移除掉了前缀,需要再次合并回来
70
- var _names = names.map(function (item) {
71
- if (isNumber(item === null || item === void 0 ? void 0 : item[0])) {
72
- return union(newNamePath, item);
73
- }
74
- return item;
75
- });
76
- useDeepCompareEffect(function () {
77
- var _document, _document$activeEleme;
78
- // 焦点激活的表单
79
- var touchName = ((_document = document) === null || _document === void 0 ? void 0 : (_document$activeEleme = _document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) || '';
80
- // 模拟change,初始化不执行onFieldChange
81
- if (isFunction(onFieldChange) && form.isFieldsTouched(_names) && transformNamesString(_names).includes(touchName)) {
82
- onFieldChange(value, (newNamePath === null || newNamePath === void 0 ? void 0 : newNamePath.length) ? form.getFieldValue(newNamePath, true) : form.getFieldsValue(), {
83
- form: form,
84
- namePath: newNamePath,
85
- index: index
86
- });
87
- }
88
- }, [value]);
89
- var _otherProps = omit(otherProps, ['colProps', 'required']);
90
69
  return _jsx("div", {
91
70
  className: _className,
92
71
  children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? _jsx(_Space.Compact, {
93
- children: _jsx(RenderFields, _objectSpread({
94
- columns: data.columns,
95
- form: form
96
- }, _otherProps))
72
+ children: columns.map(function (column) {
73
+ return _jsx(ComRender, _objectSpread(_objectSpread({
74
+ contextProps: contextProps
75
+ }, column), {}, {
76
+ otherProps: otherProps
77
+ }));
78
+ })
97
79
  }) : _jsx(_Space, _objectSpread(_objectSpread({
98
80
  align: "start"
99
81
  }, omit(space, ['separator', 'compact'])), {}, {
100
- children: data.columns.map(function (column, index) {
101
- return _jsx(RenderFields, _objectSpread({
102
- columns: [column],
103
- form: form
104
- }, _otherProps), (column === null || column === void 0 ? void 0 : column.name) || index);
82
+ children: columns.map(function (column, index) {
83
+ return _jsx(ComRender, _objectSpread(_objectSpread({
84
+ contextProps: contextProps
85
+ }, column), {}, {
86
+ otherProps: otherProps
87
+ }));
105
88
  })
106
89
  }))
107
90
  });
108
91
  };
109
- export default Group;
92
+ export default GroupCopy;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { RowProps, SpaceProps } from 'antd';
2
+ import { FormItemProps, ModalFuncProps, SpaceProps } from 'antd';
3
3
  import { FormInstance } from 'antd/es/form/Form';
4
4
  import { NamePath } from 'antd/lib/form/interface';
5
- import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
5
+ import { ColumnPropsMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../../propsType';
6
6
  export interface SpaceType extends SpaceProps {
7
7
  /**
8
8
  * 是否紧凑合并
@@ -16,20 +16,33 @@ export interface SpaceType extends SpaceProps {
16
16
  size?: number;
17
17
  }
18
18
  export interface GroupProps {
19
- children?: ProColumnProps[];
19
+ children?: GroupColumnProps[];
20
20
  space?: SpaceType;
21
- otherProps?: ProFormOtherProps;
22
- rowProps?: RowProps;
23
21
  className?: string;
24
- value?: any;
25
22
  id?: string;
26
- disabled?: boolean | (() => void);
23
+ disabled?: boolean;
27
24
  isView?: boolean;
28
- namePath?: NamePath;
29
- index?: number;
30
- onFieldChange?: (value: any[] | null, record: any, { form, }: {
31
- form: FormInstance;
32
- namePath?: NamePath;
33
- index?: number;
34
- }) => any;
25
+ value?: any[];
26
+ onChange?: (value: any[] | null, options?: any[]) => void;
27
+ otherProps?: any;
35
28
  }
29
+ export type GroupColumnProps<Values = any> = {
30
+ component?: React.ReactNode | ReactiveFunction<Values, React.ReactNode>;
31
+ names?: NamePath[];
32
+ show?: boolean | ReactiveFunction<Values, boolean>;
33
+ valueType?: ProFormValueType;
34
+ switchValue?: [any, any];
35
+ isView?: boolean;
36
+ viewRender?: (value: any, record: Values, { form, index, namePath, }: {
37
+ form: FormInstance<Values>;
38
+ index?: number | undefined;
39
+ [key: string]: any;
40
+ }) => React.ReactElement<any, any> | string | undefined | null;
41
+ viewType?: ViewType;
42
+ disabled?: boolean | ReactiveFunction<Values, boolean>;
43
+ trim?: boolean;
44
+ upperCase?: boolean;
45
+ toISOString?: boolean;
46
+ clearNotShow?: boolean;
47
+ confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
48
+ } & ColumnPropsMap & FormItemProps;
@@ -1,10 +1,63 @@
1
- import { ReactNode } from 'react';
2
- import { SpaceType } from './propsType';
1
+ /// <reference types="react" />
2
+ import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
3
+ import { FormInstance } from 'antd';
4
+ import { GroupColumnProps, GroupProps, SpaceType } from './propsType';
5
+ import { ProFormColumnProps, ReactiveFunction } from '../../render/propsType';
6
+ export type EventArgs = any[];
3
7
  /**
4
- * 插入间隔符
5
- * @param columns 表单配置数组
6
- * @returns
7
- */
8
- export declare const insertSeparator: (columns: any, space?: SpaceType, separatorNode?: ReactNode, otherProps?: any) => any;
8
+ * 插入间隔符
9
+ * @param columns 表单配置数组
10
+ * @returns
11
+ */
12
+ export declare const insertSeparator: (columns: GroupColumnProps[], space?: SpaceType) => any[];
13
+ /** 带出event的组件默认取值方法 */
14
+ export declare function defaultGetValueFromEvent(valuePropName: string, ...args: EventArgs): any;
9
15
  /** 转换names */
10
16
  export declare const transformNamesString: (arr: (string | string[])[]) => (string | string[])[];
17
+ /**
18
+ * Input TextArea 小写自动转大写
19
+ * @param type 组件类型
20
+ * @param upperCase 是否小写转大写
21
+ * @returns {}
22
+ */
23
+ export declare const isUpperCase: (type: string, upperCase: boolean) => any;
24
+ interface Params {
25
+ form?: FormInstance;
26
+ index?: number;
27
+ type?: string;
28
+ namePath?: InternalNamePath;
29
+ disabled?: boolean | ReactiveFunction<any, boolean>;
30
+ show?: boolean | ReactiveFunction<any, boolean>;
31
+ component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
32
+ fieldProps?: boolean | ReactiveFunction<any, boolean>;
33
+ name?: NamePath;
34
+ }
35
+ /** 计算响应式参数的值 */
36
+ export declare const getReactiveProps: (params: Params) => {
37
+ disabled: boolean;
38
+ show: boolean;
39
+ component: any;
40
+ fieldProps: boolean;
41
+ };
42
+ type ValueTypeGetterParams = Pick<ProFormColumnProps, 'valueType' | 'switchValue' | 'toISOString'> & {
43
+ type?: any;
44
+ mode?: string;
45
+ };
46
+ /** 获取当前字段的转换函数 */
47
+ export declare const getValueTypeTrans: (params: ValueTypeGetterParams) => any;
48
+ /** 执行所有中间件 返回处理后的值 */
49
+ export declare const getValueMiddleware: (value: any, callbacks?: any[]) => any;
50
+ interface ColumnsTransformerParams {
51
+ columns: GroupColumnProps[];
52
+ name?: NamePath;
53
+ names?: NamePath[];
54
+ value?: any[];
55
+ onChange: any;
56
+ namePath?: InternalNamePath;
57
+ form: FormInstance;
58
+ index?: number;
59
+ groupProps: GroupProps;
60
+ }
61
+ /** 转换columns */
62
+ export declare const transformColumns: (params: ColumnsTransformerParams) => any[];
63
+ export {};