@laerdal/life-react-components 3.5.0 → 3.5.2-uss.hackathon

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.
Files changed (100) hide show
  1. package/dist/Dropdown/BasicDropdown.cjs +5 -6
  2. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  3. package/dist/Dropdown/BasicDropdown.d.ts +0 -1
  4. package/dist/Dropdown/BasicDropdown.js +5 -6
  5. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  6. package/dist/Dropdown/CommonStyling.cjs +2 -2
  7. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  8. package/dist/Dropdown/CommonStyling.js +2 -2
  9. package/dist/Dropdown/CommonStyling.js.map +1 -1
  10. package/dist/Dropdown/DropdownFilter.cjs +2 -4
  11. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  12. package/dist/Dropdown/DropdownFilter.d.ts +0 -1
  13. package/dist/Dropdown/DropdownFilter.js +2 -4
  14. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  15. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +3 -1
  16. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
  17. package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +2 -0
  18. package/dist/GlobalNavigationBar/GlobalNavigationBar.js +3 -1
  19. package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
  20. package/dist/GlobalNavigationBar/business/SearchService.cjs +2 -0
  21. package/dist/GlobalNavigationBar/business/SearchService.cjs.map +1 -0
  22. package/dist/GlobalNavigationBar/business/SearchService.d.ts +0 -0
  23. package/dist/GlobalNavigationBar/business/SearchService.js +2 -0
  24. package/dist/GlobalNavigationBar/business/SearchService.js.map +1 -0
  25. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +12 -3
  26. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
  27. package/dist/GlobalNavigationBar/desktop/DesktopActions.d.ts +2 -1
  28. package/dist/GlobalNavigationBar/desktop/DesktopActions.js +10 -2
  29. package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
  30. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +2 -0
  31. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
  32. package/dist/GlobalNavigationBar/desktop/MainMenu.js +2 -0
  33. package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
  34. package/dist/GlobalNavigationBar/desktop/UnifedSearchComponent.cjs +100 -0
  35. package/dist/GlobalNavigationBar/desktop/UnifedSearchComponent.cjs.map +1 -0
  36. package/dist/GlobalNavigationBar/desktop/UnifedSearchComponent.d.ts +8 -0
  37. package/dist/GlobalNavigationBar/desktop/UnifedSearchComponent.js +89 -0
  38. package/dist/GlobalNavigationBar/desktop/UnifedSearchComponent.js.map +1 -0
  39. package/dist/GlobalNavigationBar/desktop/UnifedSearchServiceApi.cjs +38 -0
  40. package/dist/GlobalNavigationBar/desktop/UnifedSearchServiceApi.cjs.map +1 -0
  41. package/dist/GlobalNavigationBar/desktop/UnifedSearchServiceApi.d.ts +21 -0
  42. package/dist/GlobalNavigationBar/desktop/UnifedSearchServiceApi.js +30 -0
  43. package/dist/GlobalNavigationBar/desktop/UnifedSearchServiceApi.js.map +1 -0
  44. package/dist/GlobalNavigationBar/index.cjs +9 -1
  45. package/dist/GlobalNavigationBar/index.cjs.map +1 -1
  46. package/dist/GlobalNavigationBar/index.d.ts +1 -0
  47. package/dist/GlobalNavigationBar/index.js +1 -0
  48. package/dist/GlobalNavigationBar/index.js.map +1 -1
  49. package/dist/GlobalNavigationBar/types.cjs.map +1 -1
  50. package/dist/GlobalNavigationBar/types.d.ts +7 -2
  51. package/dist/GlobalNavigationBar/types.js.map +1 -1
  52. package/dist/InputFields/DatepickerField.cjs +3 -5
  53. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  54. package/dist/InputFields/DatepickerField.d.ts +0 -2
  55. package/dist/InputFields/DatepickerField.js +3 -5
  56. package/dist/InputFields/DatepickerField.js.map +1 -1
  57. package/dist/InputFields/NumberField.cjs +5 -7
  58. package/dist/InputFields/NumberField.cjs.map +1 -1
  59. package/dist/InputFields/NumberField.d.ts +0 -2
  60. package/dist/InputFields/NumberField.js +5 -7
  61. package/dist/InputFields/NumberField.js.map +1 -1
  62. package/dist/InputFields/SearchBar.cjs +7 -2
  63. package/dist/InputFields/SearchBar.cjs.map +1 -1
  64. package/dist/InputFields/SearchBar.d.ts +1 -0
  65. package/dist/InputFields/SearchBar.js +7 -2
  66. package/dist/InputFields/SearchBar.js.map +1 -1
  67. package/dist/InputFields/TextField.cjs +2 -4
  68. package/dist/InputFields/TextField.cjs.map +1 -1
  69. package/dist/InputFields/TextField.d.ts +0 -2
  70. package/dist/InputFields/TextField.js +2 -4
  71. package/dist/InputFields/TextField.js.map +1 -1
  72. package/dist/InputFields/styling.cjs +2 -2
  73. package/dist/InputFields/styling.cjs.map +1 -1
  74. package/dist/InputFields/styling.js +2 -2
  75. package/dist/InputFields/styling.js.map +1 -1
  76. package/dist/Modals/ModalDialog.cjs +6 -8
  77. package/dist/Modals/ModalDialog.cjs.map +1 -1
  78. package/dist/Modals/ModalDialog.js +6 -8
  79. package/dist/Modals/ModalDialog.js.map +1 -1
  80. package/dist/Modals/ModalTypes.cjs.map +1 -1
  81. package/dist/Modals/ModalTypes.d.ts +2 -3
  82. package/dist/Modals/ModalTypes.js.map +1 -1
  83. package/dist/Tooltips/TooltipOverflow.cjs +7 -2
  84. package/dist/Tooltips/TooltipOverflow.cjs.map +1 -1
  85. package/dist/Tooltips/TooltipOverflow.js +7 -2
  86. package/dist/Tooltips/TooltipOverflow.js.map +1 -1
  87. package/dist/Tooltips/TooltipStyles.cjs +5 -5
  88. package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
  89. package/dist/Tooltips/TooltipStyles.d.ts +1 -2
  90. package/dist/Tooltips/TooltipStyles.js +5 -5
  91. package/dist/Tooltips/TooltipStyles.js.map +1 -1
  92. package/dist/Tooltips/TooltipWrapper.cjs +1 -2
  93. package/dist/Tooltips/TooltipWrapper.cjs.map +1 -1
  94. package/dist/Tooltips/TooltipWrapper.js +1 -2
  95. package/dist/Tooltips/TooltipWrapper.js.map +1 -1
  96. package/dist/icons/index.cjs +1 -1
  97. package/dist/icons/index.cjs.map +1 -1
  98. package/dist/icons/index.js +1 -1
  99. package/dist/icons/index.js.map +1 -1
  100. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ var UssApi = /*#__PURE__*/_createClass(function UssApi() {
5
+ var _this = this;
6
+ _classCallCheck(this, UssApi);
7
+ _defineProperty(this, "token", undefined);
8
+ _defineProperty(this, "baseUrl", undefined);
9
+ _defineProperty(this, "storeJWT", function (token) {
10
+ _this.token = token;
11
+ });
12
+ _defineProperty(this, "storeBaseUrl", function (baseUrl) {
13
+ _this.baseUrl = baseUrl;
14
+ });
15
+ _defineProperty(this, "quickSearch", function (query) {
16
+ return fetch("".concat(_this.baseUrl, "/api/search?query=").concat(encodeURI(query)), {
17
+ method: "GET",
18
+ headers: _this.token ? {
19
+ "Authorization": "Bearer ".concat(_this.token)
20
+ } : {}
21
+ }).then(function (response) {
22
+ return response.json();
23
+ }).catch(function (error) {
24
+ return console.log(error);
25
+ });
26
+ });
27
+ });
28
+ _defineProperty(UssApi, "instance", new UssApi());
29
+ export default UssApi.instance;
30
+ //# sourceMappingURL=UnifedSearchServiceApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnifedSearchServiceApi.js","names":["UssApi","undefined","token","baseUrl","query","fetch","encodeURI","method","headers","then","response","json","catch","error","console","log","instance"],"sources":["../../../src/GlobalNavigationBar/desktop/UnifedSearchServiceApi.tsx"],"sourcesContent":["\r\nclass UssApi {\r\n // Globally used variables within the API class.\r\n public token: string | undefined = undefined;\r\n public baseUrl: string | undefined = undefined;\r\n static instance = new UssApi();\r\n \r\n /**\r\n * Stores the Office365 access token.\r\n */\r\n storeJWT = (token: string | undefined) => {\r\n this.token = token;\r\n };\r\n\r\n /**\r\n * Stores the base URL for the API.\r\n */\r\n storeBaseUrl = (baseUrl: string | undefined) => {\r\n this.baseUrl = baseUrl;\r\n };\r\n \r\n /**\r\n * Calls USS search endpoint\r\n * @param query - query to search for\r\n * @returns Top 10 search results\r\n */\r\n quickSearch = (query: string): Promise<any> => {\r\n return fetch(`${this.baseUrl}/api/search?query=${encodeURI(query)}`, {\r\n method: \"GET\",\r\n headers: this.token ? {\r\n \"Authorization\" : `Bearer ${this.token}`\r\n } : {},\r\n })\r\n .then((response) => response.json())\r\n .catch((error) => console.log(error));\r\n };\r\n}\r\n\r\nexport default UssApi.instance;\r\n"],"mappings":";;;IACMA,MAAM;EAAA;EAAA;EAAA,+BAE2BC,SAAS;EAAA,iCACPA,SAAS;EAAA,kCAMnC,UAACC,KAAyB,EAAK;IACxC,KAAI,CAACA,KAAK,GAAGA,KAAK;EACpB,CAAC;EAAA,sCAKc,UAACC,OAA2B,EAAK;IAC5C,KAAI,CAACA,OAAO,GAAIA,OAAO;EAC3B,CAAC;EAAA,qCAOa,UAACC,KAAa,EAAmB;IAC3C,OAAOC,KAAK,WAAI,KAAI,CAACF,OAAO,+BAAqBG,SAAS,CAACF,KAAK,CAAC,GAAI;MACjEG,MAAM,EAAE,KAAK;MACbC,OAAO,EAAE,KAAI,CAACN,KAAK,GAAG;QAClB,eAAe,mBAAa,KAAI,CAACA,KAAK;MAC1C,CAAC,GAAG,CAAC;IACL,CAAC,CAAC,CACDO,IAAI,CAAC,UAACC,QAAQ;MAAA,OAAKA,QAAQ,CAACC,IAAI,EAAE;IAAA,EAAC,CACnCC,KAAK,CAAC,UAACC,KAAK;MAAA,OAAKC,OAAO,CAACC,GAAG,CAACF,KAAK,CAAC;IAAA,EAAC;EAC7C,CAAC;AAAA;AAAA,gBAlCCb,MAAM,cAIU,IAAIA,MAAM,EAAE;AAiClC,eAAeA,MAAM,CAACgB,QAAQ"}
@@ -5,8 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  var _exportNames = {
8
- GlobalNavigationBar: true
8
+ GlobalNavigationBar: true,
9
+ CustomComponentWrapper: true
9
10
  };
