@arco-design/mobile-react 2.29.5 → 2.29.6
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 +13 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/image/index.d.ts +7 -7
- package/cjs/image/index.js +81 -61
- package/cjs/image-preview/index.js +6 -2
- package/cjs/image-preview/methods.d.ts +1 -0
- package/cjs/image-preview/methods.js +7 -2
- package/cjs/masking/methods.js +7 -2
- package/cjs/popup-swiper/index.d.ts +2 -8
- package/cjs/tabs/index.js +4 -1
- package/dist/index.js +123 -88
- package/dist/index.min.js +2 -2
- package/esm/image/index.d.ts +7 -7
- package/esm/image/index.js +81 -61
- package/esm/image-preview/index.js +6 -2
- package/esm/image-preview/methods.d.ts +1 -0
- package/esm/image-preview/methods.js +7 -3
- package/esm/masking/methods.js +7 -3
- package/esm/popup-swiper/index.d.ts +2 -8
- package/esm/tabs/index.js +4 -1
- package/package.json +3 -3
- package/umd/image/index.d.ts +7 -7
- package/umd/image/index.js +81 -61
- package/umd/image-preview/index.js +6 -2
- package/umd/image-preview/methods.d.ts +1 -0
- package/umd/image-preview/methods.js +7 -2
- package/umd/masking/methods.js +7 -2
- package/umd/popup-swiper/index.d.ts +2 -8
- package/umd/tabs/index.js +4 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [2.29.6](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.29.5...@arco-design/mobile-react@2.29.6) (2023-10-09)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* `Image` support loading & error area when using "staticLabel" ([#181](https://github.com/arco-design/arco-design-mobile/issues/181)) ([552a37d](https://github.com/arco-design/arco-design-mobile/commit/552a37d5a29cbbbe84107c0ba7cddeb1c685f2be))
|
12
|
+
* `Tabs` duplicate scrolling when "activeTab" is controlled in scroll mode ([7632138](https://github.com/arco-design/arco-design-mobile/commit/7632138f8d1164d8be6b55f5a65cc543b3b22684))
|
13
|
+
* incorrectly mounted elements when calling masking components using methods ([5740648](https://github.com/arco-design/arco-design-mobile/commit/5740648160fb6ff6d97a40da71c28d16034b4346))
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
6
19
|
## [2.29.5](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.29.4...@arco-design/mobile-react@2.29.5) (2023-10-07)
|
7
20
|
|
8
21
|
|
package/README.en-US.md
CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
|
|
59
59
|
React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
|
60
60
|
|
61
61
|
```
|
62
|
-
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.29.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.29.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.29.5/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.29.5/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## Full import
|
package/README.md
CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
|
|
59
59
|
React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
|
60
60
|
|
61
61
|
```
|
62
|
-
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.29.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.29.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.29.5/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.29.5/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
package/cjs/image/index.d.ts
CHANGED
@@ -60,22 +60,22 @@ export interface ImageProps {
|
|
60
60
|
* */
|
61
61
|
bordered?: boolean;
|
62
62
|
/**
|
63
|
-
*
|
63
|
+
* 自定义展示加载中内容
|
64
64
|
* @en Custom display loading content, valid when staticLabel=false
|
65
65
|
* */
|
66
66
|
loadingArea?: ReactNode;
|
67
67
|
/**
|
68
|
-
*
|
68
|
+
* 自定义展示加载失败内容
|
69
69
|
* @en Custom display failed to load content, valid when staticLabel=false
|
70
70
|
* */
|
71
71
|
errorArea?: ReactNode;
|
72
72
|
/**
|
73
|
-
*
|
73
|
+
* 是否展示图片加载中提示
|
74
74
|
* @en Whether to display the image loading prompt, valid when staticLabel=false
|
75
75
|
* */
|
76
76
|
showLoading?: boolean;
|
77
77
|
/**
|
78
|
-
*
|
78
|
+
* 是否展示图片加载失败提示
|
79
79
|
* @en Whether to display the image loading failure prompt, valid when staticLabel=false
|
80
80
|
* */
|
81
81
|
showError?: boolean;
|
@@ -145,17 +145,17 @@ export interface ImageProps {
|
|
145
145
|
* 图片加载完毕时触发的回调
|
146
146
|
* @en Callback when the image is loaded
|
147
147
|
* */
|
148
|
-
onLoad?: (e: Event, image: HTMLImageElement) => void;
|
148
|
+
onLoad?: (e: Event | null, image: HTMLImageElement) => void;
|
149
149
|
/**
|
150
150
|
* 图片加载失败时触发的回调,如果有自动重试则在重试最终失败后触发
|
151
151
|
* @en Callback when the image fails to load, triggered after the retry finally fails if there is an automatic retry
|
152
152
|
*/
|
153
|
-
onError?: (e: string | Event) => void;
|
153
|
+
onError?: (e: string | Event | null) => void;
|
154
154
|
/**
|
155
155
|
* 图片加载失败时自动重试触发的回调
|
156
156
|
* @en Callback triggered by automatic retry when image loading fails
|
157
157
|
*/
|
158
|
-
onAutoRetry?: (e: string | Event) => void;
|
158
|
+
onAutoRetry?: (e: string | Event | null) => void;
|
159
159
|
}
|
160
160
|
export interface ImageRef {
|
161
161
|
/**
|
package/cjs/image/index.js
CHANGED
@@ -30,30 +30,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
30
30
|
* @name_en Image
|
31
31
|
*/
|
32
32
|
var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
33
|
-
var system = (0, _helpers.useSystem)();
|
34
|
-
|
35
|
-
var _useWindowSize = (0, _helpers.useWindowSize)(),
|
36
|
-
windowWidth = _useWindowSize.windowWidth,
|
37
|
-
windowHeight = _useWindowSize.windowHeight;
|
38
|
-
|
39
|
-
var _useMountedState = (0, _helpers.useMountedState)('init'),
|
40
|
-
imageStatus = _useMountedState[0],
|
41
|
-
setImageStatus = _useMountedState[1];
|
42
|
-
|
43
|
-
var _useMountedState2 = (0, _helpers.useMountedState)(''),
|
44
|
-
wrapClass = _useMountedState2[0],
|
45
|
-
setWrapClass = _useMountedState2[1];
|
46
|
-
|
47
|
-
var _useMountedState3 = (0, _helpers.useMountedState)(false),
|
48
|
-
staticRetrying = _useMountedState3[0],
|
49
|
-
setStaticRetrying = _useMountedState3[1];
|
50
|
-
|
51
|
-
var imageRef = (0, _react.useRef)(null);
|
52
|
-
var imageDomRef = (0, _react.useRef)(null);
|
53
|
-
var wrapRef = (0, _react.useRef)(null);
|
54
|
-
var retryCountRef = (0, _react.useRef)(0);
|
55
|
-
var loadingImageRef = (0, _react.useRef)(null);
|
56
|
-
var hasLoadedRef = (0, _react.useRef)(false);
|
57
33
|
var style = props.style,
|
58
34
|
className = props.className,
|
59
35
|
status = props.status,
|
@@ -90,9 +66,33 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
90
66
|
nativeProps = _props$nativeProps === void 0 ? {} : _props$nativeProps,
|
91
67
|
onChange = props.onChange,
|
92
68
|
onClick = props.onClick,
|
93
|
-
|
69
|
+
onLoad = props.onLoad,
|
94
70
|
onError = props.onError,
|
95
71
|
onAutoRetry = props.onAutoRetry;
|
72
|
+
var system = (0, _helpers.useSystem)();
|
73
|
+
|
74
|
+
var _useWindowSize = (0, _helpers.useWindowSize)(),
|
75
|
+
windowWidth = _useWindowSize.windowWidth,
|
76
|
+
windowHeight = _useWindowSize.windowHeight;
|
77
|
+
|
78
|
+
var _useMountedState = (0, _helpers.useMountedState)(staticLabel && showLoading ? 'loading' : 'init'),
|
79
|
+
imageStatus = _useMountedState[0],
|
80
|
+
setImageStatus = _useMountedState[1];
|
81
|
+
|
82
|
+
var _useMountedState2 = (0, _helpers.useMountedState)(''),
|
83
|
+
wrapClass = _useMountedState2[0],
|
84
|
+
setWrapClass = _useMountedState2[1];
|
85
|
+
|
86
|
+
var _useMountedState3 = (0, _helpers.useMountedState)(false),
|
87
|
+
staticRetrying = _useMountedState3[0],
|
88
|
+
setStaticRetrying = _useMountedState3[1];
|
89
|
+
|
90
|
+
var imageRef = (0, _react.useRef)(null);
|
91
|
+
var imageDomRef = (0, _react.useRef)(null);
|
92
|
+
var wrapRef = (0, _react.useRef)(null);
|
93
|
+
var retryCountRef = (0, _react.useRef)(0);
|
94
|
+
var loadingImageRef = (0, _react.useRef)(null);
|
95
|
+
var hasLoadedRef = (0, _react.useRef)(false);
|
96
96
|
var isPreview = Boolean(fit.indexOf('preview') >= 0);
|
97
97
|
var actualBoxWidth = boxWidth || windowWidth;
|
98
98
|
var actualBoxHeight = boxHeight || windowHeight;
|
@@ -128,6 +128,21 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
128
128
|
retryCountRef.current = 0;
|
129
129
|
loadImage();
|
130
130
|
}, [attrs, width, height, showImage, staticLabel]);
|
131
|
+
(0, _react.useEffect)(function () {
|
132
|
+
var _imageDomRef$current;
|
133
|
+
|
134
|
+
// 当使用img标签时,onLoad可能加载完成前已经执行完,此时手动触发一次
|
135
|
+
// @en When using the img tag, onLoad may have been executed before loading is complete, and it needs to be triggered manually
|
136
|
+
if (staticLabel && !hasLoadedRef.current && (_imageDomRef$current = imageDomRef.current) != null && _imageDomRef$current.complete) {
|
137
|
+
// 图片有宽高认为正常加载,否则认为加载错误
|
138
|
+
// @en If the image has width and height, it is considered to be loaded normally, otherwise it is considered to be a loading error
|
139
|
+
if (imageDomRef.current.naturalWidth || imageDomRef.current.naturalHeight) {
|
140
|
+
handleImageLoaded(null, imageDomRef.current);
|
141
|
+
} else {
|
142
|
+
handleStaticImageError(null);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}, [staticLabel]);
|
131
146
|
|
132
147
|
function changeStatus(newStatus) {
|
133
148
|
setImageStatus(newStatus);
|
@@ -148,6 +163,43 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
148
163
|
}
|
149
164
|
}
|
150
165
|
|
166
|
+
function handleImageLoaded(evt, image) {
|
167
|
+
hasLoadedRef.current = true;
|
168
|
+
changeStatus('loaded');
|
169
|
+
var _image$width = image.width,
|
170
|
+
imageWidth = _image$width === void 0 ? 0 : _image$width,
|
171
|
+
_image$height = image.height,
|
172
|
+
imageHeight = _image$height === void 0 ? 0 : _image$height;
|
173
|
+
var extraClass = '';
|
174
|
+
|
175
|
+
if (isPreview) {
|
176
|
+
var scale = imageWidth / imageHeight;
|
177
|
+
var windowScale = actualBoxWidth / actualBoxHeight;
|
178
|
+
|
179
|
+
if (fit === 'preview-y') {
|
180
|
+
if (scale < windowScale) {
|
181
|
+
image.style.width = actualBoxWidth + "px";
|
182
|
+
image.style.height = actualBoxWidth / scale + "px";
|
183
|
+
extraClass = 'preview-overflow-y';
|
184
|
+
} else {
|
185
|
+
extraClass = 'preview-fit-contain-y';
|
186
|
+
}
|
187
|
+
} else if (fit === 'preview-x') {
|
188
|
+
if (scale > windowScale) {
|
189
|
+
image.style.width = actualBoxHeight * scale + "px";
|
190
|
+
image.style.height = actualBoxHeight + "px";
|
191
|
+
extraClass = 'preview-overflow-x';
|
192
|
+
} else {
|
193
|
+
extraClass = 'preview-fit-contain-x';
|
194
|
+
}
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
extraClass && image.classList.add(extraClass);
|
199
|
+
setWrapClass(extraClass ? extraClass + "-container" : '');
|
200
|
+
onLoad && onLoad(evt, image);
|
201
|
+
}
|
202
|
+
|
151
203
|
function loadImage(isFromRetry) {
|
152
204
|
// 如果在加载图片前发现上一个图片还没加载完,则抛弃上一个图片的加载
|
153
205
|
// @en Abort last image before starting loading new image
|
@@ -173,41 +225,8 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
173
225
|
image.onload = function (evt) {
|
174
226
|
loadingImageRef.current = null;
|
175
227
|
imageDomRef.current = image;
|
176
|
-
|
177
|
-
changeStatus('loaded');
|
178
|
-
var _image$width = image.width,
|
179
|
-
imageWidth = _image$width === void 0 ? 0 : _image$width,
|
180
|
-
_image$height = image.height,
|
181
|
-
imageHeight = _image$height === void 0 ? 0 : _image$height;
|
182
|
-
var extraClass = '';
|
183
|
-
|
184
|
-
if (isPreview) {
|
185
|
-
var scale = imageWidth / imageHeight;
|
186
|
-
var windowScale = actualBoxWidth / actualBoxHeight;
|
187
|
-
|
188
|
-
if (fit === 'preview-y') {
|
189
|
-
if (scale < windowScale) {
|
190
|
-
image.style.width = actualBoxWidth + "px";
|
191
|
-
image.style.height = actualBoxWidth / scale + "px";
|
192
|
-
extraClass = 'preview-overflow-y';
|
193
|
-
} else {
|
194
|
-
extraClass = 'preview-fit-contain-y';
|
195
|
-
}
|
196
|
-
} else if (fit === 'preview-x') {
|
197
|
-
if (scale > windowScale) {
|
198
|
-
image.style.width = actualBoxHeight * scale + "px";
|
199
|
-
image.style.height = actualBoxHeight + "px";
|
200
|
-
extraClass = 'preview-overflow-x';
|
201
|
-
} else {
|
202
|
-
extraClass = 'preview-fit-contain-x';
|
203
|
-
}
|
204
|
-
}
|
205
|
-
}
|
206
|
-
|
207
|
-
extraClass && image.classList.add(extraClass);
|
208
|
-
setWrapClass(extraClass ? extraClass + "-container" : '');
|
228
|
+
handleImageLoaded(evt, image);
|
209
229
|
replaceChild(image);
|
210
|
-
_onLoad && _onLoad(evt, image);
|
211
230
|
};
|
212
231
|
|
213
232
|
image.onerror = function (evt) {
|
@@ -233,9 +252,10 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
233
252
|
}
|
234
253
|
|
235
254
|
function handleStaticImageError(e) {
|
236
|
-
var evt = e.nativeEvent;
|
255
|
+
var evt = e ? e.nativeEvent : null;
|
237
256
|
|
238
257
|
if (retryCountRef.current >= retryTime) {
|
258
|
+
changeStatus('error');
|
239
259
|
onError && onError(evt);
|
240
260
|
} else {
|
241
261
|
retryCountRef.current += 1;
|
@@ -300,7 +320,7 @@ var BaseImage = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
300
320
|
}, staticLabel && showImage && !staticRetrying ? /*#__PURE__*/_react.default.createElement("img", (0, _extends2.default)({}, nativeProps, attrs, {
|
301
321
|
ref: imageDomRef,
|
302
322
|
onLoad: function onLoad(e) {
|
303
|
-
return
|
323
|
+
return handleImageLoaded(e.nativeEvent, imageDomRef.current);
|
304
324
|
},
|
305
325
|
onError: handleStaticImageError
|
306
326
|
})) : null), showLoading && validStatus === 'loading' ? /*#__PURE__*/_react.default.createElement("div", {
|
@@ -849,7 +849,9 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
849
849
|
return renderIndicator(currentIndex, total, lastIndex);
|
850
850
|
}
|
851
851
|
|
852
|
-
return openLoaded ? /*#__PURE__*/_react.default.createElement(_portal.default,
|
852
|
+
return openLoaded ? /*#__PURE__*/_react.default.createElement(_portal.default, {
|
853
|
+
getContainer: getContainer
|
854
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
853
855
|
className: "image-preview-indicator"
|
854
856
|
}, currentIndex + 1, "/", total)) : null;
|
855
857
|
} // ios在重设style时图片会消失一下造成闪动,因此在底下垫一张图
|
@@ -887,7 +889,9 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
887
889
|
function renderLoadingArea(index) {
|
888
890
|
// loadingArea提出来,放到过渡图上层
|
889
891
|
// @en The loadingArea is extracted and placed on the upper layer of the transition image
|
890
|
-
return index === openIndex ? /*#__PURE__*/_react.default.createElement(_portal.default,
|
892
|
+
return index === openIndex ? /*#__PURE__*/_react.default.createElement(_portal.default, {
|
893
|
+
getContainer: getContainer
|
894
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
891
895
|
className: "image-preview-loading-area"
|
892
896
|
}, loadingArea || /*#__PURE__*/_react.default.createElement(_loading.default, {
|
893
897
|
type: "circle",
|
@@ -5,6 +5,7 @@ export interface OpenBaseProps {
|
|
5
5
|
close: (e: any) => void;
|
6
6
|
openIndex: number;
|
7
7
|
images: any[];
|
8
|
+
getContainer?: () => HTMLElement;
|
8
9
|
}
|
9
10
|
export declare function open<P extends OpenBaseProps>(Component: React.FunctionComponent<P>): (config: Pick<P, Exclude<keyof P, "close">>, context?: GlobalContextParams | undefined) => {
|
10
11
|
close: () => void;
|
@@ -17,8 +17,7 @@ function open(Component) {
|
|
17
17
|
unmountOnExit: true
|
18
18
|
}, config || {}, {
|
19
19
|
close: function close() {}
|
20
|
-
});
|
21
|
-
var dynamicProps = (0, _extends2.default)({}, baseProps); // 不同的key用不同的容器挂载
|
20
|
+
}); // 不同的key用不同的容器挂载
|
22
21
|
// @en Different keys are mounted in different containers
|
23
22
|
|
24
23
|
var id = "_ARCO_IMAGE_PREVIEW_DIV_" + (baseProps.key || '') + "_";
|
@@ -31,6 +30,12 @@ function open(Component) {
|
|
31
30
|
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
32
31
|
render = _ReactDOMRender.render;
|
33
32
|
|
33
|
+
var dynamicProps = (0, _extends2.default)({}, baseProps, {
|
34
|
+
getContainer: function getContainer() {
|
35
|
+
return div;
|
36
|
+
}
|
37
|
+
});
|
38
|
+
|
34
39
|
function update(newConfig) {
|
35
40
|
dynamicProps = (0, _extends2.default)({}, dynamicProps, newConfig || {});
|
36
41
|
render(dynamicProps);
|
package/cjs/masking/methods.js
CHANGED
@@ -25,8 +25,7 @@ function getOpenMethod(Component, containerId, normalize) {
|
|
25
25
|
}, normalize(config), {
|
26
26
|
visible: false,
|
27
27
|
close: function close() {}
|
28
|
-
});
|
29
|
-
var dynamicProps = (0, _extends2.default)({}, baseProps); // 不同的key用不同的容器挂载
|
28
|
+
}); // 不同的key用不同的容器挂载
|
30
29
|
|
31
30
|
var id = "_" + (containerId || 'ARCO_MASKING') + "_DIV_" + (config.key || '') + "_";
|
32
31
|
|
@@ -38,6 +37,12 @@ function getOpenMethod(Component, containerId, normalize) {
|
|
38
37
|
var _ReactDOMRender = new _render.ReactDOMRender(Component, div, context),
|
39
38
|
render = _ReactDOMRender.render;
|
40
39
|
|
40
|
+
var dynamicProps = (0, _extends2.default)({}, baseProps, {
|
41
|
+
getContainer: function getContainer() {
|
42
|
+
return div;
|
43
|
+
}
|
44
|
+
});
|
45
|
+
|
41
46
|
function update(newConfig) {
|
42
47
|
dynamicProps = (0, _extends2.default)({}, dynamicProps, normalize(newConfig));
|
43
48
|
render(dynamicProps);
|
@@ -63,10 +63,7 @@ export declare function methodsGenerator<P extends OpenBaseProps>(Comp: React.Fu
|
|
63
63
|
close: () => void;
|
64
64
|
update: (newConfig: Pick<P, Exclude<keyof P, "visible" | "close">> & {
|
65
65
|
key?: string | undefined;
|
66
|
-
}) => void;
|
67
|
-
* 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
|
68
|
-
* @en The touchstart callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component
|
69
|
-
*/
|
66
|
+
}) => void;
|
70
67
|
};
|
71
68
|
};
|
72
69
|
declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>> & {
|
@@ -82,10 +79,7 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
|
|
82
79
|
close: () => void;
|
83
80
|
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "initialBodyOverflow" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
|
84
81
|
key?: string | undefined;
|
85
|
-
}) => void;
|
86
|
-
* 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
|
87
|
-
* @en The touchstart callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component
|
88
|
-
*/
|
82
|
+
}) => void;
|
89
83
|
};
|
90
84
|
};
|
91
85
|
/**
|
package/cjs/tabs/index.js
CHANGED
@@ -255,7 +255,10 @@ var Tabs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
255
255
|
// 利用受控手动更改index时,给cell line加上动画
|
256
256
|
// @en Animate the cell line when changeing the index
|
257
257
|
setCellTrans(true);
|
258
|
-
|
258
|
+
|
259
|
+
if (!changeFromRef.current) {
|
260
|
+
changeFromRef.current = 'manual';
|
261
|
+
}
|
259
262
|
}, [activeTab]);
|
260
263
|
(0, _helpers.useUpdateEffect)(function () {
|
261
264
|
onDistanceChange && onDistanceChange(distance, wrapWidth, activeIndex);
|