@arco-design/mobile-react 2.36.1 → 2.37.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 (233) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.d.ts +1 -1
  5. package/cjs/_helpers/hooks.js +1 -1
  6. package/cjs/_helpers/react-dom.d.ts +5 -5
  7. package/cjs/_helpers/react-dom.js +49 -32
  8. package/cjs/_helpers/render.js +6 -3
  9. package/cjs/action-sheet/index.d.ts +3 -2
  10. package/cjs/action-sheet/index.js +2 -2
  11. package/cjs/carousel/index.js +8 -7
  12. package/cjs/checkbox/checkbox.d.ts +1 -1
  13. package/cjs/checkbox/group.d.ts +1 -1
  14. package/cjs/checkbox/hooks/useMergeProps.d.ts +1 -1
  15. package/cjs/checkbox/index.d.ts +2 -2
  16. package/cjs/context-provider/index.d.ts +8 -2
  17. package/cjs/count-down/hooks.js +2 -2
  18. package/cjs/dialog/index.d.ts +8 -3
  19. package/cjs/dialog/methods.d.ts +6 -2
  20. package/cjs/dropdown-menu/helper.d.ts +2 -2
  21. package/cjs/ellipsis/components/native-ellipsis.d.ts +2 -3
  22. package/cjs/ellipsis/components/native-ellipsis.js +1 -2
  23. package/cjs/form/form-item.d.ts +33 -2
  24. package/cjs/form/form-item.js +142 -121
  25. package/cjs/form/index.js +3 -1
  26. package/cjs/form/linked-container.d.ts +1 -1
  27. package/cjs/form/linked-container.js +4 -0
  28. package/cjs/form/style/css/index.css +4 -1
  29. package/cjs/form/style/index.less +6 -1
  30. package/cjs/form/type.d.ts +29 -6
  31. package/cjs/form/type.js +10 -2
  32. package/cjs/form/useForm.d.ts +2 -17
  33. package/cjs/form/useForm.js +98 -17
  34. package/cjs/form/utils.d.ts +2 -0
  35. package/cjs/form/utils.js +42 -2
  36. package/cjs/image-preview/index.d.ts +2 -2
  37. package/cjs/index-bar/group.js +3 -1
  38. package/cjs/index-bar/index.d.ts +2 -2
  39. package/cjs/index-bar/utils.d.ts +1 -1
  40. package/cjs/input/index.js +1 -1
  41. package/cjs/masking/index.d.ts +2 -2
  42. package/cjs/notify/index.d.ts +8 -8
  43. package/cjs/notify/index.js +2 -2
  44. package/cjs/picker-view/components/cascader.js +3 -1
  45. package/cjs/picker-view/components/picker-cell.js +1 -1
  46. package/cjs/picker-view/index.js +3 -1
  47. package/cjs/popup/index.d.ts +2 -2
  48. package/cjs/popup-swiper/index.d.ts +2 -2
  49. package/cjs/pull-refresh/hooks.d.ts +2 -2
  50. package/cjs/radio/group.d.ts +1 -1
  51. package/cjs/radio/group.js +1 -1
  52. package/cjs/radio/index.d.ts +2 -2
  53. package/cjs/radio/radio.d.ts +1 -1
  54. package/cjs/radio/type.d.ts +2 -2
  55. package/cjs/skeleton/elements.js +9 -3
  56. package/cjs/slider/hooks/index.d.ts +1 -1
  57. package/cjs/slider/hooks/useSliderEvents.d.ts +1 -1
  58. package/cjs/stepper/hooks/useValue.d.ts +2 -1
  59. package/cjs/steps/index.d.ts +1 -1
  60. package/cjs/tabs/type.d.ts +2 -2
  61. package/cjs/toast/index.d.ts +12 -12
  62. package/cjs/toast/index.js +1 -1
  63. package/dist/index.js +3070 -411
  64. package/dist/index.min.js +4 -4
  65. package/dist/style.css +4 -1
  66. package/dist/style.min.css +1 -1
  67. package/esm/_helpers/hooks.d.ts +1 -1
  68. package/esm/_helpers/hooks.js +1 -1
  69. package/esm/_helpers/react-dom.d.ts +5 -5
  70. package/esm/_helpers/react-dom.js +49 -30
  71. package/esm/_helpers/render.js +6 -3
  72. package/esm/action-sheet/index.d.ts +3 -2
  73. package/esm/action-sheet/index.js +2 -2
  74. package/esm/carousel/index.js +8 -7
  75. package/esm/checkbox/checkbox.d.ts +1 -1
  76. package/esm/checkbox/group.d.ts +1 -1
  77. package/esm/checkbox/hooks/useMergeProps.d.ts +1 -1
  78. package/esm/checkbox/index.d.ts +2 -2
  79. package/esm/context-provider/index.d.ts +8 -2
  80. package/esm/count-down/hooks.js +2 -2
  81. package/esm/dialog/index.d.ts +8 -3
  82. package/esm/dialog/methods.d.ts +6 -2
  83. package/esm/dropdown-menu/helper.d.ts +2 -2
  84. package/esm/ellipsis/components/native-ellipsis.d.ts +2 -3
  85. package/esm/ellipsis/components/native-ellipsis.js +1 -1
  86. package/esm/form/form-item.d.ts +33 -2
  87. package/esm/form/form-item.js +143 -122
  88. package/esm/form/index.js +3 -1
  89. package/esm/form/linked-container.d.ts +1 -1
  90. package/esm/form/linked-container.js +4 -0
  91. package/esm/form/style/css/index.css +4 -1
  92. package/esm/form/style/index.less +6 -1
  93. package/esm/form/type.d.ts +29 -6
  94. package/esm/form/type.js +8 -1
  95. package/esm/form/useForm.d.ts +2 -17
  96. package/esm/form/useForm.js +97 -17
  97. package/esm/form/utils.d.ts +2 -0
  98. package/esm/form/utils.js +31 -1
  99. package/esm/image-preview/index.d.ts +2 -2
  100. package/esm/index-bar/group.js +3 -1
  101. package/esm/index-bar/index.d.ts +2 -2
  102. package/esm/index-bar/utils.d.ts +1 -1
  103. package/esm/input/index.js +1 -1
  104. package/esm/masking/index.d.ts +2 -2
  105. package/esm/notify/index.d.ts +8 -8
  106. package/esm/notify/index.js +2 -2
  107. package/esm/picker-view/components/cascader.js +3 -1
  108. package/esm/picker-view/components/picker-cell.js +1 -1
  109. package/esm/picker-view/index.js +3 -1
  110. package/esm/popup/index.d.ts +2 -2
  111. package/esm/popup-swiper/index.d.ts +2 -2
  112. package/esm/pull-refresh/hooks.d.ts +2 -2
  113. package/esm/radio/group.d.ts +1 -1
  114. package/esm/radio/group.js +1 -1
  115. package/esm/radio/index.d.ts +2 -2
  116. package/esm/radio/radio.d.ts +1 -1
  117. package/esm/radio/type.d.ts +2 -2
  118. package/esm/skeleton/elements.js +9 -3
  119. package/esm/slider/hooks/index.d.ts +1 -1
  120. package/esm/slider/hooks/useSliderEvents.d.ts +1 -1
  121. package/esm/stepper/hooks/useValue.d.ts +2 -1
  122. package/esm/steps/index.d.ts +1 -1
  123. package/esm/tabs/type.d.ts +2 -2
  124. package/esm/toast/index.d.ts +12 -12
  125. package/esm/toast/index.js +1 -1
  126. package/esnext/_helpers/hooks.js +1 -1
  127. package/esnext/_helpers/react-dom.d.ts +5 -5
  128. package/esnext/_helpers/react-dom.js +47 -28
  129. package/esnext/_helpers/render.js +3 -2
  130. package/esnext/action-sheet/index.d.ts +3 -2
  131. package/esnext/action-sheet/index.js +1 -1
  132. package/esnext/carousel/index.js +7 -5
  133. package/esnext/context-provider/index.d.ts +8 -2
  134. package/esnext/context-provider/index.js +1 -1
  135. package/esnext/count-down/hooks.js +2 -2
  136. package/esnext/dialog/index.d.ts +8 -3
  137. package/esnext/dialog/methods.d.ts +6 -2
  138. package/esnext/dropdown-menu/helper.d.ts +1 -1
  139. package/esnext/ellipsis/components/native-ellipsis.d.ts +2 -3
  140. package/esnext/ellipsis/components/native-ellipsis.js +1 -1
  141. package/esnext/form/form-item.d.ts +33 -2
  142. package/esnext/form/form-item.js +85 -71
  143. package/esnext/form/index.js +2 -1
  144. package/esnext/form/linked-container.d.ts +1 -1
  145. package/esnext/form/linked-container.js +3 -0
  146. package/esnext/form/style/css/index.css +4 -1
  147. package/esnext/form/style/index.less +6 -1
  148. package/esnext/form/type.d.ts +29 -6
  149. package/esnext/form/type.js +7 -0
  150. package/esnext/form/useForm.d.ts +2 -17
  151. package/esnext/form/useForm.js +72 -13
  152. package/esnext/form/utils.d.ts +2 -0
  153. package/esnext/form/utils.js +26 -0
  154. package/esnext/image-preview/index.d.ts +2 -2
  155. package/esnext/index-bar/group.js +5 -1
  156. package/esnext/index-bar/index.d.ts +2 -2
  157. package/esnext/input/index.js +1 -1
  158. package/esnext/masking/index.d.ts +2 -2
  159. package/esnext/notify/index.d.ts +8 -8
  160. package/esnext/notify/index.js +2 -2
  161. package/esnext/picker-view/components/cascader.js +5 -1
  162. package/esnext/picker-view/components/picker-cell.js +1 -1
  163. package/esnext/picker-view/index.js +5 -1
  164. package/esnext/popup/index.d.ts +2 -2
  165. package/esnext/popup-swiper/index.d.ts +2 -2
  166. package/esnext/pull-refresh/hooks.d.ts +2 -2
  167. package/esnext/radio/group.js +3 -1
  168. package/esnext/radio/type.d.ts +2 -2
  169. package/esnext/skeleton/elements.js +15 -3
  170. package/esnext/slider/hooks/useSliderEvents.d.ts +1 -1
  171. package/esnext/tabs/type.d.ts +2 -2
  172. package/esnext/toast/index.d.ts +12 -12
  173. package/esnext/toast/index.js +1 -1
  174. package/package.json +3 -3
  175. package/umd/_helpers/hooks.d.ts +1 -1
  176. package/umd/_helpers/hooks.js +1 -1
  177. package/umd/_helpers/react-dom.d.ts +5 -5
  178. package/umd/_helpers/react-dom.js +53 -35
  179. package/umd/_helpers/render.js +6 -3
  180. package/umd/action-sheet/index.d.ts +3 -2
  181. package/umd/action-sheet/index.js +2 -2
  182. package/umd/carousel/index.js +8 -7
  183. package/umd/checkbox/checkbox.d.ts +1 -1
  184. package/umd/checkbox/group.d.ts +1 -1
  185. package/umd/checkbox/hooks/useMergeProps.d.ts +1 -1
  186. package/umd/checkbox/index.d.ts +2 -2
  187. package/umd/context-provider/index.d.ts +8 -2
  188. package/umd/count-down/hooks.js +2 -2
  189. package/umd/dialog/index.d.ts +8 -3
  190. package/umd/dialog/methods.d.ts +6 -2
  191. package/umd/dropdown-menu/helper.d.ts +2 -2
  192. package/umd/ellipsis/components/native-ellipsis.d.ts +2 -3
  193. package/umd/ellipsis/components/native-ellipsis.js +1 -2
  194. package/umd/form/form-item.d.ts +33 -2
  195. package/umd/form/form-item.js +142 -121
  196. package/umd/form/index.js +3 -1
  197. package/umd/form/linked-container.d.ts +1 -1
  198. package/umd/form/linked-container.js +4 -0
  199. package/umd/form/style/css/index.css +4 -1
  200. package/umd/form/style/index.less +6 -1
  201. package/umd/form/type.d.ts +29 -6
  202. package/umd/form/type.js +9 -1
  203. package/umd/form/useForm.d.ts +2 -17
  204. package/umd/form/useForm.js +98 -21
  205. package/umd/form/utils.d.ts +2 -0
  206. package/umd/form/utils.js +40 -5
  207. package/umd/image-preview/index.d.ts +2 -2
  208. package/umd/index-bar/group.js +3 -1
  209. package/umd/index-bar/index.d.ts +2 -2
  210. package/umd/index-bar/utils.d.ts +1 -1
  211. package/umd/input/index.js +1 -1
  212. package/umd/masking/index.d.ts +2 -2
  213. package/umd/notify/index.d.ts +8 -8
  214. package/umd/notify/index.js +2 -2
  215. package/umd/picker-view/components/cascader.js +3 -1
  216. package/umd/picker-view/components/picker-cell.js +1 -1
  217. package/umd/picker-view/index.js +3 -1
  218. package/umd/popup/index.d.ts +2 -2
  219. package/umd/popup-swiper/index.d.ts +2 -2
  220. package/umd/pull-refresh/hooks.d.ts +2 -2
  221. package/umd/radio/group.d.ts +1 -1
  222. package/umd/radio/group.js +1 -1
  223. package/umd/radio/index.d.ts +2 -2
  224. package/umd/radio/radio.d.ts +1 -1
  225. package/umd/radio/type.d.ts +2 -2
  226. package/umd/skeleton/elements.js +9 -3
  227. package/umd/slider/hooks/index.d.ts +1 -1
  228. package/umd/slider/hooks/useSliderEvents.d.ts +1 -1
  229. package/umd/stepper/hooks/useValue.d.ts +2 -1
  230. package/umd/steps/index.d.ts +1 -1
  231. package/umd/tabs/type.d.ts +2 -2
  232. package/umd/toast/index.d.ts +12 -12
  233. package/umd/toast/index.js +1 -1
