@cloudbase/weda-ui 3.5.1 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +3 -0
  2. package/dist/configs/components/button.d.ts +12 -12
  3. package/dist/configs/components/calendar.d.ts +26 -0
  4. package/dist/configs/components/calendar.js +80 -0
  5. package/dist/configs/components/carousel.json +1 -4
  6. package/dist/configs/components/chart/line.d.ts +28 -28
  7. package/dist/configs/components/common/form-input-required.d.ts +1 -1
  8. package/dist/configs/components/container.d.ts +1 -1
  9. package/dist/configs/components/customer-service.d.ts +10 -34
  10. package/dist/configs/components/customer-service.js +91 -92
  11. package/dist/configs/components/dataView.d.ts +21 -3
  12. package/dist/configs/components/dataView.js +165 -16
  13. package/dist/configs/components/echart.d.ts +4 -4
  14. package/dist/configs/components/form-checkbox.d.ts +18 -18
  15. package/dist/configs/components/form-checkbox.js +0 -4
  16. package/dist/configs/components/form-date.d.ts +14 -14
  17. package/dist/configs/components/form-date.js +0 -4
  18. package/dist/configs/components/form-depart-tree-select.d.ts +17 -14
  19. package/dist/configs/components/form-depart-tree-select.js +1 -4
  20. package/dist/configs/components/form-email.d.ts +10 -10
  21. package/dist/configs/components/form-email.js +0 -4
  22. package/dist/configs/components/form-image-uploader.d.ts +11 -8
  23. package/dist/configs/components/form-image-uploader.js +1 -4
  24. package/dist/configs/components/form-input.d.ts +16 -16
  25. package/dist/configs/components/form-input.js +0 -10
  26. package/dist/configs/components/form-location.d.ts +21 -12
  27. package/dist/configs/components/form-location.js +1 -4
  28. package/dist/configs/components/form-multi-region.d.ts +13 -10
  29. package/dist/configs/components/form-multi-region.js +1 -4
  30. package/dist/configs/components/form-phone.d.ts +10 -10
  31. package/dist/configs/components/form-phone.js +0 -4
  32. package/dist/configs/components/form-radio.d.ts +18 -18
  33. package/dist/configs/components/form-radio.js +0 -4
  34. package/dist/configs/components/form-region.d.ts +12 -12
  35. package/dist/configs/components/form-region.js +0 -4
  36. package/dist/configs/components/form-rich-text.d.ts +11 -8
  37. package/dist/configs/components/form-rich-text.js +1 -4
  38. package/dist/configs/components/form-select-multiple.d.ts +27 -24
  39. package/dist/configs/components/form-select-multiple.js +1 -4
  40. package/dist/configs/components/form-select.d.ts +27 -24
  41. package/dist/configs/components/form-select.js +1 -4
  42. package/dist/configs/components/form-switch.d.ts +6 -6
  43. package/dist/configs/components/form-switch.js +0 -4
  44. package/dist/configs/components/form-text-area.d.ts +10 -10
  45. package/dist/configs/components/form-text-area.js +0 -4
  46. package/dist/configs/components/form-time.d.ts +17 -14
  47. package/dist/configs/components/form-time.js +1 -4
  48. package/dist/configs/components/form-upload-file.d.ts +13 -10
  49. package/dist/configs/components/form-upload-file.js +1 -4
  50. package/dist/configs/components/form-url.d.ts +10 -10
  51. package/dist/configs/components/form-url.js +0 -4
  52. package/dist/configs/components/form-user-tree-select.d.ts +19 -16
  53. package/dist/configs/components/form-user-tree-select.js +1 -4
  54. package/dist/configs/components/formdetail.json +0 -4
  55. package/dist/configs/components/grid/col.d.ts +2 -4
  56. package/dist/configs/components/grid/grid.d.ts +2 -4
  57. package/dist/configs/components/grid/row.d.ts +2 -3
  58. package/dist/configs/components/image.d.ts +4 -4
  59. package/dist/configs/components/link.d.ts +8 -8
  60. package/dist/configs/components/listView.d.ts +78 -33
  61. package/dist/configs/components/listView.js +258 -51
  62. package/dist/configs/components/lottery.d.ts +67 -0
  63. package/dist/configs/components/lottery.js +178 -0
  64. package/dist/configs/components/modal.d.ts +2 -2
  65. package/dist/configs/components/qr_code.d.ts +11 -11
  66. package/dist/configs/components/repeater.d.ts +10 -91
  67. package/dist/configs/components/repeater.js +75 -87
  68. package/dist/configs/components/tabs.d.ts +4 -4
  69. package/dist/configs/components/text.d.ts +2 -2
  70. package/dist/configs/components/wd-bubble.d.ts +3 -8
  71. package/dist/configs/components/wd-button.d.ts +22 -34
  72. package/dist/configs/components/wd-card.d.ts +10 -10
  73. package/dist/configs/components/wd-card.js +10 -5
  74. package/dist/configs/components/wd-checkbox.d.ts +36 -81
  75. package/dist/configs/components/wd-date-range.d.ts +87 -131
  76. package/dist/configs/components/wd-date.d.ts +88 -132
  77. package/dist/configs/components/wd-date.js +1 -1
  78. package/dist/configs/components/wd-divider.d.ts +2 -2
  79. package/dist/configs/components/wd-form-detail.d.ts +9 -9
  80. package/dist/configs/components/wd-form.d.ts +54 -82
  81. package/dist/configs/components/wd-form.js +1 -1
  82. package/dist/configs/components/wd-icon.d.ts +8 -9
  83. package/dist/configs/components/wd-image-upload.d.ts +5 -5
  84. package/dist/configs/components/wd-image.d.ts +8 -12
  85. package/dist/configs/components/wd-input-email.d.ts +88 -156
  86. package/dist/configs/components/wd-input-number.d.ts +38 -179
  87. package/dist/configs/components/wd-input-number.js +1 -1
  88. package/dist/configs/components/wd-input-phone.d.ts +86 -156
  89. package/dist/configs/components/wd-input-url.d.ts +88 -156
  90. package/dist/configs/components/wd-input.d.ts +120 -164
  91. package/dist/configs/components/wd-layout.d.ts +1 -5
  92. package/dist/configs/components/wd-link.d.ts +14 -26
  93. package/dist/configs/components/wd-modal.d.ts +12 -8
  94. package/dist/configs/components/wd-modal.js +14 -14
  95. package/dist/configs/components/wd-official-account.d.ts +3 -5
  96. package/dist/configs/components/wd-official-account.js +3 -5
  97. package/dist/configs/components/wd-radio.d.ts +35 -80
  98. package/dist/configs/components/wd-switch.d.ts +21 -67
  99. package/dist/configs/components/wd-table.d.ts +95 -132
  100. package/dist/configs/components/wd-table.js +61 -17
  101. package/dist/configs/components/wd-text.d.ts +8 -8
  102. package/dist/configs/components/wd-textarea.d.ts +64 -110
  103. package/dist/configs/components/wd-time.d.ts +89 -133
  104. package/dist/configs/components/wd-tree.d.ts +243 -281
  105. package/dist/configs/components/wd-tree.js +1 -1
  106. package/dist/configs/components/web-view.d.ts +30 -10
  107. package/dist/configs/components/web-view.js +34 -33
  108. package/dist/configs/components/wedaVideo.d.ts +30 -0
  109. package/dist/configs/components/wedaVideo.js +98 -0
  110. package/dist/configs/components/wxOpenApi/phone.d.ts +6 -6
  111. package/dist/configs/components/wxOpenApi/phoneCode.d.ts +6 -62
  112. package/dist/configs/components/wxOpenApi/phoneCode.js +62 -70
  113. package/dist/configs/components/wxOpenApi/share.d.ts +12 -12
  114. package/dist/configs/components/wxOpenApi/userInfo.d.ts +7 -7
  115. package/dist/configs/index.d.ts +2515 -4367
  116. package/dist/configs/index.js +3 -3
  117. package/dist/configs/type-utils/error.d.ts +3 -3
  118. package/dist/configs/type-utils/index.d.ts +6 -6
  119. package/dist/configs/type-utils/index.js +2 -5
  120. package/dist/configs/type-utils/type-form.d.ts +95 -101
  121. package/dist/index.js +1 -1
  122. package/dist/style/index.scss +1 -1
  123. package/dist/web/components/chart/common/echarts.js +0 -1
  124. package/dist/web/components/customer-service/customer-service.js +1 -1
  125. package/dist/web/components/dataView/index.js +1 -1
  126. package/dist/web/components/echart/echart.js +22 -6
  127. package/dist/web/components/flow/common/components/index.js +1 -0
  128. package/dist/web/components/flow/common/hooks/index.js +1 -0
  129. package/dist/web/components/flow/common/index.js +1 -0
  130. package/dist/web/components/flow/modules/operations/components/index.js +1 -0
  131. package/dist/web/components/flow/modules/operations/components/user-select/index.js +1 -0
  132. package/dist/web/components/flow/modules/operations/config/index.js +1 -0
  133. package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/index.js +1 -0
  134. package/dist/web/components/flow/process/constants.js +1 -3
  135. package/dist/web/components/flow-graph/graph.js +0 -1
  136. package/dist/web/components/form/checkbox/index.js +2 -2
  137. package/dist/web/components/form/enumSelect/MultipleSelect.js +1 -1
  138. package/dist/web/components/form/enumSelect/NormalSelect.js +1 -1
  139. package/dist/web/components/form/input/index.js +1 -1
  140. package/dist/web/components/form/location/components/LocationPC/location.PC.js +2 -2
  141. package/dist/web/components/form/radio/index.js +1 -1
  142. package/dist/web/components/form/select/dropdown-select/h5.js +5 -5
  143. package/dist/web/components/form/select/dropdown-select/pc.js +25 -28
  144. package/dist/web/components/form/select/dropdown-select/ui.d.ts +1 -1
  145. package/dist/web/components/form/select/dropdown-select/ui.js +5 -5
  146. package/dist/web/components/form/select/h5.js +10 -6
  147. package/dist/web/components/form/select/index.js +4 -2
  148. package/dist/web/components/form/selectMultiple/h5.js +1 -1
  149. package/dist/web/components/form/selectMultiple/index.js +1 -1
  150. package/dist/web/components/form/uploader/index.js +0 -1
  151. package/dist/web/components/form/uploader/uploader.pc.js +0 -1
  152. package/dist/web/components/form/uploaderFile/index.js +0 -1
  153. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +6 -4
  154. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +6 -4
  155. package/dist/web/components/form/userOrgSelect/common/fetch-data-service.d.ts +1 -1
  156. package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +19 -3
  157. package/dist/web/components/form/userOrgSelect/common/types.d.ts +2 -1
  158. package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +1 -3
  159. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.d.ts +1 -1
  160. package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +2 -2
  161. package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +0 -1
  162. package/dist/web/components/form-date/index.d.ts +1 -1
  163. package/dist/web/components/form-depart-tree-select/index.d.ts +1 -1
  164. package/dist/web/components/form-email/index.d.ts +2 -2
  165. package/dist/web/components/form-input/index.d.ts +2 -2
  166. package/dist/web/components/form-input-hooks/index.js +12 -13
  167. package/dist/web/components/form-multi-region/index.d.ts +1 -1
  168. package/dist/web/components/form-phone/index.d.ts +1 -1
  169. package/dist/web/components/form-region/index.d.ts +1 -1
  170. package/dist/web/components/form-select/index.d.ts +1 -1
  171. package/dist/web/components/form-select-multiple/index.d.ts +1 -1
  172. package/dist/web/components/form-text-area/index.d.ts +2 -2
  173. package/dist/web/components/form-time/index.d.ts +1 -1
  174. package/dist/web/components/form-url/index.d.ts +2 -2
  175. package/dist/web/components/form-user-tree-select/index.d.ts +1 -1
  176. package/dist/web/components/form-user-tree-select/index.js +3 -2
  177. package/dist/web/components/listView/index.js +81 -14
  178. package/dist/web/components/listView/interface.d.ts +7 -1
  179. package/dist/web/components/lottery/index.d.ts +22 -14
  180. package/dist/web/components/lottery/index.js +1 -2
  181. package/dist/web/components/navigationBar/horizontalMenu.js +0 -1
  182. package/dist/web/components/phone/index.js +1 -1
  183. package/dist/web/components/richText/index.js +3 -2
  184. package/dist/web/components/share/index.js +1 -1
  185. package/dist/web/components/table/UserDepartment/utils.js +0 -2
  186. package/dist/web/components/wd-card/wd-card.js +1 -1
  187. package/dist/web/components/wd-checkbox-list/checkboxList.js +1 -1
  188. package/dist/web/components/wd-date/elements/Calendar.h5.js +1 -2
  189. package/dist/web/components/wd-department-select/h5.js +0 -1
  190. package/dist/web/components/wd-form/hooks/use-remote-value.js +20 -8
  191. package/dist/web/components/wd-form/index.d.ts +7 -7
  192. package/dist/web/components/wd-form/index.js +12 -10
  193. package/dist/web/components/wd-input/wd-input.d.ts +43 -43
  194. package/dist/web/components/wd-input-email/wd-input-email.d.ts +39 -39
  195. package/dist/web/components/wd-input-number/number.js +0 -1
  196. package/dist/web/components/wd-input-number/wd-input-number.js +10 -6
  197. package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +43 -43
  198. package/dist/web/components/wd-input-url/wd-input-url.d.ts +39 -39
  199. package/dist/web/components/wd-member-select/h5.js +0 -1
  200. package/dist/web/components/wd-modal/wd-modal.js +8 -3
  201. package/dist/web/components/wd-official-account/index.js +1 -1
  202. package/dist/web/components/wd-radio-list/wd-radio-list.js +2 -2
  203. package/dist/web/components/wd-table/components/FieldRender/UserDepartment/utils.js +0 -2
  204. package/dist/web/components/wd-table/components/FieldRender/index.d.ts +1 -1
  205. package/dist/web/components/wd-table/components/FieldRender/index.js +9 -6
  206. package/dist/web/components/wd-table/components/ModalTable/index.js +0 -3
  207. package/dist/web/components/wd-table/components/Table/index.js +4 -0
  208. package/dist/web/components/wd-table/hooks/useAuthFields.d.ts +1 -1
  209. package/dist/web/components/wd-table/hooks/useAuthFields.js +18 -4
  210. package/dist/web/components/wd-table/utils/index.js +5 -4
  211. package/dist/web/components/wd-table/wd-table.js +41 -19
  212. package/dist/web/components/wd-tree/utils.js +0 -2
  213. package/dist/web/components/wd-tree/wd-tree.js +0 -1
  214. package/dist/web/components/wd-upload-image/wd-upload-image.js +0 -1
  215. package/dist/web/components/web-view/web-view.d.ts +23 -6
  216. package/dist/web/index.js +1 -0
  217. package/dist/web/utils/constant.js +0 -1
  218. package/dist/web/utils/hooks/useFormLegacy.d.ts +1 -1
  219. package/dist/web/utils/hooks/useFormLegacy.js +9 -3
  220. package/dist/web/utils/moment.js +1 -3
  221. package/dist/web/utils/platform.js +0 -3
  222. package/dist/web/utils/widget-api/index.d.ts +1 -1
  223. package/dist/web/utils/widget-api/index.js +19 -22
  224. package/dist/web/weda-ui.css +6 -0
  225. package/package.json +13 -6
  226. package/dist/configs/components/calendar.json +0 -83
  227. package/dist/configs/components/lottery.json +0 -166
  228. package/dist/configs/components/wedaVideo.json +0 -101
