@zat-design/sisyphus-react 3.4.1 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/index.esm.css +7 -0
  2. package/es/ProConfigProvider/index.js +8 -1
  3. package/es/ProEditTable/utils/index.js +6 -4
  4. package/es/ProEnum/style/index.less +4 -3
  5. package/es/ProForm/components/base/InputNumber/index.js +3 -0
  6. package/es/ProForm/components/combination/Group/index.js +19 -2
  7. package/es/ProForm/components/combination/Group/propsType.d.ts +4 -0
  8. package/es/ProForm/components/combination/Group/style/index.less +3 -0
  9. package/es/ProForm/components/render/ConfirmWrapper.js +15 -23
  10. package/es/ProForm/components/render/Render.js +16 -13
  11. package/es/ProForm/utils/index.d.ts +2 -0
  12. package/es/ProForm/utils/index.js +14 -13
  13. package/es/ProIcon/config/index.d.ts +4 -0
  14. package/es/ProIcon/config/index.js +199 -0
  15. package/es/ProIcon/index.js +73 -31
  16. package/es/ProIcon/propsTypes.d.ts +23 -1
  17. package/es/ProIcon/symbolIcon.js +1 -1
  18. package/es/ProTreeModal/style/index.less +8 -0
  19. package/lib/ProConfigProvider/index.js +8 -1
  20. package/lib/ProEditTable/utils/index.js +6 -4
  21. package/lib/ProEnum/style/index.less +4 -3
  22. package/lib/ProForm/components/base/InputNumber/index.js +3 -0
  23. package/lib/ProForm/components/combination/Group/index.js +18 -1
  24. package/lib/ProForm/components/combination/Group/propsType.d.ts +4 -0
  25. package/lib/ProForm/components/combination/Group/style/index.less +3 -0
  26. package/lib/ProForm/components/render/ConfirmWrapper.js +15 -23
  27. package/lib/ProForm/components/render/Render.js +15 -12
  28. package/lib/ProForm/utils/index.d.ts +2 -0
  29. package/lib/ProForm/utils/index.js +14 -13
  30. package/lib/ProIcon/config/index.d.ts +4 -0
  31. package/lib/ProIcon/config/index.js +205 -0
  32. package/lib/ProIcon/index.js +73 -31
  33. package/lib/ProIcon/propsTypes.d.ts +23 -1
  34. package/lib/ProIcon/symbolIcon.js +1 -1
  35. package/lib/ProTreeModal/style/index.less +8 -0
  36. package/package.json +1 -1
@@ -1,11 +1,14 @@
1
1
  import "antd/es/button/style";
2
2
  import _Button from "antd/es/button";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled"];
4
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
+ var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList"];
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import classNames from 'classnames';
8
+ import { uniqBy } from 'lodash';
9
+ import { iconMap } from './config';
8
10
  import symbolIcon from './symbolIcon';
11
+ import { useProConfig } from '../ProConfigProvider';
9
12
  var customCache = new Set();
10
13
  function isValidCustomScriptUrl(scriptUrl) {
11
14
  return Boolean(typeof scriptUrl === 'string' && scriptUrl.length && !customCache.has(scriptUrl));
@@ -34,22 +37,31 @@ if (symbolIcon && typeof document !== 'undefined' && typeof window !== 'undefine
34
37
  createScriptUrlElements([symbolIcon]);
35
38
  }
36
39
  var ProIcon = function ProIcon(props) {
37
- var type = props.type,
38
- onClick = props.onClick,
39
- _props$size = props.size,
40
- size = _props$size === void 0 ? '1em' : _props$size,
41
- color = props.color,
42
- className = props.className,
43
- _props$style = props.style,
44
- style = _props$style === void 0 ? {} : _props$style,
45
- _props$spin = props.spin,
46
- spin = _props$spin === void 0 ? false : _props$spin,
47
- rotate = props.rotate,
48
- _props$theme = props.theme,
49
- theme = _props$theme === void 0 ? false : _props$theme,
50
- _props$disabled = props.disabled,
51
- disabled = _props$disabled === void 0 ? false : _props$disabled,
52
- reset = _objectWithoutProperties(props, _excluded);
40
+ var config = useProConfig('ProIcon') || {};
41
+ var _config = _objectSpread(_objectSpread({}, config), props !== null && props !== void 0 ? props : {});
42
+ var _config$type = _config.type,
43
+ type = _config$type === void 0 ? null : _config$type,
44
+ onClick = _config.onClick,
45
+ _config$size = _config.size,
46
+ size = _config$size === void 0 ? '1em' : _config$size,
47
+ color = _config.color,
48
+ className = _config.className,
49
+ _config$style = _config.style,
50
+ style = _config$style === void 0 ? {} : _config$style,
51
+ _config$spin = _config.spin,
52
+ spin = _config$spin === void 0 ? false : _config$spin,
53
+ rotate = _config.rotate,
54
+ _config$theme = _config.theme,
55
+ theme = _config$theme === void 0 ? false : _config$theme,
56
+ _config$disabled = _config.disabled,
57
+ disabled = _config$disabled === void 0 ? false : _config$disabled,
58
+ mode = _config.mode,
59
+ _config$buttonProps = _config.buttonProps,
60
+ buttonProps = _config$buttonProps === void 0 ? {} : _config$buttonProps,
61
+ children = _config.children,
62
+ _config$mapList = _config.mapList,
63
+ mapList = _config$mapList === void 0 ? [] : _config$mapList,
64
+ reset = _objectWithoutProperties(_config, _excluded);
53
65
  var rotateStyle = rotate ? {
54
66
  msTransform: "rotate(".concat(rotate, "deg)"),
55
67
  transform: "rotate(".concat(rotate, "deg)")
@@ -60,11 +72,42 @@ var ProIcon = function ProIcon(props) {
60
72
  'pro-icon-with-theme': theme,
61
73
  'pro-icon-btn': disabled
62
74
  });
63
- var SvgElement = _jsx("span", {
75
+ var _mode = mode || 'icon';
76
+ var isIconMode = _mode === 'icon';
77
+ var isExtendButtonMode = !isIconMode || isIconMode && disabled;
78
+ var mergedMapList = uniqBy(mapList.concat(iconMap), 'text');
79
+ var _type = type;
80
+ var _text = children;
81
+ var textIsExistAndIncludeChinese = _text && /[\u4e00-\u9fa5]/.test(String(_text));
82
+ var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
83
+ // 模式为icon下,对传入的text进行中文-icon 映射
84
+ if (isIconMode && !type) {
85
+ if (textIsExistAndIncludeChinese) {
86
+ var target = mergedMapList.find(function (item) {
87
+ return item.text === _text;
88
+ });
89
+ if (target) {
90
+ _type = target === null || target === void 0 ? void 0 : target.type;
91
+ }
92
+ }
93
+ }
94
+ // 模式为button下,对传入的type进行icon-中文 映射
95
+ if (!isIconMode) {
96
+ if (typeIsExistAndIncludeEnglish) {
97
+ var _target = mergedMapList.find(function (item) {
98
+ return item.type === _type;
99
+ });
100
+ if (_target) {
101
+ _text = _target === null || _target === void 0 ? void 0 : _target.text;
102
+ }
103
+ }
104
+ }
105
+ var RenderIcon = _jsx("span", _objectSpread(_objectSpread({
64
106
  className: "anticon",
65
107
  style: {
66
108
  color: color
67
- },
109
+ }
110
+ }, reset), {}, {
68
111
  children: _jsx("svg", {
69
112
  className: proIconClassNames,
70
113
  "aria-hidden": "true",
@@ -75,18 +118,17 @@ var ProIcon = function ProIcon(props) {
75
118
  height: size
76
119
  }, rotateStyle), style),
77
120
  children: _jsx("use", {
78
- xlinkHref: "#icon-".concat(type)
121
+ xlinkHref: "#icon-".concat(_type)
79
122
  })
80
123
  })
81
- });
82
- if (disabled) {
83
- return _jsx(_Button, _objectSpread({
84
- type: "text",
85
- className: proIconClassNames,
86
- icon: SvgElement,
87
- disabled: true
88
- }, reset));
89
- }
90
- return SvgElement;
124
+ }));
125
+ return !isExtendButtonMode ? RenderIcon : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({
126
+ type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
127
+ className: proIconClassNames,
128
+ disabled: disabled,
129
+ icon: isIconMode ? RenderIcon : null
130
+ }, reset), buttonProps), {}, {
131
+ children: _text
132
+ }));
91
133
  };
