@arco-design/mobile-react 2.29.3 → 2.29.4
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 +14 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/load-more/index.d.ts +6 -0
- package/cjs/load-more/index.js +9 -3
- package/cjs/picker/index.js +2 -9
- package/cjs/picker-view/components/cascader.d.ts +1 -0
- package/cjs/picker-view/components/cascader.js +8 -1
- package/cjs/picker-view/components/picker-cell.d.ts +1 -0
- package/cjs/picker-view/components/picker-cell.js +8 -1
- package/cjs/picker-view/index.js +15 -9
- package/cjs/search-bar/style/css/index.css +2 -0
- package/cjs/search-bar/style/index.less +93 -91
- package/cjs/tabs/index.js +4 -1
- package/dist/index.js +46 -23
- package/dist/index.min.js +2 -2
- package/dist/style.css +2 -0
- package/dist/style.min.css +1 -1
- package/esm/load-more/index.d.ts +6 -0
- package/esm/load-more/index.js +9 -3
- package/esm/picker/index.js +4 -10
- package/esm/picker-view/components/cascader.d.ts +1 -0
- package/esm/picker-view/components/cascader.js +8 -1
- package/esm/picker-view/components/picker-cell.d.ts +1 -0
- package/esm/picker-view/components/picker-cell.js +8 -1
- package/esm/picker-view/index.js +16 -10
- package/esm/search-bar/style/css/index.css +2 -0
- package/esm/search-bar/style/index.less +93 -91
- package/esm/tabs/index.js +4 -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 +24 -0
- package/tokens/app/arcodesign/default/index.less +2 -0
- package/umd/load-more/index.d.ts +6 -0
- package/umd/load-more/index.js +9 -3
- package/umd/picker/index.js +2 -9
- package/umd/picker-view/components/cascader.d.ts +1 -0
- package/umd/picker-view/components/cascader.js +8 -1
- package/umd/picker-view/components/picker-cell.d.ts +1 -0
- package/umd/picker-view/components/picker-cell.js +8 -1
- package/umd/picker-view/index.js +15 -9
- package/umd/search-bar/style/css/index.css +2 -0
- package/umd/search-bar/style/index.less +93 -91
- package/umd/tabs/index.js +4 -1
package/umd/picker-view/index.js
CHANGED
@@ -78,7 +78,6 @@
|
|
78
78
|
var wrapperRef = (0, _react.useRef)(null);
|
79
79
|
var domRef = (0, _react.useRef)(null);
|
80
80
|
var barRef = (0, _react.useRef)(null);
|
81
|
-
var scrollValueRef = (0, _helpers.useLatestRef)(scrollValue);
|
82
81
|
var pickerCellsRef = (0, _react.useRef)([]);
|
83
82
|
var cascaderRef = (0, _react.useRef)(null); // itemStyle height 同时对 selection-bar 生效,这里不单独抛出 selection-bar 的高度设置属性
|
84
83
|
// @en The height of itemStyle applies to the selection-bar as well, without separately exposing the height setting property for the selection-bar.
|
@@ -120,32 +119,39 @@
|
|
120
119
|
}, [data]);
|
121
120
|
|
122
121
|
var getAllColumnValues = function getAllColumnValues() {
|
123
|
-
|
122
|
+
var _cascaderRef$current;
|
123
|
+
|
124
|
+
var curValues = cascade ? ((_cascaderRef$current = cascaderRef.current) == null ? void 0 : _cascaderRef$current.getAllCellsValue()) || [] : pickerCellsRef.current.map(function (cell) {
|
125
|
+
return cell.getCurrentCellValue();
|
126
|
+
}); // 移除级联带来的空列值,理论上非首尾列不会有空值
|
127
|
+
// @en Remove empty values from cascader
|
128
|
+
|
129
|
+
return curValues.filter(function (v) {
|
130
|
+
return v;
|
131
|
+
});
|
124
132
|
};
|
125
133
|
|
126
134
|
function getColumnValue(index) {
|
127
|
-
var _scrollValueRef$curre;
|
128
|
-
|
129
135
|
if (index === void 0) {
|
130
136
|
index = 0;
|
131
137
|
}
|
132
138
|
|
133
|
-
return (
|
139
|
+
return getAllColumnValues()[index];
|
134
140
|
}
|
135
141
|
|
136
142
|
function getCellMovingStatus() {
|
137
|
-
var _cascaderRef$
|
143
|
+
var _cascaderRef$current2;
|
138
144
|
|
139
|
-
return cascade ? ((_cascaderRef$
|
145
|
+
return cascade ? ((_cascaderRef$current2 = cascaderRef.current) == null ? void 0 : _cascaderRef$current2.getCellMovingStatus()) || [] : pickerCellsRef.current.map(function (cell) {
|
140
146
|
return cell.movingStatus;
|
141
147
|
});
|
142
148
|
}
|
143
149
|
|
144
150
|
function scrollToCurrentIndex() {
|
145
151
|
if (cascade) {
|
146
|
-
var _cascaderRef$
|
152
|
+
var _cascaderRef$current3;
|
147
153
|
|
148
|
-
(_cascaderRef$
|
154
|
+
(_cascaderRef$current3 = cascaderRef.current) == null ? void 0 : _cascaderRef$current3.scrollToCurrentIndex();
|
149
155
|
return;
|
150
156
|
}
|
151
157
|
|
@@ -1,112 +1,114 @@
|
|
1
1
|
@import '../../../style/mixin.less';
|
2
2
|
|
3
3
|
.@{prefix}-search-bar {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
}
|
11
|
-
&-square {
|
12
|
-
.@{prefix}-search-bar-wrap {
|
13
|
-
.use-var(border-radius, search-bar-square-shape-border-radius);
|
4
|
+
&-container {
|
5
|
+
display: flex;
|
6
|
+
align-items: center;
|
7
|
+
position: relative;
|
8
|
+
.use-var(padding, search-bar-padding);
|
9
|
+
.use-var(background-color, search-bar-background-color);
|
14
10
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
&-square {
|
12
|
+
.@{prefix}-search-bar-wrap {
|
13
|
+
.use-var(border-radius, search-bar-square-shape-border-radius);
|
14
|
+
}
|
19
15
|
}
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
flex: 1;
|
25
|
-
.use-var(height, search-bar-input-wrapper-height);
|
26
|
-
.use-var(font-size, search-bar-input-wrapper-font-size);
|
27
|
-
.use-var(padding, search-bar-input-wrapper-padding);
|
28
|
-
.use-var(background-color, search-bar-input-wrapper-background-color);
|
29
|
-
}
|
30
|
-
&-input {
|
31
|
-
flex: 1;
|
32
|
-
background-color: transparent;
|
33
|
-
.use-var(height, search-bar-input-height);
|
34
|
-
.use-var(caret-color, search-bar-input-caret-color);
|
35
|
-
&-left {
|
36
|
-
text-align: left;
|
16
|
+
&-round {
|
17
|
+
.@{prefix}-search-bar-wrap {
|
18
|
+
.use-var(border-radius, search-bar-round-shape-border-radius);
|
19
|
+
}
|
37
20
|
}
|
38
|
-
&-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
21
|
+
&-wrap {
|
22
|
+
display: flex;
|
23
|
+
align-items: center;
|
24
|
+
flex: 1;
|
25
|
+
.use-var(height, search-bar-input-wrapper-height);
|
26
|
+
.use-var(font-size, search-bar-input-wrapper-font-size);
|
27
|
+
.use-var(padding, search-bar-input-wrapper-padding);
|
28
|
+
.use-var(background-color, search-bar-input-wrapper-background-color);
|
43
29
|
}
|
30
|
+
&-input {
|
31
|
+
flex: 1;
|
32
|
+
background-color: transparent;
|
33
|
+
.use-var(height, search-bar-input-height);
|
34
|
+
.use-var(caret-color, search-bar-input-caret-color);
|
35
|
+
&-left {
|
36
|
+
text-align: left;
|
37
|
+
}
|
38
|
+
&-right {
|
39
|
+
text-align: right;
|
40
|
+
}
|
41
|
+
&-center {
|
42
|
+
text-align: center;
|
43
|
+
}
|
44
|
+
|
45
|
+
&::placeholder {
|
46
|
+
.use-var(color, search-bar-input-placeholder-color);
|
47
|
+
}
|
44
48
|
|
45
|
-
|
46
|
-
|
49
|
+
&::-webkit-search-decoration,
|
50
|
+
&::-webkit-search-cancel-button {
|
51
|
+
display: none;
|
52
|
+
}
|
47
53
|
}
|
48
54
|
|
49
|
-
|
50
|
-
|
51
|
-
|
55
|
+
&-prefix,
|
56
|
+
&-suffix,
|
57
|
+
&-clear {
|
58
|
+
align-items: center;
|
59
|
+
justify-content: center;
|
60
|
+
display: flex;
|
52
61
|
}
|
53
|
-
}
|
54
62
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
align-items: center;
|
59
|
-
justify-content: center;
|
60
|
-
display: flex;
|
61
|
-
}
|
63
|
+
&-prefix {
|
64
|
+
.use-var(margin-right, search-bar-prefix-margin-right);
|
65
|
+
}
|
62
66
|
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
&-clear {
|
68
|
+
.use-var(color, search-bar-clear-icon-color);
|
69
|
+
.use-var(font-size, search-bar-clear-icon-font-size);
|
70
|
+
.use-var(padding-left, search-bar-clear-icon-padding-left);
|
71
|
+
}
|
66
72
|
|
67
|
-
|
68
|
-
|
69
|
-
|
73
|
+
&-search-icon {
|
74
|
+
.use-var(color, search-bar-search-icon-color);
|
75
|
+
.use-var(font-size, search-bar-search-icon-font-size);
|
76
|
+
}
|
70
77
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
78
|
+
&-cancel-btn {
|
79
|
+
.use-var(margin-left, search-bar-cancel-btn-margin-left);
|
80
|
+
.use-var(color, search-bar-cancel-btn-color);
|
81
|
+
.use-var(font-size, search-bar-cancel-btn-font-size);
|
82
|
+
}
|
75
83
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
84
|
+
&-association {
|
85
|
+
position: absolute;
|
86
|
+
left: 0;
|
87
|
+
right: 0;
|
88
|
+
.use-var(background-color, search-bar-association-background-color);
|
89
|
+
top: 100%;
|
90
|
+
display: none;
|
81
91
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
right: 0;
|
86
|
-
.use-var(background-color, search-bar-association-background-color);
|
87
|
-
top: 100%;
|
88
|
-
display: none;
|
92
|
+
&-visible {
|
93
|
+
display: block;
|
94
|
+
}
|
89
95
|
|
90
|
-
|
91
|
-
|
92
|
-
|
96
|
+
&-item {
|
97
|
+
.use-var(height, search-bar-association-item-height);
|
98
|
+
display: flex;
|
99
|
+
align-items: center;
|
100
|
+
position: relative;
|
101
|
+
.use-var(color, search-bar-association-item-color);
|
102
|
+
.use-var(padding, search-bar-association-item-padding);
|
103
|
+
.use-var(font-size, search-bar-association-item-font-size);
|
93
104
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
align-items: center;
|
98
|
-
position: relative;
|
99
|
-
.use-var(color, search-bar-association-item-color);
|
100
|
-
.use-var(padding, search-bar-association-item-padding);
|
101
|
-
.use-var(font-size, search-bar-association-item-font-size);
|
102
|
-
|
103
|
-
&:not(:last-child) {
|
104
|
-
.onepx-border-var(bottom, line-color);
|
105
|
-
}
|
105
|
+
&:not(:last-child) {
|
106
|
+
.onepx-border-var(bottom, line-color);
|
107
|
+
}
|
106
108
|
|
107
|
-
|
108
|
-
|
109
|
-
|
109
|
+
&-highlight {
|
110
|
+
.use-var(color, search-bar-association-item-highlight-color)
|
111
|
+
}
|
112
|
+
}
|
110
113
|
}
|
111
|
-
|
112
|
-
}
|
114
|
+
}
|
package/umd/tabs/index.js
CHANGED
@@ -197,6 +197,7 @@
|
|
197
197
|
var touchStartXRef = (0, _react.useRef)(0);
|
198
198
|
var touchStartYRef = (0, _react.useRef)(0);
|
199
199
|
var touchStartTimeRef = (0, _react.useRef)(0);
|
200
|
+
var touchMovedRef = (0, _react.useRef)(false);
|
200
201
|
var scrollingRef = (0, _react.useRef)(null);
|
201
202
|
var touchStoppedRef = (0, _react.useRef)(false);
|
202
203
|
var changeFromRef = (0, _react.useRef)('');
|
@@ -290,6 +291,7 @@
|
|
290
291
|
}
|
291
292
|
|
292
293
|
touchStartedRef.current = true;
|
294
|
+
touchMovedRef.current = false;
|
293
295
|
setCellTrans(false);
|
294
296
|
setPaneTrans(false);
|
295
297
|
var evt = e.touches[0];
|
@@ -317,6 +319,7 @@
|
|
317
319
|
return;
|
318
320
|
}
|
319
321
|
|
322
|
+
touchMovedRef.current = true;
|
320
323
|
var evt = e.changedTouches[0];
|
321
324
|
var touchMoveX = evt.clientX || 0;
|
322
325
|
var touchMoveY = evt.clientY || 0; // bugfix: 兼容safari在右滑返回上一页时clientX为负值的情况,安卓有折叠屏,触点会有超出屏幕(clientX < 0)的情况,因此这里限定ios系统
|
@@ -383,7 +386,7 @@
|
|
383
386
|
cellRef.current && cellRef.current.scrollToCenter();
|
384
387
|
}
|
385
388
|
|
386
|
-
if (!touchStartedRef.current || posAdjustingRef.current || scrollingRef.current) {
|
389
|
+
if (!touchStartedRef.current || posAdjustingRef.current || scrollingRef.current || !touchMovedRef.current) {
|
387
390
|
return;
|
388
391
|
}
|
389
392
|
|