@plesk/ui-library 3.35.6 → 3.35.8
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 +35 -25
- 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 +14 -11
- 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 +441 -626
- 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 +35 -25
- 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 +1 -2
- package/esm/index.js +1 -1
- package/package.json +28 -33
- package/styleguide/build/bundle.50841a29.js +2 -0
- package/styleguide/build/{bundle.8a07b2dd.js.LICENSE.txt → bundle.50841a29.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 +2 -2
- 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 +3 -3
- 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 +1 -1
- 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 +1 -1
- 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 +3 -2
- package/types/src/components/utils.d.ts +5 -5
- package/types/src/utils/types/PolymorphicComponent.d.ts +5 -5
- package/styleguide/build/bundle.8a07b2dd.js +0 -2
|
@@ -19,6 +19,7 @@ const AutoClosableContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
|
19
19
|
class AutoClosable extends _react.Component {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
|
+
(0, _defineProperty2.default)(this, "context", void 0);
|
|
22
23
|
(0, _defineProperty2.default)(this, "children", []);
|
|
23
24
|
(0, _defineProperty2.default)(this, "addChild", child => {
|
|
24
25
|
this.children.push(child);
|
|
@@ -42,8 +42,8 @@ const toNumber = value => {
|
|
|
42
42
|
}
|
|
43
43
|
return value;
|
|
44
44
|
};
|
|
45
|
-
const isMinDisabled = (value, min) => min !== undefined && value !== '' && value <= min;
|
|
46
|
-
const isMaxDisabled = (value, max) => max !== undefined && value !== '' && value >= max;
|
|
45
|
+
const isMinDisabled = (value, min) => min !== undefined && value !== '' && +value <= min;
|
|
46
|
+
const isMaxDisabled = (value, max) => max !== undefined && value !== '' && +value >= max;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* `InputNumber` component is used for entering integer numbers.
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = require("react");
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _constants = require("../../constants");
|
|
12
11
|
var _Icon = _interopRequireWildcard(require("../Icon"));
|
|
@@ -19,23 +18,33 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
19
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
21
20
|
|
|
22
|
-
const VIEW_SIMPLE = 'simple';
|
|
23
|
-
const VIEW_CARD = 'card';
|
|
24
|
-
|
|
25
21
|
/**
|
|
26
22
|
* `Item` component is element of [ItemList](#!/ItemList) and it is presented as
|
|
27
23
|
* a combination of icon, text title and content (similar to [Media](#!/Media)).
|
|
28
24
|
* @since 0.0.48
|
|
29
25
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const Item = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
children,
|
|
29
|
+
baseClassName = `${_constants.CLS_PREFIX}item`,
|
|
30
|
+
component,
|
|
31
|
+
view = 'simple',
|
|
32
|
+
className,
|
|
33
|
+
icon,
|
|
34
|
+
title,
|
|
35
|
+
description,
|
|
36
|
+
footer,
|
|
37
|
+
value,
|
|
38
|
+
tooltip,
|
|
39
|
+
disabled,
|
|
40
|
+
hoverable,
|
|
41
|
+
...props
|
|
42
|
+
} = _ref;
|
|
43
|
+
const Tag = component || 'div';
|
|
44
|
+
const renderTitle = () => {
|
|
32
45
|
if (!title) {
|
|
33
46
|
return null;
|
|
34
47
|
}
|
|
35
|
-
const {
|
|
36
|
-
baseClassName,
|
|
37
|
-
view
|
|
38
|
-
} = this.props;
|
|
39
48
|
let wrappable = false;
|
|
40
49
|
if (typeof title === 'string') {
|
|
41
50
|
title = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
@@ -60,8 +69,8 @@ class Item extends _react.Component {
|
|
|
60
69
|
});
|
|
61
70
|
}
|
|
62
71
|
return title;
|
|
63
|
-
}
|
|
64
|
-
renderIcon(
|
|
72
|
+
};
|
|
73
|
+
const renderIcon = () => {
|
|
65
74
|
if (!icon) {
|
|
66
75
|
return null;
|
|
67
76
|
}
|
|
@@ -74,147 +83,49 @@ class Item extends _react.Component {
|
|
|
74
83
|
return _Icon.default.create(icon, {
|
|
75
84
|
size: _Icon.ICON_SIZE_32
|
|
76
85
|
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
value,
|
|
90
|
-
tooltip,
|
|
91
|
-
disabled,
|
|
92
|
-
hoverable,
|
|
93
|
-
...props
|
|
94
|
-
} = this.props;
|
|
95
|
-
if (props.onClick) {
|
|
96
|
-
if (disabled) {
|
|
97
|
-
props.onClick = e => e.preventDefault();
|
|
98
|
-
} else {
|
|
99
|
-
props.tabIndex = 0;
|
|
100
|
-
props.onKeyDown = (0, _utils.wrapFunction)(props.onKeyDown, e => {
|
|
101
|
-
if (e.key === 'Enter') {
|
|
102
|
-
e.preventDefault();
|
|
103
|
-
e.currentTarget.click();
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const item = /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tag, {
|
|
109
|
-
className: (0, _classnames.default)(baseClassName, {
|
|
110
|
-
[`${baseClassName}--card`]: view === 'card',
|
|
111
|
-
[`${baseClassName}--disabled`]: disabled,
|
|
112
|
-
[`${baseClassName}--hoverable`]: hoverable
|
|
113
|
-
}, className),
|
|
114
|
-
...props,
|
|
115
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Media.default, {
|
|
116
|
-
image: this.renderIcon(icon),
|
|
117
|
-
title: this.renderTitle(title),
|
|
118
|
-
className: `${baseClassName}__media`,
|
|
119
|
-
children: [description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
120
|
-
className: `${baseClassName}__description`,
|
|
121
|
-
children: description
|
|
122
|
-
}), _react.Children.toArray(children).length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
123
|
-
className: `${baseClassName}__content`,
|
|
124
|
-
children: children
|
|
125
|
-
}) : null]
|
|
126
|
-
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)("footer", {
|
|
127
|
-
className: `${baseClassName}__footer`,
|
|
128
|
-
children: footer
|
|
129
|
-
})]
|
|
130
|
-
});
|
|
131
|
-
if (tooltip) {
|
|
132
|
-
return (0, _utils.createProxyProps)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
133
|
-
title: tooltip,
|
|
134
|
-
children: /*#__PURE__*/(0, _react.cloneElement)(item, props)
|
|
135
|
-
}));
|
|
86
|
+
};
|
|
87
|
+
if (props.onClick) {
|
|
88
|
+
if (disabled) {
|
|
89
|
+
props.onClick = e => e.preventDefault();
|
|
90
|
+
} else {
|
|
91
|
+
props.tabIndex = 0;
|
|
92
|
+
props.onKeyDown = (0, _utils.wrapFunction)(props.onKeyDown, e => {
|
|
93
|
+
if (e.key === 'Enter') {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
e.currentTarget.click();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
136
98
|
}
|
|
137
|
-
return item;
|
|
138
99
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
*/
|
|
170
|
-
description: _propTypes.default.node,
|
|
171
|
-
/**
|
|
172
|
-
* Content of the `Item`.
|
|
173
|
-
* @since 0.0.48
|
|
174
|
-
*/
|
|
175
|
-
children: _propTypes.default.node,
|
|
176
|
-
/**
|
|
177
|
-
* An unique value. It needs only in ItemList with selectable view.
|
|
178
|
-
* @since 2.3.0
|
|
179
|
-
*/
|
|
180
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
181
|
-
/**
|
|
182
|
-
* Tooltip for component.
|
|
183
|
-
* @since 2.5.1
|
|
184
|
-
*/
|
|
185
|
-
tooltip: _propTypes.default.node,
|
|
186
|
-
/**
|
|
187
|
-
* @ignore
|
|
188
|
-
*/
|
|
189
|
-
className: _propTypes.default.string,
|
|
190
|
-
/**
|
|
191
|
-
* @ignore
|
|
192
|
-
*/
|
|
193
|
-
baseClassName: _propTypes.default.string,
|
|
194
|
-
/**
|
|
195
|
-
* Whether disabled or not.
|
|
196
|
-
* @since 3.15.0
|
|
197
|
-
*/
|
|
198
|
-
disabled: _propTypes.default.bool,
|
|
199
|
-
/**
|
|
200
|
-
* Add hover shadow and pointer cursor.
|
|
201
|
-
* @since 3.26.0
|
|
202
|
-
*/
|
|
203
|
-
hoverable: _propTypes.default.bool
|
|
204
|
-
};
|
|
205
|
-
Item.defaultProps = {
|
|
206
|
-
component: 'div',
|
|
207
|
-
view: VIEW_SIMPLE,
|
|
208
|
-
hoverable: undefined,
|
|
209
|
-
title: undefined,
|
|
210
|
-
description: undefined,
|
|
211
|
-
icon: undefined,
|
|
212
|
-
footer: undefined,
|
|
213
|
-
children: undefined,
|
|
214
|
-
value: undefined,
|
|
215
|
-
tooltip: undefined,
|
|
216
|
-
className: undefined,
|
|
217
|
-
disabled: undefined,
|
|
218
|
-
baseClassName: `${_constants.CLS_PREFIX}item`
|
|
100
|
+
const item = /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tag, {
|
|
101
|
+
className: (0, _classnames.default)(baseClassName, {
|
|
102
|
+
[`${baseClassName}--card`]: view === 'card',
|
|
103
|
+
[`${baseClassName}--disabled`]: disabled,
|
|
104
|
+
[`${baseClassName}--hoverable`]: hoverable
|
|
105
|
+
}, className),
|
|
106
|
+
...props,
|
|
107
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Media.default, {
|
|
108
|
+
image: renderIcon(),
|
|
109
|
+
title: renderTitle(),
|
|
110
|
+
className: `${baseClassName}__media`,
|
|
111
|
+
children: [description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
112
|
+
className: `${baseClassName}__description`,
|
|
113
|
+
children: description
|
|
114
|
+
}), _react.Children.toArray(children).length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
115
|
+
className: `${baseClassName}__content`,
|
|
116
|
+
children: children
|
|
117
|
+
}) : null]
|
|
118
|
+
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)("footer", {
|
|
119
|
+
className: `${baseClassName}__footer`,
|
|
120
|
+
children: footer
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
if (tooltip) {
|
|
124
|
+
return (0, _utils.createProxyProps)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
125
|
+
title: tooltip,
|
|
126
|
+
children: /*#__PURE__*/(0, _react.cloneElement)(item, props)
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
return item;
|
|
219
130
|
};
|
|
220
131
|
var _default = exports.default = Item;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _utils = require("../../utils");
|
|
9
9
|
var _react = require("react");
|
|
10
|
+
var _reactTransitionGroup = require("react-transition-group");
|
|
10
11
|
var _utils2 = require("../utils");
|
|
11
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
13
|
var _constants = require("../../constants");
|
|
@@ -37,18 +38,8 @@ const OverlayCore = _ref => {
|
|
|
37
38
|
onAnimationExited,
|
|
38
39
|
...props
|
|
39
40
|
} = _ref;
|
|
40
|
-
const
|
|
41
|
+
const backdropRef = (0, _react.useRef)(null);
|
|
41
42
|
const contentRef = (0, _react.useRef)(null);
|
|
42
|
-
const prevIsOpen = (0, _react.useRef)(externalIsOpen);
|
|
43
|
-
if (prevIsOpen.current !== externalIsOpen) {
|
|
44
|
-
prevIsOpen.current = externalIsOpen;
|
|
45
|
-
if (externalIsOpen) {
|
|
46
|
-
clearTimeout(animationTimeoutRef.current);
|
|
47
|
-
} else {
|
|
48
|
-
animationTimeoutRef.current = window.setTimeout(onAnimationExited, 300);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
(0, _react.useEffect)(() => () => clearTimeout(animationTimeoutRef.current), []);
|
|
52
43
|
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
53
44
|
(0, _react.useEffect)(() => setIsOpen(externalIsOpen), [externalIsOpen]);
|
|
54
45
|
const focus = () => {
|
|
@@ -103,29 +94,48 @@ const OverlayCore = _ref => {
|
|
|
103
94
|
children: element
|
|
104
95
|
});
|
|
105
96
|
};
|
|
97
|
+
const openClassName = `${baseClassName}--open`;
|
|
98
|
+
const transitionBaseProps = {
|
|
99
|
+
in: isOpen,
|
|
100
|
+
classNames: {
|
|
101
|
+
enterActive: openClassName,
|
|
102
|
+
enterDone: openClassName
|
|
103
|
+
},
|
|
104
|
+
timeout: 300
|
|
105
|
+
};
|
|
106
106
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layer.default, {
|
|
107
107
|
level: _constants.Z_INDEX_OVERLAY,
|
|
108
108
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
109
|
-
className: (0, _classnames.default)(baseClassName, `${baseClassName}--${placement}`, `${baseClassName}--${size}`, sideBanner && `${baseClassName}--side`,
|
|
109
|
+
className: (0, _classnames.default)(baseClassName, `${baseClassName}--${placement}`, `${baseClassName}--${size}`, sideBanner && `${baseClassName}--side`, className),
|
|
110
110
|
style: {
|
|
111
111
|
'--overlay-side-banner-background': sideBannerContainer?.background,
|
|
112
112
|
'--overlay-side-banner-align': sideBannerContainer?.align,
|
|
113
113
|
...style
|
|
114
114
|
},
|
|
115
115
|
...props,
|
|
116
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
117
|
+
nodeRef: backdropRef,
|
|
118
|
+
...transitionBaseProps,
|
|
119
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
120
|
+
ref: backdropRef,
|
|
121
|
+
className: `${baseClassName}__backdrop`,
|
|
122
|
+
onClick: handleBackdropClick
|
|
123
|
+
})
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
125
|
+
onExited: onAnimationExited,
|
|
126
|
+
nodeRef: contentRef,
|
|
127
|
+
...transitionBaseProps,
|
|
128
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_FocusTrap.default, {
|
|
129
|
+
className: `${baseClassName}__content`,
|
|
130
|
+
onKeyUp: canCloseOnEscapePress ? handleContentKeyUp : undefined,
|
|
131
|
+
ref: contentRef,
|
|
132
|
+
role: "dialog",
|
|
133
|
+
"aria-modal": "true",
|
|
134
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
135
|
+
className: `${baseClassName}__body`,
|
|
136
|
+
children: children
|
|
137
|
+
}), sideBanner && renderImage(sideBanner)]
|
|
138
|
+
})
|
|
129
139
|
})]
|
|
130
140
|
})
|
|
131
141
|
});
|
|
@@ -35,6 +35,7 @@ class SegmentedControl extends _react.Component {
|
|
|
35
35
|
selected: this.props.selected,
|
|
36
36
|
monoWidth: 0
|
|
37
37
|
});
|
|
38
|
+
(0, _defineProperty2.default)(this, "context", void 0);
|
|
38
39
|
(0, _defineProperty2.default)(this, "isCompact", false);
|
|
39
40
|
(0, _defineProperty2.default)(this, "rootRef", /*#__PURE__*/(0, _react.createRef)());
|
|
40
41
|
(0, _defineProperty2.default)(this, "adjustMonospaced", () => {
|