92
134
  export default ProIcon;
@@ -1,10 +1,16 @@
1
1
  import React, { CSSProperties } from 'react';
2
+ import { ButtonProps } from 'antd/lib/button';
3
+ export type ModeType = 'icon' | 'button';
4
+ interface iconMap {
5
+ type: string;
6
+ text: string;
7
+ }
2
8
  export interface ProIconProps {
3
9
  /**
4
10
  * @description 图标的名称
5
11
  * @default -
6
12
  */
7
- type: string;
13
+ type?: string;
8
14
  /**
9
15
  * @description 图标的大小,同时设置图标的width以及height
10
16
  * @default 14
@@ -53,4 +59,20 @@ export interface ProIconProps {
53
59
  * @default -
54
60
  */
55
61
  style?: CSSProperties;
62
+ /**
63
+ * @description 模式
64
+ * @default 'icon'
65
+ */
66
+ mode?: ModeType;
67
+ /**
68
+ * @description mode button时 props
69
+ * @default 'link'
70
+ */
71
+ buttonProps?: ButtonProps;
72
+ /**
73
+ * @description icon与中文映射表
74
+ * @default 项目内认默映射
75
+ */
76
+ mapList?: iconMap[];
56
77
  }
78
+ export {};
@@ -1,4 +1,4 @@
1
- window._iconfont_svg_string_4063056 = '<svg><symbol id="icon-disabled1" viewBox="0 0 1024 1024"><path d="M752.384 412.1088h-55.6544V300.3904C696.7296 183.6544 608.512 102.4 501.76 102.4 395.0592 102.4 306.8928 183.6544 306.8928 300.3904V407.04H251.1872c-27.8016 0-46.3872 25.344-46.3872 50.7392v385.8432c0 30.464 23.1936 50.7904 46.3872 50.7904h501.248c27.8016 0 46.3872-25.3952 46.3872-50.7904V462.848c0-30.464-18.5856-50.7392-46.4384-50.7392z m-222.72 253.8496v86.272c0 5.12-4.6592 5.12-4.6592 5.12h-41.7792c-4.608 0-4.608-5.12-4.608-5.12v-86.272c-23.2448-10.1888-37.12-30.464-37.12-55.8592 0-35.5328 27.8016-66.048 60.3136-66.048 32.4608 0 60.3136 30.5152 60.3136 66.048 0 25.3952-13.9264 45.6704-32.4608 55.808z m92.7744-253.8496H381.1328V295.3216c0-60.928 55.7056-111.6672 120.6784-111.6672 64.9728 0 120.6272 50.7392 120.6272 111.6672v116.736z" fill="#BCBCBC" ></path></symbol><symbol id="icon-drag" viewBox="0 0 1024 1024"><path d="M670.72 179.2m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M670.72 506.88m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M670.72 834.56m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M343.04 179.2m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M343.04 506.88m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M343.04 834.56m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path></symbol><symbol id="icon-plus" viewBox="0 0 1024 1024"><path d="M576 64H448v384H64v128h384v384h128V576h384V448H576z" ></path></symbol><symbol id="icon-zengjia" viewBox="0 0 1024 1024"><path d="M939.94 459.073h-377.6V83.519H462.055v375.554h-377.6v100.284h377.6v379.646H562.34V559.357h377.6z" fill="#272636" ></path></symbol><symbol id="icon-dot" viewBox="0 0 1024 1024"><path d="M512 624a112 112 0 1 0 0-224 112 112 0 0 0 0 224z" ></path></symbol><symbol id="icon-solid-close" viewBox="0 0 1024 1024"><path d="M516.707 66.513C272.86 66.513 75.16 264.212 75.16 508.06S272.86 949.607 516.707 949.607 958.254 751.91 958.254 508.06 760.556 66.513 516.707 66.513z m227.067 601.691c18.419 18.42 18.419 48.504 0 66.923s-48.504 18.42-66.923 0L516.707 574.983 356.563 735.127c-18.419 18.42-48.503 18.42-66.923 0s-18.419-48.504 0-66.923L449.784 508.06 289.64 347.916c-18.419-18.419-18.419-48.503 0-66.922 18.42-18.42 48.504-18.42 66.923 0l160.144 160.144 160.144-160.144c18.42-18.42 48.504-18.42 66.923 0 18.419 18.419 18.419 48.503 0 66.922L583.63 508.06l160.144 160.144z" ></path></symbol><symbol id="icon-arrow" viewBox="0 0 1024 1024"><path d="M832 0a192 192 0 0 1 192 192v640a192 192 0 0 1-192 192H192A192 192 0 0 1 0 832V192A192 192 0 0 1 192 0z m0 42.667H192A149.333 149.333 0 0 0 42.667 192v640A149.333 149.333 0 0 0 192 981.333h640A149.333 149.333 0 0 0 981.333 832V192A149.333 149.333 0 0 0 832 42.667z m-94.165 329.386l60.33 60.331L512 718.592 225.835 432.384l60.33-60.33L512 597.887l225.835-225.835z" ></path></symbol><symbol id="icon-delete" viewBox="0 0 1024 1024"><path d="M662.08 121.472v64H361.92v-64z m206.4 159.488v64H155.52v-64z" ></path><path d="M280.512 303.232l-0.064 530.816h460.096V303.232h64v594.88H216.512v-594.88z" ></path><path d="M431.424 440.704v337.728h-64V440.704z m225.152 0v337.728h-64V440.704z" ></path></symbol><symbol id="icon-catalog" viewBox="0 0 1075 1024"><path d="M1044.429 758.323v128.973H313.702V758.272h730.727z m-833.127 0v128.973H71.732V758.272h139.57zM1044.43 447.54v128.922H313.702V447.539h730.727z m-833.127 0v128.922H71.732V447.539h139.57z m833.127-310.784v128.922H313.702V136.704h730.727z m-833.127 0v128.922H71.732V136.704h139.57z" ></path></symbol><symbol id="icon-customColumn" viewBox="0 0 1024 1024"><path d="M170.368 128h0.576c28.288 0 42.368 14.848 42.368 44.608v678.784c0 29.76-14.08 44.608-42.368 44.608h-0.576C142.144 896 128 881.152 128 851.392V172.608c0-29.76 14.08-44.608 42.368-44.608z m682.752 0h0.576c28.224 0 42.368 14.848 42.368 44.608v678.784c0 29.76-14.08 44.608-42.368 44.608h-0.576c-28.288 0-42.368-14.848-42.368-44.608V172.608c0-29.76 14.08-44.608 42.368-44.608z m-453.632 0h225.024c38.784 0 58.176 20.16 58.176 60.416v647.168c0 40.32-19.392 60.416-58.176 60.416H399.488c-38.784 0-58.176-20.16-58.176-60.416V188.416c0-40.32 19.392-60.416 58.176-60.416z" ></path></symbol><symbol id="icon-copy" viewBox="0 0 1024 1024"><path d="M363.746 0h565.883c52.05 0 94.286 42.236 94.286 94.285V660.17c0 52.049-42.237 94.285-94.286 94.285H363.746c-52.05 0-94.286-42.236-94.286-94.285V94.285C269.46 42.236 311.697 0 363.746 0z m0 80.804a13.482 13.482 0 0 0-13.482 13.481V660.17c0 7.423 6.058 13.482 13.482 13.482h565.883c7.424 0 13.482-6.059 13.482-13.482V94.285a13.482 13.482 0 0 0-13.482-13.481H363.746z m309.905 754.54a40.445 40.445 0 1 1 80.803 0v94.37c0 52.05-42.236 94.286-94.285 94.286H94.285C42.236 1023.915 0 981.678 0 929.63V363.745c0-52.05 42.236-94.286 94.285-94.286h94.371a40.445 40.445 0 0 1 0 80.804h-94.37a13.482 13.482 0 0 0-13.482 13.482v565.883c0 7.424 6.058 13.482 13.481 13.482H660.17c7.423 0 13.482-6.058 13.482-13.482v-94.37z" ></path></symbol><symbol id="icon-drag-old" viewBox="0 0 1024 1024"><path d="M358.4 204.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 204.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 409.6m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M358.4 614.4m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M358.4 819.2m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 819.2m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M358.4 409.6m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 614.4m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path></symbol><symbol id="icon-disabled" viewBox="0 0 1024 1024"><path d="M752.384 412.1088h-55.6544V300.3904C696.7296 183.6544 608.512 102.4 501.76 102.4 395.0592 102.4 306.8928 183.6544 306.8928 300.3904V407.04H251.1872c-27.8016 0-46.3872 25.344-46.3872 50.7392v385.8432c0 30.464 23.1936 50.7904 46.3872 50.7904h501.248c27.8016 0 46.3872-25.3952 46.3872-50.7904V462.848c0-30.464-18.5856-50.7392-46.4384-50.7392z m-222.72 253.8496v86.272c0 5.12-4.6592 5.12-4.6592 5.12h-41.7792c-4.608 0-4.608-5.12-4.608-5.12v-86.272c-23.2448-10.1888-37.12-30.464-37.12-55.8592 0-35.5328 27.8016-66.048 60.3136-66.048 32.4608 0 60.3136 30.5152 60.3136 66.048 0 25.3952-13.9264 45.6704-32.4608 55.808z m92.7744-253.8496H381.1328V295.3216c0-60.928 55.7056-111.6672 120.6784-111.6672 64.9728 0 120.6272 50.7392 120.6272 111.6672v116.736z" ></path></symbol><symbol id="icon-tip" viewBox="0 0 1024 1024"><path d="M512 19.017a492.983 492.983 0 1 1-0.073 986.039A492.983 492.983 0 0 1 512 19.09z m0 48.786a444.27 444.27 0 1 0 0.073 888.467A444.27 444.27 0 0 0 512 67.803z m22.016 317.367c37.45 3.877 55.15 33.792 48.64 66.707l-78.41 259.072c-1.023 5.924 2.049 11.849 7.315 13.677 5.852 2.048 17.92-5.412 27.648-16.091l47.104-56.613c1.244 9.509-0.878 26.185-0.878 32.549-35.328 53.028-71.314 93.988-131.876 93.988-41.326-6.729-58.222-36.352-49.298-66.56l77.897-257.828c1.901-6.364-1.244-13.02-7.022-15.068-5.778-2.048-17.042 5.413-26.77 16.092l-47.031 56.612c-1.317-9.508-0.146-25.234-0.146-31.597 35.328-53.029 93.403-94.94 132.827-94.94z m40.96-144.823c29.77 0 53.906 21.724 53.906 53.614 0 31.964-24.137 53.614-53.906 53.614a52.297 52.297 0 0 1-53.906-53.614c0-31.89 24.137-53.614 53.906-53.614z" ></path></symbol><symbol id="icon-reset" viewBox="0 0 1024 1024"><path d="M482.464768 117.691733L364.363435 66.696533A49.288533 49.288533 0 0 0 325.314901 157.013333a417.9968 417.9968 0 0 0 53.8624 789.845334 49.288533 49.288533 0 0 0 25.668267-95.163734 319.624533 319.624533 0 0 1-29.559467-608.324266l-7.850666 18.158933a49.152 49.152 0 0 0 26.0096 64.580267 49.288533 49.288533 0 0 0 64.580266-24.9856l50.107734-118.9888a49.425067 49.425067 0 0 0-25.668267-64.512z m429.602133 421.410134A418.884267 418.884267 0 0 0 614.424235 126.839467a49.288533 49.288533 0 1 0-28.398934 94.344533 319.829333 319.829333 0 0 1 56.9344 589.824 49.152 49.152 0 0 0-86.152533-47.240533l-67.106133 109.431466a48.9472 48.9472 0 0 0 16.110933 67.925334l109.294933 67.9936a49.288533 49.288533 0 1 0 50.9952-83.7632l-15.018666-9.352534a418.679467 418.679467 0 0 0 261.051733-376.900266z" ></path></symbol><symbol id="icon-view" viewBox="0 0 1024 1024"><path d="M801.606 104.727a117.667 117.667 0 0 1 117.434 109.94l0.233 7.727v246.598a34.91 34.91 0 0 1-69.493 4.748l-0.325-4.748V222.394c0-24.669-18.619-44.963-42.636-47.57l-5.213-0.279H222.394c-24.669 0-44.963 18.619-47.57 42.636l-0.279 5.213v579.212c0 24.669 18.619 44.963 42.636 47.57l5.213 0.279h243.247a34.91 34.91 0 0 1 4.747 69.492l-4.747 0.326H222.394a117.667 117.667 0 0 1-117.434-109.94l-0.233-7.727V222.394a117.667 117.667 0 0 1 109.94-117.434l7.727-0.233h579.212zM448.559 585.728a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h116.364z m232.727-232.727a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h349.09z" ></path><path d="M699.764 490.356a186.182 186.182 0 1 1 0 372.364 186.182 186.182 0 0 1 0-372.364z m0 69.819a116.364 116.364 0 1 0 0 232.727 116.364 116.364 0 0 0 0-232.727z" ></path><path d="M798.673 769.35a34.91 34.91 0 0 1 49.339 0l82.292 82.246a34.91 34.91 0 1 1-49.338 49.384l-82.293-82.292a34.91 34.91 0 0 1 0-49.338z" ></path></symbol><symbol id="icon-search" viewBox="0 0 1024 1024"><path d="M801.606 104.727a117.667 117.667 0 0 1 117.434 109.94l0.233 7.727v246.598a34.91 34.91 0 0 1-69.493 4.748l-0.325-4.748V222.394c0-24.669-18.619-44.963-42.636-47.57l-5.213-0.279H222.394c-24.669 0-44.963 18.619-47.57 42.636l-0.279 5.213v579.212c0 24.669 18.619 44.963 42.636 47.57l5.213 0.279h243.247a34.91 34.91 0 0 1 4.747 69.492l-4.747 0.326H222.394a117.667 117.667 0 0 1-117.434-109.94l-0.233-7.727V222.394a117.667 117.667 0 0 1 109.94-117.434l7.727-0.233h579.212zM448.559 585.728a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h116.364z m232.727-232.727a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h349.09z" ></path><path d="M699.764 490.356a186.182 186.182 0 1 1 0 372.364 186.182 186.182 0 0 1 0-372.364z m0 69.819a116.364 116.364 0 1 0 0 232.727 116.364 116.364 0 0 0 0-232.727z" ></path><path d="M798.673 769.35a34.91 34.91 0 0 1 49.339 0l82.292 82.246a34.91 34.91 0 1 1-49.338 49.384l-82.293-82.292a34.91 34.91 0 0 1 0-49.338z" ></path></symbol></svg>', function (o) {
1
+ window._iconfont_svg_string_4063056 = '<svg><symbol id="icon-lock" viewBox="0 0 1024 1024"><path d="M752.384 412.1088h-55.6544V300.3904C696.7296 183.6544 608.512 102.4 501.76 102.4 395.0592 102.4 306.8928 183.6544 306.8928 300.3904V407.04H251.1872c-27.8016 0-46.3872 25.344-46.3872 50.7392v385.8432c0 30.464 23.1936 50.7904 46.3872 50.7904h501.248c27.8016 0 46.3872-25.3952 46.3872-50.7904V462.848c0-30.464-18.5856-50.7392-46.4384-50.7392z m-222.72 253.8496v86.272c0 5.12-4.6592 5.12-4.6592 5.12h-41.7792c-4.608 0-4.608-5.12-4.608-5.12v-86.272c-23.2448-10.1888-37.12-30.464-37.12-55.8592 0-35.5328 27.8016-66.048 60.3136-66.048 32.4608 0 60.3136 30.5152 60.3136 66.048 0 25.3952-13.9264 45.6704-32.4608 55.808z m92.7744-253.8496H381.1328V295.3216c0-60.928 55.7056-111.6672 120.6784-111.6672 64.9728 0 120.6272 50.7392 120.6272 111.6672v116.736z" fill="#BCBCBC" ></path></symbol><symbol id="icon-drag" viewBox="0 0 1024 1024"><path d="M670.72 179.2m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M670.72 506.88m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M670.72 834.56m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M343.04 179.2m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M343.04 506.88m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path><path d="M343.04 834.56m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z" fill="#939599" ></path></symbol><symbol id="icon-plus" viewBox="0 0 1024 1024"><path d="M576 64H448v384H64v128h384v384h128V576h384V448H576z" ></path></symbol><symbol id="icon-zengjia" viewBox="0 0 1024 1024"><path d="M939.94 459.073h-377.6V83.519H462.055v375.554h-377.6v100.284h377.6v379.646H562.34V559.357h377.6z" fill="#272636" ></path></symbol><symbol id="icon-dot" viewBox="0 0 1024 1024"><path d="M512 624a112 112 0 1 0 0-224 112 112 0 0 0 0 224z" ></path></symbol><symbol id="icon-solid-close" viewBox="0 0 1024 1024"><path d="M516.707 66.513C272.86 66.513 75.16 264.212 75.16 508.06S272.86 949.607 516.707 949.607 958.254 751.91 958.254 508.06 760.556 66.513 516.707 66.513z m227.067 601.691c18.419 18.42 18.419 48.504 0 66.923s-48.504 18.42-66.923 0L516.707 574.983 356.563 735.127c-18.419 18.42-48.503 18.42-66.923 0s-18.419-48.504 0-66.923L449.784 508.06 289.64 347.916c-18.419-18.419-18.419-48.503 0-66.922 18.42-18.42 48.504-18.42 66.923 0l160.144 160.144 160.144-160.144c18.42-18.42 48.504-18.42 66.923 0 18.419 18.419 18.419 48.503 0 66.922L583.63 508.06l160.144 160.144z" ></path></symbol><symbol id="icon-arrow" viewBox="0 0 1024 1024"><path d="M832 0a192 192 0 0 1 192 192v640a192 192 0 0 1-192 192H192A192 192 0 0 1 0 832V192A192 192 0 0 1 192 0z m0 42.667H192A149.333 149.333 0 0 0 42.667 192v640A149.333 149.333 0 0 0 192 981.333h640A149.333 149.333 0 0 0 981.333 832V192A149.333 149.333 0 0 0 832 42.667z m-94.165 329.386l60.33 60.331L512 718.592 225.835 432.384l60.33-60.33L512 597.887l225.835-225.835z" ></path></symbol><symbol id="icon-delete" viewBox="0 0 1024 1024"><path d="M662.08 121.472v64H361.92v-64z m206.4 159.488v64H155.52v-64z" ></path><path d="M280.512 303.232l-0.064 530.816h460.096V303.232h64v594.88H216.512v-594.88z" ></path><path d="M431.424 440.704v337.728h-64V440.704z m225.152 0v337.728h-64V440.704z" ></path></symbol><symbol id="icon-catalog" viewBox="0 0 1075 1024"><path d="M1044.429 758.323v128.973H313.702V758.272h730.727z m-833.127 0v128.973H71.732V758.272h139.57zM1044.43 447.54v128.922H313.702V447.539h730.727z m-833.127 0v128.922H71.732V447.539h139.57z m833.127-310.784v128.922H313.702V136.704h730.727z m-833.127 0v128.922H71.732V136.704h139.57z" ></path></symbol><symbol id="icon-customColumn" viewBox="0 0 1024 1024"><path d="M170.368 128h0.576c28.288 0 42.368 14.848 42.368 44.608v678.784c0 29.76-14.08 44.608-42.368 44.608h-0.576C142.144 896 128 881.152 128 851.392V172.608c0-29.76 14.08-44.608 42.368-44.608z m682.752 0h0.576c28.224 0 42.368 14.848 42.368 44.608v678.784c0 29.76-14.08 44.608-42.368 44.608h-0.576c-28.288 0-42.368-14.848-42.368-44.608V172.608c0-29.76 14.08-44.608 42.368-44.608z m-453.632 0h225.024c38.784 0 58.176 20.16 58.176 60.416v647.168c0 40.32-19.392 60.416-58.176 60.416H399.488c-38.784 0-58.176-20.16-58.176-60.416V188.416c0-40.32 19.392-60.416 58.176-60.416z" ></path></symbol><symbol id="icon-copy" viewBox="0 0 1024 1024"><path d="M363.746 0h565.883c52.05 0 94.286 42.236 94.286 94.285V660.17c0 52.049-42.237 94.285-94.286 94.285H363.746c-52.05 0-94.286-42.236-94.286-94.285V94.285C269.46 42.236 311.697 0 363.746 0z m0 80.804a13.482 13.482 0 0 0-13.482 13.481V660.17c0 7.423 6.058 13.482 13.482 13.482h565.883c7.424 0 13.482-6.059 13.482-13.482V94.285a13.482 13.482 0 0 0-13.482-13.481H363.746z m309.905 754.54a40.445 40.445 0 1 1 80.803 0v94.37c0 52.05-42.236 94.286-94.285 94.286H94.285C42.236 1023.915 0 981.678 0 929.63V363.745c0-52.05 42.236-94.286 94.285-94.286h94.371a40.445 40.445 0 0 1 0 80.804h-94.37a13.482 13.482 0 0 0-13.482 13.482v565.883c0 7.424 6.058 13.482 13.481 13.482H660.17c7.423 0 13.482-6.058 13.482-13.482v-94.37z" ></path></symbol><symbol id="icon-drag-old" viewBox="0 0 1024 1024"><path d="M358.4 204.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 204.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 409.6m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M358.4 614.4m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M358.4 819.2m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 819.2m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M358.4 409.6m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path><path d="M665.6 614.4m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" ></path></symbol><symbol id="icon-disabled" viewBox="0 0 1024 1024"><path d="M752.384 412.1088h-55.6544V300.3904C696.7296 183.6544 608.512 102.4 501.76 102.4 395.0592 102.4 306.8928 183.6544 306.8928 300.3904V407.04H251.1872c-27.8016 0-46.3872 25.344-46.3872 50.7392v385.8432c0 30.464 23.1936 50.7904 46.3872 50.7904h501.248c27.8016 0 46.3872-25.3952 46.3872-50.7904V462.848c0-30.464-18.5856-50.7392-46.4384-50.7392z m-222.72 253.8496v86.272c0 5.12-4.6592 5.12-4.6592 5.12h-41.7792c-4.608 0-4.608-5.12-4.608-5.12v-86.272c-23.2448-10.1888-37.12-30.464-37.12-55.8592 0-35.5328 27.8016-66.048 60.3136-66.048 32.4608 0 60.3136 30.5152 60.3136 66.048 0 25.3952-13.9264 45.6704-32.4608 55.808z m92.7744-253.8496H381.1328V295.3216c0-60.928 55.7056-111.6672 120.6784-111.6672 64.9728 0 120.6272 50.7392 120.6272 111.6672v116.736z" ></path></symbol><symbol id="icon-tip" viewBox="0 0 1024 1024"><path d="M512 19.017a492.983 492.983 0 1 1-0.073 986.039A492.983 492.983 0 0 1 512 19.09z m0 48.786a444.27 444.27 0 1 0 0.073 888.467A444.27 444.27 0 0 0 512 67.803z m22.016 317.367c37.45 3.877 55.15 33.792 48.64 66.707l-78.41 259.072c-1.023 5.924 2.049 11.849 7.315 13.677 5.852 2.048 17.92-5.412 27.648-16.091l47.104-56.613c1.244 9.509-0.878 26.185-0.878 32.549-35.328 53.028-71.314 93.988-131.876 93.988-41.326-6.729-58.222-36.352-49.298-66.56l77.897-257.828c1.901-6.364-1.244-13.02-7.022-15.068-5.778-2.048-17.042 5.413-26.77 16.092l-47.031 56.612c-1.317-9.508-0.146-25.234-0.146-31.597 35.328-53.029 93.403-94.94 132.827-94.94z m40.96-144.823c29.77 0 53.906 21.724 53.906 53.614 0 31.964-24.137 53.614-53.906 53.614a52.297 52.297 0 0 1-53.906-53.614c0-31.89 24.137-53.614 53.906-53.614z" ></path></symbol><symbol id="icon-reset" viewBox="0 0 1024 1024"><path d="M482.464768 117.691733L364.363435 66.696533A49.288533 49.288533 0 0 0 325.314901 157.013333a417.9968 417.9968 0 0 0 53.8624 789.845334 49.288533 49.288533 0 0 0 25.668267-95.163734 319.624533 319.624533 0 0 1-29.559467-608.324266l-7.850666 18.158933a49.152 49.152 0 0 0 26.0096 64.580267 49.288533 49.288533 0 0 0 64.580266-24.9856l50.107734-118.9888a49.425067 49.425067 0 0 0-25.668267-64.512z m429.602133 421.410134A418.884267 418.884267 0 0 0 614.424235 126.839467a49.288533 49.288533 0 1 0-28.398934 94.344533 319.829333 319.829333 0 0 1 56.9344 589.824 49.152 49.152 0 0 0-86.152533-47.240533l-67.106133 109.431466a48.9472 48.9472 0 0 0 16.110933 67.925334l109.294933 67.9936a49.288533 49.288533 0 1 0 50.9952-83.7632l-15.018666-9.352534a418.679467 418.679467 0 0 0 261.051733-376.900266z" ></path></symbol><symbol id="icon-view" viewBox="0 0 1024 1024"><path d="M801.606 104.727a117.667 117.667 0 0 1 117.434 109.94l0.233 7.727v246.598a34.91 34.91 0 0 1-69.493 4.748l-0.325-4.748V222.394c0-24.669-18.619-44.963-42.636-47.57l-5.213-0.279H222.394c-24.669 0-44.963 18.619-47.57 42.636l-0.279 5.213v579.212c0 24.669 18.619 44.963 42.636 47.57l5.213 0.279h243.247a34.91 34.91 0 0 1 4.747 69.492l-4.747 0.326H222.394a117.667 117.667 0 0 1-117.434-109.94l-0.233-7.727V222.394a117.667 117.667 0 0 1 109.94-117.434l7.727-0.233h579.212zM448.559 585.728a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h116.364z m232.727-232.727a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h349.09z" ></path><path d="M699.764 490.356a186.182 186.182 0 1 1 0 372.364 186.182 186.182 0 0 1 0-372.364z m0 69.819a116.364 116.364 0 1 0 0 232.727 116.364 116.364 0 0 0 0-232.727z" ></path><path d="M798.673 769.35a34.91 34.91 0 0 1 49.339 0l82.292 82.246a34.91 34.91 0 1 1-49.338 49.384l-82.293-82.292a34.91 34.91 0 0 1 0-49.338z" ></path></symbol><symbol id="icon-search" viewBox="0 0 1024 1024"><path d="M801.606 104.727a117.667 117.667 0 0 1 117.434 109.94l0.233 7.727v246.598a34.91 34.91 0 0 1-69.493 4.748l-0.325-4.748V222.394c0-24.669-18.619-44.963-42.636-47.57l-5.213-0.279H222.394c-24.669 0-44.963 18.619-47.57 42.636l-0.279 5.213v579.212c0 24.669 18.619 44.963 42.636 47.57l5.213 0.279h243.247a34.91 34.91 0 0 1 4.747 69.492l-4.747 0.326H222.394a117.667 117.667 0 0 1-117.434-109.94l-0.233-7.727V222.394a117.667 117.667 0 0 1 109.94-117.434l7.727-0.233h579.212zM448.559 585.728a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h116.364z m232.727-232.727a34.91 34.91 0 1 1 0 69.818H332.195a34.91 34.91 0 1 1 0-69.818h349.09z" ></path><path d="M699.764 490.356a186.182 186.182 0 1 1 0 372.364 186.182 186.182 0 0 1 0-372.364z m0 69.819a116.364 116.364 0 1 0 0 232.727 116.364 116.364 0 0 0 0-232.727z" ></path><path d="M798.673 769.35a34.91 34.91 0 0 1 49.339 0l82.292 82.246a34.91 34.91 0 1 1-49.338 49.384l-82.293-82.292a34.91 34.91 0 0 1 0-49.338z" ></path></symbol></svg>', function (o) {
2
2
  var t = (t = document.getElementsByTagName("script"))[t.length - 1],
3
3
  a = t.getAttribute("data-injectcss"),
4
4
  t = t.getAttribute("data-disable-injectsvg");
@@ -222,6 +222,14 @@
222
222
  .pro-transfer-right {
223
223
  .checked-item {
224
224
  margin: var(--zaui-space-size-sm, 8px) 0;
225
+ &.dragable {
226
+ .ant-tag {
227
+ & > span:first-child {
228
+ padding: 8px 0;
229
+ cursor: move;
230
+ }
231
+ }
232
+ }
225
233
 
226
234
  &:first-child {
227
235
  margin-top: 0;
@@ -22,7 +22,14 @@ var initialState = {
22
22
  ProEnum: {
23
23
  dics: {}
24
24
  },
25
- forms: {}
25
+ forms: {},
26
+ ProIcon: {
27
+ mode: 'icon',
28
+ mapList: [{
29
+ type: 'view',
30
+ text: '查看'
31
+ }]
32
+ }
26
33
  };
27
34
  var ProConfigContext = exports.ProConfigContext = /*#__PURE__*/_react.default.createContext({
28
35
  state: initialState,
@@ -206,7 +206,9 @@ var transformColumns = exports.transformColumns = function transformColumns() {
206
206
  ellipsis = item.ellipsis,
207
207
  key = item.key,
208
208
  tooltip = item.tooltip,
209
- suffix = item.suffix;
209
+ suffix = item.suffix,
210
+ before = item.before,
211
+ after = item.after;
210
212
  // column设置label时,权重最高
211
213
  var columnTitle = label || title;
212
214
  if (typeof columnTitle === 'string') {
@@ -218,7 +220,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
218
220
  resetProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
219
221
  item.title = (0, _jsxRuntime.jsxs)("span", {
220
222
  className: "pro-edit-table-title pro-edit-table-tooltip",
221
- children: [columnTitle, (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
223
+ children: [before, columnTitle, (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
222
224
  title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
223
225
  }, resetProps), {}, {
224
226
  children: icon ? ( /*#__PURE__*/_react.default.cloneElement(icon, {
@@ -227,12 +229,12 @@ var transformColumns = exports.transformColumns = function transformColumns() {
227
229
  className: "icon-tip",
228
230
  src: _tip.default
229
231
  })
230
- })), suffix]
232
+ })), suffix || after]
231
233
  });
232
234
  } else {
233
235
  item.title = (0, _jsxRuntime.jsxs)("span", {
234
236
  className: "pro-edit-table-title",
235
- children: [columnTitle, suffix]
237
+ children: [before, columnTitle, suffix || after]
236
238
  });
237
239
  }
238
240
  }
@@ -42,6 +42,7 @@
42
42
  padding: var(--zaui-space-size-sm) var(--zaui-space-border);
43
43
  line-height: 18px;
44
44
  background-color: #f1f3f6ff;
45
+ border: 1px solid transparent;
45
46
  cursor: pointer;
46
47
 
47
48
  &::after {
@@ -64,7 +65,7 @@
64
65
  border-top-right-radius: var(--zaui-space-size-xs);
65
66
  border-bottom-right-radius: var(--zaui-space-size-xs);
66
67
  &::after {
67
- width: 0;
68
+ background: transparent;
68
69
  }
69
70
  }
70
71
  }
@@ -73,12 +74,12 @@
73
74
  color: var(--zaui-brand);
74
75
  border: 1px solid var(--zaui-brand);
75
76
  &::after {
76
- width: 0;
77
+ background: transparent;
77
78
  }
78
79
  }
79
80
 
80
81
  .pro-enum-group-item-disabled-after::after {
81
- width: 0 !important;
82
+ background: transparent;
82
83
  }
83
84
 
84
85
  .pro-enum-group-item-disabled {
@@ -77,6 +77,9 @@ var InputNumber = function InputNumber(props) {
77
77
  },
78
78
  parser: function parser(value) {
79
79
  var num = Number(value.replace(/[\s,]+/g, ''));
80
+ if (value === '') {
81
+ return value;
82
+ }
80
83
  return Number.isNaN(num) ? value : num.toFixed((props === null || props === void 0 ? void 0 : props.precision) || 2);
81
84
  }
82
85
  };
@@ -7,10 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _jsxRuntime = require("react/jsx-runtime");
11
12
  var _antd = require("antd");
12
13
  var _react = require("react");
13
14
  var _lodash = require("lodash");
15
+ var _ahooks = require("ahooks");
14
16
  var _classnames2 = _interopRequireDefault(require("classnames"));
15
17
  var _RenderFields = _interopRequireDefault(require("../../render/RenderFields"));
16
18
  var _utils = require("./utils");
@@ -23,7 +25,13 @@ var Group = function Group(props) {
23
25
  space = _props$space === void 0 ? {
24
26
  size: 12
25
27
  } : _props$space,
26
- id = props.id;
28
+ id = props.id,
29
+ value = props.value,
30
+ onFieldChange = props.onFieldChange;
31
+ var _useCounter = (0, _ahooks.useCounter)(0),
32
+ _useCounter2 = (0, _slicedToArray2.default)(_useCounter, 2),
33
+ num = _useCounter2[0],
34
+ inc = _useCounter2[1].inc;
27
35
  var _ref = _ProForm.default.useFieldProps() || {},
28
36
  names = _ref.names,
29
37
  name = _ref.name,
@@ -60,6 +68,15 @@ var Group = function Group(props) {
60
68
  return ['Radio', 'Checkbox', 'Switch'].includes(item.type);
61
69
  })
62
70
  }, "".concat(className), className));
