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,4 +1,5 @@
|
|
|
1
1
|
.adm-jumbo-tabs {
|
|
2
|
+
--gap: 8px;
|
|
2
3
|
position: relative;
|
|
3
4
|
}
|
|
4
5
|
.adm-jumbo-tabs-header {
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
align-items: center;
|
|
13
14
|
position: relative;
|
|
14
15
|
overflow-x: scroll;
|
|
16
|
+
padding: 0 var(--gap);
|
|
15
17
|
scrollbar-width: none;
|
|
16
18
|
}
|
|
17
19
|
.adm-jumbo-tabs-tab-list::-webkit-scrollbar {
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
}
|
|
20
22
|
.adm-jumbo-tabs-tab-wrapper {
|
|
21
23
|
flex: auto;
|
|
22
|
-
padding: 0
|
|
24
|
+
padding: 0 calc(var(--gap) / 2);
|
|
23
25
|
text-align: center;
|
|
24
26
|
}
|
|
25
27
|
.adm-jumbo-tabs-tab {
|
|
@@ -36,6 +38,7 @@
|
|
|
36
38
|
}
|
|
37
39
|
.adm-jumbo-tabs-tab-title {
|
|
38
40
|
line-height: 24px;
|
|
41
|
+
padding: 0 4px;
|
|
39
42
|
}
|
|
40
43
|
.adm-jumbo-tabs-tab-description {
|
|
41
44
|
width: min-content;
|
|
@@ -3,5 +3,5 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
export declare type ListProps = {
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
mode?: 'default' | 'card';
|
|
6
|
-
} & NativeProps<'--header-font-size' | '--prefix-width' | '--prefix-padding-right' | '--align-items' | '--active-background-color' | '--border-inner' | '--border-top' | '--border-bottom' | '--padding-left' | '--font-size'>;
|
|
6
|
+
} & NativeProps<'--header-font-size' | '--prefix-width' | '--prefix-padding-right' | '--align-items' | '--active-background-color' | '--border-inner' | '--border-top' | '--border-bottom' | '--padding-left' | '--padding-right' | '--font-size'>;
|
|
7
7
|
export declare const List: FC<ListProps>;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
.adm-nav-bar-back {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
|
-
margin-right:
|
|
24
|
+
margin-right: 16px;
|
|
25
25
|
padding: 6px 0;
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
}
|
|
28
28
|
.adm-nav-bar-back-arrow {
|
|
29
|
-
font-size:
|
|
30
|
-
margin-right:
|
|
29
|
+
font-size: 24px;
|
|
30
|
+
margin-right: 4px;
|
|
31
31
|
}
|
|
32
32
|
.adm-nav-bar-left {
|
|
33
33
|
font-size: 15px;
|
|
@@ -17,5 +17,5 @@ export declare type NoticeBarProps = {
|
|
|
17
17
|
extra?: React.ReactNode;
|
|
18
18
|
/** 左侧广播图标 */
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
|
-
} & NativeProps<'--background-color' | '--border-color' | '--text-color'>;
|
|
20
|
+
} & NativeProps<'--background-color' | '--border-color' | '--text-color' | '--font-size' | '--icon-font-size' | '--height'>;
|
|
21
21
|
export declare const NoticeBar: React.NamedExoticComponent<NoticeBarProps>;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
.adm-radio .adm-radio-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;
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
cursor: not-allowed;
|
|
40
40
|
}
|
|
41
41
|
.adm-radio.adm-radio-disabled .adm-radio-content {
|
|
42
|
-
|
|
42
|
+
opacity: 0.4;
|
|
43
43
|
}
|
|
44
44
|
.adm-radio.adm-radio-disabled .adm-radio-icon {
|
|
45
|
-
color: #
|
|
46
|
-
border-color:
|
|
47
|
-
background-color: #
|
|
45
|
+
color: #b7b7b7;
|
|
46
|
+
border-color: var(--adm-color-light);
|
|
47
|
+
background-color: #f5f5f5;
|
|
48
48
|
}
|
|
49
49
|
.adm-radio .adm-radio-custom-icon {
|
|
50
50
|
font-size: var(--icon-size);
|
|
@@ -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>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
|
+
import { useSpring, animated } from '@react-spring/web';
|
|
4
5
|
const classPrefix = 'adm-spin-loading';
|
|
5
6
|
const colorRecord = {
|
|
6
7
|
default: 'var(--adm-color-weak)',
|
|
@@ -10,19 +11,45 @@ const colorRecord = {
|
|
|
10
11
|
const defaultProps = {
|
|
11
12
|
color: 'default'
|
|
12
13
|
};
|
|
14
|
+
const circumference = 15 * 3.14159265358979 * 2;
|
|
13
15
|
export const SpinLoading = memo(p => {
|
|
14
16
|
var _a;
|
|
15
17
|
|
|
16
18
|
const props = mergeProps(defaultProps, p);
|
|
17
|
-
|
|
19
|
+
const {
|
|
20
|
+
percent
|
|
21
|
+
} = useSpring({
|
|
22
|
+
loop: {
|
|
23
|
+
reverse: true
|
|
24
|
+
},
|
|
25
|
+
from: {
|
|
26
|
+
percent: 30
|
|
27
|
+
},
|
|
28
|
+
to: {
|
|
29
|
+
percent: 80
|
|
30
|
+
},
|
|
31
|
+
config: {
|
|
32
|
+
duration: 1200
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return withNativeProps(props, React.createElement(animated.div, {
|
|
18
36
|
className: classPrefix,
|
|
19
37
|
style: {
|
|
20
|
-
'--color': (_a = colorRecord[props.color]) !== null && _a !== void 0 ? _a : props.color
|
|
38
|
+
'--color': (_a = colorRecord[props.color]) !== null && _a !== void 0 ? _a : props.color,
|
|
39
|
+
'--percent': percent
|
|
21
40
|
}
|
|
22
41
|
}, React.createElement("svg", {
|
|
23
|
-
className: `${classPrefix}-svg
|
|
24
|
-
|
|
42
|
+
className: `${classPrefix}-svg`,
|
|
43
|
+
viewBox: '0 0 32 32'
|
|
44
|
+
}, React.createElement(animated.circle, {
|
|
25
45
|
className: `${classPrefix}-fill`,
|
|
26
|
-
fill: 'transparent'
|
|
46
|
+
fill: 'transparent',
|
|
47
|
+
strokeWidth: '2',
|
|
48
|
+
strokeDasharray: circumference,
|
|
49
|
+
strokeDashoffset: percent,
|
|
50
|
+
strokeLinecap: 'square',
|
|
51
|
+
r: 15,
|
|
52
|
+
cx: 16,
|
|
53
|
+
cy: 16
|
|
27
54
|
}))));
|
|
28
55
|
});
|
|
@@ -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 {
|
|
@@ -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;
|
|
@@ -147,7 +147,7 @@ export const SwipeAction = forwardRef((p, ref) => {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
|
|
150
|
-
(_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action);
|
|
150
|
+
(_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, e);
|
|
151
151
|
}
|
|
152
152
|
}, action.text);
|
|
153
153
|
}
|
|
@@ -10,6 +10,7 @@ import PageIndicator from '../page-indicator';
|
|
|
10
10
|
import { staged } from 'staged-components';
|
|
11
11
|
import { useRefState } from '../../utils/use-ref-state';
|
|
12
12
|
import { bound } from '../../utils/bound';
|
|
13
|
+
import { useUpdateEffect } from 'ahooks';
|
|
13
14
|
const defaultProps = {
|
|
14
15
|
defaultIndex: 0,
|
|
15
16
|
allowTouchMove: true,
|
|
@@ -71,6 +72,11 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
const [current, setCurrent] = useState(props.defaultIndex);
|
|
75
|
+
useUpdateEffect(() => {
|
|
76
|
+
var _a;
|
|
77
|
+
|
|
78
|
+
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, current);
|
|
79
|
+
}, [current]);
|
|
74
80
|
const [dragging, setDragging, draggingRef] = useRefState(false);
|
|
75
81
|
|
|
76
82
|
function boundIndex(current) {
|
|
@@ -156,25 +162,13 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
156
162
|
});
|
|
157
163
|
|
|
158
164
|
function swipeTo(index, immediate = false) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
position: index * 100,
|
|
167
|
-
immediate
|
|
168
|
-
});
|
|
169
|
-
} else {
|
|
170
|
-
const i = bound(index, 0, count - 1);
|
|
171
|
-
setCurrent(i);
|
|
172
|
-
(_b = props.onIndexChange) === null || _b === void 0 ? void 0 : _b.call(props, i);
|
|
173
|
-
api.start({
|
|
174
|
-
position: boundIndex(i) * 100,
|
|
175
|
-
immediate
|
|
176
|
-
});
|
|
177
|
-
}
|
|
165
|
+
const roundedIndex = Math.round(index);
|
|
166
|
+
const targetIndex = loop ? modulus(roundedIndex, count) : bound(roundedIndex, 0, count - 1);
|
|
167
|
+
setCurrent(targetIndex);
|
|
168
|
+
api.start({
|
|
169
|
+
position: (loop ? roundedIndex : boundIndex(roundedIndex)) * 100,
|
|
170
|
+
immediate
|
|
171
|
+
});
|
|
178
172
|
}
|
|
179
173
|
|
|
180
174
|
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>>;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.22",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@react-spring/web": "^9.4.2",
|
|
6
6
|
"@types/resize-observer-browser": "^0.1.6",
|
|
7
7
|
"@use-gesture/react": "^10.2.4",
|
|
8
|
-
"ahooks": "^3.1.
|
|
8
|
+
"ahooks": "^3.1.8",
|
|
9
9
|
"antd-mobile-icons": "^0.2.2",
|
|
10
10
|
"antd-mobile-v5-count": "^1.0.1",
|
|
11
11
|
"classnames": "^2.3.1",
|