@@ -1,16 +1,16 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports", "@babel/runtime/helpers/extends", "react", "es6-promise"], factory);
3
+ define(["exports", "@babel/runtime/helpers/extends", "react", "es6-promise", "./type", "./utils"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("es6-promise"));
5
+ factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("es6-promise"), require("./type"), require("./utils"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports, global._extends, global.react, global.es6Promise);
10
+ factory(mod.exports, global._extends, global.react, global.es6Promise, global.type, global.utils);
11
11
  global.useForm = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends6, _react, _es6Promise) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends6, _react, _es6Promise, _type, _utils) {
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -49,7 +49,11 @@
49
49
  return {
50
50
  registerField: defaultFunc,
51
51
  setInitialValues: defaultFunc,
52
- setCallbacks: defaultFunc
52
+ setCallbacks: defaultFunc,
53
+ getInitialValue: defaultFunc,
54
+ setInitialValue: defaultFunc,
55
+ innerSetFieldsValue: defaultFunc,
56
+ innerSetFieldValue: defaultFunc
53
57
  };
54
58
  }
55
59
  }; // 在field的静态的状态下设置
@@ -64,42 +68,82 @@
64
68
  this._initialValues = {};
65
69
  this._callbacks = {};
66
70
 
67
- this.setFieldsValue = function (values) {
71
+ this.commonSetFieldsValue = function (values, changeType) {
68
72
  var oldValues = Object.keys(values).reduce(function (acc, key) {
69
73
  var _extends2;
70
74
 
71
75
  return (0, _extends6.default)({}, acc, (_extends2 = {}, _extends2[key] = _this.getFieldValue(key), _extends2));
72
76
  }, {});
73
77
  _this._formData = (0, _extends6.default)({}, _this._formData, values);
78
+
79
+ _this.notifyField(values, oldValues, changeType);
80
+ };
81
+
82
+ this.setFieldsValue = function (values) {
83
+ _this.commonSetFieldsValue(values);
84
+
74
85
  var onValuesChange = _this._callbacks.onValuesChange;
75
- onValuesChange && onValuesChange(values, _this._formData);
86
+ onValuesChange == null ? void 0 : onValuesChange(values, _this._formData);
87
+ return true;
88
+ };
76
89
 
77
- _this.notifyField(values, oldValues);
90
+ this.innerSetFieldsValue = function (values, changeType) {
91
+ _this.commonSetFieldsValue(values, changeType);
78
92
 
93
+ var _this$_callbacks = _this._callbacks,
94
+ onValuesChange = _this$_callbacks.onValuesChange,
95
+ onChange = _this$_callbacks.onChange;
96
+ onValuesChange == null ? void 0 : onValuesChange(values, _this._formData);
97
+ onChange == null ? void 0 : onChange(values, _this._formData);
79
98
  return true;
80
99
  };
81
100
 
82
- this.setFieldValue = function (name, value) {
83
- var _oldValues, _extends3, _onValuesChange, _this$notifyField;
101
+ this.commonSetFieldValue = function (name, value, changeType) {
102
+ var _oldValues, _extends3, _this$notifyField;
84
103
 
85
104
  var oldValues = (_oldValues = {}, _oldValues[name] = _this.getFieldValue(name), _oldValues);
86
105
  _this._formData = (0, _extends6.default)({}, _this._formData, (_extends3 = {}, _extends3[name] = value, _extends3));
106
+
107
+ _this.notifyField((_this$notifyField = {}, _this$notifyField[name] = value, _this$notifyField), oldValues, changeType);
108
+ };
109
+
110
+ this.setFieldValue = function (name, value) {
111
+ var _onValuesChange;
112
+
113
+ _this.commonSetFieldValue(name, value);
114
+
87
115
  var onValuesChange = _this._callbacks.onValuesChange;
88
- onValuesChange && onValuesChange((_onValuesChange = {}, _onValuesChange[name] = value, _onValuesChange), _this._formData);
116
+ onValuesChange && onValuesChange((_onValuesChange = {}, _onValuesChange[name] = value, _onValuesChange), _this.getFieldsValue());
117
+ return true;
118
+ };
119
+
120
+ this.innerSetFieldValue = function (name, value, changeType) {
121
+ var _onValuesChange2, _onChange;
89
122
 
90
- _this.notifyField((_this$notifyField = {}, _this$notifyField[name] = value, _this$notifyField), oldValues);
123
+ _this.commonSetFieldValue(name, value, changeType);
91
124
 
125
+ var _this$_callbacks2 = _this._callbacks,
126
+ onValuesChange = _this$_callbacks2.onValuesChange,
127
+ onChange = _this$_callbacks2.onChange;
128
+ onValuesChange && onValuesChange((_onValuesChange2 = {}, _onValuesChange2[name] = value, _onValuesChange2), _this._formData);
129
+ onChange && onChange((_onChange = {}, _onChange[name] = value, _onChange), _this._formData);
92
130
  return true;
93
131
  };
94
132
 
95
- this.notifyField = function (values, oldValues) {
133
+ this.notifyField = function (values, oldValues, changeType) {
134
+ if (changeType === void 0) {
135
+ changeType = _type.ValueChangeType.Update;
136
+ }
137
+
96
138
  Object.keys(values).map(function (fieldName) {
97
139
  var _this$_fieldsList;
98
140
 
99
141
  var fieldObj = ((_this$_fieldsList = _this._fieldsList) == null ? void 0 : _this$_fieldsList[fieldName]) || null;
100
142
 
101
143
  if (fieldObj) {
102
- fieldObj.onValueChange(values[fieldName], oldValues[fieldName]);
144
+ fieldObj.onValueChange(values[fieldName], oldValues[fieldName], {
145
+ changeType: changeType
146
+ });
103
147
  }
104
148
  });
105
149
  };
@@ -111,13 +155,13 @@
111
155
  });
112
156
  }