11
+ Object.defineProperty(exports, "CustomComponentWrapper", {
12
+ enumerable: true,
13
+ get: function get() {
14
+ return _DesktopActions.DesktopActionsCustomComponentWrapper;
15
+ }
16
+ });
10
17
  Object.defineProperty(exports, "GlobalNavigationBar", {
11
18
  enumerable: true,
12
19
  get: function get() {
@@ -26,4 +33,5 @@ Object.keys(_types).forEach(function (key) {
26
33
  }
27
34
  });
28
35
  });
36
+ var _DesktopActions = require("./desktop/DesktopActions");
29
37
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/GlobalNavigationBar/index.tsx"],"sourcesContent":["import GlobalNavigationBar from './GlobalNavigationBar';\r\n\r\nexport * from './types';\r\n\r\nexport {GlobalNavigationBar};\r\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/GlobalNavigationBar/index.tsx"],"sourcesContent":["import GlobalNavigationBar from './GlobalNavigationBar';\r\n\r\nexport * from './types';\r\n\r\nexport {GlobalNavigationBar};\r\n\r\nexport { DesktopActionsCustomComponentWrapper as CustomComponentWrapper } from './desktop/DesktopActions';\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAIA"}
@@ -1,3 +1,4 @@
1
1
  import GlobalNavigationBar from './GlobalNavigationBar';
2
2
  export * from './types';
3
3
  export { GlobalNavigationBar };
4
+ export { DesktopActionsCustomComponentWrapper as CustomComponentWrapper } from './desktop/DesktopActions';
@@ -1,4 +1,5 @@
1
1
  import GlobalNavigationBar from './GlobalNavigationBar';
2
2
  export * from './types';
3
3
  export { GlobalNavigationBar };
4
+ export { DesktopActionsCustomComponentWrapper as CustomComponentWrapper } from './desktop/DesktopActions';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["GlobalNavigationBar"],"sources":["../../src/GlobalNavigationBar/index.tsx"],"sourcesContent":["import GlobalNavigationBar from './GlobalNavigationBar';\r\n\r\nexport * from './types';\r\n\r\nexport {GlobalNavigationBar};\r\n"],"mappings":"AAAA,OAAOA,mBAAmB,MAAM,uBAAuB;AAEvD,cAAc,SAAS;AAEvB,SAAQA,mBAAmB"}
1
+ {"version":3,"file":"index.js","names":["GlobalNavigationBar","DesktopActionsCustomComponentWrapper","CustomComponentWrapper"],"sources":["../../src/GlobalNavigationBar/index.tsx"],"sourcesContent":["import GlobalNavigationBar from './GlobalNavigationBar';\r\n\r\nexport * from './types';\r\n\r\nexport {GlobalNavigationBar};\r\n\r\nexport { DesktopActionsCustomComponentWrapper as CustomComponentWrapper } from './desktop/DesktopActions';\r\n"],"mappings":"AAAA,OAAOA,mBAAmB,MAAM,uBAAuB;AAEvD,cAAc,SAAS;AAEvB,SAAQA,mBAAmB;AAE3B,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { IconButtonProps } from '../Button/Iconbutton';\r\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\r\nimport { NavLinkProps } from 'react-router-dom';\r\nimport {ButtonProps} from \"../Button/Button\";\r\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\r\n\r\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\r\n label: string;\r\n icon?: React.ReactElement;\r\n}\r\n\r\nexport interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {\r\n label: string;\r\n action: () => void;\r\n\r\n tooltip?: TooltipProps;\r\n}\r\n\r\nexport interface MenuGroupFooter {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuGroupHeader {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuAccountInfo {\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface ProfileMenu {\r\n label?: string;\r\n\r\n user: MenuAccountInfo;\r\n\r\n sections: MenuNavigationSection[];\r\n\r\n signOut?: MenuButton;\r\n}\r\n\r\nexport interface MenuIconSubMenuButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'submenu';\r\n icon: React.ReactNode;\r\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuIconButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'action';\r\n icon: React.ReactNode;\r\n action: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\r\n type: 'profile';\r\n action?: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuSwitcherButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'id'\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'switcher';\r\n placement?: 'left' | 'right';\r\n action?: (button?: EventTarget) => boolean | void;\r\n}\r\n\r\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\r\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;\r\n\r\nexport interface MobileNavigationMenuProps {\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n\r\n header?: MenuGroupHeader;\r\n\r\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport interface DesktopNavigationMenuProps {\r\n buttons?: DesktopMenuButtonTypes[];\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n action?: MenuButton;\r\n reverseRightSideOrder?: boolean;\r\n}\r\n\r\n// @ts-ignore\r\nexport interface MenuNavigationGroup<T = MenuNavigationItemTypeDesktopGroup | MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\r\n label: string;\r\n note?: string;\r\n\r\n buttons?: MobileMenuButtonTypes[];\r\n header?: MenuGroupHeader;\r\n\r\n items: T[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport type MenuNavigationItem = {\r\n icon?: React.ReactNode;\r\n to: string;\r\n exact?: boolean;\r\n disabled?: boolean;\r\n external?: boolean;\r\n action?: (e: React.MouseEvent) => void;\r\n label: string;\r\n note?: string;\r\n pinned?: boolean;\r\n subItems?: MenuNavigationItem[];\r\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\r\n\r\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\r\n divider?: boolean;\r\n pinned?: boolean;\r\n label?: string;\r\n items: T[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\r\n type?: 'item';\r\n};\r\n\r\nexport type MenuNavigationItemTypeDesktopGroup = {\r\n id: string;\r\n label?: string;\r\n disabled?: boolean;\r\n pinned?: boolean;\r\n type?: 'desktopgroup';\r\n expanded?: boolean;\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\r\n type: 'group';\r\n icon?: React.ReactNode;\r\n pinned?: boolean;\r\n disabled?: boolean;\r\n};\r\n\r\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\r\n type: 'section';\r\n};\r\n\r\nexport type MenuNavigationCustomSubMenu = {\r\n type: 'custom';\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n custom: () => React.ReactNode;\r\n};\r\n"],"mappings":""}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { IconButtonProps } from '../Button/Iconbutton';\r\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\r\nimport { NavLinkProps } from 'react-router-dom';\r\nimport {ButtonProps} from \"../Button/Button\";\r\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\r\n\r\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\r\n label: string;\r\n icon?: React.ReactElement;\r\n}\r\n\r\nexport interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {\r\n label: string;\r\n action: () => void;\r\n\r\n tooltip?: TooltipProps;\r\n}\r\n\r\nexport interface MenuGroupFooter {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuGroupHeader {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuAccountInfo {\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface ProfileMenu {\r\n label?: string;\r\n\r\n user: MenuAccountInfo;\r\n\r\n sections: MenuNavigationSection[];\r\n\r\n signOut?: MenuButton;\r\n}\r\n\r\nexport interface MenuIconSubMenuButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'submenu';\r\n icon: React.ReactNode;\r\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuIconButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'action';\r\n icon: React.ReactNode;\r\n action: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\r\n type: 'profile';\r\n action?: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuSwitcherButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'id'\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'switcher';\r\n placement?: 'left' | 'right';\r\n action?: (button?: EventTarget) => boolean | void;\r\n}\r\n\r\nexport interface MenuCustomComponent {\r\n type: 'custom';\r\n placement?: 'left' | 'right';\r\n content: () => React.ReactNode;\r\n}\r\n\r\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuCustomComponent;\r\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuCustomComponent;\r\n\r\nexport interface MobileNavigationMenuProps {\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n\r\n header?: MenuGroupHeader;\r\n\r\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport interface DesktopNavigationMenuProps {\r\n buttons?: DesktopMenuButtonTypes[];\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n action?: MenuButton;\r\n reverseRightSideOrder?: boolean;\r\n}\r\n\r\n// @ts-ignore\r\nexport interface MenuNavigationGroup<T = MenuNavigationItemTypeDesktopGroup | MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\r\n label: string;\r\n note?: string;\r\n\r\n buttons?: MobileMenuButtonTypes[];\r\n header?: MenuGroupHeader;\r\n\r\n items: T[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport type MenuNavigationItem = {\r\n icon?: React.ReactNode;\r\n to: string;\r\n exact?: boolean;\r\n disabled?: boolean;\r\n external?: boolean;\r\n action?: (e: React.MouseEvent) => void;\r\n label: string;\r\n note?: string;\r\n pinned?: boolean;\r\n subItems?: MenuNavigationItem[];\r\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\r\n\r\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\r\n divider?: boolean;\r\n pinned?: boolean;\r\n label?: string;\r\n items: T[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\r\n type?: 'item';\r\n};\r\n\r\nexport type MenuNavigationItemTypeDesktopGroup = {\r\n id: string;\r\n label?: string;\r\n disabled?: boolean;\r\n pinned?: boolean;\r\n type?: 'desktopgroup';\r\n expanded?: boolean;\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\r\n type: 'group';\r\n icon?: React.ReactNode;\r\n pinned?: boolean;\r\n disabled?: boolean;\r\n};\r\n\r\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\r\n type: 'section';\r\n};\r\n\r\nexport type MenuNavigationCustomSubMenu = {\r\n type: 'custom';\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n custom: () => React.ReactNode;\r\n};\r\n"],"mappings":""}
@@ -58,8 +58,13 @@ export interface MenuSwitcherButton extends Omit<IconButtonProps, 'id' | 'type'
58
58
  placement?: 'left' | 'right';
59
59
  action?: (button?: EventTarget) => boolean | void;
60
60
  }
