@plesk/ui-library 3.34.0 → 3.34.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 +17 -100
- package/cjs/components/ContentLoader/IconsLoader.js +2 -1
- package/cjs/components/Dialog/Dialog.js +4 -113
- package/cjs/components/Drawer/Drawer.js +10 -143
- package/cjs/components/Drawer/Header.js +5 -12
- 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/Section/Section.js +2 -1
- package/cjs/components/Skeleton/SkeletonText.js +1 -1
- 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 +128 -494
- 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 +17 -98
- package/esm/components/ContentLoader/IconsLoader.js +2 -1
- package/esm/components/Dialog/Dialog.js +4 -113
- package/esm/components/Drawer/Drawer.js +10 -141
- package/esm/components/Drawer/Header.js +5 -10
- 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/Section/Section.js +2 -1
- package/esm/components/Skeleton/SkeletonText.js +1 -1
- 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.70f167a3.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 +105 -0
- package/types/src/components/Button/index.d.ts +2 -0
- package/types/src/components/Dialog/Dialog.d.ts +126 -0
- package/types/src/components/Dialog/index.d.ts +2 -0
- package/types/src/components/Drawer/Drawer.d.ts +108 -0
- package/types/src/components/Drawer/DrawerProgress.d.ts +1 -1
- package/types/src/components/Drawer/Header.d.ts +28 -0
- package/types/src/components/Drawer/index.d.ts +2 -0
- package/types/src/components/Dropdown/Dropdown.d.ts +54 -0
- package/types/src/components/Form/Form.d.ts +11 -11
- 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 +3 -0
- package/types/src/utils/types/PolymorphicComponent.d.ts +11 -0
- package/types/src/utils/types/index.d.ts +1 -0
- package/styleguide/build/bundle.ad46084d.js +0 -2
- /package/styleguide/build/{bundle.ad46084d.js.LICENSE.txt → bundle.70f167a3.js.LICENSE.txt} +0 -0
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = require("react");
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _constants = require("../../constants");
|
|
12
11
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
@@ -16,8 +15,6 @@ var _ResponsiveContext = _interopRequireDefault(require("../ResponsiveContext"))
|
|
|
16
15
|
var _OnDarkContext = _interopRequireDefault(require("../OnDarkContext"));
|
|
17
16
|
var _ButtonContext = _interopRequireDefault(require("./ButtonContext"));
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
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); }
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
18
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
22
19
|
const oldIconNames = {
|
|
23
20
|
"customize-order": "arrows-four-directions",
|
|
@@ -72,32 +69,27 @@ const renderCaret = _ref2 => {
|
|
|
72
69
|
}
|
|
73
70
|
return caretElement;
|
|
74
71
|
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
78
|
-
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
79
|
-
* @since 0.0.37
|
|
80
|
-
*/
|
|
81
72
|
const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
82
73
|
let {
|
|
83
|
-
baseClassName
|
|
74
|
+
baseClassName = `${_constants.CLS_PREFIX}button`,
|
|
84
75
|
className,
|
|
85
|
-
component
|
|
76
|
+
component,
|
|
86
77
|
size: propsSize,
|
|
87
78
|
intent,
|
|
88
|
-
ghost,
|
|
79
|
+
ghost = false,
|
|
89
80
|
selected: selectedProp,
|
|
90
81
|
onToggle,
|
|
91
82
|
state,
|
|
92
83
|
icon,
|
|
93
84
|
caret,
|
|
94
|
-
fill,
|
|
85
|
+
fill = false,
|
|
95
86
|
tooltip,
|
|
96
87
|
children,
|
|
97
88
|
arrow,
|
|
98
|
-
disabled,
|
|
89
|
+
disabled = false,
|
|
99
90
|
...props
|
|
100
91
|
} = _ref3;
|
|
92
|
+
const Tag = component || 'button';
|
|
101
93
|
const [selectedState, setSelectedState] = (0, _react.useState)(false);
|
|
102
94
|
const handleToggle = () => {
|
|
103
95
|
setSelectedState(!selectedState);
|
|
@@ -137,7 +129,7 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
137
129
|
}
|
|
138
130
|
const selected = selectedProp === undefined ? selectedState : selectedProp;
|
|
139
131
|
if (selectedProp !== undefined || onToggle) {
|
|
140
|
-
componentProps['aria-pressed'] =
|
|
132
|
+
componentProps['aria-pressed'] = `${selected}`;
|
|
141
133
|
}
|
|
142
134
|
const isArrowButton = arrow === 'forward' || arrow === 'backward';
|
|
143
135
|
const hasAriaDisabled = Tag === 'button' && disabled && tooltip;
|
|
@@ -189,90 +181,8 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
189
181
|
return button;
|
|
190
182
|
});
|
|
191
183
|
Button.displayName = 'Button';
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
* Button size.
|
|
195
|
-
* @since 2.5.0
|
|
196
|
-
*/
|
|
197
|
-
size: _propTypes.default.oneOf(['md', 'lg']),
|
|
198
|
-
/**
|
|
199
|
-
* Visual intent color to apply to component.
|
|
200
|
-
* @since 0.0.42
|
|
201
|
-
*/
|
|
202
|
-
intent: _propTypes.default.oneOf(['primary', 'secondary', 'success', 'warning', 'danger', 'info']),
|
|
203
|
-
/**
|
|
204
|
-
* Display button with transparent background.
|
|
205
|
-
* @since 2.1.0
|
|
206
|
-
*/
|
|
207
|
-
ghost: _propTypes.default.bool,
|
|
208
|
-
/**
|
|
209
|
-
* Arrow button.
|
|
210
|
-
* @since 2.6.0
|
|
211
|
-
*/
|
|
212
|
-
arrow: _propTypes.default.oneOf(['forward', 'backward']),
|
|
213
|
-
/**
|
|
214
|
-
* Selected state of toggle button. Used in controlled component mode.
|
|
215
|
-
* @since 0.0.68
|
|
216
|
-
*/
|
|
217
|
-
selected: _propTypes.default.bool,
|
|
218
|
-
/**
|
|
219
|
-
* Toggle button callback. Used in uncontrolled component mode.
|
|
220
|
-
* @since 0.0.68
|
|
221
|
-
*/
|
|
222
|
-
onToggle: _propTypes.default.func,
|
|
223
|
-
/**
|
|
224
|
-
* State of the button
|
|
225
|
-
* @since 0.0.42
|
|
226
|
-
*/
|
|
227
|
-
state: _propTypes.default.oneOf(['active', 'loading', 'hovered', 'focused']),
|
|
228
|
-
/**
|
|
229
|
-
* Is button disabled?
|
|
230
|
-
* @since 0.0.42
|
|
231
|
-
*/
|
|
232
|
-
disabled: _propTypes.default.bool,
|
|
233
|
-
/**
|
|
234
|
-
* Tooltip for component
|
|
235
|
-
* @since 0.0.42
|
|
236
|
-
*/
|
|
237
|
-
tooltip: _propTypes.default.node,
|
|
238
|
-
/**
|
|
239
|
-
* Name of icon or [Icon](#!/Icon) component
|
|
240
|
-
* @since 0.0.42
|
|
241
|
-
*/
|
|
242
|
-
icon: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]),
|
|
243
|
-
/**
|
|
244
|
-
* Show caret
|
|
245
|
-
* @since 0.0.42
|
|
246
|
-
*/
|
|
247
|
-
caret: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.element]),
|
|
248
|
-
/**
|
|
249
|
-
* Dynamically expand the button to fill out the whole available width of its parent container.
|
|
250
|
-
* @since 1.8.0
|
|
251
|
-
*/
|
|
252
|
-
fill: _propTypes.default.bool,
|
|
253
|
-
/**
|
|
254
|
-
* Content of the button
|
|
255
|
-
* @since 0.0.37
|
|
256
|
-
*/
|
|
257
|
-
children: _propTypes.default.node,
|
|
258
|
-
/**
|
|
259
|
-
* Component to render as the root element. Useful when rendering a `Button` as `<a>` or `<Link>`.
|
|
260
|
-
* @since 0.0.42
|
|
261
|
-
*/
|
|
262
|
-
component: _propTypes.default.elementType,
|
|
263
|
-
/**
|
|
264
|
-
* @ignore
|
|
265
|
-
*/
|
|
266
|
-
className: _propTypes.default.string,
|
|
267
|
-
/**
|
|
268
|
-
* @ignore
|
|
269
|
-
*/
|
|
270
|
-
baseClassName: _propTypes.default.string,
|
|
271
|
-
/**
|
|
272
|
-
* @ignore
|
|
273
|
-
*/
|
|
274
|
-
onClick: _propTypes.default.func
|
|
275
|
-
};
|
|
184
|
+
|
|
185
|
+
// For ToolbarMenu backward compatibility purposes
|
|
276
186
|
Button.defaultProps = {
|
|
277
187
|
size: undefined,
|
|
278
188
|
intent: undefined,
|
|
@@ -292,5 +202,12 @@ Button.defaultProps = {
|
|
|
292
202
|
arrow: undefined,
|
|
293
203
|
onClick: undefined
|
|
294
204
|
};
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
208
|
+
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
209
|
+
*
|
|
210
|
+
* Since: 0.0.37
|
|
211
|
+
*/
|
|
295
212
|
var _default = Button;
|
|
296
213
|
exports.default = _default;
|
|
@@ -36,6 +36,7 @@ const useIconCursor = (icons, initialCursor, isSync) => {
|
|
|
36
36
|
return [icons[cursor], targetRef];
|
|
37
37
|
};
|
|
38
38
|
const IconsLoader = _ref => {
|
|
39
|
+
var _icons;
|
|
39
40
|
let {
|
|
40
41
|
baseClassName = `${_constants.CLS_PREFIX}icons-loader`,
|
|
41
42
|
className,
|
|
@@ -45,7 +46,7 @@ const IconsLoader = _ref => {
|
|
|
45
46
|
...props
|
|
46
47
|
} = _ref;
|
|
47
48
|
const syncRef = (0, _react.useRef)('icon1');
|
|
48
|
-
if (!icons
|
|
49
|
+
if (!((_icons = icons) !== null && _icons !== void 0 && _icons.length)) {
|
|
49
50
|
icons = DEFAULT_ICONS;
|
|
50
51
|
} else if (icons.length === 1) {
|
|
51
52
|
icons = [icons[0], icons[0]];
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = require("react");
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _constants = require("../../constants");
|
|
12
11
|
var _Overlay = _interopRequireDefault(require("../Overlay"));
|
|
@@ -76,6 +75,7 @@ const Dialog = _ref => {
|
|
|
76
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
76
|
className: classPrefix,
|
|
78
77
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
78
|
+
alt: "",
|
|
79
79
|
className: `${classPrefix}-inner`,
|
|
80
80
|
src: image
|
|
81
81
|
})
|
|
@@ -84,6 +84,7 @@ const Dialog = _ref => {
|
|
|
84
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
85
85
|
className: classPrefix,
|
|
86
86
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
87
|
+
alt: "",
|
|
87
88
|
className: `${classPrefix}-inner`,
|
|
88
89
|
...image
|
|
89
90
|
})
|
|
@@ -173,7 +174,7 @@ const Dialog = _ref => {
|
|
|
173
174
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
174
175
|
className: `${baseClassName}__header-content`,
|
|
175
176
|
children: [(0, _Translate.isLikeText)(title) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.default, {
|
|
176
|
-
level:
|
|
177
|
+
level: 2,
|
|
177
178
|
className: `${baseClassName}__title`,
|
|
178
179
|
children: title
|
|
179
180
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -205,116 +206,6 @@ const Dialog = _ref => {
|
|
|
205
206
|
}), closingConfirmationDialog]
|
|
206
207
|
});
|
|
207
208
|
};
|
|
208
|
-
Dialog.propTypes = {
|
|
209
|
-
/**
|
|
210
|
-
* Toggles visibility.
|
|
211
|
-
* @since 0.0.68
|
|
212
|
-
*/
|
|
213
|
-
isOpen: _propTypes.default.bool,
|
|
214
|
-
/**
|
|
215
|
-
* Banner. Renders in front of content as wide as dialog.
|
|
216
|
-
* @since 0.0.68
|
|
217
|
-
*/
|
|
218
|
-
banner: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]),
|
|
219
|
-
/**
|
|
220
|
-
* Block with an image, placed at the side of the component
|
|
221
|
-
* @since 3.25.0
|
|
222
|
-
*/
|
|
223
|
-
sideBanner: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]),
|
|
224
|
-
/**
|
|
225
|
-
* Additional properties for the sideBanner
|
|
226
|
-
* @since 3.25.0
|
|
227
|
-
*/
|
|
228
|
-
sideBannerContainer: _propTypes.default.shape({
|
|
229
|
-
/**
|
|
230
|
-
* Values for css background property
|
|
231
|
-
*/
|
|
232
|
-
background: _propTypes.default.string,
|
|
233
|
-
/**
|
|
234
|
-
* One of: center, flex-start, flex-end
|
|
235
|
-
*/
|
|
236
|
-
align: _propTypes.default.oneOf(['center', 'flex-start', 'flex-end'])
|
|
237
|
-
}),
|
|
238
|
-
/**
|
|
239
|
-
* Image. Renders into content.
|
|
240
|
-
* @since 0.0.68
|
|
241
|
-
*/
|
|
242
|
-
image: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]),
|
|
243
|
-
/**
|
|
244
|
-
* Title
|
|
245
|
-
* @since 0.0.68
|
|
246
|
-
*/
|
|
247
|
-
title: _propTypes.default.node,
|
|
248
|
-
/**
|
|
249
|
-
* The subtitle of the `Dialog`.
|
|
250
|
-
* @since 4.0.0
|
|
251
|
-
*/
|
|
252
|
-
subtitle: _propTypes.default.node,
|
|
253
|
-
/**
|
|
254
|
-
* Title of "cancel" button
|
|
255
|
-
* @since 0.0.68
|
|
256
|
-
* @deprecated Use `cancelButton` instead.
|
|
257
|
-
*/
|
|
258
|
-
cancelTitle: _propTypes.default.node,
|
|
259
|
-
/**
|
|
260
|
-
* Cancel button visibility or custom configuration. It accepts all props of the `Button` component.
|
|
261
|
-
* @since 3.13.0
|
|
262
|
-
*/
|
|
263
|
-
cancelButton: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
264
|
-
/**
|
|
265
|
-
* Buttons except "cancel" button
|
|
266
|
-
* @since 0.0.68
|
|
267
|
-
*/
|
|
268
|
-
buttons: _propTypes.default.node,
|
|
269
|
-
/**
|
|
270
|
-
* Actions which will be shown in Dialog header
|
|
271
|
-
* @since 1.2.0
|
|
272
|
-
*/
|
|
273
|
-
actions: _propTypes.default.node,
|
|
274
|
-
/**
|
|
275
|
-
* Wraps children into [Form](#!/Form) if not empty.
|
|
276
|
-
* @since 0.0.68
|
|
277
|
-
*/
|
|
278
|
-
form: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.element]),
|
|
279
|
-
/**
|
|
280
|
-
* Dialog width
|
|
281
|
-
* @since 0.0.68
|
|
282
|
-
*/
|
|
283
|
-
size: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
284
|
-
/**
|
|
285
|
-
* If the value is false, the dialog cannot be closed and the Close button is hidden.
|
|
286
|
-
* @since 1.2.0
|
|
287
|
-
*/
|
|
288
|
-
closable: _propTypes.default.bool,
|
|
289
|
-
/**
|
|
290
|
-
* Disable close dialog button
|
|
291
|
-
* @since 4.0.0
|
|
292
|
-
*/
|
|
293
|
-
canClose: _propTypes.default.bool,
|
|
294
|
-
/**
|
|
295
|
-
* On close event handler. Called immediately after dialog closed by "cancel" button or "Esc" key.
|
|
296
|
-
* @since 0.0.68
|
|
297
|
-
*/
|
|
298
|
-
onClose: _propTypes.default.func,
|
|
299
|
-
/**
|
|
300
|
-
* Whether show or not a confirmation dialog on close.
|
|
301
|
-
* @since 3.21.0
|
|
302
|
-
*/
|
|
303
|
-
closingConfirmation: _propTypes.default.bool,
|
|
304
|
-
/**
|
|
305
|
-
* Content of the `DialogWindow`.
|
|
306
|
-
* @since 0.0.68
|
|
307
|
-
*/
|
|
308
|
-
children: _propTypes.default.node,
|
|
309
|
-
/**
|
|
310
|
-
* @ignore
|
|
311
|
-
*/
|
|
312
|
-
className: _propTypes.default.string,
|
|
313
|
-
/**
|
|
314
|
-
* @ignore
|
|
315
|
-
*/
|
|
316
|
-
baseClassName: _propTypes.default.string
|
|
317
|
-
};
|
|
318
209
|
Dialog.defaultProps = {
|
|
319
210
|
isOpen: false,
|
|
320
211
|
banner: undefined,
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = require("react");
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _constants = require("../../constants");
|
|
12
11
|
var _Overlay = _interopRequireDefault(require("../Overlay"));
|
|
@@ -18,157 +17,26 @@ var _Translate = require("../Translate");
|
|
|
18
17
|
var _ScrollableElementFormContext = _interopRequireDefault(require("../Form/ScrollableElementFormContext"));
|
|
19
18
|
var _DrawerProgress = _interopRequireDefault(require("./DrawerProgress"));
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
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); }
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
20
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
24
21
|
|
|
25
|
-
const propTypes = {
|
|
26
|
-
/**
|
|
27
|
-
* Toggles visibility.
|
|
28
|
-
* @since 0.0.65
|
|
29
|
-
*/
|
|
30
|
-
isOpen: _propTypes.default.bool,
|
|
31
|
-
/**
|
|
32
|
-
* The title of the `Drawer`.
|
|
33
|
-
* @since 0.0.65
|
|
34
|
-
*/
|
|
35
|
-
title: _propTypes.default.node.isRequired,
|
|
36
|
-
/**
|
|
37
|
-
* The subtitle of the `Drawer`.
|
|
38
|
-
* @since 0.0.65
|
|
39
|
-
*/
|
|
40
|
-
subtitle: _propTypes.default.node,
|
|
41
|
-
/**
|
|
42
|
-
* Show the minimize button and the inactive close button.
|
|
43
|
-
* @since 1.4.1
|
|
44
|
-
*/
|
|
45
|
-
hideButton: _propTypes.default.bool,
|
|
46
|
-
/**
|
|
47
|
-
* Show back button in the header. If true the close button is not show.
|
|
48
|
-
* @deprecated Not recommended to use. Use default close button instead.
|
|
49
|
-
* @since 0.0.65
|
|
50
|
-
*/
|
|
51
|
-
backButton: _propTypes.default.bool,
|
|
52
|
-
/**
|
|
53
|
-
* A slot for `Tabs` component.
|
|
54
|
-
* @since 3.26.0
|
|
55
|
-
*/
|
|
56
|
-
tabs: _propTypes.default.node,
|
|
57
|
-
/**
|
|
58
|
-
* Overlay placement.
|
|
59
|
-
* @since 0.0.65
|
|
60
|
-
*/
|
|
61
|
-
placement: _propTypes.default.oneOf(['left', 'right']),
|
|
62
|
-
/**
|
|
63
|
-
* Overlay size.
|
|
64
|
-
* @since 0.0.65
|
|
65
|
-
*/
|
|
66
|
-
size: _propTypes.default.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
67
|
-
/**
|
|
68
|
-
* onClose handler.
|
|
69
|
-
* @since 0.0.65
|
|
70
|
-
*/
|
|
71
|
-
onClose: _propTypes.default.func,
|
|
72
|
-
/**
|
|
73
|
-
* Whether show or not a confirmation dialog on close.
|
|
74
|
-
* @since 3.21.0
|
|
75
|
-
*/
|
|
76
|
-
closingConfirmation: _propTypes.default.bool,
|
|
77
|
-
/**
|
|
78
|
-
* Wraps children into [Form](#!/Form) if not empty.<br>
|
|
79
|
-
* **Note:** in case of *element* you should take care of providing additional form props from [Drawer](#!/Drawer) through your custom component. See example below for more details
|
|
80
|
-
*
|
|
81
|
-
* @since 0.0.66
|
|
82
|
-
*/
|
|
83
|
-
form: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.element]),
|
|
84
|
-
/**
|
|
85
|
-
* Block with an image, placed at the side of the component
|
|
86
|
-
* @since 3.25.0
|
|
87
|
-
*/
|
|
88
|
-
sideBanner: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]),
|
|
89
|
-
/**
|
|
90
|
-
* Additional properties for the sideBanner
|
|
91
|
-
* @since 3.25.0
|
|
92
|
-
*/
|
|
93
|
-
sideBannerContainer: _propTypes.default.shape({
|
|
94
|
-
/**
|
|
95
|
-
* Values for css background property
|
|
96
|
-
*/
|
|
97
|
-
background: _propTypes.default.string,
|
|
98
|
-
/**
|
|
99
|
-
* One of: center, flex-start, flex-end
|
|
100
|
-
*/
|
|
101
|
-
align: _propTypes.default.oneOf(['center', 'flex-start', 'flex-end'])
|
|
102
|
-
}),
|
|
103
|
-
/**
|
|
104
|
-
* Content of the `Drawer`.
|
|
105
|
-
* @since 0.0.65
|
|
106
|
-
*/
|
|
107
|
-
children: _propTypes.default.node,
|
|
108
|
-
/**
|
|
109
|
-
* Adds [Progress](#!/Progress) into footer.
|
|
110
|
-
* @since 1.11.0
|
|
111
|
-
*/
|
|
112
|
-
progress: _propTypes.default.shape({
|
|
113
|
-
/**
|
|
114
|
-
* A title for the progress.
|
|
115
|
-
*/
|
|
116
|
-
title: _propTypes.default.string,
|
|
117
|
-
/**
|
|
118
|
-
* An array of [ProgressStep](#!/ProgressStep) props.
|
|
119
|
-
*/
|
|
120
|
-
steps: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
121
|
-
title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
122
|
-
status: _propTypes.default.string,
|
|
123
|
-
progress: _propTypes.default.number,
|
|
124
|
-
icon: _propTypes.default.string
|
|
125
|
-
})).isRequired,
|
|
126
|
-
/**
|
|
127
|
-
* An option that controls drawer closing ability.
|
|
128
|
-
*/
|
|
129
|
-
cancelable: _propTypes.default.bool,
|
|
130
|
-
/**
|
|
131
|
-
* On overall status event handler.
|
|
132
|
-
* @since 3.8.0
|
|
133
|
-
*/
|
|
134
|
-
onStatusChange: _propTypes.default.func,
|
|
135
|
-
/**
|
|
136
|
-
* @ignore
|
|
137
|
-
*/
|
|
138
|
-
onClose: _propTypes.default.func,
|
|
139
|
-
/**
|
|
140
|
-
* @ignore
|
|
141
|
-
*/
|
|
142
|
-
onClosableChange: _propTypes.default.func
|
|
143
|
-
}),
|
|
144
|
-
/**
|
|
145
|
-
* @ignore
|
|
146
|
-
*/
|
|
147
|
-
className: _propTypes.default.string,
|
|
148
|
-
/**
|
|
149
|
-
* @ignore
|
|
150
|
-
*/
|
|
151
|
-
baseClassName: _propTypes.default.string
|
|
152
|
-
};
|
|
153
22
|
const defaultProps = {
|
|
154
23
|
isOpen: false,
|
|
155
|
-
subtitle:
|
|
24
|
+
subtitle: undefined,
|
|
156
25
|
backButton: undefined,
|
|
157
26
|
hideButton: undefined,
|
|
158
27
|
tabs: undefined,
|
|
159
28
|
placement: 'left',
|
|
160
29
|
size: 'md',
|
|
161
|
-
onClose:
|
|
30
|
+
onClose: undefined,
|
|
162
31
|
closingConfirmation: undefined,
|
|
163
|
-
form:
|
|
32
|
+
form: undefined,
|
|
164
33
|
sideBanner: undefined,
|
|
165
34
|
sideBannerContainer: undefined,
|
|
166
|
-
progress:
|
|
35
|
+
progress: undefined,
|
|
167
36
|
children: null,
|
|
168
|
-
className:
|
|
37
|
+
className: undefined,
|
|
169
38
|
baseClassName: `${_constants.CLS_PREFIX}drawer`
|
|
170
39
|
};
|
|
171
|
-
|
|
172
40
|
/**
|
|
173
41
|
* `Drawer` component is used for working with properties of an object (or system) without leaving the context of the object.
|
|
174
42
|
* [Read more when to use Drawer](#!/Drawers%2C%20pages%2C%20popovers).
|
|
@@ -190,7 +58,7 @@ const Drawer = _ref => {
|
|
|
190
58
|
closingConfirmation,
|
|
191
59
|
...props
|
|
192
60
|
} = _ref;
|
|
193
|
-
const scrollableRef = (0, _react.useRef)();
|
|
61
|
+
const scrollableRef = (0, _react.useRef)(null);
|
|
194
62
|
const [isClosable, setIsClosable] = (0, _react.useState)(true);
|
|
195
63
|
const {
|
|
196
64
|
onCloseWithConfirmation,
|
|
@@ -227,7 +95,7 @@ const Drawer = _ref => {
|
|
|
227
95
|
className: (0, _classnames.default)(`${baseClassName}__form`, form.props.className),
|
|
228
96
|
cancelButton: form.props.cancelButton === false ? false : {
|
|
229
97
|
onClick: onCloseWithConfirmation,
|
|
230
|
-
...form.props.cancelButton
|
|
98
|
+
...(typeof form.props.cancelButton === 'object' && form.props.cancelButton)
|
|
231
99
|
},
|
|
232
100
|
render: _ref3 => {
|
|
233
101
|
let {
|
|
@@ -246,7 +114,7 @@ const Drawer = _ref => {
|
|
|
246
114
|
if (form.cancelButton !== false) {
|
|
247
115
|
form.cancelButton = {
|
|
248
116
|
onClick: onCloseWithConfirmation,
|
|
249
|
-
...form.cancelButton
|
|
117
|
+
...(typeof form.cancelButton === 'object' && form.cancelButton)
|
|
250
118
|
};
|
|
251
119
|
}
|
|
252
120
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Form.default, {
|
|
@@ -291,7 +159,7 @@ const Drawer = _ref => {
|
|
|
291
159
|
onClose: onCloseWithConfirmation,
|
|
292
160
|
tabs: tabs,
|
|
293
161
|
children: [(0, _Translate.isLikeText)(title) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.default, {
|
|
294
|
-
level:
|
|
162
|
+
level: 2,
|
|
295
163
|
className: `${baseClassName}__title`,
|
|
296
164
|
children: title
|
|
297
165
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -319,7 +187,6 @@ const Drawer = _ref => {
|
|
|
319
187
|
}), closingConfirmationDialog]
|
|
320
188
|
});
|
|
321
189
|
};
|
|
322
|
-
Drawer.propTypes = propTypes;
|
|
323
190
|
Drawer.defaultProps = defaultProps;
|
|
324
191
|
var _default = Drawer;
|
|
325
192
|
exports.default = _default;
|
|
@@ -7,18 +7,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
|
-
var _react =
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _react = require("react");
|
|
12
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
12
|
var _constants = require("../../constants");
|
|
14
13
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
15
14
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
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); }
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
16
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
20
17
|
|
|
21
18
|
class Header extends _react.Component {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
(0, _defineProperty2.default)(this, "isRtl", false);
|
|
22
|
+
}
|
|
22
23
|
componentDidMount() {
|
|
23
24
|
this.isRtl = (0, _utils.isRtl)();
|
|
24
25
|
}
|
|
@@ -128,14 +129,6 @@ class Header extends _react.Component {
|
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
exports.default = Header;
|
|
131
|
-
(0, _defineProperty2.default)(Header, "propTypes", {
|
|
132
|
-
baseClassName: _propTypes.default.string,
|
|
133
|
-
onClose: _propTypes.default.func,
|
|
134
|
-
children: _propTypes.default.node.isRequired,
|
|
135
|
-
backButton: _propTypes.default.bool,
|
|
136
|
-
hideButton: _propTypes.default.bool,
|
|
137
|
-
tabs: _propTypes.default.node
|
|
138
|
-
});
|
|
139
132
|
(0, _defineProperty2.default)(Header, "defaultProps", {
|
|
140
133
|
onClose: null,
|
|
141
134
|
baseClassName: `${_constants.CLS_PREFIX}drawer-header`,
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _utils = require("../../utils");
|
|
9
|
-
var _react =
|
|
9
|
+
var _react = require("react");
|
|
10
10
|
var _utils2 = require("../utils");
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
12
|
var _constants = require("../../constants");
|
|
14
13
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
@@ -19,16 +18,16 @@ var _Menu = require("../Menu");
|
|
|
19
18
|
var _Translate = _interopRequireDefault(require("../Translate"));
|
|
20
19
|
var _enUS = _interopRequireDefault(require("./locale/en-US"));
|
|
21
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
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); }
|
|
23
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
21
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
25
22
|
|
|
23
|
+
// TODO: move to Popover
|
|
24
|
+
|
|
26
25
|
const createTarget = (node, _ref) => {
|
|
27
26
|
let {
|
|
28
27
|
onToggle,
|
|
29
28
|
targetRef
|
|
30
29
|
} = _ref;
|
|
31
|
-
if (
|
|
30
|
+
if (!( /*#__PURE__*/(0, _react.isValidElement)(node) && node.type !== _Translate.default)) {
|
|
32
31
|
node = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
33
32
|
caret: true,
|
|
34
33
|
children: node
|
|
@@ -209,43 +208,6 @@ const Dropdown = _ref3 => {
|
|
|
209
208
|
})
|
|
210
209
|
});
|
|
211
210
|
};
|
|
212
|
-
Dropdown.propTypes = {
|
|
213
|
-
/**
|
|
214
|
-
* Dropdown [menu](#!/Menu).
|
|
215
|
-
* @since 0.0.57
|
|
216
|
-
*/
|
|
217
|
-
menu: _propTypes.default.element.isRequired,
|
|
218
|
-
/**
|
|
219
|
-
* Menu placement.
|
|
220
|
-
* @since 0.0.60
|
|
221
|
-
*/
|
|
222
|
-
menuPlacement: _propTypes.default.string,
|
|
223
|
-
/**
|
|
224
|
-
* Content of the `Dropdown`.
|
|
225
|
-
* @since 0.0.57
|
|
226
|
-
*/
|
|
227
|
-
children: _propTypes.default.node,
|
|
228
|
-
/**
|
|
229
|
-
* Custom localization messages.
|
|
230
|
-
* @since 3.6.0
|
|
231
|
-
*/
|
|
232
|
-
locale: _propTypes.default.shape({
|
|
233
|
-
close: _propTypes.default.node
|
|
234
|
-
}),
|
|
235
|
-
/**
|
|
236
|
-
* Display menu as overlay.
|
|
237
|
-
* @ignore
|
|
238
|
-
*/
|
|
239
|
-
overlay: _propTypes.default.bool,
|
|
240
|
-
/**
|
|
241
|
-
* @ignore
|
|
242
|
-
*/
|
|
243
|
-
className: _propTypes.default.string,
|
|
244
|
-
/**
|
|
245
|
-
* @ignore
|
|
246
|
-
*/
|
|
247
|
-
baseClassName: _propTypes.default.string
|
|
248
|
-
};
|
|
249
211
|
Dropdown.defaultProps = {
|
|
250
212
|
menuPlacement: 'bottom-start',
|
|
251
213
|
children: undefined,
|
|
@@ -407,7 +407,8 @@ const RefForwardingForm = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
407
407
|
const innerRef = (0, _react.useRef)(null);
|
|
408
408
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
409
409
|
submit() {
|
|
410
|
-
|
|
410
|
+
var _innerRef$current;
|
|
411
|
+
(_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.dispatchEvent(new Event('submit', {
|
|
411
412
|
cancelable: true,
|
|
412
413
|
bubbles: true
|
|
413
414
|
}));
|