@arco-design/mobile-react 2.25.0 → 2.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/checkbox/index.d.ts +4 -2
  5. package/cjs/checkbox/index.js +1 -1
  6. package/cjs/date-picker/index.d.ts +3 -1
  7. package/cjs/form/form-item.js +5 -4
  8. package/cjs/form/type.d.ts +5 -0
  9. package/cjs/image-picker/index.d.ts +3 -1
  10. package/cjs/input/index.d.ts +3 -1
  11. package/cjs/picker/index.d.ts +3 -1
  12. package/cjs/picker-view/index.d.ts +3 -1
  13. package/cjs/radio/index.d.ts +4 -2
  14. package/cjs/rate/index.d.ts +3 -1
  15. package/cjs/slider/index.d.ts +3 -1
  16. package/cjs/stepper/index.d.ts +3 -1
  17. package/cjs/switch/index.d.ts +3 -1
  18. package/cjs/textarea/index.d.ts +3 -1
  19. package/cjs/textarea/index.js +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/index.min.js +1 -1
  22. package/esm/checkbox/index.d.ts +4 -2
  23. package/esm/checkbox/index.js +1 -1
  24. package/esm/date-picker/index.d.ts +3 -1
  25. package/esm/form/form-item.js +5 -4
  26. package/esm/form/type.d.ts +5 -0
  27. package/esm/image-picker/index.d.ts +3 -1
  28. package/esm/input/index.d.ts +3 -1
  29. package/esm/picker/index.d.ts +3 -1
  30. package/esm/picker-view/index.d.ts +3 -1
  31. package/esm/radio/index.d.ts +4 -2
  32. package/esm/rate/index.d.ts +3 -1
  33. package/esm/slider/index.d.ts +3 -1
  34. package/esm/stepper/index.d.ts +3 -1
  35. package/esm/switch/index.d.ts +3 -1
  36. package/esm/textarea/index.d.ts +3 -1
  37. package/esm/textarea/index.js +1 -1
  38. package/package.json +3 -3
  39. package/umd/checkbox/index.d.ts +4 -2
  40. package/umd/checkbox/index.js +1 -1
  41. package/umd/date-picker/index.d.ts +3 -1
  42. package/umd/form/form-item.js +5 -4
  43. package/umd/form/type.d.ts +5 -0
  44. package/umd/image-picker/index.d.ts +3 -1
  45. package/umd/input/index.d.ts +3 -1
  46. package/umd/picker/index.d.ts +3 -1
  47. package/umd/picker-view/index.d.ts +3 -1
  48. package/umd/radio/index.d.ts +4 -2
  49. package/umd/rate/index.d.ts +3 -1
  50. package/umd/slider/index.d.ts +3 -1
  51. package/umd/stepper/index.d.ts +3 -1
  52. package/umd/switch/index.d.ts +3 -1
  53. package/umd/textarea/index.d.ts +3 -1
  54. package/umd/textarea/index.js +1 -1
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export * from './type';
3
3
  declare const _default: import("react").ForwardRefExoticComponent<import("./type").CheckboxProps<string | number> & import("react").RefAttributes<import("./type").CheckboxRef>> & {
4
- Group: import("react").ForwardRefExoticComponent<import("./type").CheckboxGroupProps<string | number, import("./type").CheckboxProps<string | number> & import("react").RefAttributes<import("./type").CheckboxRef>> & import("react").RefAttributes<import("./type").CheckboxGroupRef>> & "CheckboxGroup";
4
+ Group: import("react").ForwardRefExoticComponent<import("./type").CheckboxGroupProps<string | number, import("./type").CheckboxProps<string | number> & import("react").RefAttributes<import("./type").CheckboxRef>> & import("react").RefAttributes<import("./type").CheckboxGroupRef>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  } & {
6
- displayName: string;
8
+ displayName?: string | undefined;
7
9
  };
8
10
  /**
9
11
  * 复选框,可用状态下点击切换选择,支持禁用,支持复选项组。
@@ -7,7 +7,7 @@ export * from './type';
7
7
  * 复选项组
8
8
  * @en Checkbox group
9
9
  * @displayName CheckboxGroup
10
- * */
10
+ */
11
11
  var Group = componentWrapper(componentGenerator(Checkbox), 'CheckboxGroup');
12
12
 
13
13
  /**
@@ -9,7 +9,9 @@ export interface DatePickerRef {
9
9
  */
10
10
  dom: HTMLDivElement | null;
