antd-mobile 5.28.1 → 5.28.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/bundle/antd-mobile.cjs.development.js +147 -125
- package/2x/bundle/antd-mobile.cjs.js +10 -9
- package/2x/bundle/antd-mobile.es.development.js +147 -125
- package/2x/bundle/antd-mobile.es.js +7276 -7250
- package/2x/bundle/antd-mobile.umd.development.js +147 -125
- package/2x/bundle/antd-mobile.umd.js +10 -9
- package/2x/bundle/css-vars-patch.css +1 -0
- package/2x/bundle/style.css +9 -1
- package/2x/cjs/components/popover/popover.css +1 -1
- package/2x/cjs/components/popover/popover.patch.css +1 -0
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/2x/cjs/components/stepper/index.d.ts +1 -1
- package/2x/cjs/components/stepper/stepper.d.ts +4 -2
- package/2x/cjs/components/stepper/stepper.js +21 -3
- package/2x/cjs/components/text-area/text-area.css +8 -0
- package/2x/cjs/components/text-area/text-area.js +12 -2
- package/2x/cjs/global/css-vars-patch.css +1 -0
- package/2x/cjs/index.d.ts +1 -1
- package/2x/cjs/locales/ko-KR.js +31 -2
- package/2x/cjs/utils/reduce-and-restore-motion.js +7 -6
- package/2x/cjs/utils/render-imperatively.js +9 -3
- package/2x/es/components/popover/popover.css +1 -1
- package/2x/es/components/popover/popover.patch.css +1 -0
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/2x/es/components/stepper/index.d.ts +1 -1
- package/2x/es/components/stepper/stepper.d.ts +4 -2
- package/2x/es/components/stepper/stepper.js +19 -3
- package/2x/es/components/text-area/text-area.css +8 -0
- package/2x/es/components/text-area/text-area.js +12 -2
- package/2x/es/global/css-vars-patch.css +1 -0
- package/2x/es/index.d.ts +1 -1
- package/2x/es/locales/ko-KR.js +31 -2
- package/2x/es/utils/reduce-and-restore-motion.js +7 -6
- package/2x/es/utils/render-imperatively.js +9 -3
- package/2x/package.json +2 -2
- package/bundle/antd-mobile.cjs.development.js +147 -125
- package/bundle/antd-mobile.cjs.js +10 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +147 -125
- package/bundle/antd-mobile.es.js +7276 -7250
- package/bundle/antd-mobile.umd.development.js +147 -125
- package/bundle/antd-mobile.umd.js +10 -9
- package/bundle/css-vars-patch.css +1 -0
- package/bundle/style.css +1 -1
- package/cjs/components/popover/popover.css +1 -1
- package/cjs/components/popover/popover.patch.css +1 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/cjs/components/stepper/index.d.ts +1 -1
- package/cjs/components/stepper/stepper.d.ts +4 -2
- package/cjs/components/stepper/stepper.js +21 -3
- package/cjs/components/text-area/text-area.css +7 -0
- package/cjs/components/text-area/text-area.js +12 -2
- package/cjs/global/css-vars-patch.css +1 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/locales/ko-KR.js +31 -2
- package/cjs/utils/reduce-and-restore-motion.js +7 -6
- package/cjs/utils/render-imperatively.js +9 -3
- package/es/components/popover/popover.css +1 -1
- package/es/components/popover/popover.patch.css +1 -0
- package/es/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/es/components/stepper/index.d.ts +1 -1
- package/es/components/stepper/stepper.d.ts +4 -2
- package/es/components/stepper/stepper.js +19 -3
- package/es/components/text-area/text-area.css +7 -0
- package/es/components/text-area/text-area.js +12 -2
- package/es/global/css-vars-patch.css +1 -0
- package/es/index.d.ts +1 -1
- package/es/locales/ko-KR.js +31 -2
- package/es/utils/reduce-and-restore-motion.js +7 -6
- package/es/utils/render-imperatively.js +9 -3
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
- package/umd/antd-mobile.js.LICENSE.txt +5 -4
package/cjs/locales/ko-KR.js
CHANGED
|
@@ -12,7 +12,8 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
12
12
|
common: {
|
|
13
13
|
confirm: '확인',
|
|
14
14
|
cancel: '취소',
|
|
15
|
-
loading: '로딩중'
|
|
15
|
+
loading: '로딩중',
|
|
16
|
+
close: '닫기'
|
|
16
17
|
},
|
|
17
18
|
Calendar: {
|
|
18
19
|
markItems: ['월', '화', '수', '목', '금', '토', '일'],
|
|
@@ -24,6 +25,9 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
24
25
|
Dialog: {
|
|
25
26
|
ok: '확인'
|
|
26
27
|
},
|
|
28
|
+
DatePicker: {
|
|
29
|
+
tillNow: '지금까지'
|
|
30
|
+
},
|
|
27
31
|
ErrorBlock: {
|
|
28
32
|
default: {
|
|
29
33
|
title: '문제가 발생했습니다',
|
|
@@ -94,7 +98,16 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
ImageUploader: {
|
|
97
|
-
uploading: '업로드 중...'
|
|
101
|
+
uploading: '업로드 중...',
|
|
102
|
+
upload: '업로드'
|
|
103
|
+
},
|
|
104
|
+
InfiniteScroll: {
|
|
105
|
+
noMore: '불러올 데이터 없음',
|
|
106
|
+
failedToLoad: '불러오기 실패',
|
|
107
|
+
retry: '재시도'
|
|
108
|
+
},
|
|
109
|
+
Input: {
|
|
110
|
+
clear: '지우기'
|
|
98
111
|
},
|
|
99
112
|
Mask: {
|
|
100
113
|
name: '마스크'
|
|
@@ -102,10 +115,26 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
102
115
|
Modal: {
|
|
103
116
|
ok: '확인'
|
|
104
117
|
},
|
|
118
|
+
PasscodeInput: {
|
|
119
|
+
name: '비밀번호 입력'
|
|
120
|
+
},
|
|
105
121
|
PullToRefresh: {
|
|
106
122
|
pulling: '스크롤을 당겨서 새로고침하십시오',
|
|
107
123
|
canRelease: '새로고침 하려면 놓으십시오',
|
|
108
124
|
complete: '새로고침 완료'
|
|
125
|
+
},
|
|
126
|
+
SearchBar: {
|
|
127
|
+
name: '검색바'
|
|
128
|
+
},
|
|
129
|
+
Slider: {
|
|
130
|
+
name: '슬라이더'
|
|
131
|
+
},
|
|
132
|
+
Stepper: {
|
|
133
|
+
decrease: '감소',
|
|
134
|
+
increase: '증가'
|
|
135
|
+
},
|
|
136
|
+
Switch: {
|
|
137
|
+
name: '스위치'
|
|
109
138
|
}
|
|
110
139
|
});
|
|
111
140
|
var _default = koKR;
|
|
@@ -33,11 +33,12 @@ function restoreMotion() {
|
|
|
33
33
|
function isMotionReduced() {
|
|
34
34
|
return reduced;
|
|
35
35
|
}
|
|
36
|
+
function subscribe(onStoreChange) {
|
|
37
|
+
subscribers.add(onStoreChange);
|
|
38
|
+
return () => {
|
|
39
|
+
subscribers.delete(onStoreChange);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
36
42
|
function useMotionReduced() {
|
|
37
|
-
return (0, _shim.useSyncExternalStore)(
|
|
38
|
-
subscribers.add(onStoreChange);
|
|
39
|
-
return () => {
|
|
40
|
-
subscribers.delete(onStoreChange);
|
|
41
|
-
};
|
|
42
|
-
}, isMotionReduced);
|
|
43
|
+
return (0, _shim.useSyncExternalStore)(subscribe, isMotionReduced);
|
|
43
44
|
}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.renderImperatively = renderImperatively;
|
|
7
|
+
var _tslib = require("tslib");
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _renderToBody = require("./render-to-body");
|
|
9
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -53,10 +54,15 @@ function renderImperatively(element) {
|
|
|
53
54
|
ref: wrapperRef
|
|
54
55
|
}));
|
|
55
56
|
return {
|
|
56
|
-
close: () => {
|
|
57
|
+
close: () => (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
57
58
|
var _a;
|
|
58
|
-
(
|
|
59
|
-
|
|
59
|
+
if (!wrapperRef.current) {
|
|
60
|
+
// it means the wrapper is not mounted yet, call `unmount` directly
|
|
61
|
+
unmount();
|
|
62
|
+
} else {
|
|
63
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
60
66
|
replace: element => {
|
|
61
67
|
var _a;
|
|
62
68
|
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.replace(element);
|
|
@@ -50,6 +50,19 @@ export const PullToRefresh = p => {
|
|
|
50
50
|
var _a;
|
|
51
51
|
(_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('touchmove', () => {});
|
|
52
52
|
}, []);
|
|
53
|
+
const reset = () => {
|
|
54
|
+
return new Promise(resolve => {
|
|
55
|
+
api.start({
|
|
56
|
+
to: {
|
|
57
|
+
height: 0
|
|
58
|
+
},
|
|
59
|
+
onResolve() {
|
|
60
|
+
setStatus('pulling');
|
|
61
|
+
resolve();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
};
|
|
53
66
|
function doRefresh() {
|
|
54
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
68
|
api.start({
|
|
@@ -60,27 +73,13 @@ export const PullToRefresh = p => {
|
|
|
60
73
|
yield props.onRefresh();
|
|
61
74
|
setStatus('complete');
|
|
62
75
|
} catch (e) {
|
|
63
|
-
|
|
64
|
-
to: next => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
yield next({
|
|
66
|
-
height: 0
|
|
67
|
-
});
|
|
68
|
-
setStatus('pulling');
|
|
69
|
-
})
|
|
70
|
-
});
|
|
76
|
+
reset();
|
|
71
77
|
throw e;
|
|
72
78
|
}
|
|
73
79
|
if (props.completeDelay > 0) {
|
|
74
80
|
yield sleep(props.completeDelay);
|
|
75
81
|
}
|
|
76
|
-
|
|
77
|
-
to: next => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
yield next({
|
|
79
|
-
height: 0
|
|
80
|
-
});
|
|
81
|
-
setStatus('pulling');
|
|
82
|
-
})
|
|
83
|
-
});
|
|
82
|
+
reset();
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
85
|
useDrag(state => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
import { InputProps } from '../input';
|
|
3
|
+
import { InputProps, InputRef } from '../input';
|
|
4
4
|
declare type ValueProps<ValueType> = {
|
|
5
5
|
allowEmpty: true;
|
|
6
6
|
value?: ValueType | null;
|
|
@@ -30,5 +30,7 @@ export declare type StringStepperProps = BaseStepperProps<string> & {
|
|
|
30
30
|
stringMode: true;
|
|
31
31
|
};
|
|
32
32
|
export declare type StepperProps = NumberStepperProps | StringStepperProps;
|
|
33
|
-
export declare
|
|
33
|
+
export declare type StepperRef = Pick<InputRef, 'blur' | 'focus' | 'nativeElement'>;
|
|
34
|
+
export declare function InnerStepper<ValueType extends number | string>(p: StepperProps, ref: React.ForwardedRef<StepperRef>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
35
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>>;
|
|
34
36
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import { MinusOutline, AddOutline } from 'antd-mobile-icons';
|
|
4
4
|
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
5
5
|
import getMiniDecimal, { toFixed } from '@rc-component/mini-decimal';
|
|
@@ -14,7 +14,7 @@ const defaultProps = {
|
|
|
14
14
|
disabled: false,
|
|
15
15
|
allowEmpty: false
|
|
16
16
|
};
|
|
17
|
-
export function
|
|
17
|
+
export function InnerStepper(p, ref) {
|
|
18
18
|
const props = mergeProps(defaultProps, p);
|
|
19
19
|
const {
|
|
20
20
|
defaultValue = 0,
|
|
@@ -33,6 +33,21 @@ export function Stepper(p) {
|
|
|
33
33
|
const {
|
|
34
34
|
locale
|
|
35
35
|
} = useConfig();
|
|
36
|
+
// ========================== Ref ==========================
|
|
37
|
+
useImperativeHandle(ref, () => ({
|
|
38
|
+
focus: () => {
|
|
39
|
+
var _a;
|
|
40
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
41
|
+
},
|
|
42
|
+
blur: () => {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
45
|
+
},
|
|
46
|
+
get nativeElement() {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) !== null && _b !== void 0 ? _b : null;
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
36
51
|
// ========================== Parse / Format ==========================
|
|
37
52
|
const fixedValue = value => {
|
|
38
53
|
const fixedValue = digits !== undefined ? toFixed(value.toString(), '.', digits) : value;
|
|
@@ -200,4 +215,5 @@ export function Stepper(p) {
|
|
|
200
215
|
color: 'primary',
|
|
201
216
|
"aria-label": locale.Stepper.increase
|
|
202
217
|
}, React.createElement(AddOutline, null))));
|
|
203
|
-
}
|
|
218
|
+
}
|
|
219
|
+
export const Stepper = forwardRef(InnerStepper);
|
|
@@ -60,6 +60,13 @@
|
|
|
60
60
|
.adm-text-area-element[readonly] {
|
|
61
61
|
pointer-events: none;
|
|
62
62
|
}
|
|
63
|
+
.adm-text-area-element-hidden {
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
z-index: -1000;
|
|
69
|
+
}
|
|
63
70
|
.adm-text-area-count {
|
|
64
71
|
text-align: var(--count-text-align);
|
|
65
72
|
color: var(--adm-color-weak);
|
|
@@ -27,6 +27,8 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
27
27
|
const nativeTextAreaRef = useRef(null);
|
|
28
28
|
// https://github.com/ant-design/ant-design-mobile/issues/5961
|
|
29
29
|
const heightRef = useRef('auto');
|
|
30
|
+
// https://github.com/ant-design/ant-design-mobile/issues/6051
|
|
31
|
+
const hiddenTextAreaRef = useRef(null);
|
|
30
32
|
useImperativeHandle(ref, () => ({
|
|
31
33
|
clear: () => {
|
|
32
34
|
setValue('');
|
|
@@ -46,9 +48,11 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
46
48
|
useIsomorphicLayoutEffect(() => {
|
|
47
49
|
if (!autoSize) return;
|
|
48
50
|
const textArea = nativeTextAreaRef.current;
|
|
51
|
+
const hiddenTextArea = hiddenTextAreaRef.current;
|
|
49
52
|
if (!textArea) return;
|
|
50
53
|
textArea.style.height = heightRef.current;
|
|
51
|
-
|
|
54
|
+
if (!hiddenTextArea) return;
|
|
55
|
+
let height = hiddenTextArea.scrollHeight;
|
|
52
56
|
if (typeof autoSize === 'object') {
|
|
53
57
|
const computedStyle = window.getComputedStyle(textArea);
|
|
54
58
|
const lineHeight = parseFloat(computedStyle.lineHeight);
|
|
@@ -110,6 +114,12 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
110
114
|
onFocus: props.onFocus,
|
|
111
115
|
onBlur: props.onBlur,
|
|
112
116
|
onClick: props.onClick
|
|
113
|
-
}), count
|
|
117
|
+
}), count, autoSize && React.createElement("textarea", {
|
|
118
|
+
ref: hiddenTextAreaRef,
|
|
119
|
+
className: `${classPrefix}-element ${classPrefix}-element-hidden`,
|
|
120
|
+
value: value,
|
|
121
|
+
"aria-hidden": true,
|
|
122
|
+
readOnly: true
|
|
123
|
+
})));
|
|
114
124
|
});
|
|
115
125
|
TextArea.defaultProps = defaultProps;
|
package/es/index.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ export type { SpaceProps } from './components/space';
|
|
|
133
133
|
export { default as SpinLoading } from './components/spin-loading';
|
|
134
134
|
export type { SpinLoadingProps } from './components/spin-loading';
|
|
135
135
|
export { default as Stepper } from './components/stepper';
|
|
136
|
-
export type { StepperProps } from './components/stepper';
|
|
136
|
+
export type { StepperProps, StepperRef } from './components/stepper';
|
|
137
137
|
export { default as Steps } from './components/steps';
|
|
138
138
|
export type { StepsProps, StepProps } from './components/steps';
|
|
139
139
|
export { default as SwipeAction } from './components/swipe-action';
|
package/es/locales/ko-KR.js
CHANGED
|
@@ -6,7 +6,8 @@ const koKR = mergeLocale(base, {
|
|
|
6
6
|
common: {
|
|
7
7
|
confirm: '확인',
|
|
8
8
|
cancel: '취소',
|
|
9
|
-
loading: '로딩중'
|
|
9
|
+
loading: '로딩중',
|
|
10
|
+
close: '닫기'
|
|
10
11
|
},
|
|
11
12
|
Calendar: {
|
|
12
13
|
markItems: ['월', '화', '수', '목', '금', '토', '일'],
|
|
@@ -18,6 +19,9 @@ const koKR = mergeLocale(base, {
|
|
|
18
19
|
Dialog: {
|
|
19
20
|
ok: '확인'
|
|
20
21
|
},
|
|
22
|
+
DatePicker: {
|
|
23
|
+
tillNow: '지금까지'
|
|
24
|
+
},
|
|
21
25
|
ErrorBlock: {
|
|
22
26
|
default: {
|
|
23
27
|
title: '문제가 발생했습니다',
|
|
@@ -88,7 +92,16 @@ const koKR = mergeLocale(base, {
|
|
|
88
92
|
}
|
|
89
93
|
},
|
|
90
94
|
ImageUploader: {
|
|
91
|
-
uploading: '업로드 중...'
|
|
95
|
+
uploading: '업로드 중...',
|
|
96
|
+
upload: '업로드'
|
|
97
|
+
},
|
|
98
|
+
InfiniteScroll: {
|
|
99
|
+
noMore: '불러올 데이터 없음',
|
|
100
|
+
failedToLoad: '불러오기 실패',
|
|
101
|
+
retry: '재시도'
|
|
102
|
+
},
|
|
103
|
+
Input: {
|
|
104
|
+
clear: '지우기'
|
|
92
105
|
},
|
|
93
106
|
Mask: {
|
|
94
107
|
name: '마스크'
|
|
@@ -96,10 +109,26 @@ const koKR = mergeLocale(base, {
|
|
|
96
109
|
Modal: {
|
|
97
110
|
ok: '확인'
|
|
98
111
|
},
|
|
112
|
+
PasscodeInput: {
|
|
113
|
+
name: '비밀번호 입력'
|
|
114
|
+
},
|
|
99
115
|
PullToRefresh: {
|
|
100
116
|
pulling: '스크롤을 당겨서 새로고침하십시오',
|
|
101
117
|
canRelease: '새로고침 하려면 놓으십시오',
|
|
102
118
|
complete: '새로고침 완료'
|
|
119
|
+
},
|
|
120
|
+
SearchBar: {
|
|
121
|
+
name: '검색바'
|
|
122
|
+
},
|
|
123
|
+
Slider: {
|
|
124
|
+
name: '슬라이더'
|
|
125
|
+
},
|
|
126
|
+
Stepper: {
|
|
127
|
+
decrease: '감소',
|
|
128
|
+
increase: '증가'
|
|
129
|
+
},
|
|
130
|
+
Switch: {
|
|
131
|
+
name: '스위치'
|
|
103
132
|
}
|
|
104
133
|
});
|
|
105
134
|
export default koKR;
|
|
@@ -24,11 +24,12 @@ export function restoreMotion() {
|
|
|
24
24
|
export function isMotionReduced() {
|
|
25
25
|
return reduced;
|
|
26
26
|
}
|
|
27
|
+
function subscribe(onStoreChange) {
|
|
28
|
+
subscribers.add(onStoreChange);
|
|
29
|
+
return () => {
|
|
30
|
+
subscribers.delete(onStoreChange);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
27
33
|
export function useMotionReduced() {
|
|
28
|
-
return useSyncExternalStore(
|
|
29
|
-
subscribers.add(onStoreChange);
|
|
30
|
-
return () => {
|
|
31
|
-
subscribers.delete(onStoreChange);
|
|
32
|
-
};
|
|
33
|
-
}, isMotionReduced);
|
|
34
|
+
return useSyncExternalStore(subscribe, isMotionReduced);
|
|
34
35
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
1
2
|
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
3
|
import { renderToBody } from './render-to-body';
|
|
3
4
|
export function renderImperatively(element) {
|
|
@@ -45,10 +46,15 @@ export function renderImperatively(element) {
|
|
|
45
46
|
ref: wrapperRef
|
|
46
47
|
}));
|
|
47
48
|
return {
|
|
48
|
-
close: () => {
|
|
49
|
+
close: () => __awaiter(this, void 0, void 0, function* () {
|
|
49
50
|
var _a;
|
|
50
|
-
(
|
|
51
|
-
|
|
51
|
+
if (!wrapperRef.current) {
|
|
52
|
+
// it means the wrapper is not mounted yet, call `unmount` directly
|
|
53
|
+
unmount();
|
|
54
|
+
} else {
|
|
55
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
52
58
|
replace: element => {
|
|
53
59
|
var _a;
|
|
54
60
|
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.replace(element);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.28.
|
|
3
|
+
"version": "5.28.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@floating-ui/dom": "^1.0.6",
|
|
6
6
|
"@rc-component/mini-decimal": "^1.0.1",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"lodash": "^4.17.21",
|
|
15
15
|
"rc-field-form": "~1.27.3",
|
|
16
16
|
"rc-util": "^5.24.8",
|
|
17
|
-
"react-is": "^
|
|
17
|
+
"react-is": "^18.2.0",
|
|
18
18
|
"runes": "^0.4.3",
|
|
19
19
|
"staged-components": "^1.1.3",
|
|
20
20
|
"tslib": "^2.4.1",
|