@laerdal/life-react-components 2.3.1-dev.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AuthPage/AuthPage.cjs +1 -1
- package/dist/AuthPage/AuthPage.cjs.map +1 -1
- package/dist/AuthPage/AuthPage.d.ts +1 -0
- package/dist/AuthPage/AuthPage.js +1 -1
- package/dist/AuthPage/AuthPage.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +34 -32
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/Breadcrumb/Breadcrumb.js +34 -32
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +1 -1
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/HorizontalCard/types.cjs.map +1 -1
- package/dist/Card/HorizontalCard/types.d.ts +1 -1
- package/dist/Card/HorizontalCard/types.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +19 -5
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +2 -0
- package/dist/Dropdown/BasicDropdown.js +19 -5
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +6 -3
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +3 -1
- package/dist/Dropdown/CommonStyling.js +6 -3
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownButtonTypes.d.ts +1 -0
- package/dist/Dropdown/DropdownFilter.cjs +14 -2
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +1 -0
- package/dist/Dropdown/DropdownFilter.js +14 -2
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Footer/Components/FooterBottomLinks.d.ts +1 -0
- package/dist/Footer/Components/FooterDropdownLinks.d.ts +1 -0
- package/dist/Footer/Components/FooterNavSection.d.ts +1 -0
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.d.ts +1 -0
- package/dist/Footer/Components/FooterTop.d.ts +1 -0
- package/dist/Footer/Footer.d.ts +1 -0
- package/dist/Footer/SiteFooter.cjs +30 -19
- package/dist/Footer/SiteFooter.cjs.map +1 -1
- package/dist/Footer/SiteFooter.d.ts +3 -1
- package/dist/Footer/SiteFooter.js +31 -19
- package/dist/Footer/SiteFooter.js.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +3 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js +3 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +2 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js +2 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs +7 -2
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.d.ts +5 -0
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js +6 -5
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +205 -56
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +2 -2
- package/dist/GlobalNavigationBar/desktop/MainMenu.js +205 -56
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs +259 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs.map +1 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.d.ts +21 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.js +249 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.js.map +1 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.d.ts +1 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -0
- package/dist/GlobalNavigationBar/types.cjs.map +1 -1
- package/dist/GlobalNavigationBar/types.d.ts +12 -2
- package/dist/GlobalNavigationBar/types.js.map +1 -1
- package/dist/GlobalNavigationBar/utils.cjs +17 -0
- package/dist/GlobalNavigationBar/utils.cjs.map +1 -0
- package/dist/GlobalNavigationBar/utils.d.ts +2 -0
- package/dist/GlobalNavigationBar/utils.js +10 -0
- package/dist/GlobalNavigationBar/utils.js.map +1 -0
- package/dist/InputFields/DatepickerField.cjs +23 -8
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +20 -1
- package/dist/InputFields/DatepickerField.js +23 -8
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs +2 -4
- package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.d.ts +1 -0
- package/dist/InputFields/DatepickerFieldHeader.js +2 -4
- package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.d.ts +1 -1
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +18 -6
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.d.ts +17 -0
- package/dist/InputFields/NumberField.js +18 -6
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.d.ts +15 -1
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.d.ts +1 -1
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.d.ts +16 -3
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.d.ts +2 -2
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +14 -2
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +22 -1
- package/dist/InputFields/TextField.js +14 -2
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/index.cjs.map +1 -1
- package/dist/InputFields/index.d.ts +10 -8
- package/dist/InputFields/index.js.map +1 -1
- package/dist/InputFields/styling.cjs +7 -3
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +1 -0
- package/dist/InputFields/styling.js +7 -3
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/InputFields/types.cjs.map +1 -1
- package/dist/InputFields/types.d.ts +0 -19
- package/dist/InputFields/types.js.map +1 -1
- package/dist/Layouts/index.cjs +4 -6
- package/dist/Layouts/index.cjs.map +1 -1
- package/dist/Layouts/index.d.ts +0 -1
- package/dist/Layouts/index.js +3 -4
- package/dist/Layouts/index.js.map +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.d.ts +1 -0
- package/dist/MiniProductCard/MiniProductCard.d.ts +1 -0
- package/dist/Modals/ModalContent.cjs +1 -1
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +1 -1
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +1 -1
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +1 -1
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/NavItem/NavItem.cjs +2 -1
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.d.ts +1 -0
- package/dist/NavItem/NavItem.js +1 -1
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/NavItem/NestedNavItem.cjs +38 -0
- package/dist/NavItem/NestedNavItem.cjs.map +1 -0
- package/dist/NavItem/NestedNavItem.d.ts +13 -0
- package/dist/NavItem/NestedNavItem.js +28 -0
- package/dist/NavItem/NestedNavItem.js.map +1 -0
- package/dist/Paginator/Paginator.d.ts +1 -0
- package/dist/Panel/Panel.cjs +4 -4
- package/dist/Panel/Panel.cjs.map +1 -1
- package/dist/Panel/Panel.js +5 -5
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/SideMenu/SideMenuBody.d.ts +1 -0
- package/dist/SideMenu/SideMenuFooter.d.ts +1 -0
- package/dist/SideMenu/SideMenuHeader.d.ts +1 -0
- package/dist/SideMenu/types.d.ts +1 -0
- package/dist/Switcher/MobileCustomMenuContent.cjs +3 -0
- package/dist/Switcher/MobileCustomMenuContent.cjs.map +1 -1
- package/dist/Switcher/MobileCustomMenuContent.d.ts +1 -0
- package/dist/Switcher/MobileCustomMenuContent.js +3 -0
- package/dist/Switcher/MobileCustomMenuContent.js.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.d.ts +1 -0
- package/dist/Table/TableTypes.d.ts +1 -0
- package/dist/Tabs/TabLink.cjs +74 -48
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.d.ts +14 -10
- package/dist/Tabs/TabLink.js +74 -48
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tabs/VerticalTabs.cjs +2 -0
- package/dist/Tabs/VerticalTabs.cjs.map +1 -1
- package/dist/Tabs/VerticalTabs.d.ts +1 -0
- package/dist/Tabs/VerticalTabs.js +2 -0
- package/dist/Tabs/VerticalTabs.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +3 -3
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.d.ts +1 -0
- package/dist/Tile/TileCommonItems.js +3 -3
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Toggles/TogglerTypes.d.ts +1 -0
- package/dist/Tooltips/TooltipOverflow.cjs +112 -0
- package/dist/Tooltips/TooltipOverflow.cjs.map +1 -0
- package/dist/Tooltips/TooltipOverflow.d.ts +10 -0
- package/dist/Tooltips/TooltipOverflow.js +102 -0
- package/dist/Tooltips/TooltipOverflow.js.map +1 -0
- package/dist/Tooltips/TooltipStyles.cjs +8 -5
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.d.ts +3 -1
- package/dist/Tooltips/TooltipStyles.js +8 -5
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/Tooltips/TooltipTypes.d.ts +1 -0
- package/dist/Tooltips/TooltipWrapper.cjs +2 -1
- package/dist/Tooltips/TooltipWrapper.cjs.map +1 -1
- package/dist/Tooltips/TooltipWrapper.d.ts +1 -0
- package/dist/Tooltips/TooltipWrapper.js +2 -1
- package/dist/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/icons/contenticons/Stock.cjs +41 -0
- package/dist/icons/contenticons/Stock.cjs.map +1 -0
- package/dist/icons/contenticons/Stock.d.ts +3 -0
- package/dist/icons/contenticons/Stock.js +30 -0
- package/dist/icons/contenticons/Stock.js.map +1 -0
- package/dist/icons/contenticons/index.cjs +88 -0
- package/dist/icons/contenticons/index.cjs.map +1 -1
- package/dist/icons/contenticons/index.d.ts +8 -0
- package/dist/icons/contenticons/index.js +8 -0
- package/dist/icons/contenticons/index.js.map +1 -1
- package/dist/icons/index.cjs +1 -1
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/systemicons/LegendStrokeDashed.cjs +41 -0
- package/dist/icons/systemicons/LegendStrokeDashed.cjs.map +1 -0
- package/dist/icons/systemicons/LegendStrokeDashed.d.ts +3 -0
- package/dist/icons/systemicons/LegendStrokeDashed.js +30 -0
- package/dist/icons/systemicons/LegendStrokeDashed.js.map +1 -0
- package/dist/icons/systemicons/LegendStrokeSolid.cjs +41 -0
- package/dist/icons/systemicons/LegendStrokeSolid.cjs.map +1 -0
- package/dist/icons/systemicons/LegendStrokeSolid.d.ts +3 -0
- package/dist/icons/systemicons/LegendStrokeSolid.js +30 -0
- package/dist/icons/systemicons/LegendStrokeSolid.js.map +1 -0
- package/dist/icons/systemicons/Pin.cjs +41 -0
- package/dist/icons/systemicons/Pin.cjs.map +1 -0
- package/dist/icons/systemicons/Pin.d.ts +3 -0
- package/dist/icons/systemicons/Pin.js +30 -0
- package/dist/icons/systemicons/Pin.js.map +1 -0
- package/dist/icons/systemicons/ZoomOut.cjs +41 -0
- package/dist/icons/systemicons/ZoomOut.cjs.map +1 -0
- package/dist/icons/systemicons/ZoomOut.d.ts +3 -0
- package/dist/icons/systemicons/ZoomOut.js +30 -0
- package/dist/icons/systemicons/ZoomOut.js.map +1 -0
- package/dist/icons/systemicons/index.cjs +250 -8
- package/dist/icons/systemicons/index.cjs.map +1 -1
- package/dist/icons/systemicons/index.d.ts +23 -1
- package/dist/icons/systemicons/index.js +23 -1
- package/dist/icons/systemicons/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
5
5
|
import _pt from "prop-types";
|
|
6
|
-
var _excluded = ["disabled", "readOnly", "onChange", "invalid", "value", "validationMessage", "dateFormat", "autoComplete", "placeholder", "required", "yearPicker", "yearsBeforeCurrentDate", "yearsAfterCurrentDate", "margin", "onBlur", "id", "dataTestId"];
|
|
6
|
+
var _excluded = ["disabled", "readOnly", "onChange", "invalid", "value", "validationMessage", "dateFormat", "autoComplete", "placeholder", "required", "yearPicker", "yearsBeforeCurrentDate", "yearsAfterCurrentDate", "margin", "overflowTooltipPosition", "onBlur", "id", "dataTestId"];
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -29,6 +29,7 @@ import COLORS from '../styles/colors';
|
|
|
29
29
|
import { SystemIcons } from '../icons';
|
|
30
30
|
import { DatepickerFieldHeader } from './DatepickerFieldHeader';
|
|
31
31
|
import { ComponentTextStyle, focusStyles, scrollBarStyling } from '../styles';
|
|
32
|
+
import TooltipOverflow from '../Tooltips/TooltipOverflow';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Import custom styles.
|
|
@@ -49,7 +50,7 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
49
50
|
/**
|
|
50
51
|
* Add custom styles.
|
|
51
52
|
*/
|
|
52
|
-
var DatePickerContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .react-datepicker-popper {\n z-index: ", ";\n }\n\n > div {\n display: block;\n\n ", "\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n .react-datepicker__input-container{\n z-index: 0;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height:
|
|
53
|
+
var DatePickerContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .react-datepicker-popper {\n z-index: ", ";\n }\n\n .react-datepicker-popper[data-placement^=bottom] {\n padding-top: 0px;\n }\n\n \n .react-datepicker-popper[data-placement^=top] {\n padding-bottom: 0px;\n }\n\n > div {\n display: block;\n\n ", "\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n .react-datepicker__input-container{\n z-index: 0;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 48px;\n width: 48px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ", ";\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n ", "\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n }\n\n &::before {\n text-align: center;\n display: inline-block;\n content: '';\n height: 32px;\n width: 32px;\n vertical-align: middle;\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n }\n\n .react-datepicker__month-container,\n .react-datepicker__year--container {\n width: 336px;\n }\n\n .react-datepicker__month {\n margin: 0px;\n }\n\n .react-datepicker__triangle {\n left: 50% !important;\n display: none;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] {\n margin-top: 0;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\n border-bottom-color: ", ";\n }\n\n .react-datepicker__header {\n border-bottom: 1px solid ", ";\n background: ", ";\n height: ", ";\n padding-top: 0px;\n }\n\n .react-datepicker__current-month {\n height: 48px;\n display: inline-flex;\n align-items: center;\n margin-right: 5px;\n\n ", "\n }\n\n .react-datepicker__year {\n max-height: 300px;\n overflow-y: scroll;\n\n ", "\n }\n\n .react-datepicker__year-wrapper {\n max-width: 100%;\n justify-content: space-around;\n }\n\n .react-datepicker__navigation-icon {\n display: none;\n }\n\n .react-datepicker__day-name {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 48px;\n margin: 0px;\n width: 48px;\n\n ", "\n }\n\n .react-datepicker__year-text {\n background: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-top: 20px;\n padding-top: 10px;\n padding-bottom: 10px;\n\n ", "\n &.react-datepicker__year-text--disabled {\n display: none;\n }\n\n &.react-datepicker__day--keyboard-selected {\n color: ", ";\n background: ", ";\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:focus {\n ", "\n }\n\n &.react-datepicker__year-text--selected {\n color: ", " !important;\n background: ", " !important;\n }\n }\n\n .react-datepicker__day {\n background: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n width: 40px;\n margin: 4px;\n\n ", "\n &.react-datepicker__day--keyboard-selected {\n color: ", ";\n background: ", ";\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:focus {\n ", "\n }\n\n &.react-datepicker__day--selected {\n color: ", " !important;\n background: ", " !important;\n }\n\n &.react-datepicker__day--today {\n border-radius: 0.3rem;\n color: ", ";\n background: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:focus {\n ", "\n }\n }\n }\n }\n"])), Z_INDEXES.dropdown, function (props) {
|
|
53
54
|
return props.margin ? "margin: ".concat(props.margin, ";") : '';
|
|
54
55
|
}, COLORS.primary_20, focusStyles, COLORS.neutral_20, COLORS.neutral_200, COLORS.neutral_20, function (props) {
|
|
55
56
|
return !props.yearPicker ? '96px' : '54px';
|
|
@@ -72,6 +73,7 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
72
73
|
yearsBeforeCurrentDate = _ref.yearsBeforeCurrentDate,
|
|
73
74
|
yearsAfterCurrentDate = _ref.yearsAfterCurrentDate,
|
|
74
75
|
margin = _ref.margin,
|
|
76
|
+
overflowTooltipPosition = _ref.overflowTooltipPosition,
|
|
75
77
|
onBlur = _ref.onBlur,
|
|
76
78
|
id = _ref.id,
|
|
77
79
|
dataTestId = _ref.dataTestId,
|
|
@@ -97,12 +99,14 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
97
99
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
98
100
|
open = _React$useState8[0],
|
|
99
101
|
setOpen = _React$useState8[1];
|
|
100
|
-
|
|
102
|
+
var getFormattedValue = function getFormattedValue() {
|
|
103
|
+
return dayjs(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');
|
|
104
|
+
};
|
|
101
105
|
/**
|
|
102
106
|
* Format the date in a specific way.
|
|
103
107
|
*/
|
|
104
108
|
React.useEffect(function () {
|
|
105
|
-
if (value) inputRef.current.value =
|
|
109
|
+
if (value) inputRef.current.value = getFormattedValue();
|
|
106
110
|
}, [value]);
|
|
107
111
|
React.useEffect(function () {
|
|
108
112
|
if (yearPickerMode) {
|
|
@@ -151,6 +155,7 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
151
155
|
onBlur && onBlur(e);
|
|
152
156
|
}
|
|
153
157
|
};
|
|
158
|
+
var iconSize = 24;
|
|
154
159
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
155
160
|
children: [/*#__PURE__*/_jsx(DatePickerContainer, {
|
|
156
161
|
"data-testId": dataTestId,
|
|
@@ -196,10 +201,10 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
196
201
|
setYearPickerMode: setYearPickerMode
|
|
197
202
|
}), null);
|
|
198
203
|
} : undefined,
|
|
199
|
-
customInput: /*#__PURE__*/
|
|
204
|
+
customInput: /*#__PURE__*/_jsxs(InputWrapper, {
|
|
200
205
|
disabled: disabled,
|
|
201
206
|
readOnly: readOnly,
|
|
202
|
-
children: /*#__PURE__*/_jsxs(DatepickerRow, {
|
|
207
|
+
children: [/*#__PURE__*/_jsxs(DatepickerRow, {
|
|
203
208
|
children: [/*#__PURE__*/_jsx(StyledInputFieldStyling, _objectSpread({
|
|
204
209
|
ref: inputRef,
|
|
205
210
|
type: "text",
|
|
@@ -215,6 +220,7 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
215
220
|
},
|
|
216
221
|
autoComplete: autoComplete,
|
|
217
222
|
placeholder: placeholder,
|
|
223
|
+
extraRightPadding: iconSize,
|
|
218
224
|
disabled: disabled,
|
|
219
225
|
readOnly: true,
|
|
220
226
|
suppressReadOnlyStyles: !readOnly,
|
|
@@ -224,7 +230,15 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
224
230
|
size: "24"
|
|
225
231
|
})
|
|
226
232
|
})]
|
|
227
|
-
})
|
|
233
|
+
}), !open && /*#__PURE__*/_jsx(TooltipOverflow, {
|
|
234
|
+
position: overflowTooltipPosition,
|
|
235
|
+
input: inputRef,
|
|
236
|
+
withArrow: true,
|
|
237
|
+
maxWidth: "100%",
|
|
238
|
+
size: Size.Small,
|
|
239
|
+
align: "end",
|
|
240
|
+
children: getFormattedValue()
|
|
241
|
+
})]
|
|
228
242
|
})
|
|
229
243
|
})
|
|
230
244
|
}), validationMessage && /*#__PURE__*/_jsxs(ErrorMessage, {
|
|
@@ -248,7 +262,8 @@ DatepickerField.propTypes = {
|
|
|
248
262
|
yearPicker: _pt.bool,
|
|
249
263
|
yearsBeforeCurrentDate: _pt.number,
|
|
250
264
|
yearsAfterCurrentDate: _pt.number,
|
|
251
|
-
margin: _pt.string
|
|
265
|
+
margin: _pt.string,
|
|
266
|
+
overflowTooltipPosition: _pt.oneOf(['top', 'bottom'])
|
|
252
267
|
};
|
|
253
268
|
export default DatepickerField;
|
|
254
269
|
//# sourceMappingURL=DatepickerField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatepickerField.js","names":["React","styled","DatePicker","en","dayjs","advancedFormat","extend","COLORS","SystemIcons","DatepickerFieldHeader","ComponentTextStyle","focusStyles","scrollBarStyling","ErrorMessage","InputFieldStyling","InputWrapper","ComponentMStyling","ComponentSStyling","Z_INDEXES","useFocusVisibleRef","Size","DatePickerContainer","div","dropdown","props","margin","primary_20","neutral_20","neutral_200","yearPicker","Bold","neutral_600","Small","Regular","white","primary_700","primary_500","neutral_700","neutral_100","IconWrapper","focus","DatepickerRow","StyledInputFieldStyling","neutral_500","primary_300","primary_200","primary_100","primary_800","neutral_300","DatepickerField","forwardRef","ref","disabled","readOnly","onChange","invalid","value","validationMessage","dateFormat","autoComplete","placeholder","required","yearsBeforeCurrentDate","yearsAfterCurrentDate","onBlur","id","dataTestId","rest","inputRef","datepickerRef","useRef","useState","activeMonthPage","setActiveMonthPage","yearPickerMode","setYearPickerMode","openAt","setOpenAt","open","setOpen","useEffect","current","format","selectedDate","document","getElementsByClassName","dropdownParent","parentElement","scrollTop","offsetTop","offsetHeight","useImperativeHandle","handleCalendarClose","blur","handleCalendarOpen","maxDate","Date","setFullYear","getFullYear","minDate","itemsNumber","Math","round","handleKeyDown","e","key","handleBlur","currentTarget","contains","relatedTarget","newDate","setMonth","undefined","params","createElement","customHeaderCount","setSelectionRange","critical_400"],"sources":["../../src/InputFields/DatepickerField.tsx"],"sourcesContent":["/**\n * Import react libraries.\n */\nimport React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport DatePicker, { ReactDatePickerCustomHeaderProps } from 'react-datepicker';\nimport en from 'date-fns/locale/en-GB';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat';\n\ndayjs.extend(advancedFormat);\n\n/**\n * Import custom components.\n */\nimport COLORS from '../styles/colors';\nimport {SystemIcons} from '../icons';\nimport {DatepickerFieldHeader} from './DatepickerFieldHeader';\nimport {ComponentTextStyle, focusStyles, scrollBarStyling} from '../styles';\n\n/**\n * Import custom styles.\n */\nimport {ErrorMessage, InputFieldStyling, InputWrapper} from './styling';\nimport 'react-datepicker/dist/react-datepicker.css';\nimport {ComponentMStyling, ComponentSStyling} from '../styles';\nimport {Z_INDEXES} from '../styles';\nimport {useFocusVisibleRef} from '../common';\nimport {Size, Testable} from '../types';\n\n/**\n * Add custom types.\n */\ntype DatepickerFieldProps = Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'size' | 'onBlur'> & {\n value?: Date;\n onChange?: (date: Date) => void;\n onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\n\n invalid?: boolean;\n dateFormat?: string;\n validationMessage?: string;\n autoComplete?: string;\n placeholder?: string;\n yearPicker?: boolean;\n yearsBeforeCurrentDate?: number;\n yearsAfterCurrentDate?: number;\n margin?: string;\n};\n\n/**\n * Add custom styles.\n */\nconst DatePickerContainer = styled.div<{ yearPicker: boolean; margin: string }>`\n .react-datepicker-popper {\n z-index: ${Z_INDEXES.dropdown};\n }\n\n > div {\n display: block;\n\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n .react-datepicker__input-container{\n z-index: 0;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 32px;\n width: 32px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ${COLORS.primary_20};\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n ${focusStyles}\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n }\n\n &::before {\n text-align: center;\n display: inline-block;\n content: '';\n height: 32px;\n width: 32px;\n vertical-align: middle;\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n }\n\n .react-datepicker__month-container,\n .react-datepicker__year--container {\n width: 336px;\n }\n\n .react-datepicker__month {\n margin: 0px;\n }\n\n .react-datepicker__triangle {\n left: 50% !important;\n display: none;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] {\n margin-top: 0;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\n border-bottom-color: ${COLORS.neutral_20};\n }\n\n .react-datepicker__header {\n border-bottom: 1px solid ${COLORS.neutral_200};\n background: ${COLORS.neutral_20};\n height: ${(props) => (!props.yearPicker ? '96px' : '54px')};\n padding-top: 0px;\n }\n\n .react-datepicker__current-month {\n height: 48px;\n display: inline-flex;\n align-items: center;\n margin-right: 5px;\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n\n .react-datepicker__year {\n max-height: 300px;\n overflow-y: scroll;\n\n ${scrollBarStyling(Size.Small)}\n }\n\n .react-datepicker__year-wrapper {\n max-width: 100%;\n justify-content: space-around;\n }\n\n .react-datepicker__day-name {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 48px;\n margin: 0px;\n width: 48px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n }\n\n .react-datepicker__year-text {\n background: ${COLORS.white};\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-top: 20px;\n padding-top: 10px;\n padding-bottom: 10px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n &.react-datepicker__year-text--disabled {\n display: none;\n }\n\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &.react-datepicker__year-text--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n }\n\n .react-datepicker__day {\n background: ${COLORS.white};\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n width: 40px;\n margin: 4px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &.react-datepicker__day--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n\n &.react-datepicker__day--today {\n border-radius: 0.3rem;\n color: ${COLORS.neutral_700};\n background: ${COLORS.neutral_100};\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n }\n }\n`;\n\nconst IconWrapper = styled.div`\n pointer-events: none;\n position: absolute;\n left: 16px;\n width: 24px;\n height: 24px;\n z-index: ${+Z_INDEXES.focus + 1};\n`;\n\nconst DatepickerRow = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nconst StyledInputFieldStyling = styled(InputFieldStyling)`\n padding-left: 48px !important;\n \n &::placeholder {\n color: ${COLORS.neutral_500};\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_200};\n\n ::placeholder {\n color: ${COLORS.primary_700};\n }\n\n cursor: pointer;\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active,\n &.open {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n\n ::placeholder {\n color: ${COLORS.primary_800};\n }\n }\n \n &:disabled {\n background-color: ${COLORS.white};\n }\n\n & ~ ${IconWrapper}{\n color: ${COLORS.neutral_600};\n }\n\n &:hover ~ ${IconWrapper} {\n color: ${COLORS.primary_700};\n }\n\n &:active ~ ${IconWrapper}, &.open ~ ${IconWrapper} {\n color: ${COLORS.primary_800};\n }\n\n &[tabindex='-1'] ~ ${IconWrapper} {\n color: ${COLORS.neutral_300};\n }\n`;\n\nconst DatepickerField = React.forwardRef(({\n disabled,\n readOnly,\n onChange,\n invalid,\n value,\n validationMessage,\n dateFormat,\n autoComplete,\n placeholder,\n required,\n yearPicker,\n yearsBeforeCurrentDate,\n yearsAfterCurrentDate,\n margin,\n onBlur,\n id,\n dataTestId,\n ...rest\n }: DatepickerFieldProps, ref) => {\n // Globally used variables within the component\n const inputRef = useFocusVisibleRef();\n const datepickerRef = React.useRef<any>(null);\n const [activeMonthPage, setActiveMonthPage] = React.useState<number>(-1);\n const [yearPickerMode, setYearPickerMode] = React.useState<boolean>(false);\n const [openAt, setOpenAt] = React.useState<Date | null>(null);\n // 'open' flag is used only for tracking current state of the dropdown,\n // for explicitly opening/closing the picker we are using 'datepickerRef.current.setOpen'\n const [open, setOpen] = React.useState<boolean>(false);\n\n /**\n * Format the date in a specific way.\n */\n React.useEffect(() => {\n if (value) inputRef.current.value = dayjs(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');\n }, [value]);\n\n React.useEffect(() => {\n if (yearPickerMode) {\n //unfortunately, since there are no refs, and year pickers is rendered not by our code, but by 'react-datepicker'\n //we have to touch DOM directly\n const selectedDate = document.getElementsByClassName('react-datepicker__year-text--selected')[0] as HTMLElement;\n const dropdownParent = selectedDate?.parentElement?.parentElement;\n if (selectedDate && dropdownParent) dropdownParent.scrollTop = selectedDate.offsetTop - 2 * selectedDate.offsetHeight;\n }\n }, [yearPickerMode]);\n\n //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection\n //otherwise after year selection datepicker will show January month of the selected year\n React.useEffect(() => {\n if (openAt) {\n datepickerRef.current.setOpen(true);\n //setOpenAt(null);\n }\n }, [openAt]);\n\n React.useImperativeHandle(ref, () => inputRef.current, [inputRef]);\n\n const handleCalendarClose = () => {\n inputRef.current?.blur();\n setOpen(false);\n };\n\n const handleCalendarOpen = () => {\n if (openAt) setOpenAt(null);\n setOpen(true);\n };\n\n let maxDate = new Date(value && new Date(value) > new Date() ? new Date(value) : new Date());\n maxDate.setFullYear(maxDate.getFullYear() + (yearsAfterCurrentDate ?? 50));\n\n //itemsNumber - controls number of year select options generated in the dropdown\n //items related to dates higher than 'maxDate' will be hidden, thus to avoid creating hundreds of invisible divs, we divide by 5\n let minDate = new Date(value && new Date(value) < new Date() ? new Date(value) : new Date());\n const itemsNumber = Math.round((minDate.getFullYear() - (yearsBeforeCurrentDate ?? 15)) / 5);\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape' || e.key === 'Esc')\n datepickerRef.current.setOpen(false);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLDivElement>) => {\n // @ts-ignore\n if (!e.currentTarget.contains(e.relatedTarget)) {\n onBlur && onBlur(e);\n }\n };\n\n return (\n <>\n {/* Let's render the input itself */}\n <DatePickerContainer data-testId={dataTestId} yearPicker={yearPickerMode} margin={margin || ''} onBlur={handleBlur}>\n <DatePicker\n ref={datepickerRef}\n onCalendarOpen={handleCalendarOpen}\n onCalendarClose={handleCalendarClose}\n onKeyDown={handleKeyDown}\n id={id}\n onClickOutside={() => datepickerRef.current.setOpen(false)}\n\n onChange={(e: any) => {\n if (onChange) {\n if (yearPickerMode) {\n const newDate = new Date();\n newDate.setFullYear(e.getFullYear());\n newDate.setMonth(activeMonthPage);\n setOpenAt(newDate);\n } else onChange(e);\n }\n if (yearPickerMode) setYearPickerMode(false);\n }}\n disabled={disabled || readOnly}\n locale={en}\n showYearPicker={yearPickerMode}\n //we manipulate 'yearItemNumber' and 'maxDate' to guarantee number of year select options shown before and after selected year\n yearItemNumber={yearPickerMode ? itemsNumber : undefined}\n maxDate={yearPickerMode ? maxDate : undefined}\n selected={value}\n openToDate={openAt ?? undefined}\n preventOpenOnFocus={true}\n shouldCloseOnSelect={true}\n renderCustomHeader={\n yearPicker\n ? (params: ReactDatePickerCustomHeaderProps) =>\n React.createElement(\n DatepickerFieldHeader,\n {\n ...params,\n setActiveMonthPage,\n customHeaderCount: 0,\n yearPickerMode: yearPickerMode,\n setYearPickerMode: setYearPickerMode,\n },\n null,\n )\n : undefined\n }\n customInput={\n <InputWrapper disabled={disabled} readOnly={readOnly}>\n <DatepickerRow>\n <StyledInputFieldStyling\n ref={inputRef}\n type=\"text\"\n name=\"datepicker\"\n onKeyDown={(e) => e.key === 'Enter' && datepickerRef.current.setOpen(true)}\n className={(invalid ? 'invalid' : '' + (open ? ' open' : ''))}\n tabIndex={disabled || readOnly ? -1 : 0}\n onFocus={(e) => inputRef.current?.setSelectionRange(0, 0)}\n autoComplete={autoComplete}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={true}\n suppressReadOnlyStyles={!readOnly}\n required={required}\n {...rest}\n />\n <IconWrapper>\n <SystemIcons.Calendar size=\"24\"/>\n </IconWrapper>\n </DatepickerRow>\n </InputWrapper>\n }\n />\n </DatePickerContainer>\n\n {/* If there is an error, let's render the error */}\n {validationMessage && (\n <ErrorMessage>\n <SystemIcons.TechnicalWarning color={COLORS.critical_400}/>\n <span>{validationMessage}</span>\n </ErrorMessage>\n )}\n </>\n );\n});\n\nexport default DatepickerField;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,UAAU,MAA4C,kBAAkB;AAC/E,OAAOC,EAAE,MAAM,uBAAuB;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,cAAc,MAAO,6BAA6B;AAEzDD,KAAK,CAACE,MAAM,CAACD,cAAc,CAAC;;AAE5B;AACA;AACA;AACA,OAAOE,MAAM,MAAM,kBAAkB;AACrC,SAAQC,WAAW,QAAO,UAAU;AACpC,SAAQC,qBAAqB,QAAO,yBAAyB;AAC7D,SAAQC,kBAAkB,EAAEC,WAAW,EAAEC,gBAA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{"version":3,"file":"DatepickerField.js","names":["React","styled","DatePicker","en","dayjs","advancedFormat","extend","COLORS","SystemIcons","DatepickerFieldHeader","ComponentTextStyle","focusStyles","scrollBarStyling","TooltipOverflow","ErrorMessage","InputFieldStyling","InputWrapper","ComponentMStyling","ComponentSStyling","Z_INDEXES","useFocusVisibleRef","Size","DatePickerContainer","div","dropdown","props","margin","primary_20","neutral_20","neutral_200","yearPicker","Bold","neutral_600","Small","Regular","white","primary_700","primary_500","neutral_700","neutral_100","IconWrapper","focus","DatepickerRow","StyledInputFieldStyling","neutral_500","primary_300","primary_200","primary_100","primary_800","neutral_300","DatepickerField","forwardRef","ref","disabled","readOnly","onChange","invalid","value","validationMessage","dateFormat","autoComplete","placeholder","required","yearsBeforeCurrentDate","yearsAfterCurrentDate","overflowTooltipPosition","onBlur","id","dataTestId","rest","inputRef","datepickerRef","useRef","useState","activeMonthPage","setActiveMonthPage","yearPickerMode","setYearPickerMode","openAt","setOpenAt","open","setOpen","getFormattedValue","format","useEffect","current","selectedDate","document","getElementsByClassName","dropdownParent","parentElement","scrollTop","offsetTop","offsetHeight","useImperativeHandle","handleCalendarClose","blur","handleCalendarOpen","maxDate","Date","setFullYear","getFullYear","minDate","itemsNumber","Math","round","handleKeyDown","e","key","handleBlur","currentTarget","contains","relatedTarget","iconSize","newDate","setMonth","undefined","params","createElement","customHeaderCount","setSelectionRange","critical_400"],"sources":["../../src/InputFields/DatepickerField.tsx"],"sourcesContent":["/**\n * Import react libraries.\n */\nimport React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport DatePicker, { ReactDatePickerCustomHeaderProps } from 'react-datepicker';\nimport en from 'date-fns/locale/en-GB';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat';\n\ndayjs.extend(advancedFormat);\n\n/**\n * Import custom components.\n */\nimport COLORS from '../styles/colors';\nimport {SystemIcons} from '../icons';\nimport {DatepickerFieldHeader} from './DatepickerFieldHeader';\nimport {ComponentTextStyle, focusStyles, scrollBarStyling} from '../styles';\nimport TooltipOverflow from '../Tooltips/TooltipOverflow';\n\n/**\n * Import custom styles.\n */\nimport {ErrorMessage, InputFieldStyling, InputWrapper} from './styling';\nimport 'react-datepicker/dist/react-datepicker.css';\nimport {ComponentMStyling, ComponentSStyling} from '../styles';\nimport {Z_INDEXES} from '../styles';\nimport {useFocusVisibleRef} from '../common';\nimport {Size, Testable} from '../types';\n\n/**\n * Add custom types.\n */\nexport type DatepickerFieldProps = Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'size' | 'onBlur'> & {\n value?: Date;\n onChange?: (date: Date) => void;\n onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\n\n invalid?: boolean;\n dateFormat?: string;\n validationMessage?: string;\n autoComplete?: string;\n placeholder?: string;\n yearPicker?: boolean;\n yearsBeforeCurrentDate?: number;\n yearsAfterCurrentDate?: number;\n margin?: string;\n\n overflowTooltipPosition?: 'top' | 'bottom';\n};\n\n/**\n * Add custom styles.\n */\nconst DatePickerContainer = styled.div<{ yearPicker: boolean; margin: string }>`\n .react-datepicker-popper {\n z-index: ${Z_INDEXES.dropdown};\n }\n\n .react-datepicker-popper[data-placement^=bottom] {\n padding-top: 0px;\n }\n\n \n .react-datepicker-popper[data-placement^=top] {\n padding-bottom: 0px;\n }\n\n > div {\n display: block;\n\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n .react-datepicker__input-container{\n z-index: 0;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 48px;\n width: 48px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ${COLORS.primary_20};\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n ${focusStyles}\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n }\n\n &::before {\n text-align: center;\n display: inline-block;\n content: '';\n height: 32px;\n width: 32px;\n vertical-align: middle;\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n }\n\n .react-datepicker__month-container,\n .react-datepicker__year--container {\n width: 336px;\n }\n\n .react-datepicker__month {\n margin: 0px;\n }\n\n .react-datepicker__triangle {\n left: 50% !important;\n display: none;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] {\n margin-top: 0;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\n border-bottom-color: ${COLORS.neutral_20};\n }\n\n .react-datepicker__header {\n border-bottom: 1px solid ${COLORS.neutral_200};\n background: ${COLORS.neutral_20};\n height: ${(props) => (!props.yearPicker ? '96px' : '54px')};\n padding-top: 0px;\n }\n\n .react-datepicker__current-month {\n height: 48px;\n display: inline-flex;\n align-items: center;\n margin-right: 5px;\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n\n .react-datepicker__year {\n max-height: 300px;\n overflow-y: scroll;\n\n ${scrollBarStyling(Size.Small)}\n }\n\n .react-datepicker__year-wrapper {\n max-width: 100%;\n justify-content: space-around;\n }\n\n .react-datepicker__navigation-icon {\n display: none;\n }\n\n .react-datepicker__day-name {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 48px;\n margin: 0px;\n width: 48px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n }\n\n .react-datepicker__year-text {\n background: ${COLORS.white};\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-top: 20px;\n padding-top: 10px;\n padding-bottom: 10px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n &.react-datepicker__year-text--disabled {\n display: none;\n }\n\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &.react-datepicker__year-text--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n }\n\n .react-datepicker__day {\n background: ${COLORS.white};\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n width: 40px;\n margin: 4px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &.react-datepicker__day--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n\n &.react-datepicker__day--today {\n border-radius: 0.3rem;\n color: ${COLORS.neutral_700};\n background: ${COLORS.neutral_100};\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n }\n }\n`;\n\nconst IconWrapper = styled.div`\n pointer-events: none;\n position: absolute;\n left: 16px;\n width: 24px;\n height: 24px;\n z-index: ${+Z_INDEXES.focus + 1};\n`;\n\nconst DatepickerRow = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nconst StyledInputFieldStyling = styled(InputFieldStyling)`\n padding-left: 48px !important;\n \n &::placeholder {\n color: ${COLORS.neutral_500};\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_200};\n\n ::placeholder {\n color: ${COLORS.primary_700};\n }\n\n cursor: pointer;\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active,\n &.open {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n\n ::placeholder {\n color: ${COLORS.primary_800};\n }\n }\n \n &:disabled {\n background-color: ${COLORS.white};\n }\n\n & ~ ${IconWrapper}{\n color: ${COLORS.neutral_600};\n }\n\n &:hover ~ ${IconWrapper} {\n color: ${COLORS.primary_700};\n }\n\n &:active ~ ${IconWrapper}, &.open ~ ${IconWrapper} {\n color: ${COLORS.primary_800};\n }\n\n &[tabindex='-1'] ~ ${IconWrapper} {\n color: ${COLORS.neutral_300};\n }\n`;\n\nconst DatepickerField = React.forwardRef<HTMLInputElement, DatepickerFieldProps>(({\n disabled,\n readOnly,\n onChange,\n invalid,\n value,\n validationMessage,\n dateFormat,\n autoComplete,\n placeholder,\n required,\n yearPicker,\n yearsBeforeCurrentDate,\n yearsAfterCurrentDate,\n margin,\n overflowTooltipPosition,\n onBlur,\n id,\n dataTestId,\n ...rest\n }: DatepickerFieldProps, ref) => {\n // Globally used variables within the component\n const inputRef = useFocusVisibleRef();\n const datepickerRef = React.useRef<any>(null);\n const [activeMonthPage, setActiveMonthPage] = React.useState<number>(-1);\n const [yearPickerMode, setYearPickerMode] = React.useState<boolean>(false);\n const [openAt, setOpenAt] = React.useState<Date | null>(null);\n // 'open' flag is used only for tracking current state of the dropdown,\n // for explicitly opening/closing the picker we are using 'datepickerRef.current.setOpen'\n const [open, setOpen] = React.useState<boolean>(false);\n\n const getFormattedValue = () => {\n return dayjs(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');\n }\n /**\n * Format the date in a specific way.\n */\n React.useEffect(() => {\n if (value) inputRef.current.value = getFormattedValue();\n }, [value]);\n\n React.useEffect(() => {\n if (yearPickerMode) {\n //unfortunately, since there are no refs, and year pickers is rendered not by our code, but by 'react-datepicker'\n //we have to touch DOM directly\n const selectedDate = document.getElementsByClassName('react-datepicker__year-text--selected')[0] as HTMLElement;\n const dropdownParent = selectedDate?.parentElement?.parentElement;\n if (selectedDate && dropdownParent) dropdownParent.scrollTop = selectedDate.offsetTop - 2 * selectedDate.offsetHeight;\n }\n }, [yearPickerMode]);\n\n //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection\n //otherwise after year selection datepicker will show January month of the selected year\n React.useEffect(() => {\n if (openAt) {\n datepickerRef.current.setOpen(true);\n //setOpenAt(null);\n }\n }, [openAt]);\n\n React.useImperativeHandle(ref, () => inputRef.current, [inputRef]);\n\n const handleCalendarClose = () => {\n inputRef.current?.blur();\n setOpen(false);\n };\n\n const handleCalendarOpen = () => {\n if (openAt) setOpenAt(null);\n setOpen(true);\n };\n\n let maxDate = new Date(value && new Date(value) > new Date() ? new Date(value) : new Date());\n maxDate.setFullYear(maxDate.getFullYear() + (yearsAfterCurrentDate ?? 50));\n\n //itemsNumber - controls number of year select options generated in the dropdown\n //items related to dates higher than 'maxDate' will be hidden, thus to avoid creating hundreds of invisible divs, we divide by 5\n let minDate = new Date(value && new Date(value) < new Date() ? new Date(value) : new Date());\n const itemsNumber = Math.round((minDate.getFullYear() - (yearsBeforeCurrentDate ?? 15)) / 5);\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape' || e.key === 'Esc')\n datepickerRef.current.setOpen(false);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLDivElement>) => {\n // @ts-ignore\n if (!e.currentTarget.contains(e.relatedTarget)) {\n onBlur && onBlur(e);\n }\n };\n const iconSize = 24;\n\n return (\n <>\n {/* Let's render the input itself */}\n <DatePickerContainer data-testId={dataTestId} yearPicker={yearPickerMode} margin={margin || ''} onBlur={handleBlur}>\n <DatePicker\n ref={datepickerRef}\n onCalendarOpen={handleCalendarOpen}\n onCalendarClose={handleCalendarClose}\n onKeyDown={handleKeyDown}\n id={id}\n onClickOutside={() => datepickerRef.current.setOpen(false)}\n\n onChange={(e: any) => {\n if (onChange) {\n if (yearPickerMode) {\n const newDate = new Date();\n newDate.setFullYear(e.getFullYear());\n newDate.setMonth(activeMonthPage);\n setOpenAt(newDate);\n } else onChange(e);\n }\n if (yearPickerMode) setYearPickerMode(false);\n }}\n disabled={disabled || readOnly}\n locale={en}\n showYearPicker={yearPickerMode}\n //we manipulate 'yearItemNumber' and 'maxDate' to guarantee number of year select options shown before and after selected year\n yearItemNumber={yearPickerMode ? itemsNumber : undefined}\n maxDate={yearPickerMode ? maxDate : undefined}\n selected={value}\n openToDate={openAt ?? undefined}\n preventOpenOnFocus={true}\n shouldCloseOnSelect={true}\n renderCustomHeader={\n yearPicker\n ? (params: ReactDatePickerCustomHeaderProps) =>\n React.createElement(\n DatepickerFieldHeader,\n {\n ...params,\n setActiveMonthPage,\n customHeaderCount: 0,\n yearPickerMode: yearPickerMode,\n setYearPickerMode: setYearPickerMode,\n },\n null,\n )\n : undefined\n }\n customInput={\n <InputWrapper disabled={disabled} readOnly={readOnly}>\n <DatepickerRow>\n <StyledInputFieldStyling\n ref={inputRef}\n type=\"text\"\n name=\"datepicker\"\n onKeyDown={(e) => e.key === 'Enter' && datepickerRef.current.setOpen(true)}\n className={(invalid ? 'invalid' : '' + (open ? ' open' : ''))}\n tabIndex={disabled || readOnly ? -1 : 0}\n onFocus={(e) => inputRef.current?.setSelectionRange(0, 0)}\n autoComplete={autoComplete}\n placeholder={placeholder}\n extraRightPadding={iconSize}\n disabled={disabled}\n readOnly={true}\n suppressReadOnlyStyles={!readOnly}\n required={required}\n {...rest}\n />\n <IconWrapper>\n <SystemIcons.Calendar size=\"24\"/>\n </IconWrapper>\n </DatepickerRow>\n {!open && <TooltipOverflow position={overflowTooltipPosition} input={inputRef} withArrow={true} maxWidth=\"100%\" size={Size.Small} align='end'>\n {getFormattedValue()}\n </TooltipOverflow>}\n </InputWrapper>\n }\n />\n </DatePickerContainer>\n\n {/* If there is an error, let's render the error */}\n {validationMessage && (\n <ErrorMessage>\n <SystemIcons.TechnicalWarning color={COLORS.critical_400}/>\n <span>{validationMessage}</span>\n </ErrorMessage>\n )}\n </>\n );\n});\n\nexport default DatepickerField;\n"],"mappings":";;;;;;;;;AAAA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BAAiB,EAAEoD,QAAS;cAC5B,QAAQ,EAAE5D,QAAS;cACnB,QAAQ,EAAE,IAAK;cACf,sBAAsB,EAAE,CAACC,QAAS;cAClC,QAAQ,EAAEQ;YAAS,GACfO,IAAI,EACR,eACF,KAAC,WAAW;cAAA,uBACV,KAAC,WAAW,CAAC,QAAQ;gBAAC,IAAI,EAAC;cAAI;YAAE,EACrB;UAAA,EACA,EACjB,CAACW,IAAI,iBAAI,KAAC,eAAe;YAAC,QAAQ,EAAEf,uBAAwB;YAAC,KAAK,EAAEK,QAAS;YAAC,SAAS,EAAE,IAAK;YAAC,QAAQ,EAAC,MAAM;YAAC,IAAI,EAAEjD,IAAI,CAACY,KAAM;YAAC,KAAK,EAAC,KAAK;YAAA,UAC1IiD,iBAAiB;UAAE,EACJ;QAAA;MAErB;IACD,EACkB,EAGrBxB,iBAAiB,iBAChB,MAAC,YAAY;MAAA,wBACX,KAAC,WAAW,CAAC,gBAAgB;QAAC,KAAK,EAAEnD,MAAM,CAACkH;MAAa,EAAE,eAC3D;QAAA,UAAO/D;MAAiB,EAAQ;IAAA,EAEnC;EAAA,EACA;AAEP,CAAC,CAAC;AAAC;EAxfDD,KAAK;EACLF,QAAQ;EACRW,MAAM;EAENV,OAAO;EACPG,UAAU;EACVD,iBAAiB;EACjBE,YAAY;EACZC,WAAW;EACX/B,UAAU;EACViC,sBAAsB;EACtBC,qBAAqB;EACrBtC,MAAM;EAENuC,uBAAuB,aAAG,KAAK,EAAG,QAAQ;AAAA;AA4e5C,eAAef,eAAe"}
|
|
@@ -52,8 +52,7 @@ var DatepickerFieldHeader = function DatepickerFieldHeader(_ref) {
|
|
|
52
52
|
children: [!yearPickerMode && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
53
53
|
className: "react-datepicker__navigation react-datepicker__navigation--previous",
|
|
54
54
|
onClick: handleDecreaseMonth,
|
|
55
|
-
disabled: prevMonthButtonDisabled
|
|
56
|
-
children: "Prevoius month"
|
|
55
|
+
disabled: prevMonthButtonDisabled
|
|
57
56
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(HeaderLabelContainer, {
|
|
58
57
|
onClick: function onClick() {
|
|
59
58
|
return setYearPickerMode(!yearPickerMode);
|
|
@@ -69,8 +68,7 @@ var DatepickerFieldHeader = function DatepickerFieldHeader(_ref) {
|
|
|
69
68
|
}), !yearPickerMode && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
70
69
|
className: "react-datepicker__navigation react-datepicker__navigation--next",
|
|
71
70
|
onClick: handleIncreaseMonth,
|
|
72
|
-
disabled: nextMonthButtonDisabled
|
|
73
|
-
children: "Next month"
|
|
71
|
+
disabled: nextMonthButtonDisabled
|
|
74
72
|
})]
|
|
75
73
|
})
|
|
76
74
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatepickerFieldHeader.cjs","names":["HeaderLabelContainer","styled","div","COLORS","neutral_600","CommonInteractionStyling","primary_600","DatepickerFieldHeader","date","decreaseMonth","increaseMonth","prevMonthButtonDisabled","nextMonthButtonDisabled","setYearPickerMode","yearPickerMode","setActiveMonthPage","months","handleDecreaseMonth","previousMonth","getMonth","length","handleIncreaseMonth","nextMonth","React","useEffect","display","justifyContent","getFullYear","customHeaderCount","prevYearButtonDisabled","nextYearButtonDisabled"],"sources":["../../src/InputFields/DatepickerFieldHeader.tsx"],"sourcesContent":["/**\n * Import react libraries.\n */\nimport * as React from 'react';\nimport { SystemIcons } from '../icons';\nimport styled from 'styled-components';\nimport { CommonInteractionStyling } from '../common';\nimport { COLORS } from '../styles';\n\nexport interface DatepickerFieldHeaderParams {\n date: Date;\n changeYear(year: number): void;\n changeMonth(month: number): void;\n customHeaderCount: number;\n decreaseMonth(): void;\n increaseMonth(): void;\n prevMonthButtonDisabled: boolean;\n nextMonthButtonDisabled: boolean;\n decreaseYear(): void;\n increaseYear(): void;\n prevYearButtonDisabled: boolean;\n nextYearButtonDisabled: boolean;\n yearPickerMode: boolean;\n setYearPickerMode(val: boolean): void;\n setActiveMonthPage(val: number): void;\n}\n\nconst HeaderLabelContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 10px;\n cursor: pointer;\n\n button {\n background: transparent;\n padding: 0px;\n width: auto;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n\n ${CommonInteractionStyling}\n\n &:hover {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n\n &:active {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n`;\n\nexport const DatepickerFieldHeader = ({\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n setYearPickerMode,\n yearPickerMode,\n setActiveMonthPage,\n}: DatepickerFieldHeaderParams) => {\n const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n const handleDecreaseMonth = () => {\n let previousMonth = date.getMonth() - 1;\n if (previousMonth < 0) previousMonth = months.length - 1;\n setActiveMonthPage(previousMonth);\n decreaseMonth();\n };\n\n const handleIncreaseMonth = () => {\n let nextMonth = date.getMonth() + 1;\n if (nextMonth >= months.length - 1) nextMonth = 0;\n setActiveMonthPage(nextMonth);\n increaseMonth();\n };\n\n React.useEffect(() => {\n setActiveMonthPage(date.getMonth());\n }, [date]);\n\n return (\n <>\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n }}>\n {!yearPickerMode && (\n <button className=\"react-datepicker__navigation react-datepicker__navigation--previous\" onClick={handleDecreaseMonth} disabled={prevMonthButtonDisabled}>\n
|
|
1
|
+
{"version":3,"file":"DatepickerFieldHeader.cjs","names":["HeaderLabelContainer","styled","div","COLORS","neutral_600","CommonInteractionStyling","primary_600","DatepickerFieldHeader","date","decreaseMonth","increaseMonth","prevMonthButtonDisabled","nextMonthButtonDisabled","setYearPickerMode","yearPickerMode","setActiveMonthPage","months","handleDecreaseMonth","previousMonth","getMonth","length","handleIncreaseMonth","nextMonth","React","useEffect","display","justifyContent","getFullYear","customHeaderCount","prevYearButtonDisabled","nextYearButtonDisabled"],"sources":["../../src/InputFields/DatepickerFieldHeader.tsx"],"sourcesContent":["/**\n * Import react libraries.\n */\nimport * as React from 'react';\nimport { SystemIcons } from '../icons';\nimport styled from 'styled-components';\nimport { CommonInteractionStyling } from '../common';\nimport { COLORS } from '../styles';\n\nexport interface DatepickerFieldHeaderParams {\n date: Date;\n changeYear(year: number): void;\n changeMonth(month: number): void;\n customHeaderCount: number;\n decreaseMonth(): void;\n increaseMonth(): void;\n prevMonthButtonDisabled: boolean;\n nextMonthButtonDisabled: boolean;\n decreaseYear(): void;\n increaseYear(): void;\n prevYearButtonDisabled: boolean;\n nextYearButtonDisabled: boolean;\n yearPickerMode: boolean;\n setYearPickerMode(val: boolean): void;\n setActiveMonthPage(val: number): void;\n}\n\nconst HeaderLabelContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 10px;\n cursor: pointer;\n\n button {\n background: transparent;\n padding: 0px;\n width: auto;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n\n ${CommonInteractionStyling}\n\n &:hover {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n\n &:active {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n`;\n\nexport const DatepickerFieldHeader = ({\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n setYearPickerMode,\n yearPickerMode,\n setActiveMonthPage,\n}: DatepickerFieldHeaderParams) => {\n const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n const handleDecreaseMonth = () => {\n let previousMonth = date.getMonth() - 1;\n if (previousMonth < 0) previousMonth = months.length - 1;\n setActiveMonthPage(previousMonth);\n decreaseMonth();\n };\n\n const handleIncreaseMonth = () => {\n let nextMonth = date.getMonth() + 1;\n if (nextMonth >= months.length - 1) nextMonth = 0;\n setActiveMonthPage(nextMonth);\n increaseMonth();\n };\n\n React.useEffect(() => {\n setActiveMonthPage(date.getMonth());\n }, [date]);\n\n return (\n <>\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n }}>\n {!yearPickerMode && (\n <button className=\"react-datepicker__navigation react-datepicker__navigation--previous\" onClick={handleDecreaseMonth} disabled={prevMonthButtonDisabled}>\n </button>\n )}\n <HeaderLabelContainer onClick={() => setYearPickerMode(!yearPickerMode)}>\n <div className=\"react-datepicker__current-month\">{`${months[date.getMonth()]} ${date.getFullYear()}`}</div>\n {yearPickerMode ? <SystemIcons.ArrowDropUp size=\"24px\" /> : <SystemIcons.ArrowDropDown size=\"24px\" />}\n </HeaderLabelContainer>\n {!yearPickerMode && (\n <button className=\"react-datepicker__navigation react-datepicker__navigation--next\" onClick={handleIncreaseMonth} disabled={nextMonthButtonDisabled}>\n </button>\n )}\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AAAmC;AAAA;AAAA;AAAA;AAoBnC,IAAMA,oBAAoB,GAAGC,yBAAM,CAACC,GAAG,giBAc1BC,cAAM,CAACC,WAAW,EAG3BC,gCAAwB,EAIbF,cAAM,CAACG,WAAW,EAGlBH,cAAM,CAACG,WAAW,EAMlBH,cAAM,CAACG,WAAW,EAGlBH,cAAM,CAACG,WAAW,CAGhC;AAEM,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqB,OASC;EAAA,IARjCC,IAAI,QAAJA,IAAI;IACJC,aAAa,QAAbA,aAAa;IACbC,aAAa,QAAbA,aAAa;IACbC,uBAAuB,QAAvBA,uBAAuB;IACvBC,uBAAuB,QAAvBA,uBAAuB;IACvBC,iBAAiB,QAAjBA,iBAAiB;IACjBC,cAAc,QAAdA,cAAc;IACdC,kBAAkB,QAAlBA,kBAAkB;EAElB,IAAMC,MAAM,GAAG,CAAC,SAA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,EAAE;QAAA,EAAS,EAC1Gb,cAAc,gBAAG,qBAAC,kBAAW,CAAC,WAAW;UAAC,IAAI,EAAC;QAAM,EAAG,gBAAG,qBAAC,kBAAW,CAAC,aAAa;UAAC,IAAI,EAAC;QAAM,EAAG;MAAA,EAChF,EACtB,CAACA,cAAc,iBACd;QAAQ,SAAS,EAAC,iEAAiE;QAAC,OAAO,EAAEO,mBAAoB;QAAC,QAAQ,EAAET;MAAwB,EAErJ;IAAA;EACG,EACL;AAEP,CAAC;AAAC;AAAA;EA1GAJ,IAAI;EAGJoB,iBAAiB;EAGjBjB,uBAAuB;EACvBC,uBAAuB;EAGvBiB,sBAAsB;EACtBC,sBAAsB;EACtBhB,cAAc;AAAA"}
|
|
@@ -47,8 +47,7 @@ export var DatepickerFieldHeader = function DatepickerFieldHeader(_ref) {
|
|
|
47
47
|
children: [!yearPickerMode && /*#__PURE__*/_jsx("button", {
|
|
48
48
|
className: "react-datepicker__navigation react-datepicker__navigation--previous",
|
|
49
49
|
onClick: handleDecreaseMonth,
|
|
50
|
-
disabled: prevMonthButtonDisabled
|
|
51
|
-
children: "Prevoius month"
|
|
50
|
+
disabled: prevMonthButtonDisabled
|
|
52
51
|
}), /*#__PURE__*/_jsxs(HeaderLabelContainer, {
|
|
53
52
|
onClick: function onClick() {
|
|
54
53
|
return setYearPickerMode(!yearPickerMode);
|
|
@@ -64,8 +63,7 @@ export var DatepickerFieldHeader = function DatepickerFieldHeader(_ref) {
|
|
|
64
63
|
}), !yearPickerMode && /*#__PURE__*/_jsx("button", {
|
|
65
64
|
className: "react-datepicker__navigation react-datepicker__navigation--next",
|
|
66
65
|
onClick: handleIncreaseMonth,
|
|
67
|
-
disabled: nextMonthButtonDisabled
|
|
68
|
-
children: "Next month"
|
|
66
|
+
disabled: nextMonthButtonDisabled
|
|
69
67
|
})]
|
|
70
68
|
})
|
|
71
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatepickerFieldHeader.js","names":["React","SystemIcons","styled","CommonInteractionStyling","COLORS","HeaderLabelContainer","div","neutral_600","primary_600","DatepickerFieldHeader","date","decreaseMonth","increaseMonth","prevMonthButtonDisabled","nextMonthButtonDisabled","setYearPickerMode","yearPickerMode","setActiveMonthPage","months","handleDecreaseMonth","previousMonth","getMonth","length","handleIncreaseMonth","nextMonth","useEffect","display","justifyContent","getFullYear","customHeaderCount","prevYearButtonDisabled","nextYearButtonDisabled"],"sources":["../../src/InputFields/DatepickerFieldHeader.tsx"],"sourcesContent":["/**\n * Import react libraries.\n */\nimport * as React from 'react';\nimport { SystemIcons } from '../icons';\nimport styled from 'styled-components';\nimport { CommonInteractionStyling } from '../common';\nimport { COLORS } from '../styles';\n\nexport interface DatepickerFieldHeaderParams {\n date: Date;\n changeYear(year: number): void;\n changeMonth(month: number): void;\n customHeaderCount: number;\n decreaseMonth(): void;\n increaseMonth(): void;\n prevMonthButtonDisabled: boolean;\n nextMonthButtonDisabled: boolean;\n decreaseYear(): void;\n increaseYear(): void;\n prevYearButtonDisabled: boolean;\n nextYearButtonDisabled: boolean;\n yearPickerMode: boolean;\n setYearPickerMode(val: boolean): void;\n setActiveMonthPage(val: number): void;\n}\n\nconst HeaderLabelContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 10px;\n cursor: pointer;\n\n button {\n background: transparent;\n padding: 0px;\n width: auto;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n\n ${CommonInteractionStyling}\n\n &:hover {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n\n &:active {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n`;\n\nexport const DatepickerFieldHeader = ({\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n setYearPickerMode,\n yearPickerMode,\n setActiveMonthPage,\n}: DatepickerFieldHeaderParams) => {\n const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n const handleDecreaseMonth = () => {\n let previousMonth = date.getMonth() - 1;\n if (previousMonth < 0) previousMonth = months.length - 1;\n setActiveMonthPage(previousMonth);\n decreaseMonth();\n };\n\n const handleIncreaseMonth = () => {\n let nextMonth = date.getMonth() + 1;\n if (nextMonth >= months.length - 1) nextMonth = 0;\n setActiveMonthPage(nextMonth);\n increaseMonth();\n };\n\n React.useEffect(() => {\n setActiveMonthPage(date.getMonth());\n }, [date]);\n\n return (\n <>\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n }}>\n {!yearPickerMode && (\n <button className=\"react-datepicker__navigation react-datepicker__navigation--previous\" onClick={handleDecreaseMonth} disabled={prevMonthButtonDisabled}>\n
|
|
1
|
+
{"version":3,"file":"DatepickerFieldHeader.js","names":["React","SystemIcons","styled","CommonInteractionStyling","COLORS","HeaderLabelContainer","div","neutral_600","primary_600","DatepickerFieldHeader","date","decreaseMonth","increaseMonth","prevMonthButtonDisabled","nextMonthButtonDisabled","setYearPickerMode","yearPickerMode","setActiveMonthPage","months","handleDecreaseMonth","previousMonth","getMonth","length","handleIncreaseMonth","nextMonth","useEffect","display","justifyContent","getFullYear","customHeaderCount","prevYearButtonDisabled","nextYearButtonDisabled"],"sources":["../../src/InputFields/DatepickerFieldHeader.tsx"],"sourcesContent":["/**\n * Import react libraries.\n */\nimport * as React from 'react';\nimport { SystemIcons } from '../icons';\nimport styled from 'styled-components';\nimport { CommonInteractionStyling } from '../common';\nimport { COLORS } from '../styles';\n\nexport interface DatepickerFieldHeaderParams {\n date: Date;\n changeYear(year: number): void;\n changeMonth(month: number): void;\n customHeaderCount: number;\n decreaseMonth(): void;\n increaseMonth(): void;\n prevMonthButtonDisabled: boolean;\n nextMonthButtonDisabled: boolean;\n decreaseYear(): void;\n increaseYear(): void;\n prevYearButtonDisabled: boolean;\n nextYearButtonDisabled: boolean;\n yearPickerMode: boolean;\n setYearPickerMode(val: boolean): void;\n setActiveMonthPage(val: number): void;\n}\n\nconst HeaderLabelContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 10px;\n cursor: pointer;\n\n button {\n background: transparent;\n padding: 0px;\n width: auto;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n\n ${CommonInteractionStyling}\n\n &:hover {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n\n &:active {\n div {\n color: ${COLORS.primary_600} !important;\n }\n svg {\n color: ${COLORS.primary_600};\n }\n }\n`;\n\nexport const DatepickerFieldHeader = ({\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n setYearPickerMode,\n yearPickerMode,\n setActiveMonthPage,\n}: DatepickerFieldHeaderParams) => {\n const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n const handleDecreaseMonth = () => {\n let previousMonth = date.getMonth() - 1;\n if (previousMonth < 0) previousMonth = months.length - 1;\n setActiveMonthPage(previousMonth);\n decreaseMonth();\n };\n\n const handleIncreaseMonth = () => {\n let nextMonth = date.getMonth() + 1;\n if (nextMonth >= months.length - 1) nextMonth = 0;\n setActiveMonthPage(nextMonth);\n increaseMonth();\n };\n\n React.useEffect(() => {\n setActiveMonthPage(date.getMonth());\n }, [date]);\n\n return (\n <>\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n }}>\n {!yearPickerMode && (\n <button className=\"react-datepicker__navigation react-datepicker__navigation--previous\" onClick={handleDecreaseMonth} disabled={prevMonthButtonDisabled}>\n </button>\n )}\n <HeaderLabelContainer onClick={() => setYearPickerMode(!yearPickerMode)}>\n <div className=\"react-datepicker__current-month\">{`${months[date.getMonth()]} ${date.getFullYear()}`}</div>\n {yearPickerMode ? <SystemIcons.ArrowDropUp size=\"24px\" /> : <SystemIcons.ArrowDropDown size=\"24px\" />}\n </HeaderLabelContainer>\n {!yearPickerMode && (\n <button className=\"react-datepicker__navigation react-datepicker__navigation--next\" onClick={handleIncreaseMonth} disabled={nextMonthButtonDisabled}>\n </button>\n )}\n </div>\n </>\n );\n};\n"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,UAAU;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,wBAAwB,QAAQ,WAAW;AACpD,SAASC,MAAM,QAAQ,WAAW;AAAC;AAAA;AAAA;AAoBnC,IAAMC,oBAAoB,GAAGH,MAAM,CAACI,GAAG,khBAc1BF,MAAM,CAACG,WAAW,EAG3BJ,wBAAwB,EAIbC,MAAM,CAACI,WAAW,EAGlBJ,MAAM,CAACI,WAAW,EAMlBJ,MAAM,CAACI,WAAW,EAGlBJ,MAAM,CAACI,WAAW,CAGhC;AAED,OAAO,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqB,OASC;EAAA,IARjCC,IAAI,QAAJA,IAAI;IACJC,aAAa,QAAbA,aAAa;IACbC,aAAa,QAAbA,aAAa;IACbC,uBAAuB,QAAvBA,uBAAuB;IACvBC,uBAAuB,QAAvBA,uBAAuB;IACvBC,iBAAiB,QAAjBA,iBAAiB;IACjBC,cAAc,QAAdA,cAAc;IACdC,kBAAkB,QAAlBA,kBAAkB;EAElB,IAAMC,MAAM,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC;EACzI,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmB,GAAS;IAChC,IAAIC,aAAa,GAAGV,IAAI,CAACW,QAAQ,EAAE,GAAG,CAAC;IACvC,IAAID,aAAa,GAAG,CAAC,EAAEA,aAAa,GAAGF,MAAM,CAACI,MAAM,GAAG,CAAC;IACxDL,kBAAkB,CAACG,aAAa,CAAC;IACjCT,aAA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;EAGvBgB,sBAAsB;EACtBC,sBAAsB;EACtBf,cAAc;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.cjs","names":["Label","styled","label","ComponentXXSStyling","COLORS","neutral_500","BREAKPOINTS","MEDIUM","ComponentXSStyling","LabelRow","div","CopyContainer","TypographyBase","primary_800","primary_700","primary_600","neutral_300","LabelRowInner","CopyState","InputLabel","inputId","text","size","margin","requiredProp","required","showCopyButton","React","useState","setRequired","Available","copyState","setCopyState","useEffect","undefined","document","getElementById","getAttribute","Boolean","onTriggerClick","id","click","copyInputClick","e","preventDefault","Copied","val","value","window","navigator","clipboard","writeText","setTimeout","critical_500","Size","Medium"],"sources":["../../src/InputFields/Label.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Size } from '../types';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentXS, ComponentXSStyling, ComponentXXS, ComponentXXSStyling, TypographyBase } from '../styles/typography';\nimport { SystemIcons } from '../icons';\nimport {HyperLink, StyledLink} from '../HyperLink';\n\n// Add component-specific styles.\nconst Label = styled.label`\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n &.small {\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n }\n &.medium {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n pointer-events: none;\n`;\n\nconst LabelRow = styled.div<{ margin?: string }>`\n display: flex;\n align-items: flex-start;\n height: 16px;\n margin-bottom: 4px;\n`;\n\nconst CopyContainer = styled.div`\n margin-left: auto;\n\n &:visited:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_800};\n }\n }\n\n &:hover:not(.disabled),\n &.hover-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n text-decoration-line: underline;\n }\n }\n\n &:focus:not(.disabled),\n &.focus-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:active:not(.disabled),\n &.active-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:not(.disabled)\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.primary_600};\n }\n }\n\n &.disabled\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.neutral_300};\n }\n }\n cursor: pointer;\n`;\n\nconst LabelRowInner = styled.div<{ size: Size.Small | Size.Medium | undefined }>`\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\n// Add component-specific types\
|
|
1
|
+
{"version":3,"file":"Label.cjs","names":["Label","styled","label","ComponentXXSStyling","COLORS","neutral_500","BREAKPOINTS","MEDIUM","ComponentXSStyling","LabelRow","div","CopyContainer","TypographyBase","primary_800","primary_700","primary_600","neutral_300","LabelRowInner","CopyState","InputLabel","inputId","text","size","margin","requiredProp","required","showCopyButton","React","useState","setRequired","Available","copyState","setCopyState","useEffect","undefined","document","getElementById","getAttribute","Boolean","onTriggerClick","id","click","copyInputClick","e","preventDefault","Copied","val","value","window","navigator","clipboard","writeText","setTimeout","critical_500","Size","Medium"],"sources":["../../src/InputFields/Label.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Size } from '../types';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentXS, ComponentXSStyling, ComponentXXS, ComponentXXSStyling, TypographyBase } from '../styles/typography';\nimport { SystemIcons } from '../icons';\nimport {HyperLink, StyledLink} from '../HyperLink';\n\n// Add component-specific styles.\nconst Label = styled.label`\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n &.small {\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n }\n &.medium {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n pointer-events: none;\n`;\n\nconst LabelRow = styled.div<{ margin?: string }>`\n display: flex;\n align-items: flex-start;\n height: 16px;\n margin-bottom: 4px;\n`;\n\nconst CopyContainer = styled.div`\n margin-left: auto;\n\n &:visited:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_800};\n }\n }\n\n &:hover:not(.disabled),\n &.hover-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n text-decoration-line: underline;\n }\n }\n\n &:focus:not(.disabled),\n &.focus-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:active:not(.disabled),\n &.active-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:not(.disabled)\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.primary_600};\n }\n }\n\n &.disabled\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.neutral_300};\n }\n }\n cursor: pointer;\n`;\n\nconst LabelRowInner = styled.div<{ size: Size.Small | Size.Medium | undefined }>`\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\n// Add component-specific types\nexport type LabelProps = {\n inputId: string;\n text: string;\n size?: Size.Small | Size.Medium;\n margin?: string;\n required?: boolean;\n showCopyButton?: boolean;\n};\n\nenum CopyState {\n Disabled = 0,\n Available = 1,\n Copied = 2\n}\n\nconst InputLabel: React.FunctionComponent<LabelProps> = ({ inputId, text, size, margin, required: requiredProp, showCopyButton }: LabelProps) => {\n // Globally used variables within the component\n const [required, setRequired] = React.useState<boolean>(false);\n const [copyState, setCopyState] = React.useState<CopyState>(CopyState.Available);\n\n /**\n * Checks if field is set as required and we have to mark it accordingly.\n */\n React.useEffect(() => {\n if(requiredProp === undefined)\n {\n if (document.getElementById(inputId)?.getAttribute('required') === '') {\n setRequired(true);\n } else {\n setRequired(false);\n }\n }\n else\n setRequired(Boolean(requiredProp));\n }, []);\n /**\n * Triggers a click element on a specific element.\n * @param id - ID of the element which needs to be clicked.\n */\n const onTriggerClick = (id: string): void => {\n document.getElementById(id)?.click();\n };\n\n const copyInputClick = (e: any) => {\n e.preventDefault();\n if(copyState == CopyState.Copied)\n return;\n \n const val = (document.getElementById(inputId) as HTMLInputElement)?.value;\n if(val)\n {\n window.navigator.clipboard.writeText(val);\n setCopyState(CopyState.Copied);\n setTimeout(() => {\n setCopyState(CopyState.Available);\n }, 1000);\n }\n };\n\n return (\n <LabelRow margin={margin}>\n <LabelRowInner size={size}>\n <Label htmlFor={inputId} onClick={() => onTriggerClick(inputId)} className={size || ''}>\n {text}\n </Label>\n {required && <SystemIcons.Asterisk size=\"16px\" color={COLORS.critical_500} />}\n\n {showCopyButton && \n <CopyContainer className={copyState != CopyState.Available ? \"disabled\" : \"\"} onClick={copyInputClick}>\n { size == Size.Medium ? <ComponentXS>{copyState == CopyState.Copied ? 'Copied' : 'Copy'}</ComponentXS> :\n <ComponentXXS>{copyState == CopyState.Copied ? 'Copied' : 'Copy'}</ComponentXXS> }\n </CopyContainer> }\n </LabelRowInner>\n </LabelRow>\n );\n};\n\nexport default InputLabel;\n"],"mappings":";;;;;;;;;;;AAGA;AAKA;AACA;AAKA;AACA;AACA;AAAuC;AAAA;AAAA;AAA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,IAAI,EAAED,IAAK;MAAA,wBACxB,qBAAC,KAAK;QAAC,OAAO,EAAEF,OAAQ;QAAC,OAAO,EAAE;UAAA,OAAMmB,cAAc,CAACnB,OAAO,CAAC;QAAA,CAAC;QAAC,SAAS,EAAEE,IAAI,IAAI,EAAG;QAAA,UACpFD;MAAI,EACC,EACPI,QAAQ,iBAAI,qBAAC,kBAAW,CAAC,QAAQ;QAAC,IAAI,EAAC,MAAM;QAAC,KAAK,EAAErB,cAAM,CAACiD;MAAa,EAAG,EAE5E3B,cAAc,iBACf,qBAAC,aAAa;QAAC,SAAS,EAAEK,SAAS,IAAIb,SAAS,CAACY,SAAS,GAAG,UAAU,GAAG,EAAG;QAAC,OAAO,EAAEY,cAAe;QAAA,UAClGpB,IAAI,IAAIgC,WAAI,CAACC,MAAM,gBAAG,qBAAC,uBAAW;UAAA,UAAExB,SAAS,IAAIb,SAAS,CAAC2B,MAAM,GAAG,QAAQ,GAAG;QAAM,EAAe,gBACtG,qBAAC,wBAAY;UAAA,UAAEd,SAAS,IAAIb,SAAS,CAAC2B,MAAM,GAAG,QAAQ,GAAG;QAAM;MAAgB,EAClE;IAAA;EACF,EACP;AAEf,CAAC;AAAC;EA1EAzB,OAAO;EACPC,IAAI;EAEJE,MAAM;EACNE,QAAQ;EACRC,cAAc;AAAA;AAAA,eAuEDP,UAAU;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","names":["React","BREAKPOINTS","COLORS","Size","styled","ComponentXS","ComponentXSStyling","ComponentXXS","ComponentXXSStyling","TypographyBase","SystemIcons","Label","label","neutral_500","MEDIUM","LabelRow","div","CopyContainer","primary_800","primary_700","primary_600","neutral_300","LabelRowInner","CopyState","InputLabel","inputId","text","size","margin","requiredProp","required","showCopyButton","useState","setRequired","Available","copyState","setCopyState","useEffect","undefined","document","getElementById","getAttribute","Boolean","onTriggerClick","id","click","copyInputClick","e","preventDefault","Copied","val","value","window","navigator","clipboard","writeText","setTimeout","critical_500","Medium"],"sources":["../../src/InputFields/Label.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Size } from '../types';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentXS, ComponentXSStyling, ComponentXXS, ComponentXXSStyling, TypographyBase } from '../styles/typography';\nimport { SystemIcons } from '../icons';\nimport {HyperLink, StyledLink} from '../HyperLink';\n\n// Add component-specific styles.\nconst Label = styled.label`\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n &.small {\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n }\n &.medium {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n pointer-events: none;\n`;\n\nconst LabelRow = styled.div<{ margin?: string }>`\n display: flex;\n align-items: flex-start;\n height: 16px;\n margin-bottom: 4px;\n`;\n\nconst CopyContainer = styled.div`\n margin-left: auto;\n\n &:visited:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_800};\n }\n }\n\n &:hover:not(.disabled),\n &.hover-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n text-decoration-line: underline;\n }\n }\n\n &:focus:not(.disabled),\n &.focus-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:active:not(.disabled),\n &.active-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:not(.disabled)\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.primary_600};\n }\n }\n\n &.disabled\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.neutral_300};\n }\n }\n cursor: pointer;\n`;\n\nconst LabelRowInner = styled.div<{ size: Size.Small | Size.Medium | undefined }>`\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\n// Add component-specific types\
|
|
1
|
+
{"version":3,"file":"Label.js","names":["React","BREAKPOINTS","COLORS","Size","styled","ComponentXS","ComponentXSStyling","ComponentXXS","ComponentXXSStyling","TypographyBase","SystemIcons","Label","label","neutral_500","MEDIUM","LabelRow","div","CopyContainer","primary_800","primary_700","primary_600","neutral_300","LabelRowInner","CopyState","InputLabel","inputId","text","size","margin","requiredProp","required","showCopyButton","useState","setRequired","Available","copyState","setCopyState","useEffect","undefined","document","getElementById","getAttribute","Boolean","onTriggerClick","id","click","copyInputClick","e","preventDefault","Copied","val","value","window","navigator","clipboard","writeText","setTimeout","critical_500","Medium"],"sources":["../../src/InputFields/Label.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { Size } from '../types';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentXS, ComponentXSStyling, ComponentXXS, ComponentXXSStyling, TypographyBase } from '../styles/typography';\nimport { SystemIcons } from '../icons';\nimport {HyperLink, StyledLink} from '../HyperLink';\n\n// Add component-specific styles.\nconst Label = styled.label`\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n &.small {\n ${ComponentXXSStyling(1, COLORS.neutral_500)}\n }\n &.medium {\n ${ComponentXSStyling(1, COLORS.neutral_500)}\n }\n\n pointer-events: none;\n`;\n\nconst LabelRow = styled.div<{ margin?: string }>`\n display: flex;\n align-items: flex-start;\n height: 16px;\n margin-bottom: 4px;\n`;\n\nconst CopyContainer = styled.div`\n margin-left: auto;\n\n &:visited:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_800};\n }\n }\n\n &:hover:not(.disabled),\n &.hover-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n text-decoration-line: underline;\n }\n }\n\n &:focus:not(.disabled),\n &.focus-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:active:not(.disabled),\n &.active-state:not(.disabled) {\n ${TypographyBase}\n {\n color: ${COLORS.primary_700};\n background-color: white;\n text-decoration-line: underline;\n }\n }\n\n &:not(.disabled)\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.primary_600};\n }\n }\n\n &.disabled\n {\n ${TypographyBase}\n {\n outline: none;\n padding: 2px 0;\n text-decoration-style: solid;\n text-decoration-line: none;\n font-weight: 700;\n color: ${COLORS.neutral_300};\n }\n }\n cursor: pointer;\n`;\n\nconst LabelRowInner = styled.div<{ size: Size.Small | Size.Medium | undefined }>`\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\n// Add component-specific types\nexport type LabelProps = {\n inputId: string;\n text: string;\n size?: Size.Small | Size.Medium;\n margin?: string;\n required?: boolean;\n showCopyButton?: boolean;\n};\n\nenum CopyState {\n Disabled = 0,\n Available = 1,\n Copied = 2\n}\n\nconst InputLabel: React.FunctionComponent<LabelProps> = ({ inputId, text, size, margin, required: requiredProp, showCopyButton }: LabelProps) => {\n // Globally used variables within the component\n const [required, setRequired] = React.useState<boolean>(false);\n const [copyState, setCopyState] = React.useState<CopyState>(CopyState.Available);\n\n /**\n * Checks if field is set as required and we have to mark it accordingly.\n */\n React.useEffect(() => {\n if(requiredProp === undefined)\n {\n if (document.getElementById(inputId)?.getAttribute('required') === '') {\n setRequired(true);\n } else {\n setRequired(false);\n }\n }\n else\n setRequired(Boolean(requiredProp));\n }, []);\n /**\n * Triggers a click element on a specific element.\n * @param id - ID of the element which needs to be clicked.\n */\n const onTriggerClick = (id: string): void => {\n document.getElementById(id)?.click();\n };\n\n const copyInputClick = (e: any) => {\n e.preventDefault();\n if(copyState == CopyState.Copied)\n return;\n \n const val = (document.getElementById(inputId) as HTMLInputElement)?.value;\n if(val)\n {\n window.navigator.clipboard.writeText(val);\n setCopyState(CopyState.Copied);\n setTimeout(() => {\n setCopyState(CopyState.Available);\n }, 1000);\n }\n };\n\n return (\n <LabelRow margin={margin}>\n <LabelRowInner size={size}>\n <Label htmlFor={inputId} onClick={() => onTriggerClick(inputId)} className={size || ''}>\n {text}\n </Label>\n {required && <SystemIcons.Asterisk size=\"16px\" color={COLORS.critical_500} />}\n\n {showCopyButton && \n <CopyContainer className={copyState != CopyState.Available ? \"disabled\" : \"\"} onClick={copyInputClick}>\n { size == Size.Medium ? <ComponentXS>{copyState == CopyState.Copied ? 'Copied' : 'Copy'}</ComponentXS> :\n <ComponentXXS>{copyState == CopyState.Copied ? 'Copied' : 'Copy'}</ComponentXXS> }\n </CopyContainer> }\n </LabelRowInner>\n </LabelRow>\n );\n};\n\nexport default InputLabel;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAE9B;AACA;AACA;AACA,SAASC,WAAW,EAAEC,MAAM,QAAQ,WAAW;AAC/C,SAASC,IAAI,QAAQ,UAAU;;AAE/B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,WAAW,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,mBAAmB,EAAEC,cAAc,QAAQ,sBAAsB;AACzH,SAASC,WAAW,QAAQ,UAAU;AAAC;AAAA;AAGvC;AACA,IAAMC,KAAK,GAAGP,MAAM,CAACQ,KAAK,iMACtBJ,mBAAmB,CAAC,CAAC,EAAEN,MAAM,CAACW,WAAW,CAAC,EAE1CZ,WAAW,C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