@zat-design/sisyphus-react 3.4.6 → 3.4.8-beta.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 (109) hide show
  1. package/dist/index.esm.css +17 -1
  2. package/dist/less.esm.css +17 -1
  3. package/es/ProEditTable/components/RenderField/index.js +5 -8
  4. package/es/ProEditTable/style/index.less +5 -2
  5. package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
  6. package/es/ProForm/components/base/TextArea/index.js +4 -2
  7. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
  8. package/es/ProForm/components/combination/FormList/index.js +2 -1
  9. package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -1
  10. package/es/ProForm/components/combination/FormList/utils.js +2 -3
  11. package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +2 -2
  12. package/es/ProForm/components/combination/Group/index.d.ts +8 -2
  13. package/es/ProForm/components/combination/Group/index.js +58 -76
  14. package/es/ProForm/components/combination/Group/propsType.d.ts +27 -14
  15. package/es/ProForm/components/combination/Group/utils.d.ts +60 -7
  16. package/es/ProForm/components/combination/Group/utils.js +209 -19
  17. package/es/ProForm/components/combination/ProModalSelect/index.js +35 -29
  18. package/es/ProForm/components/combination/_Group/index.d.ts +4 -0
  19. package/es/ProForm/components/combination/_Group/index.js +109 -0
  20. package/es/ProForm/components/combination/_Group/propsType.d.ts +35 -0
  21. package/es/ProForm/components/combination/_Group/utils.d.ts +10 -0
  22. package/es/ProForm/components/combination/_Group/utils.js +46 -0
  23. package/es/ProForm/components/render/Render.js +8 -6
  24. package/es/ProForm/components/render/RenderFields.js +1 -0
  25. package/es/ProForm/components/render/propsType.d.ts +4 -3
  26. package/es/ProForm/propsType.d.ts +1 -0
  27. package/es/ProForm/style/index.less +7 -0
  28. package/es/ProForm/utils/diffOriginal.js +2 -1
  29. package/es/ProForm/utils/index.d.ts +6 -1
  30. package/es/ProForm/utils/index.js +5 -5
  31. package/es/ProForm/utils/transformNames.js +3 -10
  32. package/es/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
  33. package/es/ProForm/utils/useDeepCompareMemo.js +14 -0
  34. package/es/ProForm/utils/useForm.js +2 -1
  35. package/es/ProForm/utils/useListChanged.js +2 -2
  36. package/es/ProForm/utils/useRules.js +2 -20
  37. package/es/ProSelect/index.js +14 -2
  38. package/es/ProSelect/propsType.d.ts +2 -0
  39. package/es/ProSelect/utils/index.d.ts +9 -0
  40. package/es/ProSelect/utils/index.js +60 -0
  41. package/es/ProTree/components/ProTreeSelect/index.js +3 -3
  42. package/es/ProTree/components/ProTreeSelect/style/index.less +6 -8
  43. package/es/ProTree/style/index.less +15 -0
  44. package/es/ProUpload/index.js +5 -6
  45. package/es/ProUpload/propsType.d.ts +1 -1
  46. package/es/global.less +40 -25
  47. package/es/locale/zh_CN.js +1 -1
  48. package/lib/ProEditTable/components/RenderField/index.js +5 -8
  49. package/lib/ProEditTable/style/index.less +5 -2
  50. package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
  51. package/lib/ProForm/components/base/TextArea/index.js +4 -2
  52. package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
  53. package/lib/ProForm/components/combination/FormList/index.js +2 -1
  54. package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -1
  55. package/lib/ProForm/components/combination/FormList/utils.js +2 -3
  56. package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +2 -2
  57. package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
  58. package/lib/ProForm/components/combination/Group/index.js +57 -72
  59. package/lib/ProForm/components/combination/Group/propsType.d.ts +27 -14
  60. package/lib/ProForm/components/combination/Group/utils.d.ts +60 -7
  61. package/lib/ProForm/components/combination/Group/utils.js +210 -20
  62. package/lib/ProForm/components/combination/ProModalSelect/index.js +35 -29
  63. package/lib/ProForm/components/combination/_Group/index.d.ts +4 -0
  64. package/lib/ProForm/components/combination/_Group/index.js +113 -0
  65. package/lib/ProForm/components/combination/_Group/propsType.d.ts +35 -0
  66. package/lib/ProForm/components/combination/_Group/utils.d.ts +10 -0
  67. package/lib/ProForm/components/combination/_Group/utils.js +53 -0
  68. package/lib/ProForm/components/render/Render.js +7 -5
  69. package/lib/ProForm/components/render/RenderFields.js +1 -0
  70. package/lib/ProForm/components/render/propsType.d.ts +4 -3
  71. package/lib/ProForm/propsType.d.ts +1 -0
  72. package/lib/ProForm/style/index.less +7 -0
  73. package/lib/ProForm/utils/diffOriginal.js +2 -1
  74. package/lib/ProForm/utils/index.d.ts +6 -1
  75. package/lib/ProForm/utils/index.js +5 -5
  76. package/lib/ProForm/utils/transformNames.js +2 -9
  77. package/lib/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
  78. package/lib/ProForm/utils/useDeepCompareMemo.js +20 -0
  79. package/lib/ProForm/utils/useForm.js +2 -1
  80. package/lib/ProForm/utils/useListChanged.js +1 -1
  81. package/lib/ProForm/utils/useRules.js +2 -20
  82. package/lib/ProSelect/index.js +14 -2
  83. package/lib/ProSelect/propsType.d.ts +2 -0
  84. package/lib/ProSelect/utils/index.d.ts +9 -0
  85. package/lib/ProSelect/utils/index.js +68 -0
  86. package/lib/ProTree/components/ProTreeSelect/index.js +3 -3
  87. package/lib/ProTree/components/ProTreeSelect/style/index.less +6 -8
  88. package/lib/ProTree/style/index.less +15 -0
  89. package/lib/ProUpload/index.js +5 -6
  90. package/lib/ProUpload/propsType.d.ts +1 -1
  91. package/lib/global.less +40 -25
  92. package/lib/locale/zh_CN.js +1 -1
  93. package/package.json +1 -1
  94. package/es/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
  95. package/es/ProForm/components/combination/GroupCopy/index.js +0 -84
  96. package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
  97. package/es/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
  98. package/es/ProForm/components/combination/GroupCopy/utils.js +0 -180
  99. package/lib/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
  100. package/lib/ProForm/components/combination/GroupCopy/index.js +0 -91
  101. package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
  102. package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
  103. package/lib/ProForm/components/combination/GroupCopy/utils.js +0 -187
  104. /package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
  105. /package/es/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
  106. /package/es/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
  107. /package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
  108. /package/lib/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
  109. /package/lib/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
