antd-mobile 5.17.2 → 5.20.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/bundle/antd-mobile.cjs.js +47 -19174
- package/2x/bundle/antd-mobile.compatible.umd.js +25815 -0
- package/2x/bundle/antd-mobile.es.js +16532 -17127
- package/2x/bundle/antd-mobile.umd.js +64 -0
- package/2x/bundle/style.css +237 -273
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/cjs/components/button/button.js +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +3 -3
- package/2x/cjs/components/calendar/index.d.ts +1 -1
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
- package/2x/cjs/components/dialog/show.d.ts +1 -1
- package/2x/cjs/components/form/context.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +9 -4
- package/2x/cjs/components/image/test/image.test.js +57 -8
- package/2x/cjs/components/image-viewer/slide.js +75 -56
- package/2x/cjs/components/input/input.js +9 -2
- package/2x/cjs/components/modal/show.d.ts +1 -1
- package/2x/cjs/components/notice-bar/notice-bar.css +9 -0
- package/2x/cjs/components/notice-bar/notice-bar.js +5 -3
- package/2x/cjs/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/cjs/components/passcode-input/index.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.css +12 -12
- package/2x/cjs/components/passcode-input/passcode-input.js +16 -8
- package/2x/cjs/components/rate/rate.css +1 -0
- package/2x/cjs/components/rate/rate.js +38 -5
- package/2x/cjs/components/rate/star.js +0 -10
- package/2x/cjs/components/result/result.d.ts +1 -1
- package/2x/cjs/components/result/result.js +7 -1
- package/2x/cjs/components/search-bar/search-bar.js +12 -2
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/cjs/components/swipe-action/swipe-action.js +34 -6
- package/2x/cjs/components/swiper/swiper.js +14 -0
- package/2x/cjs/components/switch/switch.d.ts +2 -1
- package/2x/cjs/components/switch/switch.js +16 -3
- package/2x/cjs/locales/base.d.ts +9 -0
- package/2x/cjs/locales/base.js +9 -0
- package/2x/cjs/locales/en-US.d.ts +9 -0
- package/2x/cjs/locales/es-ES.d.ts +9 -0
- package/2x/cjs/locales/fa-IR.d.ts +9 -0
- package/2x/cjs/locales/fr-FR.d.ts +9 -0
- package/2x/cjs/locales/id-ID.d.ts +9 -0
- package/2x/cjs/locales/id-ID.js +13 -0
- package/2x/cjs/locales/kk-KZ.d.ts +9 -0
- package/2x/cjs/locales/ko-KR.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.js +9 -0
- package/2x/cjs/locales/zh-HK.d.ts +9 -0
- package/2x/cjs/locales/zh-TW.d.ts +9 -0
- package/2x/cjs/utils/matrix.d.ts +10 -0
- package/2x/cjs/utils/matrix.js +60 -0
- package/2x/cjs/utils/merge-locale.d.ts +1 -1
- package/2x/cjs/utils/merge-locale.js +15 -5
- package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/cjs/utils/use-props-value.js +1 -1
- package/2x/cjs/utils/use-resize-effect.js +3 -1
- package/2x/cjs/utils/with-default-props.js +2 -6
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/es/components/button/button.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +3 -3
- package/2x/es/components/calendar/index.d.ts +1 -1
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/es/components/cascader-view/cascader-view.js +2 -1
- package/2x/es/components/dialog/show.d.ts +1 -1
- package/2x/es/components/form/context.d.ts +1 -1
- package/2x/es/components/form/form-item.js +8 -4
- package/2x/es/components/image/test/image.test.js +54 -8
- package/2x/es/components/image-viewer/slide.js +73 -56
- package/2x/es/components/input/input.js +8 -2
- package/2x/es/components/modal/show.d.ts +1 -1
- package/2x/es/components/notice-bar/notice-bar.css +9 -0
- package/2x/es/components/notice-bar/notice-bar.js +5 -3
- package/2x/es/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/es/components/passcode-input/index.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.css +12 -12
- package/2x/es/components/passcode-input/passcode-input.js +15 -8
- package/2x/es/components/rate/rate.css +1 -0
- package/2x/es/components/rate/rate.js +32 -5
- package/2x/es/components/rate/star.js +0 -10
- package/2x/es/components/result/result.d.ts +1 -1
- package/2x/es/components/result/result.js +6 -1
- package/2x/es/components/search-bar/search-bar.js +12 -2
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/es/components/swipe-action/swipe-action.js +34 -6
- package/2x/es/components/swiper/swiper.js +14 -0
- package/2x/es/components/switch/switch.d.ts +2 -1
- package/2x/es/components/switch/switch.js +15 -3
- package/2x/es/locales/base.d.ts +9 -0
- package/2x/es/locales/base.js +9 -0
- package/2x/es/locales/en-US.d.ts +9 -0
- package/2x/es/locales/es-ES.d.ts +9 -0
- package/2x/es/locales/fa-IR.d.ts +9 -0
- package/2x/es/locales/fr-FR.d.ts +9 -0
- package/2x/es/locales/id-ID.d.ts +9 -0
- package/2x/es/locales/id-ID.js +13 -0
- package/2x/es/locales/kk-KZ.d.ts +9 -0
- package/2x/es/locales/ko-KR.d.ts +9 -0
- package/2x/es/locales/zh-CN.d.ts +9 -0
- package/2x/es/locales/zh-CN.js +9 -0
- package/2x/es/locales/zh-HK.d.ts +9 -0
- package/2x/es/locales/zh-TW.d.ts +9 -0
- package/2x/es/utils/matrix.d.ts +10 -0
- package/2x/es/utils/matrix.js +27 -0
- package/2x/es/utils/merge-locale.d.ts +1 -1
- package/2x/es/utils/merge-locale.js +17 -3
- package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/es/utils/use-props-value.js +1 -1
- package/2x/es/utils/use-resize-effect.js +3 -1
- package/2x/es/utils/with-default-props.js +2 -4
- package/2x/package.json +6 -6
- package/2x/umd/antd-mobile.js +25815 -2
- package/bundle/antd-mobile.cjs.js +47 -19174
- package/bundle/antd-mobile.compatible.umd.js +25815 -0
- package/bundle/antd-mobile.es.js +16532 -17127
- package/bundle/antd-mobile.umd.js +64 -0
- package/bundle/style.css +1 -4080
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/cjs/components/button/button.js +1 -1
- package/cjs/components/calendar/calendar.d.ts +3 -3
- package/cjs/components/calendar/index.d.ts +1 -1
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/cjs/components/cascader-view/cascader-view.js +2 -1
- package/cjs/components/dialog/show.d.ts +1 -1
- package/cjs/components/form/context.d.ts +1 -1
- package/cjs/components/form/form-item.js +9 -4
- package/cjs/components/image/test/image.test.js +57 -8
- package/cjs/components/image-viewer/slide.js +75 -56
- package/cjs/components/input/input.js +9 -2
- package/cjs/components/modal/show.d.ts +1 -1
- package/cjs/components/notice-bar/notice-bar.css +8 -0
- package/cjs/components/notice-bar/notice-bar.js +5 -3
- package/cjs/components/number-keyboard/number-keyboard.css +11 -14
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/cjs/components/passcode-input/index.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.css +12 -12
- package/cjs/components/passcode-input/passcode-input.js +16 -8
- package/cjs/components/rate/rate.css +1 -0
- package/cjs/components/rate/rate.js +38 -5
- package/cjs/components/rate/star.js +0 -10
- package/cjs/components/result/result.d.ts +1 -1
- package/cjs/components/result/result.js +7 -1
- package/cjs/components/search-bar/search-bar.js +12 -2
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/cjs/components/swipe-action/swipe-action.js +34 -6
- package/cjs/components/swiper/swiper.js +14 -0
- package/cjs/components/switch/switch.d.ts +2 -1
- package/cjs/components/switch/switch.js +16 -3
- package/cjs/locales/base.d.ts +9 -0
- package/cjs/locales/base.js +9 -0
- package/cjs/locales/en-US.d.ts +9 -0
- package/cjs/locales/es-ES.d.ts +9 -0
- package/cjs/locales/fa-IR.d.ts +9 -0
- package/cjs/locales/fr-FR.d.ts +9 -0
- package/cjs/locales/id-ID.d.ts +9 -0
- package/cjs/locales/id-ID.js +13 -0
- package/cjs/locales/kk-KZ.d.ts +9 -0
- package/cjs/locales/ko-KR.d.ts +9 -0
- package/cjs/locales/zh-CN.d.ts +9 -0
- package/cjs/locales/zh-CN.js +9 -0
- package/cjs/locales/zh-HK.d.ts +9 -0
- package/cjs/locales/zh-TW.d.ts +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +60 -0
- package/cjs/utils/merge-locale.d.ts +1 -1
- package/cjs/utils/merge-locale.js +15 -5
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/cjs/utils/use-props-value.js +1 -1
- package/cjs/utils/use-resize-effect.js +3 -1
- package/cjs/utils/with-default-props.js +2 -6
- package/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/calendar/calendar.d.ts +3 -3
- package/es/components/calendar/index.d.ts +1 -1
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/es/components/cascader-view/cascader-view.js +2 -1
- package/es/components/dialog/show.d.ts +1 -1
- package/es/components/form/context.d.ts +1 -1
- package/es/components/form/form-item.js +8 -4
- package/es/components/image/test/image.test.js +54 -8
- package/es/components/image-viewer/slide.js +73 -56
- package/es/components/input/input.js +8 -2
- package/es/components/modal/show.d.ts +1 -1
- package/es/components/notice-bar/notice-bar.css +8 -0
- package/es/components/notice-bar/notice-bar.js +5 -3
- package/es/components/number-keyboard/number-keyboard.css +11 -14
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +19 -17
- package/es/components/passcode-input/index.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.css +12 -12
- package/es/components/passcode-input/passcode-input.js +15 -8
- package/es/components/rate/rate.css +1 -0
- package/es/components/rate/rate.js +32 -5
- package/es/components/rate/star.js +0 -10
- package/es/components/result/result.d.ts +1 -1
- package/es/components/result/result.js +6 -1
- package/es/components/search-bar/search-bar.js +12 -2
- package/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/es/components/swipe-action/swipe-action.js +34 -6
- package/es/components/swiper/swiper.js +14 -0
- package/es/components/switch/switch.d.ts +2 -1
- package/es/components/switch/switch.js +15 -3
- package/es/locales/base.d.ts +9 -0
- package/es/locales/base.js +9 -0
- package/es/locales/en-US.d.ts +9 -0
- package/es/locales/es-ES.d.ts +9 -0
- package/es/locales/fa-IR.d.ts +9 -0
- package/es/locales/fr-FR.d.ts +9 -0
- package/es/locales/id-ID.d.ts +9 -0
- package/es/locales/id-ID.js +13 -0
- package/es/locales/kk-KZ.d.ts +9 -0
- package/es/locales/ko-KR.d.ts +9 -0
- package/es/locales/zh-CN.d.ts +9 -0
- package/es/locales/zh-CN.js +9 -0
- package/es/locales/zh-HK.d.ts +9 -0
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +27 -0
- package/es/utils/merge-locale.d.ts +1 -1
- package/es/utils/merge-locale.js +17 -3
- package/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/es/utils/use-props-value.js +1 -1
- package/es/utils/use-resize-effect.js +3 -1
- package/es/utils/with-default-props.js +2 -4
- package/package.json +6 -6
- package/umd/antd-mobile.js +1 -1
- package/2x/umd/antd-mobile.js.LICENSE.txt +0 -35
|
@@ -27,4 +27,4 @@ export declare const ActionSheet: FC<ActionSheetProps>;
|
|
|
27
27
|
export declare type ActionSheetShowHandler = {
|
|
28
28
|
close: () => void;
|
|
29
29
|
};
|
|
30
|
-
export declare function showActionSheet(props: Omit<ActionSheetProps, 'visible'>): ActionSheetShowHandler;
|
|
30
|
+
export declare function showActionSheet(props: Omit<ActionSheetProps, 'visible' | 'destroyOnClose' | 'forceRender'>): ActionSheetShowHandler;
|
|
@@ -88,6 +88,6 @@ const Button = (0, _react.forwardRef)((p, ref) => {
|
|
|
88
88
|
onTouchEnd: props.onTouchEnd
|
|
89
89
|
}, loading ? _react.default.createElement("div", {
|
|
90
90
|
className: `${classPrefix}-loading-wrapper`
|
|
91
|
-
}, props.loadingIcon, props.loadingText) : props.children));
|
|
91
|
+
}, props.loadingIcon, props.loadingText) : _react.default.createElement("span", null, props.children)));
|
|
92
92
|
});
|
|
93
93
|
exports.Button = Button;
|
|
@@ -4,7 +4,7 @@ declare type Page = {
|
|
|
4
4
|
month: number;
|
|
5
5
|
year: number;
|
|
6
6
|
};
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type CalendarRef = {
|
|
8
8
|
jumpTo: (page: Page | ((page: Page) => Page)) => void;
|
|
9
9
|
jumpToToday: () => void;
|
|
10
10
|
};
|
|
@@ -15,7 +15,7 @@ export declare type CalendarProps = {
|
|
|
15
15
|
nextYearButton?: React.ReactNode;
|
|
16
16
|
onPageChange?: (year: number, month: number) => void;
|
|
17
17
|
weekStartsOn?: 'Monday' | 'Sunday';
|
|
18
|
-
renderLabel?: (date: Date) =>
|
|
18
|
+
renderLabel?: (date: Date) => React.ReactNode;
|
|
19
19
|
allowClear?: boolean;
|
|
20
20
|
max?: Date;
|
|
21
21
|
min?: Date;
|
|
@@ -36,5 +36,5 @@ export declare type CalendarProps = {
|
|
|
36
36
|
defaultValue?: [Date, Date] | null;
|
|
37
37
|
onChange?: (val: [Date, Date] | null) => void;
|
|
38
38
|
}) & NativeProps;
|
|
39
|
-
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<
|
|
39
|
+
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<CalendarRef>>;
|
|
40
40
|
export {};
|
|
@@ -23,6 +23,7 @@ export declare type CascaderProps = {
|
|
|
23
23
|
cancelText?: ReactNode;
|
|
24
24
|
children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
|
|
25
25
|
onTabsChange?: (index: number) => void;
|
|
26
|
+
activeIcon?: ReactNode;
|
|
26
27
|
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'destroyOnClose' | 'forceRender'> & NativeProps;
|
|
27
28
|
export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
28
29
|
options: CascaderOption[];
|
|
@@ -39,6 +40,7 @@ export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
|
39
40
|
cancelText?: ReactNode;
|
|
40
41
|
children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
|
|
41
42
|
onTabsChange?: ((index: number) => void) | undefined;
|
|
43
|
+
activeIcon?: ReactNode;
|
|
42
44
|
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
43
45
|
className?: string | undefined;
|
|
44
46
|
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
@@ -18,6 +18,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
18
18
|
cancelText?: import("react").ReactNode;
|
|
19
19
|
children?: ((items: (import("../cascader-view").CascaderOption | null)[], actions: import("./cascader").CascaderActions) => import("react").ReactNode) | undefined;
|
|
20
20
|
onTabsChange?: ((index: number) => void) | undefined;
|
|
21
|
+
activeIcon?: import("react").ReactNode;
|
|
21
22
|
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
22
23
|
className?: string | undefined;
|
|
23
24
|
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type CascaderValue = string;
|
|
4
4
|
export declare type CascaderOption = {
|
|
@@ -18,5 +18,6 @@ export declare type CascaderViewProps = {
|
|
|
18
18
|
onChange?: (value: CascaderValue[], extend: CascaderValueExtend) => void;
|
|
19
19
|
placeholder?: string;
|
|
20
20
|
onTabsChange?: (index: number) => void;
|
|
21
|
+
activeIcon?: ReactNode;
|
|
21
22
|
} & NativeProps<'--height'>;
|
|
22
23
|
export declare const CascaderView: FC<CascaderViewProps>;
|
|
@@ -147,7 +147,8 @@ const CascaderView = p => {
|
|
|
147
147
|
animated: true
|
|
148
148
|
})) : _react.default.createElement(_checkList.default, {
|
|
149
149
|
value: [value[index]],
|
|
150
|
-
onChange: selectValue => onItemSelect(selectValue[0], index)
|
|
150
|
+
onChange: selectValue => onItemSelect(selectValue[0], index),
|
|
151
|
+
activeIcon: props.activeIcon
|
|
151
152
|
}, level.options.map(option => {
|
|
152
153
|
const active = value[index] === option.value;
|
|
153
154
|
return _react.default.createElement(_checkList.default.Item, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DialogProps } from './dialog';
|
|
2
|
-
export declare type DialogShowProps = Omit<DialogProps, 'visible'>;
|
|
2
|
+
export declare type DialogShowProps = Omit<DialogProps, 'visible' | 'destroyOnClose' | 'forceRender'>;
|
|
3
3
|
export declare type DialogShowHandler = {
|
|
4
4
|
close: () => void;
|
|
5
5
|
};
|
|
@@ -5,7 +5,7 @@ export declare type FormContextType = {
|
|
|
5
5
|
name?: string;
|
|
6
6
|
hasFeedback: boolean;
|
|
7
7
|
layout: FormLayout;
|
|
8
|
-
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional';
|
|
8
|
+
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional' | 'none';
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const defaultFormContext: FormContextType;
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _nativeProps = require("../../utils/native-props");
|
|
15
|
+
|
|
14
16
|
var _rcFieldForm = require("rc-field-form");
|
|
15
17
|
|
|
16
18
|
var _FieldContext = _interopRequireDefault(require("rc-field-form/lib/FieldContext"));
|
|
@@ -89,6 +91,9 @@ const FormItemLayout = props => {
|
|
|
89
91
|
className: `${classPrefix}-required-text`
|
|
90
92
|
}, "(", locale.Form.optional, ")");
|
|
91
93
|
|
|
94
|
+
case 'none':
|
|
95
|
+
return null;
|
|
96
|
+
|
|
92
97
|
default:
|
|
93
98
|
return null;
|
|
94
99
|
}
|
|
@@ -114,7 +119,7 @@ const FormItemLayout = props => {
|
|
|
114
119
|
key: `warning-${index}`,
|
|
115
120
|
className: `${classPrefix}-feedback-warning`
|
|
116
121
|
}, warning)))) : null;
|
|
117
|
-
return _react.default.createElement(_list.default.Item, {
|
|
122
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_list.default.Item, {
|
|
118
123
|
style: style,
|
|
119
124
|
title: layout === 'vertical' && labelElement,
|
|
120
125
|
prefix: layout === 'horizontal' && labelElement,
|
|
@@ -132,7 +137,7 @@ const FormItemLayout = props => {
|
|
|
132
137
|
className: (0, _classnames.default)(`${classPrefix}-child`, `${classPrefix}-child-position-${childElementPosition}`)
|
|
133
138
|
}, _react.default.createElement("div", {
|
|
134
139
|
className: (0, _classnames.default)(`${classPrefix}-child-inner`)
|
|
135
|
-
}, children)));
|
|
140
|
+
}, children))));
|
|
136
141
|
};
|
|
137
142
|
|
|
138
143
|
const FormItem = props => {
|
|
@@ -223,7 +228,7 @@ const FormItem = props => {
|
|
|
223
228
|
|
|
224
229
|
return subWarnings;
|
|
225
230
|
}, curWarnings);
|
|
226
|
-
return _react.default.createElement(FormItemLayout, {
|
|
231
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(FormItemLayout, {
|
|
227
232
|
className: className,
|
|
228
233
|
style: style,
|
|
229
234
|
label: label,
|
|
@@ -244,7 +249,7 @@ const FormItem = props => {
|
|
|
244
249
|
arrow: arrow
|
|
245
250
|
}, _react.default.createElement(_context.NoStyleItemContext.Provider, {
|
|
246
251
|
value: onSubMetaChange
|
|
247
|
-
}, baseChildren));
|
|
252
|
+
}, baseChildren)));
|
|
248
253
|
}
|
|
249
254
|
|
|
250
255
|
const isRenderProps = typeof children === 'function';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _tslib = require("tslib");
|
|
4
|
-
|
|
5
3
|
var _react = _interopRequireDefault(require("react"));
|
|
6
4
|
|
|
7
5
|
var _testing = require("testing");
|
|
@@ -10,13 +8,9 @@ var _index = _interopRequireDefault(require("../index"));
|
|
|
10
8
|
|
|
11
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
10
|
|
|
11
|
+
const classPrefix = `adm-image`;
|
|
13
12
|
const demoSrc = 'https://images.unsplash.com/photo-1567945716310-4745a6b7844b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=300&q=60';
|
|
14
|
-
describe('
|
|
15
|
-
test('a11y', () => (0, _tslib.__awaiter)(void 0, void 0, void 0, function* () {
|
|
16
|
-
yield (0, _testing.testA11y)(_react.default.createElement(_index.default, {
|
|
17
|
-
src: demoSrc
|
|
18
|
-
}));
|
|
19
|
-
}));
|
|
13
|
+
describe('Image', () => {
|
|
20
14
|
test('onContainerClick can work', () => {
|
|
21
15
|
const onContainerClick = jest.fn();
|
|
22
16
|
const {
|
|
@@ -31,4 +25,59 @@ describe('image', () => {
|
|
|
31
25
|
|
|
32
26
|
expect(onContainerClick).toBeCalledTimes(1);
|
|
33
27
|
});
|
|
28
|
+
test('load successfully', () => {
|
|
29
|
+
(0, _testing.render)(_react.default.createElement(_index.default, {
|
|
30
|
+
src: demoSrc
|
|
31
|
+
}));
|
|
32
|
+
const img = document.querySelectorAll(`.${classPrefix}-img`)[0];
|
|
33
|
+
|
|
34
|
+
_testing.fireEvent.load(img);
|
|
35
|
+
|
|
36
|
+
expect(img).toHaveAttribute('src', demoSrc);
|
|
37
|
+
});
|
|
38
|
+
test('load failed', () => {
|
|
39
|
+
(0, _testing.render)(_react.default.createElement(_index.default, {
|
|
40
|
+
src: '404'
|
|
41
|
+
}));
|
|
42
|
+
const img = document.querySelectorAll(`.${classPrefix}-img`)[0];
|
|
43
|
+
|
|
44
|
+
_testing.fireEvent.error(img);
|
|
45
|
+
|
|
46
|
+
expect(img).not.toBeInTheDocument();
|
|
47
|
+
expect(document.querySelectorAll(`.${classPrefix}-tip`)[0]).toBeInTheDocument();
|
|
48
|
+
});
|
|
49
|
+
test('lazy load should be work', () => {
|
|
50
|
+
// mock useInViewport
|
|
51
|
+
// https://github.com/alibaba/hooks/blob/master/packages/hooks/src/useInViewport/__tests__/index.test.ts
|
|
52
|
+
const mockIntersectionObserver = jest.fn().mockReturnValue({
|
|
53
|
+
observe: () => null,
|
|
54
|
+
disconnect: () => null
|
|
55
|
+
});
|
|
56
|
+
window.IntersectionObserver = mockIntersectionObserver;
|
|
57
|
+
(0, _testing.render)(_react.default.createElement(_index.default, {
|
|
58
|
+
src: demoSrc,
|
|
59
|
+
lazy: true
|
|
60
|
+
}));
|
|
61
|
+
const img = document.querySelectorAll(`.${classPrefix}-img`)[0];
|
|
62
|
+
expect(img).not.toHaveAttribute('src');
|
|
63
|
+
const calls = mockIntersectionObserver.mock.calls;
|
|
64
|
+
const [onChange] = calls[calls.length - 1];
|
|
65
|
+
(0, _testing.act)(() => {
|
|
66
|
+
onChange([{
|
|
67
|
+
isIntersecting: true
|
|
68
|
+
}]);
|
|
69
|
+
});
|
|
70
|
+
expect(img).toHaveAttribute('src', demoSrc);
|
|
71
|
+
});
|
|
72
|
+
test('renders with width and height', () => {
|
|
73
|
+
const {
|
|
74
|
+
getByTestId
|
|
75
|
+
} = (0, _testing.render)(_react.default.createElement(_index.default, {
|
|
76
|
+
src: demoSrc,
|
|
77
|
+
width: 100,
|
|
78
|
+
height: 100,
|
|
79
|
+
"data-testid": 'image'
|
|
80
|
+
}));
|
|
81
|
+
expect(getByTestId('image')).toHaveStyle('--width: 100px;--height: 100px');
|
|
82
|
+
});
|
|
34
83
|
});
|
|
@@ -9,12 +9,16 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _web = require("@react-spring/web");
|
|
11
11
|
|
|
12
|
+
var _ahooks = require("ahooks");
|
|
13
|
+
|
|
12
14
|
var _rubberband = require("../../utils/rubberband");
|
|
13
15
|
|
|
14
16
|
var _useDragAndPinch = require("../../utils/use-drag-and-pinch");
|
|
15
17
|
|
|
16
18
|
var _bound = require("../../utils/bound");
|
|
17
19
|
|
|
20
|
+
var mat = _interopRequireWildcard(require("../../utils/matrix"));
|
|
21
|
+
|
|
18
22
|
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); }
|
|
19
23
|
|
|
20
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -28,54 +32,71 @@ const Slide = props => {
|
|
|
28
32
|
const controlRef = (0, _react.useRef)(null);
|
|
29
33
|
const imgRef = (0, _react.useRef)(null);
|
|
30
34
|
const [{
|
|
31
|
-
|
|
32
|
-
x,
|
|
33
|
-
y
|
|
35
|
+
matrix
|
|
34
36
|
}, api] = (0, _web.useSpring)(() => ({
|
|
35
|
-
|
|
36
|
-
x: 0,
|
|
37
|
-
y: 0,
|
|
37
|
+
matrix: mat.create(),
|
|
38
38
|
config: {
|
|
39
39
|
tension: 200
|
|
40
40
|
}
|
|
41
41
|
}));
|
|
42
|
+
const controlSize = (0, _ahooks.useSize)(controlRef);
|
|
43
|
+
const imgSize = (0, _ahooks.useSize)(imgRef);
|
|
42
44
|
const pinchLockRef = (0, _react.useRef)(false);
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const boundMatrix = (nextMatrix, type, last = false) => {
|
|
47
|
+
if (!controlSize || !imgSize) return nextMatrix;
|
|
48
|
+
const controlLeft = -controlSize.width / 2;
|
|
49
|
+
const controlTop = -controlSize.height / 2;
|
|
50
|
+
const imgLeft = -imgSize.width / 2;
|
|
51
|
+
const imgTop = -imgSize.height / 2;
|
|
52
|
+
const zoom = mat.getScaleX(nextMatrix);
|
|
53
|
+
const scaledImgWidth = zoom * imgSize.width;
|
|
54
|
+
const scaledImgHeight = zoom * imgSize.height;
|
|
55
|
+
const [x, y] = mat.apply(nextMatrix, [imgLeft, imgTop]);
|
|
56
|
+
|
|
57
|
+
if (type === 'translate') {
|
|
58
|
+
let boundedX = x;
|
|
59
|
+
let boundedY = y;
|
|
60
|
+
|
|
61
|
+
if (scaledImgWidth > controlSize.width) {
|
|
62
|
+
const minX = controlLeft - (scaledImgWidth - controlSize.width);
|
|
63
|
+
const maxX = controlLeft;
|
|
64
|
+
boundedX = last ? (0, _bound.bound)(x, minX, maxX) : (0, _rubberband.rubberbandIfOutOfBounds)(x, minX, maxX, zoom * 50);
|
|
65
|
+
} else {
|
|
66
|
+
boundedX = -scaledImgWidth / 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (scaledImgHeight > controlSize.height) {
|
|
70
|
+
const minY = controlTop - (scaledImgHeight - controlSize.height);
|
|
71
|
+
const maxY = controlTop;
|
|
72
|
+
boundedY = last ? (0, _bound.bound)(y, minY, maxY) : (0, _rubberband.rubberbandIfOutOfBounds)(y, minY, maxY, zoom * 50);
|
|
73
|
+
} else {
|
|
74
|
+
boundedY = -scaledImgHeight / 2;
|
|
75
|
+
}
|
|
48
76
|
|
|
49
|
-
|
|
50
|
-
xOffset = ((currentZoom * imgRef.current.width || 0) - controlRef.current.clientWidth) / 2;
|
|
51
|
-
yOffset = ((currentZoom * imgRef.current.height || 0) - controlRef.current.clientHeight) / 2;
|
|
77
|
+
return mat.translate(nextMatrix, boundedX - x, boundedY - y);
|
|
52
78
|
}
|
|
53
79
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
left: -xOffset,
|
|
58
|
-
right: xOffset,
|
|
59
|
-
top: -yOffset,
|
|
60
|
-
bottom: yOffset
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
if (rubberband) {
|
|
64
|
-
return [(0, _rubberband.rubberbandIfOutOfBounds)(x, bounds.left, bounds.right, currentZoom * 50), (0, _rubberband.rubberbandIfOutOfBounds)(y, bounds.top, bounds.bottom, currentZoom * 50)];
|
|
65
|
-
} else {
|
|
66
|
-
return [(0, _bound.bound)(x, bounds.left, bounds.right), (0, _bound.bound)(y, bounds.top, bounds.bottom)];
|
|
80
|
+
if (type === 'scale' && last) {
|
|
81
|
+
const [boundedX, boundedY] = [scaledImgWidth > controlSize.width ? (0, _bound.bound)(x, controlLeft - (scaledImgWidth - controlSize.width), controlLeft) : -scaledImgWidth / 2, scaledImgHeight > controlSize.height ? (0, _bound.bound)(y, controlTop - (scaledImgHeight - controlSize.height), controlTop) : -scaledImgHeight / 2];
|
|
82
|
+
return mat.translate(nextMatrix, boundedX - x, boundedY - y);
|
|
67
83
|
}
|
|
68
|
-
|
|
84
|
+
|
|
85
|
+
return nextMatrix;
|
|
86
|
+
};
|
|
69
87
|
|
|
70
88
|
(0, _useDragAndPinch.useDragAndPinch)({
|
|
71
89
|
onDrag: state => {
|
|
90
|
+
if (state.first) return;
|
|
91
|
+
if (state.pinching) return state.cancel();
|
|
92
|
+
|
|
72
93
|
if (state.tap && state.elapsedTime > 0 && state.elapsedTime < 1000) {
|
|
73
94
|
// 判断点击时间>0是为了过滤掉非正常操作,例如用户长按选择图片之后的取消操作(也是一次点击)
|
|
74
95
|
props.onTap();
|
|
75
96
|
return;
|
|
76
97
|
}
|
|
77
98
|
|
|
78
|
-
const currentZoom =
|
|
99
|
+
const currentZoom = mat.getScaleX(matrix.get());
|
|
79
100
|
|
|
80
101
|
if (dragLockRef) {
|
|
81
102
|
dragLockRef.current = currentZoom !== 1;
|
|
@@ -83,24 +104,16 @@ const Slide = props => {
|
|
|
83
104
|
|
|
84
105
|
if (!pinchLockRef.current && currentZoom <= 1) {
|
|
85
106
|
api.start({
|
|
86
|
-
|
|
87
|
-
y: 0
|
|
107
|
+
matrix: mat.create()
|
|
88
108
|
});
|
|
89
109
|
} else {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
const [x, y] = boundXY(state.offset, true);
|
|
98
|
-
api.start({
|
|
99
|
-
x,
|
|
100
|
-
y,
|
|
101
|
-
immediate: true
|
|
102
|
-
});
|
|
103
|
-
}
|
|
110
|
+
const currentMatrix = matrix.get();
|
|
111
|
+
const offset = [state.offset[0] - mat.getTranslateX(currentMatrix), state.offset[1] - mat.getTranslateY(currentMatrix)];
|
|
112
|
+
const nextMatrix = mat.translate(currentMatrix, ...(state.last ? [offset[0] + state.velocity[0] * state.direction[0] * 200, offset[1] + state.velocity[1] * state.direction[1] * 200] : offset));
|
|
113
|
+
api.start({
|
|
114
|
+
matrix: boundMatrix(nextMatrix, 'translate', state.last),
|
|
115
|
+
immediate: !state.last
|
|
116
|
+
});
|
|
104
117
|
}
|
|
105
118
|
},
|
|
106
119
|
onPinch: state => {
|
|
@@ -110,22 +123,30 @@ const Slide = props => {
|
|
|
110
123
|
const [d] = state.offset;
|
|
111
124
|
if (d < 0) return;
|
|
112
125
|
const nextZoom = state.last ? (0, _bound.bound)(d, 1, props.maxZoom) : d;
|
|
113
|
-
api.start({
|
|
114
|
-
zoom: nextZoom,
|
|
115
|
-
immediate: !state.last
|
|
116
|
-
});
|
|
117
126
|
(_a = props.onZoomChange) === null || _a === void 0 ? void 0 : _a.call(props, nextZoom);
|
|
118
127
|
|
|
119
128
|
if (state.last && nextZoom <= 1) {
|
|
120
129
|
api.start({
|
|
121
|
-
|
|
122
|
-
y: 0
|
|
130
|
+
matrix: mat.create()
|
|
123
131
|
});
|
|
124
132
|
|
|
125
133
|
if (dragLockRef) {
|
|
126
134
|
dragLockRef.current = false;
|
|
127
135
|
}
|
|
128
136
|
} else {
|
|
137
|
+
if (!controlSize) return;
|
|
138
|
+
const currentMatrix = matrix.get();
|
|
139
|
+
const currentZoom = mat.getScaleX(currentMatrix);
|
|
140
|
+
const originOffsetX = state.origin[0] - controlSize.width / 2;
|
|
141
|
+
const originOffsetY = state.origin[1] - controlSize.height / 2;
|
|
142
|
+
let nextMatrix = mat.translate(currentMatrix, -originOffsetX, -originOffsetY);
|
|
143
|
+
nextMatrix = mat.scale(nextMatrix, nextZoom / currentZoom);
|
|
144
|
+
nextMatrix = mat.translate(nextMatrix, originOffsetX, originOffsetY);
|
|
145
|
+
api.start({
|
|
146
|
+
matrix: boundMatrix(nextMatrix, 'scale', state.last),
|
|
147
|
+
immediate: !state.last
|
|
148
|
+
});
|
|
149
|
+
|
|
129
150
|
if (dragLockRef) {
|
|
130
151
|
dragLockRef.current = true;
|
|
131
152
|
}
|
|
@@ -135,13 +156,13 @@ const Slide = props => {
|
|
|
135
156
|
target: controlRef,
|
|
136
157
|
drag: {
|
|
137
158
|
// filterTaps: true,
|
|
138
|
-
from: () => [
|
|
159
|
+
from: () => [mat.getTranslateX(matrix.get()), mat.getTranslateY(matrix.get())],
|
|
139
160
|
pointer: {
|
|
140
161
|
touch: true
|
|
141
162
|
}
|
|
142
163
|
},
|
|
143
164
|
pinch: {
|
|
144
|
-
from: () => [
|
|
165
|
+
from: () => [mat.getScaleX(matrix.get()), 0],
|
|
145
166
|
pointer: {
|
|
146
167
|
touch: true
|
|
147
168
|
}
|
|
@@ -150,7 +171,7 @@ const Slide = props => {
|
|
|
150
171
|
return _react.default.createElement("div", {
|
|
151
172
|
className: `${classPrefix}-slide`,
|
|
152
173
|
onPointerMove: e => {
|
|
153
|
-
if (
|
|
174
|
+
if (mat.getScaleX(matrix.get()) !== 1) {
|
|
154
175
|
e.stopPropagation();
|
|
155
176
|
}
|
|
156
177
|
}
|
|
@@ -160,9 +181,7 @@ const Slide = props => {
|
|
|
160
181
|
}, _react.default.createElement(_web.animated.div, {
|
|
161
182
|
className: `${classPrefix}-image-wrapper`,
|
|
162
183
|
style: {
|
|
163
|
-
|
|
164
|
-
translateY: y,
|
|
165
|
-
scale: zoom
|
|
184
|
+
matrix
|
|
166
185
|
}
|
|
167
186
|
}, _react.default.createElement("img", {
|
|
168
187
|
ref: imgRef,
|
|
@@ -23,6 +23,8 @@ var _bound = require("../../utils/bound");
|
|
|
23
23
|
|
|
24
24
|
var _validate = require("../../utils/validate");
|
|
25
25
|
|
|
26
|
+
var _configProvider = require("../config-provider");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
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); }
|
|
@@ -40,6 +42,9 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
40
42
|
const [hasFocus, setHasFocus] = (0, _react.useState)(false);
|
|
41
43
|
const compositionStartRef = (0, _react.useRef)(false);
|
|
42
44
|
const nativeInputRef = (0, _react.useRef)(null);
|
|
45
|
+
const {
|
|
46
|
+
locale
|
|
47
|
+
} = (0, _configProvider.useConfig)();
|
|
43
48
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
44
49
|
clear: () => {
|
|
45
50
|
setValue('');
|
|
@@ -161,7 +166,8 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
161
166
|
role: props.role,
|
|
162
167
|
"aria-valuenow": props['aria-valuenow'],
|
|
163
168
|
"aria-valuemax": props['aria-valuemax'],
|
|
164
|
-
"aria-valuemin": props['aria-valuemin']
|
|
169
|
+
"aria-valuemin": props['aria-valuemin'],
|
|
170
|
+
"aria-label": props['aria-label']
|
|
165
171
|
}), shouldShowClear && _react.default.createElement("div", {
|
|
166
172
|
className: `${classPrefix}-clear`,
|
|
167
173
|
onMouseDown: e => {
|
|
@@ -177,7 +183,8 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
177
183
|
compositionStartRef.current = false;
|
|
178
184
|
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
179
185
|
}
|
|
180
|
-
}
|
|
186
|
+
},
|
|
187
|
+
"aria-label": locale.Input.clear
|
|
181
188
|
}, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null))));
|
|
182
189
|
});
|
|
183
190
|
exports.Input = Input;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModalProps } from './modal';
|
|
2
|
-
export declare type ModalShowProps = Omit<ModalProps, 'visible'>;
|
|
2
|
+
export declare type ModalShowProps = Omit<ModalProps, 'visible' | 'destroyOnClose' | 'forceRender'>;
|
|
3
3
|
export declare type ModalShowHandler = {
|
|
4
4
|
close: () => void;
|
|
5
5
|
};
|
|
@@ -70,6 +70,15 @@
|
|
|
70
70
|
margin-left: 24px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
.adm-notice-bar-close {
|
|
74
|
+
width: 48px;
|
|
75
|
+
height: 48px;
|
|
76
|
+
margin-right: -6px;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
73
82
|
.adm-notice-bar-close-icon {
|
|
74
83
|
font-size: var(--adm-font-size-10);
|
|
75
84
|
}
|
|
@@ -103,14 +103,16 @@ const NoticeBar = (0, _react.memo)(p => {
|
|
|
103
103
|
className: `${classPrefix}-content-inner`
|
|
104
104
|
}, props.content)), (props.closeable || props.extra) && _react.default.createElement("span", {
|
|
105
105
|
className: `${classPrefix}-right`
|
|
106
|
-
}, props.extra, props.closeable && _react.default.createElement(
|
|
107
|
-
className: `${classPrefix}-close
|
|
106
|
+
}, props.extra, props.closeable && _react.default.createElement("div", {
|
|
107
|
+
className: `${classPrefix}-close`,
|
|
108
108
|
onClick: () => {
|
|
109
109
|
var _a;
|
|
110
110
|
|
|
111
111
|
setVisible(false);
|
|
112
112
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
113
113
|
}
|
|
114
|
-
}
|
|
114
|
+
}, _react.default.createElement(_antdMobileIcons.CloseOutline, {
|
|
115
|
+
className: `${classPrefix}-close-icon`
|
|
116
|
+
})))));
|
|
115
117
|
});
|
|
116
118
|
exports.NoticeBar = NoticeBar;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
flex: 1;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.adm-number-keyboard-main.confirmed-style .
|
|
7
|
+
.adm-number-keyboard-main.adm-number-keyboard-main-confirmed-style .adm-number-keyboard-key-sign {
|
|
8
8
|
background-color: var(--adm-color-white);
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
font-size: 32px;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.adm-number-keyboard-header.with-title {
|
|
43
|
+
.adm-number-keyboard-header.adm-number-keyboard-header-with-title {
|
|
44
44
|
justify-content: space-between;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.adm-number-keyboard-header.with-title .adm-number-keyboard-header-close-button {
|
|
47
|
+
.adm-number-keyboard-header.adm-number-keyboard-header-with-title .adm-number-keyboard-header-close-button {
|
|
48
48
|
padding-right: 0;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -97,37 +97,33 @@
|
|
|
97
97
|
box-sizing: content-box;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
.adm-number-keyboard-key.
|
|
100
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-mid {
|
|
101
101
|
flex-basis: 66.67%;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.adm-number-keyboard-key.
|
|
104
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-sign:active::before {
|
|
105
105
|
opacity: 0.1;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
.adm-number-keyboard-key.
|
|
108
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-extra {
|
|
109
109
|
border-left: solid 2px var(--adm-color-border);
|
|
110
110
|
border-right: none;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
.adm-number-keyboard-key.
|
|
114
|
-
.adm-number-keyboard-key.number-key {
|
|
113
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-extra,
|
|
114
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-number {
|
|
115
115
|
background-color: var(--adm-color-background);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
.adm-number-keyboard-key.
|
|
119
|
-
.adm-number-keyboard-key.number-key:active::before {
|
|
118
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-extra:active::before,
|
|
119
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-number:active::before {
|
|
120
120
|
opacity: 0.1;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.adm-number-keyboard-key.
|
|
123
|
+
.adm-number-keyboard-key.adm-number-keyboard-key-ok {
|
|
124
124
|
background-color: var(--adm-color-primary);
|
|
125
125
|
color: var(--adm-color-white);
|
|
126
126
|
height: 288px;
|
|
127
127
|
font-size: 32px;
|
|
128
128
|
border: none;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.adm-number-keyboard-bs-key {
|
|
132
|
-
height: 40px;
|
|
133
129
|
}
|
|
@@ -5,7 +5,7 @@ export declare type NumberKeyboardProps = {
|
|
|
5
5
|
visible?: boolean;
|
|
6
6
|
title?: string;
|
|
7
7
|
confirmText?: string | null;
|
|
8
|
-
customKey?:
|
|
8
|
+
customKey?: string | [string, string];
|
|
9
9
|
randomOrder?: boolean;
|
|
10
10
|
showCloseButton?: boolean;
|
|
11
11
|
onInput?: (v: string) => void;
|