113
157
 
114
- return _this._formData;
158
+ return (0, _utils.deepClone)(_this._formData);
115
159
  };
116
160
 
117
161
  this.getFieldValue = function (name) {
118
162
  var _this$_formData;
119
163
 
120
- return (_this$_formData = _this._formData) == null ? void 0 : _this$_formData[name];
164
+ return (0, _utils.deepClone)((_this$_formData = _this._formData) == null ? void 0 : _this$_formData[name]);
121
165
  };
122
166
 
123
167
  this.getFieldError = function (name) {
@@ -180,13 +224,42 @@
180
224
  };
181
225
 
182
226
  this.setInitialValues = function (initVal) {
183
- _this._initialValues = (0, _extends6.default)({}, initVal || {});
227
+ _this._initialValues = (0, _utils.deepClone)(initVal || {});
184
228
 
185
229
  _this.setFieldsValue(initVal);
186
230
  };
187
231
 
232
+ this.setInitialValue = function (fieldName, value) {
233
+ if (!fieldName) {
234
+ return;
235
+ }
236
+
237
+ _this._initialValues[fieldName] = value;
238
+
239
+ _this.setFieldValue(fieldName, value);
240
+ };
241
+
242
+ this.getInitialValue = function (fieldName) {
243
+ return _this._initialValues[fieldName];
244
+ };
245
+
188
246
  this.resetFields = function () {
189
- _this.setFieldsValue(_this._initialValues);
247
+ var oldValues = (0, _extends6.default)({}, _this._formData);
248
+ var initialValues = {};
249
+ Object.keys(_this._formData).forEach(function (fieldName) {
250
+ var _this$_fieldsList5;
251
+
252
+ var fieldObj = ((_this$_fieldsList5 = _this._fieldsList) == null ? void 0 : _this$_fieldsList5[fieldName]) || null;
253
+
254
+ if (fieldObj) {
255
+ initialValues[fieldName] = fieldObj.getInitialValue();
256
+ }
257
+ });
258
+ var onValuesChange = _this._callbacks.onValuesChange;
259
+ onValuesChange && onValuesChange(initialValues, _this._formData);
260
+ _this._formData = initialValues;
261
+
262
+ _this.notifyField(initialValues, oldValues, _type.ValueChangeType.Reset);
190
263
  };
