@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
@@ -72,7 +72,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
72
72
  */
73
73
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
74
74
  key?: string | undefined;
75
- }) => {
75
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
76
76
  close: () => void;
77
77
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
78
78
  key?: string | undefined;
@@ -86,18 +86,18 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
86
86
  * @param {ActionSheetProps} config setting
87
87
  * @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
88
88
  */
89
- open: (config: Pick<ActionSheetProps & React.RefAttributes<ActionSheetRef>, "title" | "ref" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
89
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
90
90
  key?: string | undefined;
91
- }) => {
91
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
92
92
  close: () => void;
93
- update: (newConfig: Pick<ActionSheetProps & React.RefAttributes<ActionSheetRef>, "title" | "ref" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
93
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "title" | "ref" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "needBottomOffset" | "translateZ" | "items" | "cancelText" | "subTitle"> & {
94
94
  key?: string | undefined;
95
95
  }) => void;
96
96
  };
97
97
  };
98
98
  /**
99
99
  * 动作面板组件
100
- * @en ActionSheet Commponent
100
+ * @en ActionSheet Component
101
101
  * @type 反馈
102
102
  * @type_en FeedBack
103
103
  * @name 动作面板
@@ -109,17 +109,18 @@
109
109
  open: (0, _methods.open)(Comp)
110
110
  };
111
111
  }
112
+
113
+ var ActionSheetWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ActionSheet);
112
114
  /**
113
115
  * 动作面板组件
114
- * @en ActionSheet Commponent
116
+ * @en ActionSheet Component
115
117
  * @type 反馈
116
118
  * @type_en FeedBack
117
119
  * @name 动作面板
118
120
  * @name_en ActionSheet
119
121
  */
120
122
 
121
-
122
- var _default = (0, _mobileUtils.componentWrapper)(ActionSheet, methodsGenerator(ActionSheet));
123
+ var _default = (0, _mobileUtils.componentWrapper)(ActionSheet, methodsGenerator(ActionSheetWithGlobalContext));
123
124
 
124
125
  _exports.default = _default;
125
126
  });
@@ -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;
@@ -9,8 +9,7 @@
9
9
  transform: scale(1);
10
10
  opacity: 1;
11
11
  }
