@arco-design/mobile-react 2.23.0 → 2.24.1

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 (191) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/render.d.ts +3 -1
  5. package/cjs/_helpers/render.js +10 -3
  6. package/cjs/action-sheet/index.d.ts +5 -5
  7. package/cjs/action-sheet/index.js +4 -3
  8. package/cjs/action-sheet/methods.d.ts +1 -1
  9. package/cjs/badge/style/css/index.css +1 -2
  10. package/cjs/checkbox/checkbox.js +4 -0
  11. package/cjs/circle-progress/index.js +4 -0
  12. package/cjs/context-provider/index.d.ts +4 -0
  13. package/cjs/context-provider/index.js +14 -2
  14. package/cjs/dialog/index.d.ts +8 -8
  15. package/cjs/dialog/index.js +3 -2
  16. package/cjs/dialog/methods.d.ts +3 -3
  17. package/cjs/dialog/style/css/index.css +1 -2
  18. package/cjs/ellipsis/components/js-ellipsis.d.ts +4 -2
  19. package/cjs/ellipsis/components/js-ellipsis.js +14 -1
  20. package/cjs/ellipsis/components/native-ellipsis.d.ts +1 -1
  21. package/cjs/ellipsis/components/native-ellipsis.js +6 -1
  22. package/cjs/ellipsis/demo/style/css/mobile.css +1 -1
  23. package/cjs/ellipsis/demo/style/mobile.less +3 -1
  24. package/cjs/ellipsis/index.js +6 -2
  25. package/cjs/ellipsis/style/css/index.css +14 -1
  26. package/cjs/ellipsis/style/index.less +15 -1
  27. package/cjs/ellipsis/type.d.ts +22 -76
  28. package/cjs/image-preview/index.d.ts +3 -3
  29. package/cjs/image-preview/index.js +3 -2
  30. package/cjs/image-preview/methods.d.ts +2 -1
  31. package/cjs/image-preview/methods.js +2 -2
  32. package/cjs/input/hooks.js +1 -0
  33. package/cjs/input/index.d.ts +5 -0
  34. package/cjs/input/index.js +6 -2
  35. package/cjs/masking/index.d.ts +4 -14
  36. package/cjs/masking/index.js +3 -2
  37. package/cjs/masking/methods.d.ts +3 -2
  38. package/cjs/masking/methods.js +2 -2
  39. package/cjs/nav-bar/index.d.ts +12 -0
  40. package/cjs/nav-bar/index.js +8 -2
  41. package/cjs/notify/index.d.ts +12 -12
  42. package/cjs/notify/index.js +3 -2
  43. package/cjs/notify/methods.d.ts +2 -1
  44. package/cjs/notify/methods.js +2 -2
  45. package/cjs/picker-view/components/picker-cell.js +3 -1
  46. package/cjs/popup/index.d.ts +4 -4
  47. package/cjs/popup/index.js +3 -2
  48. package/cjs/popup/methods.d.ts +1 -1
  49. package/cjs/popup-swiper/index.d.ts +12 -6
  50. package/cjs/popup-swiper/index.js +3 -2
  51. package/cjs/popup-swiper/methods.d.ts +1 -1
  52. package/cjs/progress/index.js +4 -0
  53. package/cjs/rate/index.js +5 -0
  54. package/cjs/slider/index.js +6 -1
  55. package/cjs/stepper/index.js +7 -1
  56. package/cjs/swipe-action/index.d.ts +1 -0
  57. package/cjs/swipe-action/index.js +10 -0
  58. package/cjs/switch/index.js +4 -0
  59. package/cjs/toast/index.d.ts +18 -18
  60. package/cjs/toast/index.js +3 -2
  61. package/cjs/toast/methods.d.ts +2 -1
  62. package/cjs/toast/methods.js +2 -2
  63. package/dist/index.js +141 -47
  64. package/dist/index.min.js +3 -3
  65. package/dist/style.css +26 -114
  66. package/dist/style.min.css +1 -1
  67. package/esm/_helpers/render.d.ts +3 -1
  68. package/esm/_helpers/render.js +10 -3
  69. package/esm/action-sheet/index.d.ts +5 -5
  70. package/esm/action-sheet/index.js +4 -3
  71. package/esm/action-sheet/methods.d.ts +1 -1
  72. package/esm/badge/style/css/index.css +1 -2
  73. package/esm/checkbox/checkbox.js +4 -0
  74. package/esm/circle-progress/index.js +4 -0
  75. package/esm/context-provider/index.d.ts +4 -0
  76. package/esm/context-provider/index.js +13 -2
  77. package/esm/dialog/index.d.ts +8 -8
  78. package/esm/dialog/index.js +3 -2
  79. package/esm/dialog/methods.d.ts +3 -3
  80. package/esm/dialog/style/css/index.css +1 -2
  81. package/esm/ellipsis/components/js-ellipsis.d.ts +4 -2
  82. package/esm/ellipsis/components/js-ellipsis.js +14 -1
  83. package/esm/ellipsis/components/native-ellipsis.d.ts +1 -1
  84. package/esm/ellipsis/components/native-ellipsis.js +6 -1
  85. package/esm/ellipsis/demo/style/css/mobile.css +1 -1
  86. package/esm/ellipsis/demo/style/mobile.less +3 -1
  87. package/esm/ellipsis/index.js +6 -2
  88. package/esm/ellipsis/style/css/index.css +14 -1
  89. package/esm/ellipsis/style/index.less +15 -1
  90. package/esm/ellipsis/type.d.ts +22 -76
  91. package/esm/image-preview/index.d.ts +3 -3
  92. package/esm/image-preview/index.js +3 -2
  93. package/esm/image-preview/methods.d.ts +2 -1
  94. package/esm/image-preview/methods.js +2 -2
  95. package/esm/input/hooks.js +1 -0
  96. package/esm/input/index.d.ts +5 -0
  97. package/esm/input/index.js +6 -2
  98. package/esm/masking/index.d.ts +4 -14
  99. package/esm/masking/index.js +3 -2
  100. package/esm/masking/methods.d.ts +3 -2
  101. package/esm/masking/methods.js +2 -2
  102. package/esm/nav-bar/index.d.ts +12 -0
  103. package/esm/nav-bar/index.js +8 -2
  104. package/esm/notify/index.d.ts +12 -12
  105. package/esm/notify/index.js +3 -2
  106. package/esm/notify/methods.d.ts +2 -1
  107. package/esm/notify/methods.js +2 -2
  108. package/esm/picker-view/components/picker-cell.js +3 -1
  109. package/esm/popup/index.d.ts +4 -4
  110. package/esm/popup/index.js +3 -2
  111. package/esm/popup/methods.d.ts +1 -1
  112. package/esm/popup-swiper/index.d.ts +12 -6
  113. package/esm/popup-swiper/index.js +3 -2
  114. package/esm/popup-swiper/methods.d.ts +1 -1
  115. package/esm/progress/index.js +4 -0
  116. package/esm/rate/index.js +5 -0
  117. package/esm/slider/index.js +6 -1
  118. package/esm/stepper/index.js +7 -1
  119. package/esm/swipe-action/index.d.ts +1 -0
  120. package/esm/swipe-action/index.js +1 -0
  121. package/esm/switch/index.js +4 -0
  122. package/esm/toast/index.d.ts +18 -18
  123. package/esm/toast/index.js +3 -2
  124. package/esm/toast/methods.d.ts +2 -1
  125. package/esm/toast/methods.js +2 -2
  126. package/package.json +3 -3
  127. package/style/css/public.css +4 -4
  128. package/tokens/app/arcodesign/default/css-variables.less +2 -0
  129. package/tokens/app/arcodesign/default/index.d.ts +2 -0
  130. package/tokens/app/arcodesign/default/index.js +127 -125
  131. package/tokens/app/arcodesign/default/index.json +24 -0
  132. package/tokens/app/arcodesign/default/index.less +2 -0
  133. package/umd/_helpers/render.d.ts +3 -1
  134. package/umd/_helpers/render.js +13 -7
  135. package/umd/action-sheet/index.d.ts +5 -5
  136. package/umd/action-sheet/index.js +4 -3
  137. package/umd/action-sheet/methods.d.ts +1 -1
  138. package/umd/badge/style/css/index.css +1 -2
  139. package/umd/checkbox/checkbox.js +4 -0
  140. package/umd/circle-progress/index.js +4 -0
  141. package/umd/context-provider/index.d.ts +4 -0
  142. package/umd/context-provider/index.js +13 -1
  143. package/umd/dialog/index.d.ts +8 -8
  144. package/umd/dialog/index.js +3 -2
  145. package/umd/dialog/methods.d.ts +3 -3
  146. package/umd/dialog/style/css/index.css +1 -2
  147. package/umd/ellipsis/components/js-ellipsis.d.ts +4 -2
  148. package/umd/ellipsis/components/js-ellipsis.js +14 -1
  149. package/umd/ellipsis/components/native-ellipsis.d.ts +1 -1
  150. package/umd/ellipsis/components/native-ellipsis.js +6 -1
  151. package/umd/ellipsis/demo/style/css/mobile.css +1 -1
  152. package/umd/ellipsis/demo/style/mobile.less +3 -1
  153. package/umd/ellipsis/index.js +6 -2
  154. package/umd/ellipsis/style/css/index.css +14 -1
  155. package/umd/ellipsis/style/index.less +15 -1
  156. package/umd/ellipsis/type.d.ts +22 -76
  157. package/umd/image-preview/index.d.ts +3 -3
  158. package/umd/image-preview/index.js +3 -2
  159. package/umd/image-preview/methods.d.ts +2 -1
  160. package/umd/image-preview/methods.js +2 -2
  161. package/umd/input/hooks.js +1 -0
  162. package/umd/input/index.d.ts +5 -0
  163. package/umd/input/index.js +6 -2
  164. package/umd/masking/index.d.ts +4 -14
  165. package/umd/masking/index.js +3 -2
  166. package/umd/masking/methods.d.ts +3 -2
  167. package/umd/masking/methods.js +2 -2
  168. package/umd/nav-bar/index.d.ts +12 -0
  169. package/umd/nav-bar/index.js +8 -2
  170. package/umd/notify/index.d.ts +12 -12
  171. package/umd/notify/index.js +3 -2
  172. package/umd/notify/methods.d.ts +2 -1
  173. package/umd/notify/methods.js +2 -2
  174. package/umd/picker-view/components/picker-cell.js +3 -1
  175. package/umd/popup/index.d.ts +4 -4
  176. package/umd/popup/index.js +3 -2
  177. package/umd/popup/methods.d.ts +1 -1
  178. package/umd/popup-swiper/index.d.ts +12 -6
  179. package/umd/popup-swiper/index.js +3 -2
  180. package/umd/popup-swiper/methods.d.ts +1 -1
  181. package/umd/progress/index.js +4 -0
  182. package/umd/rate/index.js +5 -0
  183. package/umd/slider/index.js +6 -1
  184. package/umd/stepper/index.js +7 -1
  185. package/umd/swipe-action/index.d.ts +1 -0
  186. package/umd/swipe-action/index.js +11 -4
  187. package/umd/switch/index.js +4 -0
  188. package/umd/toast/index.d.ts +18 -18
  189. package/umd/toast/index.js +3 -2
  190. package/umd/toast/methods.d.ts +2 -1
  191. package/umd/toast/methods.js +2 -2