191
264
 
192
265
  this.validateFields = function () {
@@ -218,7 +291,7 @@
218
291
  this.submit = function () {
219
292
  _this.validateFields().then(function (result) {
220
293
  var onSubmit = _this._callbacks.onSubmit;
221
- onSubmit == null ? void 0 : onSubmit(_this._formData, result);
294
+ onSubmit == null ? void 0 : onSubmit(_this.getFieldsValue(), result);
222
295
  }).catch(function (e) {
223
296
  var onSubmitFailed = _this._callbacks.onSubmitFailed;
224
297
 
@@ -226,7 +299,7 @@
226
299
  return;
227
300
  }
228
301
 
229
- onSubmitFailed(_this._formData, e);
302
+ onSubmitFailed(_this.getFieldsValue(), e);
230
303
  });
231
304
  };
232
305
 
@@ -255,7 +328,11 @@
255
328
  return {
256
329
  registerField: _this.registerField,
257
330
  setInitialValues: _this.setInitialValues,
258
- setCallbacks: _this.setCallbacks
331
+ setCallbacks: _this.setCallbacks,
332
+ getInitialValue: _this.getInitialValue,
333
+ setInitialValue: _this.setInitialValue,
334
+ innerSetFieldsValue: _this.innerSetFieldsValue,
335
+ innerSetFieldValue: _this.innerSetFieldValue
259
336
  };
