@arco-design/mobile-react 2.27.4 → 2.27.5

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 (83) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.js +1 -1
  5. package/cjs/action-sheet/index.d.ts +2 -2
  6. package/cjs/badge/index.js +2 -1
  7. package/cjs/dialog/index.d.ts +2 -2
  8. package/cjs/image-preview/index.d.ts +2 -2
  9. package/cjs/image-preview/index.js +2 -1
  10. package/cjs/image-preview/style/css/index.css +3 -0
  11. package/cjs/image-preview/style/index.less +4 -0
  12. package/cjs/index.d.ts +12 -12
  13. package/cjs/index.js +46 -46
  14. package/cjs/load-more/index.d.ts +5 -0
  15. package/cjs/load-more/index.js +2 -1
  16. package/cjs/masking/index.d.ts +2 -2
  17. package/cjs/masking/index.js +4 -2
  18. package/cjs/notify/index.d.ts +8 -8
  19. package/cjs/popover/popover.js +10 -2
  20. package/cjs/popup/index.d.ts +2 -2
  21. package/cjs/popup-swiper/index.d.ts +2 -2
  22. package/cjs/slider/hooks/index.d.ts +1 -1
  23. package/cjs/slider/popover.js +6 -2
  24. package/cjs/stepper/hooks/useButtonClick.js +8 -9
  25. package/cjs/style.d.ts +13 -13
  26. package/cjs/style.js +24 -24
  27. package/cjs/toast/index.d.ts +12 -12
  28. package/cjs/toast/index.js +5 -2
  29. package/dist/index.js +13828 -13802
  30. package/dist/index.min.js +3 -3
  31. package/dist/style.css +3273 -3270
  32. package/dist/style.min.css +1 -1
  33. package/esm/_helpers/hooks.js +2 -2
  34. package/esm/action-sheet/index.d.ts +2 -2
  35. package/esm/badge/index.js +2 -1
  36. package/esm/dialog/index.d.ts +2 -2
  37. package/esm/image-preview/index.d.ts +2 -2
  38. package/esm/image-preview/index.js +2 -1
  39. package/esm/image-preview/style/css/index.css +3 -0
  40. package/esm/image-preview/style/index.less +4 -0
  41. package/esm/index.d.ts +12 -12
  42. package/esm/index.js +12 -12
  43. package/esm/load-more/index.d.ts +5 -0
  44. package/esm/load-more/index.js +2 -1
  45. package/esm/masking/index.d.ts +2 -2
  46. package/esm/masking/index.js +4 -2
  47. package/esm/notify/index.d.ts +8 -8
  48. package/esm/popover/popover.js +10 -2
  49. package/esm/popup/index.d.ts +2 -2
  50. package/esm/popup-swiper/index.d.ts +2 -2
  51. package/esm/slider/hooks/index.d.ts +1 -1
  52. package/esm/slider/popover.js +7 -3
  53. package/esm/stepper/hooks/useButtonClick.js +8 -9
  54. package/esm/style.d.ts +13 -13
  55. package/esm/style.js +13 -13
  56. package/esm/toast/index.d.ts +12 -12
  57. package/esm/toast/index.js +5 -2
  58. package/package.json +3 -3
  59. package/umd/_helpers/hooks.js +1 -1
  60. package/umd/action-sheet/index.d.ts +2 -2
  61. package/umd/badge/index.js +2 -1
  62. package/umd/dialog/index.d.ts +2 -2
  63. package/umd/image-preview/index.d.ts +2 -2
  64. package/umd/image-preview/index.js +2 -1
  65. package/umd/image-preview/style/css/index.css +3 -0
  66. package/umd/image-preview/style/index.less +4 -0
  67. package/umd/index.d.ts +12 -12
  68. package/umd/index.js +28 -28
  69. package/umd/load-more/index.d.ts +5 -0
  70. package/umd/load-more/index.js +2 -1
  71. package/umd/masking/index.d.ts +2 -2
  72. package/umd/masking/index.js +4 -2
  73. package/umd/notify/index.d.ts +8 -8
  74. package/umd/popover/popover.js +10 -2
  75. package/umd/popup/index.d.ts +2 -2
  76. package/umd/popup-swiper/index.d.ts +2 -2
  77. package/umd/slider/hooks/index.d.ts +1 -1
  78. package/umd/slider/popover.js +6 -2
  79. package/umd/stepper/hooks/useButtonClick.js +8 -9
  80. package/umd/style.d.ts +13 -13
  81. package/umd/style.js +2 -2
  82. package/umd/toast/index.d.ts +12 -12
  83. package/umd/toast/index.js +5 -2