@@ -59,11 +59,14 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
59
59
  */
60
60
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
61
61
  key?: string | undefined;
62
- }) => {
62
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
63
63
  close: () => void;
64
64
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
65
65
  key?: string | undefined;
66
- }) => void;
66
+ }) => void; /**
67
+ * 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
68
+ * @en The touchstart callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component
69
+ */
67
70
  };
68
71
  };
69
72
  declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>> & {
@@ -73,13 +76,16 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
73
76
  * @param {string | PopupSwiperProps} config Configuration
74
77
  * @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
75
78
  */
76
- open: (config: Pick<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>, "direction" | "ref" | "children" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "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" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "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"> & {
77
80
  key?: string | undefined;
78
- }) => {
81
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
79
82
  close: () => void;
80
- update: (newConfig: Pick<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>, "direction" | "ref" | "children" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "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" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "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"> & {
81
84
  key?: string | undefined;
82
- }) => void;
85
+ }) => void; /**
86
+ * 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
87
+ * @en The touchstart callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component
88
+ */
83
89
  };
84
90
  };
85
91
  /**
@@ -280,6 +280,8 @@ function methodsGenerator(Comp) {
280
280
  open: (0, _methods.open)(Comp)
281
281
  };
282
282
  }
283
+
284
+ var PopupSwiperWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(PopupSwiper);
283
285
  /**
284
286
  * 基于弹出层(Popup)封装的具有手势关闭功能的弹出层组件,拥有 Popup 组件的其他能力。
285
287
  * @en The popup with gesture closing function based on the popup encapsulation, has other capabilities of the Popup component.
@@ -289,7 +291,6 @@ function methodsGenerator(Comp) {
289
291
  * @name_en PopupSwiper
290
292
  */
