@arco-design/mobile-react 2.23.0 → 2.24.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 (156) hide show
  1. package/CHANGELOG.md +16 -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/image-preview/index.d.ts +3 -3
  19. package/cjs/image-preview/index.js +3 -2
  20. package/cjs/image-preview/methods.d.ts +2 -1
  21. package/cjs/image-preview/methods.js +2 -2
  22. package/cjs/input/hooks.js +1 -0
  23. package/cjs/input/index.d.ts +5 -0
  24. package/cjs/input/index.js +6 -2
  25. package/cjs/masking/index.d.ts +4 -14
  26. package/cjs/masking/index.js +3 -2
  27. package/cjs/masking/methods.d.ts +3 -2
  28. package/cjs/masking/methods.js +2 -2
  29. package/cjs/nav-bar/index.d.ts +12 -0
  30. package/cjs/nav-bar/index.js +8 -2
  31. package/cjs/notify/index.d.ts +12 -12
  32. package/cjs/notify/index.js +3 -2
  33. package/cjs/notify/methods.d.ts +2 -1
  34. package/cjs/notify/methods.js +2 -2
  35. package/cjs/picker-view/components/picker-cell.js +3 -1
  36. package/cjs/popup/index.d.ts +4 -4
  37. package/cjs/popup/index.js +3 -2
  38. package/cjs/popup/methods.d.ts +1 -1
  39. package/cjs/popup-swiper/index.d.ts +12 -6
  40. package/cjs/popup-swiper/index.js +3 -2
  41. package/cjs/popup-swiper/methods.d.ts +1 -1
  42. package/cjs/progress/index.js +4 -0
  43. package/cjs/rate/index.js +5 -0
  44. package/cjs/slider/index.js +6 -1
  45. package/cjs/stepper/index.js +7 -1
  46. package/cjs/swipe-action/index.d.ts +1 -0
  47. package/cjs/swipe-action/index.js +10 -0
  48. package/cjs/switch/index.js +4 -0
  49. package/cjs/toast/index.d.ts +18 -18
  50. package/cjs/toast/index.js +3 -2
  51. package/cjs/toast/methods.d.ts +2 -1
  52. package/cjs/toast/methods.js +2 -2
  53. package/dist/index.js +115 -43
  54. package/dist/index.min.js +3 -3
  55. package/dist/style.css +13 -113
  56. package/dist/style.min.css +1 -1
  57. package/esm/_helpers/render.d.ts +3 -1
  58. package/esm/_helpers/render.js +10 -3
  59. package/esm/action-sheet/index.d.ts +5 -5
  60. package/esm/action-sheet/index.js +4 -3
  61. package/esm/action-sheet/methods.d.ts +1 -1
  62. package/esm/badge/style/css/index.css +1 -2
  63. package/esm/checkbox/checkbox.js +4 -0
  64. package/esm/circle-progress/index.js +4 -0
  65. package/esm/context-provider/index.d.ts +4 -0
  66. package/esm/context-provider/index.js +13 -2
  67. package/esm/dialog/index.d.ts +8 -8
  68. package/esm/dialog/index.js +3 -2
  69. package/esm/dialog/methods.d.ts +3 -3
  70. package/esm/dialog/style/css/index.css +1 -2
  71. package/esm/image-preview/index.d.ts +3 -3
  72. package/esm/image-preview/index.js +3 -2
  73. package/esm/image-preview/methods.d.ts +2 -1
  74. package/esm/image-preview/methods.js +2 -2
  75. package/esm/input/hooks.js +1 -0
  76. package/esm/input/index.d.ts +5 -0
  77. package/esm/input/index.js +6 -2
  78. package/esm/masking/index.d.ts +4 -14
  79. package/esm/masking/index.js +3 -2
  80. package/esm/masking/methods.d.ts +3 -2
  81. package/esm/masking/methods.js +2 -2
  82. package/esm/nav-bar/index.d.ts +12 -0
  83. package/esm/nav-bar/index.js +8 -2
  84. package/esm/notify/index.d.ts +12 -12
  85. package/esm/notify/index.js +3 -2
  86. package/esm/notify/methods.d.ts +2 -1
  87. package/esm/notify/methods.js +2 -2
  88. package/esm/picker-view/components/picker-cell.js +3 -1
  89. package/esm/popup/index.d.ts +4 -4
  90. package/esm/popup/index.js +3 -2
  91. package/esm/popup/methods.d.ts +1 -1
  92. package/esm/popup-swiper/index.d.ts +12 -6
  93. package/esm/popup-swiper/index.js +3 -2
  94. package/esm/popup-swiper/methods.d.ts +1 -1
  95. package/esm/progress/index.js +4 -0
  96. package/esm/rate/index.js +5 -0
  97. package/esm/slider/index.js +6 -1
  98. package/esm/stepper/index.js +7 -1
  99. package/esm/swipe-action/index.d.ts +1 -0
  100. package/esm/swipe-action/index.js +1 -0
  101. package/esm/switch/index.js +4 -0
  102. package/esm/toast/index.d.ts +18 -18
  103. package/esm/toast/index.js +3 -2
  104. package/esm/toast/methods.d.ts +2 -1
  105. package/esm/toast/methods.js +2 -2
  106. package/package.json +3 -3
  107. package/style/css/public.css +4 -4
  108. package/umd/_helpers/render.d.ts +3 -1
  109. package/umd/_helpers/render.js +13 -7
  110. package/umd/action-sheet/index.d.ts +5 -5
  111. package/umd/action-sheet/index.js +4 -3
  112. package/umd/action-sheet/methods.d.ts +1 -1
  113. package/umd/badge/style/css/index.css +1 -2
  114. package/umd/checkbox/checkbox.js +4 -0
  115. package/umd/circle-progress/index.js +4 -0
  116. package/umd/context-provider/index.d.ts +4 -0
  117. package/umd/context-provider/index.js +13 -1
  118. package/umd/dialog/index.d.ts +8 -8
  119. package/umd/dialog/index.js +3 -2
  120. package/umd/dialog/methods.d.ts +3 -3
  121. package/umd/dialog/style/css/index.css +1 -2
  122. package/umd/image-preview/index.d.ts +3 -3
  123. package/umd/image-preview/index.js +3 -2
  124. package/umd/image-preview/methods.d.ts +2 -1
  125. package/umd/image-preview/methods.js +2 -2
  126. package/umd/input/hooks.js +1 -0
  127. package/umd/input/index.d.ts +5 -0
  128. package/umd/input/index.js +6 -2
  129. package/umd/masking/index.d.ts +4 -14
  130. package/umd/masking/index.js +3 -2
  131. package/umd/masking/methods.d.ts +3 -2
  132. package/umd/masking/methods.js +2 -2
  133. package/umd/nav-bar/index.d.ts +12 -0
  134. package/umd/nav-bar/index.js +8 -2
  135. package/umd/notify/index.d.ts +12 -12
  136. package/umd/notify/index.js +3 -2
  137. package/umd/notify/methods.d.ts +2 -1
  138. package/umd/notify/methods.js +2 -2
  139. package/umd/picker-view/components/picker-cell.js +3 -1
  140. package/umd/popup/index.d.ts +4 -4
  141. package/umd/popup/index.js +3 -2
  142. package/umd/popup/methods.d.ts +1 -1
  143. package/umd/popup-swiper/index.d.ts +12 -6
  144. package/umd/popup-swiper/index.js +3 -2
  145. package/umd/popup-swiper/methods.d.ts +1 -1
  146. package/umd/progress/index.js +4 -0
  147. package/umd/rate/index.js +5 -0
  148. package/umd/slider/index.js +6 -1
  149. package/umd/stepper/index.js +7 -1
  150. package/umd/swipe-action/index.d.ts +1 -0
  151. package/umd/swipe-action/index.js +11 -4
  152. package/umd/switch/index.js +4 -0
  153. package/umd/toast/index.d.ts +18 -18
  154. package/umd/toast/index.js +3 -2
  155. package/umd/toast/methods.d.ts +2 -1
  156. package/umd/toast/methods.js +2 -2