@@ -28,7 +28,7 @@ import { ProEditTableProps } from '../../../ProEditTable/propsType';
28
28
  import { ProTreeModalProps } from '../../../ProTreeModal/propsType';
29
29
  import { ProUploadProps } from '../../../ProUpload/propsType';
30
30
  import { ProTreeProps } from '../../../ProTree/propsType';
31
- import { GroupProps } from '../combination/Group/propsType';
31
+ import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
32
32
  import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
33
33
  import { DistributiveOmit } from '../../propsType';
34
34
  export type ComponentMap = keyof typeof componentMap;
@@ -159,7 +159,7 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
159
159
  fieldProps?: FieldProps<ProTreeProps, Values, T>;
160
160
  } | {
161
161
  type?: 'Group';
162
- fieldProps?: GroupProps | ReactiveFunction<Values, GroupProps>;
162
+ fieldProps?: GroupCopyProps | ReactiveFunction<Values, GroupCopyProps>;
163
163
  } | {
164
164
  type?: 'ProCollapse';
165
165
  fieldProps?: ProCollapseProps | ReactiveFunction<Values, ProCollapseProps>;
@@ -208,6 +208,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
208
208
  clearNotShow?: boolean;
209
209
  index?: number;
210
210
  namePath?: NamePath;
211
+ listName?: NamePath;
211
212
  /** 表单前缀信息 */
212
213
  before?: string | React.ReactNode;
213
214
  /** 表单后缀信息 */
@@ -216,7 +217,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
216
217
  extra?: string | React.ReactNode;
217
218
  /** 是否固定字段, 不隐藏 */
218
219
  fixed?: boolean;
219
- confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
220
+ confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
220
221
  }
