@arco-design/mobile-react 2.38.2 → 2.38.3
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/CHANGELOG.md +12 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/action-sheet/index.d.ts +11 -10
- package/cjs/action-sheet/index.js +6 -2
- package/cjs/action-sheet/methods.d.ts +2 -2
- package/cjs/cell/cell.d.ts +1 -1
- package/cjs/cell/cell.js +36 -7
- package/cjs/cell/style/css/index.css +46 -16
- package/cjs/cell/style/index.less +52 -11
- package/cjs/cell/type.d.ts +8 -1
- package/dist/index.js +42 -9
- package/dist/index.min.js +1 -1
- package/dist/style.css +33 -8
- package/dist/style.min.css +1 -1
- package/esm/action-sheet/index.d.ts +11 -10
- package/esm/action-sheet/index.js +6 -2
- package/esm/action-sheet/methods.d.ts +2 -2
- package/esm/cell/cell.d.ts +1 -1
- package/esm/cell/cell.js +37 -8
- package/esm/cell/style/css/index.css +46 -16
- package/esm/cell/style/index.less +52 -11
- package/esm/cell/type.d.ts +8 -1
- package/esnext/action-sheet/index.d.ts +11 -10
- package/esnext/action-sheet/index.js +7 -3
- package/esnext/action-sheet/methods.d.ts +2 -2
- package/esnext/cell/cell.d.ts +1 -1
- package/esnext/cell/cell.js +19 -3
- package/esnext/cell/style/css/index.css +46 -16
- package/esnext/cell/style/index.less +52 -11
- package/esnext/cell/type.d.ts +8 -1
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +2 -0
- package/tokens/app/arcodesign/default/index.d.ts +2 -0
- package/tokens/app/arcodesign/default/index.js +2 -0
- package/tokens/app/arcodesign/default/index.json +20 -0
- package/tokens/app/arcodesign/default/index.less +2 -0
- package/umd/action-sheet/index.d.ts +11 -10
- package/umd/action-sheet/index.js +6 -2
- package/umd/action-sheet/methods.d.ts +2 -2
- package/umd/cell/cell.d.ts +1 -1
- package/umd/cell/cell.js +36 -7
- package/umd/cell/style/css/index.css +46 -16
- package/umd/cell/style/index.less +52 -11
- package/umd/cell/type.d.ts +8 -1
|
@@ -569,16 +569,40 @@
|
|
|
569
569
|
border-radius: 0;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
.arco-cell
|
|
572
|
+
.arco-cell-clickable {
|
|
573
|
+
-webkit-user-select: none;
|
|
574
|
+
user-select: none;
|
|
575
|
+
-webkit-tap-highlight-color: transparent;
|
|
576
|
+
-webkit-touch-callout: none;
|
|
577
|
+
touch-action: manipulation;
|
|
578
|
+
position: relative;
|
|
579
|
+
}
|
|
580
|
+
.arco-cell-clickable.arco-cell-pressed {
|
|
581
|
+
background-color: #F7F8FA ;
|
|
582
|
+
}
|
|
583
|
+
.arco-cell-clickable::after {
|
|
584
|
+
content: '';
|
|
585
|
+
position: absolute;
|
|
586
|
+
top: 0;
|
|
587
|
+
right: 100%;
|
|
588
|
+
width: 0.32rem ;
|
|
589
|
+
height: 100%;
|
|
590
|
+
background-color: inherit;
|
|
591
|
+
pointer-events: none;
|
|
592
|
+
}
|
|
593
|
+
.arco-cell-clickable.arco-cell-pressed::after {
|
|
594
|
+
background-color: #F7F8FA ;
|
|
595
|
+
}
|
|
596
|
+
.arco-cell-without-group {
|
|
573
597
|
background-color: #FFFFFF ;
|
|
574
598
|
padding-left: 0.32rem ;
|
|
575
599
|
margin-left: 0;
|
|
576
600
|
}
|
|
577
|
-
.arco-cell
|
|
601
|
+
.arco-cell-without-group.bordered {
|
|
578
602
|
position: relative;
|
|
579
603
|
border-width: 0;
|
|
580
604
|
}
|
|
581
|
-
.arco-cell
|
|
605
|
+
.arco-cell-without-group.bordered::before {
|
|
582
606
|
content: '';
|
|
583
607
|
width: 100%;
|
|
584
608
|
height: 1PX;
|
|
@@ -596,20 +620,20 @@
|
|
|
596
620
|
border-radius: 0;
|
|
597
621
|
}
|
|
598
622
|
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
|
599
|
-
.arco-cell
|
|
623
|
+
.arco-cell-without-group.bordered::before {
|
|
600
624
|
transform: scaleY(0.5);
|
|
601
625
|
-webkit-transform: scaleY(0.5);
|
|
602
626
|
border-radius: 0;
|
|
603
627
|
}
|
|
604
628
|
}
|
|
605
629
|
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
|
606
|
-
.arco-cell
|
|
630
|
+
.arco-cell-without-group.bordered::before {
|
|
607
631
|
transform: scaleY(0.33333333);
|
|
608
632
|
-webkit-transform: scaleY(0.33333333);
|
|
609
633
|
border-radius: 0;
|
|
610
634
|
}
|
|
611
635
|
}
|
|
612
|
-
.arco-cell
|
|
636
|
+
.arco-cell-without-group.bordered::after {
|
|
613
637
|
content: '';
|
|
614
638
|
width: 100%;
|
|
615
639
|
height: 1PX;
|
|
@@ -627,14 +651,14 @@
|
|
|
627
651
|
border-radius: 0;
|
|
628
652
|
}
|
|
629
653
|
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
|
630
|
-
.arco-cell
|
|
654
|
+
.arco-cell-without-group.bordered::after {
|
|
631
655
|
transform: scaleY(0.5);
|
|
632
656
|
-webkit-transform: scaleY(0.5);
|
|
633
657
|
border-radius: 0;
|
|
634
658
|
}
|
|
635
659
|
}
|
|
636
660
|
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
|
637
|
-
.arco-cell
|
|
661
|
+
.arco-cell-without-group.bordered::after {
|
|
638
662
|
transform: scaleY(0.33333333);
|
|
639
663
|
-webkit-transform: scaleY(0.33333333);
|
|
640
664
|
border-radius: 0;
|
|
@@ -866,14 +890,20 @@
|
|
|
866
890
|
border-radius: 0;
|
|
867
891
|
}
|
|
868
892
|
}
|
|
869
|
-
.arco-theme-dark .arco-cell.
|
|
893
|
+
.arco-theme-dark .arco-cell-clickable.arco-cell-pressed {
|
|
894
|
+
background-color: hsla(0, 0%, 100%, 0.08) ;
|
|
895
|
+
}
|
|
896
|
+
.arco-theme-dark .arco-cell-clickable.arco-cell-pressed::after {
|
|
897
|
+
background-color: hsla(0, 0%, 100%, 0.08) ;
|
|
898
|
+
}
|
|
899
|
+
.arco-theme-dark .arco-cell-without-group {
|
|
870
900
|
background-color: #232324 ;
|
|
871
901
|
}
|
|
872
|
-
.arco-theme-dark .arco-cell
|
|
902
|
+
.arco-theme-dark .arco-cell-without-group.bordered {
|
|
873
903
|
position: relative;
|
|
874
904
|
border-width: 0;
|
|
875
905
|
}
|
|
876
|
-
.arco-theme-dark .arco-cell
|
|
906
|
+
.arco-theme-dark .arco-cell-without-group.bordered::before {
|
|
877
907
|
content: '';
|
|
878
908
|
width: 100%;
|
|
879
909
|
height: 1PX;
|
|
@@ -891,20 +921,20 @@
|
|
|
891
921
|
border-radius: 0;
|
|
892
922
|
}
|
|
893
923
|
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
|
894
|
-
.arco-theme-dark .arco-cell
|
|
924
|
+
.arco-theme-dark .arco-cell-without-group.bordered::before {
|
|
895
925
|
transform: scaleY(0.5);
|
|
896
926
|
-webkit-transform: scaleY(0.5);
|
|
897
927
|
border-radius: 0;
|
|
898
928
|
}
|
|
899
929
|
}
|
|
900
930
|
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
|
901
|
-
.arco-theme-dark .arco-cell
|
|
931
|
+
.arco-theme-dark .arco-cell-without-group.bordered::before {
|
|
902
932
|
transform: scaleY(0.33333333);
|
|
903
933
|
-webkit-transform: scaleY(0.33333333);
|
|
904
934
|
border-radius: 0;
|
|
905
935
|
}
|
|
906
936
|
}
|
|
907
|
-
.arco-theme-dark .arco-cell
|
|
937
|
+
.arco-theme-dark .arco-cell-without-group.bordered::after {
|
|
908
938
|
content: '';
|
|
909
939
|
width: 100%;
|
|
910
940
|
height: 1PX;
|
|
@@ -922,14 +952,14 @@
|
|
|
922
952
|
border-radius: 0;
|
|
923
953
|
}
|
|
924
954
|
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
|
925
|
-
.arco-theme-dark .arco-cell
|
|
955
|
+
.arco-theme-dark .arco-cell-without-group.bordered::after {
|
|
926
956
|
transform: scaleY(0.5);
|
|
927
957
|
-webkit-transform: scaleY(0.5);
|
|
928
958
|
border-radius: 0;
|
|
929
959
|
}
|
|
930
960
|
}
|
|
931
961
|
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
|
932
|
-
.arco-theme-dark .arco-cell
|
|
962
|
+
.arco-theme-dark .arco-cell-without-group.bordered::after {
|
|
933
963
|
transform: scaleY(0.33333333);
|
|
934
964
|
-webkit-transform: scaleY(0.33333333);
|
|
935
965
|
border-radius: 0;
|
|
@@ -10,15 +10,42 @@
|
|
|
10
10
|
.onepx-border-var(top, line-color);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
&-clickable {
|
|
14
|
+
user-select: none;
|
|
15
|
+
-webkit-tap-highlight-color: transparent;
|
|
16
|
+
-webkit-touch-callout: none;
|
|
17
|
+
touch-action: manipulation;
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
&.@{prefix}-cell-pressed {
|
|
21
|
+
.use-var(background-color, cell-clickable-background-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&::after {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
right: 100%;
|
|
29
|
+
.use-var(width, cell-horizontal-padding);
|
|
30
|
+
height: 100%;
|
|
31
|
+
background-color: inherit;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.@{prefix}-cell-pressed::after {
|
|
36
|
+
.use-var(background-color, cell-clickable-background-color);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-without-group {
|
|
14
41
|
.use-var(background-color, cell-background-color);
|
|
15
42
|
.use-var(padding-left, cell-horizontal-padding);
|
|
16
43
|
margin-left: 0;
|
|
44
|
+
}
|
|
17
45
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
46
|
+
&-without-group.bordered {
|
|
47
|
+
.onepx-border-var(top, line-color);
|
|
48
|
+
.onepx-border-var(bottom, line-color);
|
|
22
49
|
}
|
|
23
50
|
|
|
24
51
|
&-inner {
|
|
@@ -63,6 +90,7 @@
|
|
|
63
90
|
.cell-label-icon {
|
|
64
91
|
.use-var-with-rtl(margin-right, cell-label-icon-gutter);
|
|
65
92
|
font-size: 0;
|
|
93
|
+
|
|
66
94
|
.@{prefix}-icon {
|
|
67
95
|
line-height: initial;
|
|
68
96
|
.use-var(font-size, cell-label-icon-font-size);
|
|
@@ -76,6 +104,7 @@
|
|
|
76
104
|
});
|
|
77
105
|
.use-var-with-rtl(margin-left, cell-arrow-gutter);
|
|
78
106
|
font-size: 0;
|
|
107
|
+
|
|
79
108
|
.@{prefix}-icon {
|
|
80
109
|
.use-var(font-size, cell-arrow-font-size);
|
|
81
110
|
.use-var(color, cell-arrow-color);
|
|
@@ -148,17 +177,29 @@
|
|
|
148
177
|
.onepx-border-var(top, dark-line-color);
|
|
149
178
|
}
|
|
150
179
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
180
|
+
&-clickable {
|
|
181
|
+
&.@{prefix}-cell-pressed {
|
|
182
|
+
@{arco-dark-mode-selector} & {
|
|
183
|
+
.use-var(background-color, dark-cell-clickable-background-color);
|
|
184
|
+
}
|
|
154
185
|
}
|
|
155
|
-
|
|
186
|
+
&.@{prefix}-cell-pressed::after {
|
|
156
187
|
@{arco-dark-mode-selector} & {
|
|
157
|
-
.
|
|
158
|
-
.onepx-border-var(bottom, dark-line-color);
|
|
188
|
+
.use-var(background-color, dark-cell-clickable-background-color);
|
|
159
189
|
}
|
|
160
190
|
}
|
|
161
191
|
}
|
|
192
|
+
&-without-group {
|
|
193
|
+
@{arco-dark-mode-selector} & {
|
|
194
|
+
.use-var(background-color, dark-cell-background-color);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
&-without-group.bordered {
|
|
198
|
+
@{arco-dark-mode-selector} & {
|
|
199
|
+
.onepx-border-var(top, dark-line-color);
|
|
200
|
+
.onepx-border-var(bottom, dark-line-color);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
162
203
|
.cell-label {
|
|
163
204
|
@{arco-dark-mode-selector} & {
|
|
164
205
|
.use-var(color, dark-cell-label-color);
|
package/esnext/cell/type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type React from 'react';
|
|
2
3
|
export interface CellProps {
|
|
3
4
|
/**
|
|
4
5
|
* 自定义样式
|
|
@@ -60,6 +61,12 @@ export interface CellProps {
|
|
|
60
61
|
* @default true
|
|
61
62
|
*/
|
|
62
63
|
bordered?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* 是否启用点击态效果
|
|
66
|
+
* @en Whether to enable click effect
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
clickable?: boolean;
|
|
63
70
|
/**
|
|
64
71
|
* 点击单元格事件回调
|
|
65
72
|
* @en Callback for cell click event
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arco-design/mobile-react",
|
|
3
|
-
"version": "2.38.
|
|
3
|
+
"version": "2.38.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"author": "taoyiyue@bytedance.com",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@arco-design/mobile-utils": "2.23.
|
|
18
|
+
"@arco-design/mobile-utils": "2.23.3",
|
|
19
19
|
"@arco-design/transformable": "^1.0.0",
|
|
20
20
|
"@babel/runtime": "^7",
|
|
21
21
|
"lodash.throttle": "^4.1.1",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "57304aa9559040c8af15004e61cc7c331cf33646"
|
|
51
51
|
}
|
|
@@ -489,6 +489,8 @@
|
|
|
489
489
|
--cell-arrow-font-size: ~`pxtorem(12)`;
|
|
490
490
|
--dark-cell-background-color: var(--dark-container-background-color);
|
|
491
491
|
--cell-background-color: var(--container-background-color);
|
|
492
|
+
--dark-cell-clickable-background-color: var(--dark-card-background-color);
|
|
493
|
+
--cell-clickable-background-color: var(--card-background-color);
|
|
492
494
|
--cell-font-size: ~`pxtorem(16)`;
|
|
493
495
|
--cell-horizontal-padding: ~`pxtorem(16)`;
|
|
494
496
|
--cell-item-height: ~`pxtorem(54)`;
|
|
@@ -488,6 +488,8 @@ export interface ArcodesignToken extends Record<string, string> {
|
|
|
488
488
|
'cell-arrow-font-size': string;
|
|
489
489
|
'dark-cell-background-color': string;
|
|
490
490
|
'cell-background-color': string;
|
|
491
|
+
'dark-cell-clickable-background-color': string;
|
|
492
|
+
'cell-clickable-background-color': string;
|
|
491
493
|
'cell-font-size': string;
|
|
492
494
|
'cell-horizontal-padding': string;
|
|
493
495
|
'cell-item-height': string;
|
|
@@ -500,6 +500,8 @@ var tokens = {
|
|
|
500
500
|
"cell-arrow-font-size": "0.24rem",
|
|
501
501
|
"dark-cell-background-color": "var(--dark-container-background-color)",
|
|
502
502
|
"cell-background-color": "var(--container-background-color)",
|
|
503
|
+
"dark-cell-clickable-background-color": "var(--dark-card-background-color)",
|
|
504
|
+
"cell-clickable-background-color": "var(--card-background-color)",
|
|
503
505
|
"cell-font-size": "0.32rem",
|
|
504
506
|
"cell-horizontal-padding": "0.32rem",
|
|
505
507
|
"cell-item-height": "1.08rem",
|
|
@@ -1667,6 +1667,18 @@
|
|
|
1667
1667
|
"en": "Cell background color"
|
|
1668
1668
|
}
|
|
1669
1669
|
},
|
|
1670
|
+
"cellClickableBackgroundColor": {
|
|
1671
|
+
"cssKey": "cell-clickable-background-color",
|
|
1672
|
+
"desc": "单元格点击态背景色",
|
|
1673
|
+
"override": "",
|
|
1674
|
+
"value": "@card-background-color",
|
|
1675
|
+
"jsValue": "@global@cardBackgroundColor",
|
|
1676
|
+
"staticValue": "#F7F8FA",
|
|
1677
|
+
"localeDesc": {
|
|
1678
|
+
"ch": "单元格点击态背景色",
|
|
1679
|
+
"en": "Cell clickable background color"
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1670
1682
|
"cellContentFontSize": {
|
|
1671
1683
|
"cssKey": "cell-content-font-size",
|
|
1672
1684
|
"desc": "单元格内容文字大小",
|
|
@@ -2539,6 +2551,14 @@
|
|
|
2539
2551
|
"jsValue": "@global@darkContainerBackgroundColor",
|
|
2540
2552
|
"staticValue": "#232324"
|
|
2541
2553
|
},
|
|
2554
|
+
"darkCellClickableBackgroundColor": {
|
|
2555
|
+
"cssKey": "dark-cell-clickable-background-color",
|
|
2556
|
+
"desc": "",
|
|
2557
|
+
"override": "",
|
|
2558
|
+
"value": "@dark-card-background-color",
|
|
2559
|
+
"jsValue": "@global@darkCardBackgroundColor",
|
|
2560
|
+
"staticValue": "hsla(0, 0%, 100%, 0.08)"
|
|
2561
|
+
},
|
|
2542
2562
|
"darkCellDescColor": {
|
|
2543
2563
|
"cssKey": "dark-cell-desc-color",
|
|
2544
2564
|
"desc": "",
|
|
@@ -488,6 +488,8 @@
|
|
|
488
488
|
@cell-arrow-font-size: ~`pxtorem(12)`;
|
|
489
489
|
@dark-cell-background-color: @dark-container-background-color;
|
|
490
490
|
@cell-background-color: @container-background-color;
|
|
491
|
+
@dark-cell-clickable-background-color: @dark-card-background-color;
|
|
492
|
+
@cell-clickable-background-color: @card-background-color;
|
|
491
493
|
@cell-font-size: ~`pxtorem(16)`;
|
|
492
494
|
@cell-horizontal-padding: ~`pxtorem(16)`;
|
|
493
495
|
@cell-item-height: ~`pxtorem(54)`;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Promise } from 'es6-promise';
|
|
4
|
+
import type { PopupProps, PopupRef } from '../popup';
|
|
5
|
+
import type { OpenBaseProps } from '../masking';
|
|
5
6
|
export interface ActionSheetItemOptions {
|
|
6
7
|
/**
|
|
7
8
|
* 选项文字内容
|
|
@@ -29,7 +30,7 @@ export interface ActionSheetItemOptions {
|
|
|
29
30
|
*/
|
|
30
31
|
onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => (void | boolean) | Promise<void | boolean>;
|
|
31
32
|
}
|
|
32
|
-
export interface ActionSheetProps extends Omit<PopupProps, 'children' | '
|
|
33
|
+
export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'orientationDirection' | 'direction'> {
|
|
33
34
|
/**
|
|
34
35
|
* 选项配置,详情见 ActionSheetItemOptions
|
|
35
36
|
* @en Option setting, see ActionSheetItemOptions for details
|
|
@@ -57,12 +58,12 @@ export interface ActionSheetProps extends Omit<PopupProps, 'children' | 'getScro
|
|
|
57
58
|
*/
|
|
58
59
|
needBottomOffset?: boolean;
|
|
59
60
|
}
|
|
60
|
-
export interface ActionSheetRef {
|
|
61
|
+
export interface ActionSheetRef extends PopupRef {
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
+
* 菜单列表元素 DOM
|
|
63
64
|
* @en The outermost element DOM
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
actionList: HTMLDivElement | null;
|
|
66
67
|
}
|
|
67
68
|
export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.FunctionComponent<P>): {
|
|
68
69
|
/**
|
|
@@ -87,11 +88,11 @@ declare const _default: React.ForwardRefExoticComponent<ActionSheetProps & React
|
|
|
87
88
|
* @param {ActionSheetProps} config setting
|
|
88
89
|
* @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }}
|
|
89
90
|
*/
|
|
90
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
|
91
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
|
91
92
|
key?: string | undefined;
|
|
92
93
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
|
93
94
|
close: () => void;
|
|
94
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
|
95
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ActionSheetProps & React.RefAttributes<ActionSheetRef>>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & {
|
|
95
96
|
key?: string | undefined;
|
|
96
97
|
}) => void;
|
|
97
98
|
};
|
|
@@ -40,8 +40,11 @@
|
|
|
40
40
|
needBottomOffset = _props$needBottomOffs === void 0 ? true : _props$needBottomOffs,
|
|
41
41
|
otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
42
42
|
var popupRef = (0, _react.useRef)(null);
|
|
43
|
+
var listRef = (0, _react.useRef)(null);
|
|
43
44
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
44
|
-
return popupRef.current
|
|
45
|
+
return (0, _extends2.default)({}, popupRef.current, {
|
|
46
|
+
actionList: listRef.current
|
|
47
|
+
});
|
|
45
48
|
});
|
|
46
49
|
|
|
47
50
|
function handleItemClick(e, item) {
|
|
@@ -78,7 +81,8 @@
|
|
|
78
81
|
}, title) : null, subTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
79
82
|
className: prefixCls + "-action-sheet-sub-title"
|
|
80
83
|
}, subTitle) : null) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
-
className: prefixCls + "-action-sheet-list"
|
|
84
|
+
className: prefixCls + "-action-sheet-list",
|
|
85
|
+
ref: listRef
|
|
82
86
|
}, (items || []).map(function (item, index) {
|
|
83
87
|
return item.content ? /*#__PURE__*/_react.default.createElement("div", {
|
|
84
88
|
className: (0, _mobileUtils.cls)(prefixCls + "-action-sheet-item", item.className, item.status || 'normal'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { OpenBaseProps } from '../masking/methods';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { OpenBaseProps } from '../masking/methods';
|
|
3
3
|
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
|
4
4
|
key?: string | undefined;
|
|
5
5
|
}, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
package/umd/cell/cell.d.ts
CHANGED
package/umd/cell/cell.js
CHANGED
|
@@ -39,28 +39,57 @@
|
|
|
39
39
|
append = props.append,
|
|
40
40
|
_props$bordered = props.bordered,
|
|
41
41
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
42
|
-
|
|
42
|
+
onClick = props.onClick,
|
|
43
|
+
_props$clickable = props.clickable,
|
|
44
|
+
clickable = _props$clickable === void 0 ? false : _props$clickable;
|
|
43
45
|
var domRef = (0, _react.useRef)(null);
|
|
46
|
+
|
|
47
|
+
var _useState = (0, _react.useState)(false),
|
|
48
|
+
isPressed = _useState[0],
|
|
49
|
+
setIsPressed = _useState[1];
|
|
50
|
+
|
|
44
51
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
45
52
|
return {
|
|
46
53
|
dom: domRef.current
|
|
47
54
|
};
|
|
48
55
|
});
|
|
56
|
+
|
|
57
|
+
var handleTouchStart = function handleTouchStart() {
|
|
58
|
+
if (clickable) {
|
|
59
|
+
setIsPressed(true);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var handleTouchEnd = function handleTouchEnd() {
|
|
64
|
+
if (clickable) {
|
|
65
|
+
setIsPressed(false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var handleClick = function handleClick(e) {
|
|
70
|
+
if (onClick) {
|
|
71
|
+
onClick(e);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
49
75
|
return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
|
|
50
76
|
var prefixCls = _ref.prefixCls;
|
|
51
77
|
return /*#__PURE__*/_react.default.createElement(_group.GroupContext.Consumer, null, function (_ref2) {
|
|
78
|
+
var _cls, _cls2, _cls3;
|
|
79
|
+
|
|
52
80
|
var isFromGroup = _ref2.isFromGroup;
|
|
53
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
82
|
className: (0, _mobileUtils.cls)(prefixCls + "-cell", 'all-border-box', {
|
|
55
|
-
'without-group': !isFromGroup
|
|
56
|
-
}, {
|
|
57
83
|
bordered: bordered
|
|
58
|
-
},
|
|
84
|
+
}, {
|
|
85
|
+
'without-group': !isFromGroup
|
|
86
|
+
}, (_cls = {}, _cls[prefixCls + "-cell-without-group"] = !isFromGroup, _cls), (_cls2 = {}, _cls2[prefixCls + "-cell-clickable"] = clickable, _cls2), (_cls3 = {}, _cls3[prefixCls + "-cell-pressed"] = isPressed, _cls3), className),
|
|
59
87
|
style: style,
|
|
60
88
|
ref: domRef,
|
|
61
|
-
onClick:
|
|
62
|
-
|
|
63
|
-
|
|
89
|
+
onClick: handleClick,
|
|
90
|
+
onTouchStart: handleTouchStart,
|
|
91
|
+
onTouchEnd: handleTouchEnd,
|
|
92
|
+
onTouchCancel: handleTouchEnd
|
|
64
93
|
}, prepend, /*#__PURE__*/_react.default.createElement("div", {
|
|
65
94
|
className: (0, _mobileUtils.cls)(prefixCls + "-cell-inner", {
|
|
66
95
|
'has-desc': desc
|