@unicom-cloud/ui 0.8.113 → 0.8.115

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 (325) hide show
  1. package/Affix.js +2 -2
  2. package/Alert.js +2 -2
  3. package/AutoComplete.js +1 -1
  4. package/BackTop.js +3 -3
  5. package/Badge.js +2 -2
  6. package/Breadcrumb.js +2 -2
  7. package/Button.js +1 -1
  8. package/Calendar.js +1 -1
  9. package/Card.js +1 -1
  10. package/Carousel.js +1 -1
  11. package/Cascader.js +1 -1
  12. package/Checkbox.js +1 -1
  13. package/ColorPicker.js +1 -1
  14. package/Comment.js +1 -1
  15. package/ConfigProvider.js +1 -1
  16. package/Copy.js +1 -1
  17. package/Countdown.js +4 -4
  18. package/DatePicker.js +1 -1
  19. package/Descriptions.js +1 -1
  20. package/Details.js +4 -4
  21. package/Development.js +1 -1
  22. package/Divider.js +1 -1
  23. package/Draggable.js +1 -1
  24. package/Dropdown.js +2 -2
  25. package/Empty.js +1 -1
  26. package/Flex.js +4 -4
  27. package/Form.js +1 -1
  28. package/Icon.js +1 -1
  29. package/IconHover.js +1 -1
  30. package/Image.js +1 -1
  31. package/InputNumber.js +1 -1
  32. package/Layout.js +1 -1
  33. package/Link.js +1 -1
  34. package/LiquidFill.js +4 -4
  35. package/List.js +6 -5
  36. package/Loading.js +4 -4
  37. package/Marquee.js +7 -6
  38. package/Mentions.js +1 -1
  39. package/Menu.js +1 -1
  40. package/Message.js +2 -2
  41. package/Modal.js +1 -1
  42. package/Notice.js +4 -4
  43. package/Notification.js +2 -2
  44. package/OverflowEllipsis.js +1 -1
  45. package/PageHeader.js +1 -1
  46. package/Pagination.js +4 -2
  47. package/Popconfirm.js +1 -1
  48. package/Popover.js +1 -1
  49. package/Progress.js +1 -1
  50. package/QrCode.js +7 -7
  51. package/Radio.js +1 -1
  52. package/Rate.js +1 -1
  53. package/ResizeBox.js +2 -2
  54. package/Result.js +1 -1
  55. package/RichText.js +1 -1
  56. package/Segmented.js +4 -4
  57. package/Skeleton.js +1 -1
  58. package/Slider.js +2 -2
  59. package/Space.js +4 -4
  60. package/Spin.js +1 -1
  61. package/Statistic.js +1 -1
  62. package/Steps.js +1 -1
  63. package/Switch.js +2 -2
  64. package/Table.js +1 -1
  65. package/Tabs.js +1 -1
  66. package/Tag.js +1 -1
  67. package/Tooltip.js +1 -1
  68. package/Tour.js +4 -4
  69. package/Transfer.js +1 -1
  70. package/Tree.js +1 -1
  71. package/TreeSelect.js +1 -1
  72. package/Trigger.js +3 -3
  73. package/affix/index.js +2 -2
  74. package/alert/index.js +2 -2
  75. package/anchor/Anchor.js +2 -2
  76. package/anchor/Link.js +1 -1
  77. package/app/App.js +2 -2
  78. package/auto-complete/index.js +1 -1
  79. package/avatar/Avatar.js +1 -1
  80. package/avatar/Group.js +1 -1
  81. package/back-top/index.js +3 -3
  82. package/badge/Count.js +1 -1
  83. package/badge/index.js +2 -2
  84. package/breadcrumb/index.js +2 -2
  85. package/button/Group.js +1 -1
  86. package/button/index.js +1 -1
  87. package/calendar/index.js +2 -2
  88. package/card/Grid.js +1 -1
  89. package/card/Meta.js +1 -1
  90. package/card/index.js +1 -1
  91. package/carousel/Arrow.js +1 -1
  92. package/carousel/Indicator.js +1 -1
  93. package/carousel/index.js +1 -1
  94. package/cascader/Cascader.js +2 -2
  95. package/cascader/index.js +1 -1
  96. package/cascader/util.js +1 -1
  97. package/checkbox/Checkbox.js +2 -2
  98. package/checkbox/Group.js +2 -2
  99. package/checkbox/GroupBlock.js +2 -2
  100. package/checkbox/index.js +2 -2
  101. package/chunk/{C6A94b7f.js → BcWPf1id.js} +1 -1
  102. package/chunk/BcdTSJks.js +48 -0
  103. package/chunk/{RjJoagzL.js → CEAeR6xB.js} +1 -1
  104. package/chunk/{yWKJUe_w.js → CKojyqln.js} +4 -4
  105. package/chunk/{DrYaod6k.js → CRgtPpMG.js} +1 -1
  106. package/chunk/{3t4FwEoB.js → CVjWKHBo.js} +1 -1
  107. package/chunk/{DB0hUIM1.js → CYPFoLks.js} +4 -4
  108. package/chunk/{D0dVE1v1.js → CcH9qbbg.js} +418 -416
  109. package/chunk/{Bzx5BueA.js → Ch4iApRQ.js} +2 -2
  110. package/chunk/{CbXCgtzv.js → Cs9GrNJa.js} +5 -5
  111. package/chunk/CxbF1opI.js +231 -0
  112. package/chunk/{CRdegvoa.js → D3F0iWPu.js} +1 -1
  113. package/chunk/{DzlfiVe2.js → D6I1_o6O.js} +1 -1
  114. package/chunk/{DA5AMZwY.js → DPDyV8yt.js} +3 -3
  115. package/chunk/{B--6x-RL.js → DQ8_XXrH.js} +1 -1
  116. package/chunk/{hc_ufgVf.js → DmHIX8hU.js} +166 -121
  117. package/chunk/{CYDaUML7.js → DstheLSK.js} +4 -4
  118. package/chunk/{BHAu6wbC.js → HFPyZ48d.js} +37 -35
  119. package/chunk/{Bcl7dWlJ.js → efH9HX0H.js} +3 -3
  120. package/chunk/exc7v_Hl.js +53 -0
  121. package/collapse/Collapse.js +2 -2
  122. package/collapse/Item.js +2 -2
  123. package/color-picker/ControlBar.js +1 -1
  124. package/color-picker/InputAlpha.js +1 -1
  125. package/color-picker/InputHex.js +1 -1
  126. package/color-picker/InputRgb.js +1 -1
  127. package/color-picker/Palette.js +1 -1
  128. package/color-picker/Panel.js +2 -2
  129. package/color-picker/index.js +1 -1
  130. package/comment/index.js +1 -1
  131. package/config-provider/ConfigProvider.js +1 -1
  132. package/config-provider/context.js +1 -1
  133. package/config-provider/index.js +2 -2
  134. package/copy/index.js +1 -1
  135. package/countdown/index.js +4 -4
  136. package/date-picker/Picker.js +1 -1
  137. package/date-picker/RangePicker.js +2 -2
  138. package/date-picker/index.js +1 -1
  139. package/descriptions/index.js +1 -1
  140. package/details/index.js +4 -4
  141. package/development/index.js +1 -1
  142. package/divider/index.js +1 -1
  143. package/draggable/index.js +1 -1
  144. package/drawer/Drawer.js +89 -93
  145. package/dropdown/Button.js +1 -1
  146. package/dropdown/index.js +2 -2
  147. package/empty/index.js +1 -1
  148. package/flex/index.js +4 -4
  149. package/form/Control.js +115 -103
  150. package/form/Form.js +2 -2
  151. package/form/FormItem.js +2 -2
  152. package/form/index.js +1 -1
  153. package/form/promisify.js +10 -19
  154. package/form/store.js +3 -3
  155. package/form/util.js +62 -52
  156. package/grid/Grid.js +1 -1
  157. package/grid/Item.js +1 -1
  158. package/hooks/index.js +3 -3
  159. package/hooks/useInView.js +1 -1
  160. package/hooks/useIntersectionObserver.js +1 -1
  161. package/hooks/useOverrideRef.js +1 -1
  162. package/hooks/useWatermark.js +1 -1
  163. package/icon/addFromIconFontCn.js +1 -1
  164. package/icon/index.js +2 -2
  165. package/icon-hover/index.js +1 -1
  166. package/icons/file.js +1 -1
  167. package/image/Image.js +3 -3
  168. package/image/ImagePreview.js +6 -6
  169. package/image/ImagePreviewArrow.js +1 -1
  170. package/image/ImagePreviewGroup.js +1 -1
  171. package/image/index.js +1 -1
  172. package/index.js +739 -726
  173. package/input/Button.js +1 -1
  174. package/input/Group.js +1 -1
  175. package/input/Input.js +2 -2
  176. package/input/InputElement.js +1 -1
  177. package/input/Password.js +1 -1
  178. package/input/Search.js +1 -1
  179. package/input/Textarea.js +1 -1
  180. package/input/autoSizeTextAreaHeight.js +29 -20
  181. package/input-number/index.js +1 -1
  182. package/input-tag/InputTag.js +2 -2
  183. package/layout/Content.js +1 -1
  184. package/layout/Footer.js +1 -1
  185. package/layout/Header.js +1 -1
  186. package/layout/Sider.js +1 -1
  187. package/layout/index.js +1 -1
  188. package/link/index.js +1 -1
  189. package/liquid-fill/index.js +4 -4
  190. package/list/Item.js +1 -1
  191. package/list/Meta.js +1 -1
  192. package/list/index.js +2 -1
  193. package/loading/index.js +4 -4
  194. package/locale/en-US.js +5 -3
  195. package/locale/tr-TR.js +5 -3
  196. package/marquee/index.js +7 -6
  197. package/marquee-/index.js +7 -6
  198. package/mentions/index.js +1 -1
  199. package/menu/Menu.js +2 -2
  200. package/menu/OverflowWrap.js +1 -1
  201. package/menu/index.js +2 -2
  202. package/message/index.js +2 -2
  203. package/message/useMessage.js +1 -1
  204. package/modal/Confirm.js +2 -2
  205. package/modal/Modal.js +5 -5
  206. package/modal/index.js +2 -2
  207. package/notice/index.js +4 -4
  208. package/notification/index.js +2 -2
  209. package/notification/useNotification.js +1 -1
  210. package/overflow-ellipsis/OverflowItem.js +1 -1
  211. package/overflow-ellipsis/index.js +1 -1
  212. package/package.json +1 -1
  213. package/page-header/index.js +1 -1
  214. package/pagination/PageItem.js +1 -1
  215. package/pagination/PageJumper.js +1 -1
  216. package/pagination/PageOption.js +103 -31
  217. package/pagination/Pagination.js +38 -35
  218. package/pagination/index.js +2 -0
  219. package/picker/Input.js +1 -1
  220. package/picker/InputRange.js +1 -1
  221. package/popconfirm/index.js +1 -1
  222. package/popover/index.js +1 -1
  223. package/progress/index.js +1 -1
  224. package/qr-code/index.js +1233 -45
  225. package/radio/Group.js +2 -2
  226. package/radio/GroupBlock.js +2 -2
  227. package/radio/Radio.js +2 -2
  228. package/radio/index.js +2 -2
  229. package/rate/index.js +1 -1
  230. package/resize-box/ResizeTrigger.js +1 -1
  231. package/resize-box/Split.js +2 -2
  232. package/resize-box/SplitGroup.js +2 -2
  233. package/resize-box/index.js +2 -2
  234. package/result/index.js +1 -1
  235. package/rich-text/index.js +1 -1
  236. package/row-col/Col-.js +1 -1
  237. package/row-col/Col.js +1 -1
  238. package/row-col/Row.js +1 -1
  239. package/segmented/index.js +21 -21
  240. package/select/Option.js +1 -1
  241. package/select/Select.js +2 -2
  242. package/select-view/Core.js +1 -1
  243. package/skeleton/index.js +1 -1
  244. package/slider/Button.js +2 -2
  245. package/slider/index.js +2 -2
  246. package/space/index.js +4 -4
  247. package/spin/DotLoading.js +1 -1
  248. package/spin/index.js +1 -1
  249. package/splitter/Panel.js +1 -1
  250. package/splitter/SplitBar.js +2 -2
  251. package/splitter/Splitter.js +2 -2
  252. package/statistic/index.js +1 -1
  253. package/steps/index.js +1 -1
  254. package/style.css +1 -1
  255. package/switch/index.js +2 -2
  256. package/table/Table.js +5 -4
  257. package/table/index.js +4 -4
  258. package/tabs/Tab.js +2 -2
  259. package/tabs/TabContent.js +2 -2
  260. package/tabs/TabPane.js +1 -1
  261. package/tabs/index.js +2 -2
  262. package/tag/index.js +1 -1
  263. package/time-picker/Picker.js +1 -1
  264. package/time-picker/TimePicker.js +1 -1
  265. package/timeline/Item.js +1 -1
  266. package/timeline/Timeline.js +1 -1
  267. package/tooltip/index.js +1 -1
  268. package/tour/index.js +4 -4
  269. package/transfer/Item.js +2 -2
  270. package/transfer/List.js +2 -2
  271. package/transfer/index.js +1 -1
  272. package/tree/Animation.js +3 -3
  273. package/tree/Node.js +3 -3
  274. package/tree/NodeList.js +1 -1
  275. package/tree/Tree.js +2 -2
  276. package/tree/index.js +1 -1
  277. package/tree-select/Select.js +2 -2
  278. package/tree-select/index.js +1 -1
  279. package/trigger/getPopupStyle.js +1 -1
  280. package/trigger/index.js +145 -145
  281. package/types/common/hooks/useWindowSize.d.ts +4 -4
  282. package/types/common/utils/dom.d.ts +1 -1
  283. package/types/common/utils/lodash.d.ts +2 -1
  284. package/types/common/utils/reactDOM.d.ts +10 -1
  285. package/types/common/utils/validate.d.ts +2 -0
  286. package/types/pc/form/interface.d.ts +6 -1
  287. package/types/pc/form/promisify.d.ts +5 -0
  288. package/types/pc/form/store.d.ts +1 -1
  289. package/types/pc/form/util.d.ts +1 -1
  290. package/types/pc/input/autoSizeTextAreaHeight.d.ts +4 -2
  291. package/types/pc/pagination/PageOption.d.ts +3 -0
  292. package/types/pc/pagination/index.d.ts +2 -0
  293. package/types/pc/pagination/interface.d.ts +5 -0
  294. package/types/pc/qr-code/examples/demo.d.ts +1 -0
  295. package/types/pc/qr-code/examples/download.d.ts +2 -0
  296. package/types/pc/qr-code/examples/full.d.ts +2 -0
  297. package/types/pc/qr-code/examples/image.d.ts +2 -0
  298. package/types/pc/qr-code/index.d.ts +2 -0
  299. package/types/pc/qr-code/src/index.d.ts +116 -0
  300. package/types/pc/qr-code/src/qrcodegen.d.ts +95 -0
  301. package/types/pc/qr-code/src/qrcodegen2.d.ts +325 -0
  302. package/types/pc/utils/validate.d.ts +1 -1
  303. package/typography/Base.js +1 -1
  304. package/typography/Ellipsis.js +2 -2
  305. package/typography/Paragraph.js +1 -1
  306. package/typography/Typography.js +1 -1
  307. package/upload/TriggerNode.js +1 -1
  308. package/upload/Upload.js +2 -2
  309. package/upload/Uploader.js +1 -1
  310. package/upload/request_.js +1972 -41
  311. package/utils/PqbCSSTransition.js +1 -1
  312. package/utils/contextHolder.js +1 -1
  313. package/utils/dom.js +1 -1
  314. package/utils/index.js +247 -235
  315. package/utils/lodash.js +33 -32
  316. package/utils/react19Adapter.js +1 -1
  317. package/utils/reactDOM.js +1 -1
  318. package/utils/validate.js +15 -5
  319. package/verification-code/VerificationCode.js +1 -1
  320. package/version/index.js +1 -1
  321. package/virtual-list/VirtualList.js +1 -1
  322. package/watermark/Watermark.js +1 -1
  323. package/chunk/CXrVhA6-.js +0 -54
  324. package/chunk/De8RLlOK.js +0 -231
  325. package/chunk/d1c9z8T1.js +0 -49
