@arco-design/mobile-react 2.29.1 → 2.29.2

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,18 @@
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.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
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `LoadMore` support the prop "disabled" ([b1881b2](https://github.com/arco-design/arco-design-mobile/commit/b1881b2821debb3b94c66285d712e8f7522e6be7))
12
+ * `Tabs` the prop "tabBarFixed" supports passing in specific fixed values ([ae3158f](https://github.com/arco-design/arco-design-mobile/commit/ae3158f7f7d5d1eebca8921d6d4802aa53b31fbe))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [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
19
 
8
20
 
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.1/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.29.1/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.1/dist/style.min.css">
63
+ <script src="https://unpkg.com/@arco-design/mobile-react@2.29.1/dist/index.min.js"></script>
64
64
  ```
65
65
 
66
66
  ## 引入全部
@@ -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
@@ -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