260
337
  };
261
338
  };
@@ -5,3 +5,5 @@ export declare const getErrorAndWarnings: (result: ValidatorError[]) => {
5
5
  errors: string[];
6
6
  errorTypes: string[];
7
7
  };
8
+ export declare const getDefaultValueForInterComponent: (componentType: string) => 0 | never[] | null | undefined;
9
+ export declare function deepClone(value: any): any;
package/umd/form/utils.js CHANGED
@@ -1,20 +1,24 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports"], factory);
3
+ define(["exports", "@arco-design/mobile-utils", "lodash/cloneDeepWith", "./type"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports);
5
+ factory(exports, require("@arco-design/mobile-utils"), require("lodash/cloneDeepWith"), require("./type"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports);
10
+ factory(mod.exports, global.mobileUtils, global.cloneDeepWith, global.type);
11
11
  global.utils = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _mobileUtils, _cloneDeepWith, _type) {
14
14
  "use strict";
15
15
 
16
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
+
16
18
  _exports.__esModule = true;
17
- _exports.isFieldRequired = _exports.getErrorAndWarnings = void 0;
19
+ _exports.deepClone = deepClone;
20
+ _exports.isFieldRequired = _exports.getErrorAndWarnings = _exports.getDefaultValueForInterComponent = void 0;
21
+ _cloneDeepWith = _interopRequireDefault(_cloneDeepWith);
18
22
 
19
23
  var isFieldRequired = function isFieldRequired(rules) {
20
24
  if (rules === void 0) {
@@ -58,4 +62,35 @@
58
62
  };
59
63
 
60
64
  _exports.getErrorAndWarnings = getErrorAndWarnings;
65
+
66
+ var getDefaultValueForInterComponent = function getDefaultValueForInterComponent(componentType) {
67
+ switch (componentType) {
68
+ case _type.FormInternalComponentType.Input:
69
+ case _type.FormInternalComponentType.Textarea:
70
+ return undefined;
71
+
72
+ case _type.FormInternalComponentType.CheckboxGroup:
73
+ return [];
74
+
75
+ case _type.FormInternalComponentType.RadioGroup:
76
+ return null;
77
+
78
+ case _type.FormInternalComponentType.Slider:
79
+ case _type.FormInternalComponentType.Rate:
80
+ return 0;
81
+
82
+ default:
83
+ return undefined;
84
+ }
85
+ };
86
+
87
+ _exports.getDefaultValueForInterComponent = getDefaultValueForInterComponent;
88
+
89
+ function deepClone(value) {
90
+ return (0, _cloneDeepWith.default)(value, function (val) {
91
+ if (!(0, _mobileUtils.isObject)(val) && !(0, _mobileUtils.isArray)(val)) {
92
+ return val;
93
+ }
94
+ });
95
+ }
61
96
  });
@@ -280,9 +280,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
280
280
  * @param {ImagePreviewProps} config configuration
281
281
  * @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
282
282
  */
283
- open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "offsetBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "renderExtra" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
283
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "ref" | "className" | "style" | "context" | "key" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "offsetBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "renderExtra" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
284
284
  close: () => void;
285
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "offsetBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "renderExtra" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
285
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "ref" | "className" | "style" | "context" | "key" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "onClose" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "offsetBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "renderExtra" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
286
286
  };
