@plesk/ui-library 3.35.6 → 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 +14 -11
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library.js +435 -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 +1 -2
- package/esm/index.js +1 -1
- package/package.json +28 -33
- package/styleguide/build/bundle.a2d3190d.js +2 -0
- package/styleguide/build/{bundle.8a07b2dd.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 +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
|
@@ -6,18 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _utils = require("../../utils");
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _react = require("react");
|
|
13
11
|
var _constants = require("../../constants");
|
|
12
|
+
var _utils = require("../../utils");
|
|
13
|
+
var _Badge = _interopRequireDefault(require("../Badge"));
|
|
14
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
14
15
|
var _ButtonGroup = _interopRequireDefault(require("../ButtonGroup"));
|
|
16
|
+
var _DistractionFreeModeContext = _interopRequireDefault(require("../DistractionFreeModeContext"));
|
|
15
17
|
var _Input = _interopRequireDefault(require("../Input"));
|
|
16
|
-
var _Button = _interopRequireDefault(require("../Button"));
|
|
17
|
-
var _Badge = _interopRequireDefault(require("../Badge"));
|
|
18
18
|
var _Menu = _interopRequireWildcard(require("../Menu"));
|
|
19
19
|
var _ResponsiveContext = _interopRequireDefault(require("../ResponsiveContext"));
|
|
20
|
-
var _DistractionFreeModeContext = _interopRequireDefault(require("../DistractionFreeModeContext"));
|
|
21
20
|
var _utils2 = require("../utils");
|
|
22
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -34,10 +33,11 @@ class SearchBar extends _react.Component {
|
|
|
34
33
|
(0, _defineProperty2.default)(this, "state", {
|
|
35
34
|
focused: false,
|
|
36
35
|
overMenu: false,
|
|
37
|
-
value: this.props.inputProps
|
|
36
|
+
value: `${this.props.inputProps?.value || ''}`,
|
|
38
37
|
highlightedValue: null
|
|
39
38
|
});
|
|
40
39
|
(0, _defineProperty2.default)(this, "isFocusScheduled", false);
|
|
40
|
+
(0, _defineProperty2.default)(this, "search", void 0);
|
|
41
41
|
(0, _defineProperty2.default)(this, "keyboardNavigation", key => {
|
|
42
42
|
const {
|
|
43
43
|
onItemSelect,
|
|
@@ -52,7 +52,7 @@ class SearchBar extends _react.Component {
|
|
|
52
52
|
let nextIndex;
|
|
53
53
|
if (key === 'ArrowUp') {
|
|
54
54
|
nextIndex = Math.max(currentIndex - 1, 0);
|
|
55
|
-
} else
|
|
55
|
+
} else {
|
|
56
56
|
nextIndex = Math.min(currentIndex + 1, res.length - 1);
|
|
57
57
|
}
|
|
58
58
|
this.setState({
|
|
@@ -87,7 +87,7 @@ class SearchBar extends _react.Component {
|
|
|
87
87
|
} = this.props;
|
|
88
88
|
const {
|
|
89
89
|
value
|
|
90
|
-
} = e.
|
|
90
|
+
} = e.currentTarget;
|
|
91
91
|
if (['Enter', 'Escape', 'ArrowUp', 'ArrowDown'].indexOf(e.key) !== -1) {
|
|
92
92
|
this.checkKeys(e.key);
|
|
93
93
|
return;
|
|
@@ -166,7 +166,7 @@ class SearchBar extends _react.Component {
|
|
|
166
166
|
} = state;
|
|
167
167
|
const nextState = {};
|
|
168
168
|
if (inputPropsValue !== prevInputPropsValue) {
|
|
169
|
-
nextState.value = inputPropsValue;
|
|
169
|
+
nextState.value = inputPropsValue ?? '';
|
|
170
170
|
}
|
|
171
171
|
nextState.prevInputProps = props.inputProps;
|
|
172
172
|
return nextState;
|
|
@@ -180,34 +180,41 @@ class SearchBar extends _react.Component {
|
|
|
180
180
|
isResponsive() {
|
|
181
181
|
return this.props.responsive;
|
|
182
182
|
}
|
|
183
|
-
getResults() {
|
|
184
|
-
let innerResults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
183
|
+
getResults(innerResults) {
|
|
185
184
|
const {
|
|
186
185
|
results
|
|
187
186
|
} = this.props;
|
|
188
187
|
if (!results) {
|
|
189
188
|
return [];
|
|
190
189
|
}
|
|
191
|
-
if (results.type === _Menu.default || innerResults) {
|
|
190
|
+
if ('type' in results && results.type === _Menu.default || innerResults) {
|
|
192
191
|
let res = [];
|
|
193
192
|
const children = innerResults || results.props.children;
|
|
193
|
+
if (!Array.isArray(children)) {
|
|
194
|
+
return res;
|
|
195
|
+
}
|
|
194
196
|
for (let i = 0; i < children.length; i++) {
|
|
195
197
|
const child = children[i];
|
|
196
198
|
if (!child) {
|
|
197
199
|
continue;
|
|
198
200
|
}
|
|
199
|
-
if (child
|
|
201
|
+
if (_react.Children.count(child) > 1) {
|
|
200
202
|
res = res.concat(this.getResults(child));
|
|
201
|
-
} else if (child.type === _Menu.MenuItem || child.type === _Menu.MenuSelectableItem) {
|
|
202
|
-
res.push(child.key);
|
|
203
|
+
} else if ((child.type === _Menu.MenuItem || child.type === _Menu.MenuSelectableItem) && child.key) {
|
|
204
|
+
res.push(child.key.toString());
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
return res;
|
|
206
208
|
}
|
|
207
|
-
return results.map(
|
|
209
|
+
return results.map(_ref => {
|
|
210
|
+
let {
|
|
211
|
+
value
|
|
212
|
+
} = _ref;
|
|
213
|
+
return value;
|
|
214
|
+
});
|
|
208
215
|
}
|
|
209
216
|
getHighlightedValue() {
|
|
210
|
-
return this.state.highlightedValue || this.getResults()[0];
|
|
217
|
+
return (this.state.highlightedValue || this.getResults()[0]) ?? null;
|
|
211
218
|
}
|
|
212
219
|
searchAction() {
|
|
213
220
|
const {
|
|
@@ -248,12 +255,15 @@ class SearchBar extends _react.Component {
|
|
|
248
255
|
}
|
|
249
256
|
elementsIndexToKeyMapping(elements) {
|
|
250
257
|
let result = [];
|
|
258
|
+
if (!Array.isArray(elements)) {
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
251
261
|
for (let i = 0; i < elements.length; i++) {
|
|
252
262
|
const element = elements[i];
|
|
253
263
|
if (!element) {
|
|
254
264
|
continue;
|
|
255
265
|
}
|
|
256
|
-
if (element
|
|
266
|
+
if (Array.isArray(element)) {
|
|
257
267
|
result = result.concat(this.elementsIndexToKeyMapping(element));
|
|
258
268
|
} else {
|
|
259
269
|
result.push(element.key);
|
|
@@ -261,19 +271,15 @@ class SearchBar extends _react.Component {
|
|
|
261
271
|
}
|
|
262
272
|
return result;
|
|
263
273
|
}
|
|
264
|
-
renderResults() {
|
|
274
|
+
renderResults(results) {
|
|
265
275
|
const {
|
|
266
|
-
baseClassName
|
|
267
|
-
results
|
|
276
|
+
baseClassName
|
|
268
277
|
} = this.props;
|
|
269
278
|
const {
|
|
270
279
|
focused,
|
|
271
280
|
overMenu
|
|
272
281
|
} = this.state;
|
|
273
282
|
const highlightedValue = this.getHighlightedValue();
|
|
274
|
-
if (!results || results.length === 0) {
|
|
275
|
-
return null;
|
|
276
|
-
}
|
|
277
283
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
278
284
|
className: (0, _classnames.default)(`${baseClassName}__results`, {
|
|
279
285
|
[`${baseClassName}__results--hidden`]: !focused && !overMenu
|
|
@@ -287,10 +293,9 @@ class SearchBar extends _react.Component {
|
|
|
287
293
|
}, item.value))
|
|
288
294
|
});
|
|
289
295
|
}
|
|
290
|
-
renderResultsMenu() {
|
|
296
|
+
renderResultsMenu(results) {
|
|
291
297
|
const {
|
|
292
298
|
baseClassName,
|
|
293
|
-
results,
|
|
294
299
|
onItemSelect
|
|
295
300
|
} = this.props;
|
|
296
301
|
const {
|
|
@@ -298,21 +303,18 @@ class SearchBar extends _react.Component {
|
|
|
298
303
|
overMenu
|
|
299
304
|
} = this.state;
|
|
300
305
|
const highlightedValue = this.getHighlightedValue();
|
|
301
|
-
if (!results) {
|
|
302
|
-
return null;
|
|
303
|
-
}
|
|
304
306
|
return /*#__PURE__*/(0, _react.cloneElement)(results, {
|
|
305
307
|
className: (0, _classnames.default)(`${baseClassName}__results`, {
|
|
306
308
|
[`${baseClassName}__results--hidden`]: !focused && !overMenu
|
|
307
|
-
}, results.className),
|
|
309
|
+
}, results.props.className),
|
|
308
310
|
onMouseOver: this.handleMenuMouseOver,
|
|
309
311
|
onMouseOut: this.handleMenuMouseOut,
|
|
310
|
-
onItemClick: (
|
|
312
|
+
onItemClick: (_item, index) => {
|
|
311
313
|
const indexMap = this.elementsIndexToKeyMapping(results.props.children);
|
|
312
314
|
this.handleSelect(indexMap[index])();
|
|
313
315
|
},
|
|
314
316
|
children: _react.Children.map(results.props.children, child => {
|
|
315
|
-
if (onItemSelect && child && (child.type === _Menu.MenuItem || child.type === _Menu.MenuSelectableItem)) {
|
|
317
|
+
if (onItemSelect && child && typeof child === 'object' && 'type' in child && (child.type === _Menu.MenuItem || child.type === _Menu.MenuSelectableItem)) {
|
|
316
318
|
return /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
317
319
|
active: child.key === highlightedValue
|
|
318
320
|
});
|
|
@@ -350,7 +352,7 @@ class SearchBar extends _react.Component {
|
|
|
350
352
|
className: (0, _classnames.default)(baseClassName, {
|
|
351
353
|
[`${baseClassName}--focused`]: focused
|
|
352
354
|
}, className),
|
|
353
|
-
style: isCollapsed || distractionFreeModeEnabled ?
|
|
355
|
+
style: isCollapsed || distractionFreeModeEnabled ? undefined : {
|
|
354
356
|
maxWidth,
|
|
355
357
|
minWidth
|
|
356
358
|
},
|
|
@@ -390,128 +392,21 @@ class SearchBar extends _react.Component {
|
|
|
390
392
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
391
393
|
icon: "search",
|
|
392
394
|
onClick: this.handleSearch,
|
|
393
|
-
state: loading ? 'loading' :
|
|
395
|
+
state: loading ? 'loading' : undefined,
|
|
394
396
|
ghost: true
|
|
395
397
|
})]
|
|
396
398
|
})
|
|
397
399
|
})
|
|
398
|
-
}), results && results.type === _Menu.default
|
|
400
|
+
}), Array.isArray(results) && this.renderResults(results), results && !Array.isArray(results) && results.type === _Menu.default && this.renderResultsMenu(results)]
|
|
399
401
|
});
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* @ignore
|
|
405
|
-
*/
|
|
406
|
-
className: _propTypes.default.string,
|
|
407
|
-
/**
|
|
408
|
-
* @ignore
|
|
409
|
-
*/
|
|
410
|
-
baseClassName: _propTypes.default.string,
|
|
411
|
-
/**
|
|
412
|
-
* Maximum width of SearchBar
|
|
413
|
-
* @since 0.1.0
|
|
414
|
-
*/
|
|
415
|
-
maxWidth: _propTypes.default.number,
|
|
416
|
-
/**
|
|
417
|
-
* Minimum width of SearchBar
|
|
418
|
-
* @since 0.1.0
|
|
419
|
-
*/
|
|
420
|
-
minWidth: _propTypes.default.number,
|
|
421
|
-
/**
|
|
422
|
-
* Should disable input and show spinner or not.
|
|
423
|
-
* @since 0.1.0
|
|
424
|
-
*/
|
|
425
|
-
loading: _propTypes.default.bool,
|
|
426
|
-
/**
|
|
427
|
-
* Should collapse input or not. Used for control in independence of context.
|
|
428
|
-
* @since 0.1.0
|
|
429
|
-
*/
|
|
430
|
-
responsive: _propTypes.default.bool,
|
|
431
|
-
/**
|
|
432
|
-
* Callback for pressing 'Enter' key or 'Search' button.
|
|
433
|
-
*
|
|
434
|
-
* arguments:
|
|
435
|
-
* * value - search value
|
|
436
|
-
* * clearHandler - function that clears input value
|
|
437
|
-
* @since 0.1.0
|
|
438
|
-
*/
|
|
439
|
-
onSearch: _propTypes.default.func,
|
|
440
|
-
/**
|
|
441
|
-
* Callback for pressing any key in input. Used for a live search.
|
|
442
|
-
*
|
|
443
|
-
* arguments:
|
|
444
|
-
* * value - search value
|
|
445
|
-
* * clearHandler - function that clears input value
|
|
446
|
-
* @since 0.1.0
|
|
447
|
-
*/
|
|
448
|
-
onTyping: _propTypes.default.func,
|
|
449
|
-
/**
|
|
450
|
-
* Callback for selecting menu item with mouse click or key pressing.
|
|
451
|
-
*
|
|
452
|
-
* arguments:
|
|
453
|
-
* * value - selected value
|
|
454
|
-
* * clearHandler - function that clears input value
|
|
455
|
-
* @since 0.1.0
|
|
456
|
-
*/
|
|
457
|
-
onItemSelect: _propTypes.default.func,
|
|
458
|
-
/**
|
|
459
|
-
* Should render toggle button or not.
|
|
460
|
-
* @since 2.2.0
|
|
461
|
-
*/
|
|
462
|
-
collapsable: _propTypes.default.bool,
|
|
463
|
-
/**
|
|
464
|
-
* Callback for pressing toggle button (in normal mode).
|
|
465
|
-
* @since 2.2.0
|
|
466
|
-
*/
|
|
467
|
-
onCollapse: _propTypes.default.func,
|
|
468
|
-
/**
|
|
469
|
-
* Callback for pressing toggle button (in collapsed mode).
|
|
470
|
-
* @since 2.2.0
|
|
471
|
-
*/
|
|
472
|
-
onExpand: _propTypes.default.func,
|
|
473
|
-
/**
|
|
474
|
-
* Results to display.
|
|
475
|
-
* Could be specified by array of objects with "value" and "title" properties or by Menu component.
|
|
476
|
-
* If Menu component is used then key property of MenuItem will be treated as value.
|
|
477
|
-
* @since 0.1.0
|
|
478
|
-
*/
|
|
479
|
-
results: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape({
|
|
480
|
-
value: _propTypes.default.string.isRequired,
|
|
481
|
-
title: _propTypes.default.string.isRequired
|
|
482
|
-
})), _propTypes.default.element]),
|
|
483
|
-
/**
|
|
484
|
-
* Props of underlying input element.
|
|
485
|
-
* @since 0.4.1
|
|
486
|
-
*/
|
|
487
|
-
inputProps: _propTypes.default.object
|
|
488
|
-
};
|
|
489
|
-
const defaultProps = {
|
|
490
|
-
className: undefined,
|
|
404
|
+
(0, _defineProperty2.default)(SearchBar, "defaultProps", {
|
|
491
405
|
baseClassName: `${_constants.CLS_PREFIX}search-bar`,
|
|
492
406
|
maxWidth: 500,
|
|
493
407
|
minWidth: 270,
|
|
494
|
-
loading: false,
|
|
495
|
-
responsive: undefined,
|
|
496
|
-
onSearch: undefined,
|
|
497
|
-
onTyping: undefined,
|
|
498
|
-
onItemSelect: undefined,
|
|
499
|
-
collapsable: false,
|
|
500
|
-
onCollapse: undefined,
|
|
501
|
-
onExpand: undefined,
|
|
502
|
-
results: undefined,
|
|
503
408
|
inputProps: {}
|
|
504
|
-
};
|
|
505
|
-
SearchBar.propTypes = {
|
|
506
|
-
...propTypes,
|
|
507
|
-
distractionFreeMode: _propTypes.default.shape({
|
|
508
|
-
enabled: _propTypes.default.bool.isRequired,
|
|
509
|
-
toggle: _propTypes.default.func.isRequired
|
|
510
|
-
})
|
|
511
|
-
};
|
|
512
|
-
SearchBar.defaultProps = {
|
|
513
|
-
distractionFreeMode: undefined
|
|
514
|
-
};
|
|
409
|
+
});
|
|
515
410
|
const SearchBarWrapper = props => {
|
|
516
411
|
const distractionFreeMode = (0, _react.useContext)(_DistractionFreeModeContext.default);
|
|
517
412
|
let responsive = (0, _react.useContext)(_ResponsiveContext.default);
|
|
@@ -523,6 +418,4 @@ const SearchBarWrapper = props => {
|
|
|
523
418
|
});
|
|
524
419
|
};
|
|
525
420
|
SearchBarWrapper.displayName = 'SearchBar';
|
|
526
|
-
SearchBarWrapper.propTypes = propTypes;
|
|
527
|
-
SearchBarWrapper.defaultProps = defaultProps;
|
|
528
421
|
var _default = exports.default = SearchBarWrapper;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
8
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
12
9
|
/* eslint-disable react/no-unused-prop-types */
|
|
@@ -18,7 +15,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
18
15
|
* It can also display a [Label](#!/Label) next to the tab name for showing additional information about its content.
|
|
19
16
|
* You can make `Tabs` closeable, for example, if you are using them for opening and displaying files.
|
|
20
17
|
* @since 0.0.35
|
|
21
|
-
*/
|
|
18
|
+
*/
|
|
19
|
+
const Tab = _ref => {
|
|
22
20
|
let {
|
|
23
21
|
children
|
|
24
22
|
} = _ref;
|
|
@@ -26,49 +24,4 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
26
24
|
children: children
|
|
27
25
|
});
|
|
28
26
|
};
|
|
29
|
-
Tab.propTypes = {
|
|
30
|
-
/**
|
|
31
|
-
* Tab title
|
|
32
|
-
* @since 0.0.35
|
|
33
|
-
*/
|
|
34
|
-
title: _propTypes.default.node.isRequired,
|
|
35
|
-
/**
|
|
36
|
-
* Label in tab title
|
|
37
|
-
* @since 0.0.42
|
|
38
|
-
*/
|
|
39
|
-
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
40
|
-
/**
|
|
41
|
-
* Name of icon or Icon component for tab
|
|
42
|
-
* @since 0.0.42
|
|
43
|
-
*/
|
|
44
|
-
icon: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]),
|
|
45
|
-
/**
|
|
46
|
-
* Activate callback.
|
|
47
|
-
* @since 0.0.43
|
|
48
|
-
*/
|
|
49
|
-
onActivate: _propTypes.default.func,
|
|
50
|
-
/**
|
|
51
|
-
* Close callback
|
|
52
|
-
* @since 0.0.58
|
|
53
|
-
*/
|
|
54
|
-
onClose: _propTypes.default.func,
|
|
55
|
-
/**
|
|
56
|
-
* Component to render as the root element.
|
|
57
|
-
* @since 2.5.1
|
|
58
|
-
*/
|
|
59
|
-
component: _propTypes.default.elementType,
|
|
60
|
-
/**
|
|
61
|
-
* Tab content
|
|
62
|
-
* @since 0.0.47
|
|
63
|
-
*/
|
|
64
|
-
children: _propTypes.default.node
|
|
65
|
-
};
|
|
66
|
-
Tab.defaultProps = {
|
|
67
|
-
label: undefined,
|
|
68
|
-
icon: undefined,
|
|
69
|
-
onActivate: undefined,
|
|
70
|
-
onClose: undefined,
|
|
71
|
-
children: undefined,
|
|
72
|
-
component: undefined
|
|
73
|
-
};
|
|
74
27
|
var _default = exports.default = Tab;
|