@@ -51,8 +51,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
51
51
  * @param {string | NotifyProps} config
52
52
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
53
53
  */
54
- info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
54
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
56
56
  close: () => void;
57
57
  };
58
58
  /**
@@ -61,8 +61,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
61
61
  * @param {string | NotifyProps} config
62
62
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
63
63
  */
64
- success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
64
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
66
66
  close: () => void;
67
67
  };
68
68
  /**
@@ -71,8 +71,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
71
71
  * @param {string | NotifyProps} config
72
72
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
73
73
  */
74
- error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
74
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
76
76
  close: () => void;
77
77
  };
78
78
  /**
@@ -81,8 +81,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
81
81
  * @param {string | NotifyProps} config
82
82
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
83
83
  */
84
- warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
84
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
86
86
  close: () => void;
87
87
  };
88
88
  };
@@ -86,6 +86,8 @@
86
86
  var wrapperRef = (0, _react.useRef)(null);
87
87
  var childRef = (0, _react.useRef)(null);
88
88
  var popoverRef = (0, _react.useRef)(null);
89
+ var transitionNodeRef = (0, _react.useRef)(null);
90
+ var maskRef = (0, _react.useRef)(null);
89
91
 
90
92
  var _usePosition = (0, _hooks.usePosition)(props, popoverRef, childRef, wrapperRef),
91
93
  direction = _usePosition.direction,
@@ -217,7 +219,10 @@
217
219
  className: (0, _mobileUtils.cls)(theme + "-theme", innerPopoverClassName, {
218
220
  bordered: bordered
219
221
  }),
220
- ref: popoverRef,
222
+ ref: function ref(ele) {
223
+ popoverRef.current = ele;
224
+ transitionNodeRef.current = ele == null ? void 0 : ele.dom;
225
+ },
221
226
  direction: direction,
222
227
  minWidth: minWidth,
223
228
  maxWidth: maxWidth,
@@ -245,6 +250,7 @@
245
250
  in: visibleState && !isCalcPosition,
246
251
  timeout: transitionTimeout,
247
252
  type: transitionName,
253
+ nodeRef: transitionNodeRef,
248
254
  mountOnEnter: true,
249
255
  unmountOnExit: true
250
256
  }, renderInnerPopover()));