287
287
  };
288
288
  /**
@@ -91,7 +91,9 @@
91
91
  stickyStyle: "absolute",
92
92
  getScrollContainer: getScrollContainer,
93
93
  ref: function ref(stickyRef) {
94
- return stickyRef && updateRef(groupIndex, stickyRef);
94
+ if (stickyRef) {
95
+ updateRef(groupIndex, stickyRef);
96
+ }
95
97
  }
96
98
  }, titleDom) : titleDom;
97
99
  };
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import type { IndexBarBaseData, IndexBarProps, IndexBarRef } from './type';
2
+ import type { IndexBarBaseData, IndexBarProps, IndexBarRef, IndexBarGroupProps } from './type';
3
3
  export type { IndexBarProps, IndexBarRef, IndexBarGroupProps, IndexBarGroupRef, IndexBarChangeTrigger, IndexBarIndexType, IndexBarTipType, } from './type';
4
4
  declare const _default: React.ForwardRefExoticComponent<IndexBarProps<IndexBarBaseData> & React.RefAttributes<IndexBarRef>> & {
5
- Group: React.ForwardRefExoticComponent<import("./type").IndexBarGroupProps<IndexBarBaseData> & React.RefAttributes<import("./type").IndexBarGroupRef>>;
5
+ Group: React.ForwardRefExoticComponent<IndexBarGroupProps<IndexBarBaseData> & React.RefAttributes<import("./type").IndexBarGroupRef>>;
6
6
  };
7
7
  /**
8
8
  * 索引栏组件
@@ -1,6 +1,6 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  import { IndexBarIndexType } from './type';
3
3
  export declare function filterValidIndexBarChild(children: ReactNode): ReactElement<any, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>[];
4
- export declare function getFormatIndex(index: IndexBarIndexType, activeIndex: IndexBarIndexType | undefined): string | number;
4
+ export declare function getFormatIndex(index: IndexBarIndexType, activeIndex: IndexBarIndexType | undefined): import("react").ReactText;
5
5
  export declare function isValidIndex(index: unknown): index is IndexBarIndexType;
6
6
  export declare function getGroupDomFromIndex(containerDom: HTMLDivElement, activeIndex: IndexBarIndexType): HTMLDivElement | null;
@@ -65,7 +65,7 @@
65
65
  function renderInput(_ref) {
66
66
  var prefixCls = _ref.prefixCls;
67
67
  var prefix = prefixCls + "-input";
68
- return renderWrapper(prefix, type, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, nativeProps, {
68
+ return renderWrapper(prefix, type + " single-line", /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, nativeProps, {
69
69
  id: id,
70
70
  name: name,
71
71
  maxLength: maxLength,
@@ -205,11 +205,11 @@ declare const _default: React.ForwardRefExoticComponent<MaskingProps & React.Ref
205
205
  * @param {MaskingProps} config Configuration
206
206
  * @returns {{ close: () => void; update: (newConfig: MaskingProps) => void; }}
207
207
  */
208
- open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove"> & {
208
+ open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "ref" | "className" | "children" | "context" | "key" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove"> & {
209
209
  key?: string | undefined;
210
210
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
211
211
  close: () => void;
212
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove"> & {
212
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "ref" | "className" | "children" | "context" | "key" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove"> & {
213
213
  key?: string | undefined;
214
214
  }) => void;
215
215
  };
