@decisiv/ui-components 2.0.1-alpha.15 → 2.0.1-alpha.150
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/lib/atoms/BaseButton/index.d.ts.map +1 -1
- package/lib/atoms/BaseButton/index.js +1 -1
- package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/elements.js +8 -3
- package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/index.js +26 -5
- package/lib/atoms/BooleanInput/index.test.js +17 -6
- package/lib/atoms/BooleanInput/types.d.ts +4 -0
- package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/types.js +5 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +46 -6
- package/lib/atoms/Calendar/index.test.js +68 -38
- package/lib/atoms/Calendar/types.d.ts +1 -1
- package/lib/atoms/Calendar/types.d.ts.map +1 -1
- package/lib/atoms/Calendar/types.js +5 -1
- package/lib/atoms/InputField/Containers.d.ts +12 -6
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +8 -6
- package/lib/atoms/InputField/InputLabel.d.ts +1 -0
- package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
- package/lib/atoms/InputField/InputLabel.js +2 -1
- package/lib/atoms/InputField/index.d.ts +6 -0
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +25 -8
- package/lib/atoms/InputField/index.test.js +91 -0
- package/lib/atoms/InputField/schema.d.ts.map +1 -1
- package/lib/atoms/InputField/schema.js +1 -0
- package/lib/atoms/OptionsList/Category.d.ts +1 -1
- package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Category.js +4 -2
- package/lib/atoms/OptionsList/Footer.d.ts +8 -0
- package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Footer.js +72 -0
- package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Option.js +24 -9
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +44 -17
- package/lib/atoms/OptionsList/index.test.js +127 -17
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +5 -0
- package/lib/atoms/OptionsList/types.d.ts +15 -0
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/OptionsList/types.js +5 -1
- package/lib/atoms/RequiredIcon.d.ts +9 -0
- package/lib/atoms/RequiredIcon.d.ts.map +1 -0
- package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
- package/lib/components/Accordion/types.js +5 -1
- package/lib/components/Accordion/useAccordion/types.js +5 -1
- package/lib/components/Alert/Container.d.ts +201 -0
- package/lib/components/Alert/Container.d.ts.map +1 -0
- package/lib/components/Alert/Container.js +26 -0
- package/lib/components/Alert/StyledButton.d.ts +5 -0
- package/lib/components/Alert/StyledButton.d.ts.map +1 -0
- package/lib/components/Alert/StyledButton.js +23 -0
- package/lib/components/Alert/index.d.ts +27 -0
- package/lib/components/Alert/index.d.ts.map +1 -0
- package/lib/components/Alert/index.js +112 -0
- package/lib/components/Alert/index.test.js +79 -0
- package/lib/components/Alert/intents.d.ts +13 -0
- package/lib/components/Alert/intents.d.ts.map +1 -0
- package/lib/components/Alert/intents.js +72 -0
- package/lib/components/Alert/schema.d.ts +3 -0
- package/lib/components/Alert/schema.d.ts.map +1 -0
- package/lib/components/Alert/schema.js +25 -0
- package/lib/components/Alert/types.d.ts +36 -0
- package/lib/components/Alert/types.d.ts.map +1 -0
- package/lib/components/Alert/types.js +32 -0
- package/lib/components/Avatar/types.js +5 -1
- package/lib/components/Badge/constants.d.ts +2 -0
- package/lib/components/Badge/constants.d.ts.map +1 -0
- package/lib/components/Badge/constants.js +29 -0
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +12 -23
- package/lib/components/Badge/index.test.js +51 -8
- package/lib/components/Badge/schema.js +1 -1
- package/lib/components/Badge/types.d.ts +1 -1
- package/lib/components/Badge/types.d.ts.map +1 -1
- package/lib/components/Badge/types.js +7 -3
- package/lib/components/Breadcrumbs/types.js +5 -1
- package/lib/components/Button/StyledButton.d.ts +3 -2
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +21 -7
- package/lib/components/Button/index.d.ts.map +1 -1
- package/lib/components/Button/index.js +19 -9
- package/lib/components/Button/index.test.js +24 -8
- package/lib/components/Button/schema.d.ts +6 -1
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +11 -5
- package/lib/components/Button/types.d.ts +2 -1
- package/lib/components/Button/types.d.ts.map +1 -1
- package/lib/components/Button/types.js +5 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/Checkbox/schema.d.ts.map +1 -1
- package/lib/components/Checkbox/schema.js +2 -0
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +51 -14
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +196 -66
- package/lib/components/Combobox/index.test.js +369 -146
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +10 -2
- package/lib/components/Combobox/types.d.ts +12 -3
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/Combobox/types.js +5 -1
- package/lib/components/DropdownList/index.d.ts +4 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +76 -11
- package/lib/components/DropdownList/propTypes.d.ts +4 -0
- package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
- package/lib/components/DropdownList/propTypes.js +42 -0
- package/lib/components/DropdownList/schema.d.ts.map +1 -1
- package/lib/components/DropdownList/schema.js +5 -0
- package/lib/components/DropdownList/types.d.ts +4 -1
- package/lib/components/DropdownList/types.d.ts.map +1 -1
- package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
- package/lib/components/Filter/IconWrapper/index.js +35 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
- package/lib/components/Filter/SimplePrimary/index.js +58 -0
- package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
- package/lib/components/Filter/StyledFilter.d.ts +4 -0
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
- package/lib/components/Filter/StyledFilter.js +41 -0
- package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
- package/lib/components/Filter/StyledLabel/index.js +30 -0
- package/lib/components/Filter/index.d.ts +5 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +107 -0
- package/lib/components/Filter/index.test.js +60 -0
- package/lib/components/Filter/kind.d.ts +6 -0
- package/lib/components/Filter/kind.d.ts.map +1 -0
- package/lib/components/Filter/kind.js +45 -0
- package/lib/components/Filter/schema.d.ts +9 -0
- package/lib/components/Filter/schema.d.ts.map +1 -0
- package/lib/components/Filter/schema.js +33 -0
- package/lib/components/Filter/types.d.ts +18 -0
- package/lib/components/Filter/types.d.ts.map +1 -0
- package/lib/components/Filter/types.js +5 -0
- package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
- package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.js +3 -3
- package/lib/components/JumpTo/types.js +5 -1
- package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ClickArea.js +2 -2
- package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
- package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
- package/lib/components/LeftNav/Item/types.d.ts +1 -1
- package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/types.js +5 -1
- package/lib/components/LeftNav/index.test.js +13 -3
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +2 -0
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/LeftNav/types.js +5 -1
- package/lib/components/Link/DisabledLink.d.ts +7 -0
- package/lib/components/Link/DisabledLink.d.ts.map +1 -0
- package/lib/components/Link/DisabledLink.js +46 -0
- package/lib/components/Link/Link.d.ts +4 -0
- package/lib/components/Link/Link.d.ts.map +1 -0
- package/lib/components/Link/Link.js +67 -0
- package/lib/components/Link/index.d.ts +4 -23
- package/lib/components/Link/index.d.ts.map +1 -1
- package/lib/components/Link/index.js +20 -158
- package/lib/components/Link/index.test.js +63 -42
- package/lib/components/Link/schema.d.ts.map +1 -1
- package/lib/components/Link/schema.js +2 -1
- package/lib/components/Link/styles.d.ts +20 -0
- package/lib/components/Link/styles.d.ts.map +1 -0
- package/lib/components/Link/styles.js +131 -0
- package/lib/components/Link/types.d.ts +28 -0
- package/lib/components/Link/types.d.ts.map +1 -0
- package/lib/components/Link/types.js +5 -0
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +3 -1
- package/lib/components/Menu/types.d.ts +2 -0
- package/lib/components/Menu/types.d.ts.map +1 -1
- package/lib/components/Menu/types.js +5 -1
- package/lib/components/Modal/components.d.ts +2 -2
- package/lib/components/Modal/types.js +5 -1
- package/lib/components/Notifications/Notification/components.d.ts +3 -3
- package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.js +12 -6
- package/lib/components/Notifications/Notification/index.d.ts +3 -6
- package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/index.js +19 -12
- package/lib/components/Notifications/Notification/index.test.js +38 -19
- package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
- package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
- package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
- package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
- package/lib/components/Notifications/Notifier.test.js +79 -10
- package/lib/components/Notifications/constants.d.ts +2 -0
- package/lib/components/Notifications/constants.d.ts.map +1 -0
- package/lib/components/Notifications/constants.js +16 -0
- package/lib/components/Notifications/schema.d.ts.map +1 -1
- package/lib/components/Notifications/schema.js +2 -1
- package/lib/components/Notifications/useNotifications.d.ts +1 -0
- package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
- package/lib/components/Notifications/useNotifications.test.js +7 -4
- package/lib/components/Pagination/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +1 -0
- package/lib/components/Pagination/Pagination.test.js +9 -0
- package/lib/components/Pagination/types.js +5 -1
- package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
- package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
- package/lib/components/PasswordField/IconWrapper.js +32 -0
- package/lib/components/PasswordField/Input.d.ts +6 -0
- package/lib/components/PasswordField/Input.d.ts.map +1 -0
- package/lib/components/PasswordField/Input.js +28 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
- package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
- package/lib/components/PasswordField/index.d.ts +14 -0
- package/lib/components/PasswordField/index.d.ts.map +1 -0
- package/lib/components/PasswordField/index.js +113 -0
- package/lib/components/PasswordField/index.test.js +217 -0
- package/lib/components/PasswordField/schema.d.ts +3 -0
- package/lib/components/PasswordField/schema.d.ts.map +1 -0
- package/lib/components/PasswordField/schema.js +27 -0
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +6 -3
- package/lib/components/Popover/schema.d.ts.map +1 -1
- package/lib/components/Popover/schema.js +27 -20
- package/lib/components/Popover/types.d.ts +1 -0
- package/lib/components/Popover/types.d.ts.map +1 -1
- package/lib/components/Popover/utils.d.ts +1 -1
- package/lib/components/SearchInput/index.d.ts +11 -0
- package/lib/components/SearchInput/index.d.ts.map +1 -0
- package/lib/components/SearchInput/index.js +190 -0
- package/lib/components/SearchInput/index.test.js +417 -0
- package/lib/components/SearchInput/schema.d.ts +3 -0
- package/lib/components/SearchInput/schema.d.ts.map +1 -0
- package/lib/components/SearchInput/schema.js +24 -0
- package/lib/components/SearchInput/types.d.ts +28 -0
- package/lib/components/SearchInput/types.d.ts.map +1 -0
- package/lib/components/SearchInput/types.js +5 -0
- package/lib/components/Select/Target.d.ts.map +1 -1
- package/lib/components/Select/Target.js +6 -2
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +41 -3
- package/lib/components/Select/index.test.js +82 -23
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +8 -0
- package/lib/components/Select/types.d.ts +5 -1
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/Select/types.js +5 -1
- package/lib/components/SelectDate/Target.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +6 -2
- package/lib/components/SelectDate/index.d.ts.map +1 -1
- package/lib/components/SelectDate/index.js +32 -3
- package/lib/components/SelectDate/index.test.js +108 -51
- package/lib/components/SelectDate/schema.d.ts.map +1 -1
- package/lib/components/SelectDate/schema.js +3 -0
- package/lib/components/SelectDate/types.d.ts +3 -0
- package/lib/components/SelectDate/types.d.ts.map +1 -1
- package/lib/components/SelectDate/types.js +5 -1
- package/lib/components/SelectDateRange/index.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.js +31 -2
- package/lib/components/SelectDateRange/index.test.js +115 -58
- package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
- package/lib/components/SelectDateRange/schema.js +3 -0
- package/lib/components/SelectDateRange/types.js +5 -1
- package/lib/components/SelectMenu/index.d.ts +5 -0
- package/lib/components/SelectMenu/index.d.ts.map +1 -1
- package/lib/components/SelectMenu/index.js +27 -3
- package/lib/components/SelectMenu/schema.d.ts.map +1 -1
- package/lib/components/SelectMenu/schema.js +4 -0
- package/lib/components/Table/Body.d.ts.map +1 -1
- package/lib/components/Table/Body.js +28 -17
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +6 -1
- package/lib/components/Table/DataRow.d.ts.map +1 -1
- package/lib/components/Table/DataRow.js +26 -18
- package/lib/components/Table/Head.d.ts +1 -1
- package/lib/components/Table/Head.d.ts.map +1 -1
- package/lib/components/Table/Head.js +10 -5
- package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/index.js +19 -6
- package/lib/components/Table/HeaderCell/types.d.ts +6 -1
- package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/types.js +5 -1
- package/lib/components/Table/Provider.d.ts +5 -5
- package/lib/components/Table/Provider.d.ts.map +1 -1
- package/lib/components/Table/Provider.js +10 -11
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js +109 -19
- package/lib/components/Table/index.test.js +80 -33
- package/lib/components/Table/schema.columns.d.ts.map +1 -1
- package/lib/components/Table/schema.columns.js +6 -4
- package/lib/components/Table/schema.d.ts.map +1 -1
- package/lib/components/Table/schema.js +7 -6
- package/lib/components/Table/types.d.ts +19 -4
- package/lib/components/Table/types.d.ts.map +1 -1
- package/lib/components/Table/utils.d.ts +2 -8
- package/lib/components/Table/utils.d.ts.map +1 -1
- package/lib/components/Table/utils.js +21 -20
- package/lib/components/Tabs/types.js +5 -1
- package/lib/components/Tag/types.d.ts +1 -1
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/Tag/types.js +5 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/index.js +1 -0
- package/lib/components/TextArea/index.test.js +5 -0
- package/lib/components/TextField/Input.js +1 -1
- package/lib/components/TextField/index.test.js +5 -0
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +4 -0
- package/lib/components/Toggle/index.test.js +39 -10
- package/lib/components/Toggle/types.js +5 -1
- package/lib/components/Tooltip/index.d.ts.map +1 -1
- package/lib/components/Tooltip/index.js +3 -13
- package/lib/components/Tooltip/schema.d.ts +3 -0
- package/lib/components/Tooltip/schema.d.ts.map +1 -0
- package/lib/components/Tooltip/schema.js +29 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +50 -0
- package/lib/modifiers/spacingSchema.d.ts.map +1 -1
- package/lib/modifiers/spacingSchema.js +29 -16
- package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/index.js +5 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +14 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +14 -0
- package/lib/providers/NotificationsProvider/index.d.ts +6 -5
- package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
- package/lib/providers/NotificationsProvider/index.js +47 -28
- package/lib/providers/NotificationsProvider/types.d.ts +4 -1
- package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
- package/lib/utils/joinClassnames.d.ts +3 -0
- package/lib/utils/joinClassnames.d.ts.map +1 -0
- package/lib/utils/joinClassnames.js +26 -0
- package/lib/utils/useFirstMount.d.ts +2 -0
- package/lib/utils/useFirstMount.d.ts.map +1 -0
- package/lib/utils/useFirstMount.js +19 -0
- package/lib/utils/useUpdateEffect.d.ts +4 -0
- package/lib/utils/useUpdateEffect.d.ts.map +1 -0
- package/lib/utils/useUpdateEffect.js +28 -0
- package/package.json +2 -2
- package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
- package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
|
@@ -49,6 +49,7 @@ function Pagination(props) {
|
|
|
49
49
|
currentPage = _useState2[0],
|
|
50
50
|
setCurrentPage = _useState2[1];
|
|
51
51
|
|
|
52
|
+
if (totalPages <= 1) return null;
|
|
52
53
|
var activePageIsControlled = typeof activePage !== 'undefined';
|
|
53
54
|
|
|
54
55
|
if (activePageIsControlled && activePage !== currentPage) {
|
|
@@ -245,4 +245,13 @@ describe('Pagination', function () {
|
|
|
245
245
|
expect(onPageChange).toHaveBeenCalledWith(props.activePage + 1, props.activePage);
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
|
+
it("doesn't display when there is only 1 page", function () {
|
|
249
|
+
var _renderPagination17 = renderPagination(_objectSpread({}, defaultProps, {
|
|
250
|
+
totalPages: 1,
|
|
251
|
+
defaultActivePage: 1
|
|
252
|
+
})),
|
|
253
|
+
container = _renderPagination17.container;
|
|
254
|
+
|
|
255
|
+
expect(container).toBeEmpty();
|
|
256
|
+
});
|
|
248
257
|
});
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const IconWrapper: import("styled-components").StyledComponent<"div", any, Partial<{
|
|
3
|
+
readonly alignContent?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
4
|
+
readonly XS: "XS";
|
|
5
|
+
readonly SM: "SM";
|
|
6
|
+
readonly MD: "MD";
|
|
7
|
+
readonly LG: "LG";
|
|
8
|
+
readonly XL: "XL";
|
|
9
|
+
}> | undefined;
|
|
10
|
+
readonly alignItems?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
11
|
+
readonly XS: "XS";
|
|
12
|
+
readonly SM: "SM";
|
|
13
|
+
readonly MD: "MD";
|
|
14
|
+
readonly LG: "LG";
|
|
15
|
+
readonly XL: "XL";
|
|
16
|
+
}> | undefined;
|
|
17
|
+
readonly alignSelf?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
18
|
+
readonly XS: "XS";
|
|
19
|
+
readonly SM: "SM";
|
|
20
|
+
readonly MD: "MD";
|
|
21
|
+
readonly LG: "LG";
|
|
22
|
+
readonly XL: "XL";
|
|
23
|
+
}> | undefined;
|
|
24
|
+
readonly flex?: string | number | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("react").ReactText, {
|
|
25
|
+
readonly XS: "XS";
|
|
26
|
+
readonly SM: "SM";
|
|
27
|
+
readonly MD: "MD";
|
|
28
|
+
readonly LG: "LG";
|
|
29
|
+
readonly XL: "XL";
|
|
30
|
+
}> | undefined;
|
|
31
|
+
readonly flexBasis?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
32
|
+
readonly XS: "XS";
|
|
33
|
+
readonly SM: "SM";
|
|
34
|
+
readonly MD: "MD";
|
|
35
|
+
readonly LG: "LG";
|
|
36
|
+
readonly XL: "XL";
|
|
37
|
+
}> | undefined;
|
|
38
|
+
readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "row" | "column" | "column-reverse" | "row-reverse" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexDirectionProperty, {
|
|
39
|
+
readonly XS: "XS";
|
|
40
|
+
readonly SM: "SM";
|
|
41
|
+
readonly MD: "MD";
|
|
42
|
+
readonly LG: "LG";
|
|
43
|
+
readonly XL: "XL";
|
|
44
|
+
}> | undefined;
|
|
45
|
+
readonly flexGrow?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
|
|
46
|
+
readonly XS: "XS";
|
|
47
|
+
readonly SM: "SM";
|
|
48
|
+
readonly MD: "MD";
|
|
49
|
+
readonly LG: "LG";
|
|
50
|
+
readonly XL: "XL";
|
|
51
|
+
}> | undefined;
|
|
52
|
+
readonly flexShrink?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
|
|
53
|
+
readonly XS: "XS";
|
|
54
|
+
readonly SM: "SM";
|
|
55
|
+
readonly MD: "MD";
|
|
56
|
+
readonly LG: "LG";
|
|
57
|
+
readonly XL: "XL";
|
|
58
|
+
}> | undefined;
|
|
59
|
+
readonly flexWrap?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "nowrap" | "wrap" | "wrap-reverse" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexWrapProperty, {
|
|
60
|
+
readonly XS: "XS";
|
|
61
|
+
readonly SM: "SM";
|
|
62
|
+
readonly MD: "MD";
|
|
63
|
+
readonly LG: "LG";
|
|
64
|
+
readonly XL: "XL";
|
|
65
|
+
}> | undefined;
|
|
66
|
+
readonly justifyContent?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
67
|
+
readonly XS: "XS";
|
|
68
|
+
readonly SM: "SM";
|
|
69
|
+
readonly MD: "MD";
|
|
70
|
+
readonly LG: "LG";
|
|
71
|
+
readonly XL: "XL";
|
|
72
|
+
}> | undefined;
|
|
73
|
+
readonly justifyItems?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
74
|
+
readonly XS: "XS";
|
|
75
|
+
readonly SM: "SM";
|
|
76
|
+
readonly MD: "MD";
|
|
77
|
+
readonly LG: "LG";
|
|
78
|
+
readonly XL: "XL";
|
|
79
|
+
}> | undefined;
|
|
80
|
+
readonly justifySelf?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
|
|
81
|
+
readonly XS: "XS";
|
|
82
|
+
readonly SM: "SM";
|
|
83
|
+
readonly MD: "MD";
|
|
84
|
+
readonly LG: "LG";
|
|
85
|
+
readonly XL: "XL";
|
|
86
|
+
}> | undefined;
|
|
87
|
+
readonly order?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
|
|
88
|
+
readonly XS: "XS";
|
|
89
|
+
readonly SM: "SM";
|
|
90
|
+
readonly MD: "MD";
|
|
91
|
+
readonly LG: "LG";
|
|
92
|
+
readonly XL: "XL";
|
|
93
|
+
}> | undefined;
|
|
94
|
+
readonly size?: "XS" | "SM" | "MD" | "LG" | "XL" | undefined;
|
|
95
|
+
}> & Partial<{
|
|
96
|
+
readonly margin: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
97
|
+
readonly XS: "XS";
|
|
98
|
+
readonly SM: "SM";
|
|
99
|
+
readonly MD: "MD";
|
|
100
|
+
readonly LG: "LG";
|
|
101
|
+
readonly XL: "XL";
|
|
102
|
+
}>;
|
|
103
|
+
readonly marginBottom: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
104
|
+
readonly XS: "XS";
|
|
105
|
+
readonly SM: "SM";
|
|
106
|
+
readonly MD: "MD";
|
|
107
|
+
readonly LG: "LG";
|
|
108
|
+
readonly XL: "XL";
|
|
109
|
+
}>;
|
|
110
|
+
readonly marginLeft: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
111
|
+
readonly XS: "XS";
|
|
112
|
+
readonly SM: "SM";
|
|
113
|
+
readonly MD: "MD";
|
|
114
|
+
readonly LG: "LG";
|
|
115
|
+
readonly XL: "XL";
|
|
116
|
+
}>;
|
|
117
|
+
readonly marginRight: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
118
|
+
readonly XS: "XS";
|
|
119
|
+
readonly SM: "SM";
|
|
120
|
+
readonly MD: "MD";
|
|
121
|
+
readonly LG: "LG";
|
|
122
|
+
readonly XL: "XL";
|
|
123
|
+
}>;
|
|
124
|
+
readonly marginTop: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
125
|
+
readonly XS: "XS";
|
|
126
|
+
readonly SM: "SM";
|
|
127
|
+
readonly MD: "MD";
|
|
128
|
+
readonly LG: "LG";
|
|
129
|
+
readonly XL: "XL";
|
|
130
|
+
}>;
|
|
131
|
+
readonly marginX: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
132
|
+
readonly XS: "XS";
|
|
133
|
+
readonly SM: "SM";
|
|
134
|
+
readonly MD: "MD";
|
|
135
|
+
readonly LG: "LG";
|
|
136
|
+
readonly XL: "XL";
|
|
137
|
+
}>;
|
|
138
|
+
readonly marginY: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
139
|
+
readonly XS: "XS";
|
|
140
|
+
readonly SM: "SM";
|
|
141
|
+
readonly MD: "MD";
|
|
142
|
+
readonly LG: "LG";
|
|
143
|
+
readonly XL: "XL";
|
|
144
|
+
}>;
|
|
145
|
+
readonly padding: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
146
|
+
readonly XS: "XS";
|
|
147
|
+
readonly SM: "SM";
|
|
148
|
+
readonly MD: "MD";
|
|
149
|
+
readonly LG: "LG";
|
|
150
|
+
readonly XL: "XL";
|
|
151
|
+
}>;
|
|
152
|
+
readonly paddingBottom: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
153
|
+
readonly XS: "XS";
|
|
154
|
+
readonly SM: "SM";
|
|
155
|
+
readonly MD: "MD";
|
|
156
|
+
readonly LG: "LG";
|
|
157
|
+
readonly XL: "XL";
|
|
158
|
+
}>;
|
|
159
|
+
readonly paddingLeft: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
160
|
+
readonly XS: "XS";
|
|
161
|
+
readonly SM: "SM";
|
|
162
|
+
readonly MD: "MD";
|
|
163
|
+
readonly LG: "LG";
|
|
164
|
+
readonly XL: "XL";
|
|
165
|
+
}>;
|
|
166
|
+
readonly paddingRight: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
167
|
+
readonly XS: "XS";
|
|
168
|
+
readonly SM: "SM";
|
|
169
|
+
readonly MD: "MD";
|
|
170
|
+
readonly LG: "LG";
|
|
171
|
+
readonly XL: "XL";
|
|
172
|
+
}>;
|
|
173
|
+
readonly paddingTop: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
174
|
+
readonly XS: "XS";
|
|
175
|
+
readonly SM: "SM";
|
|
176
|
+
readonly MD: "MD";
|
|
177
|
+
readonly LG: "LG";
|
|
178
|
+
readonly XL: "XL";
|
|
179
|
+
}>;
|
|
180
|
+
readonly paddingX: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
181
|
+
readonly XS: "XS";
|
|
182
|
+
readonly SM: "SM";
|
|
183
|
+
readonly MD: "MD";
|
|
184
|
+
readonly LG: "LG";
|
|
185
|
+
readonly XL: "XL";
|
|
186
|
+
}>;
|
|
187
|
+
readonly paddingY: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
|
|
188
|
+
readonly XS: "XS";
|
|
189
|
+
readonly SM: "SM";
|
|
190
|
+
readonly MD: "MD";
|
|
191
|
+
readonly LG: "LG";
|
|
192
|
+
readonly XL: "XL";
|
|
193
|
+
}>;
|
|
194
|
+
}> & {
|
|
195
|
+
disabled?: boolean | undefined;
|
|
196
|
+
}, never>;
|
|
197
|
+
export default IconWrapper;
|
|
198
|
+
//# sourceMappingURL=IconWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordField/IconWrapper.tsx"],"names":[],"mappings":";AAUA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAqBhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
11
|
+
|
|
12
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
13
|
+
|
|
14
|
+
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
15
|
+
|
|
16
|
+
var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
|
|
17
|
+
|
|
18
|
+
var _Flex = _interopRequireDefault(require("../Flex"));
|
|
19
|
+
|
|
20
|
+
var _focusRingWithColor = _interopRequireDefault(require("../../utils/focusRingWithColor"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
var IconWrapper = (0, _styledComponents.default)(_Flex.default).withConfig({
|
|
25
|
+
displayName: "IconWrapper",
|
|
26
|
+
componentId: "z9032r-0"
|
|
27
|
+
})(["margin-right:", ";cursor:pointer;width:", ";height:", ";flex-direction:column;justify-content:center;border-radius:", ";border:1px solid transparent;&,&:hover{color:", ";}&:focus{", ";border:1px solid ", ";outline:none;"], (0, _rem.default)(_spacing.default.base * 0.2), (0, _rem.default)(_spacing.default.base * 1.8), (0, _rem.default)(_spacing.default.base * 3), (0, _rem.default)(_spacing.default.base * 0.2), function (_ref) {
|
|
28
|
+
var disabled = _ref.disabled;
|
|
29
|
+
return (0, _toColorString.default)(disabled ? _color.default.opacity.charcoal40 : _color.default.interaction.pacificOcean);
|
|
30
|
+
}, (0, _focusRingWithColor.default)(_color.default.interaction.pacificOcean40), (0, _toColorString.default)(_color.default.interaction.pacificOcean));
|
|
31
|
+
var _default = IconWrapper;
|
|
32
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordField/Input.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,KAAK;;;SAmDV,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _designTokens = require("@decisiv/design-tokens");
|
|
11
|
+
|
|
12
|
+
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
13
|
+
|
|
14
|
+
var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
|
|
15
|
+
|
|
16
|
+
var _styleModifiers = require("../../utils/styleModifiers");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
21
|
+
|
|
22
|
+
var Input = _styledComponents.default.input.withConfig({
|
|
23
|
+
displayName: "Input",
|
|
24
|
+
componentId: "sc-1kueen6-0"
|
|
25
|
+
})(["font-family:", ";font-size:", ";font-weight:", ";overflow:visible;&::-moz-focus-inner{border:0;padding:0;margin:0;}background-color:inherit;border:transparent;display:block;line-height:140%;padding-right:", ";padding-left:", ";width:100%;", " ", " ", " &:active,&:focus{outline:none;}"], _designTokens.typography.typeface.default, (0, _rem.default)(_designTokens.typography.size.alias.default), _designTokens.typography.weight.alias.default, (0, _rem.default)(_spacing.default.base), (0, _rem.default)(_spacing.default.base * 0.1), (0, _styleModifiers.whenNot)('passwordVisible', (0, _styledComponents.css)(["padding-bottom:", ";height:", ";font-size:", ";"], (0, _rem.default)(_spacing.default.base * 0.6), (0, _rem.default)(_designTokens.typography.height.alias.default * 8), (0, _rem.default)(_designTokens.typography.size.alias.header1))), (0, _styleModifiers.whenAll)([['hideLabel', true], ['passwordVisible', false]], (0, _styledComponents.css)(["margin-top:", ";padding-bottom:", ";margin-top:", ";"], (0, _rem.default)(_spacing.default.base * 0.2), (0, _rem.default)(_spacing.default.base * 0.4), (0, _rem.default)(_spacing.default.base * 0.4))), (0, _styleModifiers.whenAll)([['passwordVisible', true]], (0, _styledComponents.css)(["padding-bottom:", ";"], (0, _rem.default)(_spacing.default.base * 0.6))));
|
|
26
|
+
|
|
27
|
+
var _default = Input;
|
|
28
|
+
exports.default = _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ShowPasswordButtonInterface {
|
|
3
|
+
showPassword?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onClick?: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
|
|
6
|
+
}
|
|
7
|
+
export default function ShowPasswordButton({ showPassword, onClick, disabled, }: ShowPasswordButtonInterface): JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ShowPasswordButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShowPasswordButton.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordField/ShowPasswordButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAS3C,MAAM,WAAW,2BAA2B;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;CACxE;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,EAAE,2BAA2B,GAAG,GAAG,CAAC,OAAO,CAqC3C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ShowPasswordButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _EyeAlt = _interopRequireDefault(require("@decisiv/iconix/lib/components/EyeAlt"));
|
|
11
|
+
|
|
12
|
+
var _EyeSlash = _interopRequireDefault(require("@decisiv/iconix/lib/components/EyeSlash"));
|
|
13
|
+
|
|
14
|
+
var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
15
|
+
|
|
16
|
+
var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
|
|
17
|
+
|
|
18
|
+
var _IconWrapper = _interopRequireDefault(require("./IconWrapper"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
23
|
+
|
|
24
|
+
function ShowPasswordButton(_ref) {
|
|
25
|
+
var showPassword = _ref.showPassword,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
disabled = _ref.disabled;
|
|
28
|
+
var translate = (0, _useTranslations.default)();
|
|
29
|
+
var EyeIcon = showPassword ? _EyeSlash.default : _EyeAlt.default;
|
|
30
|
+
var tooltipText = showPassword ? translate(undefined, 'passwordField.hidePassword') : translate(undefined, 'passwordField.showPassword');
|
|
31
|
+
var handleKeyPress = (0, _react.useCallback)(function (event) {
|
|
32
|
+
if (event.key === 'Enter') onClick && onClick(event);
|
|
33
|
+
}, [onClick]);
|
|
34
|
+
return _react.default.createElement(_Tooltip.default, {
|
|
35
|
+
placement: "top",
|
|
36
|
+
target: // eslint-disable-next-line react/jsx-wrap-multilines
|
|
37
|
+
_react.default.createElement(_IconWrapper.default, {
|
|
38
|
+
tabIndex: 0,
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
onKeyPress: handleKeyPress
|
|
41
|
+
}, _react.default.createElement(EyeIcon, {
|
|
42
|
+
onClick: onClick,
|
|
43
|
+
"data-testid": "toggle-password-visible",
|
|
44
|
+
role: "button",
|
|
45
|
+
"aria-expanded": showPassword
|
|
46
|
+
}))
|
|
47
|
+
}, tooltipText);
|
|
48
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { RefForwardingComponent } from 'react';
|
|
2
|
+
import { BaseInputFieldProps } from '../../atoms/InputField';
|
|
3
|
+
export declare type TextInputRef = HTMLInputElement;
|
|
4
|
+
export interface PasswordFieldProps extends Omit<React.InputHTMLAttributes<TextInputRef>, 'icon' | 'readOnly' | 'label'>, Omit<BaseInputFieldProps, 'children' | 'onClick'> {
|
|
5
|
+
onBlur?: React.FocusEventHandler;
|
|
6
|
+
onChange?: React.ChangeEventHandler<TextInputRef>;
|
|
7
|
+
onFocus?: React.FocusEventHandler;
|
|
8
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
9
|
+
initialPasswordVisible?: boolean;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
declare const PasswordFieldWithRef: RefForwardingComponent<TextInputRef, PasswordFieldProps>;
|
|
13
|
+
export default PasswordFieldWithRef;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PasswordField/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAEZ,sBAAsB,EAMvB,MAAM,OAAO,CAAC;AAGf,OAAmB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AASzE,oBAAY,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,WAAW,kBACf,SAAQ,IAAI,CACR,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,EACvC,MAAM,GAAG,UAAU,GAAG,OAAO,CAC9B,EACD,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC;IACvC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAmED,QAAA,MAAM,oBAAoB,EAAE,sBAAsB,CAChD,YAAY,EACZ,kBAAkB,CACS,CAAC;AAQ9B,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _isNil = _interopRequireDefault(require("lodash/isNil"));
|
|
13
|
+
|
|
14
|
+
var _InputField = _interopRequireDefault(require("../../atoms/InputField"));
|
|
15
|
+
|
|
16
|
+
var _Flex = _interopRequireDefault(require("../Flex"));
|
|
17
|
+
|
|
18
|
+
var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
|
|
19
|
+
|
|
20
|
+
var _Input = _interopRequireDefault(require("./Input"));
|
|
21
|
+
|
|
22
|
+
var _schema = _interopRequireDefault(require("./schema"));
|
|
23
|
+
|
|
24
|
+
var _ShowPasswordButton = _interopRequireDefault(require("./ShowPasswordButton"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
37
|
+
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
39
|
+
|
|
40
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
41
|
+
|
|
42
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
|
+
|
|
44
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
+
|
|
46
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
47
|
+
|
|
48
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
49
|
+
|
|
50
|
+
function PasswordField(_ref, ref) {
|
|
51
|
+
var hideLabel = _ref.hideLabel,
|
|
52
|
+
initialPasswordVisible = _ref.initialPasswordVisible,
|
|
53
|
+
disabled = _ref.disabled,
|
|
54
|
+
props = _objectWithoutProperties(_ref, ["hideLabel", "initialPasswordVisible", "disabled"]);
|
|
55
|
+
|
|
56
|
+
var _useState = (0, _react.useState)(!!initialPasswordVisible),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
showPassword = _useState2[0],
|
|
59
|
+
setShowPassword = _useState2[1];
|
|
60
|
+
|
|
61
|
+
var translate = (0, _useTranslations.default)();
|
|
62
|
+
var inputRef = (0, _react.useRef)(null);
|
|
63
|
+
var handleClick = (0, _react.useCallback)(function () {
|
|
64
|
+
setShowPassword(!showPassword);
|
|
65
|
+
}, [showPassword, setShowPassword]);
|
|
66
|
+
var inputType = showPassword ? 'text' : 'password'; // Moving cursor to the end after re-rendering input because of `type`
|
|
67
|
+
|
|
68
|
+
(0, _react.useEffect)(function () {
|
|
69
|
+
if (!(0, _isNil.default)(inputRef) && !(0, _isNil.default)(inputRef.current)) {
|
|
70
|
+
inputRef.current.selectionStart = inputRef.current.value.length;
|
|
71
|
+
inputRef.current.selectionEnd = inputRef.current.value.length;
|
|
72
|
+
}
|
|
73
|
+
}, [inputType]);
|
|
74
|
+
var setInputRef = (0, _react.useCallback)(function (propRef) {
|
|
75
|
+
return function (element) {
|
|
76
|
+
inputRef.current = element; // eslint-disable-next-line no-param-reassign
|
|
77
|
+
|
|
78
|
+
propRef.current = element;
|
|
79
|
+
};
|
|
80
|
+
}, []);
|
|
81
|
+
return _react.default.createElement(_InputField.default, _extends({}, props, {
|
|
82
|
+
disabled: disabled,
|
|
83
|
+
label: translate(undefined, 'passwordField.password'),
|
|
84
|
+
hideLabel: hideLabel,
|
|
85
|
+
ref: ref,
|
|
86
|
+
secondaryElement: // eslint-disable-next-line react/jsx-wrap-multilines
|
|
87
|
+
_react.default.createElement(_ShowPasswordButton.default, {
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
showPassword: showPassword,
|
|
90
|
+
onClick: disabled ? undefined : handleClick
|
|
91
|
+
})
|
|
92
|
+
}), function (p) {
|
|
93
|
+
return _react.default.createElement(_Flex.default, {
|
|
94
|
+
flexDirection: "row",
|
|
95
|
+
flex: 1
|
|
96
|
+
}, _react.default.createElement(_Input.default, _extends({}, p, {
|
|
97
|
+
ref: setInputRef(p.ref),
|
|
98
|
+
role: "password",
|
|
99
|
+
passwordVisible: showPassword,
|
|
100
|
+
hideLabel: hideLabel,
|
|
101
|
+
type: inputType,
|
|
102
|
+
"data-testid": "password-input"
|
|
103
|
+
})));
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var PasswordFieldWithRef = (0, _react.forwardRef)(PasswordField);
|
|
108
|
+
PasswordFieldWithRef.displayName = 'TextField';
|
|
109
|
+
PasswordFieldWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
110
|
+
icon: _propTypes.default.elementType
|
|
111
|
+
});
|
|
112
|
+
var _default = PasswordFieldWithRef;
|
|
113
|
+
exports.default = _default;
|