@nutui/nutui-react 2.0.6 → 2.0.7

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 (52) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/esm/Audio.js +1 -1
  3. package/dist/esm/Button.js +15 -18
  4. package/dist/esm/Range.js +5 -13
  5. package/dist/esm/Uploader.js +3 -0
  6. package/dist/esm/types/src/packages/audio/audio.d.ts +5 -4
  7. package/dist/esm/types/src/packages/avatar/avatar.d.ts +2 -1
  8. package/dist/esm/types/src/packages/avatar/avatar.taro.d.ts +2 -1
  9. package/dist/esm/types/src/packages/backtop/backtop.d.ts +2 -1
  10. package/dist/esm/types/src/packages/backtop/backtop.taro.d.ts +2 -1
  11. package/dist/esm/types/src/packages/button/button.d.ts +2 -1
  12. package/dist/esm/types/src/packages/button/button.taro.d.ts +2 -1
  13. package/dist/esm/types/src/packages/col/col.d.ts +2 -1
  14. package/dist/esm/types/src/packages/col/col.taro.d.ts +2 -1
  15. package/dist/esm/types/src/packages/dialog/config.d.ts +2 -1
  16. package/dist/esm/types/src/packages/formitem/types.d.ts +2 -1
  17. package/dist/esm/types/src/packages/row/row.d.ts +2 -1
  18. package/dist/esm/types/src/packages/row/row.taro.d.ts +2 -1
  19. package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +6 -5
  20. package/dist/esm/types/src/packages/searchbar/searchbar.taro.d.ts +6 -5
  21. package/dist/esm/types/src/packages/swipe/swipe.d.ts +5 -4
  22. package/dist/esm/types/src/packages/swipe/swipe.taro.d.ts +5 -4
  23. package/dist/esm/types/src/packages/tag/tag.d.ts +2 -1
  24. package/dist/esm/types/src/packages/tag/tag.taro.d.ts +2 -1
  25. package/dist/esm/types/src/packages/textarea/textarea.d.ts +3 -2
  26. package/dist/esm/types/src/packages/uploader/uploader.d.ts +1 -0
  27. package/dist/esm/types/src/utils/use-touch.d.ts +2 -2
  28. package/dist/locales/base.js +1 -1
  29. package/dist/locales/en-US.js +1 -1
  30. package/dist/locales/id-ID.js +1 -1
  31. package/dist/locales/tr-TR.js +1 -1
  32. package/dist/locales/zh-CN.js +1 -1
  33. package/dist/locales/zh-TW.js +1 -1
  34. package/dist/locales/zh-UG.js +1 -1
  35. package/dist/nutui.react.es.js +33 -33
  36. package/dist/nutui.react.umd.js +33 -33
  37. package/dist/style.mjs +1 -1
  38. package/dist/types/packages/audio/audio.d.ts +5 -4
  39. package/dist/types/packages/avatar/avatar.d.ts +2 -1
  40. package/dist/types/packages/backtop/backtop.d.ts +2 -1
  41. package/dist/types/packages/button/button.d.ts +3 -2
  42. package/dist/types/packages/col/col.d.ts +2 -1
  43. package/dist/types/packages/dialog/config.d.ts +2 -1
  44. package/dist/types/packages/formitem/types.d.ts +2 -1
  45. package/dist/types/packages/row/row.d.ts +2 -1
  46. package/dist/types/packages/searchbar/searchbar.d.ts +6 -5
  47. package/dist/types/packages/swipe/swipe.d.ts +5 -4
  48. package/dist/types/packages/tag/tag.d.ts +2 -1
  49. package/dist/types/packages/textarea/textarea.d.ts +3 -2
  50. package/dist/types/packages/uploader/uploader.d.ts +1 -0
  51. package/dist/types/utils/use-touch.d.ts +2 -2
  52. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v2.0.7
2
+ `2023-07-26`
3
+
4
+ * :sparkles: feat: formitem label 支持 reactnode (#1254) @oasis-cloud
5
+ * :sparkles: feat: uploader 添加上传的响应数据 (#1251) @逍遥
6
+ * 🔨 chore: 优化 any 类型 (#1222) @junjun666
7
+ * 📖 docs(SearchBar): 补充 onClear 属性说明 (#1256) @Tralafalgar Wang
8
+
9
+
1
10
  # v2.0.6
2
11
  `2023-07-21`
3
12
 
package/dist/esm/Audio.js CHANGED
@@ -216,7 +216,7 @@ var Audio = function Audio2(props) {
216
216
  }
217
217
  };
218
218
  var onTimeupdate = function onTimeupdate2(e) {
219
- var time = parseInt(e.target.currentTime);
219
+ var time = parseInt(String(e.target.currentTime));
220
220
  var formated = formatSeconds("".concat(time));
221
221
  statusRef.current.currentDuration = formated;
222
222
  setPercent(time / statusRef.current.second * 100);
@@ -65,24 +65,21 @@ var Button = React__default.forwardRef(function(props, ref) {
65
65
  onClick2(e);
66
66
  }
67
67
  };
68
- return (
69
- // eslint-disable-next-line react/button-has-type
70
- React__default.createElement("button", _objectSpread(_objectSpread({}, rest), {}, {
71
- ref,
72
- type: nativeType,
73
- className: classNames(prefixCls, className, props.type ? "".concat(prefixCls, "--").concat(type) : null, props.fill ? "".concat(prefixCls, "--").concat(fill) : null, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "--").concat(size), size), _defineProperty(_classNames, "".concat(prefixCls, "--").concat(shape), shape), _defineProperty(_classNames, "".concat(prefixCls, "--block"), block), _defineProperty(_classNames, "".concat(prefixCls, "--disabled"), disabled), _defineProperty(_classNames, "".concat(prefixCls, "--loading"), loading), _classNames)),
74
- style: _objectSpread(_objectSpread({}, getStyle()), style),
75
- onClick: function onClick3(e) {
76
- return handleClick(e);
77
- }
78
- }), React__default.createElement("div", {
79
- className: "nut-button__warp"
80
- }, loading ? React__default.createElement(Loading, {
81
- className: "nut-icon-loading"
82
- }) : null, !loading && icon ? icon : null, children && React__default.createElement("div", {
83
- className: icon || loading ? "nut-button-text" : ""
84
- }, children)))
85
- );
68
+ return React__default.createElement("button", _objectSpread(_objectSpread({}, rest), {}, {
69
+ ref,
70
+ type: nativeType,
71
+ className: classNames(prefixCls, className, props.type ? "".concat(prefixCls, "--").concat(type) : null, props.fill ? "".concat(prefixCls, "--").concat(fill) : null, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "--").concat(size), size), _defineProperty(_classNames, "".concat(prefixCls, "--").concat(shape), shape), _defineProperty(_classNames, "".concat(prefixCls, "--block"), block), _defineProperty(_classNames, "".concat(prefixCls, "--disabled"), disabled), _defineProperty(_classNames, "".concat(prefixCls, "--loading"), loading), _classNames)),
72
+ style: _objectSpread(_objectSpread({}, getStyle()), style),
73
+ onClick: function onClick3(e) {
74
+ return handleClick(e);
75
+ }
76
+ }), React__default.createElement("div", {
77
+ className: "nut-button__warp"
78
+ }, loading ? React__default.createElement(Loading, {
79
+ className: "nut-icon-loading"
80
+ }) : null, !loading && icon ? icon : null, children && React__default.createElement("div", {
81
+ className: icon || loading ? "nut-button-text" : ""
82
+ }, children)));
86
83
  });
