@plesk/ui-library 3.33.0 → 3.34.1
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 +17 -100
- package/cjs/components/ContentLoader/IconsLoader.js +2 -1
- package/cjs/components/Dialog/Dialog.js +4 -113
- package/cjs/components/Dropdown/Dropdown.js +4 -42
- package/cjs/components/Form/Form.js +2 -1
- package/cjs/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/cjs/components/Overlay/Overlay.js +4 -3
- package/cjs/components/Popover/Popover.js +3 -1
- package/cjs/components/Section/Section.js +2 -1
- package/cjs/components/Skeleton/SkeletonText.js +1 -1
- package/cjs/components/index.js +30 -2
- package/cjs/index.js +1 -1
- package/cjs/utils/types/PolymorphicComponent.js +5 -0
- package/cjs/utils/types/index.js +5 -0
- 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 +130 -326
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +2 -2
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Button/Button.js +17 -98
- package/esm/components/ContentLoader/IconsLoader.js +2 -1
- package/esm/components/Dialog/Dialog.js +4 -113
- package/esm/components/Dropdown/Dropdown.js +4 -40
- package/esm/components/Form/Form.js +2 -1
- package/esm/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/esm/components/Overlay/Overlay.js +4 -3
- package/esm/components/Popover/Popover.js +3 -1
- package/esm/components/Section/Section.js +2 -1
- package/esm/components/Skeleton/SkeletonText.js +1 -1
- package/esm/components/index.js +2 -2
- package/esm/index.js +1 -1
- package/esm/utils/types/PolymorphicComponent.js +1 -0
- package/esm/utils/types/index.js +1 -0
- package/package.json +24 -23
- package/styleguide/build/bundle.c6ebacd7.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/AutoClosable/AutoClosable.d.ts +2 -2
- package/types/src/components/Button/Button.d.ts +102 -0
- package/types/src/components/Button/index.d.ts +2 -0
- package/types/src/components/Dialog/Dialog.d.ts +123 -0
- package/types/src/components/Dialog/index.d.ts +2 -0
- package/types/src/components/Dropdown/Dropdown.d.ts +54 -0
- package/types/src/components/Form/Form.d.ts +8 -8
- package/types/src/components/Icon/Icon.d.ts +1 -1
- package/types/src/components/Icon/index.d.ts +1 -0
- package/types/src/components/Overlay/Overlay.d.ts +1 -1
- package/types/src/components/Overlay/index.d.ts +1 -0
- package/types/src/components/index.d.ts +2 -2
- package/types/src/utils/types/PolymorphicComponent.d.ts +11 -0
- package/types/src/utils/types/index.d.ts +1 -0
- package/styleguide/build/bundle.1ca1330c.js +0 -2
- /package/styleguide/build/{bundle.1ca1330c.js.LICENSE.txt → bundle.c6ebacd7.js.LICENSE.txt} +0 -0
|
@@ -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 { cloneElement, forwardRef, isValidElement, useContext, useState } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import { CLS_PREFIX } from '../../constants';
|
|
7
6
|
import Icon from '../Icon';
|
|
@@ -65,32 +64,27 @@ const renderCaret = _ref2 => {
|
|
|
65
64
|
}
|
|
66
65
|
return caretElement;
|
|
67
66
|
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
71
|
-
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
72
|
-
* @since 0.0.37
|
|
73
|
-
*/
|
|
74
67
|
const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
75
68
|
let {
|
|
76
|
-
baseClassName
|
|
69
|
+
baseClassName = `${CLS_PREFIX}button`,
|
|
77
70
|
className,
|
|
78
|
-
component
|
|
71
|
+
component,
|
|
79
72
|
size: propsSize,
|
|
80
73
|
intent,
|
|
81
|
-
ghost,
|
|
74
|
+
ghost = false,
|
|
82
75
|
selected: selectedProp,
|
|
83
76
|
onToggle,
|
|
84
77
|
state,
|
|
85
78
|
icon,
|
|
86
79
|
caret,
|
|
87
|
-
fill,
|
|
80
|
+
fill = false,
|
|
88
81
|
tooltip,
|
|
89
82
|
children,
|
|
90
83
|
arrow,
|
|
91
|
-
disabled,
|
|
84
|
+
disabled = false,
|
|
92
85
|
...props
|
|
93
86
|
} = _ref3;
|
|
87
|
+
const Tag = component || 'button';
|
|
94
88
|
const [selectedState, setSelectedState] = useState(false);
|
|
95
89
|
const handleToggle = () => {
|
|
96
90
|
setSelectedState(!selectedState);
|
|
@@ -130,7 +124,7 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
130
124
|
}
|
|
131
125
|
const selected = selectedProp === undefined ? selectedState : selectedProp;
|
|
132
126
|
if (selectedProp !== undefined || onToggle) {
|
|
133
|
-
componentProps['aria-pressed'] =
|
|
127
|
+
componentProps['aria-pressed'] = `${selected}`;
|
|
134
128
|
}
|
|
135
129
|
const isArrowButton = arrow === 'forward' || arrow === 'backward';
|
|
136
130
|
const hasAriaDisabled = Tag === 'button' && disabled && tooltip;
|
|
@@ -182,90 +176,8 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
182
176
|
return button;
|
|
183
177
|
});
|
|
184
178
|
Button.displayName = 'Button';
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
* Button size.
|
|
188
|
-
* @since 2.5.0
|
|
189
|
-
*/
|
|
190
|
-
size: PropTypes.oneOf(['md', 'lg']),
|
|
191
|
-
/**
|
|
192
|
-
* Visual intent color to apply to component.
|
|
193
|
-
* @since 0.0.42
|
|
194
|
-
*/
|
|
195
|
-
intent: PropTypes.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'info']),
|
|
196
|
-
/**
|
|
197
|
-
* Display button with transparent background.
|
|
198
|
-
* @since 2.1.0
|
|
199
|
-
*/
|
|
200
|
-
ghost: PropTypes.bool,
|
|
201
|
-
/**
|
|
202
|
-
* Arrow button.
|
|
203
|
-
* @since 2.6.0
|
|
204
|
-
*/
|
|
205
|
-
arrow: PropTypes.oneOf(['forward', 'backward']),
|
|
206
|
-
/**
|
|
207
|
-
* Selected state of toggle button. Used in controlled component mode.
|
|
208
|
-
* @since 0.0.68
|
|
209
|
-
*/
|
|
210
|
-
selected: PropTypes.bool,
|
|
211
|
-
/**
|
|
212
|
-
* Toggle button callback. Used in uncontrolled component mode.
|
|
213
|
-
* @since 0.0.68
|
|
214
|
-
*/
|
|
215
|
-
onToggle: PropTypes.func,
|
|
216
|
-
/**
|
|
217
|
-
* State of the button
|
|
218
|
-
* @since 0.0.42
|
|
219
|
-
*/
|
|
220
|
-
state: PropTypes.oneOf(['active', 'loading', 'hovered', 'focused']),
|
|
221
|
-
/**
|
|
222
|
-
* Is button disabled?
|
|
223
|
-
* @since 0.0.42
|
|
224
|
-
*/
|
|
225
|
-
disabled: PropTypes.bool,
|
|
226
|
-
/**
|
|
227
|
-
* Tooltip for component
|
|
228
|
-
* @since 0.0.42
|
|
229
|
-
*/
|
|
230
|
-
tooltip: PropTypes.node,
|
|
231
|
-
/**
|
|
232
|
-
* Name of icon or [Icon](#!/Icon) component
|
|
233
|
-
* @since 0.0.42
|
|
234
|
-
*/
|
|
235
|
-
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
236
|
-
/**
|
|
237
|
-
* Show caret
|
|
238
|
-
* @since 0.0.42
|
|
239
|
-
*/
|
|
240
|
-
caret: PropTypes.oneOfType([PropTypes.bool, PropTypes.element]),
|
|
241
|
-
/**
|
|
242
|
-
* Dynamically expand the button to fill out the whole available width of its parent container.
|
|
243
|
-
* @since 1.8.0
|
|
244
|
-
*/
|
|
245
|
-
fill: PropTypes.bool,
|
|
246
|
-
/**
|
|
247
|
-
* Content of the button
|
|
248
|
-
* @since 0.0.37
|
|
249
|
-
*/
|
|
250
|
-
children: PropTypes.node,
|
|
251
|
-
/**
|
|
252
|
-
* Component to render as the root element. Useful when rendering a `Button` as `<a>` or `<Link>`.
|
|
253
|
-
* @since 0.0.42
|
|
254
|
-
*/
|
|
255
|
-
component: PropTypes.elementType,
|
|
256
|
-
/**
|
|
257
|
-
* @ignore
|
|
258
|
-
*/
|
|
259
|
-
className: PropTypes.string,
|
|
260
|
-
/**
|
|
261
|
-
* @ignore
|
|
262
|
-
*/
|
|
263
|
-
baseClassName: PropTypes.string,
|
|
264
|
-
/**
|
|
265
|
-
* @ignore
|
|
266
|
-
*/
|
|
267
|
-
onClick: PropTypes.func
|
|
268
|
-
};
|
|
179
|
+
|
|
180
|
+
// For ToolbarMenu backward compatibility purposes
|
|
269
181
|
Button.defaultProps = {
|
|
270
182
|
size: undefined,
|
|
271
183
|
intent: undefined,
|
|
@@ -285,4 +197,11 @@ Button.defaultProps = {
|
|
|
285
197
|
arrow: undefined,
|
|
286
198
|
onClick: undefined
|
|
287
199
|
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
203
|
+
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
204
|
+
*
|
|
205
|
+
* Since: 0.0.37
|
|
206
|
+
*/
|
|
288
207
|
export default Button;
|
|
@@ -30,6 +30,7 @@ const useIconCursor = (icons, initialCursor, isSync) => {
|
|
|
30
30
|
return [icons[cursor], targetRef];
|
|
31
31
|
};
|
|
32
32
|
const IconsLoader = _ref => {
|
|
33
|
+
var _icons;
|
|
33
34
|
let {
|
|
34
35
|
baseClassName = `${CLS_PREFIX}icons-loader`,
|
|
35
36
|
className,
|
|
@@ -39,7 +40,7 @@ const IconsLoader = _ref => {
|
|
|
39
40
|
...props
|
|
40
41
|
} = _ref;
|
|
41
42
|
const syncRef = useRef('icon1');
|
|
42
|
-
if (!icons
|
|
43
|
+
if (!((_icons = icons) !== null && _icons !== void 0 && _icons.length)) {
|
|
43
44
|
icons = DEFAULT_ICONS;
|
|
44
45
|
} else if (icons.length === 1) {
|
|
45
46
|
icons = [icons[0], icons[0]];
|
|
@@ -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 { isValidElement, cloneElement, useEffect, useState } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import { CLS_PREFIX } from '../../constants';
|
|
7
6
|
import Overlay from '../Overlay';
|
|
@@ -68,6 +67,7 @@ const Dialog = _ref => {
|
|
|
68
67
|
return /*#__PURE__*/_jsx("div", {
|
|
69
68
|
className: classPrefix,
|
|
70
69
|
children: /*#__PURE__*/_jsx("img", {
|
|
70
|
+
alt: "",
|
|
71
71
|
className: `${classPrefix}-inner`,
|
|
72
72
|
src: image
|
|
73
73
|
})
|
|
@@ -76,6 +76,7 @@ const Dialog = _ref => {
|
|
|
76
76
|
return /*#__PURE__*/_jsx("div", {
|
|
77
77
|
className: classPrefix,
|
|
78
78
|
children: /*#__PURE__*/_jsx("img", {
|
|
79
|
+
alt: "",
|
|
79
80
|
className: `${classPrefix}-inner`,
|
|
80
81
|
...image
|
|
81
82
|
})
|
|
@@ -165,7 +166,7 @@ const Dialog = _ref => {
|
|
|
165
166
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
166
167
|
className: `${baseClassName}__header-content`,
|
|
167
168
|
children: [isLikeText(title) ? /*#__PURE__*/_jsx(Heading, {
|
|
168
|
-
level:
|
|
169
|
+
level: 2,
|
|
169
170
|
className: `${baseClassName}__title`,
|
|
170
171
|
children: title
|
|
171
172
|
}) : /*#__PURE__*/_jsx("div", {
|
|
@@ -197,116 +198,6 @@ const Dialog = _ref => {
|
|
|
197
198
|
}), closingConfirmationDialog]
|
|
198
199
|
});
|
|
199
200
|
};
|
|
200
|
-
Dialog.propTypes = {
|
|
201
|
-
/**
|
|
202
|
-
* Toggles visibility.
|
|
203
|
-
* @since 0.0.68
|
|
204
|
-
*/
|
|
205
|
-
isOpen: PropTypes.bool,
|
|
206
|
-
/**
|
|
207
|
-
* Banner. Renders in front of content as wide as dialog.
|
|
208
|
-
* @since 0.0.68
|
|
209
|
-
*/
|
|
210
|
-
banner: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
211
|
-
/**
|
|
212
|
-
* Block with an image, placed at the side of the component
|
|
213
|
-
* @since 3.25.0
|
|
214
|
-
*/
|
|
215
|
-
sideBanner: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
216
|
-
/**
|
|
217
|
-
* Additional properties for the sideBanner
|
|
218
|
-
* @since 3.25.0
|
|
219
|
-
*/
|
|
220
|
-
sideBannerContainer: PropTypes.shape({
|
|
221
|
-
/**
|
|
222
|
-
* Values for css background property
|
|
223
|
-
*/
|
|
224
|
-
background: PropTypes.string,
|
|
225
|
-
/**
|
|
226
|
-
* One of: center, flex-start, flex-end
|
|
227
|
-
*/
|
|
228
|
-
align: PropTypes.oneOf(['center', 'flex-start', 'flex-end'])
|
|
229
|
-
}),
|
|
230
|
-
/**
|
|
231
|
-
* Image. Renders into content.
|
|
232
|
-
* @since 0.0.68
|
|
233
|
-
*/
|
|
234
|
-
image: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),
|
|
235
|
-
/**
|
|
236
|
-
* Title
|
|
237
|
-
* @since 0.0.68
|
|
238
|
-
*/
|
|
239
|
-
title: PropTypes.node,
|
|
240
|
-
/**
|
|
241
|
-
* The subtitle of the `Dialog`.
|
|
242
|
-
* @since 4.0.0
|
|
243
|
-
*/
|
|
244
|
-
subtitle: PropTypes.node,
|
|
245
|
-
/**
|
|
246
|
-
* Title of "cancel" button
|
|
247
|
-
* @since 0.0.68
|
|
248
|
-
* @deprecated Use `cancelButton` instead.
|
|
249
|
-
*/
|
|
250
|
-
cancelTitle: PropTypes.node,
|
|
251
|
-
/**
|
|
252
|
-
* Cancel button visibility or custom configuration. It accepts all props of the `Button` component.
|
|
253
|
-
* @since 3.13.0
|
|
254
|
-
*/
|
|
255
|
-
cancelButton: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
256
|
-
/**
|
|
257
|
-
* Buttons except "cancel" button
|
|
258
|
-
* @since 0.0.68
|
|
259
|
-
*/
|
|
260
|
-
buttons: PropTypes.node,
|
|
261
|
-
/**
|
|
262
|
-
* Actions which will be shown in Dialog header
|
|
263
|
-
* @since 1.2.0
|
|
264
|
-
*/
|
|
265
|
-
actions: PropTypes.node,
|
|
266
|
-
/**
|
|
267
|
-
* Wraps children into [Form](#!/Form) if not empty.
|
|
268
|
-
* @since 0.0.68
|
|
269
|
-
*/
|
|
270
|
-
form: PropTypes.oneOfType([PropTypes.object, PropTypes.element]),
|
|
271
|
-
/**
|
|
272
|
-
* Dialog width
|
|
273
|
-
* @since 0.0.68
|
|
274
|
-
*/
|
|
275
|
-
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
276
|
-
/**
|
|
277
|
-
* If the value is false, the dialog cannot be closed and the Close button is hidden.
|
|
278
|
-
* @since 1.2.0
|
|
279
|
-
*/
|
|
280
|
-
closable: PropTypes.bool,
|
|
281
|
-
/**
|
|
282
|
-
* Disable close dialog button
|
|
283
|
-
* @since 4.0.0
|
|
284
|
-
*/
|
|
285
|
-
canClose: PropTypes.bool,
|
|
286
|
-
/**
|
|
287
|
-
* On close event handler. Called immediately after dialog closed by "cancel" button or "Esc" key.
|
|
288
|
-
* @since 0.0.68
|
|
289
|
-
*/
|
|
290
|
-
onClose: PropTypes.func,
|
|
291
|
-
/**
|
|
292
|
-
* Whether show or not a confirmation dialog on close.
|
|
293
|
-
* @since 3.21.0
|
|
294
|
-
*/
|
|
295
|
-
closingConfirmation: PropTypes.bool,
|
|
296
|
-
/**
|
|
297
|
-
* Content of the `DialogWindow`.
|
|
298
|
-
* @since 0.0.68
|
|
299
|
-
*/
|
|
300
|
-
children: PropTypes.node,
|
|
301
|
-
/**
|
|
302
|
-
* @ignore
|
|
303
|
-
*/
|
|
304
|
-
className: PropTypes.string,
|
|
305
|
-
/**
|
|
306
|
-
* @ignore
|
|
307
|
-
*/
|
|
308
|
-
baseClassName: PropTypes.string
|
|
309
|
-
};
|
|
310
201
|
Dialog.defaultProps = {
|
|
311
202
|
isOpen: false,
|
|
312
203
|
banner: undefined,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
3
|
import { isRtl } from '../../utils';
|
|
4
|
-
import
|
|
4
|
+
import { cloneElement, isValidElement, useState, useEffect, useRef } from 'react';
|
|
5
5
|
import { wrapFunction } from '../utils';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import { CLS_PREFIX, Z_INDEX_DROPDOWN, Z_INDEX_OVERLAY } from '../../constants';
|
|
9
8
|
import Button from '../Button';
|
|
@@ -13,6 +12,8 @@ import Layer from '../Layer';
|
|
|
13
12
|
import { MenuItem, MenuDivider } from '../Menu';
|
|
14
13
|
import Translate from '../Translate';
|
|
15
14
|
import localeFallback from './locale/en-US';
|
|
15
|
+
|
|
16
|
+
// TODO: move to Popover
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -21,7 +22,7 @@ const createTarget = (node, _ref) => {
|
|
|
21
22
|
onToggle,
|
|
22
23
|
targetRef
|
|
23
24
|
} = _ref;
|
|
24
|
-
if (
|
|
25
|
+
if (!( /*#__PURE__*/isValidElement(node) && node.type !== Translate)) {
|
|
25
26
|
node = /*#__PURE__*/_jsx(Button, {
|
|
26
27
|
caret: true,
|
|
27
28
|
children: node
|
|
@@ -202,43 +203,6 @@ const Dropdown = _ref3 => {
|
|
|
202
203
|
})
|
|
203
204
|
});
|
|
204
205
|
};
|
|
205
|
-
Dropdown.propTypes = {
|
|
206
|
-
/**
|
|
207
|
-
* Dropdown [menu](#!/Menu).
|
|
208
|
-
* @since 0.0.57
|
|
209
|
-
*/
|
|
210
|
-
menu: PropTypes.element.isRequired,
|
|
211
|
-
/**
|
|
212
|
-
* Menu placement.
|
|
213
|
-
* @since 0.0.60
|
|
214
|
-
*/
|
|
215
|
-
menuPlacement: PropTypes.string,
|
|
216
|
-
/**
|
|
217
|
-
* Content of the `Dropdown`.
|
|
218
|
-
* @since 0.0.57
|
|
219
|
-
*/
|
|
220
|
-
children: PropTypes.node,
|
|
221
|
-
/**
|
|
222
|
-
* Custom localization messages.
|
|
223
|
-
* @since 3.6.0
|
|
224
|
-
*/
|
|
225
|
-
locale: PropTypes.shape({
|
|
226
|
-
close: PropTypes.node
|
|
227
|
-
}),
|
|
228
|
-
/**
|
|
229
|
-
* Display menu as overlay.
|
|
230
|
-
* @ignore
|
|
231
|
-
*/
|
|
232
|
-
overlay: PropTypes.bool,
|
|
233
|
-
/**
|
|
234
|
-
* @ignore
|
|
235
|
-
*/
|
|
236
|
-
className: PropTypes.string,
|
|
237
|
-
/**
|
|
238
|
-
* @ignore
|
|
239
|
-
*/
|
|
240
|
-
baseClassName: PropTypes.string
|
|
241
|
-
};
|
|
242
206
|
Dropdown.defaultProps = {
|
|
243
207
|
menuPlacement: 'bottom-start',
|
|
244
208
|
children: undefined,
|
|
@@ -399,7 +399,8 @@ const RefForwardingForm = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
399
399
|
const innerRef = useRef(null);
|
|
400
400
|
useImperativeHandle(ref, () => ({
|
|
401
401
|
submit() {
|
|
402
|
-
|
|
402
|
+
var _innerRef$current;
|
|
403
|
+
(_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.dispatchEvent(new Event('submit', {
|
|
403
404
|
cancelable: true,
|
|
404
405
|
bubbles: true
|
|
405
406
|
}));
|
|
@@ -40,19 +40,19 @@ const PasswordMeter = _ref => {
|
|
|
40
40
|
canCloseOnOutsideClick: false,
|
|
41
41
|
canCloseOnEscapePress: false,
|
|
42
42
|
...props,
|
|
43
|
-
children: [result
|
|
43
|
+
children: [result !== null && result !== void 0 && result.strength ? /*#__PURE__*/_jsx(Translate, {
|
|
44
44
|
component: "div",
|
|
45
45
|
content: "FormFieldPassword.passwordStrength",
|
|
46
46
|
fallback: locale.passwordStrength,
|
|
47
47
|
params: {
|
|
48
48
|
strength: /*#__PURE__*/_jsx("b", {
|
|
49
49
|
children: /*#__PURE__*/_jsx(Translate, {
|
|
50
|
-
content: `FormFieldPassword.strength${result
|
|
51
|
-
fallback: locale[`strength${result
|
|
50
|
+
content: `FormFieldPassword.strength${result === null || result === void 0 ? void 0 : result.strength}`,
|
|
51
|
+
fallback: locale[`strength${result === null || result === void 0 ? void 0 : result.strength}`]
|
|
52
52
|
})
|
|
53
53
|
})
|
|
54
54
|
}
|
|
55
|
-
}) : null, result
|
|
55
|
+
}) : null, result !== null && result !== void 0 && result.suggestions.length ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
56
56
|
children: [/*#__PURE__*/_jsx(Translate, {
|
|
57
57
|
content: "FormFieldPassword.improvePassword",
|
|
58
58
|
fallback: locale.improvePassword
|
|
@@ -102,8 +102,8 @@ const OverlayCore = _ref => {
|
|
|
102
102
|
children: /*#__PURE__*/_jsxs("div", {
|
|
103
103
|
className: classNames(baseClassName, `${baseClassName}--${placement}`, `${baseClassName}--${size}`, sideBanner && `${baseClassName}--side`, isOpen && `${baseClassName}--open`, className),
|
|
104
104
|
style: {
|
|
105
|
-
'--overlay-side-banner-background': sideBannerContainer
|
|
106
|
-
'--overlay-side-banner-align': sideBannerContainer
|
|
105
|
+
'--overlay-side-banner-background': sideBannerContainer === null || sideBannerContainer === void 0 ? void 0 : sideBannerContainer.background,
|
|
106
|
+
'--overlay-side-banner-align': sideBannerContainer === null || sideBannerContainer === void 0 ? void 0 : sideBannerContainer.align,
|
|
107
107
|
...style
|
|
108
108
|
},
|
|
109
109
|
...props,
|
|
@@ -133,10 +133,11 @@ const Overlay = _ref2 => {
|
|
|
133
133
|
const [isExist, setIsExist] = useState(false);
|
|
134
134
|
const prevFocusElementRef = useRef(null);
|
|
135
135
|
const handleClose = useCallback(() => {
|
|
136
|
+
var _prevFocusElementRef$;
|
|
136
137
|
if (!isOpenRef.current) return;
|
|
137
138
|
isOpenRef.current = false;
|
|
138
139
|
if (--overlaysCount === 0) enableDocumentScroll();
|
|
139
|
-
prevFocusElementRef.current
|
|
140
|
+
(_prevFocusElementRef$ = prevFocusElementRef.current) === null || _prevFocusElementRef$ === void 0 ? void 0 : _prevFocusElementRef$.focus();
|
|
140
141
|
}, []);
|
|
141
142
|
useEffect(() => {
|
|
142
143
|
if (isOpen) {
|
|
@@ -259,7 +259,9 @@ class Popover extends Component {
|
|
|
259
259
|
className: `${baseClassName}__content`,
|
|
260
260
|
children: /*#__PURE__*/_jsx("div", {
|
|
261
261
|
className: `${baseClassName}__content-inner`,
|
|
262
|
-
children: children
|
|
262
|
+
children: typeof children === 'function' ? children({
|
|
263
|
+
onClose: this.handleClose
|
|
264
|
+
}) : children
|
|
263
265
|
})
|
|
264
266
|
})]
|
|
265
267
|
});
|
|
@@ -139,7 +139,8 @@ class Section extends Component {
|
|
|
139
139
|
value: title,
|
|
140
140
|
onChange: onTitleChange,
|
|
141
141
|
onClick: e => {
|
|
142
|
-
|
|
142
|
+
var _e$target$closest$que;
|
|
143
|
+
(_e$target$closest$que = e.target.closest(`.${baseClassName}__header`).querySelector(`.${baseClassName}__control-button`)) === null || _e$target$closest$que === void 0 ? void 0 : _e$target$closest$que.click();
|
|
143
144
|
}
|
|
144
145
|
});
|
|
145
146
|
}
|
|
@@ -26,7 +26,7 @@ const SkeletonText = _ref => {
|
|
|
26
26
|
// eslint-disable-next-line react/no-array-index-key
|
|
27
27
|
, {
|
|
28
28
|
...lineProps,
|
|
29
|
-
className: classNames(`${baseClassName}__line`, lineProps
|
|
29
|
+
className: classNames(`${baseClassName}__line`, lineProps === null || lineProps === void 0 ? void 0 : lineProps.className)
|
|
30
30
|
}, key))
|
|
31
31
|
});
|
|
32
32
|
};
|
package/esm/components/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { default as AutoClosable } from './AutoClosable';
|
|
|
6
6
|
export { default as AuxiliaryActions } from './AuxiliaryActions';
|
|
7
7
|
export { default as Badge } from './Badge';
|
|
8
8
|
export { default as Breadcrumbs } from './Breadcrumbs';
|
|
9
|
-
export { default as Button } from './Button';
|
|
9
|
+
export { default as Button, ButtonProps } from './Button';
|
|
10
10
|
export { default as ButtonGroup } from './ButtonGroup';
|
|
11
11
|
export { default as Card } from './Card';
|
|
12
12
|
export * from './Card';
|
|
@@ -42,7 +42,7 @@ export { default as Grid } from './Grid';
|
|
|
42
42
|
export { default as GridCol } from './GridCol';
|
|
43
43
|
export { default as Heading } from './Heading';
|
|
44
44
|
export { default as Hint } from './Hint';
|
|
45
|
-
export { default as Icon } from './Icon';
|
|
45
|
+
export { default as Icon, IconProps, IconName, IconSize } from './Icon';
|
|
46
46
|
export { default as Input } from './Input';
|
|
47
47
|
export { default as InputFile } from './InputFile';
|
|
48
48
|
export { default as InputNumber } from './InputNumber';
|
package/esm/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.1",
|
|
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.
|
|
45
|
+
"@babel/runtime": "^7.22.5",
|
|
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.
|
|
61
|
+
"@babel/core": "^7.22.5",
|
|
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.
|
|
65
|
-
"@babel/preset-env": "^7.
|
|
66
|
-
"@babel/preset-react": "^7.
|
|
67
|
-
"@babel/preset-typescript": "^7.
|
|
68
|
-
"@babel/types": "^7.
|
|
64
|
+
"@babel/plugin-transform-runtime": "^7.22.5",
|
|
65
|
+
"@babel/preset-env": "^7.22.5",
|
|
66
|
+
"@babel/preset-react": "^7.22.5",
|
|
67
|
+
"@babel/preset-typescript": "^7.22.5",
|
|
68
|
+
"@babel/types": "^7.22.5",
|
|
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,14 +77,14 @@
|
|
|
77
77
|
"@types/jest": "^24.9.1",
|
|
78
78
|
"@types/jest-image-snapshot": "^6.1.0",
|
|
79
79
|
"@types/marked": "^4.3.1",
|
|
80
|
-
"@types/node": "^16.18.
|
|
81
|
-
"@types/react": "^17.0.
|
|
82
|
-
"@types/react-dom": "^17.0.
|
|
80
|
+
"@types/node": "^16.18.38",
|
|
81
|
+
"@types/react": "^17.0.62",
|
|
82
|
+
"@types/react-dom": "^17.0.20",
|
|
83
83
|
"@types/react-measure": "2.0.8",
|
|
84
84
|
"@types/react-transition-group": "^4.4.6",
|
|
85
85
|
"@types/svg4everybody": "2.1.2",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
87
|
-
"@typescript-eslint/parser": "^5.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
87
|
+
"@typescript-eslint/parser": "^5.60.1",
|
|
88
88
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
89
89
|
"autoprefixer": "^10.4.14",
|
|
90
90
|
"babel-loader": "^8.3.0",
|
|
@@ -92,37 +92,38 @@
|
|
|
92
92
|
"babel-plugin-transform-require-ignore": "^0.1.1",
|
|
93
93
|
"clean-webpack-plugin": "^4.0.0",
|
|
94
94
|
"cross-env": "^5.2.1",
|
|
95
|
-
"css-loader": "^6.
|
|
96
|
-
"css-minimizer-webpack-plugin": "^5.0.
|
|
95
|
+
"css-loader": "^6.8.1",
|
|
96
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
97
97
|
"enzyme": "^3.11.0",
|
|
98
98
|
"enzyme-to-json": "^3.6.2",
|
|
99
|
-
"eslint": "^8.
|
|
99
|
+
"eslint": "^8.44.0",
|
|
100
100
|
"eslint-config-prettier": "^8.8.0",
|
|
101
101
|
"eslint-plugin-markdown": "^3.0.0",
|
|
102
102
|
"eslint-plugin-prettier": "^4.2.1",
|
|
103
103
|
"fs-extra": "^7.0.1",
|
|
104
|
-
"html-webpack-plugin": "^5.5.
|
|
104
|
+
"html-webpack-plugin": "^5.5.3",
|
|
105
105
|
"inquirer": "^3.3.0",
|
|
106
106
|
"jest": "^24.9.0",
|
|
107
107
|
"jest-dev-server": "^9.0.0",
|
|
108
108
|
"jest-image-snapshot": "^6.1.0",
|
|
109
109
|
"less": "^4.1.3",
|
|
110
|
-
"less-loader": "^11.1.
|
|
110
|
+
"less-loader": "^11.1.3",
|
|
111
111
|
"mini-css-extract-plugin": "^2.7.6",
|
|
112
|
-
"postcss": "^8.4.
|
|
112
|
+
"postcss": "^8.4.24",
|
|
113
113
|
"postcss-less": "^6.0.0",
|
|
114
|
-
"postcss-loader": "^7.3.
|
|
114
|
+
"postcss-loader": "^7.3.3",
|
|
115
115
|
"postcss-logical": "^6.2.0",
|
|
116
116
|
"prettier": "^2.8.8",
|
|
117
117
|
"puppeteer-core": "20.4.0",
|
|
118
118
|
"react": "^17.0.2",
|
|
119
|
+
"react-docgen-typescript": "^2.2.2",
|
|
119
120
|
"react-dom": "^17.0.2",
|
|
120
121
|
"react-styleguidist": "^12.0.1",
|
|
121
122
|
"react-test-renderer": "^16.14.0",
|
|
122
123
|
"rimraf": "^5.0.1",
|
|
123
124
|
"rtlcss": "^4.1.0",
|
|
124
125
|
"style-loader": "^3.3.3",
|
|
125
|
-
"stylelint": "^15.
|
|
126
|
+
"stylelint": "^15.9.0",
|
|
126
127
|
"stylelint-declaration-block-no-ignored-properties": "^2.7.0",
|
|
127
128
|
"stylelint-no-unsupported-browser-features": "^6.1.0",
|
|
128
129
|
"stylelint-prettier": "^3.0.0",
|
|
@@ -130,8 +131,8 @@
|
|
|
130
131
|
"svg-mixer": "^2.3.14",
|
|
131
132
|
"terser-webpack-plugin": "^5.3.9",
|
|
132
133
|
"typescript": "4.5.5",
|
|
133
|
-
"webpack": "^5.
|
|
134
|
-
"webpack-cli": "^5.1.
|
|
134
|
+
"webpack": "^5.88.1",
|
|
135
|
+
"webpack-cli": "^5.1.4"
|
|
135
136
|
},
|
|
136
137
|
"peerDependencies": {
|
|
137
138
|
"react": "^17.0.2",
|