@zat-design/sisyphus-react 3.1.5 → 3.2.0-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 (256) hide show
  1. package/dist/index.esm.css +176 -251
  2. package/es/ProAction/index.js +7 -5
  3. package/es/ProAction/index.less +3 -2
  4. package/es/ProConfigProvider/index.d.ts +2 -0
  5. package/es/ProConfigProvider/index.js +23 -2
  6. package/es/ProDownload/utils.js +6 -3
  7. package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
  8. package/es/ProDrawerForm/index.js +5 -3
  9. package/es/ProDrawerForm/style/index.less +15 -11
  10. package/es/ProEditLabel/style/index.less +2 -2
  11. package/es/ProEditTable/components/ActionButton/index.js +3 -2
  12. package/es/ProEditTable/components/RenderField/index.js +2 -1
  13. package/es/ProEditTable/index.js +7 -6
  14. package/es/ProEditTable/style/index.less +15 -8
  15. package/es/ProEditTable/utils/config.d.ts +8 -8
  16. package/es/ProEditTable/utils/config.js +20 -12
  17. package/es/ProEditTable/utils/index.js +3 -2
  18. package/es/ProEnum/hooks/useEnumRequest.js +17 -10
  19. package/es/ProEnum/index.js +9 -4
  20. package/es/ProEnum/style/index.less +1 -1
  21. package/es/ProForm/components/FormFooter/index.js +16 -20
  22. package/es/ProForm/components/base/Input/index.js +4 -3
  23. package/es/ProForm/components/base/InputNumber/index.js +4 -3
  24. package/es/ProForm/components/base/RangePicker/index.js +0 -3
  25. package/es/ProForm/components/base/Select/index.js +2 -1
  26. package/es/ProForm/components/base/Switch/index.js +9 -5
  27. package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  28. package/es/ProForm/components/base/TextArea/index.js +4 -2
  29. package/es/ProForm/components/base/TextArea/index.less +1 -1
  30. package/es/ProForm/components/combination/Container/style/index.less +0 -1
  31. package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  32. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  33. package/es/ProForm/components/combination/FormList/style/index.less +20 -19
  34. package/es/ProForm/components/combination/Group/index.js +2 -2
  35. package/es/ProForm/components/combination/ProAddressBar/index.js +83 -63
  36. package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  37. package/es/ProForm/components/combination/ProModalSelect/index.js +76 -15
  38. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  39. package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  40. package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
  41. package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  42. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  43. package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  44. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  45. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  46. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
  47. package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
  48. package/es/ProForm/components/render/Render.js +4 -2
  49. package/es/ProForm/components/render/RenderFields.js +10 -6
  50. package/es/ProForm/components/render/propsType.d.ts +5 -4
  51. package/es/ProForm/index.js +14 -2
  52. package/es/ProForm/style/index.less +77 -169
  53. package/es/ProForm/utils/index.d.ts +1 -1
  54. package/es/ProForm/utils/index.js +7 -2
  55. package/es/ProForm/utils/rulesCreator.js +2 -1
  56. package/es/ProForm/utils/useRules.js +4 -3
  57. package/es/ProForm/utils/useShouldUpdate.js +16 -16
  58. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  59. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
  60. package/es/ProLayout/components/Layout/Notice/index.js +3 -2
  61. package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
  62. package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  63. package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +2 -1
  64. package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  65. package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  66. package/es/ProLayout/components/ProHeader/components/index.js +2 -1
  67. package/es/ProLayout/components/ProHeader/index.js +9 -6
  68. package/es/ProLayout/components/ProHeader/style/index.less +16 -7
  69. package/es/ProLayout/utils/index.js +1 -1
  70. package/es/ProSelect/index.d.ts +3 -3
  71. package/es/ProSelect/index.js +4 -2
  72. package/es/ProStep/components/Step/index.js +3 -1
  73. package/es/ProStep/style/index.less +0 -1
  74. package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
  75. package/es/ProTable/components/RenderColumn/index.js +41 -25
  76. package/es/ProTable/index.js +10 -8
  77. package/es/ProTable/propsType.d.ts +2 -0
  78. package/es/ProTable/style/index.less +14 -1
  79. package/es/ProTable/useAntdTable.d.ts +12 -4
  80. package/es/ProTable/useAntdTable.js +18 -6
  81. package/es/ProTable/utils.d.ts +1 -1
  82. package/es/ProTable/utils.js +258 -201
  83. package/es/ProTabs/style/index.less +1 -1
  84. package/es/ProThemeTools/component/PrdTools/index.js +1 -1
  85. package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
  86. package/es/ProThemeTools/index.d.ts +2 -2
  87. package/es/ProThemeTools/index.js +24 -17
  88. package/es/ProThemeTools/propsType.d.ts +8 -6
  89. package/es/ProThemeTools/style/index.less +2 -2
  90. package/es/ProThemeTools/utils/index.d.ts +7 -0
  91. package/es/ProThemeTools/utils/index.js +19 -1
  92. package/es/ProTree/components/ProTree.js +6 -5
  93. package/es/ProTree/components/SearchTitle.d.ts +2 -2
  94. package/es/ProTree/components/SearchTitle.js +11 -1
  95. package/es/ProTree/components/Tree.js +9 -2
  96. package/es/ProTree/style/index.less +193 -141
  97. package/es/ProTreeModal/components/List.js +0 -14
  98. package/es/ProTreeModal/components/Trigger.js +9 -3
  99. package/es/ProTreeModal/index.js +29 -13
  100. package/es/ProTreeModal/style/index.less +2 -6
  101. package/es/ProUpload/components/ButtonRender.js +5 -2
  102. package/es/ProUpload/components/DragRender.js +8 -8
  103. package/es/ProUpload/components/Example.js +3 -1
  104. package/es/ProUpload/components/ImageRender.js +8 -6
  105. package/es/ProUpload/index.js +8 -6
  106. package/es/ProUpload/style/index.less +41 -39
  107. package/es/index.d.ts +2 -1
  108. package/es/index.js +2 -1
  109. package/es/locale/en_US.d.ts +138 -0
  110. package/es/locale/en_US.js +137 -0
  111. package/es/locale/index.d.ts +13 -0
  112. package/es/locale/index.js +32 -0
  113. package/es/locale/zh_CN.d.ts +137 -0
  114. package/es/locale/zh_CN.js +136 -0
  115. package/es/old/ProEditableTable/style/index.less +1 -2
  116. package/es/style/components.less +0 -1
  117. package/es/style/core/normalize.less +1 -2
  118. package/es/style/theme/antd.less +3 -4
  119. package/es/style/theme/index.less +80 -79
  120. package/es/style/theme/tokens.less +1 -0
  121. package/lib/ProAction/index.js +7 -5
  122. package/lib/ProAction/index.less +3 -2
  123. package/lib/ProConfigProvider/index.d.ts +2 -0
  124. package/lib/ProConfigProvider/index.js +22 -2
  125. package/lib/ProDownload/utils.js +4 -3
  126. package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
  127. package/lib/ProDrawerForm/index.js +5 -3
  128. package/lib/ProDrawerForm/style/index.less +15 -11
  129. package/lib/ProEditLabel/style/index.less +2 -2
  130. package/lib/ProEditTable/components/ActionButton/index.js +3 -2
  131. package/lib/ProEditTable/components/RenderField/index.js +4 -1
  132. package/lib/ProEditTable/index.js +7 -6
  133. package/lib/ProEditTable/style/index.less +15 -8
  134. package/lib/ProEditTable/utils/config.d.ts +8 -8
  135. package/lib/ProEditTable/utils/config.js +20 -12
  136. package/lib/ProEditTable/utils/index.js +3 -2
  137. package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
  138. package/lib/ProEnum/index.js +9 -4
  139. package/lib/ProEnum/style/index.less +1 -1
  140. package/lib/ProForm/components/FormFooter/index.js +16 -19
  141. package/lib/ProForm/components/base/Input/index.js +4 -3
  142. package/lib/ProForm/components/base/InputNumber/index.js +4 -3
  143. package/lib/ProForm/components/base/RangePicker/index.js +1 -4
  144. package/lib/ProForm/components/base/Select/index.js +2 -1
  145. package/lib/ProForm/components/base/Switch/index.js +8 -5
  146. package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  147. package/lib/ProForm/components/base/TextArea/index.js +4 -2
  148. package/lib/ProForm/components/base/TextArea/index.less +1 -1
  149. package/lib/ProForm/components/combination/Container/style/index.less +0 -1
  150. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  151. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  152. package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
  153. package/lib/ProForm/components/combination/Group/index.js +2 -2
  154. package/lib/ProForm/components/combination/ProAddressBar/index.js +78 -60
  155. package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  156. package/lib/ProForm/components/combination/ProModalSelect/index.js +76 -15
  157. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  158. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  159. package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
  160. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  161. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  162. package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  163. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  164. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  165. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
  166. package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
  167. package/lib/ProForm/components/old/InputRange/index.js +0 -1
  168. package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
  169. package/lib/ProForm/components/render/Render.js +5 -2
  170. package/lib/ProForm/components/render/RenderFields.js +9 -5
  171. package/lib/ProForm/components/render/propsType.d.ts +5 -4
  172. package/lib/ProForm/index.js +14 -2
  173. package/lib/ProForm/style/index.less +77 -169
  174. package/lib/ProForm/utils/index.d.ts +1 -1
  175. package/lib/ProForm/utils/index.js +7 -2
  176. package/lib/ProForm/utils/rulesCreator.js +2 -1
  177. package/lib/ProForm/utils/useRules.js +4 -3
  178. package/lib/ProForm/utils/useShouldUpdate.js +16 -16
  179. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  180. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
  181. package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
  182. package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
  183. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  184. package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +3 -1
  185. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  186. package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  187. package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
  188. package/lib/ProLayout/components/ProHeader/index.js +9 -6
  189. package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
  190. package/lib/ProLayout/utils/index.js +1 -1
  191. package/lib/ProSelect/index.d.ts +3 -3
  192. package/lib/ProSelect/index.js +4 -2
  193. package/lib/ProStep/components/Step/index.js +3 -1
  194. package/lib/ProStep/style/index.less +0 -1
  195. package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
  196. package/lib/ProTable/components/RenderColumn/index.js +38 -24
  197. package/lib/ProTable/components/TableResizable/index.js +8 -0
  198. package/lib/ProTable/index.js +10 -8
  199. package/lib/ProTable/propsType.d.ts +2 -0
  200. package/lib/ProTable/style/index.less +14 -1
  201. package/lib/ProTable/useAntdTable.d.ts +12 -4
  202. package/lib/ProTable/useAntdTable.js +19 -6
  203. package/lib/ProTable/utils.d.ts +1 -1
  204. package/lib/ProTable/utils.js +258 -201
  205. package/lib/ProTabs/index.js +1 -0
  206. package/lib/ProTabs/style/index.less +1 -1
  207. package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
  208. package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
  209. package/lib/ProThemeTools/index.d.ts +2 -2
  210. package/lib/ProThemeTools/index.js +24 -16
  211. package/lib/ProThemeTools/propsType.d.ts +8 -6
  212. package/lib/ProThemeTools/style/index.less +2 -2
  213. package/lib/ProThemeTools/utils/index.d.ts +7 -0
  214. package/lib/ProThemeTools/utils/index.js +20 -2
  215. package/lib/ProTree/components/ProTree.js +6 -5
  216. package/lib/ProTree/components/SearchTitle.d.ts +2 -2
  217. package/lib/ProTree/components/SearchTitle.js +11 -1
  218. package/lib/ProTree/components/Tree.js +16 -2
  219. package/lib/ProTree/index.js +0 -1
  220. package/lib/ProTree/style/index.less +193 -141
  221. package/lib/ProTreeModal/components/List.js +0 -14
  222. package/lib/ProTreeModal/components/Tree.js +1 -0
  223. package/lib/ProTreeModal/components/Trigger.js +10 -3
  224. package/lib/ProTreeModal/index.js +29 -13
  225. package/lib/ProTreeModal/style/index.less +2 -6
  226. package/lib/ProUpload/components/ButtonRender.js +5 -2
  227. package/lib/ProUpload/components/DragRender.js +8 -8
  228. package/lib/ProUpload/components/Example.js +3 -1
  229. package/lib/ProUpload/components/ImageRender.js +8 -6
  230. package/lib/ProUpload/index.js +14 -5
  231. package/lib/ProUpload/style/index.less +41 -39
  232. package/lib/index.d.ts +2 -1
  233. package/lib/index.js +13 -1
  234. package/lib/locale/en_US.d.ts +138 -0
  235. package/lib/locale/en_US.js +143 -0
  236. package/lib/locale/index.d.ts +13 -0
  237. package/lib/locale/index.js +41 -0
  238. package/lib/locale/zh_CN.d.ts +137 -0
  239. package/lib/locale/zh_CN.js +142 -0
  240. package/lib/old/ProCertValidity/index.js +1 -1
  241. package/lib/old/ProEditableTable/style/index.less +1 -2
  242. package/lib/style/components.less +0 -1
  243. package/lib/style/core/normalize.less +1 -2
  244. package/lib/style/theme/antd.less +3 -4
  245. package/lib/style/theme/index.less +80 -79
  246. package/lib/style/theme/tokens.less +1 -0
  247. package/package.json +1 -1
  248. package/typings.d.ts +2 -0
  249. package/es/old/ProBackBtn/style/index.less +0 -19
  250. package/lib/old/ProBackBtn/style/index.less +0 -19
  251. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  252. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  253. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
  254. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  255. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  256. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