61
- export type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;
62
- export type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;
61
+ export interface MenuCustomComponent {
62
+ type: 'custom';
63
+ placement?: 'left' | 'right';
64
+ content: () => React.ReactNode;
65
+ }
66
+ export type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuCustomComponent;
67
+ export type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuCustomComponent;
63
68
  export interface MobileNavigationMenuProps {
64
69
  label?: string;
65
70
  buttons?: MobileMenuButtonTypes[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { IconButtonProps } from '../Button/Iconbutton';\r\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\r\nimport { NavLinkProps } from 'react-router-dom';\r\nimport {ButtonProps} from \"../Button/Button\";\r\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\r\n\r\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\r\n label: string;\r\n icon?: React.ReactElement;\r\n}\r\n\r\nexport interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {\r\n label: string;\r\n action: () => void;\r\n\r\n tooltip?: TooltipProps;\r\n}\r\n\r\nexport interface MenuGroupFooter {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuGroupHeader {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuAccountInfo {\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface ProfileMenu {\r\n label?: string;\r\n\r\n user: MenuAccountInfo;\r\n\r\n sections: MenuNavigationSection[];\r\n\r\n signOut?: MenuButton;\r\n}\r\n\r\nexport interface MenuIconSubMenuButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'submenu';\r\n icon: React.ReactNode;\r\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuIconButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'action';\r\n icon: React.ReactNode;\r\n action: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\r\n type: 'profile';\r\n action?: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuSwitcherButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'id'\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'switcher';\r\n placement?: 'left' | 'right';\r\n action?: (button?: EventTarget) => boolean | void;\r\n}\r\n\r\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\r\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;\r\n\r\nexport interface MobileNavigationMenuProps {\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n\r\n header?: MenuGroupHeader;\r\n\r\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport interface DesktopNavigationMenuProps {\r\n buttons?: DesktopMenuButtonTypes[];\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n action?: MenuButton;\r\n reverseRightSideOrder?: boolean;\r\n}\r\n\r\n// @ts-ignore\r\nexport interface MenuNavigationGroup<T = MenuNavigationItemTypeDesktopGroup | MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\r\n label: string;\r\n note?: string;\r\n\r\n buttons?: MobileMenuButtonTypes[];\r\n header?: MenuGroupHeader;\r\n\r\n items: T[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport type MenuNavigationItem = {\r\n icon?: React.ReactNode;\r\n to: string;\r\n exact?: boolean;\r\n disabled?: boolean;\r\n external?: boolean;\r\n action?: (e: React.MouseEvent) => void;\r\n label: string;\r\n note?: string;\r\n pinned?: boolean;\r\n subItems?: MenuNavigationItem[];\r\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\r\n\r\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\r\n divider?: boolean;\r\n pinned?: boolean;\r\n label?: string;\r\n items: T[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\r\n type?: 'item';\r\n};\r\n\r\nexport type MenuNavigationItemTypeDesktopGroup = {\r\n id: string;\r\n label?: string;\r\n disabled?: boolean;\r\n pinned?: boolean;\r\n type?: 'desktopgroup';\r\n expanded?: boolean;\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\r\n type: 'group';\r\n icon?: React.ReactNode;\r\n pinned?: boolean;\r\n disabled?: boolean;\r\n};\r\n\r\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\r\n type: 'section';\r\n};\r\n\r\nexport type MenuNavigationCustomSubMenu = {\r\n type: 'custom';\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n custom: () => React.ReactNode;\r\n};\r\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { IconButtonProps } from '../Button/Iconbutton';\r\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\r\nimport { NavLinkProps } from 'react-router-dom';\r\nimport {ButtonProps} from \"../Button/Button\";\r\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\r\n\r\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\r\n label: string;\r\n icon?: React.ReactElement;\r\n}\r\n\r\nexport interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {\r\n label: string;\r\n action: () => void;\r\n\r\n tooltip?: TooltipProps;\r\n}\r\n\r\nexport interface MenuGroupFooter {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuGroupHeader {\r\n header: string;\r\n note?: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuAccountInfo {\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface ProfileMenu {\r\n label?: string;\r\n\r\n user: MenuAccountInfo;\r\n\r\n sections: MenuNavigationSection[];\r\n\r\n signOut?: MenuButton;\r\n}\r\n\r\nexport interface MenuIconSubMenuButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'submenu';\r\n icon: React.ReactNode;\r\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuIconButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'action';\r\n icon: React.ReactNode;\r\n action: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\r\n type: 'profile';\r\n action?: (button?: EventTarget) => boolean | void;\r\n placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuSwitcherButton\r\n extends Omit<\r\n IconButtonProps,\r\n | 'id'\r\n | 'type'\r\n | 'action'\r\n | 'shape'\r\n | 'variant'\r\n | 'hideOnLowWidth'\r\n | 'flatEdge'\r\n | 'isInMobileMenu'\r\n | 'useTransparentBackground'\r\n | 'shouldNotInteract'\r\n | 'iconColor'\r\n | 'unsetIconSize'\r\n | 'borderRadius'\r\n | 'focusBackgroundColor'\r\n | 'children'\r\n | 'invertFocus'\r\n > {\r\n type: 'switcher';\r\n placement?: 'left' | 'right';\r\n action?: (button?: EventTarget) => boolean | void;\r\n}\r\n\r\nexport interface MenuCustomComponent {\r\n type: 'custom';\r\n placement?: 'left' | 'right';\r\n content: () => React.ReactNode;\r\n}\r\n\r\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuCustomComponent;\r\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuCustomComponent;\r\n\r\nexport interface MobileNavigationMenuProps {\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n\r\n header?: MenuGroupHeader;\r\n\r\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport interface DesktopNavigationMenuProps {\r\n buttons?: DesktopMenuButtonTypes[];\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n action?: MenuButton;\r\n reverseRightSideOrder?: boolean;\r\n}\r\n\r\n// @ts-ignore\r\nexport interface MenuNavigationGroup<T = MenuNavigationItemTypeDesktopGroup | MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\r\n label: string;\r\n note?: string;\r\n\r\n buttons?: MobileMenuButtonTypes[];\r\n header?: MenuGroupHeader;\r\n\r\n items: T[];\r\n\r\n footer?: MenuGroupFooter;\r\n action?: MenuButton;\r\n}\r\n\r\nexport type MenuNavigationItem = {\r\n icon?: React.ReactNode;\r\n to: string;\r\n exact?: boolean;\r\n disabled?: boolean;\r\n external?: boolean;\r\n action?: (e: React.MouseEvent) => void;\r\n label: string;\r\n note?: string;\r\n pinned?: boolean;\r\n subItems?: MenuNavigationItem[];\r\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\r\n\r\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\r\n divider?: boolean;\r\n pinned?: boolean;\r\n label?: string;\r\n items: T[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\r\n type?: 'item';\r\n};\r\n\r\nexport type MenuNavigationItemTypeDesktopGroup = {\r\n id: string;\r\n label?: string;\r\n disabled?: boolean;\r\n pinned?: boolean;\r\n type?: 'desktopgroup';\r\n expanded?: boolean;\r\n items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\r\n type: 'group';\r\n icon?: React.ReactNode;\r\n pinned?: boolean;\r\n disabled?: boolean;\r\n};\r\n\r\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\r\n type: 'section';\r\n};\r\n\r\nexport type MenuNavigationCustomSubMenu = {\r\n type: 'custom';\r\n label?: string;\r\n buttons?: MobileMenuButtonTypes[];\r\n custom: () => React.ReactNode;\r\n};\r\n"],"mappings":""}
@@ -27,7 +27,7 @@ require("react-datepicker/dist/react-datepicker.css");
27
27
  var _common = require("../common");
28
28
  var _types = require("../types");
29
29
  var _jsxRuntime = require("react/jsx-runtime");
30
- var _excluded = ["disabled", "readOnly", "onChange", "invalid", "value", "validationMessage", "dateFormat", "autoComplete", "placeholder", "required", "yearPicker", "yearsBeforeCurrentDate", "yearsAfterCurrentDate", "margin", "overflowTooltipPosition", "onBlur", "showQuarterYearPicker", "id", "dataTestId"];
30
+ var _excluded = ["disabled", "readOnly", "onChange", "invalid", "value", "validationMessage", "dateFormat", "autoComplete", "placeholder", "required", "yearPicker", "yearsBeforeCurrentDate", "yearsAfterCurrentDate", "margin", "onBlur", "showQuarterYearPicker", "id", "dataTestId"];
31
31
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
32
32
  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; }
33
33
  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) { (0, _defineProperty2.default)(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; }
@@ -65,7 +65,6 @@ var DatepickerField = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
65
65
  yearsBeforeCurrentDate = _ref.yearsBeforeCurrentDate,
66
66
  yearsAfterCurrentDate = _ref.yearsAfterCurrentDate,
67
67
  margin = _ref.margin,
68
- overflowTooltipPosition = _ref.overflowTooltipPosition,
69
68
  onBlur = _ref.onBlur,
70
69
  showQuarterYearPicker = _ref.showQuarterYearPicker,
71
70
  id = _ref.id,
@@ -295,12 +294,12 @@ var DatepickerField = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
295
294
  })
296
295
  })]
297
296
  }), !open && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TooltipOverflow.default, {
298
- position: overflowTooltipPosition,
299
297
  input: inputRef,
300
298
  withArrow: true,
301
299
  maxWidth: "100%",
302
300
  size: _types.Size.Small,
303
301
  align: "end",
302
+ position: "bottom",
304
303
  children: getFormattedValue()
305
304
  })]
306
305
  })
@@ -327,8 +326,7 @@ DatepickerField.propTypes = {
327
326
  yearPicker: _propTypes.default.bool,
328
327
  yearsBeforeCurrentDate: _propTypes.default.number,
329
328
  yearsAfterCurrentDate: _propTypes.default.number,
330
- margin: _propTypes.default.string,
331
- overflowTooltipPosition: _propTypes.default.oneOf(['top', 'bottom'])
329
+ margin: _propTypes.default.string
332
330
  };
333
331
  var _default = DatepickerField;
