@plesk/ui-library 3.35.2 → 3.35.4
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/Action/Action.js +1 -2
- package/cjs/components/Alert/Alert.js +1 -2
- package/cjs/components/AutoClosable/AutoClosable.js +1 -2
- package/cjs/components/AuxiliaryActions/AuxiliaryActions.js +1 -2
- package/cjs/components/Badge/Badge.js +1 -2
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/cjs/components/Button/Button.js +1 -2
- package/cjs/components/Button/ButtonContext.js +2 -4
- package/cjs/components/ButtonGroup/ButtonGroup.js +1 -2
- package/cjs/components/Card/Card.js +1 -2
- package/cjs/components/Card/CardButton.js +1 -2
- package/cjs/components/Card/PreviewPanel.js +1 -2
- package/cjs/components/CardList/CardList.js +5 -10
- package/cjs/components/CardList/CardListToolbar.js +1 -2
- package/cjs/components/Carousel/Carousel.js +1 -2
- package/cjs/components/Checkbox/Checkbox.js +1 -2
- package/cjs/components/ClosingConfirmation/locale/en-US.js +2 -3
- package/cjs/components/ClosingConfirmation/useClosingConfirmation.js +1 -2
- package/cjs/components/CodeEditor/CodeEditor.js +1 -2
- package/cjs/components/Columns/Column.js +1 -2
- package/cjs/components/Columns/Columns.js +1 -2
- package/cjs/components/ComboBox/ComboBox.js +1 -2
- package/cjs/components/ComboBox/ComboBoxOption.js +1 -2
- package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +1 -2
- package/cjs/components/ConsoleOutput/ConsoleOutput.js +1 -2
- package/cjs/components/ContentLoader/ContentLoader.js +1 -2
- package/cjs/components/ContentLoader/IconsLoader.js +1 -2
- package/cjs/components/Cuttable/Cuttable.js +1 -2
- package/cjs/components/Dialog/Dialog.js +1 -2
- package/cjs/components/DistractionFreeModeContext/DistractionFreeModeContext.js +1 -2
- package/cjs/components/Drawer/Drawer.js +1 -2
- package/cjs/components/Drawer/DrawerProgress.js +1 -2
- package/cjs/components/Drawer/Header.js +1 -2
- package/cjs/components/Dropdown/Dropdown.js +1 -2
- package/cjs/components/Dropdown/locale/en-US.js +2 -3
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessage.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageActions.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.js +1 -2
- package/cjs/components/Figure/Figure.js +1 -2
- package/cjs/components/FocusTrap/FocusTrap.js +1 -2
- package/cjs/components/Form/DisabledContext.js +1 -2
- package/cjs/components/Form/Form.js +1 -2
- package/cjs/components/Form/FormContext.js +1 -2
- package/cjs/components/Form/ScrollableElementFormContext.js +1 -2
- package/cjs/components/FormField/FormField.js +4 -4
- package/cjs/components/FormField/index.js +9 -2
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +1 -2
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +1 -2
- package/cjs/components/FormFieldPassword/PasswordMeter.js +2 -3
- package/cjs/components/FormFieldPassword/estimatePassword.js +3 -5
- package/cjs/components/FormFieldPassword/generatePassword.js +1 -2
- package/cjs/components/FormFieldPassword/locale/en-US.js +2 -3
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +65 -134
- package/cjs/components/FormFieldSelect/FormFieldSelect.js +1 -2
- package/cjs/components/FormFieldText/FormFieldText.js +56 -143
- package/cjs/components/Grid/Grid.js +1 -2
- package/cjs/components/GridCol/GridCol.js +1 -2
- package/cjs/components/Heading/Heading.js +1 -2
- package/cjs/components/Hint/Hint.js +1 -2
- package/cjs/components/Icon/Icon.js +10 -20
- package/cjs/components/Icon/constants.js +2 -4
- package/cjs/components/Icon/images/symbols.svg +39 -1
- package/cjs/components/Icon/oldIconNames.js +1 -2
- package/cjs/components/InPlaceEdit/InPlaceEdit.js +7 -29
- package/cjs/components/InPlaceEdit/locale/en-US.js +2 -3
- package/cjs/components/Input/Input.js +1 -2
- package/cjs/components/InputFile/InputFile.js +1 -2
- package/cjs/components/InputFile/locale/en-US.js +2 -3
- package/cjs/components/InputNumber/InputNumber.js +1 -2
- package/cjs/components/Item/Item.js +1 -2
- package/cjs/components/ItemLink/ItemLink.js +1 -2
- package/cjs/components/ItemList/ItemList.js +1 -2
- package/cjs/components/Label/Label.js +1 -2
- package/cjs/components/Layer/Layer.js +2 -4
- package/cjs/components/Layout/Layout.js +32 -123
- package/cjs/components/Link/Link.js +1 -2
- package/cjs/components/List/List.js +2 -2
- package/cjs/components/List/ListAction.js +1 -2
- package/cjs/components/List/ListActions.js +1 -2
- package/cjs/components/List/ListActionsDivider.js +1 -2
- package/cjs/components/List/ListEmptyView.js +1 -2
- package/cjs/components/List/ListOperation.js +2 -3
- package/cjs/components/List/ListOperationContext.js +1 -2
- package/cjs/components/LocaleProvider/LocaleProvider.js +1 -2
- package/cjs/components/Markdown/Markdown.js +1 -2
- package/cjs/components/Media/Media.js +5 -76
- package/cjs/components/Media/MediaSection.js +4 -26
- package/cjs/components/Menu/Menu.js +6 -58
- package/cjs/components/Menu/MenuBaseItem.js +5 -45
- package/cjs/components/Menu/MenuDivider.js +4 -20
- package/cjs/components/Menu/MenuHeader.js +4 -26
- package/cjs/components/Menu/MenuItem.js +7 -65
- package/cjs/components/Menu/MenuSelectableItem.js +5 -33
- package/cjs/components/OnDarkContext/OnDarkContext.js +1 -2
- package/cjs/components/Overlay/Overlay.js +1 -2
- package/cjs/components/PageHeader/PageHeader.js +1 -2
- package/cjs/components/Pagination/Pagination.js +2 -4
- package/cjs/components/Panel/Panel.js +1 -2
- package/cjs/components/Paragraph/Paragraph.js +1 -2
- package/cjs/components/Plaintext/Plaintext.js +3 -25
- package/cjs/components/Popover/Popover.js +22 -118
- package/cjs/components/Popper/Popper.js +1 -2
- package/cjs/components/Progress/Progress.js +1 -2
- package/cjs/components/ProgressBar/ProgressBar.js +1 -2
- package/cjs/components/ProgressBar/ProgressIndicator.js +1 -2
- package/cjs/components/ProgressDialog/ProgressDialog.js +1 -2
- package/cjs/components/ProgressDialogStep/ProgressDialogStep.js +1 -2
- package/cjs/components/ProgressStep/ProgressStep.js +7 -14
- package/cjs/components/Radio/Radio.js +1 -2
- package/cjs/components/Rating/Rating.js +1 -2
- package/cjs/components/ResponsiveContext/ResponsiveContext.js +1 -2
- package/cjs/components/Section/Section.js +30 -100
- package/cjs/components/Section/SectionItem.js +7 -46
- package/cjs/components/Section/index.js +16 -3
- package/cjs/components/SegmentedControl/SegmentedControl.js +1 -2
- package/cjs/components/Select/MultiValue.js +1 -2
- package/cjs/components/Select/Select.js +1 -2
- package/cjs/components/Select/SelectControl.js +1 -2
- package/cjs/components/Select/SelectOption.js +1 -2
- package/cjs/components/Select/SelectOptionGroup.js +1 -2
- package/cjs/components/Skeleton/Skeleton.js +1 -2
- package/cjs/components/Skeleton/SkeletonTabs.js +1 -2
- package/cjs/components/Skeleton/SkeletonText.js +1 -2
- package/cjs/components/Spinner/Spinner.js +1 -2
- package/cjs/components/SplitButton/SplitButton.js +1 -2
- package/cjs/components/Spot/Spot.js +1 -2
- package/cjs/components/Spot/SpotPopup.js +1 -2
- package/cjs/components/Spot/SpotPulsar.js +1 -2
- package/cjs/components/Squeezer/Squeezer.js +1 -2
- package/cjs/components/Status/Status.js +1 -2
- package/cjs/components/StatusMessage/StatusMessage.js +1 -2
- package/cjs/components/Subnav/Subnav.js +11 -58
- package/cjs/components/Subnav/index.js +6 -12
- package/cjs/components/Switch/Switch.js +1 -2
- package/cjs/components/SwitchesPanel/SwitchesPanel.js +1 -2
- package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +1 -2
- package/cjs/components/Tabs/SearchBar.js +1 -2
- package/cjs/components/Tabs/Tab.js +1 -2
- package/cjs/components/Tabs/Tabs.js +1 -2
- package/cjs/components/Text/Text.js +1 -2
- package/cjs/components/TextArea/TextArea.js +2 -3
- package/cjs/components/Toolbar/RegistryContext.js +1 -2
- package/cjs/components/Toolbar/Toolbar.js +6 -21
- package/cjs/components/Toolbar/ToolbarExpander.js +1 -2
- package/cjs/components/Toolbar/ToolbarGroup.js +21 -53
- package/cjs/components/Toolbar/ToolbarMenu.js +2 -3
- package/cjs/components/Tooltip/Tooltip.js +1 -2
- package/cjs/components/Tour/Tour.js +1 -2
- package/cjs/components/Translate/Translate.js +1 -2
- package/cjs/components/VerticalContext/VerticalContext.js +2 -4
- package/cjs/components/index.js +63 -55
- package/cjs/components/intentIconMap.js +2 -3
- package/cjs/index.js +1 -2
- package/cjs/publicPath.js +1 -2
- package/cjs/utils/types/DataAttributes.js +5 -0
- package/dist/images/symbols.svg +39 -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 +760 -1787
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +5 -5
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/FormField/FormField.js +4 -2
- package/esm/components/FormField/index.js +2 -1
- package/esm/components/FormFieldPassword/PasswordMeter.js +1 -1
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +64 -132
- package/esm/components/FormFieldText/FormFieldText.js +55 -140
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +39 -1
- package/esm/components/InPlaceEdit/InPlaceEdit.js +6 -25
- package/esm/components/Layout/Layout.js +32 -121
- package/esm/components/List/List.js +1 -0
- package/esm/components/List/ListOperation.js +1 -1
- package/esm/components/Media/Media.js +4 -74
- package/esm/components/Media/MediaSection.js +2 -25
- package/esm/components/Menu/Menu.js +5 -54
- package/esm/components/Menu/MenuBaseItem.js +4 -45
- package/esm/components/Menu/MenuDivider.js +2 -19
- package/esm/components/Menu/MenuHeader.js +2 -25
- package/esm/components/Menu/MenuItem.js +5 -62
- package/esm/components/Menu/MenuSelectableItem.js +3 -32
- package/esm/components/Plaintext/Plaintext.js +2 -23
- package/esm/components/Popover/Popover.js +21 -114
- package/esm/components/Section/Section.js +28 -97
- package/esm/components/Section/SectionItem.js +5 -41
- package/esm/components/Section/index.js +2 -1
- package/esm/components/Subnav/Subnav.js +10 -54
- package/esm/components/Subnav/index.js +1 -2
- package/esm/components/TextArea/TextArea.js +1 -1
- package/esm/components/Toolbar/Toolbar.js +7 -21
- package/esm/components/Toolbar/ToolbarGroup.js +17 -50
- package/esm/components/Toolbar/ToolbarMenu.js +1 -1
- package/esm/components/index.js +5 -10
- package/esm/index.js +1 -1
- package/esm/utils/types/DataAttributes.js +1 -0
- package/package.json +21 -21
- package/styleguide/build/bundle.17ad5082.js +2 -0
- package/styleguide/images/symbols.svg +39 -1
- package/styleguide/index.html +2 -2
- package/types/src/components/AutoClosable/AutoClosable.d.ts +23 -2
- package/types/src/components/Button/Button.d.ts +1 -4
- package/types/src/components/Columns/Column.d.ts +2 -2
- package/types/src/components/Columns/Columns.d.ts +2 -2
- package/types/src/components/Columns/index.d.ts +2 -0
- package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +1 -1
- package/types/src/components/DistractionFreeModeContext/index.d.ts +1 -0
- package/types/src/components/FormFieldPassword/PasswordMeter.d.ts +4 -3
- package/types/src/components/FormFieldRadioButtons/FormFieldRadioButtons.d.ts +72 -0
- package/types/src/components/FormFieldRadioButtons/index.d.ts +2 -0
- package/types/src/components/FormFieldSelect/FormFieldSelect.d.ts +1 -1
- package/types/src/components/FormFieldSelect/index.d.ts +1 -0
- package/types/src/components/FormFieldText/FormFieldText.d.ts +82 -0
- package/types/src/components/FormFieldText/index.d.ts +2 -0
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/InPlaceEdit/InPlaceEdit.d.ts +50 -0
- package/types/src/components/InPlaceEdit/index.d.ts +2 -0
- package/types/src/components/Input/Input.d.ts +1 -1
- package/types/src/components/Input/index.d.ts +1 -0
- package/types/src/components/InputFile/InputFile.d.ts +3 -2
- package/types/src/components/InputFile/index.d.ts +1 -0
- package/types/src/components/InputNumber/InputNumber.d.ts +2 -2
- package/types/src/components/InputNumber/index.d.ts +1 -0
- package/types/src/components/Layout/Layout.d.ts +161 -0
- package/types/src/components/Layout/index.d.ts +2 -0
- package/types/src/components/Media/Media.d.ts +66 -0
- package/types/src/components/Media/MediaSection.d.ts +22 -0
- package/types/src/components/Media/index.d.ts +4 -0
- package/types/src/components/Menu/Menu.d.ts +40 -0
- package/types/src/components/Menu/MenuBaseItem.d.ts +41 -0
- package/types/src/components/Menu/MenuDivider.d.ts +16 -0
- package/types/src/components/Menu/MenuHeader.d.ts +22 -0
- package/types/src/components/Menu/MenuItem.d.ts +49 -0
- package/types/src/components/Menu/MenuSelectableItem.d.ts +28 -0
- package/types/src/components/Menu/index.d.ts +11 -0
- package/types/src/components/Panel/Panel.d.ts +2 -1
- package/types/src/components/Plaintext/Plaintext.d.ts +23 -0
- package/types/src/components/Plaintext/index.d.ts +2 -0
- package/types/src/components/Popover/Popover.d.ts +156 -0
- package/types/src/components/Popover/index.d.ts +2 -0
- package/types/src/components/Section/Section.d.ts +145 -0
- package/types/src/components/Section/SectionItem.d.ts +38 -0
- package/types/src/components/Section/index.d.ts +5 -0
- package/types/src/components/Spot/Spot.d.ts +3 -2
- package/types/src/components/Spot/SpotPulsar.d.ts +4 -2
- package/types/src/components/Spot/index.d.ts +1 -0
- package/types/src/components/Subnav/Subnav.d.ts +50 -0
- package/types/src/components/Subnav/index.d.ts +2 -0
- package/types/src/components/TextArea/TextArea.d.ts +4 -4
- package/types/src/components/TextArea/index.d.ts +1 -0
- package/types/src/components/Toolbar/RegistryContext.d.ts +2 -2
- package/types/src/components/Toolbar/Toolbar.d.ts +47 -0
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +46 -0
- package/types/src/components/Toolbar/ToolbarMenu.d.ts +1 -1
- package/types/src/components/Toolbar/index.d.ts +5 -0
- package/types/src/components/Tour/Tour.d.ts +1 -1
- package/types/src/components/index.d.ts +21 -10
- package/types/src/utils/types/DataAttributes.d.ts +3 -0
- package/types/src/utils/types/index.d.ts +1 -0
- package/cjs/tests/index.js +0 -13
- package/cjs/tests/renderer.js +0 -33
- package/esm/tests/index.js +0 -3
- package/esm/tests/renderer.js +0 -25
- package/styleguide/build/bundle.6318f4a5.js +0 -2
- /package/styleguide/build/{bundle.6318f4a5.js.LICENSE.txt → bundle.17ad5082.js.LICENSE.txt} +0 -0
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
3
|
+
import { cloneElement } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import Tooltip from '../Tooltip';
|
|
7
6
|
import { CLS_PREFIX } from '../../constants';
|
|
8
7
|
import { createProxyProps } from '../utils';
|
|
9
8
|
import MenuBaseItem from './MenuBaseItem';
|
|
10
|
-
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
/**
|
|
12
11
|
* `MenuItem` is a part of [Menu](#!/Menu) component.
|
|
13
12
|
* @since 0.0.55
|
|
14
13
|
*/
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
14
|
const MenuItem = _ref => {
|
|
17
15
|
let {
|
|
18
|
-
baseClassName,
|
|
19
16
|
className,
|
|
20
17
|
children,
|
|
21
18
|
onClick,
|
|
22
|
-
active,
|
|
23
|
-
disabled,
|
|
24
19
|
icon,
|
|
25
20
|
label,
|
|
26
21
|
tooltip,
|
|
22
|
+
baseClassName = `${CLS_PREFIX}menu__item`,
|
|
23
|
+
disabled = false,
|
|
24
|
+
active = false,
|
|
27
25
|
...props
|
|
28
26
|
} = _ref;
|
|
29
27
|
const element = /*#__PURE__*/_jsx(MenuBaseItem, {
|
|
@@ -52,59 +50,4 @@ const MenuItem = _ref => {
|
|
|
52
50
|
}
|
|
53
51
|
return element;
|
|
54
52
|
};
|
|
55
|
-
MenuItem.propTypes = {
|
|
56
|
-
/**
|
|
57
|
-
* Whether item is active.
|
|
58
|
-
* @since 0.0.55
|
|
59
|
-
*/
|
|
60
|
-
active: PropTypes.bool,
|
|
61
|
-
/**
|
|
62
|
-
* Whether item is disabled.
|
|
63
|
-
* @since 0.0.55
|
|
64
|
-
*/
|
|
65
|
-
disabled: PropTypes.bool,
|
|
66
|
-
/**
|
|
67
|
-
* Icon
|
|
68
|
-
* @since 0.0.55
|
|
69
|
-
*/
|
|
70
|
-
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
71
|
-
/**
|
|
72
|
-
* Right label of item.
|
|
73
|
-
* @since 0.0.57
|
|
74
|
-
*/
|
|
75
|
-
label: PropTypes.node,
|
|
76
|
-
/**
|
|
77
|
-
* Tooltip for component.
|
|
78
|
-
* @since 2.6.1
|
|
79
|
-
*/
|
|
80
|
-
// eslint-disable-next-line react/require-default-props
|
|
81
|
-
tooltip: PropTypes.node,
|
|
82
|
-
/**
|
|
83
|
-
* Content of the `MenuItem`.
|
|
84
|
-
* @since 0.0.55
|
|
85
|
-
*/
|
|
86
|
-
children: PropTypes.node,
|
|
87
|
-
/**
|
|
88
|
-
* @ignore
|
|
89
|
-
*/
|
|
90
|
-
className: PropTypes.string,
|
|
91
|
-
/**
|
|
92
|
-
* @ignore
|
|
93
|
-
*/
|
|
94
|
-
baseClassName: PropTypes.string,
|
|
95
|
-
/**
|
|
96
|
-
* @ignore
|
|
97
|
-
*/
|
|
98
|
-
onClick: PropTypes.func
|
|
99
|
-
};
|
|
100
|
-
MenuItem.defaultProps = {
|
|
101
|
-
active: false,
|
|
102
|
-
disabled: false,
|
|
103
|
-
icon: null,
|
|
104
|
-
label: null,
|
|
105
|
-
children: null,
|
|
106
|
-
className: null,
|
|
107
|
-
baseClassName: `${CLS_PREFIX}menu__item`,
|
|
108
|
-
onClick: null
|
|
109
|
-
};
|
|
110
53
|
export default MenuItem;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import classNames from 'classnames';
|
|
6
4
|
import { CLS_PREFIX } from '../../constants';
|
|
7
5
|
import MenuItem from './MenuItem';
|
|
8
|
-
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
/**
|
|
10
8
|
* `MenuSelectableItem` is a part of [Menu](#!/Menu) component.
|
|
11
9
|
* @since 0.0.57
|
|
12
10
|
*/
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
11
|
const MenuSelectableItem = _ref => {
|
|
15
12
|
let {
|
|
16
|
-
baseClassName,
|
|
17
13
|
className,
|
|
18
14
|
children,
|
|
19
|
-
selected,
|
|
15
|
+
selected = false,
|
|
16
|
+
baseClassName = `${CLS_PREFIX}menu__item`,
|
|
20
17
|
...props
|
|
21
18
|
} = _ref;
|
|
22
19
|
return /*#__PURE__*/_jsx(MenuItem, {
|
|
@@ -28,30 +25,4 @@ const MenuSelectableItem = _ref => {
|
|
|
28
25
|
children: children
|
|
29
26
|
});
|
|
30
27
|
};
|
|
31
|
-
MenuSelectableItem.propTypes = {
|
|
32
|
-
/**
|
|
33
|
-
* Whether item is selected.
|
|
34
|
-
* @since 0.0.57
|
|
35
|
-
*/
|
|
36
|
-
selected: PropTypes.bool,
|
|
37
|
-
/**
|
|
38
|
-
* Content of the `MenuSelectableItem`.
|
|
39
|
-
* @since 0.0.57
|
|
40
|
-
*/
|
|
41
|
-
children: PropTypes.node,
|
|
42
|
-
/**
|
|
43
|
-
* @ignore
|
|
44
|
-
*/
|
|
45
|
-
className: PropTypes.string,
|
|
46
|
-
/**
|
|
47
|
-
* @ignore
|
|
48
|
-
*/
|
|
49
|
-
baseClassName: PropTypes.string
|
|
50
|
-
};
|
|
51
|
-
MenuSelectableItem.defaultProps = {
|
|
52
|
-
selected: false,
|
|
53
|
-
children: null,
|
|
54
|
-
className: null,
|
|
55
|
-
baseClassName: `${CLS_PREFIX}menu__item`
|
|
56
|
-
};
|
|
57
28
|
export default MenuSelectableItem;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import classNames from 'classnames';
|
|
6
4
|
import { CLS_PREFIX } from '../../constants';
|
|
7
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -11,32 +9,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
9
|
*/
|
|
12
10
|
const Plaintext = _ref => {
|
|
13
11
|
let {
|
|
14
|
-
baseClassName,
|
|
15
12
|
className,
|
|
16
|
-
children
|
|
13
|
+
children,
|
|
14
|
+
baseClassName = `${CLS_PREFIX}plaintext`
|
|
17
15
|
} = _ref;
|
|
18
16
|
return /*#__PURE__*/_jsx("pre", {
|
|
19
17
|
className: classNames(baseClassName, className),
|
|
20
18
|
children: children
|
|
21
19
|
});
|
|
22
20
|
};
|
|
23
|
-
Plaintext.propTypes = {
|
|
24
|
-
/**
|
|
25
|
-
* Content of the Plaintext
|
|
26
|
-
* @since 0.0.42
|
|
27
|
-
*/
|
|
28
|
-
children: PropTypes.node.isRequired,
|
|
29
|
-
/**
|
|
30
|
-
* @ignore
|
|
31
|
-
*/
|
|
32
|
-
className: PropTypes.string,
|
|
33
|
-
/**
|
|
34
|
-
* @ignore
|
|
35
|
-
*/
|
|
36
|
-
baseClassName: PropTypes.string
|
|
37
|
-
};
|
|
38
|
-
Plaintext.defaultProps = {
|
|
39
|
-
className: null,
|
|
40
|
-
baseClassName: `${CLS_PREFIX}plaintext`
|
|
41
|
-
};
|
|
42
21
|
export default Plaintext;
|
|
@@ -1,9 +1,7 @@
|
|
|
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, Component, createRef } from 'react';
|
|
5
4
|
import { findDOMNode } from 'react-dom';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
5
|
import classNames from 'classnames';
|
|
8
6
|
import Measure from 'react-measure';
|
|
9
7
|
import { CLS_PREFIX, Z_INDEX_POPOVER } from '../../constants';
|
|
@@ -15,6 +13,7 @@ import { isLikeText } from '../Translate';
|
|
|
15
13
|
import { wrapFunction } from '../utils';
|
|
16
14
|
import OnDarkContext from '../OnDarkContext';
|
|
17
15
|
import FocusTrap from '../FocusTrap';
|
|
16
|
+
import { cloneElement, Component, createRef } from 'react';
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
const PLACEMENT_MAP = {
|
|
@@ -25,12 +24,16 @@ const PLACEMENT_MAP = {
|
|
|
25
24
|
'bottom-left': 'bottom-end',
|
|
26
25
|
'bottom-right': 'bottom-start',
|
|
27
26
|
'left-top': 'left-end',
|
|
28
|
-
'left-bottom': 'left-start'
|
|
27
|
+
'left-bottom': 'left-start',
|
|
28
|
+
top: 'top',
|
|
29
|
+
right: 'right',
|
|
30
|
+
bottom: 'bottom',
|
|
31
|
+
left: 'left',
|
|
32
|
+
auto: 'auto'
|
|
29
33
|
};
|
|
30
34
|
const ARROW_HEIGHT = 26;
|
|
31
35
|
const isControlled = props => props.visible !== null;
|
|
32
36
|
const normalize = value => String(Number(value)) === String(value) ? `${value}px` : value;
|
|
33
|
-
|
|
34
37
|
/**
|
|
35
38
|
* `Popover` component is non-modal pop-up window used for providing additional information
|
|
36
39
|
* for an interface element. It also may contain Form with few fields or any other small content.
|
|
@@ -45,6 +48,9 @@ class Popover extends Component {
|
|
|
45
48
|
});
|
|
46
49
|
_defineProperty(this, "contentRef", /*#__PURE__*/createRef());
|
|
47
50
|
_defineProperty(this, "targetRef", /*#__PURE__*/createRef());
|
|
51
|
+
_defineProperty(this, "prevFocusElement", void 0);
|
|
52
|
+
_defineProperty(this, "popperData", void 0);
|
|
53
|
+
_defineProperty(this, "headerBounds", void 0);
|
|
48
54
|
_defineProperty(this, "checkArrowPosition", () => {
|
|
49
55
|
const {
|
|
50
56
|
title
|
|
@@ -60,10 +66,8 @@ class Popover extends Component {
|
|
|
60
66
|
actualPlacement,
|
|
61
67
|
arrowStyle
|
|
62
68
|
} = this.popperData;
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
} = arrowStyle;
|
|
66
|
-
const [direction] = actualPlacement.split('-');
|
|
69
|
+
const top = parseInt(arrowStyle?.top || '');
|
|
70
|
+
const [direction] = actualPlacement?.split('-') || [];
|
|
67
71
|
let newArrowInHeader = false;
|
|
68
72
|
const directionBottomOrPopoverLowEnough = direction === 'bottom' || top !== null && this.headerBounds && top < this.headerBounds.height - ARROW_HEIGHT / 2;
|
|
69
73
|
const rightDirection = direction !== 'top' && directionBottomOrPopoverLowEnough;
|
|
@@ -109,7 +113,7 @@ class Popover extends Component {
|
|
|
109
113
|
canCloseOnEscapePress,
|
|
110
114
|
autoFocus
|
|
111
115
|
} = this.props;
|
|
112
|
-
const isNeedFocus = autoFocus && canCloseOnEscapePress && this.prevFocusElement && (!document.activeElement || this.contentRef.current
|
|
116
|
+
const isNeedFocus = autoFocus && canCloseOnEscapePress && this.prevFocusElement && (!document.activeElement || this.contentRef.current?.contains(document.activeElement));
|
|
113
117
|
if (onClose) {
|
|
114
118
|
onClose();
|
|
115
119
|
} else {
|
|
@@ -118,7 +122,7 @@ class Popover extends Component {
|
|
|
118
122
|
});
|
|
119
123
|
}
|
|
120
124
|
if (isNeedFocus) {
|
|
121
|
-
this.prevFocusElement
|
|
125
|
+
this.prevFocusElement?.focus();
|
|
122
126
|
}
|
|
123
127
|
});
|
|
124
128
|
_defineProperty(this, "handleHeaderResize", contentRect => {
|
|
@@ -144,7 +148,7 @@ class Popover extends Component {
|
|
|
144
148
|
show: isControlled(props) ? props.visible : state.show
|
|
145
149
|
};
|
|
146
150
|
}
|
|
147
|
-
componentDidUpdate(
|
|
151
|
+
componentDidUpdate(_, prevState) {
|
|
148
152
|
const {
|
|
149
153
|
canCloseOnEscapePress,
|
|
150
154
|
autoFocus
|
|
@@ -198,7 +202,7 @@ class Popover extends Component {
|
|
|
198
202
|
} = this.state;
|
|
199
203
|
let behavior;
|
|
200
204
|
if (placement !== 'auto') {
|
|
201
|
-
const [direction] = placement
|
|
205
|
+
const [direction] = placement?.split('-') || [];
|
|
202
206
|
if (direction === 'top') {
|
|
203
207
|
behavior = ['top', 'bottom', 'right', 'left'];
|
|
204
208
|
} else if (direction === 'right') {
|
|
@@ -229,7 +233,7 @@ class Popover extends Component {
|
|
|
229
233
|
ref: measureRef,
|
|
230
234
|
className: `${baseClassName}__heading`,
|
|
231
235
|
children: [isLikeText(title) ? /*#__PURE__*/_jsx(Heading, {
|
|
232
|
-
level:
|
|
236
|
+
level: 5,
|
|
233
237
|
className: `${baseClassName}__title`,
|
|
234
238
|
children: title
|
|
235
239
|
}) : title, /*#__PURE__*/_jsxs("div", {
|
|
@@ -243,7 +247,7 @@ class Popover extends Component {
|
|
|
243
247
|
className: classNames(target.props.className, `${baseClassName}__target`),
|
|
244
248
|
onClick: wrapFunction(target.props.onClick, this.handleTargetClick)
|
|
245
249
|
});
|
|
246
|
-
const popperPlacement = PLACEMENT_MAP[placement]
|
|
250
|
+
const popperPlacement = placement ? PLACEMENT_MAP[placement] : undefined;
|
|
247
251
|
let wrapperStyle;
|
|
248
252
|
if (height) {
|
|
249
253
|
wrapperStyle = {
|
|
@@ -252,7 +256,7 @@ class Popover extends Component {
|
|
|
252
256
|
}
|
|
253
257
|
const content = /*#__PURE__*/_jsxs(FocusTrap, {
|
|
254
258
|
ref: this.contentRef,
|
|
255
|
-
onKeyUp: canCloseOnEscapePress && show ? this.hotkeyHandler :
|
|
259
|
+
onKeyUp: canCloseOnEscapePress && show ? this.hotkeyHandler : undefined,
|
|
256
260
|
className: `${baseClassName}__inner`,
|
|
257
261
|
style: wrapperStyle,
|
|
258
262
|
children: [height ? heading : heading || close, /*#__PURE__*/_jsx("div", {
|
|
@@ -296,104 +300,7 @@ class Popover extends Component {
|
|
|
296
300
|
}
|
|
297
301
|
// eslint-disable-next-line react/sort-comp
|
|
298
302
|
_defineProperty(Popover, "contextType", OnDarkContext);
|
|
299
|
-
Popover
|
|
300
|
-
/**
|
|
301
|
-
* The reference element used to position the popover.
|
|
302
|
-
* @since 0.0.65
|
|
303
|
-
*/
|
|
304
|
-
target: PropTypes.element.isRequired,
|
|
305
|
-
/**
|
|
306
|
-
* A React reference to the DOM element that needs for calculating the position of the popup.
|
|
307
|
-
* It is required only when visible or defaultVisible props are provided.
|
|
308
|
-
* @since 3.12.0
|
|
309
|
-
*/
|
|
310
|
-
targetRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
311
|
-
current: PropTypes.instanceOf(HTMLElement)
|
|
312
|
-
})]),
|
|
313
|
-
/**
|
|
314
|
-
* Popover visibility. For controlled component only.
|
|
315
|
-
* @since 0.0.65
|
|
316
|
-
*/
|
|
317
|
-
visible: PropTypes.bool,
|
|
318
|
-
/**
|
|
319
|
-
* Popover default (on init) visibility. For uncontrolled component only.
|
|
320
|
-
* @since 0.0.66
|
|
321
|
-
*/
|
|
322
|
-
defaultVisible: PropTypes.bool,
|
|
323
|
-
/**
|
|
324
|
-
* Popover title. Header will only be rendered if this prop is defined.
|
|
325
|
-
* @since 0.0.42
|
|
326
|
-
*/
|
|
327
|
-
title: PropTypes.node,
|
|
328
|
-
/**
|
|
329
|
-
* Click handler for close button. If it is not defined then default behavior (hide popover) will be used.
|
|
330
|
-
* @since 0.0.42
|
|
331
|
-
*/
|
|
332
|
-
onClose: PropTypes.func,
|
|
333
|
-
/**
|
|
334
|
-
* Popover placement
|
|
335
|
-
* @since 0.0.42
|
|
336
|
-
*/
|
|
337
|
-
placement: PropTypes.oneOf(['auto', 'top-left', 'top', 'top-right', 'right-top', 'right', 'right-bottom', 'bottom-right', 'bottom', 'bottom-left', 'left-bottom', 'left', 'left-top']),
|
|
338
|
-
/**
|
|
339
|
-
* Indicating if clicking outside the popover should close it.
|
|
340
|
-
* @since 0.0.65
|
|
341
|
-
*/
|
|
342
|
-
canCloseOnOutsideClick: PropTypes.bool,
|
|
343
|
-
/**
|
|
344
|
-
* Indicating if pressing the escape key should close the popover.
|
|
345
|
-
* @since 0.0.65
|
|
346
|
-
*/
|
|
347
|
-
canCloseOnEscapePress: PropTypes.bool,
|
|
348
|
-
/**
|
|
349
|
-
* Content of the Popover
|
|
350
|
-
* @since 0.0.42
|
|
351
|
-
*/
|
|
352
|
-
children: PropTypes.node,
|
|
353
|
-
/**
|
|
354
|
-
* Visual intent color to apply to component.
|
|
355
|
-
* @since 0.0.59
|
|
356
|
-
*/
|
|
357
|
-
intent: PropTypes.oneOf(['info', 'success', 'warning', 'danger']),
|
|
358
|
-
/**
|
|
359
|
-
* Undo predefined max-width.
|
|
360
|
-
* @since 2.4.0
|
|
361
|
-
*/
|
|
362
|
-
wide: PropTypes.bool,
|
|
363
|
-
/**
|
|
364
|
-
* Define the popover width.
|
|
365
|
-
* @since 3.2.0
|
|
366
|
-
*/
|
|
367
|
-
width: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
368
|
-
/**
|
|
369
|
-
* Define the popover height.
|
|
370
|
-
* @since 3.3.0
|
|
371
|
-
*/
|
|
372
|
-
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
373
|
-
/**
|
|
374
|
-
* A slot for buttons or links in the header.
|
|
375
|
-
* @since 3.16.0
|
|
376
|
-
*/
|
|
377
|
-
extra: PropTypes.node,
|
|
378
|
-
/**
|
|
379
|
-
* @ignore
|
|
380
|
-
*/
|
|
381
|
-
className: PropTypes.string,
|
|
382
|
-
/**
|
|
383
|
-
* @ignore
|
|
384
|
-
*/
|
|
385
|
-
baseClassName: PropTypes.string,
|
|
386
|
-
/**
|
|
387
|
-
* Boundaries element for preventOverflow property.
|
|
388
|
-
* @since 1.12.4
|
|
389
|
-
*/
|
|
390
|
-
boundariesElement: PropTypes.oneOfType([PropTypes.oneOf(['scrollParent', 'window', 'viewport']), PropTypes.instanceOf(HTMLElement)]),
|
|
391
|
-
/**
|
|
392
|
-
* @ignore
|
|
393
|
-
*/
|
|
394
|
-
autoFocus: PropTypes.bool
|
|
395
|
-
};
|
|
396
|
-
Popover.defaultProps = {
|
|
303
|
+
_defineProperty(Popover, "defaultProps", {
|
|
397
304
|
visible: null,
|
|
398
305
|
defaultVisible: false,
|
|
399
306
|
title: undefined,
|
|
@@ -412,5 +319,5 @@ Popover.defaultProps = {
|
|
|
412
319
|
boundariesElement: undefined,
|
|
413
320
|
autoFocus: true,
|
|
414
321
|
targetRef: undefined
|
|
415
|
-
};
|
|
322
|
+
});
|
|
416
323
|
export default Popover;
|
|
@@ -1,16 +1,15 @@
|
|
|
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, { Component, Children, isValidElement, useContext } from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
4
|
import classNames from 'classnames';
|
|
5
|
+
import { Children, Component, isValidElement, useContext } from 'react';
|
|
7
6
|
import Measure from 'react-measure';
|
|
8
7
|
import { CLS_PREFIX } from '../../constants';
|
|
9
|
-
import { isClickable } from '../utils';
|
|
10
|
-
import InPlaceEdit from '../InPlaceEdit';
|
|
11
8
|
import Button from '../Button';
|
|
12
|
-
import VerticalContext, { VERTICAL_BREAKPOINT } from '../VerticalContext';
|
|
13
9
|
import FormContext from '../Form/FormContext';
|
|
10
|
+
import InPlaceEdit from '../InPlaceEdit';
|
|
11
|
+
import { isClickable } from '../utils';
|
|
12
|
+
import VerticalContext, { VERTICAL_BREAKPOINT } from '../VerticalContext';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
15
|
const getErrorsForChildren = (form, children) => {
|
|
@@ -34,6 +33,22 @@ const getErrorsForChildren = (form, children) => {
|
|
|
34
33
|
});
|
|
35
34
|
return errors;
|
|
36
35
|
};
|
|
36
|
+
export const SECTION_BASE_CLASS_NAME = `${CLS_PREFIX}section`;
|
|
37
|
+
const DEFAULT_PROPS = {
|
|
38
|
+
title: undefined,
|
|
39
|
+
intent: undefined,
|
|
40
|
+
collapsible: false,
|
|
41
|
+
collapsed: false,
|
|
42
|
+
onTitleChange: undefined,
|
|
43
|
+
onClose: undefined,
|
|
44
|
+
onToggle: undefined,
|
|
45
|
+
buttons: undefined,
|
|
46
|
+
vertical: undefined,
|
|
47
|
+
children: undefined,
|
|
48
|
+
className: undefined,
|
|
49
|
+
baseClassName: SECTION_BASE_CLASS_NAME,
|
|
50
|
+
form: undefined
|
|
51
|
+
};
|
|
37
52
|
class Section extends Component {
|
|
38
53
|
constructor() {
|
|
39
54
|
super(...arguments);
|
|
@@ -44,7 +59,7 @@ class Section extends Component {
|
|
|
44
59
|
let {
|
|
45
60
|
bounds
|
|
46
61
|
} = _ref;
|
|
47
|
-
if (this.props.vertical !== undefined) {
|
|
62
|
+
if (this.props.vertical !== undefined || !bounds) {
|
|
48
63
|
return;
|
|
49
64
|
}
|
|
50
65
|
this.setState({
|
|
@@ -63,9 +78,7 @@ class Section extends Component {
|
|
|
63
78
|
collapsed: !collapsed
|
|
64
79
|
};
|
|
65
80
|
}, () => {
|
|
66
|
-
|
|
67
|
-
this.props.onToggle(this.state.collapsed);
|
|
68
|
-
}
|
|
81
|
+
this.props.onToggle?.(this.state.collapsed ?? false);
|
|
69
82
|
});
|
|
70
83
|
});
|
|
71
84
|
}
|
|
@@ -139,7 +152,8 @@ class Section extends Component {
|
|
|
139
152
|
value: title,
|
|
140
153
|
onChange: onTitleChange,
|
|
141
154
|
onClick: e => {
|
|
142
|
-
e.target
|
|
155
|
+
const button = e.target?.closest(`.${baseClassName}__header`)?.querySelector(`.${baseClassName}__control-button`);
|
|
156
|
+
button?.click();
|
|
143
157
|
}
|
|
144
158
|
});
|
|
145
159
|
}
|
|
@@ -158,10 +172,10 @@ class Section extends Component {
|
|
|
158
172
|
}
|
|
159
173
|
render() {
|
|
160
174
|
const {
|
|
161
|
-
baseClassName,
|
|
175
|
+
baseClassName = SECTION_BASE_CLASS_NAME,
|
|
162
176
|
className,
|
|
163
177
|
intent,
|
|
164
|
-
collapsible,
|
|
178
|
+
collapsible = false,
|
|
165
179
|
title,
|
|
166
180
|
collapsed,
|
|
167
181
|
onTitleChange,
|
|
@@ -216,95 +230,13 @@ class Section extends Component {
|
|
|
216
230
|
});
|
|
217
231
|
}
|
|
218
232
|
}
|
|
219
|
-
const propTypes = {
|
|
220
|
-
/**
|
|
221
|
-
* Title of the section.
|
|
222
|
-
* @since 0.0.54
|
|
223
|
-
*/
|
|
224
|
-
title: PropTypes.node,
|
|
225
|
-
/**
|
|
226
|
-
* Visual intent color to apply to component.
|
|
227
|
-
* @since 0.0.54
|
|
228
|
-
*/
|
|
229
|
-
intent: PropTypes.oneOf(['danger', 'warning', 'success', 'inactive']),
|
|
230
|
-
/**
|
|
231
|
-
* Is section collapsible.
|
|
232
|
-
* @since 0.0.54
|
|
233
|
-
*/
|
|
234
|
-
collapsible: PropTypes.bool,
|
|
235
|
-
/**
|
|
236
|
-
* Is section collapsed now.
|
|
237
|
-
* @since 0.0.54
|
|
238
|
-
*/
|
|
239
|
-
collapsed: PropTypes.bool,
|
|
240
|
-
/**
|
|
241
|
-
* Event handler of title change with inline editing form.
|
|
242
|
-
* @since 0.0.54
|
|
243
|
-
*/
|
|
244
|
-
onTitleChange: PropTypes.func,
|
|
245
|
-
/**
|
|
246
|
-
* Event handler of closing section with X-sign at the right.
|
|
247
|
-
* @since 0.0.54
|
|
248
|
-
*/
|
|
249
|
-
onClose: PropTypes.func,
|
|
250
|
-
/**
|
|
251
|
-
* A callback executed when the section collapsing.
|
|
252
|
-
* @since 3.26.0
|
|
253
|
-
*/
|
|
254
|
-
onToggle: PropTypes.func,
|
|
255
|
-
/**
|
|
256
|
-
* Array of custom section action button at the right.
|
|
257
|
-
* @since 0.0.54
|
|
258
|
-
*/
|
|
259
|
-
buttons: PropTypes.arrayOf(PropTypes.element),
|
|
260
|
-
/**
|
|
261
|
-
* Vertical or horizontal section view.
|
|
262
|
-
* Section view will be automatically switched if this parameter is not specified explicitly.
|
|
263
|
-
* @since 0.3.0
|
|
264
|
-
*/
|
|
265
|
-
vertical: PropTypes.bool,
|
|
266
|
-
/**
|
|
267
|
-
* Content of the `Section`.
|
|
268
|
-
* @since 0.0.54
|
|
269
|
-
*/
|
|
270
|
-
children: PropTypes.node,
|
|
271
|
-
/**
|
|
272
|
-
* @ignore
|
|
273
|
-
*/
|
|
274
|
-
className: PropTypes.string,
|
|
275
|
-
/**
|
|
276
|
-
* @ignore
|
|
277
|
-
*/
|
|
278
|
-
baseClassName: PropTypes.string,
|
|
279
|
-
/**
|
|
280
|
-
* @ignore
|
|
281
|
-
*/
|
|
282
|
-
form: PropTypes.object
|
|
283
|
-
};
|
|
284
|
-
const defaultProps = {
|
|
285
|
-
title: undefined,
|
|
286
|
-
intent: undefined,
|
|
287
|
-
collapsible: false,
|
|
288
|
-
collapsed: false,
|
|
289
|
-
onTitleChange: undefined,
|
|
290
|
-
onClose: undefined,
|
|
291
|
-
onToggle: undefined,
|
|
292
|
-
buttons: undefined,
|
|
293
|
-
vertical: undefined,
|
|
294
|
-
children: undefined,
|
|
295
|
-
className: undefined,
|
|
296
|
-
baseClassName: `${CLS_PREFIX}section`,
|
|
297
|
-
form: undefined
|
|
298
|
-
};
|
|
299
|
-
Section.propTypes = propTypes;
|
|
300
|
-
Section.defaultProps = defaultProps;
|
|
301
233
|
|
|
302
234
|
/**
|
|
303
235
|
* `Section` component is used for dividing of complex content into groups for better readability
|
|
304
236
|
* and comprehension of the presented information.
|
|
305
237
|
* @since 0.0.54
|
|
306
238
|
*/
|
|
307
|
-
|
|
239
|
+
_defineProperty(Section, "defaultProps", DEFAULT_PROPS);
|
|
308
240
|
const SectionWrapper = props => {
|
|
309
241
|
const form = useContext(FormContext);
|
|
310
242
|
const verticalContext = useContext(VerticalContext);
|
|
@@ -316,7 +248,6 @@ const SectionWrapper = props => {
|
|
|
316
248
|
});
|
|
317
249
|
};
|
|
318
250
|
SectionWrapper.displayName = 'Section';
|
|
319
|
-
SectionWrapper.
|
|
320
|
-
SectionWrapper.defaultProps = defaultProps;
|
|
251
|
+
SectionWrapper.defaultProps = DEFAULT_PROPS;
|
|
321
252
|
SectionWrapper.WrappedComponent = Section;
|
|
322
253
|
export default SectionWrapper;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import React, { useContext } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import classNames from 'classnames';
|
|
4
|
+
import { useContext } from 'react';
|
|
6
5
|
import { CLS_PREFIX } from '../../constants';
|
|
7
6
|
import VerticalContext from '../VerticalContext';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export const SECTION_ITEM_BASE_CLASS_NAME = `${CLS_PREFIX}section-item`;
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* `SectionItem` component is used for showing parameters and its values in [Section](#!/Section).
|
|
12
13
|
* @since 0.0.54
|
|
13
14
|
*/
|
|
14
15
|
const SectionItem = _ref => {
|
|
15
16
|
let {
|
|
16
|
-
baseClassName,
|
|
17
|
+
baseClassName = SECTION_ITEM_BASE_CLASS_NAME,
|
|
17
18
|
className,
|
|
18
19
|
children,
|
|
19
20
|
title,
|
|
20
|
-
actions,
|
|
21
|
+
actions = false,
|
|
21
22
|
vertical,
|
|
22
23
|
...props
|
|
23
24
|
} = _ref;
|
|
@@ -37,41 +38,4 @@ const SectionItem = _ref => {
|
|
|
37
38
|
})]
|
|
38
39
|
});
|
|
39
40
|
};
|
|
40
|
-
SectionItem.propTypes = {
|
|
41
|
-
/**
|
|
42
|
-
* Content of the `SectionItem`.
|
|
43
|
-
* @since 0.0.54
|
|
44
|
-
*/
|
|
45
|
-
children: PropTypes.node,
|
|
46
|
-
/**
|
|
47
|
-
* @ignore
|
|
48
|
-
*/
|
|
49
|
-
className: PropTypes.string,
|
|
50
|
-
/**
|
|
51
|
-
* @ignore
|
|
52
|
-
*/
|
|
53
|
-
baseClassName: PropTypes.string,
|
|
54
|
-
/**
|
|
55
|
-
* Title of the section item.
|
|
56
|
-
* @since 0.0.54
|
|
57
|
-
*/
|
|
58
|
-
title: PropTypes.node,
|
|
59
|
-
/**
|
|
60
|
-
* Is this section item contains actions? If it so than there should be extra whitespaces.
|
|
61
|
-
* @since 0.0.54
|
|
62
|
-
*/
|
|
63
|
-
actions: PropTypes.bool,
|
|
64
|
-
/**
|
|
65
|
-
* @ignore
|
|
66
|
-
*/
|
|
67
|
-
vertical: PropTypes.bool
|
|
68
|
-
};
|
|
69
|
-
SectionItem.defaultProps = {
|
|
70
|
-
children: undefined,
|
|
71
|
-
className: undefined,
|
|
72
|
-
baseClassName: `${CLS_PREFIX}section-item`,
|
|
73
|
-
title: undefined,
|
|
74
|
-
actions: false,
|
|
75
|
-
vertical: undefined
|
|
76
|
-
};
|
|
77
41
|
export default SectionItem;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
3
|
export { default } from './Section';
|
|
4
|
-
export {
|
|
4
|
+
export { SECTION_BASE_CLASS_NAME } from './Section';
|
|
5
|
+
export { default as SectionItem, SECTION_ITEM_BASE_CLASS_NAME } from './SectionItem';
|