221
222
  export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
222
223
  /**
@@ -41,6 +41,7 @@ export interface ProFormOtherProps {
41
41
  required?: boolean | boolean[] | (() => boolean | boolean[]);
42
42
  mode?: string;
43
43
  namePath?: any[] | string | number;
44
+ listName?: any[] | string | number;
44
45
  globalControl?: boolean;
45
46
  formDisabled?: boolean;
46
47
  }
@@ -140,6 +140,13 @@
140
140
 
141
141
  // 地址组件
142
142
  .@{ant-prefix}-form-item-control-input-content {
143
+ // 查看模式
144
+ & > span {
145
+ border-radius: 4px;
146
+ padding: 5px 8px;
147
+ background: @zaui-contract-bg;
148
+ }
149
+
143
150
  & > .pro-address {
144
151
  .@{ant-prefix}-select-selector,
145
152
  .@{ant-prefix}-input-affix-wrapper,
@@ -40,7 +40,8 @@ export var diffOriginal = function diffOriginal(params) {
40
40
  });
41
41
  }
42
42
  if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
43
- return !isEqual(value, originalValue);
43
+ var res = !isEqual(value, originalValue);
44
+ return res;
44
45
  }
45
46
  return false;
46
47
  };
@@ -83,7 +83,12 @@ export declare const deleteForPath: (values: any, namePath: string | number | (s
83
83
  * @param value 选中值
84
84
  * @returns {}
85
85
  */
86
- export declare const findOptionByValue: (treeData: any[], value: string | number) => any;
86
+ export declare const findOptionByValue: (treeData: any[], value: string | number, fieldNames: {
87
+ [key: string]: any;
88
+ label?: string;
89
+ value?: string;
90
+ children?: string;
91
+ }) => any;
87
92
  /**
88
93
  * 对比依赖列表中的 值是否变更
89
94
  */
