@plesk/ui-library 3.35.5 → 3.35.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/AutoClosable/AutoClosable.js +1 -0
- package/cjs/components/InputNumber/InputNumber.js +2 -2
- package/cjs/components/Item/Item.js +64 -153
- package/cjs/components/Overlay/Overlay.js +29 -27
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/SegmentedControl/SegmentedControl.js +1 -0
- package/cjs/components/Tabs/SearchBar.js +40 -147
- package/cjs/components/Tabs/Tab.js +2 -49
- package/cjs/components/Tabs/Tabs.js +48 -99
- package/cjs/components/Toolbar/ToolbarItem.js +1 -0
- package/cjs/components/index.js +21 -11
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library.js +442 -628
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +8 -12
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/AutoClosable/AutoClosable.js +1 -0
- package/esm/components/InputNumber/InputNumber.js +2 -2
- package/esm/components/Item/Item.js +64 -153
- package/esm/components/Overlay/Overlay.js +29 -27
- package/esm/components/Popover/Popover.js +1 -1
- package/esm/components/SegmentedControl/SegmentedControl.js +1 -0
- package/esm/components/Tabs/SearchBar.js +40 -147
- package/esm/components/Tabs/Tab.js +1 -49
- package/esm/components/Tabs/Tabs.js +49 -99
- package/esm/components/Toolbar/ToolbarItem.js +1 -0
- package/esm/components/index.js +2 -3
- package/esm/index.js +1 -1
- package/package.json +29 -35
- package/styleguide/build/bundle.a2d3190d.js +2 -0
- package/styleguide/build/{bundle.ecbe3015.js.LICENSE.txt → bundle.a2d3190d.js.LICENSE.txt} +27 -23
- package/styleguide/index.html +2 -2
- package/types/src/components/Action/Action.d.ts +1 -1
- package/types/src/components/Alert/Alert.d.ts +1 -1
- package/types/src/components/AutoClosable/AutoClosable.d.ts +23 -21
- package/types/src/components/AuxiliaryActions/AuxiliaryActions.d.ts +1 -1
- package/types/src/components/Badge/Badge.d.ts +1 -1
- package/types/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/types/src/components/Button/Button.d.ts +2 -2
- package/types/src/components/Button/ButtonContext.d.ts +1 -1
- package/types/src/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/types/src/components/Card/PreviewPanel.d.ts +4 -3
- package/types/src/components/Carousel/Carousel.d.ts +1 -1
- package/types/src/components/Checkbox/Checkbox.d.ts +1 -1
- package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +1 -1
- package/types/src/components/ComboBox/ComboBox.d.ts +2 -2
- package/types/src/components/ComboBox/ComboBoxOption.d.ts +1 -1
- package/types/src/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +5 -5
- package/types/src/components/ConsoleOutput/ConsoleOutput.d.ts +2 -2
- package/types/src/components/ContentLoader/ContentLoader.d.ts +2 -2
- package/types/src/components/ContentLoader/IconsLoader.d.ts +2 -2
- package/types/src/components/Cuttable/Cuttable.d.ts +3 -3
- package/types/src/components/Dialog/Dialog.d.ts +3 -3
- package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +1 -1
- package/types/src/components/Drawer/Drawer.d.ts +1 -1
- package/types/src/components/Drawer/DrawerProgress.d.ts +4 -4
- package/types/src/components/Drawer/Header.d.ts +1 -1
- package/types/src/components/Dropdown/Dropdown.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessage.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageActions.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.d.ts +1 -1
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.d.ts +1 -1
- package/types/src/components/Figure/Figure.d.ts +1 -1
- package/types/src/components/Form/Form.d.ts +2 -2
- package/types/src/components/Form/types.d.ts +7 -7
- package/types/src/components/Form/utils.d.ts +3 -3
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.d.ts +1 -1
- package/types/src/components/FormFieldPassword/FormFieldPassword.d.ts +4 -4
- package/types/src/components/FormFieldPassword/PasswordMeter.d.ts +1 -1
- package/types/src/components/FormFieldPassword/estimatePassword.d.ts +2 -2
- package/types/src/components/FormFieldSelect/FormFieldSelect.d.ts +2 -2
- package/types/src/components/FormFieldText/FormFieldText.d.ts +4 -4
- package/types/src/components/Grid/Grid.d.ts +4 -4
- package/types/src/components/GridCol/GridCol.d.ts +2 -2
- package/types/src/components/Heading/Heading.d.ts +1 -1
- package/types/src/components/Hint/Hint.d.ts +1 -1
- package/types/src/components/Icon/Icon.d.ts +3 -3
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/InPlaceEdit/InPlaceEdit.d.ts +2 -2
- package/types/src/components/Input/Input.d.ts +4 -3
- package/types/src/components/InputFile/InputFile.d.ts +1 -1
- package/types/src/components/Item/Item.d.ts +79 -0
- package/types/src/components/Item/index.d.ts +2 -0
- package/types/src/components/ItemLink/ItemLink.d.ts +1 -1
- package/types/src/components/ItemList/ItemList.d.ts +7 -7
- package/types/src/components/Label/Label.d.ts +3 -3
- package/types/src/components/Layer/Layer.d.ts +1 -1
- package/types/src/components/Layout/Layout.d.ts +9 -9
- package/types/src/components/Link/Link.d.ts +3 -3
- package/types/src/components/List/ListAction.d.ts +5 -5
- package/types/src/components/List/ListActions.d.ts +2 -2
- package/types/src/components/List/ListActionsDivider.d.ts +2 -2
- package/types/src/components/List/ListEmptyView.d.ts +1 -1
- package/types/src/components/List/ListOperation.d.ts +9 -5
- package/types/src/components/List/ListOperationContext.d.ts +2 -2
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +5 -5
- package/types/src/components/Markdown/Markdown.d.ts +2 -2
- package/types/src/components/Media/Media.d.ts +1 -1
- package/types/src/components/Media/MediaSection.d.ts +1 -1
- package/types/src/components/Menu/Menu.d.ts +1 -1
- package/types/src/components/Menu/MenuBaseItem.d.ts +3 -3
- package/types/src/components/Menu/MenuDivider.d.ts +1 -1
- package/types/src/components/Menu/MenuHeader.d.ts +1 -1
- package/types/src/components/Menu/MenuItem.d.ts +2 -2
- package/types/src/components/Menu/MenuSelectableItem.d.ts +2 -2
- package/types/src/components/Overlay/Overlay.d.ts +2 -2
- package/types/src/components/PageHeader/PageHeader.d.ts +3 -2
- package/types/src/components/Pagination/Pagination.d.ts +2 -2
- package/types/src/components/Panel/Panel.d.ts +3 -3
- package/types/src/components/Paragraph/Paragraph.d.ts +1 -1
- package/types/src/components/Plaintext/Plaintext.d.ts +1 -1
- package/types/src/components/Popover/Popover.d.ts +5 -3
- package/types/src/components/Popper/Popper.d.ts +2 -2
- package/types/src/components/Progress/Progress.d.ts +2 -2
- package/types/src/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/types/src/components/ProgressBar/ProgressIndicator.d.ts +1 -1
- package/types/src/components/ProgressDialog/ProgressDialog.d.ts +2 -2
- package/types/src/components/ProgressStep/ProgressStep.d.ts +2 -2
- package/types/src/components/Radio/Radio.d.ts +1 -1
- package/types/src/components/Rating/Rating.d.ts +1 -1
- package/types/src/components/Section/Section.d.ts +5 -5
- package/types/src/components/Section/SectionItem.d.ts +1 -1
- package/types/src/components/SegmentedControl/SegmentedControl.d.ts +16 -12
- package/types/src/components/Select/MultiValue.d.ts +1 -1
- package/types/src/components/Select/Select.d.ts +1 -1
- package/types/src/components/Select/SelectControl.d.ts +1 -1
- package/types/src/components/Select/SelectOption.d.ts +1 -1
- package/types/src/components/Select/SelectOptionGroup.d.ts +1 -1
- package/types/src/components/Select/structures.d.ts +3 -3
- package/types/src/components/Skeleton/Skeleton.d.ts +1 -1
- package/types/src/components/Spinner/Spinner.d.ts +1 -1
- package/types/src/components/SplitButton/SplitButton.d.ts +1 -1
- package/types/src/components/Spot/Spot.d.ts +1 -1
- package/types/src/components/Spot/SpotPopup.d.ts +5 -3
- package/types/src/components/Squeezer/Squeezer.d.ts +2 -2
- package/types/src/components/Status/Status.d.ts +3 -3
- package/types/src/components/StatusMessage/StatusMessage.d.ts +1 -1
- package/types/src/components/Subnav/Subnav.d.ts +1 -1
- package/types/src/components/Switch/Switch.d.ts +3 -2
- package/types/src/components/SwitchesPanel/SwitchesPanel.d.ts +1 -1
- package/types/src/components/SwitchesPanelItem/SwitchesPanelItem.d.ts +1 -1
- package/types/src/components/Tabs/SearchBar.d.ts +107 -0
- package/types/src/components/Tabs/Tab.d.ts +62 -0
- package/types/src/components/Tabs/Tabs.d.ts +111 -0
- package/types/src/components/Tabs/index.d.ts +6 -0
- package/types/src/components/Text/Text.d.ts +1 -1
- package/types/src/components/TextArea/TextArea.d.ts +4 -4
- package/types/src/components/Toast/Toast.d.ts +2 -2
- package/types/src/components/Toaster/Toaster.d.ts +4 -4
- package/types/src/components/Toolbar/RegistryContext.d.ts +2 -2
- package/types/src/components/Toolbar/Toolbar.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarExpander.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/src/components/Toolbar/ToolbarMenu.d.ts +1 -1
- package/types/src/components/Tooltip/Tooltip.d.ts +2 -2
- package/types/src/components/Tour/Tour.d.ts +2 -2
- package/types/src/components/Translate/Translate.d.ts +5 -3
- package/types/src/components/index.d.ts +4 -3
- package/types/src/components/utils.d.ts +5 -5
- package/types/src/utils/types/PolymorphicComponent.d.ts +5 -5
- package/styleguide/build/bundle.ecbe3015.js +0 -2
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import { isRtl } from '../../utils';
|
|
5
|
-
import React, { Component, cloneElement, Children, useContext } from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
4
|
import classNames from 'classnames';
|
|
5
|
+
import { Children, cloneElement, Component, useContext } from 'react';
|
|
8
6
|
import { CLS_PREFIX } from '../../constants';
|
|
7
|
+
import { isRtl } from '../../utils';
|
|
8
|
+
import Badge from '../Badge';
|
|
9
|
+
import Button from '../Button';
|
|
9
10
|
import ButtonGroup from '../ButtonGroup';
|
|
11
|
+
import DistractionFreeModeContext from '../DistractionFreeModeContext';
|
|
10
12
|
import Input from '../Input';
|
|
11
|
-
import Button from '../Button';
|
|
12
|
-
import Badge from '../Badge';
|
|
13
13
|
import Menu, { MenuItem, MenuSelectableItem } from '../Menu';
|
|
14
14
|
import ResponsiveContext from '../ResponsiveContext';
|
|
15
|
-
import DistractionFreeModeContext from '../DistractionFreeModeContext';
|
|
16
15
|
import { safeInvoke } from '../utils';
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
17
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -27,10 +26,11 @@ class SearchBar extends Component {
|
|
|
27
26
|
_defineProperty(this, "state", {
|
|
28
27
|
focused: false,
|
|
29
28
|
overMenu: false,
|
|
30
|
-
value: this.props.inputProps
|
|
29
|
+
value: `${this.props.inputProps?.value || ''}`,
|
|
31
30
|
highlightedValue: null
|
|
32
31
|
});
|
|
33
32
|
_defineProperty(this, "isFocusScheduled", false);
|
|
33
|
+
_defineProperty(this, "search", void 0);
|
|
34
34
|
_defineProperty(this, "keyboardNavigation", key => {
|
|
35
35
|
const {
|
|
36
36
|
onItemSelect,
|
|
@@ -45,7 +45,7 @@ class SearchBar extends Component {
|
|
|
45
45
|
let nextIndex;
|
|
46
46
|
if (key === 'ArrowUp') {
|
|
47
47
|
nextIndex = Math.max(currentIndex - 1, 0);
|
|
48
|
-
} else
|
|
48
|
+
} else {
|
|
49
49
|
nextIndex = Math.min(currentIndex + 1, res.length - 1);
|
|
50
50
|
}
|
|
51
51
|
this.setState({
|
|
@@ -80,7 +80,7 @@ class SearchBar extends Component {
|
|
|
80
80
|
} = this.props;
|
|
81
81
|
const {
|
|
82
82
|
value
|
|
83
|
-
} = e.
|
|
83
|
+
} = e.currentTarget;
|
|
84
84
|
if (['Enter', 'Escape', 'ArrowUp', 'ArrowDown'].indexOf(e.key) !== -1) {
|
|
85
85
|
this.checkKeys(e.key);
|
|
86
86
|
return;
|
|
@@ -159,7 +159,7 @@ class SearchBar extends Component {
|
|
|
159
159
|
} = state;
|
|
160
160
|
const nextState = {};
|
|
161
161
|
if (inputPropsValue !== prevInputPropsValue) {
|
|
162
|
-
nextState.value = inputPropsValue;
|
|
162
|
+
nextState.value = inputPropsValue ?? '';
|
|
163
163
|
}
|
|
164
164
|
nextState.prevInputProps = props.inputProps;
|
|
165
165
|
return nextState;
|
|
@@ -173,34 +173,41 @@ class SearchBar extends Component {
|
|
|
173
173
|
isResponsive() {
|
|
174
174
|
return this.props.responsive;
|
|
175
175
|
}
|
|
176
|
-
getResults() {
|
|
177
|
-
let innerResults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
176
|
+
getResults(innerResults) {
|
|
178
177
|
const {
|
|
179
178
|
results
|
|
180
179
|
} = this.props;
|
|
181
180
|
if (!results) {
|
|
182
181
|
return [];
|
|
183
182
|
}
|
|
184
|
-
if (results.type === Menu || innerResults) {
|
|
183
|
+
if ('type' in results && results.type === Menu || innerResults) {
|
|
185
184
|
let res = [];
|
|
186
185
|
const children = innerResults || results.props.children;
|
|
186
|
+
if (!Array.isArray(children)) {
|
|
187
|
+
return res;
|
|
188
|
+
}
|
|
187
189
|
for (let i = 0; i < children.length; i++) {
|
|
188
190
|
const child = children[i];
|
|
189
191
|
if (!child) {
|
|
190
192
|
continue;
|
|
191
193
|
}
|
|
192
|
-
if (child
|
|
194
|
+
if (Children.count(child) > 1) {
|
|
193
195
|
res = res.concat(this.getResults(child));
|
|
194
|
-
} else if (child.type === MenuItem || child.type === MenuSelectableItem) {
|
|
195
|
-
res.push(child.key);
|
|
196
|
+
} else if ((child.type === MenuItem || child.type === MenuSelectableItem) && child.key) {
|
|
197
|
+
res.push(child.key.toString());
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
return res;
|
|
199
201
|
}
|
|
200
|
-
return results.map(
|
|
202
|
+
return results.map(_ref => {
|
|
203
|
+
let {
|
|
204
|
+
value
|
|
205
|
+
} = _ref;
|
|
206
|
+
return value;
|
|
207
|
+
});
|
|
201
208
|
}
|
|
202
209
|
getHighlightedValue() {
|
|
203
|
-
return this.state.highlightedValue || this.getResults()[0];
|
|
210
|
+
return (this.state.highlightedValue || this.getResults()[0]) ?? null;
|
|
204
211
|
}
|
|
205
212
|
searchAction() {
|
|
206
213
|
const {
|
|
@@ -241,12 +248,15 @@ class SearchBar extends Component {
|
|
|
241
248
|
}
|
|
242
249
|
elementsIndexToKeyMapping(elements) {
|
|
243
250
|
let result = [];
|
|
251
|
+
if (!Array.isArray(elements)) {
|
|
252
|
+
return result;
|
|
253
|
+
}
|
|
244
254
|
for (let i = 0; i < elements.length; i++) {
|
|
245
255
|
const element = elements[i];
|
|
246
256
|
if (!element) {
|
|
247
257
|
continue;
|
|
248
258
|
}
|
|
249
|
-
if (element
|
|
259
|
+
if (Array.isArray(element)) {
|
|
250
260
|
result = result.concat(this.elementsIndexToKeyMapping(element));
|
|
251
261
|
} else {
|
|
252
262
|
result.push(element.key);
|
|
@@ -254,19 +264,15 @@ class SearchBar extends Component {
|
|
|
254
264
|
}
|
|
255
265
|
return result;
|
|
256
266
|
}
|
|
257
|
-
renderResults() {
|
|
267
|
+
renderResults(results) {
|
|
258
268
|
const {
|
|
259
|
-
baseClassName
|
|
260
|
-
results
|
|
269
|
+
baseClassName
|
|
261
270
|
} = this.props;
|
|
262
271
|
const {
|
|
263
272
|
focused,
|
|
264
273
|
overMenu
|
|
265
274
|
} = this.state;
|
|
266
275
|
const highlightedValue = this.getHighlightedValue();
|
|
267
|
-
if (!results || results.length === 0) {
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
276
|
return /*#__PURE__*/_jsx(Menu, {
|
|
271
277
|
className: classNames(`${baseClassName}__results`, {
|
|
272
278
|
[`${baseClassName}__results--hidden`]: !focused && !overMenu
|
|
@@ -280,10 +286,9 @@ class SearchBar extends Component {
|
|
|
280
286
|
}, item.value))
|
|
281
287
|
});
|
|
282
288
|
}
|
|
283
|
-
renderResultsMenu() {
|
|
289
|
+
renderResultsMenu(results) {
|
|
284
290
|
const {
|
|
285
291
|
baseClassName,
|
|
286
|
-
results,
|
|
287
292
|
onItemSelect
|
|
288
293
|
} = this.props;
|
|
289
294
|
const {
|
|
@@ -291,21 +296,18 @@ class SearchBar extends Component {
|
|
|
291
296
|
overMenu
|
|
292
297
|
} = this.state;
|
|
293
298
|
const highlightedValue = this.getHighlightedValue();
|
|
294
|
-
if (!results) {
|
|
295
|
-
return null;
|
|
296
|
-
}
|
|
297
299
|
return /*#__PURE__*/cloneElement(results, {
|
|
298
300
|
className: classNames(`${baseClassName}__results`, {
|
|
299
301
|
[`${baseClassName}__results--hidden`]: !focused && !overMenu
|
|
300
|
-
}, results.className),
|
|
302
|
+
}, results.props.className),
|
|
301
303
|
onMouseOver: this.handleMenuMouseOver,
|
|
302
304
|
onMouseOut: this.handleMenuMouseOut,
|
|
303
|
-
onItemClick: (
|
|
305
|
+
onItemClick: (_item, index) => {
|
|
304
306
|
const indexMap = this.elementsIndexToKeyMapping(results.props.children);
|
|
305
307
|
this.handleSelect(indexMap[index])();
|
|
306
308
|
},
|
|
307
309
|
children: Children.map(results.props.children, child => {
|
|
308
|
-
if (onItemSelect && child && (child.type === MenuItem || child.type === MenuSelectableItem)) {
|
|
310
|
+
if (onItemSelect && child && typeof child === 'object' && 'type' in child && (child.type === MenuItem || child.type === MenuSelectableItem)) {
|
|
309
311
|
return /*#__PURE__*/cloneElement(child, {
|
|
310
312
|
active: child.key === highlightedValue
|
|
311
313
|
});
|
|
@@ -343,7 +345,7 @@ class SearchBar extends Component {
|
|
|
343
345
|
className: classNames(baseClassName, {
|
|
344
346
|
[`${baseClassName}--focused`]: focused
|
|
345
347
|
}, className),
|
|
346
|
-
style: isCollapsed || distractionFreeModeEnabled ?
|
|
348
|
+
style: isCollapsed || distractionFreeModeEnabled ? undefined : {
|
|
347
349
|
maxWidth,
|
|
348
350
|
minWidth
|
|
349
351
|
},
|
|
@@ -383,128 +385,21 @@ class SearchBar extends Component {
|
|
|
383
385
|
}), /*#__PURE__*/_jsx(Button, {
|
|
384
386
|
icon: "search",
|
|
385
387
|
onClick: this.handleSearch,
|
|
386
|
-
state: loading ? 'loading' :
|
|
388
|
+
state: loading ? 'loading' : undefined,
|
|
387
389
|
ghost: true
|
|
388
390
|
})]
|
|
389
391
|
})
|
|
390
392
|
})
|
|
391
|
-
}), results && results.type === Menu
|
|
393
|
+
}), Array.isArray(results) && this.renderResults(results), results && !Array.isArray(results) && results.type === Menu && this.renderResultsMenu(results)]
|
|
392
394
|
});
|
|
393
395
|
}
|
|
394
396
|
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* @ignore
|
|
398
|
-
*/
|
|
399
|
-
className: PropTypes.string,
|
|
400
|
-
/**
|
|
401
|
-
* @ignore
|
|
402
|
-
*/
|
|
403
|
-
baseClassName: PropTypes.string,
|
|
404
|
-
/**
|
|
405
|
-
* Maximum width of SearchBar
|
|
406
|
-
* @since 0.1.0
|
|
407
|
-
*/
|
|
408
|
-
maxWidth: PropTypes.number,
|
|
409
|
-
/**
|
|
410
|
-
* Minimum width of SearchBar
|
|
411
|
-
* @since 0.1.0
|
|
412
|
-
*/
|
|
413
|
-
minWidth: PropTypes.number,
|
|
414
|
-
/**
|
|
415
|
-
* Should disable input and show spinner or not.
|
|
416
|
-
* @since 0.1.0
|
|
417
|
-
*/
|
|
418
|
-
loading: PropTypes.bool,
|
|
419
|
-
/**
|
|
420
|
-
* Should collapse input or not. Used for control in independence of context.
|
|
421
|
-
* @since 0.1.0
|
|
422
|
-
*/
|
|
423
|
-
responsive: PropTypes.bool,
|
|
424
|
-
/**
|
|
425
|
-
* Callback for pressing 'Enter' key or 'Search' button.
|
|
426
|
-
*
|
|
427
|
-
* arguments:
|
|
428
|
-
* * value - search value
|
|
429
|
-
* * clearHandler - function that clears input value
|
|
430
|
-
* @since 0.1.0
|
|
431
|
-
*/
|
|
432
|
-
onSearch: PropTypes.func,
|
|
433
|
-
/**
|
|
434
|
-
* Callback for pressing any key in input. Used for a live search.
|
|
435
|
-
*
|
|
436
|
-
* arguments:
|
|
437
|
-
* * value - search value
|
|
438
|
-
* * clearHandler - function that clears input value
|
|
439
|
-
* @since 0.1.0
|
|
440
|
-
*/
|
|
441
|
-
onTyping: PropTypes.func,
|
|
442
|
-
/**
|
|
443
|
-
* Callback for selecting menu item with mouse click or key pressing.
|
|
444
|
-
*
|
|
445
|
-
* arguments:
|
|
446
|
-
* * value - selected value
|
|
447
|
-
* * clearHandler - function that clears input value
|
|
448
|
-
* @since 0.1.0
|
|
449
|
-
*/
|
|
450
|
-
onItemSelect: PropTypes.func,
|
|
451
|
-
/**
|
|
452
|
-
* Should render toggle button or not.
|
|
453
|
-
* @since 2.2.0
|
|
454
|
-
*/
|
|
455
|
-
collapsable: PropTypes.bool,
|
|
456
|
-
/**
|
|
457
|
-
* Callback for pressing toggle button (in normal mode).
|
|
458
|
-
* @since 2.2.0
|
|
459
|
-
*/
|
|
460
|
-
onCollapse: PropTypes.func,
|
|
461
|
-
/**
|
|
462
|
-
* Callback for pressing toggle button (in collapsed mode).
|
|
463
|
-
* @since 2.2.0
|
|
464
|
-
*/
|
|
465
|
-
onExpand: PropTypes.func,
|
|
466
|
-
/**
|
|
467
|
-
* Results to display.
|
|
468
|
-
* Could be specified by array of objects with "value" and "title" properties or by Menu component.
|
|
469
|
-
* If Menu component is used then key property of MenuItem will be treated as value.
|
|
470
|
-
* @since 0.1.0
|
|
471
|
-
*/
|
|
472
|
-
results: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
473
|
-
value: PropTypes.string.isRequired,
|
|
474
|
-
title: PropTypes.string.isRequired
|
|
475
|
-
})), PropTypes.element]),
|
|
476
|
-
/**
|
|
477
|
-
* Props of underlying input element.
|
|
478
|
-
* @since 0.4.1
|
|
479
|
-
*/
|
|
480
|
-
inputProps: PropTypes.object
|
|
481
|
-
};
|
|
482
|
-
const defaultProps = {
|
|
483
|
-
className: undefined,
|
|
397
|
+
_defineProperty(SearchBar, "defaultProps", {
|
|
484
398
|
baseClassName: `${CLS_PREFIX}search-bar`,
|
|
485
399
|
maxWidth: 500,
|
|
486
400
|
minWidth: 270,
|
|
487
|
-
loading: false,
|
|
488
|
-
responsive: undefined,
|
|
489
|
-
onSearch: undefined,
|
|
490
|
-
onTyping: undefined,
|
|
491
|
-
onItemSelect: undefined,
|
|
492
|
-
collapsable: false,
|
|
493
|
-
onCollapse: undefined,
|
|
494
|
-
onExpand: undefined,
|
|
495
|
-
results: undefined,
|
|
496
401
|
inputProps: {}
|
|
497
|
-
};
|
|
498
|
-
SearchBar.propTypes = {
|
|
499
|
-
...propTypes,
|
|
500
|
-
distractionFreeMode: PropTypes.shape({
|
|
501
|
-
enabled: PropTypes.bool.isRequired,
|
|
502
|
-
toggle: PropTypes.func.isRequired
|
|
503
|
-
})
|
|
504
|
-
};
|
|
505
|
-
SearchBar.defaultProps = {
|
|
506
|
-
distractionFreeMode: undefined
|
|
507
|
-
};
|
|
402
|
+
});
|
|
508
403
|
const SearchBarWrapper = props => {
|
|
509
404
|
const distractionFreeMode = useContext(DistractionFreeModeContext);
|
|
510
405
|
let responsive = useContext(ResponsiveContext);
|
|
@@ -516,6 +411,4 @@ const SearchBarWrapper = props => {
|
|
|
516
411
|
});
|
|
517
412
|
};
|
|
518
413
|
SearchBarWrapper.displayName = 'SearchBar';
|
|
519
|
-
SearchBarWrapper.propTypes = propTypes;
|
|
520
|
-
SearchBarWrapper.defaultProps = defaultProps;
|
|
521
414
|
export default SearchBarWrapper;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
3
|
/* eslint-disable react/no-unused-prop-types */
|
|
3
4
|
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* `Tab` is an individual element of the [Tabs](#!/Tabs) component.
|
|
9
7
|
*
|
|
@@ -12,7 +10,6 @@ import PropTypes from 'prop-types';
|
|
|
12
10
|
* You can make `Tabs` closeable, for example, if you are using them for opening and displaying files.
|
|
13
11
|
* @since 0.0.35
|
|
14
12
|
*/
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
13
|
const Tab = _ref => {
|
|
17
14
|
let {
|
|
18
15
|
children
|
|
@@ -21,49 +18,4 @@ const Tab = _ref => {
|
|
|
21
18
|
children: children
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
|
-
Tab.propTypes = {
|
|
25
|
-
/**
|
|
26
|
-
* Tab title
|
|
27
|
-
* @since 0.0.35
|
|
28
|
-
*/
|
|
29
|
-
title: PropTypes.node.isRequired,
|
|
30
|
-
/**
|
|
31
|
-
* Label in tab title
|
|
32
|
-
* @since 0.0.42
|
|
33
|
-
*/
|
|
34
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
35
|
-
/**
|
|
36
|
-
* Name of icon or Icon component for tab
|
|
37
|
-
* @since 0.0.42
|
|
38
|
-
*/
|
|
39
|
-
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
40
|
-
/**
|
|
41
|
-
* Activate callback.
|
|
42
|
-
* @since 0.0.43
|
|
43
|
-
*/
|
|
44
|
-
onActivate: PropTypes.func,
|
|
45
|
-
/**
|
|
46
|
-
* Close callback
|
|
47
|
-
* @since 0.0.58
|
|
48
|
-
*/
|
|
49
|
-
onClose: PropTypes.func,
|
|
50
|
-
/**
|
|
51
|
-
* Component to render as the root element.
|
|
52
|
-
* @since 2.5.1
|
|
53
|
-
*/
|
|
54
|
-
component: PropTypes.elementType,
|
|
55
|
-
/**
|
|
56
|
-
* Tab content
|
|
57
|
-
* @since 0.0.47
|
|
58
|
-
*/
|
|
59
|
-
children: PropTypes.node
|
|
60
|
-
};
|
|
61
|
-
Tab.defaultProps = {
|
|
62
|
-
label: undefined,
|
|
63
|
-
icon: undefined,
|
|
64
|
-
onActivate: undefined,
|
|
65
|
-
onClose: undefined,
|
|
66
|
-
children: undefined,
|
|
67
|
-
component: undefined
|
|
68
|
-
};
|
|
69
21
|
export default Tab;
|