@arco-design/mobile-react 2.29.3 → 2.29.5
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 +29 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/action-sheet/index.d.ts +2 -2
- package/cjs/dialog/index.d.ts +2 -2
- package/cjs/image-picker/index.js +14 -6
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/image-preview/index.js +5 -3
- package/cjs/index.d.ts +5 -5
- package/cjs/index.js +16 -16
- package/cjs/load-more/index.d.ts +11 -0
- package/cjs/load-more/index.js +18 -4
- package/cjs/masking/index.d.ts +2 -2
- 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/popup/index.d.ts +2 -2
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/pull-refresh/android-pull-refresh.js +12 -20
- package/cjs/pull-refresh/hooks.js +2 -2
- package/cjs/pull-refresh/style/css/index.css +0 -1
- package/cjs/pull-refresh/style/index.less +0 -1
- package/cjs/search-bar/style/css/index.css +2 -0
- package/cjs/search-bar/style/index.less +93 -91
- package/cjs/style.d.ts +5 -5
- package/cjs/style.js +8 -8
- package/cjs/tabs/index.js +4 -1
- package/cjs/tabs/tab-pane.js +5 -2
- package/cjs/toast/index.d.ts +12 -12
- package/dist/index.js +2454 -2419
- package/dist/index.min.js +5 -5
- package/dist/style.css +505 -504
- package/dist/style.min.css +1 -1
- package/esm/action-sheet/index.d.ts +2 -2
- package/esm/dialog/index.d.ts +2 -2
- package/esm/image-picker/index.js +13 -6
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/image-preview/index.js +5 -3
- package/esm/index.d.ts +5 -5
- package/esm/index.js +5 -5
- package/esm/load-more/index.d.ts +11 -0
- package/esm/load-more/index.js +18 -4
- package/esm/masking/index.d.ts +2 -2
- 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/popup/index.d.ts +2 -2
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/pull-refresh/android-pull-refresh.js +13 -22
- package/esm/pull-refresh/hooks.js +2 -2
- package/esm/pull-refresh/style/css/index.css +0 -1
- package/esm/pull-refresh/style/index.less +0 -1
- package/esm/search-bar/style/css/index.css +2 -0
- package/esm/search-bar/style/index.less +93 -91
- package/esm/style.d.ts +5 -5
- package/esm/style.js +5 -5
- package/esm/tabs/index.js +4 -1
- package/esm/tabs/tab-pane.js +6 -3
- package/esm/toast/index.d.ts +12 -12
- 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/action-sheet/index.d.ts +2 -2
- package/umd/dialog/index.d.ts +2 -2
- package/umd/image-picker/index.js +16 -10
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/image-preview/index.js +5 -3
- package/umd/index.d.ts +5 -5
- package/umd/index.js +14 -14
- package/umd/load-more/index.d.ts +11 -0
- package/umd/load-more/index.js +18 -4
- package/umd/masking/index.d.ts +2 -2
- 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/popup/index.d.ts +2 -2
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/pull-refresh/android-pull-refresh.js +15 -24
- package/umd/pull-refresh/hooks.js +2 -2
- package/umd/pull-refresh/style/css/index.css +0 -1
- package/umd/pull-refresh/style/index.less +0 -1
- package/umd/search-bar/style/css/index.css +2 -0
- package/umd/search-bar/style/index.less +93 -91
- package/umd/style.d.ts +5 -5
- package/umd/style.js +2 -2
- package/umd/tabs/index.js +4 -1
- package/umd/tabs/tab-pane.js +5 -2
- package/umd/toast/index.d.ts +12 -12
@@ -1,22 +1,23 @@
|
|
1
1
|
(function (global, factory) {
|
2
2
|
if (typeof define === "function" && define.amd) {
|
3
|
-
define(["exports", "react", "@arco-design/mobile-utils", "../loading", "../context-provider", "./model", "./hooks", "../_helpers"], factory);
|
3
|
+
define(["exports", "@babel/runtime/helpers/extends", "react", "@arco-design/mobile-utils", "../loading", "../context-provider", "./model", "./hooks", "../_helpers"], factory);
|
4
4
|
} else if (typeof exports !== "undefined") {
|
5
|
-
factory(exports, require("react"), require("@arco-design/mobile-utils"), require("../loading"), require("../context-provider"), require("./model"), require("./hooks"), require("../_helpers"));
|
5
|
+
factory(exports, require("@babel/runtime/helpers/extends"), require("react"), require("@arco-design/mobile-utils"), require("../loading"), require("../context-provider"), require("./model"), require("./hooks"), require("../_helpers"));
|
6
6
|
} else {
|
7
7
|
var mod = {
|
8
8
|
exports: {}
|
9
9
|
};
|
10
|
-
factory(mod.exports, global.react, global.mobileUtils, global.loading, global.contextProvider, global.model, global.hooks, global._helpers);
|
10
|
+
factory(mod.exports, global._extends, global.react, global.mobileUtils, global.loading, global.contextProvider, global.model, global.hooks, global._helpers);
|
11
11
|
global.androidPullRefresh = mod.exports;
|
12
12
|
}
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _mobileUtils, _loading, _contextProvider, _model, _hooks, _helpers) {
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _extends2, _react, _mobileUtils, _loading, _contextProvider, _model, _hooks, _helpers) {
|
14
14
|
"use strict";
|
15
15
|
|
16
16
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
17
17
|
|
18
18
|
_exports.__esModule = true;
|
19
19
|
_exports.PullRefresh = void 0;
|
20
|
+
_extends2 = _interopRequireDefault(_extends2);
|
20
21
|
_react = _interopRequireWildcard(_react);
|
21
22
|
_loading = _interopRequireDefault(_loading);
|
22
23
|
|
@@ -71,11 +72,7 @@
|
|
71
72
|
onRefresh = props.onRefresh,
|
72
73
|
_props$allowPullWhenN = props.allowPullWhenNotTop,
|
73
74
|
allowPullWhenNotTop = _props$allowPullWhenN === void 0 ? false : _props$allowPullWhenN;
|
74
|
-
|
75
|
-
var _useState = (0, _react.useState)({}),
|
76
|
-
transition = _useState[0],
|
77
|
-
setTransition = _useState[1];
|
78
|
-
|
75
|
+
var placeRef = (0, _react.useRef)(null);
|
79
76
|
var touchRef = (0, _react.useRef)(null);
|
80
77
|
var currentTranslateYRef = (0, _react.useRef)(0);
|
81
78
|
var onTouching = (0, _react.useRef)(false);
|
@@ -112,17 +109,7 @@
|
|
112
109
|
|
113
110
|
var scroll = function scroll(y, ms, callback) {
|
114
111
|
if (y < 5) {
|
115
|
-
if (y < 0) {
|
116
|
-
currentTranslateYRef.current = 0;
|
117
|
-
return;
|
118
|
-
}
|
119
|
-
|
120
|
-
if (ms === 0) {
|
121
|
-
setTimeout(function () {
|
122
|
-
setTransition({
|
123
|
-
transition: 'all 0s'
|
124
|
-
});
|
125
|
-
});
|
112
|
+
if (y < 0 || ms === 0) {
|
126
113
|
currentTranslateYRef.current = 0;
|
127
114
|
return;
|
128
115
|
}
|
@@ -130,10 +117,11 @@
|
|
130
117
|
|
131
118
|
var translateY = dampRateCalculate(y, loosingHeight, dampRate);
|
132
119
|
currentTranslateYRef.current = translateY;
|
133
|
-
|
134
|
-
transform: translateY ? "translateY(" + translateY + "px)" : ''
|
120
|
+
placeRef.current && (0, _helpers.setStyleWithVendor)(placeRef.current, (0, _extends2.default)({
|
121
|
+
transform: translateY ? "translateY(" + translateY + "px) translateZ(0)" : ''
|
122
|
+
}, ms ? {
|
135
123
|
transition: "all " + ms / 1000 + "s"
|
136
|
-
});
|
124
|
+
} : {}));
|
137
125
|
setTimeout(function () {
|
138
126
|
callback == null ? void 0 : callback();
|
139
127
|
}, ms);
|
@@ -151,6 +139,9 @@
|
|
151
139
|
|
152
140
|
loadingRef.current = false;
|
153
141
|
setStatus(_model.PullRefreshStatus.Static);
|
142
|
+
placeRef.current && (0, _helpers.setStyleWithVendor)(placeRef.current, {
|
143
|
+
transition: ''
|
144
|
+
});
|
154
145
|
callback();
|
155
146
|
});
|
156
147
|
};
|
@@ -278,7 +269,7 @@
|
|
278
269
|
ref: domRef
|
279
270
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
280
271
|
className: (0, _mobileUtils.cls)(prefixCls + "-pull-refresh-place"),
|
281
|
-
|
272
|
+
ref: placeRef
|
282
273
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
283
274
|
className: (0, _mobileUtils.cls)(prefixCls + "-pull-refresh-label"),
|
284
275
|
ref: labelRef,
|
@@ -117,9 +117,9 @@
|
|
117
117
|
var allowPullWhenNotTop = _ref3.allowPullWhenNotTop,
|
118
118
|
domRef = _ref3.domRef;
|
119
119
|
var ifShouldHandle = (0, _react.useCallback)(function () {
|
120
|
-
var _domRef$current$
|
120
|
+
var _domRef$current$offse, _domRef$current9;
|
121
121
|
|
122
|
-
var domRefHeight = (_domRef$current$
|
122
|
+
var domRefHeight = (_domRef$current$offse = (_domRef$current9 = domRef.current) == null ? void 0 : _domRef$current9.offsetHeight) != null ? _domRef$current$offse : 0;
|
123
123
|
return domRef.current && !(!allowPullWhenNotTop && (domRef.current.scrollTop < 0 || domRef.current.scrollTop > domRef.current.scrollHeight - domRefHeight));
|
124
124
|
}, [allowPullWhenNotTop]);
|
125
125
|
return {
|
@@ -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/style.d.ts
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
import '../style/public.less';
|
2
2
|
import './tabs/style';
|
3
3
|
import './sticky/style';
|
4
|
-
import './
|
5
|
-
import './
|
4
|
+
import './portal/style';
|
5
|
+
import './toast/style';
|
6
6
|
import './action-sheet/style';
|
7
7
|
import './avatar/style';
|
8
8
|
import './badge/style';
|
9
9
|
import './button/style';
|
10
10
|
import './carousel/style';
|
11
|
+
import './cell/style';
|
11
12
|
import './checkbox/style';
|
12
13
|
import './circle-progress/style';
|
13
14
|
import './collapse/style';
|
@@ -27,6 +28,7 @@ import './image-preview/style';
|
|
27
28
|
import './index-bar/style';
|
28
29
|
import './input/style';
|
29
30
|
import './keyboard/style';
|
31
|
+
import './load-more/style';
|
30
32
|
import './loading/style';
|
31
33
|
import './masking/style';
|
32
34
|
import './nav-bar/style';
|
@@ -38,14 +40,13 @@ import './picker-view/style';
|
|
38
40
|
import './popover/style';
|
39
41
|
import './popup/style';
|
40
42
|
import './popup-swiper/style';
|
41
|
-
import './portal/style';
|
42
43
|
import './progress/style';
|
43
44
|
import './pull-refresh/style';
|
44
45
|
import './radio/style';
|
45
46
|
import './rate/style';
|
46
47
|
import './search-bar/style';
|
47
|
-
import './skeleton/style';
|
48
48
|
import './show-monitor/style';
|
49
|
+
import './skeleton/style';
|
49
50
|
import './slider/style';
|
50
51
|
import './stepper/style';
|
51
52
|
import './steps/style';
|
@@ -55,5 +56,4 @@ import './switch/style';
|
|
55
56
|
import './tab-bar/style';
|
56
57
|
import './tag/style';
|
57
58
|
import './textarea/style';
|
58
|
-
import './toast/style';
|
59
59
|
import './transition/style';
|
package/umd/style.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
(function (global, factory) {
|
2
2
|
if (typeof define === "function" && define.amd) {
|
3
|
-
define(["../style/public.less", "./tabs/style", "./sticky/style", "./
|
3
|
+
define(["../style/public.less", "./tabs/style", "./sticky/style", "./portal/style", "./toast/style", "./action-sheet/style", "./avatar/style", "./badge/style", "./button/style", "./carousel/style", "./cell/style", "./checkbox/style", "./circle-progress/style", "./collapse/style", "./context-provider/style", "./count-down/style", "./date-picker/style", "./dialog/style", "./divider/style", "./dropdown/style", "./dropdown-menu/style", "./ellipsis/style", "./form/style", "./grid/style", "./image/style", "./image-picker/style", "./image-preview/style", "./index-bar/style", "./input/style", "./keyboard/style", "./load-more/style", "./loading/style", "./masking/style", "./nav-bar/style", "./notice-bar/style", "./notify/style", "./pagination/style", "./picker/style", "./picker-view/style", "./popover/style", "./popup/style", "./popup-swiper/style", "./progress/style", "./pull-refresh/style", "./radio/style", "./rate/style", "./search-bar/style", "./show-monitor/style", "./skeleton/style", "./slider/style", "./stepper/style", "./steps/style", "./swipe-action/style", "./swipe-load/style", "./switch/style", "./tab-bar/style", "./tag/style", "./textarea/style", "./transition/style"], factory);
|
4
4
|
} else if (typeof exports !== "undefined") {
|
5
|
-
factory(require("../style/public.less"), require("./tabs/style"), require("./sticky/style"), require("./
|
5
|
+
factory(require("../style/public.less"), require("./tabs/style"), require("./sticky/style"), require("./portal/style"), require("./toast/style"), require("./action-sheet/style"), require("./avatar/style"), require("./badge/style"), require("./button/style"), require("./carousel/style"), require("./cell/style"), require("./checkbox/style"), require("./circle-progress/style"), require("./collapse/style"), require("./context-provider/style"), require("./count-down/style"), require("./date-picker/style"), require("./dialog/style"), require("./divider/style"), require("./dropdown/style"), require("./dropdown-menu/style"), require("./ellipsis/style"), require("./form/style"), require("./grid/style"), require("./image/style"), require("./image-picker/style"), require("./image-preview/style"), require("./index-bar/style"), require("./input/style"), require("./keyboard/style"), require("./load-more/style"), require("./loading/style"), require("./masking/style"), require("./nav-bar/style"), require("./notice-bar/style"), require("./notify/style"), require("./pagination/style"), require("./picker/style"), require("./picker-view/style"), require("./popover/style"), require("./popup/style"), require("./popup-swiper/style"), require("./progress/style"), require("./pull-refresh/style"), require("./radio/style"), require("./rate/style"), require("./search-bar/style"), require("./show-monitor/style"), require("./skeleton/style"), require("./slider/style"), require("./stepper/style"), require("./steps/style"), require("./swipe-action/style"), require("./swipe-load/style"), require("./switch/style"), require("./tab-bar/style"), require("./tag/style"), require("./textarea/style"), require("./transition/style"));
|
6
6
|
} else {
|
7
7
|
var mod = {
|
8
8
|
exports: {}
|
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
|
|
package/umd/tabs/tab-pane.js
CHANGED
@@ -256,12 +256,15 @@
|
|
256
256
|
}
|
257
257
|
|
258
258
|
var translateStr = translateZ ? ' translateZ(0)' : '';
|
259
|
+
var translatePercentInSSR = (panes.length ? 100 / panes.length : 0) * activeIndex * rtlRatio * -1 + "%";
|
260
|
+
var verticalTranslate = distance - wrapWidth * activeIndex * rtlRatio + "px";
|
261
|
+
var horizontalTranslate = distance - wrapHeight * activeIndex + "px";
|
259
262
|
var sizeStyle = tabDirection === 'vertical' ? {
|
260
263
|
width: 100 * panes.length + "%",
|
261
|
-
transform: "translateX(" + (
|
264
|
+
transform: "translateX(" + ((0, _mobileUtils.isSSR)() ? translatePercentInSSR : verticalTranslate) + ")" + translateStr
|
262
265
|
} : {
|
263
266
|
height: 100 * panes.length + "%",
|
264
|
-
transform: "translateY(" + (
|
267
|
+
transform: "translateY(" + ((0, _mobileUtils.isSSR)() ? translatePercentInSSR : horizontalTranslate) + ")" + translateStr
|
265
268
|
};
|
266
269
|
var heightStyle = currentPaneHeight && currentPaneHeight !== 'auto' ? {
|
267
270
|
height: currentPaneHeight
|
package/umd/toast/index.d.ts
CHANGED
@@ -185,8 +185,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
185
185
|
* @param {string | ToastProps} config Configuration
|
186
186
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
187
187
|
*/
|
188
|
-
toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
189
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
188
|
+
toast: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
189
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">) => void;
|
190
190
|
close: () => void;
|
191
191
|
hide: () => void;
|
192
192
|
};
|
@@ -196,8 +196,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
196
196
|
* @param {string | ToastProps} config Configuration
|
197
197
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
198
198
|
*/
|
199
|
-
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
200
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
199
|
+
info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
200
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">) => void;
|
201
201
|
close: () => void;
|
202
202
|
hide: () => void;
|
203
203
|
};
|
@@ -207,8 +207,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
207
207
|
* @param {string | ToastProps} config Configuration
|
208
208
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
209
209
|
*/
|
210
|
-
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
211
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
210
|
+
success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
211
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">) => void;
|
212
212
|
close: () => void;
|
213
213
|
hide: () => void;
|
214
214
|
};
|
@@ -218,8 +218,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
218
218
|
* @param {string | ToastProps} config Configuration
|
219
219
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
220
220
|
*/
|
221
|
-
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
222
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
221
|
+
error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
222
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">) => void;
|
223
223
|
close: () => void;
|
224
224
|
hide: () => void;
|
225
225
|
};
|
@@ -229,8 +229,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
229
229
|
* @param {string | ToastProps} config Configuration
|
230
230
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
231
231
|
*/
|
232
|
-
loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
233
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
232
|
+
loading: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
233
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">) => void;
|
234
234
|
close: () => void;
|
235
235
|
hide: () => void;
|
236
236
|
};
|
@@ -240,8 +240,8 @@ declare const _default: React.ForwardRefExoticComponent<ToastProps & React.RefAt
|
|
240
240
|
* @param {string | ToastProps} config Configuration
|
241
241
|
* @returns {{ update: (config: ToastProps) => void; close: () => void }}
|
242
242
|
*/
|
243
|
-
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
244
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "
|
243
|
+
warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
244
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ToastProps & React.RefAttributes<ToastRef>>, "loading" | "content" | "layout" | "icon" | "direction" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose" | "loadingIcon" | "loadingInner" | "disableBodyTouch" | "typeIconMap" | "initialBodyOverflow">) => void;
|
245
245
|
close: () => void;
|
246
246
|
hide: () => void;
|
247
247
|
};
|