josenanodev-react-components-library 1.0.3 → 1.0.4

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 (301) hide show
  1. package/dist/cjs/Services/MulticalendarStatesAndSettings.d.ts +34 -0
  2. package/dist/cjs/Services/MulticalendarStatesAndSettings.js +55 -0
  3. package/dist/cjs/Services/accessToken.d.ts +3 -0
  4. package/dist/cjs/Services/accessToken.js +15 -0
  5. package/dist/cjs/common/constants.d.ts +5 -0
  6. package/dist/cjs/common/constants.js +8 -0
  7. package/dist/cjs/common/turboSuiteUrls.d.ts +7 -0
  8. package/dist/cjs/common/turboSuiteUrls.js +9 -0
  9. package/dist/cjs/common/types.d.ts +113 -0
  10. package/dist/cjs/components/BubbleMenu/BubbleMenu.d.ts +12 -0
  11. package/dist/cjs/components/BubbleMenu/BubbleMenu.js +60 -0
  12. package/dist/cjs/components/BubbleMenu/BubbleMenu.module.scss +113 -0
  13. package/dist/cjs/components/CalendarDatePicker/CalendarDatePicker.d.ts +19 -0
  14. package/dist/cjs/components/CalendarDatePicker/CalendarDatePicker.js +191 -0
  15. package/dist/cjs/components/CalendarDatePicker/CalendarDatePicker.module.scss +104 -0
  16. package/dist/cjs/components/CalendarDatePicker/subcomponents/CalendarScrollableSection.d.ts +15 -0
  17. package/dist/cjs/components/CalendarDatePicker/subcomponents/CalendarScrollableSection.js +300 -0
  18. package/dist/cjs/components/CalendarDatePicker/subcomponents/CalendarScrollableSection.module.scss +151 -0
  19. package/dist/cjs/components/ExportToExcelButton/ExportToExcelButton.css +31 -0
  20. package/dist/cjs/components/ExportToExcelButton/ExportToExcelButton.d.ts +5 -0
  21. package/dist/cjs/components/ExportToExcelButton/ExportToExcelButton.js +45 -0
  22. package/dist/cjs/components/ExportToExcelButton/ExportToExcelButtonOwnFunctions.d.ts +6 -0
  23. package/dist/cjs/components/ExportToExcelButton/ExportToExcelButtonOwnFunctions.js +75 -0
  24. package/dist/cjs/components/ExportToExcelButton/types.d.ts +44 -0
  25. package/dist/cjs/components/InputBoxWithConfirmation/InputBoxWithConfirmation.d.ts +17 -0
  26. package/dist/cjs/components/InputBoxWithConfirmation/InputBoxWithConfirmation.js +137 -0
  27. package/dist/cjs/components/InputBoxWithConfirmation/InputBoxWithConfirmation.module.scss +52 -0
  28. package/dist/cjs/components/IntegerControl/IntegerControl.d.ts +10 -0
  29. package/dist/cjs/components/IntegerControl/IntegerControl.js +52 -0
  30. package/dist/cjs/components/IntegerControl/IntegerControl.module.scss +46 -0
  31. package/dist/cjs/components/LabeledInput/LabeledInput.d.ts +15 -0
  32. package/dist/cjs/components/LabeledInput/LabeledInput.js +47 -0
  33. package/dist/cjs/components/LabeledInput/LabeledInput.module.scss +74 -0
  34. package/dist/cjs/components/Modal/Modal.css +43 -0
  35. package/dist/cjs/components/Modal/Modal.d.ts +5 -0
  36. package/dist/cjs/components/Modal/Modal.js +82 -0
  37. package/dist/cjs/components/Modal/types.d.ts +8 -0
  38. package/dist/cjs/components/Multicalendar/Multicalendar.css +191 -0
  39. package/dist/cjs/components/Multicalendar/Multicalendar.d.ts +5 -0
  40. package/dist/cjs/components/Multicalendar/Multicalendar.js +369 -0
  41. package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.d.ts +86 -0
  42. package/dist/cjs/components/Multicalendar/MulticalendarOwnFunctions.js +192 -0
  43. package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.css +5 -0
  44. package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.d.ts +5 -0
  45. package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.js +20 -0
  46. package/dist/cjs/components/Multicalendar/subcomponents/composites/CellsRow/types.d.ts +11 -0
  47. package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +6 -0
  48. package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.d.ts +5 -0
  49. package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.js +20 -0
  50. package/dist/cjs/components/Multicalendar/subcomponents/composites/DatesGrid/types.d.ts +13 -0
  51. package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.css +3 -0
  52. package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.d.ts +5 -0
  53. package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.js +15 -0
  54. package/dist/cjs/components/Multicalendar/subcomponents/composites/ListElementsColumn/types.d.ts +9 -0
  55. package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/Cell.css +6 -0
  56. package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/Cell.d.ts +5 -0
  57. package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/Cell.js +12 -0
  58. package/dist/cjs/components/Multicalendar/subcomponents/individuals/Cell/types.d.ts +10 -0
  59. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.css +60 -0
  60. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.d.ts +5 -0
  61. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +56 -0
  62. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DatesRow/types.d.ts +11 -0
  63. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.css +14 -0
  64. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.d.ts +5 -0
  65. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.js +13 -0
  66. package/dist/cjs/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/types.d.ts +6 -0
  67. package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.css +14 -0
  68. package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.d.ts +5 -0
  69. package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.js +14 -0
  70. package/dist/cjs/components/Multicalendar/subcomponents/individuals/ListElement/types.d.ts +7 -0
  71. package/dist/cjs/components/Multicalendar/types.d.ts +48 -0
  72. package/dist/cjs/components/MultipleJoinedButtonsBar/MultipleJoinedButtonsBar.css +40 -0
  73. package/dist/cjs/components/MultipleJoinedButtonsBar/MultipleJoinedButtonsBar.d.ts +5 -0
  74. package/dist/cjs/components/MultipleJoinedButtonsBar/MultipleJoinedButtonsBar.js +48 -0
  75. package/dist/cjs/components/MultipleJoinedButtonsBar/types.d.ts +6 -0
  76. package/dist/cjs/components/ParallelSelectionList/ParallelSelectionList.css +244 -0
  77. package/dist/cjs/components/ParallelSelectionList/ParallelSelectionList.d.ts +5 -0
  78. package/dist/cjs/components/ParallelSelectionList/ParallelSelectionList.js +147 -0
  79. package/dist/cjs/components/ParallelSelectionList/types.d.ts +22 -0
  80. package/dist/cjs/components/PopUp/PopUp.css +15 -0
  81. package/dist/cjs/components/PopUp/PopUp.d.ts +5 -0
  82. package/dist/cjs/components/PopUp/PopUp.js +50 -0
  83. package/dist/cjs/components/PopUp/types.d.ts +9 -0
  84. package/dist/cjs/components/ProgressBar/ProgressBar.css +39 -0
  85. package/dist/cjs/components/ProgressBar/ProgressBar.d.ts +5 -0
  86. package/dist/cjs/components/ProgressBar/ProgressBar.js +56 -0
  87. package/dist/cjs/components/ProgressBar/types.d.ts +7 -0
  88. package/dist/cjs/components/ScreenSteps/ScreenSteps.d.ts +14 -0
  89. package/dist/cjs/components/ScreenSteps/ScreenSteps.js +66 -0
  90. package/dist/cjs/components/ScreenSteps/ScreenSteps.module.scss +68 -0
  91. package/dist/cjs/components/ScrollSnapGallery/ScrollSnapGallery.d.ts +14 -0
  92. package/dist/cjs/components/ScrollSnapGallery/ScrollSnapGallery.js +98 -0
  93. package/dist/cjs/components/ScrollSnapGallery/ScrollSnapGallery.module.scss +67 -0
  94. package/dist/cjs/components/SearchBar/SearchBar.css +35 -0
  95. package/dist/cjs/components/SearchBar/SearchBar.d.ts +5 -0
  96. package/dist/cjs/components/SearchBar/SearchBar.js +54 -0
  97. package/dist/cjs/components/SearchBar/types.d.ts +10 -0
  98. package/dist/cjs/components/SideBar/SideBar.css +53 -0
  99. package/dist/cjs/components/SideBar/SideBar.d.ts +8 -0
  100. package/dist/cjs/components/SideBar/SideBar.js +70 -0
  101. package/dist/cjs/components/SideBar/types.d.ts +8 -0
  102. package/dist/cjs/components/Slider/Slider.css +55 -0
  103. package/dist/cjs/components/Slider/Slider.d.ts +5 -0
  104. package/dist/cjs/components/Slider/Slider.js +173 -0
  105. package/dist/cjs/components/Slider/SliderOwnFunctions.d.ts +2 -0
  106. package/dist/cjs/components/Slider/SliderOwnFunctions.js +11 -0
  107. package/dist/cjs/components/Slider/types.d.ts +14 -0
  108. package/dist/cjs/hooks/useIntersectionObserver.d.ts +9 -0
  109. package/dist/cjs/hooks/useIntersectionObserver.js +28 -0
  110. package/dist/cjs/hooks/useOutsideClick.d.ts +3 -0
  111. package/dist/cjs/hooks/useOutsideClick.js +19 -0
  112. package/dist/cjs/hooks/useResizeObserver.d.ts +7 -0
  113. package/dist/cjs/hooks/useResizeObserver.js +30 -0
  114. package/dist/cjs/hooks/useWindowsSize.d.ts +6 -0
  115. package/dist/cjs/hooks/useWindowsSize.js +20 -0
  116. package/dist/cjs/index.css +79 -0
  117. package/dist/cjs/index.d.ts +20 -0
  118. package/dist/cjs/index.js +45 -0
  119. package/dist/cjs/languages/en-EN.d.ts +3 -0
  120. package/dist/cjs/languages/en-EN.js +25 -0
  121. package/dist/cjs/languages/es-ES.d.ts +3 -0
  122. package/dist/cjs/languages/es-ES.js +25 -0
  123. package/dist/cjs/languages/it-IT.d.ts +3 -0
  124. package/dist/cjs/languages/it-IT.js +25 -0
  125. package/dist/cjs/languages/types.d.ts +22 -0
  126. package/dist/cjs/mocks/ReactComponentMocksForTesting/CellChildrenMock.d.ts +4 -0
  127. package/dist/cjs/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +13 -0
  128. package/dist/cjs/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.d.ts +4 -0
  129. package/dist/cjs/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.js +10 -0
  130. package/dist/cjs/react-app-env.d.ts +1 -0
  131. package/dist/cjs/setupTests.d.ts +2 -0
  132. package/dist/cjs/setupTests.js +8 -0
  133. package/dist/cjs/stories/CalendarDatePickerMask.d.ts +4 -0
  134. package/dist/cjs/stories/CalendarDatePickerMask.js +21 -0
  135. package/dist/cjs/utils/datesArray.d.ts +8 -0
  136. package/dist/cjs/utils/datesArray.js +23 -0
  137. package/dist/cjs/utils/dayOfTheWeekStartingOnMonday.d.ts +7 -0
  138. package/dist/cjs/utils/dayOfTheWeekStartingOnMonday.js +11 -0
  139. package/dist/cjs/utils/jsToSqlDate.d.ts +7 -0
  140. package/dist/cjs/utils/jsToSqlDate.js +22 -0
  141. package/dist/cjs/utils/monthYearString.d.ts +3 -0
  142. package/dist/cjs/utils/monthYearString.js +27 -0
  143. package/dist/cjs/utils/numberOfDaysInAMonth.d.ts +6 -0
  144. package/dist/cjs/utils/numberOfDaysInAMonth.js +12 -0
  145. package/dist/cjs/utils/numberOfWeeksInAMonth.d.ts +7 -0
  146. package/dist/cjs/utils/numberOfWeeksInAMonth.js +25 -0
  147. package/dist/cjs/utils/sqlToJsDate.d.ts +7 -0
  148. package/dist/cjs/utils/sqlToJsDate.js +14 -0
  149. package/dist/esm/Services/MulticalendarStatesAndSettings.d.ts +34 -0
  150. package/dist/esm/Services/MulticalendarStatesAndSettings.js +46 -0
  151. package/dist/esm/Services/accessToken.d.ts +3 -0
  152. package/dist/esm/Services/accessToken.js +9 -0
  153. package/dist/esm/common/constants.d.ts +5 -0
  154. package/dist/esm/common/constants.js +5 -0
  155. package/dist/esm/common/turboSuiteUrls.d.ts +7 -0
  156. package/dist/esm/common/turboSuiteUrls.js +7 -0
  157. package/dist/esm/common/types.d.ts +113 -0
  158. package/dist/esm/components/BubbleMenu/BubbleMenu.d.ts +12 -0
  159. package/dist/esm/components/BubbleMenu/BubbleMenu.js +32 -0
  160. package/dist/esm/components/BubbleMenu/BubbleMenu.module.scss +113 -0
  161. package/dist/esm/components/CalendarDatePicker/CalendarDatePicker.d.ts +19 -0
  162. package/dist/esm/components/CalendarDatePicker/CalendarDatePicker.js +163 -0
  163. package/dist/esm/components/CalendarDatePicker/CalendarDatePicker.module.scss +104 -0
  164. package/dist/esm/components/CalendarDatePicker/subcomponents/CalendarScrollableSection.d.ts +15 -0
  165. package/dist/esm/components/CalendarDatePicker/subcomponents/CalendarScrollableSection.js +272 -0
  166. package/dist/esm/components/CalendarDatePicker/subcomponents/CalendarScrollableSection.module.scss +151 -0
  167. package/dist/esm/components/ExportToExcelButton/ExportToExcelButton.css +31 -0
  168. package/dist/esm/components/ExportToExcelButton/ExportToExcelButton.d.ts +5 -0
  169. package/dist/esm/components/ExportToExcelButton/ExportToExcelButton.js +17 -0
  170. package/dist/esm/components/ExportToExcelButton/ExportToExcelButtonOwnFunctions.d.ts +6 -0
  171. package/dist/esm/components/ExportToExcelButton/ExportToExcelButtonOwnFunctions.js +48 -0
  172. package/dist/esm/components/ExportToExcelButton/types.d.ts +44 -0
  173. package/dist/esm/components/InputBoxWithConfirmation/InputBoxWithConfirmation.d.ts +17 -0
  174. package/dist/esm/components/InputBoxWithConfirmation/InputBoxWithConfirmation.js +109 -0
  175. package/dist/esm/components/InputBoxWithConfirmation/InputBoxWithConfirmation.module.scss +52 -0
  176. package/dist/esm/components/IntegerControl/IntegerControl.d.ts +10 -0
  177. package/dist/esm/components/IntegerControl/IntegerControl.js +24 -0
  178. package/dist/esm/components/IntegerControl/IntegerControl.module.scss +46 -0
  179. package/dist/esm/components/LabeledInput/LabeledInput.d.ts +15 -0
  180. package/dist/esm/components/LabeledInput/LabeledInput.js +19 -0
  181. package/dist/esm/components/LabeledInput/LabeledInput.module.scss +74 -0
  182. package/dist/esm/components/Modal/Modal.css +43 -0
  183. package/dist/esm/components/Modal/Modal.d.ts +5 -0
  184. package/dist/esm/components/Modal/Modal.js +54 -0
  185. package/dist/esm/components/Modal/types.d.ts +8 -0
  186. package/dist/esm/components/Multicalendar/Multicalendar.css +191 -0
  187. package/dist/esm/components/Multicalendar/Multicalendar.d.ts +5 -0
  188. package/dist/esm/components/Multicalendar/Multicalendar.js +341 -0
  189. package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.d.ts +86 -0
  190. package/dist/esm/components/Multicalendar/MulticalendarOwnFunctions.js +176 -0
  191. package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.css +5 -0
  192. package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.d.ts +5 -0
  193. package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/CellsRow.js +15 -0
  194. package/dist/esm/components/Multicalendar/subcomponents/composites/CellsRow/types.d.ts +11 -0
  195. package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.css +6 -0
  196. package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.d.ts +5 -0
  197. package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/DatesGrid.js +15 -0
  198. package/dist/esm/components/Multicalendar/subcomponents/composites/DatesGrid/types.d.ts +13 -0
  199. package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.css +3 -0
  200. package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.d.ts +5 -0
  201. package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/ListElementsColumn.js +10 -0
  202. package/dist/esm/components/Multicalendar/subcomponents/composites/ListElementsColumn/types.d.ts +9 -0
  203. package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/Cell.css +6 -0
  204. package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/Cell.d.ts +5 -0
  205. package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/Cell.js +7 -0
  206. package/dist/esm/components/Multicalendar/subcomponents/individuals/Cell/types.d.ts +10 -0
  207. package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.css +60 -0
  208. package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.d.ts +5 -0
  209. package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/DatesRow.js +51 -0
  210. package/dist/esm/components/Multicalendar/subcomponents/individuals/DatesRow/types.d.ts +11 -0
  211. package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.css +14 -0
  212. package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.d.ts +5 -0
  213. package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation.js +8 -0
  214. package/dist/esm/components/Multicalendar/subcomponents/individuals/DropdownMonthNavigation/types.d.ts +6 -0
  215. package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.css +14 -0
  216. package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.d.ts +5 -0
  217. package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/ListElement.js +9 -0
  218. package/dist/esm/components/Multicalendar/subcomponents/individuals/ListElement/types.d.ts +7 -0
  219. package/dist/esm/components/Multicalendar/types.d.ts +48 -0
  220. package/dist/esm/components/MultipleJoinedButtonsBar/MultipleJoinedButtonsBar.css +40 -0
  221. package/dist/esm/components/MultipleJoinedButtonsBar/MultipleJoinedButtonsBar.d.ts +5 -0
  222. package/dist/esm/components/MultipleJoinedButtonsBar/MultipleJoinedButtonsBar.js +23 -0
  223. package/dist/esm/components/MultipleJoinedButtonsBar/types.d.ts +6 -0
  224. package/dist/esm/components/ParallelSelectionList/ParallelSelectionList.css +244 -0
  225. package/dist/esm/components/ParallelSelectionList/ParallelSelectionList.d.ts +5 -0
  226. package/dist/esm/components/ParallelSelectionList/ParallelSelectionList.js +142 -0
  227. package/dist/esm/components/ParallelSelectionList/types.d.ts +22 -0
  228. package/dist/esm/components/PopUp/PopUp.css +15 -0
  229. package/dist/esm/components/PopUp/PopUp.d.ts +5 -0
  230. package/dist/esm/components/PopUp/PopUp.js +22 -0
  231. package/dist/esm/components/PopUp/types.d.ts +9 -0
  232. package/dist/esm/components/ProgressBar/ProgressBar.css +39 -0
  233. package/dist/esm/components/ProgressBar/ProgressBar.d.ts +5 -0
  234. package/dist/esm/components/ProgressBar/ProgressBar.js +31 -0
  235. package/dist/esm/components/ProgressBar/types.d.ts +7 -0
  236. package/dist/esm/components/ScreenSteps/ScreenSteps.d.ts +14 -0
  237. package/dist/esm/components/ScreenSteps/ScreenSteps.js +38 -0
  238. package/dist/esm/components/ScreenSteps/ScreenSteps.module.scss +68 -0
  239. package/dist/esm/components/ScrollSnapGallery/ScrollSnapGallery.d.ts +14 -0
  240. package/dist/esm/components/ScrollSnapGallery/ScrollSnapGallery.js +70 -0
  241. package/dist/esm/components/ScrollSnapGallery/ScrollSnapGallery.module.scss +67 -0
  242. package/dist/esm/components/SearchBar/SearchBar.css +35 -0
  243. package/dist/esm/components/SearchBar/SearchBar.d.ts +5 -0
  244. package/dist/esm/components/SearchBar/SearchBar.js +29 -0
  245. package/dist/esm/components/SearchBar/types.d.ts +10 -0
  246. package/dist/esm/components/SideBar/SideBar.css +53 -0
  247. package/dist/esm/components/SideBar/SideBar.d.ts +8 -0
  248. package/dist/esm/components/SideBar/SideBar.js +42 -0
  249. package/dist/esm/components/SideBar/types.d.ts +8 -0
  250. package/dist/esm/components/Slider/Slider.css +55 -0
  251. package/dist/esm/components/Slider/Slider.d.ts +5 -0
  252. package/dist/esm/components/Slider/Slider.js +148 -0
  253. package/dist/esm/components/Slider/SliderOwnFunctions.d.ts +2 -0
  254. package/dist/esm/components/Slider/SliderOwnFunctions.js +6 -0
  255. package/dist/esm/components/Slider/types.d.ts +14 -0
  256. package/dist/esm/hooks/useIntersectionObserver.d.ts +9 -0
  257. package/dist/esm/hooks/useIntersectionObserver.js +26 -0
  258. package/dist/esm/hooks/useOutsideClick.d.ts +3 -0
  259. package/dist/esm/hooks/useOutsideClick.js +17 -0
  260. package/dist/esm/hooks/useResizeObserver.d.ts +7 -0
  261. package/dist/esm/hooks/useResizeObserver.js +28 -0
  262. package/dist/esm/hooks/useWindowsSize.d.ts +6 -0
  263. package/dist/esm/hooks/useWindowsSize.js +18 -0
  264. package/dist/esm/index.css +79 -0
  265. package/dist/esm/index.d.ts +20 -0
  266. package/dist/esm/index.js +19 -0
  267. package/dist/esm/languages/en-EN.d.ts +3 -0
  268. package/dist/esm/languages/en-EN.js +23 -0
  269. package/dist/esm/languages/es-ES.d.ts +3 -0
  270. package/dist/esm/languages/es-ES.js +23 -0
  271. package/dist/esm/languages/it-IT.d.ts +3 -0
  272. package/dist/esm/languages/it-IT.js +23 -0
  273. package/dist/esm/languages/types.d.ts +22 -0
  274. package/dist/esm/mocks/ReactComponentMocksForTesting/CellChildrenMock.d.ts +4 -0
  275. package/dist/esm/mocks/ReactComponentMocksForTesting/CellChildrenMock.js +8 -0
  276. package/dist/esm/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.d.ts +4 -0
  277. package/dist/esm/mocks/ReactComponentMocksForTesting/ListElementChildrenMock.js +5 -0
  278. package/dist/esm/react-app-env.d.ts +1 -0
  279. package/dist/esm/setupTests.d.ts +2 -0
  280. package/dist/esm/setupTests.js +6 -0
  281. package/dist/esm/stories/CalendarDatePickerMask.d.ts +4 -0
  282. package/dist/esm/stories/CalendarDatePickerMask.js +16 -0
  283. package/dist/esm/utils/datesArray.d.ts +8 -0
  284. package/dist/esm/utils/datesArray.js +21 -0
  285. package/dist/esm/utils/dayOfTheWeekStartingOnMonday.d.ts +7 -0
  286. package/dist/esm/utils/dayOfTheWeekStartingOnMonday.js +9 -0
  287. package/dist/esm/utils/jsToSqlDate.d.ts +7 -0
  288. package/dist/esm/utils/jsToSqlDate.js +20 -0
  289. package/dist/esm/utils/monthYearString.d.ts +3 -0
  290. package/dist/esm/utils/monthYearString.js +25 -0
  291. package/dist/esm/utils/numberOfDaysInAMonth.d.ts +6 -0
  292. package/dist/esm/utils/numberOfDaysInAMonth.js +8 -0
  293. package/dist/esm/utils/numberOfWeeksInAMonth.d.ts +7 -0
  294. package/dist/esm/utils/numberOfWeeksInAMonth.js +20 -0
  295. package/dist/esm/utils/sqlToJsDate.d.ts +7 -0
  296. package/dist/esm/utils/sqlToJsDate.js +12 -0
  297. package/package.json +10 -22
  298. package/dist/index.d.ts +0 -1
  299. package/dist/index.mjs +0 -20188
  300. package/dist/index.umd.js +0 -196
  301. package/dist/style.css +0 -1
