@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.
- package/CHANGELOG.md +23 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.d.ts +1 -1
- package/cjs/_helpers/hooks.js +1 -1
- package/cjs/_helpers/react-dom.d.ts +5 -5
- package/cjs/_helpers/react-dom.js +49 -32
- package/cjs/_helpers/render.js +6 -3
- package/cjs/action-sheet/index.d.ts +3 -2
- package/cjs/action-sheet/index.js +2 -2
- package/cjs/carousel/index.js +8 -7
- package/cjs/checkbox/checkbox.d.ts +1 -1
- package/cjs/checkbox/group.d.ts +1 -1
- package/cjs/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/cjs/checkbox/index.d.ts +2 -2
- package/cjs/context-provider/index.d.ts +8 -2
- package/cjs/count-down/hooks.js +2 -2
- package/cjs/dialog/index.d.ts +8 -3
- package/cjs/dialog/methods.d.ts +6 -2
- package/cjs/dropdown-menu/helper.d.ts +2 -2
- package/cjs/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/cjs/ellipsis/components/native-ellipsis.js +1 -2
- package/cjs/form/form-item.d.ts +33 -2
- package/cjs/form/form-item.js +142 -121
- package/cjs/form/index.js +3 -1
- package/cjs/form/linked-container.d.ts +1 -1
- package/cjs/form/linked-container.js +4 -0
- package/cjs/form/style/css/index.css +4 -1
- package/cjs/form/style/index.less +6 -1
- package/cjs/form/type.d.ts +29 -6
- package/cjs/form/type.js +10 -2
- package/cjs/form/useForm.d.ts +2 -17
- package/cjs/form/useForm.js +98 -17
- package/cjs/form/utils.d.ts +2 -0
- package/cjs/form/utils.js +42 -2
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/index-bar/group.js +3 -1
- package/cjs/index-bar/index.d.ts +2 -2
- package/cjs/index-bar/utils.d.ts +1 -1
- package/cjs/input/index.js +1 -1
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/notify/index.d.ts +8 -8
- package/cjs/notify/index.js +2 -2
- package/cjs/picker-view/components/cascader.js +3 -1
- package/cjs/picker-view/components/picker-cell.js +1 -1
- package/cjs/picker-view/index.js +3 -1
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/pull-refresh/hooks.d.ts +2 -2
- package/cjs/radio/group.d.ts +1 -1
- package/cjs/radio/group.js +1 -1
- package/cjs/radio/index.d.ts +2 -2
- package/cjs/radio/radio.d.ts +1 -1
- package/cjs/radio/type.d.ts +2 -2
- package/cjs/skeleton/elements.js +9 -3
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/hooks/useSliderEvents.d.ts +1 -1
- package/cjs/stepper/hooks/useValue.d.ts +2 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/tabs/type.d.ts +2 -2
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/index.js +1 -1
- package/dist/index.js +3070 -411
- package/dist/index.min.js +4 -4
- package/dist/style.css +4 -1
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.d.ts +1 -1
- package/esm/_helpers/hooks.js +1 -1
- package/esm/_helpers/react-dom.d.ts +5 -5
- package/esm/_helpers/react-dom.js +49 -30
- package/esm/_helpers/render.js +6 -3
- package/esm/action-sheet/index.d.ts +3 -2
- package/esm/action-sheet/index.js +2 -2
- package/esm/carousel/index.js +8 -7
- package/esm/checkbox/checkbox.d.ts +1 -1
- package/esm/checkbox/group.d.ts +1 -1
- package/esm/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/esm/checkbox/index.d.ts +2 -2
- package/esm/context-provider/index.d.ts +8 -2
- package/esm/count-down/hooks.js +2 -2
- package/esm/dialog/index.d.ts +8 -3
- package/esm/dialog/methods.d.ts +6 -2
- package/esm/dropdown-menu/helper.d.ts +2 -2
- package/esm/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/esm/ellipsis/components/native-ellipsis.js +1 -1
- package/esm/form/form-item.d.ts +33 -2
- package/esm/form/form-item.js +143 -122
- package/esm/form/index.js +3 -1
- package/esm/form/linked-container.d.ts +1 -1
- package/esm/form/linked-container.js +4 -0
- package/esm/form/style/css/index.css +4 -1
- package/esm/form/style/index.less +6 -1
- package/esm/form/type.d.ts +29 -6
- package/esm/form/type.js +8 -1
- package/esm/form/useForm.d.ts +2 -17
- package/esm/form/useForm.js +97 -17
- package/esm/form/utils.d.ts +2 -0
- package/esm/form/utils.js +31 -1
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/index-bar/group.js +3 -1
- package/esm/index-bar/index.d.ts +2 -2
- package/esm/index-bar/utils.d.ts +1 -1
- package/esm/input/index.js +1 -1
- package/esm/masking/index.d.ts +2 -2
- package/esm/notify/index.d.ts +8 -8
- package/esm/notify/index.js +2 -2
- package/esm/picker-view/components/cascader.js +3 -1
- package/esm/picker-view/components/picker-cell.js +1 -1
- package/esm/picker-view/index.js +3 -1
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/pull-refresh/hooks.d.ts +2 -2
- package/esm/radio/group.d.ts +1 -1
- package/esm/radio/group.js +1 -1
- package/esm/radio/index.d.ts +2 -2
- package/esm/radio/radio.d.ts +1 -1
- package/esm/radio/type.d.ts +2 -2
- package/esm/skeleton/elements.js +9 -3
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/hooks/useSliderEvents.d.ts +1 -1
- package/esm/stepper/hooks/useValue.d.ts +2 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/tabs/type.d.ts +2 -2
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/index.js +1 -1
- package/esnext/_helpers/hooks.js +1 -1
- package/esnext/_helpers/react-dom.d.ts +5 -5
- package/esnext/_helpers/react-dom.js +47 -28
- package/esnext/_helpers/render.js +3 -2
- package/esnext/action-sheet/index.d.ts +3 -2
- package/esnext/action-sheet/index.js +1 -1
- package/esnext/carousel/index.js +7 -5
- package/esnext/context-provider/index.d.ts +8 -2
- package/esnext/context-provider/index.js +1 -1
- package/esnext/count-down/hooks.js +2 -2
- package/esnext/dialog/index.d.ts +8 -3
- package/esnext/dialog/methods.d.ts +6 -2
- package/esnext/dropdown-menu/helper.d.ts +1 -1
- package/esnext/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/esnext/ellipsis/components/native-ellipsis.js +1 -1
- package/esnext/form/form-item.d.ts +33 -2
- package/esnext/form/form-item.js +85 -71
- package/esnext/form/index.js +2 -1
- package/esnext/form/linked-container.d.ts +1 -1
- package/esnext/form/linked-container.js +3 -0
- package/esnext/form/style/css/index.css +4 -1
- package/esnext/form/style/index.less +6 -1
- package/esnext/form/type.d.ts +29 -6
- package/esnext/form/type.js +7 -0
- package/esnext/form/useForm.d.ts +2 -17
- package/esnext/form/useForm.js +72 -13
- package/esnext/form/utils.d.ts +2 -0
- package/esnext/form/utils.js +26 -0
- package/esnext/image-preview/index.d.ts +2 -2
- package/esnext/index-bar/group.js +5 -1
- package/esnext/index-bar/index.d.ts +2 -2
- package/esnext/input/index.js +1 -1
- package/esnext/masking/index.d.ts +2 -2
- package/esnext/notify/index.d.ts +8 -8
- package/esnext/notify/index.js +2 -2
- package/esnext/picker-view/components/cascader.js +5 -1
- package/esnext/picker-view/components/picker-cell.js +1 -1
- package/esnext/picker-view/index.js +5 -1
- package/esnext/popup/index.d.ts +2 -2
- package/esnext/popup-swiper/index.d.ts +2 -2
- package/esnext/pull-refresh/hooks.d.ts +2 -2
- package/esnext/radio/group.js +3 -1
- package/esnext/radio/type.d.ts +2 -2
- package/esnext/skeleton/elements.js +15 -3
- package/esnext/slider/hooks/useSliderEvents.d.ts +1 -1
- package/esnext/tabs/type.d.ts +2 -2
- package/esnext/toast/index.d.ts +12 -12
- package/esnext/toast/index.js +1 -1
- package/package.json +3 -3
- package/umd/_helpers/hooks.d.ts +1 -1
- package/umd/_helpers/hooks.js +1 -1
- package/umd/_helpers/react-dom.d.ts +5 -5
- package/umd/_helpers/react-dom.js +53 -35
- package/umd/_helpers/render.js +6 -3
- package/umd/action-sheet/index.d.ts +3 -2
- package/umd/action-sheet/index.js +2 -2
- package/umd/carousel/index.js +8 -7
- package/umd/checkbox/checkbox.d.ts +1 -1
- package/umd/checkbox/group.d.ts +1 -1
- package/umd/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/umd/checkbox/index.d.ts +2 -2
- package/umd/context-provider/index.d.ts +8 -2
- package/umd/count-down/hooks.js +2 -2
- package/umd/dialog/index.d.ts +8 -3
- package/umd/dialog/methods.d.ts +6 -2
- package/umd/dropdown-menu/helper.d.ts +2 -2
- package/umd/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/umd/ellipsis/components/native-ellipsis.js +1 -2
- package/umd/form/form-item.d.ts +33 -2
- package/umd/form/form-item.js +142 -121
- package/umd/form/index.js +3 -1
- package/umd/form/linked-container.d.ts +1 -1
- package/umd/form/linked-container.js +4 -0
- package/umd/form/style/css/index.css +4 -1
- package/umd/form/style/index.less +6 -1
- package/umd/form/type.d.ts +29 -6
- package/umd/form/type.js +9 -1
- package/umd/form/useForm.d.ts +2 -17
- package/umd/form/useForm.js +98 -21
- package/umd/form/utils.d.ts +2 -0
- package/umd/form/utils.js +40 -5
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/index-bar/group.js +3 -1
- package/umd/index-bar/index.d.ts +2 -2
- package/umd/index-bar/utils.d.ts +1 -1
- package/umd/input/index.js +1 -1
- package/umd/masking/index.d.ts +2 -2
- package/umd/notify/index.d.ts +8 -8
- package/umd/notify/index.js +2 -2
- package/umd/picker-view/components/cascader.js +3 -1
- package/umd/picker-view/components/picker-cell.js +1 -1
- package/umd/picker-view/index.js +3 -1
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/pull-refresh/hooks.d.ts +2 -2
- package/umd/radio/group.d.ts +1 -1
- package/umd/radio/group.js +1 -1
- package/umd/radio/index.d.ts +2 -2
- package/umd/radio/radio.d.ts +1 -1
- package/umd/radio/type.d.ts +2 -2
- package/umd/skeleton/elements.js +9 -3
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/hooks/useSliderEvents.d.ts +1 -1
- package/umd/stepper/hooks/useValue.d.ts +2 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/tabs/type.d.ts +2 -2
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/index.js +1 -1
package/cjs/form/useForm.js
CHANGED
@@ -12,6 +12,10 @@ var _react = require("react");
|
|
12
12
|
|
13
13
|
var _es6Promise = require("es6-promise");
|
14
14
|
|
15
|
+
var _type = require("./type");
|
16
|
+
|
17
|
+
var _utils = require("./utils");
|
18
|
+
|
15
19
|
/* eslint-disable no-console */
|
16
20
|
var defaultFunc = function defaultFunc() {};
|
17
21
|
|
@@ -41,7 +45,11 @@ var defaultFormDataMethods = {
|
|
41
45
|
return {
|
42
46
|
registerField: defaultFunc,
|
43
47
|
setInitialValues: defaultFunc,
|
44
|
-
setCallbacks: defaultFunc
|
48
|
+
setCallbacks: defaultFunc,
|
49
|
+
getInitialValue: defaultFunc,
|
50
|
+
setInitialValue: defaultFunc,
|
51
|
+
innerSetFieldsValue: defaultFunc,
|
52
|
+
innerSetFieldValue: defaultFunc
|
45
53
|
};
|
46
54
|
}
|
47
55
|
}; // 在field的静态的状态下设置
|
@@ -56,42 +64,82 @@ var FormData = function FormData() {
|
|
56
64
|
this._initialValues = {};
|
57
65
|
this._callbacks = {};
|
58
66
|
|
59
|
-
this.
|
67
|
+
this.commonSetFieldsValue = function (values, changeType) {
|
60
68
|
var oldValues = Object.keys(values).reduce(function (acc, key) {
|
61
69
|
var _extends2;
|
62
70
|
|
63
71
|
return (0, _extends6.default)({}, acc, (_extends2 = {}, _extends2[key] = _this.getFieldValue(key), _extends2));
|
64
72
|
}, {});
|
65
73
|
_this._formData = (0, _extends6.default)({}, _this._formData, values);
|
74
|
+
|
75
|
+
_this.notifyField(values, oldValues, changeType);
|
76
|
+
};
|
77
|
+
|
78
|
+
this.setFieldsValue = function (values) {
|
79
|
+
_this.commonSetFieldsValue(values);
|
80
|
+
|
66
81
|
var onValuesChange = _this._callbacks.onValuesChange;
|
67
|
-
onValuesChange
|
82
|
+
onValuesChange == null ? void 0 : onValuesChange(values, _this._formData);
|
83
|
+
return true;
|
84
|
+
};
|
68
85
|
|
69
|
-
|
86
|
+
this.innerSetFieldsValue = function (values, changeType) {
|
87
|
+
_this.commonSetFieldsValue(values, changeType);
|
70
88
|
|
89
|
+
var _this$_callbacks = _this._callbacks,
|
90
|
+
onValuesChange = _this$_callbacks.onValuesChange,
|
91
|
+
onChange = _this$_callbacks.onChange;
|
92
|
+
onValuesChange == null ? void 0 : onValuesChange(values, _this._formData);
|
93
|
+
onChange == null ? void 0 : onChange(values, _this._formData);
|
71
94
|
return true;
|
72
95
|
};
|
73
96
|
|
74
|
-
this.
|
75
|
-
var _oldValues, _extends3,
|
97
|
+
this.commonSetFieldValue = function (name, value, changeType) {
|
98
|
+
var _oldValues, _extends3, _this$notifyField;
|
76
99
|
|
77
100
|
var oldValues = (_oldValues = {}, _oldValues[name] = _this.getFieldValue(name), _oldValues);
|
78
101
|
_this._formData = (0, _extends6.default)({}, _this._formData, (_extends3 = {}, _extends3[name] = value, _extends3));
|
102
|
+
|
103
|
+
_this.notifyField((_this$notifyField = {}, _this$notifyField[name] = value, _this$notifyField), oldValues, changeType);
|
104
|
+
};
|
105
|
+
|
106
|
+
this.setFieldValue = function (name, value) {
|
107
|
+
var _onValuesChange;
|
108
|
+
|
109
|
+
_this.commonSetFieldValue(name, value);
|
110
|
+
|
79
111
|
var onValuesChange = _this._callbacks.onValuesChange;
|
80
|
-
onValuesChange && onValuesChange((_onValuesChange = {}, _onValuesChange[name] = value, _onValuesChange), _this.
|
112
|
+
onValuesChange && onValuesChange((_onValuesChange = {}, _onValuesChange[name] = value, _onValuesChange), _this.getFieldsValue());
|
113
|
+
return true;
|
114
|
+
};
|
81
115
|
|
82
|
-
|
116
|
+
this.innerSetFieldValue = function (name, value, changeType) {
|
117
|
+
var _onValuesChange2, _onChange;
|
83
118
|
|
119
|
+
_this.commonSetFieldValue(name, value, changeType);
|
120
|
+
|
121
|
+
var _this$_callbacks2 = _this._callbacks,
|
122
|
+
onValuesChange = _this$_callbacks2.onValuesChange,
|
123
|
+
onChange = _this$_callbacks2.onChange;
|
124
|
+
onValuesChange && onValuesChange((_onValuesChange2 = {}, _onValuesChange2[name] = value, _onValuesChange2), _this._formData);
|
125
|
+
onChange && onChange((_onChange = {}, _onChange[name] = value, _onChange), _this._formData);
|
84
126
|
return true;
|
85
127
|
};
|
86
128
|
|
87
|
-
this.notifyField = function (values, oldValues) {
|
129
|
+
this.notifyField = function (values, oldValues, changeType) {
|
130
|
+
if (changeType === void 0) {
|
131
|
+
changeType = _type.ValueChangeType.Update;
|
132
|
+
}
|
133
|
+
|
88
134
|
Object.keys(values).map(function (fieldName) {
|
89
135
|
var _this$_fieldsList;
|
90
136
|
|
91
137
|
var fieldObj = ((_this$_fieldsList = _this._fieldsList) == null ? void 0 : _this$_fieldsList[fieldName]) || null;
|
92
138
|
|
93
139
|
if (fieldObj) {
|
94
|
-
fieldObj.onValueChange(values[fieldName], oldValues[fieldName]
|
140
|
+
fieldObj.onValueChange(values[fieldName], oldValues[fieldName], {
|
141
|
+
changeType: changeType
|
142
|
+
});
|
95
143
|
}
|
96
144
|
});
|
97
145
|
};
|
@@ -103,13 +151,13 @@ var FormData = function FormData() {
|
|
103
151
|
});
|
104
152
|
}
|
105
153
|
|
106
|
-
return _this._formData;
|
154
|
+
return (0, _utils.deepClone)(_this._formData);
|
107
155
|
};
|
108
156
|
|
109
157
|
this.getFieldValue = function (name) {
|
110
158
|
var _this$_formData;
|
111
159
|
|
112
|
-
return (_this$_formData = _this._formData) == null ? void 0 : _this$_formData[name];
|
160
|
+
return (0, _utils.deepClone)((_this$_formData = _this._formData) == null ? void 0 : _this$_formData[name]);
|
113
161
|
};
|
114
162
|
|
115
163
|
this.getFieldError = function (name) {
|
@@ -172,13 +220,42 @@ var FormData = function FormData() {
|
|
172
220
|
};
|
173
221
|
|
174
222
|
this.setInitialValues = function (initVal) {
|
175
|
-
_this._initialValues = (0,
|
223
|
+
_this._initialValues = (0, _utils.deepClone)(initVal || {});
|
176
224
|
|
177
225
|
_this.setFieldsValue(initVal);
|
178
226
|
};
|
179
227
|
|
228
|
+
this.setInitialValue = function (fieldName, value) {
|
229
|
+
if (!fieldName) {
|
230
|
+
return;
|
231
|
+
}
|
232
|
+
|
233
|
+
_this._initialValues[fieldName] = value;
|
234
|
+
|
235
|
+
_this.setFieldValue(fieldName, value);
|
236
|
+
};
|
237
|
+
|
238
|
+
this.getInitialValue = function (fieldName) {
|
239
|
+
return _this._initialValues[fieldName];
|
240
|
+
};
|
241
|
+
|
180
242
|
this.resetFields = function () {
|
181
|
-
|
243
|
+
var oldValues = (0, _extends6.default)({}, _this._formData);
|
244
|
+
var initialValues = {};
|
245
|
+
Object.keys(_this._formData).forEach(function (fieldName) {
|
246
|
+
var _this$_fieldsList5;
|
247
|
+
|
248
|
+
var fieldObj = ((_this$_fieldsList5 = _this._fieldsList) == null ? void 0 : _this$_fieldsList5[fieldName]) || null;
|
249
|
+
|
250
|
+
if (fieldObj) {
|
251
|
+
initialValues[fieldName] = fieldObj.getInitialValue();
|
252
|
+
}
|
253
|
+
});
|
254
|
+
var onValuesChange = _this._callbacks.onValuesChange;
|
255
|
+
onValuesChange && onValuesChange(initialValues, _this._formData);
|
256
|
+
_this._formData = initialValues;
|
257
|
+
|
258
|
+
_this.notifyField(initialValues, oldValues, _type.ValueChangeType.Reset);
|
182
259
|
};
|
183
260
|
|
184
261
|
this.validateFields = function () {
|
@@ -210,7 +287,7 @@ var FormData = function FormData() {
|
|
210
287
|
this.submit = function () {
|
211
288
|
_this.validateFields().then(function (result) {
|
212
289
|
var onSubmit = _this._callbacks.onSubmit;
|
213
|
-
onSubmit == null ? void 0 : onSubmit(_this.
|
290
|
+
onSubmit == null ? void 0 : onSubmit(_this.getFieldsValue(), result);
|
214
291
|
}).catch(function (e) {
|
215
292
|
var onSubmitFailed = _this._callbacks.onSubmitFailed;
|
216
293
|
|
@@ -218,7 +295,7 @@ var FormData = function FormData() {
|
|
218
295
|
return;
|
219
296
|
}
|
220
297
|
|
221
|
-
onSubmitFailed(_this.
|
298
|
+
onSubmitFailed(_this.getFieldsValue(), e);
|
222
299
|
});
|
223
300
|
};
|
224
301
|
|
@@ -247,7 +324,11 @@ var FormData = function FormData() {
|
|
247
324
|
return {
|
248
325
|
registerField: _this.registerField,
|
249
326
|
setInitialValues: _this.setInitialValues,
|
250
|
-
setCallbacks: _this.setCallbacks
|
327
|
+
setCallbacks: _this.setCallbacks,
|
328
|
+
getInitialValue: _this.getInitialValue,
|
329
|
+
setInitialValue: _this.setInitialValue,
|
330
|
+
innerSetFieldsValue: _this.innerSetFieldsValue,
|
331
|
+
innerSetFieldValue: _this.innerSetFieldValue
|
251
332
|
};
|
252
333
|
};
|
253
334
|
};
|
package/cjs/form/utils.d.ts
CHANGED
@@ -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/cjs/form/utils.js
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
3
5
|
exports.__esModule = true;
|
4
|
-
exports.
|
6
|
+
exports.deepClone = deepClone;
|
7
|
+
exports.isFieldRequired = exports.getErrorAndWarnings = exports.getDefaultValueForInterComponent = void 0;
|
8
|
+
|
9
|
+
var _mobileUtils = require("@arco-design/mobile-utils");
|
10
|
+
|
11
|
+
var _cloneDeepWith = _interopRequireDefault(require("lodash/cloneDeepWith"));
|
12
|
+
|
13
|
+
var _type = require("./type");
|
5
14
|
|
6
15
|
var isFieldRequired = function isFieldRequired(rules) {
|
7
16
|
if (rules === void 0) {
|
@@ -44,4 +53,35 @@ var getErrorAndWarnings = function getErrorAndWarnings(result) {
|
|
44
53
|
};
|
45
54
|
};
|
46
55
|
|
47
|
-
exports.getErrorAndWarnings = getErrorAndWarnings;
|
56
|
+
exports.getErrorAndWarnings = getErrorAndWarnings;
|
57
|
+
|
58
|
+
var getDefaultValueForInterComponent = function getDefaultValueForInterComponent(componentType) {
|
59
|
+
switch (componentType) {
|
60
|
+
case _type.FormInternalComponentType.Input:
|
61
|
+
case _type.FormInternalComponentType.Textarea:
|
62
|
+
return undefined;
|
63
|
+
|
64
|
+
case _type.FormInternalComponentType.CheckboxGroup:
|
65
|
+
return [];
|
66
|
+
|
67
|
+
case _type.FormInternalComponentType.RadioGroup:
|
68
|
+
return null;
|
69
|
+
|
70
|
+
case _type.FormInternalComponentType.Slider:
|
71
|
+
case _type.FormInternalComponentType.Rate:
|
72
|
+
return 0;
|
73
|
+
|
74
|
+
default:
|
75
|
+
return undefined;
|
76
|
+
}
|
77
|
+
};
|
78
|
+
|
79
|
+
exports.getDefaultValueForInterComponent = getDefaultValueForInterComponent;
|
80
|
+
|
81
|
+
function deepClone(value) {
|
82
|
+
return (0, _cloneDeepWith.default)(value, function (val) {
|
83
|
+
if (!(0, _mobileUtils.isObject)(val) && !(0, _mobileUtils.isArray)(val)) {
|
84
|
+
return val;
|
85
|
+
}
|
86
|
+
});
|
87
|
+
}
|
@@ -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>>, "
|
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>>, "
|
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
|
/**
|
package/cjs/index-bar/group.js
CHANGED
@@ -86,7 +86,9 @@ var IndexBarGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
86
86
|
stickyStyle: "absolute",
|
87
87
|
getScrollContainer: getScrollContainer,
|
88
88
|
ref: function ref(stickyRef) {
|
89
|
-
|
89
|
+
if (stickyRef) {
|
90
|
+
updateRef(groupIndex, stickyRef);
|
91
|
+
}
|
90
92
|
}
|
91
93
|
}, titleDom) : titleDom;
|
92
94
|
};
|
package/cjs/index-bar/index.d.ts
CHANGED
@@ -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<
|
5
|
+
Group: React.ForwardRefExoticComponent<IndexBarGroupProps<IndexBarBaseData> & React.RefAttributes<import("./type").IndexBarGroupRef>>;
|
6
6
|
};
|
7
7
|
/**
|
8
8
|
* 索引栏组件
|
package/cjs/index-bar/utils.d.ts
CHANGED
@@ -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):
|
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;
|
package/cjs/input/index.js
CHANGED
@@ -60,7 +60,7 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
60
60
|
function renderInput(_ref) {
|
61
61
|
var prefixCls = _ref.prefixCls;
|
62
62
|
var prefix = prefixCls + "-input";
|
63
|
-
return renderWrapper(prefix, type, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, nativeProps, {
|
63
|
+
return renderWrapper(prefix, type + " single-line", /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, nativeProps, {
|
64
64
|
id: id,
|
65
65
|
name: name,
|
66
66
|
maxLength: maxLength,
|
package/cjs/masking/index.d.ts
CHANGED
@@ -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>>, "
|
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>>, "
|
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
|
};
|
package/cjs/notify/index.d.ts
CHANGED
@@ -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>>, "
|
55
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "
|
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>>, "
|
65
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "
|
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>>, "
|
75
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "
|
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>>, "
|
85
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "
|
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
|
};
|
package/cjs/notify/index.js
CHANGED
@@ -54,8 +54,8 @@ var Notify = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
54
54
|
getContainer = props.getContainer;
|
55
55
|
var domRef = (0, _react.useRef)(null);
|
56
56
|
var innerRef = (0, _react.useRef)(null);
|
57
|
-
var closeTimerRef = (0, _react.useRef)();
|
58
|
-
var onCloseTimeRef = (0, _react.useRef)();
|
57
|
+
var closeTimerRef = (0, _react.useRef)(undefined);
|
58
|
+
var onCloseTimeRef = (0, _react.useRef)(undefined);
|
59
59
|
|
60
60
|
var _useState = (0, _react.useState)(!visible),
|
61
61
|
hasTrans = _useState[0],
|
@@ -127,7 +127,9 @@ var Cascader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
127
127
|
rows: rows,
|
128
128
|
hideEmptyCols: hideEmptyCols,
|
129
129
|
ref: function ref(cellRef) {
|
130
|
-
|
130
|
+
if (cellRef) {
|
131
|
+
pickerCellsRef.current[index] = cellRef;
|
132
|
+
}
|
131
133
|
},
|
132
134
|
touchToStop: touchToStop
|
133
135
|
});
|
@@ -68,7 +68,7 @@ var PickerCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
68
68
|
var rowCount = Math.max(rows % 2 === 0 ? rows + 1 : rows, 3);
|
69
69
|
var isTouchMoveRef = (0, _react.useRef)(false);
|
70
70
|
var isTouchStopped = (0, _react.useRef)(false);
|
71
|
-
var unmountCallbackRef = (0, _react.useRef)();
|
71
|
+
var unmountCallbackRef = (0, _react.useRef)(undefined);
|
72
72
|
var timeRef = (0, _react.useRef)(null);
|
73
73
|
var colStyle = (0, _react.useMemo)(function () {
|
74
74
|
return (0, _helpers.getStyleWithVendor)((0, _extends2.default)({
|
package/cjs/picker-view/index.js
CHANGED
@@ -269,7 +269,9 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
269
269
|
rows: rows,
|
270
270
|
hideEmptyCols: hideEmptyCols,
|
271
271
|
ref: function ref(cellRef) {
|
272
|
-
|
272
|
+
if (cellRef) {
|
273
|
+
pickerCellsRef.current[index] = cellRef;
|
274
|
+
}
|
273
275
|
},
|
274
276
|
touchToStop: touchToStop
|
275
277
|
});
|
package/cjs/popup/index.d.ts
CHANGED
@@ -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>>, "
|
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>>, "
|
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>>, "
|
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>>, "
|
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
|
};
|
package/cjs/radio/group.d.ts
CHANGED
@@ -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<
|
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>>;
|
package/cjs/radio/group.js
CHANGED
@@ -90,7 +90,7 @@ function componentGenerator(Comp) {
|
|
90
90
|
layout: layout,
|
91
91
|
disabled: disabled,
|
92
92
|
icons: icons,
|
93
|
-
value: groupValue === void 0 ? [] : [groupValue],
|
93
|
+
value: groupValue === void 0 || groupValue === null ? [] : [groupValue],
|
94
94
|
onChange: handleChange
|
95
95
|
}
|
96
96
|
}, children, !children && options && options.map(function (option) {
|
package/cjs/radio/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
export * from './type';
|
3
|
-
declare const _default: import("react").ForwardRefExoticComponent<import("./type").RadioProps<
|
4
|
-
Group: import("react").ForwardRefExoticComponent<import("./type").RadioGroupProps<
|
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
|
} & {
|
package/cjs/radio/radio.d.ts
CHANGED
@@ -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<
|
5
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps<React.ReactText> & React.RefAttributes<RadioRef>>;
|
package/cjs/radio/type.d.ts
CHANGED
@@ -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
|
package/cjs/skeleton/elements.js
CHANGED
@@ -188,7 +188,9 @@ var SkeletonParagraph = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref
|
|
188
188
|
backgroundColor: backgroundColor
|
189
189
|
},
|
190
190
|
ref: function ref(el) {
|
191
|
-
|
191
|
+
if (el) {
|
192
|
+
lineDomRefs.current[idx] = el;
|
193
|
+
}
|
192
194
|
}
|
193
195
|
}, isGradientAnimation && offsets !== undefined && /*#__PURE__*/_react.default.createElement("div", {
|
194
196
|
className: prefixCls + "-skeleton-animation-item",
|
@@ -276,7 +278,9 @@ var SkeletonGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
276
278
|
backgroundColor: backgroundColor
|
277
279
|
},
|
278
280
|
ref: function ref(el) {
|
279
|
-
|
281
|
+
if (el) {
|
282
|
+
iconDomRefs.current[idx] = el;
|
283
|
+
}
|
280
284
|
}
|
281
285
|
}, isGradientAnimation && iconOffsets !== undefined && /*#__PURE__*/_react.default.createElement("div", {
|
282
286
|
className: prefixCls + "-skeleton-animation-item",
|
@@ -289,7 +293,9 @@ var SkeletonGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
289
293
|
backgroundColor: backgroundColor
|
290
294
|
},
|
291
295
|
ref: function ref(el) {
|
292
|
-
|
296
|
+
if (el) {
|
297
|
+
textDomRefs.current[idx] = el;
|
298
|
+
}
|
293
299
|
}
|
294
300
|
}, isGradientAnimation && textOffsets !== undefined && /*#__PURE__*/_react.default.createElement("div", {
|
295
301
|
className: prefixCls + "-skeleton-animation-item",
|
@@ -5,7 +5,7 @@ export declare type LinePosition = {
|
|
5
5
|
length: number;
|
6
6
|
start: number;
|
7
7
|
};
|
8
|
-
export declare const SliderContext: React.Context<Required<Pick<SliderProps, "
|
8
|
+
export declare const SliderContext: React.Context<Required<Pick<SliderProps, "className" | "style" | "disabled" | "step" | "size" | "type" | "onChange" | "onAfterChange" | "max" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks" | "renderThumbPopover">>;
|
9
9
|
export * from './useSliderIcon';
|
10
10
|
export * from './useSliderInit';
|
11
11
|
export * from './useSliderStyle';
|