@plesk/ui-library 3.27.0 → 3.27.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/Drawer/DrawerProgress.js +15 -1
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +39 -5
- package/cjs/components/FormFieldPassword/passwordScore.js +3 -2
- package/cjs/components/Icon/Icon.js +1 -1
- package/cjs/components/Rating/images/rating.svg +5 -5
- package/cjs/index.js +1 -1
- package/dist/images/rating.svg +5 -5
- 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 +60 -10
- 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/Drawer/DrawerProgress.js +16 -2
- package/esm/components/FormFieldPassword/FormFieldPassword.js +40 -5
- package/esm/components/FormFieldPassword/passwordScore.js +3 -2
- package/esm/components/Icon/Icon.js +1 -1
- package/esm/components/Rating/images/rating.svg +5 -5
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/styleguide/build/bundle.aabb094f.js +2 -0
- package/styleguide/build/{bundle.ff1f903a.js.LICENSE.txt → bundle.aabb094f.js.LICENSE.txt} +0 -0
- package/styleguide/images/rating.svg +5 -5
- package/styleguide/index.html +2 -2
- package/styleguide/build/bundle.ff1f903a.js +0 -2
|
@@ -30,6 +30,20 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
30
30
|
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; }
|
|
31
31
|
|
|
32
32
|
// Copyright 1999-2019. Plesk International GmbH. All rights reserved.
|
|
33
|
+
const renderAdditionalButtons = buttons => {
|
|
34
|
+
const buttonProcessing = button => {
|
|
35
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(button) && button.type === _Button.default) {
|
|
36
|
+
return /*#__PURE__*/(0, _react.cloneElement)(button, {
|
|
37
|
+
size: 'lg'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return button;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return Array.isArray(buttons) ? buttons.map(buttonProcessing) : buttonProcessing(buttons);
|
|
45
|
+
};
|
|
46
|
+
|
|
33
47
|
class DrawerProgress extends _react.Component {
|
|
34
48
|
constructor(...args) {
|
|
35
49
|
super(...args);
|
|
@@ -143,7 +157,7 @@ class DrawerProgress extends _react.Component {
|
|
|
143
157
|
|
|
144
158
|
const footer = hasFooter ? /*#__PURE__*/_react.default.createElement("div", {
|
|
145
159
|
className: `${baseClassName}__footer`
|
|
146
|
-
}, buttons, canCancel && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
160
|
+
}, renderAdditionalButtons(buttons), canCancel && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
147
161
|
onClick: this.handleCancel,
|
|
148
162
|
size: "lg"
|
|
149
163
|
}, /*#__PURE__*/_react.default.createElement(_Translate.default, {
|
|
@@ -62,8 +62,15 @@ class FormFieldPassword extends _react.Component {
|
|
|
62
62
|
super(...args);
|
|
63
63
|
(0, _defineProperty2.default)(this, "state", {
|
|
64
64
|
visible: false,
|
|
65
|
-
passwordMeterVisible: false
|
|
65
|
+
passwordMeterVisible: false,
|
|
66
|
+
scoreResult: {
|
|
67
|
+
password: null,
|
|
68
|
+
intent: null,
|
|
69
|
+
strength: null,
|
|
70
|
+
unusedRules: []
|
|
71
|
+
}
|
|
66
72
|
});
|
|
73
|
+
(0, _defineProperty2.default)(this, "passwordOnScoring", null);
|
|
67
74
|
(0, _defineProperty2.default)(this, "targetRef", /*#__PURE__*/(0, _react.createRef)());
|
|
68
75
|
(0, _defineProperty2.default)(this, "handleToggleClick", () => {
|
|
69
76
|
this.setState(({
|
|
@@ -80,9 +87,10 @@ class FormFieldPassword extends _react.Component {
|
|
|
80
87
|
(0, _defineProperty2.default)(this, "handleBlur", this.handleClosePasswordMeter);
|
|
81
88
|
}
|
|
82
89
|
|
|
83
|
-
passwordScore(value) {
|
|
90
|
+
async passwordScore(value) {
|
|
84
91
|
if (!value) {
|
|
85
92
|
return {
|
|
93
|
+
password: null,
|
|
86
94
|
intent: null,
|
|
87
95
|
strength: null,
|
|
88
96
|
unusedRules: []
|
|
@@ -90,12 +98,15 @@ class FormFieldPassword extends _react.Component {
|
|
|
90
98
|
}
|
|
91
99
|
|
|
92
100
|
const {
|
|
93
|
-
passwordScoreRules
|
|
101
|
+
passwordScoreRules,
|
|
102
|
+
customPasswordScore
|
|
94
103
|
} = this.props;
|
|
104
|
+
const passwordScoreFunc = customPasswordScore || _passwordScore.default;
|
|
95
105
|
const {
|
|
106
|
+
password,
|
|
96
107
|
score,
|
|
97
108
|
unusedRules
|
|
98
|
-
} =
|
|
109
|
+
} = await passwordScoreFunc(value, passwordScoreRules);
|
|
99
110
|
let intent = 'success';
|
|
100
111
|
|
|
101
112
|
let strength = /*#__PURE__*/_react.default.createElement(_Translate.default, {
|
|
@@ -130,6 +141,7 @@ class FormFieldPassword extends _react.Component {
|
|
|
130
141
|
}
|
|
131
142
|
|
|
132
143
|
return {
|
|
144
|
+
password,
|
|
133
145
|
intent,
|
|
134
146
|
strength,
|
|
135
147
|
unusedRules
|
|
@@ -144,10 +156,24 @@ class FormFieldPassword extends _react.Component {
|
|
|
144
156
|
passwordMeterProps
|
|
145
157
|
} = this.props;
|
|
146
158
|
const {
|
|
159
|
+
password,
|
|
147
160
|
intent,
|
|
148
161
|
strength,
|
|
149
162
|
unusedRules
|
|
150
|
-
} = this.
|
|
163
|
+
} = this.state.scoreResult;
|
|
164
|
+
|
|
165
|
+
if (!!value && value !== password && value !== this.passwordOnScoring) {
|
|
166
|
+
this.passwordOnScoring = value;
|
|
167
|
+
this.passwordScore(value).then(scoreResult => {
|
|
168
|
+
if (this.passwordOnScoring === scoreResult.password) {
|
|
169
|
+
this.passwordOnScoring = null;
|
|
170
|
+
this.setState({
|
|
171
|
+
scoreResult
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
151
177
|
return /*#__PURE__*/_react.default.createElement(_Popover.default, (0, _extends2.default)({
|
|
152
178
|
visible: passwordMeterVisible && !!value,
|
|
153
179
|
target: target,
|
|
@@ -234,6 +260,7 @@ class FormFieldPassword extends _react.Component {
|
|
|
234
260
|
hidePasswordMeter,
|
|
235
261
|
passwordMeterProps,
|
|
236
262
|
passwordScoreRules,
|
|
263
|
+
customPasswordScore,
|
|
237
264
|
size,
|
|
238
265
|
autoFocus,
|
|
239
266
|
autoComplete,
|
|
@@ -333,6 +360,12 @@ FormFieldPassword.propTypes = {
|
|
|
333
360
|
score: _propTypes.default.func.isRequired
|
|
334
361
|
})),
|
|
335
362
|
|
|
363
|
+
/**
|
|
364
|
+
* Custom password score estimator
|
|
365
|
+
* @since 3.27.1
|
|
366
|
+
*/
|
|
367
|
+
customPasswordScore: _propTypes.default.func,
|
|
368
|
+
|
|
336
369
|
/**
|
|
337
370
|
* Size of the control
|
|
338
371
|
* @since 1.5.6
|
|
@@ -374,6 +407,7 @@ FormFieldPassword.defaultProps = {
|
|
|
374
407
|
hidePasswordMeter: false,
|
|
375
408
|
passwordMeterProps: {},
|
|
376
409
|
passwordScoreRules: undefined,
|
|
410
|
+
customPasswordScore: undefined,
|
|
377
411
|
size: 'md',
|
|
378
412
|
autoFocus: undefined,
|
|
379
413
|
autoComplete: undefined,
|
|
@@ -126,7 +126,7 @@ const Icon = ({
|
|
|
126
126
|
}, props), newName ? /*#__PURE__*/_react.default.createElement("svg", {
|
|
127
127
|
focusable: "false"
|
|
128
128
|
}, /*#__PURE__*/_react.default.createElement("use", {
|
|
129
|
-
|
|
129
|
+
href: getHref(newName, newSize)
|
|
130
130
|
})) : src && /*#__PURE__*/_react.default.createElement("img", {
|
|
131
131
|
src: src,
|
|
132
132
|
alt: alt
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="56" height="248" viewBox="0 0 51 248">
|
|
2
2
|
<defs><symbol id="star"><path stroke-width="3" d="m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z"></path></symbol></defs>
|
|
3
|
-
<use x="0" y="0" fill="none" stroke="#ff9500"
|
|
4
|
-
<use x="0" y="100" fill="#ff9500" stroke="#ff9500"
|
|
5
|
-
<use x="0" y="200" fill="#848484" stroke="#848484"
|
|
6
|
-
</svg>
|
|
3
|
+
<use x="0" y="0" fill="none" stroke="#ff9500" href="#star"></use>
|
|
4
|
+
<use x="0" y="100" fill="#ff9500" stroke="#ff9500" href="#star"></use>
|
|
5
|
+
<use x="0" y="200" fill="#848484" stroke="#848484" href="#star"></use>
|
|
6
|
+
</svg>
|
package/cjs/index.js
CHANGED
package/dist/images/rating.svg
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
|
|
1
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="56" height="248" viewBox="0 0 51 248">
|
|
2
2
|
<defs><symbol id="star"><path stroke-width="3" d="m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z"></path></symbol></defs>
|
|
3
|
-
<use x="0" y="0" fill="none" stroke="#ff9500"
|
|
4
|
-
<use x="0" y="100" fill="#ff9500" stroke="#ff9500"
|
|
5
|
-
<use x="0" y="200" fill="#848484" stroke="#848484"
|
|
6
|
-
</svg>
|
|
3
|
+
<use x="0" y="0" fill="none" stroke="#ff9500" href="#star"></use>
|
|
4
|
+
<use x="0" y="100" fill="#ff9500" stroke="#ff9500" href="#star"></use>
|
|
5
|
+
<use x="0" y="200" fill="#848484" stroke="#848484" href="#star"></use>
|
|
6
|
+
</svg>
|