@@ -9,7 +9,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
9
9
  * @param {string | NotifyProps} config
10
10
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
11
11
  */
12
- info: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
12
+ info: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
13
13
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
14
14
  close: () => void;
15
15
  };
@@ -19,7 +19,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
19
19
  * @param {string | NotifyProps} config
20
20
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
21
21
  */
22
- success: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
22
+ success: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
23
23
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
24
24
  close: () => void;
25
25
  };
@@ -29,7 +29,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
29
29
  * @param {string | NotifyProps} config
30
30
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
31
31
  */
32
- error: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
32
+ error: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
33
33
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
34
34
  close: () => void;
35
35
  };
@@ -39,7 +39,7 @@ export declare function methodsGenerator<P extends NotifyBaseProps>(Comp: React.
39
39
  * @param {string | NotifyProps} config
40
40
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
41
41
  */
42
- warn: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
42
+ warn: (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
43
43
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
44
44
  close: () => void;
45
45
  };
@@ -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<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => {
55
- update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
54
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "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<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => {
65
- update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
64
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "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<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => {
75
- update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
74
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "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<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => {
85
- update: (newConfig: Pick<NotifyProps & React.RefAttributes<NotifyRef>, "style" | "content" | "transitionDuration" | "ref" | "key" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
84
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "context" | "getContainer" | "type" | "className" | "duration" | "onClose">) => void;
86
86
  close: () => void;
87
87
  };
88
88
  };
