@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.
- package/CHANGELOG.md +16 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/render.d.ts +3 -1
- package/cjs/_helpers/render.js +10 -3
- package/cjs/action-sheet/index.d.ts +5 -5
- package/cjs/action-sheet/index.js +4 -3
- package/cjs/action-sheet/methods.d.ts +1 -1
- package/cjs/badge/style/css/index.css +1 -2
- package/cjs/checkbox/checkbox.js +4 -0
- package/cjs/circle-progress/index.js +4 -0
- package/cjs/context-provider/index.d.ts +4 -0
- package/cjs/context-provider/index.js +14 -2
- package/cjs/dialog/index.d.ts +8 -8
- package/cjs/dialog/index.js +3 -2
- package/cjs/dialog/methods.d.ts +3 -3
- package/cjs/dialog/style/css/index.css +1 -2
- package/cjs/image-preview/index.d.ts +3 -3
- package/cjs/image-preview/index.js +3 -2
- package/cjs/image-preview/methods.d.ts +2 -1
- package/cjs/image-preview/methods.js +2 -2
- package/cjs/input/hooks.js +1 -0
- package/cjs/input/index.d.ts +5 -0
- package/cjs/input/index.js +6 -2
- package/cjs/masking/index.d.ts +4 -14
- package/cjs/masking/index.js +3 -2
- package/cjs/masking/methods.d.ts +3 -2
- package/cjs/masking/methods.js +2 -2
- package/cjs/nav-bar/index.d.ts +12 -0
- package/cjs/nav-bar/index.js +8 -2
- package/cjs/notify/index.d.ts +12 -12
- package/cjs/notify/index.js +3 -2
- package/cjs/notify/methods.d.ts +2 -1
- package/cjs/notify/methods.js +2 -2
- package/cjs/picker-view/components/picker-cell.js +3 -1
- package/cjs/popup/index.d.ts +4 -4
- package/cjs/popup/index.js +3 -2
- package/cjs/popup/methods.d.ts +1 -1
- package/cjs/popup-swiper/index.d.ts +12 -6
- package/cjs/popup-swiper/index.js +3 -2
- package/cjs/popup-swiper/methods.d.ts +1 -1
- package/cjs/progress/index.js +4 -0
- package/cjs/rate/index.js +5 -0
- package/cjs/slider/index.js +6 -1
- package/cjs/stepper/index.js +7 -1
- package/cjs/swipe-action/index.d.ts +1 -0
- package/cjs/swipe-action/index.js +10 -0
- package/cjs/switch/index.js +4 -0
- package/cjs/toast/index.d.ts +18 -18
- package/cjs/toast/index.js +3 -2
- package/cjs/toast/methods.d.ts +2 -1
- package/cjs/toast/methods.js +2 -2
- package/dist/index.js +115 -43
- package/dist/index.min.js +3 -3
- package/dist/style.css +13 -113
- package/dist/style.min.css +1 -1
- package/esm/_helpers/render.d.ts +3 -1
- package/esm/_helpers/render.js +10 -3
- package/esm/action-sheet/index.d.ts +5 -5
- package/esm/action-sheet/index.js +4 -3
- package/esm/action-sheet/methods.d.ts +1 -1
- package/esm/badge/style/css/index.css +1 -2
- package/esm/checkbox/checkbox.js +4 -0
- package/esm/circle-progress/index.js +4 -0
- package/esm/context-provider/index.d.ts +4 -0
- package/esm/context-provider/index.js +13 -2
- package/esm/dialog/index.d.ts +8 -8
- package/esm/dialog/index.js +3 -2
- package/esm/dialog/methods.d.ts +3 -3
- package/esm/dialog/style/css/index.css +1 -2
- package/esm/image-preview/index.d.ts +3 -3
- package/esm/image-preview/index.js +3 -2
- package/esm/image-preview/methods.d.ts +2 -1
- package/esm/image-preview/methods.js +2 -2
- package/esm/input/hooks.js +1 -0
- package/esm/input/index.d.ts +5 -0
- package/esm/input/index.js +6 -2
- package/esm/masking/index.d.ts +4 -14
- package/esm/masking/index.js +3 -2
- package/esm/masking/methods.d.ts +3 -2
- package/esm/masking/methods.js +2 -2
- package/esm/nav-bar/index.d.ts +12 -0
- package/esm/nav-bar/index.js +8 -2
- package/esm/notify/index.d.ts +12 -12
- package/esm/notify/index.js +3 -2
- package/esm/notify/methods.d.ts +2 -1
- package/esm/notify/methods.js +2 -2
- package/esm/picker-view/components/picker-cell.js +3 -1
- package/esm/popup/index.d.ts +4 -4
- package/esm/popup/index.js +3 -2
- package/esm/popup/methods.d.ts +1 -1
- package/esm/popup-swiper/index.d.ts +12 -6
- package/esm/popup-swiper/index.js +3 -2
- package/esm/popup-swiper/methods.d.ts +1 -1
- package/esm/progress/index.js +4 -0
- package/esm/rate/index.js +5 -0
- package/esm/slider/index.js +6 -1
- package/esm/stepper/index.js +7 -1
- package/esm/swipe-action/index.d.ts +1 -0
- package/esm/swipe-action/index.js +1 -0
- package/esm/switch/index.js +4 -0
- package/esm/toast/index.d.ts +18 -18
- package/esm/toast/index.js +3 -2
- package/esm/toast/methods.d.ts +2 -1
- package/esm/toast/methods.js +2 -2
- package/package.json +3 -3
- package/style/css/public.css +4 -4
- package/umd/_helpers/render.d.ts +3 -1
- package/umd/_helpers/render.js +13 -7
- package/umd/action-sheet/index.d.ts +5 -5
- package/umd/action-sheet/index.js +4 -3
- package/umd/action-sheet/methods.d.ts +1 -1
- package/umd/badge/style/css/index.css +1 -2
- package/umd/checkbox/checkbox.js +4 -0
- package/umd/circle-progress/index.js +4 -0
- package/umd/context-provider/index.d.ts +4 -0
- package/umd/context-provider/index.js +13 -1
- package/umd/dialog/index.d.ts +8 -8
- package/umd/dialog/index.js +3 -2
- package/umd/dialog/methods.d.ts +3 -3
- package/umd/dialog/style/css/index.css +1 -2
- package/umd/image-preview/index.d.ts +3 -3
- package/umd/image-preview/index.js +3 -2
- package/umd/image-preview/methods.d.ts +2 -1
- package/umd/image-preview/methods.js +2 -2
- package/umd/input/hooks.js +1 -0
- package/umd/input/index.d.ts +5 -0
- package/umd/input/index.js +6 -2
- package/umd/masking/index.d.ts +4 -14
- package/umd/masking/index.js +3 -2
- package/umd/masking/methods.d.ts +3 -2
- package/umd/masking/methods.js +2 -2
- package/umd/nav-bar/index.d.ts +12 -0
- package/umd/nav-bar/index.js +8 -2
- package/umd/notify/index.d.ts +12 -12
- package/umd/notify/index.js +3 -2
- package/umd/notify/methods.d.ts +2 -1
- package/umd/notify/methods.js +2 -2
- package/umd/picker-view/components/picker-cell.js +3 -1
- package/umd/popup/index.d.ts +4 -4
- package/umd/popup/index.js +3 -2
- package/umd/popup/methods.d.ts +1 -1
- package/umd/popup-swiper/index.d.ts +12 -6
- package/umd/popup-swiper/index.js +3 -2
- package/umd/popup-swiper/methods.d.ts +1 -1
- package/umd/progress/index.js +4 -0
- package/umd/rate/index.js +5 -0
- package/umd/slider/index.js +6 -1
- package/umd/stepper/index.js +7 -1
- package/umd/swipe-action/index.d.ts +1 -0
- package/umd/swipe-action/index.js +11 -4
- package/umd/switch/index.js +4 -0
- package/umd/toast/index.d.ts +18 -18
- package/umd/toast/index.js +3 -2
- package/umd/toast/methods.d.ts +2 -1
- package/umd/toast/methods.js +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,22 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [2.24.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.23.0...@arco-design/mobile-react@2.24.0) (2022-12-20)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* support accessibility mode ([#65](https://github.com/arco-design/arco-design-mobile/issues/65)) ([fa7789c](https://github.com/arco-design/arco-design-mobile/commit/fa7789c1866341244cbffcbef1d1be375880bd82))
|
12
|
+
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
* component function support custom context ([#52](https://github.com/arco-design/arco-design-mobile/issues/52)) ([e5bd260](https://github.com/arco-design/arco-design-mobile/commit/e5bd260f6df128f8cd44e26464f1b5e5e6deff11))
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
6
22
|
# [2.23.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.22.3...@arco-design/mobile-react@2.23.0) (2022-11-29)
|
7
23
|
|
8
24
|
|
package/README.en-US.md
CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
|
|
59
59
|
React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
|
60
60
|
|
61
61
|
```
|
62
|
-
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.23.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.23.0/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## Full import
|
package/README.md
CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
|
|
59
59
|
React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
|
60
60
|
|
61
61
|
```
|
62
|
-
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.23.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.23.0/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/_helpers/render.d.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import { FunctionComponent } from 'react';
|
2
2
|
import { RootType } from './react-dom';
|
3
|
+
import { GlobalContextParams } from '../context-provider';
|
3
4
|
export declare class ReactDOMRender {
|
4
5
|
root: RootType | undefined;
|
5
6
|
app: FunctionComponent;
|
6
7
|
container: Element | DocumentFragment;
|
7
|
-
|
8
|
+
context: GlobalContextParams | undefined;
|
9
|
+
constructor(app: FunctionComponent, container: Element | DocumentFragment, context?: GlobalContextParams);
|
8
10
|
render: (props: any) => void;
|
9
11
|
unmount: () => void;
|
10
12
|
}
|
package/cjs/_helpers/render.js
CHANGED
@@ -5,24 +5,30 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports.ReactDOMRender = void 0;
|
7
7
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
9
11
|
|
10
12
|
var _reactDom = require("./react-dom");
|
11
13
|
|
12
|
-
var ReactDOMRender = function ReactDOMRender(app, container) {
|
14
|
+
var ReactDOMRender = function ReactDOMRender(app, container, context) {
|
13
15
|
var _this = this;
|
14
16
|
|
15
17
|
this.root = void 0;
|
16
18
|
this.app = void 0;
|
17
19
|
this.container = void 0;
|
20
|
+
this.context = void 0;
|
18
21
|
|
19
22
|
this.render = function (props) {
|
20
23
|
var CustomApp = _this.app;
|
24
|
+
var propsWithContext = (0, _extends2.default)({}, props, {
|
25
|
+
context: _this.context
|
26
|
+
});
|
21
27
|
|
22
28
|
if (_this.root) {
|
23
|
-
_this.root.render( /*#__PURE__*/_react.default.createElement(CustomApp,
|
29
|
+
_this.root.render( /*#__PURE__*/_react.default.createElement(CustomApp, propsWithContext));
|
24
30
|
} else {
|
25
|
-
_this.root = (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(CustomApp,
|
31
|
+
_this.root = (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(CustomApp, propsWithContext), _this.container);
|
26
32
|
}
|
27
33
|
};
|
28
34
|
|
@@ -35,6 +41,7 @@ var ReactDOMRender = function ReactDOMRender(app, container) {
|
|
35
41
|
|
36
42
|
this.app = app;
|
37
43
|
this.container = container;
|
44
|
+
this.context = context;
|
38
45
|
};
|
39
46
|
|
40
47
|
exports.ReactDOMRender = ReactDOMRender;
|
@@ -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
|
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
|
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
|
100
|
+
* @en ActionSheet Component
|
101
101
|
* @type 反馈
|
102
102
|
* @type_en FeedBack
|
103
103
|
* @name 动作面板
|
@@ -107,16 +107,17 @@ function methodsGenerator(Comp) {
|
|
107
107
|
open: (0, _methods.open)(Comp)
|
108
108
|
};
|
109
109
|
}
|
110
|
+
|
111
|
+
var ActionSheetWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ActionSheet);
|
110
112
|
/**
|
111
113
|
* 动作面板组件
|
112
|
-
* @en ActionSheet
|
114
|
+
* @en ActionSheet Component
|
113
115
|
* @type 反馈
|
114
116
|
* @type_en FeedBack
|
115
117
|
* @name 动作面板
|
116
118
|
* @name_en ActionSheet
|
117
119
|
*/
|
118
120
|
|
119
|
-
|
120
|
-
var _default = (0, _mobileUtils.componentWrapper)(ActionSheet, methodsGenerator(ActionSheet));
|
121
|
+
var _default = (0, _mobileUtils.componentWrapper)(ActionSheet, methodsGenerator(ActionSheetWithGlobalContext));
|
121
122
|
|
122
123
|
exports.default = _default;
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { OpenBaseProps } from '../masking/methods';
|
3
3
|
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
4
4
|
key?: string | undefined;
|
5
|
-
}) => {
|
5
|
+
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
6
6
|
close: () => void;
|
7
7
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
8
8
|
key?: string | undefined;
|
package/cjs/checkbox/checkbox.js
CHANGED
@@ -158,6 +158,10 @@ var Checkbox = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
158
158
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
159
159
|
var prefixCls = _ref.prefixCls;
|
160
160
|
return /*#__PURE__*/_react.default.createElement("div", {
|
161
|
+
role: "checkbox",
|
162
|
+
"aria-checked": checked,
|
163
|
+
"aria-disabled": disabled,
|
164
|
+
tabIndex: 0,
|
161
165
|
ref: domRef,
|
162
166
|
style: style,
|
163
167
|
className: (0, _mobileUtils.cls)(className, prefixCls + "-" + componentName, "shape-" + shape, {
|
@@ -164,6 +164,10 @@ var CircleProgress = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
164
164
|
function renderCircleProgress(_ref) {
|
165
165
|
var prefixCls = _ref.prefixCls;
|
166
166
|
return /*#__PURE__*/_react.default.createElement("div", {
|
167
|
+
role: "progressbar",
|
168
|
+
"aria-valuemin": 0,
|
169
|
+
"aria-valuemax": 100,
|
170
|
+
"aria-valuenow": percentage,
|
167
171
|
className: (0, _mobileUtils.cls)(prefixCls + "-circle-progress", disabled ? prefixCls + "-circle-progress-disabled" : '', "" + className),
|
168
172
|
style: (0, _extends2.default)({
|
169
173
|
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;
|
@@ -3,6 +3,7 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
+
exports.CompWithGlobalContext = CompWithGlobalContext;
|
6
7
|
exports.GlobalContext = exports.ContextLayout = void 0;
|
7
8
|
exports.default = ContextProvider;
|
8
9
|
exports.defaultContext = void 0;
|
@@ -15,7 +16,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
15
16
|
|
16
17
|
var _mobileUtils = require("@arco-design/mobile-utils");
|
17
18
|
|
18
|
-
var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"]
|
19
|
+
var _excluded = ["children", "useDarkMode", "isDarkMode", "theme", "locale"],
|
20
|
+
_excluded2 = ["context"];
|
19
21
|
|
20
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
23
|
|
@@ -100,4 +102,14 @@ function ContextProvider(props) {
|
|
100
102
|
}
|
101
103
|
|
102
104
|
var ContextLayout = GlobalContext.Consumer;
|
103
|
-
exports.ContextLayout = ContextLayout;
|
105
|
+
exports.ContextLayout = ContextLayout;
|
106
|
+
|
107
|
+
function CompWithGlobalContext(Component) {
|
108
|
+
return function (props) {
|
109
|
+
var propsContext = props.context,
|
110
|
+
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
111
|
+
return /*#__PURE__*/_react.default.createElement(ContextLayout, null, function (context) {
|
112
|
+
return /*#__PURE__*/_react.default.createElement(ContextProvider, (0, _extends2.default)({}, context, propsContext), /*#__PURE__*/_react.default.createElement(Component, others));
|
113
|
+
});
|
114
|
+
};
|
115
|
+
}
|
package/cjs/dialog/index.d.ts
CHANGED
@@ -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
|
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
|
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
|
};
|
package/cjs/dialog/index.js
CHANGED
@@ -172,6 +172,8 @@ function methodsGenerator(Comp) {
|
|
172
172
|
open: (0, _methods.open)(Comp)
|
173
173
|
};
|
174
174
|
}
|
175
|
+
|
176
|
+
var DialogWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Dialog);
|
175
177
|
/**
|
176
178
|
* 模态对话框,在浮层中显示,引导用户进行相关操作。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
|
177
179
|
* @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.
|
@@ -181,7 +183,6 @@ function methodsGenerator(Comp) {
|
|
181
183
|
* @name_en Dialog
|
182
184
|
*/
|
183
185
|
|
184
|
-
|
185
|
-
var _default = (0, _mobileUtils.componentWrapper)(Dialog, methodsGenerator(Dialog));
|
186
|
+
var _default = (0, _mobileUtils.componentWrapper)(Dialog, methodsGenerator(DialogWithGlobalContext));
|
186
187
|
|
187
188
|
exports.default = _default;
|
package/cjs/dialog/methods.d.ts
CHANGED
@@ -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;
|
@@ -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
|
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
|
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
|
/**
|
@@ -1015,6 +1015,8 @@ function methodsGenerator(Comp) {
|
|
1015
1015
|
open: (0, _methods.open)(Comp)
|
1016
1016
|
};
|
1017
1017
|
}
|
1018
|
+
|
1019
|
+
var ImagePreviewWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(ImagePreview);
|
1018
1020
|
/**
|
1019
1021
|
* 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
|
1020
1022
|
* @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
|
@@ -1024,7 +1026,6 @@ function methodsGenerator(Comp) {
|
|
1024
1026
|
* @name_en ImagePreview
|
1025
1027
|
*/
|
1026
1028
|
|
1027
|
-
|
1028
|
-
var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreview));
|
1029
|
+
var _default = (0, _mobileUtils.componentWrapper)(ImagePreview, methodsGenerator(ImagePreviewWithGlobalContext));
|
1029
1030
|
|
1030
1031
|
exports.default = _default;
|
@@ -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
|
};
|
@@ -12,7 +12,7 @@ var _mobileUtils = require("@arco-design/mobile-utils");
|
|
12
12
|
var _render = require("../_helpers/render");
|
13
13
|
|
14
14
|
function open(Component) {
|
15
|
-
return function (config) {
|
15
|
+
return function (config, context) {
|
16
16
|
var baseProps = (0, _extends2.default)({
|
17
17
|
unmountOnExit: true
|
18
18
|
}, config || {}, {
|
@@ -28,7 +28,7 @@ function open(Component) {
|
|
28
28
|
|
29
29
|
var leaving = false;
|
30
30
|
|
31
|
-
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
31
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
32
32
|
render = _ReactDOMRender.render;
|
33
33
|
|
34
34
|
function update(newConfig) {
|
package/cjs/input/hooks.js
CHANGED
@@ -215,6 +215,7 @@ function useInputLogic(props, inputRef) {
|
|
215
215
|
|
216
216
|
function renderWrapper(prefixCls, type, children) {
|
217
217
|
return /*#__PURE__*/_react.default.createElement("div", {
|
218
|
+
role: "search",
|
218
219
|
className: prefixCls + "-container all-border-box " + (className || ''),
|
219
220
|
style: style,
|
220
221
|
ref: wrapRef
|
package/cjs/input/index.d.ts
CHANGED
@@ -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
|
/**
|
package/cjs/input/index.js
CHANGED
@@ -42,7 +42,9 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
42
42
|
inputClass = props.inputClass,
|
43
43
|
inputStyle = props.inputStyle,
|
44
44
|
_props$nativeProps = props.nativeProps,
|
45
|
-
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps
|
45
|
+
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps,
|
46
|
+
_props$ariaLabel = props.ariaLabel,
|
47
|
+
ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel;
|
46
48
|
var inputRef = (0, _react.useRef)(null);
|
47
49
|
|
48
50
|
var _useInputLogic = (0, _hooks.useInputLogic)(props, inputRef),
|
@@ -86,7 +88,9 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
86
88
|
onChange: handleChange,
|
87
89
|
onInput: handleInput,
|
88
90
|
onKeyDown: handleKeyDown,
|
89
|
-
onClick: handleClick
|
91
|
+
onClick: handleClick,
|
92
|
+
"aria-disabled": disabled,
|
93
|
+
"aria-label": ariaLabel
|
90
94
|
})));
|
91
95
|
}
|
92
96
|
|
package/cjs/masking/index.d.ts
CHANGED
@@ -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
|
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
|
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
|
};
|
package/cjs/masking/index.js
CHANGED
@@ -219,6 +219,8 @@ function methodsGenerator(Comp) {
|
|
219
219
|
open: (0, _methods.open)(Comp)
|
220
220
|
};
|
221
221
|
}
|
222
|
+
|
223
|
+
var MaskingWithGlobalContext = (0, _contextProvider.CompWithGlobalContext)(Masking);
|
222
224
|
/**
|
223
225
|
* 通用模态弹窗,内部内容自定义。默认做了防滚动穿透处理,如果弹层内容中需要滚动,则需将滚动容器传入`getScrollContainer`属性以在未滚动到顶部或底部时释放滚动。
|
224
226
|
* @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.
|
@@ -228,7 +230,6 @@ function methodsGenerator(Comp) {
|
|
228
230
|
* @name_en Masking
|
229
231
|
*/
|
230
232
|
|
231
|
-
|
232
|
-
var _default = (0, _mobileUtils.componentWrapper)(Masking, methodsGenerator(Masking));
|
233
|
+
var _default = (0, _mobileUtils.componentWrapper)(Masking, methodsGenerator(MaskingWithGlobalContext));
|
233
234
|
|
234
235
|
exports.default = _default;
|
package/cjs/masking/methods.d.ts
CHANGED
@@ -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;
|
package/cjs/masking/methods.js
CHANGED
@@ -19,7 +19,7 @@ function getOpenMethod(Component, containerId, normalize) {
|
|
19
19
|
};
|
20
20
|
}
|
21
21
|
|
22
|
-
return function (config) {
|
22
|
+
return function (config, context) {
|
23
23
|
var baseProps = (0, _extends2.default)({
|
24
24
|
unmountOnExit: true
|
25
25
|
}, normalize(config), {
|
@@ -35,7 +35,7 @@ function getOpenMethod(Component, containerId, normalize) {
|
|
35
35
|
|
36
36
|
var leaving = false;
|
37
37
|
|
38
|
-
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
38
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
39
39
|
render = _ReactDOMRender.render;
|
40
40
|
|
41
41
|
function update(newConfig) {
|
package/cjs/nav-bar/index.d.ts
CHANGED
@@ -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。
|