antd-mobile 5.0.0-rc.21 → 5.0.0-rc.22
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/avatar/avatar.d.ts +1 -1
- package/2x/cjs/components/badge/badge.css +1 -1
- package/2x/cjs/components/calendar/calendar.js +4 -0
- package/2x/cjs/components/capsule-tabs/capsule-tabs.css +1 -1
- package/2x/cjs/components/checkbox/checkbox.css +6 -16
- package/2x/cjs/components/checkbox/checkbox.js +1 -1
- package/2x/cjs/components/error-block/error-block.d.ts +1 -1
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +2 -0
- package/2x/cjs/components/floating-panel/floating-panel.js +5 -0
- package/2x/cjs/components/form/form.css +4 -0
- package/2x/cjs/components/form/index.css +4 -0
- package/2x/cjs/components/input/input.css +28 -25
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/input/input.js +7 -3
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/2x/cjs/components/list/list.d.ts +1 -1
- package/2x/cjs/components/nav-bar/nav-bar.css +3 -3
- package/2x/cjs/components/notice-bar/notice-bar.d.ts +1 -1
- package/2x/cjs/components/radio/radio.css +5 -5
- package/2x/cjs/components/result/result.css +2 -5
- package/2x/cjs/components/search-bar/search-bar.css +14 -9
- package/2x/cjs/components/selector/selector.css +4 -0
- package/2x/cjs/components/spin-loading/spin-loading.css +1 -19
- package/2x/cjs/components/spin-loading/spin-loading.d.ts +1 -1
- package/2x/cjs/components/spin-loading/spin-loading.js +33 -5
- package/2x/cjs/components/stepper/stepper.css +4 -7
- package/2x/cjs/components/stepper/stepper.js +0 -1
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -2
- package/2x/cjs/components/swipe-action/swipe-action.js +1 -1
- package/2x/cjs/components/swiper/swiper.js +14 -19
- package/2x/cjs/components/tabs/tabs.css +1 -1
- package/2x/cjs/components/tag/tag.css +3 -3
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +1 -1
- package/2x/cjs/utils/get-scroll-parent.js +1 -1
- package/2x/es/components/avatar/avatar.d.ts +1 -1
- package/2x/es/components/badge/badge.css +1 -1
- package/2x/es/components/calendar/calendar.js +2 -0
- package/2x/es/components/capsule-tabs/capsule-tabs.css +1 -1
- package/2x/es/components/checkbox/checkbox.css +6 -16
- package/2x/es/components/checkbox/checkbox.js +1 -1
- package/2x/es/components/error-block/error-block.d.ts +1 -1
- package/2x/es/components/floating-panel/floating-panel.d.ts +2 -0
- package/2x/es/components/floating-panel/floating-panel.js +5 -0
- package/2x/es/components/form/form.css +4 -0
- package/2x/es/components/form/index.css +4 -0
- package/2x/es/components/input/input.css +28 -25
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/input/input.js +4 -3
- package/2x/es/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/2x/es/components/list/list.d.ts +1 -1
- package/2x/es/components/nav-bar/nav-bar.css +3 -3
- package/2x/es/components/notice-bar/notice-bar.d.ts +1 -1
- package/2x/es/components/radio/radio.css +5 -5
- package/2x/es/components/result/result.css +2 -5
- package/2x/es/components/search-bar/search-bar.css +14 -9
- package/2x/es/components/selector/selector.css +4 -0
- package/2x/es/components/spin-loading/spin-loading.css +1 -19
- package/2x/es/components/spin-loading/spin-loading.d.ts +1 -1
- package/2x/es/components/spin-loading/spin-loading.js +32 -5
- package/2x/es/components/stepper/stepper.css +4 -7
- package/2x/es/components/stepper/stepper.js +0 -1
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -2
- package/2x/es/components/swipe-action/swipe-action.js +1 -1
- package/2x/es/components/swiper/swiper.js +13 -19
- package/2x/es/components/tabs/tabs.css +1 -1
- package/2x/es/components/tag/tag.css +3 -3
- package/2x/es/components/virtual-input/virtual-input.d.ts +1 -1
- package/2x/es/utils/get-scroll-parent.js +1 -1
- package/2x/package.json +2 -2
- package/README.md +1 -1
- package/cjs/components/avatar/avatar.d.ts +1 -1
- package/cjs/components/badge/badge.css +1 -1
- package/cjs/components/calendar/calendar.js +4 -0
- package/cjs/components/capsule-tabs/capsule-tabs.css +1 -1
- package/cjs/components/checkbox/checkbox.css +6 -14
- package/cjs/components/checkbox/checkbox.js +1 -1
- package/cjs/components/error-block/error-block.d.ts +1 -1
- package/cjs/components/floating-panel/floating-panel.d.ts +2 -0
- package/cjs/components/floating-panel/floating-panel.js +5 -0
- package/cjs/components/form/form.css +3 -0
- package/cjs/components/form/index.css +3 -0
- package/cjs/components/input/input.css +26 -24
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/input/input.js +7 -3
- package/cjs/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/cjs/components/list/list.d.ts +1 -1
- package/cjs/components/nav-bar/nav-bar.css +3 -3
- package/cjs/components/notice-bar/notice-bar.d.ts +1 -1
- package/cjs/components/radio/radio.css +5 -5
- package/cjs/components/result/result.css +2 -5
- package/cjs/components/search-bar/search-bar.css +13 -9
- package/cjs/components/selector/selector.css +3 -0
- package/cjs/components/spin-loading/spin-loading.css +1 -17
- package/cjs/components/spin-loading/spin-loading.d.ts +1 -1
- package/cjs/components/spin-loading/spin-loading.js +33 -5
- package/cjs/components/stepper/stepper.css +4 -6
- package/cjs/components/stepper/stepper.js +0 -1
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -2
- package/cjs/components/swipe-action/swipe-action.js +1 -1
- package/cjs/components/swiper/swiper.js +14 -19
- package/cjs/components/tabs/tabs.css +1 -1
- package/cjs/components/tag/tag.css +3 -3
- package/cjs/components/virtual-input/virtual-input.d.ts +1 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/es/components/avatar/avatar.d.ts +1 -1
- package/es/components/badge/badge.css +1 -1
- package/es/components/calendar/calendar.js +2 -0
- package/es/components/capsule-tabs/capsule-tabs.css +1 -1
- package/es/components/checkbox/checkbox.css +6 -14
- package/es/components/checkbox/checkbox.js +1 -1
- package/es/components/error-block/error-block.d.ts +1 -1
- package/es/components/floating-panel/floating-panel.d.ts +2 -0
- package/es/components/floating-panel/floating-panel.js +5 -0
- package/es/components/form/form.css +3 -0
- package/es/components/form/index.css +3 -0
- package/es/components/input/input.css +26 -24
- package/es/components/input/input.d.ts +2 -2
- package/es/components/input/input.js +4 -3
- package/es/components/jumbo-tabs/jumbo-tabs.css +4 -1
- package/es/components/list/list.d.ts +1 -1
- package/es/components/nav-bar/nav-bar.css +3 -3
- package/es/components/notice-bar/notice-bar.d.ts +1 -1
- package/es/components/radio/radio.css +5 -5
- package/es/components/result/result.css +2 -5
- package/es/components/search-bar/search-bar.css +13 -9
- package/es/components/selector/selector.css +3 -0
- package/es/components/spin-loading/spin-loading.css +1 -17
- package/es/components/spin-loading/spin-loading.d.ts +1 -1
- package/es/components/spin-loading/spin-loading.js +32 -5
- package/es/components/stepper/stepper.css +4 -6
- package/es/components/stepper/stepper.js +0 -1
- package/es/components/swipe-action/swipe-action.d.ts +2 -2
- package/es/components/swipe-action/swipe-action.js +1 -1
- package/es/components/swiper/swiper.js +13 -19
- package/es/components/tabs/tabs.css +1 -1
- package/es/components/tag/tag.css +3 -3
- package/es/components/virtual-input/virtual-input.d.ts +1 -1
- package/es/utils/get-scroll-parent.js +1 -1
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
.adm-result {
|
|
2
|
-
--bg-color: var(--adm-color-white);
|
|
3
|
-
--color: var(--adm-color-text);
|
|
4
|
-
--adm-color-weak: var(--adm-color-weak);
|
|
5
2
|
padding: 32px 12px;
|
|
6
|
-
background-color: var(--
|
|
3
|
+
background-color: var(--adm-color-white);
|
|
7
4
|
}
|
|
8
5
|
.adm-result-icon {
|
|
9
6
|
box-sizing: border-box;
|
|
@@ -16,7 +13,7 @@
|
|
|
16
13
|
font-size: 52px;
|
|
17
14
|
}
|
|
18
15
|
.adm-result-title {
|
|
19
|
-
color: var(--color);
|
|
16
|
+
color: var(--adm-color-text);
|
|
20
17
|
font-size: 18px;
|
|
21
18
|
line-height: 1.4;
|
|
22
19
|
text-align: center;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
.adm-search-bar {
|
|
2
|
-
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
--height: 28px;
|
|
2
|
+
--height: 32px;
|
|
6
3
|
--padding-left: 8px;
|
|
7
4
|
--background: #f5f5f5;
|
|
8
5
|
--border-radius: 6px;
|
|
9
6
|
--placeholder-color: var(--adm-color-weak);
|
|
10
7
|
---placeholder-color: var(--placeholder-color);
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: var(--height);
|
|
11
12
|
}
|
|
12
13
|
.adm-search-bar .adm-search-bar-input-box {
|
|
13
14
|
flex: auto;
|
|
@@ -21,20 +22,20 @@
|
|
|
21
22
|
}
|
|
22
23
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input-box-icon {
|
|
23
24
|
flex: none;
|
|
24
|
-
color: var(
|
|
25
|
+
color: var(--adm-color-light);
|
|
25
26
|
font-size: 16px;
|
|
26
27
|
}
|
|
27
28
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input {
|
|
28
29
|
flex: auto;
|
|
29
30
|
padding: 4px 8px 4px 4px;
|
|
30
|
-
height: var(--height);
|
|
31
|
+
height: calc(var(--height) - 2px);
|
|
31
32
|
box-sizing: border-box;
|
|
32
33
|
}
|
|
33
|
-
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-input
|
|
34
|
+
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-input {
|
|
34
35
|
--placeholder-color: var(---placeholder-color);
|
|
36
|
+
--font-size: 15px;
|
|
35
37
|
}
|
|
36
|
-
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input .adm-input {
|
|
37
|
-
font-size: 13px;
|
|
38
|
+
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input .adm-input-element {
|
|
38
39
|
line-height: 19px;
|
|
39
40
|
}
|
|
40
41
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-search-bar-input-without-icon {
|
|
@@ -47,6 +48,9 @@
|
|
|
47
48
|
.adm-search-bar .adm-search-bar-cancel-button.adm-button {
|
|
48
49
|
padding: 3px 12px;
|
|
49
50
|
}
|
|
51
|
+
.adm-search-bar-active .adm-input.adm-input {
|
|
52
|
+
--placeholder-color: var(--adm-color-light);
|
|
53
|
+
}
|
|
50
54
|
.adm-search-bar-active .adm-search-bar-input-box {
|
|
51
55
|
border-color: var(--adm-color-primary);
|
|
52
56
|
background: var(--adm-color-white);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
.adm-spin-loading {
|
|
2
2
|
--color: var(--adm-color-weak);
|
|
3
3
|
--size: 32px;
|
|
4
|
-
--track-width: calc(var(--size) / 16);
|
|
5
4
|
--pi: 3.14159265;
|
|
6
|
-
--radius:
|
|
5
|
+
--radius: 15;
|
|
7
6
|
--circumference: calc(var(--radius) * var(--pi) * 2);
|
|
8
7
|
width: var(--size);
|
|
9
8
|
height: var(--size);
|
|
@@ -15,13 +14,6 @@
|
|
|
15
14
|
}
|
|
16
15
|
.adm-spin-loading-svg > .adm-spin-loading-fill {
|
|
17
16
|
stroke: var(--color);
|
|
18
|
-
stroke-width: var(--track-width);
|
|
19
|
-
stroke-dasharray: var(--circumference);
|
|
20
|
-
stroke-linecap: square;
|
|
21
|
-
animation: adm-spin-loading-fill 1s infinite alternate-reverse linear;
|
|
22
|
-
r: var(--radius);
|
|
23
|
-
cx: calc(var(--size) / 2);
|
|
24
|
-
cy: calc(var(--size) / 2);
|
|
25
17
|
}
|
|
26
18
|
@keyframes adm-spin-loading-rotate {
|
|
27
19
|
from {
|
|
@@ -31,11 +23,3 @@
|
|
|
31
23
|
transform: rotate(360deg);
|
|
32
24
|
}
|
|
33
25
|
}
|
|
34
|
-
@keyframes adm-spin-loading-fill {
|
|
35
|
-
from {
|
|
36
|
-
stroke-dashoffset: calc(var(--circumference) * (1 - 0.4));
|
|
37
|
-
}
|
|
38
|
-
to {
|
|
39
|
-
stroke-dashoffset: calc(var(--circumference) * (1 - 0.8));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type SpinLoadingProps = {
|
|
4
4
|
color?: 'default' | 'primary' | 'white' | (string & {});
|
|
5
|
-
} & NativeProps<'--color' | '--size'
|
|
5
|
+
} & NativeProps<'--color' | '--size'>;
|
|
6
6
|
export declare const SpinLoading: React.NamedExoticComponent<SpinLoadingProps>;
|
|
@@ -11,6 +11,8 @@ var _nativeProps = require("../../utils/native-props");
|
|
|
11
11
|
|
|
12
12
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
13
13
|
|
|
14
|
+
var _web = require("@react-spring/web");
|
|
15
|
+
|
|
14
16
|
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); }
|
|
15
17
|
|
|
16
18
|
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; }
|
|
@@ -24,20 +26,46 @@ const colorRecord = {
|
|
|
24
26
|
const defaultProps = {
|
|
25
27
|
color: 'default'
|
|
26
28
|
};
|
|
29
|
+
const circumference = 15 * 3.14159265358979 * 2;
|
|
27
30
|
const SpinLoading = (0, _react.memo)(p => {
|
|
28
31
|
var _a;
|
|
29
32
|
|
|
30
33
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
31
|
-
|
|
34
|
+
const {
|
|
35
|
+
percent
|
|
36
|
+
} = (0, _web.useSpring)({
|
|
37
|
+
loop: {
|
|
38
|
+
reverse: true
|
|
39
|
+
},
|
|
40
|
+
from: {
|
|
41
|
+
percent: 30
|
|
42
|
+
},
|
|
43
|
+
to: {
|
|
44
|
+
percent: 80
|
|
45
|
+
},
|
|
46
|
+
config: {
|
|
47
|
+
duration: 1200
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_web.animated.div, {
|
|
32
51
|
className: classPrefix,
|
|
33
52
|
style: {
|
|
34
|
-
'--color': (_a = colorRecord[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
53
|
+
'--color': (_a = colorRecord[props.color]) !== null && _a !== void 0 ? _a : props.color,
|
|
54
|
+
'--percent': percent
|
|
35
55
|
}
|
|
36
56
|
}, _react.default.createElement("svg", {
|
|
37
|
-
className: `${classPrefix}-svg
|
|
38
|
-
|
|
57
|
+
className: `${classPrefix}-svg`,
|
|
58
|
+
viewBox: '0 0 32 32'
|
|
59
|
+
}, _react.default.createElement(_web.animated.circle, {
|
|
39
60
|
className: `${classPrefix}-fill`,
|
|
40
|
-
fill: 'transparent'
|
|
61
|
+
fill: 'transparent',
|
|
62
|
+
strokeWidth: '2',
|
|
63
|
+
strokeDasharray: circumference,
|
|
64
|
+
strokeDashoffset: percent,
|
|
65
|
+
strokeLinecap: 'square',
|
|
66
|
+
r: 15,
|
|
67
|
+
cx: 16,
|
|
68
|
+
cy: 16
|
|
41
69
|
}))));
|
|
42
70
|
});
|
|
43
71
|
exports.SpinLoading = SpinLoading;
|
|
@@ -31,12 +31,10 @@
|
|
|
31
31
|
}
|
|
32
32
|
.adm-stepper .adm-stepper-input {
|
|
33
33
|
height: var(--height);
|
|
34
|
-
background-color: var(--input-background-color);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
text-align: center;
|
|
38
|
-
font-size: var(--input-font-size);
|
|
39
|
-
color: var(--input-font-color);
|
|
34
|
+
--background-color: var(--input-background-color);
|
|
35
|
+
--font-size: var(--input-font-size);
|
|
36
|
+
--color: var(--input-font-color);
|
|
37
|
+
--text-align: center;
|
|
40
38
|
}
|
|
41
39
|
.adm-stepper-minus,
|
|
42
40
|
.adm-stepper-plus {
|
|
@@ -102,7 +102,6 @@ const Stepper = p => {
|
|
|
102
102
|
|
|
103
103
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
104
104
|
className: (0, _classnames.default)(classPrefix, {
|
|
105
|
-
[`${classPrefix}-disabled`]: disabled,
|
|
106
105
|
[`${classPrefix}-active`]: hasFocus
|
|
107
106
|
})
|
|
108
107
|
}, _react.default.createElement(_button.default, {
|
|
@@ -14,7 +14,7 @@ export declare type Action = {
|
|
|
14
14
|
export declare type SwipeActionProps = {
|
|
15
15
|
rightActions?: Action[];
|
|
16
16
|
leftActions?: Action[];
|
|
17
|
-
onAction?: (action: Action) => void;
|
|
17
|
+
onAction?: (action: Action, e: React.MouseEvent) => void;
|
|
18
18
|
closeOnTouchOutside?: boolean;
|
|
19
19
|
closeOnAction?: boolean;
|
|
20
20
|
children: ReactNode;
|
|
@@ -22,7 +22,7 @@ export declare type SwipeActionProps = {
|
|
|
22
22
|
export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
23
23
|
rightActions?: Action[] | undefined;
|
|
24
24
|
leftActions?: Action[] | undefined;
|
|
25
|
-
onAction?: ((action: Action) => void) | undefined;
|
|
25
|
+
onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
|
|
26
26
|
closeOnTouchOutside?: boolean | undefined;
|
|
27
27
|
closeOnAction?: boolean | undefined;
|
|
28
28
|
children: ReactNode;
|
|
@@ -167,7 +167,7 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
|
|
170
|
-
(_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action);
|
|
170
|
+
(_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, e);
|
|
171
171
|
}
|
|
172
172
|
}, action.text);
|
|
173
173
|
}
|
|
@@ -29,6 +29,8 @@ var _useRefState = require("../../utils/use-ref-state");
|
|
|
29
29
|
|
|
30
30
|
var _bound = require("../../utils/bound");
|
|
31
31
|
|
|
32
|
+
var _ahooks = require("ahooks");
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
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); }
|
|
@@ -98,6 +100,11 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
const [current, setCurrent] = (0, _react.useState)(props.defaultIndex);
|
|
103
|
+
(0, _ahooks.useUpdateEffect)(() => {
|
|
104
|
+
var _a;
|
|
105
|
+
|
|
106
|
+
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, current);
|
|
107
|
+
}, [current]);
|
|
101
108
|
const [dragging, setDragging, draggingRef] = (0, _useRefState.useRefState)(false);
|
|
102
109
|
|
|
103
110
|
function boundIndex(current) {
|
|
@@ -183,25 +190,13 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
183
190
|
});
|
|
184
191
|
|
|
185
192
|
function swipeTo(index, immediate = false) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
position: index * 100,
|
|
194
|
-
immediate
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
const i = (0, _bound.bound)(index, 0, count - 1);
|
|
198
|
-
setCurrent(i);
|
|
199
|
-
(_b = props.onIndexChange) === null || _b === void 0 ? void 0 : _b.call(props, i);
|
|
200
|
-
api.start({
|
|
201
|
-
position: boundIndex(i) * 100,
|
|
202
|
-
immediate
|
|
203
|
-
});
|
|
204
|
-
}
|
|
193
|
+
const roundedIndex = Math.round(index);
|
|
194
|
+
const targetIndex = loop ? modulus(roundedIndex, count) : (0, _bound.bound)(roundedIndex, 0, count - 1);
|
|
195
|
+
setCurrent(targetIndex);
|
|
196
|
+
api.start({
|
|
197
|
+
position: (loop ? roundedIndex : boundIndex(roundedIndex)) * 100,
|
|
198
|
+
immediate
|
|
199
|
+
});
|
|
205
200
|
}
|
|
206
201
|
|
|
207
202
|
function swipeNext() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.adm-tag {
|
|
2
2
|
--border-radius: var(--adm-tag-border-radius, 2px);
|
|
3
|
-
padding:
|
|
4
|
-
font-size:
|
|
3
|
+
padding: 2px 4px;
|
|
4
|
+
font-size: 11px;
|
|
5
5
|
line-height: 1;
|
|
6
6
|
font-weight: normal;
|
|
7
7
|
background: var(--background-color);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
display: inline-block;
|
|
10
10
|
white-space: nowrap;
|
|
11
11
|
border-radius: var(--border-radius);
|
|
12
|
-
border:
|
|
12
|
+
border: 1px solid var(--border-color);
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
}
|
|
15
15
|
.adm-tag-round {
|
|
@@ -21,4 +21,4 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
|
|
|
21
21
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
|
|
22
22
|
clearable?: boolean | undefined;
|
|
23
23
|
onClear?: (() => void) | undefined;
|
|
24
|
-
} & Pick<InputProps, "value" | "disabled" | "onChange" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--
|
|
24
|
+
} & Pick<InputProps, "value" | "disabled" | "onChange" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -7,7 +7,7 @@ exports.getScrollParent = getScrollParent;
|
|
|
7
7
|
|
|
8
8
|
var _canUseDom = require("./can-use-dom");
|
|
9
9
|
|
|
10
|
-
const overflowScrollReg = /scroll|auto/i;
|
|
10
|
+
const overflowScrollReg = /scroll|auto|overlay/i;
|
|
11
11
|
const defaultRoot = _canUseDom.canUseDom ? window : undefined;
|
|
12
12
|
|
|
13
13
|
function isElement(node) {
|
|
@@ -5,5 +5,5 @@ export declare type AvatarProps = {
|
|
|
5
5
|
src: string;
|
|
6
6
|
fallback?: ReactNode;
|
|
7
7
|
fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
8
|
-
} & Pick<ImageProps, 'alt' | 'lazy' | 'onClick' | 'onError'> & NativeProps<'--size'>;
|
|
8
|
+
} & Pick<ImageProps, 'alt' | 'lazy' | 'onClick' | 'onError'> & NativeProps<'--size' | '--border-radius'>;
|
|
9
9
|
export declare const Avatar: FC<AvatarProps>;
|
|
@@ -6,6 +6,8 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
6
6
|
import { ArrowLeft } from './arrow-left';
|
|
7
7
|
import { ArrowLeftDouble } from './arrow-left-double';
|
|
8
8
|
import { useConfig } from '../config-provider';
|
|
9
|
+
import isoWeek from 'dayjs/plugin/isoWeek';
|
|
10
|
+
dayjs.extend(isoWeek);
|
|
9
11
|
const classPrefix = 'adm-calendar';
|
|
10
12
|
const defaultProps = {
|
|
11
13
|
weekStartsOn: 'Sunday'
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
.adm-checkbox .adm-checkbox-icon {
|
|
15
15
|
flex: none;
|
|
16
|
-
border: 1px solid
|
|
16
|
+
border: 1px solid var(--adm-color-light);
|
|
17
17
|
border-radius: var(--icon-size);
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
display: flex;
|
|
@@ -38,25 +38,17 @@
|
|
|
38
38
|
cursor: not-allowed;
|
|
39
39
|
}
|
|
40
40
|
.adm-checkbox.adm-checkbox-disabled .adm-checkbox-content {
|
|
41
|
-
|
|
41
|
+
opacity: 0.4;
|
|
42
42
|
}
|
|
43
|
-
.adm-checkbox.adm-checkbox-disabled.adm-checkbox-
|
|
44
|
-
color: #
|
|
45
|
-
border-color:
|
|
46
|
-
background-color: #
|
|
47
|
-
}
|
|
48
|
-
.adm-checkbox.adm-checkbox-disabled.adm-checkbox-checked .adm-checkbox-icon {
|
|
49
|
-
color: #ccc;
|
|
50
|
-
}
|
|
51
|
-
.adm-checkbox.adm-checkbox-disabled .adm-checkbox-icon {
|
|
52
|
-
border-color: #ccc;
|
|
53
|
-
background-color: #ebedf0;
|
|
43
|
+
.adm-checkbox.adm-checkbox-disabled .adm-checkbox-icon.adm-checkbox-icon {
|
|
44
|
+
color: #b7b7b7;
|
|
45
|
+
border-color: var(--adm-color-light);
|
|
46
|
+
background-color: #f5f5f5;
|
|
54
47
|
}
|
|
55
48
|
.adm-checkbox .adm-checkbox-custom-icon {
|
|
56
49
|
font-size: var(--icon-size);
|
|
57
50
|
}
|
|
58
51
|
.adm-checkbox.adm-checkbox-indeterminate .adm-checkbox-icon {
|
|
59
|
-
border-color: var(--adm-color-primary);
|
|
60
52
|
background-color: #ffffff;
|
|
61
53
|
color: var(--adm-color-primary);
|
|
62
54
|
}
|
|
@@ -72,7 +72,7 @@ export const Checkbox = p => {
|
|
|
72
72
|
|
|
73
73
|
return withNativeProps(props, React.createElement("label", {
|
|
74
74
|
className: classNames(classPrefix, {
|
|
75
|
-
[`${classPrefix}-checked`]: checked,
|
|
75
|
+
[`${classPrefix}-checked`]: checked && !props.indeterminate,
|
|
76
76
|
[`${classPrefix}-indeterminate`]: props.indeterminate,
|
|
77
77
|
[`${classPrefix}-disabled`]: disabled,
|
|
78
78
|
[`${classPrefix}-block`]: props.block
|
|
@@ -6,5 +6,5 @@ export declare type ErrorBlockProps = {
|
|
|
6
6
|
image?: string | ReactElement;
|
|
7
7
|
description?: ReactNode;
|
|
8
8
|
fullPage?: boolean;
|
|
9
|
-
} & NativeProps<'--image-height' | '--image-height-full-page'>;
|
|
9
|
+
} & NativeProps<'--image-height' | '--image-height-full-page' | '--image-width' | '--image-width-full-page'>;
|
|
10
10
|
export declare const ErrorBlock: FC<ErrorBlockProps>;
|
|
@@ -3,6 +3,7 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
export declare type FloatingPanelProps = {
|
|
4
4
|
anchors: number[];
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
onHeightChange?: (height: number, animating: boolean) => void;
|
|
6
7
|
} & NativeProps<'--border-radius' | '--z-index'>;
|
|
7
8
|
export declare type FloatingPanelRef = {
|
|
8
9
|
setHeight: (height: number, options?: {
|
|
@@ -12,4 +13,5 @@ export declare type FloatingPanelRef = {
|
|
|
12
13
|
export declare const FloatingPanel: React.ForwardRefExoticComponent<{
|
|
13
14
|
anchors: number[];
|
|
14
15
|
children: ReactNode;
|
|
16
|
+
onHeightChange?: ((height: number, animating: boolean) => void) | undefined;
|
|
15
17
|
} & NativeProps<"--z-index" | "--border-radius"> & React.RefAttributes<FloatingPanelRef>>;
|
|
@@ -27,6 +27,11 @@ export const FloatingPanel = forwardRef((props, ref) => {
|
|
|
27
27
|
y: bounds.bottom,
|
|
28
28
|
config: {
|
|
29
29
|
tension: 300
|
|
30
|
+
},
|
|
31
|
+
onChange: result => {
|
|
32
|
+
var _a;
|
|
33
|
+
|
|
34
|
+
(_a = props.onHeightChange) === null || _a === void 0 ? void 0 : _a.call(props, result.value.y, y.isAnimating);
|
|
30
35
|
}
|
|
31
36
|
}));
|
|
32
37
|
useDrag(state => {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
.adm-input
|
|
1
|
+
.adm-input {
|
|
2
2
|
--font-size: 17px;
|
|
3
3
|
--color: var(--adm-color-text);
|
|
4
4
|
--placeholder-color: var(--adm-color-light);
|
|
5
|
-
--disabled-color: var(--adm-color-weak);
|
|
6
5
|
--text-align: left;
|
|
6
|
+
--background-color: transparent;
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: flex-start;
|
|
9
9
|
align-items: center;
|
|
10
10
|
width: 100%;
|
|
11
11
|
max-width: 100%;
|
|
12
12
|
max-height: 100%;
|
|
13
|
+
background-color: var(--background-color);
|
|
13
14
|
}
|
|
14
|
-
.adm-input {
|
|
15
|
+
.adm-input-disabled {
|
|
16
|
+
opacity: 0.4;
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
}
|
|
19
|
+
.adm-input-element {
|
|
15
20
|
flex: auto;
|
|
16
21
|
display: inline-block;
|
|
17
22
|
box-sizing: border-box;
|
|
@@ -30,53 +35,50 @@
|
|
|
30
35
|
min-height: 1.5em;
|
|
31
36
|
text-align: var(--text-align);
|
|
32
37
|
}
|
|
33
|
-
.adm-input::placeholder {
|
|
38
|
+
.adm-input-element::placeholder {
|
|
34
39
|
color: var(--placeholder-color);
|
|
35
40
|
font-family: inherit;
|
|
36
41
|
}
|
|
37
|
-
.adm-input:-webkit-autofill {
|
|
42
|
+
.adm-input-element:-webkit-autofill {
|
|
38
43
|
background-color: transparent;
|
|
39
44
|
}
|
|
40
|
-
.adm-input:
|
|
41
|
-
color: var(--disabled-color);
|
|
42
|
-
cursor: not-allowed;
|
|
43
|
-
opacity: 1;
|
|
44
|
-
-webkit-text-fill-color: var(--disabled-color);
|
|
45
|
-
}
|
|
46
|
-
.adm-input:read-only {
|
|
45
|
+
.adm-input-element:read-only {
|
|
47
46
|
cursor: default;
|
|
48
47
|
}
|
|
49
|
-
.adm-input:invalid {
|
|
48
|
+
.adm-input-element:invalid {
|
|
50
49
|
box-shadow: none;
|
|
51
50
|
}
|
|
52
|
-
.adm-input::-ms-clear {
|
|
51
|
+
.adm-input-element::-ms-clear {
|
|
53
52
|
display: none;
|
|
54
53
|
}
|
|
55
|
-
.adm-input::-webkit-search-cancel-button {
|
|
54
|
+
.adm-input-element::-webkit-search-cancel-button {
|
|
56
55
|
display: none;
|
|
57
56
|
}
|
|
58
|
-
.adm-input::-webkit-search-decoration {
|
|
57
|
+
.adm-input-element::-webkit-search-decoration {
|
|
59
58
|
display: none;
|
|
60
59
|
}
|
|
61
|
-
.adm-input[type='date'],
|
|
62
|
-
.adm-input[type='time'],
|
|
63
|
-
.adm-input[type='datetime-local'] {
|
|
60
|
+
.adm-input-element[type='date'],
|
|
61
|
+
.adm-input-element[type='time'],
|
|
62
|
+
.adm-input-element[type='datetime-local'] {
|
|
64
63
|
min-height: 1.5em;
|
|
65
64
|
}
|
|
66
|
-
.adm-input[type='search'] {
|
|
65
|
+
.adm-input-element[type='search'] {
|
|
67
66
|
-webkit-appearance: none;
|
|
68
67
|
}
|
|
69
|
-
.adm-input[readonly] {
|
|
68
|
+
.adm-input-element[readonly] {
|
|
70
69
|
pointer-events: none;
|
|
71
70
|
}
|
|
72
71
|
.adm-input-clear {
|
|
73
72
|
flex: none;
|
|
74
73
|
margin-left: 8px;
|
|
75
|
-
color: var(--
|
|
76
|
-
padding:
|
|
74
|
+
color: var(--adm-color-light);
|
|
75
|
+
padding: 4px;
|
|
77
76
|
cursor: pointer;
|
|
78
77
|
}
|
|
78
|
+
.adm-input-clear:active {
|
|
79
|
+
color: var(--adm-color-weak);
|
|
80
|
+
}
|
|
79
81
|
.adm-input-clear .antd-mobile-icon {
|
|
80
82
|
display: block;
|
|
81
|
-
font-size:
|
|
83
|
+
font-size: 15px;
|
|
82
84
|
}
|
|
@@ -13,7 +13,7 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
13
13
|
id?: string;
|
|
14
14
|
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
15
|
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
16
|
-
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--
|
|
16
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'>;
|
|
17
17
|
export declare type InputRef = {
|
|
18
18
|
clear: () => void;
|
|
19
19
|
focus: () => void;
|
|
@@ -31,5 +31,5 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedH
|
|
|
31
31
|
id?: string | undefined;
|
|
32
32
|
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
33
33
|
enterKeyHint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
34
|
-
} & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--
|
|
34
|
+
} & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>;
|
|
35
35
|
export {};
|
|
@@ -3,6 +3,7 @@ import { usePropsValue } from '../../utils/use-props-value';
|
|
|
3
3
|
import { CloseCircleFill } from 'antd-mobile-icons';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
|
+
import classNames from 'classnames';
|
|
6
7
|
const classPrefix = `adm-input`;
|
|
7
8
|
const defaultProps = {
|
|
8
9
|
defaultValue: ''
|
|
@@ -50,10 +51,10 @@ export const Input = forwardRef((p, ref) => {
|
|
|
50
51
|
};
|
|
51
52
|
}, [props.enterKeyHint]);
|
|
52
53
|
return withNativeProps(props, React.createElement("div", {
|
|
53
|
-
className: `${classPrefix}-
|
|
54
|
+
className: classNames(`${classPrefix}`, props.disabled && `${classPrefix}-disabled`)
|
|
54
55
|
}, React.createElement("input", {
|
|
55
56
|
ref: nativeInputRef,
|
|
56
|
-
className: classPrefix
|
|
57
|
+
className: `${classPrefix}-element`,
|
|
57
58
|
value: value,
|
|
58
59
|
onChange: e => {
|
|
59
60
|
setValue(e.target.value);
|
|
@@ -86,7 +87,7 @@ export const Input = forwardRef((p, ref) => {
|
|
|
86
87
|
autoCorrect: props.autoCorrect,
|
|
87
88
|
onKeyDown: handleKeydown,
|
|
88
89
|
onKeyUp: props.onKeyUp
|
|
89
|
-
}), props.clearable && !!value &&
|
|
90
|
+
}), props.clearable && !!value && React.createElement("div", {
|
|
90
91
|
className: `${classPrefix}-clear`,
|
|
91
92
|
onMouseDown: e => {
|
|
92
93
|
e.preventDefault();
|