334
332
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"DatepickerField.cjs","names":["dayjs","extend","advancedFormat","quarterOfYear","DatePickerContainer","styled","div","Z_INDEXES","dropdown","props","margin","COLORS","primary_20","focusStyles","neutral_20","neutral_200","yearPicker","ComponentSStyling","ComponentTextStyle","Bold","neutral_600","scrollBarStyling","Size","Small","ComponentMStyling","Regular","white","primary_700","primary_500","neutral_700","neutral_100","IconWrapper","focus","DatepickerRow","StyledInputFieldStyling","InputFieldStyling","neutral_500","primary_300","primary_200","primary_100","primary_800","neutral_300","quarterComponentsClassPrefix","DatepickerField","React","forwardRef","ref","disabled","readOnly","onChange","invalid","value","validationMessage","dateFormat","autoComplete","placeholder","required","yearsBeforeCurrentDate","yearsAfterCurrentDate","overflowTooltipPosition","onBlur","showQuarterYearPicker","id","dataTestId","rest","inputRef","useFocusVisibleRef","datepickerRef","useRef","focusedQuarterRef","useState","activeMonthPage","setActiveMonthPage","yearPickerMode","setYearPickerMode","openAt","setOpenAt","open","setOpen","getFormattedValue","val","year","quarter","format","useEffect","current","getQuarterItem","classname","document","getElementsByClassName","selectedDate","dropdownParent","parentElement","scrollTop","offsetTop","offsetHeight","wrapper","handler","event","key","currentQ","click","previousQ","tabIndex","nextQ","addEventListener","selectedQuarter","i","innerText","includes","setAttribute","firstQuarter","removeEventListener","useImperativeHandle","handleCalendarClose","blur","handleCalendarOpen","maxDate","Date","setFullYear","getFullYear","minDate","itemsNumber","Math","round","handleKeyDown","e","handleBlur","currentTarget","contains","relatedTarget","iconSize","newDate","setMonth","en","undefined","params","createElement","DatepickerFieldHeader","customHeaderCount","setSelectionRange","critical_400"],"sources":["../../src/InputFields/DatepickerField.tsx"],"sourcesContent":["/**\r\n * Import react libraries.\r\n */\r\nimport React from 'react';\r\n\r\n/**\r\n * Import third-party libraries.\r\n */\r\nimport styled from 'styled-components';\r\nimport DatePicker, { ReactDatePickerCustomHeaderProps } from 'react-datepicker';\r\nimport en from 'date-fns/locale/en-GB';\r\nimport dayjs from 'dayjs';\r\nimport advancedFormat from 'dayjs/plugin/advancedFormat';\r\nimport quarterOfYear from \"dayjs/plugin/quarterOfYear\";\r\n\r\ndayjs.extend(advancedFormat);\r\ndayjs.extend(quarterOfYear);\r\n\r\n/**\r\n * Import custom components.\r\n */\r\nimport COLORS from '../styles/colors';\r\nimport {SystemIcons} from '../icons';\r\nimport {DatepickerFieldHeader} from './DatepickerFieldHeader';\r\nimport {ComponentTextStyle, focusStyles, scrollBarStyling} from '../styles';\r\nimport TooltipOverflow from '../Tooltips/TooltipOverflow';\r\n\r\n/**\r\n * Import custom styles.\r\n */\r\nimport {ErrorMessage, InputFieldStyling, InputWrapper} from './styling';\r\nimport 'react-datepicker/dist/react-datepicker.css';\r\nimport {ComponentMStyling, ComponentSStyling} from '../styles';\r\nimport {Z_INDEXES} from '../styles';\r\nimport {useFocusVisibleRef} from '../common';\r\nimport {Size, Testable} from '../types';\r\n\r\n/**\r\n * Add custom types.\r\n */\r\nexport type DatepickerFieldProps = Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'size' | 'onBlur'> & {\r\n value?: Date;\r\n onChange?: (date: Date) => void;\r\n onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\r\n\r\n showQuarterYearPicker?: boolean;\r\n invalid?: boolean;\r\n dateFormat?: string;\r\n validationMessage?: string;\r\n autoComplete?: string;\r\n placeholder?: string;\r\n yearPicker?: boolean;\r\n yearsBeforeCurrentDate?: number;\r\n yearsAfterCurrentDate?: number;\r\n margin?: string;\r\n\r\n overflowTooltipPosition?: 'top' | 'bottom';\r\n};\r\n\r\n/**\r\n * Add custom styles.\r\n */\r\nconst DatePickerContainer = styled.div<{ yearPicker: boolean; margin: string; quarterPicker?: boolean }>`\r\n .react-datepicker-popper {\r\n z-index: ${Z_INDEXES.dropdown};\r\n }\r\n\r\n .react-datepicker-popper[data-placement^=bottom] {\r\n padding-top: 0px;\r\n }\r\n\r\n \r\n .react-datepicker-popper[data-placement^=top] {\r\n padding-bottom: 0px;\r\n }\r\n\r\n > div {\r\n display: block;\r\n\r\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\r\n .react-datepicker {\r\n box-sizing: border-box;\r\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\r\n border: 1px solid #e5e5e5;\r\n }\r\n .react-datepicker__input-container{\r\n z-index: 0;\r\n }\r\n\r\n .react-datepicker__navigation {\r\n line-height: normal;\r\n text-indent: inherit;\r\n border: none;\r\n border-radius: 4px;\r\n height: 48px;\r\n width: 48px;\r\n outline: none;\r\n margin: 0px;\r\n color: transparent;\r\n\r\n &:hover {\r\n background: ${COLORS.primary_20};\r\n\r\n &.react-datepicker__navigation--previous::before {\r\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\");\r\n }\r\n\r\n &.react-datepicker__navigation--next::before {\r\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\");\r\n }\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n &.react-datepicker__navigation--next::before {\r\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\");\r\n }\r\n\r\n &.react-datepicker__navigation--previous::before {\r\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\");\r\n }\r\n }\r\n\r\n &::before {\r\n text-align: center;\r\n display: inline-block;\r\n content: '';\r\n height: 32px;\r\n width: 32px;\r\n vertical-align: middle;\r\n }\r\n\r\n &.react-datepicker__navigation--next::before {\r\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\");\r\n }\r\n\r\n &.react-datepicker__navigation--previous::before {\r\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\");\r\n }\r\n }\r\n\r\n .react-datepicker__month-container,\r\n .react-datepicker__year--container {\r\n width: 336px;\r\n }\r\n\r\n .react-datepicker__month {\r\n margin: 0px;\r\n }\r\n\r\n .react-datepicker__triangle {\r\n left: 50% !important;\r\n display: none;\r\n }\r\n\r\n .react-datepicker-popper[data-placement^='bottom'] {\r\n margin-top: 0;\r\n }\r\n\r\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\r\n border-bottom-color: ${COLORS.neutral_20};\r\n }\r\n\r\n .react-datepicker__header {\r\n border-bottom: 1px solid ${COLORS.neutral_200};\r\n background: ${COLORS.neutral_20};\r\n height: ${(props) => (!props.yearPicker ? '96px' : '54px')};\r\n padding-top: 0px;\r\n }\r\n\r\n .react-datepicker-year-header {\r\n height: 48px;\r\n line-height: 48px !important;\r\n align-items: center;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\r\n }\r\n\r\n .react-datepicker__current-month {\r\n height: 48px;\r\n display: inline-flex;\r\n align-items: center;\r\n margin-right: 5px;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\r\n }\r\n\r\n .react-datepicker__year {\r\n max-height: 300px;\r\n overflow-y: scroll;\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n }\r\n\r\n .react-datepicker__quarter-wrapper{\r\n width: 100%;\r\n display: flex;\r\n align-content: space-evenly;\r\n flex-wrap: wrap;\r\n align-items: center;\r\n gap: 20px;\r\n }\r\n\r\n .react-datepicker__year-wrapper {\r\n max-width: 100%;\r\n justify-content: space-around;\r\n }\r\n\r\n .react-datepicker__navigation-icon {\r\n display: none;\r\n }\r\n\r\n .react-datepicker__day-name {\r\n display: inline-flex;\r\n justify-content: center;\r\n align-items: center;\r\n height: 48px;\r\n margin: 0px;\r\n width: 48px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n }\r\n\r\n \r\n\r\n .react-datepicker__year-text {\r\n background: ${COLORS.white};\r\n border: none;\r\n display: inline-flex;\r\n justify-content: center;\r\n align-items: center;\r\n margin-top: 20px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n &.react-datepicker__year-text--disabled {\r\n display: none;\r\n }\r\n\r\n &.react-datepicker__day--keyboard-selected {\r\n color: ${COLORS.neutral_600};\r\n background: ${COLORS.white};\r\n font-weight: 400;\r\n border: none;\r\n }\r\n\r\n &:hover {\r\n color: ${COLORS.primary_700};\r\n background: ${COLORS.primary_20};\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.react-datepicker__year-text--selected {\r\n color: ${COLORS.white} !important;\r\n background: ${COLORS.primary_500} !important;\r\n }\r\n }\r\n\r\n .react-datepicker__day, .react-datepicker__quarter-text {\r\n background: ${COLORS.white};\r\n border: none;\r\n display: inline-flex;\r\n justify-content: center;\r\n align-items: center;\r\n flex-grow: 1;\r\n height: 40px;\r\n width: 40px;\r\n margin: 4px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n &.react-datepicker__day--keyboard-selected, .react-datepicker__quarter-text--keyboard-selected {\r\n color: ${COLORS.neutral_600};\r\n background: ${COLORS.white};\r\n flex-grow: 1;\r\n font-weight: 400;\r\n border: none;\r\n }\r\n\r\n &.react-datepicker__quarter--selected {\r\n color: ${COLORS.white} !important;\r\n flex-grow: 1;\r\n background: ${COLORS.primary_500} !important;\r\n }\r\n\r\n &:hover {\r\n color: ${COLORS.primary_700};\r\n background: ${COLORS.primary_20};\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.react-datepicker__day--selected {\r\n color: ${COLORS.white} !important;\r\n background: ${COLORS.primary_500} !important;\r\n }\r\n\r\n &.react-datepicker__day--today {\r\n border-radius: 0.3rem;\r\n color: ${COLORS.neutral_700};\r\n background: ${COLORS.neutral_100};\r\n\r\n &:hover {\r\n color: ${COLORS.primary_700};\r\n background: ${COLORS.primary_20};\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst IconWrapper = styled.div`\r\n pointer-events: none;\r\n position: absolute;\r\n left: 16px;\r\n width: 24px;\r\n height: 24px;\r\n z-index: ${+Z_INDEXES.focus + 1};\r\n`;\r\n\r\nconst DatepickerRow = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nconst StyledInputFieldStyling = styled(InputFieldStyling)`\r\n padding-left: 48px !important;\r\n \r\n &::placeholder {\r\n color: ${COLORS.neutral_500};\r\n }\r\n\r\n &:focus:not(.focus-visible) {\r\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\r\n }\r\n\r\n &:hover {\r\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_200};\r\n\r\n ::placeholder {\r\n color: ${COLORS.primary_700};\r\n }\r\n\r\n cursor: pointer;\r\n background-color: ${COLORS.primary_20};\r\n color: ${COLORS.primary_700};\r\n }\r\n\r\n &:active,\r\n &.open {\r\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\r\n background-color: ${COLORS.primary_100};\r\n color: ${COLORS.primary_800};\r\n\r\n ::placeholder {\r\n color: ${COLORS.primary_800};\r\n }\r\n }\r\n \r\n &:disabled {\r\n background-color: ${COLORS.white};\r\n }\r\n\r\n & ~ ${IconWrapper}{\r\n color: ${COLORS.neutral_600};\r\n }\r\n\r\n &:hover ~ ${IconWrapper} {\r\n color: ${COLORS.primary_700};\r\n }\r\n\r\n &:active ~ ${IconWrapper}, &.open ~ ${IconWrapper} {\r\n color: ${COLORS.primary_800};\r\n }\r\n\r\n &[tabindex='-1'] ~ ${IconWrapper} {\r\n color: ${COLORS.neutral_300};\r\n }\r\n`;\r\n\r\nconst quarterComponentsClassPrefix = 'react-datepicker__quarter-';\r\n\r\nconst DatepickerField = React.forwardRef<HTMLInputElement, DatepickerFieldProps>(({\r\n disabled,\r\n readOnly,\r\n onChange,\r\n invalid,\r\n value,\r\n validationMessage,\r\n dateFormat,\r\n autoComplete,\r\n placeholder,\r\n required,\r\n yearPicker,\r\n yearsBeforeCurrentDate,\r\n yearsAfterCurrentDate,\r\n margin,\r\n overflowTooltipPosition,\r\n onBlur,\r\n showQuarterYearPicker,\r\n id,\r\n dataTestId,\r\n ...rest\r\n }: DatepickerFieldProps, ref) => {\r\n // Globally used variables within the component\r\n const inputRef = useFocusVisibleRef();\r\n const datepickerRef = React.useRef<any>(null);\r\n const focusedQuarterRef = React.useRef<number>(1);\r\n const [activeMonthPage, setActiveMonthPage] = React.useState<number>(-1);\r\n const [yearPickerMode, setYearPickerMode] = React.useState<boolean>(false);\r\n const [openAt, setOpenAt] = React.useState<Date | null>(null);\r\n // 'open' flag is used only for tracking current state of the dropdown,\r\n // for explicitly opening/closing the picker we are using 'datepickerRef.current.setOpen'\r\n const [open, setOpen] = React.useState<boolean>(false);\r\n\r\n const getFormattedValue = () => {\r\n if(showQuarterYearPicker)\r\n {\r\n const val = dayjs(value);\r\n return val.year() + ', Q' + val.quarter();\r\n }\r\n else \r\n return dayjs(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');\r\n }\r\n /**\r\n * Format the date in a specific way.\r\n */\r\n React.useEffect(() => {\r\n if (value) inputRef.current.value = getFormattedValue();\r\n }, [value]);\r\n\r\n function getQuarterItem(classname: string) : HTMLElement {\r\n return document.getElementsByClassName(quarterComponentsClassPrefix + classname)[0] as HTMLElement;\r\n }\r\n\r\n React.useEffect(() => {\r\n if (yearPickerMode) {\r\n //unfortunately, since there are no refs, and year pickers is rendered not by our code, but by 'react-datepicker'\r\n //we have to touch DOM directly\r\n const selectedDate = document.getElementsByClassName('react-datepicker__year-text--selected')[0] as HTMLElement;\r\n const dropdownParent = selectedDate?.parentElement?.parentElement;\r\n if (selectedDate && dropdownParent) dropdownParent.scrollTop = selectedDate.offsetTop - 2 * selectedDate.offsetHeight;\r\n }\r\n }, [yearPickerMode]);\r\n\r\n React.useEffect(() => {\r\n if(showQuarterYearPicker && open)\r\n {\r\n const wrapper = getQuarterItem('wrapper');\r\n const handler = (event: KeyboardEvent) => {\r\n switch(event.key)\r\n {\r\n case ' ':\r\n case 'Enter':\r\n const currentQ = getQuarterItem(focusedQuarterRef.current + '');\r\n currentQ.click();\r\n break;\r\n\r\n case 'ArrowLeft':\r\n if(focusedQuarterRef.current > 1)\r\n {\r\n const currentQ = getQuarterItem(focusedQuarterRef.current + '');\r\n const previousQ = getQuarterItem((focusedQuarterRef.current - 1) + '');\r\n if(previousQ)\r\n {\r\n currentQ.tabIndex = -1;\r\n previousQ.tabIndex = 0;\r\n previousQ.focus();\r\n focusedQuarterRef.current = focusedQuarterRef.current - 1;\r\n }\r\n }\r\n break;\r\n\r\n case 'ArrowRight':\r\n if(focusedQuarterRef.current < 4)\r\n {\r\n const currentQ = getQuarterItem(focusedQuarterRef.current + '');\r\n const nextQ = getQuarterItem((focusedQuarterRef.current + 1) + '');\r\n if(nextQ)\r\n {\r\n currentQ.tabIndex = -1;\r\n nextQ.tabIndex = 0;\r\n nextQ.focus();\r\n focusedQuarterRef.current = focusedQuarterRef.current + 1;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n\r\n wrapper.addEventListener('keydown', handler);\r\n //unfortunately since there are no efs, and quarter picker is rendered not by our code, but by 'react-datepicker'\r\n //we have to touch DOM directly\r\n \r\n const selectedQuarter = getQuarterItem('-selected');\r\n if(selectedQuarter) {\r\n for (let i = 1; i < 5; i++) {\r\n if(selectedQuarter.innerText.includes('Q' + i)) {\r\n focusedQuarterRef.current = i;\r\n break;\r\n }\r\n }\r\n selectedQuarter.setAttribute(\"tabIndex\", \"0\");\r\n }\r\n else\r\n {\r\n const firstQuarter = getQuarterItem('1');\r\n if(firstQuarter) {\r\n focusedQuarterRef.current = 1;\r\n firstQuarter.setAttribute(\"tabIndex\", \"0\");\r\n }\r\n }\r\n\r\n return () => {\r\n wrapper.removeEventListener('keydown', handler);\r\n };\r\n }\r\n }, [showQuarterYearPicker, open]);\r\n\r\n //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection\r\n //otherwise after year selection datepicker will show January month of the selected year\r\n React.useEffect(() => {\r\n if (openAt) {\r\n datepickerRef.current.setOpen(true);\r\n //setOpenAt(null);\r\n }\r\n }, [openAt]);\r\n\r\n React.useImperativeHandle(ref, () => inputRef.current, [inputRef]);\r\n\r\n const handleCalendarClose = () => {\r\n inputRef.current?.blur();\r\n setOpen(false);\r\n };\r\n\r\n const handleCalendarOpen = () => {\r\n if (openAt) setOpenAt(null);\r\n setOpen(true);\r\n };\r\n\r\n let maxDate = new Date(value && new Date(value) > new Date() ? new Date(value) : new Date());\r\n maxDate.setFullYear(maxDate.getFullYear() + (yearsAfterCurrentDate ?? 50));\r\n\r\n //itemsNumber - controls number of year select options generated in the dropdown\r\n //items related to dates higher than 'maxDate' will be hidden, thus to avoid creating hundreds of invisible divs, we divide by 5\r\n let minDate = new Date(value && new Date(value) < new Date() ? new Date(value) : new Date());\r\n const itemsNumber = Math.round((minDate.getFullYear() - (yearsBeforeCurrentDate ?? 15)) / 5);\r\n\r\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (e.key === 'Escape' || e.key === 'Esc')\r\n datepickerRef.current.setOpen(false);\r\n };\r\n\r\n const handleBlur = (e: React.FocusEvent<HTMLDivElement>) => {\r\n // @ts-ignore\r\n if (!e.currentTarget.contains(e.relatedTarget)) {\r\n onBlur && onBlur(e);\r\n }\r\n };\r\n const iconSize = 24;\r\n\r\n return (\r\n <>\r\n {/* Let's render the input itself */}\r\n <DatePickerContainer quarterPicker={showQuarterYearPicker} data-testid={dataTestId} yearPicker={yearPickerMode} margin={margin || ''} onBlur={handleBlur}>\r\n <DatePicker\r\n ref={datepickerRef}\r\n onCalendarOpen={handleCalendarOpen}\r\n onCalendarClose={handleCalendarClose}\r\n onKeyDown={handleKeyDown}\r\n id={id}\r\n onClickOutside={() => datepickerRef.current.setOpen(false)}\r\n\r\n onChange={(e: any) => {\r\n if (onChange) {\r\n if (yearPickerMode) {\r\n const newDate = new Date();\r\n newDate.setFullYear(e.getFullYear());\r\n newDate.setMonth(activeMonthPage);\r\n setOpenAt(newDate);\r\n } else onChange(e);\r\n }\r\n if (yearPickerMode) setYearPickerMode(false);\r\n }}\r\n disabled={disabled || readOnly}\r\n locale={en}\r\n showQuarterYearPicker={showQuarterYearPicker}\r\n dateFormat={showQuarterYearPicker ? \"yyyy, QQQ\" : undefined}\r\n showYearPicker={yearPickerMode}\r\n //we manipulate 'yearItemNumber' and 'maxDate' to guarantee number of year select options shown before and after selected year\r\n yearItemNumber={yearPickerMode ? itemsNumber : undefined}\r\n maxDate={yearPickerMode ? maxDate : undefined}\r\n selected={value}\r\n openToDate={openAt ?? undefined}\r\n preventOpenOnFocus={true}\r\n shouldCloseOnSelect={true}\r\n renderCustomHeader={\r\n yearPicker\r\n ? (params: ReactDatePickerCustomHeaderProps) =>\r\n React.createElement(\r\n DatepickerFieldHeader,\r\n {\r\n ...params,\r\n setActiveMonthPage,\r\n customHeaderCount: 0,\r\n yearPickerMode: yearPickerMode,\r\n setYearPickerMode: setYearPickerMode,\r\n },\r\n null,\r\n )\r\n : undefined\r\n }\r\n customInput={\r\n <InputWrapper disabled={disabled} readOnly={readOnly}>\r\n <DatepickerRow>\r\n <StyledInputFieldStyling\r\n ref={inputRef}\r\n type=\"text\"\r\n name=\"datepicker\"\r\n onKeyDown={(e) => e.key === 'Enter' && datepickerRef.current.setOpen(true)}\r\n className={(invalid ? 'invalid' : '' + (open ? ' open' : ''))}\r\n tabIndex={disabled || readOnly ? -1 : 0}\r\n onFocus={(e) => inputRef.current?.setSelectionRange(0, 0)}\r\n autoComplete={autoComplete}\r\n placeholder={placeholder}\r\n extraRightPadding={iconSize}\r\n disabled={disabled}\r\n readOnly={true}\r\n suppressReadOnlyStyles={!readOnly}\r\n required={required}\r\n {...rest}\r\n />\r\n <IconWrapper>\r\n <SystemIcons.Calendar size=\"24\"/>\r\n </IconWrapper>\r\n </DatepickerRow>\r\n {!open && <TooltipOverflow position={overflowTooltipPosition} input={inputRef} withArrow={true} maxWidth=\"100%\" size={Size.Small} align='end'>\r\n {getFormattedValue()}\r\n </TooltipOverflow>}\r\n </InputWrapper>\r\n }\r\n />\r\n </DatePickerContainer>\r\n\r\n {/* If there is an error, let's render the error */}\r\n {validationMessage && (\r\n <ErrorMessage>\r\n <SystemIcons.TechnicalWarning color={COLORS.critical_400}/>\r\n <span>{validationMessage}</span>\r\n </ErrorMessage>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nexport default DatepickerField;\r\n"],"mappings":";;;;;;;;;;;;AAGA;AAKA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AAKA;AACA;AAGA;AACA;AAAwC;AAAA;AAAA;AAAA;AAAA;AApBxCA,cAAK,CAACC,MAAM,CAACC,uBAAc,CAAC;AAC5BF,cAAK,CAACC,MAAM,CAACE,sBAAa,CAAC;;AAE3B;AACA;AACA;;AAuCA;AACA;AACA;AACA,IAAMC,mBAAmB,GAAGC,yBAAM,CAACC,GAAG,+2QAEvBC,iBAAS,CAACC,QAAQ,EAe3B,UAACC,KAAK;EAAA,OAAMA,KAAK,CAACC,MAAM,qBAAcD,KAAK,CAACC,MAAM,SAAM,EAAE;AAAA,CAAC,EAsB3CC,eAAM,CAACC,UAAU,EAY7BC,mBAAW,EA+CQF,eAAM,CAACG,UAAU,EAIbH,eAAM,CAACI,WAAW,EAC/BJ,eAAM,CAACG,UAAU,EACrB,UAACL,KAAK;EAAA,OAAM,CAACA,KAAK,CAACO,UAAU,GAAG,MAAM,GAAG,MAAM;AAAA,CAAC,EASxD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EACPG,UAAU;EACVD,iBAAiB;EACjBE,YAAY;EACZC,WAAW;EACXvC,UAAU;EACVyC,sBAAsB;EACtBC,qBAAqB;EACrBhD,MAAM;EAENiD,uBAAuB,4BAAG,KAAK,EAAG,QAAQ;AAAA;AAAA,eAimB7BhB,eAAe;AAAA"}
1
+ {"version":3,"file":"DatepickerField.cjs","names":["dayjs","extend","advancedFormat","quarterOfYear","DatePickerContainer","styled","div","Z_INDEXES","dropdown","props","margin","COLORS","primary_20","focusStyles","neutral_20","neutral_200","yearPicker","ComponentSStyling","ComponentTextStyle","Bold","neutral_600","scrollBarStyling","Size","Small","ComponentMStyling","Regular","white","primary_700","primary_500","neutral_700","neutral_100","IconWrapper","focus","DatepickerRow","StyledInputFieldStyling","InputFieldStyling","neutral_500","primary_300","primary_200","primary_100","primary_800","neutral_300","quarterComponentsClassPrefix","DatepickerField","React","forwardRef","ref","disabled","readOnly","onChange","invalid","value","validationMessage","dateFormat","autoComplete","placeholder","required","yearsBeforeCurrentDate","yearsAfterCurrentDate","onBlur","showQuarterYearPicker","id","dataTestId","rest","inputRef","useFocusVisibleRef","datepickerRef","useRef","focusedQuarterRef","useState","activeMonthPage","setActiveMonthPage","yearPickerMode","setYearPickerMode","openAt","setOpenAt","open","setOpen","getFormattedValue","val","year","quarter","format","useEffect","current","getQuarterItem","classname","document","getElementsByClassName","selectedDate","dropdownParent","parentElement","scrollTop","offsetTop","offsetHeight","wrapper","handler","event","key","currentQ","click","previousQ","tabIndex","nextQ","addEventListener","selectedQuarter","i","innerText","includes","setAttribute","firstQuarter","removeEventListener","useImperativeHandle","handleCalendarClose","blur","handleCalendarOpen","maxDate","Date","setFullYear","getFullYear","minDate","itemsNumber","Math","round","handleKeyDown","e","handleBlur","currentTarget","contains","relatedTarget","iconSize","newDate","setMonth","en","undefined","params","createElement","DatepickerFieldHeader","customHeaderCount","setSelectionRange","critical_400"],"sources":["../../src/InputFields/DatepickerField.tsx"],"sourcesContent":["/**\r\n * Import react libraries.\r\n */\r\nimport React from 'react';\r\n\r\n/**\r\n * Import third-party libraries.\r\n */\r\nimport styled from 'styled-components';\r\nimport DatePicker, { ReactDatePickerCustomHeaderProps } from 'react-datepicker';\r\nimport en from 'date-fns/locale/en-GB';\r\nimport dayjs from 'dayjs';\r\nimport advancedFormat from 'dayjs/plugin/advancedFormat';\r\nimport quarterOfYear from \"dayjs/plugin/quarterOfYear\";\r\n\r\ndayjs.extend(advancedFormat);\r\ndayjs.extend(quarterOfYear);\r\n\r\n/**\r\n * Import custom components.\r\n */\r\nimport COLORS from '../styles/colors';\r\nimport {SystemIcons} from '../icons';\r\nimport {DatepickerFieldHeader} from './DatepickerFieldHeader';\r\nimport {ComponentTextStyle, focusStyles, scrollBarStyling} from '../styles';\r\nimport TooltipOverflow from '../Tooltips/TooltipOverflow';\r\n\r\n/**\r\n * Import custom styles.\r\n */\r\nimport {ErrorMessage, InputFieldStyling, InputWrapper} from './styling';\r\nimport 'react-datepicker/dist/react-datepicker.css';\r\nimport {ComponentMStyling, ComponentSStyling} from '../styles';\r\nimport {Z_INDEXES} from '../styles';\r\nimport {useFocusVisibleRef} from '../common';\r\nimport {Size, Testable} from '../types';\r\n\r\n/**\r\n * Add custom types.\r\n */\r\nexport type DatepickerFieldProps = Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'size' | 'onBlur'> & {\r\n value?: Date;\r\n onChange?: (date: Date) => void;\r\n onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\r\n\r\n showQuarterYearPicker?: boolean;\r\n invalid?: boolean;\r\n dateFormat?: string;\r\n validationMessage?: string;\r\n autoComplete?: string;\r\n placeholder?: string;\r\n yearPicker?: boolean;\r\n yearsBeforeCurrentDate?: number;\r\n yearsAfterCurrentDate?: number;\r\n margin?: string;\r\n};\r\n\r\n/**\r\n * Add custom styles.\r\n */\r\nconst DatePickerContainer = styled.div<{ yearPicker: boolean; margin: string; quarterPicker?: boolean }>`\r\n .react-datepicker-popper {\r\n z-index: ${Z_INDEXES.dropdown};\r\n }\r\n\r\n .react-datepicker-popper[data-placement^=bottom] {\r\n padding-top: 0px;\r\n }\r\n\r\n \r\n .react-datepicker-popper[data-placement^=top] {\r\n padding-bottom: 0px;\r\n }\r\n\r\n > div {\r\n display: block;\r\n\r\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\r\n .react-datepicker {\r\n box-sizing: border-box;\r\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\r\n border: 1px solid #e5e5e5;\r\n }\r\n .react-datepicker__input-container{\r\n z-index: 0;\r\n }\r\n\r\n .react-datepicker__navigation {\r\n line-height: normal;\r\n text-indent: inherit;\r\n border: none;\r\n border-radius: 4px;\r\n height: 48px;\r\n width: 48px;\r\n outline: none;\r\n margin: 0px;\r\n color: transparent;\r\n\r\n &:hover {\r\n background: ${COLORS.primary_20};\r\n\r\n &.react-datepicker__navigation--previous::before {\r\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\");\r\n }\r\n\r\n &.react-datepicker__navigation--next::before {\r\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\");\r\n }\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n &.react-datepicker__navigation--next::before {\r\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\");\r\n }\r\n\r\n &.react-datepicker__navigation--previous::before {\r\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\");\r\n }\r\n }\r\n\r\n &::before {\r\n text-align: center;\r\n display: inline-block;\r\n content: '';\r\n height: 32px;\r\n width: 32px;\r\n vertical-align: middle;\r\n }\r\n\r\n &.react-datepicker__navigation--next::before {\r\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\");\r\n }\r\n\r\n &.react-datepicker__navigation--previous::before {\r\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\");\r\n }\r\n }\r\n\r\n .react-datepicker__month-container,\r\n .react-datepicker__year--container {\r\n width: 336px;\r\n }\r\n\r\n .react-datepicker__month {\r\n margin: 0px;\r\n }\r\n\r\n .react-datepicker__triangle {\r\n left: 50% !important;\r\n display: none;\r\n }\r\n\r\n .react-datepicker-popper[data-placement^='bottom'] {\r\n margin-top: 0;\r\n }\r\n\r\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\r\n border-bottom-color: ${COLORS.neutral_20};\r\n }\r\n\r\n .react-datepicker__header {\r\n border-bottom: 1px solid ${COLORS.neutral_200};\r\n background: ${COLORS.neutral_20};\r\n height: ${(props) => (!props.yearPicker ? '96px' : '54px')};\r\n padding-top: 0px;\r\n }\r\n\r\n .react-datepicker-year-header {\r\n height: 48px;\r\n line-height: 48px !important;\r\n align-items: center;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\r\n }\r\n\r\n .react-datepicker__current-month {\r\n height: 48px;\r\n display: inline-flex;\r\n align-items: center;\r\n margin-right: 5px;\r\n\r\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\r\n }\r\n\r\n .react-datepicker__year {\r\n max-height: 300px;\r\n overflow-y: scroll;\r\n\r\n ${scrollBarStyling(Size.Small)}\r\n }\r\n\r\n .react-datepicker__quarter-wrapper{\r\n width: 100%;\r\n display: flex;\r\n align-content: space-evenly;\r\n flex-wrap: wrap;\r\n align-items: center;\r\n gap: 20px;\r\n }\r\n\r\n .react-datepicker__year-wrapper {\r\n max-width: 100%;\r\n justify-content: space-around;\r\n }\r\n\r\n .react-datepicker__navigation-icon {\r\n display: none;\r\n }\r\n\r\n .react-datepicker__day-name {\r\n display: inline-flex;\r\n justify-content: center;\r\n align-items: center;\r\n height: 48px;\r\n margin: 0px;\r\n width: 48px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n }\r\n\r\n \r\n\r\n .react-datepicker__year-text {\r\n background: ${COLORS.white};\r\n border: none;\r\n display: inline-flex;\r\n justify-content: center;\r\n align-items: center;\r\n margin-top: 20px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n &.react-datepicker__year-text--disabled {\r\n display: none;\r\n }\r\n\r\n &.react-datepicker__day--keyboard-selected {\r\n color: ${COLORS.neutral_600};\r\n background: ${COLORS.white};\r\n font-weight: 400;\r\n border: none;\r\n }\r\n\r\n &:hover {\r\n color: ${COLORS.primary_700};\r\n background: ${COLORS.primary_20};\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.react-datepicker__year-text--selected {\r\n color: ${COLORS.white} !important;\r\n background: ${COLORS.primary_500} !important;\r\n }\r\n }\r\n\r\n .react-datepicker__day, .react-datepicker__quarter-text {\r\n background: ${COLORS.white};\r\n border: none;\r\n display: inline-flex;\r\n justify-content: center;\r\n align-items: center;\r\n flex-grow: 1;\r\n height: 40px;\r\n width: 40px;\r\n margin: 4px;\r\n\r\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\r\n &.react-datepicker__day--keyboard-selected, .react-datepicker__quarter-text--keyboard-selected {\r\n color: ${COLORS.neutral_600};\r\n background: ${COLORS.white};\r\n flex-grow: 1;\r\n font-weight: 400;\r\n border: none;\r\n }\r\n\r\n &.react-datepicker__quarter--selected {\r\n color: ${COLORS.white} !important;\r\n flex-grow: 1;\r\n background: ${COLORS.primary_500} !important;\r\n }\r\n\r\n &:hover {\r\n color: ${COLORS.primary_700};\r\n background: ${COLORS.primary_20};\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.react-datepicker__day--selected {\r\n color: ${COLORS.white} !important;\r\n background: ${COLORS.primary_500} !important;\r\n }\r\n\r\n &.react-datepicker__day--today {\r\n border-radius: 0.3rem;\r\n color: ${COLORS.neutral_700};\r\n background: ${COLORS.neutral_100};\r\n\r\n &:hover {\r\n color: ${COLORS.primary_700};\r\n background: ${COLORS.primary_20};\r\n }\r\n\r\n &:focus {\r\n ${focusStyles}\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst IconWrapper = styled.div`\r\n pointer-events: none;\r\n position: absolute;\r\n left: 16px;\r\n width: 24px;\r\n height: 24px;\r\n z-index: ${+Z_INDEXES.focus + 1};\r\n`;\r\n\r\nconst DatepickerRow = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nconst StyledInputFieldStyling = styled(InputFieldStyling)`\r\n padding-left: 48px !important;\r\n \r\n &::placeholder {\r\n color: ${COLORS.neutral_500};\r\n }\r\n\r\n &:focus:not(.focus-visible) {\r\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\r\n }\r\n\r\n &:hover {\r\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_200};\r\n\r\n ::placeholder {\r\n color: ${COLORS.primary_700};\r\n }\r\n\r\n cursor: pointer;\r\n background-color: ${COLORS.primary_20};\r\n color: ${COLORS.primary_700};\r\n }\r\n\r\n &:active,\r\n &.open {\r\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\r\n background-color: ${COLORS.primary_100};\r\n color: ${COLORS.primary_800};\r\n\r\n ::placeholder {\r\n color: ${COLORS.primary_800};\r\n }\r\n }\r\n \r\n &:disabled {\r\n background-color: ${COLORS.white};\r\n }\r\n\r\n & ~ ${IconWrapper}{\r\n color: ${COLORS.neutral_600};\r\n }\r\n\r\n &:hover ~ ${IconWrapper} {\r\n color: ${COLORS.primary_700};\r\n }\r\n\r\n &:active ~ ${IconWrapper}, &.open ~ ${IconWrapper} {\r\n color: ${COLORS.primary_800};\r\n }\r\n\r\n &[tabindex='-1'] ~ ${IconWrapper} {\r\n color: ${COLORS.neutral_300};\r\n }\r\n`;\r\n\r\nconst quarterComponentsClassPrefix = 'react-datepicker__quarter-';\r\n\r\nconst DatepickerField = React.forwardRef<HTMLInputElement, DatepickerFieldProps>(({\r\n disabled,\r\n readOnly,\r\n onChange,\r\n invalid,\r\n value,\r\n validationMessage,\r\n dateFormat,\r\n autoComplete,\r\n placeholder,\r\n required,\r\n yearPicker,\r\n yearsBeforeCurrentDate,\r\n yearsAfterCurrentDate,\r\n margin,\r\n onBlur,\r\n showQuarterYearPicker,\r\n id,\r\n dataTestId,\r\n ...rest\r\n }: DatepickerFieldProps, ref) => {\r\n // Globally used variables within the component\r\n const inputRef = useFocusVisibleRef();\r\n const datepickerRef = React.useRef<any>(null);\r\n const focusedQuarterRef = React.useRef<number>(1);\r\n const [activeMonthPage, setActiveMonthPage] = React.useState<number>(-1);\r\n const [yearPickerMode, setYearPickerMode] = React.useState<boolean>(false);\r\n const [openAt, setOpenAt] = React.useState<Date | null>(null);\r\n // 'open' flag is used only for tracking current state of the dropdown,\r\n // for explicitly opening/closing the picker we are using 'datepickerRef.current.setOpen'\r\n const [open, setOpen] = React.useState<boolean>(false);\r\n\r\n const getFormattedValue = () => {\r\n if(showQuarterYearPicker)\r\n {\r\n const val = dayjs(value);\r\n return val.year() + ', Q' + val.quarter();\r\n }\r\n else \r\n return dayjs(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');\r\n }\r\n /**\r\n * Format the date in a specific way.\r\n */\r\n React.useEffect(() => {\r\n if (value) inputRef.current.value = getFormattedValue();\r\n }, [value]);\r\n\r\n function getQuarterItem(classname: string) : HTMLElement {\r\n return document.getElementsByClassName(quarterComponentsClassPrefix + classname)[0] as HTMLElement;\r\n }\r\n\r\n React.useEffect(() => {\r\n if (yearPickerMode) {\r\n //unfortunately, since there are no refs, and year pickers is rendered not by our code, but by 'react-datepicker'\r\n //we have to touch DOM directly\r\n const selectedDate = document.getElementsByClassName('react-datepicker__year-text--selected')[0] as HTMLElement;\r\n const dropdownParent = selectedDate?.parentElement?.parentElement;\r\n if (selectedDate && dropdownParent) dropdownParent.scrollTop = selectedDate.offsetTop - 2 * selectedDate.offsetHeight;\r\n }\r\n }, [yearPickerMode]);\r\n\r\n React.useEffect(() => {\r\n if(showQuarterYearPicker && open)\r\n {\r\n const wrapper = getQuarterItem('wrapper');\r\n const handler = (event: KeyboardEvent) => {\r\n switch(event.key)\r\n {\r\n case ' ':\r\n case 'Enter':\r\n const currentQ = getQuarterItem(focusedQuarterRef.current + '');\r\n currentQ.click();\r\n break;\r\n\r\n case 'ArrowLeft':\r\n if(focusedQuarterRef.current > 1)\r\n {\r\n const currentQ = getQuarterItem(focusedQuarterRef.current + '');\r\n const previousQ = getQuarterItem((focusedQuarterRef.current - 1) + '');\r\n if(previousQ)\r\n {\r\n currentQ.tabIndex = -1;\r\n previousQ.tabIndex = 0;\r\n previousQ.focus();\r\n focusedQuarterRef.current = focusedQuarterRef.current - 1;\r\n }\r\n }\r\n break;\r\n\r\n case 'ArrowRight':\r\n if(focusedQuarterRef.current < 4)\r\n {\r\n const currentQ = getQuarterItem(focusedQuarterRef.current + '');\r\n const nextQ = getQuarterItem((focusedQuarterRef.current + 1) + '');\r\n if(nextQ)\r\n {\r\n currentQ.tabIndex = -1;\r\n nextQ.tabIndex = 0;\r\n nextQ.focus();\r\n focusedQuarterRef.current = focusedQuarterRef.current + 1;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n\r\n wrapper.addEventListener('keydown', handler);\r\n //unfortunately since there are no efs, and quarter picker is rendered not by our code, but by 'react-datepicker'\r\n //we have to touch DOM directly\r\n \r\n const selectedQuarter = getQuarterItem('-selected');\r\n if(selectedQuarter) {\r\n for (let i = 1; i < 5; i++) {\r\n if(selectedQuarter.innerText.includes('Q' + i)) {\r\n focusedQuarterRef.current = i;\r\n break;\r\n }\r\n }\r\n selectedQuarter.setAttribute(\"tabIndex\", \"0\");\r\n }\r\n else\r\n {\r\n const firstQuarter = getQuarterItem('1');\r\n if(firstQuarter) {\r\n focusedQuarterRef.current = 1;\r\n firstQuarter.setAttribute(\"tabIndex\", \"0\");\r\n }\r\n }\r\n\r\n return () => {\r\n wrapper.removeEventListener('keydown', handler);\r\n };\r\n }\r\n }, [showQuarterYearPicker, open]);\r\n\r\n //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection\r\n //otherwise after year selection datepicker will show January month of the selected year\r\n React.useEffect(() => {\r\n if (openAt) {\r\n datepickerRef.current.setOpen(true);\r\n //setOpenAt(null);\r\n }\r\n }, [openAt]);\r\n\r\n React.useImperativeHandle(ref, () => inputRef.current, [inputRef]);\r\n\r\n const handleCalendarClose = () => {\r\n inputRef.current?.blur();\r\n setOpen(false);\r\n };\r\n\r\n const handleCalendarOpen = () => {\r\n if (openAt) setOpenAt(null);\r\n setOpen(true);\r\n };\r\n\r\n let maxDate = new Date(value && new Date(value) > new Date() ? new Date(value) : new Date());\r\n maxDate.setFullYear(maxDate.getFullYear() + (yearsAfterCurrentDate ?? 50));\r\n\r\n //itemsNumber - controls number of year select options generated in the dropdown\r\n //items related to dates higher than 'maxDate' will be hidden, thus to avoid creating hundreds of invisible divs, we divide by 5\r\n let minDate = new Date(value && new Date(value) < new Date() ? new Date(value) : new Date());\r\n const itemsNumber = Math.round((minDate.getFullYear() - (yearsBeforeCurrentDate ?? 15)) / 5);\r\n\r\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\r\n if (e.key === 'Escape' || e.key === 'Esc')\r\n datepickerRef.current.setOpen(false);\r\n };\r\n\r\n const handleBlur = (e: React.FocusEvent<HTMLDivElement>) => {\r\n // @ts-ignore\r\n if (!e.currentTarget.contains(e.relatedTarget)) {\r\n onBlur && onBlur(e);\r\n }\r\n };\r\n const iconSize = 24;\r\n\r\n return (\r\n <>\r\n {/* Let's render the input itself */}\r\n <DatePickerContainer quarterPicker={showQuarterYearPicker} data-testid={dataTestId} yearPicker={yearPickerMode} margin={margin || ''} onBlur={handleBlur}>\r\n <DatePicker\r\n ref={datepickerRef}\r\n onCalendarOpen={handleCalendarOpen}\r\n onCalendarClose={handleCalendarClose}\r\n onKeyDown={handleKeyDown}\r\n id={id}\r\n onClickOutside={() => datepickerRef.current.setOpen(false)}\r\n\r\n onChange={(e: any) => {\r\n if (onChange) {\r\n if (yearPickerMode) {\r\n const newDate = new Date();\r\n newDate.setFullYear(e.getFullYear());\r\n newDate.setMonth(activeMonthPage);\r\n setOpenAt(newDate);\r\n } else onChange(e);\r\n }\r\n if (yearPickerMode) setYearPickerMode(false);\r\n }}\r\n disabled={disabled || readOnly}\r\n locale={en}\r\n showQuarterYearPicker={showQuarterYearPicker}\r\n dateFormat={showQuarterYearPicker ? \"yyyy, QQQ\" : undefined}\r\n showYearPicker={yearPickerMode}\r\n //we manipulate 'yearItemNumber' and 'maxDate' to guarantee number of year select options shown before and after selected year\r\n yearItemNumber={yearPickerMode ? itemsNumber : undefined}\r\n maxDate={yearPickerMode ? maxDate : undefined}\r\n selected={value}\r\n openToDate={openAt ?? undefined}\r\n preventOpenOnFocus={true}\r\n shouldCloseOnSelect={true}\r\n renderCustomHeader={\r\n yearPicker\r\n ? (params: ReactDatePickerCustomHeaderProps) =>\r\n React.createElement(\r\n DatepickerFieldHeader,\r\n {\r\n ...params,\r\n setActiveMonthPage,\r\n customHeaderCount: 0,\r\n yearPickerMode: yearPickerMode,\r\n setYearPickerMode: setYearPickerMode,\r\n },\r\n null,\r\n )\r\n : undefined\r\n }\r\n customInput={\r\n <InputWrapper disabled={disabled} readOnly={readOnly}>\r\n <DatepickerRow>\r\n <StyledInputFieldStyling\r\n ref={inputRef}\r\n type=\"text\"\r\n name=\"datepicker\"\r\n onKeyDown={(e) => e.key === 'Enter' && datepickerRef.current.setOpen(true)}\r\n className={(invalid ? 'invalid' : '' + (open ? ' open' : ''))}\r\n tabIndex={disabled || readOnly ? -1 : 0}\r\n onFocus={(e) => inputRef.current?.setSelectionRange(0, 0)}\r\n autoComplete={autoComplete}\r\n placeholder={placeholder}\r\n extraRightPadding={iconSize}\r\n disabled={disabled}\r\n readOnly={true}\r\n suppressReadOnlyStyles={!readOnly}\r\n required={required}\r\n {...rest}\r\n />\r\n <IconWrapper>\r\n <SystemIcons.Calendar size=\"24\"/>\r\n </IconWrapper>\r\n </DatepickerRow>\r\n {!open && <TooltipOverflow input={inputRef} withArrow={true} maxWidth=\"100%\" size={Size.Small} align='end' position='bottom'>\r\n {getFormattedValue()}\r\n </TooltipOverflow>}\r\n </InputWrapper>\r\n }\r\n />\r\n </DatePickerContainer>\r\n\r\n {/* If there is an error, let's render the error */}\r\n {validationMessage && (\r\n <ErrorMessage>\r\n <SystemIcons.TechnicalWarning color={COLORS.critical_400}/>\r\n <span>{validationMessage}</span>\r\n </ErrorMessage>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nexport default DatepickerField;\r\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;cAAA,uBACV,qBAAC,kBAAW,CAAC,QAAQ;gBAAC,IAAI,EAAC;cAAI;YAAE,EACrB;UAAA,EACA,EACjB,CAACa,IAAI,iBAAI,qBAAC,wBAAe;YAAC,KAAK,EAAEZ,QAAS;YAAC,SAAS,EAAE,IAAK;YAAC,QAAQ,EAAC,MAAM;YAAC,IAAI,EAAE1C,WAAI,CAACC,KAAM;YAAC,KAAK,EAAC,KAAK;YAAC,QAAQ,EAAC,QAAQ;YAAA,UACzHuD,iBAAiB;UAAE,EACJ;QAAA;MAErB;IACD,EACkB,EAGrB1B,iBAAiB,iBAChB,sBAAC,qBAAY;MAAA,wBACX,qBAAC,kBAAW,CAAC,gBAAgB;QAAC,KAAK,EAAEzC,eAAM,CAACiI;MAAa,EAAE,eAC3D;QAAA,UAAOxF;MAAiB,EAAQ;IAAA,EAEnC;EAAA,EACA;AAEP,CAAC,CAAC;AAAC;EA3mBDD,KAAK;EACLF,QAAQ;EACRU,MAAM;EAENC,qBAAqB;EACrBV,OAAO;EACPG,UAAU;EACVD,iBAAiB;EACjBE,YAAY;EACZC,WAAW;EACXvC,UAAU;EACVyC,sBAAsB;EACtBC,qBAAqB;EACrBhD,MAAM;AAAA;AAAA,eAgmBOiC,eAAe;AAAA"}
@@ -21,7 +21,6 @@ export type DatepickerFieldProps = Testable & Omit<React.InputHTMLAttributes<HTM
21
21
  yearsBeforeCurrentDate?: number;
22
22
  yearsAfterCurrentDate?: number;
23
23
  margin?: string;
24
- overflowTooltipPosition?: 'top' | 'bottom';
25
24
  };
