@plesk/ui-library 3.35.1 → 3.35.2
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/Button/Button.js +1 -2
- package/cjs/components/Carousel/Carousel.js +25 -39
- package/cjs/components/Drawer/Header.js +71 -108
- package/cjs/components/Form/Form.js +5 -7
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +8 -67
- package/cjs/components/Grid/Grid.js +9 -71
- package/cjs/components/GridCol/GridCol.js +3 -54
- package/cjs/components/Link/Link.js +1 -2
- package/cjs/components/List/List.js +11 -8
- package/cjs/components/ProgressDialog/ProgressDialog.js +12 -85
- package/cjs/components/Rating/Rating.js +5 -36
- package/cjs/components/Skeleton/index.js +2 -2
- package/cjs/components/SplitButton/SplitButton.js +1 -2
- package/cjs/components/SwitchesPanel/SwitchesPanel.js +3 -26
- package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -57
- package/cjs/components/Toaster/Toaster.js +3 -3
- package/cjs/components/index.js +14 -11
- package/cjs/index.js +1 -1
- package/cjs/tests/renderer.js +7 -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 +273 -672
- 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/Button/Button.js +1 -2
- package/esm/components/Carousel/Carousel.js +25 -37
- package/esm/components/Drawer/Header.js +70 -107
- package/esm/components/Form/Form.js +5 -7
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +8 -65
- package/esm/components/Grid/Grid.js +9 -69
- package/esm/components/GridCol/GridCol.js +2 -55
- package/esm/components/Link/Link.js +1 -2
- package/esm/components/List/List.js +11 -8
- package/esm/components/ProgressDialog/ProgressDialog.js +12 -83
- package/esm/components/Rating/Rating.js +5 -36
- package/esm/components/Skeleton/index.js +2 -2
- package/esm/components/SplitButton/SplitButton.js +1 -2
- package/esm/components/SwitchesPanel/SwitchesPanel.js +3 -24
- package/esm/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -55
- package/esm/components/Toaster/Toaster.js +3 -1
- package/esm/components/index.js +1 -2
- package/esm/index.js +1 -1
- package/esm/tests/renderer.js +7 -1
- package/package.json +16 -17
- package/styleguide/build/bundle.6318f4a5.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/Button/Button.d.ts +2 -3
- package/types/src/components/Carousel/Carousel.d.ts +58 -0
- package/types/src/components/Carousel/index.d.ts +2 -0
- package/types/src/components/Dialog/Dialog.d.ts +1 -1
- package/types/src/components/Dialog/index.d.ts +1 -1
- package/types/src/components/Drawer/Header.d.ts +4 -20
- package/types/src/components/Form/Form.d.ts +5 -0
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.d.ts +53 -0
- package/types/src/components/FormFieldCheckbox/index.d.ts +2 -0
- package/types/src/components/FormFieldPassword/generatePassword.d.ts +2 -0
- package/types/src/components/Grid/Grid.d.ts +97 -0
- package/types/src/components/Grid/index.d.ts +2 -0
- package/types/src/components/GridCol/GridCol.d.ts +53 -0
- package/types/src/components/GridCol/index.d.ts +2 -0
- package/types/src/components/Link/Link.d.ts +1 -2
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +1 -1
- package/types/src/components/ProgressDialog/ProgressDialog.d.ts +125 -0
- package/types/src/components/ProgressDialog/index.d.ts +2 -0
- package/types/src/components/Rating/Rating.d.ts +27 -0
- package/types/src/components/Rating/index.d.ts +2 -0
- package/types/src/components/Skeleton/Skeleton.d.ts +3 -5
- package/types/src/components/Skeleton/SkeletonTabs.d.ts +4 -4
- package/types/src/components/Skeleton/SkeletonText.d.ts +2 -2
- package/types/src/components/Skeleton/index.d.ts +4 -1
- package/types/src/components/SplitButton/SplitButton.d.ts +1 -2
- package/types/src/components/SwitchesPanel/SwitchesPanel.d.ts +24 -0
- package/types/src/components/SwitchesPanel/index.d.ts +2 -0
- package/types/src/components/SwitchesPanelItem/SwitchesPanelItem.d.ts +78 -0
- package/types/src/components/SwitchesPanelItem/index.d.ts +2 -0
- package/types/src/components/index.d.ts +10 -2
- package/types/src/components/utils.d.ts +1 -1
- package/cjs/components/Alert/Alert.stories.js +0 -34
- package/cjs/components/Button/Button.stories.js +0 -109
- package/cjs/components/Cuttable/Cuttable.stories.js +0 -46
- package/cjs/components/Dialog/Dialog.stories.js +0 -49
- package/cjs/components/Drawer/Drawer.stories.js +0 -65
- package/cjs/components/Form/Form.stories.js +0 -35
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +0 -32
- package/cjs/components/Icon/Icon.stories.js +0 -32
- package/cjs/components/ItemLink/ItemLink.stories.js +0 -20
- package/cjs/components/ItemList/ItemList.stories.js +0 -122
- package/cjs/components/List/List.stories.js +0 -152
- package/cjs/components/Markdown/Markdown.stories.js +0 -51
- package/cjs/components/Menu/Menu.stories.js +0 -77
- package/cjs/components/Popover/Popover.stories.js +0 -60
- package/cjs/components/Select/Select.stories.js +0 -57
- package/cjs/components/Skeleton/Skeleton.stories.js +0 -24
- package/cjs/components/Skeleton/SkeletonTabs.stories.js +0 -15
- package/cjs/components/Skeleton/SkeletonText.stories.js +0 -33
- package/cjs/components/Status/Status.stories.js +0 -19
- package/cjs/components/Tabs/Tabs.stories.js +0 -24
- package/dist/.DS_Store +0 -0
- package/dist/images/default.svg +0 -1
- package/dist/images/filtered.svg +0 -1
- package/esm/components/Alert/Alert.stories.js +0 -27
- package/esm/components/Button/Button.stories.js +0 -99
- package/esm/components/Cuttable/Cuttable.stories.js +0 -39
- package/esm/components/Dialog/Dialog.stories.js +0 -42
- package/esm/components/Drawer/Drawer.stories.js +0 -56
- package/esm/components/Form/Form.stories.js +0 -27
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +0 -23
- package/esm/components/Icon/Icon.stories.js +0 -23
- package/esm/components/ItemLink/ItemLink.stories.js +0 -12
- package/esm/components/ItemList/ItemList.stories.js +0 -109
- package/esm/components/List/List.stories.js +0 -139
- package/esm/components/Markdown/Markdown.stories.js +0 -43
- package/esm/components/Menu/Menu.stories.js +0 -65
- package/esm/components/Popover/Popover.stories.js +0 -52
- package/esm/components/Select/Select.stories.js +0 -48
- package/esm/components/Skeleton/Skeleton.stories.js +0 -15
- package/esm/components/Skeleton/SkeletonTabs.stories.js +0 -7
- package/esm/components/Skeleton/SkeletonText.stories.js +0 -23
- package/esm/components/Status/Status.stories.js +0 -11
- package/esm/components/Tabs/Tabs.stories.js +0 -16
- package/styleguide/build/bundle.edc3f2a1.js +0 -2
- package/types/src/components/Alert/Alert.stories.d.ts +0 -11
- package/types/src/components/Button/Button.stories.d.ts +0 -17
- package/types/src/components/Cuttable/Cuttable.stories.d.ts +0 -17
- package/types/src/components/Dialog/Dialog.stories.d.ts +0 -25
- package/types/src/components/Drawer/Drawer.stories.d.ts +0 -43
- package/types/src/components/Form/Form.stories.d.ts +0 -13
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +0 -20
- package/types/src/components/Icon/Icon.stories.d.ts +0 -7
- package/types/src/components/ItemLink/ItemLink.stories.d.ts +0 -12
- package/types/src/components/ItemList/ItemList.stories.d.ts +0 -172
- package/types/src/components/List/List.stories.d.ts +0 -30
- package/types/src/components/Markdown/Markdown.stories.d.ts +0 -10
- package/types/src/components/Menu/Menu.stories.d.ts +0 -20
- package/types/src/components/Popover/Popover.stories.d.ts +0 -25
- package/types/src/components/Select/Select.stories.d.ts +0 -12
- package/types/src/components/Skeleton/Skeleton.stories.d.ts +0 -15
- package/types/src/components/Skeleton/SkeletonTabs.stories.d.ts +0 -5
- package/types/src/components/Skeleton/SkeletonText.stories.d.ts +0 -23
- package/types/src/components/Status/Status.stories.d.ts +0 -11
- package/types/src/components/Tabs/Tabs.stories.d.ts +0 -10
- package/types/src/tests/index.d.ts +0 -1
- package/types/src/tests/renderer.d.ts +0 -23
- /package/styleguide/build/{bundle.edc3f2a1.js.LICENSE.txt → bundle.6318f4a5.js.LICENSE.txt} +0 -0
|
@@ -294,7 +294,9 @@ class List extends Component {
|
|
|
294
294
|
data,
|
|
295
295
|
pagination,
|
|
296
296
|
vertical,
|
|
297
|
-
rowKey
|
|
297
|
+
rowKey,
|
|
298
|
+
totalRows,
|
|
299
|
+
filtered
|
|
298
300
|
} = _ref5;
|
|
299
301
|
let {
|
|
300
302
|
prevSortColumn,
|
|
@@ -313,16 +315,17 @@ class List extends Component {
|
|
|
313
315
|
sortDirection
|
|
314
316
|
};
|
|
315
317
|
}
|
|
318
|
+
const additionalExpanded = [];
|
|
316
319
|
if (prevData !== data) {
|
|
317
|
-
|
|
320
|
+
const isSingleElementInCurrentExpanded = () => state.expandedRows.includes(getRowKey(data[0], {
|
|
321
|
+
rowKey
|
|
322
|
+
}));
|
|
323
|
+
if (renderRowBody && data?.length === 1 && (!pagination || totalRows === 1) && (!prevData || prevData?.length === 0 || isSingleElementInCurrentExpanded()) && (!filtered || isSingleElementInCurrentExpanded())) {
|
|
318
324
|
const key = getRowKey(data[0], {
|
|
319
325
|
rowKey
|
|
320
326
|
});
|
|
321
327
|
if (notExpandableRows.indexOf(key) === -1) {
|
|
322
|
-
|
|
323
|
-
...nextState,
|
|
324
|
-
expandedRows: [...expandedRows, key]
|
|
325
|
-
};
|
|
328
|
+
additionalExpanded.push(key);
|
|
326
329
|
}
|
|
327
330
|
}
|
|
328
331
|
const keys = data.map(row => getRowKey(row, {
|
|
@@ -340,10 +343,10 @@ class List extends Component {
|
|
|
340
343
|
selection
|
|
341
344
|
};
|
|
342
345
|
}
|
|
343
|
-
if (prevExpandedRows !== expandedRows) {
|
|
346
|
+
if (prevExpandedRows !== expandedRows || additionalExpanded.length) {
|
|
344
347
|
nextState = {
|
|
345
348
|
...nextState,
|
|
346
|
-
expandedRows
|
|
349
|
+
expandedRows: [...expandedRows, ...additionalExpanded]
|
|
347
350
|
};
|
|
348
351
|
}
|
|
349
352
|
if (prevPagination !== pagination) {
|
|
@@ -1,8 +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
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
4
|
+
import { Component } from 'react';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import Dialog from '../Dialog';
|
|
8
7
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -44,7 +43,7 @@ class ProgressDialog extends Component {
|
|
|
44
43
|
isFinished,
|
|
45
44
|
isFailed
|
|
46
45
|
} = this.state;
|
|
47
|
-
|
|
46
|
+
this.clearCloseTimeout();
|
|
48
47
|
if (!isOpen) {
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
@@ -68,7 +67,7 @@ class ProgressDialog extends Component {
|
|
|
68
67
|
isOpen
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
|
-
componentDidUpdate(
|
|
70
|
+
componentDidUpdate(_, prevState) {
|
|
72
71
|
const {
|
|
73
72
|
isFinished
|
|
74
73
|
} = this.state;
|
|
@@ -76,13 +75,19 @@ class ProgressDialog extends Component {
|
|
|
76
75
|
autoCloseTimeout
|
|
77
76
|
} = this.props;
|
|
78
77
|
if (prevState.isFinished === false && isFinished === true) {
|
|
79
|
-
|
|
78
|
+
this.clearCloseTimeout();
|
|
80
79
|
if (autoCloseTimeout) {
|
|
81
80
|
this.closeTimeout = setTimeout(this.handleClose, autoCloseTimeout);
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
componentWillUnmount() {
|
|
85
|
+
this.clearCloseTimeout();
|
|
86
|
+
}
|
|
87
|
+
clearCloseTimeout() {
|
|
88
|
+
if (!this.closeTimeout) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
86
91
|
clearTimeout(this.closeTimeout);
|
|
87
92
|
}
|
|
88
93
|
render() {
|
|
@@ -133,83 +138,7 @@ class ProgressDialog extends Component {
|
|
|
133
138
|
});
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
|
-
ProgressDialog
|
|
137
|
-
/**
|
|
138
|
-
* Toggles visibility.
|
|
139
|
-
* @since 1.2.0
|
|
140
|
-
*/
|
|
141
|
-
isOpen: PropTypes.bool,
|
|
142
|
-
/**
|
|
143
|
-
* Banner. Renders in front of content as wide as dialog.
|
|
144
|
-
* @since 1.2.0
|
|
145
|
-
*/
|
|
146
|
-
banner: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
147
|
-
/**
|
|
148
|
-
* Image. Renders into content.
|
|
149
|
-
* @since 1.2.0
|
|
150
|
-
*/
|
|
151
|
-
image: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
152
|
-
/**
|
|
153
|
-
* Title
|
|
154
|
-
* @since 1.2.0
|
|
155
|
-
*/
|
|
156
|
-
title: PropTypes.node,
|
|
157
|
-
/**
|
|
158
|
-
* Description of the `ProgressDialog`.
|
|
159
|
-
* @since 1.2.0
|
|
160
|
-
*/
|
|
161
|
-
description: PropTypes.node,
|
|
162
|
-
/**
|
|
163
|
-
* Actions which will be shown in Dialog header.
|
|
164
|
-
* @since 1.2.0
|
|
165
|
-
*/
|
|
166
|
-
actions: PropTypes.node,
|
|
167
|
-
/**
|
|
168
|
-
* Whether the dialog should be canceled with the cancel button.
|
|
169
|
-
* @since 1.2.0
|
|
170
|
-
*/
|
|
171
|
-
cancelable: PropTypes.bool,
|
|
172
|
-
/**
|
|
173
|
-
* The interval of time to auto close dialog when it successful finished.
|
|
174
|
-
* Set `null` for disable auto close.
|
|
175
|
-
* @since 1.2.0
|
|
176
|
-
*/
|
|
177
|
-
autoCloseTimeout: PropTypes.number,
|
|
178
|
-
/**
|
|
179
|
-
* On cancel event handler.
|
|
180
|
-
* @since 1.2.0
|
|
181
|
-
*/
|
|
182
|
-
onCancel: PropTypes.func,
|
|
183
|
-
/**
|
|
184
|
-
* On close event handler.
|
|
185
|
-
* @since 1.2.0
|
|
186
|
-
*/
|
|
187
|
-
onClose: PropTypes.func,
|
|
188
|
-
/**
|
|
189
|
-
* On finish event handler.
|
|
190
|
-
* @since 1.2.0
|
|
191
|
-
*/
|
|
192
|
-
onFinish: PropTypes.func,
|
|
193
|
-
/**
|
|
194
|
-
* On fail event handler.
|
|
195
|
-
* @since 1.2.0
|
|
196
|
-
*/
|
|
197
|
-
onFail: PropTypes.func,
|
|
198
|
-
/**
|
|
199
|
-
* Content of the `ProgressDialog`.
|
|
200
|
-
* @since 1.2.0
|
|
201
|
-
*/
|
|
202
|
-
children: PropTypes.node,
|
|
203
|
-
/**
|
|
204
|
-
* @ignore
|
|
205
|
-
*/
|
|
206
|
-
className: PropTypes.string,
|
|
207
|
-
/**
|
|
208
|
-
* @ignore
|
|
209
|
-
*/
|
|
210
|
-
baseClassName: PropTypes.string
|
|
211
|
-
};
|
|
212
|
-
ProgressDialog.defaultProps = {
|
|
141
|
+
_defineProperty(ProgressDialog, "defaultProps", {
|
|
213
142
|
isOpen: false,
|
|
214
143
|
banner: null,
|
|
215
144
|
image: null,
|
|
@@ -225,5 +154,5 @@ ProgressDialog.defaultProps = {
|
|
|
225
154
|
children: null,
|
|
226
155
|
className: null,
|
|
227
156
|
baseClassName: `${CLS_PREFIX}progress-dialog`
|
|
228
|
-
};
|
|
157
|
+
});
|
|
229
158
|
export default ProgressDialog;
|
|
@@ -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";
|
|
@@ -14,25 +12,22 @@ const width = value => {
|
|
|
14
12
|
}
|
|
15
13
|
return result;
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
/**
|
|
19
16
|
* `Rating` component is used for showing and collecting feedback of users' opinion in 0-5 grade scale.
|
|
20
17
|
* @since 0.0.42
|
|
21
18
|
*/
|
|
22
19
|
const Rating = _ref => {
|
|
23
20
|
let {
|
|
24
|
-
baseClassName
|
|
21
|
+
baseClassName = `${CLS_PREFIX}rating`,
|
|
25
22
|
className,
|
|
26
|
-
value,
|
|
27
|
-
small,
|
|
23
|
+
value = 0,
|
|
24
|
+
small = false,
|
|
28
25
|
...props
|
|
29
26
|
} = _ref;
|
|
30
27
|
return /*#__PURE__*/_jsx("div", {
|
|
31
|
-
className: classNames({
|
|
32
|
-
[baseClassName]: true,
|
|
28
|
+
className: classNames(baseClassName, className, {
|
|
33
29
|
[`${baseClassName}--static`]: true,
|
|
34
|
-
[`${baseClassName}--small`]: small
|
|
35
|
-
[className]: true
|
|
30
|
+
[`${baseClassName}--small`]: small
|
|
36
31
|
}),
|
|
37
32
|
...props,
|
|
38
33
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -43,30 +38,4 @@ const Rating = _ref => {
|
|
|
43
38
|
})
|
|
44
39
|
});
|
|
45
40
|
};
|
|
46
|
-
Rating.propTypes = {
|
|
47
|
-
/**
|
|
48
|
-
* Rating value from 0 to 5.
|
|
49
|
-
* @since 0.0.42
|
|
50
|
-
*/
|
|
51
|
-
value: PropTypes.number,
|
|
52
|
-
/**
|
|
53
|
-
* Small variant.
|
|
54
|
-
* @since 0.0.42
|
|
55
|
-
*/
|
|
56
|
-
small: PropTypes.bool,
|
|
57
|
-
/**
|
|
58
|
-
* @ignore
|
|
59
|
-
*/
|
|
60
|
-
className: PropTypes.string,
|
|
61
|
-
/**
|
|
62
|
-
* @ignore
|
|
63
|
-
*/
|
|
64
|
-
baseClassName: PropTypes.string
|
|
65
|
-
};
|
|
66
|
-
Rating.defaultProps = {
|
|
67
|
-
value: 0,
|
|
68
|
-
small: false,
|
|
69
|
-
className: null,
|
|
70
|
-
baseClassName: `${CLS_PREFIX}rating`
|
|
71
|
-
};
|
|
72
41
|
export default Rating;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
3
|
export { default } from './Skeleton';
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
4
|
+
export { default as SkeletonTabs } from './SkeletonTabs';
|
|
5
|
+
export { default as SkeletonText } from './SkeletonText';
|
|
@@ -35,8 +35,7 @@ const focusStrategy = {
|
|
|
35
35
|
* `Split Button` is a combination of a standard [Button](#!/Button) with a [Dropdown](#!/Dropdown) menu.
|
|
36
36
|
* It is used for grouping several related actions when one of the actions should be accessible immediately
|
|
37
37
|
* because it is used more often than others.
|
|
38
|
-
*
|
|
39
|
-
* Since: 0.0.40
|
|
38
|
+
* @since 0.0.40
|
|
40
39
|
*/
|
|
41
40
|
const SplitButton = _ref => {
|
|
42
41
|
let {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
3
|
+
import { Children, cloneElement } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import { CLS_PREFIX } from '../../constants';
|
|
7
6
|
import Section from '../Section';
|
|
@@ -12,7 +11,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
12
11
|
*/
|
|
13
12
|
const SwitchesPanel = _ref => {
|
|
14
13
|
let {
|
|
15
|
-
baseClassName
|
|
14
|
+
baseClassName = `${CLS_PREFIX}switches-panel`,
|
|
16
15
|
className,
|
|
17
16
|
children,
|
|
18
17
|
...props
|
|
@@ -22,30 +21,10 @@ const SwitchesPanel = _ref => {
|
|
|
22
21
|
...props,
|
|
23
22
|
children: /*#__PURE__*/_jsx("div", {
|
|
24
23
|
className: `${baseClassName}__items`,
|
|
25
|
-
children: Children.map(children, child => /*#__PURE__*/cloneElement(child, {
|
|
24
|
+
children: children && Children.map(children, child => /*#__PURE__*/cloneElement(child, {
|
|
26
25
|
className: classNames(child.props.className, `${baseClassName}__item`)
|
|
27
26
|
}))
|
|
28
27
|
})
|
|
29
28
|
});
|
|
30
29
|
};
|
|
31
|
-
SwitchesPanel.propTypes = {
|
|
32
|
-
/**
|
|
33
|
-
* Content of the `SwitchesPanel`. Recommended to use [SwitchesPanelItem](#!/SwitchesPanelItem) components.
|
|
34
|
-
* @since 0.3.0
|
|
35
|
-
*/
|
|
36
|
-
children: PropTypes.node,
|
|
37
|
-
/**
|
|
38
|
-
* @ignore
|
|
39
|
-
*/
|
|
40
|
-
className: PropTypes.string,
|
|
41
|
-
/**
|
|
42
|
-
* @ignore
|
|
43
|
-
*/
|
|
44
|
-
baseClassName: PropTypes.string
|
|
45
|
-
};
|
|
46
|
-
SwitchesPanel.defaultProps = {
|
|
47
|
-
children: null,
|
|
48
|
-
className: null,
|
|
49
|
-
baseClassName: `${CLS_PREFIX}switches-panel`
|
|
50
|
-
};
|
|
51
30
|
export default SwitchesPanel;
|
|
@@ -1,8 +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
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
4
|
+
import { Component } from 'react';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import { CLS_PREFIX } from '../../constants';
|
|
8
7
|
import Switch from '../Switch';
|
|
@@ -82,58 +81,7 @@ class SwitchesPanelItem extends Component {
|
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
|
-
SwitchesPanelItem
|
|
86
|
-
/**
|
|
87
|
-
* A callback function, can be executed when the checked state is changing.
|
|
88
|
-
* @since 0.3.0
|
|
89
|
-
*/
|
|
90
|
-
onChange: PropTypes.func.isRequired,
|
|
91
|
-
/**
|
|
92
|
-
* @ignore
|
|
93
|
-
*/
|
|
94
|
-
defaultChecked: PropTypes.bool,
|
|
95
|
-
/**
|
|
96
|
-
* Visual intent color to apply to component.
|
|
97
|
-
* @since 0.3.0
|
|
98
|
-
*/
|
|
99
|
-
intent: PropTypes.oneOf(['warning', 'danger']),
|
|
100
|
-
/**
|
|
101
|
-
* Title of the `SwitchesPanelItem`. Must be no longer than two lines.
|
|
102
|
-
* @since 0.3.0
|
|
103
|
-
*/
|
|
104
|
-
title: PropTypes.node.isRequired,
|
|
105
|
-
/**
|
|
106
|
-
* `SwitchesPanelItem` description. Must be no longer than three lines.
|
|
107
|
-
* @since 0.3.0
|
|
108
|
-
*/
|
|
109
|
-
description: PropTypes.node,
|
|
110
|
-
/**
|
|
111
|
-
* Rich full description of the `SwitchesPanelItem`.
|
|
112
|
-
* Adds control button with question mark that shows `Popover` on click.
|
|
113
|
-
* @since 0.3.0
|
|
114
|
-
*/
|
|
115
|
-
fullDescription: PropTypes.node,
|
|
116
|
-
/**
|
|
117
|
-
* Props of underlying [Switch](#!/Switch) component.
|
|
118
|
-
* @since 0.5.0
|
|
119
|
-
*/
|
|
120
|
-
switchProps: PropTypes.object,
|
|
121
|
-
/**
|
|
122
|
-
* Content of the control actions.
|
|
123
|
-
* Don't place here more than three buttons (with the one from 'fullDescription' property) or one link and one button.
|
|
124
|
-
* @since 0.3.0
|
|
125
|
-
*/
|
|
126
|
-
children: PropTypes.node,
|
|
127
|
-
/**
|
|
128
|
-
* @ignore
|
|
129
|
-
*/
|
|
130
|
-
className: PropTypes.string,
|
|
131
|
-
/**
|
|
132
|
-
* @ignore
|
|
133
|
-
*/
|
|
134
|
-
baseClassName: PropTypes.string
|
|
135
|
-
};
|
|
136
|
-
SwitchesPanelItem.defaultProps = {
|
|
84
|
+
_defineProperty(SwitchesPanelItem, "defaultProps", {
|
|
137
85
|
defaultChecked: false,
|
|
138
86
|
intent: null,
|
|
139
87
|
description: null,
|
|
@@ -142,5 +90,5 @@ SwitchesPanelItem.defaultProps = {
|
|
|
142
90
|
children: null,
|
|
143
91
|
className: null,
|
|
144
92
|
baseClassName: `${CLS_PREFIX}switches-panel-item`
|
|
145
|
-
};
|
|
93
|
+
});
|
|
146
94
|
export default SwitchesPanelItem;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
var _class;
|
|
2
3
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
4
|
|
|
4
5
|
import { render } from 'react-dom';
|
|
@@ -184,6 +185,7 @@ export default class Toaster extends Component {
|
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
187
|
}
|
|
188
|
+
_class = Toaster;
|
|
187
189
|
// eslint-disable-next-line react/sort-comp
|
|
188
190
|
_defineProperty(Toaster, "defaultProps", {
|
|
189
191
|
position: 'top-end',
|
|
@@ -194,7 +196,7 @@ _defineProperty(Toaster, "create", function () {
|
|
|
194
196
|
let container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.body;
|
|
195
197
|
const containerElement = document.createElement('div');
|
|
196
198
|
container.appendChild(containerElement);
|
|
197
|
-
return render( /*#__PURE__*/_jsx(
|
|
199
|
+
return render( /*#__PURE__*/_jsx(_class, {
|
|
198
200
|
...props
|
|
199
201
|
}), containerElement);
|
|
200
202
|
});
|
package/esm/components/index.js
CHANGED
|
@@ -98,6 +98,5 @@ export { default as Tooltip } from './Tooltip';
|
|
|
98
98
|
export { default as Tour } from './Tour';
|
|
99
99
|
export { default as Translate } from './Translate';
|
|
100
100
|
export { default as Link } from './Link';
|
|
101
|
-
export { default as Skeleton } from './Skeleton';
|
|
102
|
-
export * from './Skeleton';
|
|
101
|
+
export { default as Skeleton, SkeletonTabs, SkeletonText } from './Skeleton';
|
|
103
102
|
export { PortalContext } from './Layer';
|
package/esm/index.js
CHANGED
package/esm/tests/renderer.js
CHANGED
|
@@ -5,7 +5,8 @@ import userEvent from '@testing-library/user-event';
|
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
const renderer = (Component, baseProps) => propOverrides => {
|
|
7
7
|
const {
|
|
8
|
-
asFragment
|
|
8
|
+
asFragment,
|
|
9
|
+
rerender
|
|
9
10
|
} = render( /*#__PURE__*/_jsx(Component, {
|
|
10
11
|
...baseProps,
|
|
11
12
|
...propOverrides
|
|
@@ -13,6 +14,11 @@ const renderer = (Component, baseProps) => propOverrides => {
|
|
|
13
14
|
return {
|
|
14
15
|
asFragment,
|
|
15
16
|
user: userEvent,
|
|
17
|
+
rerender: rerenderPropsOverrides => rerender( /*#__PURE__*/_jsx(Component, {
|
|
18
|
+
...baseProps,
|
|
19
|
+
...propOverrides,
|
|
20
|
+
...rerenderPropsOverrides
|
|
21
|
+
})),
|
|
16
22
|
...baseProps
|
|
17
23
|
};
|
|
18
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.35.
|
|
3
|
+
"version": "3.35.2",
|
|
4
4
|
"description": "Plesk UI Library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"/index.js"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/runtime": "^7.22.
|
|
45
|
+
"@babel/runtime": "^7.22.10",
|
|
46
46
|
"@plesk/react-movable": "^2.7.1",
|
|
47
47
|
"classnames": "^2.3.2",
|
|
48
48
|
"codemirror": "5.58.2",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"use-focus-visible": "^1.0.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@babel/core": "^7.22.
|
|
61
|
+
"@babel/core": "^7.22.10",
|
|
62
62
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
63
63
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
64
|
-
"@babel/plugin-transform-runtime": "^7.22.
|
|
65
|
-
"@babel/preset-env": "^7.22.
|
|
64
|
+
"@babel/plugin-transform-runtime": "^7.22.10",
|
|
65
|
+
"@babel/preset-env": "^7.22.10",
|
|
66
66
|
"@babel/preset-react": "^7.22.5",
|
|
67
67
|
"@babel/preset-typescript": "^7.22.5",
|
|
68
|
-
"@babel/types": "^7.22.
|
|
68
|
+
"@babel/types": "^7.22.10",
|
|
69
69
|
"@csstools/postcss-logical-float-and-clear": "^1.0.1",
|
|
70
70
|
"@plesk/eslint-config": "^3.0.0",
|
|
71
71
|
"@plesk/stylelint-config": "^2.0.0",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"@types/classnames": "2.3.1",
|
|
78
78
|
"@types/doctrine": "^0.0.5",
|
|
79
79
|
"@types/enzyme": "^3.10.13",
|
|
80
|
-
"@types/jest": "^
|
|
81
|
-
"@types/jest-image-snapshot": "^6.
|
|
80
|
+
"@types/jest": "^25.2.3",
|
|
81
|
+
"@types/jest-image-snapshot": "^6.2.0",
|
|
82
82
|
"@types/marked": "^4.3.1",
|
|
83
|
-
"@types/node": "^16.18.
|
|
84
|
-
"@types/react": "^17.0.
|
|
83
|
+
"@types/node": "^16.18.40",
|
|
84
|
+
"@types/react": "^17.0.64",
|
|
85
85
|
"@types/react-dom": "^17.0.20",
|
|
86
86
|
"@types/react-measure": "2.0.8",
|
|
87
87
|
"@types/react-transition-group": "^4.4.6",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
90
90
|
"@typescript-eslint/parser": "^5.62.0",
|
|
91
91
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
92
|
-
"autoprefixer": "^10.4.
|
|
92
|
+
"autoprefixer": "^10.4.15",
|
|
93
93
|
"babel-loader": "^8.3.0",
|
|
94
94
|
"babel-plugin-transform-require-ignore": "^0.1.1",
|
|
95
95
|
"clean-webpack-plugin": "^4.0.0",
|
|
@@ -98,17 +98,16 @@
|
|
|
98
98
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
99
99
|
"enzyme": "^3.11.0",
|
|
100
100
|
"enzyme-to-json": "^3.6.2",
|
|
101
|
-
"eslint": "^8.
|
|
102
|
-
"eslint-config-prettier": "^8.
|
|
101
|
+
"eslint": "^8.47.0",
|
|
102
|
+
"eslint-config-prettier": "^8.10.0",
|
|
103
103
|
"eslint-plugin-markdown": "^3.0.1",
|
|
104
104
|
"eslint-plugin-prettier": "^4.2.1",
|
|
105
|
-
"fs-extra": "^7.0.1",
|
|
106
105
|
"html-webpack-plugin": "^5.5.3",
|
|
107
106
|
"inquirer": "^3.3.0",
|
|
108
|
-
"jest": "^
|
|
107
|
+
"jest": "^25.5.4",
|
|
109
108
|
"jest-dev-server": "^9.0.0",
|
|
110
109
|
"jest-image-snapshot": "^6.2.0",
|
|
111
|
-
"less": "^4.
|
|
110
|
+
"less": "^4.2.0",
|
|
112
111
|
"less-loader": "^11.1.3",
|
|
113
112
|
"mini-css-extract-plugin": "^2.7.6",
|
|
114
113
|
"postcss": "^8.4.27",
|
|
@@ -131,7 +130,7 @@
|
|
|
131
130
|
"stylelint-use-logical-spec": "^5.0.0",
|
|
132
131
|
"svg-mixer": "^2.3.14",
|
|
133
132
|
"terser-webpack-plugin": "^5.3.9",
|
|
134
|
-
"typescript": "4.
|
|
133
|
+
"typescript": "4.7.4",
|
|
135
134
|
"webpack": "^5.88.2",
|
|
136
135
|
"webpack-cli": "^5.1.4"
|
|
137
136
|
},
|