antd-mobile 5.11.2 → 5.12.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/2x/cjs/components/calendar/calendar.d.ts +4 -0
- package/2x/cjs/components/calendar/calendar.js +13 -9
- package/2x/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
- package/2x/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/2x/cjs/components/cascade-picker/cascade-picker.js +8 -4
- package/2x/cjs/components/cascade-picker/index.d.ts +4 -2
- package/2x/cjs/components/date-picker/date-picker.d.ts +18 -4
- package/2x/cjs/components/date-picker/date-picker.js +5 -6
- package/2x/cjs/components/date-picker/index.d.ts +15 -2
- package/2x/cjs/components/dialog/dialog.d.ts +2 -1
- package/2x/cjs/components/dialog/dialog.js +2 -2
- package/2x/cjs/components/dropdown/dropdown.css +1 -1
- package/2x/cjs/components/error-block/images/busy.d.ts +1 -0
- package/2x/cjs/components/error-block/images/default.d.ts +1 -0
- package/2x/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/cjs/components/error-block/images/empty.d.ts +1 -0
- package/2x/cjs/components/form/form-item.d.ts +2 -1
- package/2x/cjs/components/form/form-item.js +21 -4
- package/2x/cjs/components/form/utils.d.ts +1 -0
- package/2x/cjs/components/form/utils.js +20 -0
- package/2x/cjs/components/image/image.d.ts +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -2
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/input/input.js +1 -0
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/2x/cjs/components/list/list.css +1 -0
- package/2x/cjs/components/mask/mask.js +1 -1
- package/2x/cjs/components/modal/modal.d.ts +2 -1
- package/2x/cjs/components/modal/modal.js +2 -2
- package/2x/cjs/components/picker/index.d.ts +44 -3
- package/2x/cjs/components/picker/picker.d.ts +32 -2
- package/2x/cjs/components/picker/picker.js +43 -16
- package/2x/cjs/components/popup/popup.d.ts +2 -1
- package/2x/cjs/components/popup/popup.js +1 -1
- package/2x/cjs/components/search-bar/search-bar.js +2 -8
- package/2x/cjs/components/swipe-action/swipe-action.js +1 -1
- package/2x/cjs/components/tabs/tabs.css +5 -3
- package/2x/cjs/components/tabs/tabs.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +4 -1
- package/2x/cjs/components/toast/methods.js +3 -7
- package/2x/cjs/components/toast/toast.d.ts +2 -1
- package/2x/cjs/utils/render-to-body.js +3 -6
- package/2x/cjs/utils/render.d.ts +9 -0
- package/2x/cjs/utils/render.js +92 -0
- package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/cjs/utils/use-props-value.d.ts +1 -1
- package/2x/es/components/calendar/calendar.d.ts +4 -0
- package/2x/es/components/calendar/calendar.js +13 -9
- package/2x/es/components/capsule-tabs/capsule-tabs.css +1 -0
- package/2x/es/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/2x/es/components/cascade-picker/cascade-picker.js +4 -3
- package/2x/es/components/cascade-picker/index.d.ts +4 -2
- package/2x/es/components/date-picker/date-picker.d.ts +18 -4
- package/2x/es/components/date-picker/date-picker.js +6 -5
- package/2x/es/components/date-picker/index.d.ts +15 -2
- package/2x/es/components/dialog/dialog.d.ts +2 -1
- package/2x/es/components/dialog/dialog.js +2 -2
- package/2x/es/components/dropdown/dropdown.css +1 -1
- package/2x/es/components/error-block/images/busy.d.ts +1 -0
- package/2x/es/components/error-block/images/default.d.ts +1 -0
- package/2x/es/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/es/components/error-block/images/empty.d.ts +1 -0
- package/2x/es/components/form/form-item.d.ts +2 -1
- package/2x/es/components/form/form-item.js +23 -4
- package/2x/es/components/form/utils.d.ts +1 -0
- package/2x/es/components/form/utils.js +17 -0
- package/2x/es/components/image/image.d.ts +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +1 -2
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/input/input.js +1 -0
- package/2x/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/2x/es/components/list/list.css +1 -0
- package/2x/es/components/mask/mask.js +1 -1
- package/2x/es/components/modal/modal.d.ts +2 -1
- package/2x/es/components/modal/modal.js +2 -2
- package/2x/es/components/picker/index.d.ts +44 -3
- package/2x/es/components/picker/picker.d.ts +32 -2
- package/2x/es/components/picker/picker.js +42 -17
- package/2x/es/components/popup/popup.d.ts +2 -1
- package/2x/es/components/popup/popup.js +1 -1
- package/2x/es/components/search-bar/search-bar.js +2 -8
- package/2x/es/components/swipe-action/swipe-action.js +1 -1
- package/2x/es/components/tabs/tabs.css +5 -3
- package/2x/es/components/tabs/tabs.d.ts +1 -1
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +4 -2
- package/2x/es/components/toast/methods.js +3 -3
- package/2x/es/components/toast/toast.d.ts +2 -1
- package/2x/es/utils/render-to-body.js +3 -3
- package/2x/es/utils/render.d.ts +9 -0
- package/2x/es/utils/render.js +77 -0
- package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/es/utils/use-props-value.d.ts +1 -1
- package/2x/package.json +9 -14
- package/bundle/antd-mobile.cjs.js +5053 -4310
- package/bundle/antd-mobile.es.js +5055 -4312
- package/bundle/style.css +9 -4
- package/cjs/components/calendar/calendar.d.ts +4 -0
- package/cjs/components/calendar/calendar.js +13 -9
- package/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
- package/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/cjs/components/cascade-picker/cascade-picker.js +8 -4
- package/cjs/components/cascade-picker/index.d.ts +4 -2
- package/cjs/components/date-picker/date-picker.d.ts +18 -4
- package/cjs/components/date-picker/date-picker.js +5 -6
- package/cjs/components/date-picker/index.d.ts +15 -2
- package/cjs/components/dialog/dialog.d.ts +2 -1
- package/cjs/components/dialog/dialog.js +2 -2
- package/cjs/components/dropdown/dropdown.css +1 -1
- package/cjs/components/error-block/images/busy.d.ts +1 -0
- package/cjs/components/error-block/images/default.d.ts +1 -0
- package/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/cjs/components/error-block/images/empty.d.ts +1 -0
- package/cjs/components/form/form-item.d.ts +2 -1
- package/cjs/components/form/form-item.js +21 -4
- package/cjs/components/form/utils.d.ts +1 -0
- package/cjs/components/form/utils.js +20 -0
- package/cjs/components/image/image.d.ts +1 -1
- package/cjs/components/image-uploader/image-uploader.js +1 -2
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/input/input.js +1 -0
- package/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/cjs/components/list/list.css +1 -0
- package/cjs/components/mask/mask.js +1 -1
- package/cjs/components/modal/modal.d.ts +2 -1
- package/cjs/components/modal/modal.js +2 -2
- package/cjs/components/picker/index.d.ts +44 -3
- package/cjs/components/picker/picker.d.ts +32 -2
- package/cjs/components/picker/picker.js +43 -16
- package/cjs/components/popup/popup.d.ts +2 -1
- package/cjs/components/popup/popup.js +1 -1
- package/cjs/components/search-bar/search-bar.js +2 -8
- package/cjs/components/swipe-action/swipe-action.js +1 -1
- package/cjs/components/tabs/tabs.css +5 -3
- package/cjs/components/tabs/tabs.d.ts +1 -1
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +4 -1
- package/cjs/components/toast/methods.js +3 -7
- package/cjs/components/toast/toast.d.ts +2 -1
- package/cjs/utils/render-to-body.js +3 -6
- package/cjs/utils/render.d.ts +9 -0
- package/cjs/utils/render.js +92 -0
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/cjs/utils/use-props-value.d.ts +1 -1
- package/es/components/calendar/calendar.d.ts +4 -0
- package/es/components/calendar/calendar.js +13 -9
- package/es/components/capsule-tabs/capsule-tabs.css +1 -0
- package/es/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/es/components/cascade-picker/cascade-picker.js +4 -3
- package/es/components/cascade-picker/index.d.ts +4 -2
- package/es/components/date-picker/date-picker.d.ts +18 -4
- package/es/components/date-picker/date-picker.js +6 -5
- package/es/components/date-picker/index.d.ts +15 -2
- package/es/components/dialog/dialog.d.ts +2 -1
- package/es/components/dialog/dialog.js +2 -2
- package/es/components/dropdown/dropdown.css +1 -1
- package/es/components/error-block/images/busy.d.ts +1 -0
- package/es/components/error-block/images/default.d.ts +1 -0
- package/es/components/error-block/images/disconnected.d.ts +1 -0
- package/es/components/error-block/images/empty.d.ts +1 -0
- package/es/components/form/form-item.d.ts +2 -1
- package/es/components/form/form-item.js +23 -4
- package/es/components/form/utils.d.ts +1 -0
- package/es/components/form/utils.js +17 -0
- package/es/components/image/image.d.ts +1 -1
- package/es/components/image-uploader/image-uploader.js +1 -2
- package/es/components/input/input.d.ts +2 -2
- package/es/components/input/input.js +1 -0
- package/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/es/components/list/list.css +1 -0
- package/es/components/mask/mask.js +1 -1
- package/es/components/modal/modal.d.ts +2 -1
- package/es/components/modal/modal.js +2 -2
- package/es/components/picker/index.d.ts +44 -3
- package/es/components/picker/picker.d.ts +32 -2
- package/es/components/picker/picker.js +42 -17
- package/es/components/popup/popup.d.ts +2 -1
- package/es/components/popup/popup.js +1 -1
- package/es/components/search-bar/search-bar.js +2 -8
- package/es/components/swipe-action/swipe-action.js +1 -1
- package/es/components/tabs/tabs.css +5 -3
- package/es/components/tabs/tabs.d.ts +1 -1
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +4 -2
- package/es/components/toast/methods.js +3 -3
- package/es/components/toast/toast.d.ts +2 -1
- package/es/utils/render-to-body.js +3 -3
- package/es/utils/render.d.ts +9 -0
- package/es/utils/render.js +77 -0
- package/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/es/utils/use-props-value.d.ts +1 -1
- package/package.json +9 -14
- package/umd/antd-mobile.js +1 -1
|
@@ -52,7 +52,7 @@ export const SearchBar = forwardRef((p, ref) => {
|
|
|
52
52
|
}));
|
|
53
53
|
|
|
54
54
|
const renderCancelButton = () => {
|
|
55
|
-
let isShowCancel
|
|
55
|
+
let isShowCancel;
|
|
56
56
|
|
|
57
57
|
if (typeof props.showCancelButton === 'function') {
|
|
58
58
|
isShowCancel = props.showCancelButton(hasFocus, value);
|
|
@@ -61,13 +61,7 @@ export const SearchBar = forwardRef((p, ref) => {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
return isShowCancel && React.createElement("div", {
|
|
64
|
-
className: `${classPrefix}-suffix
|
|
65
|
-
onMouseDown: e => {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
},
|
|
68
|
-
onTouchStart: e => {
|
|
69
|
-
e.preventDefault();
|
|
70
|
-
}
|
|
64
|
+
className: `${classPrefix}-suffix`
|
|
71
65
|
}, React.createElement(Button, {
|
|
72
66
|
fill: 'none',
|
|
73
67
|
className: `${classPrefix}-cancel-button`,
|
|
@@ -185,7 +185,7 @@ export const SwipeAction = forwardRef((p, ref) => {
|
|
|
185
185
|
}
|
|
186
186
|
}, React.createElement(animated.div, {
|
|
187
187
|
style: {
|
|
188
|
-
pointerEvents: x.to(v => v !== 0 && x.goal !== 0 ? 'none' : '
|
|
188
|
+
pointerEvents: x.to(v => v !== 0 && x.goal !== 0 ? 'none' : 'auto')
|
|
189
189
|
}
|
|
190
190
|
}, props.children)), withStopPropagation(props.stopPropagation, React.createElement("div", {
|
|
191
191
|
className: 'adm-swipe-action-actions adm-swipe-action-actions-right',
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
--content-padding: 12px;
|
|
4
4
|
--active-line-height: 2px;
|
|
5
5
|
--active-line-border-radius: var(--active-line-height);
|
|
6
|
+
--active-line-color: var(--adm-color-primary);
|
|
7
|
+
--active-title-color: var(--adm-color-primary);
|
|
6
8
|
position: relative;
|
|
9
|
+
min-width: 0;
|
|
7
10
|
}
|
|
8
11
|
.adm-tabs-header {
|
|
9
12
|
position: relative;
|
|
@@ -37,7 +40,7 @@
|
|
|
37
40
|
cursor: pointer;
|
|
38
41
|
}
|
|
39
42
|
.adm-tabs-tab-active {
|
|
40
|
-
color: var(--
|
|
43
|
+
color: var(--active-title-color);
|
|
41
44
|
}
|
|
42
45
|
.adm-tabs-tab-disabled {
|
|
43
46
|
opacity: 0.5;
|
|
@@ -47,8 +50,7 @@
|
|
|
47
50
|
position: absolute;
|
|
48
51
|
bottom: 0;
|
|
49
52
|
height: var(--active-line-height);
|
|
50
|
-
|
|
51
|
-
background: var(--adm-color-primary);
|
|
53
|
+
background: var(--active-line-color);
|
|
52
54
|
border-radius: var(--active-line-border-radius);
|
|
53
55
|
}
|
|
54
56
|
.adm-tabs-content {
|
|
@@ -15,5 +15,5 @@ export declare type TabsProps = {
|
|
|
15
15
|
stretch?: boolean;
|
|
16
16
|
onChange?: (key: string) => void;
|
|
17
17
|
children?: React.ReactNode;
|
|
18
|
-
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding'>;
|
|
18
|
+
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
|
|
19
19
|
export declare const Tabs: FC<TabsProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
|
-
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'name' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
|
|
5
5
|
onChange?: (val: string) => void;
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
|
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
22
|
};
|
|
23
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { forwardRef,
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
2
|
+
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
2
3
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
4
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
4
5
|
import { mergeProps } from '../../utils/with-default-props';
|
|
@@ -41,7 +42,7 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
41
42
|
(_a = nativeTextAreaRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
42
43
|
}
|
|
43
44
|
}));
|
|
44
|
-
|
|
45
|
+
useIsomorphicLayoutEffect(() => {
|
|
45
46
|
if (!autoSize) return;
|
|
46
47
|
const textArea = nativeTextAreaRef.current;
|
|
47
48
|
if (!textArea) return;
|
|
@@ -114,6 +115,7 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
114
115
|
autoFocus: props.autoFocus,
|
|
115
116
|
disabled: props.disabled,
|
|
116
117
|
readOnly: props.readOnly,
|
|
118
|
+
name: props.name,
|
|
117
119
|
onFocus: props.onFocus,
|
|
118
120
|
onBlur: props.onBlur,
|
|
119
121
|
onClick: props.onClick
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { createRef, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
2
2
|
import { resolveContainer } from '../../utils/get-container';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
3
|
import { InternalToast } from './toast';
|
|
5
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
5
|
+
import { render, unmount as reactUnmount } from '../../utils/render';
|
|
6
6
|
const containers = [];
|
|
7
7
|
|
|
8
8
|
function unmount(container) {
|
|
9
|
-
const unmountResult =
|
|
9
|
+
const unmountResult = reactUnmount(container);
|
|
10
10
|
|
|
11
11
|
if (unmountResult && container.parentNode) {
|
|
12
12
|
container.parentNode.removeChild(container);
|
|
@@ -64,7 +64,7 @@ export function show(p) {
|
|
|
64
64
|
}));
|
|
65
65
|
});
|
|
66
66
|
const ref = createRef();
|
|
67
|
-
|
|
67
|
+
render(React.createElement(TempToast, {
|
|
68
68
|
ref: ref
|
|
69
69
|
}), container);
|
|
70
70
|
return {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { MaskProps } from '../mask';
|
|
2
3
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
export interface ToastProps {
|
|
5
6
|
afterClose?: () => void;
|
|
6
|
-
maskStyle?:
|
|
7
|
+
maskStyle?: MaskProps['style'];
|
|
7
8
|
maskClassName?: string;
|
|
8
9
|
maskClickable?: boolean;
|
|
9
10
|
content?: ReactNode;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { render, unmount as reactUnmount } from './render';
|
|
2
2
|
export function renderToBody(element) {
|
|
3
3
|
const container = document.createElement('div');
|
|
4
4
|
document.body.appendChild(container);
|
|
5
5
|
|
|
6
6
|
function unmount() {
|
|
7
|
-
const unmountResult =
|
|
7
|
+
const unmountResult = reactUnmount(container);
|
|
8
8
|
|
|
9
9
|
if (unmountResult && container.parentNode) {
|
|
10
10
|
container.parentNode.removeChild(container);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
render(element, container);
|
|
15
15
|
return unmount;
|
|
16
16
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
declare const MARK = "__antd_mobile_root__";
|
|
4
|
+
declare type ContainerType = (Element | DocumentFragment) & {
|
|
5
|
+
[MARK]?: Root;
|
|
6
|
+
};
|
|
7
|
+
export declare function render(node: ReactElement, container: ContainerType): void;
|
|
8
|
+
export declare function unmount(container: ContainerType): boolean | Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import * as ReactDOM from 'react-dom'; // Let compiler not to search module usage
|
|
3
|
+
|
|
4
|
+
const fullClone = Object.assign({}, ReactDOM);
|
|
5
|
+
const {
|
|
6
|
+
version,
|
|
7
|
+
render: reactRender,
|
|
8
|
+
unmountComponentAtNode
|
|
9
|
+
} = fullClone;
|
|
10
|
+
let createRoot;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const mainVersion = Number((version || '').split('.')[0]);
|
|
14
|
+
|
|
15
|
+
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
17
|
+
createRoot = fullClone.createRoot;
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {// Do nothing;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function toggleWarning(skip) {
|
|
23
|
+
const {
|
|
24
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
25
|
+
} = fullClone;
|
|
26
|
+
|
|
27
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
|
|
28
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const MARK = '__antd_mobile_root__';
|
|
33
|
+
|
|
34
|
+
function legacyRender(node, container) {
|
|
35
|
+
reactRender(node, container);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function concurrentRender(node, container) {
|
|
39
|
+
toggleWarning(true);
|
|
40
|
+
const root = container[MARK] || createRoot(container);
|
|
41
|
+
toggleWarning(false);
|
|
42
|
+
root.render(node);
|
|
43
|
+
container[MARK] = root;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function render(node, container) {
|
|
47
|
+
if (createRoot) {
|
|
48
|
+
concurrentRender(node, container);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
legacyRender(node, container);
|
|
53
|
+
} // ========================== Unmount =========================
|
|
54
|
+
|
|
55
|
+
function legacyUnmount(container) {
|
|
56
|
+
return unmountComponentAtNode(container);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function concurrentUnmount(container) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
// Delay to unmount to avoid React 18 sync warning
|
|
62
|
+
return Promise.resolve().then(() => {
|
|
63
|
+
var _a;
|
|
64
|
+
|
|
65
|
+
(_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
66
|
+
delete container[MARK];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function unmount(container) {
|
|
72
|
+
if (createRoot) {
|
|
73
|
+
return concurrentUnmount(container);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return legacyUnmount(container);
|
|
77
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?:
|
|
1
|
+
export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react").ReactDOMAttributes;
|
|
@@ -4,5 +4,5 @@ declare type Options<T> = {
|
|
|
4
4
|
defaultValue: T;
|
|
5
5
|
onChange?: (v: T) => void;
|
|
6
6
|
};
|
|
7
|
-
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (
|
|
7
|
+
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: SetStateAction<T>) => void];
|
|
8
8
|
export {};
|
package/package.json
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.2",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@floating-ui/dom": "^0.4.
|
|
6
|
-
"@react-spring/web": "^9.4.
|
|
7
|
-
"@
|
|
8
|
-
"
|
|
9
|
-
"@types/react-virtualized": "^9.21.21",
|
|
10
|
-
"@types/resize-observer-browser": "^0.1.7",
|
|
11
|
-
"@use-gesture/react": "^10.2.10",
|
|
12
|
-
"ahooks": "^3.1.14",
|
|
5
|
+
"@floating-ui/dom": "^0.4.5",
|
|
6
|
+
"@react-spring/web": "^9.4.5",
|
|
7
|
+
"@use-gesture/react": "^10.2.12",
|
|
8
|
+
"ahooks": "^3.3.10",
|
|
13
9
|
"antd-mobile-icons": "^0.2.2",
|
|
14
10
|
"antd-mobile-v5-count": "^1.0.1",
|
|
15
11
|
"big.js": "^6.1.1",
|
|
16
12
|
"classnames": "^2.3.1",
|
|
17
|
-
"dayjs": "^1.11.
|
|
13
|
+
"dayjs": "^1.11.2",
|
|
18
14
|
"lodash": "^4.17.21",
|
|
19
|
-
"rc-field-form": "^1.26.
|
|
15
|
+
"rc-field-form": "^1.26.4",
|
|
20
16
|
"react-is": "^17.0.2",
|
|
21
17
|
"staged-components": "^1.1.2",
|
|
22
18
|
"tslib": "^2.3.1"
|
|
23
19
|
},
|
|
24
20
|
"peerDependencies": {
|
|
25
|
-
"react": "^16.8.0 || ^17.0.0"
|
|
21
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
26
22
|
},
|
|
27
23
|
"main": "./cjs/index.js",
|
|
28
24
|
"module": "./es/index.js",
|
|
@@ -43,6 +39,5 @@
|
|
|
43
39
|
"url": "git+https://github.com/ant-design/ant-design-mobile.git",
|
|
44
40
|
"branch": "master",
|
|
45
41
|
"platform": "github"
|
|
46
|
-
}
|
|
47
|
-
"packageManager": "yarn@3.2.0"
|
|
42
|
+
}
|
|
48
43
|
}
|