antd-mobile 5.20.0 → 5.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/bundle/antd-mobile.cjs.js +12 -12
- package/2x/bundle/antd-mobile.compatible.umd.js +6882 -6786
- package/2x/bundle/antd-mobile.es.js +3779 -3709
- package/2x/bundle/antd-mobile.umd.js +12 -12
- package/2x/bundle/style.css +131 -0
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/picker-view/wheel.js +2 -0
- package/2x/cjs/components/rate/rate.css +3 -0
- package/2x/cjs/components/rate/rate.js +15 -14
- package/2x/cjs/components/result-page/index.d.ts +7 -0
- package/2x/cjs/components/result-page/index.js +20 -0
- package/2x/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/2x/cjs/components/result-page/result-page-card.js +24 -0
- package/2x/cjs/components/result-page/result-page.css +130 -0
- package/2x/cjs/components/result-page/result-page.d.ts +23 -0
- package/2x/cjs/components/result-page/result-page.js +108 -0
- package/2x/cjs/components/swiper/swiper.js +1 -1
- package/2x/cjs/index.d.ts +1 -0
- package/2x/cjs/index.js +8 -0
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/picker-view/wheel.js +2 -0
- package/2x/es/components/rate/rate.css +3 -0
- package/2x/es/components/rate/rate.js +15 -14
- package/2x/es/components/result-page/index.d.ts +7 -0
- package/2x/es/components/result-page/index.js +7 -0
- package/2x/es/components/result-page/result-page-card.d.ts +6 -0
- package/2x/es/components/result-page/result-page-card.js +9 -0
- package/2x/es/components/result-page/result-page.css +130 -0
- package/2x/es/components/result-page/result-page.d.ts +23 -0
- package/2x/es/components/result-page/result-page.js +83 -0
- package/2x/es/components/swiper/swiper.js +1 -1
- package/2x/es/index.d.ts +1 -0
- package/2x/es/index.js +1 -0
- package/2x/package.json +3 -3
- package/2x/umd/antd-mobile.js +6882 -6786
- package/bundle/antd-mobile.cjs.js +12 -12
- package/bundle/antd-mobile.compatible.umd.js +6882 -6786
- package/bundle/antd-mobile.es.js +3779 -3709
- package/bundle/antd-mobile.umd.js +12 -12
- package/bundle/style.css +1 -1
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/picker-view/wheel.js +2 -0
- package/cjs/components/rate/rate.css +3 -0
- package/cjs/components/rate/rate.js +15 -14
- package/cjs/components/result-page/index.d.ts +7 -0
- package/cjs/components/result-page/index.js +20 -0
- package/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/cjs/components/result-page/result-page-card.js +24 -0
- package/cjs/components/result-page/result-page.css +113 -0
- package/cjs/components/result-page/result-page.d.ts +23 -0
- package/cjs/components/result-page/result-page.js +108 -0
- package/cjs/components/swiper/swiper.js +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -0
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/picker-view/wheel.js +2 -0
- package/es/components/rate/rate.css +3 -0
- package/es/components/rate/rate.js +15 -14
- package/es/components/result-page/index.d.ts +7 -0
- package/es/components/result-page/index.js +7 -0
- package/es/components/result-page/result-page-card.d.ts +6 -0
- package/es/components/result-page/result-page-card.js +9 -0
- package/es/components/result-page/result-page.css +113 -0
- package/es/components/result-page/result-page.d.ts +23 -0
- package/es/components/result-page/result-page.js +83 -0
- package/es/components/swiper/swiper.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +3 -3
- package/umd/antd-mobile.js +1 -1
package/2x/bundle/style.css
CHANGED
|
@@ -3486,6 +3486,8 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3486
3486
|
--inactive-color: var(--adm-color-border);
|
|
3487
3487
|
display: inline-flex;
|
|
3488
3488
|
touch-action: pan-y;
|
|
3489
|
+
-webkit-user-select: none;
|
|
3490
|
+
user-select: none;
|
|
3489
3491
|
}
|
|
3490
3492
|
|
|
3491
3493
|
.adm-rate-box {
|
|
@@ -3501,6 +3503,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3501
3503
|
overflow: hidden;
|
|
3502
3504
|
cursor: pointer;
|
|
3503
3505
|
box-sizing: border-box;
|
|
3506
|
+
transition: all .3s;
|
|
3504
3507
|
}
|
|
3505
3508
|
|
|
3506
3509
|
.adm-rate-star-half {
|
|
@@ -3571,6 +3574,134 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3571
3574
|
color: var(--adm-color-warning);
|
|
3572
3575
|
}
|
|
3573
3576
|
|
|
3577
|
+
.adm-result-page {
|
|
3578
|
+
--background-color: var(--adm-color-primary);
|
|
3579
|
+
position: relative;
|
|
3580
|
+
background-color: var(--adm-color-box);
|
|
3581
|
+
min-height: 100vh;
|
|
3582
|
+
width: 100%;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
.adm-result-page-header {
|
|
3586
|
+
display: flex;
|
|
3587
|
+
align-items: center;
|
|
3588
|
+
flex-direction: column;
|
|
3589
|
+
background-color: transparent;
|
|
3590
|
+
position: relative;
|
|
3591
|
+
padding: 40px 40px 200px;
|
|
3592
|
+
z-index: 1;
|
|
3593
|
+
overflow: hidden;
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
.adm-result-page-icon {
|
|
3597
|
+
color: var(--adm-color-background);
|
|
3598
|
+
box-sizing: border-box;
|
|
3599
|
+
padding: 4px;
|
|
3600
|
+
margin-bottom: 16px;
|
|
3601
|
+
}
|
|
3602
|
+
|
|
3603
|
+
.adm-result-page-icon .antd-mobile-icon {
|
|
3604
|
+
font-size: 64px;
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
.adm-result-page-title {
|
|
3608
|
+
font-size: var(--adm-font-size-10);
|
|
3609
|
+
color: var(--adm-color-background);
|
|
3610
|
+
line-height: 1.4;
|
|
3611
|
+
text-align: center;
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
.adm-result-page-description {
|
|
3615
|
+
margin-top: 16px;
|
|
3616
|
+
margin-bottom: 48px;
|
|
3617
|
+
font-size: var(--adm-font-size-6);
|
|
3618
|
+
color: #fff9;
|
|
3619
|
+
line-height: 1.4;
|
|
3620
|
+
text-align: center;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
.adm-result-page-details {
|
|
3624
|
+
width: 100%;
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
.adm-result-page-detail {
|
|
3628
|
+
width: 100%;
|
|
3629
|
+
display: flex;
|
|
3630
|
+
flex-direction: row;
|
|
3631
|
+
justify-content: space-between;
|
|
3632
|
+
margin-bottom: 10px;
|
|
3633
|
+
color: var(--adm-color-background);
|
|
3634
|
+
font-size: var(--adm-font-size-6);
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
.adm-result-page-detail-bold {
|
|
3638
|
+
font-weight: 600;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
.adm-result-page-collapse {
|
|
3642
|
+
opacity: .6;
|
|
3643
|
+
width: 20px;
|
|
3644
|
+
height: 20px;
|
|
3645
|
+
margin: auto auto 10px;
|
|
3646
|
+
border-top: 4px solid var(--adm-color-background);
|
|
3647
|
+
border-right: 4px solid var(--adm-color-background);
|
|
3648
|
+
transform: rotate(135deg);
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
.adm-result-page-collapse-active {
|
|
3652
|
+
transform: rotate(-45deg);
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
.adm-result-page-bgWrapper {
|
|
3656
|
+
position: relative;
|
|
3657
|
+
align-self: flex-start;
|
|
3658
|
+
top: 108px;
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
.adm-result-page-bg {
|
|
3662
|
+
--width: 440vw;
|
|
3663
|
+
position: absolute;
|
|
3664
|
+
height: var(--width);
|
|
3665
|
+
width: var(--width);
|
|
3666
|
+
left: calc((var(--width) - 100vw) * -1 / 2 - 40px);
|
|
3667
|
+
top: calc(var(--width) * -1 + 1vw);
|
|
3668
|
+
border-radius: 50%;
|
|
3669
|
+
background-color: var(--background-color);
|
|
3670
|
+
z-index: -1;
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
.adm-result-page-content {
|
|
3674
|
+
position: relative;
|
|
3675
|
+
padding: 24px;
|
|
3676
|
+
top: -208px;
|
|
3677
|
+
z-index: 2;
|
|
3678
|
+
}
|
|
3679
|
+
|
|
3680
|
+
.adm-result-page-footer {
|
|
3681
|
+
position: fixed;
|
|
3682
|
+
bottom: 0;
|
|
3683
|
+
width: 100%;
|
|
3684
|
+
padding: 24px 24px 48px;
|
|
3685
|
+
display: flex;
|
|
3686
|
+
justify-content: center;
|
|
3687
|
+
background-color: var(--adm-color-box);
|
|
3688
|
+
z-index: 3;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
.adm-result-page-footer-btn {
|
|
3692
|
+
flex: 1;
|
|
3693
|
+
max-width: calc((100vw - 72px)/2);
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
.adm-result-page-footer-space {
|
|
3697
|
+
width: 24px;
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3700
|
+
.adm-result-page-card {
|
|
3701
|
+
border-radius: 16px;
|
|
3702
|
+
background-color: var(--adm-color-background);
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3574
3705
|
.adm-search-bar {
|
|
3575
3706
|
--height: 64px;
|
|
3576
3707
|
--padding-left: 16px;
|
|
@@ -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' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue' | 'getValueFromEvent' | 'getValueProps' | 'normalize' | 'preserve' | 'validateFirst'> & Pick<ListItemProps, 'style' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|
|
@@ -208,6 +208,8 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
208
208
|
if (prev.index !== next.index) return false;
|
|
209
209
|
if (prev.value !== next.value) return false;
|
|
210
210
|
if (prev.onSelect !== next.onSelect) return false;
|
|
211
|
+
if (prev.renderLabel !== next.renderLabel) return false;
|
|
212
|
+
if (prev.mouseWheel !== next.mouseWheel) return false;
|
|
211
213
|
|
|
212
214
|
if (!(0, _isEqual.default)(prev.column, next.column)) {
|
|
213
215
|
return false;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
--inactive-color: var(--adm-color-border);
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
touch-action: pan-y;
|
|
7
|
+
-webkit-user-select: none;
|
|
8
|
+
user-select: none;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.adm-rate-box {
|
|
@@ -19,6 +21,7 @@
|
|
|
19
21
|
overflow: hidden;
|
|
20
22
|
cursor: pointer;
|
|
21
23
|
box-sizing: border-box;
|
|
24
|
+
transition: all 0.3s;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
.adm-rate-star-half {
|
|
@@ -50,15 +50,6 @@ const Rate = p => {
|
|
|
50
50
|
[`${classPrefix}-star-half`]: half,
|
|
51
51
|
[`${classPrefix}-star-readonly`]: props.readOnly
|
|
52
52
|
}),
|
|
53
|
-
onClick: () => {
|
|
54
|
-
if (props.readOnly) return;
|
|
55
|
-
|
|
56
|
-
if (props.allowClear && value === v) {
|
|
57
|
-
setValue(0);
|
|
58
|
-
} else {
|
|
59
|
-
setValue(v);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
53
|
role: 'radio',
|
|
63
54
|
"aria-checked": value >= v,
|
|
64
55
|
"aria-label": '' + v
|
|
@@ -68,20 +59,30 @@ const Rate = p => {
|
|
|
68
59
|
const bind = (0, _react2.useDrag)(state => {
|
|
69
60
|
if (props.readOnly) return;
|
|
70
61
|
const {
|
|
71
|
-
xy: [clientX]
|
|
62
|
+
xy: [clientX],
|
|
63
|
+
tap
|
|
72
64
|
} = state;
|
|
73
65
|
const container = containerRef.current;
|
|
74
66
|
if (!container) return;
|
|
75
67
|
const rect = container.getBoundingClientRect();
|
|
76
68
|
const rawValue = (clientX - rect.left) / rect.width * props.count;
|
|
77
|
-
const
|
|
78
|
-
|
|
69
|
+
const ceiledValue = props.allowHalf ? Math.ceil(rawValue * 2) / 2 : Math.ceil(rawValue);
|
|
70
|
+
const boundValue = (0, _bound.bound)(ceiledValue, 0, props.count);
|
|
71
|
+
|
|
72
|
+
if (tap) {
|
|
73
|
+
if (props.allowClear && boundValue === value) {
|
|
74
|
+
setValue(0);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
setValue(boundValue);
|
|
79
80
|
}, {
|
|
80
81
|
axis: 'x',
|
|
81
|
-
preventScroll: true,
|
|
82
82
|
pointer: {
|
|
83
83
|
touch: true
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
|
+
filterTaps: true
|
|
85
86
|
});
|
|
86
87
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", Object.assign({
|
|
87
88
|
className: classPrefix,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './result-page.less';
|
|
3
|
+
export type { ResultPageProps } from './result-page';
|
|
4
|
+
declare const _default: import("react").FC<import("./result-page").ResultPageProps> & {
|
|
5
|
+
Card: import("react").FC<import("./result-page-card").ResultPageCardProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("./result-page.css");
|
|
9
|
+
|
|
10
|
+
var _resultPage2 = require("./result-page");
|
|
11
|
+
|
|
12
|
+
var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
|
|
13
|
+
|
|
14
|
+
var _resultPageCard = require("./result-page-card");
|
|
15
|
+
|
|
16
|
+
var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_resultPage2.ResultPage, {
|
|
17
|
+
Card: _resultPageCard.ResultPageCard
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResultPageCard = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
const classPrefix = `adm-result-page-card`;
|
|
17
|
+
|
|
18
|
+
const ResultPageCard = props => {
|
|
19
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement('div', {
|
|
20
|
+
className: (0, _classnames.default)(`${classPrefix}`)
|
|
21
|
+
}, props.children));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.ResultPageCard = ResultPageCard;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
.adm-result-page {
|
|
2
|
+
--background-color: var(--adm-color-primary);
|
|
3
|
+
position: relative;
|
|
4
|
+
background-color: var(--adm-color-box);
|
|
5
|
+
min-height: 100vh;
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.adm-result-page-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
position: relative;
|
|
15
|
+
padding: 40px;
|
|
16
|
+
padding-bottom: 200px;
|
|
17
|
+
z-index: 1;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.adm-result-page-icon {
|
|
22
|
+
color: var(--adm-color-background);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
padding: 4px;
|
|
25
|
+
margin-bottom: 16px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.adm-result-page-icon .antd-mobile-icon {
|
|
29
|
+
font-size: 64px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.adm-result-page-title {
|
|
33
|
+
font-size: var(--adm-font-size-10);
|
|
34
|
+
color: var(--adm-color-background);
|
|
35
|
+
line-height: 1.4;
|
|
36
|
+
text-align: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.adm-result-page-description {
|
|
40
|
+
margin-top: 16px;
|
|
41
|
+
margin-bottom: 48px;
|
|
42
|
+
font-size: var(--adm-font-size-6);
|
|
43
|
+
color: rgba(255, 255, 255, 0.6);
|
|
44
|
+
line-height: 1.4;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.adm-result-page-details {
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.adm-result-page-detail {
|
|
53
|
+
width: 100%;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
margin-bottom: 10px;
|
|
58
|
+
color: var(--adm-color-background);
|
|
59
|
+
font-size: var(--adm-font-size-6);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.adm-result-page-detail-bold {
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.adm-result-page-collapse {
|
|
67
|
+
opacity: 0.6;
|
|
68
|
+
width: 20px;
|
|
69
|
+
height: 20px;
|
|
70
|
+
margin: auto;
|
|
71
|
+
margin-bottom: 10px;
|
|
72
|
+
border-top: 4px solid var(--adm-color-background);
|
|
73
|
+
border-right: 4px solid var(--adm-color-background);
|
|
74
|
+
transform: rotate(135deg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.adm-result-page-collapse-active {
|
|
78
|
+
transform: rotate(-45deg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.adm-result-page-bgWrapper {
|
|
82
|
+
position: relative;
|
|
83
|
+
align-self: flex-start;
|
|
84
|
+
top: 108px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.adm-result-page-bg {
|
|
88
|
+
--width: 440vw;
|
|
89
|
+
position: absolute;
|
|
90
|
+
height: var(--width);
|
|
91
|
+
width: var(--width);
|
|
92
|
+
left: calc((var(--width) - 100vw) * -1 / 2 - 40px);
|
|
93
|
+
top: calc(var(--width) * -1 + 1vw);
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
background-color: var(--background-color);
|
|
96
|
+
z-index: -1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.adm-result-page-content {
|
|
100
|
+
position: relative;
|
|
101
|
+
padding: 24px;
|
|
102
|
+
top: -208px;
|
|
103
|
+
z-index: 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.adm-result-page-footer {
|
|
107
|
+
position: fixed;
|
|
108
|
+
bottom: 0;
|
|
109
|
+
width: 100%;
|
|
110
|
+
padding: 24px;
|
|
111
|
+
padding-bottom: 48px;
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
background-color: var(--adm-color-box);
|
|
115
|
+
z-index: 3;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.adm-result-page-footer-btn {
|
|
119
|
+
flex: 1;
|
|
120
|
+
max-width: calc((100vw - 72px) / 2);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.adm-result-page-footer-space {
|
|
124
|
+
width: 24px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.adm-result-page-card {
|
|
128
|
+
border-radius: 16px;
|
|
129
|
+
background-color: var(--adm-color-background);
|
|
130
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
interface ResultPageDetail {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare type ResultPageDetails = ResultPageDetail[];
|
|
9
|
+
declare type OnClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown;
|
|
10
|
+
export declare type ResultPageProps = {
|
|
11
|
+
status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
details?: ResultPageDetails;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
primaryButtonText?: ReactNode;
|
|
18
|
+
secondaryButtonText?: ReactNode;
|
|
19
|
+
onPrimaryButtonClick?: OnClick;
|
|
20
|
+
onSecondaryButtonClick?: OnClick;
|
|
21
|
+
} & NativeProps<'--background-color'>;
|
|
22
|
+
export declare const ResultPage: FC<ResultPageProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResultPage = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _antdMobileIcons = require("antd-mobile-icons");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _nativeProps = require("../../utils/native-props");
|
|
15
|
+
|
|
16
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
|
+
|
|
18
|
+
var _isNodeWithContent = require("../../utils/is-node-with-content");
|
|
19
|
+
|
|
20
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
const classPrefix = `adm-result-page`;
|
|
29
|
+
const iconRecord = {
|
|
30
|
+
success: _antdMobileIcons.CheckCircleFill,
|
|
31
|
+
error: _antdMobileIcons.CloseCircleFill,
|
|
32
|
+
info: _antdMobileIcons.InformationCircleFill,
|
|
33
|
+
waiting: _antdMobileIcons.ClockCircleFill,
|
|
34
|
+
warning: _antdMobileIcons.ExclamationCircleFill
|
|
35
|
+
};
|
|
36
|
+
const defaultProps = {
|
|
37
|
+
status: 'info',
|
|
38
|
+
details: []
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const ResultPage = p => {
|
|
42
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
43
|
+
const {
|
|
44
|
+
status,
|
|
45
|
+
title,
|
|
46
|
+
description,
|
|
47
|
+
details,
|
|
48
|
+
icon,
|
|
49
|
+
primaryButtonText,
|
|
50
|
+
secondaryButtonText,
|
|
51
|
+
onPrimaryButtonClick,
|
|
52
|
+
onSecondaryButtonClick
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
const resultIcon = icon || _react.default.createElement(iconRecord[status]);
|
|
56
|
+
|
|
57
|
+
const [collapse, setCollapse] = (0, _react.useState)(true);
|
|
58
|
+
const showSecondaryButton = (0, _isNodeWithContent.isNodeWithContent)(secondaryButtonText);
|
|
59
|
+
const showPrimaryButton = (0, _isNodeWithContent.isNodeWithContent)(primaryButtonText);
|
|
60
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
61
|
+
className: classPrefix
|
|
62
|
+
}, _react.default.createElement("div", {
|
|
63
|
+
className: `${classPrefix}-header`
|
|
64
|
+
}, _react.default.createElement("div", {
|
|
65
|
+
className: `${classPrefix}-icon`
|
|
66
|
+
}, resultIcon), _react.default.createElement("div", {
|
|
67
|
+
className: `${classPrefix}-title`
|
|
68
|
+
}, title), (0, _isNodeWithContent.isNodeWithContent)(description) ? _react.default.createElement("div", {
|
|
69
|
+
className: `${classPrefix}-description`
|
|
70
|
+
}, description) : null, details.length ? _react.default.createElement("div", {
|
|
71
|
+
className: `${classPrefix}-details`
|
|
72
|
+
}, (collapse ? details.slice(0, 3) : details).map((detail, index) => {
|
|
73
|
+
return _react.default.createElement("div", {
|
|
74
|
+
className: (0, _classnames.default)(`${classPrefix}-detail`, detail.bold && `${classPrefix}-detail-bold`),
|
|
75
|
+
key: index
|
|
76
|
+
}, _react.default.createElement("span", null, detail.label), _react.default.createElement("span", null, detail.value));
|
|
77
|
+
}), details.length > 3 && _react.default.createElement("div", {
|
|
78
|
+
onClick: () => setCollapse(prev => !prev)
|
|
79
|
+
}, _react.default.createElement("div", {
|
|
80
|
+
className: (0, _classnames.default)(`${classPrefix}-collapse`, !collapse && `${classPrefix}-collapse-active`)
|
|
81
|
+
}))) : null, _react.default.createElement("div", {
|
|
82
|
+
className: `${classPrefix}-bgWrapper`
|
|
83
|
+
}, _react.default.createElement("div", {
|
|
84
|
+
className: `${classPrefix}-bg`
|
|
85
|
+
}))), _react.default.createElement("div", {
|
|
86
|
+
className: `${classPrefix}-content`
|
|
87
|
+
}, props.children), _react.default.createElement("div", {
|
|
88
|
+
className: `${classPrefix}-footer`
|
|
89
|
+
}, showSecondaryButton && _react.default.createElement(_button.default, {
|
|
90
|
+
block: true,
|
|
91
|
+
color: 'default',
|
|
92
|
+
fill: 'solid',
|
|
93
|
+
size: 'large',
|
|
94
|
+
onClick: onSecondaryButtonClick,
|
|
95
|
+
className: `${classPrefix}-footer-btn`
|
|
96
|
+
}, secondaryButtonText), showPrimaryButton && showSecondaryButton && _react.default.createElement("div", {
|
|
97
|
+
className: `${classPrefix}-footer-space`
|
|
98
|
+
}), showPrimaryButton && _react.default.createElement(_button.default, {
|
|
99
|
+
block: true,
|
|
100
|
+
color: 'primary',
|
|
101
|
+
fill: 'solid',
|
|
102
|
+
size: 'large',
|
|
103
|
+
onClick: onPrimaryButtonClick,
|
|
104
|
+
className: `${classPrefix}-footer-btn`
|
|
105
|
+
}, primaryButtonText))));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.ResultPage = ResultPage;
|
|
@@ -245,7 +245,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
245
245
|
return () => {
|
|
246
246
|
window.clearInterval(interval);
|
|
247
247
|
};
|
|
248
|
-
}, [autoplay, autoplayInterval, dragging]);
|
|
248
|
+
}, [autoplay, autoplayInterval, dragging, count]);
|
|
249
249
|
|
|
250
250
|
function renderTrackInner() {
|
|
251
251
|
if (loop) {
|
package/2x/cjs/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export { default as PullToRefresh } from './components/pull-to-refresh';
|
|
|
56
56
|
export { default as Radio } from './components/radio';
|
|
57
57
|
export { default as Rate } from './components/rate';
|
|
58
58
|
export { default as Result } from './components/result';
|
|
59
|
+
export { default as ResultPage } from './components/result-page';
|
|
59
60
|
export { default as SafeArea } from './components/safe-area';
|
|
60
61
|
export { default as ScrollMask } from './components/scroll-mask';
|
|
61
62
|
export { default as SearchBar } from './components/search-bar';
|
package/2x/cjs/index.js
CHANGED
|
@@ -339,6 +339,12 @@ Object.defineProperty(exports, "Result", {
|
|
|
339
339
|
return _result.default;
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
|
+
Object.defineProperty(exports, "ResultPage", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return _resultPage.default;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
342
348
|
Object.defineProperty(exports, "SafeArea", {
|
|
343
349
|
enumerable: true,
|
|
344
350
|
get: function () {
|
|
@@ -610,6 +616,8 @@ var _rate = _interopRequireDefault(require("./components/rate"));
|
|
|
610
616
|
|
|
611
617
|
var _result = _interopRequireDefault(require("./components/result"));
|
|
612
618
|
|
|
619
|
+
var _resultPage = _interopRequireDefault(require("./components/result-page"));
|
|
620
|
+
|
|
613
621
|
var _safeArea = _interopRequireDefault(require("./components/safe-area"));
|
|
614
622
|
|
|
615
623
|
var _scrollMask = _interopRequireDefault(require("./components/scroll-mask"));
|
|
@@ -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' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue' | 'getValueFromEvent' | 'getValueProps' | 'normalize' | 'preserve' | 'validateFirst'> & Pick<ListItemProps, 'style' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|
|
@@ -186,6 +186,8 @@ export const Wheel = memo(props => {
|
|
|
186
186
|
if (prev.index !== next.index) return false;
|
|
187
187
|
if (prev.value !== next.value) return false;
|
|
188
188
|
if (prev.onSelect !== next.onSelect) return false;
|
|
189
|
+
if (prev.renderLabel !== next.renderLabel) return false;
|
|
190
|
+
if (prev.mouseWheel !== next.mouseWheel) return false;
|
|
189
191
|
|
|
190
192
|
if (!isEqual(prev.column, next.column)) {
|
|
191
193
|
return false;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
--inactive-color: var(--adm-color-border);
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
touch-action: pan-y;
|
|
7
|
+
-webkit-user-select: none;
|
|
8
|
+
user-select: none;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.adm-rate-box {
|
|
@@ -19,6 +21,7 @@
|
|
|
19
21
|
overflow: hidden;
|
|
20
22
|
cursor: pointer;
|
|
21
23
|
box-sizing: border-box;
|
|
24
|
+
transition: all 0.3s;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
.adm-rate-star-half {
|