@@ -175,6 +175,8 @@
175
175
  warn: (0, _methods.notify)(Comp, 'warn')
176
176
  };
177
177
  }
178
+
179
+ var NotifyWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Notify);
178
180
  /**
179
181
  * 主动操作后显示的反馈信息横条,可采用方法调用或者组件调用的方式
180
182
  * @en The feedback information bar displayed after active operation can be called by method or by component.
@@ -184,8 +186,7 @@
184
186
  * @name_en Notify
185
187
  */
186
188
 
187
-
188
- var _default = (0, _mobileUtils.componentWrapper)(Notify, methodsGenerator(Notify));
189
+ var _default = (0, _mobileUtils.componentWrapper)(Notify, methodsGenerator(NotifyWithGlobalContext));
189
190
 
190
191
  _exports.default = _default;
191
192
  });
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { GlobalContextParams } from '../context-provider';
2
3
  export interface NotifyBaseProps {
3
4
  getContainer?: () => HTMLElement;
4
5
  onClose?: (scene?: string) => void;
@@ -7,7 +8,7 @@ export interface NotifyBaseProps {
7
8
  close?: (e: any) => void;
8
9
  type?: string;
9
10
  }
10
- export declare function notify<P extends NotifyBaseProps>(Component: React.FC<P>, type?: string): (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>) => {
11
+ export declare function notify<P extends NotifyBaseProps>(Component: React.FC<P>, type?: string): (originConfig: string | Pick<P, Exclude<keyof P, "visible" | "close">>, context?: GlobalContextParams | undefined) => {
11
12
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">>) => void;
12
13
  close: () => void;
13
14
  };
@@ -20,7 +20,7 @@
20
20
  _extends2 = _interopRequireDefault(_extends2);
21
21
 
22
22
  function notify(Component, type) {
23
- return function (originConfig) {
23
+ return function (originConfig, context) {
24
24
  var config = typeof originConfig === 'string' ? {
25
25
  content: originConfig,
26
26
  type: 'info'
@@ -39,7 +39,7 @@
39
39
  document.body.appendChild(div);
40
40
  }
41
41
 
42
- var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
42
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
43
43
  render = _ReactDOMRender.render,
44
44
  unmount = _ReactDOMRender.unmount;
45
45
 
@@ -368,12 +368,14 @@
368
368
  ref: wrapRef,
369
369
  onTouchStart: _handleItemTouchStart,
370
370
  onTouchEnd: _handleColumnTouchEnd,
371
- onTouchCancel: _handleColumnTouchEnd
371
+ onTouchCancel: _handleColumnTouchEnd,
372
+ "aria-disabled": disabled
372
373
  }, data.map(function (item, index) {
373
374
  var _cls;
374
375
 
375
376
  var dis = Math.abs(index - currentIndex);
376
377
  return /*#__PURE__*/_react.default.createElement("div", {
378
+ "aria-label": index === currentIndex ? "" + item.value : '',
377
379
  key: index + "_" + item.value,
378
380
  className: (0, _mobileUtils.cls)(prefixCls + "-column-item", (_cls = {
379
381
  selected: index === currentIndex
@@ -52,7 +52,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
52
52
  */
53
53
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
54
54
  key?: string | undefined;
55
- }) => {
55
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
56
56
  close: () => void;
57
57
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
58
58
  key?: string | undefined;
@@ -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<PopupProps & React.RefAttributes<PopupRef>, "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"> & {
69
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "ref" | "children" | "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"> & {
70
70
  key?: string | undefined;
71
- }) => {
71
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
72
72
  close: () => void;
73
- update: (newConfig: Pick<PopupProps & React.RefAttributes<PopupRef>, "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"> & {
73
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "ref" | "children" | "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"> & {
74
74
  key?: string | undefined;
75
75
  }) => void;
76
76
  };
@@ -99,6 +99,8 @@
99
99
  open: (0, _methods.open)(Comp)
100
100
  };
101
101
  }
102
+
103
+ var PopupWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Popup);
102
104
  /**
103
105
  * 基于模态弹窗的的全屏菜单,支持各个方向。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
104
106
  * @en A full-screen menu based on a modal popup, supporting all directions. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the popup layer, you need to pass the scroll container to the `getScrollContainer` property to release scrolling when it is not scrolled to the top or bottom.
@@ -108,8 +110,7 @@
108
110
  * @name_en Popup
109
111
  */
110
112
 
111
-
112
- var _default = (0, _mobileUtils.componentWrapper)(Popup, methodsGenerator(Popup));
113
+ var _default = (0, _mobileUtils.componentWrapper)(Popup, methodsGenerator(PopupWithGlobalContext));
113
114
 
114
115
  _exports.default = _default;
115
116
  });
@@ -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;
@@ -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" | "ref" | "children" | "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" | "ref" | "children" | "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 @@
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,8 +291,7 @@
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;
296
297
  });
@@ -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;
@@ -106,6 +106,10 @@
106
106
  function renderBarProgress(_ref) {
107
107
  var prefixCls = _ref.prefixCls;
108
108
  return /*#__PURE__*/_react.default.createElement("div", {
109
+ role: "progressbar",
110
+ "aria-valuenow": percentage,
111
+ "aria-valuemax": 100,
112
+ "aria-valuemin": 0,
109
113
  className: (0, _mobileUtils.cls)(prefixCls + "-progress", {
110
114
  'progress-fixed': mode === 'nav'
111
115
  }, {
package/umd/rate/index.js CHANGED
@@ -164,6 +164,11 @@
164
164
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref2) {
165
165
  var prefixCls = _ref2.prefixCls;
166
166
  return /*#__PURE__*/_react.default.createElement("div", {
167
+ role: "slider",
168
+ "aria-valuemin": 0,
169
+ "aria-valuemax": count,
170
+ "aria-valuenow": innerValue,
171
+ "aria-disabled": disabled,
167
172
  className: (0, _mobileUtils.cls)(prefixCls + "-rate", className, {
168
173
  disabled: disabled
169
174
  }),
@@ -147,7 +147,12 @@
147
147
  'show-marks': showMarks
148
148
  }),
149
149
  style: style,
150
- ref: domRef
150
+ ref: domRef,
151
+ role: "slider",
152
+ "aria-valuemin": min,
153
+ "aria-valuemax": max,
154
+ "aria-valuenow": Array.isArray(valueGroup) ? valueGroup[0] : valueGroup,
155
+ "aria-disabled": disabled
151
156
  }, isHorizontal ? renderPrefixLabel : renderSuffixLabel, /*#__PURE__*/_react.default.createElement("div", {
152
157
  className: prefixCls + "-slider-wrapper"
153
158
  }, /*#__PURE__*/_react.default.createElement(_marks.default, {
@@ -151,6 +151,7 @@
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 @@
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
@@ -1,25 +1,32 @@
1
1
  (function (global, factory) {
2
2
  if (typeof define === "function" && define.amd) {
3
- define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils", "../context-provider", "./item", "../_helpers"], factory);
3
+ define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils", "../context-provider", "./item", "../_helpers", "./type"], factory);
4
4
  } else if (typeof exports !== "undefined") {
5
- factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"), require("../context-provider"), require("./item"), require("../_helpers"));
5
+ factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"), require("../context-provider"), require("./item"), require("../_helpers"), require("./type"));
6
6
  } else {
7
7
  var mod = {
8
8
  exports: {}
9
9
  };
10
- factory(mod.exports, global._extends, global.react, global.mobileUtils, global.contextProvider, global.item, global._helpers);
10
+ factory(mod.exports, global._extends, global.react, global.mobileUtils, global.contextProvider, global.item, global._helpers, global.type);
11
11
  global.index = mod.exports;
12
12
  }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils, _contextProvider, _item, _helpers) {
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils, _contextProvider, _item, _helpers, _type) {
14
14
  "use strict";
15
15
 
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
17
 
18
18
  _exports.__esModule = true;
19
+ var _exportNames = {};
19
20
  _exports.default = void 0;
20
21
  _extends2 = _interopRequireDefault(_extends2);
21
22
  _react = _interopRequireWildcard(_react);
22
23
  _item = _interopRequireDefault(_item);
24
+ Object.keys(_type).forEach(function (key) {
25
+ if (key === "default" || key === "__esModule") return;
26
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
27
+ if (key in _exports && _exports[key] === _type[key]) return;
28
+ _exports[key] = _type[key];
29
+ });
23
30
 
24
31
  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); }
25
32
 
@@ -122,6 +122,10 @@
122
122
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
123
123
  var prefixCls = _ref.prefixCls;
124
124
  return /*#__PURE__*/_react.default.createElement("div", {
125
+ role: "switch",
126
+ "aria-checked": switchChecked,
127
+ "aria-disabled": disabled,
128
+ tabIndex: 0,
125
129
  ref: domRef,
126
130
  className: (0, _mobileUtils.cls)(prefixCls + "-switch all-border-box", className, "type-" + platform, "system-" + system, shape, {
127
131
  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
  };
@@ -219,6 +219,8 @@
219
219
  warn: (0, _methods.toast)(Comp, 'warn')
220
220
  };
221
221
  }
222
+
223
+ var ToastWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Toast);
222
224
  /**
223
225
  * 轻提示组件,支持各个场景下调用方法。
224
226
  * @en The toast component, supports calling methods in various scenarios.
@@ -228,8 +230,7 @@
228
230
  * @name_en Toast
229
231
  */
230
232
 
231
-
232
- var _default = (0, _mobileUtils.componentWrapper)(Toast, methodsGenerator(Toast));
233
+ var _default = (0, _mobileUtils.componentWrapper)(Toast, methodsGenerator(ToastWithGlobalContext));
233
234
 
234
235
  _exports.default = _default;
235
236
  });
@@ -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;
@@ -20,7 +20,7 @@
20
20
  _extends2 = _interopRequireDefault(_extends2);
21
21
 
22
22
  function toast(Component, type) {
23
- return function (originConfig) {
23
+ return function (originConfig, context) {
24
24
  var config = typeof originConfig === 'string' ? {
25
25
  content: originConfig,
26
26
  type: 'info'
@@ -34,7 +34,7 @@
34
34
  var div = document.createElement('div');
35
35
  document.body.appendChild(div);
36
36
 
37
- var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
37
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
38
38
  render = _ReactDOMRender.render,
39
39
  unmount = _ReactDOMRender.unmount;
40
40