71
+ (0, _ahooks.useDeepCompareEffect)(function () {
72
+ // 模拟change,初始化不执行onFieldChange
73
+ if ((0, _lodash.isFunction)(onFieldChange) && num >= 1) {
74
+ onFieldChange(value, form.getFieldsValue(), {
75
+ form: form
76
+ });
77
+ }
78
+ inc();
79
+ }, [value]);
63
80
  return (0, _jsxRuntime.jsx)("div", {
64
81
  className: _className,
65
82
  children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? (0, _jsxRuntime.jsx)(_antd.Space.Compact, {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RowProps, SpaceProps } from 'antd';
3
+ import { FormInstance } from 'antd/es/form/Form';
3
4
  import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
4
5
  export interface SpaceType extends SpaceProps {
5
6
  /**
@@ -22,4 +23,7 @@ export interface GroupProps {
22
23
  value?: any;
23
24
  id?: string;
24
25
  disabled?: boolean | (() => void);
26
+ onFieldChange?: (value: any[] | null, record: any, { form, }: {
27
+ form: FormInstance;
28
+ }) => any;
25
29
  }
@@ -74,6 +74,9 @@
74
74
  margin-inline-start: -1px;
75
75
  border-start-start-radius: 0;
76
76
  border-end-start-radius: 0;
77
+ padding: 0 12px;
78
+ background-color: #fff;
79
+ cursor: default;
77
80
  }
78
81
  .pro-modal-select {
79
82
  margin-left: -1px;
@@ -14,7 +14,8 @@ var _antd = require("antd");
14
14
  var _index = _interopRequireDefault(require("../../index"));
15
15
  var _excluded = ["onChange", "children", "confirm"];
16
16
  var defaultConfirmProps = {
17
- title: '点击确定完成修改'
17
+ title: '操作提示',
18
+ content: '确定要修改该字段吗?'
18
19
  };
19
20
  var ConfirmWrapper = function ConfirmWrapper(props) {
20
21
  var onChange = props.onChange,
@@ -28,7 +29,8 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
28
29
  other[_key - 1] = arguments[_key];
29
30
  }
30
31
  var _value = (value === null || value === void 0 ? void 0 : value.target) ? value.target.value : value;
31
- if (confirm === true) {
32
+ var confirmProps = (0, _lodash.isFunction)(confirm) ? confirm(form.getFieldsValue()) : confirm;
33
+ if (confirmProps === true) {
32
34
  _antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultConfirmProps), {}, {
33
35
  onOk: function onOk() {
34
36
  return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
@@ -36,28 +38,18 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
36
38
  }));
37
39
  return;
38
40
  }
39
- if ((0, _lodash.isFunction)(confirm)) {
40
- var confirmProps = (0, _lodash.isFunction)(confirm) && confirm(form.getFieldsValue());
41
- if (confirmProps === true) {
42
- _antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultConfirmProps), {}, {
43
- onOk: function onOk() {
44
- return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
45
- }
46
- }));
47
- return;
48
- }
49
- if ((0, _lodash.isObject)(confirmProps)) {
50
- _antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultConfirmProps), confirmProps), {}, {
51
- onOk: function onOk() {
52
- for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
53
- arg[_key2] = arguments[_key2];
54
- }
55
- confirmProps === null || confirmProps === void 0 ? void 0 : confirmProps.onOk.apply(confirmProps, arg);
56
- onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
41
+ if ((0, _lodash.isObject)(confirmProps)) {
42
+ _antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultConfirmProps), confirmProps), {}, {
43
+ onOk: function onOk() {
44
+ var _confirmProps$onOk;
45
+ for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
46
+ arg[_key2] = arguments[_key2];
57
47
  }
58
- }));
59
- return;
60
- }
48
+ (_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
49
+ onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
50
+ }
51
+ }));
52
+ return;
61
53
  }
62
54
  onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
63
55
  };
@@ -32,7 +32,7 @@ var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className",
32
32
  /* eslint-disable prefer-destructuring */
33
33
  // 这个组件只管渲染, 参数的整理在外部处理
34
34
  var Render = function Render(props) {
35
- var _ref2, _otherProps$names2;
35
+ var _ref2, _ref3, _otherProps$names2;
36
36
  var component = props.component,
37
37
  originComponent = props.originComponent,
38
38
  _props$formItemProps = props.formItemProps,
@@ -167,8 +167,8 @@ var Render = function Render(props) {
167
167
  }
168
168
  /** 移除多余参数,防止透传给formItem报错 */
169
169
  var _otherFormItemProps = (0, _lodash.omit)(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'switchValue', 'precision', 'clearNotShow']);
170
- // 优先级 column.disabled > fieldProps.disabled > formDisabled
171
- var lastDisabled = (_ref2 = _disabled !== null && _disabled !== void 0 ? _disabled : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref2 !== void 0 ? _ref2 : formDisabled;
170
+ // 优先级 formitem上【column.disabled > 组件上【fieldProps.disabled > 全局【formDisabled
171
+ var lastDisabled = (_ref2 = (_ref3 = _disabled !== null && _disabled !== void 0 ? _disabled : _fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : componentProps === null || componentProps === void 0 ? void 0 : componentProps.disabled) !== null && _ref2 !== void 0 ? _ref2 : formDisabled;
172
172
  /**
173
173
  * 最新fieldProps: 更新后的组件Props
174
174
  */
@@ -196,8 +196,8 @@ var Render = function Render(props) {
196
196
  var functionArgs = function functionArgs(args) {
197
197
  var _otherFormItemProps$n;
198
198
  var _args = (0, _toConsumableArray2.default)(args);
199
- var _ref3 = otherProps || {},
200
- valueType = _ref3.valueType;
199
+ var _ref4 = otherProps || {},
200
+ valueType = _ref4.valueType;
201
201
  _args[1] = form.getFieldsValue();
202
202
  _args[2] = {
203
203
  form: form
@@ -258,8 +258,9 @@ var Render = function Render(props) {
258
258
  // Group默认校验, 延时与重新setFieldValue,为了解决校验值未同步最新的问题,
259
259
  if (formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames) {
260
260
  setTimeout(function () {
261
- form.setFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames, form.getFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames));
262
- form.validateFields();
261
+ var namePath = (0, _index.parseNamePath)(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames);
262
+ form.setFieldValue(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames, form.getFieldValue(namePath));
263
+ form.validateFields(namePath);
263
264
  }, 60);
264
265
  }
265
266
  // ProTreeSelect返回option
@@ -273,7 +274,7 @@ var Render = function Render(props) {
273
274
  * onBlur参数重置 (value, record, { form, index, namePath, option }) => void
274
275
  */
275
276
  var handleBlur = /*#__PURE__*/function () {
276
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
277
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
277
278
  var _len2,
278
279
  args,
279
280
  _key2,
@@ -300,12 +301,14 @@ var Render = function Render(props) {
300
301
  }, _callee);
301
302
  }));
302
303
  return function handleBlur() {
303
- return _ref4.apply(this, arguments);
304
+ return _ref5.apply(this, arguments);
304
305
  };
305
306
  }();
306
307
  var renderItem = function renderItem() {
308
+ // 移除多余字段,group保留onFieldChange
309
+ var lastComponentPropsFilter = type === 'Group' ? ['disabledStrictly'] : ['onFieldChange', 'disabledStrictly'];
307
310
  // 表单渲染 start
308
- var childProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props), (0, _lodash.omit)(lastComponentProps, ['onFieldChange', 'disabledStrictly'])), {}, {
311
+ var childProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props), (0, _lodash.omit)(lastComponentProps, lastComponentPropsFilter)), {}, {
309
312
  // @ts-ignore
310
313
  otherProps: otherProps,
311
314
  onChange: handleChange,
@@ -348,7 +351,7 @@ var Render = function Render(props) {
348
351
  if (originComponent) {
349
352
  delete childProps.otherProps;
350
353
  }
351
- var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? ( /*#__PURE__*/_react.default.cloneElement(AutoComponent, childProps)) : (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, ['onFieldChange', 'disabledStrictly'])), {}, {
354
+ var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? ( /*#__PURE__*/_react.default.cloneElement(AutoComponent, childProps)) : (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, lastComponentPropsFilter)), {}, {
352
355
  otherProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
353
356
  show: show,
354
357
  disabled: lastDisabled,
@@ -383,7 +386,7 @@ var Render = function Render(props) {
383
386
  name: _otherFormItemProps.name
384
387
  }, (0, _lodash.omit)(_otherFormItemProps, ['rules'])), {}, {
385
388
  children: function children(fields, operation, meta) {
386
- return (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, ['onFieldChange', 'disabledStrictly'])), {}, {
389
+ return (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, lastComponentPropsFilter)), {}, {
387
390
  otherProps: otherProps,
388
391
  fields: fields,
389
392
  operation: operation,
@@ -88,4 +88,6 @@ export declare const findOptionByValue: (treeData: any[], value: string | number
88
88
  * 对比依赖列表中的 值是否变更
89
89
  */
90
90
  export declare const equalDependencies: (dependencies: any, prevValues: any, currentValues: any) => any;
91
+ /** 解析namePath */
92
+ export declare const parseNamePath: (input: string) => any;
91
93
  export {};
@@ -9,7 +9,7 @@ exports.getAllNamePath = exports.findOptionByValue = exports.filterInternalField
9
9
  exports.getArrayBeforeNumber = getArrayBeforeNumber;
10
10
  exports.hasRowKey = exports.getLayout = exports.getDecimalDigits = void 0;
11
11
  exports.initialValuesToNames = initialValuesToNames;
12
- exports.isUpperCase = exports.isTrim = exports.isSelect = exports.isNullValue = exports.isNullArray = exports.isNotFullArray = void 0;
12
+ exports.parseNamePath = exports.isUpperCase = exports.isTrim = exports.isSelect = exports.isNullValue = exports.isNullArray = exports.isNotFullArray = void 0;
13
13
  exports.processHyphenKeys = processHyphenKeys;
14
14
  exports.splitNameStr = void 0;
15
15
  exports.toArray = toArray;
@@ -21,18 +21,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
21
21
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
22
22
  var _react = require("react");
23
23
  var _lodash = _interopRequireWildcard(require("lodash"));
24
- var colProps = {
25
- search: {
26
- span: 8
27
- },
28
- drawer: {
29
- span: 12
30
- }
31
- };
32
- var footer = {
33
- search: false,
34
- drawer: false
35
- };
36
24
  var getLayout = exports.getLayout = function getLayout(params) {
37
25
  var _params$span = params.span,
38
26
  span = _params$span === void 0 ? 8 : _params$span,
@@ -436,4 +424,17 @@ var equalDependencies = exports.equalDependencies = function equalDependencies(d
436
424
  });
437
425
  }
438
426
  return false;
427
+ };
428
+ /** 解析namePath */
429
+ var parseNamePath = exports.parseNamePath = function parseNamePath(input) {
430
+ var parts = input.split('_');
431
+ if (parts.every(function (item) {
432
+ return (0, _lodash.isNaN)(Number(item));
433
+ })) {
434
+ return [input];
435
+ }
436
+ var result = parts.map(function (item) {
437
+ return (0, _lodash.isNaN)(Number(item)) ? item : Number(item);
438
+ });
439
+ return [result];
439
440
  };
@@ -0,0 +1,4 @@
1
+ export declare const iconMap: {
2
+ type: string;
3
+ text: string;
4
+ }[];