11
11
  }
12
- declare const _default: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerRef>> & "DatePicker";
12
+ declare const _default: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerRef>> & {
13
+ displayName?: string | undefined;
14
+ };
13
15
  /**
14
16
  * 日期时间选择器,基于`Picker`组件扩展,支持指定范围,单位可精确到秒。
15
17
  * @en Date picker, based on the `Picker` component, supports the specified range, the unit can be accurate to seconds.
@@ -11,9 +11,12 @@ import { FormInternalComponentType } from './type';
11
11
  import { getErrorAndWarnings, isFieldRequired } from './utils';
12
12
  var FormItemInner = /*#__PURE__*/function (_PureComponent) {
13
13
  _inheritsLoose(FormItemInner, _PureComponent);
14
+ // eslint-disable-next-line react/static-property-placement
15
+
14
16
  function FormItemInner(props, context) {
15
17
  var _this;
16
18
  _this = _PureComponent.call(this, props) || this;
19
+ _this.context = void 0;
17
20
  _this.destroyField = void 0;
18
21
  _this._errors = [];
19
22
  _this._touched = false;
@@ -127,8 +130,7 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
127
130
  };
128
131
  _proto.setFieldData = function setFieldData(value) {
129
132
  var field = this.props.field;
130
- var _ref = this.context.form,
131
- setFieldValue = _ref.setFieldValue;
133
+ var setFieldValue = this.context.form.setFieldValue;
132
134
  setFieldValue(field, value);
133
135
  this.validateField();
134
136
  };
@@ -156,8 +158,7 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
156
158
  _this$props4$triggerP = _this$props4.triggerPropsField,
157
159
  triggerPropsField = _this$props4$triggerP === void 0 ? 'value' : _this$props4$triggerP,
158
160
  displayType = _this$props4.displayType;
159
- var _ref2 = this.context.form,
160
- getFieldValue = _ref2.getFieldValue;
161
+ var getFieldValue = this.context.form.getFieldValue;
161
162
  var props = (_props = {}, _props[triggerPropsField] = getFieldValue(field), _props.disabled = this.props.disabled, _props);
162
163
  var childrenType = displayType || ((_children$type = children.type) == null ? void 0 : _children$type.displayName);
163
164
  switch (childrenType) {
@@ -155,6 +155,11 @@ export interface IFormInstance {
155
155
  * @en Reset fields
156
156
  */
157
157
  resetFields: () => void;
158
+ /**
159
+ * 设置单个表单项值
160
+ * @en Set field value
161
+ */
162
+ setFieldValue: (name: string, value: FieldValue) => boolean;
158
163
  /**
159
164
  * 设置多个表单项值
160
165
  * @en Set multiple field value
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { ImagePickerProps, ImagePickerRef } from './type';
3
3
  export * from './type';
4
- declare const _default: React.ForwardRefExoticComponent<ImagePickerProps & React.RefAttributes<ImagePickerRef>> & "ImagePicker";
4
+ declare const _default: React.ForwardRefExoticComponent<ImagePickerProps & React.RefAttributes<ImagePickerRef>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  /**
6
8
  * 图片选择器组件
7
9
  * @en ImagePicker Component
@@ -45,7 +45,9 @@ export interface InputRef {
45
45
  */
46
46
  input: HTMLInputElement | null;
47
47
  }
48
- declare const _default: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> & "Input";
48
+ declare const _default: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> & {
49
+ displayName?: string | undefined;
50
+ };
49
51
  /**
50
52
  * 输入框组件,支持添加前后缀。
51
53
  * @en The input box, supports adding prefixes and suffixes.
@@ -35,7 +35,9 @@ export interface PickerRef {
35
35
  */
36
36
  scrollToCurrentIndex: () => void;
37
37
  }
38
- declare const _default: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<PickerRef>> & "Picker";
38
+ declare const _default: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<PickerRef>> & {
39
+ displayName?: string | undefined;
40
+ };
39
41
  /**
40
42
  * 选择器组件,形式是弹起的浮层。
41
43
  * @en The selector component, in the form of a popup layer.
@@ -42,7 +42,9 @@ export interface PickerViewRef {
42
42
  */
43
43
  scrollToCurrentIndex: () => void;
44
44
  }