@@ -392,19 +392,19 @@ export var deleteForPath = function deleteForPath(values, namePath) {
392
392
  * @param value 选中值
393
393
  * @returns {}
394
394
  */
395
- export var findOptionByValue = function findOptionByValue(treeData, value) {
395
+ export var findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
396
396
  if (isObject(value)) {
397
397
  return value;
398
398
  }
399
399
  for (var i = 0; i < (treeData === null || treeData === void 0 ? void 0 : treeData.length); i++) {
400
400
  var node = treeData[i];
401
- if (node.value === value) {
402
- return omit(node, ['children']);
401
+ if (node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value'] === value) {
402
+ return omit(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
403
403
  }
404
404
  if (node.children) {
405
- var foundNode = findOptionByValue(node.children, value);
405
+ var foundNode = findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
406
406
  if (foundNode) {
407
- return omit(foundNode, ['children']);
407
+ return omit(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
408
408
  }
409
409
  }
410
410
  }
@@ -1,23 +1,16 @@
1
- import { union, isNumber } from 'lodash';
1
+ import { union } from 'lodash';
2
2
  import { transformValue } from './transformValue';
3
3
  var transformNames = function transformNames(formItem, form, names, fieldName, type) {
4
- var _names2, _names3, _names3$;
5
4
  var _ref = formItem || {},
6
5
  normalize = _ref.normalize,
7
6
  getValueProps = _ref.getValueProps,
8
7
  _shouldUpdate2 = _ref.shouldUpdate;
9
- var _names = names;
10
- if (!((_names2 = _names) === null || _names2 === void 0 ? void 0 : _names2.length)) {
8
+ if (!(names === null || names === void 0 ? void 0 : names.length)) {
11
9
  return {};
12
10
  }
13
11
  // 当在formList场景下,给transformValue函数的setFiledProps的name, 需要全namePath
14
12
  var _fieldName = Array.isArray(formItem === null || formItem === void 0 ? void 0 : formItem.name) ? union(formItem === null || formItem === void 0 ? void 0 : formItem.namePath, formItem === null || formItem === void 0 ? void 0 : formItem.name) : fieldName;
15
- if (type === 'Group' && isNumber((_names3 = _names) === null || _names3 === void 0 ? void 0 : (_names3$ = _names3[0]) === null || _names3$ === void 0 ? void 0 : _names3$[0])) {
16
- _names = _names.map(function (item) {
17
- return union(formItem === null || formItem === void 0 ? void 0 : formItem.namePath, item);
18
- });
19
- }
20
- var _transformValue = transformValue(_names, form, _fieldName, normalize, getValueProps),
13
+ var _transformValue = transformValue(names, form, _fieldName, normalize, getValueProps),
21
14
  _normalize = _transformValue.normalize,
22
15
  _getValueProps = _transformValue.getValueProps,
23
16
  _shouldUpdate = _transformValue.shouldUpdate;
@@ -0,0 +1,2 @@
1
+ /** 深度比较依赖变化memo */
2
+ export declare const useDeepCompareMemo: (fun: () => any, depList: any[]) => any;
@@ -0,0 +1,14 @@
1
+ import { useRef } from 'react';
2
+ import { isEqualWith } from 'lodash';
3
+ import { customEqualForFun } from '.';
4
+ /** 深度比较依赖变化memo */
5
+ export var useDeepCompareMemo = function useDeepCompareMemo(fun, depList) {
6
+ var lastDependency = useRef(); // 上一次的依赖
7
+ var lastRes = useRef(); // 上一次的结果
8
+ if (!isEqualWith(depList, lastDependency.current, customEqualForFun)) {
9
+ var res = fun();
10
+ lastRes.current = res;
11
+ }
12
+ lastDependency.current = depList;
13
+ return lastRes.current;
14
+ };
@@ -57,7 +57,8 @@ export var useForm = function useForm(originForm) {
57
57
  behavior: 'smooth'
58
58
  });
59
59
  }
60
- case 14:
60
+ throw _context.t0;
61
+ case 15:
61
62
  case "end":
62
63
  return _context.stop();
63
64
  }
@@ -1,6 +1,6 @@
1
1
  import "antd/es/form/style";
2
2
  import _Form from "antd/es/form";
3
- import { get } from 'lodash';
3
+ import { get, isString } from 'lodash';
4
4
  import { diffOriginal } from './diffOriginal';
5
5
  var toNamePath = function toNamePath(name) {
6
6
  if (Array.isArray(name)) {
@@ -87,7 +87,7 @@ export var useListChanged = function useListChanged(params) {
87
87
  originalValue: originalValue,
88
88
  form: form,
89
89
  equalWith: equalWith,
90
- name: namesStr || name
90
+ name: isString(namesStr) ? namesStr : originalName || name
91
91
  });
92
92
  return [changed, originalValue];
93
93
  };
@@ -24,10 +24,6 @@ var useRules = function useRules(props) {
24
24
  var result = {
25
25
  rules: rules || []
26
26
  };
27
- // Group required: true时,直接走完整校验
28
- if (allRequired && type === 'Group') {
29
- return result;
30
- }
31
27
  if (allRequired) {
32
28
  if (!requiredRule) {
33
29
  var message = isSelect ? "".concat(locale.ProForm.selectPlaceHolder).concat(_label) : "".concat(locale.ProForm.inputPlaceholder).concat(_label);
@@ -58,23 +54,9 @@ var useRules = function useRules(props) {
58
54
  required: required
59
55
  });
60
56
  useEffect(function () {
61
- if (type === 'Group' && (allRequired || requiredRule)) {
62
- var customRequired = {
63
- validator: function validator(rules, value) {
64
- // 完整性校验, 数组有值且值不完整则校验不通过
65
- if (Array.isArray(value) && isNotFullArray(value, names.length, required)) {
66
- return Promise.reject(new Error("".concat(locale.ProForm.completeText).concat(_label)));
67
- }
68
- return Promise.resolve();
69
- }
70
- };
71
- // 插入rules第一条,完整性校验大于自定义
72
- internalRule.rules.unshift(customRequired);
73
- return;
74
- }
75
57
  // 添加完整性校验
76
58
  if (names && !isBoolean(labelRequired)) {
77
- var _customRequired = {
59
+ var customRequired = {
78
60
  validator: function validator(rules, value) {
79
61
  // 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
80
62
  if (Array.isArray(value) && !isNullArray(value) && isNotFullArray(value, names.length, required)) {
@@ -83,7 +65,7 @@ var useRules = function useRules(props) {
83
65
  return Promise.resolve();
84
66
  }
85
67
  };
86
- internalRule.rules.unshift(_customRequired);
68
+ internalRule.rules.unshift(customRequired);
87
69
  }
88
70
  }, [internalRule]);
89
71
  return internalRule;
@@ -9,7 +9,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
9
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
10
10
  import "antd/es/select/style";
11
11
  import _Select from "antd/es/select";
12
- var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
12
+ var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "isView"];
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
15
15
  import React, { useImperativeHandle, useState, forwardRef } from 'react';
@@ -19,6 +19,7 @@ import Container from '../ProForm/components/Container';
19
19
  import AdaptiveTooltip from './components/AdaptiveTooltip';
20
20
  import { ProForm } from '..';
21
21
  import locale from '../locale';
22
+ import { getSelectList } from './utils';
22
23
  import './index.less';
23
24
  var Option = _Select.Option;
24
25
  export var ProSelect = function ProSelect(props, ref) {
@@ -41,6 +42,8 @@ export var ProSelect = function ProSelect(props, ref) {
41
42
  tooltip = _props$tooltip === void 0 ? false : _props$tooltip,
42
43
  otherProps = props.otherProps,
43
44
  labelInValue = props.labelInValue,
45
+ _props$filterInList = props.filterInList,
46
+ filterInList = _props$filterInList === void 0 ? false : _props$filterInList,
44
47
  _props$scrollFollowPa = props.scrollFollowParent,
45
48
  scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa,
46
49
  defaultOne = props.defaultOne,
@@ -265,6 +268,15 @@ export var ProSelect = function ProSelect(props, ref) {
265
268
  }
266
269
  return value;
267
270
  };
271
+ var newSelectList = selectList;
272
+ if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
273
+ newSelectList = getSelectList({
274
+ otherProps: otherProps,
275
+ value: props.value,
276
+ dataSource: selectList,
277
+ labelInValue: labelInValue
278
+ });
279
+ }
268
280
  return _jsx(_Select, _objectSpread(_objectSpread({
269
281
  placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProSelect = locale.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
270
282
  allowClear: true,
@@ -287,7 +299,7 @@ export var ProSelect = function ProSelect(props, ref) {
287
299
  }
288
300
  }, omit(cloneDeep(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
289
301
  value: transformValue(),
290
- children: Array.isArray(selectList) && selectList.map(function (item) {
302
+ children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
291
303
  return _jsx(Option, {
292
304
  value: item[code],
293
305
  record: item,
@@ -14,6 +14,8 @@ export interface PropSelectProps extends Omit<SelectProps, 'onSearch'> {
14
14
  defaultOne?: boolean;
15
15
  /** 数据源 */
16
16
  dataSource?: DataOption[];
17
+ /** list场景中过滤掉已选择的值 */
18
+ filterInList?: boolean;
17
19
  /** @deprecated 兼容 2.0 版本、3.0 使用view 模式 */
18
20
  defaultDisableValue?: string;
19
21
  /** 是否展示 tooltip、当 label 特别长的时候使用 */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 返回当前组件可以显示的数据源
3
+ */
4
+ export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, }: {
5
+ otherProps: any;
6
+ value: any;
7
+ dataSource: any;
8
+ labelInValue: any;
9
+ }) => any;
@@ -0,0 +1,60 @@
1
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
2
+ /* eslint-disable no-restricted-syntax */
3
+ import _ from 'lodash';
4
+ var findSelectNameValues = function findSelectNameValues(_ref) {
5
+ var list = _ref.list,
6
+ selectName = _ref.selectName,
7
+ value = _ref.value,
8
+ dataSource = _ref.dataSource,
9
+ labelInValue = _ref.labelInValue;
10
+ var selectValues = [];
11
+ list.forEach(function (item) {
12
+ var result = item;
13
+ if (!item || !Object.keys(item).length || Object.keys(item).length === 1 && 'rowKey' in item) {
14
+ return false;
15
+ }
16
+ var _iterator = _createForOfIteratorHelper(selectName),
17
+ _step;
18
+ try {
19
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
20
+ var key = _step.value;
21
+ result = result[key];
22
+ }
23
+ } catch (err) {
24
+ _iterator.e(err);
25
+ } finally {
26
+ _iterator.f();
27
+ }
28
+ selectValues.push(result);
29
+ });
30
+ var diffList = _.difference(selectValues, [value]);
31
+ return dataSource.filter(function (item) {
32
+ return !diffList.includes(labelInValue ? item : item.value);
33
+ });
34
+ };
35
+ /**
36
+ * 返回当前组件可以显示的数据源
37
+ */
38
+ export var getSelectList = function getSelectList(_ref2) {
39
+ var otherProps = _ref2.otherProps,
40
+ value = _ref2.value,
41
+ dataSource = _ref2.dataSource,
42
+ labelInValue = _ref2.labelInValue;
43
+ if (!otherProps) {
44
+ return null;
45
+ }
46
+ var listName = otherProps.listName,
47
+ form = otherProps.form;
48
+ var firstNumberIndex = listName.findIndex(function (item) {
49
+ return typeof item === 'number';
50
+ });
51
+ var fatherName = listName.slice(0, firstNumberIndex);
52
+ var selectName = listName.slice(firstNumberIndex + 1);
53
+ return findSelectNameValues({
54
+ list: form.getFieldValue(fatherName),
55
+ selectName: selectName,
56
+ value: value,
57
+ dataSource: dataSource,
58
+ labelInValue: labelInValue
59
+ });
60
+ };
@@ -407,13 +407,13 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
407
407
  }
408
408
  return result;
409
409
  }
410
- var handleChange = function handleChange(newVal) {
410
+ var handleChange = function handleChange(newVal, label, extra) {
411
411
  // newVal回来得一定是label、value
412
412
  var result = newVal;
413
413
  if (props === null || props === void 0 ? void 0 : props.labelInValue) {
414
414
  result = getLabelByValue(selectList, newVal);
415
415
  }
416
- onChange && onChange(result, selectList, null);
416
+ onChange && onChange(result, label, extra);
417
417
  // 重置搜索
418
418
  showSearch && searchTreeEvent('');
419
419
  };
@@ -486,7 +486,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
486
486
  allowClear: allowClear || true,
487
487
  showArrow: true,
488
488
  treeNodeFilterProp: treeNodeFilterProp,
489
- virtual: false
489
+ virtual: true
490
490
  }, selectProps);
491
491
  if (value === null) {
492
492
  delete treeProps.value;
@@ -40,6 +40,12 @@
40
40
  color: red;
41
41
  }
42
42
  }
43
+ // 隐藏单选下拉树后面勾号
44
+ .@{ant-prefix}-select-tree-node-content-wrapper{
45
+ .check-mark-icon{
46
+ display: none;
47
+ }
48
+ }
43
49
  // 单选
44
50
  &.signal-tree{
45
51
  .@{ant-prefix}-select-tree{
@@ -63,14 +69,6 @@
63
69
  display: block;
64
70
  }
65
71
  }
66
- .@{ant-prefix}-select-tree-node-content-wrapper{
67
- background-color: transparent;
68
- &.@{ant-prefix}-select-tree-node-selected{
69
- .check-mark-icon{
70
- display: block;
71
- }
72
- }
73
- }
74
72
  .@{ant-prefix}-select-tree-treenode:hover{
75
73
  background-color: #f5f5f5;
76
74
  }
@@ -348,3 +348,18 @@
348
348
  height: 16px !important;
349
349
  }
350
350
 
351
+ .pro-tree-select, .pro-tree-select-drop-down-container{
352
+ .@{ant-prefix}-select-selector{
353
+ .check-mark-icon{
354
+ display: none;
355
+ }
356
+ }
357
+ &.@{ant-prefix}-select-dropdown{
358
+ // 隐藏单选下拉树后面勾号
359
+ .@{ant-prefix}-select-tree-node-content-wrapper{
360
+ .check-mark-icon{
361
+ display: none;
362
+ }
363
+ }
364
+ }
365
+ }
@@ -175,10 +175,6 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
175
175
  * @return {*}
176
176
  */
177
177
  var handleBeforeUpload = function handleBeforeUpload(file, fileList) {
178
- if (!isFunction(beforeUpload)) {
179
- return false;
180
- }
181
- // TODO
182
178
  if (!validateFileExt(extExt, file)) {
183
179
  var _locale$ProUpload2;
184
180
  _message.error("".concat(locale === null || locale === void 0 ? void 0 : (_locale$ProUpload2 = locale.ProUpload) === null || _locale$ProUpload2 === void 0 ? void 0 : _locale$ProUpload2.errorInfoExt, "\u3010").concat(extExt.join('、'), "\u3011"));
@@ -189,7 +185,9 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
189
185
  _message.error("".concat(locale === null || locale === void 0 ? void 0 : (_locale$ProUpload3 = locale.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.errorInfoSize).concat(size, "M"));
190
186
  return false;
191
187
  }
192
- return beforeUpload(file, fileList);
188
+ if (beforeUpload) {
189
+ return beforeUpload(file, fileList);
190
+ }
193
191
  };
194
192
  var handleRemove = function handleRemove(file) {
195
193
  var nextList = _fileList.slice();
@@ -244,7 +242,8 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
244
242
  showUploadList: showUploadList,
245
243
  method: method,
246
244
  accept: accept,
247
- data: _objectSpread({}, dataParams)
245
+ data: _objectSpread({}, dataParams),
246
+ name: name
248
247
  }, residueProps);
249
248
  var baseProps = {
250
249
  isView: isView,
@@ -18,7 +18,7 @@ export interface fieldNamesProps {
18
18
  }
19
19
  export interface ProUploadProps {
20
20
  /**
21
- * @description 拖拽框顶部的内容
21
+ * @description 顶部的内容(button类型的上传不适用)
22
22
  * @default -
23
23
  */
24
24
  headerRender?: React.ReactNode | (() => React.ReactNode);
package/es/global.less CHANGED
@@ -5,37 +5,52 @@ pre {
5
5
  }
6
6
 
7
7
  * {
8
- // 火狐浏览器
9
- scrollbar-width: thin;
10
- scrollbar-color: #d2d3d7 transparent;
11
8
  // ie浏览器
12
9
  scrollbar-face-color: #d2d3d7;
13
10
  scrollbar-highlight-color: #979797;
14
11
  scrollbar-3dlight-color: #979797;
15
- }
16
12
 
17
- ::-webkit-scrollbar  {
18
- width: 16px;
19
- }
13
+ ::-webkit-scrollbar  {
14
+ width: 16px;
15
+ background: transparent;
16
+ }
20
17
 
21
- // // 滑块
22
- ::-webkit-scrollbar-thumb {
23
- background-color: #d2d3d7;
24
- background-clip: padding-box;
25
- border-color: transparent;
26
- border-style: dashed;
27
- border-width: 4px;
28
- border-radius: 10px;
29
- -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
30
- }
18
+ // 轨道
19
+ ::-webkit-scrollbar-track {
20
+ background-color: #fff;
21
+ border-radius: 10px;
22
+ }
31
23
 
32
- // 轨道
33
- ::-webkit-scrollbar-track {
34
- background-color: transparent;
35
- border-radius: 10px;
36
- }
24
+ // 悬浮轨道
25
+ ::-webkit-scrollbar-thumb:hover {
26
+ background-color: #979797;
27
+ background-clip: padding-box;
28
+ border-color: transparent;
29
+ border-style: dashed;
30
+ border-width: 4px;
31
+ border-radius: 10px;
32
+ -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
33
+ }
34
+
35
+ :hover::-webkit-scrollbar-track {
36
+ background: transparent;
37
+ }
38
+
39
+ :hover::-webkit-scrollbar-thumb {
40
+ background-color: #d2d3d7;
41
+ background-clip: padding-box;
42
+ border-color: transparent;
43
+ border-style: dashed;
44
+ border-width: 4px;
45
+ border-radius: 10px;
46
+ -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
47
+ }
48
+
49
+ :hover::-webkit-scrollbar-thumb:hover {
50
+ background-color: #979797;
51
+ }
37
52
 
38
- // 悬浮轨道
39
- ::-webkit-scrollbar-thumb:hover {
40
- background-color: #979797;
53
+ :hover::-webkit-scrollbar-track {
54
+ background-color: #fff;
55
+ }
41
56
  }
@@ -89,7 +89,7 @@ export default {
89
89
  edit: '编辑',
90
90
  copy: '复制',
91
91
  delete: '删除',
92
- mulDelete: '删除',
92
+ mulDelete: '批量删除',
93
93
  save: '保存',
94
94
  custom: '自定义',
95
95
  operation: '操作',
@@ -318,7 +318,7 @@ var RenderField = function RenderField(_ref) {
318
318
  }
319
319
  _args = [].concat(args);
320
320
  rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
321
- row = type === 'Group' ? _args[1] : form.getFieldValue(rowPath, true);
321
+ row = form.getFieldValue(rowPath, true);
322
322
  orgRow = (0, _lodash.cloneDeep)(row);
323
323
  if (!onFieldChange) {
324
324
  _context.next = 18;
@@ -363,7 +363,7 @@ var RenderField = function RenderField(_ref) {
363
363
  return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
364
364
  case 27:
365
365
  // 判断属性是否变动
366
- type !== 'Group' && form.setFieldValue(rowPath, row);
366
+ form.setFieldValue(rowPath, row);
367
367
  if (!(0, _lodash.isEqual)(orgRow, row)) {
368
368
  diff = (0, _tools.difference)(row, orgRow) || {};
369
369
  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) {
@@ -409,7 +409,7 @@ var RenderField = function RenderField(_ref) {
409
409
  }
410
410
  _args = formatArgs([].concat(args));
411
411
  rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
412
- row = type === 'Group' ? _args[1] : form.getFieldValue(rowPath, true);
412
+ row = form.getFieldValue(rowPath, true);
413
413
  orgRow = (0, _lodash.cloneDeep)(row);
414
414
  _args[1] = row;
415
415
  _context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
@@ -494,16 +494,13 @@ var RenderField = function RenderField(_ref) {
494
494
  form: form,
495
495
  names: names,
496
496
  name: cellName,
497
+ listName: cellName,
497
498
  viewEmpty: viewEmpty,
498
499
  valueType: valueType,
499
500
  isView: isView
500
501
  }
501
502
  });
502
- if (type === 'Group') {
503
- componentProps.onFieldChange = _onchange;
504
- } else {
505
- componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
506
- }
503
+ componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
507
504
  // 单元格编辑时,设置各个单元格disabled属性
508
505
  if (isCell) {
509
506
  record["".concat(dataIndex, "-Disabled")] = _disabled;
@@ -2,6 +2,9 @@
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
+ }
5
8
  .pro-edit-table-tooltip {
6
9
  display : inline-flex;
7
10
  align-items: center;
@@ -62,7 +65,7 @@
62
65
 
63
66
  .drag-wrapper {
64
67
  display: flex;
65
- .drag-icon {
68
+ .anticon {
66
69
  margin-right: var(--zaui-space-size-md, 16px);
67
70
  margin-left: var(--zaui-space-size-xs, 4px);
68
71
  cursor: pointer;
@@ -137,7 +140,7 @@
137
140
  .@{ant-prefix}-table-cell-fix-left,
138
141
  .@{ant-prefix}-table-cell-fix-right {
139
142
  background-color: var(--zaui-table-header-bg, #f2f3f5);
140
-
143
+
141
144
  }
142
145
  }
143
146
 
@@ -5,6 +5,7 @@ import './index.less';
5
5
  export interface Props extends TextAreaProps {
6
6
  otherProps?: ProFormOtherProps;
7
7
  isView?: boolean;
8
+ tooltip?: boolean;
8
9
  }
9
10
  declare const TextAreaDef: React.FC<Props>;
10
11
  export default TextAreaDef;