antd-mobile 5.19.0 → 5.22.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.development.js +25724 -0
- package/2x/bundle/antd-mobile.cjs.js +8 -32
- package/2x/bundle/antd-mobile.compatible.umd.js +10464 -10860
- package/2x/bundle/antd-mobile.es.development.js +25704 -0
- package/2x/bundle/antd-mobile.es.js +8381 -8615
- package/2x/bundle/antd-mobile.umd.development.js +25726 -0
- package/2x/bundle/antd-mobile.umd.js +8 -32
- package/2x/bundle/style.css +153 -7
- package/2x/cjs/components/action-sheet/action-sheet.css +6 -2
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -0
- package/2x/cjs/components/action-sheet/action-sheet.js +2 -1
- package/2x/cjs/components/check-list/check-list.css +1 -1
- package/2x/cjs/components/ellipsis/ellipsis.js +1 -0
- package/2x/cjs/components/floating-panel/floating-panel.js +2 -2
- package/2x/cjs/components/form/context.d.ts +1 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +3 -0
- package/2x/cjs/components/image/test/image.test.js +57 -8
- package/2x/cjs/components/image-viewer/image-viewer.js +4 -2
- package/2x/cjs/components/index-bar/index-bar.css +1 -1
- package/2x/cjs/components/page-indicator/page-indicator.css +1 -1
- package/2x/cjs/components/picker-view/wheel.js +2 -0
- package/2x/cjs/components/rate/rate.css +4 -0
- package/2x/cjs/components/rate/rate.js +42 -13
- 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/selector/selector.css +10 -0
- package/2x/cjs/components/selector/selector.d.ts +3 -2
- package/2x/cjs/components/selector/selector.js +1 -4
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/cjs/components/swipe-action/swipe-action.js +34 -6
- package/2x/cjs/components/swiper/swiper.js +15 -1
- package/2x/cjs/components/tab-bar/tab-bar.css +2 -2
- package/2x/cjs/index.d.ts +1 -0
- package/2x/cjs/index.js +8 -0
- package/2x/cjs/locales/id-ID.js +13 -0
- package/2x/cjs/utils/use-resize-effect.js +3 -1
- package/2x/es/components/action-sheet/action-sheet.css +6 -2
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -0
- package/2x/es/components/action-sheet/action-sheet.js +2 -1
- package/2x/es/components/check-list/check-list.css +1 -1
- package/2x/es/components/ellipsis/ellipsis.js +1 -0
- package/2x/es/components/floating-panel/floating-panel.js +2 -2
- package/2x/es/components/form/context.d.ts +1 -1
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +3 -0
- package/2x/es/components/image/test/image.test.js +54 -8
- package/2x/es/components/image-viewer/image-viewer.js +4 -2
- package/2x/es/components/index-bar/index-bar.css +1 -1
- package/2x/es/components/page-indicator/page-indicator.css +1 -1
- package/2x/es/components/picker-view/wheel.js +2 -0
- package/2x/es/components/rate/rate.css +4 -0
- package/2x/es/components/rate/rate.js +36 -13
- 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/selector/selector.css +10 -0
- package/2x/es/components/selector/selector.d.ts +3 -2
- package/2x/es/components/selector/selector.js +1 -3
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/es/components/swipe-action/swipe-action.js +34 -6
- package/2x/es/components/swiper/swiper.js +15 -1
- package/2x/es/components/tab-bar/tab-bar.css +2 -2
- package/2x/es/index.d.ts +1 -0
- package/2x/es/index.js +1 -0
- package/2x/es/locales/id-ID.js +13 -0
- package/2x/es/utils/use-resize-effect.js +3 -1
- package/2x/package.json +6 -6
- package/2x/umd/antd-mobile.js +10464 -10860
- package/bundle/antd-mobile.cjs.development.js +25724 -0
- package/bundle/antd-mobile.cjs.js +8 -32
- package/bundle/antd-mobile.compatible.umd.js +10464 -10860
- package/bundle/antd-mobile.es.development.js +25704 -0
- package/bundle/antd-mobile.es.js +8381 -8615
- package/bundle/antd-mobile.umd.development.js +25726 -0
- package/bundle/antd-mobile.umd.js +8 -32
- package/bundle/style.css +1 -1
- package/cjs/components/action-sheet/action-sheet.css +5 -2
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -0
- package/cjs/components/action-sheet/action-sheet.js +2 -1
- package/cjs/components/check-list/check-list.css +1 -1
- package/cjs/components/ellipsis/ellipsis.js +1 -0
- package/cjs/components/floating-panel/floating-panel.js +2 -2
- package/cjs/components/form/context.d.ts +1 -1
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +3 -0
- package/cjs/components/image/test/image.test.js +57 -8
- package/cjs/components/image-viewer/image-viewer.js +4 -2
- package/cjs/components/index-bar/index-bar.css +1 -1
- package/cjs/components/page-indicator/page-indicator.css +1 -1
- package/cjs/components/picker-view/wheel.js +2 -0
- package/cjs/components/rate/rate.css +4 -0
- package/cjs/components/rate/rate.js +42 -13
- 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/selector/selector.css +9 -0
- package/cjs/components/selector/selector.d.ts +3 -2
- package/cjs/components/selector/selector.js +1 -4
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/cjs/components/swipe-action/swipe-action.js +34 -6
- package/cjs/components/swiper/swiper.js +15 -1
- package/cjs/components/tab-bar/tab-bar.css +2 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -0
- package/cjs/locales/id-ID.js +13 -0
- package/cjs/utils/use-resize-effect.js +3 -1
- package/es/components/action-sheet/action-sheet.css +5 -2
- package/es/components/action-sheet/action-sheet.d.ts +1 -0
- package/es/components/action-sheet/action-sheet.js +2 -1
- package/es/components/check-list/check-list.css +1 -1
- package/es/components/ellipsis/ellipsis.js +1 -0
- package/es/components/floating-panel/floating-panel.js +2 -2
- package/es/components/form/context.d.ts +1 -1
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +3 -0
- package/es/components/image/test/image.test.js +54 -8
- package/es/components/image-viewer/image-viewer.js +4 -2
- package/es/components/index-bar/index-bar.css +1 -1
- package/es/components/page-indicator/page-indicator.css +1 -1
- package/es/components/picker-view/wheel.js +2 -0
- package/es/components/rate/rate.css +4 -0
- package/es/components/rate/rate.js +36 -13
- 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/selector/selector.css +9 -0
- package/es/components/selector/selector.d.ts +3 -2
- package/es/components/selector/selector.js +1 -3
- package/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/es/components/swipe-action/swipe-action.js +34 -6
- package/es/components/swiper/swiper.js +15 -1
- package/es/components/tab-bar/tab-bar.css +2 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/id-ID.js +13 -0
- package/es/utils/use-resize-effect.js +3 -1
- package/package.json +6 -6
- package/umd/antd-mobile.js +1 -1
package/2x/bundle/style.css
CHANGED
|
@@ -140,15 +140,19 @@ div.adm-px-tester {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.adm-action-sheet-button-item-description {
|
|
143
|
-
font-size: var(--adm-font-size-
|
|
143
|
+
font-size: var(--adm-font-size-6);
|
|
144
144
|
color: var(--adm-color-weak);
|
|
145
|
-
padding-top:
|
|
145
|
+
padding-top: 8px;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
149
149
|
color: var(--adm-color-danger);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
.adm-action-sheet-button-item-bold .adm-action-sheet-button-item-name {
|
|
153
|
+
font-weight: 700;
|
|
154
|
+
}
|
|
155
|
+
|
|
152
156
|
.adm-action-sheet-cancel {
|
|
153
157
|
background-color: var(--adm-color-box);
|
|
154
158
|
padding-top: 16px;
|
|
@@ -1090,7 +1094,7 @@ div.adm-px-tester {
|
|
|
1090
1094
|
}
|
|
1091
1095
|
|
|
1092
1096
|
.adm-check-list-item-extra {
|
|
1093
|
-
font-size: var(--adm-font-size-
|
|
1097
|
+
font-size: var(--adm-font-size-10);
|
|
1094
1098
|
line-height: 1;
|
|
1095
1099
|
color: var(--adm-color-primary);
|
|
1096
1100
|
}
|
|
@@ -2482,7 +2486,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
2482
2486
|
.adm-index-bar-sidebar-bubble {
|
|
2483
2487
|
position: absolute;
|
|
2484
2488
|
top: 50%;
|
|
2485
|
-
right:
|
|
2489
|
+
right: 120px;
|
|
2486
2490
|
width: 94px;
|
|
2487
2491
|
height: 94px;
|
|
2488
2492
|
color: var(--adm-color-white);
|
|
@@ -3106,7 +3110,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3106
3110
|
.adm-page-indicator {
|
|
3107
3111
|
display: flex;
|
|
3108
3112
|
width: auto;
|
|
3109
|
-
--dot-color:
|
|
3113
|
+
--dot-color: #dddddd;
|
|
3110
3114
|
--active-dot-color: var(--adm-color-primary);
|
|
3111
3115
|
--dot-size: 6px;
|
|
3112
3116
|
--active-dot-size: 26px;
|
|
@@ -3485,6 +3489,9 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3485
3489
|
--active-color: #ffd21e;
|
|
3486
3490
|
--inactive-color: var(--adm-color-border);
|
|
3487
3491
|
display: inline-flex;
|
|
3492
|
+
touch-action: pan-y;
|
|
3493
|
+
-webkit-user-select: none;
|
|
3494
|
+
user-select: none;
|
|
3488
3495
|
}
|
|
3489
3496
|
|
|
3490
3497
|
.adm-rate-box {
|
|
@@ -3500,6 +3507,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3500
3507
|
overflow: hidden;
|
|
3501
3508
|
cursor: pointer;
|
|
3502
3509
|
box-sizing: border-box;
|
|
3510
|
+
transition: all .3s;
|
|
3503
3511
|
}
|
|
3504
3512
|
|
|
3505
3513
|
.adm-rate-star-half {
|
|
@@ -3570,6 +3578,134 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3570
3578
|
color: var(--adm-color-warning);
|
|
3571
3579
|
}
|
|
3572
3580
|
|
|
3581
|
+
.adm-result-page {
|
|
3582
|
+
--background-color: var(--adm-color-primary);
|
|
3583
|
+
position: relative;
|
|
3584
|
+
background-color: var(--adm-color-box);
|
|
3585
|
+
min-height: 100vh;
|
|
3586
|
+
width: 100%;
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
.adm-result-page-header {
|
|
3590
|
+
display: flex;
|
|
3591
|
+
align-items: center;
|
|
3592
|
+
flex-direction: column;
|
|
3593
|
+
background-color: transparent;
|
|
3594
|
+
position: relative;
|
|
3595
|
+
padding: 40px 40px 200px;
|
|
3596
|
+
z-index: 1;
|
|
3597
|
+
overflow: hidden;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
.adm-result-page-icon {
|
|
3601
|
+
color: var(--adm-color-background);
|
|
3602
|
+
box-sizing: border-box;
|
|
3603
|
+
padding: 4px;
|
|
3604
|
+
margin-bottom: 16px;
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
.adm-result-page-icon .antd-mobile-icon {
|
|
3608
|
+
font-size: 64px;
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
.adm-result-page-title {
|
|
3612
|
+
font-size: var(--adm-font-size-10);
|
|
3613
|
+
color: var(--adm-color-background);
|
|
3614
|
+
line-height: 1.4;
|
|
3615
|
+
text-align: center;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
.adm-result-page-description {
|
|
3619
|
+
margin-top: 16px;
|
|
3620
|
+
margin-bottom: 48px;
|
|
3621
|
+
font-size: var(--adm-font-size-6);
|
|
3622
|
+
color: #fff9;
|
|
3623
|
+
line-height: 1.4;
|
|
3624
|
+
text-align: center;
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
.adm-result-page-details {
|
|
3628
|
+
width: 100%;
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
.adm-result-page-detail {
|
|
3632
|
+
width: 100%;
|
|
3633
|
+
display: flex;
|
|
3634
|
+
flex-direction: row;
|
|
3635
|
+
justify-content: space-between;
|
|
3636
|
+
margin-bottom: 10px;
|
|
3637
|
+
color: var(--adm-color-background);
|
|
3638
|
+
font-size: var(--adm-font-size-6);
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
.adm-result-page-detail-bold {
|
|
3642
|
+
font-weight: 600;
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
.adm-result-page-collapse {
|
|
3646
|
+
opacity: .6;
|
|
3647
|
+
width: 20px;
|
|
3648
|
+
height: 20px;
|
|
3649
|
+
margin: auto auto 10px;
|
|
3650
|
+
border-top: 4px solid var(--adm-color-background);
|
|
3651
|
+
border-right: 4px solid var(--adm-color-background);
|
|
3652
|
+
transform: rotate(135deg);
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
.adm-result-page-collapse-active {
|
|
3656
|
+
transform: rotate(-45deg);
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3659
|
+
.adm-result-page-bgWrapper {
|
|
3660
|
+
position: relative;
|
|
3661
|
+
align-self: flex-start;
|
|
3662
|
+
top: 108px;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
.adm-result-page-bg {
|
|
3666
|
+
--width: 440vw;
|
|
3667
|
+
position: absolute;
|
|
3668
|
+
height: var(--width);
|
|
3669
|
+
width: var(--width);
|
|
3670
|
+
left: calc((var(--width) - 100vw) * -1 / 2 - 40px);
|
|
3671
|
+
top: calc(var(--width) * -1 + 1vw);
|
|
3672
|
+
border-radius: 50%;
|
|
3673
|
+
background-color: var(--background-color);
|
|
3674
|
+
z-index: -1;
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
.adm-result-page-content {
|
|
3678
|
+
position: relative;
|
|
3679
|
+
padding: 24px;
|
|
3680
|
+
top: -208px;
|
|
3681
|
+
z-index: 2;
|
|
3682
|
+
}
|
|
3683
|
+
|
|
3684
|
+
.adm-result-page-footer {
|
|
3685
|
+
position: fixed;
|
|
3686
|
+
bottom: 0;
|
|
3687
|
+
width: 100%;
|
|
3688
|
+
padding: 24px 24px 48px;
|
|
3689
|
+
display: flex;
|
|
3690
|
+
justify-content: center;
|
|
3691
|
+
background-color: var(--adm-color-box);
|
|
3692
|
+
z-index: 3;
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
.adm-result-page-footer-btn {
|
|
3696
|
+
flex: 1;
|
|
3697
|
+
max-width: calc((100vw - 72px)/2);
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3700
|
+
.adm-result-page-footer-space {
|
|
3701
|
+
width: 24px;
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
.adm-result-page-card {
|
|
3705
|
+
border-radius: 16px;
|
|
3706
|
+
background-color: var(--adm-color-background);
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3573
3709
|
.adm-search-bar {
|
|
3574
3710
|
--height: 64px;
|
|
3575
3711
|
--padding-left: 16px;
|
|
@@ -3647,6 +3783,10 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3647
3783
|
--checked-border: none;
|
|
3648
3784
|
--border-radius: 4px;
|
|
3649
3785
|
--padding: 16px 32px;
|
|
3786
|
+
--gap: 16px;
|
|
3787
|
+
---gap: var(--gap);
|
|
3788
|
+
---gap-horizontal: var(--gap-horizontal, var(--gap));
|
|
3789
|
+
---gap-vertical: var(--gap-vertical, var(--gap));
|
|
3650
3790
|
overflow: hidden;
|
|
3651
3791
|
font-size: var(--adm-font-size-7);
|
|
3652
3792
|
line-height: 1.4;
|
|
@@ -3656,6 +3796,12 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
3656
3796
|
--gap: 24px;
|
|
3657
3797
|
}
|
|
3658
3798
|
|
|
3799
|
+
.adm-selector .adm-grid {
|
|
3800
|
+
--gap: var(---gap);
|
|
3801
|
+
--gap-horizontal: var(---gap-horizontal);
|
|
3802
|
+
--gap-vertical: var(---gap-vertical);
|
|
3803
|
+
}
|
|
3804
|
+
|
|
3659
3805
|
.adm-selector-item {
|
|
3660
3806
|
padding: var(--padding);
|
|
3661
3807
|
position: relative;
|
|
@@ -4417,7 +4563,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
4417
4563
|
|
|
4418
4564
|
.adm-tab-bar-item {
|
|
4419
4565
|
flex: 1;
|
|
4420
|
-
color: var(--adm-color-
|
|
4566
|
+
color: var(--adm-color-text-secondary);
|
|
4421
4567
|
white-space: nowrap;
|
|
4422
4568
|
padding: 8px 16px;
|
|
4423
4569
|
width: -webkit-min-content;
|
|
@@ -4437,7 +4583,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
4437
4583
|
}
|
|
4438
4584
|
|
|
4439
4585
|
.adm-tab-bar-item-title {
|
|
4440
|
-
font-size: var(--adm-font-size-
|
|
4586
|
+
font-size: var(--adm-font-size-2);
|
|
4441
4587
|
line-height: 30px;
|
|
4442
4588
|
}
|
|
4443
4589
|
|
|
@@ -48,15 +48,19 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.adm-action-sheet-button-item-description {
|
|
51
|
-
font-size: var(--adm-font-size-
|
|
51
|
+
font-size: var(--adm-font-size-6);
|
|
52
52
|
color: var(--adm-color-weak);
|
|
53
|
-
padding-top:
|
|
53
|
+
padding-top: 8px;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
57
57
|
color: var(--adm-color-danger);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.adm-action-sheet-button-item-bold .adm-action-sheet-button-item-name {
|
|
61
|
+
font-weight: bold;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
.adm-action-sheet-cancel {
|
|
61
65
|
background-color: var(--adm-color-box);
|
|
62
66
|
padding-top: 16px;
|
|
@@ -65,7 +65,8 @@ const ActionSheet = p => {
|
|
|
65
65
|
}, _react.default.createElement("a", {
|
|
66
66
|
className: (0, _classnames.default)('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
67
67
|
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
68
|
-
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
68
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled,
|
|
69
|
+
[`${classPrefix}-button-item-bold`]: action.bold
|
|
69
70
|
}),
|
|
70
71
|
onClick: () => {
|
|
71
72
|
var _a, _b, _c;
|
|
@@ -41,6 +41,7 @@ const Ellipsis = p => {
|
|
|
41
41
|
function calcEllipsised() {
|
|
42
42
|
const root = rootRef.current;
|
|
43
43
|
if (!root) return;
|
|
44
|
+
if (!root.offsetParent) return;
|
|
44
45
|
const originStyle = window.getComputedStyle(root);
|
|
45
46
|
const container = document.createElement('div');
|
|
46
47
|
const styleNames = Array.prototype.slice.apply(originStyle);
|
|
@@ -133,8 +133,8 @@ const FloatingPanel = (0, _react.forwardRef)((p, ref) => {
|
|
|
133
133
|
ref: elementRef,
|
|
134
134
|
className: 'adm-floating-panel',
|
|
135
135
|
style: {
|
|
136
|
-
height: maxHeight,
|
|
137
|
-
translateY: y.to(y => `calc(100% + (${y}px))`)
|
|
136
|
+
height: Math.round(maxHeight),
|
|
137
|
+
translateY: y.to(y => `calc(100% + (${Math.round(y)}px))`)
|
|
138
138
|
}
|
|
139
139
|
}, _react.default.createElement("div", {
|
|
140
140
|
className: 'adm-floating-panel-mask',
|
|
@@ -5,7 +5,7 @@ export declare type FormContextType = {
|
|
|
5
5
|
name?: string;
|
|
6
6
|
hasFeedback: boolean;
|
|
7
7
|
layout: FormLayout;
|
|
8
|
-
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional';
|
|
8
|
+
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional' | 'none';
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const defaultFormContext: FormContextType;
|
|
@@ -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;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _tslib = require("tslib");
|
|
4
|
-
|
|
5
3
|
var _react = _interopRequireDefault(require("react"));
|
|
6
4
|
|
|
7
5
|
var _testing = require("testing");
|
|
@@ -10,13 +8,9 @@ var _index = _interopRequireDefault(require("../index"));
|
|
|
10
8
|
|
|
11
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
10
|
|
|
11
|
+
const classPrefix = `adm-image`;
|
|
13
12
|
const demoSrc = 'https://images.unsplash.com/photo-1567945716310-4745a6b7844b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=300&q=60';
|
|
14
|
-
describe('
|
|
15
|
-
test('a11y', () => (0, _tslib.__awaiter)(void 0, void 0, void 0, function* () {
|
|
16
|
-
yield (0, _testing.testA11y)(_react.default.createElement(_index.default, {
|
|
17
|
-
src: demoSrc
|
|
18
|
-
}));
|
|
19
|
-
}));
|
|
13
|
+
describe('Image', () => {
|
|
20
14
|
test('onContainerClick can work', () => {
|
|
21
15
|
const onContainerClick = jest.fn();
|
|
22
16
|
const {
|
|
@@ -31,4 +25,59 @@ describe('image', () => {
|
|
|
31
25
|
|
|
32
26
|
expect(onContainerClick).toBeCalledTimes(1);
|
|
33
27
|
});
|
|
28
|
+
test('load successfully', () => {
|
|
29
|
+
(0, _testing.render)(_react.default.createElement(_index.default, {
|
|
30
|
+
src: demoSrc
|
|
31
|
+
}));
|
|
32
|
+
const img = document.querySelectorAll(`.${classPrefix}-img`)[0];
|
|
33
|
+
|
|
34
|
+
_testing.fireEvent.load(img);
|
|
35
|
+
|
|
36
|
+
expect(img).toHaveAttribute('src', demoSrc);
|
|
37
|
+
});
|
|
38
|
+
test('load failed', () => {
|
|
39
|
+
(0, _testing.render)(_react.default.createElement(_index.default, {
|
|
40
|
+
src: '404'
|
|
41
|
+
}));
|
|
42
|
+
const img = document.querySelectorAll(`.${classPrefix}-img`)[0];
|
|
43
|
+
|
|
44
|
+
_testing.fireEvent.error(img);
|
|
45
|
+
|
|
46
|
+
expect(img).not.toBeInTheDocument();
|
|
47
|
+
expect(document.querySelectorAll(`.${classPrefix}-tip`)[0]).toBeInTheDocument();
|
|
48
|
+
});
|
|
49
|
+
test('lazy load should be work', () => {
|
|
50
|
+
// mock useInViewport
|
|
51
|
+
// https://github.com/alibaba/hooks/blob/master/packages/hooks/src/useInViewport/__tests__/index.test.ts
|
|
52
|
+
const mockIntersectionObserver = jest.fn().mockReturnValue({
|
|
53
|
+
observe: () => null,
|
|
54
|
+
disconnect: () => null
|
|
55
|
+
});
|
|
56
|
+
window.IntersectionObserver = mockIntersectionObserver;
|
|
57
|
+
(0, _testing.render)(_react.default.createElement(_index.default, {
|
|
58
|
+
src: demoSrc,
|
|
59
|
+
lazy: true
|
|
60
|
+
}));
|
|
61
|
+
const img = document.querySelectorAll(`.${classPrefix}-img`)[0];
|
|
62
|
+
expect(img).not.toHaveAttribute('src');
|
|
63
|
+
const calls = mockIntersectionObserver.mock.calls;
|
|
64
|
+
const [onChange] = calls[calls.length - 1];
|
|
65
|
+
(0, _testing.act)(() => {
|
|
66
|
+
onChange([{
|
|
67
|
+
isIntersecting: true
|
|
68
|
+
}]);
|
|
69
|
+
});
|
|
70
|
+
expect(img).toHaveAttribute('src', demoSrc);
|
|
71
|
+
});
|
|
72
|
+
test('renders with width and height', () => {
|
|
73
|
+
const {
|
|
74
|
+
getByTestId
|
|
75
|
+
} = (0, _testing.render)(_react.default.createElement(_index.default, {
|
|
76
|
+
src: demoSrc,
|
|
77
|
+
width: 100,
|
|
78
|
+
height: 100,
|
|
79
|
+
"data-testid": 'image'
|
|
80
|
+
}));
|
|
81
|
+
expect(getByTestId('image')).toHaveStyle('--width: 100px;--height: 100px');
|
|
82
|
+
});
|
|
34
83
|
});
|
|
@@ -41,7 +41,8 @@ const ImageViewer = p => {
|
|
|
41
41
|
visible: props.visible,
|
|
42
42
|
disableBodyScroll: false,
|
|
43
43
|
opacity: 'thick',
|
|
44
|
-
afterClose: props.afterClose
|
|
44
|
+
afterClose: props.afterClose,
|
|
45
|
+
destroyOnClose: true
|
|
45
46
|
}, _react.default.createElement("div", {
|
|
46
47
|
className: `${classPrefix}-content`
|
|
47
48
|
}, props.image && _react.default.createElement(_slide.Slide, {
|
|
@@ -90,7 +91,8 @@ const MultiImageViewer = (0, _react.forwardRef)((p, ref) => {
|
|
|
90
91
|
visible: props.visible,
|
|
91
92
|
disableBodyScroll: false,
|
|
92
93
|
opacity: 'thick',
|
|
93
|
-
afterClose: props.afterClose
|
|
94
|
+
afterClose: props.afterClose,
|
|
95
|
+
destroyOnClose: true
|
|
94
96
|
}, _react.default.createElement("div", {
|
|
95
97
|
className: `${classPrefix}-content`
|
|
96
98
|
}, props.images && _react.default.createElement(_slides.Slides, {
|
|
@@ -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;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
--active-color: #ffd21e;
|
|
4
4
|
--inactive-color: var(--adm-color-border);
|
|
5
5
|
display: inline-flex;
|
|
6
|
+
touch-action: pan-y;
|
|
7
|
+
-webkit-user-select: none;
|
|
8
|
+
user-select: none;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
.adm-rate-box {
|
|
@@ -18,6 +21,7 @@
|
|
|
18
21
|
overflow: hidden;
|
|
19
22
|
cursor: pointer;
|
|
20
23
|
box-sizing: border-box;
|
|
24
|
+
transition: all 0.3s;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
.adm-rate-star-half {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Rate = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
@@ -17,8 +17,16 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
17
17
|
|
|
18
18
|
var _star = require("./star");
|
|
19
19
|
|
|
20
|
+
var _react2 = require("@use-gesture/react");
|
|
21
|
+
|
|
22
|
+
var _bound = require("../../utils/bound");
|
|
23
|
+
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
22
30
|
const classPrefix = `adm-rate`;
|
|
23
31
|
const defaultProps = {
|
|
24
32
|
count: 5,
|
|
@@ -32,6 +40,7 @@ const defaultProps = {
|
|
|
32
40
|
const Rate = p => {
|
|
33
41
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
34
42
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
43
|
+
const containerRef = (0, _react.useRef)(null);
|
|
35
44
|
const starList = Array(props.count).fill(null);
|
|
36
45
|
|
|
37
46
|
function renderStar(v, half) {
|
|
@@ -41,26 +50,46 @@ const Rate = p => {
|
|
|
41
50
|
[`${classPrefix}-star-half`]: half,
|
|
42
51
|
[`${classPrefix}-star-readonly`]: props.readOnly
|
|
43
52
|
}),
|
|
44
|
-
onClick: () => {
|
|
45
|
-
if (props.readOnly) return;
|
|
46
|
-
|
|
47
|
-
if (props.allowClear && value === v) {
|
|
48
|
-
setValue(0);
|
|
49
|
-
} else {
|
|
50
|
-
setValue(v);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
53
|
role: 'radio',
|
|
54
54
|
"aria-checked": value >= v,
|
|
55
55
|
"aria-label": '' + v
|
|
56
56
|
}, props.character);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const bind = (0, _react2.useDrag)(state => {
|
|
60
|
+
if (props.readOnly) return;
|
|
61
|
+
const {
|
|
62
|
+
xy: [clientX],
|
|
63
|
+
tap
|
|
64
|
+
} = state;
|
|
65
|
+
const container = containerRef.current;
|
|
66
|
+
if (!container) return;
|
|
67
|
+
const rect = container.getBoundingClientRect();
|
|
68
|
+
const rawValue = (clientX - rect.left) / rect.width * props.count;
|
|
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);
|
|
80
|
+
}, {
|
|
81
|
+
axis: 'x',
|
|
82
|
+
pointer: {
|
|
83
|
+
touch: true
|
|
84
|
+
},
|
|
85
|
+
filterTaps: true
|
|
86
|
+
});
|
|
87
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", Object.assign({
|
|
60
88
|
className: classPrefix,
|
|
61
89
|
role: 'radiogroup',
|
|
62
|
-
"aria-readonly": props.readOnly
|
|
63
|
-
|
|
90
|
+
"aria-readonly": props.readOnly,
|
|
91
|
+
ref: containerRef
|
|
92
|
+
}, bind()), starList.map((_, i) => _react.default.createElement("div", {
|
|
64
93
|
key: i,
|
|
65
94
|
className: (0, _classnames.default)(`${classPrefix}-box`)
|
|
66
95
|
}, props.allowHalf && renderStar(i + 0.5, true), renderStar(i + 1, false)))));
|
|
@@ -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;
|