@arco-design/mobile-react 2.21.3 → 2.22.2
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 +31 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/index.d.ts +1 -0
- package/cjs/_helpers/index.js +9 -0
- package/cjs/_helpers/react-dom.d.ts +13 -0
- package/cjs/_helpers/react-dom.js +65 -0
- package/cjs/_helpers/render.d.ts +10 -0
- package/cjs/_helpers/render.js +40 -0
- package/cjs/action-sheet/index.d.ts +1 -1
- package/cjs/action-sheet/style/css/index.css +2 -2
- package/cjs/action-sheet/style/index.less +1 -1
- package/cjs/dialog/style/css/index.css +2 -2
- package/cjs/dialog/style/index.less +1 -1
- package/cjs/image-picker/index.js +0 -1
- package/cjs/image-preview/index.d.ts +2 -10
- package/cjs/image-preview/methods.js +4 -11
- package/cjs/masking/index.d.ts +10 -0
- package/cjs/masking/methods.js +4 -11
- package/cjs/notify/methods.js +6 -9
- package/cjs/popover/hooks/useEvent.js +6 -6
- package/cjs/pull-refresh/android-pull-refresh.js +2 -0
- package/cjs/pull-refresh/ios-pull-refresh.js +3 -2
- package/cjs/pull-refresh/model.d.ts +6 -2
- package/cjs/steps/demo/style/css/mobile.css +8 -2
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/steps/index.js +5 -1
- package/cjs/steps/step.js +5 -3
- package/cjs/steps/style/css/index.css +78 -23
- package/cjs/steps/style/index.less +92 -24
- package/cjs/steps/type.d.ts +12 -0
- package/cjs/swipe-action/index.js +21 -3
- package/cjs/tabs/index.js +8 -4
- package/cjs/tabs/style/css/index.css +8 -8
- package/cjs/tabs/style/index.less +4 -4
- package/cjs/tabs/tab-cell.js +4 -3
- package/cjs/tabs/type.d.ts +11 -0
- package/cjs/toast/methods.js +9 -12
- package/dist/index.js +186 -81
- package/dist/index.min.js +4 -4
- package/dist/style.css +87 -35
- package/dist/style.min.css +1 -1
- package/esm/_helpers/index.d.ts +1 -0
- package/esm/_helpers/index.js +1 -0
- package/esm/_helpers/react-dom.d.ts +13 -0
- package/esm/_helpers/react-dom.js +57 -0
- package/esm/_helpers/render.d.ts +10 -0
- package/esm/_helpers/render.js +29 -0
- package/esm/action-sheet/index.d.ts +1 -1
- package/esm/action-sheet/style/css/index.css +2 -2
- package/esm/action-sheet/style/index.less +1 -1
- package/esm/dialog/style/css/index.css +2 -2
- package/esm/dialog/style/index.less +1 -1
- package/esm/image-picker/index.js +0 -1
- package/esm/image-preview/index.d.ts +2 -10
- package/esm/image-preview/methods.js +3 -9
- package/esm/masking/index.d.ts +10 -0
- package/esm/masking/methods.js +3 -9
- package/esm/notify/methods.js +6 -7
- package/esm/popover/hooks/useEvent.js +6 -6
- package/esm/pull-refresh/android-pull-refresh.js +2 -0
- package/esm/pull-refresh/ios-pull-refresh.js +3 -2
- package/esm/pull-refresh/model.d.ts +6 -2
- package/esm/steps/demo/style/css/mobile.css +8 -2
- package/esm/steps/index.d.ts +1 -1
- package/esm/steps/index.js +5 -1
- package/esm/steps/step.js +5 -3
- package/esm/steps/style/css/index.css +78 -23
- package/esm/steps/style/index.less +92 -24
- package/esm/steps/type.d.ts +12 -0
- package/esm/swipe-action/index.js +21 -3
- package/esm/tabs/index.js +9 -5
- package/esm/tabs/style/css/index.css +8 -8
- package/esm/tabs/style/index.less +4 -4
- package/esm/tabs/tab-cell.js +4 -3
- package/esm/tabs/type.d.ts +11 -0
- package/esm/toast/methods.js +8 -9
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +7 -3
- package/tokens/app/arcodesign/default/index.d.ts +4 -0
- package/tokens/app/arcodesign/default/index.js +7 -3
- package/tokens/app/arcodesign/default/index.json +58 -10
- package/tokens/app/arcodesign/default/index.less +7 -3
- package/tokens/mixin/index.less +1 -1
- package/umd/_helpers/index.d.ts +1 -0
- package/umd/_helpers/index.js +10 -4
- package/umd/_helpers/react-dom.d.ts +13 -0
- package/umd/_helpers/react-dom.js +78 -0
- package/umd/_helpers/render.d.ts +10 -0
- package/umd/_helpers/render.js +51 -0
- package/umd/action-sheet/index.d.ts +1 -1
- package/umd/action-sheet/style/css/index.css +2 -2
- package/umd/action-sheet/style/index.less +1 -1
- package/umd/dialog/style/css/index.css +2 -2
- package/umd/dialog/style/index.less +1 -1
- package/umd/image-picker/index.js +0 -1
- package/umd/image-preview/index.d.ts +2 -10
- package/umd/image-preview/methods.js +6 -13
- package/umd/masking/index.d.ts +10 -0
- package/umd/masking/methods.js +6 -13
- package/umd/notify/methods.js +9 -12
- package/umd/popover/hooks/useEvent.js +6 -6
- package/umd/pull-refresh/android-pull-refresh.js +2 -0
- package/umd/pull-refresh/ios-pull-refresh.js +3 -2
- package/umd/pull-refresh/model.d.ts +6 -2
- package/umd/steps/demo/style/css/mobile.css +8 -2
- package/umd/steps/index.d.ts +1 -1
- package/umd/steps/index.js +5 -1
- package/umd/steps/step.js +5 -3
- package/umd/steps/style/css/index.css +78 -23
- package/umd/steps/style/index.less +92 -24
- package/umd/steps/type.d.ts +12 -0
- package/umd/swipe-action/index.js +21 -3
- package/umd/tabs/index.js +8 -4
- package/umd/tabs/style/css/index.css +8 -8
- package/umd/tabs/style/index.less +4 -4
- package/umd/tabs/tab-cell.js +4 -3
- package/umd/tabs/type.d.ts +11 -0
- package/umd/toast/methods.js +11 -14
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,37 @@
|
|
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.22.2](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.22.0...@arco-design/mobile-react@2.22.2) (2022-11-09)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* `PullRefresh` support custom style ([edac495](https://github.com/arco-design/arco-design-mobile/commit/edac4954526b8f2e3a86c9742752222e19f899f8))
|
12
|
+
* `Steps` optimize style & support custom alignment ([617c570](https://github.com/arco-design/arco-design-mobile/commit/617c57003135215787897b48c07d2b674c482828))
|
13
|
+
* `Tabs` fix touch event on foldable screen ([a67fa71](https://github.com/arco-design/arco-design-mobile/commit/a67fa71c8944e27aa43d6353e4a24e4ba676cec3))
|
14
|
+
* optimize .text-medium mixin ([ab62ab2](https://github.com/arco-design/arco-design-mobile/commit/ab62ab2cdb51174cbd2106467bbf1a3db4694982))
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
# [2.22.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.21.3...@arco-design/mobile-react@2.22.0) (2022-10-28)
|
21
|
+
|
22
|
+
|
23
|
+
### Bug Fixes
|
24
|
+
|
25
|
+
* `SwipeAction` prevent touchmove by gesture ([#59](https://github.com/arco-design/arco-design-mobile/issues/59)) ([c9ef474](https://github.com/arco-design/arco-design-mobile/commit/c9ef474312eb9f9af736431f16147cfb56dee623))
|
26
|
+
* `Tabs` supports tabBarStopPropagation ([#62](https://github.com/arco-design/arco-design-mobile/issues/62)) ([ba24d17](https://github.com/arco-design/arco-design-mobile/commit/ba24d178320e12b0aa95e5d75feb34e5e5163af4))
|
27
|
+
|
28
|
+
|
29
|
+
### Features
|
30
|
+
|
31
|
+
* add support for react18 ([#57](https://github.com/arco-design/arco-design-mobile/issues/57)) ([7cbb4fc](https://github.com/arco-design/arco-design-mobile/commit/7cbb4fcd5bd8c2809141bf0546f42ecf3367fd73))
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
6
37
|
## [2.21.3](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.21.2...@arco-design/mobile-react@2.21.3) (2022-09-30)
|
7
38
|
|
8
39
|
|
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.22.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.22.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.22.0/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.22.0/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/_helpers/index.d.ts
CHANGED
package/cjs/_helpers/index.js
CHANGED
@@ -30,6 +30,15 @@ Object.keys(_type).forEach(function (key) {
|
|
30
30
|
exports[key] = _type[key];
|
31
31
|
});
|
32
32
|
|
33
|
+
var _reactDom = require("./react-dom");
|
34
|
+
|
35
|
+
Object.keys(_reactDom).forEach(function (key) {
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
37
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
38
|
+
if (key in exports && exports[key] === _reactDom[key]) return;
|
39
|
+
exports[key] = _reactDom[key];
|
40
|
+
});
|
41
|
+
|
33
42
|
/**
|
34
43
|
* @type utils
|
35
44
|
* @name componentUtils
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
export interface RootType {
|
3
|
+
render: (container: ReactElement) => void;
|
4
|
+
_unmount: () => void;
|
5
|
+
}
|
6
|
+
export interface RootTypeReact extends RootType {
|
7
|
+
unmount?: () => void;
|
8
|
+
}
|
9
|
+
export declare type CreateRootFnType = (container: Element | DocumentFragment) => RootTypeReact;
|
10
|
+
export declare const render: (app: ReactElement, container: Element | DocumentFragment) => {
|
11
|
+
render: (container: ReactElement) => void;
|
12
|
+
_unmount: () => void;
|
13
|
+
};
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.render = void 0;
|
7
|
+
|
8
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
9
|
+
|
10
|
+
var _CopyReactDOM$version;
|
11
|
+
|
12
|
+
function isObject(obj) {
|
13
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
14
|
+
}
|
15
|
+
|
16
|
+
var __SECRET_INTERNALS__ = '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED';
|
17
|
+
var CopyReactDOM = _reactDom.default;
|
18
|
+
var copyRender;
|
19
|
+
var isReact18 = Number((_CopyReactDOM$version = CopyReactDOM.version) == null ? void 0 : _CopyReactDOM$version.split('.')[0]) > 17;
|
20
|
+
|
21
|
+
var updateUsingClientEntryPoint = function updateUsingClientEntryPoint(skipWarning) {
|
22
|
+
// https://github.com/facebook/react/blob/17806594cc28284fe195f918e8d77de3516848ec/packages/react-dom/npm/client.js#L10
|
23
|
+
// Avoid console warning
|
24
|
+
if (isObject(CopyReactDOM[__SECRET_INTERNALS__])) {
|
25
|
+
CopyReactDOM[__SECRET_INTERNALS__].usingClientEntryPoint = skipWarning;
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
var createRoot;
|
30
|
+
|
31
|
+
try {
|
32
|
+
createRoot = CopyReactDOM.createRoot;
|
33
|
+
} catch (_) {}
|
34
|
+
|
35
|
+
if (isReact18 && createRoot) {
|
36
|
+
copyRender = function copyRender(app, container) {
|
37
|
+
updateUsingClientEntryPoint(true);
|
38
|
+
var root = createRoot(container);
|
39
|
+
updateUsingClientEntryPoint(false);
|
40
|
+
root.render(app);
|
41
|
+
|
42
|
+
root._unmount = function () {
|
43
|
+
setTimeout(function () {
|
44
|
+
root == null ? void 0 : root.unmount == null ? void 0 : root.unmount();
|
45
|
+
});
|
46
|
+
};
|
47
|
+
|
48
|
+
return root;
|
49
|
+
};
|
50
|
+
} else {
|
51
|
+
copyRender = function copyRender(app, container) {
|
52
|
+
CopyReactDOM.render(app, container);
|
53
|
+
return {
|
54
|
+
render: function render(comment) {
|
55
|
+
CopyReactDOM.render(comment, container);
|
56
|
+
},
|
57
|
+
_unmount: function _unmount() {
|
58
|
+
CopyReactDOM.unmountComponentAtNode(container);
|
59
|
+
}
|
60
|
+
};
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
var render = copyRender;
|
65
|
+
exports.render = render;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { FunctionComponent } from 'react';
|
2
|
+
import { RootType } from './react-dom';
|
3
|
+
export declare class ReactDOMRender {
|
4
|
+
root: RootType | undefined;
|
5
|
+
app: FunctionComponent;
|
6
|
+
container: Element | DocumentFragment;
|
7
|
+
constructor(app: FunctionComponent, container: Element | DocumentFragment);
|
8
|
+
render: (props: any) => void;
|
9
|
+
unmount: () => void;
|
10
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.ReactDOMRender = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _reactDom = require("./react-dom");
|
11
|
+
|
12
|
+
var ReactDOMRender = function ReactDOMRender(app, container) {
|
13
|
+
var _this = this;
|
14
|
+
|
15
|
+
this.root = void 0;
|
16
|
+
this.app = void 0;
|
17
|
+
this.container = void 0;
|
18
|
+
|
19
|
+
this.render = function (props) {
|
20
|
+
var CustomApp = _this.app;
|
21
|
+
|
22
|
+
if (_this.root) {
|
23
|
+
_this.root.render( /*#__PURE__*/_react.default.createElement(CustomApp, props));
|
24
|
+
} else {
|
25
|
+
_this.root = (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(CustomApp, props), _this.container);
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
this.unmount = function () {
|
30
|
+
var _this$root;
|
31
|
+
|
32
|
+
(_this$root = _this.root) == null ? void 0 : _this$root._unmount();
|
33
|
+
_this.root = undefined;
|
34
|
+
};
|
35
|
+
|
36
|
+
this.app = app;
|
37
|
+
this.container = container;
|
38
|
+
};
|
39
|
+
|
40
|
+
exports.ReactDOMRender = ReactDOMRender;
|
@@ -26,7 +26,7 @@ export interface ActionSheetItemOptions {
|
|
26
26
|
* 点击选项事件,返回值为 true 时可以阻止动作面板关闭
|
27
27
|
* @en Click option event, actionSheet will be prevent from closing when returning true
|
28
28
|
*/
|
29
|
-
onClick?: (e
|
29
|
+
onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => (void | boolean) | Promise<void | boolean>;
|
30
30
|
}
|
31
31
|
export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'getScrollContainer' | 'orientationDirection' | 'direction'> {
|
32
32
|
/**
|
@@ -46,8 +46,8 @@
|
|
46
46
|
.arco-action-sheet-title.android,
|
47
47
|
.arco-action-sheet-title.system-android {
|
48
48
|
font-weight: 400;
|
49
|
-
-webkit-text-stroke: 0.3PX
|
50
|
-
text-stroke: 0.3PX
|
49
|
+
-webkit-text-stroke: 0.3PX currentColor;
|
50
|
+
text-stroke: 0.3PX currentColor;
|
51
51
|
}
|
52
52
|
.arco-action-sheet-sub-title {
|
53
53
|
color: #86909c ;
|
@@ -126,8 +126,8 @@
|
|
126
126
|
.arco-dialog-header.ios.android,
|
127
127
|
.arco-dialog-header.ios.system-android {
|
128
128
|
font-weight: 400;
|
129
|
-
-webkit-text-stroke: 0.3PX
|
130
|
-
text-stroke: 0.3PX
|
129
|
+
-webkit-text-stroke: 0.3PX currentColor;
|
130
|
+
text-stroke: 0.3PX currentColor;
|
131
131
|
}
|
132
132
|
.arco-dialog-header.ios.only-title {
|
133
133
|
padding-bottom: 0.4rem ;
|
@@ -105,7 +105,7 @@
|
|
105
105
|
.use-var(padding-right, dialog-ios-horizontal-padding);
|
106
106
|
.use-var(font-size, dialog-header-ios-font-size);
|
107
107
|
.use-var(line-height, dialog-header-ios-line-height);
|
108
|
-
.text-medium
|
108
|
+
.text-medium();
|
109
109
|
|
110
110
|
&.only-title {
|
111
111
|
.use-var(padding-bottom, dialog-ios-vertical-padding);
|
@@ -194,7 +194,6 @@ var ImagePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
194
194
|
var timeOutEvent;
|
195
195
|
|
196
196
|
var handleTouchStart = function handleTouchStart(e, image, index) {
|
197
|
-
e.preventDefault();
|
198
197
|
timeOutEvent = setTimeout(function () {
|
199
198
|
timeOutEvent = 0;
|
200
199
|
onLongPress == null ? void 0 : onLongPress(e, image, index);
|
@@ -254,11 +254,7 @@ export declare function methodsGenerator<P extends ImagePreviewProps>(Comp: Reac
|
|
254
254
|
*/
|
255
255
|
open: (config: Pick<P, Exclude<keyof P, "close">>) => {
|
256
256
|
close: () => void;
|
257
|
-
update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
|
258
|
-
* 是否可循环滑动
|
259
|
-
* @en Whether it can be swiped circularly
|
260
|
-
* @default false
|
261
|
-
*/
|
257
|
+
update: (newConfig: Pick<P, Exclude<keyof P, "close">>) => void;
|
262
258
|
};
|
263
259
|
};
|
264
260
|
declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>> & {
|
@@ -270,11 +266,7 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
270
266
|
*/
|
271
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">) => {
|
272
268
|
close: () => void;
|
273
|
-
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;
|
274
|
-
* 是否可循环滑动
|
275
|
-
* @en Whether it can be swiped circularly
|
276
|
-
* @default false
|
277
|
-
*/
|
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;
|
278
270
|
};
|
279
271
|
};
|
280
272
|
/**
|
@@ -7,12 +7,10 @@ exports.open = open;
|
|
7
7
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
9
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
11
|
-
|
12
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
13
|
-
|
14
10
|
var _mobileUtils = require("@arco-design/mobile-utils");
|
15
11
|
|
12
|
+
var _render = require("../_helpers/render");
|
13
|
+
|
16
14
|
function open(Component) {
|
17
15
|
return function (config) {
|
18
16
|
var baseProps = (0, _extends2.default)({
|
@@ -30,13 +28,8 @@ function open(Component) {
|
|
30
28
|
|
31
29
|
var leaving = false;
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
getContainer: function getContainer() {
|
36
|
-
return div;
|
37
|
-
}
|
38
|
-
})), div);
|
39
|
-
}
|
31
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
32
|
+
render = _ReactDOMRender.render;
|
40
33
|
|
41
34
|
function update(newConfig) {
|
42
35
|
dynamicProps = (0, _extends2.default)({}, dynamicProps, newConfig || {});
|
package/cjs/masking/index.d.ts
CHANGED
@@ -192,6 +192,11 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
|
|
192
192
|
open: (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
193
193
|
key?: string | undefined;
|
194
194
|
}) => {
|
195
|
+
/**
|
196
|
+
* 点击蒙层是否关闭菜单
|
197
|
+
* @en Whether to click the mask to close the menu
|
198
|
+
* @default true
|
199
|
+
*/
|
195
200
|
close: () => void;
|
196
201
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
197
202
|
key?: string | undefined;
|
@@ -208,6 +213,11 @@ declare const _default: React.ForwardRefExoticComponent<MaskingProps & React.Ref
|
|
208
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"> & {
|
209
214
|
key?: string | undefined;
|
210
215
|
}) => {
|
216
|
+
/**
|
217
|
+
* 点击蒙层是否关闭菜单
|
218
|
+
* @en Whether to click the mask to close the menu
|
219
|
+
* @default true
|
220
|
+
*/
|
211
221
|
close: () => void;
|
212
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"> & {
|
213
223
|
key?: string | undefined;
|
package/cjs/masking/methods.js
CHANGED
@@ -8,12 +8,10 @@ exports.open = open;
|
|
8
8
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
10
10
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
12
|
-
|
13
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
14
|
-
|
15
11
|
var _mobileUtils = require("@arco-design/mobile-utils");
|
16
12
|
|
13
|
+
var _render = require("../_helpers/render");
|
14
|
+
|
17
15
|
function getOpenMethod(Component, containerId, normalize) {
|
18
16
|
if (normalize === void 0) {
|
19
17
|
normalize = function normalize(config) {
|
@@ -37,13 +35,8 @@ function getOpenMethod(Component, containerId, normalize) {
|
|
37
35
|
|
38
36
|
var leaving = false;
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
getContainer: function getContainer() {
|
43
|
-
return div;
|
44
|
-
}
|
45
|
-
})), div);
|
46
|
-
}
|
38
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
39
|
+
render = _ReactDOMRender.render;
|
47
40
|
|
48
41
|
function update(newConfig) {
|
49
42
|
dynamicProps = (0, _extends2.default)({}, dynamicProps, normalize(newConfig));
|
package/cjs/notify/methods.js
CHANGED
@@ -9,9 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
9
9
|
|
10
10
|
var _mobileUtils = require("@arco-design/mobile-utils");
|
11
11
|
|
12
|
-
var
|
13
|
-
|
14
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
12
|
+
var _render = require("../_helpers/render");
|
15
13
|
|
16
14
|
function notify(Component, type) {
|
17
15
|
return function (originConfig) {
|
@@ -33,17 +31,16 @@ function notify(Component, type) {
|
|
33
31
|
document.body.appendChild(div);
|
34
32
|
}
|
35
33
|
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
var _ReactDOMRender = new _render.ReactDOMRender(Component, div),
|
35
|
+
render = _ReactDOMRender.render,
|
36
|
+
unmount = _ReactDOMRender.unmount;
|
39
37
|
|
40
38
|
function destroy() {
|
41
39
|
var onClose = config.onClose;
|
42
40
|
onClose && onClose();
|
41
|
+
unmount();
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
if (unmountResult && div.parentNode) {
|
43
|
+
if (div.parentNode) {
|
47
44
|
div.parentNode.removeChild(div);
|
48
45
|
}
|
49
46
|
}
|
@@ -52,6 +52,7 @@ var useEvent = function useEvent(props, wrapperRef, popoverInnerRef, visibleRef,
|
|
52
52
|
onVisibleChange(false);
|
53
53
|
window.clearTimeout(closeTimer.current);
|
54
54
|
closeTimer.current = 0;
|
55
|
+
mayRemoveEventListenerOnBody();
|
55
56
|
};
|
56
57
|
|
57
58
|
var throttleHandleVerticalScroll = (0, _react.useMemo)(function () {
|
@@ -71,7 +72,7 @@ var useEvent = function useEvent(props, wrapperRef, popoverInnerRef, visibleRef,
|
|
71
72
|
};
|
72
73
|
}, [throttleHandleVerticalScroll, getVerticalScrollContainer, autoVerticalDirection, visibleRef]);
|
73
74
|
var mayRemoveEventListenerOnBody = (0, _react.useCallback)(function () {
|
74
|
-
document.body.removeEventListener('click', handleClickBody);
|
75
|
+
document.body.removeEventListener('click', handleClickBody, true);
|
75
76
|
document.body.removeEventListener('touchstart', handleTouchBody);
|
76
77
|
var el = getVerticalScrollContainer();
|
77
78
|
|
@@ -86,7 +87,6 @@ var useEvent = function useEvent(props, wrapperRef, popoverInnerRef, visibleRef,
|
|
86
87
|
// 仅处理子元素和气泡元素外的点击事件
|
87
88
|
// @en Only handle click events outside of children elements and bubble elements
|
88
89
|
if (!(0, _mobileUtils.isContains)(wrapperRef.current, e.target) && !(0, _mobileUtils.isContains)(((_popoverInnerRef$curr = popoverInnerRef.current) == null ? void 0 : _popoverInnerRef$curr.dom) || null, e.target)) {
|
89
|
-
// TODO: 这里仅阻止了react事件,react 18 将不再在document上挂事件,这里的stop会失效
|
90
90
|
if (preventBodyClick) {
|
91
91
|
e.stopPropagation();
|
92
92
|
e.preventDefault();
|
@@ -112,13 +112,13 @@ var useEvent = function useEvent(props, wrapperRef, popoverInnerRef, visibleRef,
|
|
112
112
|
var handle = function handle(e) {
|
113
113
|
e.stopPropagation();
|
114
114
|
e.preventDefault();
|
115
|
-
document.body.removeEventListener('click', handle);
|
115
|
+
document.body.removeEventListener('click', handle, true);
|
116
116
|
clearTimeout(preventRecentClickTimer);
|
117
117
|
};
|
118
118
|
|
119
|
-
document.body.addEventListener('click', handle);
|
119
|
+
document.body.addEventListener('click', handle, true);
|
120
120
|
preventRecentClickTimer = window.setTimeout(function () {
|
121
|
-
document.body.removeEventListener('click', handle);
|
121
|
+
document.body.removeEventListener('click', handle, true);
|
122
122
|
}, 500);
|
123
123
|
};
|
124
124
|
|
@@ -161,7 +161,7 @@ var useEvent = function useEvent(props, wrapperRef, popoverInnerRef, visibleRef,
|
|
161
161
|
var el = getVerticalScrollContainer();
|
162
162
|
el && el.addEventListener('scroll', handleScrollBody);
|
163
163
|
} else if (clickOtherToClose) {
|
164
|
-
document.body.addEventListener('click', handleClickBody);
|
164
|
+
document.body.addEventListener('click', handleClickBody, true);
|
165
165
|
}
|
166
166
|
};
|
167
167
|
/**
|
@@ -36,6 +36,7 @@ var PullRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
36
36
|
locale = _useContext$locale === void 0 ? _mobileUtils.defaultLocale : _useContext$locale;
|
37
37
|
|
38
38
|
var className = props.className,
|
39
|
+
style = props.style,
|
39
40
|
children = props.children,
|
40
41
|
_props$loosingText = props.loosingText,
|
41
42
|
loosingText = _props$loosingText === void 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
@@ -272,6 +273,7 @@ var PullRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
272
273
|
className: (0, _mobileUtils.cls)(prefixCls + "-pull-refresh all-border-box is-android", className, {
|
273
274
|
'is-disabled': (disabled || !touching && useHideAsNestedScroll) && status !== _model.PullRefreshStatus.Loading
|
274
275
|
}),
|
276
|
+
style: style,
|
275
277
|
ref: domRef
|
276
278
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
277
279
|
className: (0, _mobileUtils.cls)(prefixCls + "-pull-refresh-place"),
|
@@ -35,6 +35,7 @@ var PullRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
35
35
|
|
36
36
|
var animationRef = (0, _react.useRef)(0);
|
37
37
|
var className = props.className,
|
38
|
+
style = props.style,
|
38
39
|
children = props.children,
|
39
40
|
_props$loadingText = props.loadingText,
|
40
41
|
loadingText = _props$loadingText === void 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
@@ -214,9 +215,9 @@ var PullRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
214
215
|
'is-disabled': disabled || !touching && useHideAsNestedScroll
|
215
216
|
}),
|
216
217
|
ref: domRef,
|
217
|
-
style: contentHeight > 0 ? {
|
218
|
+
style: contentHeight > 0 ? (0, _extends2.default)({
|
218
219
|
height: contentHeight
|
219
|
-
}
|
220
|
+
}, style || {}) : style
|
220
221
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
221
222
|
className: (0, _mobileUtils.cls)(prefixCls + "-pull-refresh-content-wrapper")
|
222
223
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ReactNode } from 'react';
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
2
2
|
export interface PullRefreshRef {
|
3
3
|
/**
|
4
4
|
* 最外层元素 DOM
|
@@ -32,9 +32,13 @@ export interface PullRefreshBasicProps {
|
|
32
32
|
/**
|
33
33
|
* 样式类名
|
34
34
|
* @en Custom classname
|
35
|
-
* @default ""
|
36
35
|
*/
|
37
36
|
className?: string;
|
37
|
+
/**
|
38
|
+
* 自定义样式
|
39
|
+
* @en Custom style
|
40
|
+
*/
|
41
|
+
style?: CSSProperties;
|
38
42
|
/**
|
39
43
|
* 是否禁用
|
40
44
|
* @en Whether to be disabled
|
@@ -30,7 +30,10 @@
|
|
30
30
|
#demo-steps #demo-order-7 .process-title-color-with-config {
|
31
31
|
color: #FFB400;
|
32
32
|
}
|
33
|
-
#demo-steps #demo-order-7 .finish-tail-color-with-config
|
33
|
+
#demo-steps #demo-order-7 .finish-tail-color-with-config::before,
|
34
|
+
#demo-steps #demo-order-7 .finish-tail-color-with-config::after,
|
35
|
+
#demo-steps #demo-order-7 .process-tail-color-with-config::before,
|
36
|
+
#demo-steps #demo-order-7 .error-tail-color-with-config::before {
|
34
37
|
background: #FFB400;
|
35
38
|
}
|
36
39
|
#demo-steps #demo-order-8 .demo-svg .arco-steps-item-custom-icon {
|
@@ -57,7 +60,10 @@
|
|
57
60
|
#demo-steps #demo-order-8 .demo-svg .process-title-color-with-config {
|
58
61
|
color: #165DFF;
|
59
62
|
}
|
60
|
-
#demo-steps #demo-order-8 .demo-svg .finish-tail-color-with-config
|
63
|
+
#demo-steps #demo-order-8 .demo-svg .finish-tail-color-with-config::before,
|
64
|
+
#demo-steps #demo-order-8 .demo-svg .finish-tail-color-with-config::after,
|
65
|
+
#demo-steps #demo-order-8 .demo-svg .process-tail-color-with-config::before,
|
66
|
+
#demo-steps #demo-order-8 .demo-svg .error-tail-color-with-config::before {
|
61
67
|
background: #165DFF;
|
62
68
|
}
|
63
69
|
#demo-steps #demo-order-8 .demo-svg .arco-steps-item-custom-icon {
|
package/cjs/steps/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { StepsProps, StepsRef } from './type';
|
3
3
|
export * from './type';
|
4
|
-
export declare const StepsContext: React.Context<Pick<StepsProps, "direction" | "status" | "current" | "iconType"> & {
|
4
|
+
export declare const StepsContext: React.Context<Pick<StepsProps, "direction" | "status" | "current" | "align" | "iconType"> & {
|
5
5
|
index?: number | undefined;
|
6
6
|
changeIndex: (newIndex: number) => void;
|
7
7
|
}>;
|
package/cjs/steps/index.js
CHANGED
@@ -44,6 +44,7 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
44
44
|
children = props.children,
|
45
45
|
_props$direction = props.direction,
|
46
46
|
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
|
47
|
+
userSetAlign = props.align,
|
47
48
|
_props$iconType = props.iconType,
|
48
49
|
iconType = _props$iconType === void 0 ? 'number' : _props$iconType,
|
49
50
|
current = props.current,
|
@@ -54,6 +55,8 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
54
55
|
items = props.items,
|
55
56
|
onClick = props.onClick,
|
56
57
|
onChange = props.onChange;
|
58
|
+
var defaultAlign = direction === 'vertical' ? 'start' : 'center';
|
59
|
+
var align = userSetAlign !== void 0 ? userSetAlign : defaultAlign;
|
57
60
|
|
58
61
|
var _useState = (0, _react.useState)(Number(defaultIndex)),
|
59
62
|
innerIndex = _useState[0],
|
@@ -89,11 +92,12 @@ var Steps = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
89
92
|
direction: direction,
|
90
93
|
index: index,
|
91
94
|
status: activeIndex === index ? status : void 0,
|
95
|
+
align: align,
|
92
96
|
changeIndex: changeIndex
|
93
97
|
},
|
94
98
|
key: index
|
95
99
|
}, child);
|
96
|
-
}, [iconType, activeIndex, direction]);
|
100
|
+
}, [iconType, activeIndex, direction, align]);
|
97
101
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
98
102
|
var prefixCls = _ref.prefixCls;
|
99
103
|
return /*#__PURE__*/_react.default.createElement("div", {
|