@arco-design/mobile-react 2.29.1 → 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 CHANGED
@@ -3,6 +3,31 @@
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
+
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)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * `LoadMore` support the prop "disabled" ([b1881b2](https://github.com/arco-design/arco-design-mobile/commit/b1881b2821debb3b94c66285d712e8f7522e6be7))
25
+ * `Tabs` the prop "tabBarFixed" supports passing in specific fixed values ([ae3158f](https://github.com/arco-design/arco-design-mobile/commit/ae3158f7f7d5d1eebca8921d6d4802aa53b31fbe))
26
+
27
+
28
+
29
+
30
+
6
31
  ## [2.29.1](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.29.0...@arco-design/mobile-react@2.29.1) (2023-08-21)
7
32
 
8
33
 
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.0/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.29.0/dist/index.min.js"></script>
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.0/dist/style.min.css">
63
- <script src="https://unpkg.com/@arco-design/mobile-react@2.29.0/dist/index.min.js"></script>
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
- } // 300ms内再次点击则触发doubleClick,否则触发click
592
- // @en Click again within 300ms to trigger doubleClick, otherwise trigger click
591
+ } // 如果正在触发doubleClick就不触发click
592
+ // @en If doubleClick is being triggered, click will not be triggered
593
593
 
594
594
 
595
- dblTimerRef.current = window.setTimeout(function () {
596
- if (!dblClickingRef.current) {
597
- if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
598
- goClose(e);
599
- }
595
+ if (!dblClickingRef.current) {
596
+ if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
597
+ goClose(e);
600
598
  }
601
- }, 300);
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);
@@ -11,6 +11,11 @@ export interface LoadMoreProps {
11
11
  * @en Custom classname
12
12
  */
13
13
  className?: string;
14
+ /**
15
+ * 是否禁用加载能力
16
+ * @en Whether to disable the loading capability
17
+ */
18
+ disabled?: boolean;
14
19
  /**
15
20
  * 组件加载但尚未启用状态下的内容
16
21
  * @en Content when the component is loaded but not yet enabled
@@ -31,6 +31,7 @@ var LoadMore = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
31
31
  var _props$className = props.className,
32
32
  className = _props$className === void 0 ? '' : _props$className,
33
33
  style = props.style,
34
+ disabled = props.disabled,
34
35
  beforeReadyArea = props.beforeReadyArea,
35
36
  loadingArea = props.loadingArea,
36
37
  noMoreArea = props.noMoreArea,
@@ -65,11 +66,16 @@ var LoadMore = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
65
66
  var lastScrollEndRef = (0, _react.useRef)(false);
66
67
  var nowStatus = status || innerStatus;
67
68
  var statusRef = (0, _react.useRef)(nowStatus);
69
+ var disabledRef = (0, _helpers.useLatestRef)(disabled);
68
70
  var changeStatus = (0, _react.useCallback)(function (st, scene) {
69
71
  setInnerStatus(st);
70
72
  onStatusChange && onStatusChange(st, scene);
71
73
  }, [onStatusChange]);
72
74
  var triggerGetData = (0, _react.useCallback)(function (scene) {
75
+ if (disabledRef.current) {
76
+ return;
77
+ }
78
+
73
79
  if (blockWhenLoading && statusRef.current === 'loading') {
74
80
  return;
75
81
  }
@@ -94,12 +100,12 @@ var LoadMore = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
94
100
  }
95
101
  }, [nowStatus]);
96
102
  (0, _react.useEffect)(function () {
97
- if (requestAtFirst) {
103
+ if (requestAtFirst && !disabled) {
98
104
  if (statusRef.current === 'prepare') {
99
105
  triggerGetData('requestAtFirst');
100
106
  }
101
107
  }
102
- }, [trigger]);
108
+ }, [trigger, disabled]);
103
109
  var handleContainerScroll = (0, _react.useCallback)(function () {
104
110
  var scrollTop = (0, _mobileUtils.getScrollContainerAttribute)('scrollTop', getScrollContainer);
105
111
 
@@ -120,7 +126,7 @@ var LoadMore = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
120
126
  var binded = null;
121
127
  var scrollFunc = throttle ? (0, _lodash.default)(handleContainerScroll, throttle) : handleContainerScroll;
122
128
 
123
- if (trigger === 'scroll') {
129
+ if (trigger === 'scroll' && !disabled) {
124
130
  var container = (0, _mobileUtils.getValidScrollContainer)(getScrollContainer);
125
131
 
126
132
  if (container) {
@@ -134,7 +140,7 @@ var LoadMore = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
134
140
  binded.removeEventListener('scroll', scrollFunc);
135
141
  }
136
142
  };
137
- }, [trigger, getScrollContainer, handleContainerScroll, throttle]);
143
+ }, [trigger, disabled, getScrollContainer, handleContainerScroll, throttle]);
138
144
  (0, _react.useImperativeHandle)(ref, function () {
139
145
  return {
140
146
  dom: domRef.current,
@@ -187,11 +193,13 @@ var LoadMore = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
187
193
  }
188
194
 
189
195
  return /*#__PURE__*/_react.default.createElement(_contextProvider.ContextLayout, null, function (_ref) {
196
+ var _cls;
197
+
190
198
  var prefixCls = _ref.prefixCls,
191
199
  _ref$locale = _ref.locale,
192
200
  locale = _ref$locale === void 0 ? _mobileUtils.defaultLocale : _ref$locale;
193
201
  return /*#__PURE__*/_react.default.createElement("div", {
194
- className: prefixCls + "-load-more status-" + nowStatus + " " + className,
202
+ className: (0, _mobileUtils.cls)(prefixCls + "-load-more status-" + nowStatus, className, (_cls = {}, _cls[prefixCls + "-load-more-disabled"] = disabled, _cls)),
195
203
  ref: domRef,
196
204
  style: style,
197
205
  onClick: handleClick
@@ -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: 2000,
212
- weekBounce: 500,
213
- strongBounce: 300
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 > 30) {
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);
@@ -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
  })));
@@ -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, _react.useEffect)(function () {
73
+ (0, _helpers.useUpdateEffect)(function () {
72
74
  setVisibleState(Boolean(visible));
73
75
  }, [visible]);
74
76
  var popoverRef = (0, _react.useRef)(null);
@@ -378,7 +378,8 @@ var TabCell = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
378
378
  fixed: tabBarFixed
379
379
  }, {
380
380
  'has-divider': hasDivider
381
- })
381
+ }),
382
+ style: typeof tabBarFixed === 'object' ? tabBarFixed : {}
382
383
  }, /*#__PURE__*/_react.default.createElement("div", {
383
384
  className: (0, _mobileUtils.cls)(prefix + "-container", tabDirection, "pos-" + tabBarPosition, "arrange-" + (originArrange || tabBarArrange), "type-" + type, {
384
385
  overflow: hasOverflow
@@ -1,4 +1,4 @@
1
- import { ReactNode, ReactNodeArray } from 'react';
1
+ import { CSSProperties, ReactNode, ReactNodeArray } from 'react';
2
2
  export declare type TabData = string | {
3
3
  title: ReactNode;
4
4
  [x: string]: any;
@@ -71,10 +71,10 @@ export interface TabsProps {
71
71
  */
72
72
  tabBarScroll?: boolean;
73
73
  /**
74
- * TabBar是否顶部固定
75
- * @en Whether the TabBar is fixed on the top
74
+ * TabBar是否顶部/底部固定(含 placeholder),可传入具体固定的值
75
+ * @en Whether the TabBar is fixed on the top or bottom (including placeholder), a specific fixed value can be passed in
76
76
  */
77
- tabBarFixed?: boolean;
77
+ tabBarFixed?: boolean | Pick<CSSProperties, 'top' | 'bottom'>;
78
78
  /**
79
79
  * tabBar额外渲染内容
80
80
  * @en TabBar extra render content
package/dist/index.js CHANGED
@@ -4307,7 +4307,8 @@
4307
4307
  fixed: tabBarFixed
4308
4308
  }, {
4309
4309
  'has-divider': hasDivider
4310
- })
4310
+ }),
4311
+ style: typeof tabBarFixed === 'object' ? tabBarFixed : {}
4311
4312
  }, /*#__PURE__*/React__default["default"].createElement("div", {
4312
4313
  className: cls(prefix + "-container", tabDirection, "pos-" + tabBarPosition, "arrange-" + (originArrange || tabBarArrange), "type-" + type, {
4313
4314
  overflow: hasOverflow
@@ -5842,6 +5843,7 @@
5842
5843
  var _a = props.className,
5843
5844
  className = _a === void 0 ? '' : _a,
5844
5845
  style = props.style,
5846
+ disabled = props.disabled,
5845
5847
  beforeReadyArea = props.beforeReadyArea,
5846
5848
  loadingArea = props.loadingArea,
5847
5849
  noMoreArea = props.noMoreArea,
@@ -5876,11 +5878,16 @@
5876
5878
  var lastScrollEndRef = React.useRef(false);
5877
5879
  var nowStatus = status || innerStatus;
5878
5880
  var statusRef = React.useRef(nowStatus);
5881
+ var disabledRef = useLatestRef(disabled);
5879
5882
  var changeStatus = React.useCallback(function (st, scene) {
5880
5883
  setInnerStatus(st);
5881
5884
  onStatusChange && onStatusChange(st, scene);
5882
5885
  }, [onStatusChange]);
5883
5886
  var triggerGetData = React.useCallback(function (scene) {
5887
+ if (disabledRef.current) {
5888
+ return;
5889
+ }
5890
+
5884
5891
  if (blockWhenLoading && statusRef.current === 'loading') {
5885
5892
  return;
5886
5893
  }
@@ -5905,12 +5912,12 @@
5905
5912
  }
5906
5913
  }, [nowStatus]);
5907
5914
  React.useEffect(function () {
5908
- if (requestAtFirst) {
5915
+ if (requestAtFirst && !disabled) {
5909
5916
  if (statusRef.current === 'prepare') {
5910
5917
  triggerGetData('requestAtFirst');
5911
5918
  }
5912
5919
  }
5913
- }, [trigger]);
5920
+ }, [trigger, disabled]);
5914
5921
  var handleContainerScroll = React.useCallback(function () {
5915
5922
  var scrollTop = getScrollContainerAttribute('scrollTop', getScrollContainer);
5916
5923
 
@@ -5931,7 +5938,7 @@
5931
5938
  var binded = null;
5932
5939
  var scrollFunc = throttle ? lodash_throttle(handleContainerScroll, throttle) : handleContainerScroll;
5933
5940
 
5934
- if (trigger === 'scroll') {
5941
+ if (trigger === 'scroll' && !disabled) {
5935
5942
  var container = getValidScrollContainer(getScrollContainer);
5936
5943
 
5937
5944
  if (container) {
@@ -5945,7 +5952,7 @@
5945
5952
  binded.removeEventListener('scroll', scrollFunc);
5946
5953
  }
5947
5954
  };
5948
- }, [trigger, getScrollContainer, handleContainerScroll, throttle]);
5955
+ }, [trigger, disabled, getScrollContainer, handleContainerScroll, throttle]);
5949
5956
  React.useImperativeHandle(ref, function () {
5950
5957
  return {
5951
5958
  dom: domRef.current,
@@ -5998,11 +6005,13 @@
5998
6005
  }
5999
6006
 
6000
6007
  return /*#__PURE__*/React__default["default"].createElement(ContextLayout, null, function (_a) {
6008
+ var _b;
6009
+
6001
6010
  var prefixCls = _a.prefixCls,
6002
- _b = _a.locale,
6003
- locale = _b === void 0 ? defaultLocale : _b;
6011
+ _c = _a.locale,
6012
+ locale = _c === void 0 ? defaultLocale : _c;
6004
6013
  return /*#__PURE__*/React__default["default"].createElement("div", {
6005
- className: prefixCls + "-load-more status-" + nowStatus + " " + className,
6014
+ className: cls(prefixCls + "-load-more status-" + nowStatus, className, (_b = {}, _b[prefixCls + "-load-more-disabled"] = disabled, _b)),
6006
6015
  ref: domRef,
6007
6016
  style: style,
6008
6017
  onClick: handleClick
@@ -11116,9 +11125,9 @@
11116
11125
 
11117
11126
  function momentum(current, start, duration, minY, maxY) {
11118
11127
  var durationMap = {
11119
- noBounce: 2000,
11120
- weekBounce: 500,
11121
- strongBounce: 300
11128
+ noBounce: 400,
11129
+ weekBounce: 100,
11130
+ strongBounce: 75
11122
11131
  };
11123
11132
  var bezierMap = {
11124
11133
  noBounce: 'cubic-bezier(.17, .89, .45, 1)',
@@ -11177,7 +11186,7 @@
11177
11186
  var absDistY = Math.abs(transformY - lastTransformY); // 计算动量,保证滚动顺畅,条件:手势时间小于300ms && 移动距离绝对值大于30时
11178
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
11179
11188
 
11180
- if (duration < 300 && absDistY > 30) {
11189
+ if (duration < 300 && absDistY > 90) {
11181
11190
  var momentumY = momentum(transformY, lastTransformY, duration, wrapperHeight - scrollerHeight, 0);
11182
11191
  var newItemIndex_1 = Math.max(0, Math.min(data.length - 1, Math.round(-1 * momentumY.destination / itemHeight)));
11183
11192
  setBezier(momentumY.bezier);
@@ -11445,7 +11454,14 @@
11445
11454
  var barRef = React.useRef(null);
11446
11455
  var scrollValueRef = useLatestRef(scrollValue);
11447
11456
  var pickerCellsRef = React.useRef([]);
11448
- 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]);
11449
11465
  var innerData = React.useMemo(function () {
11450
11466
  var newData;
11451
11467
 
@@ -11616,7 +11632,8 @@
11616
11632
  className: prefixCls + "-picker-selection-mask " + prefixCls + "-picker-selection-mask-top"
11617
11633
  }), /*#__PURE__*/React__default["default"].createElement("div", {
11618
11634
  ref: barRef,
11619
- className: prefixCls + "-picker-selection-bar"
11635
+ className: prefixCls + "-picker-selection-bar",
11636
+ style: selectionBarHeight
11620
11637
  }), /*#__PURE__*/React__default["default"].createElement("div", {
11621
11638
  className: prefixCls + "-picker-selection-mask " + prefixCls + "-picker-selection-mask-bottom"
11622
11639
  })));
@@ -17316,7 +17333,7 @@
17316
17333
  var index$h = componentWrapper(ImagePicker, 'ImagePicker');
17317
17334
 
17318
17335
  /*!
17319
- * @arco-design/transformable v1.0.1
17336
+ * @arco-design/transformable v1.0.2
17320
17337
  * (c) 2022 ludan.kibbon
17321
17338
  */
17322
17339
  function _defineProperty(obj, key, value) {
@@ -19556,6 +19573,7 @@
19556
19573
  lazyloadCount = _j === void 0 ? 1 : _j,
19557
19574
  _k = props.swipeToClose,
19558
19575
  swipeToClose = _k === void 0 ? true : _k,
19576
+ extra = props.extra,
19559
19577
  getMinScale = props.getMinScale,
19560
19578
  getMaxScale = props.getMaxScale,
19561
19579
  getDoubleClickScale = props.getDoubleClickScale,
@@ -19574,14 +19592,13 @@
19574
19592
  onTouchEnd = props.onTouchEnd,
19575
19593
  _l = props.indicatorPos,
19576
19594
  indicatorPos = _l === void 0 ? 'start' : _l,
19577
- 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"]);
19578
19596
 
19579
19597
  var system = useSystem();
19580
19598
  var domRef = React.useRef(null);
19581
19599
  var imagesRef = React.useRef([]);
19582
19600
  var carouselRef = React.useRef(null);
19583
19601
  var transformersRef = React.useRef([]);
19584
- var dblTimerRef = React.useRef(null);
19585
19602
  var longTimerRef = React.useRef(null);
19586
19603
  var transImageRef = React.useRef(null);
19587
19604
  var imageDomsRef = React.useRef([]);
@@ -20066,17 +20083,15 @@
20066
20083
  function handleImageClick(e) {
20067
20084
  if (movedRef.current) {
20068
20085
  return;
20069
- } // 300ms内再次点击则触发doubleClick,否则触发click
20070
- // @en Click again within 300ms to trigger doubleClick, otherwise trigger click
20086
+ } // 如果正在触发doubleClick就不触发click
20087
+ // @en If doubleClick is being triggered, click will not be triggered
20071
20088
 
20072
20089
 
20073
- dblTimerRef.current = window.setTimeout(function () {
20074
- if (!dblClickingRef.current) {
20075
- if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
20076
- goClose(e);
20077
- }
20090
+ if (!dblClickingRef.current) {
20091
+ if (!onImageClick || !onImageClick(innerIndexRef.current, e)) {
20092
+ goClose(e);
20078
20093
  }
20079
- }, 300);
20094
+ }
20080
20095
  }
20081
20096
 
20082
20097
  function handleImageDoubleClick(e) {
@@ -20086,12 +20101,6 @@
20086
20101
  }
20087
20102
 
20088
20103
  dblClickingRef.current = true;
20089
-
20090
- if (dblTimerRef.current) {
20091
- clearTimeout(dblTimerRef.current);
20092
- dblTimerRef.current = null;
20093
- }
20094
-
20095
20104
  var index = innerIndexRef.current;
20096
20105
  onImageDoubleClick && onImageDoubleClick(index, e); // 双击时根据配置放大或缩小
20097
20106
  // @en Zoom in or out according to configuration when double-clicking
@@ -20484,7 +20493,7 @@
20484
20493
  onLoad: transImageInfo.onLoad,
20485
20494
  onError: transImageInfo.onError
20486
20495
  };
20487
- })) : null)), transImageInfo ? /*#__PURE__*/React__default["default"].createElement("div", {
20496
+ })) : null, extra)), transImageInfo ? /*#__PURE__*/React__default["default"].createElement("div", {
20488
20497
  className: "image-preview-lock-modal",
20489
20498
  onClick: goClose
20490
20499
  }) : null);
@@ -22374,7 +22383,7 @@
22374
22383
  visibleState = _j[0],
22375
22384
  setVisibleState = _j[1];
22376
22385
 
22377
- React.useEffect(function () {
22386
+ useUpdateEffect(function () {
22378
22387
  setVisibleState(Boolean(visible));
22379
22388
  }, [visible]);
22380
22389
  var popoverRef = React.useRef(null);