@@ -51,8 +51,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
51
51
  * @param {string | NotifyProps} config
52
52
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
53
53
  */
54
- info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
54
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">) => void;
56
56
  close: () => void;
57
57
  };
58
58
  /**
@@ -61,8 +61,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
61
61
  * @param {string | NotifyProps} config
62
62
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
63
63
  */
64
- success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
64
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">) => void;
66
66
  close: () => void;
67
67
  };
68
68
  /**
@@ -71,8 +71,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
71
71
  * @param {string | NotifyProps} config
72
72
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
73
73
  */
74
- error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
74
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">) => void;
76
76
  close: () => void;
77
77
  };
78
78
  /**
@@ -81,8 +81,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
81
81
  * @param {string | NotifyProps} config
82
82
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
83
83
  */
84
- warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
84
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "ref" | "className" | "style" | "duration" | "content" | "transitionDuration" | "context" | "key" | "type" | "getContainer" | "onClose">) => void;
86
86
  close: () => void;
87
87
  };
88
88
  };
@@ -53,8 +53,8 @@
53
53
  getContainer = props.getContainer;
54
54
  var domRef = (0, _react.useRef)(null);
55
55
  var innerRef = (0, _react.useRef)(null);
56
- var closeTimerRef = (0, _react.useRef)();
57
- var onCloseTimeRef = (0, _react.useRef)();
56
+ var closeTimerRef = (0, _react.useRef)(undefined);
57
+ var onCloseTimeRef = (0, _react.useRef)(undefined);
58
58
 
59
59
  var _useState = (0, _react.useState)(!visible),
60
60
  hasTrans = _useState[0],
@@ -135,7 +135,9 @@
135
135
  rows: rows,
136
136
  hideEmptyCols: hideEmptyCols,
137
137
  ref: function ref(cellRef) {
138
- return cellRef && (pickerCellsRef.current[index] = cellRef);
138
+ if (cellRef) {
139
+ pickerCellsRef.current[index] = cellRef;
140
+ }
139
141
  },
140
142
  touchToStop: touchToStop
141
143
  });
@@ -75,7 +75,7 @@
75
75
  var rowCount = Math.max(rows % 2 === 0 ? rows + 1 : rows, 3);
76
76
  var isTouchMoveRef = (0, _react.useRef)(false);
77
77
  var isTouchStopped = (0, _react.useRef)(false);
78
- var unmountCallbackRef = (0, _react.useRef)();
78
+ var unmountCallbackRef = (0, _react.useRef)(undefined);
79
79
  var timeRef = (0, _react.useRef)(null);
80
80
  var colStyle = (0, _react.useMemo)(function () {
81
81
  return (0, _helpers.getStyleWithVendor)((0, _extends2.default)({
@@ -265,7 +265,9 @@
265
265
  rows: rows,
266
266
  hideEmptyCols: hideEmptyCols,
267
267
  ref: function ref(cellRef) {
268
- return cellRef && (pickerCellsRef.current[index] = cellRef);
268
+ if (cellRef) {
269
+ pickerCellsRef.current[index] = cellRef;
270
+ }
269
271
  },
270
272
  touchToStop: touchToStop
271
273
  });
@@ -66,11 +66,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupProps & React.RefAt
66
66
  * @param {PopupProps} config Configuration
67
67
  * @returns {{ close: () => void; update: (newConfig: PopupProps) => void; }}
68
68
  */
69
- open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
69
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
70
70
  key?: string | undefined;
71
71
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
72
72
  close: () => void;
73
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
73
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
74
74
  key?: string | undefined;
75
75
  }) => void;
76
76
  };
@@ -73,11 +73,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
73
73
  * @param {string | PopupSwiperProps} config Configuration
74
74
  * @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
75
75
  */
76
- open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
76
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
77
77
  key?: string | undefined;
78
78
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
79
79
  close: () => void;
80
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
80
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "ref" | "className" | "children" | "direction" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
81
81
  key?: string | undefined;
82
82
  }) => void;
83
83
  };
@@ -17,14 +17,14 @@ export declare const useCommonState: ({ onRefresh, loosingMinHeight, }: {
17
17
  tipsHeight: number;
18
18
  };
19
19
  export declare const useAddScrollEvents: ({ domRef, handleTouchStart, handleTouchMove, handleTouchEnd, }: {
20
- domRef: RefObject<HTMLDivElement>;
20
+ domRef: RefObject<HTMLDivElement | null>;
21
21
  handleTouchStart: (evt: HTMLElementEventMap['touchstart']) => void;
22
22
  handleTouchMove: (evt: HTMLElementEventMap['touchmove']) => void;
23
23
  handleTouchEnd: (evt: HTMLElementEventMap['touchend']) => void;
24
24
  }) => void;
25
25
  export declare const useCheckAsStart: ({ allowPullWhenNotTop, domRef, }: {
26
26
  allowPullWhenNotTop: boolean;
27
- domRef: RefObject<HTMLDivElement>;
27
+ domRef: RefObject<HTMLDivElement | null>;
28
28
  }) => {
29
29
  ifShouldHandle: () => boolean | null;
30
30
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps, RadioGroupRef, RadioProps, RadioRef, ValueType } from './type';
3
3
  import { GroupContextParams } from '../checkbox';
4
- export declare const RadioGroupContext: React.Context<GroupContextParams<string | number>>;
4
+ export declare const RadioGroupContext: React.Context<GroupContextParams<React.ReactText>>;
5
5
  export declare function componentGenerator<T extends ValueType = ValueType, P extends RadioProps<T> = RadioProps<T>, R extends RadioRef = RadioRef>(Comp: React.ForwardRefExoticComponent<P & React.RefAttributes<R>>): React.ForwardRefExoticComponent<RadioGroupProps<T, P> & React.RefAttributes<RadioGroupRef>>;
@@ -97,7 +97,7 @@
97
97
  layout: layout,
98
98
  disabled: disabled,
99
99
  icons: icons,
100
- value: groupValue === void 0 ? [] : [groupValue],
100
+ value: groupValue === void 0 || groupValue === null ? [] : [groupValue],
101
101
  onChange: handleChange
102
102
  }
