antd-mobile 5.15.1 → 5.16.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/README.md +30 -16
- package/2x/bundle/antd-mobile.cjs.js +322 -193
- package/2x/bundle/antd-mobile.es.js +323 -194
- package/2x/bundle/style.css +66 -13
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -2
- package/2x/cjs/components/cascader/cascader.d.ts +29 -4
- package/2x/cjs/components/cascader/cascader.js +41 -19
- package/2x/cjs/components/cascader/index.d.ts +21 -2
- package/2x/cjs/components/center-popup/center-popup.css +11 -0
- package/2x/cjs/components/center-popup/center-popup.d.ts +3 -20
- package/2x/cjs/components/center-popup/center-popup.js +24 -13
- package/2x/cjs/components/date-picker/date-picker.d.ts +2 -2
- package/2x/cjs/components/date-picker/date-picker.js +3 -1
- package/2x/cjs/components/date-picker/index.d.ts +1 -1
- package/2x/cjs/components/input/input.css +4 -0
- package/2x/cjs/components/input/input.d.ts +7 -4
- package/2x/cjs/components/input/input.js +5 -1
- package/2x/cjs/components/list/index.d.ts +10 -2
- package/2x/cjs/components/list/list.d.ts +13 -2
- package/2x/cjs/components/list/list.js +16 -6
- package/2x/cjs/components/modal/modal-action-button.d.ts +2 -2
- package/2x/cjs/components/modal/modal.css +0 -9
- package/2x/cjs/components/modal/modal.js +4 -11
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/2x/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/2x/cjs/components/picker/index.d.ts +2 -6
- package/2x/cjs/components/picker/picker.d.ts +2 -6
- package/2x/cjs/components/picker/picker.js +8 -7
- package/2x/cjs/components/picker-view/picker-view.css +1 -0
- package/2x/cjs/components/picker-view/wheel.js +10 -8
- package/2x/cjs/components/popup/popup-base-props.d.ts +35 -0
- package/2x/cjs/components/popup/popup-base-props.js +18 -0
- package/2x/cjs/components/popup/popup.css +32 -0
- package/2x/cjs/components/popup/popup.d.ts +3 -19
- package/2x/cjs/components/popup/popup.js +43 -18
- package/2x/cjs/components/progress-bar/progress-bar.css +17 -3
- package/2x/cjs/components/progress-bar/progress-bar.d.ts +4 -2
- package/2x/cjs/components/progress-bar/progress-bar.js +27 -5
- package/2x/cjs/components/slider/slider.js +2 -1
- package/2x/cjs/components/slider/thumb.d.ts +2 -1
- package/2x/cjs/components/slider/thumb.js +13 -1
- package/2x/cjs/components/stepper/stepper.js +14 -3
- package/2x/cjs/components/steps/steps.css +1 -1
- package/2x/cjs/locales/base.d.ts +7 -0
- package/2x/cjs/locales/base.js +7 -0
- package/2x/cjs/locales/en-US.d.ts +7 -0
- package/2x/cjs/locales/es-ES.d.ts +7 -0
- package/2x/cjs/locales/fa-IR.d.ts +7 -0
- package/2x/cjs/locales/fr-FR.d.ts +7 -0
- package/2x/cjs/locales/id-ID.d.ts +118 -0
- package/2x/cjs/locales/id-ID.js +121 -0
- package/2x/cjs/locales/kk-KZ.d.ts +118 -0
- package/2x/cjs/locales/kk-KZ.js +124 -0
- package/2x/cjs/locales/ko-KR.d.ts +7 -0
- package/2x/cjs/locales/zh-CN.d.ts +7 -0
- package/2x/cjs/locales/zh-CN.js +7 -0
- package/2x/cjs/locales/zh-HK.d.ts +7 -0
- package/2x/cjs/locales/zh-TW.d.ts +7 -0
- package/2x/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/2x/es/components/action-sheet/action-sheet.js +6 -2
- package/2x/es/components/cascader/cascader.d.ts +29 -4
- package/2x/es/components/cascader/cascader.js +42 -18
- package/2x/es/components/cascader/index.d.ts +21 -2
- package/2x/es/components/center-popup/center-popup.css +11 -0
- package/2x/es/components/center-popup/center-popup.d.ts +3 -20
- package/2x/es/components/center-popup/center-popup.js +22 -13
- package/2x/es/components/date-picker/date-picker.d.ts +2 -2
- package/2x/es/components/date-picker/date-picker.js +3 -1
- package/2x/es/components/date-picker/index.d.ts +1 -1
- package/2x/es/components/input/input.css +4 -0
- package/2x/es/components/input/input.d.ts +7 -4
- package/2x/es/components/input/input.js +5 -1
- package/2x/es/components/list/index.d.ts +10 -2
- package/2x/es/components/list/list.d.ts +13 -2
- package/2x/es/components/list/list.js +12 -4
- package/2x/es/components/modal/modal-action-button.d.ts +2 -2
- package/2x/es/components/modal/modal.css +0 -9
- package/2x/es/components/modal/modal.js +4 -10
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/2x/es/components/number-keyboard/number-keyboard.js +13 -7
- package/2x/es/components/picker/index.d.ts +2 -6
- package/2x/es/components/picker/picker.d.ts +2 -6
- package/2x/es/components/picker/picker.js +8 -6
- package/2x/es/components/picker-view/picker-view.css +1 -0
- package/2x/es/components/picker-view/wheel.js +10 -8
- package/2x/es/components/popup/popup-base-props.d.ts +35 -0
- package/2x/es/components/popup/popup-base-props.js +11 -0
- package/2x/es/components/popup/popup.css +32 -0
- package/2x/es/components/popup/popup.d.ts +3 -19
- package/2x/es/components/popup/popup.js +41 -19
- package/2x/es/components/progress-bar/progress-bar.css +17 -3
- package/2x/es/components/progress-bar/progress-bar.d.ts +4 -2
- package/2x/es/components/progress-bar/progress-bar.js +25 -5
- package/2x/es/components/slider/slider.js +2 -1
- package/2x/es/components/slider/thumb.d.ts +2 -1
- package/2x/es/components/slider/thumb.js +12 -1
- package/2x/es/components/stepper/stepper.js +13 -3
- package/2x/es/components/steps/steps.css +1 -1
- package/2x/es/locales/base.d.ts +7 -0
- package/2x/es/locales/base.js +7 -0
- package/2x/es/locales/en-US.d.ts +7 -0
- package/2x/es/locales/es-ES.d.ts +7 -0
- package/2x/es/locales/fa-IR.d.ts +7 -0
- package/2x/es/locales/fr-FR.d.ts +7 -0
- package/2x/es/locales/id-ID.d.ts +118 -0
- package/2x/es/locales/id-ID.js +111 -0
- package/2x/es/locales/kk-KZ.d.ts +118 -0
- package/2x/es/locales/kk-KZ.js +114 -0
- package/2x/es/locales/ko-KR.d.ts +7 -0
- package/2x/es/locales/zh-CN.d.ts +7 -0
- package/2x/es/locales/zh-CN.js +7 -0
- package/2x/es/locales/zh-HK.d.ts +7 -0
- package/2x/es/locales/zh-TW.d.ts +7 -0
- package/2x/package.json +1 -1
- package/2x/umd/antd-mobile.js +1 -1
- package/README.md +30 -16
- package/bundle/antd-mobile.cjs.js +322 -193
- package/bundle/antd-mobile.es.js +323 -194
- package/bundle/style.css +56 -12
- package/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/cjs/components/action-sheet/action-sheet.js +6 -2
- package/cjs/components/cascader/cascader.d.ts +29 -4
- package/cjs/components/cascader/cascader.js +41 -19
- package/cjs/components/cascader/index.d.ts +21 -2
- package/cjs/components/center-popup/center-popup.css +10 -0
- package/cjs/components/center-popup/center-popup.d.ts +3 -20
- package/cjs/components/center-popup/center-popup.js +24 -13
- package/cjs/components/date-picker/date-picker.d.ts +2 -2
- package/cjs/components/date-picker/date-picker.js +3 -1
- package/cjs/components/date-picker/index.d.ts +1 -1
- package/cjs/components/input/input.css +3 -0
- package/cjs/components/input/input.d.ts +7 -4
- package/cjs/components/input/input.js +5 -1
- package/cjs/components/list/index.d.ts +10 -2
- package/cjs/components/list/list.d.ts +13 -2
- package/cjs/components/list/list.js +16 -6
- package/cjs/components/modal/modal-action-button.d.ts +2 -2
- package/cjs/components/modal/modal.css +0 -8
- package/cjs/components/modal/modal.js +4 -11
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/cjs/components/picker/index.d.ts +2 -6
- package/cjs/components/picker/picker.d.ts +2 -6
- package/cjs/components/picker/picker.js +8 -7
- package/cjs/components/picker-view/picker-view.css +1 -0
- package/cjs/components/picker-view/wheel.js +10 -8
- package/cjs/components/popup/popup-base-props.d.ts +35 -0
- package/cjs/components/popup/popup-base-props.js +18 -0
- package/cjs/components/popup/popup.css +26 -0
- package/cjs/components/popup/popup.d.ts +3 -19
- package/cjs/components/popup/popup.js +43 -18
- package/cjs/components/progress-bar/progress-bar.css +15 -3
- package/cjs/components/progress-bar/progress-bar.d.ts +4 -2
- package/cjs/components/progress-bar/progress-bar.js +27 -5
- package/cjs/components/slider/slider.js +2 -1
- package/cjs/components/slider/thumb.d.ts +2 -1
- package/cjs/components/slider/thumb.js +13 -1
- package/cjs/components/stepper/stepper.js +14 -3
- package/cjs/components/steps/steps.css +1 -1
- package/cjs/locales/base.d.ts +7 -0
- package/cjs/locales/base.js +7 -0
- package/cjs/locales/en-US.d.ts +7 -0
- package/cjs/locales/es-ES.d.ts +7 -0
- package/cjs/locales/fa-IR.d.ts +7 -0
- package/cjs/locales/fr-FR.d.ts +7 -0
- package/cjs/locales/id-ID.d.ts +118 -0
- package/cjs/locales/id-ID.js +121 -0
- package/cjs/locales/kk-KZ.d.ts +118 -0
- package/cjs/locales/kk-KZ.js +124 -0
- package/cjs/locales/ko-KR.d.ts +7 -0
- package/cjs/locales/zh-CN.d.ts +7 -0
- package/cjs/locales/zh-CN.js +7 -0
- package/cjs/locales/zh-HK.d.ts +7 -0
- package/cjs/locales/zh-TW.d.ts +7 -0
- package/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/es/components/action-sheet/action-sheet.js +6 -2
- package/es/components/cascader/cascader.d.ts +29 -4
- package/es/components/cascader/cascader.js +42 -18
- package/es/components/cascader/index.d.ts +21 -2
- package/es/components/center-popup/center-popup.css +10 -0
- package/es/components/center-popup/center-popup.d.ts +3 -20
- package/es/components/center-popup/center-popup.js +22 -13
- package/es/components/date-picker/date-picker.d.ts +2 -2
- package/es/components/date-picker/date-picker.js +3 -1
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/input/input.css +3 -0
- package/es/components/input/input.d.ts +7 -4
- package/es/components/input/input.js +5 -1
- package/es/components/list/index.d.ts +10 -2
- package/es/components/list/list.d.ts +13 -2
- package/es/components/list/list.js +12 -4
- package/es/components/modal/modal-action-button.d.ts +2 -2
- package/es/components/modal/modal.css +0 -8
- package/es/components/modal/modal.js +4 -10
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/es/components/number-keyboard/number-keyboard.js +13 -7
- package/es/components/picker/index.d.ts +2 -6
- package/es/components/picker/picker.d.ts +2 -6
- package/es/components/picker/picker.js +8 -6
- package/es/components/picker-view/picker-view.css +1 -0
- package/es/components/picker-view/wheel.js +10 -8
- package/es/components/popup/popup-base-props.d.ts +35 -0
- package/es/components/popup/popup-base-props.js +11 -0
- package/es/components/popup/popup.css +26 -0
- package/es/components/popup/popup.d.ts +3 -19
- package/es/components/popup/popup.js +41 -19
- package/es/components/progress-bar/progress-bar.css +15 -3
- package/es/components/progress-bar/progress-bar.d.ts +4 -2
- package/es/components/progress-bar/progress-bar.js +25 -5
- package/es/components/slider/slider.js +2 -1
- package/es/components/slider/thumb.d.ts +2 -1
- package/es/components/slider/thumb.js +12 -1
- package/es/components/stepper/stepper.js +13 -3
- package/es/components/steps/steps.css +1 -1
- package/es/locales/base.d.ts +7 -0
- package/es/locales/base.js +7 -0
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/es-ES.d.ts +7 -0
- package/es/locales/fa-IR.d.ts +7 -0
- package/es/locales/fr-FR.d.ts +7 -0
- package/es/locales/id-ID.d.ts +118 -0
- package/es/locales/id-ID.js +111 -0
- package/es/locales/kk-KZ.d.ts +118 -0
- package/es/locales/kk-KZ.js +114 -0
- package/es/locales/ko-KR.d.ts +7 -0
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +7 -0
- package/es/locales/zh-HK.d.ts +7 -0
- package/es/locales/zh-TW.d.ts +7 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './list.less';
|
|
3
|
-
export type { ListProps } from './list';
|
|
3
|
+
export type { ListProps, ListRef } from './list';
|
|
4
4
|
export type { ListItemProps } from './list-item';
|
|
5
|
-
declare const _default: import("react").
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
header?: import("react").ReactNode;
|
|
7
|
+
mode?: "default" | "card" | undefined;
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
|
+
} & {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
style?: (import("react").CSSProperties & Partial<Record<"--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", string>>) | undefined;
|
|
12
|
+
tabIndex?: number | undefined;
|
|
13
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./list").ListRef>> & {
|
|
6
14
|
Item: import("react").FC<import("./list-item").ListItemProps>;
|
|
7
15
|
};
|
|
8
16
|
export default _default;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ListProps = {
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
mode?: 'default' | 'card';
|
|
6
6
|
children?: ReactNode;
|
|
7
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
|
-
export declare
|
|
8
|
+
export declare type ListRef = {
|
|
9
|
+
nativeElement: HTMLDivElement | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const List: React.ForwardRefExoticComponent<{
|
|
12
|
+
header?: ReactNode;
|
|
13
|
+
mode?: "default" | "card" | undefined;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
} & {
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
style?: (React.CSSProperties & Partial<Record<"--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", string>>) | undefined;
|
|
18
|
+
tabIndex?: number | undefined;
|
|
19
|
+
} & React.AriaAttributes & React.RefAttributes<ListRef>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useRef } 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';
|
|
@@ -6,10 +6,18 @@ const classPrefix = `adm-list`;
|
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
mode: 'default'
|
|
8
8
|
};
|
|
9
|
-
export const List = p => {
|
|
9
|
+
export const List = forwardRef((p, ref) => {
|
|
10
10
|
const props = mergeProps(defaultProps, p);
|
|
11
|
+
const nativeElementRef = useRef(null);
|
|
12
|
+
useImperativeHandle(ref, () => ({
|
|
13
|
+
get nativeElement() {
|
|
14
|
+
return nativeElementRef.current;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}));
|
|
11
18
|
return withNativeProps(props, React.createElement("div", {
|
|
12
|
-
className: classNames(classPrefix, `${classPrefix}-${props.mode}`)
|
|
19
|
+
className: classNames(classPrefix, `${classPrefix}-${props.mode}`),
|
|
20
|
+
ref: nativeElementRef
|
|
13
21
|
}, props.header && React.createElement("div", {
|
|
14
22
|
className: `${classPrefix}-header`
|
|
15
23
|
}, props.header), React.createElement("div", {
|
|
@@ -17,4 +25,4 @@ export const List = p => {
|
|
|
17
25
|
}, React.createElement("div", {
|
|
18
26
|
className: `${classPrefix}-body-inner`
|
|
19
27
|
}, props.children))));
|
|
20
|
-
};
|
|
28
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type Action = {
|
|
4
4
|
key: string | number;
|
|
5
|
-
text:
|
|
5
|
+
text: ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
danger?: boolean;
|
|
8
8
|
primary?: boolean;
|
|
@@ -58,15 +58,6 @@
|
|
|
58
58
|
color: var(--adm-color-text);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.adm-modal-close {
|
|
62
|
-
position: absolute;
|
|
63
|
-
right: 16px;
|
|
64
|
-
top: 16px;
|
|
65
|
-
color: var(--adm-color-weak);
|
|
66
|
-
padding: 8px;
|
|
67
|
-
font-size: var(--adm-font-size-10);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
61
|
.adm-modal-footer {
|
|
71
62
|
user-select: none;
|
|
72
63
|
padding: 16px 24px 24px;
|
|
@@ -6,7 +6,6 @@ import { ModalActionButton } from './modal-action-button';
|
|
|
6
6
|
import Image from '../image';
|
|
7
7
|
import Space from '../space';
|
|
8
8
|
import AutoCenter from '../auto-center';
|
|
9
|
-
import { CloseOutline } from 'antd-mobile-icons';
|
|
10
9
|
import CenterPopup from '../center-popup';
|
|
11
10
|
const defaultProps = {
|
|
12
11
|
actions: [],
|
|
@@ -15,10 +14,7 @@ const defaultProps = {
|
|
|
15
14
|
};
|
|
16
15
|
export const Modal = p => {
|
|
17
16
|
const props = mergeProps(defaultProps, p);
|
|
18
|
-
const element = React.createElement(React.Fragment, null, props.
|
|
19
|
-
className: classNames(cls('close'), 'adm-plain-anchor'),
|
|
20
|
-
onClick: props.onClose
|
|
21
|
-
}, React.createElement(CloseOutline, null)), !!props.image && React.createElement("div", {
|
|
17
|
+
const element = React.createElement(React.Fragment, null, !!props.image && React.createElement("div", {
|
|
22
18
|
className: cls('image-container')
|
|
23
19
|
}, React.createElement(Image, {
|
|
24
20
|
src: props.image,
|
|
@@ -54,11 +50,9 @@ export const Modal = p => {
|
|
|
54
50
|
style: props.style,
|
|
55
51
|
afterClose: props.afterClose,
|
|
56
52
|
afterShow: props.afterShow,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
61
|
-
} : undefined,
|
|
53
|
+
showCloseButton: props.showCloseButton,
|
|
54
|
+
closeOnMaskClick: props.closeOnMaskClick,
|
|
55
|
+
onClose: props.onClose,
|
|
62
56
|
visible: props.visible,
|
|
63
57
|
getContainer: props.getContainer,
|
|
64
58
|
bodyStyle: props.bodyStyle,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopupProps } from '../popup';
|
|
3
|
-
import { GetContainer } from '../../utils/render-to-container';
|
|
4
3
|
import { NativeProps } from '../../utils/native-props';
|
|
5
4
|
export declare type NumberKeyboardProps = {
|
|
6
5
|
visible?: boolean;
|
|
7
6
|
title?: string;
|
|
8
|
-
getContainer?: GetContainer;
|
|
9
7
|
confirmText?: string | null;
|
|
10
8
|
customKey?: '-' | '.' | 'X';
|
|
11
9
|
randomOrder?: boolean;
|
|
@@ -14,9 +12,7 @@ export declare type NumberKeyboardProps = {
|
|
|
14
12
|
onDelete?: () => void;
|
|
15
13
|
onClose?: () => void;
|
|
16
14
|
onConfirm?: () => void;
|
|
17
|
-
afterShow?: () => void;
|
|
18
|
-
afterClose?: () => void;
|
|
19
15
|
closeOnConfirm?: boolean;
|
|
20
16
|
safeArea?: boolean;
|
|
21
|
-
} & Pick<PopupProps, 'stopPropagation'> & NativeProps;
|
|
17
|
+
} & Pick<PopupProps, 'afterClose' | 'afterShow' | 'getContainer' | 'destroyOnClose' | 'forceRender' | 'stopPropagation'> & NativeProps;
|
|
22
18
|
export declare const NumberKeyboard: React.FC<NumberKeyboardProps>;
|
|
@@ -14,7 +14,9 @@ const defaultProps = {
|
|
|
14
14
|
showCloseButton: true,
|
|
15
15
|
confirmText: null,
|
|
16
16
|
closeOnConfirm: true,
|
|
17
|
-
safeArea: true
|
|
17
|
+
safeArea: true,
|
|
18
|
+
destroyOnClose: false,
|
|
19
|
+
forceRender: false
|
|
18
20
|
};
|
|
19
21
|
export const NumberKeyboard = p => {
|
|
20
22
|
const props = mergeProps(defaultProps, p);
|
|
@@ -119,7 +121,11 @@ export const NumberKeyboard = p => {
|
|
|
119
121
|
'sign-key': !isNumberKey && key,
|
|
120
122
|
'mid-key': index === 9 && !!confirmText
|
|
121
123
|
});
|
|
122
|
-
|
|
124
|
+
const ariaProps = key ? {
|
|
125
|
+
role: 'button',
|
|
126
|
+
title: key
|
|
127
|
+
} : undefined;
|
|
128
|
+
return React.createElement("div", Object.assign({
|
|
123
129
|
key: key,
|
|
124
130
|
className: className,
|
|
125
131
|
onTouchStart: () => {
|
|
@@ -133,10 +139,8 @@ export const NumberKeyboard = p => {
|
|
|
133
139
|
if (key === 'BACKSPACE') {
|
|
134
140
|
onBackspacePressEnd();
|
|
135
141
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
role: 'button'
|
|
139
|
-
}, key === 'BACKSPACE' ? React.createElement(TextDeletionOutline, null) : key);
|
|
142
|
+
}
|
|
143
|
+
}, ariaProps), key === 'BACKSPACE' ? React.createElement(TextDeletionOutline, null) : key);
|
|
140
144
|
};
|
|
141
145
|
|
|
142
146
|
return React.createElement(Popup, {
|
|
@@ -146,7 +150,9 @@ export const NumberKeyboard = p => {
|
|
|
146
150
|
afterClose: props.afterClose,
|
|
147
151
|
afterShow: props.afterShow,
|
|
148
152
|
className: `${classPrefix}-popup`,
|
|
149
|
-
stopPropagation: props.stopPropagation
|
|
153
|
+
stopPropagation: props.stopPropagation,
|
|
154
|
+
destroyOnClose: props.destroyOnClose,
|
|
155
|
+
forceRender: props.forceRender
|
|
150
156
|
}, withNativeProps(props, React.createElement("div", {
|
|
151
157
|
ref: keyboardRef,
|
|
152
158
|
className: classPrefix,
|
|
@@ -20,9 +20,7 @@ declare const _default: import("react").NamedExoticComponent<{
|
|
|
20
20
|
mouseWheel?: boolean | undefined;
|
|
21
21
|
popupClassName?: string | undefined;
|
|
22
22
|
popupStyle?: import("react").CSSProperties | undefined;
|
|
23
|
-
|
|
24
|
-
destroyOnClose?: boolean | undefined;
|
|
25
|
-
} & Pick<import("../popup").PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
23
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
26
24
|
className?: string | undefined;
|
|
27
25
|
style?: (import("react").CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
28
26
|
tabIndex?: number | undefined;
|
|
@@ -45,9 +43,7 @@ declare const _default: import("react").NamedExoticComponent<{
|
|
|
45
43
|
mouseWheel?: boolean | undefined;
|
|
46
44
|
popupClassName?: string | undefined;
|
|
47
45
|
popupStyle?: import("react").CSSProperties | undefined;
|
|
48
|
-
|
|
49
|
-
destroyOnClose?: boolean | undefined;
|
|
50
|
-
} & Pick<import("../popup").PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
46
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
51
47
|
className?: string | undefined;
|
|
52
48
|
style?: (import("react").CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
53
49
|
tabIndex?: number | undefined;
|
|
@@ -26,9 +26,7 @@ export declare type PickerProps = {
|
|
|
26
26
|
mouseWheel?: boolean;
|
|
27
27
|
popupClassName?: string;
|
|
28
28
|
popupStyle?: React.CSSProperties;
|
|
29
|
-
|
|
30
|
-
destroyOnClose?: boolean;
|
|
31
|
-
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size' | '--item-height'>;
|
|
29
|
+
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'forceRender' | 'destroyOnClose'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size' | '--item-height'>;
|
|
32
30
|
export declare const Picker: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
33
31
|
columns: PickerColumn[] | ((value: PickerValue[]) => PickerColumn[]);
|
|
34
32
|
value?: PickerValue[] | undefined;
|
|
@@ -47,9 +45,7 @@ export declare const Picker: React.MemoExoticComponent<React.ForwardRefExoticCom
|
|
|
47
45
|
mouseWheel?: boolean | undefined;
|
|
48
46
|
popupClassName?: string | undefined;
|
|
49
47
|
popupStyle?: React.CSSProperties | undefined;
|
|
50
|
-
|
|
51
|
-
destroyOnClose?: boolean | undefined;
|
|
52
|
-
} & Pick<PopupProps, "onClick" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
48
|
+
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
53
49
|
className?: string | undefined;
|
|
54
50
|
style?: (React.CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
55
51
|
tabIndex?: number | undefined;
|
|
@@ -10,12 +10,13 @@ import { useConfig } from '../config-provider';
|
|
|
10
10
|
import { useMemoizedFn } from 'ahooks';
|
|
11
11
|
import SafeArea from '../safe-area';
|
|
12
12
|
import { defaultRenderLabel } from './picker-utils';
|
|
13
|
-
import { useShouldRender } from '../../utils/should-render';
|
|
14
13
|
const classPrefix = `adm-picker`;
|
|
15
14
|
const defaultProps = {
|
|
16
15
|
defaultValue: [],
|
|
17
16
|
closeOnMaskClick: true,
|
|
18
|
-
renderLabel: defaultRenderLabel
|
|
17
|
+
renderLabel: defaultRenderLabel,
|
|
18
|
+
destroyOnClose: false,
|
|
19
|
+
forceRender: false
|
|
19
20
|
};
|
|
20
21
|
export const Picker = memo(forwardRef((p, ref) => {
|
|
21
22
|
var _a;
|
|
@@ -79,12 +80,12 @@ export const Picker = memo(forwardRef((p, ref) => {
|
|
|
79
80
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, val, ext);
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
|
-
const shouldRender = useShouldRender(visible, props.forceRender, props.destroyOnClose);
|
|
83
83
|
const pickerElement = withNativeProps(props, React.createElement("div", {
|
|
84
84
|
className: classPrefix
|
|
85
85
|
}, React.createElement("div", {
|
|
86
86
|
className: `${classPrefix}-header`
|
|
87
87
|
}, React.createElement("a", {
|
|
88
|
+
role: 'button',
|
|
88
89
|
className: `${classPrefix}-header-button`,
|
|
89
90
|
onClick: () => {
|
|
90
91
|
var _a;
|
|
@@ -95,6 +96,7 @@ export const Picker = memo(forwardRef((p, ref) => {
|
|
|
95
96
|
}, props.cancelText), React.createElement("div", {
|
|
96
97
|
className: `${classPrefix}-header-title`
|
|
97
98
|
}, props.title), React.createElement("a", {
|
|
99
|
+
role: 'button',
|
|
98
100
|
className: `${classPrefix}-header-button`,
|
|
99
101
|
onClick: () => {
|
|
100
102
|
setValue(innerValue);
|
|
@@ -122,13 +124,13 @@ export const Picker = memo(forwardRef((p, ref) => {
|
|
|
122
124
|
setVisible(false);
|
|
123
125
|
},
|
|
124
126
|
getContainer: props.getContainer,
|
|
125
|
-
destroyOnClose:
|
|
127
|
+
destroyOnClose: props.destroyOnClose,
|
|
126
128
|
afterShow: props.afterShow,
|
|
127
129
|
afterClose: props.afterClose,
|
|
128
130
|
onClick: props.onClick,
|
|
129
|
-
forceRender:
|
|
131
|
+
forceRender: props.forceRender,
|
|
130
132
|
stopPropagation: props.stopPropagation
|
|
131
|
-
},
|
|
133
|
+
}, pickerElement, React.createElement(SafeArea, {
|
|
132
134
|
position: 'bottom'
|
|
133
135
|
}));
|
|
134
136
|
return React.createElement(React.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, extend.items, actions));
|
|
@@ -132,27 +132,29 @@ export const Wheel = memo(props => {
|
|
|
132
132
|
className: 'adm-picker-view-column-accessible-current',
|
|
133
133
|
role: 'button',
|
|
134
134
|
"aria-label": current ? `当前选择的是:${current.label}` : '当前未选择'
|
|
135
|
-
}, "-"), React.createElement("div",
|
|
135
|
+
}, "-"), React.createElement("div", {
|
|
136
136
|
className: 'adm-picker-view-column-accessible-button',
|
|
137
137
|
onClick: () => {
|
|
138
|
+
if (!previous) return;
|
|
138
139
|
scrollSelect(previousIndex);
|
|
139
140
|
},
|
|
140
|
-
role: 'button',
|
|
141
|
-
"aria-label": `选择上一项:${previous.label}`
|
|
142
|
-
}, "-")
|
|
141
|
+
role: previous ? 'button' : 'text',
|
|
142
|
+
"aria-label": !previous ? '没有上一项' : `选择上一项:${previous.label}`
|
|
143
|
+
}, "-"), React.createElement("div", {
|
|
143
144
|
className: 'adm-picker-view-column-accessible-button',
|
|
144
145
|
onClick: () => {
|
|
146
|
+
if (!next) return;
|
|
145
147
|
scrollSelect(nextIndex);
|
|
146
148
|
},
|
|
147
|
-
role: 'button',
|
|
148
|
-
"aria-label": `选择下一项:${next.label}`
|
|
149
|
-
}, "-"))
|
|
149
|
+
role: next ? 'button' : 'text',
|
|
150
|
+
"aria-label": !next ? '没有下一项' : `选择下一项:${next.label}`
|
|
151
|
+
}, "-"));
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
return React.createElement("div", {
|
|
153
|
-
ref: rootRef,
|
|
154
155
|
className: `${classPrefix}-column`
|
|
155
156
|
}, React.createElement(animated.div, {
|
|
157
|
+
ref: rootRef,
|
|
156
158
|
style: {
|
|
157
159
|
translateY: y
|
|
158
160
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GetContainer } from '../../utils/render-to-container';
|
|
3
|
+
import { MaskProps } from '../mask';
|
|
4
|
+
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
5
|
+
export declare type PopupBaseProps = {
|
|
6
|
+
afterClose?: () => void;
|
|
7
|
+
afterShow?: () => void;
|
|
8
|
+
bodyClassName?: string;
|
|
9
|
+
bodyStyle?: React.CSSProperties;
|
|
10
|
+
closeOnMaskClick?: boolean;
|
|
11
|
+
destroyOnClose?: boolean;
|
|
12
|
+
disableBodyScroll?: boolean;
|
|
13
|
+
forceRender?: boolean;
|
|
14
|
+
getContainer?: GetContainer;
|
|
15
|
+
mask?: boolean;
|
|
16
|
+
maskClassName?: string;
|
|
17
|
+
maskStyle?: MaskProps['style'];
|
|
18
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
21
|
+
showCloseButton?: boolean;
|
|
22
|
+
stopPropagation?: PropagationEvent[];
|
|
23
|
+
visible?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultPopupBaseProps: {
|
|
26
|
+
closeOnMaskClick: boolean;
|
|
27
|
+
destroyOnClose: boolean;
|
|
28
|
+
disableBodyScroll: boolean;
|
|
29
|
+
forceRender: boolean;
|
|
30
|
+
getContainer: null;
|
|
31
|
+
mask: boolean;
|
|
32
|
+
showCloseButton: boolean;
|
|
33
|
+
stopPropagation: string[];
|
|
34
|
+
visible: boolean;
|
|
35
|
+
};
|
|
@@ -10,26 +10,58 @@
|
|
|
10
10
|
z-index: calc(var(--z-index) + 10);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
.adm-popup-body .adm-popup-close-icon {
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 100;
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
.adm-popup-body-position-bottom {
|
|
14
19
|
width: 100%;
|
|
15
20
|
bottom: 0;
|
|
16
21
|
left: 0;
|
|
17
22
|
}
|
|
18
23
|
|
|
24
|
+
.adm-popup-body-position-bottom .adm-popup-close-icon {
|
|
25
|
+
right: 16px;
|
|
26
|
+
top: 16px;
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
.adm-popup-body-position-top {
|
|
20
30
|
width: 100%;
|
|
21
31
|
top: 0;
|
|
22
32
|
left: 0;
|
|
23
33
|
}
|
|
24
34
|
|
|
35
|
+
.adm-popup-body-position-top .adm-popup-close-icon {
|
|
36
|
+
right: 16px;
|
|
37
|
+
bottom: 16px;
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
.adm-popup-body-position-left {
|
|
26
41
|
height: 100%;
|
|
27
42
|
top: 0;
|
|
28
43
|
left: 0;
|
|
29
44
|
}
|
|
30
45
|
|
|
46
|
+
.adm-popup-body-position-left .adm-popup-close-icon {
|
|
47
|
+
right: 16px;
|
|
48
|
+
top: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
31
51
|
.adm-popup-body-position-right {
|
|
32
52
|
height: 100%;
|
|
33
53
|
top: 0;
|
|
34
54
|
right: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.adm-popup-body-position-right .adm-popup-close-icon {
|
|
58
|
+
left: 16px;
|
|
59
|
+
top: 16px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.adm-popup-close-icon {
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
padding: 8px;
|
|
65
|
+
font-size: 36px;
|
|
66
|
+
color: var(--adm-color-weak);
|
|
35
67
|
}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
6
|
-
export declare type PopupProps = PropsWithChildren<{
|
|
7
|
-
afterClose?: () => void;
|
|
8
|
-
afterShow?: () => void;
|
|
9
|
-
bodyClassName?: string;
|
|
10
|
-
bodyStyle?: React.CSSProperties;
|
|
11
|
-
destroyOnClose?: boolean;
|
|
12
|
-
forceRender?: boolean;
|
|
13
|
-
getContainer?: GetContainer;
|
|
14
|
-
mask?: boolean;
|
|
15
|
-
maskClassName?: string;
|
|
16
|
-
maskStyle?: MaskProps['style'];
|
|
17
|
-
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
18
|
-
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
3
|
+
import { PopupBaseProps } from './popup-base-props';
|
|
4
|
+
export declare type PopupProps = PopupBaseProps & PropsWithChildren<{
|
|
19
5
|
position?: 'bottom' | 'top' | 'left' | 'right';
|
|
20
|
-
stopPropagation?: PropagationEvent[];
|
|
21
|
-
visible?: boolean;
|
|
22
6
|
}> & NativeProps<'--z-index'>;
|
|
23
7
|
export declare const Popup: FC<PopupProps>;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import React, { useState, useRef } from 'react';
|
|
3
|
-
import { useUnmountedRef } from 'ahooks';
|
|
3
|
+
import { useIsomorphicLayoutEffect, useUnmountedRef } from 'ahooks';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
6
|
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/should-render';
|
|
11
10
|
import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
11
|
+
import { ShouldRender } from '../../utils/should-render';
|
|
12
|
+
import { CloseOutline } from 'antd-mobile-icons';
|
|
13
|
+
import { defaultPopupBaseProps } from './popup-base-props';
|
|
14
|
+
import { useInnerVisible } from '../../utils/use-inner-visible';
|
|
12
15
|
const classPrefix = `adm-popup`;
|
|
13
|
-
const defaultProps = {
|
|
14
|
-
position: 'bottom'
|
|
15
|
-
|
|
16
|
-
getContainer: () => document.body,
|
|
17
|
-
mask: true,
|
|
18
|
-
stopPropagation: ['click']
|
|
19
|
-
};
|
|
16
|
+
const defaultProps = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
17
|
+
position: 'bottom'
|
|
18
|
+
});
|
|
20
19
|
export const Popup = p => {
|
|
21
20
|
const props = mergeProps(defaultProps, p);
|
|
22
21
|
const bodyCls = classNames(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
23
|
-
const ref = useRef(null);
|
|
24
22
|
const [active, setActive] = useState(props.visible);
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
useIsomorphicLayoutEffect(() => {
|
|
24
|
+
if (props.visible) {
|
|
25
|
+
setActive(true);
|
|
26
|
+
}
|
|
27
|
+
}, [props.visible]);
|
|
28
|
+
const ref = useRef(null);
|
|
29
|
+
useLockScroll(ref, props.disableBodyScroll && active);
|
|
27
30
|
const unmountedRef = useUnmountedRef();
|
|
28
31
|
const {
|
|
29
32
|
percent
|
|
@@ -35,9 +38,6 @@ export const Popup = p => {
|
|
|
35
38
|
tension: 300,
|
|
36
39
|
friction: 30
|
|
37
40
|
},
|
|
38
|
-
onStart: () => {
|
|
39
|
-
setActive(true);
|
|
40
|
-
},
|
|
41
41
|
onRest: () => {
|
|
42
42
|
var _a, _b;
|
|
43
43
|
|
|
@@ -51,6 +51,7 @@ export const Popup = p => {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
const maskVisible = useInnerVisible(active && props.visible);
|
|
54
55
|
const node = withStopPropagation(props.stopPropagation, withNativeProps(props, React.createElement("div", {
|
|
55
56
|
className: classPrefix,
|
|
56
57
|
onClick: props.onClick,
|
|
@@ -58,8 +59,18 @@ export const Popup = p => {
|
|
|
58
59
|
display: active ? undefined : 'none'
|
|
59
60
|
}
|
|
60
61
|
}, props.mask && React.createElement(Mask, {
|
|
61
|
-
visible:
|
|
62
|
-
|
|
62
|
+
visible: maskVisible,
|
|
63
|
+
forceRender: props.forceRender,
|
|
64
|
+
destroyOnClose: props.destroyOnClose,
|
|
65
|
+
onMaskClick: e => {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
|
|
68
|
+
(_a = props.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
69
|
+
|
|
70
|
+
if (props.closeOnMaskClick) {
|
|
71
|
+
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
63
74
|
className: props.maskClassName,
|
|
64
75
|
style: props.maskStyle,
|
|
65
76
|
disableBodyScroll: false,
|
|
@@ -88,6 +99,17 @@ export const Popup = p => {
|
|
|
88
99
|
})
|
|
89
100
|
}),
|
|
90
101
|
ref: ref
|
|
91
|
-
},
|
|
92
|
-
|
|
102
|
+
}, props.showCloseButton && React.createElement("a", {
|
|
103
|
+
className: classNames(`${classPrefix}-close-icon`, 'adm-plain-anchor'),
|
|
104
|
+
onClick: () => {
|
|
105
|
+
var _a;
|
|
106
|
+
|
|
107
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
108
|
+
}
|
|
109
|
+
}, React.createElement(CloseOutline, null)), props.children))));
|
|
110
|
+
return React.createElement(ShouldRender, {
|
|
111
|
+
active: active,
|
|
112
|
+
forceRender: props.forceRender,
|
|
113
|
+
destroyOnClose: props.destroyOnClose
|
|
114
|
+
}, renderToContainer(props.getContainer, node));
|
|
93
115
|
};
|
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
|
-
--track-width: var(--adm-progress-bar-track-width,
|
|
2
|
+
--track-width: var(--adm-progress-bar-track-width, 16px);
|
|
3
3
|
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
4
4
|
--fill-color: var(--adm-progress-bar-fill-color, var(--adm-color-primary));
|
|
5
|
+
--text-width: var(--adm-progress-bar-text-width, 80px);
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
.adm-progress-bar-trail {
|
|
11
|
+
flex: auto;
|
|
8
12
|
background: var(--track-color);
|
|
9
13
|
overflow: hidden;
|
|
10
14
|
height: var(--track-width);
|
|
11
|
-
border-radius: var(--track-width);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
.adm-progress-bar-fill {
|
|
15
18
|
transition: width 0.3s;
|
|
16
19
|
background: var(--fill-color);
|
|
17
|
-
height:
|
|
20
|
+
height: var(--track-width);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.adm-progress-bar-text {
|
|
24
|
+
flex: none;
|
|
25
|
+
width: calc(var(--text-width) + 16px);
|
|
26
|
+
padding-left: 16px;
|
|
27
|
+
color: #999999;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.adm-progress-bar-rounded .adm-progress-bar-trail,
|
|
31
|
+
.adm-progress-bar-rounded .adm-progress-bar-fill {
|
|
18
32
|
border-radius: var(--track-width);
|
|
19
33
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ProgressBarProps = {
|
|
4
4
|
percent?: number;
|
|
5
|
-
|
|
5
|
+
rounded?: boolean;
|
|
6
|
+
text?: boolean | ReactNode | ((percent: number) => ReactNode);
|
|
7
|
+
} & NativeProps<'--track-width' | '--track-color' | '--fill-color' | '--text-width'>;
|
|
6
8
|
export declare const ProgressBar: FC<ProgressBarProps>;
|