@clayui/tabs 3.95.2 → 3.96.0
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/index.js +5 -5
- package/package.json +3 -3
- package/src/index.tsx +2 -2
package/lib/index.js
CHANGED
|
@@ -58,7 +58,7 @@ function ClayTabs(_ref) {
|
|
|
58
58
|
onActiveChange = _ref.onActiveChange,
|
|
59
59
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
60
60
|
|
|
61
|
-
var
|
|
61
|
+
var _useControlledState = (0, _shared.useControlledState)({
|
|
62
62
|
defaultName: 'defaultActive',
|
|
63
63
|
defaultValue: defaultActive,
|
|
64
64
|
handleName: 'onActiveChange',
|
|
@@ -66,10 +66,10 @@ function ClayTabs(_ref) {
|
|
|
66
66
|
onChange: onActiveChange,
|
|
67
67
|
value: externalActive
|
|
68
68
|
}),
|
|
69
|
-
|
|
70
|
-
active =
|
|
71
|
-
setActive =
|
|
72
|
-
isUncontrolled =
|
|
69
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 3),
|
|
70
|
+
active = _useControlledState2[0],
|
|
71
|
+
setActive = _useControlledState2[1],
|
|
72
|
+
isUncontrolled = _useControlledState2[2];
|
|
73
73
|
|
|
74
74
|
var _React$Children$toArr = _react.default.Children.toArray(children),
|
|
75
75
|
_React$Children$toArr2 = _slicedToArray(_React$Children$toArr, 2),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clayui/tabs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.96.0",
|
|
4
4
|
"description": "ClayTabs component",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"repository": "https://github.com/liferay/clay",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@clayui/shared": "^3.
|
|
29
|
+
"@clayui/shared": "^3.96.0",
|
|
30
30
|
"classnames": "^2.2.6"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"browserslist": [
|
|
38
38
|
"extends browserslist-config-clay"
|
|
39
39
|
],
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "4b068cc052987f0a95dc6ca3e5f985b5a52236c6"
|
|
41
41
|
}
|
package/src/index.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {InternalDispatch,
|
|
6
|
+
import {InternalDispatch, useControlledState, useId} from '@clayui/shared';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import Content from './Content';
|
|
@@ -84,7 +84,7 @@ function ClayTabs({
|
|
|
84
84
|
onActiveChange,
|
|
85
85
|
...otherProps
|
|
86
86
|
}: IProps) {
|
|
87
|
-
const [active, setActive, isUncontrolled] =
|
|
87
|
+
const [active, setActive, isUncontrolled] = useControlledState({
|
|
88
88
|
defaultName: 'defaultActive',
|
|
89
89
|
defaultValue: defaultActive,
|
|
90
90
|
handleName: 'onActiveChange',
|