103
103
  }, children, !children && options && options.map(function (option) {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export * from './type';
3
- declare const _default: import("react").ForwardRefExoticComponent<import("./type").RadioProps<string | number> & import("react").RefAttributes<import("./type").RadioRef>> & {
4
- Group: import("react").ForwardRefExoticComponent<import("./type").RadioGroupProps<string | number, import("./type").RadioProps<string | number> & import("react").RefAttributes<import("./type").RadioRef>> & import("react").RefAttributes<import("./type").RadioGroupRef>> & {
3
+ declare const _default: import("react").ForwardRefExoticComponent<import("./type").RadioProps<import("react").ReactText> & import("react").RefAttributes<import("./type").RadioRef>> & {
4
+ Group: import("react").ForwardRefExoticComponent<import("./type").RadioGroupProps<import("react").ReactText, import("./type").RadioProps<import("react").ReactText> & import("react").RefAttributes<import("./type").RadioRef>> & import("react").RefAttributes<import("./type").RadioGroupRef>> & {
5
5
  displayName?: string | undefined;
6
6
  };
7
7
  } & {
@@ -2,4 +2,4 @@ import React from 'react';
2
2
  import { CheckboxProps, CheckboxRef } from '../checkbox';
3
3
  import { RadioProps, RadioRef, ValueType } from './type';
4
4
  export declare function componentGenerator<T extends ValueType = ValueType, P extends CheckboxProps<T> = CheckboxProps<T>, R extends CheckboxRef = CheckboxRef>(Comp: React.ForwardRefExoticComponent<P & React.RefAttributes<R>>): React.ForwardRefExoticComponent<RadioProps<T> & React.RefAttributes<RadioRef>>;
5
- export declare const Radio: React.ForwardRefExoticComponent<RadioProps<string | number> & React.RefAttributes<RadioRef>>;
5
+ export declare const Radio: React.ForwardRefExoticComponent<RadioProps<React.ReactText> & React.RefAttributes<RadioRef>>;
@@ -8,10 +8,10 @@ export interface RadioGroupProps<T extends ValueType = ValueType, P extends Radi
8
8
  */
9
9
  options?: P[];
10
10
  /**
11
- * 受控模式,选中的选项
11
+ * 受控模式,选中的选项,传null表示取消选中
12
12
  * @en Checked option, controlled mode
13
13
  */
14
- value?: T;
14
+ value?: T | null;
15
15
  /**
16
16
  * 默认选中项
17
17
  * @en Default checked value
@@ -191,7 +191,9 @@
191
191
  backgroundColor: backgroundColor
192
192
  },
193
193
  ref: function ref(el) {
194
- return el && (lineDomRefs.current[idx] = el);
194
+ if (el) {
195
+ lineDomRefs.current[idx] = el;
196
+ }
195
197
  }
196
198
  }, isGradientAnimation && offsets !== undefined && /*#__PURE__*/_react.default.createElement("div", {
197
199
  className: prefixCls + "-skeleton-animation-item",
@@ -279,7 +281,9 @@
279
281
  backgroundColor: backgroundColor
280
282
  },
281
283
  ref: function ref(el) {
282
- return el && (iconDomRefs.current[idx] = el);
284
+ if (el) {
285
+ iconDomRefs.current[idx] = el;
286
+ }
283
287
  }
284
288
  }, isGradientAnimation && iconOffsets !== undefined && /*#__PURE__*/_react.default.createElement("div", {
285
289
  className: prefixCls + "-skeleton-animation-item",
@@ -292,7 +296,9 @@
292
296
  backgroundColor: backgroundColor
293
297
  },
294
298
  ref: function ref(el) {
295
- return el && (textDomRefs.current[idx] = el);
299
+ if (el) {
300
+ textDomRefs.current[idx] = el;
301
+ }
296
302
  }
297
303
  }, isGradientAnimation && textOffsets !== undefined && /*#__PURE__*/_react.default.createElement("div", {
298
304
  className: prefixCls + "-skeleton-animation-item",