45
- declare const _default: React.ForwardRefExoticComponent<PickerViewProps & React.RefAttributes<PickerViewRef>> & "PickerView";
45
+ declare const _default: React.ForwardRefExoticComponent<PickerViewProps & React.RefAttributes<PickerViewRef>> & {
46
+ displayName?: string | undefined;
47
+ };
46
48
  /**
47
49
  * 选择器视图组件,不含弹窗,方便使用方灵活定制选择器。
48
50
  * @en The picker view component, not has contain popup, which is convenient for the user to flexibly customize the picker.
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export * from './type';
3
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>> & "RadioGroup";
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>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  } & {
6
- displayName: string;
8
+ displayName?: string | undefined;
7
9
  };
8
10
  /**
9
11
  * 单选框,可用状态下点击切换选择,支持禁用,支持单选项组。
@@ -94,7 +94,9 @@ export interface RateRef {
94
94
  */
95
95
  dom: HTMLDivElement | null;
96
96
  }
97
- declare const _default: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<RateRef>> & "Rate";
97
+ declare const _default: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<RateRef>> & {
98
+ displayName?: string | undefined;
99
+ };
98
100
  /**
99
101
  * 评分组件,支持受控模式
100
102
  * @en Rate component, supports controlled mode
@@ -138,7 +138,9 @@ export interface SliderRef {
138
138
  */
139
139
  dom: HTMLDivElement | null;
140
140
  }
141
- declare const _default: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderRef>> & "Slider";
141
+ declare const _default: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderRef>> & {
142
+ displayName?: string | undefined;
143
+ };
142
144
  /**
143
145
  * 滑动型输入器,展示当前值和可选范围。
144
146
  * @en Slide input component, displays the current value and optional range.
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { StepperProps, StepperRef } from './type';
3
3
  export * from './type';
4
- declare const _default: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>> & "Stepper";
4
+ declare const _default: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  /**
6
8
  * 步进器组件,支持受控模式
7
9
  * @en Stepper component, provide controlled mode
@@ -90,7 +90,9 @@ export interface SwitchRef {
90
90
  */
91
91
  dom: HTMLDivElement | null;
92
92
  }
93
- declare const _default: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<SwitchRef>> & "Switch";
93
+ declare const _default: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<SwitchRef>> & {
94
+ displayName?: string | undefined;
95
+ };
94
96
  /**
95
97
  * 开关组件,支持点击和滑动触发开关动作。
96
98
  * @en A switch component that supports click and slide trigger switch actions.
@@ -81,7 +81,9 @@ export interface TextareaRef {
81
81
  */
82
82
  resize: () => void;
83
83
  }
84
- declare const _default: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<TextareaRef>> & "Textarea";
84
+ declare const _default: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<TextareaRef>> & {
85
+ displayName?: string | undefined;
86
+ };
85
87
  /**
86
88
  * 多行文本输入框组件,支持自适应内容高度。
87
89
  * @en A multi-line textarea, supports adaptive content height.
@@ -45,7 +45,7 @@ var Textarea = /*#__PURE__*/forwardRef(function (props, ref) {
45
45
  }
46
46
  // 默认为过滤换行后的字符长度
47
47
  // @en The default is the character length after filtering newlines
48
- var validValue = inputValue.replace(/\n/g, '');
48
+ var validValue = (inputValue || '').replace(/\n/g, '');
49
49
  return validValue ? String(validValue).length : 0;
50
50
  }, [inputValue, statisticsLengthCaculator]);
51
51
  var exceed = maxValueLength ? currentValueLength > maxValueLength : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arco-design/mobile-react",
3
- "version": "2.25.0",
3
+ "version": "2.25.2",
4
4
  "description": "",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -15,7 +15,7 @@
15
15
  "author": "taoyiyue@bytedance.com",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@arco-design/mobile-utils": "2.13.0",
18
+ "@arco-design/mobile-utils": "2.13.2",
19
19
  "@arco-design/transformable": "^1.0.0",
20
20
  "lodash.throttle": "^4.1.1",
21
21
  "resize-observer-polyfill": "^1.5.1"
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "fc2a622794d8ca20215086267ee88083bf48f59f"
38
+ "gitHead": "181b8d60014ef9b1992c9011c8be3ab7c7f08f2e"
39
39
  }
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export * from './type';
3
3
  declare const _default: import("react").ForwardRefExoticComponent<import("./type").CheckboxProps<string | number> & import("react").RefAttributes<import("./type").CheckboxRef>> & {
4
- Group: import("react").ForwardRefExoticComponent<import("./type").CheckboxGroupProps<string | number, import("./type").CheckboxProps<string | number> & import("react").RefAttributes<import("./type").CheckboxRef>> & import("react").RefAttributes<import("./type").CheckboxGroupRef>> & "CheckboxGroup";
4
+ Group: import("react").ForwardRefExoticComponent<import("./type").CheckboxGroupProps<string | number, import("./type").CheckboxProps<string | number> & import("react").RefAttributes<import("./type").CheckboxRef>> & import("react").RefAttributes<import("./type").CheckboxGroupRef>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  } & {
6
- displayName: string;
8
+ displayName?: string | undefined;
7
9
  };
