@plesk/ui-library 3.45.1 → 3.46.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/FormFieldPassword/PasswordMeter.js +8 -2
- package/cjs/components/FormFieldPassword/index.js +8 -1
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +2 -3
- package/cjs/components/Layout/Layout.js +66 -9
- package/cjs/components/Markdown/Markdown.js +2 -1
- package/cjs/index.js +1 -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 +87 -17
- 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/FormFieldPassword/PasswordMeter.js +6 -1
- package/esm/components/FormFieldPassword/index.js +2 -1
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +2 -3
- package/esm/components/Layout/Layout.js +66 -9
- package/esm/components/Markdown/Markdown.js +2 -1
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/styleguide/build/bundle.19f0a6f2.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/components/FormFieldPassword/PasswordMeter.d.ts +3 -1
- package/types/components/FormFieldPassword/index.d.ts +1 -0
- package/types/components/Layout/Layout.d.ts +10 -0
- package/types/components/Markdown/Markdown.d.ts +7 -1
- package/styleguide/build/bundle.a9dbfec3.js +0 -2
- /package/styleguide/build/{bundle.a9dbfec3.js.LICENSE.txt → bundle.19f0a6f2.js.LICENSE.txt} +0 -0
|
@@ -5,6 +5,10 @@ import Popover from '../Popover';
|
|
|
5
5
|
import { InternalTranslate } from '../Translate';
|
|
6
6
|
import estimatePassword, { DEFAULT_RULES } from './estimatePassword';
|
|
7
7
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
let defaultEstimateFunction = null;
|
|
9
|
+
export const setDefaultPasswordEstimateFunction = fn => {
|
|
10
|
+
defaultEstimateFunction = fn;
|
|
11
|
+
};
|
|
8
12
|
const strengthIntents = {
|
|
9
13
|
VeryWeak: 'danger',
|
|
10
14
|
Weak: 'danger',
|
|
@@ -24,7 +28,8 @@ const PasswordMeter = ({
|
|
|
24
28
|
if (!visible) {
|
|
25
29
|
return;
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
const estimateFunction = onEstimate ?? defaultEstimateFunction;
|
|
32
|
+
Promise.resolve(estimateFunction ? estimateFunction(value, estimatePassword, DEFAULT_RULES) : estimatePassword(value)).then(result => {
|
|
28
33
|
setResult(result);
|
|
29
34
|
});
|
|
30
35
|
}, [visible, value, onEstimate]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
3
|
export { default } from './FormFieldPassword';
|
|
4
|
-
export { default as generatePassword } from './generatePassword';
|
|
4
|
+
export { default as generatePassword } from './generatePassword';
|
|
5
|
+
export { setDefaultPasswordEstimateFunction } from './PasswordMeter';
|
|
@@ -16,7 +16,6 @@ const FormFieldRadioButtons = ({
|
|
|
16
16
|
className,
|
|
17
17
|
options,
|
|
18
18
|
autoFocus,
|
|
19
|
-
label,
|
|
20
19
|
...props
|
|
21
20
|
}) => /*#__PURE__*/_jsx(FormField, {
|
|
22
21
|
className: classNames(baseClassName, className),
|
|
@@ -33,9 +32,9 @@ const FormFieldRadioButtons = ({
|
|
|
33
32
|
"aria-invalid": !!Object.keys(getErrors() ?? {}).length,
|
|
34
33
|
"aria-describedby": getDescriptionLabelId(),
|
|
35
34
|
className: `${baseClassName}__fieldset`,
|
|
36
|
-
children: [label && /*#__PURE__*/_jsx("legend", {
|
|
35
|
+
children: [props.label && /*#__PURE__*/_jsx("legend", {
|
|
37
36
|
className: `${baseClassName}__legend`,
|
|
38
|
-
children: label
|
|
37
|
+
children: props.label
|
|
39
38
|
}), options.map(({
|
|
40
39
|
value,
|
|
41
40
|
label,
|
|
@@ -7,6 +7,7 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { CSSTransition } from 'react-transition-group';
|
|
8
8
|
import { useInternalTranslate } from '../LocaleProvider';
|
|
9
9
|
import { CLS_PREFIX } from '../../constants';
|
|
10
|
+
import { disableDocumentScroll, enableDocumentScroll } from '../../utils';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const subscribeMatchMedia = (query, handler) => {
|
|
12
13
|
const mq = window.matchMedia(query);
|
|
@@ -121,6 +122,17 @@ class Layout extends Component {
|
|
|
121
122
|
this.unsubscribeMatchMedia = subscribeMatchMedia('(max-width: 1022px)', this.handleMatchMedia);
|
|
122
123
|
this.unsubscribeClickOutside = subscribeClickOutside([this.sidebarRef, this.responsiveSidebarTogglerRef], this.handleClickOutside);
|
|
123
124
|
}
|
|
125
|
+
componentDidUpdate(prevProps) {
|
|
126
|
+
const isRightSidebarOpen = this.props.rightSidebar && this.props.rightSidebarVisible;
|
|
127
|
+
const wasRightSidebarOpen = prevProps.rightSidebar && prevProps.rightSidebarVisible;
|
|
128
|
+
const isMobile = window.matchMedia('(max-width: 780px)').matches;
|
|
129
|
+
if (!wasRightSidebarOpen && isRightSidebarOpen && isMobile) {
|
|
130
|
+
disableDocumentScroll();
|
|
131
|
+
}
|
|
132
|
+
if (wasRightSidebarOpen && !isRightSidebarOpen) {
|
|
133
|
+
enableDocumentScroll();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
124
136
|
componentWillUnmount() {
|
|
125
137
|
this.unsubscribeMatchMedia?.();
|
|
126
138
|
this.unsubscribeClickOutside?.();
|
|
@@ -279,6 +291,42 @@ class Layout extends Component {
|
|
|
279
291
|
})
|
|
280
292
|
});
|
|
281
293
|
}
|
|
294
|
+
renderRightSidebar({
|
|
295
|
+
rightSidebar,
|
|
296
|
+
rightSidebarVisible
|
|
297
|
+
}) {
|
|
298
|
+
if (!rightSidebar) {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
const {
|
|
302
|
+
baseClassName
|
|
303
|
+
} = this.props;
|
|
304
|
+
return /*#__PURE__*/_jsx(CSSTransition, {
|
|
305
|
+
in: !rightSidebarVisible,
|
|
306
|
+
timeout: 300,
|
|
307
|
+
classNames: {
|
|
308
|
+
enter: `${baseClassName}__right-sidebar--enter`,
|
|
309
|
+
enterActive: `${baseClassName}__right-sidebar--active-enter`,
|
|
310
|
+
enterDone: `${baseClassName}__right-sidebar--on`,
|
|
311
|
+
exit: `${baseClassName}__right-sidebar--exit`,
|
|
312
|
+
exitActive: `${baseClassName}__right-sidebar--active-exit`,
|
|
313
|
+
exitDone: `${baseClassName}__right-sidebar--off`
|
|
314
|
+
},
|
|
315
|
+
children: /*#__PURE__*/_jsx("aside", {
|
|
316
|
+
className: `${baseClassName}__right-sidebar`,
|
|
317
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
318
|
+
className: `${baseClassName}__right-sidebar-inner`,
|
|
319
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
320
|
+
className: `${baseClassName}__right-sidebar-content`,
|
|
321
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
322
|
+
className: `${baseClassName}__right-sidebar-content-inner`,
|
|
323
|
+
children: rightSidebar
|
|
324
|
+
})
|
|
325
|
+
})
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
});
|
|
329
|
+
}
|
|
282
330
|
renderMainContent({
|
|
283
331
|
children
|
|
284
332
|
}) {
|
|
@@ -323,6 +371,8 @@ class Layout extends Component {
|
|
|
323
371
|
sidebarType,
|
|
324
372
|
sidebarCollapsible,
|
|
325
373
|
sidebarCollapsed,
|
|
374
|
+
rightSidebar,
|
|
375
|
+
rightSidebarVisible,
|
|
326
376
|
translate,
|
|
327
377
|
onSidebarToggle,
|
|
328
378
|
contentAddon,
|
|
@@ -350,6 +400,7 @@ class Layout extends Component {
|
|
|
350
400
|
[`${baseClassName}--sidebar`]: sidebar,
|
|
351
401
|
[`${baseClassName}--sidebar-type-${sidebarType}`]: sidebarType && sidebar,
|
|
352
402
|
[`${baseClassName}--sidebar-collapsed`]: sidebarType === 'collapsed' && isSidebarClosed,
|
|
403
|
+
[`${baseClassName}--right-sidebar-collapsed`]: !rightSidebar || !rightSidebarVisible,
|
|
353
404
|
[`${baseClassName}--sidebar-folded`]: sidebarType === 'folded' && isSidebarClosed
|
|
354
405
|
}, className),
|
|
355
406
|
...props,
|
|
@@ -362,15 +413,21 @@ class Layout extends Component {
|
|
|
362
413
|
children: [this.renderSidebar({
|
|
363
414
|
sidebar
|
|
364
415
|
}), /*#__PURE__*/_jsxs("div", {
|
|
365
|
-
className: `${baseClassName}__content`,
|
|
366
|
-
children: [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
416
|
+
className: `${baseClassName}__content-wrapper`,
|
|
417
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
418
|
+
className: `${baseClassName}__content`,
|
|
419
|
+
children: [this.renderContentAddon({
|
|
420
|
+
contentAddon
|
|
421
|
+
}), this.renderContentHeader({
|
|
422
|
+
contentHeader
|
|
423
|
+
}), this.renderMainContent({
|
|
424
|
+
children
|
|
425
|
+
}), this.renderFooter({
|
|
426
|
+
footer
|
|
427
|
+
})]
|
|
428
|
+
}), this.renderRightSidebar({
|
|
429
|
+
rightSidebar,
|
|
430
|
+
rightSidebarVisible
|
|
374
431
|
})]
|
|
375
432
|
})]
|
|
376
433
|
})]
|
|
@@ -15,13 +15,14 @@ const Markdown = ({
|
|
|
15
15
|
className,
|
|
16
16
|
compact = false,
|
|
17
17
|
children,
|
|
18
|
+
parserOptions,
|
|
18
19
|
...props
|
|
19
20
|
}) => /*#__PURE__*/_jsx("div", {
|
|
20
21
|
className: classNames(baseClassName, {
|
|
21
22
|
[`${baseClassName}--compact`]: compact
|
|
22
23
|
}, className),
|
|
23
24
|
dangerouslySetInnerHTML: {
|
|
24
|
-
__html: marked(children)
|
|
25
|
+
__html: marked(children, parserOptions)
|
|
25
26
|
},
|
|
26
27
|
...props
|
|
27
28
|
});
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.46.1",
|
|
4
4
|
"description": "Plesk UI Library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"stylelint-use-logical-spec": "^5.0.1",
|
|
127
127
|
"svg-mixer": "^2.3.14",
|
|
128
128
|
"terser-webpack-plugin": "^5.3.14",
|
|
129
|
-
"typescript": "5.9.
|
|
129
|
+
"typescript": "5.9.3",
|
|
130
130
|
"typescript-eslint": "^8.35.0",
|
|
131
131
|
"webpack": "^5.99.9",
|
|
132
132
|
"webpack-cli": "^6.0.1"
|