@arco-design/mobile-react 2.36.1 → 2.37.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 +23 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.d.ts +1 -1
- package/cjs/_helpers/hooks.js +1 -1
- package/cjs/_helpers/react-dom.d.ts +5 -5
- package/cjs/_helpers/react-dom.js +49 -32
- package/cjs/_helpers/render.js +6 -3
- package/cjs/action-sheet/index.d.ts +3 -2
- package/cjs/action-sheet/index.js +2 -2
- package/cjs/carousel/index.js +8 -7
- package/cjs/checkbox/checkbox.d.ts +1 -1
- package/cjs/checkbox/group.d.ts +1 -1
- package/cjs/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/cjs/checkbox/index.d.ts +2 -2
- package/cjs/context-provider/index.d.ts +8 -2
- package/cjs/count-down/hooks.js +2 -2
- package/cjs/dialog/index.d.ts +8 -3
- package/cjs/dialog/methods.d.ts +6 -2
- package/cjs/dropdown-menu/helper.d.ts +2 -2
- package/cjs/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/cjs/ellipsis/components/native-ellipsis.js +1 -2
- package/cjs/form/form-item.d.ts +33 -2
- package/cjs/form/form-item.js +142 -121
- package/cjs/form/index.js +3 -1
- package/cjs/form/linked-container.d.ts +1 -1
- package/cjs/form/linked-container.js +4 -0
- package/cjs/form/style/css/index.css +4 -1
- package/cjs/form/style/index.less +6 -1
- package/cjs/form/type.d.ts +29 -6
- package/cjs/form/type.js +10 -2
- package/cjs/form/useForm.d.ts +2 -17
- package/cjs/form/useForm.js +98 -17
- package/cjs/form/utils.d.ts +2 -0
- package/cjs/form/utils.js +42 -2
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/index-bar/group.js +3 -1
- package/cjs/index-bar/index.d.ts +2 -2
- package/cjs/index-bar/utils.d.ts +1 -1
- package/cjs/input/index.js +1 -1
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/notify/index.d.ts +8 -8
- package/cjs/notify/index.js +2 -2
- package/cjs/picker-view/components/cascader.js +3 -1
- package/cjs/picker-view/components/picker-cell.js +1 -1
- package/cjs/picker-view/index.js +3 -1
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/pull-refresh/hooks.d.ts +2 -2
- package/cjs/radio/group.d.ts +1 -1
- package/cjs/radio/group.js +1 -1
- package/cjs/radio/index.d.ts +2 -2
- package/cjs/radio/radio.d.ts +1 -1
- package/cjs/radio/type.d.ts +2 -2
- package/cjs/skeleton/elements.js +9 -3
- package/cjs/slider/hooks/index.d.ts +1 -1
- package/cjs/slider/hooks/useSliderEvents.d.ts +1 -1
- package/cjs/stepper/hooks/useValue.d.ts +2 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/tabs/type.d.ts +2 -2
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/index.js +1 -1
- package/dist/index.js +3070 -411
- package/dist/index.min.js +4 -4
- package/dist/style.css +4 -1
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.d.ts +1 -1
- package/esm/_helpers/hooks.js +1 -1
- package/esm/_helpers/react-dom.d.ts +5 -5
- package/esm/_helpers/react-dom.js +49 -30
- package/esm/_helpers/render.js +6 -3
- package/esm/action-sheet/index.d.ts +3 -2
- package/esm/action-sheet/index.js +2 -2
- package/esm/carousel/index.js +8 -7
- package/esm/checkbox/checkbox.d.ts +1 -1
- package/esm/checkbox/group.d.ts +1 -1
- package/esm/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/esm/checkbox/index.d.ts +2 -2
- package/esm/context-provider/index.d.ts +8 -2
- package/esm/count-down/hooks.js +2 -2
- package/esm/dialog/index.d.ts +8 -3
- package/esm/dialog/methods.d.ts +6 -2
- package/esm/dropdown-menu/helper.d.ts +2 -2
- package/esm/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/esm/ellipsis/components/native-ellipsis.js +1 -1
- package/esm/form/form-item.d.ts +33 -2
- package/esm/form/form-item.js +143 -122
- package/esm/form/index.js +3 -1
- package/esm/form/linked-container.d.ts +1 -1
- package/esm/form/linked-container.js +4 -0
- package/esm/form/style/css/index.css +4 -1
- package/esm/form/style/index.less +6 -1
- package/esm/form/type.d.ts +29 -6
- package/esm/form/type.js +8 -1
- package/esm/form/useForm.d.ts +2 -17
- package/esm/form/useForm.js +97 -17
- package/esm/form/utils.d.ts +2 -0
- package/esm/form/utils.js +31 -1
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/index-bar/group.js +3 -1
- package/esm/index-bar/index.d.ts +2 -2
- package/esm/index-bar/utils.d.ts +1 -1
- package/esm/input/index.js +1 -1
- package/esm/masking/index.d.ts +2 -2
- package/esm/notify/index.d.ts +8 -8
- package/esm/notify/index.js +2 -2
- package/esm/picker-view/components/cascader.js +3 -1
- package/esm/picker-view/components/picker-cell.js +1 -1
- package/esm/picker-view/index.js +3 -1
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/pull-refresh/hooks.d.ts +2 -2
- package/esm/radio/group.d.ts +1 -1
- package/esm/radio/group.js +1 -1
- package/esm/radio/index.d.ts +2 -2
- package/esm/radio/radio.d.ts +1 -1
- package/esm/radio/type.d.ts +2 -2
- package/esm/skeleton/elements.js +9 -3
- package/esm/slider/hooks/index.d.ts +1 -1
- package/esm/slider/hooks/useSliderEvents.d.ts +1 -1
- package/esm/stepper/hooks/useValue.d.ts +2 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/tabs/type.d.ts +2 -2
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/index.js +1 -1
- package/esnext/_helpers/hooks.js +1 -1
- package/esnext/_helpers/react-dom.d.ts +5 -5
- package/esnext/_helpers/react-dom.js +47 -28
- package/esnext/_helpers/render.js +3 -2
- package/esnext/action-sheet/index.d.ts +3 -2
- package/esnext/action-sheet/index.js +1 -1
- package/esnext/carousel/index.js +7 -5
- package/esnext/context-provider/index.d.ts +8 -2
- package/esnext/context-provider/index.js +1 -1
- package/esnext/count-down/hooks.js +2 -2
- package/esnext/dialog/index.d.ts +8 -3
- package/esnext/dialog/methods.d.ts +6 -2
- package/esnext/dropdown-menu/helper.d.ts +1 -1
- package/esnext/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/esnext/ellipsis/components/native-ellipsis.js +1 -1
- package/esnext/form/form-item.d.ts +33 -2
- package/esnext/form/form-item.js +85 -71
- package/esnext/form/index.js +2 -1
- package/esnext/form/linked-container.d.ts +1 -1
- package/esnext/form/linked-container.js +3 -0
- package/esnext/form/style/css/index.css +4 -1
- package/esnext/form/style/index.less +6 -1
- package/esnext/form/type.d.ts +29 -6
- package/esnext/form/type.js +7 -0
- package/esnext/form/useForm.d.ts +2 -17
- package/esnext/form/useForm.js +72 -13
- package/esnext/form/utils.d.ts +2 -0
- package/esnext/form/utils.js +26 -0
- package/esnext/image-preview/index.d.ts +2 -2
- package/esnext/index-bar/group.js +5 -1
- package/esnext/index-bar/index.d.ts +2 -2
- package/esnext/input/index.js +1 -1
- package/esnext/masking/index.d.ts +2 -2
- package/esnext/notify/index.d.ts +8 -8
- package/esnext/notify/index.js +2 -2
- package/esnext/picker-view/components/cascader.js +5 -1
- package/esnext/picker-view/components/picker-cell.js +1 -1
- package/esnext/picker-view/index.js +5 -1
- package/esnext/popup/index.d.ts +2 -2
- package/esnext/popup-swiper/index.d.ts +2 -2
- package/esnext/pull-refresh/hooks.d.ts +2 -2
- package/esnext/radio/group.js +3 -1
- package/esnext/radio/type.d.ts +2 -2
- package/esnext/skeleton/elements.js +15 -3
- package/esnext/slider/hooks/useSliderEvents.d.ts +1 -1
- package/esnext/tabs/type.d.ts +2 -2
- package/esnext/toast/index.d.ts +12 -12
- package/esnext/toast/index.js +1 -1
- package/package.json +3 -3
- package/umd/_helpers/hooks.d.ts +1 -1
- package/umd/_helpers/hooks.js +1 -1
- package/umd/_helpers/react-dom.d.ts +5 -5
- package/umd/_helpers/react-dom.js +53 -35
- package/umd/_helpers/render.js +6 -3
- package/umd/action-sheet/index.d.ts +3 -2
- package/umd/action-sheet/index.js +2 -2
- package/umd/carousel/index.js +8 -7
- package/umd/checkbox/checkbox.d.ts +1 -1
- package/umd/checkbox/group.d.ts +1 -1
- package/umd/checkbox/hooks/useMergeProps.d.ts +1 -1
- package/umd/checkbox/index.d.ts +2 -2
- package/umd/context-provider/index.d.ts +8 -2
- package/umd/count-down/hooks.js +2 -2
- package/umd/dialog/index.d.ts +8 -3
- package/umd/dialog/methods.d.ts +6 -2
- package/umd/dropdown-menu/helper.d.ts +2 -2
- package/umd/ellipsis/components/native-ellipsis.d.ts +2 -3
- package/umd/ellipsis/components/native-ellipsis.js +1 -2
- package/umd/form/form-item.d.ts +33 -2
- package/umd/form/form-item.js +142 -121
- package/umd/form/index.js +3 -1
- package/umd/form/linked-container.d.ts +1 -1
- package/umd/form/linked-container.js +4 -0
- package/umd/form/style/css/index.css +4 -1
- package/umd/form/style/index.less +6 -1
- package/umd/form/type.d.ts +29 -6
- package/umd/form/type.js +9 -1
- package/umd/form/useForm.d.ts +2 -17
- package/umd/form/useForm.js +98 -21
- package/umd/form/utils.d.ts +2 -0
- package/umd/form/utils.js +40 -5
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/index-bar/group.js +3 -1
- package/umd/index-bar/index.d.ts +2 -2
- package/umd/index-bar/utils.d.ts +1 -1
- package/umd/input/index.js +1 -1
- package/umd/masking/index.d.ts +2 -2
- package/umd/notify/index.d.ts +8 -8
- package/umd/notify/index.js +2 -2
- package/umd/picker-view/components/cascader.js +3 -1
- package/umd/picker-view/components/picker-cell.js +1 -1
- package/umd/picker-view/index.js +3 -1
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/pull-refresh/hooks.d.ts +2 -2
- package/umd/radio/group.d.ts +1 -1
- package/umd/radio/group.js +1 -1
- package/umd/radio/index.d.ts +2 -2
- package/umd/radio/radio.d.ts +1 -1
- package/umd/radio/type.d.ts +2 -2
- package/umd/skeleton/elements.js +9 -3
- package/umd/slider/hooks/index.d.ts +1 -1
- package/umd/slider/hooks/useSliderEvents.d.ts +1 -1
- package/umd/stepper/hooks/useValue.d.ts +2 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/tabs/type.d.ts +2 -2
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/index.js +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,29 @@
|
|
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.37.0](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.36.2...@arco-design/mobile-react@2.37.0) (2025-06-17)
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* add new locale "es" and "de" & react 19 compatibility ([#334](https://github.com/arco-design/arco-design-mobile/issues/334)) ([95559a5](https://github.com/arco-design/arco-design-mobile/commit/95559a5f592fdf85c4e79176ddbfe3c93910330f))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
## [2.36.2](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.36.1...@arco-design/mobile-react@2.36.2) (2025-06-06)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* `Carousel` swipping problem after setting "bounceWhenNoLoop" ([#326](https://github.com/arco-design/arco-design-mobile/issues/326)) ([8e5a788](https://github.com/arco-design/arco-design-mobile/commit/8e5a78858ba5398936ed5d6923753adfae46e1e7))
|
23
|
+
* `Form` add change & reset callback ([#325](https://github.com/arco-design/arco-design-mobile/issues/325)) ([16c2ffd](https://github.com/arco-design/arco-design-mobile/commit/16c2ffd9190cb38b1b8df9ca4087b1b0a90e67ff))
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
6
29
|
## [2.36.1](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.36.0...@arco-design/mobile-react@2.36.1) (2025-05-15)
|
7
30
|
|
8
31
|
|
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.36.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.36.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.36.2/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.36.2/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.36.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.36.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.36.2/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.36.2/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/_helpers/hooks.d.ts
CHANGED
@@ -146,7 +146,7 @@ export declare function useLatestRef<T>(variable: T): React.MutableRefObject<T>;
|
|
146
146
|
* const systemWithHarmony = useSystem({ detectHarmony: true });
|
147
147
|
* ```
|
148
148
|
*/
|
149
|
-
export declare function useSystem(options?: SystemOptions): "" | "
|
149
|
+
export declare function useSystem(options?: SystemOptions): "" | "pc" | "android" | "ios" | "harmony";
|
150
150
|
/**
|
151
151
|
* 获取页面视口宽高大小,并在页面有resize时更新大小
|
152
152
|
* @desc {en} Get the width and height of the page viewport, and update the size when the page is resized
|
package/cjs/_helpers/hooks.js
CHANGED
@@ -787,7 +787,7 @@ function useSingleAndDoubleClick(onClick, onDoubleClick, delay) {
|
|
787
787
|
clickTimes = _useState11[0],
|
788
788
|
setClickTimes = _useState11[1];
|
789
789
|
|
790
|
-
var eventRef = (0, _react.useRef)();
|
790
|
+
var eventRef = (0, _react.useRef)(undefined);
|
791
791
|
(0, _react.useEffect)(function () {
|
792
792
|
var timer = setTimeout(function () {
|
793
793
|
if (clickTimes === 1) onClick(eventRef.current);
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
2
|
export interface RootType {
|
3
|
-
render: (
|
3
|
+
render: (element: ReactElement) => void;
|
4
4
|
_unmount: () => void;
|
5
5
|
}
|
6
6
|
export interface RootTypeReact extends RootType {
|
7
7
|
unmount?: () => void;
|
8
8
|
}
|
9
|
-
export declare type CreateRootFnType = (container: Element | DocumentFragment) =>
|
10
|
-
|
11
|
-
|
12
|
-
_unmount: () => void;
|
9
|
+
export declare type CreateRootFnType = (container: Element | DocumentFragment) => {
|
10
|
+
render: (element: ReactElement) => void;
|
11
|
+
unmount?: () => void;
|
13
12
|
};
|
13
|
+
export declare const render: (app: ReactElement, container: Element | DocumentFragment, createRootFunction?: CreateRootFnType | undefined) => RootType;
|
@@ -1,12 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
3
|
exports.__esModule = true;
|
6
4
|
exports.render = void 0;
|
7
5
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
-
|
10
6
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
11
7
|
|
12
8
|
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); }
|
@@ -17,56 +13,77 @@ function isObject(obj) {
|
|
17
13
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
18
14
|
}
|
19
15
|
|
20
|
-
|
16
|
+
// Cast ReactDOM to a version that might have createRoot and other properties
|
17
|
+
var typedReactDOM = ReactDOM;
|
21
18
|
var copyRender;
|
22
|
-
var version = CopyReactDOM.version,
|
23
|
-
reactRender = CopyReactDOM.render,
|
24
|
-
unmountComponentAtNode = CopyReactDOM.unmountComponentAtNode;
|
25
|
-
var isReact18 = Number((version || '').split('.')[0]) > 17;
|
26
19
|
|
27
20
|
var updateUsingClientEntryPoint = function updateUsingClientEntryPoint(skipWarning) {
|
28
21
|
// https://github.com/facebook/react/blob/17806594cc28284fe195f918e8d77de3516848ec/packages/react-dom/npm/client.js#L10
|
29
22
|
// Avoid console warning
|
30
|
-
var
|
23
|
+
var secretInternals = typedReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
31
24
|
|
32
|
-
if (isObject(
|
33
|
-
|
25
|
+
if (isObject(secretInternals)) {
|
26
|
+
secretInternals.usingClientEntryPoint = skipWarning;
|
34
27
|
}
|
35
28
|
};
|
36
29
|
|
37
|
-
var createRoot;
|
38
|
-
|
39
|
-
try {
|
40
|
-
createRoot = CopyReactDOM.createRoot;
|
41
|
-
} catch (_) {}
|
30
|
+
var createRootFn = typedReactDOM.createRoot;
|
42
31
|
|
43
|
-
|
44
|
-
|
32
|
+
var getRender = function getRender(createRootFunction) {
|
33
|
+
return function (app, container) {
|
45
34
|
updateUsingClientEntryPoint(true);
|
46
|
-
var root =
|
35
|
+
var root = createRootFunction(container);
|
47
36
|
updateUsingClientEntryPoint(false);
|
48
37
|
root.render(app);
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
38
|
+
return {
|
39
|
+
render: function render(elementToRender) {
|
40
|
+
root.render(elementToRender);
|
41
|
+
},
|
42
|
+
_unmount: function _unmount() {
|
43
|
+
setTimeout(function () {
|
44
|
+
if (root && typeof root.unmount === 'function') {
|
45
|
+
root.unmount();
|
46
|
+
}
|
47
|
+
});
|
48
|
+
}
|
54
49
|
};
|
55
|
-
|
56
|
-
return root;
|
57
50
|
};
|
58
|
-
}
|
51
|
+
};
|
52
|
+
|
53
|
+
if (createRootFn) {
|
54
|
+
// React 18
|
55
|
+
copyRender = getRender(createRootFn);
|
56
|
+
} else if (typeof typedReactDOM.render === 'function' && typeof typedReactDOM.unmountComponentAtNode === 'function') {
|
57
|
+
// React 16/17
|
59
58
|
copyRender = function copyRender(app, container) {
|
60
|
-
|
59
|
+
typedReactDOM.render(app, container); // Use non-null assertion
|
60
|
+
|
61
61
|
return {
|
62
|
-
render: function render(
|
63
|
-
|
62
|
+
render: function render(elementToRender) {
|
63
|
+
typedReactDOM.render(elementToRender, container); // Use non-null assertion
|
64
64
|
},
|
65
65
|
_unmount: function _unmount() {
|
66
|
-
unmountComponentAtNode(container);
|
66
|
+
typedReactDOM.unmountComponentAtNode(container); // Use non-null assertion
|
67
67
|
}
|
68
68
|
};
|
69
69
|
};
|
70
|
+
} else {
|
71
|
+
copyRender = function copyRender(app, container, createRootFunction) {
|
72
|
+
var defaultCb = function defaultCb() {
|
73
|
+
// Fallback if no rendering method is found
|
74
|
+
console.error('ArcoDesign: ReactDOM.createRoot() or ReactDOM.render() not found. ' + 'This usually means you are using an unsupported version of React, ' + 'or ReactDOM is not properly initialized. ' + 'ArcoDesign Mobile React requires React 16, 17, 18, or 19.');
|
75
|
+
return {
|
76
|
+
render: function render(_element) {},
|
77
|
+
_unmount: function _unmount() {}
|
78
|
+
};
|
79
|
+
};
|
80
|
+
|
81
|
+
if (createRootFunction) {
|
82
|
+
return getRender(createRootFunction)(app, container);
|
83
|
+
}
|
84
|
+
|
85
|
+
return defaultCb();
|
86
|
+
};
|
70
87
|
}
|
71
88
|
|
72
89
|
var render = copyRender;
|
package/cjs/_helpers/render.js
CHANGED
@@ -27,14 +27,17 @@ root // use root in cache
|
|
27
27
|
|
28
28
|
this.render = function (props) {
|
29
29
|
var CustomApp = _this.app;
|
30
|
-
var propsWithContext = (0, _extends2.default)({
|
30
|
+
var propsWithContext = (0, _extends2.default)({
|
31
31
|
context: _this.context
|
32
|
-
});
|
32
|
+
}, props);
|
33
33
|
|
34
34
|
if (_this.root) {
|
35
35
|
_this.root.render( /*#__PURE__*/_react.default.createElement(CustomApp, propsWithContext));
|
36
36
|
} else {
|
37
|
-
|
37
|
+
var _ref = _this.context || {},
|
38
|
+
createRoot = _ref.createRoot;
|
39
|
+
|
40
|
+
_this.root = (0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(CustomApp, propsWithContext), _this.container, createRoot);
|
38
41
|
}
|
39
42
|
};
|
40
43
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { ReactNode, CSSProperties } from 'react';
|
2
|
+
import { Promise } from 'es6-promise';
|
2
3
|
import { PopupProps } from '../popup';
|
3
4
|
import { OpenBaseProps } from '../masking';
|
4
5
|
export interface ActionSheetItemOptions {
|
@@ -86,11 +87,11 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
|
|
86
87
|
* @param {ActionSheetProps} config setting
|
87
88
|
* @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
|
88
89
|
*/
|
89
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "
|
90
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
90
91
|
key?: string | undefined;
|
91
92
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
92
93
|
close: () => void;
|
93
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "
|
94
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
94
95
|
key?: string | undefined;
|
95
96
|
}) => void;
|
96
97
|
};
|
@@ -78,14 +78,14 @@ var ActionSheet = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
78
78
|
}, subTitle) : null) : null, /*#__PURE__*/_react.default.createElement("div", {
|
79
79
|
className: prefixCls + "-action-sheet-list"
|
80
80
|
}, (items || []).map(function (item, index) {
|
81
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
81
|
+
return item.content ? /*#__PURE__*/_react.default.createElement("div", {
|
82
82
|
className: (0, _mobileUtils.cls)(prefixCls + "-action-sheet-item", item.className, item.status || 'normal'),
|
83
83
|
key: index,
|
84
84
|
style: item.style,
|
85
85
|
onClick: function onClick(e) {
|
86
86
|
return handleItemClick(e, item);
|
87
87
|
}
|
88
|
-
}, item.content);
|
88
|
+
}, item.content) : null;
|
89
89
|
})), cancelText ? /*#__PURE__*/_react.default.createElement("div", {
|
90
90
|
className: prefixCls + "-action-sheet-item cancel-item",
|
91
91
|
onClick: function onClick(e) {
|
package/cjs/carousel/index.js
CHANGED
@@ -699,12 +699,6 @@ var Carousel = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
699
699
|
|
700
700
|
stopPropagation && e.stopPropagation();
|
701
701
|
|
702
|
-
if (bouncingRef.current) {
|
703
|
-
bouncingRef.current = false;
|
704
|
-
jumpTo(index, false);
|
705
|
-
return;
|
706
|
-
}
|
707
|
-
|
708
702
|
if (!touchStartedRef.current) {
|
709
703
|
return;
|
710
704
|
}
|
@@ -716,7 +710,14 @@ var Carousel = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
716
710
|
return;
|
717
711
|
}
|
718
712
|
|
719
|
-
touchMovedRef.current = false;
|
713
|
+
touchMovedRef.current = false; // bugfix: 回弹判断逻辑需在touchMovedRef标识重置逻辑之后,否则会在触发回弹后导致标识无法重置引起滑动判断问题
|
714
|
+
// @en bugfix: The logic for the bounce judgment needs to be after the touchMovedRef reset logic, otherwise it will cause the problem of slide judgment after the bounce is triggered.
|
715
|
+
|
716
|
+
if (bouncingRef.current) {
|
717
|
+
bouncingRef.current = false;
|
718
|
+
jumpTo(index, false);
|
719
|
+
return;
|
720
|
+
}
|
720
721
|
|
721
722
|
if (posAdjustingRef.current || touchStoppedRef.current) {
|
722
723
|
return;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { CheckboxProps, CheckboxRef } from './type';
|
3
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps<
|
3
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps<React.ReactText> & React.RefAttributes<CheckboxRef>>;
|
package/cjs/checkbox/group.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { GroupContextParams, CheckboxGroupProps, CheckboxGroupRef, ValueType, CheckboxProps, CheckboxRef } from './type';
|
3
|
-
export declare const CheckboxGroupContext: React.Context<GroupContextParams<
|
3
|
+
export declare const CheckboxGroupContext: React.Context<GroupContextParams<React.ReactText>>;
|
4
4
|
export declare function componentGenerator<T extends ValueType = ValueType, P extends CheckboxProps<T> = CheckboxProps<T>, R extends CheckboxRef = CheckboxRef>(Comp: React.ForwardRefExoticComponent<P & React.RefAttributes<R>>): React.ForwardRefExoticComponent<CheckboxGroupProps<T, P> & React.RefAttributes<CheckboxGroupRef>>;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { CheckboxProps, GroupContextParams, ValueType } from '../type';
|
3
|
-
export declare const useMergeProps: <T extends
|
3
|
+
export declare const useMergeProps: <T extends React.ReactText = React.ReactText, P extends CheckboxProps<T> = CheckboxProps<T>>(props: P, groupContext: React.Context<GroupContextParams<ValueType>>) => P;
|
package/cjs/checkbox/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
export * from './type';
|
3
|
-
declare const _default: import("react").ForwardRefExoticComponent<import("./type").CheckboxProps<
|
4
|
-
Group: import("react").ForwardRefExoticComponent<import("./type").CheckboxGroupProps<
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<import("./type").CheckboxProps<import("react").ReactText> & import("react").RefAttributes<import("./type").CheckboxRef>> & {
|
4
|
+
Group: import("react").ForwardRefExoticComponent<import("./type").CheckboxGroupProps<import("react").ReactText, import("./type").CheckboxProps<import("react").ReactText> & import("react").RefAttributes<import("./type").CheckboxRef>> & import("react").RefAttributes<import("./type").CheckboxGroupRef>> & {
|
5
5
|
displayName?: string | undefined;
|
6
6
|
};
|
7
7
|
} & {
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { Attributes } from 'react';
|
2
2
|
import { ILocale } from '@arco-design/mobile-utils';
|
3
|
+
import { CreateRootFnType } from '../_helpers';
|
3
4
|
export interface GlobalContextParams {
|
4
5
|
/**
|
5
6
|
* 组件类名前缀
|
@@ -52,6 +53,11 @@ export interface GlobalContextParams {
|
|
52
53
|
* @en Triggered when the system's native dark mode changes, valid when useDarkMode=true
|
53
54
|
*/
|
54
55
|
onDarkModeChange?: (isDark: boolean) => void;
|
56
|
+
/**
|
57
|
+
* React19 修改了 createRoot 的引入路径,导致组件内部无法直接引入(低react版本会找不到模块)。因此使用 react 19 的用户需从外部传入 createRoot 方法
|
58
|
+
* @en Users using react 19 need to pass in the createRoot method from outside
|
59
|
+
*/
|
60
|
+
createRoot?: CreateRootFnType;
|
55
61
|
}
|
56
62
|
export declare const defaultContext: GlobalContextParams;
|
57
63
|
export declare const GlobalContext: React.Context<GlobalContextParams>;
|
@@ -71,4 +77,4 @@ export declare type WithGlobalContext<T> = T & {
|
|
71
77
|
*/
|
72
78
|
export default function ContextProvider(props: ContextProviderProps): JSX.Element;
|
73
79
|
export declare const ContextLayout: React.Consumer<GlobalContextParams>;
|
74
|
-
export declare function CompWithGlobalContext<P extends
|
80
|
+
export declare function CompWithGlobalContext<P extends Attributes>(Component: React.FunctionComponent<P>): (props: WithGlobalContext<P>) => JSX.Element;
|
package/cjs/count-down/hooks.js
CHANGED
@@ -13,8 +13,8 @@ var _util = require("./util");
|
|
13
13
|
|
14
14
|
var useCountDown = function useCountDown(options) {
|
15
15
|
var taskIdRef = (0, _react.useRef)(0);
|
16
|
-
var endTimeRef = (0, _react.useRef)();
|
17
|
-
var countingRef = (0, _react.useRef)();
|
16
|
+
var endTimeRef = (0, _react.useRef)(undefined);
|
17
|
+
var countingRef = (0, _react.useRef)(undefined);
|
18
18
|
|
19
19
|
var _useRefState = (0, _helpers.useRefState)(options.time),
|
20
20
|
remain = _useRefState[0],
|
package/cjs/dialog/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { ILocale } from '@arco-design/mobile-utils';
|
3
|
+
import { Promise } from 'es6-promise';
|
3
4
|
import { MaskingCommonProps, MaskingRef, OpenBaseProps } from '../masking';
|
4
5
|
export * from './methods';
|
5
6
|
export interface FooterButtonOptions {
|
@@ -130,7 +131,11 @@ export interface ConfirmOptions extends AlertOptions {
|
|
130
131
|
* */
|
131
132
|
cancelText?: ReactNode;
|
132
133
|
}
|
133
|
-
export declare function methodsGenerator<P extends OpenBaseProps, A
|
134
|
+
export declare function methodsGenerator<P extends OpenBaseProps, A extends {
|
135
|
+
key?: string;
|
136
|
+
} = AlertOptions, C extends {
|
137
|
+
key?: string;
|
138
|
+
} = ConfirmOptions>(Comp: React.FunctionComponent<P>): {
|
134
139
|
/**
|
135
140
|
* 打开确认框(含一个确认按钮)
|
136
141
|
* @desc {en} Open a confirmation dialog (with a confirmation button)
|
@@ -193,11 +198,11 @@ declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefA
|
|
193
198
|
* @param {DialogProps} config Configuration
|
194
199
|
* @returns {{ close: () => void; update: (newConfig: DialogProps) => void; }}
|
195
200
|
*/
|
196
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "
|
201
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "ref" | "className" | "footer" | "title" | "children" | "context" | "key" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "platform" | "extra"> & {
|
197
202
|
key?: string | undefined;
|
198
203
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
199
204
|
close: () => void;
|
200
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "
|
205
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<DialogProps & React.RefAttributes<DialogRef>>, "ref" | "className" | "footer" | "title" | "children" | "context" | "key" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "footerType" | "renderFooter" | "footerCollapseCount" | "titleAlign" | "contentAlign" | "platform" | "extra"> & {
|
201
206
|
key?: string | undefined;
|
202
207
|
}) => void;
|
203
208
|
};
|
package/cjs/dialog/methods.d.ts
CHANGED
@@ -2,11 +2,15 @@ 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
|
5
|
+
export declare function alert<AlertOptions extends {
|
6
|
+
key?: string;
|
7
|
+
}, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: AlertOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
6
8
|
close: () => void;
|
7
9
|
update: (newConfig: AlertOptions) => void;
|
8
10
|
};
|
9
|
-
export declare function confirm<ConfirmOptions
|
11
|
+
export declare function confirm<ConfirmOptions extends {
|
12
|
+
key?: string;
|
13
|
+
}, P extends OpenBaseProps>(Component: React.FunctionComponent<P>, normalize?: <T, Props>(config: T) => Props): (config: ConfirmOptions, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
10
14
|
close: () => void;
|
11
15
|
update: (newConfig: ConfirmOptions) => void;
|
12
16
|
};
|
@@ -20,13 +20,13 @@ export declare function isCascadeArray(options: string[] | OptionsItem[][] | Cas
|
|
20
20
|
* */
|
21
21
|
export declare const getFormattedOptions: (options: OptionsItem[][] | string[] | CascadeOptions[], currentValues: ValueType) => {
|
22
22
|
formattedOptions: OptionsItem[][];
|
23
|
-
formattedValue: (string | number |
|
23
|
+
formattedValue: (string | number | React.ReactText[])[];
|
24
24
|
};
|
25
25
|
/**
|
26
26
|
* 判断是否为指定ref内的元素
|
27
27
|
* @en Determine whether it is an element within the specified ref
|
28
28
|
*/
|
29
|
-
export declare const isRefDom: (dom: any, ref: React.RefObject<HTMLDivElement>) => boolean;
|
29
|
+
export declare const isRefDom: (dom: any, ref: React.RefObject<HTMLDivElement | null>) => boolean;
|
30
30
|
/**
|
31
31
|
* 判断是否为指定类名下的元素
|
32
32
|
* @en Determine whether it is an element under the specified classname
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
2
|
import { NativeEllipsisProps } from '../type';
|
3
3
|
declare function NativeEllipsis({ prefixCls, ellipsis, dangerouslyUseInnerHTML, text, maxLine, ellipsisNode, collapseNode, onEllipsisNodeClick, onCollapseNodeClick, }: NativeEllipsisProps): JSX.Element;
|
4
|
-
|
5
|
-
export default _default;
|
4
|
+
export default NativeEllipsis;
|
package/cjs/form/form-item.d.ts
CHANGED
@@ -1,4 +1,35 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import {
|
1
|
+
import React, { PureComponent, ReactNode } from 'react';
|
2
|
+
import { Promise } from 'es6-promise';
|
3
|
+
import { FormItemContext } from './form-item-context';
|
4
|
+
import { IFieldError, FieldValue, IFormItemInnerProps, FormItemProps, ValidateStatus, FormItemRef, ValueChangeType, IFormItemContext } from './type';
|
5
|
+
interface IFormItemInnerState {
|
6
|
+
validateStatus: ValidateStatus;
|
7
|
+
errors?: ReactNode[];
|
8
|
+
_touched: boolean;
|
9
|
+
}
|
10
|
+
declare class FormItemInner extends PureComponent<IFormItemInnerProps, IFormItemInnerState> {
|
11
|
+
context: React.ContextType<typeof FormItemContext>;
|
12
|
+
destroyField: () => void;
|
13
|
+
private _errors;
|
14
|
+
private _touched;
|
15
|
+
constructor(props: IFormItemInnerProps, context: IFormItemContext);
|
16
|
+
componentDidMount(): void;
|
17
|
+
componentWillUnmount(): void;
|
18
|
+
onValueChange: (curValue: FieldValue, preValue: any, info?: {
|
19
|
+
changeType: ValueChangeType;
|
20
|
+
} | undefined) => void;
|
21
|
+
getInitialValue: () => any;
|
22
|
+
getFieldError: () => React.ReactNode[];
|
23
|
+
isFieldTouched: () => boolean;
|
24
|
+
getAllRuleValidateTriggers: () => string[];
|
25
|
+
validateField: (validateTrigger?: string | undefined) => Promise<IFieldError>;
|
26
|
+
setFieldData: (value: FieldValue) => void;
|
27
|
+
innerTriggerFunctionWithValueFirst: (value: any, ...args: any[]) => void;
|
28
|
+
innerOnInputFunction: (_: any, value: any, ...args: any[]) => void;
|
29
|
+
innerClearFunction: (...args: any[]) => void;
|
30
|
+
renderChildren(): React.FunctionComponentElement<any>;
|
31
|
+
render(): React.FunctionComponentElement<any>;
|
32
|
+
}
|
33
|
+
export { FormItemInner };
|
3
34
|
declare const _default: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<FormItemRef>>;
|
4
35
|
export default _default;
|