antd-mobile 5.0.0-rc.27 → 5.0.0-rc.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/README.md +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +5 -0
- package/2x/cjs/components/checkbox/checkbox.js +12 -12
- package/2x/cjs/components/form/form-item.css +16 -6
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +17 -8
- package/2x/cjs/components/form/form.css +0 -9
- package/2x/cjs/components/form/form.js +1 -1
- package/2x/cjs/components/form/index.css +16 -15
- package/2x/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -1
- package/2x/cjs/components/input/input.css +1 -0
- package/2x/cjs/components/popover/index.d.ts +1 -1
- package/2x/cjs/components/popover/popover-menu.d.ts +1 -1
- package/2x/cjs/components/progress-bar/progress-bar.css +1 -1
- package/2x/cjs/components/progress-circle/progress-circle.css +4 -4
- package/2x/cjs/components/progress-circle/progress-circle.js +1 -2
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +7 -1
- package/2x/cjs/components/radio/radio.js +14 -0
- package/2x/cjs/components/rate/rate.css +2 -1
- package/2x/cjs/components/rate/rate.d.ts +1 -1
- package/2x/cjs/components/slider/slider.css +12 -7
- package/2x/cjs/components/slider/thumb-icon.d.ts +3 -0
- package/2x/cjs/components/slider/thumb-icon.js +38 -0
- package/2x/cjs/components/slider/thumb.js +5 -1
- package/2x/cjs/components/tabs/tabs.js +3 -3
- package/2x/cjs/components/text-area/text-area.js +10 -1
- package/2x/cjs/utils/is-dev.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +6 -1
- package/2x/es/components/checkbox/checkbox.js +11 -12
- package/2x/es/components/form/form-item.css +16 -6
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +15 -6
- package/2x/es/components/form/form.css +0 -9
- package/2x/es/components/form/form.js +1 -1
- package/2x/es/components/form/index.css +16 -15
- package/2x/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +1 -1
- package/2x/es/components/input/input.css +1 -0
- package/2x/es/components/popover/index.d.ts +1 -1
- package/2x/es/components/popover/popover-menu.d.ts +1 -1
- package/2x/es/components/progress-bar/progress-bar.css +1 -1
- package/2x/es/components/progress-circle/progress-circle.css +4 -4
- package/2x/es/components/progress-circle/progress-circle.js +1 -2
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +8 -2
- package/2x/es/components/radio/radio.js +12 -0
- package/2x/es/components/rate/rate.css +2 -1
- package/2x/es/components/rate/rate.d.ts +1 -1
- package/2x/es/components/slider/slider.css +12 -7
- package/2x/es/components/slider/thumb-icon.d.ts +3 -0
- package/2x/es/components/slider/thumb-icon.js +25 -0
- package/2x/es/components/slider/thumb.js +4 -1
- package/2x/es/components/tabs/tabs.js +3 -3
- package/2x/es/components/text-area/text-area.js +9 -1
- package/2x/es/utils/is-dev.js +1 -1
- package/2x/package.json +3 -2
- package/README.md +1 -1
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +5 -0
- package/cjs/components/checkbox/checkbox.js +12 -12
- package/cjs/components/form/form-item.css +14 -6
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +17 -8
- package/cjs/components/form/form.css +0 -7
- package/cjs/components/form/form.js +1 -1
- package/cjs/components/form/index.css +14 -13
- package/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/cjs/components/image-uploader/image-uploader.js +1 -1
- package/cjs/components/input/input.css +1 -0
- package/cjs/components/popover/index.d.ts +1 -1
- package/cjs/components/popover/popover-menu.d.ts +1 -1
- package/cjs/components/progress-bar/progress-bar.css +1 -1
- package/cjs/components/progress-circle/progress-circle.css +4 -4
- package/cjs/components/progress-circle/progress-circle.js +1 -2
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +7 -1
- package/cjs/components/radio/radio.js +14 -0
- package/cjs/components/rate/rate.css +2 -1
- package/cjs/components/rate/rate.d.ts +1 -1
- package/cjs/components/slider/slider.css +11 -7
- package/cjs/components/slider/thumb-icon.d.ts +3 -0
- package/cjs/components/slider/thumb-icon.js +38 -0
- package/cjs/components/slider/thumb.js +5 -1
- package/cjs/components/tabs/tabs.js +3 -3
- package/cjs/components/text-area/text-area.js +10 -1
- package/cjs/utils/is-dev.js +1 -1
- package/es/components/calendar/calendar.d.ts +1 -0
- package/es/components/calendar/calendar.js +6 -1
- package/es/components/checkbox/checkbox.js +11 -12
- package/es/components/form/form-item.css +14 -6
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +15 -6
- package/es/components/form/form.css +0 -7
- package/es/components/form/form.js +1 -1
- package/es/components/form/index.css +14 -13
- package/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/es/components/image-uploader/image-uploader.js +1 -1
- package/es/components/input/input.css +1 -0
- package/es/components/popover/index.d.ts +1 -1
- package/es/components/popover/popover-menu.d.ts +1 -1
- package/es/components/progress-bar/progress-bar.css +1 -1
- package/es/components/progress-circle/progress-circle.css +4 -4
- package/es/components/progress-circle/progress-circle.js +1 -2
- package/es/components/pull-to-refresh/pull-to-refresh.js +8 -2
- package/es/components/radio/radio.js +12 -0
- package/es/components/rate/rate.css +2 -1
- package/es/components/rate/rate.d.ts +1 -1
- package/es/components/slider/slider.css +11 -7
- package/es/components/slider/thumb-icon.d.ts +3 -0
- package/es/components/slider/thumb-icon.js +25 -0
- package/es/components/slider/thumb.js +4 -1
- package/es/components/tabs/tabs.js +3 -3
- package/es/components/text-area/text-area.js +9 -1
- package/es/utils/is-dev.js +1 -1
- package/package.json +3 -2
- package/umd/antd-mobile.js +1 -1
- package/2x/assets/slider-thumb.svg +0 -14
- package/2x/cjs/assets/slider-thumb.svg +0 -14
- package/2x/es/assets/slider-thumb.svg +0 -14
- package/assets/slider-thumb.svg +0 -14
- package/cjs/assets/slider-thumb.svg +0 -14
- package/es/assets/slider-thumb.svg +0 -14
|
@@ -7,7 +7,7 @@ import type { FormLayout } from './index';
|
|
|
7
7
|
declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
|
8
8
|
declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
|
|
9
9
|
declare type RcFieldProps = Omit<FieldProps, 'children'>;
|
|
10
|
-
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue'> & Pick<ListItemProps, 'style' | 'onClick' | 'extra' | 'arrow'> & {
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue'> & Pick<ListItemProps, 'style' | 'onClick' | 'extra' | 'arrow' | 'description'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|
|
@@ -7,6 +7,8 @@ import { devWarning } from '../../utils/dev-log';
|
|
|
7
7
|
import { FormContext, NoStyleItemContext } from './context';
|
|
8
8
|
import { toArray } from './utils';
|
|
9
9
|
import List from '../list';
|
|
10
|
+
import Popover from '../popover';
|
|
11
|
+
import { QuestionCircleOutline } from 'antd-mobile-icons';
|
|
10
12
|
const NAME_SPLIT = '__SPLIT__';
|
|
11
13
|
const classPrefix = `adm-form-item`;
|
|
12
14
|
const MemoInput = React.memo(({
|
|
@@ -26,7 +28,8 @@ const FormItemLayout = props => {
|
|
|
26
28
|
htmlFor,
|
|
27
29
|
hidden,
|
|
28
30
|
errors,
|
|
29
|
-
arrow
|
|
31
|
+
arrow,
|
|
32
|
+
description
|
|
30
33
|
} = props;
|
|
31
34
|
const context = useContext(FormContext);
|
|
32
35
|
const hasFeedback = props.hasFeedback !== undefined ? props.hasFeedback : context.hasFeedback;
|
|
@@ -39,17 +42,21 @@ const FormItemLayout = props => {
|
|
|
39
42
|
className: `${classPrefix}-label-required`
|
|
40
43
|
}, "*"), help && React.createElement("span", {
|
|
41
44
|
className: `${classPrefix}-label-help`
|
|
42
|
-
},
|
|
43
|
-
|
|
45
|
+
}, React.createElement(Popover, {
|
|
46
|
+
content: help,
|
|
47
|
+
mode: 'dark',
|
|
48
|
+
trigger: 'click'
|
|
49
|
+
}, React.createElement(QuestionCircleOutline, null)))) : null;
|
|
50
|
+
const descriptionElement = feedback || description ? React.createElement(React.Fragment, null, description, React.createElement("div", {
|
|
44
51
|
className: `${classPrefix}-footer`
|
|
45
|
-
}, feedback);
|
|
52
|
+
}, feedback)) : null;
|
|
46
53
|
return React.createElement(List.Item, {
|
|
47
54
|
style: style,
|
|
48
55
|
title: layout === 'vertical' && labelElement,
|
|
49
56
|
prefix: layout === 'horizontal' && labelElement,
|
|
50
57
|
extra: extra,
|
|
51
58
|
description: descriptionElement,
|
|
52
|
-
className: classNames(classPrefix, className, {
|
|
59
|
+
className: classNames(classPrefix, className, `${classPrefix}-${layout}`, {
|
|
53
60
|
[`${classPrefix}-hidden`]: hidden
|
|
54
61
|
}),
|
|
55
62
|
disabled: disabled,
|
|
@@ -73,6 +80,7 @@ export const FormItem = props => {
|
|
|
73
80
|
noStyle,
|
|
74
81
|
hidden,
|
|
75
82
|
layout,
|
|
83
|
+
description,
|
|
76
84
|
// Field 相关
|
|
77
85
|
disabled,
|
|
78
86
|
rules,
|
|
@@ -85,7 +93,7 @@ export const FormItem = props => {
|
|
|
85
93
|
dependencies,
|
|
86
94
|
arrow
|
|
87
95
|
} = props,
|
|
88
|
-
fieldProps = __rest(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "arrow"]);
|
|
96
|
+
fieldProps = __rest(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "arrow"]);
|
|
89
97
|
|
|
90
98
|
const {
|
|
91
99
|
validateTrigger: contextValidateTrigger
|
|
@@ -134,6 +142,7 @@ export const FormItem = props => {
|
|
|
134
142
|
label: label,
|
|
135
143
|
extra: extra,
|
|
136
144
|
help: help,
|
|
145
|
+
description: description,
|
|
137
146
|
required: isRequired,
|
|
138
147
|
disabled: disabled,
|
|
139
148
|
hasFeedback: hasFeedback,
|
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
--padding-left: 16px;
|
|
3
3
|
--padding-right: 12px;
|
|
4
4
|
}
|
|
5
|
-
.adm-form-horizontal .adm-list.adm-list {
|
|
6
|
-
--prefix-width: 6em;
|
|
7
|
-
--align-items: stretch;
|
|
8
|
-
}
|
|
9
|
-
.adm-form-horizontal .adm-list.adm-list .adm-list-item-content-extra {
|
|
10
|
-
align-self: center;
|
|
11
|
-
}
|
|
12
5
|
.adm-form .adm-form-footer {
|
|
13
6
|
padding: 20px 12px;
|
|
14
7
|
}
|
|
@@ -51,7 +51,7 @@ export const Form = forwardRef((p, ref) => {
|
|
|
51
51
|
});
|
|
52
52
|
collect();
|
|
53
53
|
return React.createElement(RcForm, Object.assign({
|
|
54
|
-
className: classNames(classPrefix,
|
|
54
|
+
className: classNames(classPrefix, className),
|
|
55
55
|
style: style,
|
|
56
56
|
ref: ref
|
|
57
57
|
}, formProps), React.createElement(FormContext.Provider, {
|
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
--padding-left: 16px;
|
|
3
3
|
--padding-right: 12px;
|
|
4
4
|
}
|
|
5
|
-
.adm-form-horizontal .adm-list.adm-list {
|
|
6
|
-
--prefix-width: 6em;
|
|
7
|
-
--align-items: stretch;
|
|
8
|
-
}
|
|
9
|
-
.adm-form-horizontal .adm-list.adm-list .adm-list-item-content-extra {
|
|
10
|
-
align-self: center;
|
|
11
|
-
}
|
|
12
5
|
.adm-form .adm-form-footer {
|
|
13
6
|
padding: 20px 12px;
|
|
14
7
|
}
|
|
@@ -21,6 +14,7 @@
|
|
|
21
14
|
line-height: 1.5;
|
|
22
15
|
box-sizing: border-box;
|
|
23
16
|
position: relative;
|
|
17
|
+
color: #666666;
|
|
24
18
|
}
|
|
25
19
|
.adm-form-item-label-required {
|
|
26
20
|
position: absolute;
|
|
@@ -30,6 +24,9 @@
|
|
|
30
24
|
color: var(--adm-color-danger);
|
|
31
25
|
user-select: none;
|
|
32
26
|
}
|
|
27
|
+
.adm-form-item-label-help {
|
|
28
|
+
margin-left: 4px;
|
|
29
|
+
}
|
|
33
30
|
.adm-form-item-footer {
|
|
34
31
|
color: var(--adm-color-danger);
|
|
35
32
|
margin-top: 4px;
|
|
@@ -37,14 +34,18 @@
|
|
|
37
34
|
.adm-form-item.adm-form-item-hidden {
|
|
38
35
|
display: none;
|
|
39
36
|
}
|
|
40
|
-
.adm-form-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
.adm-form-item.adm-form-item-horizontal.adm-list-item {
|
|
38
|
+
--align-items: stretch;
|
|
39
|
+
--prefix-width: 6em;
|
|
43
40
|
}
|
|
44
|
-
.adm-form-horizontal .adm-list-item-content-prefix {
|
|
41
|
+
.adm-form-item.adm-form-item-horizontal .adm-list-item-content-prefix {
|
|
45
42
|
padding-top: 12px;
|
|
46
43
|
padding-bottom: 12px;
|
|
47
44
|
}
|
|
48
|
-
.adm-form-item-
|
|
49
|
-
|
|
45
|
+
.adm-form-item.adm-form-item-horizontal .adm-list-item-content-extra {
|
|
46
|
+
align-self: center;
|
|
47
|
+
}
|
|
48
|
+
.adm-form-item.adm-form-item-vertical .adm-form-item-label {
|
|
49
|
+
font-size: 15px;
|
|
50
|
+
margin-bottom: 4px;
|
|
50
51
|
}
|
|
@@ -19,7 +19,7 @@ export declare type ImageUploaderProps = {
|
|
|
19
19
|
showUpload?: boolean;
|
|
20
20
|
deletable?: boolean;
|
|
21
21
|
capture?: InputHTMLAttributes<unknown>['capture'];
|
|
22
|
-
onPreview?: (index: number) => void;
|
|
22
|
+
onPreview?: (index: number, item: ImageUploadItem) => void;
|
|
23
23
|
beforeUpload?: (file: File[]) => Promise<File[]> | File[];
|
|
24
24
|
upload: (file: File) => Promise<ImageUploadItem>;
|
|
25
25
|
onDelete?: (item: ImageUploadItem) => boolean | Promise<boolean> | void;
|
|
@@ -13,7 +13,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
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<Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "
|
|
16
|
+
Menu: import("react").ForwardRefExoticComponent<Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
|
|
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<Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "
|
|
14
|
+
export declare const PopoverMenu: React.ForwardRefExoticComponent<Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
|
|
15
15
|
actions: Action[];
|
|
16
16
|
onAction?: ((item: Action) => void) | undefined;
|
|
17
17
|
} & React.RefAttributes<PopoverRef>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
2
|
--track-width: var(--adm-progress-bar-track-width, 3px);
|
|
3
3
|
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
4
|
-
--fill-color: var(--adm-progress-bar-fill-color,
|
|
4
|
+
--fill-color: var(--adm-progress-bar-fill-color, var(--adm-color-primary));
|
|
5
5
|
}
|
|
6
6
|
.adm-progress-bar-trail {
|
|
7
7
|
background: var(--track-color);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*进度圈*/
|
|
2
2
|
.adm-progress-circle {
|
|
3
|
-
--track-width: 3px;
|
|
4
|
-
--size: 50px;
|
|
5
|
-
--track-color: #e5e5e5;
|
|
6
|
-
--fill-color:
|
|
3
|
+
--track-width: var(--adm-progress-circle-track-width, 3px);
|
|
4
|
+
--size: var(--adm-progress-circle-size, 50px);
|
|
5
|
+
--track-color: var(--adm-progress-circle-track-color, #e5e5e5);
|
|
6
|
+
--fill-color: var(--adm-progress-circle-fill-color, var(--adm-color-primary));
|
|
7
7
|
--percent: 0;
|
|
8
8
|
--pi: 3.14159265;
|
|
9
9
|
--radius: calc(var(--size) / 2 - var(--track-width) / 2);
|
|
@@ -4,8 +4,7 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
4
4
|
const classPrefix = `adm-progress-circle`;
|
|
5
5
|
export const ProgressCircle = p => {
|
|
6
6
|
const props = mergeProps({
|
|
7
|
-
percent: 0
|
|
8
|
-
strokeColor: '#1677FF'
|
|
7
|
+
percent: 0
|
|
9
8
|
}, p);
|
|
10
9
|
const style = {
|
|
11
10
|
'--percent': props.percent.toString()
|
|
@@ -3,7 +3,7 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
3
3
|
import { animated, useSpring } from '@react-spring/web';
|
|
4
4
|
import { useDrag } from '@use-gesture/react';
|
|
5
5
|
import { getScrollParent } from '../../utils/get-scroll-parent';
|
|
6
|
-
import React, { useRef, useState } from 'react';
|
|
6
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { supportsPassive } from '../../utils/supports-passive';
|
|
8
8
|
import { convertPx } from '../../utils/convert-px';
|
|
9
9
|
import { rubberbandIfOutOfBounds } from '../../utils/rubberband';
|
|
@@ -36,7 +36,13 @@ export const PullToRefresh = p => {
|
|
|
36
36
|
}
|
|
37
37
|
}));
|
|
38
38
|
const elementRef = useRef(null);
|
|
39
|
-
const pullingRef = useRef(false);
|
|
39
|
+
const pullingRef = useRef(false); //防止下拉时抖动
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
var _a;
|
|
43
|
+
|
|
44
|
+
(_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('touchmove', () => {});
|
|
45
|
+
}, []);
|
|
40
46
|
|
|
41
47
|
function doRefresh() {
|
|
42
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5,6 +5,8 @@ import { RadioGroupContext } from './group-context';
|
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
7
|
import { CheckIcon } from '../checkbox/check-icon';
|
|
8
|
+
import { devWarning } from '../../utils/dev-log';
|
|
9
|
+
import { isDev } from '../../utils/is-dev';
|
|
8
10
|
const classPrefix = `adm-radio`;
|
|
9
11
|
const defaultProps = {
|
|
10
12
|
defaultChecked: false
|
|
@@ -23,6 +25,16 @@ export const Radio = p => {
|
|
|
23
25
|
} = props;
|
|
24
26
|
|
|
25
27
|
if (groupContext && value !== undefined) {
|
|
28
|
+
if (isDev) {
|
|
29
|
+
if (p.checked !== undefined) {
|
|
30
|
+
devWarning('Radio', 'When used within `Radio.Group`, the `checked` prop of `Radio` will not work.');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (p.defaultChecked !== undefined) {
|
|
34
|
+
devWarning('Radio', 'When used within `Radio.Group`, the `defaultChecked` prop of `Radio` will not work.');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
checked = groupContext.value.includes(value);
|
|
27
39
|
|
|
28
40
|
setChecked = checked => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.adm-rate {
|
|
2
2
|
--star-size: 24px;
|
|
3
3
|
--active-color: #ffd21e;
|
|
4
|
+
--inactive-color: var(--adm-color-light);
|
|
4
5
|
display: inline-flex;
|
|
5
6
|
}
|
|
6
7
|
.adm-rate-box {
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
padding: calc(var(--star-size) / 8);
|
|
11
12
|
line-height: var(--star-size);
|
|
12
13
|
font-size: var(--star-size);
|
|
13
|
-
color: var(--
|
|
14
|
+
color: var(--inactive-color);
|
|
14
15
|
text-align: center;
|
|
15
16
|
overflow: hidden;
|
|
16
17
|
cursor: pointer;
|
|
@@ -9,5 +9,5 @@ export declare type RateProps = {
|
|
|
9
9
|
readOnly?: boolean;
|
|
10
10
|
value?: number;
|
|
11
11
|
onChange?: (value: number) => void;
|
|
12
|
-
} & NativeProps<'--star-size' | '--active-color'>;
|
|
12
|
+
} & NativeProps<'--star-size' | '--active-color' | '--inactive-color'>;
|
|
13
13
|
export declare const Rate: FC<RateProps>;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
.adm-slider-fill {
|
|
17
17
|
position: absolute;
|
|
18
|
+
z-index: 1;
|
|
18
19
|
height: 4px;
|
|
19
20
|
background-color: var(--fill-color);
|
|
20
21
|
}
|
|
@@ -37,24 +38,27 @@
|
|
|
37
38
|
background-color: var(--fill-color);
|
|
38
39
|
}
|
|
39
40
|
.adm-slider-thumb {
|
|
40
|
-
touch-action: none;
|
|
41
|
-
position: absolute;
|
|
42
41
|
width: 22px;
|
|
43
42
|
height: 22px;
|
|
43
|
+
margin: 5px;
|
|
44
44
|
border-radius: 50%;
|
|
45
|
-
|
|
46
|
-
top: 50%;
|
|
47
|
-
transform: translate(-50%, -50%);
|
|
48
|
-
background: #fff url('../../assets/slider-thumb.svg') no-repeat center center;
|
|
49
|
-
background-size: 10px 10px;
|
|
45
|
+
background: var(--adm-color-white);
|
|
50
46
|
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.12), 0 1.5px 3px -2px rgba(0, 0, 0, 0.25);
|
|
51
47
|
}
|
|
52
48
|
.adm-slider-thumb:focus {
|
|
53
49
|
outline: none;
|
|
54
50
|
}
|
|
51
|
+
.adm-slider-thumb-icon {
|
|
52
|
+
width: 10px;
|
|
53
|
+
height: 10px;
|
|
54
|
+
margin: 6px;
|
|
55
|
+
user-select: none;
|
|
56
|
+
}
|
|
55
57
|
.adm-slider-thumb-container {
|
|
58
|
+
cursor: grab;
|
|
56
59
|
touch-action: none;
|
|
57
60
|
position: absolute;
|
|
61
|
+
z-index: 2;
|
|
58
62
|
width: 32px;
|
|
59
63
|
height: 32px;
|
|
60
64
|
border-radius: 50%;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
export const ThumbIcon = props => {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
viewBox: '0 0 20 20'
|
|
6
|
+
}, React.createElement("g", {
|
|
7
|
+
stroke: 'none',
|
|
8
|
+
strokeWidth: '1',
|
|
9
|
+
fill: 'none',
|
|
10
|
+
fillRule: 'evenodd'
|
|
11
|
+
}, React.createElement("g", {
|
|
12
|
+
transform: 'translate(-604.000000, -656.000000)',
|
|
13
|
+
fill: '#999999'
|
|
14
|
+
}, React.createElement("g", {
|
|
15
|
+
transform: 'translate(592.000000, 644.000000)'
|
|
16
|
+
}, React.createElement("g", {
|
|
17
|
+
transform: 'translate(12.000000, 12.000000)'
|
|
18
|
+
}, React.createElement("polygon", {
|
|
19
|
+
points: '0 3.33333333 2.22222222 3.33333333 2.22222222 17.7777778 0 17.7777778'
|
|
20
|
+
}), React.createElement("polygon", {
|
|
21
|
+
points: '17.7777778 3.33333333 20 3.33333333 20 17.7777778 17.7777778 17.7777778'
|
|
22
|
+
}), React.createElement("path", {
|
|
23
|
+
d: 'M10.8888889,0 L9.11111111,0 C8.98888889,0 8.88888889,0.107142857 8.88888889,0.238095238 L8.88888889,19.7619048 C8.88888889,19.8928571 8.98888889,20 9.11111111,20 L10.8888889,20 C11.0111111,20 11.1111111,19.8928571 11.1111111,19.7619048 L11.1111111,0.238095238 C11.1111111,0.107142857 11.0111111,0 10.8888889,0 Z'
|
|
24
|
+
})))))));
|
|
25
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { useDrag } from '@use-gesture/react';
|
|
3
|
+
import { ThumbIcon } from './thumb-icon';
|
|
3
4
|
const classPrefix = `adm-slider`;
|
|
4
5
|
|
|
5
6
|
const Thumb = props => {
|
|
@@ -44,7 +45,9 @@ const Thumb = props => {
|
|
|
44
45
|
style: currentPosition()
|
|
45
46
|
}, bind()), React.createElement("div", {
|
|
46
47
|
className: `${classPrefix}-thumb`
|
|
47
|
-
}
|
|
48
|
+
}, React.createElement(ThumbIcon, {
|
|
49
|
+
className: `${classPrefix}-thumb-icon`
|
|
50
|
+
})));
|
|
48
51
|
};
|
|
49
52
|
|
|
50
53
|
export default Thumb;
|
|
@@ -135,16 +135,16 @@ export const Tabs = p => {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
useIsomorphicLayoutEffect(() => {
|
|
138
|
-
animate(
|
|
138
|
+
animate(!x.isAnimating);
|
|
139
139
|
}, []);
|
|
140
140
|
useUpdateLayoutEffect(() => {
|
|
141
141
|
animate();
|
|
142
142
|
}, [activeKey]);
|
|
143
143
|
useResizeEffect(() => {
|
|
144
|
-
animate(
|
|
144
|
+
animate(!x.isAnimating);
|
|
145
145
|
}, tabListContainerRef);
|
|
146
146
|
useMutationEffect(() => {
|
|
147
|
-
animate(
|
|
147
|
+
animate(!x.isAnimating);
|
|
148
148
|
}, tabListContainerRef, {
|
|
149
149
|
subtree: true,
|
|
150
150
|
childList: true,
|
|
@@ -2,6 +2,7 @@ import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react
|
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
4
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
5
|
+
import { devError } from '../../utils/dev-log';
|
|
5
6
|
const classPrefix = 'adm-text-area';
|
|
6
7
|
const defaultProps = {
|
|
7
8
|
rows: 2,
|
|
@@ -16,7 +17,14 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
16
17
|
showCount,
|
|
17
18
|
maxLength
|
|
18
19
|
} = props;
|
|
19
|
-
const [value, setValue] = usePropsValue(props)
|
|
20
|
+
const [value, setValue] = usePropsValue(Object.assign(Object.assign({}, props), {
|
|
21
|
+
value: props.value === null ? '' : props.value
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
if (props.value === null) {
|
|
25
|
+
devError('TextArea', '`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.');
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
const nativeTextAreaRef = useRef(null);
|
|
21
29
|
useImperativeHandle(ref, () => ({
|
|
22
30
|
clear: () => {
|
package/es/utils/is-dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const isDev = process.env.NODE_ENV === 'development';
|
|
1
|
+
export const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.28",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@react-spring/web": "^9.4.3",
|
|
6
6
|
"@types/resize-observer-browser": "^0.1.7",
|
|
@@ -39,5 +39,6 @@
|
|
|
39
39
|
"url": "git+https://github.com/ant-design/ant-design-mobile.git",
|
|
40
40
|
"branch": "master",
|
|
41
41
|
"platform": "github"
|
|
42
|
-
}
|
|
42
|
+
},
|
|
43
|
+
"packageManager": "yarn@3.1.1"
|
|
43
44
|
}
|