@arco-design/mobile-react 2.27.4 → 2.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.d.ts +1 -0
  5. package/cjs/_helpers/hooks.js +44 -28
  6. package/cjs/action-sheet/index.d.ts +2 -2
  7. package/cjs/badge/index.js +2 -1
  8. package/cjs/badge/style/css/index.css +12 -0
  9. package/cjs/badge/style/index.less +3 -3
  10. package/cjs/button/style/css/index.css +4 -0
  11. package/cjs/button/style/index.less +1 -1
  12. package/cjs/cell/style/css/index.css +7 -0
  13. package/cjs/cell/style/index.less +4 -1
  14. package/cjs/checkbox/style/css/index.css +13 -0
  15. package/cjs/checkbox/style/index.less +3 -3
  16. package/cjs/collapse/collapse.js +12 -6
  17. package/cjs/dialog/index.d.ts +2 -2
  18. package/cjs/form/style/css/index.css +16 -0
  19. package/cjs/form/style/index.less +4 -4
  20. package/cjs/image-preview/index.d.ts +2 -2
  21. package/cjs/image-preview/index.js +4 -2
  22. package/cjs/image-preview/style/css/index.css +3 -0
  23. package/cjs/image-preview/style/index.less +4 -0
  24. package/cjs/index.d.ts +12 -12
  25. package/cjs/index.js +46 -46
  26. package/cjs/load-more/index.d.ts +5 -0
  27. package/cjs/load-more/index.js +2 -1
  28. package/cjs/masking/index.d.ts +2 -2
  29. package/cjs/masking/index.js +4 -2
  30. package/cjs/notify/index.d.ts +8 -8
  31. package/cjs/popover/popover.js +10 -2
  32. package/cjs/popup/index.d.ts +2 -2
  33. package/cjs/popup-swiper/index.d.ts +2 -2
  34. package/cjs/radio/style/css/index.css +8 -0
  35. package/cjs/radio/style/index.less +2 -2
  36. package/cjs/rate/index.js +5 -3
  37. package/cjs/rate/style/css/index.css +4 -0
  38. package/cjs/rate/style/index.less +4 -0
  39. package/cjs/slider/hooks/index.d.ts +1 -1
  40. package/cjs/slider/popover.js +6 -2
  41. package/cjs/stepper/hooks/useButtonClick.js +8 -9
  42. package/cjs/sticky/index.d.ts +5 -0
  43. package/cjs/sticky/index.js +20 -7
  44. package/cjs/style.d.ts +13 -13
  45. package/cjs/style.js +24 -24
  46. package/cjs/switch/index.js +7 -2
  47. package/cjs/switch/style/css/index.css +44 -0
  48. package/cjs/switch/style/index.less +19 -7
  49. package/cjs/tabs/demo/style/css/mobile.css +11 -0
  50. package/cjs/tabs/demo/style/mobile.less +5 -1
  51. package/cjs/tabs/index.js +14 -5
  52. package/cjs/tabs/style/css/index.css +32 -7
  53. package/cjs/tabs/style/index.less +9 -14
  54. package/cjs/tabs/tab-cell-underline.js +14 -5
  55. package/cjs/tabs/tab-cell.js +15 -7
  56. package/cjs/tabs/tab-pane.js +4 -3
  57. package/cjs/tabs/type.d.ts +1 -0
  58. package/cjs/toast/index.d.ts +12 -12
  59. package/cjs/toast/index.js +5 -2
  60. package/dist/index.js +13914 -13836
  61. package/dist/index.min.js +4 -4
  62. package/dist/style.css +3366 -3236
  63. package/dist/style.min.css +1 -1
  64. package/esm/_helpers/hooks.d.ts +1 -0
  65. package/esm/_helpers/hooks.js +43 -29
  66. package/esm/action-sheet/index.d.ts +2 -2
  67. package/esm/badge/index.js +2 -1
  68. package/esm/badge/style/css/index.css +12 -0
  69. package/esm/badge/style/index.less +3 -3
  70. package/esm/button/style/css/index.css +4 -0
  71. package/esm/button/style/index.less +1 -1
  72. package/esm/cell/style/css/index.css +7 -0
  73. package/esm/cell/style/index.less +4 -1
  74. package/esm/checkbox/style/css/index.css +13 -0
  75. package/esm/checkbox/style/index.less +3 -3
  76. package/esm/collapse/collapse.js +14 -8
  77. package/esm/dialog/index.d.ts +2 -2
  78. package/esm/form/style/css/index.css +16 -0
  79. package/esm/form/style/index.less +4 -4
  80. package/esm/image-preview/index.d.ts +2 -2
  81. package/esm/image-preview/index.js +4 -2
  82. package/esm/image-preview/style/css/index.css +3 -0
  83. package/esm/image-preview/style/index.less +4 -0
  84. package/esm/index.d.ts +12 -12
  85. package/esm/index.js +12 -12
  86. package/esm/load-more/index.d.ts +5 -0
  87. package/esm/load-more/index.js +2 -1
  88. package/esm/masking/index.d.ts +2 -2
  89. package/esm/masking/index.js +4 -2
  90. package/esm/notify/index.d.ts +8 -8
  91. package/esm/popover/popover.js +10 -2
  92. package/esm/popup/index.d.ts +2 -2
  93. package/esm/popup-swiper/index.d.ts +2 -2
  94. package/esm/radio/style/css/index.css +8 -0
  95. package/esm/radio/style/index.less +2 -2
  96. package/esm/rate/index.js +5 -3
  97. package/esm/rate/style/css/index.css +4 -0
  98. package/esm/rate/style/index.less +4 -0
  99. package/esm/slider/hooks/index.d.ts +1 -1
  100. package/esm/slider/popover.js +7 -3
  101. package/esm/stepper/hooks/useButtonClick.js +8 -9
  102. package/esm/sticky/index.d.ts +5 -0
  103. package/esm/sticky/index.js +20 -7
  104. package/esm/style.d.ts +13 -13
  105. package/esm/style.js +13 -13
  106. package/esm/switch/index.js +9 -4
  107. package/esm/switch/style/css/index.css +44 -0
  108. package/esm/switch/style/index.less +19 -7
  109. package/esm/tabs/demo/style/css/mobile.css +11 -0
  110. package/esm/tabs/demo/style/mobile.less +5 -1
  111. package/esm/tabs/index.js +16 -7
  112. package/esm/tabs/style/css/index.css +32 -7
  113. package/esm/tabs/style/index.less +9 -14
  114. package/esm/tabs/tab-cell-underline.js +14 -6
  115. package/esm/tabs/tab-cell.js +15 -8
  116. package/esm/tabs/tab-pane.js +4 -3
  117. package/esm/tabs/type.d.ts +1 -0
  118. package/esm/toast/index.d.ts +12 -12
  119. package/esm/toast/index.js +5 -2
  120. package/package.json +3 -3
  121. package/umd/_helpers/hooks.d.ts +1 -0
  122. package/umd/_helpers/hooks.js +44 -28
  123. package/umd/action-sheet/index.d.ts +2 -2
  124. package/umd/badge/index.js +2 -1
  125. package/umd/badge/style/css/index.css +12 -0
  126. package/umd/badge/style/index.less +3 -3
  127. package/umd/button/style/css/index.css +4 -0
  128. package/umd/button/style/index.less +1 -1
  129. package/umd/cell/style/css/index.css +7 -0
  130. package/umd/cell/style/index.less +4 -1
  131. package/umd/checkbox/style/css/index.css +13 -0
  132. package/umd/checkbox/style/index.less +3 -3
  133. package/umd/collapse/collapse.js +12 -6
  134. package/umd/dialog/index.d.ts +2 -2
  135. package/umd/form/style/css/index.css +16 -0
  136. package/umd/form/style/index.less +4 -4
  137. package/umd/image-preview/index.d.ts +2 -2
  138. package/umd/image-preview/index.js +4 -2
  139. package/umd/image-preview/style/css/index.css +3 -0
  140. package/umd/image-preview/style/index.less +4 -0
  141. package/umd/index.d.ts +12 -12
  142. package/umd/index.js +28 -28
  143. package/umd/load-more/index.d.ts +5 -0
  144. package/umd/load-more/index.js +2 -1
  145. package/umd/masking/index.d.ts +2 -2
  146. package/umd/masking/index.js +4 -2
  147. package/umd/notify/index.d.ts +8 -8
  148. package/umd/popover/popover.js +10 -2
  149. package/umd/popup/index.d.ts +2 -2
  150. package/umd/popup-swiper/index.d.ts +2 -2
  151. package/umd/radio/style/css/index.css +8 -0
  152. package/umd/radio/style/index.less +2 -2
  153. package/umd/rate/index.js +5 -3
  154. package/umd/rate/style/css/index.css +4 -0
  155. package/umd/rate/style/index.less +4 -0
  156. package/umd/slider/hooks/index.d.ts +1 -1
  157. package/umd/slider/popover.js +6 -2
  158. package/umd/stepper/hooks/useButtonClick.js +8 -9
  159. package/umd/sticky/index.d.ts +5 -0
  160. package/umd/sticky/index.js +20 -7
  161. package/umd/style.d.ts +13 -13
  162. package/umd/style.js +2 -2
  163. package/umd/switch/index.js +7 -2
  164. package/umd/switch/style/css/index.css +44 -0
  165. package/umd/switch/style/index.less +19 -7
  166. package/umd/tabs/demo/style/css/mobile.css +11 -0
  167. package/umd/tabs/demo/style/mobile.less +5 -1
  168. package/umd/tabs/index.js +14 -5
  169. package/umd/tabs/style/css/index.css +32 -7
  170. package/umd/tabs/style/index.less +9 -14
  171. package/umd/tabs/tab-cell-underline.js +16 -9
  172. package/umd/tabs/tab-cell.js +17 -11
  173. package/umd/tabs/tab-pane.js +4 -3
  174. package/umd/tabs/type.d.ts +1 -0
  175. package/umd/toast/index.d.ts +12 -12
  176. package/umd/toast/index.js +5 -2
