antd-mobile 5.2.0 → 5.3.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/2x/cjs/components/calendar/calendar.d.ts +1 -28
- package/2x/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/2x/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
- package/2x/cjs/components/cascade-picker/prompt.d.ts +2 -1
- package/2x/cjs/components/collapse/collapse.js +5 -3
- package/2x/cjs/components/date-picker/date-picker.js +7 -1
- package/2x/cjs/components/dialog/dialog.css +27 -18
- package/2x/cjs/components/dialog/dialog.js +39 -42
- package/2x/cjs/components/dropdown/dropdown.css +2 -1
- package/2x/cjs/components/dropdown/item.js +2 -2
- package/2x/cjs/components/ellipsis/ellipsis.d.ts +2 -0
- package/2x/cjs/components/ellipsis/ellipsis.js +8 -5
- package/2x/cjs/components/form/context.d.ts +2 -1
- package/2x/cjs/components/form/context.js +6 -5
- package/2x/cjs/components/form/form-item.css +27 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -0
- package/2x/cjs/components/form/form-item.js +44 -13
- package/2x/cjs/components/form/form.d.ts +2 -2
- package/2x/cjs/components/form/form.js +18 -9
- package/2x/cjs/components/form/index.css +27 -1
- package/2x/cjs/components/form/index.d.ts +2 -2
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +1 -1
- package/2x/cjs/components/image-viewer/index.d.ts +1 -1
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/input/input.js +2 -2
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
- package/2x/cjs/components/mask/mask.js +2 -2
- package/2x/cjs/components/modal/modal.css +27 -21
- package/2x/cjs/components/modal/modal.js +39 -36
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +1 -1
- package/2x/cjs/components/picker/prompt.d.ts +2 -2
- package/2x/cjs/components/popover/arrow.js +1 -2
- package/2x/cjs/components/popover/index.d.ts +3 -3
- package/2x/cjs/components/popover/popover-menu.d.ts +1 -1
- package/2x/cjs/components/popover/popover.d.ts +1 -1
- package/2x/cjs/components/popup/popup.js +2 -2
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/2x/cjs/components/search-bar/search-bar.js +1 -0
- package/2x/cjs/components/selector/selector.d.ts +3 -1
- package/2x/cjs/components/stepper/stepper.d.ts +11 -2
- package/2x/cjs/components/swiper/index.d.ts +3 -3
- package/2x/cjs/components/swiper/swiper.d.ts +3 -3
- package/2x/cjs/components/switch/spin-icon.d.ts +3 -0
- package/2x/cjs/components/switch/spin-icon.js +37 -0
- package/2x/cjs/components/switch/switch.css +1 -1
- package/2x/cjs/components/switch/switch.js +4 -6
- package/2x/cjs/components/tabs/tabs.d.ts +1 -0
- package/2x/cjs/components/tabs/tabs.js +17 -19
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +2 -2
- package/2x/cjs/locales/base.d.ts +51 -0
- package/2x/cjs/locales/base.js +52 -0
- package/2x/cjs/locales/en-US.d.ts +51 -0
- package/2x/cjs/locales/zh-CN.d.ts +51 -0
- package/2x/cjs/locales/zh-CN.js +52 -0
- package/2x/cjs/utils/measure-css-length.js +3 -1
- package/2x/cjs/utils/native-props.d.ts +1 -1
- package/2x/cjs/utils/render-to-container.d.ts +1 -1
- package/2x/cjs/utils/should-render.d.ts +10 -0
- package/{cjs/utils/use-should-render.js → 2x/cjs/utils/should-render.js} +8 -0
- package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -2
- package/2x/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
- package/2x/cjs/utils/use-props-value.d.ts +1 -1
- package/2x/cjs/utils/use-tab-list-scroll.js +3 -1
- package/2x/cjs/utils/use-touch.d.ts +0 -1
- package/2x/cjs/utils/validate.js +1 -1
- package/2x/cjs/utils/with-stop-propagation.d.ts +1 -1
- package/2x/es/components/calendar/calendar.d.ts +1 -28
- package/2x/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/2x/es/components/capsule-tabs/capsule-tabs.js +13 -17
- package/2x/es/components/cascade-picker/prompt.d.ts +2 -1
- package/2x/es/components/collapse/collapse.js +4 -3
- package/2x/es/components/date-picker/date-picker.js +6 -1
- package/2x/es/components/dialog/dialog.css +27 -18
- package/2x/es/components/dialog/dialog.js +37 -41
- package/2x/es/components/dropdown/dropdown.css +2 -1
- package/2x/es/components/dropdown/item.js +1 -1
- package/2x/es/components/ellipsis/ellipsis.d.ts +2 -0
- package/2x/es/components/ellipsis/ellipsis.js +7 -5
- package/2x/es/components/form/context.d.ts +2 -1
- package/2x/es/components/form/context.js +4 -3
- package/2x/es/components/form/form-item.css +27 -1
- package/2x/es/components/form/form-item.d.ts +1 -0
- package/2x/es/components/form/form-item.js +43 -13
- package/2x/es/components/form/form.d.ts +2 -2
- package/2x/es/components/form/form.js +18 -11
- package/2x/es/components/form/index.css +27 -1
- package/2x/es/components/form/index.d.ts +2 -2
- package/2x/es/components/image-viewer/image-viewer.d.ts +1 -1
- package/2x/es/components/image-viewer/index.d.ts +1 -1
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/input/input.js +2 -2
- package/2x/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/2x/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
- package/2x/es/components/mask/mask.js +1 -1
- package/2x/es/components/modal/modal.css +27 -21
- package/2x/es/components/modal/modal.js +37 -36
- package/2x/es/components/passcode-input/passcode-input.d.ts +1 -1
- package/2x/es/components/picker/prompt.d.ts +2 -2
- package/2x/es/components/popover/arrow.js +1 -2
- package/2x/es/components/popover/index.d.ts +3 -3
- package/2x/es/components/popover/popover-menu.d.ts +1 -1
- package/2x/es/components/popover/popover.d.ts +1 -1
- package/2x/es/components/popup/popup.js +1 -1
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/2x/es/components/search-bar/search-bar.js +1 -0
- package/2x/es/components/selector/selector.d.ts +3 -1
- package/2x/es/components/stepper/stepper.d.ts +11 -2
- package/2x/es/components/swiper/index.d.ts +3 -3
- package/2x/es/components/swiper/swiper.d.ts +3 -3
- package/2x/es/components/switch/spin-icon.d.ts +3 -0
- package/2x/es/components/switch/spin-icon.js +23 -0
- package/2x/es/components/switch/switch.css +1 -1
- package/2x/es/components/switch/switch.js +3 -5
- package/2x/es/components/tabs/tabs.d.ts +1 -0
- package/2x/es/components/tabs/tabs.js +16 -20
- package/2x/es/components/virtual-input/virtual-input.d.ts +2 -2
- package/2x/es/locales/base.d.ts +51 -0
- package/2x/es/locales/base.js +52 -0
- package/2x/es/locales/en-US.d.ts +51 -0
- package/2x/es/locales/zh-CN.d.ts +51 -0
- package/2x/es/locales/zh-CN.js +52 -0
- package/2x/es/utils/measure-css-length.js +3 -1
- package/2x/es/utils/native-props.d.ts +1 -1
- package/2x/es/utils/render-to-container.d.ts +1 -1
- package/2x/es/utils/should-render.d.ts +10 -0
- package/2x/es/utils/{use-should-render.js → should-render.js} +4 -0
- package/2x/es/utils/use-drag-and-pinch.d.ts +1 -2
- package/2x/es/utils/use-isomorphic-update-layout-effect.js +1 -2
- package/2x/es/utils/use-props-value.d.ts +1 -1
- package/2x/es/utils/use-tab-list-scroll.js +3 -2
- package/2x/es/utils/use-touch.d.ts +0 -1
- package/2x/es/utils/validate.js +1 -1
- package/2x/es/utils/with-stop-propagation.d.ts +1 -1
- package/2x/package.json +6 -6
- package/cjs/components/calendar/calendar.d.ts +1 -28
- package/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
- package/cjs/components/cascade-picker/prompt.d.ts +2 -1
- package/cjs/components/collapse/collapse.js +5 -3
- package/cjs/components/date-picker/date-picker.js +7 -1
- package/cjs/components/dialog/dialog.css +26 -18
- package/cjs/components/dialog/dialog.js +39 -42
- package/cjs/components/dropdown/dropdown.css +2 -1
- package/cjs/components/dropdown/item.js +2 -2
- package/cjs/components/ellipsis/ellipsis.d.ts +2 -0
- package/cjs/components/ellipsis/ellipsis.js +8 -5
- package/cjs/components/form/context.d.ts +2 -1
- package/cjs/components/form/context.js +6 -5
- package/cjs/components/form/form-item.css +21 -1
- package/cjs/components/form/form-item.d.ts +1 -0
- package/cjs/components/form/form-item.js +44 -13
- package/cjs/components/form/form.d.ts +2 -2
- package/cjs/components/form/form.js +18 -9
- package/cjs/components/form/index.css +21 -1
- package/cjs/components/form/index.d.ts +2 -2
- package/cjs/components/image-viewer/image-viewer.d.ts +1 -1
- package/cjs/components/image-viewer/index.d.ts +1 -1
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/input/input.js +2 -2
- package/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
- package/cjs/components/mask/mask.js +2 -2
- package/cjs/components/modal/modal.css +26 -20
- package/cjs/components/modal/modal.js +39 -36
- package/cjs/components/passcode-input/passcode-input.d.ts +1 -1
- package/cjs/components/picker/prompt.d.ts +2 -2
- package/cjs/components/popover/arrow.js +1 -2
- package/cjs/components/popover/index.d.ts +3 -3
- package/cjs/components/popover/popover-menu.d.ts +1 -1
- package/cjs/components/popover/popover.d.ts +1 -1
- package/cjs/components/popup/popup.js +2 -2
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/cjs/components/search-bar/search-bar.js +1 -0
- package/cjs/components/selector/selector.d.ts +3 -1
- package/cjs/components/stepper/stepper.d.ts +11 -2
- package/cjs/components/swiper/index.d.ts +3 -3
- package/cjs/components/swiper/swiper.d.ts +3 -3
- package/cjs/components/switch/spin-icon.d.ts +3 -0
- package/cjs/components/switch/spin-icon.js +37 -0
- package/cjs/components/switch/switch.css +1 -1
- package/cjs/components/switch/switch.js +4 -6
- package/cjs/components/tabs/tabs.d.ts +1 -0
- package/cjs/components/tabs/tabs.js +17 -19
- package/cjs/components/virtual-input/virtual-input.d.ts +2 -2
- package/cjs/locales/base.d.ts +51 -0
- package/cjs/locales/base.js +52 -0
- package/cjs/locales/en-US.d.ts +51 -0
- package/cjs/locales/zh-CN.d.ts +51 -0
- package/cjs/locales/zh-CN.js +52 -0
- package/cjs/utils/measure-css-length.js +3 -1
- package/cjs/utils/native-props.d.ts +1 -1
- package/cjs/utils/render-to-container.d.ts +1 -1
- package/cjs/utils/should-render.d.ts +10 -0
- package/{2x/cjs/utils/use-should-render.js → cjs/utils/should-render.js} +8 -0
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -2
- package/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
- package/cjs/utils/use-props-value.d.ts +1 -1
- package/cjs/utils/use-tab-list-scroll.js +3 -1
- package/cjs/utils/use-touch.d.ts +0 -1
- package/cjs/utils/validate.js +1 -1
- package/cjs/utils/with-stop-propagation.d.ts +1 -1
- package/es/components/calendar/calendar.d.ts +1 -28
- package/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/es/components/capsule-tabs/capsule-tabs.js +13 -17
- package/es/components/cascade-picker/prompt.d.ts +2 -1
- package/es/components/collapse/collapse.js +4 -3
- package/es/components/date-picker/date-picker.js +6 -1
- package/es/components/dialog/dialog.css +26 -18
- package/es/components/dialog/dialog.js +37 -41
- package/es/components/dropdown/dropdown.css +2 -1
- package/es/components/dropdown/item.js +1 -1
- package/es/components/ellipsis/ellipsis.d.ts +2 -0
- package/es/components/ellipsis/ellipsis.js +7 -5
- package/es/components/form/context.d.ts +2 -1
- package/es/components/form/context.js +4 -3
- package/es/components/form/form-item.css +21 -1
- package/es/components/form/form-item.d.ts +1 -0
- package/es/components/form/form-item.js +43 -13
- package/es/components/form/form.d.ts +2 -2
- package/es/components/form/form.js +18 -11
- package/es/components/form/index.css +21 -1
- package/es/components/form/index.d.ts +2 -2
- package/es/components/image-viewer/image-viewer.d.ts +1 -1
- package/es/components/image-viewer/index.d.ts +1 -1
- package/es/components/input/input.d.ts +2 -2
- package/es/components/input/input.js +2 -2
- package/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
- package/es/components/mask/mask.js +1 -1
- package/es/components/modal/modal.css +26 -20
- package/es/components/modal/modal.js +37 -36
- package/es/components/passcode-input/passcode-input.d.ts +1 -1
- package/es/components/picker/prompt.d.ts +2 -2
- package/es/components/popover/arrow.js +1 -2
- package/es/components/popover/index.d.ts +3 -3
- package/es/components/popover/popover-menu.d.ts +1 -1
- package/es/components/popover/popover.d.ts +1 -1
- package/es/components/popup/popup.js +1 -1
- package/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/es/components/search-bar/search-bar.js +1 -0
- package/es/components/selector/selector.d.ts +3 -1
- package/es/components/stepper/stepper.d.ts +11 -2
- package/es/components/swiper/index.d.ts +3 -3
- package/es/components/swiper/swiper.d.ts +3 -3
- package/es/components/switch/spin-icon.d.ts +3 -0
- package/es/components/switch/spin-icon.js +23 -0
- package/es/components/switch/switch.css +1 -1
- package/es/components/switch/switch.js +3 -5
- package/es/components/tabs/tabs.d.ts +1 -0
- package/es/components/tabs/tabs.js +16 -20
- package/es/components/virtual-input/virtual-input.d.ts +2 -2
- package/es/locales/base.d.ts +51 -0
- package/es/locales/base.js +52 -0
- package/es/locales/en-US.d.ts +51 -0
- package/es/locales/zh-CN.d.ts +51 -0
- package/es/locales/zh-CN.js +52 -0
- package/es/utils/measure-css-length.js +3 -1
- package/es/utils/native-props.d.ts +1 -1
- package/es/utils/render-to-container.d.ts +1 -1
- package/es/utils/should-render.d.ts +10 -0
- package/es/utils/{use-should-render.js → should-render.js} +4 -0
- package/es/utils/use-drag-and-pinch.d.ts +1 -2
- package/es/utils/use-isomorphic-update-layout-effect.js +1 -2
- package/es/utils/use-props-value.d.ts +1 -1
- package/es/utils/use-tab-list-scroll.js +3 -2
- package/es/utils/use-touch.d.ts +0 -1
- package/es/utils/validate.js +1 -1
- package/es/utils/with-stop-propagation.d.ts +1 -1
- package/package.json +6 -6
- package/umd/antd-mobile.js +1 -1
- package/2x/assets/spin.svg +0 -12
- package/2x/cjs/assets/spin.svg +0 -12
- package/2x/cjs/utils/use-should-render.d.ts +0 -1
- package/2x/es/assets/spin.svg +0 -12
- package/2x/es/utils/use-should-render.d.ts +0 -1
- package/assets/spin.svg +0 -12
- package/cjs/assets/spin.svg +0 -12
- package/cjs/utils/use-should-render.d.ts +0 -1
- package/es/assets/spin.svg +0 -12
- package/es/utils/use-should-render.d.ts +0 -1
|
@@ -8,9 +8,9 @@ export type { FormSubscribeProps } from './form-subscribe';
|
|
|
8
8
|
export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
|
|
9
9
|
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & import("../../utils/native-props").NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<import("./context").FormContextType> & {
|
|
10
10
|
footer?: import("react").ReactNode;
|
|
11
|
-
layout?:
|
|
11
|
+
layout?: FormLayout | undefined;
|
|
12
12
|
mode?: "default" | "card" | undefined;
|
|
13
|
-
} & import("react").RefAttributes<
|
|
13
|
+
} & import("react").RefAttributes<import("./form").FormInstance>> & {
|
|
14
14
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
15
15
|
Subscribe: import("react").VFC<import("./form-subscribe").FormSubscribeProps>;
|
|
16
16
|
Header: import("react").FC<{}>;
|
|
@@ -16,7 +16,7 @@ export declare type MultiImageViewerProps = Omit<ImageViewerProps, 'image'> & {
|
|
|
16
16
|
defaultIndex?: number;
|
|
17
17
|
onIndexChange?: (index: number) => void;
|
|
18
18
|
};
|
|
19
|
-
export declare const MultiImageViewer: React.ForwardRefExoticComponent<
|
|
19
|
+
export declare const MultiImageViewer: React.ForwardRefExoticComponent<Omit<ImageViewerProps, "image"> & {
|
|
20
20
|
images?: string[] | undefined;
|
|
21
21
|
defaultIndex?: number | undefined;
|
|
22
22
|
onIndexChange?: ((index: number) => void) | undefined;
|
|
@@ -4,7 +4,7 @@ import { showMultiImageViewer, showImageViewer, clearImageViewer } from './metho
|
|
|
4
4
|
export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
|
|
5
5
|
export type { ImageViewerHandler } from './methods';
|
|
6
6
|
declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
|
|
7
|
-
Multi: import("react").ForwardRefExoticComponent<
|
|
7
|
+
Multi: import("react").ForwardRefExoticComponent<Omit<import("./image-viewer").ImageViewerProps, "image"> & {
|
|
8
8
|
images?: string[] | undefined;
|
|
9
9
|
defaultIndex?: number | undefined;
|
|
10
10
|
onIndexChange?: ((index: number) => void) | undefined;
|
|
@@ -21,7 +21,7 @@ export declare type InputRef = {
|
|
|
21
21
|
focus: () => void;
|
|
22
22
|
blur: () => void;
|
|
23
23
|
};
|
|
24
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<
|
|
24
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
27
27
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedH
|
|
|
32
32
|
onClear?: (() => void) | undefined;
|
|
33
33
|
id?: string | undefined;
|
|
34
34
|
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
35
|
-
enterKeyHint?: "
|
|
35
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
36
36
|
min?: number | undefined;
|
|
37
37
|
max?: number | undefined;
|
|
38
38
|
} & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>;
|
|
@@ -57,7 +57,7 @@ export const Input = forwardRef((p, ref) => {
|
|
|
57
57
|
let nextValue = value;
|
|
58
58
|
|
|
59
59
|
if (props.type === 'number') {
|
|
60
|
-
nextValue = bound(parseFloat(nextValue), props.min, props.max).toString();
|
|
60
|
+
nextValue = nextValue && bound(parseFloat(nextValue), props.min, props.max).toString();
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (nextValue !== value) {
|
|
@@ -105,7 +105,7 @@ export const Input = forwardRef((p, ref) => {
|
|
|
105
105
|
onKeyUp: props.onKeyUp,
|
|
106
106
|
onCompositionStart: props.onCompositionStart,
|
|
107
107
|
onCompositionEnd: props.onCompositionEnd
|
|
108
|
-
}), props.clearable && !!value && !props.readOnly && React.createElement("div", {
|
|
108
|
+
}), props.clearable && !!value && !props.readOnly && hasFocus && React.createElement("div", {
|
|
109
109
|
className: `${classPrefix}-clear`,
|
|
110
110
|
onMouseDown: e => {
|
|
111
111
|
e.preventDefault();
|
|
@@ -6,6 +6,7 @@ import { usePropsValue } from '../../utils/use-props-value';
|
|
|
6
6
|
import { useResizeEffect } from '../../utils/use-resize-effect';
|
|
7
7
|
import { useTabListScroll } from '../../utils/use-tab-list-scroll';
|
|
8
8
|
import ScrollMask from '../scroll-mask';
|
|
9
|
+
import { ShouldRender } from '../../utils/should-render';
|
|
9
10
|
const classPrefix = `adm-jumbo-tabs`;
|
|
10
11
|
export const JumboTab = () => {
|
|
11
12
|
return null;
|
|
@@ -87,22 +88,17 @@ export const JumboTabs = props => {
|
|
|
87
88
|
return null;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
}, pane.props.children);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return null;
|
|
91
|
+
const active = pane.key === activeKey;
|
|
92
|
+
return React.createElement(ShouldRender, {
|
|
93
|
+
key: pane.key,
|
|
94
|
+
active: active,
|
|
95
|
+
forceRender: pane.props.forceRender,
|
|
96
|
+
destroyOnClose: pane.props.destroyOnClose
|
|
97
|
+
}, React.createElement("div", {
|
|
98
|
+
className: `${classPrefix}-content`,
|
|
99
|
+
style: {
|
|
100
|
+
display: active ? 'block' : 'none'
|
|
101
|
+
}
|
|
102
|
+
}, pane.props.children));
|
|
107
103
|
})));
|
|
108
104
|
};
|
|
@@ -6,7 +6,7 @@ import { useSpring, animated } from '@react-spring/web';
|
|
|
6
6
|
import { renderToContainer } from '../../utils/render-to-container';
|
|
7
7
|
import { mergeProps } from '../../utils/with-default-props';
|
|
8
8
|
import { useConfig } from '../config-provider';
|
|
9
|
-
import { useShouldRender } from '../../utils/
|
|
9
|
+
import { useShouldRender } from '../../utils/should-render';
|
|
10
10
|
import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
11
11
|
const classPrefix = `adm-mask`;
|
|
12
12
|
const opacityRecord = {
|
|
@@ -16,48 +16,53 @@
|
|
|
16
16
|
max-width: 75vw;
|
|
17
17
|
transform: translate(-50%, -50%);
|
|
18
18
|
}
|
|
19
|
-
.adm-modal-
|
|
19
|
+
.adm-modal-body {
|
|
20
20
|
width: 100%;
|
|
21
21
|
max-height: 70vh;
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
font-size: 14px;
|
|
24
24
|
background-color: white;
|
|
25
25
|
border-radius: 8px;
|
|
26
|
-
overflow
|
|
27
|
-
overflow-y: auto;
|
|
26
|
+
overflow: hidden;
|
|
28
27
|
display: flex;
|
|
29
28
|
flex-direction: column;
|
|
30
29
|
}
|
|
31
|
-
.adm-modal-
|
|
30
|
+
.adm-modal-body > * {
|
|
32
31
|
flex: none;
|
|
33
32
|
}
|
|
34
|
-
.adm-modal-
|
|
33
|
+
.adm-modal-body > .adm-modal-content {
|
|
35
34
|
flex: auto;
|
|
36
35
|
}
|
|
37
|
-
.adm-modal-
|
|
38
|
-
padding: 20px
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
36
|
+
.adm-modal-body:not(.adm-modal-with-image) {
|
|
37
|
+
padding-top: 20px;
|
|
41
38
|
}
|
|
42
|
-
.adm-modal-
|
|
43
|
-
margin-
|
|
39
|
+
.adm-modal-body .adm-modal-image-container {
|
|
40
|
+
margin-bottom: 12px;
|
|
41
|
+
max-height: 40vh;
|
|
42
|
+
overflow-y: scroll;
|
|
44
43
|
}
|
|
45
|
-
.adm-modal-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
.adm-modal-body .adm-modal-header {
|
|
45
|
+
margin-bottom: 8px;
|
|
46
|
+
padding: 0 12px;
|
|
48
47
|
}
|
|
49
|
-
.adm-modal-
|
|
48
|
+
.adm-modal-body .adm-modal-title {
|
|
49
|
+
margin-bottom: 8px;
|
|
50
|
+
padding: 0 12px;
|
|
50
51
|
font-weight: bold;
|
|
51
52
|
font-size: 18px;
|
|
52
53
|
line-height: 25px;
|
|
53
54
|
text-align: center;
|
|
54
55
|
}
|
|
55
|
-
.adm-modal-
|
|
56
|
+
.adm-modal-body .adm-modal-content {
|
|
57
|
+
padding: 0 12px 12px;
|
|
58
|
+
max-height: 70vh;
|
|
59
|
+
overflow-x: hidden;
|
|
60
|
+
overflow-y: auto;
|
|
56
61
|
font-size: 15px;
|
|
57
62
|
line-height: 1.4;
|
|
58
63
|
color: #333;
|
|
59
64
|
}
|
|
60
|
-
.adm-modal-
|
|
65
|
+
.adm-modal-body .adm-modal-close {
|
|
61
66
|
position: absolute;
|
|
62
67
|
right: 8px;
|
|
63
68
|
top: 8px;
|
|
@@ -69,6 +74,10 @@
|
|
|
69
74
|
user-select: none;
|
|
70
75
|
padding: 8px 12px 12px;
|
|
71
76
|
}
|
|
77
|
+
.adm-modal-footer-empty {
|
|
78
|
+
padding: 0;
|
|
79
|
+
height: 8px;
|
|
80
|
+
}
|
|
72
81
|
.adm-modal-footer.adm-space {
|
|
73
82
|
--gap-vertical: 20px;
|
|
74
83
|
}
|
|
@@ -86,6 +95,3 @@
|
|
|
86
95
|
.adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
|
|
87
96
|
opacity: 0.7;
|
|
88
97
|
}
|
|
89
|
-
.adm-modal-image-container {
|
|
90
|
-
overflow-y: auto;
|
|
91
|
-
}
|
|
@@ -52,49 +52,28 @@ export const Modal = p => {
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
const [active, setActive] = useState(props.visible);
|
|
55
|
-
const
|
|
56
|
-
className:
|
|
57
|
-
style:
|
|
58
|
-
display: active ? 'unset' : 'none'
|
|
59
|
-
}
|
|
60
|
-
}, React.createElement(Mask, {
|
|
61
|
-
visible: props.visible,
|
|
62
|
-
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
63
|
-
style: props.maskStyle,
|
|
64
|
-
className: classNames(`${classPrefix}-mask`, props.maskClassName)
|
|
65
|
-
}), React.createElement("div", {
|
|
66
|
-
className: `${classPrefix}-wrap`,
|
|
67
|
-
style: {
|
|
68
|
-
pointerEvents: props.visible ? 'unset' : 'none'
|
|
69
|
-
}
|
|
70
|
-
}, React.createElement(animated.div, {
|
|
71
|
-
style: Object.assign({}, style),
|
|
72
|
-
onClick: e => e.stopPropagation(),
|
|
73
|
-
className: `${classPrefix}-main`
|
|
55
|
+
const body = React.createElement("div", {
|
|
56
|
+
className: classNames(cls('body'), props.image && cls('with-image'), props.bodyClassName),
|
|
57
|
+
style: props.bodyStyle
|
|
74
58
|
}, props.showCloseButton && React.createElement("a", {
|
|
75
|
-
className: classNames(
|
|
59
|
+
className: classNames(cls('close'), 'adm-plain-anchor'),
|
|
76
60
|
onClick: props.onClose
|
|
77
61
|
}, React.createElement(CloseOutline, null)), !!props.image && React.createElement("div", {
|
|
78
|
-
className:
|
|
62
|
+
className: cls('image-container')
|
|
79
63
|
}, React.createElement(Image, {
|
|
80
64
|
src: props.image,
|
|
81
65
|
alt: 'modal header image',
|
|
82
66
|
width: '100%'
|
|
83
|
-
})), React.createElement("div", {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, props.header)), !!props.title && React.createElement("div", {
|
|
91
|
-
className: `${classPrefix}-body-title`
|
|
92
|
-
}, props.title), !!props.content && React.createElement("div", {
|
|
93
|
-
className: `${classPrefix}-body-content`
|
|
94
|
-
}, typeof props.content === 'string' ? React.createElement(AutoCenter, null, props.content) : props.content)), React.createElement(Space, {
|
|
67
|
+
})), !!props.header && React.createElement("div", {
|
|
68
|
+
className: cls('header')
|
|
69
|
+
}, React.createElement(AutoCenter, null, props.header)), !!props.title && React.createElement("div", {
|
|
70
|
+
className: cls('title')
|
|
71
|
+
}, props.title), React.createElement("div", {
|
|
72
|
+
className: cls('content')
|
|
73
|
+
}, typeof props.content === 'string' ? React.createElement(AutoCenter, null, props.content) : props.content), React.createElement(Space, {
|
|
95
74
|
direction: 'vertical',
|
|
96
75
|
block: true,
|
|
97
|
-
className:
|
|
76
|
+
className: classNames(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
|
|
98
77
|
}, props.actions.map((action, index) => {
|
|
99
78
|
return React.createElement(ModalActionButton, {
|
|
100
79
|
key: action.key,
|
|
@@ -109,6 +88,28 @@ export const Modal = p => {
|
|
|
109
88
|
}
|
|
110
89
|
})
|
|
111
90
|
});
|
|
112
|
-
})))
|
|
91
|
+
})));
|
|
92
|
+
const node = withStopPropagation(props.stopPropagation, withNativeProps(props, React.createElement("div", {
|
|
93
|
+
className: cls(),
|
|
94
|
+
style: {
|
|
95
|
+
display: active ? 'unset' : 'none'
|
|
96
|
+
}
|
|
97
|
+
}, React.createElement(Mask, {
|
|
98
|
+
visible: props.visible,
|
|
99
|
+
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
100
|
+
style: props.maskStyle,
|
|
101
|
+
className: classNames(cls('mask'), props.maskClassName)
|
|
102
|
+
}), React.createElement("div", {
|
|
103
|
+
className: cls('wrap'),
|
|
104
|
+
style: {
|
|
105
|
+
pointerEvents: props.visible ? 'unset' : 'none'
|
|
106
|
+
}
|
|
107
|
+
}, React.createElement(animated.div, {
|
|
108
|
+
style: style
|
|
109
|
+
}, body)))));
|
|
113
110
|
return renderToContainer(props.getContainer, node);
|
|
114
|
-
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
function cls(name = '') {
|
|
114
|
+
return 'adm-modal' + (name && '-') + name;
|
|
115
|
+
}
|
|
@@ -30,6 +30,6 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
|
|
|
30
30
|
seperated?: boolean | undefined;
|
|
31
31
|
onBlur?: (() => void) | undefined;
|
|
32
32
|
onFocus?: (() => void) | undefined;
|
|
33
|
-
keyboard?: React.ReactElement<NumberKeyboardProps, string |
|
|
33
|
+
keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
34
34
|
onFill?: ((val: string) => void) | undefined;
|
|
35
35
|
} & NativeProps<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PickerProps } from './index';
|
|
2
|
-
export declare function prompt(props: Omit<PickerProps, 'value' | 'visible' | 'children'>): Promise<
|
|
1
|
+
import type { PickerProps, PickerValue } from './index';
|
|
2
|
+
export declare function prompt(props: Omit<PickerProps, 'value' | 'visible' | 'children'>): Promise<PickerValue[] | null>;
|
|
@@ -4,9 +4,8 @@ export const Arrow = memo(props => {
|
|
|
4
4
|
return withNativeProps(props, React.createElement("svg", {
|
|
5
5
|
viewBox: '0 0 30 16'
|
|
6
6
|
}, React.createElement("g", {
|
|
7
|
-
transform: 'translate(-1300.000000, -841.000000)',
|
|
8
7
|
fill: 'currentColor'
|
|
9
8
|
}, React.createElement("path", {
|
|
10
|
-
d: '
|
|
9
|
+
d: 'M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z'
|
|
11
10
|
}))));
|
|
12
11
|
});
|
|
@@ -4,16 +4,16 @@ import './popover-menu.less';
|
|
|
4
4
|
export type { PopoverProps, PopoverRef } from './popover';
|
|
5
5
|
export type { PopoverMenuProps, Action } from './popover-menu';
|
|
6
6
|
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
7
|
-
getContainer?:
|
|
7
|
+
getContainer?: import("../../utils/render-to-container").GetContainer | undefined;
|
|
8
8
|
destroyOnHide?: boolean | undefined;
|
|
9
|
-
children: import("react").ReactElement<any, string |
|
|
9
|
+
children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
10
10
|
mode?: "dark" | "light" | undefined;
|
|
11
11
|
trigger?: "click" | undefined;
|
|
12
12
|
placement?: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
|
|
13
13
|
stopPropagation?: "click"[] | undefined;
|
|
14
14
|
content: import("react").ReactNode;
|
|
15
15
|
} & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "align" | "defaultVisible" | "onVisibleChange"> & import("../../utils/native-props").NativeProps<"--z-index"> & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
16
|
-
Menu: import("react").ForwardRefExoticComponent<
|
|
16
|
+
Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
|
|
17
17
|
actions: import("./popover-menu").Action[];
|
|
18
18
|
onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
|
|
19
19
|
} & import("react").RefAttributes<import("./popover").PopoverRef>>;
|
|
@@ -11,7 +11,7 @@ export declare type PopoverMenuProps = Omit<PopoverProps, 'content'> & {
|
|
|
11
11
|
actions: Action[];
|
|
12
12
|
onAction?: (item: Action) => void;
|
|
13
13
|
};
|
|
14
|
-
export declare const PopoverMenu: React.ForwardRefExoticComponent<
|
|
14
|
+
export declare const PopoverMenu: React.ForwardRefExoticComponent<Omit<PopoverProps, "content"> & {
|
|
15
15
|
actions: Action[];
|
|
16
16
|
onAction?: ((item: Action) => void) | undefined;
|
|
17
17
|
} & React.RefAttributes<PopoverRef>>;
|
|
@@ -19,7 +19,7 @@ export declare type PopoverRef = {
|
|
|
19
19
|
visible: boolean;
|
|
20
20
|
};
|
|
21
21
|
export declare const Popover: React.ForwardRefExoticComponent<{
|
|
22
|
-
getContainer?:
|
|
22
|
+
getContainer?: GetContainer | undefined;
|
|
23
23
|
destroyOnHide?: boolean | undefined;
|
|
24
24
|
children: ReactElement;
|
|
25
25
|
mode?: "dark" | "light" | undefined;
|
|
@@ -7,7 +7,7 @@ import Mask from '../mask';
|
|
|
7
7
|
import { useLockScroll } from '../../utils/use-lock-scroll';
|
|
8
8
|
import { renderToContainer } from '../../utils/render-to-container';
|
|
9
9
|
import { useSpring, animated } from '@react-spring/web';
|
|
10
|
-
import { useShouldRender } from '../../utils/
|
|
10
|
+
import { useShouldRender } from '../../utils/should-render';
|
|
11
11
|
import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
12
12
|
const classPrefix = `adm-popup`;
|
|
13
13
|
const defaultProps = {
|
|
@@ -108,7 +108,7 @@ export const PullToRefresh = p => {
|
|
|
108
108
|
if (!element) return;
|
|
109
109
|
const scrollParent = getScrollParent(element);
|
|
110
110
|
if (!scrollParent) return;
|
|
111
|
-
const top = 'scrollTop' in scrollParent ? scrollParent.scrollTop : scrollParent.
|
|
111
|
+
const top = 'scrollTop' in scrollParent ? scrollParent.scrollTop : scrollParent.scrollY;
|
|
112
112
|
|
|
113
113
|
if (top <= 0 && y > 0) {
|
|
114
114
|
pullingRef.current = true;
|
|
@@ -45,6 +45,7 @@ export const SearchBar = forwardRef((p, ref) => {
|
|
|
45
45
|
|
|
46
46
|
const renderCancelButton = () => {
|
|
47
47
|
let isShowCancel = false;
|
|
48
|
+
const showCancelButton = props.showCancelButton;
|
|
48
49
|
|
|
49
50
|
if (typeof props.showCancelButton === 'function') {
|
|
50
51
|
isShowCancel = props.showCancelButton(hasFocus, value);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
declare type SelectorValue = string | number;
|
|
3
4
|
export interface SelectorOption<V> {
|
|
4
5
|
label: ReactNode;
|
|
5
6
|
description?: ReactNode;
|
|
@@ -18,4 +19,5 @@ export declare type SelectorProps<V> = {
|
|
|
18
19
|
}) => void;
|
|
19
20
|
showCheckMark?: boolean;
|
|
20
21
|
} & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
|
|
21
|
-
export declare const Selector: <V extends
|
|
22
|
+
export declare const Selector: <V extends SelectorValue>(p: SelectorProps<V>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
23
|
+
export {};
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { InputProps } from '../input';
|
|
4
|
-
|
|
4
|
+
declare type ValueProps = {
|
|
5
|
+
allowEmpty: true;
|
|
5
6
|
value?: number | null;
|
|
6
7
|
defaultValue?: number | null;
|
|
7
8
|
onChange?: (value: number | null) => void;
|
|
9
|
+
};
|
|
10
|
+
declare type ValuePropsWithNull = {
|
|
11
|
+
allowEmpty?: false;
|
|
12
|
+
value?: number;
|
|
13
|
+
defaultValue?: number;
|
|
14
|
+
onChange?: (value: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare type StepperProps = Pick<InputProps, 'onFocus' | 'onBlur'> & (ValuePropsWithNull | ValueProps) & {
|
|
8
17
|
min?: number;
|
|
9
18
|
max?: number;
|
|
10
19
|
step?: number;
|
|
11
20
|
digits?: number;
|
|
12
21
|
disabled?: boolean;
|
|
13
22
|
inputReadOnly?: boolean;
|
|
14
|
-
allowEmpty?: boolean;
|
|
15
23
|
} & NativeProps<'--height' | '--input-width' | '--input-font-size' | '--input-background-color' | '--border-radius' | '--border' | '--border-inner' | '--active-border' | '--button-font-size' | '--button-background-color' | '--button-width' | '--input-font-color' | '--button-text-color'>;
|
|
16
24
|
export declare const Stepper: FC<StepperProps>;
|
|
25
|
+
export {};
|
|
@@ -7,15 +7,15 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
7
7
|
autoplay?: boolean | undefined;
|
|
8
8
|
autoplayInterval?: number | undefined;
|
|
9
9
|
loop?: boolean | undefined;
|
|
10
|
-
direction?: "
|
|
10
|
+
direction?: "vertical" | "horizontal" | undefined;
|
|
11
11
|
onIndexChange?: ((index: number) => void) | undefined;
|
|
12
|
-
indicatorProps?: Pick<import("../page-indicator").PageIndicatorProps, "style" | "
|
|
12
|
+
indicatorProps?: Pick<import("../page-indicator").PageIndicatorProps, "style" | "className" | "color"> | undefined;
|
|
13
13
|
indicator?: ((total: number, current: number) => import("react").ReactNode) | undefined;
|
|
14
14
|
slideSize?: number | undefined;
|
|
15
15
|
trackOffset?: number | undefined;
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
|
-
children?: import("react").ReactElement<any, string |
|
|
18
|
+
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
19
|
} & import("../../utils/native-props").NativeProps<"--border-radius" | "--width" | "--height" | "--track-padding"> & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
20
|
Item: import("react").FC<{
|
|
21
21
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
@@ -28,13 +28,13 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
28
28
|
autoplay?: boolean | undefined;
|
|
29
29
|
autoplayInterval?: number | undefined;
|
|
30
30
|
loop?: boolean | undefined;
|
|
31
|
-
direction?: "
|
|
31
|
+
direction?: "vertical" | "horizontal" | undefined;
|
|
32
32
|
onIndexChange?: ((index: number) => void) | undefined;
|
|
33
|
-
indicatorProps?: Pick<PageIndicatorProps, "style" | "
|
|
33
|
+
indicatorProps?: Pick<PageIndicatorProps, "style" | "className" | "color"> | undefined;
|
|
34
34
|
indicator?: ((total: number, current: number) => ReactNode) | undefined;
|
|
35
35
|
slideSize?: number | undefined;
|
|
36
36
|
trackOffset?: number | undefined;
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
|
-
children?: React.ReactElement<any, string |
|
|
39
|
+
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
40
|
} & NativeProps<"--border-radius" | "--width" | "--height" | "--track-padding"> & React.RefAttributes<SwiperRef>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
export const SpinIcon = memo(props => {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
width: '28px',
|
|
6
|
+
height: '28px',
|
|
7
|
+
viewBox: '0 0 28 28'
|
|
8
|
+
}, React.createElement("g", {
|
|
9
|
+
stroke: 'none',
|
|
10
|
+
strokeWidth: '1',
|
|
11
|
+
fill: 'none',
|
|
12
|
+
fillRule: 'evenodd'
|
|
13
|
+
}, React.createElement("g", {
|
|
14
|
+
transform: 'translate(-137.000000, -840.000000)',
|
|
15
|
+
fill: '#1576FE'
|
|
16
|
+
}, React.createElement("g", {
|
|
17
|
+
transform: 'translate(80.000000, 823.000000)'
|
|
18
|
+
}, React.createElement("g", {
|
|
19
|
+
transform: 'translate(53.000000, 13.000000)'
|
|
20
|
+
}, React.createElement("path", {
|
|
21
|
+
d: 'M17.9996753,31.5 C10.5556724,31.5 4.5,25.4443275 4.5,18.0003247 C4.5,10.5563219 10.5556724,4.5 17.9996753,4.5 C18.5355492,4.5 18.9702974,4.93474816 18.9702974,5.47062208 C18.9702974,6.006496 18.5355492,6.44124416 17.9996753,6.44124416 C11.6261524,6.44124416 6.44124416,11.6267709 6.44124416,18.0002938 C6.44124416,24.3738167 11.6261524,29.5587249 17.9996753,29.5587249 C24.3731982,29.5587249 29.5587249,24.3738167 29.5587249,18.0002938 C29.5587249,14.7964616 28.2778291,11.8169616 25.9523687,9.61220279 C25.5637302,9.24317094 25.5473089,8.62893223 25.9157222,8.23967523 C26.2841356,7.84976878 26.8989928,7.83461537 27.2882498,8.20302872 C30.0042351,10.7787368 31.5,14.2580826 31.5,18.0002938 C31.5,25.4443275 25.4436781,31.5 17.9996753,31.5 Z'
|
|
22
|
+
})))))));
|
|
23
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import SpinIcon from '../../assets/spin.svg';
|
|
5
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
6
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
7
6
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
|
+
import { SpinIcon } from './spin-icon';
|
|
8
8
|
const classPrefix = `adm-switch`;
|
|
9
9
|
const defaultProps = {
|
|
10
10
|
defaultChecked: false
|
|
@@ -54,10 +54,8 @@ export const Switch = p => {
|
|
|
54
54
|
className: `${classPrefix}-checkbox`
|
|
55
55
|
}, React.createElement("div", {
|
|
56
56
|
className: `${classPrefix}-handle`
|
|
57
|
-
}, (props.loading || changing) && React.createElement(
|
|
58
|
-
|
|
59
|
-
className: `${classPrefix}-icon`,
|
|
60
|
-
alt: 'switch-handle'
|
|
57
|
+
}, (props.loading || changing) && React.createElement(SpinIcon, {
|
|
58
|
+
className: `${classPrefix}-spin-icon`
|
|
61
59
|
})), React.createElement("div", {
|
|
62
60
|
className: `${classPrefix}-inner`
|
|
63
61
|
}, checked ? props.checkedText : props.uncheckedText))));
|