12
- }
13
- @keyframes scale-on {
12
+ }@keyframes scale-on {
14
13
  0% {
15
14
  -webkit-transform: scale(0);
16
15
  transform: scale(0);
@@ -154,6 +154,10 @@
154
154
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
155
155
  var prefixCls = _ref.prefixCls;
156
156
  return /*#__PURE__*/_react.default.createElement("div", {
157
+ role: "checkbox",
158
+ "aria-checked": checked,
159
+ "aria-disabled": disabled,
160
+ tabIndex: 0,
157
161
  ref: domRef,
158
162
  style: style,
159
163
  className: (0, _mobileUtils.cls)(className, prefixCls + "-" + componentName, "shape-" + shape, {
@@ -169,6 +169,10 @@
169
169
  function renderCircleProgress(_ref) {
170
170
  var prefixCls = _ref.prefixCls;
171
171
  return /*#__PURE__*/_react.default.createElement("div", {
172
+ role: "progressbar",
173
+ "aria-valuemin": 0,
174
+ "aria-valuemax": 100,
175
+ "aria-valuenow": percentage,
172
176
  className: (0, _mobileUtils.cls)(prefixCls + "-circle-progress", disabled ? prefixCls + "-circle-progress-disabled" : '', "" + className),
173
177
  style: (0, _extends2.default)({
174
178
  width: circleSize,
@@ -41,6 +41,9 @@ export declare const GlobalContext: React.Context<GlobalContextParams>;
41
41
  export interface ContextProviderProps extends GlobalContextParams {
42
42
  children: React.ReactNode;
43
43
  }
44
+ export declare type WithGlobalContext<T> = T & {
45
+ context?: GlobalContextParams;
46
+ };
44
47
  /**
45
48
  * 全局数据控制组件,用于替换全局数据。
46
49
  * @en Global data control component, used to replace global data.
@@ -51,3 +54,4 @@ export interface ContextProviderProps extends GlobalContextParams {
51
54
  */
52
55
  export default function ContextProvider(props: ContextProviderProps): JSX.Element;
53
56
  export declare const ContextLayout: React.Consumer<GlobalContextParams>;
57
+ export declare function CompWithGlobalContext<P extends JSX.IntrinsicAttributes>(Component: React.FunctionComponent<P>): (props: WithGlobalContext<P>) => JSX.Element;
@@ -16,13 +16,15 @@
16
16
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
17
 
18
18
  _exports.__esModule = true;
19
+ _exports.CompWithGlobalContext = CompWithGlobalContext;
19
20
  _exports.GlobalContext = _exports.ContextLayout = void 0;
20
21
  _exports.default = ContextProvider;
21
22
  _exports.defaultContext = void 0;
22
23
  _extends2 = _interopRequireDefault(_extends2);
23
24
  _objectWithoutPropertiesLoose2 = _interopRequireDefault(_objectWithoutPropertiesLoose2);
24
25
  _react = _interopRequireWildcard(_react);
25
- var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"];
26
+ var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"],
27
+ _excluded2 = ["context"];
26
28
 
27
29
  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); }
28
30
 
@@ -108,4 +110,14 @@
108
110
 
109
111
  var ContextLayout = GlobalContext.Consumer;
110
112
  _exports.ContextLayout = ContextLayout;
113
+
114
+ function CompWithGlobalContext(Component) {
115
+ return function (props) {
116
+ var propsContext = props.context,
117
+ others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
118
+ return /*#__PURE__*/_react.default.createElement(ContextLayout, null, function (context) {
119
+ return /*#__PURE__*/_react.default.createElement(ContextProvider, (0, _extends2.default)({}, context, propsContext), /*#__PURE__*/_react.default.createElement(Component, others));
120
+ });
121
+ };
122
+ }
111
123
  });
@@ -137,7 +137,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
137
137
  * @param {AlertOptions & DialogProps} config Configuration
138
138
  * @returns {{ close: () => void; update: (newConfig: AlertOptions & DialogProps) => void; }}
139
139
  */
140
- alert: (config: A) => {
140
+ alert: (config: A, context?: import("../context-provider").GlobalContextParams | undefined) => {
141
141
  close: () => void;
142
142
  update: (newConfig: A) => void;
143
143
  };
@@ -147,7 +147,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
147
147
  * @param {ConfirmOptions & AlertOptions} config Configuration
148
148
  * @returns {{ close: () => void; update: (newConfig: ConfirmOptions & AlertOptions) => void; }}
149
149
  */
150
- confirm: (config: C) => {
150
+ confirm: (config: C, context?: import("../context-provider").GlobalContextParams | undefined) => {
151
151
  close: () => void;
152
152
  update: (newConfig: C) => void;
153
153
  };
@@ -159,7 +159,7 @@ export declare function methodsGenerator<P extends OpenBaseProps, A = AlertOptio
159
159
  */
160
160
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
161
161
  key?: string | undefined;
162
- }) => {
162
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
163
163
  close: () => void;
164
164
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
165
165
  key?: string | undefined;
@@ -173,7 +173,7 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
173
173
  * @param {AlertOptions & DialogProps} config Configuration
174
174
  * @returns {{ close: () => void; update: (newConfig: AlertOptions & DialogProps) => void; }}
175
175
  */
176
- alert: (config: AlertOptions) => {
176
+ alert: (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
177
177
  close: () => void;
178
178
  update: (newConfig: AlertOptions) => void;
179
179
  };
@@ -183,7 +183,7 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
183
183
  * @param {ConfirmOptions & AlertOptions} config Configuration
184
184
  * @returns {{ close: () => void; update: (newConfig: ConfirmOptions & AlertOptions) => void; }}
185
185
  */
186
- confirm: (config: ConfirmOptions) => {
186
+ confirm: (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
187
187
  close: () => void;
188
188
  update: (newConfig: ConfirmOptions) => void;
189
189
  };
@@ -193,11 +193,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
193
193
  * @param {DialogProps} config Configuration
194
194
  * @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
195
195
  */
196
- open: (config: Pick<DialogProps & React.RefAttributes<DialogRef>, "platform" | "footer" | "title" | "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" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
196
+ open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "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" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
197
197
  key?: string | undefined;
198
- }) => {
198
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
199
199
  close: () => void;
200
- update: (newConfig: Pick<DialogProps & React.RefAttributes<DialogRef>, "platform" | "footer" | "title" | "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" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
200
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "platform" | "footer" | "title" | "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" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "extra"> & {
201
201
  key?: string | undefined;
202
202
  }) => void;
203
203
  };
@@ -171,6 +171,8 @@
171
171
  open: (0, _methods.open)(Comp)
172
172
  };
173
173
  }
174
+
175
+ var DialogWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Dialog);
174
176
  /**
175
177
  * 模态对话框,在浮层中显示,引导用户进行相关操作。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
176
178
  * @en A modal dialog, displayed in a floating layer, guides the user to perform related operations. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the bullet layer, you need to pass the scroll container to `getScrollContainer` to release scrolling when it is not scrolled to the top or bottom.
@@ -180,8 +182,7 @@
180
182
  * @name_en Dialog
181
183
  */
182
184
 
183
-
184
- var _default = (0, _mobileUtils.componentWrapper)(Dialog, methodsGenerator(Dialog));
185
+ var _default = (0, _mobileUtils.componentWrapper)(Dialog, methodsGenerator(DialogWithGlobalContext));
185
186
 
186
187
  _exports.default = _default;
187
188
  });
@@ -2,17 +2,17 @@ import React from 'react';
2
2
  import { OpenBaseProps } from '../masking/methods';
3
3
  export declare function normalizeAlert<AlertOptions, P>(config: AlertOptions): P;
4
4
  export declare function normalizeConfirm<ConfirmOptions, P>(config: ConfirmOptions): P;
5
- export declare function alert<AlertOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions) => {
5
+ export declare function alert<AlertOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
6
6
  close: () => void;
7
7
  update: (newConfig: AlertOptions) => void;
8
8
  };
9
- export declare function confirm<ConfirmOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions) => {
9
+ export declare function confirm<ConfirmOptions, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
10
10
  close: () => void;
11
11
  update: (newConfig: ConfirmOptions) => void;
12
12
  };
13
13
  export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
14
14
  key?: string | undefined;
15
- }) => {
15
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
16
16
  close: () => void;
17
17
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
18
18
  key?: string | undefined;
@@ -9,8 +9,7 @@
9
9
  -webkit-transform: scale(1);
10
10
  transform: scale(1);
11
11
  }