@@ -9,7 +9,7 @@ import Button from '../../components/button';
9
9
  import { Bubble, ConfigProvider, ExternalLink } from 'tea-component';
10
10
  import '../style';
11
11
  // @ts-ignore忽略ts交验
12
- // eslint-disable-next-line rulesdir/no-phantom-deps,import/no-unresolved
12
+ // eslint-disable-next-line rulesdir/no-phantom-deps
13
13
  import { autorun } from 'mobx';
14
14
  const Phone = (props) => {
15
15
  var _a, _b;
@@ -307,13 +307,13 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
307
307
  }, [style === null || style === void 0 ? void 0 : style.height, (_c = toolbarDomRef === null || toolbarDomRef === void 0 ? void 0 : toolbarDomRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight]);
308
308
  React.useEffect(() => {
309
309
  var _a, _b, _c, _d;
310
- if ((style === null || style === void 0 ? void 0 : style.height) && !isH5 && layout === 'vertical') {
310
+ if ((style === null || style === void 0 ? void 0 : style.height) && layout === 'vertical') {
311
311
  const ele = (_c = (_b = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.parentNode) === null || _c === void 0 ? void 0 : _c.children;
312
312
  if (ele && ele.length > 1) {
313
313
  ele[1].style.height = `calc(100% - ${((_d = ele === null || ele === void 0 ? void 0 : ele[0]) === null || _d === void 0 ? void 0 : _d.clientHeight) || 0}px - ${labelVisible ? 10 : 0}px)`;
314
314
  }
315
315
  }
316
- }, [style === null || style === void 0 ? void 0 : style.height, isH5, layout, labelVisible]);
316
+ }, [style === null || style === void 0 ? void 0 : style.height, layout, labelVisible]);
317
317
  React.useEffect(() => {
318
318
  var _a;
319
319
  const map = currentMap;
@@ -362,6 +362,7 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
362
362
  ? `calc(100% - ${editorHeight + 1}px)`
363
363
  : '100%',
364
364
  width: '100%',
365
+ caretColor: readOnly || disabled ? 'transparent' : 'unset',
365
366
  } })] }) }) }));
