@plesk/ui-library 3.35.5 → 3.35.7
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/AutoClosable/AutoClosable.js +1 -0
- package/cjs/components/InputNumber/InputNumber.js +2 -2
- package/cjs/components/Item/Item.js +64 -153
- package/cjs/components/Overlay/Overlay.js +29 -27
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/SegmentedControl/SegmentedControl.js +1 -0
- package/cjs/components/Tabs/SearchBar.js +40 -147
- package/cjs/components/Tabs/Tab.js +2 -49
- package/cjs/components/Tabs/Tabs.js +48 -99
- package/cjs/components/Toolbar/ToolbarItem.js +1 -0
- package/cjs/components/index.js +21 -11
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library.js +442 -628
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +8 -12
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/AutoClosable/AutoClosable.js +1 -0
- package/esm/components/InputNumber/InputNumber.js +2 -2
- package/esm/components/Item/Item.js +64 -153
- package/esm/components/Overlay/Overlay.js +29 -27
- package/esm/components/Popover/Popover.js +1 -1
- package/esm/components/SegmentedControl/SegmentedControl.js +1 -0
- package/esm/components/Tabs/SearchBar.js +40 -147
- package/esm/components/Tabs/Tab.js +1 -49
- package/esm/components/Tabs/Tabs.js +49 -99
- package/esm/components/Toolbar/ToolbarItem.js +1 -0
- package/esm/components/index.js +2 -3
- package/esm/index.js +1 -1
- package/package.json +29 -35
- package/styleguide/build/bundle.a2d3190d.js +2 -0
- package/styleguide/build/{bundle.ecbe3015.js.LICENSE.txt → bundle.a2d3190d.js.LICENSE.txt} +27 -23
- package/styleguide/index.html +2 -2
- package/types/src/components/Action/Action.d.ts +1 -1
- package/types/src/components/Alert/Alert.d.ts +1 -1
- package/types/src/components/AutoClosable/AutoClosable.d.ts +23 -21
- package/types/src/components/AuxiliaryActions/AuxiliaryActions.d.ts +1 -1
- package/types/src/components/Badge/Badge.d.ts +1 -1
- package/types/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/types/src/components/Button/Button.d.ts +2 -2
- package/types/src/components/Button/ButtonContext.d.ts +1 -1
- package/types/src/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/types/src/components/Card/PreviewPanel.d.ts +4 -3
- package/types/src/components/Carousel/Carousel.d.ts +1 -1
- package/types/src/components/Checkbox/Checkbox.d.ts +1 -1
- package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +1 -1
- package/types/src/components/ComboBox/ComboBox.d.ts +2 -2
- package/types/src/components/ComboBox/ComboBoxOption.d.ts +1 -1
- package/types/src/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +5 -5
- package/types/src/components/ConsoleOutput/ConsoleOutput.d.ts +2 -2
- package/types/src/components/ContentLoader/ContentLoader.d.ts +2 -2
- package/types/src/components/ContentLoader/IconsLoader.d.ts +2 -2
- package/types/src/components/Cuttable/Cuttable.d.ts +3 -3
- package/types/src/components/Dialog/Dialog.d.ts +3 -3
- package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +1 -1
- package/types/src/components/Drawer/Drawer.d.ts +1 -1
- package/types/src/components/Drawer/DrawerProgress.d.ts +4 -4
- package/types/src/components/Drawer/Header.d.ts +1 -1
- package/types/src/components/Dropdown/Dropdown.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessage.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageActions.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.d.ts +1 -1
- package/types/src/components/Figure/Figure.d.ts +1 -1
- package/types/src/components/Form/Form.d.ts +2 -2
- package/types/src/components/Form/types.d.ts +7 -7
- package/types/src/components/Form/utils.d.ts +3 -3
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.d.ts +1 -1
- package/types/src/components/FormFieldPassword/FormFieldPassword.d.ts +4 -4
- package/types/src/components/FormFieldPassword/PasswordMeter.d.ts +1 -1
- package/types/src/components/FormFieldPassword/estimatePassword.d.ts +2 -2
- package/types/src/components/FormFieldSelect/FormFieldSelect.d.ts +2 -2
- package/types/src/components/FormFieldText/FormFieldText.d.ts +4 -4
- package/types/src/components/Grid/Grid.d.ts +4 -4
- package/types/src/components/GridCol/GridCol.d.ts +2 -2
- package/types/src/components/Heading/Heading.d.ts +1 -1
- package/types/src/components/Hint/Hint.d.ts +1 -1
- package/types/src/components/Icon/Icon.d.ts +3 -3
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/InPlaceEdit/InPlaceEdit.d.ts +2 -2
- package/types/src/components/Input/Input.d.ts +4 -3
- package/types/src/components/InputFile/InputFile.d.ts +1 -1
- package/types/src/components/Item/Item.d.ts +79 -0
- package/types/src/components/Item/index.d.ts +2 -0
- package/types/src/components/ItemLink/ItemLink.d.ts +1 -1
- package/types/src/components/ItemList/ItemList.d.ts +7 -7
- package/types/src/components/Label/Label.d.ts +3 -3
- package/types/src/components/Layer/Layer.d.ts +1 -1
- package/types/src/components/Layout/Layout.d.ts +9 -9
- package/types/src/components/Link/Link.d.ts +3 -3
- package/types/src/components/List/ListAction.d.ts +5 -5
- package/types/src/components/List/ListActions.d.ts +2 -2
- package/types/src/components/List/ListActionsDivider.d.ts +2 -2
- package/types/src/components/List/ListEmptyView.d.ts +1 -1
- package/types/src/components/List/ListOperation.d.ts +9 -5
- package/types/src/components/List/ListOperationContext.d.ts +2 -2
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +5 -5
- package/types/src/components/Markdown/Markdown.d.ts +2 -2
- package/types/src/components/Media/Media.d.ts +1 -1
- package/types/src/components/Media/MediaSection.d.ts +1 -1
- package/types/src/components/Menu/Menu.d.ts +1 -1
- package/types/src/components/Menu/MenuBaseItem.d.ts +3 -3
- package/types/src/components/Menu/MenuDivider.d.ts +1 -1
- package/types/src/components/Menu/MenuHeader.d.ts +1 -1
- package/types/src/components/Menu/MenuItem.d.ts +2 -2
- package/types/src/components/Menu/MenuSelectableItem.d.ts +2 -2
- package/types/src/components/Overlay/Overlay.d.ts +2 -2
- package/types/src/components/PageHeader/PageHeader.d.ts +3 -2
- package/types/src/components/Pagination/Pagination.d.ts +2 -2
- package/types/src/components/Panel/Panel.d.ts +3 -3
- package/types/src/components/Paragraph/Paragraph.d.ts +1 -1
- package/types/src/components/Plaintext/Plaintext.d.ts +1 -1
- package/types/src/components/Popover/Popover.d.ts +5 -3
- package/types/src/components/Popper/Popper.d.ts +2 -2
- package/types/src/components/Progress/Progress.d.ts +2 -2
- package/types/src/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/types/src/components/ProgressBar/ProgressIndicator.d.ts +1 -1
- package/types/src/components/ProgressDialog/ProgressDialog.d.ts +2 -2
- package/types/src/components/ProgressStep/ProgressStep.d.ts +2 -2
- package/types/src/components/Radio/Radio.d.ts +1 -1
- package/types/src/components/Rating/Rating.d.ts +1 -1
- package/types/src/components/Section/Section.d.ts +5 -5
- package/types/src/components/Section/SectionItem.d.ts +1 -1
- package/types/src/components/SegmentedControl/SegmentedControl.d.ts +16 -12
- package/types/src/components/Select/MultiValue.d.ts +1 -1
- package/types/src/components/Select/Select.d.ts +1 -1
- package/types/src/components/Select/SelectControl.d.ts +1 -1
- package/types/src/components/Select/SelectOption.d.ts +1 -1
- package/types/src/components/Select/SelectOptionGroup.d.ts +1 -1
- package/types/src/components/Select/structures.d.ts +3 -3
- package/types/src/components/Skeleton/Skeleton.d.ts +1 -1
- package/types/src/components/Spinner/Spinner.d.ts +1 -1
- package/types/src/components/SplitButton/SplitButton.d.ts +1 -1
- package/types/src/components/Spot/Spot.d.ts +1 -1
- package/types/src/components/Spot/SpotPopup.d.ts +5 -3
- package/types/src/components/Squeezer/Squeezer.d.ts +2 -2
- package/types/src/components/Status/Status.d.ts +3 -3
- package/types/src/components/StatusMessage/StatusMessage.d.ts +1 -1
- package/types/src/components/Subnav/Subnav.d.ts +1 -1
- package/types/src/components/Switch/Switch.d.ts +3 -2
- package/types/src/components/SwitchesPanel/SwitchesPanel.d.ts +1 -1
- package/types/src/components/SwitchesPanelItem/SwitchesPanelItem.d.ts +1 -1
- package/types/src/components/Tabs/SearchBar.d.ts +107 -0
- package/types/src/components/Tabs/Tab.d.ts +62 -0
- package/types/src/components/Tabs/Tabs.d.ts +111 -0
- package/types/src/components/Tabs/index.d.ts +6 -0
- package/types/src/components/Text/Text.d.ts +1 -1
- package/types/src/components/TextArea/TextArea.d.ts +4 -4
- package/types/src/components/Toast/Toast.d.ts +2 -2
- package/types/src/components/Toaster/Toaster.d.ts +4 -4
- package/types/src/components/Toolbar/RegistryContext.d.ts +2 -2
- package/types/src/components/Toolbar/Toolbar.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarExpander.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/src/components/Toolbar/ToolbarMenu.d.ts +1 -1
- package/types/src/components/Tooltip/Tooltip.d.ts +2 -2
- package/types/src/components/Tour/Tour.d.ts +2 -2
- package/types/src/components/Translate/Translate.d.ts +5 -3
- package/types/src/components/index.d.ts +4 -3
- package/types/src/components/utils.d.ts +5 -5
- package/types/src/utils/types/PolymorphicComponent.d.ts +5 -5
- package/styleguide/build/bundle.ecbe3015.js +0 -2
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import React, { cloneElement, isValidElement, Component, Fragment, Children } from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
4
|
import classNames from 'classnames';
|
|
5
|
+
import { Children, cloneElement, Component, Fragment, isValidElement } from 'react';
|
|
7
6
|
import Measure from 'react-measure';
|
|
8
7
|
import { CLS_PREFIX } from '../../constants';
|
|
8
|
+
import Dropdown from '../Dropdown';
|
|
9
9
|
import Icon, { ICON_SIZE_16 } from '../Icon';
|
|
10
10
|
import Label from '../Label';
|
|
11
|
-
import Dropdown from '../Dropdown';
|
|
12
11
|
import Menu, { MenuItem } from '../Menu';
|
|
13
|
-
import Tab from './Tab';
|
|
14
12
|
import ResponsiveContext from '../ResponsiveContext';
|
|
15
13
|
import { wrapFunction } from '../utils';
|
|
14
|
+
import Tab from './Tab';
|
|
16
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
18
|
const ADDON_LEFT_PADDING = 5;
|
|
19
19
|
const MIN_ADDON_WIDTH_DEFAULT = 150;
|
|
20
20
|
const COLLAPSED_SEARCH_WIDTH = 60;
|
|
21
|
-
|
|
22
21
|
/**
|
|
23
22
|
* `Tabs` component is a content area with a group of individual [Tab](#!/Tab) elements, each displaying different content
|
|
24
23
|
* in the same screen area. `Tabs` are used when you have too much content to display in one place at the same time, so
|
|
@@ -34,9 +33,12 @@ class Tabs extends Component {
|
|
|
34
33
|
collapsedLength: 0,
|
|
35
34
|
compact: false,
|
|
36
35
|
searching: false,
|
|
37
|
-
monospacedWidth:
|
|
36
|
+
monospacedWidth: 0
|
|
38
37
|
});
|
|
39
|
-
_defineProperty(this, "widths",
|
|
38
|
+
_defineProperty(this, "widths", void 0);
|
|
39
|
+
_defineProperty(this, "addon", void 0);
|
|
40
|
+
_defineProperty(this, "tabsnavRef", void 0);
|
|
41
|
+
_defineProperty(this, "moreTabsRef", null);
|
|
40
42
|
_defineProperty(this, "checkAdaptive", () => {
|
|
41
43
|
let {
|
|
42
44
|
compact,
|
|
@@ -52,12 +54,12 @@ class Tabs extends Component {
|
|
|
52
54
|
widths,
|
|
53
55
|
addon
|
|
54
56
|
} = this;
|
|
55
|
-
let monospacedWidth =
|
|
57
|
+
let monospacedWidth = 0;
|
|
56
58
|
const getMonospacedWidth = () => monospacedWidth;
|
|
57
59
|
if (!widths) {
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
|
-
const addonMinWidth = ADDON_LEFT_PADDING + (addonMinWidthProp || (search
|
|
62
|
+
const addonMinWidth = ADDON_LEFT_PADDING + (addonMinWidthProp || (search?.props.minWidth ?? MIN_ADDON_WIDTH_DEFAULT));
|
|
61
63
|
const searchWidth = compact && search ? COLLAPSED_SEARCH_WIDTH + ADDON_LEFT_PADDING : 0;
|
|
62
64
|
const {
|
|
63
65
|
more,
|
|
@@ -68,7 +70,7 @@ class Tabs extends Component {
|
|
|
68
70
|
const tabsNumber = tabs.length;
|
|
69
71
|
let lastTabIndex = tabsNumber - 1 - collapsedLength;
|
|
70
72
|
if (monospaced) {
|
|
71
|
-
monospacedWidth = tabs.slice(0, lastTabIndex + 1)
|
|
73
|
+
monospacedWidth = Math.max(...tabs.slice(0, lastTabIndex + 1));
|
|
72
74
|
tabs = tabs.map(getMonospacedWidth);
|
|
73
75
|
}
|
|
74
76
|
const getListWidth = () => {
|
|
@@ -140,9 +142,7 @@ class Tabs extends Component {
|
|
|
140
142
|
collapsedLength,
|
|
141
143
|
monospacedWidth
|
|
142
144
|
};
|
|
143
|
-
const
|
|
144
|
-
for (let i = 0; i < keys.length; i++) {
|
|
145
|
-
const key = keys[i];
|
|
145
|
+
for (const key of Object.keys(newState)) {
|
|
146
146
|
if (JSON.stringify(newState[key]) === JSON.stringify(this.state[key])) {
|
|
147
147
|
delete newState[key];
|
|
148
148
|
}
|
|
@@ -177,7 +177,7 @@ class Tabs extends Component {
|
|
|
177
177
|
tabs,
|
|
178
178
|
more: more.offsetWidth,
|
|
179
179
|
container: this.tabsnavRef.offsetWidth,
|
|
180
|
-
margin: more.offsetWidth - more.querySelector(`.${baseClassName}__link`)
|
|
180
|
+
margin: more.offsetWidth - (more.querySelector(`.${baseClassName}__link`)?.offsetWidth ?? 0)
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
this.checkAdaptive();
|
|
@@ -241,9 +241,9 @@ class Tabs extends Component {
|
|
|
241
241
|
children: /*#__PURE__*/_jsxs(Tag, {
|
|
242
242
|
className: `${baseClassName}__link`,
|
|
243
243
|
role: "tab",
|
|
244
|
-
"aria-selected": selected ||
|
|
244
|
+
"aria-selected": selected || undefined,
|
|
245
245
|
style: {
|
|
246
|
-
width: monospacedWidth
|
|
246
|
+
width: monospacedWidth || undefined
|
|
247
247
|
},
|
|
248
248
|
onClick: handleClick,
|
|
249
249
|
...tabProps,
|
|
@@ -270,21 +270,16 @@ class Tabs extends Component {
|
|
|
270
270
|
return nextState;
|
|
271
271
|
}
|
|
272
272
|
componentDidUpdate() {
|
|
273
|
-
if (!this.widths || this.props.children
|
|
274
|
-
setTimeout(() => this.handleResize()
|
|
273
|
+
if (!this.widths || Children.count(this.props.children) !== this.widths.tabs.length) {
|
|
274
|
+
setTimeout(() => this.handleResize());
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
onClick(active) {
|
|
278
278
|
this.setState({
|
|
279
279
|
active
|
|
280
280
|
});
|
|
281
|
-
const tab = this.props.children[active - 1];
|
|
282
|
-
|
|
283
|
-
onActivate
|
|
284
|
-
} = tab.props;
|
|
285
|
-
if (onActivate) {
|
|
286
|
-
onActivate();
|
|
287
|
-
}
|
|
281
|
+
const tab = Array.isArray(this.props.children) ? this.props.children[active - 1] : this.props.children;
|
|
282
|
+
tab?.props?.onActivate?.();
|
|
288
283
|
}
|
|
289
284
|
renderTabLabel(tabMode, label) {
|
|
290
285
|
const {
|
|
@@ -331,7 +326,7 @@ class Tabs extends Component {
|
|
|
331
326
|
children
|
|
332
327
|
} = this.props;
|
|
333
328
|
const childrenCount = Children.count(children);
|
|
334
|
-
if (!childrenCount) {
|
|
329
|
+
if (!childrenCount || !children) {
|
|
335
330
|
return null;
|
|
336
331
|
}
|
|
337
332
|
return /*#__PURE__*/_jsxs("ul", {
|
|
@@ -357,19 +352,19 @@ class Tabs extends Component {
|
|
|
357
352
|
className: classNames(`${baseClassName}__tab`, closeBlock && `${baseClassName}__tab--closable`),
|
|
358
353
|
children: [/*#__PURE__*/_jsxs("a", {
|
|
359
354
|
className: `${baseClassName}__link`,
|
|
360
|
-
tabIndex:
|
|
355
|
+
tabIndex: -1,
|
|
361
356
|
style: tabProps.style,
|
|
362
357
|
children: [iconBlock, /*#__PURE__*/_jsx("span", {
|
|
363
358
|
className: `${baseClassName}__tab-title`,
|
|
364
359
|
children: title
|
|
365
360
|
}), this.renderTabLabel('tab', label)]
|
|
366
361
|
}), closeBlock]
|
|
367
|
-
}, title);
|
|
362
|
+
}, `${title}`);
|
|
368
363
|
}), /*#__PURE__*/_jsx("li", {
|
|
369
364
|
className: classNames(`${baseClassName}__tab`, `${baseClassName}__tab--more`),
|
|
370
365
|
children: /*#__PURE__*/_jsx("a", {
|
|
371
366
|
className: `${baseClassName}__link`,
|
|
372
|
-
tabIndex:
|
|
367
|
+
tabIndex: -1,
|
|
373
368
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
374
369
|
name: "three-dots-horizontal"
|
|
375
370
|
})
|
|
@@ -390,7 +385,10 @@ class Tabs extends Component {
|
|
|
390
385
|
Children.forEach(children, (child, index) => {
|
|
391
386
|
const hidden = index > lastTabIndex;
|
|
392
387
|
const tabMode = hidden ? 'menu-item' : 'tab';
|
|
393
|
-
|
|
388
|
+
const renderedTab = this.renderTabItem(child, index, tabMode);
|
|
389
|
+
if (renderedTab) {
|
|
390
|
+
(hidden ? hiddenItems : visibleItems).push(renderedTab);
|
|
391
|
+
}
|
|
394
392
|
});
|
|
395
393
|
return {
|
|
396
394
|
visibleItems,
|
|
@@ -420,7 +418,7 @@ class Tabs extends Component {
|
|
|
420
418
|
ref: ref => this.moreTabsRef = ref,
|
|
421
419
|
className: classNames(`${baseClassName}__tab`, moreSelected && `${baseClassName}__tab--selected`, `${baseClassName}__tab--more`),
|
|
422
420
|
role: "presentation",
|
|
423
|
-
"aria-selected": moreSelected ||
|
|
421
|
+
"aria-selected": moreSelected || undefined,
|
|
424
422
|
children: /*#__PURE__*/_jsx(Dropdown, {
|
|
425
423
|
className: `${baseClassName}__dropdown`,
|
|
426
424
|
menu: /*#__PURE__*/_jsx(Menu, {
|
|
@@ -430,8 +428,8 @@ class Tabs extends Component {
|
|
|
430
428
|
children: /*#__PURE__*/_jsx("a", {
|
|
431
429
|
className: `${baseClassName}__link`,
|
|
432
430
|
role: "tab",
|
|
433
|
-
tabIndex:
|
|
434
|
-
"aria-selected": moreSelected ||
|
|
431
|
+
tabIndex: 0,
|
|
432
|
+
"aria-selected": moreSelected || undefined,
|
|
435
433
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
436
434
|
name: "three-dots-horizontal"
|
|
437
435
|
})
|
|
@@ -445,6 +443,9 @@ class Tabs extends Component {
|
|
|
445
443
|
baseClassName,
|
|
446
444
|
search
|
|
447
445
|
} = this.props;
|
|
446
|
+
if (!search) {
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
448
449
|
const {
|
|
449
450
|
compact
|
|
450
451
|
} = this.state;
|
|
@@ -478,7 +479,8 @@ class Tabs extends Component {
|
|
|
478
479
|
if (!childrenCount) {
|
|
479
480
|
return null;
|
|
480
481
|
}
|
|
481
|
-
|
|
482
|
+
const addonElement = addon || placeholder;
|
|
483
|
+
let addonBlock = addonElement;
|
|
482
484
|
const addonProps = {};
|
|
483
485
|
let searchBlock = null;
|
|
484
486
|
if (search) {
|
|
@@ -489,19 +491,21 @@ class Tabs extends Component {
|
|
|
489
491
|
};
|
|
490
492
|
if (compact) {
|
|
491
493
|
if (searching) {
|
|
492
|
-
searchProps.maxWidth =
|
|
493
|
-
searchProps.minWidth =
|
|
494
|
+
searchProps.maxWidth = undefined;
|
|
495
|
+
searchProps.minWidth = undefined;
|
|
494
496
|
searchProps.autoFocus = true;
|
|
495
497
|
searchProps.responsive = false;
|
|
496
498
|
} else {
|
|
497
499
|
searchProps.onSearch = this.handleStartSearching;
|
|
498
500
|
}
|
|
499
501
|
searchBlock = this.renderSearchBar(searchProps);
|
|
500
|
-
} else if (
|
|
502
|
+
} else if (addonElement) {
|
|
501
503
|
searchProps.key = 1;
|
|
502
|
-
addonBlock =
|
|
503
|
-
|
|
504
|
-
|
|
504
|
+
addonBlock = /*#__PURE__*/_jsxs(_Fragment, {
|
|
505
|
+
children: [this.renderSearchBar(searchProps), /*#__PURE__*/cloneElement(addonElement, {
|
|
506
|
+
key: 2
|
|
507
|
+
})]
|
|
508
|
+
});
|
|
505
509
|
} else {
|
|
506
510
|
addonProps.style = {
|
|
507
511
|
maxWidth: search.props.maxWidth
|
|
@@ -530,9 +534,10 @@ class Tabs extends Component {
|
|
|
530
534
|
let {
|
|
531
535
|
measureRef: ref
|
|
532
536
|
} = _ref2;
|
|
533
|
-
|
|
537
|
+
const fakeTabs = this.renderFakeTabs();
|
|
538
|
+
return fakeTabs ? /*#__PURE__*/cloneElement(fakeTabs, {
|
|
534
539
|
ref
|
|
535
|
-
});
|
|
540
|
+
}) : null;
|
|
536
541
|
}
|
|
537
542
|
}), searchBlock, addonBlock && /*#__PURE__*/_jsx(Measure, {
|
|
538
543
|
onResize: this.handleAddonResize,
|
|
@@ -560,62 +565,7 @@ class Tabs extends Component {
|
|
|
560
565
|
});
|
|
561
566
|
}
|
|
562
567
|
}
|
|
563
|
-
Tabs
|
|
564
|
-
/**
|
|
565
|
-
* Number of active tab
|
|
566
|
-
* @since 0.0.35
|
|
567
|
-
*/
|
|
568
|
-
active: PropTypes.number,
|
|
569
|
-
/**
|
|
570
|
-
* Addon for search bar, dropdown etc.
|
|
571
|
-
* @since 0.0.58
|
|
572
|
-
*/
|
|
573
|
-
addon: PropTypes.element,
|
|
574
|
-
/**
|
|
575
|
-
* Placeholder for search bar, dropdown etc.
|
|
576
|
-
*
|
|
577
|
-
* @deprecated Do not use! Use `addon` instead!
|
|
578
|
-
* @since 0.0.42
|
|
579
|
-
*/
|
|
580
|
-
placeholder: PropTypes.element,
|
|
581
|
-
/**
|
|
582
|
-
* Minimum add-on width in pixels
|
|
583
|
-
* @since 0.0.58
|
|
584
|
-
*/
|
|
585
|
-
addonMinWidth: PropTypes.number,
|
|
586
|
-
/**
|
|
587
|
-
* Monospaced version of tabs (all visible tabs as wide as widest of them)
|
|
588
|
-
* @since 0.0.58
|
|
589
|
-
*/
|
|
590
|
-
monospaced: PropTypes.bool,
|
|
591
|
-
/**
|
|
592
|
-
* [SearchBar](#!/SearchBar) element
|
|
593
|
-
* @since 0.0.58
|
|
594
|
-
*/
|
|
595
|
-
search: PropTypes.element,
|
|
596
|
-
/**
|
|
597
|
-
* [Tabs](#!/Tab)
|
|
598
|
-
* @since 0.0.47
|
|
599
|
-
*/
|
|
600
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
|
|
601
|
-
/**
|
|
602
|
-
* @ignore
|
|
603
|
-
*/
|
|
604
|
-
className: PropTypes.string,
|
|
605
|
-
/**
|
|
606
|
-
* @ignore
|
|
607
|
-
*/
|
|
608
|
-
baseClassName: PropTypes.string
|
|
609
|
-
};
|
|
610
|
-
Tabs.defaultProps = {
|
|
611
|
-
active: null,
|
|
612
|
-
addon: null,
|
|
613
|
-
placeholder: null,
|
|
614
|
-
addonMinWidth: null,
|
|
615
|
-
monospaced: null,
|
|
616
|
-
search: null,
|
|
617
|
-
children: null,
|
|
618
|
-
className: null,
|
|
568
|
+
_defineProperty(Tabs, "defaultProps", {
|
|
619
569
|
baseClassName: `${CLS_PREFIX}tabs`
|
|
620
|
-
};
|
|
570
|
+
});
|
|
621
571
|
export default Tabs;
|
package/esm/components/index.js
CHANGED
|
@@ -59,7 +59,7 @@ export { default as LocaleProvider } from './LocaleProvider';
|
|
|
59
59
|
export * from './LocaleProvider';
|
|
60
60
|
export { default as Markdown } from './Markdown';
|
|
61
61
|
export { default as Media, MediaSection } from './Media';
|
|
62
|
-
export { default as Menu, MenuDivider, MenuHeader, MenuItem, MenuSelectableItem } from './Menu';
|
|
62
|
+
export { default as Menu, MenuDivider, MenuHeader, MenuItem, MenuSelectableItem, MenuBaseItem } from './Menu';
|
|
63
63
|
export { default as Overlay } from './Overlay';
|
|
64
64
|
export { default as PageHeader } from './PageHeader';
|
|
65
65
|
export { default as Pagination } from './Pagination';
|
|
@@ -85,8 +85,7 @@ export { default as Subnav, SubnavItem } from './Subnav';
|
|
|
85
85
|
export { default as Switch } from './Switch';
|
|
86
86
|
export { default as SwitchesPanel } from './SwitchesPanel';
|
|
87
87
|
export { default as SwitchesPanelItem } from './SwitchesPanelItem';
|
|
88
|
-
export { default as Tabs } from './Tabs';
|
|
89
|
-
export * from './Tabs';
|
|
88
|
+
export { default as Tabs, Tab, SearchBar } from './Tabs';
|
|
90
89
|
export { default as Text } from './Text';
|
|
91
90
|
export { default as Toaster } from './Toaster';
|
|
92
91
|
export { default as Toolbar, ToolbarGroup, ToolbarExpander } from './Toolbar';
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.35.
|
|
3
|
+
"version": "3.35.7",
|
|
4
4
|
"description": "Plesk UI Library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -21,13 +21,14 @@
|
|
|
21
21
|
"build:cjs": "cross-env NODE_ENV=cjs node ./scripts/build.js",
|
|
22
22
|
"build:types": "rimraf ./types && tsc --project ./configs/types-generator.config.json",
|
|
23
23
|
"create-svg-sprite": "node ./scripts/create-svg-sprite.js",
|
|
24
|
-
"lint": "yarn lint:es && yarn lint:types && yarn lint:style",
|
|
24
|
+
"lint": "yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check",
|
|
25
25
|
"lint:es": "eslint --ext js,md,tsx src configs scripts styleguidist",
|
|
26
26
|
"lint:types": "tsc",
|
|
27
27
|
"lint:style": "stylelint \"{src,styleguidist}/**/*.less\"",
|
|
28
|
+
"format:check": "prettier --check src",
|
|
29
|
+
"format": "prettier --write src",
|
|
28
30
|
"styleguide": "styleguidist server --config ./configs/styleguide.config.js",
|
|
29
31
|
"styleguide:build": "styleguidist build --config ./configs/styleguide.config.js",
|
|
30
|
-
"create-component": "node scripts/create-component.js",
|
|
31
32
|
"prepublishOnly": "yarn install && yarn test && yarn build && yarn styleguide:build",
|
|
32
33
|
"storybook": "webpack serve --config ./configs/storybook.config.js --allowed-hosts all",
|
|
33
34
|
"postinstall": "node ./scripts/postinstall.js"
|
|
@@ -70,57 +71,52 @@
|
|
|
70
71
|
"@plesk/eslint-config": "^3.0.0",
|
|
71
72
|
"@plesk/stylelint-config": "^2.0.0",
|
|
72
73
|
"@testing-library/dom": "^9.3.3",
|
|
73
|
-
"@testing-library/jest-dom": "^
|
|
74
|
-
"@testing-library/react": "^
|
|
75
|
-
"@testing-library/user-event": "^
|
|
74
|
+
"@testing-library/jest-dom": "^6.1.3",
|
|
75
|
+
"@testing-library/react": "^14.0.0",
|
|
76
|
+
"@testing-library/user-event": "^14.5.1",
|
|
76
77
|
"@types/buble": "^0.20.2",
|
|
77
78
|
"@types/classnames": "2.3.1",
|
|
78
79
|
"@types/doctrine": "^0.0.5",
|
|
79
|
-
"@types/
|
|
80
|
-
"@types/jest": "^27.5.2",
|
|
80
|
+
"@types/jest": "^29.5.5",
|
|
81
81
|
"@types/jest-image-snapshot": "^6.2.1",
|
|
82
|
-
"@types/marked": "^4.3.
|
|
83
|
-
"@types/node": "^16.18.
|
|
84
|
-
"@types/react": "^
|
|
85
|
-
"@types/react-dom": "^
|
|
86
|
-
"@types/react-measure": "2.0.
|
|
87
|
-
"@types/react-transition-group": "^4.4.
|
|
82
|
+
"@types/marked": "^4.3.2",
|
|
83
|
+
"@types/node": "^16.18.58",
|
|
84
|
+
"@types/react": "^18.2.25",
|
|
85
|
+
"@types/react-dom": "^18.2.11",
|
|
86
|
+
"@types/react-measure": "2.0.9",
|
|
87
|
+
"@types/react-transition-group": "^4.4.7",
|
|
88
88
|
"@types/svg4everybody": "2.1.2",
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
90
|
-
"@typescript-eslint/parser": "^
|
|
91
|
-
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
|
90
|
+
"@typescript-eslint/parser": "^6.7.4",
|
|
92
91
|
"autoprefixer": "^10.4.16",
|
|
93
92
|
"babel-loader": "^8.3.0",
|
|
94
93
|
"babel-plugin-transform-require-ignore": "^0.1.1",
|
|
95
94
|
"clean-webpack-plugin": "^4.0.0",
|
|
96
|
-
"cross-env": "^
|
|
95
|
+
"cross-env": "^7.0.3",
|
|
97
96
|
"css-loader": "^6.8.1",
|
|
98
97
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
99
|
-
"
|
|
100
|
-
"enzyme-to-json": "^3.6.2",
|
|
101
|
-
"eslint": "^8.50.0",
|
|
98
|
+
"eslint": "^8.51.0",
|
|
102
99
|
"eslint-config-prettier": "^8.10.0",
|
|
103
100
|
"eslint-plugin-markdown": "^3.0.1",
|
|
104
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
105
101
|
"html-webpack-plugin": "^5.5.3",
|
|
106
|
-
"
|
|
107
|
-
"jest": "^
|
|
108
|
-
"jest-
|
|
102
|
+
"jest": "^29.7.0",
|
|
103
|
+
"jest-dev-server": "^9.0.1",
|
|
104
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
109
105
|
"jest-image-snapshot": "^6.2.0",
|
|
110
106
|
"less": "^4.2.0",
|
|
111
107
|
"less-loader": "^11.1.3",
|
|
112
108
|
"mini-css-extract-plugin": "^2.7.6",
|
|
113
|
-
"postcss": "^8.4.
|
|
109
|
+
"postcss": "^8.4.31",
|
|
114
110
|
"postcss-less": "^6.0.0",
|
|
115
111
|
"postcss-loader": "^7.3.3",
|
|
116
112
|
"postcss-logical": "^6.2.0",
|
|
117
113
|
"prettier": "^2.8.8",
|
|
118
114
|
"puppeteer-core": "20.4.0",
|
|
119
|
-
"react": "^
|
|
115
|
+
"react": "^18.2.0",
|
|
120
116
|
"react-docgen-typescript": "^2.2.2",
|
|
121
|
-
"react-dom": "^
|
|
122
|
-
"react-styleguidist": "^
|
|
123
|
-
"rimraf": "^5.0.
|
|
117
|
+
"react-dom": "^18.2.0",
|
|
118
|
+
"react-styleguidist": "^13.1.1",
|
|
119
|
+
"rimraf": "^5.0.5",
|
|
124
120
|
"rtlcss": "^4.1.1",
|
|
125
121
|
"style-loader": "^3.3.3",
|
|
126
122
|
"stylelint": "^15.10.3",
|
|
@@ -130,17 +126,15 @@
|
|
|
130
126
|
"stylelint-use-logical-spec": "^5.0.0",
|
|
131
127
|
"svg-mixer": "^2.3.14",
|
|
132
128
|
"terser-webpack-plugin": "^5.3.9",
|
|
133
|
-
"typescript": "
|
|
129
|
+
"typescript": "5.2.2",
|
|
134
130
|
"webpack": "^5.88.2",
|
|
135
131
|
"webpack-cli": "^5.1.4"
|
|
136
132
|
},
|
|
137
133
|
"peerDependencies": {
|
|
138
|
-
"react": "^
|
|
139
|
-
"react-dom": "^
|
|
134
|
+
"react": "^18.2.0",
|
|
135
|
+
"react-dom": "^18.2.0"
|
|
140
136
|
},
|
|
141
137
|
"resolutions": {
|
|
142
|
-
"@babel/types": "^7.15.6",
|
|
143
|
-
"@types/react": "^17.0.39",
|
|
144
138
|
"trim": ">=0.0.3",
|
|
145
139
|
"postcss": "^8.4.23"
|
|
146
140
|
},
|