package/form/Control.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as g, jsxs as I } from "react/jsx-runtime";
1
+ import { jsx as m, jsxs as I } from "react/jsx-runtime";
2
2
  import E from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
3
  import w from "@unicom-cloud/icons/IconUiCloseCircleFill";
4
4
  import b from "@unicom-cloud/icons/IconUiExclamationCircleFill";
@@ -7,7 +7,7 @@ import f from "lodash/get";
7
7
  import V from "lodash/isArray";
8
8
  import M from "lodash/isBoolean";
9
9
  import S from "lodash/isEqualWith";
10
- import m from "lodash/isFunction";
10
+ import p from "lodash/isFunction";
11
11
  import U from "lodash/isNil";
12
12
  import k from "lodash/set";
13
13
  import F, { Component as N, isValidElement as P } from "react";
@@ -16,96 +16,108 @@ import C from "../utils/warning.js";
16
16
  import { FormItemContext as W } from "./context.js";
17
17
  import { isFieldMatch as v, schemaValidate as x, isSyntheticEvent as $, ID_INPUT_SUFFIX as _ } from "./util.js";
18
18
  class it extends N {
19
- constructor(l, d) {
19
+ constructor(l, u) {
20
20
  super(l), this.errors = null, this.warnings = null, this.isDestroyed = !1, this.childrenElement = null, this.triggerStateCollect = () => {
21
- const { innerCollectFormState: e } = this.context.store.getInnerMethods(!0);
22
- e();
23
- }, this.toggleValidateStatus = (e) => {
24
- this.validateStatus = e, this.triggerStateCollect();
25
- }, this.toggleTouched = (e) => {
26
- this.touched = M(e) ? e : !this.touched, this.triggerStateCollect();
27
- }, this.setWarnings = (e) => {
28
- this.warnings = e, this.triggerStateCollect();
29
- }, this.setErrors = (e) => {
30
- this.errors = e, this.triggerStateCollect();
31
- }, this.getErrors = () => this.errors, this.getWarnings = () => this.warnings || [], this.isTouched = () => this.touched, this.getValidateStatus = () => this.props.validateStatus ? this.props.validateStatus : this.validateStatus, this.hasFieldProps = () => !!this.props.field, this.clearFormItemError = (e = this.props.field) => {
32
- const { updateFormItem: t } = this.context;
33
- t?.(e, { errors: null, warnings: null });
21
+ const { innerCollectFormState: t } = this.context.store.getInnerMethods(!0);
22
+ t();
23
+ }, this.toggleValidateStatus = (t) => {
24
+ this.validateStatus = t, this.triggerStateCollect();
25
+ }, this.toggleTouched = (t) => {
26
+ this.touched = M(t) ? t : !this.touched, this.triggerStateCollect();
27
+ }, this.setWarnings = (t) => {
28
+ this.warnings = t, this.triggerStateCollect();
29
+ }, this.setErrors = (t) => {
30
+ this.errors = t, this.triggerStateCollect();
31
+ }, this.getErrors = () => this.errors, this.getWarnings = () => this.warnings || [], this.isTouched = () => this.touched, this.getValidateStatus = () => this.props.validateStatus ? this.props.validateStatus : this.validateStatus, this.hasFieldProps = () => !!this.props.field, this.clearFormItemError = (t = this.props.field) => {
32
+ const { updateFormItem: e } = this.context;
33
+ e?.(t, { errors: null, warnings: null });
34
34
  }, this.updateFormItem = () => {
35
35
  if (this.isDestroyed) return;
36
36
  this.forceUpdate();
37
- const { updateFormItem: e } = this.context;
38
- e?.(this.props.field, {
37
+ const { updateFormItem: t } = this.context;
38
+ t?.(this.props.field, {
39
39
  errors: this.errors,
40
40
  warnings: this.warnings
41
41
  });
42
42
  }, this.getFieldValue = () => {
43
- const e = this.props.field, t = this.context.store;
44
- return e ? t.getInnerMethods(!0).innerGetFieldValue(e) : void 0;
45
- }, this.onStoreChange = (e, t) => {
46
- const i = V(t.field) ? t.field : [t.field], { field: s, shouldUpdate: r, dependencies: o } = this.props, h = (c) => {
47
- if (o && r && C(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), o)
48
- V(o) && o.some((n) => v(n, i)) && this.isTouched() && this.validateField();
49
- else if (r) {
43
+ const t = this.props.field, e = this.context.store;
44
+ return t ? e.getInnerMethods(!0).innerGetFieldValue(t) : void 0;
45
+ }, this.onStoreChange = (t, e) => {
46
+ const i = V(e.field) ? e.field : [e.field], { field: o, shouldUpdate: s, dependencies: r } = this.props, a = (d) => {
47
+ if (r && s && C(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), r)
48
+ V(r) && r.some((n) => v(n, i)) && this.isTouched() && this.validateField();
49
+ else if (s) {
50
50
  let n = !1;
51
- m(r) ? n = r(t.prev, t.current, {
52
- field: t.field,
53
- ...c
54
- }) : n = !S(t.prev, t.current), n && this.updateFormItem();
51
+ p(s) ? n = s(e.prev, e.current, {
52
+ field: e.field,
53
+ ...d
54
+ }) : n = !S(e.prev, e.current), n && this.updateFormItem();
55
55
  }
56
56
  };
57
- switch (e) {
57
+ switch (t) {
58
58
  case "reset":
59
- this.toggleTouched(!1), this.toggleValidateStatus(void 0), this.setErrors(null), this.setWarnings(null), o || r ? h() : this.updateFormItem();
59
+ this.toggleTouched(!1), this.toggleValidateStatus(void 0), this.setErrors(null), this.setWarnings(null), r || s ? a() : this.updateFormItem();
60
60
  break;
61
61
  case "innerSetValue":
62
- if (v(s, i)) {
62
+ if (v(o, i)) {
63
63
  this.toggleTouched(!0), this.updateFormItem();
64
64
  return;
65
65
  }
66
- h({
66
+ a({
67
67
  isInner: !0,
68
- isFormList: t.isFormList
68
+ isFormList: e.isFormList
69
69
  });
70
70
  break;
71
71
  case "setFieldValue":
72
- if (v(s, i)) {
73
- this.toggleTouched(!0), t.data && "touched" in t.data && this.toggleTouched(t.data.touched), t.data && "warnings" in t.data && this.setWarnings(
74
- U(t.data.warnings) ? [] : [].concat(t.data.warnings)
75
- ), t.data && "errors" in t.data ? this.setErrors(t.data.errors) : S(f(t.prev, s), f(t.current, s)) || this.setErrors(null), this.updateFormItem();
72
+ if (v(o, i)) {
73
+ this.toggleTouched(!0), e.data && "touched" in e.data && this.toggleTouched(e.data.touched), e.data && "warnings" in e.data && this.setWarnings(
74
+ U(e.data.warnings) ? [] : [].concat(e.data.warnings)
75
+ ), e.data && "errors" in e.data ? this.setErrors(e.data.errors) : S(f(e.prev, o), f(e.current, o)) || this.setErrors(null), this.updateFormItem();
76
76
  return;
77
77
  }
78
- h();
78
+ a();
79
79
  break;
80
80
  }
81
- }, this.innerSetFieldValue = (e, t) => {
82
- if (!e) return;
81
+ }, this.innerSetFieldValue = (t, e) => {
82
+ if (!t) return;
83
83
  const { store: i } = this.context;
84
- i.getInnerMethods(!0).innerSetFieldValue(e, t);
85
- const r = {};
86
- k(r, e, t), this.props?.onValuesChange?.(r, {
84
+ i.getInnerMethods(!0).innerSetFieldValue(t, e);
85
+ const s = {};
86
+ k(s, t, e), this.props?.onValuesChange?.(s, {
87
87
  ...i.getFieldsValue()
88
88
  });
89
89
  }, this.validateFieldOnly = () => {
90
- const { validateMessages: e } = this.context, { field: t, rules: i } = this.props, s = this.getFieldValue();
91
- return x(t, s, i, e).then(
92
- ({ error: r, warning: o }) => Promise.resolve({ error: r, value: s, warning: o, field: t })
93
- );
94
- }, this.validateField = (e) => {
95
- const { validateTrigger: t, validateMessages: i } = this.context, { field: s, rules: r, validateTrigger: o } = this.props, h = this.getFieldValue(), c = () => {
96
- const a = this.errors || this.warnings?.length;
97
- this.toggleValidateStatus("validating"), this.setErrors(null), this.setWarnings(null), a && this.updateFormItem();
98
- }, n = e ? (r || []).filter((a) => [].concat(
99
- a.validateTrigger || o || t
100
- ).indexOf(e) > -1) : r;
101
- return n && n.length && s ? (c(), x(s, h, n, i).then(
102
- ({ error: a, warning: u }) => (this.setErrors(a ? a[s] : null), this.setWarnings(u || null), this.toggleValidateStatus(
103
- this.errors ? "error" : this.warnings?.length ? "warning" : "success"
104
- ), this.updateFormItem(), Promise.resolve({ error: a, value: h, field: s }))
105
- )) : Promise.resolve({ error: null, value: h, field: s });
106
- }, this.handleTrigger = (e, ...t) => {
107
- const i = this.childrenElement || this.props.children, { store: s } = this.context, { field: r, trigger: o, normalize: h, getValueFromEvent: c } = this.props, n = m(c) ? c(e, ...t) : e;
108
- let a = n;
90
+ const { validateMessages: t, schemaOptions: e } = this.context, { field: i, rules: o } = this.props, s = this.getFieldValue();
91
+ return x(
92
+ i,
93
+ s,
94
+ o,
95
+ t,
96
+ e
97
+ ).then(({ error: r, warning: a }) => Promise.resolve({ error: r, value: s, warning: a, field: i }));
98
+ }, this.validateField = (t) => {
99
+ const {
100
+ validateTrigger: e,
101
+ validateMessages: i,
102
+ schemaOptions: o
103
+ } = this.context, { field: s, rules: r, validateTrigger: a } = this.props, d = this.getFieldValue(), n = () => {
104
+ const c = this.errors || this.warnings?.length;
105
+ this.toggleValidateStatus("validating"), this.setErrors(null), this.setWarnings(null), c && this.updateFormItem();
106
+ }, h = t ? (r || []).filter((c) => [].concat(
107
+ c.validateTrigger || a || e
108
+ ).indexOf(t) > -1) : r;
109
+ return h && h.length && s ? (n(), x(
110
+ s,
111
+ d,
112
+ h,
113
+ i,
114
+ o
115
+ ).then(({ error: c, warning: g }) => (this.setErrors(c ? c[s] : null), this.setWarnings(g || null), this.toggleValidateStatus(
116
+ this.errors ? "error" : this.warnings?.length ? "warning" : "success"
117
+ ), this.updateFormItem(), Promise.resolve({ error: c, value: d, field: s })))) : Promise.resolve({ error: null, value: d, field: s });
118
+ }, this.handleTrigger = (t, ...e) => {
119
+ const i = this.childrenElement || this.props.children, { store: o } = this.context, { field: s, trigger: r, normalize: a, getValueFromEvent: d } = this.props, n = p(d) ? d(t, ...e) : t;
120
+ let h = n;
109
121
  if ($(n)) {
110
122
  C(
111
123
  !0,
@@ -113,23 +125,23 @@ class it extends N {
113
125
  ), n.stopPropagation();
114
126
  return;
115
127
  }
116
- typeof h == "function" && (a = h(n, s.getFieldValue(r), {
117
- ...s.getFieldsValue()
118
- })), this.toggleTouched(!0), this.innerSetFieldValue(r, a), this.validateField(o), P(i) && i.props && i.props[o] && (this.props.isFormList || i.props[o](a, ...t));
128
+ typeof a == "function" && (h = a(n, o.getFieldValue(s), {
129
+ ...o.getFieldsValue()
130
+ })), this.toggleTouched(!0), this.innerSetFieldValue(s, h), this.validateField(r), P(i) && i.props && i.props[r] && (this.props.isFormList || i.props[r](h, ...e));
119
131
  }, this.getChild = () => {
120
- const { children: e } = this.props, { store: t } = this.context;
121
- let i = e;
122
- return m(e) && (i = e(
123
- t.getFields(),
132
+ const { children: t } = this.props, { store: e } = this.context;
133
+ let i = t;
134
+ return p(t) && (i = t(
135
+ e.getFields(),
124
136
  {
125
- ...t
137
+ ...e
126
138
  },
127
139
  this.props.isFormList && {
128
140
  value: this.getFieldValue(),
129
141
  onChange: this.handleTrigger
130
142
  }
131
143
  )), this.childrenElement = i, i;
132
- }, "initialValue" in l && this.hasFieldProps() && d?.store?.getInnerMethods?.(!0)?.innerSetInitialValue?.(l.field, l.initialValue);
144
+ }, "initialValue" in l && this.hasFieldProps() && u?.store?.getInnerMethods?.(!0)?.innerSetInitialValue?.(l.field, l.initialValue);
133
145
  }
134
146
  static {
135
147
  this.defaultProps = {
@@ -146,8 +158,8 @@ class it extends N {
146
158
  componentDidMount() {
147
159
  const { store: l } = this.context ?? {};
148
160
  if (l) {
149
- const d = l.getInnerMethods(!0);
150
- this.removeRegisterField = d.registerField(this);
161
+ const u = l.getInnerMethods(!0);
162
+ this.removeRegisterField = u.registerField(this);
151
163
  }
152
164
  this.isDestroyed = !1;
153
165
  }
@@ -162,46 +174,46 @@ class it extends N {
162
174
  * 收集rules里的validateTrigger字段
163
175
  */
164
176
  getValidateTrigger() {
165
- const l = this.props.validateTrigger || this.context.validateTrigger || "onChange", d = this.props.rules || [];
166
- let e = [];
167
- return d.map((t) => {
168
- e = e.concat(t.validateTrigger || l);
169
- }), Array.from(new Set(e));
177
+ const l = this.props.validateTrigger || this.context.validateTrigger || "onChange", u = this.props.rules || [];
178
+ let t = [];
179
+ return u.map((e) => {
180
+ t = t.concat(e.validateTrigger || l);
181
+ }), Array.from(new Set(t));
170
182
  }
171
- renderControl(l, d) {
183
+ renderControl(l, u) {
172
184
  const {
173
- field: e,
174
- trigger: t = "onChange",
185
+ field: t,
186
+ trigger: e = "onChange",
175
187
  triggerPropName: i = "value",
176
- validateStatus: s,
177
- formatter: r
178
- } = this.props, { store: o, disabled: h } = this.context, c = "disabled" in this.props ? this.props.disabled : h, n = F.Children.only(l), a = {
188
+ validateStatus: o,
189
+ formatter: s
190
+ } = this.props, { store: r, disabled: a } = this.context, d = "disabled" in this.props ? this.props.disabled : a, n = F.Children.only(l), h = {
179
191
  // used by label
180
- id: D(n.props?.id || { [`${d}${_}`]: d })
192
+ id: D(n.props?.id || { [`${u}${_}`]: u })
181
193
  };
182
- this.getValidateTrigger().forEach((p) => {
183
- a[p] = (T) => {
184
- this.validateField(p), n.props?.[p]?.(T);
194
+ this.getValidateTrigger().forEach((g) => {
195
+ h[g] = (T) => {
196
+ this.validateField(g), n.props?.[g]?.(T);
185
197
  };
186
- }), a[t] = this.handleTrigger, c !== void 0 && !("disabled" in n.props) && (a.disabled = c);
187
- let u = f(o.getInnerMethods(!0).innerGetStore(), e);
188
- return m(r) && (u = r(u)), a[i] = u, !s && this.errors && (a.error = !0), F.cloneElement(n, a);
198
+ }), h[e] = this.handleTrigger, d !== void 0 && !("disabled" in n.props) && (h.disabled = d);
199
+ let c = f(r.getInnerMethods(!0).innerGetStore(), t);
200
+ return p(s) && (c = s(c)), h[i] = c, !o && this.errors && (h.error = !0), F.cloneElement(n, h);
189
201
  }
190
202
  render() {
191
- const { noStyle: l, field: d, isFormList: e, hasFeedback: t } = this.props, i = this.getValidateStatus(), { prefixCls: s, getFormElementId: r } = this.context;
192
- let o = this.getChild();
193
- const h = this.hasFieldProps() ? r?.(d) : void 0;
194
- return this.hasFieldProps() && !e && F.Children.count(o) === 1 && (o = this.renderControl(o, h)), l ? o : /* @__PURE__ */ g("div", { className: `${s}-item-control-wrapper`, children: /* @__PURE__ */ g("div", { className: `${s}-item-control`, id: h, children: /* @__PURE__ */ I("div", { className: `${s}-item-control-children`, children: [
195
- o,
196
- i && t && /* @__PURE__ */ I(
203
+ const { noStyle: l, field: u, isFormList: t, hasFeedback: e } = this.props, i = this.getValidateStatus(), { prefixCls: o, getFormElementId: s } = this.context;
204
+ let r = this.getChild();
205
+ const a = this.hasFieldProps() ? s?.(u) : void 0;
206
+ return this.hasFieldProps() && !t && F.Children.count(r) === 1 && (r = this.renderControl(r, a)), l ? r : /* @__PURE__ */ m("div", { className: `${o}-item-control-wrapper`, children: /* @__PURE__ */ m("div", { className: `${o}-item-control`, id: a, children: /* @__PURE__ */ I("div", { className: `${o}-item-control-children`, children: [
207
+ r,
208
+ i && e && /* @__PURE__ */ I(
197
209
  "div",
198
210
  {
199
- className: `${s}-item-feedback ${s}-item-feedback-${i}`,
211
+ className: `${o}-item-feedback ${o}-item-feedback-${i}`,
200
212
  children: [
201
- i === "warning" && /* @__PURE__ */ g(b, {}),
202
- i === "success" && /* @__PURE__ */ g(E, {}),
203
- i === "error" && /* @__PURE__ */ g(w, {}),
204
- i === "validating" && /* @__PURE__ */ g(y, {})
213
+ i === "warning" && /* @__PURE__ */ m(b, {}),
214
+ i === "success" && /* @__PURE__ */ m(E, {}),
215
+ i === "error" && /* @__PURE__ */ m(w, {}),
216
+ i === "validating" && /* @__PURE__ */ m(y, {})
205
217
  ]
206
218
  }
207
219
  )
package/form/Form.js CHANGED
@@ -3,13 +3,13 @@ import "../chunk/-PX9OR3r.js";
3
3
  import "lodash/isPlainObject";
4
4
  import "lodash/merge";
5
5
  import "react";
6
- import "../chunk/CYDaUML7.js";
6
+ import "../chunk/DstheLSK.js";
7
7
  import "../chunk/BO_5qdS_.js";
8
8
  import "../chunk/FgWHhRFz.js";
9
9
  import "@unicom-cloud/utils/class-name";
10
10
  import "../chunk/BKKEev13.js";
11
11
  import "./context.js";
12
- import { F } from "../chunk/BHAu6wbC.js";
12
+ import { F } from "../chunk/HFPyZ48d.js";
13
13
  import "./util.js";
14
14
  export {
15
15
  F as default
package/form/FormItem.js CHANGED
@@ -4,10 +4,10 @@ import pe from "lodash/isArray";
4
4
  import ue from "lodash/isFunction";
5
5
  import C from "lodash/isPlainObject";
6
6
  import x from "lodash/isUndefined";
7
- import { a as fe } from "../chunk/CYDaUML7.js";
7
+ import { a as fe } from "../chunk/DstheLSK.js";
8
8
  import { u as be } from "../chunk/FgWHhRFz.js";
9
9
  import he from "../row-col/index.js";
10
- import { P as ge } from "../chunk/B--6x-RL.js";
10
+ import { P as ge } from "../chunk/DQ8_XXrH.js";
11
11
  import S from "@unicom-cloud/utils/class-name";
12
12
  import { o as Ce } from "../chunk/BKKEev13.js";
13
13
  import I from "./Control.js";
package/form/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { F as v, g as V, u as R } from "../chunk/BHAu6wbC.js";
1
+ import { F as v, g as V, u as R } from "../chunk/HFPyZ48d.js";
2
2
  import { FormContext as g, FormItemContext as w, FormProviderContext as L, FormListContext as M } from "./context.js";
3
3
  import P from "./Control.js";
4
4
  import y from "./FormItem.js";
package/form/promisify.js CHANGED
@@ -1,26 +1,17 @@
1
1
  import "../chunk/DsaQZE4X.js";
2
- import { isFunction as f } from "@unicom-cloud/utils/is";
3
- class p extends Error {
2
+ import { isFunction as c } from "@unicom-cloud/utils/is";
3
+ class l extends Error {
4
4
  constructor(t) {
5
- super("form validate error, get errors by error.errors"), this.errors = {}, this.errors = t;
5
+ super("表单验证错误,请通过 error.errors 获取错误详情"), this.errors = {}, this.errors = t;
6
6
  }
7
7
  }
8
- function h(e) {
9
- return Object.defineProperty((...r) => {
10
- if (f(r[r.length - 1]))
11
- return e.apply(this, r);
12
- {
13
- const n = (i, s) => {
14
- const l = (o, u) => {
15
- if (o)
16
- return s(new p(o));
17
- i(u);
18
- };
19
- return r[r.length] = l, r.length++, e.apply(this, r);
20
- };
21
- return new Promise(n);
22
- }
23
- }, "name", { value: e.name });
8
+ function h(r) {
9
+ return Object.defineProperty((...e) => c(e[e.length - 1]) ? r.apply(this, e) : new Promise((o, i) => {
10
+ const p = (n, s) => {
11
+ n ? i(new l(n)) : o(s);
12
+ };
13
+ return e[e.length] = p, e.length++, r.apply(this, e);
14
+ }), "name", { value: r.name });
24
15
  }
25
16
  export {
26
17
  h as default
package/form/store.js CHANGED
@@ -161,9 +161,7 @@ class J {
161
161
  }).catch((n) => n).finally(() => {
162
162
  });
163
163
  }
164
- ), this.toggleSubmitStatus = (t) => {
165
- this.submitStatus = t, this.innerCollectFormState(), this.notifyFormWatcher();
166
- }, this.submit = () => {
164
+ ), this.submit = () => {
167
165
  this.toggleSubmitStatus(g.submitting);
168
166
  const t = (e, i) => {
169
167
  let s;
@@ -173,6 +171,8 @@ class J {
173
171
  ), s;
174
172
  };
175
173
  return this.validate(t);
174
+ }, this.toggleSubmitStatus = (t) => {
175
+ this.submitStatus = t, this.innerCollectFormState(), this.notifyFormWatcher();
176
176
  }, this.getFieldsState = (t) => {
177
177
  const e = {}, i = (s) => {
178
178
  if (!s)
package/form/util.js CHANGED
@@ -1,74 +1,84 @@
1
- import { H as l } from "../chunk/hc_ufgVf.js";
2
- import h from "lodash/cloneDeepWith";
1
+ import y from "lodash/cloneDeepWith";
3
2
  import g from "lodash/flatten";
4
3
  import v from "lodash/has";
5
- import y from "lodash/isArray";
4
+ import d from "lodash/isArray";
6
5
  import E from "lodash/isFunction";
7
- import d from "lodash/isPlainObject";
8
- import S from "lodash/set";
9
- import w from "lodash/setWith";
10
- import O from "react";
11
- function F(t) {
12
- return h(t, (n) => {
13
- if (!d(n) && !y(n))
6
+ import l from "lodash/isPlainObject";
7
+ import S from "lodash/merge";
8
+ import w from "lodash/set";
9
+ import O from "lodash/setWith";
10
+ import F from "react";
11
+ import { a as _ } from "../chunk/DmHIX8hU.js";
12
+ import "lodash/defaultsDeep";
13
+ import "lodash/get";
14
+ function D(t) {
15
+ return y(t, (n) => {
16
+ if (!l(n) && !d(n))
14
17
  return n;
15
18
  });
16
19
  }
17
- const A = (t, n) => h(t, (r) => {
20
+ const T = (t, n) => y(t, (r) => {
18
21
  if (E(r))
19
- return (s) => r(s, n);
22
+ return (o) => r(o, n);
20
23
  });
21
- function G(t, n, r) {
22
- return S(t, n, F(r)), t;
24
+ function X(t, n, r) {
25
+ return w(t, n, D(r)), t;
23
26
  }
24
- function H(t, n = "") {
25
- const r = /* @__PURE__ */ new Set(), s = (e, o = "") => e ? r.has(e) ? [] : (r.add(e), g(
26
- Object.keys(e).map((i) => (d(e[i]) || y(e[i])) && Object.keys(e[i]).length && !O.isValidElement(e[i]) ? s(e[i], `${o + i}.`) : o + i)
27
+ function $(t, n = "") {
28
+ const r = /* @__PURE__ */ new Set(), o = (i, s = "") => i ? r.has(i) ? [] : (r.add(i), g(
29
+ Object.keys(i).map((e) => (l(i[e]) || d(i[e])) && Object.keys(i[e]).length && !F.isValidElement(i[e]) ? o(i[e], `${s + e}.`) : s + e)
27
30
  )) : [];
28
- return s(t, n);
31
+ return o(t, n);
29
32
  }
30
- function L(t) {
33
+ function q(t) {
31
34
  return t?.constructor?.name === "SyntheticEvent" || t?.nativeEvent instanceof Event;
32
35
  }
33
- async function N(t, n, r, s) {
34
- const e = [...r || []];
35
- let o = 0;
36
- return new Promise(async (i) => {
37
- const a = [], f = async (u) => {
38
- const p = () => o < e.length - 1 ? (o++, f(e[o])) : i({ error: null, warning: a });
39
- if (!u)
40
- return p();
41
- const c = { ...u };
42
- !c.type && !c.validator && (c.type = "string"), new l({ [t]: [c] }, {
43
- ignoreEmptyString: !0,
44
- validateMessages: s
45
- }).validate({ [t]: n }, (m) => {
46
- if (m)
47
- if (u.validateLevel === "warning")
48
- a.push(m[t].message);
36
+ async function z(t, n, r, o, i) {
37
+ const s = [...r || []];
38
+ let e = 0;
39
+ return new Promise((f) => {
40
+ const m = [], p = async (a) => {
41
+ const h = () => e < s.length - 1 ? (e++, p(s[e])) : f({ error: null, warning: m });
42
+ if (!a)
43
+ return h();
44
+ const c = { ...a };
45
+ !c.type && !c.validator && (c.type = "string"), new _(
46
+ { [t]: [c] },
47
+ S(
48
+ {
49
+ ignoreEmptyString: !0,
50
+ // trim: true, // 潘启宝添加
51
+ validateMessages: o
52
+ },
53
+ i
54
+ )
55
+ ).validate({ [t]: n }, (u) => {
56
+ if (u)
57
+ if (a.validateLevel === "warning")
58
+ m.push(u[t].message);
49
59
  else
50
- return i({
51
- error: m,
52
- warning: a
60
+ return f({
61
+ error: u,
62
+ warning: m
53
63
  });
54
- return p();
64
+ return h();
55
65
  });
56
66
  };
57
- f(e[o]);
67
+ p(s[e]);
58
68
  });
59
69
  }
60
- function R(t, n) {
61
- const r = w({}, t, void 0, Object);
62
- return n.some((s) => v(r, s));
70
+ function B(t, n) {
71
+ const r = O({}, t, void 0, Object);
72
+ return n.some((o) => v(r, o));
63
73
  }
64
- const T = "_input";
74
+ const C = "_input";
65
75
  export {
66
- T as ID_INPUT_SUFFIX,
67
- F as cloneDeep,
68
- A as formatValidateMsg,
69
- R as isFieldMatch,
70
- L as isSyntheticEvent,
71
- H as iterativelyGetKeys,
72
- N as schemaValidate,
73
- G as set
76
+ C as ID_INPUT_SUFFIX,
77
+ D as cloneDeep,
78
+ T as formatValidateMsg,
79
+ B as isFieldMatch,
80
+ q as isSyntheticEvent,
81
+ $ as iterativelyGetKeys,
82
+ z as schemaValidate,
83
+ X as set
74
84
  };
package/grid/Grid.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as x } from "react/jsx-runtime";
2
2
  import O from "lodash/isArray";
3
3
  import f from "lodash/isNil";
4
4
  import { forwardRef as _, useContext as A } from "react";
5
- import { a as L } from "../chunk/CYDaUML7.js";
5
+ import { a as L } from "../chunk/DstheLSK.js";
6
6
  import { COLS as u } from "../constant/index.js";
7
7
  import { u as M } from "../chunk/FgWHhRFz.js";
8
8
  import { useResponsiveState as c } from "../hooks/useResponsiveState.js";
package/grid/Item.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as S } from "react/jsx-runtime";
2
2
  import { forwardRef as v, useContext as a } from "react";
3
- import { a as R } from "../chunk/CYDaUML7.js";
3
+ import { a as R } from "../chunk/DstheLSK.js";
4
4
  import { u as b } from "../chunk/FgWHhRFz.js";
5
5
  import { useResponsiveState as i } from "../hooks/useResponsiveState.js";
6
6
  import h from "@unicom-cloud/utils/class-name";
package/hooks/index.js CHANGED
@@ -10,8 +10,8 @@ import { u as Ue, u as we } from "../chunk/BJeTDXdz.js";
10
10
  import { useVerificationCode as We } from "./useVerificationCode.js";
11
11
  import { useWatermark as Ve } from "./useWatermark.js";
12
12
  import { u as ze } from "../chunk/gJsdBcpG.js";
13
- import { u as Ae } from "../chunk/RjJoagzL.js";
14
- import { u as qe } from "../chunk/C6A94b7f.js";
13
+ import { u as Ae } from "../chunk/CEAeR6xB.js";
14
+ import { u as qe } from "../chunk/BcWPf1id.js";
15
15
  import { u as Ge } from "../chunk/oopARUrq.js";
16
16
  import { u as Ye } from "../chunk/Bvxzb1wd.js";
17
17
  import { u as Je } from "../chunk/BL9DMeor.js";
@@ -20,7 +20,7 @@ import { u as _e } from "../chunk/FgWHhRFz.js";
20
20
  import { u as es } from "../chunk/2vdCeheu.js";
21
21
  import { u as as } from "../chunk/zmmqLCF4.js";
22
22
  import { u as ts } from "../chunk/BqWBaRtM.js";
23
- import { u as rs } from "../chunk/CRdegvoa.js";
23
+ import { u as rs } from "../chunk/D3F0iWPu.js";
24
24
  import { u as is } from "../chunk/Ca6eMq_Y.js";
25
25
  import { u as ps } from "../chunk/rT6qmv-Y.js";
26
26
  import { u as cs } from "../chunk/CsqGBZv1.js";
@@ -1,4 +1,4 @@
1
- import { u as f } from "../chunk/C6A94b7f.js";
1
+ import { u as f } from "../chunk/BcWPf1id.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { u as f } from "../chunk/RjJoagzL.js";
1
+ import { u as f } from "../chunk/CEAeR6xB.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { u as f } from "../chunk/CRdegvoa.js";
1
+ import { u as f } from "../chunk/D3F0iWPu.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import P from "lodash/isNumber";
2
2
  import W from "lodash/merge";
3
3
  import { useState as B, useRef as R, useEffect as $ } from "react";
4
- import { a as O } from "../chunk/d1c9z8T1.js";
4
+ import { a as O } from "../chunk/BcdTSJks.js";
5
5
  function A(n) {
6
6
  if (!n)
7
7
  return 1;
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import { addFromIconFontCn as a } from "./index.js";
4
- import "../chunk/d1c9z8T1.js";
4
+ import "../chunk/BcdTSJks.js";
5
5
  export {
6
6
  a as default
7
7
  };
package/icon/index.js CHANGED
@@ -2,9 +2,9 @@ import { jsx as i } from "react/jsx-runtime";
2
2
  import a from "react";
3
3
  import { default as A } from "@unicom-cloud/icons/context";
4
4
  import { default as j } from "@unicom-cloud/icons/useProps";
5
- import { C as x } from "../chunk/CYDaUML7.js";
5
+ import { C as x } from "../chunk/DstheLSK.js";
6
6
  import g from "@unicom-cloud/utils/class-name";
7
- import { a as N } from "../chunk/d1c9z8T1.js";
7
+ import { a as N } from "../chunk/BcdTSJks.js";
8
8
  const m = a.forwardRef(function(e, u) {
9
9
  return /* @__PURE__ */ i(x, { children: (r) => {
10
10
  const { className: d, spin: t, children: n, type: l, ...o } = e, c = {