87
84
  Button.displayName = "NutButton";
88
85
  export {
package/dist/esm/Range.js CHANGED
@@ -226,7 +226,7 @@ var Range = function Range2(props) {
226
226
  setEaxctValue(newValue);
227
227
  updateValue(newValue);
228
228
  };
229
- var _onTouchEnd = function onTouchEnd(event) {
229
+ var onTouchEnd = function onTouchEnd2() {
230
230
  if (disabled) {
231
231
  return;
232
232
  }
@@ -285,12 +285,8 @@ var Range = function Range2(props) {
285
285
  onTouchMove: function onTouchMove(e) {
286
286
  return _onTouchMove(e);
287
287
  },
288
- onTouchEnd: function onTouchEnd(e) {
289
- return _onTouchEnd();
290
- },
291
- onTouchCancel: function onTouchCancel(e) {
292
- return _onTouchEnd();
293
- },
288
+ onTouchEnd,
289
+ onTouchCancel: onTouchEnd,
294
290
  onClick: function onClick(e) {
295
291
  return e.stopPropagation();
296
292
  }
@@ -303,12 +299,8 @@ var Range = function Range2(props) {
303
299
  onTouchMove: function onTouchMove(e) {
304
300
  return _onTouchMove(e);
305
301
  },
306
- onTouchEnd: function onTouchEnd(e) {
307
- return _onTouchEnd();
308
- },
309
- onTouchCancel: function onTouchCancel(e) {
310
- return _onTouchEnd();
311
- },
302
+ onTouchEnd,
303
+ onTouchCancel: onTouchEnd,
312
304
  onClick: function onClick(e) {
313
305
  return e.stopPropagation();
314
306
  }
@@ -158,6 +158,7 @@ var FileItem = /* @__PURE__ */ _createClass(function FileItem2() {
158
158
  _defineProperty(this, "path", void 0);
159
159
  _defineProperty(this, "percentage", 0);
160
160
  _defineProperty(this, "formData", new FormData());
161
+ _defineProperty(this, "responseText", void 0);
161
162
  });
162
163
  var InternalUploader = function InternalUploader2(props, ref) {
163
164
  var _useConfig = useConfig(), locale = _useConfig.locale;
@@ -256,6 +257,7 @@ var InternalUploader = function InternalUploader2(props, ref) {
256
257
  if (item.uid === fileItem.uid) {
257
258
  item.status = "success";
258
259
  item.message = locale.uploader.success;
260
+ item.responseText = responseText;
259
261
  }
260
262
  return item;
261
263
  });
@@ -273,6 +275,7 @@ var InternalUploader = function InternalUploader2(props, ref) {
273
275
  if (item.uid === fileItem.uid) {
274
276
  item.status = "error";
275
277
  item.message = locale.uploader.error;
278
+ item.responseText = responseText;
276
279
  }
277
280
  return item;
278
281
  });
@@ -1,4 +1,5 @@
1
- import React, { FunctionComponent, ReactEventHandler } from 'react';
1
+ import React, { FunctionComponent } from 'react';
2
+ import type { SyntheticEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export interface AudioProps extends BasicComponent {
4
5
  src: string;
@@ -9,9 +10,9 @@ export interface AudioProps extends BasicComponent {
9
10
  type: string;
10
11
  onBack: (e: HTMLAudioElement) => void;
11
12
  onForward: (e: HTMLAudioElement) => void;
12
- onPause: ((e: HTMLAudioElement) => void) & ReactEventHandler<HTMLAudioElement>;
13
- onEnd: (e: HTMLAudioElement) => void;
13
+ onPause: (e: SyntheticEvent<HTMLAudioElement>) => void;
14
+ onEnd: (e: SyntheticEvent<HTMLAudioElement>) => void;
14
15
  onMute: (e: HTMLAudioElement) => void;
15
- onCanPlay: ((e: HTMLAudioElement) => void) & ReactEventHandler<HTMLAudioElement>;
16
+ onCanPlay: (e: SyntheticEvent<HTMLAudioElement>) => void;
16
17
  }
17
18
  export declare const Audio: FunctionComponent<Partial<AudioProps> & React.HTMLAttributes<HTMLElement>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  import AvatarGroup from '@/packages/avatargroup';
4
5
  export interface AvatarProps extends BasicComponent {
@@ -10,7 +11,7 @@ export interface AvatarProps extends BasicComponent {
10
11
  color: string;
11
12
  src: string;
12
13
  alt: string;
13
- onClick: (e: MouseEvent) => void;
14
+ onClick: (e: MouseEvent<HTMLDivElement>) => void;
14
15
  onError: () => void;
15
16
  }
16
17
  export type AvatarShape = 'round' | 'square';
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  import AvatarGroup from '@/packages/avatargroup/index.taro';
4
5
  export interface AvatarProps extends BasicComponent {
@@ -10,7 +11,7 @@ export interface AvatarProps extends BasicComponent {
10
11
  fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
11
12
  src: string;
12
13
  alt: string;
13
- onClick: (e: MouseEvent) => void;
14
+ onClick: (e: MouseEvent<HTMLDivElement>) => void;
14
15
  onError: () => void;
15
16
  }
16
17
  export type AvatarShape = 'round' | 'square';
@@ -1,10 +1,11 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export interface BackTopProps extends BasicComponent {
4
5
  target: string;
5
6
  threshold: number;
6
7
  zIndex: number;
7
8
  duration: number;
8
- onClick?: (event: MouseEvent) => void;
9
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
9
10
  }
10
11
  export declare const BackTop: FunctionComponent<Partial<BackTopProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,9 +1,10 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export interface BackTopProps extends BasicComponent {
4
5
  threshold: number;
5
6
  zIndex: number;
6
7
  duration: number;
7
- onClick?: (event: MouseEvent) => void;
8
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
8
9
  }
9
10
  export declare const BackTop: FunctionComponent<Partial<BackTopProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
4
5
  export type ButtonSize = 'large' | 'normal' | 'small';
@@ -16,6 +17,6 @@ export interface ButtonProps extends BasicComponent {
16
17
  icon: React.ReactNode;
17
18
  id: string;
18
19
  nativeType: 'submit' | 'reset' | 'button';
19
- onClick: (e: MouseEvent) => void;
20
+ onClick: (e: MouseEvent<HTMLButtonElement>) => void;
20
21
  }
21
22
  export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
3
4
  import { BasicComponent } from '@/utils/typings';
4
5
  type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style'>;
@@ -16,7 +17,7 @@ export interface ButtonProps extends BasicComponent, OmitMiniProgramButtonProps
16
17
  loading: boolean;
17
18
  disabled: boolean;
18
19
  icon: React.ReactNode;
19
- onClick: (e: MouseEvent) => void;
20
+ onClick: (e: MouseEvent<HTMLButtonElement>) => void;
20
21
  }
21
22
  export declare const Button: React.ForwardRefExoticComponent<Omit<Partial<ButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
22
23
  export {};
@@ -1,10 +1,11 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type ColEventType = 'row' | 'col';
4
5
  export interface ColProps extends BasicComponent {
5
6
  span: string | number;
6
7
  offset: string | number;
7
8
  gutter: string | number;
8
- onClick: (e: any, type: ColEventType) => void;
9
+ onClick: (e: MouseEvent<HTMLDivElement>, type: ColEventType) => void;
9
10
  }
10
11
  export declare const Col: FunctionComponent<Partial<ColProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,10 +1,11 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type ColEventType = 'row' | 'col';
4
5
  export interface ColProps extends BasicComponent {
5
6
  span: string | number;
6
7
  offset: string | number;
7
8
  gutter: string | number;
8
- onClick: (e: any, type: ColEventType) => void;
9
+ onClick: (e: MouseEvent<HTMLDivElement>, type: ColEventType) => void;
9
10
  }
10
11
  export declare const Col: FunctionComponent<Partial<ColProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, ForwardRefExoticComponent, PropsWithChildren } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  export type DialogConfigType = {
3
4
  prefixCls?: string;
4
5
  simple?: boolean;
@@ -20,7 +21,7 @@ export interface BasicDialogProps {
20
21
  beforeClose?: () => boolean;
21
22
  beforeCancel?: () => boolean;
22
23
  onClose?: () => void;
23
- onConfirm?: (e?: MouseEvent) => Promise<() => void> | void;
24
+ onConfirm?: (e?: MouseEvent<HTMLButtonElement>) => Promise<() => void> | void;
24
25
  onCancel?: () => void;
25
26
  onClick?: () => void;
26
27
  }
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface FormItemRuleWithoutValidator {
2
3
  [key: string]: any;
3
4
  regex?: RegExp;
@@ -15,7 +16,7 @@ export interface BaseFormField {
15
16
  /**
16
17
  * label 标签的文本
17
18
  */
18
- label: string;
19
+ label: ReactNode;
19
20
  /**
20
21
  * 校验规则,设置字段的校验逻辑
21
22
  */
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type RowEventType = 'row' | 'col';
4
5
  export interface RowProps extends BasicComponent {
@@ -7,6 +8,6 @@ export interface RowProps extends BasicComponent {
7
8
  align: string;
8
9
  wrap: string;
9
10
  gutter: string | number;
10
- onClick: (e: any, type: RowEventType) => void;
11
+ onClick: (e: MouseEvent<HTMLDivElement>, type: RowEventType) => void;
11
12
  }
12
13
  export declare const Row: FunctionComponent<Partial<RowProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type RowEventType = 'row' | 'col';
4
5
  export interface RowProps extends BasicComponent {
@@ -7,6 +8,6 @@ export interface RowProps extends BasicComponent {
7
8
  align: string;
8
9
  wrap: string;
9
10
  gutter: string | number;
10
- onClick: (e: any, type: RowEventType) => void;
11
+ onClick: (e: MouseEvent<HTMLDivElement>, type: RowEventType) => void;
11
12
  }
12
13
  export declare const Row: FunctionComponent<Partial<RowProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export interface SearchBarProps extends BasicComponent {
4
5
  /** 文本值 */
@@ -24,14 +25,14 @@ export interface SearchBarProps extends BasicComponent {
24
25
  /** 确定搜索时触发 */
25
26
  onSearch?: (val: string) => void;
26
27
  /** 输入框内容变化时触发 */
27
- onChange?: (value: string, event: Event) => void;
28
+ onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
28
29
  /** 输入框获得焦点时触发 */
29
- onFocus?: (value: string, event: Event) => void;
30
+ onFocus?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
30
31
  /** 输入框失去焦点时触发 */
31
- onBlur?: (value: string, event: Event) => void;
32
+ onBlur?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
32
33
  /** 点击清除按钮后触发 */
33
- onClear?: (event: Event) => void;
34
+ onClear?: (event: MouseEvent<HTMLDivElement>) => void;
34
35
  /** 点击输入区域时触发 */
35
- onInputClick?: (event: Event) => void;
36
+ onInputClick?: (event: MouseEvent<HTMLInputElement>) => void;
36
37
  }
37
38
  export declare const SearchBar: FunctionComponent<Partial<SearchBarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur'>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export interface SearchBarProps extends BasicComponent {
4
5
  /** 文本值 */
@@ -24,14 +25,14 @@ export interface SearchBarProps extends BasicComponent {
24
25
  /** 确定搜索时触发 */
25
26
  onSearch?: (val: string) => void;
26
27
  /** 输入框内容变化时触发 */
27
- onChange?: (value: string, event: Event) => void;
28
+ onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
28
29
  /** 输入框获得焦点时触发 */
29
- onFocus?: (value: string, event: Event) => void;
30
+ onFocus?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
30
31
  /** 输入框失去焦点时触发 */
31
- onBlur?: (value: string, event: Event) => void;
32
+ onBlur?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
32
33
  /** 点击清除按钮后触发 */
33
- onClear?: (event: Event) => void;
34
+ onClear?: (event: MouseEvent<HTMLDivElement>) => void;
34
35
  /** 点击输入区域时触发 */
35
- onInputClick?: (event: Event) => void;
36
+ onInputClick?: (event: MouseEvent<HTMLInputElement>) => void;
36
37
  }
37
38
  export declare const SearchBar: FunctionComponent<Partial<SearchBarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur'>>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { TouchEvent, MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type SwipeSide = 'left' | 'right';
4
5
  export interface SwipeInstance {
@@ -27,9 +28,9 @@ export interface SwipeProps extends BasicComponent {
27
28
  position: SwipeSide;
28
29
  }) => void;
29
30
  /** 点击时触发 */
30
- onActionClick?: (event: Event, position: SwipeSide) => void;
31
- onTouchStart?: (event: Event) => void;
32
- onTouchEnd?: (event: Event) => void;
33
- onTouchMove?: (event: Event) => void;
31
+ onActionClick?: (event: MouseEvent<HTMLDivElement>, position: SwipeSide) => void;
32
+ onTouchStart?: (event: TouchEvent<HTMLDivElement>) => void;
33
+ onTouchEnd?: (event: TouchEvent<HTMLDivElement>) => void;
34
+ onTouchMove?: (event: TouchEvent<HTMLDivElement>) => void;
34
35
  }
35
36
  export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { TouchEvent, MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type SwipeSide = 'left' | 'right';
4
5
  export interface SwipeInstance {
@@ -27,9 +28,9 @@ export interface SwipeProps extends BasicComponent {
27
28
  position: SwipeSide;
28
29
  }) => void;
29
30
  /** 点击时触发 */
30
- onActionClick?: (event: Event, position: SwipeSide) => void;
31
- onTouchStart?: (event: Event) => void;
32
- onTouchEnd?: (event: Event) => void;
33
- onTouchMove?: (event: Event) => void;
31
+ onActionClick?: (event: MouseEvent<HTMLDivElement>, position: SwipeSide) => void;
32
+ onTouchStart?: (event: TouchEvent<HTMLDivElement>) => void;
33
+ onTouchEnd?: (event: TouchEvent<HTMLDivElement>) => void;
34
+ onTouchMove?: (event: TouchEvent<HTMLDivElement>) => void;
34
35
  }
35
36
  export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
@@ -1,4 +1,5 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type TagType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
4
5
  export interface TagProps extends BasicComponent {
@@ -10,7 +11,7 @@ export interface TagProps extends BasicComponent {
10
11
  mark: boolean;
11
12
  closeable: boolean;
12
13
  closeIcon: ReactNode;
13
- onClick: (e: MouseEvent) => void;
14
+ onClick: (e: MouseEvent<HTMLDivElement>) => void;
14
15
  onClose: (e?: any) => void;
15
16
  }
16
17
  export declare const Tag: FunctionComponent<Partial<TagProps>>;
@@ -1,4 +1,5 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export type TagType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
4
5
  export interface TagProps extends BasicComponent {
@@ -10,7 +11,7 @@ export interface TagProps extends BasicComponent {
10
11
  mark: boolean;
11
12
  closeable: boolean;
12
13
  closeIcon: ReactNode;
13
- onClick: (e: MouseEvent) => void;
14
+ onClick: (e: MouseEvent<HTMLDivElement>) => void;
14
15
  onClose: (e?: any) => void;
15
16
  }
16
17
  export declare const Tag: FunctionComponent<Partial<TagProps>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { FocusEvent } from 'react';
2
3
  import { BasicComponent } from '@/utils/typings';
3
4
  export interface TextAreaProps extends BasicComponent {
4
5
  value: string;
@@ -11,7 +12,7 @@ export interface TextAreaProps extends BasicComponent {
11
12
  disabled: boolean;
12
13
  autoSize: boolean;
13
14
  onChange: (value: string) => void;
14
- onBlur: (event: Event) => void;
15
- onFocus: (event: Event) => void;
15
+ onBlur: (event: FocusEvent<HTMLTextAreaElement>) => void;
16
+ onFocus: (event: FocusEvent<HTMLTextAreaElement>) => void;
16
17
  }
17
18
  export declare const TextArea: FunctionComponent<Partial<TextAreaProps> & Omit<React.HTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'onBlur' | 'onFocus'>>;
@@ -71,6 +71,7 @@ export declare class FileItem {
71
71
  path?: string;
72
72
  percentage: string | number;
73
73
  formData: FormData;
74
+ responseText?: string;
74
75
  }
75
76
  export declare const Uploader: React.ForwardRefExoticComponent<Partial<UploaderProps> & {
76
77
  children?: React.ReactNode;
@@ -1,7 +1,7 @@
1
1
  type Direction = '' | 'vertical' | 'horizontal';
2
2
  export declare function useTouch(): {
3
- move: EventListener;
4
- start: EventListener;
3
+ move: (event: React.TouchEvent<HTMLElement>) => void;
4
+ start: (event: React.TouchEvent<HTMLElement>) => void;
5
5
  reset: () => void;
6
6
  startX: number;
7
7
  startY: number;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:22 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:26 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  var _a;
8
8
  /*!
9
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:15:29 GMT+0800 (China Standard Time)
9
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:54:35 GMT+0800 (China Standard Time)
10
10
  * (c) 2023 @jdf2e.
11
11
  * Released under the MIT License.
12
12
  */
@@ -2449,32 +2449,29 @@ const Button = React__default.forwardRef(
2449
2449
  onClick(e);
2450
2450
  }
2451
2451
  };
2452
- return (
2453
- // eslint-disable-next-line react/button-has-type
2454
- /* @__PURE__ */ React__default.createElement(
2455
- "button",
2456
- {
2457
- ...rest,
2458
- ref,
2459
- type: nativeType,
2460
- className: classNames(
2461
- prefixCls,
2462
- className,
2463
- props.type ? `${prefixCls}--${type4}` : null,
2464
- props.fill ? `${prefixCls}--${fill}` : null,
2465
- {
2466
- [`${prefixCls}--${size}`]: size,
2467
- [`${prefixCls}--${shape}`]: shape,
2468
- [`${prefixCls}--block`]: block,
2469
- [`${prefixCls}--disabled`]: disabled,
2470
- [`${prefixCls}--loading`]: loading
2471
- }
2472
- ),
2473
- style: { ...getStyle(), ...style },
2474
- onClick: (e) => handleClick2(e)
2475
- },
2476
- /* @__PURE__ */ React__default.createElement("div", { className: "nut-button__warp" }, loading ? /* @__PURE__ */ React__default.createElement(k$3, { className: "nut-icon-loading" }) : null, !loading && icon ? icon : null, children && /* @__PURE__ */ React__default.createElement("div", { className: icon || loading ? "nut-button-text" : "" }, children))
2477
- )
2452
+ return /* @__PURE__ */ React__default.createElement(
2453
+ "button",
2454
+ {
2455
+ ...rest,
2456
+ ref,
2457
+ type: nativeType,
2458
+ className: classNames(
2459
+ prefixCls,
2460
+ className,
2461
+ props.type ? `${prefixCls}--${type4}` : null,
2462
+ props.fill ? `${prefixCls}--${fill}` : null,
2463
+ {
2464
+ [`${prefixCls}--${size}`]: size,
2465
+ [`${prefixCls}--${shape}`]: shape,
2466
+ [`${prefixCls}--block`]: block,
2467
+ [`${prefixCls}--disabled`]: disabled,
2468
+ [`${prefixCls}--loading`]: loading
2469
+ }
2470
+ ),
2471
+ style: { ...getStyle(), ...style },
2472
+ onClick: (e) => handleClick2(e)
2473
+ },
2474
+ /* @__PURE__ */ React__default.createElement("div", { className: "nut-button__warp" }, loading ? /* @__PURE__ */ React__default.createElement(k$3, { className: "nut-icon-loading" }) : null, !loading && icon ? icon : null, children && /* @__PURE__ */ React__default.createElement("div", { className: icon || loading ? "nut-button-text" : "" }, children))
2478
2475
  );
2479
2476
  }
2480
2477
  );
@@ -18035,7 +18032,7 @@ const Range = (props) => {
18035
18032
  setEaxctValue(newValue);
18036
18033
  updateValue(newValue);
18037
18034
  };
18038
- const onTouchEnd = (event) => {
18035
+ const onTouchEnd = () => {
18039
18036
  if (disabled) {
18040
18037
  return;
18041
18038
  }
@@ -18084,8 +18081,8 @@ const Range = (props) => {
18084
18081
  onTouchStart(e);
18085
18082
  },
18086
18083
  onTouchMove: (e) => onTouchMove(e),
18087
- onTouchEnd: (e) => onTouchEnd(),
18088
- onTouchCancel: (e) => onTouchEnd(),
18084
+ onTouchEnd,
18085
+ onTouchCancel: onTouchEnd,
18089
18086
  onClick: (e) => e.stopPropagation()
18090
18087
  },
18091
18088
  renderButton(index)
@@ -18096,8 +18093,8 @@ const Range = (props) => {
18096
18093
  className: "nut-range-button-wrapper",
18097
18094
  onTouchStart: (e) => onTouchStart(e),
18098
18095
  onTouchMove: (e) => onTouchMove(e),
18099
- onTouchEnd: (e) => onTouchEnd(),
18100
- onTouchCancel: (e) => onTouchEnd(),
18096
+ onTouchEnd,
18097
+ onTouchCancel: onTouchEnd,
18101
18098
  onClick: (e) => e.stopPropagation()
18102
18099
  },
18103
18100
  renderButton()
@@ -18990,6 +18987,7 @@ class FileItem {
18990
18987
  __publicField(this, "path");
18991
18988
  __publicField(this, "percentage", 0);
18992
18989
  __publicField(this, "formData", new FormData());
18990
+ __publicField(this, "responseText");
18993
18991
  }
18994
18992
  }
18995
18993
  const InternalUploader = (props, ref) => {
@@ -19120,6 +19118,7 @@ const InternalUploader = (props, ref) => {
19120
19118
  if (item.uid === fileItem.uid) {
19121
19119
  item.status = "success";
19122
19120
  item.message = locale.uploader.success;
19121
+ item.responseText = responseText;
19123
19122
  }
19124
19123
  return item;
19125
19124
  });
@@ -19137,6 +19136,7 @@ const InternalUploader = (props, ref) => {
19137
19136
  if (item.uid === fileItem.uid) {
19138
19137
  item.status = "error";
19139
19138
  item.message = locale.uploader.error;
19139
+ item.responseText = responseText;
19140
19140
  }
19141
19141
  return item;
19142
19142
  });
@@ -22005,7 +22005,7 @@ const Audio = (props) => {
22005
22005
  }
22006
22006
  };
22007
22007
  const onTimeupdate = (e) => {
22008
- const time = parseInt(e.target.currentTime);
22008
+ const time = parseInt(String(e.target.currentTime));
22009
22009
  const formated = formatSeconds(`${time}`);
22010
22010
  statusRef.current.currentDuration = formated;
22011
22011
  setPercent(time / statusRef.current.second * 100);
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  return value;
10
10
  };
11
11
  /*!
12
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:15:29 GMT+0800 (China Standard Time)
12
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:54:35 GMT+0800 (China Standard Time)
13
13
  * (c) 2023 @jdf2e.
14
14
  * Released under the MIT License.
15
15
  */
@@ -2467,32 +2467,29 @@ Check the top-level render call using <` + t + ">.");
2467
2467
  onClick(e);
2468
2468
  }
2469
2469
  };
2470
- return (
2471
- // eslint-disable-next-line react/button-has-type
2472
- /* @__PURE__ */ React.createElement(
2473
- "button",
2474
- {
2475
- ...rest,
2476
- ref,
2477
- type: nativeType,
2478
- className: classNames(
2479
- prefixCls,
2480
- className,
2481
- props.type ? `${prefixCls}--${type2}` : null,
2482
- props.fill ? `${prefixCls}--${fill}` : null,
2483
- {
2484
- [`${prefixCls}--${size}`]: size,
2485
- [`${prefixCls}--${shape}`]: shape,
2486
- [`${prefixCls}--block`]: block,
2487
- [`${prefixCls}--disabled`]: disabled,
2488
- [`${prefixCls}--loading`]: loading
2489
- }
2490
- ),
2491
- style: { ...getStyle(), ...style },
2492
- onClick: (e) => handleClick2(e)
2493
- },
2494
- /* @__PURE__ */ React.createElement("div", { className: "nut-button__warp" }, loading ? /* @__PURE__ */ React.createElement(k$3, { className: "nut-icon-loading" }) : null, !loading && icon ? icon : null, children && /* @__PURE__ */ React.createElement("div", { className: icon || loading ? "nut-button-text" : "" }, children))
2495
- )
2470
+ return /* @__PURE__ */ React.createElement(
2471
+ "button",
2472
+ {
2473
+ ...rest,
2474
+ ref,
2475
+ type: nativeType,
2476
+ className: classNames(
2477
+ prefixCls,
2478
+ className,
2479
+ props.type ? `${prefixCls}--${type2}` : null,
2480
+ props.fill ? `${prefixCls}--${fill}` : null,
2481
+ {
2482
+ [`${prefixCls}--${size}`]: size,
2483
+ [`${prefixCls}--${shape}`]: shape,
2484
+ [`${prefixCls}--block`]: block,
2485
+ [`${prefixCls}--disabled`]: disabled,
2486
+ [`${prefixCls}--loading`]: loading
2487
+ }
2488
+ ),
2489
+ style: { ...getStyle(), ...style },
2490
+ onClick: (e) => handleClick2(e)
2491
+ },
2492
+ /* @__PURE__ */ React.createElement("div", { className: "nut-button__warp" }, loading ? /* @__PURE__ */ React.createElement(k$3, { className: "nut-icon-loading" }) : null, !loading && icon ? icon : null, children && /* @__PURE__ */ React.createElement("div", { className: icon || loading ? "nut-button-text" : "" }, children))
2496
2493
  );
2497
2494
  }
2498
2495
  );
@@ -18053,7 +18050,7 @@ Please add \`${key}Action\` when creating your handler.`);
18053
18050
  setEaxctValue(newValue);
18054
18051
  updateValue(newValue);
18055
18052
  };
18056
- const onTouchEnd = (event) => {
18053
+ const onTouchEnd = () => {
18057
18054
  if (disabled) {
18058
18055
  return;
18059
18056
  }
@@ -18102,8 +18099,8 @@ Please add \`${key}Action\` when creating your handler.`);
18102
18099
  onTouchStart(e);
18103
18100
  },
18104
18101
  onTouchMove: (e) => onTouchMove(e),
18105
- onTouchEnd: (e) => onTouchEnd(),
18106
- onTouchCancel: (e) => onTouchEnd(),
18102
+ onTouchEnd,
18103
+ onTouchCancel: onTouchEnd,
18107
18104
  onClick: (e) => e.stopPropagation()
18108
18105
  },
18109
18106
  renderButton(index)
@@ -18114,8 +18111,8 @@ Please add \`${key}Action\` when creating your handler.`);
18114
18111
  className: "nut-range-button-wrapper",
18115
18112
  onTouchStart: (e) => onTouchStart(e),
18116
18113
  onTouchMove: (e) => onTouchMove(e),
18117
- onTouchEnd: (e) => onTouchEnd(),
18118
- onTouchCancel: (e) => onTouchEnd(),
18114
+ onTouchEnd,
18115
+ onTouchCancel: onTouchEnd,
18119
18116
  onClick: (e) => e.stopPropagation()
18120
18117
  },
18121
18118
  renderButton()
@@ -19008,6 +19005,7 @@ Please add \`${key}Action\` when creating your handler.`);
19008
19005
  __publicField(this, "path");
19009
19006
  __publicField(this, "percentage", 0);
19010
19007
  __publicField(this, "formData", new FormData());
19008
+ __publicField(this, "responseText");
19011
19009
  }
19012
19010
  }
19013
19011
  const InternalUploader = (props, ref) => {
@@ -19138,6 +19136,7 @@ Please add \`${key}Action\` when creating your handler.`);
19138
19136
  if (item.uid === fileItem.uid) {
19139
19137
  item.status = "success";
19140
19138
  item.message = locale.uploader.success;
19139
+ item.responseText = responseText;
19141
19140
  }
19142
19141
  return item;
19143
19142
  });
@@ -19155,6 +19154,7 @@ Please add \`${key}Action\` when creating your handler.`);
19155
19154
  if (item.uid === fileItem.uid) {
19156
19155
  item.status = "error";
19157
19156
  item.message = locale.uploader.error;
19157
+ item.responseText = responseText;
19158
19158
  }
19159
19159
  return item;
19160
19160
  });
