@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
package/dist/plesk-ui-library.js
CHANGED
|
@@ -58886,7 +58886,7 @@ function useFocusVisible() {
|
|
|
58886
58886
|
/***/ ((module) => {
|
|
58887
58887
|
|
|
58888
58888
|
"use strict";
|
|
58889
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.43.
|
|
58889
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.43.2","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.(less|css)\\"","format:check":"prettier --check src styleguidist","format":"prettier --write src styleguidist","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.25.6","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.65.18","marked":"15.0.7","memoize-one":"^6.0.0","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"2.0.0","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^3.1.0","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.25.2","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.25.4","@babel/preset-env":"^7.25.4","@babel/preset-react":"^7.24.7","@babel/preset-typescript":"^7.24.7","@babel/types":"^7.25.6","@csstools/postcss-logical-float-and-clear":"^3.0.0","@plesk/eslint-config":"^4.0.0","@plesk/stylelint-config":"^3.0.1","@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.5.0","@testing-library/react":"^16.1.0","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.4","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.9","@types/jest":"^29.5.13","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^6.0.0","@types/node":"^22.5.5","@types/react":"^18.3.8","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.12","@types/react-transition-group":"^4.4.11","@types/svg4everybody":"2.1.5","@types/webpack-env":"^1.18.5","autoprefixer":"^10.4.20","babel-loader":"^10.0.0","babel-plugin-transform-require-ignore":"^0.1.1","cross-env":"^7.0.3","css-loader":"^7.1.2","css-minimizer-webpack-plugin":"^7.0.0","eslint":"^9.21.0","eslint-config-prettier":"^10.0.2","eslint-plugin-markdown":"^5.1.0","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^11.0.0","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^12.2.0","mini-css-extract-plugin":"^2.9.1","postcss":"^8.4.47","postcss-less":"^6.0.0","postcss-loader":"^8.1.1","postcss-logical":"^8.0.0","prettier":"^3.4.1","puppeteer-core":"22.15.0","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.3","rimraf":"^6.0.1","rtlcss":"^4.3.0","style-loader":"^4.0.0","stylelint":"^16.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^8.0.2","stylelint-prettier":"^5.0.2","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.8.2","typescript-eslint":"^8.26.0","webpack":"^5.94.0","webpack-cli":"^6.0.1"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
|
|
58890
58890
|
|
|
58891
58891
|
/***/ }),
|
|
58892
58892
|
|
|
@@ -79821,25 +79821,26 @@ const TabList = _ref => {
|
|
|
79821
79821
|
monospacedWidth,
|
|
79822
79822
|
baseClassName
|
|
79823
79823
|
} = _ref;
|
|
79824
|
-
|
|
79825
|
-
|
|
79826
|
-
|
|
79824
|
+
const handleTabClick = (tab, position) => {
|
|
79825
|
+
onTabClick(position);
|
|
79826
|
+
tab?.props?.onActivate?.();
|
|
79827
|
+
};
|
|
79827
79828
|
let tabs = _react.Children.toArray(children);
|
|
79828
79829
|
tabs = tabs.filter(child => child?.type === _Tab.default);
|
|
79829
79830
|
const listChildren = tabs.slice(0, visibleLength);
|
|
79830
79831
|
const menuChildren = tabs.slice(visibleLength);
|
|
79831
|
-
const listItems =
|
|
79832
|
+
const listItems = listChildren.map((tab, index) => {
|
|
79832
79833
|
const position = index + 1;
|
|
79833
79834
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabListItem.default, {
|
|
79834
79835
|
// eslint-disable-line react/no-array-index-key
|
|
79835
79836
|
tab: tab,
|
|
79836
79837
|
baseClassName: baseClassName,
|
|
79837
79838
|
selected: position === active,
|
|
79838
|
-
onClick: () =>
|
|
79839
|
+
onClick: () => handleTabClick(tab, position),
|
|
79839
79840
|
monospacedWidth: monospacedWidth
|
|
79840
79841
|
}, index);
|
|
79841
79842
|
});
|
|
79842
|
-
const menuItems =
|
|
79843
|
+
const menuItems = menuChildren.map((tab, index) => {
|
|
79843
79844
|
const position = listChildren.length + index + 1;
|
|
79844
79845
|
const {
|
|
79845
79846
|
title,
|
|
@@ -79868,7 +79869,7 @@ const TabList = _ref => {
|
|
|
79868
79869
|
})]
|
|
79869
79870
|
}),
|
|
79870
79871
|
active: active === position,
|
|
79871
|
-
onClick: () =>
|
|
79872
|
+
onClick: () => handleTabClick(tab, position),
|
|
79872
79873
|
className: `${baseClassName}__menu-item`,
|
|
79873
79874
|
component: Tag,
|
|
79874
79875
|
...tabProps,
|
|
@@ -80065,7 +80066,7 @@ const Tabs = _ref => {
|
|
|
80065
80066
|
const tabNavRef = (0, _react.useRef)(null);
|
|
80066
80067
|
const tabListRef = (0, _react.useRef)(null);
|
|
80067
80068
|
const fakeAddonRef = (0, _react.useRef)(null);
|
|
80068
|
-
const childrenCount = _react.Children.
|
|
80069
|
+
const childrenCount = _react.Children.toArray(children).length;
|
|
80069
80070
|
const [active, setActive] = (0, _useActive.useActive)(externalActive);
|
|
80070
80071
|
const {
|
|
80071
80072
|
monospacedWidth,
|
|
@@ -80080,11 +80081,6 @@ const Tabs = _ref => {
|
|
|
80080
80081
|
baseClassName,
|
|
80081
80082
|
childrenCount
|
|
80082
80083
|
});
|
|
80083
|
-
const handleTabClick = active => {
|
|
80084
|
-
setActive(active);
|
|
80085
|
-
const tab = Array.isArray(children) ? children[active - 1] : children;
|
|
80086
|
-
tab?.props?.onActivate?.();
|
|
80087
|
-
};
|
|
80088
80084
|
const [searching, setSearching] = (0, _react.useState)(false);
|
|
80089
80085
|
if (!childrenCount) {
|
|
80090
80086
|
return null;
|
|
@@ -80135,7 +80131,7 @@ const Tabs = _ref => {
|
|
|
80135
80131
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabList.default, {
|
|
80136
80132
|
tabListRef: tabListRef,
|
|
80137
80133
|
active: active,
|
|
80138
|
-
onTabClick:
|
|
80134
|
+
onTabClick: setActive,
|
|
80139
80135
|
visibleLength: visibleLength,
|
|
80140
80136
|
monospacedWidth: monospacedWidth,
|
|
80141
80137
|
baseClassName: baseClassName,
|
|
@@ -80157,7 +80153,7 @@ const Tabs = _ref => {
|
|
|
80157
80153
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
80158
80154
|
className: `${baseClassName}__tab-panel`,
|
|
80159
80155
|
role: "tabpanel",
|
|
80160
|
-
children: _react.Children.
|
|
80156
|
+
children: _react.Children.toArray(children).map((tab, index) => index + 1 === active ? tab : null)
|
|
80161
80157
|
})]
|
|
80162
80158
|
});
|
|
80163
80159
|
};
|