@plesk/ui-library 3.27.2 → 3.27.3
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/README.md +35 -35
- package/cjs/components/Action/Action.js +3 -3
- package/cjs/components/Alert/Alert.js +5 -5
- package/cjs/components/AutoClosable/AutoClosable.js +3 -3
- package/cjs/components/AuxiliaryActions/AuxiliaryActions.js +3 -3
- package/cjs/components/Badge/Badge.js +3 -3
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +4 -4
- package/cjs/components/Button/Button.js +50 -50
- package/cjs/components/ButtonGroup/ButtonGroup.js +3 -3
- package/cjs/components/Card/Card.js +52 -52
- package/cjs/components/Card/CardButton.js +2 -2
- package/cjs/components/Card/PreviewPanel.js +3 -3
- package/cjs/components/Card/images/no-image.svg +6 -6
- package/cjs/components/CardList/CardList.js +55 -55
- package/cjs/components/Carousel/Carousel.js +11 -11
- package/cjs/components/Checkbox/Checkbox.js +3 -3
- package/cjs/components/CodeEditor/CodeEditor.js +40 -40
- package/cjs/components/Columns/Column.js +3 -3
- package/cjs/components/Columns/Columns.js +3 -3
- package/cjs/components/ComboBox/ComboBox.js +4 -4
- package/cjs/components/ComboBox/ComboBoxOption.js +3 -3
- package/cjs/components/ConsoleOutput/ConsoleOutput.js +3 -3
- package/cjs/components/ContentLoader/ContentLoader.js +3 -3
- package/cjs/components/Cuttable/Cuttable.js +3 -3
- package/cjs/components/Dialog/Dialog.js +74 -65
- package/cjs/components/Drawer/Drawer.js +71 -71
- package/cjs/components/Dropdown/Dropdown.js +24 -24
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessage.js +4 -4
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageActions.js +3 -3
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.js +3 -3
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.js +3 -3
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.js +3 -3
- package/cjs/components/Figure/Figure.js +14 -14
- package/cjs/components/Form/Form.js +4 -4
- package/cjs/components/Form/utils.js +22 -22
- package/cjs/components/FormField/FormField.js +78 -78
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +26 -26
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +28 -242
- package/cjs/components/FormFieldPassword/PasswordMeter.js +81 -0
- package/cjs/components/FormFieldPassword/estimatePassword.js +203 -0
- package/cjs/components/FormFieldPassword/generatePassword.js +21 -0
- package/cjs/components/FormFieldPassword/index.js +5 -5
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +32 -32
- package/cjs/components/FormFieldSelect/FormFieldSelect.js +4 -4
- package/cjs/components/FormFieldText/FormFieldText.js +36 -36
- package/cjs/components/Grid/Grid.js +37 -37
- package/cjs/components/GridCol/GridCol.js +25 -25
- package/cjs/components/Heading/Heading.js +3 -3
- package/cjs/components/Hint/Hint.js +3 -3
- package/cjs/components/Icon/Icon.js +6 -6
- package/cjs/components/Icon/images/symbols.svg +1653 -1653
- package/cjs/components/InPlaceEdit/InPlaceEdit.js +15 -15
- package/cjs/components/Input/Input.js +3 -3
- package/cjs/components/InputFile/InputFile.js +3 -3
- package/cjs/components/InputNumber/InputNumber.js +3 -3
- package/cjs/components/Item/Item.js +41 -41
- package/cjs/components/ItemLink/ItemLink.js +4 -4
- package/cjs/components/ItemList/ItemList.js +6 -6
- package/cjs/components/Label/Label.js +3 -3
- package/cjs/components/Layer/Layer.js +2 -2
- package/cjs/components/Layout/Layout.js +55 -55
- package/cjs/components/Link/Link.js +6 -6
- package/cjs/components/List/List.js +133 -133
- package/cjs/components/List/ListAction.js +4 -4
- package/cjs/components/List/ListActions.js +3 -3
- package/cjs/components/List/ListActionsDivider.js +4 -4
- package/cjs/components/List/ListEmptyView.js +4 -4
- package/cjs/components/List/ListOperation.js +4 -4
- package/cjs/components/LocaleProvider/LocaleProvider.js +3 -3
- package/cjs/components/Markdown/Markdown.js +13 -13
- package/cjs/components/Media/Media.js +37 -37
- package/cjs/components/Media/MediaSection.js +10 -10
- package/cjs/components/Menu/Menu.js +28 -28
- package/cjs/components/Menu/MenuBaseItem.js +19 -19
- package/cjs/components/Menu/MenuDivider.js +7 -7
- package/cjs/components/Menu/MenuHeader.js +10 -10
- package/cjs/components/Menu/MenuItem.js +27 -27
- package/cjs/components/Menu/MenuSelectableItem.js +13 -13
- package/cjs/components/Overlay/Backdrop.js +6 -6
- package/cjs/components/Overlay/Overlay.js +34 -34
- package/cjs/components/PageHeader/PageHeader.js +3 -3
- package/cjs/components/Pagination/Pagination.js +3 -3
- package/cjs/components/Panel/Panel.js +3 -3
- package/cjs/components/Paragraph/Paragraph.js +3 -3
- package/cjs/components/Plaintext/Plaintext.js +10 -10
- package/cjs/components/Popover/Popover.js +59 -59
- package/cjs/components/Popper/Popper.js +30 -30
- package/cjs/components/Progress/Progress.js +13 -13
- package/cjs/components/ProgressDialog/ProgressDialog.js +49 -48
- package/cjs/components/ProgressDialogStep/ProgressDialogStep.js +3 -3
- package/cjs/components/ProgressStep/ProgressStep.js +25 -25
- package/cjs/components/Radio/Radio.js +3 -3
- package/cjs/components/Rating/Rating.js +13 -13
- package/cjs/components/Rating/images/rating.svg +6 -6
- package/cjs/components/Section/Section.js +41 -41
- package/cjs/components/Section/SectionItem.js +18 -18
- package/cjs/components/SegmentedControl/SegmentedControl.js +37 -37
- package/cjs/components/Select/MultiValue.js +1 -1
- package/cjs/components/Select/Select.js +3 -3
- package/cjs/components/Select/SelectControl.js +1 -1
- package/cjs/components/Select/SelectOption.js +3 -3
- package/cjs/components/Select/SelectOptionGroup.js +3 -3
- package/cjs/components/Spinner/Spinner.js +2 -2
- package/cjs/components/SplitButton/SplitButton.js +20 -20
- package/cjs/components/Spot/Spot.js +3 -3
- package/cjs/components/Status/Status.js +3 -3
- package/cjs/components/StatusMessage/StatusMessage.js +4 -4
- package/cjs/components/Subnav/Subnav.js +22 -22
- package/cjs/components/Switch/Switch.js +31 -31
- package/cjs/components/SwitchesPanel/SwitchesPanel.js +10 -10
- package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +33 -33
- package/cjs/components/Tabs/SearchBar.js +57 -57
- package/cjs/components/Tabs/Tab.js +28 -28
- package/cjs/components/Tabs/Tabs.js +33 -33
- package/cjs/components/Text/Text.js +3 -3
- package/cjs/components/TextArea/TextArea.js +3 -3
- package/cjs/components/Toaster/Toaster.js +32 -32
- package/cjs/components/Toolbar/Toolbar.js +13 -13
- package/cjs/components/Toolbar/ToolbarExpander.js +5 -5
- package/cjs/components/Toolbar/ToolbarGroup.js +17 -17
- package/cjs/components/Tooltip/Tooltip.js +19 -19
- package/cjs/components/Tour/Tour.js +5 -5
- package/cjs/components/Translate/Translate.js +25 -25
- package/cjs/index.js +1 -1
- package/dist/images/no-image.svg +6 -6
- package/dist/images/rating.svg +6 -6
- package/dist/images/symbols.svg +1653 -1653
- 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 +6625 -6638
- 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/Action/Action.js +3 -3
- package/esm/components/Alert/Alert.js +5 -5
- package/esm/components/AutoClosable/AutoClosable.js +3 -3
- package/esm/components/AuxiliaryActions/AuxiliaryActions.js +3 -3
- package/esm/components/Badge/Badge.js +3 -3
- package/esm/components/Breadcrumbs/Breadcrumbs.js +4 -4
- package/esm/components/Button/Button.js +50 -50
- package/esm/components/ButtonGroup/ButtonGroup.js +3 -3
- package/esm/components/Card/Card.js +52 -52
- package/esm/components/Card/CardButton.js +2 -2
- package/esm/components/Card/PreviewPanel.js +3 -3
- package/esm/components/Card/images/no-image.svg +6 -6
- package/esm/components/CardList/CardList.js +55 -55
- package/esm/components/Carousel/Carousel.js +11 -11
- package/esm/components/Checkbox/Checkbox.js +3 -3
- package/esm/components/CodeEditor/CodeEditor.js +40 -40
- package/esm/components/Columns/Column.js +3 -3
- package/esm/components/Columns/Columns.js +3 -3
- package/esm/components/ComboBox/ComboBox.js +4 -4
- package/esm/components/ComboBox/ComboBoxOption.js +3 -3
- package/esm/components/ConsoleOutput/ConsoleOutput.js +3 -3
- package/esm/components/ContentLoader/ContentLoader.js +3 -3
- package/esm/components/Cuttable/Cuttable.js +3 -3
- package/esm/components/Dialog/Dialog.js +74 -65
- package/esm/components/Drawer/Drawer.js +71 -71
- package/esm/components/Dropdown/Dropdown.js +24 -24
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessage.js +4 -4
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageActions.js +3 -3
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.js +3 -3
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.js +3 -3
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.js +3 -3
- package/esm/components/Figure/Figure.js +14 -14
- package/esm/components/Form/Form.js +4 -4
- package/esm/components/Form/utils.js +22 -22
- package/esm/components/FormField/FormField.js +78 -78
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +26 -26
- package/esm/components/FormFieldPassword/FormFieldPassword.js +26 -235
- package/esm/components/FormFieldPassword/PasswordMeter.js +61 -0
- package/esm/components/FormFieldPassword/estimatePassword.js +187 -0
- package/esm/components/FormFieldPassword/generatePassword.js +14 -0
- package/esm/components/FormFieldPassword/index.js +3 -2
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +32 -32
- package/esm/components/FormFieldSelect/FormFieldSelect.js +4 -4
- package/esm/components/FormFieldText/FormFieldText.js +36 -36
- package/esm/components/Grid/Grid.js +37 -37
- package/esm/components/GridCol/GridCol.js +25 -25
- package/esm/components/Heading/Heading.js +3 -3
- package/esm/components/Hint/Hint.js +3 -3
- package/esm/components/Icon/Icon.js +6 -6
- package/esm/components/Icon/images/symbols.svg +1653 -1653
- package/esm/components/InPlaceEdit/InPlaceEdit.js +15 -15
- package/esm/components/Input/Input.js +3 -3
- package/esm/components/InputFile/InputFile.js +3 -3
- package/esm/components/InputNumber/InputNumber.js +3 -3
- package/esm/components/Item/Item.js +41 -41
- package/esm/components/ItemLink/ItemLink.js +4 -4
- package/esm/components/ItemList/ItemList.js +6 -6
- package/esm/components/Label/Label.js +3 -3
- package/esm/components/Layer/Layer.js +2 -2
- package/esm/components/Layout/Layout.js +55 -55
- package/esm/components/Link/Link.js +6 -6
- package/esm/components/List/List.js +133 -133
- package/esm/components/List/ListAction.js +4 -4
- package/esm/components/List/ListActions.js +3 -3
- package/esm/components/List/ListActionsDivider.js +4 -4
- package/esm/components/List/ListEmptyView.js +4 -4
- package/esm/components/List/ListOperation.js +4 -4
- package/esm/components/LocaleProvider/LocaleProvider.js +3 -3
- package/esm/components/Markdown/Markdown.js +13 -13
- package/esm/components/Media/Media.js +37 -37
- package/esm/components/Media/MediaSection.js +10 -10
- package/esm/components/Menu/Menu.js +28 -28
- package/esm/components/Menu/MenuBaseItem.js +19 -19
- package/esm/components/Menu/MenuDivider.js +7 -7
- package/esm/components/Menu/MenuHeader.js +10 -10
- package/esm/components/Menu/MenuItem.js +27 -27
- package/esm/components/Menu/MenuSelectableItem.js +13 -13
- package/esm/components/Overlay/Backdrop.js +6 -6
- package/esm/components/Overlay/Overlay.js +34 -34
- package/esm/components/PageHeader/PageHeader.js +3 -3
- package/esm/components/Pagination/Pagination.js +3 -3
- package/esm/components/Panel/Panel.js +3 -3
- package/esm/components/Paragraph/Paragraph.js +3 -3
- package/esm/components/Plaintext/Plaintext.js +10 -10
- package/esm/components/Popover/Popover.js +59 -59
- package/esm/components/Popper/Popper.js +30 -30
- package/esm/components/Progress/Progress.js +13 -13
- package/esm/components/ProgressDialog/ProgressDialog.js +49 -48
- package/esm/components/ProgressDialogStep/ProgressDialogStep.js +3 -3
- package/esm/components/ProgressStep/ProgressStep.js +25 -25
- package/esm/components/Radio/Radio.js +3 -3
- package/esm/components/Rating/Rating.js +13 -13
- package/esm/components/Rating/images/rating.svg +6 -6
- package/esm/components/Section/Section.js +41 -41
- package/esm/components/Section/SectionItem.js +18 -18
- package/esm/components/SegmentedControl/SegmentedControl.js +37 -37
- package/esm/components/Select/MultiValue.js +1 -1
- package/esm/components/Select/Select.js +3 -3
- package/esm/components/Select/SelectControl.js +1 -1
- package/esm/components/Select/SelectOption.js +3 -3
- package/esm/components/Select/SelectOptionGroup.js +3 -3
- package/esm/components/Spinner/Spinner.js +2 -2
- package/esm/components/SplitButton/SplitButton.js +20 -20
- package/esm/components/Spot/Spot.js +3 -3
- package/esm/components/Status/Status.js +3 -3
- package/esm/components/StatusMessage/StatusMessage.js +4 -4
- package/esm/components/Subnav/Subnav.js +22 -22
- package/esm/components/Switch/Switch.js +31 -31
- package/esm/components/SwitchesPanel/SwitchesPanel.js +10 -10
- package/esm/components/SwitchesPanelItem/SwitchesPanelItem.js +33 -33
- package/esm/components/Tabs/SearchBar.js +57 -57
- package/esm/components/Tabs/Tab.js +28 -28
- package/esm/components/Tabs/Tabs.js +33 -33
- package/esm/components/Text/Text.js +3 -3
- package/esm/components/TextArea/TextArea.js +3 -3
- package/esm/components/Toaster/Toaster.js +32 -32
- package/esm/components/Toolbar/Toolbar.js +13 -13
- package/esm/components/Toolbar/ToolbarExpander.js +5 -5
- package/esm/components/Toolbar/ToolbarGroup.js +17 -17
- package/esm/components/Tooltip/Tooltip.js +19 -19
- package/esm/components/Tour/Tour.js +5 -5
- package/esm/components/Translate/Translate.js +25 -25
- package/esm/index.js +1 -1
- package/index.js +5 -5
- package/package.json +151 -151
- package/scripts/postinstall.js +9 -9
- package/styleguide/browserconfig.xml +9 -9
- package/styleguide/build/bundle.f38c467d.js +2 -0
- package/styleguide/build/{bundle.1c9c8500.js.LICENSE.txt → bundle.f38c467d.js.LICENSE.txt} +0 -0
- package/styleguide/images/no-image.svg +6 -6
- package/styleguide/images/rating.svg +6 -6
- package/styleguide/images/symbols.svg +1653 -1653
- package/styleguide/index.html +2 -2
- package/styleguide/placeholders/placeholder_400x200.svg +5 -5
- package/styleguide/placeholders/placeholder_400x400.svg +5 -5
- package/styleguide/placeholders/placeholder_600x400.svg +5 -5
- package/styleguide/safari-pinned-tab.svg +28 -28
- package/styleguide/site.webmanifest +19 -19
- package/types/package.d.ts +133 -133
- package/types/src/components/Action/Action.d.ts +61 -61
- package/types/src/components/Action/index.d.ts +1 -1
- package/types/src/components/Alert/Alert.d.ts +36 -36
- package/types/src/components/Alert/Alert.stories.d.ts +14 -14
- package/types/src/components/Alert/index.d.ts +1 -1
- package/types/src/components/AutoClosable/AutoClosable.d.ts +59 -59
- package/types/src/components/AutoClosable/index.d.ts +1 -1
- package/types/src/components/AuxiliaryActions/AuxiliaryActions.d.ts +28 -28
- package/types/src/components/AuxiliaryActions/index.d.ts +1 -1
- package/types/src/components/Badge/Badge.d.ts +39 -39
- package/types/src/components/Badge/index.d.ts +1 -1
- package/types/src/components/Breadcrumbs/Breadcrumbs.d.ts +25 -25
- package/types/src/components/Breadcrumbs/index.d.ts +1 -1
- package/types/src/components/Button/Button.stories.d.ts +16 -16
- package/types/src/components/ButtonGroup/ButtonGroup.d.ts +27 -27
- package/types/src/components/ButtonGroup/index.d.ts +1 -1
- package/types/src/components/Card/PreviewPanel.d.ts +53 -53
- package/types/src/components/Card/helpers.d.ts +5 -5
- package/types/src/components/Checkbox/Checkbox.d.ts +67 -67
- package/types/src/components/Checkbox/index.d.ts +1 -1
- package/types/src/components/ClosingConfirmation/index.d.ts +1 -1
- package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +10 -10
- package/types/src/components/Columns/Column.d.ts +52 -52
- package/types/src/components/Columns/Columns.d.ts +34 -34
- package/types/src/components/Columns/index.d.ts +2 -2
- package/types/src/components/ComboBox/ComboBox.d.ts +58 -58
- package/types/src/components/ComboBox/ComboBoxOption.d.ts +19 -19
- package/types/src/components/ComboBox/index.d.ts +2 -2
- package/types/src/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +40 -40
- package/types/src/components/ComboBoxDropdown/index.d.ts +1 -1
- package/types/src/components/ConsoleOutput/ConsoleOutput.d.ts +52 -52
- package/types/src/components/ConsoleOutput/index.d.ts +1 -1
- package/types/src/components/ContentLoader/ContentLoader.d.ts +60 -60
- package/types/src/components/ContentLoader/IconsLoader.d.ts +10 -10
- package/types/src/components/ContentLoader/index.d.ts +1 -1
- package/types/src/components/Cuttable/Cuttable.d.ts +63 -63
- package/types/src/components/Cuttable/Cuttable.stories.d.ts +34 -34
- package/types/src/components/Cuttable/index.d.ts +1 -1
- package/types/src/components/Dialog/Dialog.stories.d.ts +22 -22
- package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +7 -7
- package/types/src/components/DistractionFreeModeContext/index.d.ts +1 -1
- package/types/src/components/Drawer/Drawer.stories.d.ts +40 -40
- package/types/src/components/Drawer/DrawerProgress.d.ts +45 -45
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessage.d.ts +38 -38
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageActions.d.ts +22 -22
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.d.ts +22 -22
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.d.ts +13 -13
- package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.d.ts +22 -22
- package/types/src/components/ExtendedStatusMessage/index.d.ts +5 -5
- package/types/src/components/FocusTrap/FocusTrap.d.ts +7 -7
- package/types/src/components/FocusTrap/index.d.ts +1 -1
- package/types/src/components/Form/DisabledContext.d.ts +3 -3
- package/types/src/components/Form/Form.d.ts +163 -163
- package/types/src/components/Form/Form.stories.d.ts +12 -12
- package/types/src/components/Form/FormContext.d.ts +16 -16
- package/types/src/components/Form/index.d.ts +2 -2
- package/types/src/components/Form/utils.d.ts +32 -32
- package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +17 -17
- 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/FormFieldSelect/FormFieldSelect.d.ts +13 -13
- package/types/src/components/FormFieldSelect/index.d.ts +1 -1
- package/types/src/components/Heading/Heading.d.ts +39 -39
- package/types/src/components/Heading/index.d.ts +1 -1
- package/types/src/components/Hint/Hint.d.ts +24 -24
- package/types/src/components/Hint/index.d.ts +1 -1
- package/types/src/components/Icon/Icon.d.ts +88 -88
- package/types/src/components/Icon/Icon.stories.d.ts +6 -6
- package/types/src/components/Icon/constants.d.ts +3 -3
- package/types/src/components/Icon/index.d.ts +2 -2
- package/types/src/components/Icon/oldIconNames.d.ts +5 -5
- package/types/src/components/Input/Input.d.ts +57 -57
- package/types/src/components/Input/index.d.ts +1 -1
- package/types/src/components/InputFile/InputFile.d.ts +49 -49
- package/types/src/components/InputFile/index.d.ts +1 -1
- package/types/src/components/InputNumber/InputNumber.d.ts +64 -64
- package/types/src/components/InputNumber/index.d.ts +1 -1
- package/types/src/components/ItemLink/ItemLink.d.ts +28 -28
- package/types/src/components/ItemLink/ItemLink.stories.d.ts +14 -14
- package/types/src/components/ItemLink/index.d.ts +1 -1
- package/types/src/components/ItemList/ItemList.d.ts +113 -113
- package/types/src/components/ItemList/ItemList.stories.d.ts +289 -289
- package/types/src/components/Label/Label.d.ts +28 -28
- package/types/src/components/Label/index.d.ts +1 -1
- package/types/src/components/Layer/Layer.d.ts +29 -29
- package/types/src/components/Layer/index.d.ts +2 -2
- package/types/src/components/Link/Link.d.ts +47 -47
- package/types/src/components/Link/index.d.ts +1 -1
- package/types/src/components/List/List.stories.d.ts +29 -29
- package/types/src/components/List/ListAction.d.ts +39 -39
- package/types/src/components/List/ListActions.d.ts +30 -30
- package/types/src/components/List/ListActionsDivider.d.ts +10 -10
- package/types/src/components/List/ListEmptyView.d.ts +44 -44
- package/types/src/components/List/ListOperation.d.ts +42 -42
- package/types/src/components/List/ListOperationContext.d.ts +7 -7
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +37 -37
- package/types/src/components/LocaleProvider/index.d.ts +2 -2
- package/types/src/components/Menu/Menu.stories.d.ts +19 -19
- package/types/src/components/OnDarkContext/OnDarkContext.d.ts +3 -3
- package/types/src/components/OnDarkContext/index.d.ts +1 -1
- package/types/src/components/PageHeader/PageHeader.d.ts +53 -53
- package/types/src/components/PageHeader/index.d.ts +1 -1
- package/types/src/components/Pagination/Pagination.d.ts +77 -77
- package/types/src/components/Panel/Panel.d.ts +65 -65
- package/types/src/components/Paragraph/Paragraph.d.ts +29 -29
- package/types/src/components/Paragraph/index.d.ts +1 -1
- package/types/src/components/Popover/Popover.stories.d.ts +22 -22
- package/types/src/components/ProgressBar/ProgressBar.d.ts +23 -23
- package/types/src/components/ProgressBar/ProgressIndicator.d.ts +21 -21
- package/types/src/components/ProgressBar/index.d.ts +1 -1
- package/types/src/components/Radio/Radio.d.ts +52 -52
- package/types/src/components/Radio/index.d.ts +1 -1
- package/types/src/components/ResponsiveContext/ResponsiveContext.d.ts +3 -3
- package/types/src/components/ResponsiveContext/index.d.ts +1 -1
- package/types/src/components/Select/MultiValue.d.ts +9 -9
- package/types/src/components/Select/Select.d.ts +74 -74
- package/types/src/components/Select/Select.stories.d.ts +23 -23
- package/types/src/components/Select/SelectControl.d.ts +26 -26
- package/types/src/components/Select/SelectOption.d.ts +29 -29
- package/types/src/components/Select/SelectOptionGroup.d.ts +20 -20
- package/types/src/components/Select/index.d.ts +3 -3
- package/types/src/components/Select/structures.d.ts +19 -19
- package/types/src/components/Spinner/Spinner.d.ts +18 -18
- package/types/src/components/Spinner/index.d.ts +1 -1
- package/types/src/components/Spot/Spot.d.ts +70 -70
- package/types/src/components/Spot/SpotPopup.d.ts +25 -25
- package/types/src/components/Spot/SpotPulsar.d.ts +10 -10
- package/types/src/components/Spot/index.d.ts +1 -1
- package/types/src/components/Squeezer/Squeezer.d.ts +22 -22
- package/types/src/components/Squeezer/index.d.ts +1 -1
- package/types/src/components/Status/Status.d.ts +69 -69
- package/types/src/components/Status/Status.stories.d.ts +22 -22
- package/types/src/components/Status/index.d.ts +1 -1
- package/types/src/components/StatusMessage/StatusMessage.d.ts +29 -29
- package/types/src/components/StatusMessage/index.d.ts +1 -1
- package/types/src/components/Tabs/Tabs.stories.d.ts +7 -7
- package/types/src/components/Text/Text.d.ts +64 -64
- package/types/src/components/Text/index.d.ts +1 -1
- package/types/src/components/TextArea/TextArea.d.ts +69 -69
- package/types/src/components/TextArea/calculateNodeHeight.d.ts +6 -6
- package/types/src/components/Toast/Toast.d.ts +40 -40
- package/types/src/components/Toast/index.d.ts +2 -2
- package/types/src/components/Toaster/Toaster.d.ts +93 -93
- package/types/src/components/Toaster/index.d.ts +1 -1
- package/types/src/components/Toolbar/RegistryContext.d.ts +16 -16
- package/types/src/components/Toolbar/ToolbarExpander.d.ts +24 -24
- package/types/src/components/Toolbar/ToolbarItem.d.ts +2 -2
- package/types/src/components/Toolbar/ToolbarMenu.d.ts +7 -7
- package/types/src/components/Tour/Tour.d.ts +27 -27
- package/types/src/components/Tour/index.d.ts +1 -1
- package/types/src/components/VerticalContext/VerticalContext.d.ts +4 -4
- package/types/src/components/VerticalContext/index.d.ts +1 -1
- package/types/src/components/index.d.ts +98 -98
- package/types/src/components/intentIconMap.d.ts +4 -4
- package/types/src/components/utils.d.ts +28 -28
- package/types/src/index.d.ts +5 -5
- package/types/src/utils.d.ts +5 -5
- package/cjs/components/FormFieldPassword/passwordScore.js +0 -132
- package/esm/components/FormFieldPassword/passwordScore.js +0 -123
- package/styleguide/build/bundle.1c9c8500.js +0 -2
|
@@ -22,11 +22,11 @@ import VerticalContext from '../VerticalContext';
|
|
|
22
22
|
import ScrollableElementFormContext from '../Form/ScrollableElementFormContext';
|
|
23
23
|
import DisabledContext from '../Form/DisabledContext';
|
|
24
24
|
const defaultValue = undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Simple helper to handle situations when we expecting only array
|
|
27
|
-
* @param value
|
|
28
|
-
* @param nonEmpty
|
|
29
|
-
* @returns {Array}
|
|
25
|
+
/**
|
|
26
|
+
* Simple helper to handle situations when we expecting only array
|
|
27
|
+
* @param value
|
|
28
|
+
* @param nonEmpty
|
|
29
|
+
* @returns {Array}
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
const getArrayHelper = (value, nonEmpty = false) => {
|
|
@@ -48,8 +48,8 @@ const isControlled = props => props.value !== undefined;
|
|
|
48
48
|
const isEmpty = value => {
|
|
49
49
|
return !value && value !== 0 || Array.isArray(value) && value.length === 0 || !Array.isArray(value) && typeof value === 'object' && Object.values(value).filter(t => Boolean(t)).length === 0;
|
|
50
50
|
};
|
|
51
|
-
/**
|
|
52
|
-
* @since 0.0.54
|
|
51
|
+
/**
|
|
52
|
+
* @since 0.0.54
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
55
|
|
|
@@ -415,10 +415,10 @@ class FormField extends Component {
|
|
|
415
415
|
|
|
416
416
|
clearTimeout(this.focusTimer);
|
|
417
417
|
}
|
|
418
|
-
/**
|
|
419
|
-
* Field API provided to field
|
|
420
|
-
* @param index
|
|
421
|
-
* @returns {Object}
|
|
418
|
+
/**
|
|
419
|
+
* Field API provided to field
|
|
420
|
+
* @param index
|
|
421
|
+
* @returns {Object}
|
|
422
422
|
*/
|
|
423
423
|
|
|
424
424
|
|
|
@@ -442,127 +442,127 @@ class FormField extends Component {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
const propTypes = {
|
|
445
|
-
/**
|
|
446
|
-
* Field ID.
|
|
447
|
-
* @since 0.0.59
|
|
445
|
+
/**
|
|
446
|
+
* Field ID.
|
|
447
|
+
* @since 0.0.59
|
|
448
448
|
*/
|
|
449
449
|
id: PropTypes.string,
|
|
450
450
|
|
|
451
|
-
/**
|
|
452
|
-
* Field name.
|
|
453
|
-
* @since 0.0.54
|
|
451
|
+
/**
|
|
452
|
+
* Field name.
|
|
453
|
+
* @since 0.0.54
|
|
454
454
|
*/
|
|
455
455
|
name: PropTypes.string,
|
|
456
456
|
|
|
457
|
-
/**
|
|
458
|
-
* Field value.
|
|
459
|
-
* @deprecated Use [Form](#!/Form) values.
|
|
460
|
-
* @since 0.0.57
|
|
457
|
+
/**
|
|
458
|
+
* Field value.
|
|
459
|
+
* @deprecated Use [Form](#!/Form) values.
|
|
460
|
+
* @since 0.0.57
|
|
461
461
|
*/
|
|
462
462
|
value: PropTypes.any,
|
|
463
463
|
|
|
464
|
-
/**
|
|
465
|
-
* A callback function, can be executed when the value is changing.
|
|
466
|
-
* @since 0.4.1
|
|
464
|
+
/**
|
|
465
|
+
* A callback function, can be executed when the value is changing.
|
|
466
|
+
* @since 0.4.1
|
|
467
467
|
*/
|
|
468
468
|
onChange: PropTypes.func,
|
|
469
469
|
|
|
470
|
-
/**
|
|
471
|
-
* Field label.
|
|
472
|
-
* @since 0.0.54
|
|
470
|
+
/**
|
|
471
|
+
* Field label.
|
|
472
|
+
* @since 0.0.54
|
|
473
473
|
*/
|
|
474
474
|
label: PropTypes.any,
|
|
475
475
|
|
|
476
|
-
/**
|
|
477
|
-
* Field description.
|
|
478
|
-
* @since 0.0.57
|
|
476
|
+
/**
|
|
477
|
+
* Field description.
|
|
478
|
+
* @since 0.0.57
|
|
479
479
|
*/
|
|
480
480
|
description: PropTypes.any,
|
|
481
481
|
|
|
482
|
-
/**
|
|
483
|
-
* Show long descriptions in popover after clicking on "( i )" icon
|
|
484
|
-
* @since 3.14.0
|
|
482
|
+
/**
|
|
483
|
+
* Show long descriptions in popover after clicking on "( i )" icon
|
|
484
|
+
* @since 3.14.0
|
|
485
485
|
*/
|
|
486
486
|
fullDescription: PropTypes.node,
|
|
487
487
|
|
|
488
|
-
/**
|
|
489
|
-
* Field errors.
|
|
490
|
-
* @deprecated Use [Form](#!/Form) errors.
|
|
491
|
-
* @since 0.0.57
|
|
488
|
+
/**
|
|
489
|
+
* Field errors.
|
|
490
|
+
* @deprecated Use [Form](#!/Form) errors.
|
|
491
|
+
* @since 0.0.57
|
|
492
492
|
*/
|
|
493
493
|
errors: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
494
494
|
|
|
495
|
-
/**
|
|
496
|
-
* Indicates whether field is required.
|
|
497
|
-
* @since 0.0.54
|
|
495
|
+
/**
|
|
496
|
+
* Indicates whether field is required.
|
|
497
|
+
* @since 0.0.54
|
|
498
498
|
*/
|
|
499
499
|
required: PropTypes.bool,
|
|
500
500
|
|
|
501
|
-
/**
|
|
502
|
-
* Content of the `FormField`.
|
|
503
|
-
* @since 0.0.54
|
|
501
|
+
/**
|
|
502
|
+
* Content of the `FormField`.
|
|
503
|
+
* @since 0.0.54
|
|
504
504
|
*/
|
|
505
505
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
506
506
|
|
|
507
|
-
/**
|
|
508
|
-
* If 'true', a field will be multiple. You can also limit the number of fields with a value like { max: 5 }.
|
|
509
|
-
* @since 1.12.0
|
|
507
|
+
/**
|
|
508
|
+
* If 'true', a field will be multiple. You can also limit the number of fields with a value like { max: 5 }.
|
|
509
|
+
* @since 1.12.0
|
|
510
510
|
*/
|
|
511
511
|
multi: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
512
512
|
max: PropTypes.number.isRequired
|
|
513
513
|
})]),
|
|
514
514
|
|
|
515
|
-
/**
|
|
516
|
-
* @ignore Disabled state of multiple field.
|
|
515
|
+
/**
|
|
516
|
+
* @ignore Disabled state of multiple field.
|
|
517
517
|
*/
|
|
518
518
|
disabled: PropTypes.bool,
|
|
519
519
|
|
|
520
|
-
/**
|
|
521
|
-
* Localization messages
|
|
522
|
-
* @since 1.12.0
|
|
520
|
+
/**
|
|
521
|
+
* Localization messages
|
|
522
|
+
* @since 1.12.0
|
|
523
523
|
*/
|
|
524
524
|
locale: PropTypes.shape({
|
|
525
525
|
addMore: PropTypes.node,
|
|
526
526
|
remove: PropTypes.node
|
|
527
527
|
}),
|
|
528
528
|
|
|
529
|
-
/**
|
|
530
|
-
* Callback which called for all values. If it returns 'true' a pseudo-link 'Add more' will be disabled
|
|
531
|
-
* @ignore
|
|
532
|
-
* @deprecated
|
|
529
|
+
/**
|
|
530
|
+
* Callback which called for all values. If it returns 'true' a pseudo-link 'Add more' will be disabled
|
|
531
|
+
* @ignore
|
|
532
|
+
* @deprecated
|
|
533
533
|
*/
|
|
534
534
|
addMoreValidator: PropTypes.func,
|
|
535
535
|
|
|
536
|
-
/**
|
|
537
|
-
* A callback function, can be executed when the row is removed.
|
|
538
|
-
* @since 1.12.0
|
|
536
|
+
/**
|
|
537
|
+
* A callback function, can be executed when the row is removed.
|
|
538
|
+
* @since 1.12.0
|
|
539
539
|
*/
|
|
540
540
|
onRemoveRow: PropTypes.func,
|
|
541
541
|
|
|
542
|
-
/**
|
|
543
|
-
* @ignore
|
|
542
|
+
/**
|
|
543
|
+
* @ignore
|
|
544
544
|
*/
|
|
545
545
|
className: PropTypes.string,
|
|
546
546
|
|
|
547
|
-
/**
|
|
548
|
-
* @ignore
|
|
547
|
+
/**
|
|
548
|
+
* @ignore
|
|
549
549
|
*/
|
|
550
550
|
baseClassName: PropTypes.string,
|
|
551
551
|
|
|
552
|
-
/**
|
|
553
|
-
* @ignore
|
|
552
|
+
/**
|
|
553
|
+
* @ignore
|
|
554
554
|
*/
|
|
555
555
|
form: PropTypes.object,
|
|
556
556
|
|
|
557
|
-
/**
|
|
558
|
-
* Vertical or horizontal field view.
|
|
559
|
-
* If it is not defined explicitly, the vertical mode will use from Form or Section components.
|
|
560
|
-
* @since 3.13.0
|
|
557
|
+
/**
|
|
558
|
+
* Vertical or horizontal field view.
|
|
559
|
+
* If it is not defined explicitly, the vertical mode will use from Form or Section components.
|
|
560
|
+
* @since 3.13.0
|
|
561
561
|
*/
|
|
562
562
|
vertical: PropTypes.bool,
|
|
563
563
|
|
|
564
|
-
/**
|
|
565
|
-
* @ignore
|
|
564
|
+
/**
|
|
565
|
+
* @ignore
|
|
566
566
|
*/
|
|
567
567
|
scrollableElement: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.instanceOf(Window)])
|
|
568
568
|
};
|
|
@@ -590,14 +590,14 @@ const defaultProps = {
|
|
|
590
590
|
};
|
|
591
591
|
FormField.propTypes = propTypes;
|
|
592
592
|
FormField.defaultProps = defaultProps;
|
|
593
|
-
/**
|
|
594
|
-
* `FormField` component is used for showing of parameter values in Form or
|
|
595
|
-
* for entering of user data with any form elements.
|
|
596
|
-
*
|
|
597
|
-
* For the most cases the following form elements can be used:
|
|
598
|
-
* * [FormFieldText](#!/FormFieldText) for entering text,
|
|
599
|
-
* * [FormFieldSelect](#!/FormFieldSelect), [FormFieldCheckbox](#!/FormFieldCheckbox),
|
|
600
|
-
* [FormFieldRadioButtons](#!/FormFieldRadioButtons) for selecting options.
|
|
593
|
+
/**
|
|
594
|
+
* `FormField` component is used for showing of parameter values in Form or
|
|
595
|
+
* for entering of user data with any form elements.
|
|
596
|
+
*
|
|
597
|
+
* For the most cases the following form elements can be used:
|
|
598
|
+
* * [FormFieldText](#!/FormFieldText) for entering text,
|
|
599
|
+
* * [FormFieldSelect](#!/FormFieldSelect), [FormFieldCheckbox](#!/FormFieldCheckbox),
|
|
600
|
+
* [FormFieldRadioButtons](#!/FormFieldRadioButtons) for selecting options.
|
|
601
601
|
*/
|
|
602
602
|
|
|
603
603
|
const FormFieldWrapper = props => {
|
|
@@ -7,10 +7,10 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
7
7
|
import Checkbox from '../Checkbox';
|
|
8
8
|
import FormField from '../FormField';
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* `FormFieldCheckbox` component component is used for turning an option on or off
|
|
12
|
-
* and selecting or deselecting an item.
|
|
13
|
-
* @since 0.0.58
|
|
10
|
+
/**
|
|
11
|
+
* `FormFieldCheckbox` component component is used for turning an option on or off
|
|
12
|
+
* and selecting or deselecting an item.
|
|
13
|
+
* @since 0.0.58
|
|
14
14
|
*/
|
|
15
15
|
const FormFieldCheckbox = ({
|
|
16
16
|
baseClassName,
|
|
@@ -52,52 +52,52 @@ const FormFieldCheckbox = ({
|
|
|
52
52
|
}, label)));
|
|
53
53
|
|
|
54
54
|
FormFieldCheckbox.propTypes = {
|
|
55
|
-
/**
|
|
56
|
-
* Disabled state of field.
|
|
57
|
-
* @since 0.1.0
|
|
55
|
+
/**
|
|
56
|
+
* Disabled state of field.
|
|
57
|
+
* @since 0.1.0
|
|
58
58
|
*/
|
|
59
59
|
disabled: PropTypes.bool,
|
|
60
60
|
|
|
61
|
-
/**
|
|
62
|
-
* Custom checked value. Default is boolean true.
|
|
63
|
-
* @since 0.0.59
|
|
61
|
+
/**
|
|
62
|
+
* Custom checked value. Default is boolean true.
|
|
63
|
+
* @since 0.0.59
|
|
64
64
|
*/
|
|
65
65
|
checkedValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* Custom unchecked value. Default is boolean false.
|
|
69
|
-
* @since 0.0.59
|
|
67
|
+
/**
|
|
68
|
+
* Custom unchecked value. Default is boolean false.
|
|
69
|
+
* @since 0.0.59
|
|
70
70
|
*/
|
|
71
71
|
uncheckedValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
* The browser will automatically focus on the component upon rendering the screen
|
|
75
|
-
* @since 1.9.0
|
|
73
|
+
/**
|
|
74
|
+
* The browser will automatically focus on the component upon rendering the screen
|
|
75
|
+
* @since 1.9.0
|
|
76
76
|
*/
|
|
77
77
|
autoFocus: PropTypes.bool,
|
|
78
78
|
|
|
79
|
-
/**
|
|
80
|
-
* @ignore Field cannot be multiple
|
|
79
|
+
/**
|
|
80
|
+
* @ignore Field cannot be multiple
|
|
81
81
|
*/
|
|
82
82
|
multi: PropTypes.bool,
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
* @ignore
|
|
84
|
+
/**
|
|
85
|
+
* @ignore
|
|
86
86
|
*/
|
|
87
87
|
label: PropTypes.any,
|
|
88
88
|
|
|
89
|
-
/**
|
|
90
|
-
* @ignore
|
|
89
|
+
/**
|
|
90
|
+
* @ignore
|
|
91
91
|
*/
|
|
92
92
|
required: PropTypes.bool,
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* @ignore
|
|
94
|
+
/**
|
|
95
|
+
* @ignore
|
|
96
96
|
*/
|
|
97
97
|
className: PropTypes.string,
|
|
98
98
|
|
|
99
|
-
/**
|
|
100
|
-
* @ignore
|
|
99
|
+
/**
|
|
100
|
+
* @ignore
|
|
101
101
|
*/
|
|
102
102
|
baseClassName: PropTypes.string,
|
|
103
103
|
fullDescription: PropTypes.string
|
|
@@ -1,49 +1,30 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
// Copyright 1999-
|
|
3
|
+
// Copyright 1999-2022. Plesk International GmbH. All rights reserved.
|
|
4
4
|
import React, { Component, Fragment, createRef } from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import { CLS_PREFIX } from '../../constants';
|
|
8
7
|
import Button from '../Button';
|
|
9
8
|
import FormField from '../FormField';
|
|
10
9
|
import Input from '../Input';
|
|
11
|
-
import Popover from '../Popover';
|
|
12
10
|
import Translate from '../Translate';
|
|
13
|
-
import
|
|
11
|
+
import PasswordMeter from './PasswordMeter';
|
|
12
|
+
import generatePassword from './generatePassword';
|
|
14
13
|
import locale from './locale/en-US';
|
|
15
|
-
const symbolClasses = {
|
|
16
|
-
upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
17
|
-
lower: 'abcdefghijklmnopqrstuvwxyz',
|
|
18
|
-
number: '0123456789',
|
|
19
|
-
special: '!@#$%^&*?_~'
|
|
20
|
-
};
|
|
21
|
-
export const generatePassword = () => {
|
|
22
|
-
const password = ['upper', 'lower', 'lower', 'lower', 'number', 'number', 'special', 'number', 'upper', 'upper', 'lower', 'lower', 'lower', 'lower', 'lower', 'lower'];
|
|
23
|
-
return password.sort((a, b) => Math.floor(b.length * Math.random()) - Math.floor(a.length * Math.random())).map(symbolClass => symbolClasses[symbolClass][Math.floor(symbolClasses[symbolClass].length * Math.random())]).join('');
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* `FormFieldPassword` component provides secure way to enter a password.
|
|
27
|
-
* @since 0.0.58
|
|
28
|
-
*/
|
|
29
14
|
|
|
15
|
+
/**
|
|
16
|
+
* `FormFieldPassword` component provides secure way to enter a password.
|
|
17
|
+
* @since 0.0.58
|
|
18
|
+
*/
|
|
30
19
|
class FormFieldPassword extends Component {
|
|
31
20
|
constructor(...args) {
|
|
32
21
|
super(...args);
|
|
33
22
|
|
|
34
23
|
_defineProperty(this, "state", {
|
|
35
24
|
visible: false,
|
|
36
|
-
passwordMeterVisible: false
|
|
37
|
-
scoreResult: {
|
|
38
|
-
password: null,
|
|
39
|
-
intent: null,
|
|
40
|
-
strength: null,
|
|
41
|
-
unusedRules: []
|
|
42
|
-
}
|
|
25
|
+
passwordMeterVisible: false
|
|
43
26
|
});
|
|
44
27
|
|
|
45
|
-
_defineProperty(this, "passwordOnScoring", null);
|
|
46
|
-
|
|
47
28
|
_defineProperty(this, "targetRef", /*#__PURE__*/createRef());
|
|
48
29
|
|
|
49
30
|
_defineProperty(this, "handleToggleClick", () => {
|
|
@@ -63,134 +44,6 @@ class FormFieldPassword extends Component {
|
|
|
63
44
|
_defineProperty(this, "handleBlur", this.handleClosePasswordMeter);
|
|
64
45
|
}
|
|
65
46
|
|
|
66
|
-
async passwordScore(value) {
|
|
67
|
-
if (!value) {
|
|
68
|
-
return {
|
|
69
|
-
password: null,
|
|
70
|
-
intent: null,
|
|
71
|
-
strength: null,
|
|
72
|
-
unusedRules: []
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const {
|
|
77
|
-
passwordScoreRules
|
|
78
|
-
} = this.props;
|
|
79
|
-
const {
|
|
80
|
-
password,
|
|
81
|
-
score,
|
|
82
|
-
unusedRules
|
|
83
|
-
} = await passwordScore(value, passwordScoreRules);
|
|
84
|
-
let intent = 'success';
|
|
85
|
-
let strength = /*#__PURE__*/React.createElement(Translate, {
|
|
86
|
-
content: "FormFieldPassword.strengthVeryStrong",
|
|
87
|
-
fallback: locale.strengthVeryStrong
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
if (score < 16) {
|
|
91
|
-
intent = 'danger';
|
|
92
|
-
strength = /*#__PURE__*/React.createElement(Translate, {
|
|
93
|
-
content: "FormFieldPassword.strengthVeryWeak",
|
|
94
|
-
fallback: locale.strengthVeryWeak
|
|
95
|
-
});
|
|
96
|
-
} else if (score < 25) {
|
|
97
|
-
intent = 'danger';
|
|
98
|
-
strength = /*#__PURE__*/React.createElement(Translate, {
|
|
99
|
-
content: "FormFieldPassword.strengthWeak",
|
|
100
|
-
fallback: locale.strengthWeak
|
|
101
|
-
});
|
|
102
|
-
} else if (score < 35) {
|
|
103
|
-
intent = 'warning';
|
|
104
|
-
strength = /*#__PURE__*/React.createElement(Translate, {
|
|
105
|
-
content: "FormFieldPassword.strengthMedium",
|
|
106
|
-
fallback: locale.strengthMedium
|
|
107
|
-
});
|
|
108
|
-
} else if (score < 45) {
|
|
109
|
-
intent = 'success';
|
|
110
|
-
strength = /*#__PURE__*/React.createElement(Translate, {
|
|
111
|
-
content: "FormFieldPassword.strengthStrong",
|
|
112
|
-
fallback: locale.strengthStrong
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
password,
|
|
118
|
-
intent,
|
|
119
|
-
strength,
|
|
120
|
-
unusedRules
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
renderPasswordMeter(value, target) {
|
|
125
|
-
const {
|
|
126
|
-
passwordMeterVisible
|
|
127
|
-
} = this.state;
|
|
128
|
-
const {
|
|
129
|
-
passwordMeterProps
|
|
130
|
-
} = this.props;
|
|
131
|
-
const {
|
|
132
|
-
password,
|
|
133
|
-
intent,
|
|
134
|
-
strength,
|
|
135
|
-
unusedRules
|
|
136
|
-
} = this.state.scoreResult;
|
|
137
|
-
|
|
138
|
-
if (!!value && value !== password && value !== this.passwordOnScoring) {
|
|
139
|
-
this.passwordOnScoring = value;
|
|
140
|
-
this.passwordScore(value).then(scoreResult => {
|
|
141
|
-
if (this.passwordOnScoring === scoreResult.password) {
|
|
142
|
-
this.passwordOnScoring = null;
|
|
143
|
-
this.setState({
|
|
144
|
-
scoreResult
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return /*#__PURE__*/React.createElement(Popover, _extends({
|
|
151
|
-
visible: passwordMeterVisible && !!value,
|
|
152
|
-
target: target,
|
|
153
|
-
targetRef: this.targetRef,
|
|
154
|
-
placement: "bottom-right",
|
|
155
|
-
intent: intent,
|
|
156
|
-
canCloseOnOutsideClick: false,
|
|
157
|
-
canCloseOnEscapePress: false,
|
|
158
|
-
onClose: this.handleClosePasswordMeter
|
|
159
|
-
}, passwordMeterProps), /*#__PURE__*/React.createElement(Translate, {
|
|
160
|
-
content: "FormFieldPassword.passwordStrength",
|
|
161
|
-
fallback: locale.passwordStrength,
|
|
162
|
-
params: {
|
|
163
|
-
strength: /*#__PURE__*/React.createElement("b", null, strength)
|
|
164
|
-
}
|
|
165
|
-
}), /*#__PURE__*/React.createElement("br", null), unusedRules.length ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Translate, {
|
|
166
|
-
content: "FormFieldPassword.improvePassword",
|
|
167
|
-
fallback: locale.improvePassword
|
|
168
|
-
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("ul", null, unusedRules.slice(0, 3).map(({
|
|
169
|
-
rule
|
|
170
|
-
}, index) => {
|
|
171
|
-
const {
|
|
172
|
-
name
|
|
173
|
-
} = rule;
|
|
174
|
-
let {
|
|
175
|
-
message
|
|
176
|
-
} = rule;
|
|
177
|
-
|
|
178
|
-
if (name && !message) {
|
|
179
|
-
message = /*#__PURE__*/React.createElement(Translate, {
|
|
180
|
-
content: `FormFieldPassword.${name}`,
|
|
181
|
-
fallback: locale[name]
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
186
|
-
key: name || index.toString()
|
|
187
|
-
}, message);
|
|
188
|
-
}))) : /*#__PURE__*/React.createElement(Translate, {
|
|
189
|
-
content: "FormFieldPassword.yourPasswordIsStrong",
|
|
190
|
-
fallback: locale.yourPasswordIsStrong
|
|
191
|
-
}));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
47
|
renderGenerateButton({
|
|
195
48
|
setValue,
|
|
196
49
|
isDisabled
|
|
@@ -232,12 +85,15 @@ class FormFieldPassword extends Component {
|
|
|
232
85
|
hideGenerateButton,
|
|
233
86
|
hidePasswordMeter,
|
|
234
87
|
passwordMeterProps,
|
|
235
|
-
passwordScoreRules,
|
|
236
88
|
size,
|
|
237
89
|
autoFocus,
|
|
238
90
|
autoComplete,
|
|
239
91
|
...props
|
|
240
92
|
} = this.props;
|
|
93
|
+
const {
|
|
94
|
+
visible,
|
|
95
|
+
passwordMeterVisible
|
|
96
|
+
} = this.state;
|
|
241
97
|
return /*#__PURE__*/React.createElement(FormField, _extends({
|
|
242
98
|
className: classNames(baseClassName, className)
|
|
243
99
|
}, props), ({
|
|
@@ -247,18 +103,18 @@ class FormFieldPassword extends Component {
|
|
|
247
103
|
setValue,
|
|
248
104
|
isDisabled
|
|
249
105
|
}) => {
|
|
106
|
+
const value = getValue('');
|
|
250
107
|
const input = /*#__PURE__*/React.createElement(Input, {
|
|
251
108
|
id: getId(),
|
|
252
109
|
name: getName(),
|
|
253
|
-
type:
|
|
254
|
-
value:
|
|
110
|
+
type: visible ? 'text' : 'password',
|
|
111
|
+
value: value,
|
|
255
112
|
onChange: e => {
|
|
256
113
|
setValue(e.target.value);
|
|
257
114
|
this.setState({
|
|
258
115
|
passwordMeterVisible: true
|
|
259
116
|
});
|
|
260
117
|
},
|
|
261
|
-
onFocus: this.handleFocus,
|
|
262
118
|
onBlur: this.handleBlur,
|
|
263
119
|
autoFocus: autoFocus,
|
|
264
120
|
autoComplete: autoComplete,
|
|
@@ -267,8 +123,8 @@ class FormFieldPassword extends Component {
|
|
|
267
123
|
suffix: hideShowButton ? null : /*#__PURE__*/React.createElement(Button, {
|
|
268
124
|
className: `${baseClassName}__button--show`,
|
|
269
125
|
onClick: this.handleToggleClick,
|
|
270
|
-
icon:
|
|
271
|
-
tooltip:
|
|
126
|
+
icon: visible ? 'visible' : 'invisible',
|
|
127
|
+
tooltip: visible ? /*#__PURE__*/React.createElement(Translate, {
|
|
272
128
|
content: "FormFieldPassword.hidePassword",
|
|
273
129
|
fallback: locale.hidePassword
|
|
274
130
|
}) : /*#__PURE__*/React.createElement(Translate, {
|
|
@@ -287,7 +143,12 @@ class FormFieldPassword extends Component {
|
|
|
287
143
|
className: classNames(`${baseClassName}__control`, `${baseClassName}__control--${size}`)
|
|
288
144
|
}, /*#__PURE__*/React.createElement("div", {
|
|
289
145
|
className: classNames(`${baseClassName}__field`, `${baseClassName}__field--${size}`)
|
|
290
|
-
}, hidePasswordMeter ? input :
|
|
146
|
+
}, hidePasswordMeter ? input : /*#__PURE__*/React.createElement(PasswordMeter, _extends({
|
|
147
|
+
value: value,
|
|
148
|
+
targetRef: this.targetRef,
|
|
149
|
+
visible: passwordMeterVisible && value !== '',
|
|
150
|
+
onClose: this.handleClosePasswordMeter
|
|
151
|
+
}, passwordMeterProps), input)), hideGenerateButton ? null : this.renderGenerateButton({
|
|
291
152
|
setValue,
|
|
292
153
|
isDisabled
|
|
293
154
|
}));
|
|
@@ -296,87 +157,17 @@ class FormFieldPassword extends Component {
|
|
|
296
157
|
|
|
297
158
|
}
|
|
298
159
|
|
|
299
|
-
FormFieldPassword
|
|
300
|
-
/**
|
|
301
|
-
* Is show button hidden?
|
|
302
|
-
* @since 0.0.59
|
|
303
|
-
*/
|
|
304
|
-
hideShowButton: PropTypes.bool,
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Is generate button hidden?
|
|
308
|
-
* @since 0.0.59
|
|
309
|
-
*/
|
|
310
|
-
hideGenerateButton: PropTypes.bool,
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Is password meter hidden?
|
|
314
|
-
* @since 0.0.59
|
|
315
|
-
*/
|
|
316
|
-
hidePasswordMeter: PropTypes.bool,
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Additional props for password meter. . See [Popover](#!/Popover) for more information.
|
|
320
|
-
* @since 1.5.6
|
|
321
|
-
*/
|
|
322
|
-
passwordMeterProps: PropTypes.object,
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* A set of custom password score rules.
|
|
326
|
-
* @since 3.21.0
|
|
327
|
-
*/
|
|
328
|
-
passwordScoreRules: PropTypes.arrayOf(PropTypes.shape({
|
|
329
|
-
name: PropTypes.string,
|
|
330
|
-
message: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
331
|
-
score: PropTypes.func.isRequired
|
|
332
|
-
})),
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Size of the control
|
|
336
|
-
* @since 1.5.6
|
|
337
|
-
*/
|
|
338
|
-
size: PropTypes.oneOf(['md', 'lg', 'xl', 'fill']),
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* The browser will automatically focus on the component upon rendering the screen
|
|
342
|
-
* @since 1.9.0
|
|
343
|
-
*/
|
|
344
|
-
autoFocus: PropTypes.bool,
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Prevent password autocompletion.
|
|
348
|
-
* @since 2.5.1
|
|
349
|
-
*/
|
|
350
|
-
autoComplete: PropTypes.oneOf(['new-password']),
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* A render function for customizing the password generation button.
|
|
354
|
-
* @since 3.13.0
|
|
355
|
-
*/
|
|
356
|
-
generateButton: PropTypes.func,
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* @ignore
|
|
360
|
-
*/
|
|
361
|
-
className: PropTypes.string,
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* @ignore
|
|
365
|
-
*/
|
|
366
|
-
baseClassName: PropTypes.string
|
|
367
|
-
};
|
|
368
|
-
FormFieldPassword.defaultProps = {
|
|
160
|
+
_defineProperty(FormFieldPassword, "defaultProps", {
|
|
369
161
|
hideShowButton: false,
|
|
370
162
|
generateButton: undefined,
|
|
371
163
|
hideGenerateButton: false,
|
|
372
164
|
hidePasswordMeter: false,
|
|
373
165
|
passwordMeterProps: {},
|
|
374
|
-
passwordScoreRules: undefined,
|
|
375
166
|
size: 'md',
|
|
376
167
|
autoFocus: undefined,
|
|
377
168
|
autoComplete: undefined,
|
|
378
169
|
className: undefined,
|
|
379
170
|
baseClassName: `${CLS_PREFIX}form-field-password`
|
|
380
|
-
};
|
|
381
|
-
|
|
171
|
+
});
|
|
172
|
+
|
|
382
173
|
export default FormFieldPassword;
|