@@ -22023,7 +22023,7 @@ Please add \`${key}Action\` when creating your handler.`);
22023
22023
  }
22024
22024
  };
22025
22025
  const onTimeupdate = (e) => {
22026
- const time = parseInt(e.target.currentTime);
22026
+ const time = parseInt(String(e.target.currentTime));
22027
22027
  const formated = formatSeconds(`${time}`);
22028
22028
  statusRef.current.currentDuration = formated;
22029
22029
  setPercent(time / statusRef.current.second * 100);
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.6 Fri Jul 21 2023 17:16:01 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v2.0.7 Wed Jul 26 2023 13:55:01 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,4 +1,5 @@
1
- import React, { FunctionComponent, ReactEventHandler } from 'react';
1
+ import React, { FunctionComponent } from 'react';
2
+ import type { SyntheticEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export interface AudioProps extends BasicComponent {
4
5
  /**
@@ -45,12 +46,12 @@ export interface AudioProps extends BasicComponent {
45
46
  * 暂停回调
46
47
  * @default -
47
48
  */
48
- onPause: ((e: HTMLAudioElement) => void) & ReactEventHandler<HTMLAudioElement>
49
+ onPause: (e: SyntheticEvent<HTMLAudioElement>) => void
49
50
  /**
50
51
  * 语音播放完成,loop = false 时生效
51
52
  * @default -
52
53
  */
53
- onEnd: (e: HTMLAudioElement) => void
54
+ onEnd: (e: SyntheticEvent<HTMLAudioElement>) => void
54
55
  /**
55
56
  * 静音回调
56
57
  * @default -
@@ -60,6 +61,6 @@ export interface AudioProps extends BasicComponent {
60
61
  * 可以播放媒体时触发
61
62
  * @default -
62
63
  */
63
- onCanPlay: ((e: HTMLAudioElement) => void) & ReactEventHandler<HTMLAudioElement>
64
+ onCanPlay: (e: SyntheticEvent<HTMLAudioElement>) => void
64
65
  }
65
66
  export declare const Audio: FunctionComponent<Partial<AudioProps> & React.HTMLAttributes<HTMLElement>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  import AvatarGroup from '../../packages/avatargroup';
4
5
  export interface AvatarProps extends BasicComponent {
@@ -46,7 +47,7 @@ export interface AvatarProps extends BasicComponent {
46
47
  * 点击头像触发事件
47
48
  * @default -
48
49
  */
49
- onClick: (e: MouseEvent) => void
50
+ onClick: (e: MouseEvent<HTMLDivElement>) => void
50
51
  /**
51
52
  * 图片加载失败的事件
52
53
  * @default -
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export interface BackTopProps extends BasicComponent {
4
5
  /**
@@ -25,6 +26,6 @@ export interface BackTopProps extends BasicComponent {
25
26
  * 按钮点击时触发事件
26
27
  * @default -
27
28
  */
28
- onClick?: (event: MouseEvent) => void
29
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void
29
30
  }
30
31
  export declare const BackTop: FunctionComponent<Partial<BackTopProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
4
5
  export type ButtonSize = 'large' | 'normal' | 'small';
@@ -54,8 +55,8 @@ export interface ButtonProps extends BasicComponent {
54
55
  nativeType: 'submit' | 'reset' | 'button';
55
56
  /**
56
57
  * 点击按钮时触发
57
- * @default false
58
+ * @default -
58
59
  */
59
- onClick: (e: MouseEvent) => void
60
+ onClick: (e: MouseEvent<HTMLButtonElement>) => void
60
61
  }
61
62
  export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export type ColEventType = 'row' | 'col';
4
5
  export interface ColProps extends BasicComponent {
@@ -17,6 +18,6 @@ export interface ColProps extends BasicComponent {
17
18
  * 点击时触发
18
19
  * @default -
19
20
  */
20
- onClick: (e: any, type: ColEventType) => void
21
+ onClick: (e: MouseEvent<HTMLDivElement>, type: ColEventType) => void
21
22
  }
22
23
  export declare const Col: FunctionComponent<Partial<ColProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, ForwardRefExoticComponent, PropsWithChildren } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  export type DialogConfigType = {
3
4
  prefixCls?: string;
4
5
  simple?: boolean;
@@ -20,7 +21,7 @@ export interface BasicDialogProps {
20
21
  beforeClose?: () => boolean;
21
22
  beforeCancel?: () => boolean;
22
23
  onClose?: () => void;
23
- onConfirm?: (e?: MouseEvent) => Promise<() => void> | void;
24
+ onConfirm?: (e?: MouseEvent<HTMLButtonElement>) => Promise<() => void> | void;
24
25
  onCancel?: () => void;
25
26
  onClick?: () => void;
26
27
  }
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface FormItemRuleWithoutValidator {
2
3
  [key: string]: any;
3
4
  regex?: RegExp;
@@ -15,7 +16,7 @@ export interface BaseFormField {
15
16
  /**
16
17
  * label 标签的文本
17
18
  */
18
- label: string;
19
+ label: ReactNode;
19
20
  /**
20
21
  * 校验规则,设置字段的校验逻辑
21
22
  */
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export type RowEventType = 'row' | 'col';
4
5
  export interface RowProps extends BasicComponent {
@@ -7,6 +8,6 @@ export interface RowProps extends BasicComponent {
7
8
  align: string;
8
9
  wrap: string;
9
10
  gutter: string | number;
10
- onClick: (e: any, type: RowEventType) => void;
11
+ onClick: (e: MouseEvent<HTMLDivElement>, type: RowEventType) => void;
11
12
  }
12
13
  export declare const Row: FunctionComponent<Partial<RowProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>>;
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export interface SearchBarProps extends BasicComponent {
4
5
  /**
@@ -70,26 +71,26 @@ export interface SearchBarProps extends BasicComponent {
70
71
  * 输入内容时触发
71
72
  * @default -
72
73
  */
73
- onChange?: (value: string, event: Event) => void;
74
+ onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
74
75
  /**
75
76
  * 聚焦时触发
76
77
  * @default -
77
78
  */
78
- onFocus?: (value: string, event: Event) => void;
79
+ onFocus?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
79
80
  /**
80
81
  * 失焦时触发
81
82
  * @default -
82
83
  */
83
- onBlur?: (value: string, event: Event) => void;
84
+ onBlur?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
84
85
  /**
85
86
  * 点击清空时触发
86
87
  * @default -
87
88
  */
88
- onClear?: (event: Event) => void;
89
+ onClear?: (event: MouseEvent<HTMLDivElement>) => void;
89
90
  /**
90
91
  * 点击输入区域时触发
91
92
  * @default -
92
93
  */
93
- onInputClick?: (event: Event) => void;
94
+ onInputClick?: (event: MouseEvent<HTMLInputElement>) => void;
94
95
  }
95
96
  export declare const SearchBar: FunctionComponent<Partial<SearchBarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur'>>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { TouchEvent, MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export type SwipeSide = 'left' | 'right';
4
5
  export interface SwipeInstance {
@@ -51,21 +52,21 @@ export interface SwipeProps extends BasicComponent {
51
52
  * 点击左侧或者右侧时触发
52
53
  * @default -
53
54
  */
54
- onActionClick?: (event: Event, position: SwipeSide) => void;
55
+ onActionClick?: (event: MouseEvent<HTMLDivElement>, position: SwipeSide) => void;
55
56
  /**
56
57
  * onTouchStart
57
58
  * @default -
58
59
  */
59
- onTouchStart?: (event: Event) => void
60
+ onTouchStart?: (event: TouchEvent<HTMLDivElement>) => void
60
61
  /**
61
62
  * onTouchEnd
62
63
  * @default -
63
64
  */
64
- onTouchEnd?: (event: Event) => void
65
+ onTouchEnd?: (event: TouchEvent<HTMLDivElement>) => void
65
66
  /**
66
67
  * onTouchMove
67
68
  * @default -
68
69
  */
69
- onTouchMove?: (event: Event) => void
70
+ onTouchMove?: (event: TouchEvent<HTMLDivElement>) => void
70
71
  }
71
72
  export declare const Swipe: React.ForwardRefExoticComponent<Partial<SwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeInstance>>;
@@ -1,4 +1,5 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
+ import type { MouseEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export type TagType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
4
5
  export interface TagProps extends BasicComponent {
@@ -46,7 +47,7 @@ export interface TagProps extends BasicComponent {
46
47
  * 点击事件
47
48
  * @default -
48
49
  */
49
- onClick: (e: MouseEvent) => void
50
+ onClick: (e: MouseEvent<HTMLDivElement>) => void
50
51
  /**
51
52
  * 关闭事件
52
53
  * @default -
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import type { FocusEvent } from 'react';
2
3
  import { BasicComponent } from '../../utils/typings';
3
4
  export interface TextAreaProps extends BasicComponent {
4
5
  /**
@@ -55,11 +56,11 @@ export interface TextAreaProps extends BasicComponent {
55
56
  * 失焦时触发
56
57
  * @default -
57
58
  */
58
- onBlur: (event: Event) => void
59
+ onBlur: (event: FocusEvent<HTMLTextAreaElement>) => void
59
60
  /**
60
61
  * 聚焦时触发
61
62
  * @default -
62
63
  */
63
- onFocus: (event: Event) => void
64
+ onFocus: (event: FocusEvent<HTMLTextAreaElement>) => void
64
65
  }
65
66
  export declare const TextArea: FunctionComponent<Partial<TextAreaProps> & Omit<React.HTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'onBlur' | 'onFocus'>>;
@@ -215,6 +215,7 @@ export declare class FileItem {
215
215
  path?: string;
216
216
  percentage: string | number;
217
217
  formData: FormData;
218
+ responseText?: string;
218
219
  }
219
220
  export declare const Uploader: React.ForwardRefExoticComponent<Partial<UploaderProps> & {
220
221
  children?: React.ReactNode;
@@ -1,7 +1,7 @@
1
1
  type Direction = '' | 'vertical' | 'horizontal';
2
2
  export declare function useTouch(): {
3
- move: EventListener;
4
- start: EventListener;
3
+ move: (event: React.TouchEvent<HTMLElement>) => void;
4
+ start: (event: React.TouchEvent<HTMLElement>) => void;
5
5
  reset: () => void;
6
6
  startX: number;
7
7
  startY: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",