@arco-design/mobile-react 2.22.3 → 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 +32 -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-picker/index.js +18 -12
- package/cjs/image-picker/type.d.ts +10 -0
- 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/index.d.ts +1 -0
- package/cjs/index.js +5 -1
- package/cjs/input/hooks.js +1 -0
- package/cjs/input/index.d.ts +5 -0
- package/cjs/input/index.js +6 -2
- package/cjs/input/style/css/index.css +1 -0
- package/cjs/input/style/index.less +1 -0
- 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/demo/style/css/mobile.css +4 -0
- package/cjs/stepper/demo/style/mobile.less +10 -0
- package/cjs/stepper/hooks/useButtonClick.d.ts +11 -0
- package/cjs/stepper/hooks/useButtonClick.js +74 -0
- package/cjs/stepper/hooks/useInputEvent.d.ts +9 -0
- package/cjs/stepper/hooks/useInputEvent.js +59 -0
- package/cjs/stepper/hooks/useValue.d.ts +6 -0
- package/cjs/stepper/hooks/useValue.js +44 -0
- package/cjs/stepper/index.d.ts +13 -0
- package/cjs/stepper/index.js +190 -0
- package/cjs/stepper/style/css/index.css +76 -0
- package/cjs/stepper/style/css/index.d.ts +2 -0
- package/cjs/stepper/style/css/index.js +5 -0
- package/cjs/stepper/style/index.d.ts +2 -0
- package/cjs/stepper/style/index.js +5 -0
- package/cjs/stepper/style/index.less +80 -0
- package/cjs/stepper/type.d.ts +159 -0
- package/cjs/stepper/type.js +3 -0
- package/cjs/style.d.ts +1 -0
- package/cjs/style.js +2 -0
- 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 +463 -52
- package/dist/index.min.js +3 -3
- package/dist/style.css +77 -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-picker/index.js +18 -12
- package/esm/image-picker/type.d.ts +10 -0
- 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/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/input/hooks.js +1 -0
- package/esm/input/index.d.ts +5 -0
- package/esm/input/index.js +6 -2
- package/esm/input/style/css/index.css +1 -0
- package/esm/input/style/index.less +1 -0
- 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/demo/style/css/mobile.css +4 -0
- package/esm/stepper/demo/style/mobile.less +10 -0
- package/esm/stepper/hooks/useButtonClick.d.ts +11 -0
- package/esm/stepper/hooks/useButtonClick.js +69 -0
- package/esm/stepper/hooks/useInputEvent.d.ts +9 -0
- package/esm/stepper/hooks/useInputEvent.js +53 -0
- package/esm/stepper/hooks/useValue.d.ts +6 -0
- package/esm/stepper/hooks/useValue.js +38 -0
- package/esm/stepper/index.d.ts +13 -0
- package/esm/stepper/index.js +163 -0
- package/esm/stepper/style/css/index.css +76 -0
- package/esm/stepper/style/css/index.d.ts +2 -0
- package/esm/stepper/style/css/index.js +2 -0
- package/esm/stepper/style/index.d.ts +2 -0
- package/esm/stepper/style/index.js +2 -0
- package/esm/stepper/style/index.less +80 -0
- package/esm/stepper/type.d.ts +159 -0
- package/esm/stepper/type.js +1 -0
- package/esm/style.d.ts +1 -0
- package/esm/style.js +1 -0
- 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/tokens/app/arcodesign/default/css-variables.less +15 -0
- package/tokens/app/arcodesign/default/index.d.ts +15 -0
- package/tokens/app/arcodesign/default/index.js +16 -1
- package/tokens/app/arcodesign/default/index.json +180 -0
- package/tokens/app/arcodesign/default/index.less +15 -0
- 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-picker/index.js +18 -12
- package/umd/image-picker/type.d.ts +10 -0
- 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/index.d.ts +1 -0
- package/umd/index.js +7 -5
- package/umd/input/hooks.js +1 -0
- package/umd/input/index.d.ts +5 -0
- package/umd/input/index.js +6 -2
- package/umd/input/style/css/index.css +1 -0
- package/umd/input/style/index.less +1 -0
- 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/demo/style/css/mobile.css +4 -0
- package/umd/stepper/demo/style/mobile.less +10 -0
- package/umd/stepper/hooks/useButtonClick.d.ts +11 -0
- package/umd/stepper/hooks/useButtonClick.js +86 -0
- package/umd/stepper/hooks/useInputEvent.d.ts +9 -0
- package/umd/stepper/hooks/useInputEvent.js +71 -0
- package/umd/stepper/hooks/useValue.d.ts +6 -0
- package/umd/stepper/hooks/useValue.js +56 -0
- package/umd/stepper/index.d.ts +13 -0
- package/umd/stepper/index.js +191 -0
- package/umd/stepper/style/css/index.css +76 -0
- package/umd/stepper/style/css/index.d.ts +2 -0
- package/umd/stepper/style/css/index.js +15 -0
- package/umd/stepper/style/index.d.ts +2 -0
- package/umd/stepper/style/index.js +15 -0
- package/umd/stepper/style/index.less +80 -0
- package/umd/stepper/type.d.ts +159 -0
- package/umd/stepper/type.js +17 -0
- package/umd/style.d.ts +1 -0
- package/umd/style.js +4 -4
- 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,38 @@
|
|
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
|
+
|
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)
|
23
|
+
|
24
|
+
|
25
|
+
### Bug Fixes
|
26
|
+
|
27
|
+
* `ImagePicker` add click event ([#67](https://github.com/arco-design/arco-design-mobile/issues/67)) ([0f76fda](https://github.com/arco-design/arco-design-mobile/commit/0f76fda245ac9a171525800c1d170c93411f2820))
|
28
|
+
|
29
|
+
|
30
|
+
### Features
|
31
|
+
|
32
|
+
* add new component `Stepper` ([#46](https://github.com/arco-design/arco-design-mobile/issues/46)) ([a6ce795](https://github.com/arco-design/arco-design-mobile/commit/a6ce7958345ca5170cf00b7efa5cf74d02ebe93d))
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
6
38
|
## [2.22.3](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.22.2...@arco-design/mobile-react@2.22.3) (2022-11-23)
|
7
39
|
|
8
40
|
|
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;
|
@@ -84,7 +84,9 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
84
84
|
onMaxSizeExceed = props.onMaxSizeExceed,
|
85
85
|
onLimitExceed = props.onLimitExceed,
|
86
86
|
upload = props.upload,
|
87
|
-
selectAdapter = props.selectAdapter
|
87
|
+
selectAdapter = props.selectAdapter,
|
88
|
+
onSelectClick = props.onSelectClick,
|
89
|
+
onDeleteClick = props.onDeleteClick;
|
88
90
|
var domRef = (0, _react.useRef)(null);
|
89
91
|
var fileRef = (0, _react.useRef)(null);
|
90
92
|
var cacheRef = (0, _react.useRef)([]);
|
@@ -185,6 +187,7 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
185
187
|
};
|
186
188
|
|
187
189
|
var handleDelete = function handleDelete(index) {
|
190
|
+
onDeleteClick && onDeleteClick(index);
|
188
191
|
onChange(images.filter(function (_i, j) {
|
189
192
|
return j !== index;
|
190
193
|
}));
|
@@ -208,17 +211,20 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
208
211
|
}
|
209
212
|
};
|
210
213
|
|
211
|
-
var handleSelect = function handleSelect() {
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
214
|
+
var handleSelect = function handleSelect(e) {
|
215
|
+
if (e.target !== fileRef.current) {
|
216
|
+
var _fileRef$current;
|
217
|
+
|
218
|
+
onSelectClick && onSelectClick();
|
219
|
+
selectAdapter ? selectAdapter().then(function (_ref4) {
|
220
|
+
var files = _ref4.files;
|
221
|
+
return handleChange({
|
222
|
+
target: {
|
223
|
+
files: files
|
224
|
+
}
|
225
|
+
}, true);
|
226
|
+
}) : (_fileRef$current = fileRef.current) == null ? void 0 : _fileRef$current.click();
|
227
|
+
}
|
222
228
|
};
|
223
229
|
|
224
230
|
var getGridData = function getGridData(prefixCls, locale) {
|
@@ -164,6 +164,16 @@ export interface ImagePickerProps {
|
|
164
164
|
* @en Select Adaptor
|
165
165
|
*/
|
166
166
|
selectAdapter?: () => Promise<SelectCallback>;
|
167
|
+
/**
|
168
|
+
* 选图点击事件
|
169
|
+
* @en Select Icon Click Event
|
170
|
+
*/
|
171
|
+
onSelectClick?: () => void;
|
172
|
+
/**
|
173
|
+
* 删除点击事件
|
174
|
+
* @en Delete Icon Click Event
|
175
|
+
*/
|
176
|
+
onDeleteClick?: (index: number) => void;
|
167
177
|
}
|
168
178
|
export interface ImagePickerRef {
|
169
179
|
/**
|
@@ -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/index.d.ts
CHANGED
@@ -42,6 +42,7 @@ export { default as Radio } from './radio';
|
|
42
42
|
export { default as Rate } from './rate';
|
43
43
|
export { default as Slider } from './slider';
|
44
44
|
export { default as SearchBar } from './search-bar';
|
45
|
+
export { default as Stepper } from './stepper';
|
45
46
|
export { default as Steps } from './steps';
|
46
47
|
export { default as Sticky } from './sticky';
|
47
48
|
export { default as SwipeAction } from './swipe-action';
|
package/cjs/index.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports.Transition = exports.Toast = exports.Textarea = exports.Tag = exports.Tabs = exports.TabBar = exports.Switch = exports.SwipeLoad = exports.SwipeAction = exports.Sticky = exports.Steps = exports.Slider = exports.ShowMonitor = exports.SearchBar = exports.Rate = exports.Radio = exports.PullRefresh = exports.Progress = exports.Portal = exports.PopupSwiper = exports.Popup = exports.Popover = exports.PickerView = exports.Picker = exports.Pagination = exports.Notify = exports.NoticeBar = exports.NavBar = exports.Masking = exports.Loading = exports.LoadMore = exports.Input = exports.ImagePreview = exports.ImagePicker = exports.Image = exports.Grid = exports.Ellipsis = exports.DropdownMenu = exports.Dropdown = exports.Dialog = exports.DatePicker = exports.CountDown = exports.ContextProvider = exports.Collapse = exports.CircleProgress = exports.Checkbox = exports.Cell = exports.Carousel = exports.Button = exports.Badge = exports.Avatar = exports.ActionSheet = void 0;
|
6
|
+
exports.Transition = exports.Toast = exports.Textarea = exports.Tag = exports.Tabs = exports.TabBar = exports.Switch = exports.SwipeLoad = exports.SwipeAction = exports.Sticky = exports.Steps = exports.Stepper = exports.Slider = exports.ShowMonitor = exports.SearchBar = exports.Rate = exports.Radio = exports.PullRefresh = exports.Progress = exports.Portal = exports.PopupSwiper = exports.Popup = exports.Popover = exports.PickerView = exports.Picker = exports.Pagination = exports.Notify = exports.NoticeBar = exports.NavBar = exports.Masking = exports.Loading = exports.LoadMore = exports.Input = exports.ImagePreview = exports.ImagePicker = exports.Image = exports.Grid = exports.Ellipsis = exports.DropdownMenu = exports.Dropdown = exports.Dialog = exports.DatePicker = exports.CountDown = exports.ContextProvider = exports.Collapse = exports.CircleProgress = exports.Checkbox = exports.Cell = exports.Carousel = exports.Button = exports.Badge = exports.Avatar = exports.ActionSheet = void 0;
|
7
7
|
|
8
8
|
var _actionSheet = _interopRequireDefault(require("./action-sheet"));
|
9
9
|
|
@@ -181,6 +181,10 @@ var _searchBar = _interopRequireDefault(require("./search-bar"));
|
|
181
181
|
|
182
182
|
exports.SearchBar = _searchBar.default;
|
183
183
|
|
184
|
+
var _stepper = _interopRequireDefault(require("./stepper"));
|
185
|
+
|
186
|
+
exports.Stepper = _stepper.default;
|
187
|
+
|
184
188
|
var _steps = _interopRequireDefault(require("./steps"));
|
185
189
|
|
186
190
|
exports.Steps = _steps.default;
|
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
|
|