@@ -253,12 +259,14 @@
253
259
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showMask && /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_transition.default, {
254
260
  in: visibleState && !isCalcPosition,
255
261
  timeout: maskTransitionTimeout,
262
+ nodeRef: maskRef,
256
263
  type: "fade",
257
264
  mountOnEnter: true,
258
265
  unmountOnExit: true
259
266
  }, /*#__PURE__*/_react.default.createElement("div", {
260
267
  className: prefixCls + "-popover-mask",
261
- onClick: onClickMask
268
+ onClick: onClickMask,
269
+ ref: maskRef
262
270
  }))), /*#__PURE__*/_react.default.createElement("div", {
263
271
  className: (0, _mobileUtils.cls)(prefixCls + "-popover", className, theme + "-theme", mode + "-mode", {
264
272
  bordered: bordered,
@@ -66,11 +66,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupProps & React.RefAt
66
66
  * @param {PopupProps} config Configuration
67
67
  * @returns {{ close: () => void; update: (newConfig: PopupProps) => void; }}
68
68
  */
69
- open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
69
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
70
70
  key?: string | undefined;
71
71
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
72
72
  close: () => void;
73
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
73
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
74
74
  key?: string | undefined;
75
75
  }) => void;
76
76
  };
@@ -76,11 +76,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
76
76
  * @param {string | PopupSwiperProps} config Configuration
77
77
  * @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
78
78
  */
79
- open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ" | "onTouchEnd" | "onTouchStart" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
79
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
80
80
  key?: string | undefined;
81
81
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
82
82
  close: () => void;
83
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ" | "onTouchEnd" | "onTouchStart" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
83
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
84
84
  key?: string | undefined;
85
85
  }) => void; /**
86
86
  * 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
@@ -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, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "min" | "onAfterChange" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks">>;
8
+ export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "onAfterChange" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks">>;
9
9
  export * from './useSliderIcon';
10
10
  export * from './useSliderInit';
11
11
  export * from './useSliderStyle';
@@ -33,15 +33,19 @@
33
33
  _useContext$prefixCls = _useContext.prefixCls,
34
34
  prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls;
35
35
 
36
+ var domRef = (0, _react.useRef)(null);
36
37
  return /*#__PURE__*/_react.default.createElement("div", {
37
38
  className: prefixCls + "-slider-popover-wrapper"
38
39
  }, /*#__PURE__*/_react.default.createElement(_transition.default, {
39
40
  in: visible,
40
41
  timeout: 300,
41
42
  type: "fade",
42
- mountOnEnter: true
43
+ mountOnEnter: true,
44
+ unmountOnExit: true,
45
+ nodeRef: domRef
43
46
  }, /*#__PURE__*/_react.default.createElement("div", {
44
- className: prefixCls + "-slider-popover" + (content ? '' : ' no-content')
47
+ className: prefixCls + "-slider-popover" + (content ? '' : ' no-content'),
48
+ ref: domRef
45
49
  }, /*#__PURE__*/_react.default.createElement("div", {
46
50
  className: prefixCls + "-slider-popover-content"
47
51
  }, content), /*#__PURE__*/_react.default.createElement("div", {
@@ -33,16 +33,15 @@
33
33
  updateValue = params.updateValue,
34
34
  onAddButtonClick = params.onAddButtonClick,
35
35
  onMinusButtonClick = params.onMinusButtonClick;
36
+ var minusDisable = actualInputValue <= min || disabled;
36
37
 
37
- var _useState = (0, _react.useState)(function () {
38
- return actualInputValue === min || disabled;
39
- }),
38
+ var _useState = (0, _react.useState)(minusDisable),
40
39
  minusButtonDisable = _useState[0],
41
40
  setMinusButtonDisable = _useState[1];
42
41
 
43
- var _useState2 = (0, _react.useState)(function () {
44
- return actualInputValue === max || disabled;
45
- }),
42
+ var addDisable = actualInputValue >= max || disabled;
43
+
44
+ var _useState2 = (0, _react.useState)(addDisable),
46
45
  addButtonDisable = _useState2[0],
47
46
  setAddButtonDisable = _useState2[1];
48
47
 
@@ -73,9 +72,9 @@
73
72
 
74
73
 
75
74
  (0, _react.useEffect)(function () {
76
- setMinusButtonDisable(actualInputValue <= min);
77
- setAddButtonDisable(actualInputValue >= max);
78
- }, [actualInputValue]);
75
+ setMinusButtonDisable(minusDisable);
76
+ setAddButtonDisable(addDisable);
77
+ }, [minusDisable, addDisable]);
79
78
  return {
80
79
  minusButtonDisable: minusButtonDisable,
81
80
  addButtonDisable: addButtonDisable,
package/umd/style.d.ts CHANGED
@@ -1,35 +1,32 @@
1
1
  import '../style/public.less';
2
- import './button/style';
2
+ import './tabs/style';
3
+ import './sticky/style';
4
+ import './load-more/style';
5
+ import './cell/style';
3
6
  import './action-sheet/style';
4
7
  import './avatar/style';
5
8
  import './badge/style';
9
+ import './button/style';
6
10
  import './carousel/style';
7
- import './cell/style';
8
11
  import './checkbox/style';
9
12
  import './circle-progress/style';
10
13
  import './collapse/style';
11
14
  import './context-provider/style';
12
15
  import './count-down/style';
13
16
  import './date-picker/style';
14
- import './divider/style';
15
17
  import './dialog/style';
18
+ import './divider/style';
16
19
  import './dropdown/style';
17
20
  import './dropdown-menu/style';
18
21
  import './ellipsis/style';
19
22
  import './form/style';
20
- import './input/style';
21
- import './textarea/style';
22
- import './radio/style';
23
- import './image-picker/style';
24
- import './rate/style';
25
- import './slider/style';
26
23
  import './grid/style';
27
24
  import './image/style';
28
- import './show-monitor/style';
25
+ import './image-picker/style';
29
26
  import './image-preview/style';
30
27
  import './index-bar/style';
28
+ import './input/style';
31
29
  import './keyboard/style';
32
- import './load-more/style';
33
30
  import './loading/style';
34
31
  import './masking/style';
35
32
  import './nav-bar/style';
@@ -44,15 +41,18 @@ import './popup-swiper/style';
44
41
  import './portal/style';
45
42
  import './progress/style';
46
43
  import './pull-refresh/style';
44
+ import './radio/style';
45
+ import './rate/style';
47
46
  import './search-bar/style';
47
+ import './show-monitor/style';
48
+ import './slider/style';
48
49
  import './stepper/style';
49
50
  import './steps/style';
50
- import './sticky/style';
51
51
  import './swipe-action/style';
52
52
  import './swipe-load/style';
53
53
  import './switch/style';
54
54
  import './tab-bar/style';
55
- import './tabs/style';
56
55
  import './tag/style';
56
+ import './textarea/style';
57
57
  import './toast/style';
58
58
  import './transition/style';
package/umd/style.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["../style/public.less", "./button/style", "./action-sheet/style", "./avatar/style", "./badge/style", "./carousel/style", "./cell/style", "./checkbox/style", "./circle-progress/style", "./collapse/style", "./context-provider/style", "./count-down/style", "./date-picker/style", "./divider/style", "./dialog/style", "./dropdown/style", "./dropdown-menu/style", "./ellipsis/style", "./form/style", "./input/style", "./textarea/style", "./radio/style", "./image-picker/style", "./rate/style", "./slider/style", "./grid/style", "./image/style", "./show-monitor/style", "./image-preview/style", "./index-bar/style", "./keyboard/style", "./load-more/style", "./loading/style", "./masking/style", "./nav-bar/style", "./notice-bar/style", "./notify/style", "./pagination/style", "./picker/style", "./picker-view/style", "./popover/style", "./popup/style", "./popup-swiper/style", "./portal/style", "./progress/style", "./pull-refresh/style", "./search-bar/style", "./stepper/style", "./steps/style", "./sticky/style", "./swipe-action/style", "./swipe-load/style", "./switch/style", "./tab-bar/style", "./tabs/style", "./tag/style", "./toast/style", "./transition/style"], factory);
3
+ define(["../style/public.less", "./tabs/style", "./sticky/style", "./load-more/style", "./cell/style", "./action-sheet/style", "./avatar/style", "./badge/style", "./button/style", "./carousel/style", "./checkbox/style", "./circle-progress/style", "./collapse/style", "./context-provider/style", "./count-down/style", "./date-picker/style", "./dialog/style", "./divider/style", "./dropdown/style", "./dropdown-menu/style", "./ellipsis/style", "./form/style", "./grid/style", "./image/style", "./image-picker/style", "./image-preview/style", "./index-bar/style", "./input/style", "./keyboard/style", "./loading/style", "./masking/style", "./nav-bar/style", "./notice-bar/style", "./notify/style", "./pagination/style", "./picker/style", "./picker-view/style", "./popover/style", "./popup/style", "./popup-swiper/style", "./portal/style", "./progress/style", "./pull-refresh/style", "./radio/style", "./rate/style", "./search-bar/style", "./show-monitor/style", "./slider/style", "./stepper/style", "./steps/style", "./swipe-action/style", "./swipe-load/style", "./switch/style", "./tab-bar/style", "./tag/style", "./textarea/style", "./toast/style", "./transition/style"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(require("../style/public.less"), require("./button/style"), require("./action-sheet/style"), require("./avatar/style"), require("./badge/style"), require("./carousel/style"), require("./cell/style"), require("./checkbox/style"), require("./circle-progress/style"), require("./collapse/style"), require("./context-provider/style"), require("./count-down/style"), require("./date-picker/style"), require("./divider/style"), require("./dialog/style"), require("./dropdown/style"), require("./dropdown-menu/style"), require("./ellipsis/style"), require("./form/style"), require("./input/style"), require("./textarea/style"), require("./radio/style"), require("./image-picker/style"), require("./rate/style"), require("./slider/style"), require("./grid/style"), require("./image/style"), require("./show-monitor/style"), require("./image-preview/style"), require("./index-bar/style"), require("./keyboard/style"), require("./load-more/style"), require("./loading/style"), require("./masking/style"), require("./nav-bar/style"), require("./notice-bar/style"), require("./notify/style"), require("./pagination/style"), require("./picker/style"), require("./picker-view/style"), require("./popover/style"), require("./popup/style"), require("./popup-swiper/style"), require("./portal/style"), require("./progress/style"), require("./pull-refresh/style"), require("./search-bar/style"), require("./stepper/style"), require("./steps/style"), require("./sticky/style"), require("./swipe-action/style"), require("./swipe-load/style"), require("./switch/style"), require("./tab-bar/style"), require("./tabs/style"), require("./tag/style"), require("./toast/style"), require("./transition/style"));
5
+ factory(require("../style/public.less"), require("./tabs/style"), require("./sticky/style"), require("./load-more/style"), require("./cell/style"), require("./action-sheet/style"), require("./avatar/style"), require("./badge/style"), require("./button/style"), require("./carousel/style"), require("./checkbox/style"), require("./circle-progress/style"), require("./collapse/style"), require("./context-provider/style"), require("./count-down/style"), require("./date-picker/style"), require("./dialog/style"), require("./divider/style"), require("./dropdown/style"), require("./dropdown-menu/style"), require("./ellipsis/style"), require("./form/style"), require("./grid/style"), require("./image/style"), require("./image-picker/style"), require("./image-preview/style"), require("./index-bar/style"), require("./input/style"), require("./keyboard/style"), require("./loading/style"), require("./masking/style"), require("./nav-bar/style"), require("./notice-bar/style"), require("./notify/style"), require("./pagination/style"), require("./picker/style"), require("./picker-view/style"), require("./popover/style"), require("./popup/style"), require("./popup-swiper/style"), require("./portal/style"), require("./progress/style"), require("./pull-refresh/style"), require("./radio/style"), require("./rate/style"), require("./search-bar/style"), require("./show-monitor/style"), require("./slider/style"), require("./stepper/style"), require("./steps/style"), require("./swipe-action/style"), require("./swipe-load/style"), require("./switch/style"), require("./tab-bar/style"), require("./tag/style"), require("./textarea/style"), require("./toast/style"), require("./transition/style"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
@@ -185,8 +185,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
185
185
  * @param {string | ToastProps} config Configuration
186
186
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
187
187
  */
188
- toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
189
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
188
+ toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
189
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
190
190
  close: () => void;
191
191
  hide: () => void;
192
192
  };
@@ -196,8 +196,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
196
196
  * @param {string | ToastProps} config Configuration
197
197
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
198
198
  */
199
- info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
200
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
199
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
200
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
201
201
  close: () => void;
202
202
  hide: () => void;
203
203
  };
@@ -207,8 +207,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
207
207
  * @param {string | ToastProps} config Configuration
208
208
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
209
209
  */
210
- success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
211
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
210
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
211
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
212
212
  close: () => void;
213
213
  hide: () => void;
214
214
  };
@@ -218,8 +218,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
218
218
  * @param {string | ToastProps} config Configuration
219
219
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
220
220
  */
221
- error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
222
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
221
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
222
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
223
223
  close: () => void;
224
224
  hide: () => void;
225
225
  };
@@ -229,8 +229,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
229
229
  * @param {string | ToastProps} config Configuration
230
230
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
231
231
  */
232
- loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
233
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
232
+ loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
233
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
234
234
  close: () => void;
235
235
  hide: () => void;
236
236
  };
@@ -240,8 +240,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
240
240
  * @param {string | ToastProps} config Configuration
241
241
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
242
242
  */
243
- warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
244
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "loadingIcon" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
243
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
244
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
245
245
  close: () => void;
246
246
  hide: () => void;
247
247
  };
@@ -68,6 +68,7 @@
68
68
  initialBodyOverflow = props.initialBodyOverflow;
69
69
  var closeTimerRef = (0, _react.useRef)();
70
70
  var domRef = (0, _react.useRef)(null);
71
+ var wrapDomRef = (0, _react.useRef)(null);
71
72
  var isInitialMount = (0, _react.useRef)(false);
72
73
  var hasType = type && type !== 'info';
73
74
  (0, _react.useImperativeHandle)(ref, function () {
@@ -136,7 +137,8 @@
136
137
  className: (0, _mobileUtils.cls)(prefixClass + "-wrapper", "from-" + direction, {
137
138
  'no-event': !disableBodyTouch
138
139
  }),
139
- onClick: handleClickMask
140
+ onClick: handleClickMask,
141
+ ref: wrapDomRef
140
142
  }, /*#__PURE__*/_react.default.createElement("div", {
141
143
  className: (0, _mobileUtils.cls)(prefixClass + "-inner", layout, (_cls = {}, _cls[prefixClass + "-inner-mixin"] = (loading || hasType || icon) && layout === 'vertical', _cls))
142
144
  }, loading && /*#__PURE__*/_react.default.createElement("div", {
@@ -163,7 +165,8 @@
163
165
  }, /*#__PURE__*/_react.default.createElement(_transition.default, {
164
166
  in: visible,
165
167
  timeout: transitionDuration,
166
- type: "fade"
168
+ type: "fade",
169
+ nodeRef: wrapDomRef
167
170
  }, renderComponent(prefixCls + "-toast"))));
168
171
  });
169
172
  });