@hi-ui/tabs 4.0.0-beta.11 → 4.0.0-beta.12
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/lib/cjs/TabList.js +6 -5
- package/lib/esm/TabList.js +7 -6
- package/package.json +2 -2
package/lib/cjs/TabList.js
CHANGED
|
@@ -100,11 +100,12 @@ var TabList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
100
100
|
setTranslateY = _useState4[1];
|
|
101
101
|
|
|
102
102
|
var itemsRef = React.useRef({});
|
|
103
|
-
var showScrollBtn =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
103
|
+
var showScrollBtn = false;
|
|
104
|
+
|
|
105
|
+
if (scrollRef && innerRef) {
|
|
106
|
+
showScrollBtn = direction === 'horizontal' ? scrollRef.clientWidth > innerRef.clientWidth : scrollRef.clientHeight > innerRef.clientHeight;
|
|
107
|
+
}
|
|
108
|
+
|
|
108
109
|
var onClickTab = React.useCallback(function (key, event) {
|
|
109
110
|
if (onTabClick) {
|
|
110
111
|
onTabClick(key, event);
|
package/lib/esm/TabList.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
import React, { forwardRef, useState, useRef,
|
|
10
|
+
import React, { forwardRef, useState, useRef, useCallback } from 'react';
|
|
11
11
|
import { __DEV__ } from '@hi-ui/env';
|
|
12
12
|
import { TabItem } from './TabItem.js';
|
|
13
13
|
import { useUncontrolledState } from '@hi-ui/use-uncontrolled-state';
|
|
@@ -75,11 +75,12 @@ var TabList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
75
75
|
setTranslateY = _useState4[1];
|
|
76
76
|
|
|
77
77
|
var itemsRef = useRef({});
|
|
78
|
-
var showScrollBtn =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
78
|
+
var showScrollBtn = false;
|
|
79
|
+
|
|
80
|
+
if (scrollRef && innerRef) {
|
|
81
|
+
showScrollBtn = direction === 'horizontal' ? scrollRef.clientWidth > innerRef.clientWidth : scrollRef.clientHeight > innerRef.clientHeight;
|
|
82
|
+
}
|
|
83
|
+
|
|
83
84
|
var onClickTab = useCallback(function (key, event) {
|
|
84
85
|
if (onTabClick) {
|
|
85
86
|
onTabClick(key, event);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/tabs",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.12",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HIUI <mi-hiui@xiaomi.com>",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^17.0.1",
|
|
61
61
|
"react-dom": "^17.0.1"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "3a156d7336309ae1b4fb73588735727de583e161"
|
|
64
64
|
}
|