@@ -13,6 +13,8 @@ var _mobileUtils = require("@arco-design/mobile-utils");
13
13
 
14
14
  var _helpers = require("../_helpers");
15
15
 
16
+ var _contextProvider = require("../context-provider");
17
+
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
19
 
18
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -40,6 +42,9 @@ var TabCellUnderline = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
40
42
  getTabRect = props.getTabRect,
41
43
  getTabCenterLeft = props.getTabCenterLeft;
42
44
 
45
+ var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
46
+ useRtl = _useContext.useRtl;
47
+
43
48
  var _useState = (0, _react.useState)({}),
44
49
  underlineStyle = _useState[0],
45
50
  setUnderlineStyle = _useState[1];
@@ -59,6 +64,7 @@ var TabCellUnderline = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
59
64
  var isVertical = tabDirection === 'vertical';
60
65
  var maxScaleWithDefault = caterpillarMaxScale || 2;
61
66
  var translateZStr = translateZ ? ' translateZ(0)' : '';
67
+ var rtlRatio = isVertical && useRtl ? -1 : 1;
62
68
  (0, _react.useImperativeHandle)(ref, function () {
63
69
  return {
64
70
  setCaterpillarAnimate: setCaterpillarAnimate,
@@ -130,11 +136,13 @@ var TabCellUnderline = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
130
136
  }
131
137
 
132
138
  function getDescIndex() {
133
- if (distance > 0) {
139
+ var comparedDis = distance * rtlRatio;
140
+
141
+ if (comparedDis > 0) {
134
142
  return activeIndex - 1;
135
143
  }
136
144
 
137
- if (distance < 0) {
145
+ if (comparedDis < 0) {
138
146
  return activeIndex + 1;
139
147
  }
140
148
 
@@ -156,7 +164,8 @@ var TabCellUnderline = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
156
164
  var currentLeft = getLineLeft(activeIndex);
157
165
  var descIndex = getDescIndex();
158
166
  var descLeft = getLineLeft(descIndex);
159
- var moveRatio = wrapWidth ? distance / wrapWidth : 0;
167
+ var comparedDis = distance * rtlRatio;
168
+ var moveRatio = wrapWidth ? comparedDis / wrapWidth : 0;
160
169
  var leftOffset = moveRatio * (currentLeft - descLeft);
161
170
  var direc = isVertical ? 'X' : 'Y';
162
171
  var transStyle = useCaterpillar && !jumpingDis && !underlineAdaptive ? caterpillarProperty === 'size' ? (_ref = {}, _ref[isVertical ? 'width' : 'height'] = 100 * getLineScale(moveRatio) + "%", _ref.willChange = 'width', _ref) : {
@@ -171,7 +180,7 @@ var TabCellUnderline = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
171
180
  var currentWidth = getLineWidth(activeIndex);
172
181
  var descWidth = getLineWidth(descIndex);
173
182
  var widthOffset = moveRatio * (currentWidth - descWidth);
174
- adaptiveStyle = (_adaptiveStyle = {}, _adaptiveStyle[isVertical ? 'width' : 'height'] = distance > 0 ? currentWidth - widthOffset : currentWidth + widthOffset, _adaptiveStyle.willChange = 'width', _adaptiveStyle);
183
+ adaptiveStyle = (_adaptiveStyle = {}, _adaptiveStyle[isVertical ? 'width' : 'height'] = comparedDis > 0 ? currentWidth - widthOffset : currentWidth + widthOffset, _adaptiveStyle.willChange = 'width', _adaptiveStyle);
175
184
  adaptiveOuterStyle = isVertical ? {
176
185
  width: 'auto'
177
186
  } : {
@@ -188,7 +197,7 @@ var TabCellUnderline = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
188
197
  };
189
198
  return {
190
199
  outer: (0, _extends2.default)({
191
- transform: "translate" + direc + "(" + (distance > 0 ? currentLeft - leftOffset : currentLeft + leftOffset) + "px)" + translateZStr
200
+ transform: "translate" + direc + "(" + (comparedDis > 0 ? currentLeft - leftOffset : currentLeft + leftOffset) + "px)" + translateZStr
192
201
  }, outerSize, adaptiveOuterStyle),
193
202
  inner: (0, _extends2.default)({}, transStyle, adaptiveStyle)
194
203
  };
@@ -15,6 +15,8 @@ var _helpers = require("../_helpers");
15
15
 
16
16
  var _tabCellUnderline = _interopRequireDefault(require("./tab-cell-underline"));
17
17
 
18
+ var _contextProvider = require("../context-provider");
19
+
18
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
21
 
20
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -68,6 +70,10 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
68
70
  translateZ = props.translateZ,
69
71
  tabBarStopPropagation = props.tabBarStopPropagation;
70
72
  var prefix = prefixCls + "-tab-cell";
73
+
74
+ var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
75
+ useRtl = _useContext.useRtl;
76
+
71
77
  var domRef = (0, _react.useRef)(null);
72
78
  var underlineRef = (0, _react.useRef)(null);
73
79
  var allCellRectRef = (0, _react.useRef)([]);
@@ -262,20 +268,22 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
262
268
  }
263
269
 
264
270
  function getCellStyle(index) {
271
+ var _ref2;
272
+
265
273
  if (!isVertical) {
266
274
  return {};
267
275
  }
268
276
 
277
+ var marginStart = useRtl ? 'marginRight' : 'marginLeft';
278
+ var marginEnd = useRtl ? 'marginLeft' : 'marginRight';
279
+
269
280
  if (index === 0) {
270
- return {
271
- marginRight: cellGutter,
272
- marginLeft: getCellPadding('left')
273
- };
281
+ var _ref;
282
+
283
+ return _ref = {}, _ref[marginEnd] = cellGutter, _ref[marginStart] = getCellPadding('left'), _ref;
274
284
  }
275
285
 
276
- return {
277
- marginRight: index === tabs.length - 1 ? void 0 : cellGutter
278
- };
286
+ return _ref2 = {}, _ref2[marginEnd] = index === tabs.length - 1 ? void 0 : cellGutter, _ref2;
279
287
  }
280
288
 
281
289
  function renderBarItem(tab, index) {
@@ -52,7 +52,8 @@ var TabPane = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
52
52
  autoHeight = props.autoHeight,
53
53
  swipeEnergySaving = props.swipeEnergySaving,
54
54
  changeIndex = props.changeIndex,
55
- onScroll = props.onScroll;
55
+ onScroll = props.onScroll,
56
+ rtlRatio = props.rtlRatio;
56
57
  var domRef = (0, _react.useRef)(null);
57
58
  var panesRef = (0, _react.useRef)([]);
58
59
  var autoScrollingRef = (0, _react.useRef)(false);
@@ -251,7 +252,7 @@ var TabPane = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
251
252
  var translateStr = translateZ ? ' translateZ(0)' : '';
252
253
  var sizeStyle = tabDirection === 'vertical' ? {
253
254
  width: 100 * panes.length + "%",
254
- transform: "translateX(" + (distance - wrapWidth * activeIndex) + "px)" + translateStr
255
+ transform: "translateX(" + (distance - wrapWidth * activeIndex * rtlRatio) + "px)" + translateStr
255
256
  } : {
256
257
  height: 100 * panes.length + "%",
257
258
  transform: "translateY(" + (distance - wrapHeight * activeIndex) + "px)" + translateStr
@@ -279,7 +280,7 @@ var TabPane = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
279
280
 
280
281
  var translateStr = translateZ ? ' translateZ(0)' : '';
281
282
  var sizeStyle = tabDirection === 'vertical' ? {
282
- transform: "translateX(" + (distance - wrapWidth * (activeIndex - index)) + "px)" + translateStr
283
+ transform: "translateX(" + (distance - wrapWidth * (activeIndex - index) * rtlRatio) + "px)" + translateStr
283
284
  } : {
284
285
  transform: "translateY(" + (distance - wrapHeight * (activeIndex - index)) + "px)" + translateStr
285
286
  };
@@ -579,6 +579,7 @@ export interface TabPaneProps extends Pick<TabsProps, 'duration' | 'transitionDu
579
579
  paneTrans: boolean;
580
580
  swipeable: boolean;
581
581
  changeIndex: (newIndex: number, from?: string) => void;
582
+ rtlRatio: number;
582
583
  }
583
584
  export interface TabPaneRef {
584
585
  /**
@@ -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
  };
@@ -71,6 +71,7 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
71
71
  initialBodyOverflow = props.initialBodyOverflow;
72
72
  var closeTimerRef = (0, _react.useRef)();
73
73
  var domRef = (0, _react.useRef)(null);
74
+ var wrapDomRef = (0, _react.useRef)(null);
74
75
  var isInitialMount = (0, _react.useRef)(false);
75
76
  var hasType = type && type !== 'info';
76
77
  (0, _react.useImperativeHandle)(ref, function () {
@@ -139,7 +140,8 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
139
140
  className: (0, _mobileUtils.cls)(prefixClass + "-wrapper", "from-" + direction, {
140
141
  'no-event': !disableBodyTouch
141
142
  }),
142
- onClick: handleClickMask
143
+ onClick: handleClickMask,
144
+ ref: wrapDomRef
143
145
  }, /*#__PURE__*/_react.default.createElement("div", {
144
146
  className: (0, _mobileUtils.cls)(prefixClass + "-inner", layout, (_cls = {}, _cls[prefixClass + "-inner-mixin"] = (loading || hasType || icon) && layout === 'vertical', _cls))
145
147
  }, loading && /*#__PURE__*/_react.default.createElement("div", {
@@ -166,7 +168,8 @@ var Toast = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
166
168
  }, /*#__PURE__*/_react.default.createElement(_transition.default, {
167
169
  in: visible,
168
170
  timeout: transitionDuration,
169
- type: "fade"
171
+ type: "fade",
172
+ nodeRef: wrapDomRef
170
173
  }, renderComponent(prefixCls + "-toast"))));
171
174
  });
172
175
  });