12
- }
13
- @keyframes fade-scale-on {
12
+ }@keyframes fade-scale-on {
14
13
  0% {
15
14
  opacity: 0;
16
15
  -webkit-transform: scale(0.5);
@@ -252,7 +252,7 @@ export declare function methodsGenerator<P extends ImagePreviewProps>(Comp: Reac
252
252
  * @param {ImagePreviewProps} config configuration
253
253
  * @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
254
254
  */
255
- open: (config: Pick<P, Exclude<keyof P, "close">>) => {
255
+ open: (config: Pick<P, Exclude<keyof P, "close">>, context?: import("../context-provider").GlobalContextParams | undefined) => {
256
256
  close: () => void;
257
257
  update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
258
258
  };
@@ -264,9 +264,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
264
264
  * @param {ImagePreviewProps} config configuration
265
265
  * @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
266
266
  */
267
- open: (config: Pick<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>, "style" | "ref" | "key" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => {
267
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
268
268
  close: () => void;
269
- update: (newConfig: Pick<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>, "style" | "ref" | "key" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
269
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "getContainer" | "className" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
270
270
  };
271
271
  };
272
272
  /**
@@ -1009,6 +1009,8 @@
1009
1009
  open: (0, _methods.open)(Comp)
1010
1010
  };
1011
1011
  }
1012
+
1013
+ var ImagePreviewWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ImagePreview);
1012
1014
  /**
1013
1015
  * 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
1014
1016
  * @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
@@ -1018,8 +1020,7 @@
1018
1020
  * @name_en ImagePreview
1019
1021
  */
1020
1022
 
1021
-
1022
- var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreview));
1023
+ var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreviewWithGlobalContext));
1023
1024
 
1024
1025
  _exports.default = _default;
1025
1026
  });
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
+ import { GlobalContextParams } from '../context-provider';
2
3
  export interface OpenBaseProps {
3
4
  onClose?: () => void;
4
5
  close: (e: any) => void;
5
6
  openIndex: number;
6
7
  images: any[];
7
8
  }
8
- export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close">>) => {
9
+ export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close">>, context?: GlobalContextParams | undefined) => {
9
10
  close: () => void;
