antd-mobile 5.14.2 → 5.15.1
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/README.md +1 -2
- package/2x/bundle/antd-mobile.cjs.js +201 -162
- package/2x/bundle/antd-mobile.es.js +196 -157
- package/2x/bundle/style.css +9 -6
- package/2x/cjs/components/badge/badge.css +1 -1
- package/2x/cjs/components/badge/badge.d.ts +2 -0
- package/2x/cjs/components/badge/badge.js +2 -1
- package/2x/cjs/components/button/button.d.ts +5 -1
- package/2x/cjs/components/center-popup/center-popup.d.ts +1 -0
- package/2x/cjs/components/center-popup/center-popup.js +3 -1
- package/2x/cjs/components/checkbox/checkbox.d.ts +22 -2
- package/2x/cjs/components/checkbox/checkbox.js +14 -4
- package/2x/cjs/components/checkbox/index.d.ts +17 -2
- package/2x/cjs/components/checkbox/native-input.js +10 -8
- package/2x/cjs/components/date-picker/date-picker-date-utils.js +12 -15
- package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -15
- package/2x/cjs/components/date-picker/date-picker.d.ts +5 -1
- package/2x/cjs/components/date-picker/index.d.ts +5 -1
- package/2x/cjs/components/dialog/dialog.js +3 -1
- package/2x/cjs/components/dropdown/dropdown.d.ts +5 -1
- package/2x/cjs/components/dropdown/index.d.ts +5 -1
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +5 -1
- package/2x/cjs/components/form/form-item.js +2 -4
- package/2x/cjs/components/form/form-subscribe.d.ts +7 -2
- package/2x/cjs/components/form/form-subscribe.js +28 -16
- package/2x/cjs/components/form/form.d.ts +5 -1
- package/2x/cjs/components/form/index.d.ts +6 -2
- package/2x/cjs/components/index-bar/index-bar.d.ts +5 -1
- package/2x/cjs/components/index-bar/index.d.ts +5 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +13 -4
- package/2x/cjs/components/input/input.d.ts +5 -1
- package/2x/cjs/components/list/list.css +3 -0
- package/2x/cjs/components/list/list.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +5 -1
- package/2x/cjs/components/picker/index.d.ts +10 -2
- package/2x/cjs/components/picker/picker.d.ts +5 -1
- package/2x/cjs/components/popover/index.d.ts +5 -1
- package/2x/cjs/components/popover/popover.d.ts +5 -1
- package/2x/cjs/components/radio/radio.js +3 -3
- package/2x/cjs/components/rate/rate.css +2 -2
- package/2x/cjs/components/rate/rate.js +3 -3
- package/2x/cjs/components/rate/star.d.ts +2 -0
- package/2x/cjs/components/rate/star.js +37 -0
- package/2x/cjs/components/safe-area/safe-area.css +3 -2
- package/2x/cjs/components/search-bar/search-bar.d.ts +5 -1
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +5 -1
- package/2x/cjs/components/swiper/index.d.ts +10 -2
- package/2x/cjs/components/swiper/swiper.d.ts +5 -1
- package/2x/cjs/components/switch/switch.js +10 -1
- package/2x/cjs/components/text-area/text-area.d.ts +6 -1
- package/2x/cjs/components/text-area/text-area.js +5 -0
- package/2x/cjs/components/toast/methods.js +32 -73
- package/2x/cjs/components/toast/toast.js +6 -2
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +5 -1
- package/2x/cjs/components/water-mark/water-mark.js +3 -2
- package/2x/cjs/global/global.css +0 -1
- package/2x/cjs/global/theme-default.css +0 -1
- package/2x/cjs/locales/base.d.ts +3 -0
- package/2x/cjs/locales/base.js +3 -0
- package/2x/cjs/locales/en-US.d.ts +3 -0
- package/2x/cjs/locales/es-ES.d.ts +3 -0
- package/2x/cjs/locales/fa-IR.d.ts +3 -0
- package/2x/cjs/locales/fr-FR.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.js +3 -0
- package/2x/cjs/locales/zh-HK.d.ts +3 -0
- package/2x/cjs/locales/zh-TW.d.ts +3 -0
- package/2x/cjs/utils/native-props.d.ts +3 -3
- package/2x/cjs/utils/render-imperatively.d.ts +4 -1
- package/2x/cjs/utils/render-imperatively.js +23 -11
- package/2x/cjs/utils/use-props-value.js +2 -6
- package/2x/es/components/badge/badge.css +1 -1
- package/2x/es/components/badge/badge.d.ts +2 -0
- package/2x/es/components/badge/badge.js +2 -1
- package/2x/es/components/button/button.d.ts +5 -1
- package/2x/es/components/center-popup/center-popup.d.ts +1 -0
- package/2x/es/components/center-popup/center-popup.js +3 -1
- package/2x/es/components/checkbox/checkbox.d.ts +22 -2
- package/2x/es/components/checkbox/checkbox.js +15 -3
- package/2x/es/components/checkbox/index.d.ts +17 -2
- package/2x/es/components/checkbox/native-input.js +9 -8
- package/2x/es/components/date-picker/date-picker-date-utils.js +12 -15
- package/2x/es/components/date-picker/date-picker-week-utils.js +12 -15
- package/2x/es/components/date-picker/date-picker.d.ts +5 -1
- package/2x/es/components/date-picker/index.d.ts +5 -1
- package/2x/es/components/dialog/dialog.js +3 -1
- package/2x/es/components/dropdown/dropdown.d.ts +5 -1
- package/2x/es/components/dropdown/index.d.ts +5 -1
- package/2x/es/components/floating-panel/floating-panel.d.ts +5 -1
- package/2x/es/components/form/form-item.js +2 -2
- package/2x/es/components/form/form-subscribe.d.ts +7 -2
- package/2x/es/components/form/form-subscribe.js +21 -14
- package/2x/es/components/form/form.d.ts +5 -1
- package/2x/es/components/form/index.d.ts +6 -2
- package/2x/es/components/index-bar/index-bar.d.ts +5 -1
- package/2x/es/components/index-bar/index.d.ts +5 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +14 -5
- package/2x/es/components/input/input.d.ts +5 -1
- package/2x/es/components/list/list.css +3 -0
- package/2x/es/components/list/list.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.d.ts +5 -1
- package/2x/es/components/picker/index.d.ts +10 -2
- package/2x/es/components/picker/picker.d.ts +5 -1
- package/2x/es/components/popover/index.d.ts +5 -1
- package/2x/es/components/popover/popover.d.ts +5 -1
- package/2x/es/components/radio/radio.js +3 -3
- package/2x/es/components/rate/rate.css +2 -2
- package/2x/es/components/rate/rate.js +2 -2
- package/2x/es/components/rate/star.d.ts +2 -0
- package/2x/es/components/rate/star.js +25 -0
- package/2x/es/components/safe-area/safe-area.css +3 -2
- package/2x/es/components/search-bar/search-bar.d.ts +5 -1
- package/2x/es/components/swipe-action/swipe-action.d.ts +5 -1
- package/2x/es/components/swiper/index.d.ts +10 -2
- package/2x/es/components/swiper/swiper.d.ts +5 -1
- package/2x/es/components/switch/switch.js +9 -1
- package/2x/es/components/text-area/text-area.d.ts +6 -1
- package/2x/es/components/text-area/text-area.js +5 -0
- package/2x/es/components/toast/methods.js +29 -67
- package/2x/es/components/toast/toast.js +6 -2
- package/2x/es/components/virtual-input/virtual-input.d.ts +5 -1
- package/2x/es/components/water-mark/water-mark.js +3 -2
- package/2x/es/global/global.css +0 -1
- package/2x/es/global/theme-default.css +0 -1
- package/2x/es/locales/base.d.ts +3 -0
- package/2x/es/locales/base.js +3 -0
- package/2x/es/locales/en-US.d.ts +3 -0
- package/2x/es/locales/es-ES.d.ts +3 -0
- package/2x/es/locales/fa-IR.d.ts +3 -0
- package/2x/es/locales/fr-FR.d.ts +3 -0
- package/2x/es/locales/ko-KR.d.ts +3 -0
- package/2x/es/locales/zh-CN.d.ts +3 -0
- package/2x/es/locales/zh-CN.js +3 -0
- package/2x/es/locales/zh-HK.d.ts +3 -0
- package/2x/es/locales/zh-TW.d.ts +3 -0
- package/2x/es/utils/native-props.d.ts +3 -3
- package/2x/es/utils/render-imperatively.d.ts +4 -1
- package/2x/es/utils/render-imperatively.js +23 -11
- package/2x/es/utils/use-props-value.js +2 -6
- package/2x/package.json +3 -3
- package/2x/umd/antd-mobile.js +1 -1
- package/README.md +1 -2
- package/bundle/antd-mobile.cjs.js +201 -162
- package/bundle/antd-mobile.es.js +196 -157
- package/bundle/style.css +9 -6
- package/cjs/components/badge/badge.css +1 -1
- package/cjs/components/badge/badge.d.ts +2 -0
- package/cjs/components/badge/badge.js +2 -1
- package/cjs/components/button/button.d.ts +5 -1
- package/cjs/components/center-popup/center-popup.d.ts +1 -0
- package/cjs/components/center-popup/center-popup.js +3 -1
- package/cjs/components/checkbox/checkbox.d.ts +22 -2
- package/cjs/components/checkbox/checkbox.js +14 -4
- package/cjs/components/checkbox/index.d.ts +17 -2
- package/cjs/components/checkbox/native-input.js +10 -8
- package/cjs/components/date-picker/date-picker-date-utils.js +12 -15
- package/cjs/components/date-picker/date-picker-week-utils.js +12 -15
- package/cjs/components/date-picker/date-picker.d.ts +5 -1
- package/cjs/components/date-picker/index.d.ts +5 -1
- package/cjs/components/dialog/dialog.js +3 -1
- package/cjs/components/dropdown/dropdown.d.ts +5 -1
- package/cjs/components/dropdown/index.d.ts +5 -1
- package/cjs/components/floating-panel/floating-panel.d.ts +5 -1
- package/cjs/components/form/form-item.js +2 -4
- package/cjs/components/form/form-subscribe.d.ts +7 -2
- package/cjs/components/form/form-subscribe.js +28 -16
- package/cjs/components/form/form.d.ts +5 -1
- package/cjs/components/form/index.d.ts +6 -2
- package/cjs/components/index-bar/index-bar.d.ts +5 -1
- package/cjs/components/index-bar/index.d.ts +5 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +13 -4
- package/cjs/components/input/input.d.ts +5 -1
- package/cjs/components/list/list.css +3 -0
- package/cjs/components/list/list.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.d.ts +5 -1
- package/cjs/components/picker/index.d.ts +10 -2
- package/cjs/components/picker/picker.d.ts +5 -1
- package/cjs/components/popover/index.d.ts +5 -1
- package/cjs/components/popover/popover.d.ts +5 -1
- package/cjs/components/radio/radio.js +3 -3
- package/cjs/components/rate/rate.css +2 -2
- package/cjs/components/rate/rate.js +3 -3
- package/cjs/components/rate/star.d.ts +2 -0
- package/cjs/components/rate/star.js +37 -0
- package/cjs/components/safe-area/safe-area.css +3 -2
- package/cjs/components/search-bar/search-bar.d.ts +5 -1
- package/cjs/components/swipe-action/swipe-action.d.ts +5 -1
- package/cjs/components/swiper/index.d.ts +10 -2
- package/cjs/components/swiper/swiper.d.ts +5 -1
- package/cjs/components/switch/switch.js +10 -1
- package/cjs/components/text-area/text-area.d.ts +6 -1
- package/cjs/components/text-area/text-area.js +5 -0
- package/cjs/components/toast/methods.js +32 -73
- package/cjs/components/toast/toast.js +6 -2
- package/cjs/components/virtual-input/virtual-input.d.ts +5 -1
- package/cjs/components/water-mark/water-mark.js +3 -2
- package/cjs/global/global.css +0 -1
- package/cjs/global/theme-default.css +0 -1
- package/cjs/locales/base.d.ts +3 -0
- package/cjs/locales/base.js +3 -0
- package/cjs/locales/en-US.d.ts +3 -0
- package/cjs/locales/es-ES.d.ts +3 -0
- package/cjs/locales/fa-IR.d.ts +3 -0
- package/cjs/locales/fr-FR.d.ts +3 -0
- package/cjs/locales/ko-KR.d.ts +3 -0
- package/cjs/locales/zh-CN.d.ts +3 -0
- package/cjs/locales/zh-CN.js +3 -0
- package/cjs/locales/zh-HK.d.ts +3 -0
- package/cjs/locales/zh-TW.d.ts +3 -0
- package/cjs/utils/native-props.d.ts +3 -3
- package/cjs/utils/render-imperatively.d.ts +4 -1
- package/cjs/utils/render-imperatively.js +23 -11
- package/cjs/utils/use-props-value.js +2 -6
- package/es/components/badge/badge.css +1 -1
- package/es/components/badge/badge.d.ts +2 -0
- package/es/components/badge/badge.js +2 -1
- package/es/components/button/button.d.ts +5 -1
- package/es/components/center-popup/center-popup.d.ts +1 -0
- package/es/components/center-popup/center-popup.js +3 -1
- package/es/components/checkbox/checkbox.d.ts +22 -2
- package/es/components/checkbox/checkbox.js +15 -3
- package/es/components/checkbox/index.d.ts +17 -2
- package/es/components/checkbox/native-input.js +9 -8
- package/es/components/date-picker/date-picker-date-utils.js +12 -15
- package/es/components/date-picker/date-picker-week-utils.js +12 -15
- package/es/components/date-picker/date-picker.d.ts +5 -1
- package/es/components/date-picker/index.d.ts +5 -1
- package/es/components/dialog/dialog.js +3 -1
- package/es/components/dropdown/dropdown.d.ts +5 -1
- package/es/components/dropdown/index.d.ts +5 -1
- package/es/components/floating-panel/floating-panel.d.ts +5 -1
- package/es/components/form/form-item.js +2 -2
- package/es/components/form/form-subscribe.d.ts +7 -2
- package/es/components/form/form-subscribe.js +21 -14
- package/es/components/form/form.d.ts +5 -1
- package/es/components/form/index.d.ts +6 -2
- package/es/components/index-bar/index-bar.d.ts +5 -1
- package/es/components/index-bar/index.d.ts +5 -1
- package/es/components/infinite-scroll/infinite-scroll.js +14 -5
- package/es/components/input/input.d.ts +5 -1
- package/es/components/list/list.css +3 -0
- package/es/components/list/list.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.d.ts +5 -1
- package/es/components/picker/index.d.ts +10 -2
- package/es/components/picker/picker.d.ts +5 -1
- package/es/components/popover/index.d.ts +5 -1
- package/es/components/popover/popover.d.ts +5 -1
- package/es/components/radio/radio.js +3 -3
- package/es/components/rate/rate.css +2 -2
- package/es/components/rate/rate.js +2 -2
- package/es/components/rate/star.d.ts +2 -0
- package/es/components/rate/star.js +25 -0
- package/es/components/safe-area/safe-area.css +3 -2
- package/es/components/search-bar/search-bar.d.ts +5 -1
- package/es/components/swipe-action/swipe-action.d.ts +5 -1
- package/es/components/swiper/index.d.ts +10 -2
- package/es/components/swiper/swiper.d.ts +5 -1
- package/es/components/switch/switch.js +9 -1
- package/es/components/text-area/text-area.d.ts +6 -1
- package/es/components/text-area/text-area.js +5 -0
- package/es/components/toast/methods.js +29 -67
- package/es/components/toast/toast.js +6 -2
- package/es/components/virtual-input/virtual-input.d.ts +5 -1
- package/es/components/water-mark/water-mark.js +3 -2
- package/es/global/global.css +0 -1
- package/es/global/theme-default.css +0 -1
- package/es/locales/base.d.ts +3 -0
- package/es/locales/base.js +3 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/es-ES.d.ts +3 -0
- package/es/locales/fa-IR.d.ts +3 -0
- package/es/locales/fr-FR.d.ts +3 -0
- package/es/locales/ko-KR.d.ts +3 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +3 -0
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/utils/native-props.d.ts +3 -3
- package/es/utils/render-imperatively.d.ts +4 -1
- package/es/utils/render-imperatively.js +23 -11
- package/es/utils/use-props-value.js +2 -6
- package/package.json +3 -3
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/form/form-imperative-item.d.ts +0 -5
- package/2x/cjs/components/form/form-imperative-item.js +0 -57
- package/2x/es/components/form/form-imperative-item.d.ts +0 -5
- package/2x/es/components/form/form-imperative-item.js +0 -38
- package/cjs/components/form/form-imperative-item.d.ts +0 -5
- package/cjs/components/form/form-imperative-item.js +0 -57
- package/es/components/form/form-imperative-item.d.ts +0 -5
- package/es/components/form/form-imperative-item.js +0 -38
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { mergeProps } from '../../utils/with-default-props';
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { useLockFn,
|
|
4
|
+
import { useLockFn, useThrottleFn } from 'ahooks';
|
|
5
5
|
import { withNativeProps } from '../../utils/native-props';
|
|
6
6
|
import { getScrollParent } from '../../utils/get-scroll-parent';
|
|
7
7
|
import { useConfig } from '../config-provider';
|
|
@@ -36,7 +36,9 @@ export const InfiniteScroll = p => {
|
|
|
36
36
|
const [flag, setFlag] = useState({});
|
|
37
37
|
const nextFlagRef = useRef(flag);
|
|
38
38
|
const [scrollParent, setScrollParent] = useState();
|
|
39
|
-
const
|
|
39
|
+
const {
|
|
40
|
+
run: check
|
|
41
|
+
} = useThrottleFn(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
42
|
if (nextFlagRef.current !== flag) return;
|
|
41
43
|
if (!props.hasMore) return;
|
|
42
44
|
const element = elementRef.current;
|
|
@@ -55,7 +57,11 @@ export const InfiniteScroll = p => {
|
|
|
55
57
|
yield doLoadMore(false);
|
|
56
58
|
setFlag(nextFlag);
|
|
57
59
|
}
|
|
58
|
-
})
|
|
60
|
+
}), {
|
|
61
|
+
wait: 100,
|
|
62
|
+
leading: true,
|
|
63
|
+
trailing: true
|
|
64
|
+
}); // Make sure to trigger `loadMore` when content changes
|
|
59
65
|
|
|
60
66
|
useEffect(() => {
|
|
61
67
|
check();
|
|
@@ -76,8 +82,11 @@ export const InfiniteScroll = p => {
|
|
|
76
82
|
}, [scrollParent]);
|
|
77
83
|
|
|
78
84
|
function retry() {
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
setFailed(false);
|
|
87
|
+
yield doLoadMore(true);
|
|
88
|
+
setFlag(nextFlagRef.current);
|
|
89
|
+
});
|
|
81
90
|
}
|
|
82
91
|
|
|
83
92
|
return withNativeProps(props, React.createElement("div", {
|
|
@@ -38,5 +38,9 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
38
38
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
39
39
|
min?: number | undefined;
|
|
40
40
|
max?: number | undefined;
|
|
41
|
-
} &
|
|
41
|
+
} & {
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
|
|
44
|
+
tabIndex?: number | undefined;
|
|
45
|
+
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
42
46
|
export {};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
--padding-left: 24px;
|
|
11
11
|
--padding-right: 24px;
|
|
12
12
|
--font-size: var(--adm-font-size-9);
|
|
13
|
+
--extra-max-width: 70%;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.adm-list-header {
|
|
@@ -79,9 +80,11 @@
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
.adm-list-item-content-extra {
|
|
83
|
+
flex: none;
|
|
82
84
|
padding-left: 24px;
|
|
83
85
|
font-size: var(--adm-font-size-7);
|
|
84
86
|
color: var(--adm-color-weak);
|
|
87
|
+
max-width: var(--extra-max-width);
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
.adm-list-item-content-arrow {
|
|
@@ -4,5 +4,5 @@ export declare type ListProps = {
|
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
mode?: 'default' | 'card';
|
|
6
6
|
children?: ReactNode;
|
|
7
|
-
} & NativeProps<'--
|
|
7
|
+
} & NativeProps<'--active-background-color' | '--align-items' | '--border-bottom' | '--border-inner' | '--border-top' | '--extra-max-width' | '--font-size' | '--header-font-size' | '--padding-left' | '--padding-right' | '--prefix-padding-right' | '--prefix-width'>;
|
|
8
8
|
export declare const List: FC<ListProps>;
|
|
@@ -32,4 +32,8 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
|
|
|
32
32
|
onFocus?: (() => void) | undefined;
|
|
33
33
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
34
34
|
onFill?: ((val: string) => void) | undefined;
|
|
35
|
-
} &
|
|
35
|
+
} & {
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
style?: (React.CSSProperties & Partial<Record<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap", string>>) | undefined;
|
|
38
|
+
tabIndex?: number | undefined;
|
|
39
|
+
} & React.AriaAttributes & React.RefAttributes<PasscodeInputRef>>;
|
|
@@ -22,7 +22,11 @@ declare const _default: import("react").NamedExoticComponent<{
|
|
|
22
22
|
popupStyle?: import("react").CSSProperties | undefined;
|
|
23
23
|
forceRender?: boolean | undefined;
|
|
24
24
|
destroyOnClose?: boolean | undefined;
|
|
25
|
-
} & Pick<import("../popup").PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> &
|
|
25
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
style?: (import("react").CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
28
|
+
tabIndex?: number | undefined;
|
|
29
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./picker").PickerActions>> & {
|
|
26
30
|
readonly type: import("react").ForwardRefExoticComponent<{
|
|
27
31
|
columns: import("../picker-view").PickerColumn[] | ((value: import("../picker-view").PickerValue[]) => import("../picker-view").PickerColumn[]);
|
|
28
32
|
value?: import("../picker-view").PickerValue[] | undefined;
|
|
@@ -43,7 +47,11 @@ declare const _default: import("react").NamedExoticComponent<{
|
|
|
43
47
|
popupStyle?: import("react").CSSProperties | undefined;
|
|
44
48
|
forceRender?: boolean | undefined;
|
|
45
49
|
destroyOnClose?: boolean | undefined;
|
|
46
|
-
} & Pick<import("../popup").PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> &
|
|
50
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
51
|
+
className?: string | undefined;
|
|
52
|
+
style?: (import("react").CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
53
|
+
tabIndex?: number | undefined;
|
|
54
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./picker").PickerActions>>;
|
|
47
55
|
} & {
|
|
48
56
|
prompt: typeof prompt;
|
|
49
57
|
};
|
|
@@ -49,4 +49,8 @@ export declare const Picker: React.MemoExoticComponent<React.ForwardRefExoticCom
|
|
|
49
49
|
popupStyle?: React.CSSProperties | undefined;
|
|
50
50
|
forceRender?: boolean | undefined;
|
|
51
51
|
destroyOnClose?: boolean | undefined;
|
|
52
|
-
} & Pick<PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> &
|
|
52
|
+
} & Pick<PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
53
|
+
className?: string | undefined;
|
|
54
|
+
style?: (React.CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
55
|
+
tabIndex?: number | undefined;
|
|
56
|
+
} & React.AriaAttributes & React.RefAttributes<PickerActions>>>;
|
|
@@ -17,7 +17,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
17
17
|
placement?: DeprecatedPlacement | Placement | undefined;
|
|
18
18
|
stopPropagation?: "click"[] | undefined;
|
|
19
19
|
content: import("react").ReactNode;
|
|
20
|
-
} &
|
|
20
|
+
} & {
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
style?: (import("react").CSSProperties & Partial<Record<"--z-index", string>>) | undefined;
|
|
23
|
+
tabIndex?: number | undefined;
|
|
24
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
21
25
|
Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
|
|
22
26
|
actions: import("./popover-menu").Action[];
|
|
23
27
|
onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
|
|
@@ -33,4 +33,8 @@ export declare const Popover: React.ForwardRefExoticComponent<{
|
|
|
33
33
|
placement?: DeprecatedPlacement | Placement | undefined;
|
|
34
34
|
stopPropagation?: "click"[] | undefined;
|
|
35
35
|
content: React.ReactNode;
|
|
36
|
-
} &
|
|
36
|
+
} & {
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
style?: (React.CSSProperties & Partial<Record<"--z-index", string>>) | undefined;
|
|
39
|
+
tabIndex?: number | undefined;
|
|
40
|
+
} & React.AriaAttributes & React.RefAttributes<PopoverRef>>;
|
|
@@ -38,16 +38,16 @@ export const Radio = p => {
|
|
|
38
38
|
|
|
39
39
|
checked = groupContext.value.includes(value);
|
|
40
40
|
|
|
41
|
-
setChecked =
|
|
41
|
+
setChecked = innerChecked => {
|
|
42
42
|
var _a;
|
|
43
43
|
|
|
44
|
-
if (
|
|
44
|
+
if (innerChecked) {
|
|
45
45
|
groupContext.check(value);
|
|
46
46
|
} else {
|
|
47
47
|
groupContext.uncheck(value);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props,
|
|
50
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerChecked);
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
disabled = disabled || groupContext.disabled;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.adm-rate {
|
|
2
2
|
--star-size: 48px;
|
|
3
3
|
--active-color: #ffd21e;
|
|
4
|
-
--inactive-color: var(--adm-color-
|
|
4
|
+
--inactive-color: var(--adm-color-border);
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.adm-rate-star {
|
|
13
|
-
padding:
|
|
13
|
+
padding: 0.125em;
|
|
14
14
|
line-height: var(--star-size);
|
|
15
15
|
font-size: var(--star-size);
|
|
16
16
|
color: var(--inactive-color);
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { withNativeProps } from '../../utils/native-props';
|
|
4
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
5
|
-
import { StarFill } from 'antd-mobile-icons';
|
|
6
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
|
+
import { Star } from './star';
|
|
7
7
|
const classPrefix = `adm-rate`;
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
count: 5,
|
|
10
10
|
allowHalf: false,
|
|
11
|
-
character: React.createElement(
|
|
11
|
+
character: React.createElement(Star, null),
|
|
12
12
|
defaultValue: 0,
|
|
13
13
|
readOnly: false,
|
|
14
14
|
allowClear: true
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const Star = () => {
|
|
3
|
+
// return (
|
|
4
|
+
// <svg height='1em' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'>
|
|
5
|
+
// <title>{'star-fill\u5907\u4EFD 71'}</title>
|
|
6
|
+
// <path
|
|
7
|
+
// d='m24 36-10.52 5.53a2 2 0 0 1-2.902-2.108l2.01-11.714-8.511-8.296a2 2 0 0 1 1.108-3.411l11.762-1.71 5.26-10.657a2 2 0 0 1 3.586 0l5.26 10.658L42.815 16a2 2 0 0 1 1.108 3.411l-8.51 8.296 2.009 11.714a2 2 0 0 1-2.902 2.109L24 36Z'
|
|
8
|
+
// fill='#E5E5E5'
|
|
9
|
+
// fillRule='evenodd'
|
|
10
|
+
// />
|
|
11
|
+
// </svg>
|
|
12
|
+
// )
|
|
13
|
+
return React.createElement("svg", {
|
|
14
|
+
viewBox: '0 0 42 40',
|
|
15
|
+
height: '1em',
|
|
16
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
17
|
+
style: {
|
|
18
|
+
verticalAlign: '-0.125em'
|
|
19
|
+
}
|
|
20
|
+
}, React.createElement("path", {
|
|
21
|
+
d: 'm21 34-10.52 5.53a2 2 0 0 1-2.902-2.108l2.01-11.714-8.511-8.296a2 2 0 0 1 1.108-3.411l11.762-1.71 5.26-10.657a2 2 0 0 1 3.586 0l5.26 10.658L39.815 14a2 2 0 0 1 1.108 3.411l-8.51 8.296 2.009 11.714a2 2 0 0 1-2.902 2.109L21 34Z',
|
|
22
|
+
fill: 'currentColor',
|
|
23
|
+
fillRule: 'evenodd'
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
.adm-safe-area {
|
|
2
|
+
--multiple: var(--adm-safe-area-multiple, 1);
|
|
2
3
|
display: block;
|
|
3
4
|
width: 100%;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.adm-safe-area-position-top {
|
|
7
|
-
padding-top: calc(env(safe-area-inset-top) * var(--
|
|
8
|
+
padding-top: calc(env(safe-area-inset-top) * var(--multiple));
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.adm-safe-area-position-bottom {
|
|
11
|
-
padding-bottom: calc(env(safe-area-inset-bottom) * var(--
|
|
12
|
+
padding-bottom: calc(env(safe-area-inset-bottom) * var(--multiple));
|
|
12
13
|
}
|
|
@@ -31,4 +31,8 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
31
31
|
onSearch?: ((val: string) => void) | undefined;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
33
|
onCancel?: (() => void) | undefined;
|
|
34
|
-
} &
|
|
34
|
+
} & {
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
style?: (React.CSSProperties & Partial<Record<"--height" | "--border-radius" | "--padding-left" | "--background" | "--placeholder-color", string>>) | undefined;
|
|
37
|
+
tabIndex?: number | undefined;
|
|
38
|
+
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
@@ -29,5 +29,9 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
29
29
|
closeOnAction?: boolean | undefined;
|
|
30
30
|
children: ReactNode;
|
|
31
31
|
stopPropagation?: "click"[] | undefined;
|
|
32
|
-
} &
|
|
32
|
+
} & {
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
|
|
35
|
+
tabIndex?: number | undefined;
|
|
36
|
+
} & React.AriaAttributes & React.RefAttributes<SwipeActionRef>>;
|
|
33
37
|
export {};
|
|
@@ -16,10 +16,18 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (import("react").CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
24
|
Item: import("react").FC<{
|
|
21
25
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
22
26
|
children?: import("react").ReactNode;
|
|
23
|
-
} &
|
|
27
|
+
} & {
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
30
|
+
tabIndex?: number | undefined;
|
|
31
|
+
} & import("react").AriaAttributes>;
|
|
24
32
|
};
|
|
25
33
|
export default _default;
|
|
@@ -37,4 +37,8 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
39
|
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
|
-
} &
|
|
40
|
+
} & {
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
style?: (React.CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
|
|
43
|
+
tabIndex?: number | undefined;
|
|
44
|
+
} & React.AriaAttributes & React.RefAttributes<SwiperRef>>;
|
|
@@ -5,6 +5,7 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
7
|
import { SpinIcon } from './spin-icon';
|
|
8
|
+
import { useConfig } from '../config-provider';
|
|
8
9
|
const classPrefix = `adm-switch`;
|
|
9
10
|
const defaultProps = {
|
|
10
11
|
defaultChecked: false
|
|
@@ -13,6 +14,9 @@ export const Switch = p => {
|
|
|
13
14
|
const props = mergeProps(defaultProps, p);
|
|
14
15
|
const disabled = props.disabled || props.loading || false;
|
|
15
16
|
const [changing, setChanging] = useState(false);
|
|
17
|
+
const {
|
|
18
|
+
locale
|
|
19
|
+
} = useConfig();
|
|
16
20
|
const [checked, setChecked] = usePropsValue({
|
|
17
21
|
value: props.checked,
|
|
18
22
|
defaultValue: props.defaultChecked,
|
|
@@ -49,7 +53,11 @@ export const Switch = p => {
|
|
|
49
53
|
className: classNames(classPrefix, {
|
|
50
54
|
[`${classPrefix}-checked`]: checked,
|
|
51
55
|
[`${classPrefix}-disabled`]: disabled || changing
|
|
52
|
-
})
|
|
56
|
+
}),
|
|
57
|
+
role: 'switch',
|
|
58
|
+
"aria-label": locale.Switch.name,
|
|
59
|
+
"aria-checked": checked,
|
|
60
|
+
"aria-disabled": disabled
|
|
53
61
|
}, React.createElement("div", {
|
|
54
62
|
className: `${classPrefix}-checkbox`
|
|
55
63
|
}, React.createElement("div", {
|
|
@@ -19,6 +19,7 @@ export declare type TextAreaRef = {
|
|
|
19
19
|
clear: () => void;
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
|
+
nativeElement: HTMLTextAreaElement | null;
|
|
22
23
|
};
|
|
23
24
|
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
25
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -33,4 +34,8 @@ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.Detail
|
|
|
33
34
|
maxRows?: number | undefined;
|
|
34
35
|
} | undefined;
|
|
35
36
|
id?: string | undefined;
|
|
36
|
-
} &
|
|
37
|
+
} & {
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--count-text-align", string>>) | undefined;
|
|
40
|
+
tabIndex?: number | undefined;
|
|
41
|
+
} & React.AriaAttributes & React.RefAttributes<TextAreaRef>>;
|
|
@@ -40,7 +40,12 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
40
40
|
var _a;
|
|
41
41
|
|
|
42
42
|
(_a = nativeTextAreaRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
get nativeElement() {
|
|
46
|
+
return nativeTextAreaRef.current;
|
|
43
47
|
}
|
|
48
|
+
|
|
44
49
|
}));
|
|
45
50
|
useIsomorphicLayoutEffect(() => {
|
|
46
51
|
if (!autoSize) return;
|
|
@@ -1,86 +1,48 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { resolveContainer } from '../../utils/get-container';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { InternalToast } from './toast';
|
|
4
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function unmount(container) {
|
|
9
|
-
const unmountResult = reactUnmount(container);
|
|
10
|
-
|
|
11
|
-
if (unmountResult && container.parentNode) {
|
|
12
|
-
container.parentNode.removeChild(container);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
4
|
+
import { renderImperatively } from '../../utils/render-imperatively';
|
|
5
|
+
let currentHandler = null;
|
|
6
|
+
let currentTimeout = null;
|
|
16
7
|
const defaultProps = {
|
|
17
8
|
duration: 2000,
|
|
18
9
|
position: 'center',
|
|
19
10
|
maskClickable: true
|
|
20
11
|
};
|
|
12
|
+
|
|
13
|
+
const ToastInner = props => React.createElement(InternalToast, Object.assign({}, props));
|
|
14
|
+
|
|
21
15
|
export function show(p) {
|
|
22
16
|
const props = mergeProps(defaultProps, typeof p === 'string' ? {
|
|
23
17
|
content: p
|
|
24
18
|
} : p);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const bodyContainer = resolveContainer(getContainer);
|
|
31
|
-
bodyContainer.appendChild(container);
|
|
32
|
-
clear();
|
|
33
|
-
containers.push(container);
|
|
34
|
-
const TempToast = forwardRef((_, ref) => {
|
|
35
|
-
const [visible, setVisible] = useState(true);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
return () => {
|
|
38
|
-
var _a;
|
|
19
|
+
const element = React.createElement(ToastInner, Object.assign({}, props, {
|
|
20
|
+
onClose: () => {
|
|
21
|
+
currentHandler = null;
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
39
24
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
25
|
+
if (currentHandler) {
|
|
26
|
+
currentHandler.replace(element);
|
|
27
|
+
} else {
|
|
28
|
+
currentHandler = renderImperatively(element);
|
|
29
|
+
}
|
|
47
30
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return () => {
|
|
52
|
-
window.clearTimeout(timer);
|
|
53
|
-
};
|
|
54
|
-
}, []);
|
|
55
|
-
useImperativeHandle(ref, () => ({
|
|
56
|
-
close: () => setVisible(false)
|
|
57
|
-
}));
|
|
58
|
-
return React.createElement(InternalToast, Object.assign({}, props, {
|
|
59
|
-
getContainer: () => container,
|
|
60
|
-
visible: visible,
|
|
61
|
-
afterClose: () => {
|
|
62
|
-
unmount(container);
|
|
63
|
-
}
|
|
64
|
-
}));
|
|
65
|
-
});
|
|
66
|
-
const ref = createRef();
|
|
67
|
-
render(React.createElement(TempToast, {
|
|
68
|
-
ref: ref
|
|
69
|
-
}), container);
|
|
70
|
-
return {
|
|
71
|
-
close: () => {
|
|
72
|
-
var _a;
|
|
31
|
+
if (currentTimeout) {
|
|
32
|
+
window.clearTimeout(currentTimeout);
|
|
33
|
+
}
|
|
73
34
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
35
|
+
if (props.duration !== 0) {
|
|
36
|
+
currentTimeout = window.setTimeout(() => {
|
|
37
|
+
clear();
|
|
38
|
+
}, props.duration);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return currentHandler;
|
|
77
42
|
}
|
|
78
43
|
export function clear() {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (!container) break;
|
|
82
|
-
unmount(container);
|
|
83
|
-
}
|
|
44
|
+
currentHandler === null || currentHandler === void 0 ? void 0 : currentHandler.close();
|
|
45
|
+
currentHandler = null;
|
|
84
46
|
}
|
|
85
47
|
export function config(val) {
|
|
86
48
|
if (val.duration !== undefined) {
|
|
@@ -23,10 +23,14 @@ export const InternalToast = p => {
|
|
|
23
23
|
|
|
24
24
|
switch (icon) {
|
|
25
25
|
case 'success':
|
|
26
|
-
return React.createElement(CheckOutline,
|
|
26
|
+
return React.createElement(CheckOutline, {
|
|
27
|
+
className: `${classPrefix}-icon-success`
|
|
28
|
+
});
|
|
27
29
|
|
|
28
30
|
case 'fail':
|
|
29
|
-
return React.createElement(CloseOutline,
|
|
31
|
+
return React.createElement(CloseOutline, {
|
|
32
|
+
className: `${classPrefix}-icon-fail`
|
|
33
|
+
});
|
|
30
34
|
|
|
31
35
|
case 'loading':
|
|
32
36
|
return React.createElement(SpinLoading, {
|
|
@@ -21,4 +21,8 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
|
|
|
21
21
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
22
22
|
clearable?: boolean | undefined;
|
|
23
23
|
onClear?: (() => void) | undefined;
|
|
24
|
-
} & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> &
|
|
24
|
+
} & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> & {
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color", string>>) | undefined;
|
|
27
|
+
tabIndex?: number | undefined;
|
|
28
|
+
} & React.AriaAttributes & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -44,13 +44,14 @@ export const WaterMark = p => {
|
|
|
44
44
|
const img = new Image();
|
|
45
45
|
img.crossOrigin = 'anonymous';
|
|
46
46
|
img.referrerPolicy = 'no-referrer';
|
|
47
|
-
img.src = image;
|
|
48
47
|
|
|
49
48
|
img.onload = () => {
|
|
50
49
|
ctx.drawImage(img, -imageWidth * ratio / 2, -imageHeight * ratio / 2, imageWidth * ratio, imageHeight * ratio);
|
|
51
50
|
ctx.restore();
|
|
52
51
|
setBase64Url(canvas.toDataURL());
|
|
53
52
|
};
|
|
53
|
+
|
|
54
|
+
img.src = image;
|
|
54
55
|
} else if (content) {
|
|
55
56
|
ctx.textBaseline = 'middle';
|
|
56
57
|
ctx.textAlign = 'center'; // 文字绕中间旋转
|
|
@@ -65,7 +66,7 @@ export const WaterMark = p => {
|
|
|
65
66
|
setBase64Url(canvas.toDataURL());
|
|
66
67
|
}
|
|
67
68
|
} else {
|
|
68
|
-
throw new Error('
|
|
69
|
+
throw new Error('Canvas is not supported in the current environment');
|
|
69
70
|
}
|
|
70
71
|
}, [gapX, gapY, rotate, fontStyle, fontWeight, width, height, fontFamily, fontColor, image, content, fontSize]);
|
|
71
72
|
return withNativeProps(props, React.createElement("div", {
|
package/2x/es/global/global.css
CHANGED
package/2x/es/locales/base.d.ts
CHANGED
package/2x/es/locales/base.js
CHANGED
package/2x/es/locales/en-US.d.ts
CHANGED
package/2x/es/locales/es-ES.d.ts
CHANGED
package/2x/es/locales/fa-IR.d.ts
CHANGED