@@ -0,0 +1,341 @@
1
+ import React, { useEffect, useState, useRef } from "react";
2
+ import * as Funciones from "./MulticalendarOwnFunctions";
3
+ import "./Multicalendar.css";
4
+ //Assets
5
+ import { BsChevronLeft, BsChevronRight } from "react-icons/bs";
6
+ //Componentes
7
+ import DatesRow from "./subcomponents/individuals/DatesRow/DatesRow";
8
+ import ListElementsColumn from "./subcomponents/composites/ListElementsColumn/ListElementsColumn";
9
+ import DatesGrid from "./subcomponents/composites/DatesGrid/DatesGrid";
10
+ import DropdownMonthNavigation from "./subcomponents/individuals/DropdownMonthNavigation/DropdownMonthNavigation";
11
+ //Hooks
12
+ import useWindowSize from "../../hooks/useWindowsSize";
13
+ //Utils
14
+ import sqlToJsDate from "../../utils/sqlToJsDate";
15
+ //Services
16
+ import { getMulticalendarScrollLeftPosition, getMulticalendarScrollTopPosition, setMulticalendarScrollLeftPosition, setMulticalendarScrollTopPosition, } from "../../Services/MulticalendarStatesAndSettings";
17
+ const Multicalendar = ({ multicalendarId, ReactCellChildren, ReactListElementChildren, listElementsIdsArray, language, pastDatesVisible = true, cellsWidth = 120, cellsHeight = 80, verticalAxisWidth = 280, pastDaysInitialQuantity = 365, futureDaysInitialQuantity = 365, chunkRenderX = 0, chunkRenderY = 0, dynamicDaysQuantity = false, authomaticScrollOnDraggingOverEdges = false, waitTimeForCalls = 500, callsOnInitialView, callsOnScrollingStops, aditionalControlsComponents, upperLeftComponent, autoSavePosition, onScrollTopChanges, onScrollLeftChanges, }) => {
18
+ var _a, _b;
19
+ //Constantes del componente
20
+ const initialDateOffset = 1 + chunkRenderX;
21
+ //Refs
22
+ const datesRowRef = useRef(null);
23
+ const destiniesColumnRef = useRef(null);
24
+ const gridWrapperRef = useRef(null);
25
+ const controlsWrapperRef = useRef(null);
26
+ const horizontalAxisWrapperRef = useRef(null);
27
+ //Estados
28
+ const [firtsCallOnInitialViewDone, setFirtsCallOnInitialViewDone] = useState(false);
29
+ const [windowWidth, windowHeight] = useWindowSize();
30
+ const [futureDaysQuantity, setFutureDaysQuantity] = useState(Math.ceil(futureDaysInitialQuantity));
31
+ const [pastDaysQuantity, setPastDaysQuantity] = useState(pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) : 0);
32
+ const [paginationWidth, setPaginationWidth] = useState(0);
33
+ const [paginationHeight, setPaginationHeight] = useState(0);
34
+ const [xOffset, setXOffset] = useState(1);
35
+ const [yOffset, setYOffset] = useState(0);
36
+ const [visibleDates, setVisibleDates] = useState([]);
37
+ const [visibleListElementsIds, setVisibleListElementsIds] = useState([]);
38
+ const [updateList, setUpdateList] = useState(false);
39
+ const [origin, setOrigin] = useState({
40
+ x: getMulticalendarScrollLeftPosition(multicalendarId)
41
+ ? Number(getMulticalendarScrollLeftPosition(multicalendarId))
42
+ : pastDatesVisible
43
+ ? Math.ceil(pastDaysInitialQuantity) * cellsWidth
44
+ : 0,
45
+ y: getMulticalendarScrollTopPosition(multicalendarId)
46
+ ? Number(getMulticalendarScrollTopPosition(multicalendarId))
47
+ : 0,
48
+ });
49
+ const [xPosition, setXPosition] = useState(origin.x);
50
+ const [yPosition, setYPosition] = useState(origin.y);
51
+ const [renderCoordinates, setRenderCoordinates] = useState({
52
+ x: origin.x,
53
+ y: origin.y,
54
+ });
55
+ const [initialPositioningDone, setInitialPositioningDone] = useState(false);
56
+ const [minimumVisibleDate, setMinimumVisibleDate] = useState(new Date());
57
+ const [idTimeoutForCalls, setIdTimeoutForCalls] = useState(undefined);
58
+ const [clientXPositionOnGrid, setClientXPositionOnGrid] = useState(undefined);
59
+ const [clientYPositionOnGrid, setClientYPositionOnGrid] = useState(undefined);
60
+ const [scrollingOnCourse, setScrollingOnCourse] = useState(false);
61
+ const [controlsWrapperHeight, setControlsWrapperHeight] = useState(((_a = controlsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) ? controlsWrapperRef.current.clientHeight : 0);
62
+ const [horizontalAxisWrapperHeight, setHorizontalAxisWrapperHeight] = useState(((_b = horizontalAxisWrapperRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)
63
+ ? horizontalAxisWrapperRef.current.clientHeight
64
+ : 0);
65
+ const [userIsHoldingMouseDown, setUserIsHoldingMouseDown] = useState(false);
66
+ //UseEffect
67
+ useEffect(() => {
68
+ setOrigin({
69
+ x: pastDatesVisible ? Math.ceil(pastDaysInitialQuantity) * cellsWidth : 0,
70
+ y: 0,
71
+ });
72
+ }, [pastDatesVisible, pastDaysInitialQuantity, cellsWidth]);
73
+ useEffect(() => {
74
+ //Cached positions
75
+ if (gridWrapperRef.current && initialPositioningDone === false) {
76
+ gridWrapperRef.current.scrollTop = origin.y;
77
+ gridWrapperRef.current.scrollLeft = origin.x;
78
+ setInitialPositioningDone(true);
79
+ }
80
+ }, [origin.y, origin.x, initialPositioningDone]);
81
+ useEffect(() => {
82
+ if (onScrollLeftChanges) {
83
+ onScrollLeftChanges(xPosition);
84
+ }
85
+ if (onScrollTopChanges) {
86
+ onScrollTopChanges(yPosition);
87
+ }
88
+ return () => {
89
+ if (autoSavePosition) {
90
+ if (yPosition !== origin.y) {
91
+ setMulticalendarScrollTopPosition(multicalendarId, String(yPosition));
92
+ }
93
+ if (xPosition !== origin.x) {
94
+ setMulticalendarScrollLeftPosition(multicalendarId, String(xPosition));
95
+ }
96
+ }
97
+ };
98
+ }, [autoSavePosition, yPosition, xPosition, origin.y, origin.x]);
99
+ useEffect(() => {
100
+ if (pastDatesVisible) {
101
+ setPastDaysQuantity(Math.ceil(pastDaysInitialQuantity));
102
+ }
103
+ else {
104
+ setPastDaysQuantity(0);
105
+ }
106
+ }, [pastDatesVisible, pastDaysInitialQuantity]);
107
+ useEffect(() => {
108
+ if (!firtsCallOnInitialViewDone &&
109
+ visibleListElementsIds.length > 0 &&
110
+ visibleDates.length > 0 &&
111
+ callsOnInitialView) {
112
+ setFirtsCallOnInitialViewDone(true);
113
+ callsOnInitialView(visibleListElementsIds, visibleDates);
114
+ }
115
+ }, [
116
+ firtsCallOnInitialViewDone,
117
+ visibleListElementsIds,
118
+ visibleDates,
119
+ callsOnInitialView,
120
+ ]);
121
+ useEffect(() => {
122
+ var _a, _b;
123
+ const localConstControlsWrapperHeight = ((_a = controlsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight)
124
+ ? controlsWrapperRef.current.clientHeight
125
+ : 0;
126
+ const localConstHorizontalAxisWrapperHeight = ((_b = horizontalAxisWrapperRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)
127
+ ? horizontalAxisWrapperRef.current.clientHeight
128
+ : 0;
129
+ setControlsWrapperHeight(localConstControlsWrapperHeight);
130
+ setHorizontalAxisWrapperHeight(localConstHorizontalAxisWrapperHeight);
131
+ setUpdateList(true);
132
+ // Dimensiones de paginacion, requiere agregar 1 para no ver espacios en blanco
133
+ setPaginationWidth(Math.ceil((windowWidth - verticalAxisWidth) / cellsWidth) + 1);
134
+ setPaginationHeight(Math.ceil((windowHeight -
135
+ localConstControlsWrapperHeight -
136
+ localConstHorizontalAxisWrapperHeight) /
137
+ cellsHeight) + 1);
138
+ // Redefinicion de posicion X ante cambios en el tamaño de la ventana
139
+ if (gridWrapperRef.current !== null) {
140
+ setXPosition(gridWrapperRef.current.scrollLeft);
141
+ setRenderCoordinates({
142
+ x: gridWrapperRef.current.scrollLeft,
143
+ y: gridWrapperRef.current.scrollTop,
144
+ });
145
+ setXOffset(Math.floor(gridWrapperRef.current.scrollLeft / cellsWidth) - chunkRenderX);
146
+ }
147
+ }, [
148
+ windowWidth,
149
+ windowHeight,
150
+ verticalAxisWidth,
151
+ cellsHeight,
152
+ cellsWidth,
153
+ chunkRenderX,
154
+ ]);
155
+ useEffect(() => {
156
+ // Definicion de visibilidad y renderizacion del Eje Y
157
+ if ((renderCoordinates.x === origin.x && renderCoordinates.y === origin.y) ||
158
+ Math.abs(renderCoordinates.y - yPosition) / cellsHeight > chunkRenderY ||
159
+ updateList) {
160
+ if (!(renderCoordinates.x === origin.x && renderCoordinates.y === origin.y)) {
161
+ if (gridWrapperRef.current !== null)
162
+ setRenderCoordinates({
163
+ x: gridWrapperRef.current.scrollLeft,
164
+ y: gridWrapperRef.current.scrollTop,
165
+ });
166
+ }
167
+ let desfase = Funciones.defineYOffset(yPosition, cellsHeight, chunkRenderY);
168
+ setYOffset(desfase);
169
+ setVisibleListElementsIds(Funciones.defineListElementsArrayVisibleList(paginationHeight, chunkRenderY, desfase, listElementsIdsArray));
170
+ if (updateList)
171
+ setUpdateList(false);
172
+ }
173
+ }, [
174
+ updateList,
175
+ yPosition,
176
+ cellsHeight,
177
+ chunkRenderY,
178
+ origin.x,
179
+ origin.y,
180
+ paginationHeight,
181
+ renderCoordinates.x,
182
+ renderCoordinates.y,
183
+ listElementsIdsArray,
184
+ ]);
185
+ useEffect(() => {
186
+ // Definicion de visibilidad y renderizacion del Eje X
187
+ if ((renderCoordinates.x === origin.x && renderCoordinates.y === origin.y) ||
188
+ xPosition < cellsWidth ||
189
+ Math.abs(renderCoordinates.x - xPosition) / cellsWidth > chunkRenderX ||
190
+ updateList) {
191
+ setVisibleDates([]);
192
+ if (!(renderCoordinates.x === origin.x && renderCoordinates.y === origin.y)) {
193
+ if (gridWrapperRef.current !== null)
194
+ setRenderCoordinates({
195
+ x: gridWrapperRef.current.scrollLeft,
196
+ y: gridWrapperRef.current.scrollTop,
197
+ });
198
+ }
199
+ setXOffset(Funciones.defineXOffset(xPosition, cellsWidth, chunkRenderX));
200
+ const fechaMinimaMilisegundos = Funciones.minimalDateMilliseconds(xPosition, cellsWidth, pastDaysQuantity, initialDateOffset);
201
+ setMinimumVisibleDate(Funciones.defineMinimalVisibleDate(fechaMinimaMilisegundos, initialDateOffset));
202
+ if (updateList)
203
+ setUpdateList(false);
204
+ setVisibleDates(Funciones.defineVisibleDatesArray(paginationWidth, chunkRenderX, fechaMinimaMilisegundos));
205
+ }
206
+ }, [
207
+ updateList,
208
+ paginationWidth,
209
+ xPosition,
210
+ chunkRenderX,
211
+ cellsWidth,
212
+ initialDateOffset,
213
+ pastDaysQuantity,
214
+ renderCoordinates.x,
215
+ renderCoordinates.y,
216
+ origin.x,
217
+ origin.y,
218
+ ]);
219
+ useEffect(() => {
220
+ setScrollingOnCourse(true);
221
+ clearTimeout(idTimeoutForCalls);
222
+ setIdTimeoutForCalls(undefined);
223
+ // eslint-disable-next-line
224
+ }, [xPosition, yPosition]);
225
+ useEffect(() => {
226
+ if (idTimeoutForCalls === undefined) {
227
+ let _id = setTimeout(() => setScrollingOnCourse(false), waitTimeForCalls);
228
+ setIdTimeoutForCalls(_id);
229
+ }
230
+ }, [xPosition, yPosition, idTimeoutForCalls, waitTimeForCalls]);
231
+ useEffect(() => {
232
+ if (!scrollingOnCourse && callsOnScrollingStops) {
233
+ callsOnScrollingStops(visibleListElementsIds, visibleDates);
234
+ }
235
+ // eslint-disable-next-line
236
+ }, [scrollingOnCourse, visibleListElementsIds, visibleDates]);
237
+ //Cancelar idIntervalo Autoscroll de rango cuando se deja de seleccionar
238
+ useEffect(() => {
239
+ if (!authomaticScrollOnDraggingOverEdges) {
240
+ if (clientXPositionOnGrid !== undefined)
241
+ setClientXPositionOnGrid(undefined);
242
+ if (clientYPositionOnGrid !== undefined)
243
+ setClientYPositionOnGrid(undefined);
244
+ }
245
+ }, [authomaticScrollOnDraggingOverEdges, clientXPositionOnGrid, clientYPositionOnGrid]);
246
+ useEffect(() => {
247
+ document.body.addEventListener("mousedown", () => {
248
+ setUserIsHoldingMouseDown(true);
249
+ });
250
+ document.body.addEventListener("mouseup", () => {
251
+ setUserIsHoldingMouseDown(false);
252
+ });
253
+ return () => {
254
+ document.body.removeEventListener("mousedown", () => {
255
+ setUserIsHoldingMouseDown(true);
256
+ });
257
+ document.body.removeEventListener("mouseup", () => {
258
+ setUserIsHoldingMouseDown(false);
259
+ });
260
+ };
261
+ }, [authomaticScrollOnDraggingOverEdges]);
262
+ //Render
263
+ return (React.createElement("div", { key: multicalendarId, id: multicalendarId, "data-testid": multicalendarId, className: "trc-multicalendar", style: {
264
+ gridTemplateColumns: `${verticalAxisWidth}px`,
265
+ gridTemplateRows: `auto auto calc(100% - ${controlsWrapperHeight + horizontalAxisWrapperHeight}px`,
266
+ } },
267
+ React.createElement("div", { ref: controlsWrapperRef, className: "controls" },
268
+ React.createElement("div", { className: "div-dates-navigation" },
269
+ React.createElement(DropdownMonthNavigation, { visibleYear: minimumVisibleDate.getFullYear(), visibleMonth: minimumVisibleDate.getMonth(), onChangeAction: (valorDeOpcion) => {
270
+ Funciones.scrollByDate(new Date(Number(Date.parse(sqlToJsDate(valorDeOpcion).toString()))), gridWrapperRef, pastDaysQuantity, cellsWidth);
271
+ }, options: Funciones.defineMonthsArray(pastDaysQuantity, futureDaysQuantity, language) }),
272
+ React.createElement("button", { onClick: () => Funciones.scrollByDate(new Date(), gridWrapperRef, pastDaysQuantity, cellsWidth) }, language["Today"])),
273
+ aditionalControlsComponents && (React.createElement("div", { className: "div-aditional-controls-components" }, aditionalControlsComponents))),
274
+ React.createElement("div", { className: "div-upper-left-component" }, upperLeftComponent),
275
+ React.createElement("div", { className: "vertical-axis" },
276
+ React.createElement("div", { ref: destiniesColumnRef, className: "div-list-element-column", onScroll: (e) => {
277
+ // Se puede hacer funcion
278
+ if (gridWrapperRef.current !== null)
279
+ gridWrapperRef.current.scrollTop = e.target.scrollTop;
280
+ } },
281
+ React.createElement(ListElementsColumn, { listHeight: cellsHeight * listElementsIdsArray.length, yOffset: yOffset, elementsHeight: cellsHeight, idsArray: visibleListElementsIds, ReactListElementChildren: ReactListElementChildren }))),
282
+ React.createElement("div", { ref: horizontalAxisWrapperRef, className: "horizontal-axis" },
283
+ React.createElement("div", { className: "div-weeks-buttons" },
284
+ React.createElement("button", { className: "past-week-button", onClick: () => {
285
+ // Se puede hacer funcion
286
+ if (datesRowRef.current !== null)
287
+ datesRowRef.current.scroll({
288
+ left: datesRowRef.current.scrollLeft - cellsWidth * 7,
289
+ });
290
+ } },
291
+ React.createElement(BsChevronLeft, null)),
292
+ React.createElement("button", { onClick: () => {
293
+ // Se puede hacer funcion
294
+ if (datesRowRef.current !== null)
295
+ datesRowRef.current.scroll({
296
+ left: datesRowRef.current.scrollLeft + cellsWidth * 7,
297
+ });
298
+ }, className: "next-week-button" },
299
+ React.createElement(BsChevronRight, null))),
300
+ React.createElement("div", { ref: datesRowRef, className: "div-dates-row", onScroll: (e) => {
301
+ if (gridWrapperRef.current !== null)
302
+ gridWrapperRef.current.scrollLeft = e.target.scrollLeft;
303
+ } },
304
+ React.createElement(DatesRow, { visibleDates: visibleDates, width: (pastDaysQuantity + futureDaysQuantity) * cellsWidth, height: 74, cellsWidth: cellsWidth, cellsHeight: 74, offset: xOffset, language: language }))),
305
+ React.createElement("div", { className: "div-main-container" },
306
+ React.createElement("div", { ref: gridWrapperRef, className: "main-container", onScroll: (e) => {
307
+ if (datesRowRef.current !== null) {
308
+ const scrollLeft = e.target.scrollLeft;
309
+ datesRowRef.current.scrollLeft = scrollLeft;
310
+ setXPosition(scrollLeft);
311
+ }
312
+ if (destiniesColumnRef.current !== null) {
313
+ const scrollTop = e.target.scrollTop;
314
+ destiniesColumnRef.current.scrollTop = scrollTop;
315
+ setYPosition(scrollTop);
316
+ }
317
+ if (dynamicDaysQuantity &&
318
+ e.target.scrollLeft +
319
+ e.target.offsetWidth >
320
+ (pastDaysQuantity + futureDaysQuantity) * cellsWidth - cellsWidth) {
321
+ setFutureDaysQuantity(futureDaysQuantity + 1);
322
+ }
323
+ if (pastDatesVisible &&
324
+ dynamicDaysQuantity &&
325
+ e.target.scrollLeft < cellsWidth) {
326
+ setPastDaysQuantity(pastDaysQuantity + 1);
327
+ e.target.scrollLeft = cellsWidth * 3;
328
+ }
329
+ Funciones.authomaticScrollInGrid(userIsHoldingMouseDown, clientXPositionOnGrid, clientYPositionOnGrid, cellsWidth * 0.8, cellsHeight * 0.8, e.target);
330
+ }, onMouseMove: (e) => {
331
+ if (gridWrapperRef.current !== null && userIsHoldingMouseDown) {
332
+ let x = e.clientX - gridWrapperRef.current.getBoundingClientRect().left;
333
+ let y = e.clientY - gridWrapperRef.current.getBoundingClientRect().top;
334
+ setClientXPositionOnGrid(x);
335
+ setClientYPositionOnGrid(y);
336
+ Funciones.startAuthomaticScrollInGrid(userIsHoldingMouseDown, x, y, cellsWidth * 0.8, cellsHeight * 0.8, gridWrapperRef);
337
+ }
338
+ } },
339
+ React.createElement(DatesGrid, { gridWidth: (pastDaysQuantity + futureDaysQuantity) * cellsWidth, gridHeight: cellsHeight * listElementsIdsArray.length, xOffset: xOffset, yOffset: yOffset, cellsWidth: cellsWidth, cellsHeight: cellsHeight, visibleListElementsIdsArray: visibleListElementsIds, visibleDates: visibleDates, ReactCellChildren: ReactCellChildren })))));
340
+ };
341
+ export default Multicalendar;
@@ -0,0 +1,86 @@
1
+ import React from "react";
2
+ import { languageType } from "../../languages/types";
3
+ /**
4
+ *
5
+ * @param dateObject Date Object
6
+ * @param elementRef ref of the element that will be scrolled
7
+ * @param leftPagination number of cells to the left
8
+ * @param cellsWidth width of cells
9
+ */
10
+ export declare function scrollByDate(dateObject: Date, elementRef: React.RefObject<HTMLDivElement>, leftPagination: number, cellsWidth: number): void;
11
+ /**
12
+ *
13
+ * @param xPosition position X of grid
14
+ * @param cellsWidth width of grid cells
15
+ * @param leftPagination number of cells to the left
16
+ * @param initialDateOffset offset of cells for the initial date
17
+ * @returns milliseconds of the minimal date
18
+ */
19
+ export declare function minimalDateMilliseconds(xPosition: number, cellsWidth: number, leftPagination: number, initialDateOffset: number): number;
20
+ /**
21
+ *
22
+ * @param millisecondsOfMinimalDate milliseconds of the minimal date
23
+ * @param initialDateOffset offset of number of cells for initial date
24
+ * @returns The minimal visible date object
25
+ */
26
+ export declare function defineMinimalVisibleDate(millisecondsOfMinimalDate: number, initialDateOffset: number): Date;
27
+ /**
28
+ *
29
+ * @param xPosition current x position in the grid horizontal scroll
30
+ * @param cellsWidth width of grid cells
31
+ * @param chunkRenderX extra rendered cells in a row
32
+ * @returns number X offset
33
+ */
34
+ export declare function defineXOffset(xPosition: number, cellsWidth: number, chunkRenderX: number): number;
35
+ /**
36
+ *
37
+ * @param paginationWidth width of pagination of horizontal axis of the grid
38
+ * @param chunkRenderX extra rendered cells in every row
39
+ * @param minimalDateMilliseconds milliseconds of the minimal date
40
+ * @returns an array containing all the dates that should be rendered base on position of x scroll
41
+ */
42
+ export declare function defineVisibleDatesArray(paginationWidth: number, chunkRenderX: number, minimalDateMilliseconds: number): Date[];
43
+ /**
44
+ *
45
+ * @param yPosition current y position in the grid vertical scroll
46
+ * @param cellsHeight height of grid cells
47
+ * @param chunkRenderY extra rendered cells in every column
48
+ * @returns number Y offset
49
+ */
50
+ export declare function defineYOffset(yPosition: number, cellsHeight: number, chunkRenderY: number): number;
51
+ /**
52
+ *
53
+ * @param paginationHeight height of pagination of the vertical axis of the grid
54
+ * @param chunkRenderY extra rendered cells in every column
55
+ * @param offset offset from top of the list
56
+ * @param listElementsIds all ids array
57
+ * @returns Array of the destinies that will be rendered
58
+ */
59
+ export declare function defineListElementsArrayVisibleList(paginationHeight: number, chunkRenderY: number, offset: number, listElementsIds: string[] | number[]): string[] | number[];
60
+ /**
61
+ *
62
+ * @param leftPagination number of cells to the left
63
+ * @param language language object for traductions
64
+ * @returns string of the date, month followed by year
65
+ */
66
+ export declare function defineMonthsArray(leftPagination: number, rightPagination: number, language: languageType): JSX.Element[];
67
+ /**
68
+ *
69
+ * @param holdingClic boolean to know if mouse id down
70
+ * @param xClientPosition position x of the client
71
+ * @param yClientPosition position y of the client
72
+ * @param widthHorizontalBorder horizontal border of activation
73
+ * @param widthVerticalBorder vertical border of activation
74
+ * @param gridRef ref ofthe grid container
75
+ */
76
+ export declare function startAuthomaticScrollInGrid(holdingClic: boolean, xClientPosition: number, yClientPosition: number, widthHorizontalBorder: number, widthVerticalBorder: number, gridRef: React.RefObject<HTMLDivElement>): void;
77
+ /**
78
+ *
79
+ * @param holdingClic boolean to know if mouse id down
80
+ * @param xClientPosition position x of the client
81
+ * @param yClientPosition position y of the client
82
+ * @param widthHorizontalBorder horizontal border of activation
83
+ * @param widthVerticalBorder vertical border of activation
84
+ * @param gridContainer grid container
85
+ */
86
+ export declare function authomaticScrollInGrid(holdingClic: boolean, xClientPosition: number | undefined, yClientPosition: number | undefined, widthHorizontalBorder: number, widthVerticalBorder: number, gridContainer: HTMLDivElement): void;
@@ -0,0 +1,176 @@
1
+ import React from "react";
2
+ //Utils
3
+ import jsToSqlDate from "../../utils/jsToSqlDate";
4
+ import monthYearString from "../../utils/monthYearString";
5
+ //Variables
6
+ import { millisecondsOfOneDay } from "../../common/constants";
7
+ /**
8
+ *
9
+ * @param dateObject Date Object
10
+ * @param elementRef ref of the element that will be scrolled
11
+ * @param leftPagination number of cells to the left
12
+ * @param cellsWidth width of cells
13
+ */
14
+ export function scrollByDate(dateObject, elementRef, leftPagination, cellsWidth) {
15
+ //nueva posicion de scroll horizontal = cantidad de dias hasta hoy * ancho de celda
16
+ if (elementRef.current !== null) {
17
+ elementRef.current.scrollLeft =
18
+ ((Date.parse(dateObject.toString()) -
19
+ (Date.parse(new Date().toString()) -
20
+ (leftPagination) * millisecondsOfOneDay)) /
21
+ millisecondsOfOneDay) *
22
+ cellsWidth;
23
+ }
24
+ }
25
+ /**
26
+ *
27
+ * @param xPosition position X of grid
28
+ * @param cellsWidth width of grid cells
29
+ * @param leftPagination number of cells to the left
30
+ * @param initialDateOffset offset of cells for the initial date
31
+ * @returns milliseconds of the minimal date
32
+ */
33
+ export function minimalDateMilliseconds(xPosition, cellsWidth, leftPagination, initialDateOffset) {
34
+ let minimalDate = new Date(Date.parse(new Date().toString()) +
35
+ millisecondsOfOneDay *
36
+ (Math.floor(xPosition / cellsWidth) - leftPagination - initialDateOffset));
37
+ minimalDate.setHours(12, 0, 0, 0);
38
+ return Date.parse(minimalDate.toString());
39
+ }
40
+ /**
41
+ *
42
+ * @param millisecondsOfMinimalDate milliseconds of the minimal date
43
+ * @param initialDateOffset offset of number of cells for initial date
44
+ * @returns The minimal visible date object
45
+ */
46
+ export function defineMinimalVisibleDate(millisecondsOfMinimalDate, initialDateOffset) {
47
+ return new Date(millisecondsOfMinimalDate + initialDateOffset * millisecondsOfOneDay);
48
+ }
49
+ /**
50
+ *
51
+ * @param xPosition current x position in the grid horizontal scroll
52
+ * @param cellsWidth width of grid cells
53
+ * @param chunkRenderX extra rendered cells in a row
54
+ * @returns number X offset
55
+ */
56
+ export function defineXOffset(xPosition, cellsWidth, chunkRenderX) {
57
+ return Math.floor(xPosition / cellsWidth) - chunkRenderX;
58
+ }
59
+ /**
60
+ *
61
+ * @param paginationWidth width of pagination of horizontal axis of the grid
62
+ * @param chunkRenderX extra rendered cells in every row
63
+ * @param minimalDateMilliseconds milliseconds of the minimal date
64
+ * @returns an array containing all the dates that should be rendered base on position of x scroll
65
+ */
66
+ export function defineVisibleDatesArray(paginationWidth, chunkRenderX, minimalDateMilliseconds) {
67
+ let array = [];
68
+ for (let index = 0; index < paginationWidth + chunkRenderX * 2; index++) {
69
+ array[index] = new Date(minimalDateMilliseconds + millisecondsOfOneDay * (index + 1));
70
+ }
71
+ return array;
72
+ }
73
+ /**
74
+ *
75
+ * @param yPosition current y position in the grid vertical scroll
76
+ * @param cellsHeight height of grid cells
77
+ * @param chunkRenderY extra rendered cells in every column
78
+ * @returns number Y offset
79
+ */
80
+ export function defineYOffset(yPosition, cellsHeight, chunkRenderY) {
81
+ let desfase = Math.floor(yPosition / cellsHeight) - chunkRenderY;
82
+ if (desfase < 0)
83
+ desfase = 0;
84
+ return desfase;
85
+ }
86
+ /**
87
+ *
88
+ * @param paginationHeight height of pagination of the vertical axis of the grid
89
+ * @param chunkRenderY extra rendered cells in every column
90
+ * @param offset offset from top of the list
91
+ * @param listElementsIds all ids array
92
+ * @returns Array of the destinies that will be rendered
93
+ */
94
+ export function defineListElementsArrayVisibleList(paginationHeight, chunkRenderY, offset, listElementsIds) {
95
+ let array = [];
96
+ for (let index = 0; index < paginationHeight + chunkRenderY * 2; index++) {
97
+ if (listElementsIds[index + offset] && index + offset >= 0)
98
+ array[index] = listElementsIds[index + offset];
99
+ }
100
+ return array;
101
+ }
102
+ /**
103
+ *
104
+ * @param leftPagination number of cells to the left
105
+ * @param language language object for traductions
106
+ * @returns string of the date, month followed by year
107
+ */
108
+ export function defineMonthsArray(leftPagination, rightPagination, language) {
109
+ let minimumDateMilliseconds = Date.parse(new Date().toString()) - leftPagination * millisecondsOfOneDay;
110
+ let maximumDateMilliseconds = Date.parse(new Date().toString()) + rightPagination * millisecondsOfOneDay;
111
+ let array = [];
112
+ let sideArray = [];
113
+ for (let index = 0; index * millisecondsOfOneDay + minimumDateMilliseconds < maximumDateMilliseconds; index++) {
114
+ let dateObject = new Date(millisecondsOfOneDay * index + minimumDateMilliseconds);
115
+ let firstDayOfTheMonth = dateObject;
116
+ firstDayOfTheMonth.setDate(1);
117
+ firstDayOfTheMonth.setHours(12, 0, 0, 0);
118
+ let dateString = monthYearString(dateObject, language);
119
+ if (!sideArray.includes(dateString)) {
120
+ sideArray.push(dateString);
121
+ array.push(React.createElement("option", {
122
+ key: jsToSqlDate(firstDayOfTheMonth),
123
+ value: jsToSqlDate(firstDayOfTheMonth),
124
+ }, dateString));
125
+ }
126
+ }
127
+ return array;
128
+ }
129
+ /**
130
+ *
131
+ * @param holdingClic boolean to know if mouse id down
132
+ * @param xClientPosition position x of the client
133
+ * @param yClientPosition position y of the client
134
+ * @param widthHorizontalBorder horizontal border of activation
135
+ * @param widthVerticalBorder vertical border of activation
136
+ * @param gridRef ref ofthe grid container
137
+ */
138
+ export function startAuthomaticScrollInGrid(holdingClic, xClientPosition, yClientPosition, widthHorizontalBorder, widthVerticalBorder, gridRef) {
139
+ if (holdingClic && gridRef.current !== null) {
140
+ if (xClientPosition < widthHorizontalBorder)
141
+ gridRef.current.scrollLeft -= 10;
142
+ if (xClientPosition > gridRef.current.offsetWidth - widthHorizontalBorder)
143
+ gridRef.current.scrollLeft += 10;
144
+ if (yClientPosition < widthVerticalBorder)
145
+ gridRef.current.scrollTop -= 10;
146
+ if (yClientPosition > gridRef.current.offsetHeight - widthVerticalBorder)
147
+ gridRef.current.scrollTop += 10;
148
+ }
149
+ }
150
+ /**
151
+ *
152
+ * @param holdingClic boolean to know if mouse id down
153
+ * @param xClientPosition position x of the client
154
+ * @param yClientPosition position y of the client
155
+ * @param widthHorizontalBorder horizontal border of activation
156
+ * @param widthVerticalBorder vertical border of activation
157
+ * @param gridContainer grid container
158
+ */
159
+ export function authomaticScrollInGrid(holdingClic, xClientPosition, yClientPosition, widthHorizontalBorder, widthVerticalBorder, gridContainer) {
160
+ if (holdingClic) {
161
+ if (xClientPosition) {
162
+ if (xClientPosition < widthHorizontalBorder)
163
+ gridContainer.scrollLeft -= widthHorizontalBorder - xClientPosition;
164
+ if (xClientPosition > gridContainer.offsetWidth - widthHorizontalBorder)
165
+ gridContainer.scrollLeft +=
166
+ xClientPosition + widthHorizontalBorder - gridContainer.offsetWidth;
167
+ }
168
+ if (yClientPosition) {
169
+ if (yClientPosition < widthVerticalBorder)
170
+ gridContainer.scrollTop -= widthVerticalBorder - yClientPosition;
171
+ if (yClientPosition > gridContainer.offsetHeight - widthVerticalBorder)
172
+ gridContainer.scrollTop +=
173
+ yClientPosition + widthVerticalBorder - gridContainer.offsetHeight;
174
+ }
175
+ }
176
+ }
@@ -0,0 +1,5 @@
1
+ .cells-row {
2
+ display: flex;
3
+ flex-flow: row;
4
+ }
5
+
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import "./CellsRow.css";
3
+ import { CellsRowsPropsType } from "./types";
4
+ declare const CellsRow: ({ listElementId, visibleDatesArray, width, height, cellsWidth, cellsHeight, ReactCellChildren, }: CellsRowsPropsType) => React.JSX.Element;
5
+ export default CellsRow;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import "./CellsRow.css";
3
+ //Componentes
4
+ import Cell from "../../individuals/Cell/Cell";
5
+ //Utils
6
+ import jsToSqlDate from "../../../../../utils/jsToSqlDate";
7
+ const CellsRow = ({ listElementId, visibleDatesArray, width, height, cellsWidth, cellsHeight, ReactCellChildren, }) => {
8
+ //Render
9
+ return (React.createElement("div", { className: "cells-row", style: {
10
+ width: width,
11
+ height: height,
12
+ } }, visibleDatesArray.length > 0 &&
13
+ visibleDatesArray.map((date) => (React.createElement(Cell, { key: listElementId + date.toString(), date: jsToSqlDate(date), listElementId: listElementId, width: cellsWidth, heigth: cellsHeight, ReactCellChildren: ReactCellChildren })))));
14
+ };
15
+ export default CellsRow;
@@ -0,0 +1,11 @@
1
+ import { ReactCellChildrenType } from "../../../types";
2
+
3
+ export interface CellsRowsPropsType {
4
+ listElementId: string | number;
5
+ visibleDatesArray: Date[];
6
+ width: number;
7
+ height: number;
8
+ cellsWidth: number;
9
+ cellsHeight: number;
10
+ ReactCellChildren: ReactCellChildrenType;
11
+ }
@@ -0,0 +1,6 @@
1
+ .dates-grid {
2
+ box-sizing: border-box;
3
+ }
4
+ .dates-grid .div-cells-row-height {
5
+ box-sizing: border-box;
6
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import "./DatesGrid.css";
3
+ import { DatesGridPropTypes } from "./types";
4
+ declare const DatesGrid: ({ gridWidth, gridHeight, xOffset, yOffset, cellsWidth, cellsHeight, visibleListElementsIdsArray, visibleDates, ReactCellChildren, }: DatesGridPropTypes) => React.JSX.Element;
5
+ export default DatesGrid;