@zat-design/sisyphus-react 3.1.5 → 3.2.0

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 -250
  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 +2 -2
  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 +2 -2
  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,9 +1,9 @@
1
1
  import "antd/es/input/style";
2
2
  import _Input from "antd/es/input";
3
- import "antd/es/tooltip/style";
4
- import _Tooltip from "antd/es/tooltip";
5
3
  import "antd/es/cascader/style";
6
4
  import _Cascader from "antd/es/cascader";
5
+ import "antd/es/tooltip/style";
6
+ import _Tooltip from "antd/es/tooltip";
7
7
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
8
8
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
@@ -11,14 +11,18 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
11
11
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
12
12
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
13
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
14
- var _excluded = ["getPopupContainer", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator"];
15
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import "antd/es/typography/style";
15
+ import _Typography from "antd/es/typography";
16
+ var _excluded = ["className", "getPopupContainer", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator"];
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
18
  import { useEffect, useState, memo, useMemo } from 'react';
17
19
  import { useSetState } from 'ahooks';
18
20
  import { tools } from '@zat-design/utils';
19
21
  import { useProConfig } from '../../../../ProConfigProvider';
20
22
  import useEnum from '../../../../ProEnum/hooks/useEnum';
23
+ import locale from '../../../../locale';
21
24
  var transformDataName = tools.transformDataName;
25
+ var Text = _Typography.Text;
22
26
  var filterDataSource = function filterDataSource(dataSource, level) {
23
27
  return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
24
28
  return _objectSpread(_objectSpread({}, item), {}, {
@@ -44,7 +48,7 @@ var levelMap = {
44
48
  3: 'county'
45
49
  };
46
50
  var ProAddressBar = function ProAddressBar(props) {
47
- var _otherProps$otherProp, _ref11, _ref11$filter;
51
+ var _otherProps$otherProp, _ref11, _ref11$filter, _locale$ProAddressBar, _locale$ProAddressBar2, _locale$ProAddressBar3;
48
52
  var _ref = useProConfig('ProAddressBar') || {},
49
53
  configUseRequest = _ref.useRequest,
50
54
  configTransformResponse = _ref.transformResponse,
@@ -53,8 +57,8 @@ var ProAddressBar = function ProAddressBar(props) {
53
57
  configFieldNames = _ref.fieldNames,
54
58
  configEnumCode = _ref.enumCode,
55
59
  configCode = _ref.code;
56
- // console.count('地址组件渲染次数');
57
- var getPopupContainer = props.getPopupContainer,
60
+ var className = props.className,
61
+ getPopupContainer = props.getPopupContainer,
58
62
  _props$hasDetail = props.hasDetail,
59
63
  hasDetail = _props$hasDetail === void 0 ? true : _props$hasDetail,
60
64
  _props$detailMaxLengt = props.detailMaxLength,
@@ -171,7 +175,7 @@ var ProAddressBar = function ProAddressBar(props) {
171
175
  transFormData = transformDataName(newData, {
172
176
  label: fieldNames.label,
173
177
  value: fieldNames.value,
174
- children: 'children'
178
+ children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
175
179
  });
176
180
  setServiceData(realLevel === 2 ? filterDataSource(transFormData, level) : transFormData);
177
181
  }
@@ -265,19 +269,19 @@ var ProAddressBar = function ProAddressBar(props) {
265
269
  }, [service]);
266
270
  useEffect(function () {
267
271
  // 传入useRequest时初始化province展示
268
- if (service && !fetched && province) {
272
+ if (service && loadData && !fetched && province) {
269
273
  initAddressLabel('province', province, provinceOptions);
270
274
  }
271
275
  }, [province, fetched, provinceOptions]);
272
276
  useEffect(function () {
273
277
  // 传入useRequest时初始化city展示
274
- if (service && !fetched && province && city) {
278
+ if (service && loadData && !fetched && province && city) {
275
279
  initAddressLabel('city', city, _defineProperty({}, parentKey, province));
276
280
  }
277
281
  }, [province, city, fetched]);
278
282
  useEffect(function () {
279
283
  // 传入useRequest时初始化county展示
280
- if (service && !fetched && city && county) {
284
+ if (service && loadData && !fetched && city && county) {
281
285
  initAddressLabel('county', county, _defineProperty({}, parentKey, city));
282
286
  }
283
287
  }, [city, county, fetched]);
@@ -287,6 +291,12 @@ var ProAddressBar = function ProAddressBar(props) {
287
291
  setDefaultLabel(getAddressLabel(realDataSource, value));
288
292
  }
289
293
  }, [realIsView, value, realDataSource]);
294
+ useEffect(function () {
295
+ // 传入useRequest但loadData为fasle查看时初始化展示
296
+ if (realIsView && value && (serviceData === null || serviceData === void 0 ? void 0 : serviceData.length) > 0) {
297
+ setDefaultLabel(getAddressLabel(serviceData, value));
298
+ }
299
+ }, [realIsView, value, serviceData]);
290
300
  var handleLoadData = /*#__PURE__*/function () {
291
301
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(selectedOptions) {
292
302
  var targetOption, data;
@@ -320,14 +330,14 @@ var ProAddressBar = function ProAddressBar(props) {
320
330
  return _ref10.apply(this, arguments);
321
331
  };
322
332
  }();
323
- var handleChange = function handleChange(changeValue) {
333
+ var handleChange = function handleChange(changeValue, selectedOptions) {
324
334
  if (onChange) {
325
335
  if (hasDetail && address) {
326
336
  var realValue = changeValue || [];
327
337
  realValue[realLevel] = address;
328
- onChange(realValue);
338
+ onChange(realValue, selectedOptions);
329
339
  } else {
330
- onChange(changeValue);
340
+ onChange(changeValue, selectedOptions);
331
341
  }
332
342
  }
333
343
  };
@@ -362,56 +372,66 @@ var ProAddressBar = function ProAddressBar(props) {
362
372
  var viewValue = ((_ref11 = [provinceLabel, cityLabel, countyLabel, value === null || value === void 0 ? void 0 : value[realLevel]]) === null || _ref11 === void 0 ? void 0 : (_ref11$filter = _ref11.filter(function (item) {
363
373
  return !!item;
364
374
  })) === null || _ref11$filter === void 0 ? void 0 : _ref11$filter.join(separator)) || '-';
365
- return _jsx("div", {
366
- className: "pro-address",
367
- children: realIsView ? viewValue : _jsxs(_Fragment, {
368
- children: [dataSource || addressCode || !loadData ? _jsx(_Cascader, {
369
- className: hasDetail ? '' : 'no-detail',
370
- placeholder: "\u8BF7\u9009\u62E9",
371
- value: addressValue,
372
- options: !loadData ? serviceData : realDataSource,
373
- disabled: disabled,
374
- displayRender: function displayRender(label) {
375
- return label === null || label === void 0 ? void 0 : label.filter(function (item) {
376
- return !!item;
377
- }).join('/');
378
- },
379
- showSearch: {
380
- filter: handlefilter
381
- },
382
- onChange: handleChange
383
- }) : _jsx(_Cascader, {
384
- className: hasDetail ? '' : 'no-detail',
385
- placeholder: "\u8BF7\u9009\u62E9",
386
- value: addressValue,
387
- loadData: handleLoadData,
388
- // @ts-ignore
389
- options: provinces,
390
- disabled: disabled,
391
- displayRender: displayRender,
392
- changeOnSelect: true,
393
- // @ts-ignore
394
- onChange: handleChange
395
- }), hasDetail && (tooltip && disabled && address ? _jsx(_Tooltip, {
396
- title: address,
397
- children: _jsx("span", {
398
- className: "pro-address-detail",
399
- children: _jsx(_Input, {
400
- disabled: disabled,
401
- value: address
402
- })
403
- })
404
- }) : _jsx(_Input, {
405
- allowClear: true,
406
- autoComplete: "off",
407
- disabled: disabled,
408
- value: address,
409
- maxLength: detailMaxLength,
410
- placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740",
411
- // @ts-ignore
412
- onChange: handleAddressChange
413
- }))]
375
+ return realIsView ? tooltip ? _jsx(_Tooltip, {
376
+ className: className,
377
+ title: tooltip === true ? viewValue : tooltip,
378
+ children: _jsx(Text, {
379
+ ellipsis: {
380
+ tooltip: false
381
+ },
382
+ children: viewValue
414
383
  })
384
+ }) : _jsx("span", {
385
+ className: className,
386
+ children: viewValue
387
+ }) : _jsxs("div", {
388
+ className: "pro-address ".concat(className),
389
+ children: [dataSource || addressCode || !loadData ? _jsx(_Cascader, {
390
+ className: hasDetail ? '' : 'no-detail',
391
+ placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar = locale.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
392
+ value: addressValue,
393
+ options: !loadData ? serviceData : realDataSource,
394
+ disabled: disabled,
395
+ displayRender: function displayRender(label) {
396
+ return label === null || label === void 0 ? void 0 : label.filter(function (item) {
397
+ return !!item;
398
+ }).join('/');
399
+ },
400
+ showSearch: {
401
+ filter: handlefilter
402
+ },
403
+ onChange: handleChange
404
+ }) : _jsx(_Cascader, {
405
+ className: hasDetail ? '' : 'no-detail',
406
+ placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar2 = locale.ProAddressBar) === null || _locale$ProAddressBar2 === void 0 ? void 0 : _locale$ProAddressBar2.placeholder,
407
+ value: addressValue,
408
+ loadData: handleLoadData,
409
+ // @ts-ignore
410
+ options: provinces,
411
+ disabled: disabled,
412
+ displayRender: displayRender,
413
+ changeOnSelect: true,
414
+ // @ts-ignore
415
+ onChange: handleChange
416
+ }), hasDetail && (tooltip && disabled && address ? _jsx(_Tooltip, {
417
+ title: address,
418
+ children: _jsx("span", {
419
+ className: "pro-address-detail",
420
+ children: _jsx(_Input, {
421
+ disabled: disabled,
422
+ value: address
423
+ })
424
+ })
425
+ }) : _jsx(_Input, {
426
+ allowClear: true,
427
+ autoComplete: "off",
428
+ disabled: disabled,
429
+ value: address,
430
+ maxLength: detailMaxLength,
431
+ placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar3 = locale.ProAddressBar) === null || _locale$ProAddressBar3 === void 0 ? void 0 : _locale$ProAddressBar3.detailPlaceholder,
432
+ // @ts-ignore
433
+ onChange: handleAddressChange
434
+ }))]
415
435
  });
416
436
  };
417
437
  // @ts-ignore
@@ -3,11 +3,12 @@ import { DefaultOptionType } from 'rc-select/lib/Select';
3
3
  import { Service } from 'ahooks/lib/useRequest/src/types';
4
4
  export interface AddressProps {
5
5
  getPopupContainer?: () => ReactNode;
6
+ className?: string;
6
7
  isView?: boolean;
7
8
  value?: string[];
8
9
  disabled?: boolean;
9
10
  hasDetail?: boolean;
10
- tooltip?: boolean;
11
+ tooltip?: boolean | ReactNode;
11
12
  detailMaxLength?: number;
12
13
  fieldNames?: {
13
14
  label: string;
@@ -20,7 +21,7 @@ export interface AddressProps {
20
21
  defaultParams?: any;
21
22
  parentKey?: string;
22
23
  };
23
- onChange?: (value: string[]) => void;
24
+ onChange?: (value: string[], selectedOptions?: any[]) => void;
24
25
  transformResponse?: (data: any[]) => any[];
25
26
  level?: number;
26
27
  enumCode?: string;
@@ -12,7 +12,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
12
12
  import "antd/es/form/style";
13
13
  import _Form from "antd/es/form";
14
14
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
15
- var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "otherProps", "searchForm"],
15
+ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "otherProps", "searchForm", "defaultOne"],
16
16
  _excluded2 = ["onOk"],
17
17
  _excluded3 = ["rowKey", "columns", "rowSelection"];
18
18
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -25,6 +25,7 @@ import { ProForm, ProDrawerForm, ProTable, useProConfig } from '../../../../inde
25
25
  import Container from '../../Container';
26
26
  import viewSvg from '../../../../assets/view.svg';
27
27
  import useRequestList from './hooks/useRequestList';
28
+ import locale from '../../../../locale';
28
29
  var ProModalSelect = function ProModalSelect(props, ref) {
29
30
  var _formColumns$;
30
31
  var value = props.value,
@@ -48,6 +49,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
48
49
  isTooltip = props.isTooltip,
49
50
  otherProps = props.otherProps,
50
51
  searchForm = props.searchForm,
52
+ defaultOne = props.defaultOne,
51
53
  restInputProps = _objectWithoutProperties(props, _excluded);
52
54
  var contentForm = _Form.useFormInstance();
53
55
  if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
@@ -125,7 +127,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
125
127
  transformResponse: transformResponse
126
128
  }, _objectSpread({
127
129
  manual: true,
128
- ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || visible
130
+ ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || visible || defaultOne
129
131
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
130
132
  data = _useRequestList.data,
131
133
  loading = _useRequestList.loading,
@@ -288,7 +290,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
288
290
  _context2.next = 4;
289
291
  break;
290
292
  }
291
- _message.error('请先勾选');
293
+ _message.error(locale.ProModalSelect.checkMsg);
292
294
  return _context2.abrupt("return", false);
293
295
  case 4:
294
296
  _data = isMultiple ? selectedRows : selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows[0];
@@ -410,14 +412,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
410
412
  // 初始化回显,当传入initParams时,前端用来回险
411
413
  var getInitValues = /*#__PURE__*/function () {
412
414
  var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
413
- var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
415
+ var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
414
416
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
415
417
  while (1) switch (_context4.prev = _context4.next) {
416
418
  case 0:
417
419
  if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
418
- useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm.getFieldsValue());
420
+ useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
419
421
  }
420
- if (!(useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams)) {
422
+ if (!((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne)) {
421
423
  _context4.next = 13;
422
424
  break;
423
425
  }
@@ -431,7 +433,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
431
433
  });
432
434
  return _context4.abrupt("return");
433
435
  case 5:
434
- queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams);
436
+ queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || {});
435
437
  page = _objectSpread({
436
438
  pageNum: 1,
437
439
  pageSize: 10
@@ -474,6 +476,61 @@ var ProModalSelect = function ProModalSelect(props, ref) {
474
476
  return _ref9.apply(this, arguments);
475
477
  };
476
478
  }();
479
+ // 初始化回显,当传入initParams时,前端用来回险
480
+ var getDefaultOneValues = /*#__PURE__*/function () {
481
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
482
+ var _useRequest$options4, _useRequest$options5;
483
+ var queryBean, page, params, res, _list2, list, _res$data2, _data3, nextSelectRowKeys;
484
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
485
+ while (1) switch (_context5.prev = _context5.next) {
486
+ case 0:
487
+ queryBean = _objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options4 = useRequest.options) === null || _useRequest$options4 === void 0 ? void 0 : _useRequest$options4.defaultParams);
488
+ page = _objectSpread({
489
+ pageNum: 1,
490
+ pageSize: 10
491
+ }, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
492
+ params = withPagination ? _objectSpread(_objectSpread({}, page), {}, {
493
+ queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
494
+ }) : queryBean;
495
+ params = transformParams ? transformParams(params) : params;
496
+ _context5.next = 6;
497
+ return runAsync(params);
498
+ case 6:
499
+ res = _context5.sent;
500
+ if (res === null || res === void 0 ? void 0 : res.data) {
501
+ list = [];
502
+ if (transformResponse) {
503
+ list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
504
+ } else {
505
+ list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
506
+ }
507
+ _data3 = isMultiple ? list : (_list2 = list) === null || _list2 === void 0 ? void 0 : _list2[0];
508
+ nextSelectRowKeys = isMultiple ? value : [value];
509
+ if (labelInValue) {
510
+ onChange(_data3);
511
+ } else {
512
+ onChange(isMultiple ? _data3.map(function (item) {
513
+ return item[valueKey];
514
+ }) : _data3[valueKey]);
515
+ }
516
+ // 更新内部展示值
517
+ setState({
518
+ _value: _data3,
519
+ isInit: false,
520
+ selectedRows: list,
521
+ selectedRowKeys: nextSelectRowKeys
522
+ });
523
+ }
524
+ case 8:
525
+ case "end":
526
+ return _context5.stop();
527
+ }
528
+ }, _callee5);
529
+ }));
530
+ return function getDefaultOneValues() {
531
+ return _ref10.apply(this, arguments);
532
+ };
533
+ }();
477
534
  useImperativeHandle(ref, function () {
478
535
  return {
479
536
  handleClick: handleClick,
@@ -505,8 +562,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
505
562
  });
506
563
  useEffect(function () {
507
564
  if (onOff && !visible) {
508
- var _useRequest$options4;
509
- if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options4 = useRequest.options) === null || _useRequest$options4 === void 0 ? void 0 : _useRequest$options4.manual) !== true) {
565
+ var _useRequest$options6;
566
+ if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
510
567
  onReset();
511
568
  }
512
569
  var nextState = {
@@ -538,11 +595,15 @@ var ProModalSelect = function ProModalSelect(props, ref) {
538
595
  }, [value, visible, isInit]);
539
596
  useEffect(function () {
540
597
  if (!value) {
541
- setState({
542
- _value: undefined,
543
- selectedRowKeys: [],
544
- selectedRows: []
545
- });
598
+ if (defaultOne) {
599
+ getDefaultOneValues();
600
+ } else {
601
+ setState({
602
+ _value: undefined,
603
+ selectedRowKeys: [],
604
+ selectedRows: []
605
+ });
606
+ }
546
607
  }
547
608
  if (labelInValue && _value && !isEqual(value, _value)) {
548
609
  setState({
@@ -593,7 +654,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
593
654
  onChange: handleChangeValue,
594
655
  disabled: disabled,
595
656
  addonAfter: forceAddonAfterRender(),
596
- placeholder: "\u8BF7\u9009\u62E9",
657
+ placeholder: locale.ProModalSelect.select,
597
658
  autoComplete: "off"
598
659
  }, restInputProps)), _jsx(_Input, {
599
660
  type: "hidden",
@@ -37,6 +37,7 @@ interface ProModalPropsType {
37
37
  viewEmpty?: React.ReactNode;
38
38
  otherProps?: ProFormOtherProps;
39
39
  labelInValue?: boolean;
40
+ defaultOne?: boolean;
40
41
  beforeOpen?: any;
41
42
  isTooltip?: any;
42
43
  showCodeName?: boolean;
@@ -22,7 +22,7 @@
22
22
 
23
23
  > span {
24
24
  position: relative;
25
- font-size: var(--zaui-font-size-sm, 12px );
25
+ font-size: var(--zaui-font-size, 14px);
26
26
  border: none;
27
27
  border-radius: 50%;
28
28
  }
@@ -57,7 +57,7 @@
57
57
  &:hover {
58
58
  .ant-input,
59
59
  .ant-input-group-addon {
60
- border-color: #d9d9d9;
60
+ border-color: @zaui-form-control-line;
61
61
  }
62
62
  }
63
63
  }
@@ -73,7 +73,7 @@
73
73
  }
74
74
 
75
75
  .ant-input-group-addon {
76
- padding: 0px var(--zaui-space-size-md, 8px);
76
+ padding: 0px var(--zaui-space-size-sm, 8px);
77
77
  background-color: var(--zaui-base-bg, #ffffff);
78
78
  cursor: pointer;
79
79
 
@@ -11,6 +11,7 @@ import { isEmpty } from 'lodash';
11
11
  import classnames from 'classnames';
12
12
  import { tools } from '@zat-design/utils';
13
13
  import Container from '../../Container';
14
+ import locale from '../../../../locale';
14
15
  var formatAmount = tools.formatAmount,
15
16
  formatPercent = tools.formatPercent,
16
17
  formatPerMill = tools.formatPerMill;
@@ -155,7 +156,7 @@ var ProNumberRange = function ProNumberRange(props) {
155
156
  children: [_jsx(_InputNumber, _objectSpread(_objectSpread({
156
157
  className: "range-left",
157
158
  value: (value === null || value === void 0 ? void 0 : value[0]) || range[0],
158
- placeholder: "\u8BF7\u8F93\u5165",
159
+ placeholder: "".concat(locale.ProForm.inputPlaceholder),
159
160
  min: min,
160
161
  max: (value === null || value === void 0 ? void 0 : value[1]) || max || range[1],
161
162
  precision: precision,
@@ -174,7 +175,7 @@ var ProNumberRange = function ProNumberRange(props) {
174
175
  }), _jsx(_InputNumber, _objectSpread(_objectSpread({
175
176
  className: "range-right",
176
177
  value: (value === null || value === void 0 ? void 0 : value[1]) || range[1],
177
- placeholder: "\u8BF7\u8F93\u5165",
178
+ placeholder: "".concat(locale.ProForm.inputPlaceholder),
178
179
  min: (value === null || value === void 0 ? void 0 : value[0]) || min || range[0],
179
180
  max: max,
180
181
  precision: precision,
@@ -10,7 +10,7 @@
10
10
 
11
11
  .ant-input-status-error {
12
12
  &.range-split {
13
- border-color: #ff4d4f;
13
+ border-color: @zaui-danger;
14
14
  }
15
15
  }
16
16
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { RangePickerProps } from 'antd/es/date-picker';
3
3
  import { Moment } from 'moment';
4
- export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'separator'> & {
4
+ export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'separator' | 'mode'> & {
5
5
  disabled?: boolean;
6
6
  foreverText?: string;
7
7
  foreverDate?: string;
@@ -15,6 +15,7 @@ import classNames from 'classnames';
15
15
  import moment from 'moment';
16
16
  import { useProConfig } from '../../../../ProConfigProvider';
17
17
  import Container from '../../Container';
18
+ import locale from '../../../../locale';
18
19
  var defaultPickerValue = [moment(), moment()];
19
20
  var useControlled = function useControlled(props) {
20
21
  var _useState = useState(),
@@ -42,7 +43,7 @@ var RangePicker = _DatePicker.RangePicker;
42
43
  var ProRangeLimit = function ProRangeLimit(props) {
43
44
  var disabled = props.disabled,
44
45
  _props$foreverText = props.foreverText,
45
- foreverText = _props$foreverText === void 0 ? '长期' : _props$foreverText,
46
+ foreverText = _props$foreverText === void 0 ? locale.ProTimeLimit.foreverText : _props$foreverText,
46
47
  _props$foreverDate = props.foreverDate,
47
48
  foreverDate = _props$foreverDate === void 0 ? '9999-01-01' : _props$foreverDate,
48
49
  _props$format = props.format,
@@ -122,12 +123,10 @@ var ProRangeLimit = function ProRangeLimit(props) {
122
123
  };
123
124
  return _jsxs(_Input.Group, {
124
125
  compact: true,
126
+ className: "pro-range-limit",
125
127
  children: [_jsx(RangePicker, _objectSpread(_objectSpread(_objectSpread({
126
128
  allowClear: true,
127
129
  disabled: [disabled, disabled || _isForever],
128
- style: {
129
- width: 'calc(100% - 84px)'
130
- },
131
130
  defaultPickerValue: defaultPickerValue
132
131
  }, initialConfig), omit(rest, ['placeholder', 'separator'])), {}, {
133
132
  format: format,
@@ -135,9 +134,6 @@ var ProRangeLimit = function ProRangeLimit(props) {
135
134
  onChange: handleRangeChange
136
135
  })), _jsx("div", {
137
136
  className: className,
138
- style: {
139
- width: '84px'
140
- },
141
137
  children: _jsx(_Checkbox, {
142
138
  checked: _isForever,
143
139
  disabled: disabled,
@@ -2,10 +2,11 @@ import { DatePickerProps } from 'antd';
2
2
  import { Moment } from 'moment';
3
3
  import React from 'react';
4
4
  import { ProFormOtherProps } from '../../../propsType';
5
+ import { Props as ProRangeLimitProps } from '../ProRangeLimit';
5
6
  export type DateType = DatePickerProps['value'];
6
- export interface Props<ValueType extends DateType | string | null = DateType> extends Omit<DatePickerProps, 'value' | 'onChange'> {
7
+ export type ProTimeLimitProps = DistributiveOmit<DatePickerProps, 'value' | 'onChange' | 'mode'> & {
7
8
  value?: string;
8
- onChange?: (value: Props['value'] | null, valueData: Moment) => void;
9
+ onChange?: (value: ProTimeLimitProps['value'] | null, valueData: Moment) => void;
9
10
  disabled?: boolean;
10
11
  foreverTime?: string;
11
12
  foreverText?: string;
@@ -13,7 +14,11 @@ export interface Props<ValueType extends DateType | string | null = DateType> ex
13
14
  format?: string;
14
15
  valueType?: 'moment' | 'format' | 'ISO';
15
16
  otherProps?: ProFormOtherProps;
16
- }
17
- export declare const ProTimeLimit: React.FC<Props>;
18
- declare const LimitPick: (props: any) => JSX.Element;
17
+ mode?: 'DatePicker';
18
+ };
19
+ export declare const ProTimeLimit: React.FC<ProTimeLimitProps>;
20
+ export type ProLimitProps = ProTimeLimitProps | (ProRangeLimitProps & {
21
+ mode: 'RangePicker';
22
+ });
23
+ declare const LimitPick: React.FC<ProLimitProps>;
19
24
  export default LimitPick;
@@ -18,6 +18,7 @@ import { useProConfig } from '../../../../ProConfigProvider';
18
18
  import Container from '../../Container';
19
19
  import useControlled from './hooks/useControlled';
20
20
  import ProRangeLimit from '../ProRangeLimit';
21
+ import locale from '../../../../locale';
21
22
  // 永久有效默认值
22
23
  export var ProTimeLimit = function ProTimeLimit(props) {
23
24
  var _props$format = props.format,
@@ -25,7 +26,7 @@ export var ProTimeLimit = function ProTimeLimit(props) {
25
26
  disabled = props.disabled,
26
27
  foreverTime = props.foreverTime,
27
28
  _props$foreverText = props.foreverText,
28
- foreverText = _props$foreverText === void 0 ? '长期' : _props$foreverText,
29
+ foreverText = _props$foreverText === void 0 ? locale.ProTimeLimit.foreverText : _props$foreverText,
29
30
  _props$valueType = props.valueType,
30
31
  valueType = _props$valueType === void 0 ? 'format' : _props$valueType,
31
32
  otherProps = props.otherProps,
@@ -82,25 +83,17 @@ export var ProTimeLimit = function ProTimeLimit(props) {
82
83
  });
83
84
  return _jsxs(_Input.Group, {
84
85
  compact: true,
86
+ className: "pro-time-limit",
85
87
  children: [_jsx(_DatePicker, _objectSpread(_objectSpread(_objectSpread({
86
- disabled: disabled || isForever,
87
- style: {
88
- width: 'calc(100% - 84px)'
89
- }
88
+ disabled: disabled || isForever
90
89
  }, initialConfig), omit(rest, ['placeholder'])), {}, {
91
90
  value: value,
92
91
  onChange: onChange
93
92
  })), _jsx("div", {
94
93
  className: className,
95
- style: {
96
- width: '84px'
97
- },
98
94
  children: _jsx(_Checkbox, {
99
95
  checked: isForever,
100
96
  disabled: disabled,
101
- style: {
102
- width: '60px'
103
- },
104
97
  onChange: foreverChange,
105
98
  children: foreverText
106
99
  })
@@ -1,7 +1,7 @@
1
1
  .ant-form-item-has-error {
2
2
  .ant-picker-status-error
3
3
  ~ .forever-checkbox:not(.ant-input-disabled):not(.ant-input-borderless).ant-input {
4
- background: #fff;
4
+ background: @zaui-base-bg;
5
5
  border-color: var(--ant-error-color);
6
6
  }
7
7
  .forever-checkbox:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus {
@@ -11,3 +11,20 @@
11
11
  box-shadow: 0 0 0 2px var(--ant-error-color-outline);
12
12
  }
13
13
  }
14
+
15
+ span.ant-input-group-compact {
16
+ &.pro-time-limit,
17
+ &.pro-range-limit {
18
+ display: flex;
19
+
20
+ .ant-picker {
21
+ flex: 1;
22
+ }
23
+
24
+ .forever-checkbox {
25
+ flex: 0;
26
+ min-width: unset;
27
+ white-space: nowrap;
28
+ }
29
+ }
30
+ }