26
25
  declare const DatepickerField: React.ForwardRefExoticComponent<Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onBlur" | "onChange" | "size" | "value"> & {
27
26
  value?: Date | undefined;
@@ -37,6 +36,5 @@ declare const DatepickerField: React.ForwardRefExoticComponent<Testable & Omit<R
37
36
  yearsBeforeCurrentDate?: number | undefined;
38
37
  yearsAfterCurrentDate?: number | undefined;
39
38
  margin?: string | undefined;
40
- overflowTooltipPosition?: "top" | "bottom" | undefined;
41
39
  } & React.RefAttributes<HTMLInputElement>>;
42
40
  export default DatepickerField;
@@ -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", "overflowTooltipPosition", "onBlur", "showQuarterYearPicker", "id", "dataTestId"];
6
+ var _excluded = ["disabled", "readOnly", "onChange", "invalid", "value", "validationMessage", "dateFormat", "autoComplete", "placeholder", "required", "yearPicker", "yearsBeforeCurrentDate", "yearsAfterCurrentDate", "margin", "onBlur", "showQuarterYearPicker", "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; }
@@ -76,7 +76,6 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
76
76
  yearsBeforeCurrentDate = _ref.yearsBeforeCurrentDate,
77
77
  yearsAfterCurrentDate = _ref.yearsAfterCurrentDate,
78
78
  margin = _ref.margin,
79
- overflowTooltipPosition = _ref.overflowTooltipPosition,
80
79
  onBlur = _ref.onBlur,
81
80
  showQuarterYearPicker = _ref.showQuarterYearPicker,
82
81
  id = _ref.id,
@@ -306,12 +305,12 @@ var DatepickerField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
306
305
  })
307
306
  })]
308
307
  }), !open && /*#__PURE__*/_jsx(TooltipOverflow, {
309
- position: overflowTooltipPosition,
310
308
  input: inputRef,
311
309
  withArrow: true,
312
310
  maxWidth: "100%",
313
311
  size: Size.Small,
314
312
  align: "end",
313
+ position: "bottom",
315
314
  children: getFormattedValue()
316
315
  })]
317
316
  })
@@ -338,8 +337,7 @@ DatepickerField.propTypes = {
338
337
  yearPicker: _pt.bool,
339
338
  yearsBeforeCurrentDate: _pt.number,
340
339
  yearsAfterCurrentDate: _pt.number,
341
- margin: _pt.string,
342
- overflowTooltipPosition: _pt.oneOf(['top', 'bottom'])
340
+ margin: _pt.string
343
341
  };
344
342
  export default DatepickerField;
345
343
  //# sourceMappingURL=DatepickerField.js.map