@plesk/ui-library 3.27.2 → 3.28.0
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/Dialog/Dialog.js +11 -2
- package/cjs/components/Form/Form.js +4 -2
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +25 -239
- package/cjs/components/FormFieldPassword/PasswordMeter.js +81 -0
- package/cjs/components/FormFieldPassword/estimatePassword.js +212 -0
- package/cjs/components/FormFieldPassword/generatePassword.js +21 -0
- package/cjs/components/FormFieldPassword/index.js +5 -5
- package/cjs/components/Icon/constants.js +2 -2
- package/cjs/components/Icon/images/symbols.svg +9 -1
- package/cjs/components/ProgressDialog/ProgressDialog.js +2 -1
- package/cjs/components/Skeleton/Skeleton.js +49 -0
- package/cjs/components/Skeleton/Skeleton.stories.js +26 -0
- package/cjs/components/Skeleton/SkeletonTabs.js +41 -0
- package/cjs/components/Skeleton/SkeletonTabs.stories.js +17 -0
- package/cjs/components/Skeleton/SkeletonText.js +45 -0
- package/cjs/components/Skeleton/SkeletonText.stories.js +35 -0
- package/cjs/components/Skeleton/index.js +31 -0
- package/cjs/components/index.js +22 -1
- package/cjs/components/utils.js +6 -2
- package/cjs/index.js +1 -1
- package/dist/images/symbols.svg +9 -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 +607 -339
- 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/Dialog/Dialog.js +11 -2
- package/esm/components/Form/Form.js +4 -2
- package/esm/components/FormFieldPassword/FormFieldPassword.js +23 -232
- package/esm/components/FormFieldPassword/PasswordMeter.js +61 -0
- package/esm/components/FormFieldPassword/estimatePassword.js +196 -0
- package/esm/components/FormFieldPassword/generatePassword.js +14 -0
- package/esm/components/FormFieldPassword/index.js +3 -2
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +9 -1
- package/esm/components/ProgressDialog/ProgressDialog.js +2 -1
- package/esm/components/Skeleton/Skeleton.js +34 -0
- package/esm/components/Skeleton/Skeleton.stories.js +10 -0
- package/esm/components/Skeleton/SkeletonTabs.js +26 -0
- package/esm/components/Skeleton/SkeletonTabs.stories.js +4 -0
- package/esm/components/Skeleton/SkeletonText.js +30 -0
- package/esm/components/Skeleton/SkeletonText.stories.js +16 -0
- package/esm/components/Skeleton/index.js +4 -0
- package/esm/components/index.js +3 -1
- package/esm/components/utils.js +2 -1
- package/esm/index.js +1 -1
- package/package.json +3 -3
- package/styleguide/build/bundle.24d5b0eb.js +2 -0
- package/styleguide/build/{bundle.1c9c8500.js.LICENSE.txt → bundle.24d5b0eb.js.LICENSE.txt} +0 -0
- package/styleguide/images/symbols.svg +9 -1
- package/styleguide/index.html +2 -2
- package/types/src/components/FormFieldPassword/FormFieldPassword.d.ts +91 -0
- package/types/src/components/FormFieldPassword/PasswordMeter.d.ts +9 -0
- package/types/src/components/FormFieldPassword/estimatePassword.d.ts +13 -0
- package/types/src/components/FormFieldPassword/index.d.ts +2 -0
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/Skeleton/Skeleton.d.ts +49 -0
- package/types/src/components/Skeleton/Skeleton.stories.d.ts +12 -0
- package/types/src/components/Skeleton/SkeletonTabs.d.ts +23 -0
- package/types/src/components/Skeleton/SkeletonTabs.stories.d.ts +6 -0
- package/types/src/components/Skeleton/SkeletonText.d.ts +34 -0
- package/types/src/components/Skeleton/SkeletonText.stories.d.ts +38 -0
- package/types/src/components/Skeleton/index.d.ts +3 -0
- package/types/src/components/index.d.ts +2 -0
- package/types/src/components/utils.d.ts +1 -0
- package/cjs/components/FormFieldPassword/passwordScore.js +0 -132
- package/esm/components/FormFieldPassword/passwordScore.js +0 -123
- package/styleguide/build/bundle.1c9c8500.js +0 -2
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="16" height="
|
|
1
|
+
<svg width="16" height="11088" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
2
|
<defs>
|
|
3
3
|
<symbol viewBox="0 0 12 12" id="archive:12">
|
|
4
4
|
<path d="M2 1h7v.5a.5.5 0 0 0 1 0V1a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-.5a.5.5 0 0 0-1 0v.5H2V1z" />
|
|
@@ -1391,6 +1391,14 @@
|
|
|
1391
1391
|
<symbol viewBox="0 0 16 16" id="send:16">
|
|
1392
1392
|
<path fill-rule="evenodd" d="M15.63 1.174a.5.5 0 0 1 .067.55l-6.5 13a.5.5 0 0 1-.827.101l-1.5-1.75-.005-.006L5.646 11.6a.5.5 0 0 1-.061-.544l1.304-2.587-3.016.975a.5.5 0 0 1-.474-.09l-1.468-1.22-.006-.005-1.75-1.5a.5.5 0 0 1 .172-.855l14.75-4.75a.5.5 0 0 1 .532.15zM1.503 6.452l1.068.916 1.254 1.04L7.721 7.15a.5.5 0 0 1 .6.7l-1.696 3.365 1.007 1.213 1.008 1.176L14.27 2.34 1.505 6.452z" clip-rule="evenodd" />
|
|
1393
1393
|
</symbol>
|
|
1394
|
+
<symbol viewBox="0 0 12 12" id="server:12">
|
|
1395
|
+
<path d="M2.5 2a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1h-1ZM5 2.5c0-.28.22-.5.5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5ZM2.5 6a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1h-1ZM5 6.5c0-.28.22-.5.5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5Z" />
|
|
1396
|
+
<path fill-rule="evenodd" d="M0 3a2 2 0 0 0 .68 1.5A2 2 0 0 0 0 6v1c0 1.1.9 2 2 2h3.5v.09a1.5 1.5 0 0 0-.91.91H.5a.5.5 0 1 0 0 1h4.09a1.5 1.5 0 0 0 2.82 0h4.09a.5.5 0 0 0 0-1H7.41a1.5 1.5 0 0 0-.91-.91V9H10a2 2 0 0 0 2-2V6a2 2 0 0 0-.68-1.5A2 2 0 0 0 12 3V2a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v1Zm10-2H2a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1Zm0 7a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h8Zm-4 3a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z" clip-rule="evenodd" />
|
|
1397
|
+
</symbol>
|
|
1398
|
+
<symbol viewBox="0 0 16 16" id="server:16">
|
|
1399
|
+
<path d="M3 7a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM5 8a1 1 0 1 1 2 0 1 1 0 0 1-2 0ZM9 7a1 1 0 0 0 0 2h4a1 1 0 1 0 0-2H9ZM3 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM6 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM8 3a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H9a1 1 0 0 1-1-1Z" />
|
|
1400
|
+
<path fill-rule="evenodd" d="M0 4a2 2 0 0 0 .68 1.5A2 2 0 0 0 0 7v2c0 1.1.9 2 2 2h5.5v1.09a1.5 1.5 0 0 0-.91.91H.5a.5.5 0 1 0 0 1h6.09a1.5 1.5 0 0 0 2.82 0h6.09a.5.5 0 0 0 0-1H9.41a1.5 1.5 0 0 0-.91-.91V11H14a2 2 0 0 0 2-2V7a2 2 0 0 0-.68-1.5A2 2 0 0 0 16 4V2a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v2Zm14 6a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h12Zm0-9H2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1ZM8.5 13.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z" clip-rule="evenodd" />
|
|
1401
|
+
</symbol>
|
|
1394
1402
|
<symbol viewBox="0 0 12 12" id="servers:12">
|
|
1395
1403
|
<path d="M8 6.5a.5.5 0 01.5-.5h3a.5.5 0 010 1h-3a.5.5 0 01-.5-.5zM0 1.5a.5.5 0 011 0v2a.5.5 0 01-1 0v-2zM2.5 1a.5.5 0 00-.5.5v2a.5.5 0 001 0v-2a.5.5 0 00-.5-.5zM8.5 2a.5.5 0 000 1H9v1a1 1 0 001 1h1.5a.5.5 0 000-1H10V3a1 1 0 00-1-1h-.5zM9 9v1h-.5a.5.5 0 000 1H9a1 1 0 001-1V9h1.5a.5.5 0 000-1H10a1 1 0 00-1 1z" />
|
|
1396
1404
|
<path fill-rule="evenodd" d="M4 2a1 1 0 011-1h1a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1V2zm1 0h1v1H5V2z" clip-rule="evenodd" />
|
package/styleguide/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
7
|
-
<title>Plesk UI Library 3.
|
|
7
|
+
<title>Plesk UI Library 3.28.0</title>
|
|
8
8
|
<meta name="msapplication-TileColor" content="#da532c">
|
|
9
9
|
<meta name="theme-color" content="#ffffff">
|
|
10
10
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
</script>
|
|
41
41
|
<noscript><div><img src="https://mc.yandex.ru/watch/56446840" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
|
42
42
|
<!-- /Yandex.Metrika counter -->
|
|
43
|
-
<script src="build/bundle.
|
|
43
|
+
<script src="build/bundle.24d5b0eb.js"></script>
|
|
44
44
|
</body>
|
|
45
45
|
</html>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Component, ComponentProps, ReactElement, RefObject } from 'react';
|
|
2
|
+
import Button from '../Button';
|
|
3
|
+
import FormField from '../FormField';
|
|
4
|
+
import { PasswordMeterProps } from './PasswordMeter';
|
|
5
|
+
import './FormFieldPassword.less';
|
|
6
|
+
export declare type FormFieldPasswordProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Is show button hidden?
|
|
9
|
+
* @since 0.0.59
|
|
10
|
+
*/
|
|
11
|
+
hideShowButton?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Is generate button hidden?
|
|
14
|
+
* @since 0.0.59
|
|
15
|
+
*/
|
|
16
|
+
hideGenerateButton?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Is password meter hidden?
|
|
19
|
+
* @since 0.0.59
|
|
20
|
+
*/
|
|
21
|
+
hidePasswordMeter?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Additional props for password meter. See [Popover](#!/Popover) for more information.
|
|
24
|
+
* @since 1.5.6
|
|
25
|
+
*/
|
|
26
|
+
passwordMeterProps?: PasswordMeterProps;
|
|
27
|
+
/**
|
|
28
|
+
* Size of the control
|
|
29
|
+
* @since 1.5.6
|
|
30
|
+
*/
|
|
31
|
+
size: 'md' | 'lg' | 'xl' | 'fill';
|
|
32
|
+
/**
|
|
33
|
+
* The browser will automatically focus on the component upon rendering the screen
|
|
34
|
+
* @since 1.9.0
|
|
35
|
+
*/
|
|
36
|
+
autoFocus?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Prevent password autocompletion.
|
|
39
|
+
* @since 2.5.1
|
|
40
|
+
*/
|
|
41
|
+
autoComplete?: 'new-password';
|
|
42
|
+
/**
|
|
43
|
+
* A render function for customizing the password generation button.
|
|
44
|
+
* @since 3.13.0
|
|
45
|
+
*/
|
|
46
|
+
generateButton?: (generateButtonProps: ComponentProps<typeof Button>) => ReactElement;
|
|
47
|
+
/**
|
|
48
|
+
* @ignore
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
/**
|
|
52
|
+
* @ignore
|
|
53
|
+
*/
|
|
54
|
+
baseClassName?: string;
|
|
55
|
+
} & ComponentProps<typeof FormField>;
|
|
56
|
+
declare type FormFieldPasswordState = {
|
|
57
|
+
visible: boolean;
|
|
58
|
+
passwordMeterVisible: boolean;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* `FormFieldPassword` component provides secure way to enter a password.
|
|
62
|
+
* @since 0.0.58
|
|
63
|
+
*/
|
|
64
|
+
declare class FormFieldPassword extends Component<FormFieldPasswordProps, FormFieldPasswordState> {
|
|
65
|
+
static defaultProps: {
|
|
66
|
+
hideShowButton: boolean;
|
|
67
|
+
generateButton: undefined;
|
|
68
|
+
hideGenerateButton: boolean;
|
|
69
|
+
hidePasswordMeter: boolean;
|
|
70
|
+
passwordMeterProps: {};
|
|
71
|
+
size: string;
|
|
72
|
+
autoFocus: undefined;
|
|
73
|
+
autoComplete: undefined;
|
|
74
|
+
className: undefined;
|
|
75
|
+
baseClassName: string;
|
|
76
|
+
};
|
|
77
|
+
state: {
|
|
78
|
+
visible: boolean;
|
|
79
|
+
passwordMeterVisible: boolean;
|
|
80
|
+
};
|
|
81
|
+
targetRef: RefObject<HTMLSpanElement>;
|
|
82
|
+
handleToggleClick: () => void;
|
|
83
|
+
handleClosePasswordMeter: () => void;
|
|
84
|
+
handleBlur: () => void;
|
|
85
|
+
renderGenerateButton({ setValue, isDisabled, }: {
|
|
86
|
+
setValue: (value: any) => void;
|
|
87
|
+
isDisabled: () => boolean;
|
|
88
|
+
}): JSX.Element;
|
|
89
|
+
render(): JSX.Element;
|
|
90
|
+
}
|
|
91
|
+
export default FormFieldPassword;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps, FunctionComponent } from 'react';
|
|
2
|
+
import Popover from '../Popover';
|
|
3
|
+
import estimatePassword, { EstimateResult, EstimateRule } from './estimatePassword';
|
|
4
|
+
export declare type PasswordMeterProps = {
|
|
5
|
+
value: string;
|
|
6
|
+
onEstimate?: (password: string, defaultEstimateFn: typeof estimatePassword, defaultEstimateRules: EstimateRule[]) => EstimateResult;
|
|
7
|
+
} & ComponentProps<typeof Popover>;
|
|
8
|
+
declare const PasswordMeter: FunctionComponent<PasswordMeterProps>;
|
|
9
|
+
export default PasswordMeter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type EstimateRule = {
|
|
3
|
+
name: string;
|
|
4
|
+
suggestion?: ReactNode;
|
|
5
|
+
score: (password: string) => number;
|
|
6
|
+
};
|
|
7
|
+
export declare type EstimateResult = {
|
|
8
|
+
strength: 'VeryWeak' | 'Weak' | 'Medium' | 'Strong' | 'VeryStrong';
|
|
9
|
+
suggestions: ReactNode[];
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULT_RULES: EstimateRule[];
|
|
12
|
+
declare const _default: (password: string, rules?: EstimateRule[]) => EstimateResult;
|
|
13
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const NAMES_12: IconName[];
|
|
2
|
-
export declare type IconName = 'archive' | 'arrow-back' | 'arrow-diagonal-out' | 'arrow-down' | 'arrow-down-in' | 'arrow-down-out' | 'arrow-down-tray' | 'arrow-left' | 'arrow-right' | 'arrow-right-in' | 'arrow-right-out' | 'arrow-up' | 'arrow-up-circle' | 'arrow-up-in' | 'arrow-up-in-cloud' | 'arrow-up-out' | 'arrow-up-tray' | 'arrows-four-directions' | 'arrows-inward' | 'arrows-loop' | 'arrows-opposite' | 'arrows-outward' | 'backup' | 'backup2' | 'bar-chart-vertical' | 'bar-chart-vertical-arrow-up' | 'bell' | 'book-email' | 'boundary' | 'box-diagonal-bottom-in' | 'box-diagonal-top-in' | 'brush' | 'bug' | 'calendar' | 'calendar-clock' | 'camera' | 'card' | 'card-ribbon' | 'card-row' | 'card-tile' | 'cd' | 'cd-up-in-cloud' | 'chain' | 'chain-broken' | 'chat' | 'check-list' | 'check-mark' | 'check-mark-circle' | 'check-mark-circle-filled' | 'chevron-double-down' | 'chevron-double-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-diagonal' | 'clean' | 'clip' | 'clock' | 'clone' | 'cloud' | 'cloud-checkmark' | 'cloud-crossed' | 'cloud-graph' | 'code' | 'connection' | 'console' | 'console-filled' | 'copy' | 'copy-indicator' | 'cpu' | 'crane' | 'credit-cards' | 'cross-mark' | 'cross-mark-circle' | 'cross-mark-circle-filled' | 'crown-transfer' | 'dashboard' | 'database' | 'database-box' | 'database-plus' | 'deploy' | 'docker-filled' | 'dollar' | 'dollar-filled' | 'dot' | 'emoticon-confused' | 'emoticon-dead' | 'emoticon-excited' | 'emoticon-happy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'enter' | 'exclamation-mark-circle' | 'exclamation-mark-circle-filled' | 'eye' | 'eye-closed' | 'facebook' | 'facebook-filled' | 'feedback' | 'filter' | 'filter-check-mark' | 'fire' | 'flag-globe' | 'floppy-disk' | 'folder-closed' | 'folder-key' | 'folder-network' | 'folder-open' | 'folders-tree' | 'four-squares' | 'gear' | 'git' | 'github' | 'globe' | 'hard-drive' | 'hard-drive-key' | 'hat' | 'hexagons' | 'home' | 'info-circle' | 'info-circle-filled' | 'ip-addresses' | 'kebab' | 'key' | 'lifebuoy' | 'lightbulb' | 'limit' | 'linux' | 'list' | 'list-check-mark' | 'location' | 'lock-closed' | 'lock-closed-check' | 'lock-closed-filled' | 'lock-open' | 'lock-open-cross' | 'lock-open-filled' | 'mail' | 'mail-settings' | 'megaphone' | 'menu' | 'menu-thin' | 'microsoft' | 'minimize' | 'minus' | 'minus-circle' | 'minus-circle-filled' | 'monitoring' | 'monitoring-off' | 'my-little-admin' | 'net' | 'nine-dots' | 'node-js' | 'package' | 'panel' | 'panel-check' | 'panel-eye' | 'panel-key' | 'panel-settings' | 'panels' | 'pause-circle' | 'pencil' | 'pencil-dialog' | 'php' | 'phpmyadmin' | 'pin' | 'pipette' | 'plans' | 'plugins' | 'plus' | 'power' | 'projects' | 'puzzle' | 'question-mark-circle' | 'question-mark-circle-filled' | 'ram' | 'react-js' | 'recycle' | 'refresh' | 'reload' | 'remove' | 'reset' | 'resource' | 'ribbon' | 'rocket' | 'ruby' | 'sand-clock' | 'scan' | 'screen' | 'search' | 'security-check' | 'send' | 'servers' | 'share' | 'shield' | 'shield-chain' | 'shopping-cart' | 'sidebar-right-hide' | 'sidebar-right-show' | 'signal-light' | 'site-page' | 'sleep' | 'sliders' | 'square-with-circles' | 'star' | 'star-circle-filled' | 'star-filled' | 'star-half-filled' | 'start' | 'start-circle' | 'stop' | 'stop-circle' | 'storage' | 'themes' | 'three-dots-horizontal' | 'three-dots-vertical' | 'tools' | 'transfer' | 'triangle-exclamation-mark' | 'triangle-exclamation-mark-filled' | 'unarchive' | 'user' | 'volume' | 'web' | 'web-plus' | 'web-settings' | 'windows' | 'wordpress';
|
|
2
|
+
export declare type IconName = 'archive' | 'arrow-back' | 'arrow-diagonal-out' | 'arrow-down' | 'arrow-down-in' | 'arrow-down-out' | 'arrow-down-tray' | 'arrow-left' | 'arrow-right' | 'arrow-right-in' | 'arrow-right-out' | 'arrow-up' | 'arrow-up-circle' | 'arrow-up-in' | 'arrow-up-in-cloud' | 'arrow-up-out' | 'arrow-up-tray' | 'arrows-four-directions' | 'arrows-inward' | 'arrows-loop' | 'arrows-opposite' | 'arrows-outward' | 'backup' | 'backup2' | 'bar-chart-vertical' | 'bar-chart-vertical-arrow-up' | 'bell' | 'book-email' | 'boundary' | 'box-diagonal-bottom-in' | 'box-diagonal-top-in' | 'brush' | 'bug' | 'calendar' | 'calendar-clock' | 'camera' | 'card' | 'card-ribbon' | 'card-row' | 'card-tile' | 'cd' | 'cd-up-in-cloud' | 'chain' | 'chain-broken' | 'chat' | 'check-list' | 'check-mark' | 'check-mark-circle' | 'check-mark-circle-filled' | 'chevron-double-down' | 'chevron-double-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-diagonal' | 'clean' | 'clip' | 'clock' | 'clone' | 'cloud' | 'cloud-checkmark' | 'cloud-crossed' | 'cloud-graph' | 'code' | 'connection' | 'console' | 'console-filled' | 'copy' | 'copy-indicator' | 'cpu' | 'crane' | 'credit-cards' | 'cross-mark' | 'cross-mark-circle' | 'cross-mark-circle-filled' | 'crown-transfer' | 'dashboard' | 'database' | 'database-box' | 'database-plus' | 'deploy' | 'docker-filled' | 'dollar' | 'dollar-filled' | 'dot' | 'emoticon-confused' | 'emoticon-dead' | 'emoticon-excited' | 'emoticon-happy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'enter' | 'exclamation-mark-circle' | 'exclamation-mark-circle-filled' | 'eye' | 'eye-closed' | 'facebook' | 'facebook-filled' | 'feedback' | 'filter' | 'filter-check-mark' | 'fire' | 'flag-globe' | 'floppy-disk' | 'folder-closed' | 'folder-key' | 'folder-network' | 'folder-open' | 'folders-tree' | 'four-squares' | 'gear' | 'git' | 'github' | 'globe' | 'hard-drive' | 'hard-drive-key' | 'hat' | 'hexagons' | 'home' | 'info-circle' | 'info-circle-filled' | 'ip-addresses' | 'kebab' | 'key' | 'lifebuoy' | 'lightbulb' | 'limit' | 'linux' | 'list' | 'list-check-mark' | 'location' | 'lock-closed' | 'lock-closed-check' | 'lock-closed-filled' | 'lock-open' | 'lock-open-cross' | 'lock-open-filled' | 'mail' | 'mail-settings' | 'megaphone' | 'menu' | 'menu-thin' | 'microsoft' | 'minimize' | 'minus' | 'minus-circle' | 'minus-circle-filled' | 'monitoring' | 'monitoring-off' | 'my-little-admin' | 'net' | 'nine-dots' | 'node-js' | 'package' | 'panel' | 'panel-check' | 'panel-eye' | 'panel-key' | 'panel-settings' | 'panels' | 'pause-circle' | 'pencil' | 'pencil-dialog' | 'php' | 'phpmyadmin' | 'pin' | 'pipette' | 'plans' | 'plugins' | 'plus' | 'power' | 'projects' | 'puzzle' | 'question-mark-circle' | 'question-mark-circle-filled' | 'ram' | 'react-js' | 'recycle' | 'refresh' | 'reload' | 'remove' | 'reset' | 'resource' | 'ribbon' | 'rocket' | 'ruby' | 'sand-clock' | 'scan' | 'screen' | 'search' | 'security-check' | 'send' | 'server' | 'servers' | 'share' | 'shield' | 'shield-chain' | 'shopping-cart' | 'sidebar-right-hide' | 'sidebar-right-show' | 'signal-light' | 'site-page' | 'sleep' | 'sliders' | 'square-with-circles' | 'star' | 'star-circle-filled' | 'star-filled' | 'star-half-filled' | 'start' | 'start-circle' | 'stop' | 'stop-circle' | 'storage' | 'themes' | 'three-dots-horizontal' | 'three-dots-vertical' | 'tools' | 'transfer' | 'triangle-exclamation-mark' | 'triangle-exclamation-mark-filled' | 'unarchive' | 'user' | 'volume' | 'web' | 'web-plus' | 'web-settings' | 'windows' | 'wordpress';
|
|
3
3
|
export declare const NAMES: IconName[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComponentType, FC } from 'react';
|
|
2
|
+
import './Skeleton.less';
|
|
3
|
+
export declare type SkeletonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Skeleton width. For the width specified as a number, `'px'` is used as the unit.
|
|
6
|
+
* You can also specify a value with other units such as `'em'`, `'%'`, etc. (f.e. 20%, 10em)
|
|
7
|
+
* @since 3.28.0
|
|
8
|
+
*/
|
|
9
|
+
width?: number | string;
|
|
10
|
+
/**
|
|
11
|
+
* Skeleton max width. For the width specified as a number, `'px'` is used as the unit.
|
|
12
|
+
* You can also specify a value with other units such as `'em'`, `'%'`, etc. (f.e. 20%, 10em)
|
|
13
|
+
* @since 3.28.0
|
|
14
|
+
*/
|
|
15
|
+
maxWidth?: number | string;
|
|
16
|
+
/**
|
|
17
|
+
* Skeleton height. For the width specified as a number, `'px'` is used as the unit.
|
|
18
|
+
* You can also specify a value with other units such as `'em'`, `'%'`, etc. (f.e. 20%, 10em)
|
|
19
|
+
* @since 3.28.0
|
|
20
|
+
*/
|
|
21
|
+
height?: number | string;
|
|
22
|
+
/**
|
|
23
|
+
* custom styles for skeleton
|
|
24
|
+
* @since 3.28.0
|
|
25
|
+
*/
|
|
26
|
+
style?: {
|
|
27
|
+
[key: string]: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Component to render as the root element.
|
|
31
|
+
* @since 3.28.0
|
|
32
|
+
*/
|
|
33
|
+
component?: ComponentType | keyof JSX.IntrinsicElements;
|
|
34
|
+
/**
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
baseClassName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* `Skeleton` (or content-placeholder) is placeholder preview of content before the data gets loaded to reduce load-time frustration.
|
|
45
|
+
* Skeleton is used for non-text components, images, media-objects, etc.
|
|
46
|
+
* @since 3.28.0
|
|
47
|
+
*/
|
|
48
|
+
declare const Skeleton: FC<SkeletonProps>;
|
|
49
|
+
export default Skeleton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Basic: {
|
|
3
|
+
(args: React.PropsWithChildren<import("./Skeleton").SkeletonProps>): JSX.Element;
|
|
4
|
+
args: {};
|
|
5
|
+
};
|
|
6
|
+
export declare const CustomSize: {
|
|
7
|
+
(args: React.PropsWithChildren<import("./Skeleton").SkeletonProps>): JSX.Element;
|
|
8
|
+
args: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import './SkeletonTabs.less';
|
|
3
|
+
declare type SkeletonTabsProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Number of tabs
|
|
6
|
+
* @since 3.28.0
|
|
7
|
+
*/
|
|
8
|
+
count?: number;
|
|
9
|
+
/**
|
|
10
|
+
* @ignore
|
|
11
|
+
*/
|
|
12
|
+
className: string;
|
|
13
|
+
/**
|
|
14
|
+
* @ignore
|
|
15
|
+
*/
|
|
16
|
+
baseClassName: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Skeleton for tabs component
|
|
20
|
+
* @since `3.28.0
|
|
21
|
+
*/
|
|
22
|
+
declare const SkeletonTabs: FC<SkeletonTabsProps>;
|
|
23
|
+
export default SkeletonTabs;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FC, ComponentType } from 'react';
|
|
2
|
+
import { SkeletonProps } from './Skeleton';
|
|
3
|
+
import './SkeletonText.less';
|
|
4
|
+
declare type SkeletonTextProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Number of rows
|
|
7
|
+
* @since 3.28.0
|
|
8
|
+
*/
|
|
9
|
+
lines?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Props for line
|
|
12
|
+
* @since 3.28.0
|
|
13
|
+
*/
|
|
14
|
+
lineProps?: SkeletonProps;
|
|
15
|
+
/**
|
|
16
|
+
* Component to render as the root element.
|
|
17
|
+
* @since 3.28.0
|
|
18
|
+
*/
|
|
19
|
+
component?: ComponentType | keyof JSX.IntrinsicElements;
|
|
20
|
+
/**
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
baseClassName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Skeleton for text-containing components. Is can be used inside Paragraph, as title, or single text
|
|
31
|
+
* @since 3.28.0
|
|
32
|
+
*/
|
|
33
|
+
declare const SkeletonText: FC<SkeletonTextProps>;
|
|
34
|
+
export default SkeletonText;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Basic: {
|
|
3
|
+
(args: React.PropsWithChildren<{
|
|
4
|
+
lines?: number | undefined;
|
|
5
|
+
lineProps?: import("./Skeleton").SkeletonProps | undefined;
|
|
6
|
+
component?: "symbol" | "object" | "big" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "menuitem" | "keygen" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined;
|
|
7
|
+
baseClassName?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
}>): JSX.Element;
|
|
10
|
+
args: {};
|
|
11
|
+
};
|
|
12
|
+
export declare const LinesCount: {
|
|
13
|
+
(args: React.PropsWithChildren<{
|
|
14
|
+
lines?: number | undefined;
|
|
15
|
+
lineProps?: import("./Skeleton").SkeletonProps | undefined;
|
|
16
|
+
component?: "symbol" | "object" | "big" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "menuitem" | "keygen" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined;
|
|
17
|
+
baseClassName?: string | undefined;
|
|
18
|
+
className?: string | undefined;
|
|
19
|
+
}>): JSX.Element;
|
|
20
|
+
args: {
|
|
21
|
+
lines: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const Custom: {
|
|
25
|
+
(args: React.PropsWithChildren<{
|
|
26
|
+
lines?: number | undefined;
|
|
27
|
+
lineProps?: import("./Skeleton").SkeletonProps | undefined;
|
|
28
|
+
component?: "symbol" | "object" | "big" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "menuitem" | "keygen" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined;
|
|
29
|
+
baseClassName?: string | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
}>): JSX.Element;
|
|
32
|
+
args: {
|
|
33
|
+
lines: number;
|
|
34
|
+
lineProps: {
|
|
35
|
+
width: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -96,3 +96,5 @@ export { default as Tooltip } from './Tooltip';
|
|
|
96
96
|
export { default as Tour } from './Tour';
|
|
97
97
|
export { default as Translate } from './Translate';
|
|
98
98
|
export { default as Link } from './Link';
|
|
99
|
+
export { default as Skeleton } from './Skeleton';
|
|
100
|
+
export * from './Skeleton';
|
|
@@ -25,4 +25,5 @@ export declare const createFocusManager: (containerRef: React.RefObject<HTMLElem
|
|
|
25
25
|
focusLast: (attempt?: number) => boolean;
|
|
26
26
|
};
|
|
27
27
|
export declare const mergeRefs: <T>(...refs: React.Ref<T | null>[]) => (value: T | null) => void;
|
|
28
|
+
export declare const normalizeSize: (value?: string | number | undefined) => string | number | undefined;
|
|
28
29
|
export {};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.PASSWORD_SCORE_RULES = void 0;
|
|
7
|
-
|
|
8
|
-
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
|
|
9
|
-
const passwordScore = (password, rules = PASSWORD_SCORE_RULES) => {
|
|
10
|
-
const unusedRules = [];
|
|
11
|
-
let score = 0;
|
|
12
|
-
rules.forEach(rule => {
|
|
13
|
-
const mark = rule.score(password);
|
|
14
|
-
|
|
15
|
-
if (mark < 0) {
|
|
16
|
-
unusedRules.push({
|
|
17
|
-
rule,
|
|
18
|
-
value: -mark
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
score += mark;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return Promise.resolve({
|
|
25
|
-
password,
|
|
26
|
-
score,
|
|
27
|
-
unusedRules
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const PASSWORD_SCORE_RULES = [{
|
|
32
|
-
name: 'passwordTooShort',
|
|
33
|
-
|
|
34
|
-
score(passwd) {
|
|
35
|
-
return passwd.length < 5 ? -1 : 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}, {
|
|
39
|
-
name: 'passwordLength',
|
|
40
|
-
|
|
41
|
-
score(passwd) {
|
|
42
|
-
if (passwd.length < 5) {
|
|
43
|
-
return 3;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (passwd.length > 4 && passwd.length < 8) {
|
|
47
|
-
return 6;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (passwd.length > 7 && passwd.length < 16) {
|
|
51
|
-
return 12;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return 18;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
}, {
|
|
58
|
-
name: 'lettersLowerCase',
|
|
59
|
-
|
|
60
|
-
score(passwd) {
|
|
61
|
-
// [verified] at least one lower case letter
|
|
62
|
-
return passwd.match(/[a-z]/) ? 1 : -1;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
}, {
|
|
66
|
-
name: 'lettersUpperCase',
|
|
67
|
-
|
|
68
|
-
score(passwd) {
|
|
69
|
-
// [verified] at least one upper case letter
|
|
70
|
-
return passwd.match(/[A-Z]/) ? 5 : -1;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}, {
|
|
74
|
-
name: 'numbers1',
|
|
75
|
-
|
|
76
|
-
score(passwd) {
|
|
77
|
-
// [verified] at least one number
|
|
78
|
-
return passwd.match(/\d+/) ? 5 : -1;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
}, {
|
|
82
|
-
name: 'numbers3',
|
|
83
|
-
|
|
84
|
-
score(passwd) {
|
|
85
|
-
// [verified] at least three numbers
|
|
86
|
-
return passwd.match(/(.*[0-9].*[0-9].*[0-9])/) ? 5 : -1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
}, {
|
|
90
|
-
name: 'specialChar1',
|
|
91
|
-
|
|
92
|
-
score(passwd) {
|
|
93
|
-
// [verified] at least one special character
|
|
94
|
-
return passwd.match(/[!@#$%^&*?_~]/) ? 5 : -1;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
}, {
|
|
98
|
-
name: 'specialChar2',
|
|
99
|
-
|
|
100
|
-
score(passwd) {
|
|
101
|
-
// [verified] at least two special characters
|
|
102
|
-
return passwd.match(/(.*[!@#$%^&*?_~].*[!@#$%^&*?_~])/) ? 5 : -1;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}, {
|
|
106
|
-
name: 'comboUpperAndLower',
|
|
107
|
-
|
|
108
|
-
score(passwd) {
|
|
109
|
-
// [verified] both upper and lower case
|
|
110
|
-
return passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/) ? 2 : -1;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
}, {
|
|
114
|
-
name: 'comboLettersAndNumbers',
|
|
115
|
-
|
|
116
|
-
score(passwd) {
|
|
117
|
-
// [verified] both letters and numbers
|
|
118
|
-
return passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/) ? 2 : -1;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
}, {
|
|
122
|
-
name: 'comboLettersNumbersSpecial',
|
|
123
|
-
|
|
124
|
-
score(passwd) {
|
|
125
|
-
// [verified] letters, numbers, and special characters
|
|
126
|
-
return passwd.match(/([a-zA-Z0-9].*[!@#$%^&*?_~])|([!@#$%^&*?_~].*[a-zA-Z0-9])/) ? 2 : -1;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
}];
|
|
130
|
-
exports.PASSWORD_SCORE_RULES = PASSWORD_SCORE_RULES;
|
|
131
|
-
var _default = passwordScore;
|
|
132
|
-
exports.default = _default;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
|
|
2
|
-
const passwordScore = (password, rules = PASSWORD_SCORE_RULES) => {
|
|
3
|
-
const unusedRules = [];
|
|
4
|
-
let score = 0;
|
|
5
|
-
rules.forEach(rule => {
|
|
6
|
-
const mark = rule.score(password);
|
|
7
|
-
|
|
8
|
-
if (mark < 0) {
|
|
9
|
-
unusedRules.push({
|
|
10
|
-
rule,
|
|
11
|
-
value: -mark
|
|
12
|
-
});
|
|
13
|
-
} else {
|
|
14
|
-
score += mark;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return Promise.resolve({
|
|
18
|
-
password,
|
|
19
|
-
score,
|
|
20
|
-
unusedRules
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const PASSWORD_SCORE_RULES = [{
|
|
25
|
-
name: 'passwordTooShort',
|
|
26
|
-
|
|
27
|
-
score(passwd) {
|
|
28
|
-
return passwd.length < 5 ? -1 : 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
}, {
|
|
32
|
-
name: 'passwordLength',
|
|
33
|
-
|
|
34
|
-
score(passwd) {
|
|
35
|
-
if (passwd.length < 5) {
|
|
36
|
-
return 3;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (passwd.length > 4 && passwd.length < 8) {
|
|
40
|
-
return 6;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (passwd.length > 7 && passwd.length < 16) {
|
|
44
|
-
return 12;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return 18;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}, {
|
|
51
|
-
name: 'lettersLowerCase',
|
|
52
|
-
|
|
53
|
-
score(passwd) {
|
|
54
|
-
// [verified] at least one lower case letter
|
|
55
|
-
return passwd.match(/[a-z]/) ? 1 : -1;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
}, {
|
|
59
|
-
name: 'lettersUpperCase',
|
|
60
|
-
|
|
61
|
-
score(passwd) {
|
|
62
|
-
// [verified] at least one upper case letter
|
|
63
|
-
return passwd.match(/[A-Z]/) ? 5 : -1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}, {
|
|
67
|
-
name: 'numbers1',
|
|
68
|
-
|
|
69
|
-
score(passwd) {
|
|
70
|
-
// [verified] at least one number
|
|
71
|
-
return passwd.match(/\d+/) ? 5 : -1;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}, {
|
|
75
|
-
name: 'numbers3',
|
|
76
|
-
|
|
77
|
-
score(passwd) {
|
|
78
|
-
// [verified] at least three numbers
|
|
79
|
-
return passwd.match(/(.*[0-9].*[0-9].*[0-9])/) ? 5 : -1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
}, {
|
|
83
|
-
name: 'specialChar1',
|
|
84
|
-
|
|
85
|
-
score(passwd) {
|
|
86
|
-
// [verified] at least one special character
|
|
87
|
-
return passwd.match(/[!@#$%^&*?_~]/) ? 5 : -1;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}, {
|
|
91
|
-
name: 'specialChar2',
|
|
92
|
-
|
|
93
|
-
score(passwd) {
|
|
94
|
-
// [verified] at least two special characters
|
|
95
|
-
return passwd.match(/(.*[!@#$%^&*?_~].*[!@#$%^&*?_~])/) ? 5 : -1;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
}, {
|
|
99
|
-
name: 'comboUpperAndLower',
|
|
100
|
-
|
|
101
|
-
score(passwd) {
|
|
102
|
-
// [verified] both upper and lower case
|
|
103
|
-
return passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/) ? 2 : -1;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}, {
|
|
107
|
-
name: 'comboLettersAndNumbers',
|
|
108
|
-
|
|
109
|
-
score(passwd) {
|
|
110
|
-
// [verified] both letters and numbers
|
|
111
|
-
return passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/) ? 2 : -1;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
}, {
|
|
115
|
-
name: 'comboLettersNumbersSpecial',
|
|
116
|
-
|
|
117
|
-
score(passwd) {
|
|
118
|
-
// [verified] letters, numbers, and special characters
|
|
119
|
-
return passwd.match(/([a-zA-Z0-9].*[!@#$%^&*?_~])|([!@#$%^&*?_~].*[a-zA-Z0-9])/) ? 2 : -1;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}];
|
|
123
|
-
export default passwordScore;
|