8
10
  /**
9
11
  * 复选框,可用状态下点击切换选择,支持禁用,支持复选项组。
@@ -26,7 +26,7 @@
26
26
  * 复选项组
27
27
  * @en Checkbox group
28
28
  * @displayName CheckboxGroup
29
- * */
29
+ */
30
30
  var Group = (0, _mobileUtils.componentWrapper)((0, _group.componentGenerator)(_checkbox.Checkbox), 'CheckboxGroup');
31
31
 
32
32
  /**
@@ -9,7 +9,9 @@ export interface DatePickerRef {
9
9
  */
10
10
  dom: HTMLDivElement | null;
11
11
  }
12
- declare const _default: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerRef>> & "DatePicker";
12
+ declare const _default: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerRef>> & {
13
+ displayName?: string | undefined;
14
+ };
13
15
  /**
14
16
  * 日期时间选择器,基于`Picker`组件扩展,支持指定范围,单位可精确到秒。
15
17
  * @en Date picker, based on the `Picker` component, supports the specified range, the unit can be accurate to seconds.
@@ -25,9 +25,12 @@
25
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
26
26
  var FormItemInner = /*#__PURE__*/function (_PureComponent) {
27
27
  (0, _inheritsLoose2.default)(FormItemInner, _PureComponent);
28
+ // eslint-disable-next-line react/static-property-placement
29
+
28
30
  function FormItemInner(props, context) {
29
31
  var _this;
30
32
  _this = _PureComponent.call(this, props) || this;
33
+ _this.context = void 0;
31
34
  _this.destroyField = void 0;
32
35
  _this._errors = [];
33
36
  _this._touched = false;
@@ -141,8 +144,7 @@
141
144
  };
142
145
  _proto.setFieldData = function setFieldData(value) {
143
146
  var field = this.props.field;
144
- var _ref = this.context.form,
145
- setFieldValue = _ref.setFieldValue;
147
+ var setFieldValue = this.context.form.setFieldValue;
146
148
  setFieldValue(field, value);
147
149
  this.validateField();
148
150
  };
@@ -170,8 +172,7 @@
170
172
  _this$props4$triggerP = _this$props4.triggerPropsField,
171
173
  triggerPropsField = _this$props4$triggerP === void 0 ? 'value' : _this$props4$triggerP,
172
174
  displayType = _this$props4.displayType;
173
- var _ref2 = this.context.form,
174
- getFieldValue = _ref2.getFieldValue;
175
+ var getFieldValue = this.context.form.getFieldValue;
175
176
  var props = (_props = {}, _props[triggerPropsField] = getFieldValue(field), _props.disabled = this.props.disabled, _props);
176
177
  var childrenType = displayType || ((_children$type = children.type) == null ? void 0 : _children$type.displayName);
177
178
  switch (childrenType) {
@@ -155,6 +155,11 @@ export interface IFormInstance {
155
155
  * @en Reset fields
156
156
  */
157
157
  resetFields: () => void;
158
+ /**
159
+ * 设置单个表单项值
160
+ * @en Set field value
161
+ */
162
+ setFieldValue: (name: string, value: FieldValue) => boolean;
158
163
  /**
159
164
  * 设置多个表单项值
160
165
  * @en Set multiple field value
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { ImagePickerProps, ImagePickerRef } from './type';
3
3
  export * from './type';
4
- declare const _default: React.ForwardRefExoticComponent<ImagePickerProps & React.RefAttributes<ImagePickerRef>> & "ImagePicker";
4
+ declare const _default: React.ForwardRefExoticComponent<ImagePickerProps & React.RefAttributes<ImagePickerRef>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  /**
6
8
  * 图片选择器组件
7
9
  * @en ImagePicker Component
@@ -45,7 +45,9 @@ export interface InputRef {
45
45
  */
46
46
  input: HTMLInputElement | null;
47
47
  }
48
- declare const _default: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> & "Input";
48
+ declare const _default: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> & {
49
+ displayName?: string | undefined;
50
+ };
49
51
  /**
50
52
  * 输入框组件,支持添加前后缀。
51
53
  * @en The input box, supports adding prefixes and suffixes.
@@ -35,7 +35,9 @@ export interface PickerRef {
35
35
  */
36
36
  scrollToCurrentIndex: () => void;
37
37
  }
38
- declare const _default: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<PickerRef>> & "Picker";
38
+ declare const _default: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<PickerRef>> & {
39
+ displayName?: string | undefined;
40
+ };
39
41
  /**
40
42
  * 选择器组件,形式是弹起的浮层。
41
43
  * @en The selector component, in the form of a popup layer.
@@ -42,7 +42,9 @@ export interface PickerViewRef {
42
42
  */
43
43
  scrollToCurrentIndex: () => void;
44
44
  }
