antd-mobile 5.12.4 → 5.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/cjs/components/action-sheet/action-sheet.css +22 -7
- package/2x/cjs/components/action-sheet/action-sheet.js +8 -16
- package/2x/cjs/components/button/button.d.ts +1 -1
- package/2x/cjs/components/calendar/calendar.css +4 -0
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +1 -1
- package/2x/cjs/components/form/form-item.js +1 -4
- package/2x/cjs/components/image/image.d.ts +1 -0
- package/2x/cjs/components/image/image.js +4 -2
- package/2x/cjs/components/popover/popover.css +1 -0
- package/2x/cjs/components/popover/popover.js +3 -1
- package/2x/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/2x/cjs/components/swiper/index.d.ts +1 -1
- package/2x/cjs/components/swiper/swiper.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.js +2 -1
- package/2x/es/components/action-sheet/action-sheet.css +22 -7
- package/2x/es/components/action-sheet/action-sheet.js +8 -15
- package/2x/es/components/button/button.d.ts +1 -1
- package/2x/es/components/calendar/calendar.css +4 -0
- package/2x/es/components/calendar/calendar.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +1 -1
- package/2x/es/components/form/form-item.js +1 -4
- package/2x/es/components/image/image.d.ts +1 -0
- package/2x/es/components/image/image.js +4 -2
- package/2x/es/components/popover/popover.css +1 -0
- package/2x/es/components/popover/popover.js +3 -1
- package/2x/es/components/search-bar/search-bar.d.ts +1 -1
- package/2x/es/components/swiper/index.d.ts +1 -1
- package/2x/es/components/swiper/swiper.d.ts +1 -1
- package/2x/es/components/text-area/text-area.js +2 -1
- package/2x/package.json +5 -5
- package/bundle/antd-mobile.cjs.js +165 -168
- package/bundle/antd-mobile.es.js +166 -169
- package/bundle/style.css +94 -78
- package/cjs/components/action-sheet/action-sheet.css +19 -7
- package/cjs/components/action-sheet/action-sheet.js +8 -16
- package/cjs/components/button/button.d.ts +1 -1
- package/cjs/components/calendar/calendar.css +3 -0
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +1 -1
- package/cjs/components/form/form-item.js +1 -4
- package/cjs/components/image/image.d.ts +1 -0
- package/cjs/components/image/image.js +4 -2
- package/cjs/components/popover/popover.css +1 -0
- package/cjs/components/popover/popover.js +3 -1
- package/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/cjs/components/swiper/index.d.ts +1 -1
- package/cjs/components/swiper/swiper.d.ts +1 -1
- package/cjs/components/text-area/text-area.js +2 -1
- package/es/components/action-sheet/action-sheet.css +19 -7
- package/es/components/action-sheet/action-sheet.js +8 -15
- package/es/components/button/button.d.ts +1 -1
- package/es/components/calendar/calendar.css +3 -0
- package/es/components/calendar/calendar.d.ts +1 -0
- package/es/components/calendar/calendar.js +1 -1
- package/es/components/form/form-item.js +1 -4
- package/es/components/image/image.d.ts +1 -0
- package/es/components/image/image.js +4 -2
- package/es/components/popover/popover.css +1 -0
- package/es/components/popover/popover.js +3 -1
- package/es/components/search-bar/search-bar.d.ts +1 -1
- package/es/components/swiper/index.d.ts +1 -1
- package/es/components/swiper/swiper.d.ts +1 -1
- package/es/components/text-area/text-area.js +2 -1
- package/package.json +5 -5
- package/umd/antd-mobile.js +1 -1
|
@@ -8,19 +8,31 @@
|
|
|
8
8
|
justify-content: center;
|
|
9
9
|
color: var(--adm-color-weak);
|
|
10
10
|
font-size: 15px;
|
|
11
|
-
padding: 18px
|
|
11
|
+
padding: 18px 12px;
|
|
12
|
+
border-bottom: 1px solid var(--adm-border-color);
|
|
13
|
+
}
|
|
14
|
+
.adm-action-sheet-button-list {
|
|
12
15
|
border-bottom: 1px solid var(--adm-border-color);
|
|
13
16
|
}
|
|
14
17
|
.adm-action-sheet-button-item-wrapper {
|
|
15
|
-
|
|
16
|
-
border-top: 1px solid var(--adm-border-color);
|
|
18
|
+
border-bottom: 1px solid var(--adm-border-color);
|
|
17
19
|
}
|
|
18
|
-
.adm-action-sheet-button-item-wrapper:
|
|
19
|
-
border-
|
|
20
|
+
.adm-action-sheet-button-item-wrapper:last-child {
|
|
21
|
+
border-bottom: none;
|
|
20
22
|
}
|
|
21
23
|
.adm-action-sheet-button-item {
|
|
22
|
-
padding: 14px;
|
|
23
24
|
text-align: center;
|
|
25
|
+
display: block;
|
|
26
|
+
background-color: #ffffff;
|
|
27
|
+
padding: 16px;
|
|
28
|
+
}
|
|
29
|
+
.adm-action-sheet-button-item:active {
|
|
30
|
+
background-color: #eeeeee;
|
|
31
|
+
}
|
|
32
|
+
.adm-action-sheet-button-item-disabled {
|
|
33
|
+
cursor: not-allowed;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
opacity: 0.4;
|
|
24
36
|
}
|
|
25
37
|
.adm-action-sheet-button-item-name {
|
|
26
38
|
color: var(--adm-color-text);
|
|
@@ -29,7 +41,7 @@
|
|
|
29
41
|
.adm-action-sheet-button-item-description {
|
|
30
42
|
font-size: 12px;
|
|
31
43
|
color: var(--adm-color-weak);
|
|
32
|
-
padding-top:
|
|
44
|
+
padding-top: 2px;
|
|
33
45
|
}
|
|
34
46
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
35
47
|
color: var(--adm-color-danger);
|
|
@@ -16,8 +16,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
16
16
|
|
|
17
17
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
18
18
|
|
|
19
|
-
var _button = _interopRequireDefault(require("../button"));
|
|
20
|
-
|
|
21
19
|
var _safeArea = _interopRequireDefault(require("../safe-area"));
|
|
22
20
|
|
|
23
21
|
var _renderImperatively = require("../../utils/render-imperatively");
|
|
@@ -60,11 +58,11 @@ const ActionSheet = p => {
|
|
|
60
58
|
}, props.actions.map((action, index) => _react.default.createElement("div", {
|
|
61
59
|
key: action.key,
|
|
62
60
|
className: `${classPrefix}-button-item-wrapper`
|
|
63
|
-
}, _react.default.createElement(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
}, _react.default.createElement("a", {
|
|
62
|
+
className: (0, _classnames.default)('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
63
|
+
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
64
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
65
|
+
}),
|
|
68
66
|
onClick: () => {
|
|
69
67
|
var _a, _b, _c;
|
|
70
68
|
|
|
@@ -74,10 +72,7 @@ const ActionSheet = p => {
|
|
|
74
72
|
if (props.closeOnAction) {
|
|
75
73
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
76
74
|
}
|
|
77
|
-
}
|
|
78
|
-
className: (0, _classnames.default)(`${classPrefix}-button-item`, {
|
|
79
|
-
[`${classPrefix}-button-item-danger`]: action.danger
|
|
80
|
-
})
|
|
75
|
+
}
|
|
81
76
|
}, _react.default.createElement("div", {
|
|
82
77
|
className: `${classPrefix}-button-item-name`
|
|
83
78
|
}, action.text), action.description && _react.default.createElement("div", {
|
|
@@ -86,11 +81,8 @@ const ActionSheet = p => {
|
|
|
86
81
|
className: `${classPrefix}-cancel`
|
|
87
82
|
}, _react.default.createElement("div", {
|
|
88
83
|
className: `${classPrefix}-button-item-wrapper`
|
|
89
|
-
}, _react.default.createElement(
|
|
90
|
-
|
|
91
|
-
fill: 'none',
|
|
92
|
-
shape: 'rectangular',
|
|
93
|
-
className: `${classPrefix}-button-item`,
|
|
84
|
+
}, _react.default.createElement("a", {
|
|
85
|
+
className: (0, _classnames.default)('adm-plain-anchor', `${classPrefix}-button-item`),
|
|
94
86
|
onClick: () => {
|
|
95
87
|
var _a;
|
|
96
88
|
|
|
@@ -31,5 +31,5 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
31
31
|
type?: "reset" | "submit" | "button" | undefined;
|
|
32
32
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
|
33
33
|
children?: React.ReactNode;
|
|
34
|
-
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
35
35
|
export {};
|
|
@@ -71,6 +71,9 @@
|
|
|
71
71
|
border-top-right-radius: 4px;
|
|
72
72
|
border-bottom-right-radius: 4px;
|
|
73
73
|
}
|
|
74
|
+
.adm-calendar-cell.adm-calendar-cell-disabled.adm-calendar-cell.adm-calendar-cell-selected {
|
|
75
|
+
color: var(--adm-color-light);
|
|
76
|
+
}
|
|
74
77
|
.adm-calendar-cell .adm-calendar-cell-top {
|
|
75
78
|
flex: none;
|
|
76
79
|
font-size: 18px;
|
|
@@ -153,7 +153,7 @@ const Calendar = (0, _react.forwardRef)((p, ref) => {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const inThisMonth = d.month() === current.month();
|
|
156
|
-
const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
156
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
157
157
|
cells.push(_react.default.createElement("div", {
|
|
158
158
|
key: d.valueOf(),
|
|
159
159
|
className: (0, _classnames.default)(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
@@ -256,10 +256,7 @@ const FormItem = props => {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
let Variables = {};
|
|
259
|
-
|
|
260
|
-
if (typeof label === 'string') {
|
|
261
|
-
Variables.label = label;
|
|
262
|
-
}
|
|
259
|
+
Variables.label = typeof label === 'string' ? label : '';
|
|
263
260
|
|
|
264
261
|
if (messageVariables) {
|
|
265
262
|
Variables = Object.assign(Object.assign({}, Variables), messageVariables);
|
|
@@ -9,6 +9,7 @@ export declare type ImageProps = {
|
|
|
9
9
|
placeholder?: ReactNode;
|
|
10
10
|
fallback?: ReactNode;
|
|
11
11
|
lazy?: boolean;
|
|
12
|
+
draggable?: boolean;
|
|
12
13
|
onClick?: (event: React.MouseEvent<HTMLImageElement, Event>) => void;
|
|
13
14
|
onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
14
15
|
onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
@@ -36,7 +36,8 @@ const defaultProps = {
|
|
|
36
36
|
fallback: _react.default.createElement("div", {
|
|
37
37
|
className: `${classPrefix}-tip`
|
|
38
38
|
}, _react.default.createElement(_brokenImageIcon.BrokenImageIcon, null)),
|
|
39
|
-
lazy: false
|
|
39
|
+
lazy: false,
|
|
40
|
+
draggable: false
|
|
40
41
|
};
|
|
41
42
|
const Image = (0, _stagedComponents.staged)(p => {
|
|
42
43
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
@@ -85,7 +86,8 @@ const Image = (0, _stagedComponents.staged)(p => {
|
|
|
85
86
|
referrerPolicy: props.referrerPolicy,
|
|
86
87
|
sizes: props.sizes,
|
|
87
88
|
srcSet: srcSet,
|
|
88
|
-
useMap: props.useMap
|
|
89
|
+
useMap: props.useMap,
|
|
90
|
+
draggable: props.draggable
|
|
89
91
|
});
|
|
90
92
|
|
|
91
93
|
return _react.default.createElement(_react.default.Fragment, null, !loaded && props.placeholder, img);
|
|
@@ -160,7 +160,9 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
|
160
160
|
(0, _react.useEffect)(() => {
|
|
161
161
|
const floatingElement = floatingRef.current;
|
|
162
162
|
if (!targetElement || !floatingElement) return;
|
|
163
|
-
return (0, _dom.autoUpdate)(targetElement, floatingElement, update
|
|
163
|
+
return (0, _dom.autoUpdate)(targetElement, floatingElement, update, {
|
|
164
|
+
elementResize: typeof ResizeObserver !== 'undefined'
|
|
165
|
+
});
|
|
164
166
|
}, [targetElement]);
|
|
165
167
|
(0, _ahooks.useClickAway)(() => {
|
|
166
168
|
if (!props.trigger) return;
|
|
@@ -31,4 +31,4 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
31
31
|
onSearch?: ((val: string) => void) | undefined;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
33
|
onCancel?: (() => void) | undefined;
|
|
34
|
-
} & NativeProps<"--
|
|
34
|
+
} & NativeProps<"--height" | "--border-radius" | "--padding-left" | "--background" | "--placeholder-color"> & React.RefAttributes<InputRef>>;
|
|
@@ -16,7 +16,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
|
-
} & import("../../utils/native-props").NativeProps<"--
|
|
19
|
+
} & import("../../utils/native-props").NativeProps<"--width" | "--height" | "--border-radius" | "--track-padding"> & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
20
|
Item: import("react").FC<{
|
|
21
21
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
22
22
|
children?: import("react").ReactNode;
|
|
@@ -37,4 +37,4 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
39
|
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
|
-
} & NativeProps<"--
|
|
40
|
+
} & NativeProps<"--width" | "--height" | "--border-radius" | "--track-padding"> & React.RefAttributes<SwiperRef>>;
|
|
@@ -123,7 +123,8 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
123
123
|
compositingRef.current = false;
|
|
124
124
|
|
|
125
125
|
if (maxLength) {
|
|
126
|
-
|
|
126
|
+
const v = e.target.value;
|
|
127
|
+
setValue([...v].slice(0, maxLength).join(''));
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
@@ -8,19 +8,31 @@
|
|
|
8
8
|
justify-content: center;
|
|
9
9
|
color: var(--adm-color-weak);
|
|
10
10
|
font-size: 15px;
|
|
11
|
-
padding: 18px
|
|
11
|
+
padding: 18px 12px;
|
|
12
|
+
border-bottom: 1px solid var(--adm-border-color);
|
|
13
|
+
}
|
|
14
|
+
.adm-action-sheet-button-list {
|
|
12
15
|
border-bottom: 1px solid var(--adm-border-color);
|
|
13
16
|
}
|
|
14
17
|
.adm-action-sheet-button-item-wrapper {
|
|
15
|
-
|
|
16
|
-
border-top: 1px solid var(--adm-border-color);
|
|
18
|
+
border-bottom: 1px solid var(--adm-border-color);
|
|
17
19
|
}
|
|
18
|
-
.adm-action-sheet-button-item-wrapper:
|
|
19
|
-
border-
|
|
20
|
+
.adm-action-sheet-button-item-wrapper:last-child {
|
|
21
|
+
border-bottom: none;
|
|
20
22
|
}
|
|
21
23
|
.adm-action-sheet-button-item {
|
|
22
|
-
padding: 14px;
|
|
23
24
|
text-align: center;
|
|
25
|
+
display: block;
|
|
26
|
+
background-color: #ffffff;
|
|
27
|
+
padding: 16px;
|
|
28
|
+
}
|
|
29
|
+
.adm-action-sheet-button-item:active {
|
|
30
|
+
background-color: #eeeeee;
|
|
31
|
+
}
|
|
32
|
+
.adm-action-sheet-button-item-disabled {
|
|
33
|
+
cursor: not-allowed;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
opacity: 0.4;
|
|
24
36
|
}
|
|
25
37
|
.adm-action-sheet-button-item-name {
|
|
26
38
|
color: var(--adm-color-text);
|
|
@@ -29,7 +41,7 @@
|
|
|
29
41
|
.adm-action-sheet-button-item-description {
|
|
30
42
|
font-size: 12px;
|
|
31
43
|
color: var(--adm-color-weak);
|
|
32
|
-
padding-top:
|
|
44
|
+
padding-top: 2px;
|
|
33
45
|
}
|
|
34
46
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
35
47
|
color: var(--adm-color-danger);
|
|
@@ -3,7 +3,6 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import Popup from '../popup';
|
|
6
|
-
import Button from '../button';
|
|
7
6
|
import SafeArea from '../safe-area';
|
|
8
7
|
import { renderImperatively } from '../../utils/render-imperatively';
|
|
9
8
|
const classPrefix = `adm-action-sheet`;
|
|
@@ -41,11 +40,11 @@ export const ActionSheet = p => {
|
|
|
41
40
|
}, props.actions.map((action, index) => React.createElement("div", {
|
|
42
41
|
key: action.key,
|
|
43
42
|
className: `${classPrefix}-button-item-wrapper`
|
|
44
|
-
}, React.createElement(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
}, React.createElement("a", {
|
|
44
|
+
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
45
|
+
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
46
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
47
|
+
}),
|
|
49
48
|
onClick: () => {
|
|
50
49
|
var _a, _b, _c;
|
|
51
50
|
|
|
@@ -55,10 +54,7 @@ export const ActionSheet = p => {
|
|
|
55
54
|
if (props.closeOnAction) {
|
|
56
55
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
57
56
|
}
|
|
58
|
-
}
|
|
59
|
-
className: classNames(`${classPrefix}-button-item`, {
|
|
60
|
-
[`${classPrefix}-button-item-danger`]: action.danger
|
|
61
|
-
})
|
|
57
|
+
}
|
|
62
58
|
}, React.createElement("div", {
|
|
63
59
|
className: `${classPrefix}-button-item-name`
|
|
64
60
|
}, action.text), action.description && React.createElement("div", {
|
|
@@ -67,11 +63,8 @@ export const ActionSheet = p => {
|
|
|
67
63
|
className: `${classPrefix}-cancel`
|
|
68
64
|
}, React.createElement("div", {
|
|
69
65
|
className: `${classPrefix}-button-item-wrapper`
|
|
70
|
-
}, React.createElement(
|
|
71
|
-
|
|
72
|
-
fill: 'none',
|
|
73
|
-
shape: 'rectangular',
|
|
74
|
-
className: `${classPrefix}-button-item`,
|
|
66
|
+
}, React.createElement("a", {
|
|
67
|
+
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`),
|
|
75
68
|
onClick: () => {
|
|
76
69
|
var _a;
|
|
77
70
|
|
|
@@ -31,5 +31,5 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
31
31
|
type?: "reset" | "submit" | "button" | undefined;
|
|
32
32
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
|
33
33
|
children?: React.ReactNode;
|
|
34
|
-
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
35
35
|
export {};
|
|
@@ -71,6 +71,9 @@
|
|
|
71
71
|
border-top-right-radius: 4px;
|
|
72
72
|
border-bottom-right-radius: 4px;
|
|
73
73
|
}
|
|
74
|
+
.adm-calendar-cell.adm-calendar-cell-disabled.adm-calendar-cell.adm-calendar-cell-selected {
|
|
75
|
+
color: var(--adm-color-light);
|
|
76
|
+
}
|
|
74
77
|
.adm-calendar-cell .adm-calendar-cell-top {
|
|
75
78
|
flex: none;
|
|
76
79
|
font-size: 18px;
|
|
@@ -125,7 +125,7 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const inThisMonth = d.month() === current.month();
|
|
128
|
-
const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
128
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
129
129
|
cells.push(React.createElement("div", {
|
|
130
130
|
key: d.valueOf(),
|
|
131
131
|
className: classNames(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
@@ -228,10 +228,7 @@ export const FormItem = props => {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
let Variables = {};
|
|
231
|
-
|
|
232
|
-
if (typeof label === 'string') {
|
|
233
|
-
Variables.label = label;
|
|
234
|
-
}
|
|
231
|
+
Variables.label = typeof label === 'string' ? label : '';
|
|
235
232
|
|
|
236
233
|
if (messageVariables) {
|
|
237
234
|
Variables = Object.assign(Object.assign({}, Variables), messageVariables);
|
|
@@ -9,6 +9,7 @@ export declare type ImageProps = {
|
|
|
9
9
|
placeholder?: ReactNode;
|
|
10
10
|
fallback?: ReactNode;
|
|
11
11
|
lazy?: boolean;
|
|
12
|
+
draggable?: boolean;
|
|
12
13
|
onClick?: (event: React.MouseEvent<HTMLImageElement, Event>) => void;
|
|
13
14
|
onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
14
15
|
onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
@@ -16,7 +16,8 @@ const defaultProps = {
|
|
|
16
16
|
fallback: React.createElement("div", {
|
|
17
17
|
className: `${classPrefix}-tip`
|
|
18
18
|
}, React.createElement(BrokenImageIcon, null)),
|
|
19
|
-
lazy: false
|
|
19
|
+
lazy: false,
|
|
20
|
+
draggable: false
|
|
20
21
|
};
|
|
21
22
|
export const Image = staged(p => {
|
|
22
23
|
const props = mergeProps(defaultProps, p);
|
|
@@ -65,7 +66,8 @@ export const Image = staged(p => {
|
|
|
65
66
|
referrerPolicy: props.referrerPolicy,
|
|
66
67
|
sizes: props.sizes,
|
|
67
68
|
srcSet: srcSet,
|
|
68
|
-
useMap: props.useMap
|
|
69
|
+
useMap: props.useMap,
|
|
70
|
+
draggable: props.draggable
|
|
69
71
|
});
|
|
70
72
|
return React.createElement(React.Fragment, null, !loaded && props.placeholder, img);
|
|
71
73
|
}
|
|
@@ -132,7 +132,9 @@ export const Popover = forwardRef((p, ref) => {
|
|
|
132
132
|
useEffect(() => {
|
|
133
133
|
const floatingElement = floatingRef.current;
|
|
134
134
|
if (!targetElement || !floatingElement) return;
|
|
135
|
-
return autoUpdate(targetElement, floatingElement, update
|
|
135
|
+
return autoUpdate(targetElement, floatingElement, update, {
|
|
136
|
+
elementResize: typeof ResizeObserver !== 'undefined'
|
|
137
|
+
});
|
|
136
138
|
}, [targetElement]);
|
|
137
139
|
useClickAway(() => {
|
|
138
140
|
if (!props.trigger) return;
|
|
@@ -31,4 +31,4 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
31
31
|
onSearch?: ((val: string) => void) | undefined;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
33
|
onCancel?: (() => void) | undefined;
|
|
34
|
-
} & NativeProps<"--
|
|
34
|
+
} & NativeProps<"--height" | "--border-radius" | "--padding-left" | "--background" | "--placeholder-color"> & React.RefAttributes<InputRef>>;
|
|
@@ -16,7 +16,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
|
-
} & import("../../utils/native-props").NativeProps<"--
|
|
19
|
+
} & import("../../utils/native-props").NativeProps<"--width" | "--height" | "--border-radius" | "--track-padding"> & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
20
|
Item: import("react").FC<{
|
|
21
21
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
22
22
|
children?: import("react").ReactNode;
|
|
@@ -37,4 +37,4 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
39
|
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
|
-
} & NativeProps<"--
|
|
40
|
+
} & NativeProps<"--width" | "--height" | "--border-radius" | "--track-padding"> & React.RefAttributes<SwiperRef>>;
|
|
@@ -106,7 +106,8 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
106
106
|
compositingRef.current = false;
|
|
107
107
|
|
|
108
108
|
if (maxLength) {
|
|
109
|
-
|
|
109
|
+
const v = e.target.value;
|
|
110
|
+
setValue([...v].slice(0, maxLength).join(''));
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.7",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@floating-ui/dom": "^0.
|
|
5
|
+
"@floating-ui/dom": "^0.5.1",
|
|
6
6
|
"@react-spring/web": "^9.4.5",
|
|
7
|
-
"@use-gesture/react": "10.2.
|
|
8
|
-
"ahooks": "^3.3.
|
|
7
|
+
"@use-gesture/react": "10.2.12",
|
|
8
|
+
"ahooks": "^3.3.12",
|
|
9
9
|
"antd-mobile-icons": "^0.2.2",
|
|
10
10
|
"antd-mobile-v5-count": "^1.0.1",
|
|
11
11
|
"big.js": "^6.1.1",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"rc-field-form": "^1.26.4",
|
|
16
16
|
"react-is": "^17.0.2",
|
|
17
17
|
"staged-components": "^1.1.2",
|
|
18
|
-
"tslib": "^2.
|
|
18
|
+
"tslib": "^2.4.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|