10
11
  update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
11
12
  };
@@ -20,7 +20,7 @@
20
20
  _extends2 = _interopRequireDefault(_extends2);
21
21
 
22
22
  function open(Component) {
23
- return function (config) {
23
+ return function (config, context) {
24
24
  var baseProps = (0, _extends2.default)({
25
25
  unmountOnExit: true
26
26
  }, config || {}, {
@@ -36,7 +36,7 @@
36
36
 
37
37
  var leaving = false;
38
38
 
39
- var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
39
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
40
40
  render = _ReactDOMRender.render;
41
41
 
42
42
  function update(newConfig) {
@@ -222,6 +222,7 @@
222
222
 
223
223
  function renderWrapper(prefixCls, type, children) {
224
224
  return /*#__PURE__*/_react.default.createElement("div", {
225
+ role: "search",
225
226
  className: prefixCls + "-container all-border-box " + (className || ''),
226
227
  style: style,
227
228
  ref: wrapRef
@@ -27,6 +27,11 @@ export interface InputProps extends BasicInputProps {
27
27
  * @en Other unlisted native properties have lower priority than listed component properties
28
28
  */
29
29
  nativeProps?: React.InputHTMLAttributes<HTMLInputElement>;
30
+ /**
31
+ * 无障碍label
32
+ * @en accessible label
33
+ */
34
+ ariaLabel?: string;
30
35
  }
31
36
  export interface InputRef {
32
37
  /**
@@ -47,7 +47,9 @@
47
47
  inputClass = props.inputClass,
48
48
  inputStyle = props.inputStyle,
49
49
  _props$nativeProps = props.nativeProps,
50
- nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps;
50
+ nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps,
51
+ _props$ariaLabel = props.ariaLabel,
52
+ ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel;
51
53
  var inputRef = (0, _react.useRef)(null);
52
54
 
53
55
  var _useInputLogic = (0, _hooks.useInputLogic)(props, inputRef),
@@ -91,7 +93,9 @@
91
93
  onChange: handleChange,
92
94
  onInput: handleInput,
93
95
  onKeyDown: handleKeyDown,
94
- onClick: handleClick
96
+ onClick: handleClick,
97
+ "aria-disabled": disabled,
98
+ "aria-label": ariaLabel
95
99
  })));
96
100
  }
97
101
 
@@ -191,12 +191,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
191
191
  */
192
192
  open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
193
193
  key?: string | undefined;
194
- }) => {
195
- /**
196
- * 点击蒙层是否关闭菜单
197
- * @en Whether to click the mask to close the menu
198
- * @default true
199
- */
194
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
200
195
  close: () => void;
201
196
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
202
197
  key?: string | undefined;
@@ -210,16 +205,11 @@ declare const _default: React.ForwardRefExoticComponent<MaskingProps & React.Ref
210
205
  * @param {MaskingProps} config Configuration
211
206
  * @returns {{ close: () => void; update: (newConfig: MaskingProps) => void; }}
212
207
  */
213
- open: (config: Pick<MaskingProps & React.RefAttributes<MaskingRef>, "ref" | "children" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
208
+ open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "ref" | "children" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
214
209
  key?: string | undefined;
215
- }) => {
216
- /**
217
- * 点击蒙层是否关闭菜单
218
- * @en Whether to click the mask to close the menu
219
- * @default true
220
- */
210
+ }, context?: import("../context-provider").GlobalContextParams | undefined) => {
221
211
  close: () => void;
222
- update: (newConfig: Pick<MaskingProps & React.RefAttributes<MaskingRef>, "ref" | "children" | "key" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
212
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "ref" | "children" | "key" | "context" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "className" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
223
213
  key?: string | undefined;
224
214
  }) => void;
225
215
  };
@@ -220,6 +220,8 @@
220
220
  open: (0, _methods.open)(Comp)
221
221
  };
222
222
  }
223
+
224
+ var MaskingWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Masking);
223
225
  /**
224
226
  * 通用模态弹窗,内部内容自定义。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
225
227
  * @en Generic modal popup with custom internal content. By default, anti-scroll penetration processing is performed. If scrolling is required in the content of the bullet layer, need to pass the scroll container to the `getScrollContainer` to release scrolling when it is not scrolled to the top or bottom.
@@ -229,8 +231,7 @@
229
231
  * @name_en Masking
230
232
  */
231
233
 
232
-
233
- var _default = (0, _mobileUtils.componentWrapper)(Masking, methodsGenerator(Masking));
234
+ var _default = (0, _mobileUtils.componentWrapper)(Masking, methodsGenerator(MaskingWithGlobalContext));
234
235
 
235
236
  _exports.default = _default;
236
237
  });
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { GlobalContextParams } from '../context-provider';
2
3
  export interface OpenBaseProps {
3
4
  unmountOnExit?: boolean;
4
5
  getContainer?: () => HTMLElement;
@@ -8,13 +9,13 @@ export interface OpenBaseProps {
8
9
  }
9
10
  export declare function getOpenMethod<T extends {
10
11
  key?: string;
11
- }, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, containerId?: string, normalize?: (config: T) => P): (config: T) => {
12
+ }, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, containerId?: string, normalize?: (config: T) => P): (config: T, context?: GlobalContextParams | undefined) => {
12
13
  close: () => void;
13
14
  update: (newConfig: T) => void;
14
15
  };