45
- declare const _default: React.ForwardRefExoticComponent<PickerViewProps & React.RefAttributes<PickerViewRef>> & "PickerView";
45
+ declare const _default: React.ForwardRefExoticComponent<PickerViewProps & React.RefAttributes<PickerViewRef>> & {
46
+ displayName?: string | undefined;
47
+ };
46
48
  /**
47
49
  * 选择器视图组件,不含弹窗,方便使用方灵活定制选择器。
48
50
  * @en The picker view component, not has contain popup, which is convenient for the user to flexibly customize the picker.
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export * from './type';
3
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>> & "RadioGroup";
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>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  } & {
6
- displayName: string;
8
+ displayName?: string | undefined;
7
9
  };
8
10
  /**
9
11
  * 单选框,可用状态下点击切换选择,支持禁用,支持单选项组。
@@ -94,7 +94,9 @@ export interface RateRef {
94
94
  */
95
95
  dom: HTMLDivElement | null;
96
96
  }
97
- declare const _default: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<RateRef>> & "Rate";
97
+ declare const _default: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<RateRef>> & {
98
+ displayName?: string | undefined;
99
+ };
98
100
  /**
99
101
  * 评分组件,支持受控模式
100
102
  * @en Rate component, supports controlled mode
@@ -138,7 +138,9 @@ export interface SliderRef {
138
138
  */
139
139
  dom: HTMLDivElement | null;
140
140
  }
141
- declare const _default: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderRef>> & "Slider";
141
+ declare const _default: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<SliderRef>> & {
142
+ displayName?: string | undefined;
143
+ };
142
144
  /**
143
145
  * 滑动型输入器,展示当前值和可选范围。
144
146
  * @en Slide input component, displays the current value and optional range.
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { StepperProps, StepperRef } from './type';
3
3
  export * from './type';
4
- declare const _default: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>> & "Stepper";
4
+ declare const _default: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>> & {
5
+ displayName?: string | undefined;
6
+ };
5
7
  /**
6
8
  * 步进器组件,支持受控模式
7
9
  * @en Stepper component, provide controlled mode
@@ -90,7 +90,9 @@ export interface SwitchRef {
90
90
  */
91
91
  dom: HTMLDivElement | null;
92
92
  }
93
- declare const _default: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<SwitchRef>> & "Switch";
93
+ declare const _default: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<SwitchRef>> & {
94
+ displayName?: string | undefined;
95
+ };
94
96
  /**
95
97
  * 开关组件,支持点击和滑动触发开关动作。
96
98
  * @en A switch component that supports click and slide trigger switch actions.
@@ -81,7 +81,9 @@ export interface TextareaRef {
81
81
  */
82
82
  resize: () => void;
83
83
  }
84
- declare const _default: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<TextareaRef>> & "Textarea";
84
+ declare const _default: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<TextareaRef>> & {
85
+ displayName?: string | undefined;
86
+ };
85
87
  /**
86
88
  * 多行文本输入框组件,支持自适应内容高度。
87
89
  * @en A multi-line textarea, supports adaptive content height.
@@ -62,7 +62,7 @@
62
62
  }
63
63
  // 默认为过滤换行后的字符长度
64
64
  // @en The default is the character length after filtering newlines
65
- var validValue = inputValue.replace(/\n/g, '');
65
+ var validValue = (inputValue || '').replace(/\n/g, '');
66
66
  return validValue ? String(validValue).length : 0;
67
67
  }, [inputValue, statisticsLengthCaculator]);
68
68
  var exceed = maxValueLength ? currentValueLength > maxValueLength : false;