@@ -1,7 +1,7 @@
1
1
  .pro-enum-select {
2
2
  .close-icon {
3
3
  position : relative;
4
- margin-left : -31px;
4
+ margin-left : calc(0px - @zaui-space-size-lg);
5
5
  margin-right : var(--zaui-space-size-md, 14px);
6
6
  color : #FFFFFF;
7
7
  height: 12px;
@@ -16,7 +16,6 @@
16
16
 
17
17
  > span {
18
18
  position : relative;
19
- font-size : 8px;
20
19
  border : none;
21
20
  border-radius : 50%;
22
21
 
@@ -45,7 +44,7 @@
45
44
  .ant-table-thead>tr>th {
46
45
  border : 0;
47
46
  white-space : nowrap;
48
- background-color: #F6F7F8;
47
+ background-color: @zaui-table-header-bg;
49
48
  }
50
49
 
51
50
  .ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
@@ -69,7 +68,7 @@
69
68
  }
70
69
 
71
70
  .ant-table-tbody tr:nth-child(2n)>td {
72
- background-color: #FAFAFA;
71
+ background-color: @zaui-table-strip-bg;
73
72
  }
74
73
 
75
74
  .ant-table-tbody>.ant-table-placeholder>td {
@@ -81,7 +80,7 @@
81
80
  >tr:hover:not(.ant-table-expanded-row, .ant-table-placeholder)>td,
82
81
  .ant-table-row-hover,
83
82
  .ant-table-row-hover>td {
84
- background: #FAFAFA;
83
+ background: @zaui-table-hover-bg;
85
84
  }
86
85
  }
87
86
 
@@ -89,13 +88,13 @@
89
88
 
90
89
  .ant-table-row-hover,
91
90
  .ant-table-row-hover>td {
92
- background: #FAFAFA;
91
+ background: @zaui-table-hover-bg;
93
92
  }
94
93
  }
95
94
 
96
95
  .ant-table-fixed-header {
97
96
  .ant-table-tbody tr:nth-child(n)>td {
98
- background-color: #FAFAFA;
97
+ background-color: @zaui-table-strip-bg;
99
98
  }
100
99
 
101
100
  .ant-table-tbody tr:nth-child(2n)>td {
@@ -108,7 +107,7 @@
108
107
  }
109
108
 
110
109
  .ant-modal-footer {
111
- padding: 16px;
110
+ padding: @zaui-space-size-md;
112
111
  }
113
112
 
114
113
  }
@@ -22,6 +22,7 @@ import { ReactSVG } from 'react-svg';
22
22
  import { isFunction, isString, omit } from 'lodash';
23
23
  import useShouldUpdate from '../../utils/useShouldUpdate';
24
24
  import { isTrim, isUpperCase, findOptionByValue } from '../../utils/index';
25
+ import { useProConfig } from '../../../ProConfigProvider';
25
26
  import transformNames from '../../utils/transformNames';
26
27
  import valueTypeMap from '../../utils/valueType';
27
28
  import { useChanged } from '../../utils/useChanged';
@@ -138,7 +139,8 @@ var Render = function Render(props) {
138
139
  required: labelRequired || _required
139
140
  } : null, otherProps.isView && !requiredOnView ? {
140
141
  required: false
141
- } : null, _objectSpread({}, isTrim(type, trim)), _objectSpread({}, isUpperCase(type, upperCase)), {
142
+ } : null, _objectSpread({}, isTrim(type, trim, useProConfig())), // 优先取传进来的,其次取ProConfigProvider配置的
143
+ _objectSpread({}, isUpperCase(type, upperCase)), {
142
144
  validateFirst: true
143
145
  });
