@arco-design/mobile-react 2.29.2 → 2.29.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 +13 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/image-preview/index.d.ts +7 -2
- package/cjs/image-preview/index.js +9 -17
- package/cjs/picker-view/components/picker-cell.js +4 -4
- package/cjs/picker-view/index.js +10 -2
- package/cjs/popover/menu.js +3 -1
- package/dist/index.js +25 -25
- package/dist/index.min.js +3 -3
- package/esm/image-preview/index.d.ts +7 -2
- package/esm/image-preview/index.js +9 -17
- package/esm/picker-view/components/picker-cell.js +4 -4
- package/esm/picker-view/index.js +10 -2
- package/esm/popover/menu.js +3 -2
- package/package.json +3 -3
- package/umd/image-preview/index.d.ts +7 -2
- package/umd/image-preview/index.js +9 -17
- package/umd/picker-view/components/picker-cell.js +4 -4
- package/umd/picker-view/index.js +10 -2
- package/umd/popover/menu.js +5 -5
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.3](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.29.2...@arco-design/mobile-react@2.29.3) (2023-09-12)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* `ImagePreview` remove duplicate setTimeout for double-click judgment ([0a5565b](https://github.com/arco-design/arco-design-mobile/commit/0a5565bf06c5d5737d730a59227dd239feaf50d1))
|
12
|
+
* `PickerView` adjust animation duration ([#164](https://github.com/arco-design/arco-design-mobile/issues/164)) ([6c7f020](https://github.com/arco-design/arco-design-mobile/commit/6c7f020baeb8b2a7ba00d08bf9feaf8f8ebcca3f))
|
13
|
+
* `Popover` fix the problem that popover.menu does not show when defaultVisible=true ([b9c7397](https://github.com/arco-design/arco-design-mobile/commit/b9c73975f4333482152b207bb6bee8dfd7f0b7e3))
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
6
19
|
## [2.29.2](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.29.1...@arco-design/mobile-react@2.29.2) (2023-08-28)
|
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.2/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.29.2/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.2/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.29.2/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
@@ -139,6 +139,11 @@ export interface ImagePreviewProps extends Pick<CarouselProps, 'animateDurationS
|
|
139
139
|
* @default "start"
|
140
140
|
*/
|
141
141
|
indicatorPos?: CarouselProps['indicatorPos'];
|
142
|
+
/**
|
143
|
+
* 渲染自定义元素,如自定义关闭按钮
|
144
|
+
* @en Render custom elements such as custom close buttons
|
145
|
+
*/
|
146
|
+
extra?: ReactNode;
|
142
147
|
/**
|
143
148
|
* 图片捏合时最小缩放倍数,松手后仍会恢复到1的状态,默认为0.7
|
144
149
|
* @en The minimum zoom factor when the image is pinched, it will still return to the state of 1 after letting go, the default is 0.7
|
@@ -269,9 +274,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
269
274
|
* @param {ImagePreviewProps} config configuration
|
270
275
|
* @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
|
271
276
|
*/
|
272
|
-
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
277
|
+
open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
|
273
278
|
close: () => void;
|
274
|
-
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
279
|
+
update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "extra" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
|
275
280
|
};
|
276
281
|
};
|
277
282
|
/**
|
@@ -42,7 +42,7 @@ Object.keys(_methods).forEach(function (key) {
|
|
42
42
|
|
43
43
|
var _loading = _interopRequireDefault(require("../loading"));
|
44
44
|
|
45
|
-
var _excluded = ["style", "className", "images", "loop", "openIndex", "fit", "noselect", "displayDuration", "spaceBetween", "showLoading", "loadingArea", "errorArea", "showError", "retryTime", "staticLabel", "replaceFallbackWhenLoaded", "scrollBezier", "lazyloadCount", "swipeToClose", "getMinScale", "getMaxScale", "getDoubleClickScale", "getContainer", "getThumbBounds", "renderIndicator", "onChange", "onAfterChange", "onImageClick", "onImageDoubleClick", "onImageLongTap", "close", "onClose", "onTouchStart", "onTouchMove", "onTouchEnd", "indicatorPos"];
|
45
|
+
var _excluded = ["style", "className", "images", "loop", "openIndex", "fit", "noselect", "displayDuration", "spaceBetween", "showLoading", "loadingArea", "errorArea", "showError", "retryTime", "staticLabel", "replaceFallbackWhenLoaded", "scrollBezier", "lazyloadCount", "swipeToClose", "extra", "getMinScale", "getMaxScale", "getDoubleClickScale", "getContainer", "getThumbBounds", "renderIndicator", "onChange", "onAfterChange", "onImageClick", "onImageDoubleClick", "onImageLongTap", "close", "onClose", "onTouchStart", "onTouchMove", "onTouchEnd", "indicatorPos"];
|
46
46
|
|
47
47
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
48
48
|
|
@@ -80,6 +80,7 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
80
80
|
lazyloadCount = _props$lazyloadCount === void 0 ? 1 : _props$lazyloadCount,
|
81
81
|
_props$swipeToClose = props.swipeToClose,
|
82
82
|
swipeToClose = _props$swipeToClose === void 0 ? true : _props$swipeToClose,
|
83
|
+
extra = props.extra,
|
83
84
|
getMinScale = props.getMinScale,
|
84
85
|
getMaxScale = props.getMaxScale,
|
85
86
|
getDoubleClickScale = props.getDoubleClickScale,
|
@@ -104,7 +105,6 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
104
105
|
var imagesRef = (0, _react.useRef)([]);
|
105
106
|
var carouselRef = (0, _react.useRef)(null);
|
106
107
|
var transformersRef = (0, _react.useRef)([]);
|
107
|
-
var dblTimerRef = (0, _react.useRef)(null);
|
108
108
|
var longTimerRef = (0, _react.useRef)(null);
|
109
109
|
var transImageRef = (0, _react.useRef)(null);
|
110
110
|
var imageDomsRef = (0, _react.useRef)([]);
|
@@ -588,17 +588,15 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
588
588
|
function handleImageClick(e) {
|
589
589
|
if (movedRef.current) {
|
590
590
|
return;
|
591
|
-
} //
|
592
|
-
// @en
|
591
|
+
} // 如果正在触发doubleClick就不触发click
|
592
|
+
// @en If doubleClick is being triggered, click will not be triggered
|
593
593
|
|
594
594
|
|
595
|
-
|
596
|
-
if (!
|
597
|
-
|
598
|
-
goClose(e);
|
599
|
-
}
|
595
|
+
if (!dblClickingRef.current) {
|
596
|
+
if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
|
597
|
+
goClose(e);
|
600
598
|
}
|
601
|
-
}
|
599
|
+
}
|
602
600
|
}
|
603
601
|
|
604
602
|
function handleImageDoubleClick(e) {
|
@@ -608,12 +606,6 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
608
606
|
}
|
609
607
|
|
610
608
|
dblClickingRef.current = true;
|
611
|
-
|
612
|
-
if (dblTimerRef.current) {
|
613
|
-
clearTimeout(dblTimerRef.current);
|
614
|
-
dblTimerRef.current = null;
|
615
|
-
}
|
616
|
-
|
617
609
|
var index = innerIndexRef.current;
|
618
610
|
onImageDoubleClick && onImageDoubleClick(index, e); // 双击时根据配置放大或缩小
|
619
611
|
// @en Zoom in or out according to configuration when double-clicking
|
@@ -1007,7 +999,7 @@ var ImagePreview = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
1007
999
|
onLoad: transImageInfo.onLoad,
|
1008
1000
|
onError: transImageInfo.onError
|
1009
1001
|
};
|
1010
|
-
})) : null)), transImageInfo ? /*#__PURE__*/_react.default.createElement("div", {
|
1002
|
+
})) : null, extra)), transImageInfo ? /*#__PURE__*/_react.default.createElement("div", {
|
1011
1003
|
className: "image-preview-lock-modal",
|
1012
1004
|
onClick: goClose
|
1013
1005
|
}) : null);
|
@@ -208,9 +208,9 @@ var PickerCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
208
208
|
|
209
209
|
function momentum(current, start, duration, minY, maxY) {
|
210
210
|
var durationMap = {
|
211
|
-
noBounce:
|
212
|
-
weekBounce:
|
213
|
-
strongBounce:
|
211
|
+
noBounce: 400,
|
212
|
+
weekBounce: 100,
|
213
|
+
strongBounce: 75
|
214
214
|
};
|
215
215
|
var bezierMap = {
|
216
216
|
noBounce: 'cubic-bezier(.17, .89, .45, 1)',
|
@@ -269,7 +269,7 @@ var PickerCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
269
269
|
var absDistY = Math.abs(transformY - lastTransformY); // 计算动量,保证滚动顺畅,条件:手势时间小于300ms && 移动距离绝对值大于30时
|
270
270
|
// @en Calculate the momentum to ensure smooth scrolling, condition: the gesture time is less than 300ms && the absolute value of the moving distance is greater than 30
|
271
271
|
|
272
|
-
if (duration < 300 && absDistY >
|
272
|
+
if (duration < 300 && absDistY > 90) {
|
273
273
|
var momentumY = momentum(transformY, lastTransformY, duration, wrapperHeight - scrollerHeight, 0);
|
274
274
|
var newItemIndex = Math.max(0, Math.min(data.length - 1, Math.round(-1 * momentumY.destination / itemHeight)));
|
275
275
|
setBezier(momentumY.bezier);
|
package/cjs/picker-view/index.js
CHANGED
@@ -84,7 +84,14 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
84
84
|
var barRef = (0, _react.useRef)(null);
|
85
85
|
var scrollValueRef = (0, _helpers.useLatestRef)(scrollValue);
|
86
86
|
var pickerCellsRef = (0, _react.useRef)([]);
|
87
|
-
var cascaderRef = (0, _react.useRef)(null);
|
87
|
+
var cascaderRef = (0, _react.useRef)(null); // itemStyle height 同时对 selection-bar 生效,这里不单独抛出 selection-bar 的高度设置属性
|
88
|
+
// @en The height of itemStyle applies to the selection-bar as well, without separately exposing the height setting property for the selection-bar.
|
89
|
+
|
90
|
+
var selectionBarHeight = (0, _react.useMemo)(function () {
|
91
|
+
return itemStyle != null && itemStyle.height ? {
|
92
|
+
height: itemStyle.height
|
93
|
+
} : {};
|
94
|
+
}, [itemStyle]);
|
88
95
|
var innerData = (0, _react.useMemo)(function () {
|
89
96
|
var newData;
|
90
97
|
|
@@ -254,7 +261,8 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
254
261
|
className: prefixCls + "-picker-selection-mask " + prefixCls + "-picker-selection-mask-top"
|
255
262
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
256
263
|
ref: barRef,
|
257
|
-
className: prefixCls + "-picker-selection-bar"
|
264
|
+
className: prefixCls + "-picker-selection-bar",
|
265
|
+
style: selectionBarHeight
|
258
266
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
259
267
|
className: prefixCls + "-picker-selection-mask " + prefixCls + "-picker-selection-mask-bottom"
|
260
268
|
})));
|
package/cjs/popover/menu.js
CHANGED
@@ -15,6 +15,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
16
16
|
var _contextProvider = require("../context-provider");
|
17
17
|
|
18
|
+
var _helpers = require("../_helpers");
|
19
|
+
|
18
20
|
var _excluded = ["menu", "menuLayout", "onSelect", "onClickMenuItem", "className", "useClickStatus", "clickStatusDuration", "clickSelfToClose", "touchSelfToClose", "defaultVisible", "visible", "onChange"];
|
19
21
|
|
20
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -68,7 +70,7 @@ function componentGenerator(Comp) {
|
|
68
70
|
visibleState = _useState2[0],
|
69
71
|
setVisibleState = _useState2[1];
|
70
72
|
|
71
|
-
(0,
|
73
|
+
(0, _helpers.useUpdateEffect)(function () {
|
72
74
|
setVisibleState(Boolean(visible));
|
73
75
|
}, [visible]);
|
74
76
|
var popoverRef = (0, _react.useRef)(null);
|
package/dist/index.js
CHANGED
@@ -11125,9 +11125,9 @@
|
|
11125
11125
|
|
11126
11126
|
function momentum(current, start, duration, minY, maxY) {
|
11127
11127
|
var durationMap = {
|
11128
|
-
noBounce:
|
11129
|
-
weekBounce:
|
11130
|
-
strongBounce:
|
11128
|
+
noBounce: 400,
|
11129
|
+
weekBounce: 100,
|
11130
|
+
strongBounce: 75
|
11131
11131
|
};
|
11132
11132
|
var bezierMap = {
|
11133
11133
|
noBounce: 'cubic-bezier(.17, .89, .45, 1)',
|
@@ -11186,7 +11186,7 @@
|
|
11186
11186
|
var absDistY = Math.abs(transformY - lastTransformY); // 计算动量,保证滚动顺畅,条件:手势时间小于300ms && 移动距离绝对值大于30时
|
11187
11187
|
// @en Calculate the momentum to ensure smooth scrolling, condition: the gesture time is less than 300ms && the absolute value of the moving distance is greater than 30
|
11188
11188
|
|
11189
|
-
if (duration < 300 && absDistY >
|
11189
|
+
if (duration < 300 && absDistY > 90) {
|
11190
11190
|
var momentumY = momentum(transformY, lastTransformY, duration, wrapperHeight - scrollerHeight, 0);
|
11191
11191
|
var newItemIndex_1 = Math.max(0, Math.min(data.length - 1, Math.round(-1 * momentumY.destination / itemHeight)));
|
11192
11192
|
setBezier(momentumY.bezier);
|
@@ -11454,7 +11454,14 @@
|
|
11454
11454
|
var barRef = React.useRef(null);
|
11455
11455
|
var scrollValueRef = useLatestRef(scrollValue);
|
11456
11456
|
var pickerCellsRef = React.useRef([]);
|
11457
|
-
var cascaderRef = React.useRef(null);
|
11457
|
+
var cascaderRef = React.useRef(null); // itemStyle height 同时对 selection-bar 生效,这里不单独抛出 selection-bar 的高度设置属性
|
11458
|
+
// @en The height of itemStyle applies to the selection-bar as well, without separately exposing the height setting property for the selection-bar.
|
11459
|
+
|
11460
|
+
var selectionBarHeight = React.useMemo(function () {
|
11461
|
+
return (itemStyle === null || itemStyle === void 0 ? void 0 : itemStyle.height) ? {
|
11462
|
+
height: itemStyle.height
|
11463
|
+
} : {};
|
11464
|
+
}, [itemStyle]);
|
11458
11465
|
var innerData = React.useMemo(function () {
|
11459
11466
|
var newData;
|
11460
11467
|
|
@@ -11625,7 +11632,8 @@
|
|
11625
11632
|
className: prefixCls + "-picker-selection-mask " + prefixCls + "-picker-selection-mask-top"
|
11626
11633
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
11627
11634
|
ref: barRef,
|
11628
|
-
className: prefixCls + "-picker-selection-bar"
|
11635
|
+
className: prefixCls + "-picker-selection-bar",
|
11636
|
+
style: selectionBarHeight
|
11629
11637
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
11630
11638
|
className: prefixCls + "-picker-selection-mask " + prefixCls + "-picker-selection-mask-bottom"
|
11631
11639
|
})));
|
@@ -17325,7 +17333,7 @@
|
|
17325
17333
|
var index$h = componentWrapper(ImagePicker, 'ImagePicker');
|
17326
17334
|
|
17327
17335
|
/*!
|
17328
|
-
* @arco-design/transformable v1.0.
|
17336
|
+
* @arco-design/transformable v1.0.2
|
17329
17337
|
* (c) 2022 ludan.kibbon
|
17330
17338
|
*/
|
17331
17339
|
function _defineProperty(obj, key, value) {
|
@@ -19565,6 +19573,7 @@
|
|
19565
19573
|
lazyloadCount = _j === void 0 ? 1 : _j,
|
19566
19574
|
_k = props.swipeToClose,
|
19567
19575
|
swipeToClose = _k === void 0 ? true : _k,
|
19576
|
+
extra = props.extra,
|
19568
19577
|
getMinScale = props.getMinScale,
|
19569
19578
|
getMaxScale = props.getMaxScale,
|
19570
19579
|
getDoubleClickScale = props.getDoubleClickScale,
|
@@ -19583,14 +19592,13 @@
|
|
19583
19592
|
onTouchEnd = props.onTouchEnd,
|
19584
19593
|
_l = props.indicatorPos,
|
19585
19594
|
indicatorPos = _l === void 0 ? 'start' : _l,
|
19586
|
-
otherProps = __rest$1(props, ["style", "className", "images", "loop", "openIndex", "fit", "noselect", "displayDuration", "spaceBetween", "showLoading", "loadingArea", "errorArea", "showError", "retryTime", "staticLabel", "replaceFallbackWhenLoaded", "scrollBezier", "lazyloadCount", "swipeToClose", "getMinScale", "getMaxScale", "getDoubleClickScale", "getContainer", "getThumbBounds", "renderIndicator", "onChange", "onAfterChange", "onImageClick", "onImageDoubleClick", "onImageLongTap", "close", "onClose", "onTouchStart", "onTouchMove", "onTouchEnd", "indicatorPos"]);
|
19595
|
+
otherProps = __rest$1(props, ["style", "className", "images", "loop", "openIndex", "fit", "noselect", "displayDuration", "spaceBetween", "showLoading", "loadingArea", "errorArea", "showError", "retryTime", "staticLabel", "replaceFallbackWhenLoaded", "scrollBezier", "lazyloadCount", "swipeToClose", "extra", "getMinScale", "getMaxScale", "getDoubleClickScale", "getContainer", "getThumbBounds", "renderIndicator", "onChange", "onAfterChange", "onImageClick", "onImageDoubleClick", "onImageLongTap", "close", "onClose", "onTouchStart", "onTouchMove", "onTouchEnd", "indicatorPos"]);
|
19587
19596
|
|
19588
19597
|
var system = useSystem();
|
19589
19598
|
var domRef = React.useRef(null);
|
19590
19599
|
var imagesRef = React.useRef([]);
|
19591
19600
|
var carouselRef = React.useRef(null);
|
19592
19601
|
var transformersRef = React.useRef([]);
|
19593
|
-
var dblTimerRef = React.useRef(null);
|
19594
19602
|
var longTimerRef = React.useRef(null);
|
19595
19603
|
var transImageRef = React.useRef(null);
|
19596
19604
|
var imageDomsRef = React.useRef([]);
|
@@ -20075,17 +20083,15 @@
|
|
20075
20083
|
function handleImageClick(e) {
|
20076
20084
|
if (movedRef.current) {
|
20077
20085
|
return;
|
20078
|
-
} //
|
20079
|
-
// @en
|
20086
|
+
} // 如果正在触发doubleClick就不触发click
|
20087
|
+
// @en If doubleClick is being triggered, click will not be triggered
|
20080
20088
|
|
20081
20089
|
|
20082
|
-
|
20083
|
-
if (!
|
20084
|
-
|
20085
|
-
goClose(e);
|
20086
|
-
}
|
20090
|
+
if (!dblClickingRef.current) {
|
20091
|
+
if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
|
20092
|
+
goClose(e);
|
20087
20093
|
}
|
20088
|
-
}
|
20094
|
+
}
|
20089
20095
|
}
|
20090
20096
|
|
20091
20097
|
function handleImageDoubleClick(e) {
|
@@ -20095,12 +20101,6 @@
|
|
20095
20101
|
}
|
20096
20102
|
|
20097
20103
|
dblClickingRef.current = true;
|
20098
|
-
|
20099
|
-
if (dblTimerRef.current) {
|
20100
|
-
clearTimeout(dblTimerRef.current);
|
20101
|
-
dblTimerRef.current = null;
|
20102
|
-
}
|
20103
|
-
|
20104
20104
|
var index = innerIndexRef.current;
|
20105
20105
|
onImageDoubleClick && onImageDoubleClick(index, e); // 双击时根据配置放大或缩小
|
20106
20106
|
// @en Zoom in or out according to configuration when double-clicking
|
@@ -20493,7 +20493,7 @@
|
|
20493
20493
|
onLoad: transImageInfo.onLoad,
|
20494
20494
|
onError: transImageInfo.onError
|
20495
20495
|
};
|
20496
|
-
})) : null)), transImageInfo ? /*#__PURE__*/React__default["default"].createElement("div", {
|
20496
|
+
})) : null, extra)), transImageInfo ? /*#__PURE__*/React__default["default"].createElement("div", {
|
20497
20497
|
className: "image-preview-lock-modal",
|
20498
20498
|
onClick: goClose
|
20499
20499
|
}) : null);
|
@@ -22383,7 +22383,7 @@
|
|
22383
22383
|
visibleState = _j[0],
|
22384
22384
|
setVisibleState = _j[1];
|
22385
22385
|
|
22386
|
-
|
22386
|
+
useUpdateEffect(function () {
|
22387
22387
|
setVisibleState(Boolean(visible));
|
22388
22388
|
}, [visible]);
|
22389
22389
|
var popoverRef = React.useRef(null);
|