291
293
 
292
-
293
- var _default = (0, _mobileUtils.componentWrapper)(PopupSwiper, methodsGenerator(PopupSwiper));
294
+ var _default = (0, _mobileUtils.componentWrapper)(PopupSwiper, methodsGenerator(PopupSwiperWithGlobalContext));
294
295
 
295
296
  exports.default = _default;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { OpenBaseProps } from '../masking/methods';
3
3
  export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
4
4
  key?: string | undefined;
5
- }) => {
5
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
6
6
  close: () => void;
7
7
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
8
8
  key?: string | undefined;
@@ -101,6 +101,10 @@ var Progress = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
101
101
  function renderBarProgress(_ref) {
102
102
  var prefixCls = _ref.prefixCls;
103
103
  return /*#__PURE__*/_react.default.createElement("div", {
104
+ role: "progressbar",
105
+ "aria-valuenow": percentage,
106
+ "aria-valuemax": 100,
107
+ "aria-valuemin": 0,
104
108
  className: (0, _mobileUtils.cls)(prefixCls + "-progress", {
105
109
  'progress-fixed': mode === 'nav'
106
110
  }, {
package/cjs/rate/index.js CHANGED
@@ -160,6 +160,11 @@ var Rate = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
160
160
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref2) {
161
161
  var prefixCls = _ref2.prefixCls;
162
162
  return /*#__PURE__*/_react.default.createElement("div", {
163
+ role: "slider",
164
+ "aria-valuemin": 0,
165
+ "aria-valuemax": count,
166
+ "aria-valuenow": innerValue,
167
+ "aria-disabled": disabled,
163
168
  className: (0, _mobileUtils.cls)(prefixCls + "-rate", className, {
164
169
  disabled: disabled
165
170
  }),
@@ -144,7 +144,12 @@ var Slider = /*#__PURE__*/(0, _react.forwardRef)(function (_, ref) {
144
144
  'show-marks': showMarks
145
145
  }),
146
146
  style: style,
147
- ref: domRef
147
+ ref: domRef,
148
+ role: "slider",
149
+ "aria-valuemin": min,
150
+ "aria-valuemax": max,
151
+ "aria-valuenow": Array.isArray(valueGroup) ? valueGroup[0] : valueGroup,
152
+ "aria-disabled": disabled
148
153
  }, isHorizontal ? renderPrefixLabel : renderSuffixLabel, /*#__PURE__*/_react.default.createElement("div", {
149
154
  className: prefixCls + "-slider-wrapper"
150
155
  }, /*#__PURE__*/_react.default.createElement(_marks.default, {
@@ -151,6 +151,7 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
151
151
  ref: domRef,
152
152
  onClick: onClick
153
153
  }, /*#__PURE__*/_react.default.createElement("div", {
154
+ "aria-label": "decrease",
154
155
  onClick: handleMinusButtonClick
155
156
  }, minusButton || /*#__PURE__*/_react.default.createElement("div", {
156
157
  className: (0, _mobileUtils.cls)(prefixCls + "-stepper-minus-button")
@@ -168,8 +169,13 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
168
169
  value: showValue,
169
170
  readOnly: inputReadonly,
170
171
  ref: inputRef,
171
- type: "number"
172
+ type: "number",
173
+ role: "spinbutton",
174
+ "aria-valuenow": Number(showValue),
175
+ "aria-valuemax": max,
176
+ "aria-valuemin": min
172
177
  }), /*#__PURE__*/_react.default.createElement("div", {
178
+ "aria-label": "increase",
173
179
  onClick: handleAddButtonClick
174
180
  }, addButton || /*#__PURE__*/_react.default.createElement("div", {
175
181
  className: (0, _mobileUtils.cls)(prefixCls + "-stepper-add-button")
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SwipeActionProps, SwipeActionRef } from './type';
3
+ export * from './type';
3
4
  /**
4
5
  * 滑动操作组件,左右滑动拉出菜单栏
5
6
  * @en SwipeAction component, slide left and right to pull out the menu bar
@@ -3,6 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
5
  exports.__esModule = true;
6
+ var _exportNames = {};
6
7
  exports.default = void 0;
7
8
 
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -17,6 +18,15 @@ var _item = _interopRequireDefault(require("./item"));
17
18
 
18
19
  var _helpers = require("../_helpers");
19
20
 
21
+ var _type = require("./type");
22
+
23
+ Object.keys(_type).forEach(function (key) {
24
+ if (key === "default" || key === "__esModule") return;
25
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
+ if (key in exports && exports[key] === _type[key]) return;
27
+ exports[key] = _type[key];
28
+ });
29
+
20
30
  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); }
21
31
 
22
32
  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; }
@@ -116,6 +116,10 @@ var Switch = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
116
116
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
117
117
  var prefixCls = _ref.prefixCls;
118
118
  return /*#__PURE__*/_react.default.createElement("div", {
119
+ role: "switch",
120
+ "aria-checked": switchChecked,
121
+ "aria-disabled": disabled,
122
+ tabIndex: 0,
119
123
  ref: domRef,
120
124
  className: (0, _mobileUtils.cls)(prefixCls + "-switch all-border-box", className, "type-" + platform, "system-" + system, shape, {
121
125
  checked: switchChecked,
@@ -117,7 +117,7 @@ export declare function methodsGenerator<P extends ToastBaseProps>(Comp: React.F
117
117
  * @param {string | ToastProps} config Configuration
118
118
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
119
119
  */
120
- toast: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
120
+ toast: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
121
121
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
122
122
  close: () => void;
123
123
  hide: () => void;
@@ -128,7 +128,7 @@ export declare function methodsGenerator<P extends ToastBaseProps>(Comp: React.F
128
128
  * @param {string | ToastProps} config Configuration
129
129
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
130
130
  */
131
- info: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
131
+ info: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
132
132
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
133
133
  close: () => void;
134
134
  hide: () => void;
@@ -139,7 +139,7 @@ export declare function methodsGenerator<P extends ToastBaseProps>(Comp: React.F
139
139
  * @param {string | ToastProps} config Configuration
140
140
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
141
141
  */
142
- success: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
142
+ success: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
143
143
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
144
144
  close: () => void;
145
145
  hide: () => void;
@@ -150,7 +150,7 @@ export declare function methodsGenerator<P extends ToastBaseProps>(Comp: React.F
150
150
  * @param {string | ToastProps} config Configuration
151
151
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
152
152
  */
153
- error: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
153
+ error: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
154
154
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
155
155
  close: () => void;
156
156
  hide: () => void;
@@ -161,7 +161,7 @@ export declare function methodsGenerator<P extends ToastBaseProps>(Comp: React.F
161
161
  * @param {string | ToastProps} config Configuration
162
162
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
163
163
  */
164
- loading: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
164
+ loading: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
165
165
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
166
166
  close: () => void;
167
167
  hide: () => void;
@@ -172,7 +172,7 @@ export declare function methodsGenerator<P extends ToastBaseProps>(Comp: React.F
172
172
  * @param {string | ToastProps} config Configuration
173
173
  * @returns {{ update: (config: ToastProps) => void; close: () => void }}
174
174
  */
175
- warn: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
175
+ warn: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
176
176
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
177
177
  close: () => void;
178
178
  hide: () => void;
@@ -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<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => {
189
- update: (newConfig: Pick<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => {
200
- update: (newConfig: Pick<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => {
211
- update: (newConfig: Pick<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => {
222
- update: (newConfig: Pick<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => {
233
- update: (newConfig: Pick<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => {
244
- update: (newConfig: Pick<ToastProps & React.RefAttributes<ToastRef>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "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" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose" | "initialBodyOverflow" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap">) => void;
245
245
  close: () => void;
246
246
  hide: () => void;
247
247
  };
@@ -222,6 +222,8 @@ function methodsGenerator(Comp) {
222
222
  warn: (0, _methods.toast)(Comp, 'warn')
223
223
  };
224
224
  }
225
+
226
+ var ToastWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Toast);
225
227
  /**
226
228
  * 轻提示组件,支持各个场景下调用方法。
227
229
  * @en The toast component, supports calling methods in various scenarios.
@@ -231,7 +233,6 @@ function methodsGenerator(Comp) {
231
233
  * @name_en Toast
232
234
  */
233
235
 
234
-
235
- var _default = (0, _mobileUtils.componentWrapper)(Toast, methodsGenerator(Toast));
236
+ var _default = (0, _mobileUtils.componentWrapper)(Toast, methodsGenerator(ToastWithGlobalContext));
236
237
 
237
238
  exports.default = _default;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { GlobalContextParams } from '../context-provider';
2
3
  export interface ToastBaseProps {
3
4
  getContainer?: () => HTMLElement;
4
5
  onClose?: (scene?: string) => void;
@@ -8,7 +9,7 @@ export interface ToastBaseProps {
8
9
  type?: string;
9
10
  loading?: boolean;
10
11
  }
11
- export declare function toast<P extends ToastBaseProps>(Component: React.FunctionComponent<P>, type?: string): (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
12
+ export declare function toast<P extends ToastBaseProps>(Component: React.FunctionComponent<P>, type?: string): (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: GlobalContextParams | undefined) => {
12
13
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
13
14
  close: () => void;
14
15
  hide: () => void;
@@ -12,7 +12,7 @@ var _mobileUtils = require("@arco-design/mobile-utils");
12
12
  var _render = require("../_helpers/render");
13
13
 
14
14
  function toast(Component, type) {
15
- return function (originConfig) {
15
+ return function (originConfig, context) {
16
16
  var config = typeof originConfig === 'string' ? {
17
17
  content: originConfig,
18
18
  type: 'info'
@@ -26,7 +26,7 @@ function toast(Component, type) {
26
26
  var div = document.createElement('div');
27
27
  document.body.appendChild(div);
28
28
 
29
- var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
29
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
30
30
  render = _ReactDOMRender.render,
31
31
  unmount = _ReactDOMRender.unmount;
32
32