144
146
  // 添加label宽度
@@ -157,7 +159,7 @@ var Render = function Render(props) {
157
159
  var lastComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), _fieldProps), {}, {
158
160
  disabled: lastDisabled
159
161
  });
160
- var _className = classNames((_classNames = {}, _defineProperty(_classNames, className, className), _defineProperty(_classNames, 'pro-form-item-changed', changed), _classNames));
162
+ var _className = classNames((_classNames = {}, _defineProperty(_classNames, className, className), _defineProperty(_classNames, 'pro-form-item-changed', changed), _defineProperty(_classNames, 'pro-form-item-width-auto', ['Switch'].includes(type)), _classNames));
161
163
  if (formItemProps.hidden === true || _show === false) {
162
164
  // 为了监听shouldUpdate 必须存在一个FormItem, 空Input解决 【[antd: Form.Item] `name` is only used for validate React element】
163
165
  return _jsx(_Form.Item, {
@@ -3,11 +3,12 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "disabled", "equalWith", "clearNotShow", "required"];
4
4
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
5
5
  import React from 'react';
6
- import { isFunction, union } from 'lodash';
6
+ import { isBoolean, isFunction, union } from 'lodash';
7
7
  import Render from './Render';
8
8
  import * as componentMap from '../index';
9
9
  import { isSelect } from '../../utils';
10
10
  import { FieldProvider } from '../../utils/useFieldProps';
11
+ import locale from '../../../locale';
11
12
  var RenderFields = function RenderFields(props) {
12
13
  var isView = props.isView,
13
14
  _props$columns = props.columns,
@@ -108,6 +109,7 @@ var RenderFields = function RenderFields(props) {
108
109
  }
109
110
  if (component && /*#__PURE__*/React.isValidElement(component)) {
110
111
  var _newComponent$props;
112
+ _type = null;
111
113
  var newComponent = component;
112
114
  var isProEditTable = (newComponent === null || newComponent === void 0 ? void 0 : (_newComponent$props = newComponent.props) === null || _newComponent$props === void 0 ? void 0 : _newComponent$props.onlyOneLineMsg) === '请先保存数据';
113
115
  TargetComponent = _isView ? viewRenderHandle || '' : component;
@@ -127,16 +129,14 @@ var RenderFields = function RenderFields(props) {
127
129
  dataSource: dataSource,
128
130
  type: _type
129
131
  });
130
- var _placeholder = placeholder || "".concat(_isSelect ? '请选择' : '请输入').concat(label || formLabel || '');
132
+ var _placeholder = placeholder || "".concat(_isSelect ? "".concat(locale.ProForm.selectPlaceHolder) : "".concat(locale.ProForm.inputPlaceholder)).concat(label || formLabel || '');
131
133
  // 表单组件Props 兼容2.0版本
132
134
  var _fieldProps = _objectSpread(_objectSpread({
133
135
  disabled: disabled
134
136
  }, formItemChildProps), fieldProps);
135
- if (formDisabled) {
137
+ if (isBoolean(formDisabled)) {
136
138
  _fieldProps.disabled = formDisabled;
137
- // _disabled = formDisabled;
138
139
  }
139
-
140
140
  var componentProps = _objectSpread({
141
141
  disabled: _disabled,
142
142
  placeholder: _placeholder,
@@ -146,6 +146,10 @@ var RenderFields = function RenderFields(props) {
146
146
  if (['Switch', 'SwitchCheckbox'].includes(_type)) {
147
147
  _formItemProps.valuePropName = 'checked';
148
148
  }
149
+ // 时间范围placeholder处理
150
+ if (['RangePicker'].includes(_type) && !(fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.placeholder)) {
151
+ delete componentProps.placeholder;
152
+ }
149
153
  // 没有找到对应组件 不渲染
150
154
  if (!TargetComponent) {
151
155
  return [];
@@ -176,7 +180,7 @@ var RenderFields = function RenderFields(props) {
176
180
  value: otherProps,
177
181
  children: _jsx(Render, {
178
182
  show: show,
179
- disabled: formDisabled,
183
+ disabled: Boolean(formDisabled),
180
184
  form: form,
181
185
  type: _type,
182
186
  originComponent: component,
@@ -21,7 +21,8 @@ import { AddressProps } from '../combination/ProAddressBar/propsType';
21
21
  import { ProCombinationProps } from '../combination/ProCombination/propsType';
22
22
  import { ProModalSelectPropsType as ProModalSelectProps } from '../combination/ProModalSelect/propsType';
23
23
  import { ProNumberRangeProps } from '../combination/ProNumberRange/propsType';
24
- import { Props as ProTimeLimitProps } from '../combination/ProTimeLimit';
24
+ import { ProLimitProps } from '../combination/ProTimeLimit';
25
+ import { Props as ProRangeLimitProps } from '../combination/ProRangeLimit';
25
26
  import { CheckboxPropsMap, ProEnum, PropProSelectsMap, PropRadioPropsMap } from '../../../ProEnum/propsType';
26
27
  import { PropSelectProps as ProSelectProps } from '../../../ProSelect/propsType';
27
28
  import { ProEditTableProps } from '../../../ProEditTable/propsType';
@@ -57,7 +58,7 @@ type FunctionArgs<Values> = (value: any, record: any, { form, index, namePath, o
57
58
  namePath?: NamePath;
58
59
  [key: string]: any;
59
60
  }) => any;
60
- type TransformToFormField<T extends ControlProps, Values> = Omit<T, 'onChange' | 'value'> & {
61
+ type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T, 'onChange' | 'value'> & {
61
62
  value?: T['value'];
62
63
  onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], form: FormInstance<Values>) => void;
63
64
  onFieldChange?: FunctionArgs<Values>;
@@ -135,10 +136,10 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
135
136
  fieldProps?: FieldProps<ProNumberRangeProps, Values, T>;
136
137
  } | {
137
138
  type?: 'ProRangeLimit';
138
- fieldProps?: FieldProps<ProNumberRangeProps, Values, T>;
139
+ fieldProps?: FieldProps<ProRangeLimitProps, Values, T>;
139
140
  } | {
140
141
  type?: 'ProTimeLimit';
141
- fieldProps?: FieldProps<ProTimeLimitProps, Values, T>;
142
+ fieldProps?: FieldProps<ProLimitProps, Values, T>;
142
143
  } | {
143
144
  type?: 'ProEnum';
144
145
  fieldProps?: ProEnumFieldProps<Values, T>;
@@ -24,7 +24,9 @@ import { useProConfig } from '../ProConfigProvider';
24
24
  import { getLayout, splitNameStr, useControlled, initialValuesToNames } from './utils/index';
25
25
  import { useForm } from './utils/useForm';
26
26
  import { useFieldProps } from './utils/useFieldProps';
27
+ import locale from '../locale';
27
28
  var ProForm = function ProForm(props, ref) {
29
+ var _localStorage;
28
30
  var _props$mode = props.mode,
29
31
  mode = _props$mode === void 0 ? 'search' : _props$mode,
30
32
  span = props.span,
@@ -98,12 +100,12 @@ var ProForm = function ProForm(props, ref) {
98
100
  onClick: expandHandle,
99
101
  children: !openState ? _jsxs(_Space, {
100
102
  align: "center",
101
- children: ["\u5C55\u5F00", _jsx(DoubleLeftOutlined, {
103
+ children: [locale.ProForm.unfold, _jsx(DoubleLeftOutlined, {
102
104
  className: "rotate-to-bottom"
103
105
  })]
104
106
  }) : _jsxs(_Space, {
105
107
  align: "center",
106
- children: ["\u6536\u8D77", _jsx(DoubleLeftOutlined, {
108
+ children: [locale.ProForm.packUp, _jsx(DoubleLeftOutlined, {
107
109
  className: "rotate-to-top"
108
110
  })]
109
111
  })
@@ -179,6 +181,16 @@ var ProForm = function ProForm(props, ref) {
179
181
  })
180
182
  })) : null;
181
183
  };
184
+ // 国际化,非中文时默认上下布局
185
+ if (((_localStorage = localStorage) === null || _localStorage === void 0 ? void 0 : _localStorage.locale) && localStorage.locale !== 'zh-CN') {
186
+ // 一行布局时,左右布局
187
+ if (span === 24) {
188
+ otherProps.layout = otherProps.layout || 'horizontal';
189
+ } else {
190
+ // 其他布局时,上下布局
191
+ otherProps.layout = otherProps.layout || 'vertical';
192
+ }
193
+ }
182
194
  return _jsx(_Form, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
183
195
  onKeyPress: function onKeyPress(event) {
184
196
  if (!submitOnEnter) return;
@@ -11,6 +11,28 @@
11
11
  @import '../components/old/EnumSelect/style/index.less';
12
12
 
13
13
  .pro-form {
14
+ &.ant-form-vertical {
15
+ .ant-form-item .ant-form-item-label {
16
+ flex: none !important;
17
+ }
18
+
19
+ .pro-form-custom-footer {
20
+ display : flex;
21
+ align-items : center;
22
+ margin-bottom: 0;
23
+ height : auto;
24
+ padding-top : 6px;
25
+
26
+ .ant-space-align-center {
27
+ align-items: normal;
28
+ }
29
+ }
30
+ }
31
+
32
+ &.ant-form {
33
+ margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
34
+ }
35
+
14
36
  .pro-collapse-level2 {
15
37
  .ant-collapse-item {
16
38
  margin-bottom: 0 !important;
@@ -23,17 +45,17 @@
23
45
  }
24
46
 
25
47
  span.ant-input-clear-icon {
26
- display: unset;
48
+ display : unset;
27
49
  visibility: hidden;
28
50
  }
29
51
 
30
52
  .ant-input-affix-wrapper:hover span.ant-input-clear-icon {
31
- display: unset;
53
+ display : unset;
32
54
  visibility: unset;
33
55
  }
34
56
 
35
57
  .ant-input-affix-wrapper:hover span.ant-input-clear-icon[class~='ant-input-clear-icon-hidden'] {
36
- display: unset;
58
+ display : unset;
37
59
  visibility: hidden;
38
60
  }
39
61
 
@@ -67,8 +89,8 @@
67
89
 
68
90
  // 展开折叠按钮
69
91
  .expand-button {
70
- line-height: 32px;
71
- cursor: pointer;
92
+ line-height: @zaui-space-card;
93
+ cursor : pointer;
72
94
 
73
95
  .rotate-to-top {
74
96
  transform: rotate(90deg);
@@ -80,40 +102,39 @@
80
102
  }
81
103
 
82
104
  .ant-form-item {
83
- margin-bottom: 22px !important;
105
+ margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1)) !important;
106
+
107
+ &.pro-form-item-width-auto {
108
+ .ant-form-item-control-input {
109
+ flex-grow: inherit;
110
+ }
111
+
112
+ .ant-form-item-control-input-content {
113
+ flex: initial;
114
+ }
115
+ }
84
116
 
85
117
  .ant-form-item-tooltip {
86
118
  svg {
87
- width: 14px;
88
- height: 14px;
119
+ width : 14px;
120
+ height : 14px;
89
121
  vertical-align: bottom;
90
- fill: #909090;
122
+ fill : @zaui-aide-text;
91
123
  }
92
124
  }
93
125
 
94
126
  // 比较原始值场景下 不同时候的样式
95
127
  &.pro-form-item-changed {
128
+
96
129
  span.ant-input-affix-wrapper,
97
130
  .ant-select-selector,
98
131
  .ant-picker {
99
- background: #fffaa1;
132
+ background: @zaui-contract-bg;
100
133
 
101
134
  input {
102
- background: #fffaa1;
135
+ background: @zaui-contract-bg;
103
136
  }
104
137
  }
105
-
106
- #switch {
107
- background: #bfbfbf;
108
- }
109
- }
110
-
111
- // 自定义label宽度场景
112
- &.label-width {
113
- .ant-form-item-label {
114
- width: auto !important;
115
- max-width: fit-content !important;
116
- }
117
138
  }
118
139
 
119
140
  .ant-row {
@@ -147,9 +168,9 @@
147
168
  }
148
169
 
149
170
  .range-right {
150
- width: 100%;
151
- border: 1px solid #d9d9d9;
152
- border-top-left-radius: 0;
171
+ width : 100%;
172
+ border : 1px solid @zaui-form-control-line;
173
+ border-top-left-radius : 0;
153
174
  border-bottom-left-radius: 0;
154
175
  }
155
176
  }
@@ -160,149 +181,36 @@
160
181
  display: none;
161
182
  }
162
183
 
163
- // 查看模式
164
- &.mode-view {
165
- // 查看模式样式覆盖
166
- .ant-input[disabled] {
167
- .noDisabled();
168
- }
169
-
170
- .ant-input-disabled {
171
- .noDisabled();
172
- }
173
-
174
- .ant-picker.ant-picker-disabled {
175
- .noDisabled();
176
- }
177
-
178
- .ant-picker-input > input[disabled] {
179
- .noDisabled();
180
- }
181
-
182
- .ant-picker-suffix {
183
- display: none;
184
- }
185
-
186
- .ant-input-textarea.ant-input-textarea-show-count::after {
187
- display: none;
188
- }
189
-
190
- .ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector {
191
- .noDisabled();
192
- }
193
-
194
- .ant-select-arrow {
195
- display: none;
196
- }
197
-
198
- .ant-upload.ant-upload-disabled {
199
- display: none;
200
- }
201
-
202
- .ant-switch-loading,
203
- .ant-switch-disabled {
204
- .ant-switch-inner {
205
- .noDisabled();
206
- }
207
-
208
- .ant-switch-handle {
209
- display: none;
210
- }
211
-
212
- background-color: #fff;
213
- cursor: default;
214
- opacity: 1;
215
- }
216
-
217
- .ant-radio-wrapper.ant-radio-wrapper-checked.ant-radio-wrapper-disabled {
218
- display: block;
219
-
220
- .ant-radio.ant-radio-checked.ant-radio-disabled {
221
- display: none;
222
- }
223
-
224
- > span {
225
- .noDisabled();
226
- position: relative;
227
- top: -3px;
228
- }
229
- }
230
-
231
- .ant-radio-wrapper.ant-radio-wrapper-disabled {
232
- display: none;
233
- }
234
-
235
- .ant-checkbox-wrapper.ant-checkbox-wrapper-checked.ant-checkbox-wrapper-disabled {
236
- display: block;
237
-
238
- .ant-checkbox.ant-checkbox-checked.ant-checkbox-disabled {
239
- display: none;
240
- }
241
-
242
- > span {
243
- .noDisabled();
244
- position: relative;
245
- top: -3px;
246
- }
247
- }
248
-
249
- .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled {
250
- display: none;
251
- }
252
-
253
- .ant-form-item-has-error {
254
- .ant-form-item-explain.ant-form-item-explain-error {
255
- display: none;
256
- }
257
- }
258
-
259
- ::placeholder {
260
- font-size: 0px;
261
- }
262
-
263
- .ant-input-affix-wrapper-disabled {
264
- background-color: transparent;
265
- border: none;
266
- }
267
-
268
- .ant-select-selection-placeholder {
269
- display: none;
270
- }
271
-
272
- .ant-input-suffix {
273
- display: none;
274
- }
275
- }
276
-
277
184
  .ant-form-item-label {
278
- > label {
185
+ >label {
279
186
  white-space: pre-wrap;
280
187
  }
281
188
  }
282
189
 
283
190
  .suffix-value {
284
- margin-left: 8px;
191
+ margin-left: @zaui-space-size-sm;
285
192
  }
286
193
 
287
194
  .ant-form-item-has-error {
288
195
  .group-separator {
289
- color: var(--ant-error-color);
196
+ color : var(--ant-error-color);
290
197
  border-color: var(--ant-error-color);
291
198
  }
292
199
 
293
200
  .site-input-split {
294
- border-color: #ff4d4f;
201
+ border-color: @zaui-danger;
295
202
  }
296
203
  }
297
204
 
298
205
  .site-input-group-wrapper {
206
+
299
207
  // 范围值表单样式
300
208
  & .site-input-split {
301
- text-align: center;
302
- background-color: #fafafa;
209
+ text-align : center;
210
+ background-color: @zaui-table-strip-bg;
303
211
 
304
212
  &.site-input-split-disabled {
305
- background-color: #f2f2f2;
213
+ background-color: @zaui-disabled-bg;
306
214
  }
307
215
  }
308
216
 
@@ -344,33 +252,33 @@
344
252
  }
345
253
  }
346
254
 
347
- &.ant-input-group.ant-input-group-compact > *:not(:last-child) {
255
+ &.ant-input-group.ant-input-group-compact>*:not(:last-child) {
348
256
  margin-right: 0;
349
257
  }
350
258
 
351
- > *:first-child {
352
- border-top-right-radius: 0 !important;
259
+ >*:first-child {
260
+ border-top-right-radius : 0 !important;
353
261
  border-bottom-right-radius: 0 !important;
354
262
 
355
- > .ant-select-selector {
356
- border-top-right-radius: 0 !important;
263
+ >.ant-select-selector {
264
+ border-top-right-radius : 0 !important;
357
265
  border-bottom-right-radius: 0 !important;
358
266
  }
359
267
  }
360
268
 
361
- > *:last-child {
362
- border-top-left-radius: 0 !important;
269
+ >*:last-child {
270
+ border-top-left-radius : 0 !important;
363
271
  border-bottom-left-radius: 0 !important;
364
272
 
365
- > .ant-select-selector {
366
- border-top-left-radius: 0 !important;
273
+ >.ant-select-selector {
274
+ border-top-left-radius : 0 !important;
367
275
  border-bottom-left-radius: 0 !important;
368
276
  }
369
277
  }
370
278
  }
371
279
 
372
- .ant-input-group.ant-input-group-compact > * {
373
- float: none;
280
+ .ant-input-group.ant-input-group-compact>* {
281
+ float : none;
374
282
  vertical-align: top;
375
283
  }
376
284
 
@@ -379,17 +287,17 @@
379
287
  }
380
288
 
381
289
  .noDisabled {
382
- color: #333;
383
- font-size: 14px;
290
+ color : @zaui-disabled-text;
291
+ font-size : var(--zaui-font-size, 14px);
384
292
  background-color: transparent;
385
- border: none;
386
- cursor: default;
387
- opacity: 1;
293
+ border : none;
294
+ cursor : default;
295
+ opacity : 1;
388
296
  }
389
297
 
390
298
  div.pro-form-custom-footer {
391
- width: unset !important;
392
- height: 32px;
299
+ width : unset !important;
300
+ height : @zaui-space-card;
393
301
  margin-bottom: calc(var(--zaui-height-size-md, 16px) * var(--zaui-size, 1));
394
302
 
395
303
  &.pro-form-custom-footer-hidden {
@@ -398,14 +306,14 @@
398
306
  }
399
307
 
400
308
  .pro-form-view-container {
401
- display: inline-block;
402
- color: var(--zaui-text, #343434);
309
+ display : inline-block;
310
+ color : var(--zaui-text, #343434);
403
311
  word-break: break-all;
404
312
  }
405
313
 
406
314
  .pro-form-view-container_nowrap {
407
- overflow: hidden;
408
- white-space: nowrap;
315
+ overflow : hidden;
316
+ white-space : nowrap;
409
317
  text-overflow: ellipsis;
410
318
  }
411
319
 
@@ -17,7 +17,7 @@ export declare const isSelect: (props: any) => any;
17
17
  * @param trim 是否移除前后空格
18
18
  * @returns {}
19
19
  */
20
- export declare const isTrim: (type: string, trim: boolean) => any;
20
+ export declare const isTrim: (type: string, trim: boolean, configData: any) => any;
21
21
  /**
22
22
  * Input TextArea 小写自动转大写
23
23
  * @param type 组件类型
@@ -62,9 +62,14 @@ export var isSelect = function isSelect(props) {
62
62
  * @param trim 是否移除前后空格
63
63
  * @returns {}
64
64
  */
65
- export var isTrim = function isTrim(type, trim) {
65
+ export var isTrim = function isTrim(type, trim, configData) {
66
+ var _state$type;
66
67
  var result = {};
67
- if (['Input', 'TextArea', 'ProCombination'].includes(type) && trim) {
68
+ var _ref = configData || {},
69
+ _ref$state = _ref.state,
70
+ state = _ref$state === void 0 ? {} : _ref$state;
71
+ var _trim = trim || (state === null || state === void 0 ? void 0 : (_state$type = state[type]) === null || _state$type === void 0 ? void 0 : _state$type.trim);
72
+ if (['Input', 'TextArea', 'ProCombination'].includes(type) && _trim) {
68
73
  result.getValueFromEvent = function (event) {
69
74
  var _event$target$value;
70
75
  if (Array.isArray(event)) {
@@ -1,9 +1,10 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { validate, regExp } from '@zat-design/utils';
3
3
  import { isNullValue } from './index';
4
+ import locale from '../../locale';
4
5
  export var rulesCreator = function rulesCreator(rules, label, isSelect) {
5
6
  var _result;
6
- var message = "".concat(isSelect ? '请选择' : '请输入', "\u6B63\u786E\u7684").concat(label || '');
7
+ var message = "".concat(isSelect ? "".concat(locale.ProForm.selectPlaceHolder) : "".concat(locale.ProForm.inputPlaceholder)).concat(locale.ProForm.ruleText).concat(label || '');
7
8
  var result = [];
8
9
  result = rules.map(function (ruleItem) {
9
10
  var rule = _objectSpread({}, ruleItem);
@@ -3,6 +3,7 @@ import { useEffect, useMemo } from 'react';
3
3
  import { isBoolean } from 'lodash';
4
4
  import { rulesCreator } from './rulesCreator';
5
5
  import { isNotFullArray, isNullArray } from './index';
6
+ import locale from '../../locale';
6
7
  var useRules = function useRules(props) {
7
8
  var rules = props.rules,
8
9
  required = props.required,
@@ -21,7 +22,7 @@ var useRules = function useRules(props) {
21
22
  return 'required' in rule;
22
23
  }));
23
24
  if (!requiredRule) {
24
- var message = isSelect ? "\u8BF7\u9009\u62E9".concat(label || '') : "\u8BF7\u8F93\u5165".concat(label || '');
25
+ var message = isSelect ? "".concat(locale.ProForm.selectPlaceHolder).concat(label || '') : "".concat(locale.ProForm.inputPlaceholder).concat(label || '');
25
26
  var rule = {
26
27
  required: required,
27
28
  message: message
@@ -30,7 +31,7 @@ var useRules = function useRules(props) {
30
31
  if (names === null || names === void 0 ? void 0 : names.length) {
31
32
  rule.validator = function (_, value) {
32
33
  if (!value || isNullArray(value)) {
33
- return Promise.reject(new Error("\u8BF7\u586B\u5199".concat(label)));
34
+ return Promise.reject(new Error("".concat(locale.ProForm.inputPlaceholder).concat(label)));
34
35
  }
35
36
  return Promise.resolve();
36
37
  };
@@ -49,7 +50,7 @@ var useRules = function useRules(props) {
49
50
  validator: function validator(rules, value) {
50
51
  // 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
51
52
  if (Array.isArray(value) && !isNullArray(value) && isNotFullArray(value, names.length)) {
52
- return Promise.reject(new Error("\u8BF7\u5B8C\u6574\u586B\u5199".concat(label || '')));
53
+ return Promise.reject(new Error("".concat(locale.ProForm.completeText).concat(label || '')));
53
54
  }
54
55
  return Promise.resolve();
55
56
  }