@plesk/ui-library 3.43.1 → 3.43.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/cjs/components/Tabs/TabList.js +8 -7
- package/cjs/components/Tabs/Tabs.js +3 -8
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library-rtl.css +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +12 -16
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +2 -2
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Tabs/TabList.js +8 -7
- package/esm/components/Tabs/Tabs.js +3 -8
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/styleguide/build/bundle.2360aa9e.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/components/Tabs/TabList.d.ts +1 -1
- package/styleguide/build/bundle.06c6ee6c.js +0 -2
- /package/styleguide/build/{bundle.06c6ee6c.js.LICENSE.txt → bundle.2360aa9e.js.LICENSE.txt} +0 -0
|
@@ -30,25 +30,26 @@ const TabList = _ref => {
|
|
|
30
30
|
monospacedWidth,
|
|
31
31
|
baseClassName
|
|
32
32
|
} = _ref;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const handleTabClick = (tab, position) => {
|
|
34
|
+
onTabClick(position);
|
|
35
|
+
tab?.props?.onActivate?.();
|
|
36
|
+
};
|
|
36
37
|
let tabs = _react.Children.toArray(children);
|
|
37
38
|
tabs = tabs.filter(child => child?.type === _Tab.default);
|
|
38
39
|
const listChildren = tabs.slice(0, visibleLength);
|
|
39
40
|
const menuChildren = tabs.slice(visibleLength);
|
|
40
|
-
const listItems =
|
|
41
|
+
const listItems = listChildren.map((tab, index) => {
|
|
41
42
|
const position = index + 1;
|
|
42
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabListItem.default, {
|
|
43
44
|
// eslint-disable-line react/no-array-index-key
|
|
44
45
|
tab: tab,
|
|
45
46
|
baseClassName: baseClassName,
|
|
46
47
|
selected: position === active,
|
|
47
|
-
onClick: () =>
|
|
48
|
+
onClick: () => handleTabClick(tab, position),
|
|
48
49
|
monospacedWidth: monospacedWidth
|
|
49
50
|
}, index);
|
|
50
51
|
});
|
|
51
|
-
const menuItems =
|
|
52
|
+
const menuItems = menuChildren.map((tab, index) => {
|
|
52
53
|
const position = listChildren.length + index + 1;
|
|
53
54
|
const {
|
|
54
55
|
title,
|
|
@@ -77,7 +78,7 @@ const TabList = _ref => {
|
|
|
77
78
|
})]
|
|
78
79
|
}),
|
|
79
80
|
active: active === position,
|
|
80
|
-
onClick: () =>
|
|
81
|
+
onClick: () => handleTabClick(tab, position),
|
|
81
82
|
className: `${baseClassName}__menu-item`,
|
|
82
83
|
component: Tag,
|
|
83
84
|
...tabProps,
|
|
@@ -40,7 +40,7 @@ const Tabs = _ref => {
|
|
|
40
40
|
const tabNavRef = (0, _react.useRef)(null);
|
|
41
41
|
const tabListRef = (0, _react.useRef)(null);
|
|
42
42
|
const fakeAddonRef = (0, _react.useRef)(null);
|
|
43
|
-
const childrenCount = _react.Children.
|
|
43
|
+
const childrenCount = _react.Children.toArray(children).length;
|
|
44
44
|
const [active, setActive] = (0, _useActive.useActive)(externalActive);
|
|
45
45
|
const {
|
|
46
46
|
monospacedWidth,
|
|
@@ -55,11 +55,6 @@ const Tabs = _ref => {
|
|
|
55
55
|
baseClassName,
|
|
56
56
|
childrenCount
|
|
57
57
|
});
|
|
58
|
-
const handleTabClick = active => {
|
|
59
|
-
setActive(active);
|
|
60
|
-
const tab = Array.isArray(children) ? children[active - 1] : children;
|
|
61
|
-
tab?.props?.onActivate?.();
|
|
62
|
-
};
|
|
63
58
|
const [searching, setSearching] = (0, _react.useState)(false);
|
|
64
59
|
if (!childrenCount) {
|
|
65
60
|
return null;
|
|
@@ -110,7 +105,7 @@ const Tabs = _ref => {
|
|
|
110
105
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabList.default, {
|
|
111
106
|
tabListRef: tabListRef,
|
|
112
107
|
active: active,
|
|
113
|
-
onTabClick:
|
|
108
|
+
onTabClick: setActive,
|
|
114
109
|
visibleLength: visibleLength,
|
|
115
110
|
monospacedWidth: monospacedWidth,
|
|
116
111
|
baseClassName: baseClassName,
|
|
@@ -132,7 +127,7 @@ const Tabs = _ref => {
|
|
|
132
127
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
133
128
|
className: `${baseClassName}__tab-panel`,
|
|
134
129
|
role: "tabpanel",
|
|
135
|
-
children: _react.Children.
|
|
130
|
+
children: _react.Children.toArray(children).map((tab, index) => index + 1 === active ? tab : null)
|
|
136
131
|
})]
|
|
137
132
|
});
|
|
138
133
|
};
|
package/cjs/index.js
CHANGED
|
@@ -46,5 +46,5 @@ Object.keys(_components).forEach(function (key) {
|
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
|
|
49
|
-
const version = exports.version = "3.43.
|
|
49
|
+
const version = exports.version = "3.43.2";
|
|
50
50
|
(0, _svg4everybody.default)();
|