15
16
  export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>, containerId?: string): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
16
17
  key?: string | undefined;
17
- }) => {
18
+ }, context?: GlobalContextParams | undefined) => {
18
19
  close: () => void;
19
20
  update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
20
21
  key?: string | undefined;
@@ -27,7 +27,7 @@
27
27
  };
28
28
  }
29
29
 
30
- return function (config) {
30
+ return function (config, context) {
31
31
  var baseProps = (0, _extends2.default)({
32
32
  unmountOnExit: true
33
33
  }, normalize(config), {
@@ -43,7 +43,7 @@
43
43
 
44
44
  var leaving = false;
45
45
 
46
- var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
46
+ var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
47
47
  render = _ReactDOMRender.render;
48
48
 
49
49
  function update(newConfig) {
@@ -105,6 +105,18 @@ export interface NavBarProps {
105
105
  * @en Set a custom style according to the scroll offset value. After setting this property, the scroll event of the scroll container will be monitored.
106
106
  */
107
107
  getComputedStyleByScroll?: (offset: number) => CSSProperties;
108
+ /**
109
+ * 无障碍aria-label属性
110
+ * @en Accessibility attribute aria-label
111
+ * @default ""
112
+ */
113
+ ariaLabel?: string;
114
+ /**
115
+ * 无障碍role属性
116
+ * @en Accessibility attribute role
117
+ * @default "banner"
118
+ */
119
+ ariaRole?: string;
108
120
  }
109
121
  /**
110
122
  * 导航栏组件,支持吸顶和沉浸式,支持在指定滚动位置展示,支持根据滚动位置实时更新style。
@@ -59,7 +59,11 @@
59
59
  getScrollContainer = props.getScrollContainer,
60
60
  _props$showOffset = props.showOffset,
61
61
  showOffset = _props$showOffset === void 0 ? 0 : _props$showOffset,
62
- getComputedStyleByScroll = props.getComputedStyleByScroll;
62
+ getComputedStyleByScroll = props.getComputedStyleByScroll,
63
+ _props$ariaLabel = props.ariaLabel,
64
+ ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel,
65
+ _props$ariaRole = props.ariaRole,
66
+ ariaRole = _props$ariaRole === void 0 ? 'banner' : _props$ariaRole;
63
67
  var navBarRef = (0, _react.useRef)(null);
64
68
 
65
69
  var _useState = (0, _react.useState)(showOffset > 0),
@@ -147,7 +151,9 @@
147
151
  paddingTop: fixed && statusBarHeight ? statusBarHeight + "px" : ''
148
152
  }, style || {}, relBackground ? {
149
153
  background: relBackground
150
- } : {})
154
+ } : {}),
155
+ "aria-label": ariaLabel,
156
+ role: ariaRole
151
157
  }, /*#__PURE__*/_react.default.createElement("div", {
152
158
  className: (0, _mobileUtils.cls)(className, system, prefixCls + "-nav-bar-wrapper", (_cls2 = {}, _cls2[prefixCls + "-nav-bar-wrapper-fixed"] = fixed, _cls2[prefixCls + "-nav-bar-wrapper-border"] = hasBottomLine, _cls2)),
153
159
  style: (0, _extends2.default)({