366
367
  return renderDecorator(richTextEl, decorator)({
367
368
  id,
@@ -9,7 +9,7 @@ import { Bubble, ConfigProvider } from 'tea-component';
9
9
  import Button from '../../components/button';
10
10
  import '../style';
11
11
  // @ts-ignore忽略ts交验
12
- // eslint-disable-next-line rulesdir/no-phantom-deps,import/no-unresolved
12
+ // eslint-disable-next-line rulesdir/no-phantom-deps
13
13
  import { autorun } from 'mobx';
14
14
  const Share = (props) => {
15
15
  var _a, _b;
@@ -72,9 +72,7 @@ export const getRelationData = (relation) => {
72
72
  const primaryColumn = (_b = relation === null || relation === void 0 ? void 0 : relation.v1) === null || _b === void 0 ? void 0 : _b.primaryColumn;
73
73
  const data = {
74
74
  content: record === null || record === void 0 ? void 0 : record[primaryColumn],
75
- // eslint-disable-next-line no-underscore-dangle
76
75
  id: record === null || record === void 0 ? void 0 : record._id,
77
76
  };
78
- // eslint-disable-next-line no-underscore-dangle
79
77
  return data;
80
78
  };
@@ -10,5 +10,5 @@ export const WdCard = forwardRef(function WdCard({ showHeader = true, showConten
10
10
  useImperativeHandle(ref, () => {
11
11
  return { showHeader, showContent, showFooter, showDivider };
12
12
  }, [showHeader, showContent, showFooter, showDivider]);
13
- return (_jsxs("div", { className: `${isH5 ? `${classPrefix}-h5-card-root` : `${classPrefix}-pc-card-root`} ${classPrefix}-card-root ${showDivider ? classPrefix + '-card--bordered' : ''} ${className}`, "data-testid": "wd-card-test", onClick: (e) => events.tap({}, { originEvent: e }), style: style, children: [showHeader ? (_jsx("div", { className: `${classPrefix}-card__header`, "data-testid": "wd-card-header-test", children: _jsx("div", { className: `${classPrefix}-card__title`, children: headerSlot }) })) : null, showContent ? (_jsx("div", { className: `${classPrefix}-card__body`, "data-testid": "wd-card-body-test", children: contentSlot })) : null, showFooter ? (_jsx("div", { className: `${classPrefix}-card__footer`, "data-testid": "wd-card-footer-test", children: footerSlot })) : null] }));
13
+ return (_jsxs("div", { className: `${isH5 ? `${classPrefix}-h5-card-root` : `${classPrefix}-pc-card-root`} ${classPrefix}-card-root ${showDivider ? classPrefix + '-card--bordered' : ''} ${className}`, "data-testid": "wd-card-test", onClick: (e) => events.tap({}, { originEvent: e }), style: style, children: [showHeader ? (_jsx("div", { className: `${classPrefix}-card__header`, "data-testid": "wd-card-header-test", children: headerSlot })) : null, showContent ? (_jsx("div", { className: `${classPrefix}-card__body`, "data-testid": "wd-card-body-test", children: contentSlot })) : null, showFooter ? (_jsx("div", { className: `${classPrefix}-card__footer`, "data-testid": "wd-card-footer-test", children: footerSlot })) : null] }));
14
14
  });
@@ -44,8 +44,8 @@ export const WdCheckboxList = React.forwardRef(function WdCheckboxList(props, in
44
44
  const value = Object.entries(newMap)
45
45
  .filter(([, checked]) => checked)
46
46
  .map(([value]) => value);
47
- events === null || events === void 0 ? void 0 : events.change({ value }, { originEvent: e });
48
47
  outerOnChange === null || outerOnChange === void 0 ? void 0 : outerOnChange(value);
48
+ events === null || events === void 0 ? void 0 : events.change({ value }, { originEvent: e });
49
49
  }
50
50
  };
51
51
  React.useEffect(() => {
@@ -42,8 +42,7 @@ export function Calendar(props) {
42
42
  };
43
43
  // 选中日期
44
44
  const handleSelectDay = (item) => {
45
- if ((item === null || item === void 0 ? void 0 : item.disabled) ||
46
- convertDateItemToValue(item) === convertDateItemToValue(dateItem)) {
45
+ if ((item === null || item === void 0 ? void 0 : item.disabled) || getYMD(item) === getYMD(dateItem)) {
47
46
  return;
48
47
  }
49
48
  const value = convertDateItemToValue({ ...dateItem, day: item.day });
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /* eslint-disable max-lines */
3
2
  import { useState } from 'react';
4
3
  import { Portal } from '../common/portal';
5
4
  import { useConfig } from '../../utils/config-context';
@@ -1,4 +1,4 @@
1
- import { useCallback, useEffect, useState } from 'react';
1
+ import { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { debug } from '../../../utils/console';
3
3
  // import { usePlatform } from '../../../utils/platform';
4
4
  // import { alertError } from '../../form/form';
@@ -23,15 +23,16 @@ methodGetItem, paramGetItem, appCloud, isDataModel, allSelectFields = emptyObjec
23
23
  console.error(err);
24
24
  // alertError(platform, '表单容器数据查询失败');
25
25
  }, []);
26
- const { data: remoteValue, error, isLoading, mutate, } = useSWR(() => {
27
- if (!formTypeWithInitValue.includes(formType) || !dataSourceName) {
26
+ const whetherNeedToFetchInitValue = useMemo(() => {
27
+ if (!formTypeWithInitValue.includes(formType) ||
28
+ !(typeof dataSourceName === 'string' && dataSourceName.length > 0)) {
28
29
  logger.debug('formType没有初始值或者,没配数据源', {
29
30
  formType,
30
31
  dataSourceName,
31
32
  isDataModel,
32
33
  _id,
33
34
  });
34
- return null;
35
+ return false;
35
36
  }
36
37
  if (!isDataModel && (!methodGetItem || !paramGetItem)) {
37
38
  logger.debug('配置的数据源是连接器要有方法和参数配置', {
@@ -39,10 +40,16 @@ methodGetItem, paramGetItem, appCloud, isDataModel, allSelectFields = emptyObjec
39
40
  methodGetItem,
40
41
  paramGetItem,
41
42
  });
42
- return null;
43
+ return false;
43
44
  }
44
45
  if (isDataModel && !_id) {
45
46
  logger.debug('是数据源但是没有配_id');
47
+ return false;
48
+ }
49
+ return true;
50
+ }, [_id, dataSourceName, formType, isDataModel, methodGetItem, paramGetItem]);
51
+ const { data: remoteValue, error, isLoading, mutate, } = useSWR(() => {
52
+ if (!whetherNeedToFetchInitValue) {
46
53
  return null;
47
54
  }
48
55
  if (isDataModel && allSelectFields === null) {
@@ -130,16 +137,21 @@ methodGetItem, paramGetItem, appCloud, isDataModel, allSelectFields = emptyObjec
130
137
  mutate();
131
138
  };
132
139
  }, [mutate]);
133
- const [loadingStatus, setLoadingStatus] = useState(() => (isLoading ? 'hidden' : 'done'));
140
+ const [loadingStatus, setLoadingStatus] = useState(() => {
141
+ if (isLoading || whetherNeedToFetchInitValue) {
142
+ return 'hidden';
143
+ }
144
+ return 'done';
145
+ });
134
146
  // 1 秒后仍在loading 才显示 loading
135
147
  useTimeoutEffect(() => {
136
148
  setLoadingStatus(isLoading ? 'loading' : 'done');
137
149
  }, LOADING_THRESHOLD);
138
150
  useEffect(() => {
139
- if (isLoading === false) {
151
+ if (isLoading === false && remoteValue) {
140
152
  setLoadingStatus('done');
141
153
  }
142
- }, [isLoading]);
154
+ }, [isLoading, remoteValue]);
143
155
  return {
144
156
  remoteValue,
145
157
  error,
@@ -30,34 +30,34 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
30
30
  readonly title: "校验成功";
31
31
  readonly name: "validateSuccess";
32
32
  readonly detail: import("@sinclair/typebox").TObject<{
33
- errors: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">, import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">>;
33
+ errors: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
34
34
  }>;
35
35
  }, {
36
36
  readonly title: "校验失败";
37
37
  readonly name: "validateFail";
38
38
  readonly detail: import("@sinclair/typebox").TObject<{
39
- errors: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">, import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">>;
39
+ errors: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
40
40
  }>;
41
41
  }, {
42
42
  readonly title: "查询为空";
43
43
  readonly name: "queryEmpty";
44
44
  readonly detail: import("@sinclair/typebox").TObject<{
45
- data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">, import("@sinclair/typebox").TAny>;
45
+ data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
46
46
  }>;
47
47
  }, {
48
48
  readonly title: "查询成功";
49
49
  readonly name: "querySuccess";
50
50
  readonly detail: import("@sinclair/typebox").TObject<{
51
- data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">, import("@sinclair/typebox").TAny>;
51
+ data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
52
52
  }>;
53
53
  }, {
54
54
  readonly title: "查询失败";
55
55
  readonly name: "queryFail";
56
56
  readonly detail: import("@sinclair/typebox").TObject<{
57
57
  error: import("@sinclair/typebox").TObject<{
58
- requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">>;
59
- message: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
60
- code: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
58
+ requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
59
+ message: import("@sinclair/typebox").TString;
60
+ code: import("@sinclair/typebox").TString;
61
61
  }>;
62
62
  }>;
63
63
  }]>> & {
@@ -21,9 +21,8 @@ import '../style';
21
21
  import { getErrorObjectFromValidateResult, getFormDataFromItemMap, } from './form-utils';
22
22
  import { ConfigProvider, StatusTip } from 'tea-component';
23
23
  import { isNil } from '../../utils/lodash';
24
- const SET_VALUE_DEBOUNCE_TIMEOUT = 200;
24
+ const SET_VALUE_DEBOUNCE_TIMEOUT = 250;
25
25
  const logger = debug('wd-form');
26
- // eslint-disable-next-line tree-shaking/no-side-effects-in-initialization
27
26
  const WdForm = React.forwardRef(function WdForm(props, ref) {
28
27
  var _a;
29
28
  const { className, id, style, contentSlot: contentSlotEl, layout = 'horizontal', formType = 'create', _id, datasourceType = 'model', dataSourceName, methodGetItem, methodCreate, methodUpdate, paramGetItem, appCloud = tcbAppCloud,
@@ -95,6 +94,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
95
94
  return null;
96
95
  }
97
96
  const fields = {};
97
+ logger.debug('formItemMapKey', { formItemMapKey });
98
98
  formItemMap.forEach((item, name) => {
99
99
  var _a;
100
100
  if (!fields[name]) {
@@ -113,7 +113,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
113
113
  return acc;
114
114
  }, {});
115
115
  return result;
116
- }, [formItemMap, ready]);
116
+ }, [formItemMap, ready, formItemMapKey]);
117
117
  const { remoteValue: fetchedInitialValues, loadingStatus: initValueLoadingStatus, error: initValueFetchError, } = useRemoteValue({
118
118
  appCloud,
119
119
  formType,
@@ -157,11 +157,13 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
157
157
  });
158
158
  }, [eventsRef, formItemMap, formType]);
159
159
  const setValue = useDebouncedCallback((data, setNull) => {
160
- if (typeof data !== 'object' || typeof data === null) {
160
+ if (typeof data !== 'object' || data === null) {
161
161
  console.warn('setValue data need expect a object but got', data);
162
162
  return;
163
163
  }
164
- formItemMap.forEach((item, name) => {
164
+ [...formItemMap.entries()].map(([name, n]) => {
165
+ var _a;
166
+ const item = (_a = formItemMap.get(name)) !== null && _a !== void 0 ? _a : n;
165
167
  if (!item.setValue) {
166
168
  console.error('表单组件缺少setValue方法:', item);
167
169
  return;
@@ -249,7 +251,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
249
251
  isDataModel,
250
252
  dataSourceName,
251
253
  });
252
- const onInitDataSourceFieldsWithAuth = useCallback((authValue) => {
254
+ const initDataSourceFieldsWithAuth = useCallback((authValue) => {
253
255
  logger.debug('onInitDataSourceFieldsWithAuth', authValue);
254
256
  const { isDataModel, dataSourceFieldsWidthAuthList } = authValue;
255
257
  try {
@@ -297,7 +299,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
297
299
  useEffect(() => {
298
300
  if (initValueLoadingStatus !== 'done')
299
301
  return;
300
- if (!initValueFetchError && fetchedInitialValues) {
302
+ if (!initValueFetchError && formInitValueToSet) {
301
303
  /*
302
304
  错误处理放在了 @link {onInitialValuesError}
303
305
  下面是可以拿到data了
@@ -312,16 +314,16 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
312
314
  // 兼容私有环境,新接口不存在的情况,产品策略完善后移除
313
315
  if ((window === null || window === void 0 ? void 0 : window['_isPrivate']) &&
314
316
  !((_b = (_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.cloud) === null || _b === void 0 ? void 0 : _b.getDataSourceProfileAsync)) {
315
- onInitDataSourceFieldsWithAuth === null || onInitDataSourceFieldsWithAuth === void 0 ? void 0 : onInitDataSourceFieldsWithAuth({ isDataModel });
317
+ initDataSourceFieldsWithAuth === null || initDataSourceFieldsWithAuth === void 0 ? void 0 : initDataSourceFieldsWithAuth({ isDataModel });
316
318
  return;
317
319
  }
318
320
  if (!isInIde()) {
319
- onInitDataSourceFieldsWithAuth(authValue);
321
+ initDataSourceFieldsWithAuth(authValue);
320
322
  }
321
323
  }, [
322
324
  authValue,
323
325
  isDataModel,
324
- onInitDataSourceFieldsWithAuth,
326
+ initDataSourceFieldsWithAuth,
325
327
  formItemMap,
326
328
  formItemMapKey,
327
329
  ]);
@@ -4,76 +4,76 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input'
4
4
  /**
5
5
  * 标准化:单行输入组件
6
6
  */
7
- export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & import("type-fest").Simplify<Partial<{
8
- label: string;
9
- name: string;
10
- type: string;
11
- size: string;
12
- required: boolean;
13
- maxLength: number;
14
- extra: string;
15
- placeholder: string;
16
- status: string;
17
- layout: string;
18
- block: boolean;
19
- after: string;
20
- focus: boolean;
21
- requiredFlag: boolean;
22
- labelVisible: boolean;
23
- inputValue: string;
24
- password: boolean;
25
- clearable: boolean;
26
- counterVisible: boolean;
27
- before: string;
28
- labelWidth: string;
29
- labelAlign: string;
30
- labelWrap: boolean;
31
- labelTips: string;
32
- isUnionValue: boolean;
33
- prefixType: string;
34
- prefixIcon: string;
35
- prefixSrc: string;
36
- suffixType: string;
37
- suffixIcon: string;
38
- suffixSrc: string;
39
- borderedH5: boolean;
40
- borderedPc: boolean;
41
- isNickNameType: boolean;
42
- rules: {
7
+ export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & import("type-fest").Simplify<{
8
+ label?: string;
9
+ name?: string;
10
+ type?: string;
11
+ required?: boolean;
12
+ extra?: string;
13
+ size?: string;
14
+ maxLength?: number;
15
+ placeholder?: string;
16
+ status?: string;
17
+ layout?: string;
18
+ block?: boolean;
19
+ after?: string;
20
+ focus?: boolean;
21
+ requiredFlag?: boolean;
22
+ labelVisible?: boolean;
23
+ inputValue?: string;
24
+ password?: boolean;
25
+ clearable?: boolean;
26
+ counterVisible?: boolean;
27
+ before?: string;
28
+ labelWidth?: string;
29
+ labelAlign?: string;
30
+ labelWrap?: boolean;
31
+ labelTips?: string;
32
+ isUnionValue?: boolean;
33
+ prefixType?: string;
34
+ prefixIcon?: string;
35
+ prefixSrc?: string;
36
+ suffixType?: string;
37
+ suffixIcon?: string;
38
+ suffixSrc?: string;
39
+ borderedH5?: boolean;
40
+ borderedPc?: boolean;
41
+ isNickNameType?: boolean;
42
+ rules?: {
43
43
  pattern?: string;
44
44
  message: string;
45
45
  format: string;
46
46
  }[];
47
- requiredMsg: string;
48
- }>> & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
47
+ requiredMsg?: string;
48
+ }> & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
49
49
  readonly name: "change";
50
50
  readonly title: "值改变";
51
51
  readonly detail: import("@sinclair/typebox").TObject<{
52
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
52
+ value: import("@sinclair/typebox").TString;
53
53
  }>;
54
54
  }, {
55
55
  readonly name: "focus";
56
56
  readonly title: "聚焦";
57
57
  readonly detail: import("@sinclair/typebox").TObject<{
58
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
58
+ value: import("@sinclair/typebox").TString;
59
59
  }>;
60
60
  }, {
61
61
  readonly name: "blur";
62
62
  readonly title: "失焦";
63
63
  readonly detail: import("@sinclair/typebox").TObject<{
64
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
64
+ value: import("@sinclair/typebox").TString;
65
65
  }>;
66
66
  }, {
67
67
  readonly name: "confirm";
68
68
  readonly title: "确认";
69
69
  readonly detail: import("@sinclair/typebox").TObject<{
70
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
70
+ value: import("@sinclair/typebox").TString;
71
71
  }>;
72
72
  }, {
73
73
  readonly name: "clear";
74
74
  readonly title: "清除内容";
75
75
  readonly detail: import("@sinclair/typebox").TObject<{
76
- originValue: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
76
+ originValue: import("@sinclair/typebox").TString;
77
77
  }>;
78
78
  }]>> & {
79
79
  wrapClassName?: string;
@@ -4,68 +4,68 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input-
4
4
  /**
5
5
  * 标准化:邮箱输入组件
6
6
  */
7
- export declare const WdInputEmail: React.ForwardRefExoticComponent<CommonPropsType & import("type-fest").Simplify<Partial<{
8
- label: string;
9
- name: string;
10
- size: string;
11
- required: boolean;
12
- maxLength: number;
13
- extra: string;
14
- placeholder: string;
15
- status: string;
16
- layout: string;
17
- block: boolean;
18
- after: string;
19
- focus: boolean;
20
- requiredFlag: boolean;
21
- labelVisible: boolean;
22
- inputValue: string;
23
- clearable: boolean;
24
- counterVisible: boolean;
25
- before: string;
26
- labelWidth: string;
27
- labelAlign: string;
28
- labelWrap: boolean;
29
- labelTips: string;
30
- isUnionValue: boolean;
31
- prefixType: string;
32
- prefixIcon: string;
33
- prefixSrc: string;
34
- suffixType: string;
35
- suffixIcon: string;
36
- suffixSrc: string;
37
- borderedH5: boolean;
38
- borderedPc: boolean;
39
- requiredMsg: string;
40
- }>> & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
7
+ export declare const WdInputEmail: React.ForwardRefExoticComponent<CommonPropsType & import("type-fest").Simplify<{
8
+ label?: string;
9
+ name?: string;
10
+ required?: boolean;
11
+ extra?: string;
12
+ size?: string;
13
+ maxLength?: number;
14
+ placeholder?: string;
15
+ status?: string;
16
+ layout?: string;
17
+ block?: boolean;
18
+ after?: string;
19
+ focus?: boolean;
20
+ requiredFlag?: boolean;
21
+ labelVisible?: boolean;
22
+ inputValue?: string;
23
+ clearable?: boolean;
24
+ counterVisible?: boolean;
25
+ before?: string;
26
+ labelWidth?: string;
27
+ labelAlign?: string;
28
+ labelWrap?: boolean;
29
+ labelTips?: string;
30
+ isUnionValue?: boolean;
31
+ prefixType?: string;
32
+ prefixIcon?: string;
33
+ prefixSrc?: string;
34
+ suffixType?: string;
35
+ suffixIcon?: string;
36
+ suffixSrc?: string;
37
+ borderedH5?: boolean;
38
+ borderedPc?: boolean;
39
+ requiredMsg?: string;
40
+ }> & import("type-fest").Simplify<import("../../../configs/type-utils").StaticEventsType<[{
41
41
  readonly name: "change";
42
42
  readonly title: "值改变";
43
43
  readonly detail: import("@sinclair/typebox").TObject<{
44
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
44
+ value: import("@sinclair/typebox").TString;
45
45
  }>;
46
46
  }, {
47
47
  readonly name: "focus";
48
48
  readonly title: "聚焦";
49
49
  readonly detail: import("@sinclair/typebox").TObject<{
50
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
50
+ value: import("@sinclair/typebox").TString;
51
51
  }>;
52
52
  }, {
53
53
  readonly name: "blur";
54
54
  readonly title: "失焦";
55
55
  readonly detail: import("@sinclair/typebox").TObject<{
56
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
56
+ value: import("@sinclair/typebox").TString;
57
57
  }>;
58
58
  }, {
59
59
  readonly name: "confirm";
60
60
  readonly title: "确认";
61
61
  readonly detail: import("@sinclair/typebox").TObject<{
62
- value: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
62
+ value: import("@sinclair/typebox").TString;
63
63
  }>;
64
64
  }, {
65
65
  readonly name: "clear";
66
66
  readonly title: "清除内容";
67
67
  readonly detail: import("@sinclair/typebox").TObject<{
68
- originValue: import("@sinclair/typebox").TString<"string" | "boolean" | "object" | "function" | "tel" | "x-long-text" | "phone" | "datetime" | "array" | "url" | "x-image" | "x-rtf" | "x-enum" | "x-location" | "x-file" | "x-autonumber" | "x-area-code" | "related" | "father-son" | "many-many">;
68
+ originValue: import("@sinclair/typebox").TString;
69
69
  }>;
70
70
  }]>> & React.RefAttributes<unknown>>;
71
71
  export type WdInputEmailProps = CommonPropsType & DataType & EventsType & {};
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-lines */
2
1
  /* eslint-disable @typescript-eslint/no-magic-numbers */
3
2
  /**
4
3
  * 两正数字符串比较
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /* eslint-disable complexity */
3
- /* eslint-disable @typescript-eslint/no-magic-numbers */
4
3
  /* eslint-disable max-lines */
5
4
  import { useImperativeHandle, forwardRef, useRef, useCallback, useMemo, useState, useEffect, } from 'react';
6
5
  import { useConfig } from '../../utils/config-context';
@@ -144,6 +143,7 @@ export const WdInputNumber = forwardRef(function WdInputNumber(props, ref) {
144
143
  const toReal = getRealValue(toShow);
145
144
  setShowValue(toShow);
146
145
  setRealValue(toReal);
146
+ changeForm(toReal);
147
147
  // eslint-disable-next-line react-hooks/exhaustive-deps
148
148
  }, [
149
149
  // calcPercent,
@@ -208,22 +208,26 @@ export const WdInputNumber = forwardRef(function WdInputNumber(props, ref) {
208
208
  after,
209
209
  className: inputGroupCls,
210
210
  };
211
+ const editDisabled = useMemo(() => {
212
+ const status = props.status || 'edit';
213
+ return readOnly || disabled || status !== 'edit';
214
+ }, [readOnly, disabled, props.status]);
211
215
  // 是否可以递增
212
216
  const stepPlusDisabled = useMemo(() => {
213
- if (readOnly || disabled || props.status !== 'edit')
217
+ if (editDisabled)
214
218
  return true;
215
219
  if (!isNumber(realValue) || !isNumber(props.max))
216
220
  return false;
217
221
  return +props.max <= +realValue;
218
- }, [readOnly, disabled, props.status, realValue, props.max]);
222
+ }, [editDisabled, realValue, props.max]);
219
223
  // 是否可以递减
220
224
  const stepMinusDisabled = useMemo(() => {
221
- if (readOnly || disabled || props.status !== 'edit')
225
+ if (editDisabled)
222
226
  return true;
223
227
  if (!isNumber(realValue) || !isNumber(props.min))
224
228
  return false;
225
229
  return +props.min >= +realValue;
226
- }, [readOnly, disabled, props.status, realValue, props.min]);
230
+ }, [editDisabled, realValue, props.min]);
227
231
  /**
228
232
  * 监听非输入引起的value变化,比如调用 setValue, clearValue
229
233
  */
@@ -266,7 +270,7 @@ export const WdInputNumber = forwardRef(function WdInputNumber(props, ref) {
266
270
  */
267
271
  const onRealChange = (e, type = '') => {
268
272
  var _a, _b;
269
- if (readOnly || disabled || props.status !== 'edit')
273
+ if (editDisabled)
270
274
  return realValue;
271
275
  if (['plus', 'minus'].includes(type)) {
272
276
  if (!isNumber(props.step) ||