@cwellt_software/cwellt-reactjs-lib 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/dist/assets/asset-Boimp3FS +46 -0
  2. package/dist/assets/asset-CIKjURuf +48 -0
  3. package/dist/assets/asset-DO0cv1ff +51 -0
  4. package/dist/assets/asset-DitoBYw6 +51 -0
  5. package/dist/common/classes/CwSelectList.d.ts +8 -0
  6. package/dist/common/classes/CwSelectList.d.ts.map +1 -0
  7. package/dist/common/classes/CwSelectListItems.d.ts +9 -0
  8. package/dist/common/classes/CwSelectListItems.d.ts.map +1 -0
  9. package/dist/common/functions/collections.d.ts +5 -0
  10. package/dist/common/functions/collections.d.ts.map +1 -0
  11. package/dist/common/functions/reactor.d.ts +2 -0
  12. package/dist/common/functions/reactor.d.ts.map +1 -0
  13. package/dist/common/interfaces/CwSelectListProps.d.ts +9 -0
  14. package/dist/common/interfaces/CwSelectListProps.d.ts.map +1 -0
  15. package/dist/components/control/action/button/CwButton.d.ts +7 -0
  16. package/dist/components/control/action/button/CwButton.d.ts.map +1 -0
  17. package/dist/components/control/action/buttons/CwButtons.d.ts +326 -0
  18. package/dist/components/control/action/buttons/CwButtons.d.ts.map +1 -0
  19. package/dist/components/control/action/contextmenu/CwContextMenu.d.ts +33 -0
  20. package/dist/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -0
  21. package/dist/components/control/action/search/CwSearch.d.ts +18 -0
  22. package/dist/components/control/action/search/CwSearch.d.ts.map +1 -0
  23. package/dist/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts +21 -0
  24. package/dist/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts.map +1 -0
  25. package/dist/components/control/choice/checkbox/CwCheckbox.d.ts +19 -0
  26. package/dist/components/control/choice/checkbox/CwCheckbox.d.ts.map +1 -0
  27. package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts +24 -0
  28. package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts.map +1 -0
  29. package/dist/components/control/choice/dropdown/CwDropdown.d.ts +21 -0
  30. package/dist/components/control/choice/dropdown/CwDropdown.d.ts.map +1 -0
  31. package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts +19 -0
  32. package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts.map +1 -0
  33. package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts +32 -0
  34. package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts.map +1 -0
  35. package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts +23 -0
  36. package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts.map +1 -0
  37. package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts +68 -0
  38. package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +1 -0
  39. package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts +34 -0
  40. package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts.map +1 -0
  41. package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts +18 -0
  42. package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts.map +1 -0
  43. package/dist/components/control/choice/multiselect/CwMultiselect.d.ts +15 -0
  44. package/dist/components/control/choice/multiselect/CwMultiselect.d.ts.map +1 -0
  45. package/dist/components/control/choice/multiselect/CwOptionList.d.ts +17 -0
  46. package/dist/components/control/choice/multiselect/CwOptionList.d.ts.map +1 -0
  47. package/dist/components/control/choice/option/CwOption.d.ts +17 -0
  48. package/dist/components/control/choice/option/CwOption.d.ts.map +1 -0
  49. package/dist/components/control/choice/select/CwSelect.d.ts +49 -0
  50. package/dist/components/control/choice/select/CwSelect.d.ts.map +1 -0
  51. package/dist/components/control/choice/toggle/CwToggle.d.ts +36 -0
  52. package/dist/components/control/choice/toggle/CwToggle.d.ts.map +1 -0
  53. package/dist/components/control/input/any/CwInput.d.ts +19 -0
  54. package/dist/components/control/input/any/CwInput.d.ts.map +1 -0
  55. package/dist/components/control/input/chipper/CwChip.d.ts +16 -0
  56. package/dist/components/control/input/chipper/CwChip.d.ts.map +1 -0
  57. package/dist/components/control/input/date/CwInputDate.d.ts +40 -0
  58. package/dist/components/control/input/date/CwInputDate.d.ts.map +1 -0
  59. package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts +7 -0
  60. package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts.map +1 -0
  61. package/dist/components/control/input/date-text/CwInputDateText.d.ts +39 -0
  62. package/dist/components/control/input/date-text/CwInputDateText.d.ts.map +1 -0
  63. package/dist/components/control/input/datetime/CwInputDatetime.d.ts +40 -0
  64. package/dist/components/control/input/datetime/CwInputDatetime.d.ts.map +1 -0
  65. package/dist/components/control/input/digit/CwDigit.d.ts +40 -0
  66. package/dist/components/control/input/digit/CwDigit.d.ts.map +1 -0
  67. package/dist/components/control/input/file/CwFileUpload.d.ts +20 -0
  68. package/dist/components/control/input/file/CwFileUpload.d.ts.map +1 -0
  69. package/dist/components/control/input/image/CwInputImage.d.ts +11 -0
  70. package/dist/components/control/input/image/CwInputImage.d.ts.map +1 -0
  71. package/dist/components/control/input/image-area/CwImageArea.d.ts +58 -0
  72. package/dist/components/control/input/image-area/CwImageArea.d.ts.map +1 -0
  73. package/dist/components/control/input/number/CwInputNumber.d.ts +22 -0
  74. package/dist/components/control/input/number/CwInputNumber.d.ts.map +1 -0
  75. package/dist/components/control/input/phone/CwInputPhone.d.ts +36 -0
  76. package/dist/components/control/input/phone/CwInputPhone.d.ts.map +1 -0
  77. package/dist/components/control/input/text/CwInputText.d.ts +40 -0
  78. package/dist/components/control/input/text/CwInputText.d.ts.map +1 -0
  79. package/dist/components/control/input/text-area/CwTextArea.d.ts +25 -0
  80. package/dist/components/control/input/text-area/CwTextArea.d.ts.map +1 -0
  81. package/dist/components/control/input/time/CwTime.d.ts +40 -0
  82. package/dist/components/control/input/time/CwTime.d.ts.map +1 -0
  83. package/dist/components/custom/find-airport/CwFindAirportComp.d.ts +32 -0
  84. package/dist/components/custom/find-airport/CwFindAirportComp.d.ts.map +1 -0
  85. package/dist/components/custom/scheduler/CwSchedulerComp.d.ts +39 -0
  86. package/dist/components/custom/scheduler/CwSchedulerComp.d.ts.map +1 -0
  87. package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts +101 -0
  88. package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts.map +1 -0
  89. package/dist/components/custom/scheduler/components/ClearSchedulerButton.d.ts +7 -0
  90. package/dist/components/custom/scheduler/components/ClearSchedulerButton.d.ts.map +1 -0
  91. package/dist/components/custom/scheduler/components/EventRender.d.ts +3 -0
  92. package/dist/components/custom/scheduler/components/EventRender.d.ts.map +1 -0
  93. package/dist/components/custom/scheduler/components/ResourceListRender.d.ts +17 -0
  94. package/dist/components/custom/scheduler/components/ResourceListRender.d.ts.map +1 -0
  95. package/dist/components/custom/scheduler/components/ResourceRender.d.ts +15 -0
  96. package/dist/components/custom/scheduler/components/ResourceRender.d.ts.map +1 -0
  97. package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts +10 -0
  98. package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts.map +1 -0
  99. package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts +10 -0
  100. package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts.map +1 -0
  101. package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts +10 -0
  102. package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts.map +1 -0
  103. package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts +10 -0
  104. package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts.map +1 -0
  105. package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts +14 -0
  106. package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts.map +1 -0
  107. package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts +24 -0
  108. package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts.map +1 -0
  109. package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts +8 -0
  110. package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts.map +1 -0
  111. package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts +11 -0
  112. package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +1 -0
  113. package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts +11 -0
  114. package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts.map +1 -0
  115. package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts +10 -0
  116. package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts.map +1 -0
  117. package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts +7 -0
  118. package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts.map +1 -0
  119. package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts +2 -0
  120. package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts.map +1 -0
  121. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts +2 -0
  122. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts.map +1 -0
  123. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +2 -0
  124. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +1 -0
  125. package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts +11 -0
  126. package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts.map +1 -0
  127. package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts +10 -0
  128. package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts.map +1 -0
  129. package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts +2 -0
  130. package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts.map +1 -0
  131. package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +11 -0
  132. package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +1 -0
  133. package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts +8 -0
  134. package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts.map +1 -0
  135. package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts +2 -0
  136. package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts.map +1 -0
  137. package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts +2 -0
  138. package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts.map +1 -0
  139. package/dist/components/custom/scheduler/logic/filtering/filterAndProcessResources.d.ts +19 -0
  140. package/dist/components/custom/scheduler/logic/filtering/filterAndProcessResources.d.ts.map +1 -0
  141. package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts +10 -0
  142. package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts.map +1 -0
  143. package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts +10 -0
  144. package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts.map +1 -0
  145. package/dist/components/custom/scheduler/logic/filtering/hasSameProperties.d.ts +3 -0
  146. package/dist/components/custom/scheduler/logic/filtering/hasSameProperties.d.ts.map +1 -0
  147. package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts +14 -0
  148. package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts.map +1 -0
  149. package/dist/components/custom/scheduler/logic/pixels/calculateMaxPxFromDateRange.d.ts +7 -0
  150. package/dist/components/custom/scheduler/logic/pixels/calculateMaxPxFromDateRange.d.ts.map +1 -0
  151. package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts +8 -0
  152. package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts.map +1 -0
  153. package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts +6 -0
  154. package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts.map +1 -0
  155. package/dist/components/custom/scheduler/logic/pixels/heightSchedulerPinned.d.ts +6 -0
  156. package/dist/components/custom/scheduler/logic/pixels/heightSchedulerPinned.d.ts.map +1 -0
  157. package/dist/components/custom/scheduler/logic/state_handle/handleDateChange.d.ts +10 -0
  158. package/dist/components/custom/scheduler/logic/state_handle/handleDateChange.d.ts.map +1 -0
  159. package/dist/components/custom/scheduler/logic/state_handle/handlePropChanges.d.ts +11 -0
  160. package/dist/components/custom/scheduler/logic/state_handle/handlePropChanges.d.ts.map +1 -0
  161. package/dist/components/custom/scheduler/logic/state_handle/handleResourceChange.d.ts +10 -0
  162. package/dist/components/custom/scheduler/logic/state_handle/handleResourceChange.d.ts.map +1 -0
  163. package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts +2 -0
  164. package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts.map +1 -0
  165. package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts +2 -0
  166. package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts.map +1 -0
  167. package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts +3 -0
  168. package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts.map +1 -0
  169. package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts +13 -0
  170. package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts.map +1 -0
  171. package/dist/components/custom/scheduler/logic/ui/getHasPropsChanged.d.ts +8 -0
  172. package/dist/components/custom/scheduler/logic/ui/getHasPropsChanged.d.ts.map +1 -0
  173. package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts +2 -0
  174. package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts.map +1 -0
  175. package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts +3 -0
  176. package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts.map +1 -0
  177. package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts +19 -0
  178. package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts.map +1 -0
  179. package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts +48 -0
  180. package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts.map +1 -0
  181. package/dist/components/custom/scheduler/state/EventProps.d.ts +7 -0
  182. package/dist/components/custom/scheduler/state/EventProps.d.ts.map +1 -0
  183. package/dist/components/custom/scheduler/state/Resource.d.ts +14 -0
  184. package/dist/components/custom/scheduler/state/Resource.d.ts.map +1 -0
  185. package/dist/components/custom/scheduler/state/State.d.ts +25 -0
  186. package/dist/components/custom/scheduler/state/State.d.ts.map +1 -0
  187. package/dist/components/custom/scheduler/state/cblEvent.d.ts +26 -0
  188. package/dist/components/custom/scheduler/state/cblEvent.d.ts.map +1 -0
  189. package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts +7 -0
  190. package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts.map +1 -0
  191. package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts +6 -0
  192. package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts.map +1 -0
  193. package/dist/components/display/data/accordion/CwAccordionContainer.d.ts +16 -0
  194. package/dist/components/display/data/accordion/CwAccordionContainer.d.ts.map +1 -0
  195. package/dist/components/display/data/table/CwTable.d.ts +130 -0
  196. package/dist/components/display/data/table/CwTable.d.ts.map +1 -0
  197. package/dist/components/display/graphics/icon/CwIcon.d.ts +14 -0
  198. package/dist/components/display/graphics/icon/CwIcon.d.ts.map +1 -0
  199. package/dist/components/display/graphics/loading/CwLoading.d.ts +19 -0
  200. package/dist/components/display/graphics/loading/CwLoading.d.ts.map +1 -0
  201. package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts +8 -0
  202. package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts.map +1 -0
  203. package/dist/components/display/text/heading/CwHeadingMain.d.ts +5 -0
  204. package/dist/components/display/text/heading/CwHeadingMain.d.ts.map +1 -0
  205. package/dist/components/display/text/heading/CwHeadingSecond.d.ts +5 -0
  206. package/dist/components/display/text/heading/CwHeadingSecond.d.ts.map +1 -0
  207. package/dist/components/display/text/label/CwLabel.d.ts +28 -0
  208. package/dist/components/display/text/label/CwLabel.d.ts.map +1 -0
  209. package/dist/components/display/text/message/CwMessage.d.ts +31 -0
  210. package/dist/components/display/text/message/CwMessage.d.ts.map +1 -0
  211. package/dist/components/display/text/tag/CwTag.d.ts +16 -0
  212. package/dist/components/display/text/tag/CwTag.d.ts.map +1 -0
  213. package/dist/components/display/text/tooltip/CwTooltip.d.ts +10 -0
  214. package/dist/components/display/text/tooltip/CwTooltip.d.ts.map +1 -0
  215. package/dist/components/layout/align/CwAlign.d.ts +53 -0
  216. package/dist/components/layout/align/CwAlign.d.ts.map +1 -0
  217. package/dist/components/layout/list/details/CwExpandable.d.ts +23 -0
  218. package/dist/components/layout/list/details/CwExpandable.d.ts.map +1 -0
  219. package/dist/components/layout/modal/hover/CwModalHover.d.ts +19 -0
  220. package/dist/components/layout/modal/hover/CwModalHover.d.ts.map +1 -0
  221. package/dist/components/layout/modal/legacy/cw_modal.d.ts +24 -0
  222. package/dist/components/layout/modal/legacy/cw_modal.d.ts.map +1 -0
  223. package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts +19 -0
  224. package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts.map +1 -0
  225. package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts +21 -0
  226. package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts.map +1 -0
  227. package/dist/components/layout/modal/legacy/cw_modal_report.d.ts +35 -0
  228. package/dist/components/layout/modal/legacy/cw_modal_report.d.ts.map +1 -0
  229. package/dist/components/layout/table/grouped/CwTableGrouped.d.ts +80 -0
  230. package/dist/components/layout/table/grouped/CwTableGrouped.d.ts.map +1 -0
  231. package/dist/components/layout/tabs/CwTabs.d.ts +37 -0
  232. package/dist/components/layout/tabs/CwTabs.d.ts.map +1 -0
  233. package/dist/content/icons/new-cw-icons/NewCwIcons.html +2 -2
  234. package/dist/content/icons/new-cw-icons/NewCwIcons.json +1 -1
  235. package/dist/content/icons/new-cw-icons/css/new-cw-icons.css +3 -1
  236. package/dist/content/icons/new-cw-icons/fonts/NewCwIcons.woff +0 -0
  237. package/dist/index.cjs.js +687 -514
  238. package/dist/index.cjs.js.map +1 -1
  239. package/dist/index.css +2 -4
  240. package/dist/index.css.map +1 -1
  241. package/dist/index.d.ts +206 -192
  242. package/dist/index.es.js +688 -515
  243. package/dist/index.es.js.map +1 -0
  244. package/dist/index.esm.js +621 -693
  245. package/dist/index.esm.js.map +1 -0
  246. package/dist/src/common/functions/colorManipulation.d.ts +6 -0
  247. package/dist/src/common/functions/colorManipulation.d.ts.map +1 -0
  248. package/dist/src/common/functions/reactor.d.ts +0 -1
  249. package/dist/src/common/functions/useSingleAndDoubleClicks.d.ts.map +1 -1
  250. package/dist/src/components/control/action/button/CwButton.d.ts +1 -1
  251. package/dist/src/components/control/action/button/CwButton.d.ts.map +1 -1
  252. package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts +5 -5
  253. package/dist/src/components/control/choice/option/CwOption.d.ts +1 -1
  254. package/dist/src/components/control/choice/option/CwOption.d.ts.map +1 -1
  255. package/dist/src/components/control/choice/select/CwSelect.d.ts +11 -11
  256. package/dist/src/components/control/choice/select/CwSelect.d.ts.map +1 -1
  257. package/dist/src/components/control/choice/toggle/CwToggle.d.ts +8 -8
  258. package/dist/src/components/control/choice/toggle/CwToggle.d.ts.map +1 -1
  259. package/dist/src/components/control/input/chipper/CwChip.d.ts +4 -4
  260. package/dist/src/components/control/input/chipper/CwChip.d.ts.map +1 -1
  261. package/dist/src/components/control/input/date/CwInputDate.d.ts +11 -11
  262. package/dist/src/components/control/input/date/CwInputDate.d.ts.map +1 -1
  263. package/dist/src/components/control/input/date-text/CwInputDateText.d.ts +8 -8
  264. package/dist/src/components/control/input/date-text/CwInputDateText.d.ts.map +1 -1
  265. package/dist/src/components/control/input/datetime/CwInputDatetime.d.ts +11 -11
  266. package/dist/src/components/control/input/datetime/CwInputDatetime.d.ts.map +1 -1
  267. package/dist/src/components/control/input/digit/CwDigit.d.ts +11 -11
  268. package/dist/src/components/control/input/digit/CwDigit.d.ts.map +1 -1
  269. package/dist/src/components/control/input/file/CwFileUpload.d.ts.map +1 -1
  270. package/dist/src/components/control/input/image/CwInputImage.d.ts +1 -1
  271. package/dist/src/components/control/input/image/CwInputImage.d.ts.map +1 -1
  272. package/dist/src/components/control/input/image-area/CwImageArea.d.ts +7 -7
  273. package/dist/src/components/control/input/image-area/CwImageArea.d.ts.map +1 -1
  274. package/dist/src/components/control/input/phone/CwInputPhone.d.ts +9 -9
  275. package/dist/src/components/control/input/phone/CwInputPhone.d.ts.map +1 -1
  276. package/dist/src/components/control/input/text/CwInputText.d.ts +11 -11
  277. package/dist/src/components/control/input/text/CwInputText.d.ts.map +1 -1
  278. package/dist/src/components/control/input/text-area/CwTextArea.d.ts +9 -9
  279. package/dist/src/components/control/input/text-area/CwTextArea.d.ts.map +1 -1
  280. package/dist/src/components/control/input/time/CwTime.d.ts +11 -11
  281. package/dist/src/components/control/input/time/CwTime.d.ts.map +1 -1
  282. package/dist/src/components/custom/scheduler/CwSchedulerComp.d.ts +1 -0
  283. package/dist/src/components/custom/scheduler/CwSchedulerComp.d.ts.map +1 -1
  284. package/dist/src/components/custom/scheduler/components/ClearSchedulerButton.d.ts +2 -2
  285. package/dist/src/components/custom/scheduler/logic/filtering/filterAndProcessResources.d.ts.map +1 -1
  286. package/dist/src/components/custom/scheduler/logic/pixels/calculateMaxPxFromDateRange.d.ts +0 -1
  287. package/dist/src/components/custom/scheduler/logic/state_handle/handleDateChange.d.ts +0 -1
  288. package/dist/src/components/custom/scheduler/logic/state_handle/handlePropChanges.d.ts.map +1 -1
  289. package/dist/src/components/custom/scheduler/logic/ui/getHasPropsChanged.d.ts.map +1 -1
  290. package/dist/src/components/custom/scheduler/logic/ui/shouldTriggerScroll.d.ts.map +1 -1
  291. package/dist/src/components/custom/scheduler/state/EventProps.d.ts +0 -1
  292. package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts +6 -4
  293. package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +1 -1
  294. package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts +1 -1
  295. package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts.map +1 -1
  296. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.d.ts +4 -0
  297. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.d.ts.map +1 -1
  298. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.d.ts +1 -1
  299. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.d.ts.map +1 -1
  300. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.d.ts.map +1 -1
  301. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.d.ts +3 -1
  302. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.d.ts.map +1 -1
  303. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgrounEvent.d.ts +7 -0
  304. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgrounEvent.d.ts.map +1 -1
  305. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts +2 -3
  306. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts.map +1 -1
  307. package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts +3 -3
  308. package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts.map +1 -1
  309. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts +4 -2
  310. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +1 -1
  311. package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts +2 -1
  312. package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map +1 -1
  313. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.d.ts +3 -1
  314. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.d.ts.map +1 -1
  315. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.d.ts.map +1 -1
  316. package/dist/src/components/custom/scheduler-new/presentation/helpers.d.ts +1 -1
  317. package/dist/src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.d.ts.map +1 -1
  318. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.d.ts.map +1 -1
  319. package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts +1 -1
  320. package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts.map +1 -1
  321. package/dist/src/components/custom/scheduler-new/presentation/state/external/Event.d.ts +0 -1
  322. package/dist/src/components/custom/scheduler-new/presentation/state/external/Row.d.ts +0 -1
  323. package/dist/src/components/custom/scheduler-new/presentation/state/ui/EventSideDragState.d.ts +0 -1
  324. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerEventState.d.ts +3 -2
  325. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerHeaderState.d.ts +2 -5
  326. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerHeaderState.d.ts.map +1 -1
  327. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerRow.d.ts +0 -1
  328. package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts +5 -0
  329. package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts.map +1 -1
  330. package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts.map +1 -1
  331. package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts +5 -5
  332. package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts.map +1 -1
  333. package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +3 -2
  334. package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -1
  335. package/dist/src/components/display/graphics/icon/CwIcon.d.ts +2 -2
  336. package/dist/src/components/display/graphics/icon/CwIcon.d.ts.map +1 -1
  337. package/dist/src/components/display/text/label/CwLabel.d.ts +9 -9
  338. package/dist/src/components/display/text/label/CwLabel.d.ts.map +1 -1
  339. package/dist/src/components/display/text/message/CwMessage.d.ts +5 -5
  340. package/dist/src/components/display/text/message/CwMessage.d.ts.map +1 -1
  341. package/dist/src/components/layout/align/CwAlign.d.ts +24 -24
  342. package/dist/src/components/layout/align/CwAlign.d.ts.map +1 -1
  343. package/dist/src/components/layout/dialog/CwDialog.d.ts +8 -8
  344. package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
  345. package/dist/src/components/layout/list/details/CwExpandable.d.ts +9 -9
  346. package/dist/src/components/layout/list/details/CwExpandable.d.ts.map +1 -1
  347. package/dist/src/components/layout/modal/hover/CwModalHover.d.ts +5 -5
  348. package/dist/src/components/layout/modal/hover/CwModalHover.d.ts.map +1 -1
  349. package/dist/src/index.d.ts +5 -5
  350. package/dist/src/index.d.ts.map +1 -1
  351. package/dist/test/components/custom/scheduler/calculateMaxPxFromDateRange.test.d.ts +0 -1
  352. package/package.json +2 -2
  353. package/dist/src/components/custom/scheduler-new/presentation/TestScheduler.d.ts +0 -1
  354. package/dist/src/components/custom/scheduler-new/presentation/components/row/cancellablePromise.d.ts +0 -7
  355. package/dist/src/components/custom/scheduler-new/presentation/components/row/cancellablePromise.d.ts.map +0 -1
  356. package/dist/src/components/custom/scheduler-new/presentation/components/row/useCancellablePromise.d.ts +0 -7
  357. package/dist/src/components/custom/scheduler-new/presentation/components/row/useCancellablePromise.d.ts.map +0 -1
  358. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsByResource.d.ts +0 -5
  359. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsByResource.d.ts.map +0 -1
  360. package/dist/src/components/custom/scheduler-new/presentation/state/external/Event.d.ts.map +0 -1
  361. package/dist/src/components/custom/scheduler-new/presentation/state/external/Row.d.ts.map +0 -1
  362. package/dist/src/components/custom/scheduler-new/presentation/state/ui/EventSideDragState.d.ts.map +0 -1
  363. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerEventState.d.ts.map +0 -1
  364. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerRow.d.ts.map +0 -1
  365. package/dist/test/components/custom/newScheduler/presentation/logic/getDefaultDivisions.test.d.ts.map +0 -1
package/dist/index.cjs.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
5
  var client = require('react-dom/client');
6
+ var reactDom = require('react-dom');
6
7
  var antd = require('antd');
7
8
  var Draggable = require('react-draggable');
8
9
  var moment = require('moment');
@@ -70,12 +71,12 @@ function CwHeadingSecond(props) {
70
71
  * General purpose aligner flex container, useful for column or row view.
71
72
  * @remarks
72
73
  * ```txt
73
- * $flexDirection="row" (default):
74
+ * flexDirection="row" (default):
74
75
  *
75
76
  * <Row A> | - item 1 - item 2 - item 3 |
76
77
  * <Row B> | - item 1 - item 2 - item 3 |
77
78
  *
78
- * $flexDirection="column":
79
+ * flexDirection="column":
79
80
  *
80
81
  * <Col A> <Col B>
81
82
  * | - item 1 | - item 1 |
@@ -84,7 +85,7 @@ function CwHeadingSecond(props) {
84
85
  *
85
86
  * ```
86
87
  * @example
87
- * <CwAlign $flexDirection="column">
88
+ * <CwAlign flexDirection="column">
88
89
  * <div>
89
90
  * <h2>ColumnA</h2>
90
91
  * </div>
@@ -94,29 +95,29 @@ function CwHeadingSecond(props) {
94
95
  * </CwAlign>
95
96
  */
96
97
  function CwAlign(props) {
97
- const { $alignContent, $alignItems, $alignSelf, $bottom, $display, $flexBasis, $flexDirection, $flexGrow, $flexShrink, $flexWrap, $height, $justifyContent, $left, $margin, $order, $padding, $position, $right, $top, $width, $gap, ...divProps } = props;
98
+ const { alignContent, alignItems, alignSelf, bottom, display, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, cssHeight, justifyContent, left, margin, order, padding, position, right, top, cssWidth, gap, ...divProps } = props;
98
99
  return (jsxRuntime.jsx("div", { className: "cw-align", ...divProps, style: {
99
- alignContent: $alignContent,
100
- alignItems: $alignItems,
101
- alignSelf: $alignSelf,
102
- bottom: $bottom,
103
- display: $display ?? "flex",
104
- flexBasis: $flexBasis,
105
- flexDirection: $flexDirection,
106
- flexGrow: $flexGrow,
107
- flexShrink: $flexShrink,
108
- flexWrap: $flexWrap,
109
- height: $height,
110
- justifyContent: $justifyContent,
111
- left: $left,
112
- margin: $margin,
113
- order: $order,
114
- padding: $padding,
115
- position: $position,
116
- right: $right,
117
- top: $top,
118
- width: $width,
119
- gap: $gap
100
+ alignContent: alignContent,
101
+ alignItems: alignItems,
102
+ alignSelf: alignSelf,
103
+ bottom: bottom,
104
+ display: display ?? "flex",
105
+ flexBasis: flexBasis,
106
+ flexDirection: flexDirection,
107
+ flexGrow: flexGrow,
108
+ flexShrink: flexShrink,
109
+ flexWrap: flexWrap,
110
+ height: cssHeight,
111
+ justifyContent: justifyContent,
112
+ left: left,
113
+ margin: margin,
114
+ order: order,
115
+ padding: padding,
116
+ position: position,
117
+ right: right,
118
+ top: top,
119
+ width: cssWidth,
120
+ gap: gap
120
121
  }, children: props.children }));
121
122
  }
122
123
 
@@ -124,12 +125,12 @@ function CwAlign(props) {
124
125
  * Label for form controls.
125
126
  * @example
126
127
  * ```tsx
127
- * <CwLabelForm $justify="right" >Username:</CwLabelForm>
128
+ * <CwLabelForm justify="right" >Username:</CwLabelForm>
128
129
  * ```
129
130
  */
130
131
  function CwLabel(props) {
131
- const { $justify, $text, $height, $width, $alignProps, $margin, ...$labelProps } = props;
132
- return (jsxRuntime.jsx("span", { className: "cw-label", children: jsxRuntime.jsx(CwAlign, { ...$alignProps, children: jsxRuntime.jsx("label", { style: { textAlign: $justify, width: $width, height: $height, margin: $margin ?? "1px 0 0 0" }, ...$labelProps, children: $labelProps.children ?? $text }) }) }));
132
+ const { justify, text, labelHeight, labelWidth, alignProps, margin, ...labelProps } = props;
133
+ return (jsxRuntime.jsx("span", { className: "cw-label", children: jsxRuntime.jsx(CwAlign, { ...alignProps, children: jsxRuntime.jsx("label", { style: { textAlign: justify, width: labelWidth, height: labelHeight, margin: margin ?? "1px 0 0 0" }, ...labelProps, children: labelProps.children ?? text }) }) }));
133
134
  }
134
135
 
135
136
  function CwTooltip(CwelltTooltipProps) {
@@ -162,11 +163,12 @@ function CwTag(tagProps) {
162
163
  /**
163
164
  * An icon from fontawesome4. Find them here: [fontawesome.com/v4](https://fontawesome.com/v4/icons/)
164
165
  * @example
165
- * <CwIcon $id="house" />
166
+ * <CwIcon id="house" />
166
167
  */
167
168
  function CwIcon(props) {
169
+ const { iconId, ...iconProps } = props;
168
170
  // if you wrap this inside a div I WILL find you 🔪
169
- return jsxRuntime.jsx("i", { ...props, className: `fa fa-${props.$id}` });
171
+ return jsxRuntime.jsx("i", { ...iconProps, className: `fa fa-${iconId}` });
170
172
  }
171
173
 
172
174
  const CW_DEFAULT_MESSAGE_DURATION = 2000;
@@ -180,27 +182,27 @@ exports.CwMessageType = void 0;
180
182
  const CwMessage = props => {
181
183
  React.useEffect(() => {
182
184
  const timer = setTimeout(() => {
183
- props.$onClose?.();
184
- }, props.$duration ?? CW_DEFAULT_MESSAGE_DURATION);
185
+ props.onClose?.();
186
+ }, props.duration ?? CW_DEFAULT_MESSAGE_DURATION);
185
187
  return () => clearTimeout(timer);
186
188
  }, [props]);
187
- return (jsxRuntime.jsx("div", { className: "cw-message", "data-message-type": Object.keys(exports.CwMessageType).find(key => exports.CwMessageType[key] === props.$type), children: jsxRuntime.jsxs(CwAlign, { "$justifyContent": "center", "$alignItems": "center", children: [props.$type && jsxRuntime.jsx(CwIcon, { "$id": props.$type.toString() }), props.$message] }) }));
189
+ return (jsxRuntime.jsx("div", { className: "cw-message", "data-message-type": Object.keys(exports.CwMessageType).find(key => exports.CwMessageType[key] === props.messageType), children: jsxRuntime.jsxs(CwAlign, { justifyContent: "center", alignItems: "center", children: [props.messageType && jsxRuntime.jsx(CwIcon, { iconId: props.messageType.toString() }), props.message] }) }));
188
190
  };
189
191
  const useCwMessage = () => {
190
192
  const [isVisible, setIsVisible] = React.useState(false);
191
193
  const [message, setMessage] = React.useState("");
192
194
  const [duration, setDuration] = React.useState();
193
195
  const [type, setType] = React.useState();
194
- const showMessage = ($props) => {
195
- setMessage($props.$message);
196
- setDuration($props.$duration);
197
- setType($props.$type);
196
+ const showMessage = (props) => {
197
+ setMessage(props.message);
198
+ setDuration(props.duration);
199
+ setType(props.messageType);
198
200
  setIsVisible(true);
199
201
  };
200
202
  const closeMessage = () => {
201
203
  setIsVisible(false);
202
204
  };
203
- const RenderMessage = isVisible ? (jsxRuntime.jsx(CwMessage, { "$message": message, "$duration": duration, "$type": type, "$onClose": closeMessage })) : null;
205
+ const RenderMessage = isVisible ? (jsxRuntime.jsx(CwMessage, { message: message, duration: duration, messageType: type, onClose: closeMessage })) : null;
204
206
  return { showMessage, RenderMessage };
205
207
  };
206
208
  class CwMessageManager {
@@ -230,7 +232,7 @@ class CwMessageManager {
230
232
  const msg = document.createElement("div");
231
233
  this.messageContainer?.prepend(msg);
232
234
  const msgRoot = client.createRoot(msg); // Create a root for the new message
233
- msgRoot.render(jsxRuntime.jsx(CwMessage, { "$message": message, "$type": type, "$duration": duration, "$onClose": () => this.closeMessage(msgRoot) }));
235
+ msgRoot.render(jsxRuntime.jsx(CwMessage, { message: message, messageType: type, duration: duration, onClose: () => this.closeMessage(msgRoot) }));
234
236
  }
235
237
  closeMessage(msgRoot) {
236
238
  msgRoot.unmount(); // Unmount the message root
@@ -263,14 +265,136 @@ function CwLoadingSmall(CwelltLoadingAppointements) {
263
265
  jsxRuntime.jsx("div", { className: "cwellt_d_none" })) }));
264
266
  }
265
267
 
266
- var styles$6 = {"cw-generic-tooltip":"cw-generic-tooltip-module_cw-generic-tooltip__Ij76M","cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si"};
268
+ var styles$a = {"cw-generic-tooltip":"cw-generic-tooltip-module_cw-generic-tooltip__Ij76M","cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si"};
267
269
 
268
- const CwGenericTooltip = ({ children, content = null, position = "right", dissapearsWhenHover = false, overlayStyle = {}, }) => {
270
+ // Constants moved outside to prevent recreation
271
+ const margin = 16;
272
+ const defaultPosition = "right";
273
+ const positionOrder = ['right', 'bottom', 'left', 'top'];
274
+ // Memoized utility functions to prevent recreation
275
+ const calculatePositionForSide = (position, triggerRect, tooltipRect) => {
276
+ switch (position) {
277
+ case 'left':
278
+ return {
279
+ top: triggerRect.top + (triggerRect.height - tooltipRect.height) / 2,
280
+ left: triggerRect.left - tooltipRect.width - margin
281
+ };
282
+ case 'right':
283
+ return {
284
+ top: triggerRect.top + (triggerRect.height - tooltipRect.height) / 2,
285
+ left: triggerRect.right + margin
286
+ };
287
+ case 'top':
288
+ return {
289
+ top: triggerRect.top - tooltipRect.height - margin,
290
+ left: triggerRect.left + (triggerRect.width - tooltipRect.width) / 2
291
+ };
292
+ case 'bottom':
293
+ return {
294
+ top: triggerRect.bottom + margin,
295
+ left: triggerRect.left + (triggerRect.width - tooltipRect.width) / 2
296
+ };
297
+ }
298
+ };
299
+ // Optimized hooks
300
+ const useTooltipDelay = (callback, delay) => {
301
+ const timeoutRef = React.useRef();
302
+ const clearTooltipTimeout = React.useCallback(() => {
303
+ if (timeoutRef.current) {
304
+ window.clearTimeout(timeoutRef.current);
305
+ timeoutRef.current = undefined;
306
+ }
307
+ }, []);
308
+ const setTooltipTimeout = React.useCallback(() => {
309
+ clearTooltipTimeout();
310
+ if (delay) {
311
+ timeoutRef.current = window.setTimeout(callback, delay);
312
+ }
313
+ else {
314
+ callback();
315
+ }
316
+ }, [callback, delay, clearTooltipTimeout]);
317
+ React.useEffect(() => clearTooltipTimeout, [clearTooltipTimeout]);
318
+ return { setTooltipTimeout, clearTooltipTimeout };
319
+ };
320
+ const useTooltipPosition = (isVisible, containerRef, preferredPosition, tooltipClassName) => {
321
+ const [tooltipState, setTooltipState] = React.useState({
322
+ position: { top: 0, left: 0 },
323
+ actualPosition: preferredPosition
324
+ });
325
+ const frameRef = React.useRef();
326
+ const updatePosition = React.useCallback(() => {
327
+ if (!isVisible || !containerRef.current)
328
+ return;
329
+ const tooltipElement = document.querySelector(`.${tooltipClassName}`);
330
+ if (!tooltipElement)
331
+ return;
332
+ const triggerRect = containerRef.current.getBoundingClientRect();
333
+ const tooltipRect = tooltipElement.getBoundingClientRect();
334
+ // Try preferred position first
335
+ const position = calculatePositionForSide(preferredPosition, triggerRect, tooltipRect);
336
+ const windowWidth = window.innerWidth;
337
+ const windowHeight = window.innerHeight;
338
+ // Quick bounds check
339
+ if (position.left >= margin &&
340
+ position.top >= margin &&
341
+ position.left + tooltipRect.width <= windowWidth - margin &&
342
+ position.top + tooltipRect.height <= windowHeight - margin) {
343
+ setTooltipState({ position, actualPosition: preferredPosition });
344
+ return;
345
+ }
346
+ // Try other positions if preferred doesn't fit
347
+ for (const pos of positionOrder) {
348
+ if (pos === preferredPosition)
349
+ continue;
350
+ const newPosition = calculatePositionForSide(pos, triggerRect, tooltipRect);
351
+ if (newPosition.left >= margin &&
352
+ newPosition.top >= margin &&
353
+ newPosition.left + tooltipRect.width <= windowWidth - margin &&
354
+ newPosition.top + tooltipRect.height <= windowHeight - margin) {
355
+ setTooltipState({ position: newPosition, actualPosition: pos });
356
+ return;
357
+ }
358
+ }
359
+ // Fallback to preferred position if none fit
360
+ setTooltipState({ position, actualPosition: preferredPosition });
361
+ }, [isVisible, preferredPosition, tooltipClassName]);
362
+ React.useEffect(() => {
363
+ frameRef.current = requestAnimationFrame(updatePosition);
364
+ return () => {
365
+ if (frameRef.current) {
366
+ cancelAnimationFrame(frameRef.current);
367
+ }
368
+ };
369
+ }, [updatePosition]);
370
+ return tooltipState;
371
+ };
372
+ // Main component with optimizations
373
+ const CwGenericTooltip = ({ children, content = null, position = defaultPosition, dissapearsWhenHover = false, overlayStyle = {}, showDelay = 0, }) => {
269
374
  const [isVisible, setIsVisible] = React.useState(false);
270
- return (jsxRuntime.jsxs("div", { className: styles$6["cw-generic-tooltip"], onMouseEnter: () => setIsVisible(true), onMouseLeave: () => setIsVisible(false), style: overlayStyle, children: [isVisible && content && (jsxRuntime.jsx("div", { className: styles$6["cw-generic-tooltip-content"], "data-position": position, onMouseEnter: () => {
271
- if (dissapearsWhenHover)
272
- setIsVisible(false);
273
- }, children: content })), children] }));
375
+ const containerRef = React.useRef(null);
376
+ const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => setIsVisible(true), showDelay);
377
+ const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$a["cw-generic-tooltip-content"]);
378
+ // Memoize tooltip content creation
379
+ const tooltipContent = React.useMemo(() => {
380
+ if (!isVisible || !content)
381
+ return null;
382
+ return reactDom.createPortal(jsxRuntime.jsx("div", { className: styles$a["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, style: {
383
+ position: 'fixed',
384
+ top: `${tooltipPosition.top}px`,
385
+ left: `${tooltipPosition.left}px`,
386
+ visibility: tooltipPosition.top === 0 && tooltipPosition.left === 0 ? 'hidden' : 'visible',
387
+ ...overlayStyle
388
+ }, onMouseEnter: () => dissapearsWhenHover && setIsVisible(false), children: content }), document.body);
389
+ }, [isVisible, content, actualPosition, tooltipPosition, dissapearsWhenHover, overlayStyle]);
390
+ const handleMouseEnter = React.useCallback(() => {
391
+ setTooltipTimeout();
392
+ }, [setTooltipTimeout]);
393
+ const handleMouseLeave = React.useCallback(() => {
394
+ clearTooltipTimeout();
395
+ setIsVisible(false);
396
+ }, [clearTooltipTimeout]);
397
+ return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$a["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, children: [tooltipContent, children] }));
274
398
  };
275
399
 
276
400
  // Reference for draggable modal
@@ -389,11 +513,11 @@ class CwModalIframe extends React__namespace.Component {
389
513
  }
390
514
  }
391
515
 
392
- var styles$5 = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8","cw-dialog-button-save":"cw-dialog-module_cw-dialog-button-save__eZ9SI"};
516
+ var styles$9 = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8","cw-dialog-button-save":"cw-dialog-module_cw-dialog-button-save__eZ9SI"};
393
517
 
394
518
  const CwDialog = props => {
395
519
  const dialogRef = React.useRef(null);
396
- const initialDialogSize = { width: props.$size?.width ?? 800, height: props.$size?.height ?? 600 };
520
+ const initialDialogSize = { width: props.dialogSize?.width ?? 800, height: props.dialogSize?.height ?? 600 };
397
521
  const [isDragging, setIsDragging] = React.useState(false);
398
522
  const [resizeDirection, setResizeDirection] = React.useState(null);
399
523
  const [position, setPosition] = React.useState({
@@ -475,9 +599,9 @@ const CwDialog = props => {
475
599
  e.stopPropagation();
476
600
  setResizeDirection(direction);
477
601
  };
478
- const header = (jsxRuntime.jsxs("header", { onMouseDown: handleMouseDown, children: [jsxRuntime.jsx("span", { children: props.$headline }), props.$customHeader || (jsxRuntime.jsx("button", { className: styles$5["cw-dialog-button-close"], onClick: props.$onClose, children: "\u2A2F" }))] }));
602
+ const header = (jsxRuntime.jsxs("header", { onMouseDown: handleMouseDown, children: [jsxRuntime.jsx("span", { children: props.headline }), props.customHeader || (jsxRuntime.jsx("button", { className: styles$9["cw-dialog-button-close"], onClick: props.onClose, children: "\u2A2F" }))] }));
479
603
  const content = (jsxRuntime.jsx("section", { style: { flex: 1, overflowX: "auto", overflowY: "auto", width: "100%" }, children: props.children }));
480
- const footer = (jsxRuntime.jsx("footer", { style: { width: "100%" }, children: props.$customFooter || (jsxRuntime.jsx("button", { className: styles$5["cw-dialog-button-save"], onClick: props.$onSave, children: "\uD83D\uDDAB" })) }));
604
+ const footer = (jsxRuntime.jsx("footer", { style: { width: "100%" }, children: props.customFooter || (jsxRuntime.jsx("button", { className: styles$9["cw-dialog-button-save"], onClick: props.onSave, children: "\uD83D\uDDAB" })) }));
481
605
  const resizeHandles = [
482
606
  jsxRuntime.jsx("div", { "data-handle-n": true, onMouseDown: handleResizeMouseDown("n") }, "handle-n"),
483
607
  jsxRuntime.jsx("div", { "data-handle-s": true, onMouseDown: handleResizeMouseDown("s") }, "handle-s"),
@@ -488,12 +612,12 @@ const CwDialog = props => {
488
612
  jsxRuntime.jsx("div", { "data-handle-se": true, onMouseDown: handleResizeMouseDown("se") }, "handle-se"),
489
613
  jsxRuntime.jsx("div", { "data-handle-sw": true, onMouseDown: handleResizeMouseDown("sw") }, "handle-sw")
490
614
  ];
491
- return (props.open && (jsxRuntime.jsx("div", { "data-has-scrim": props.$scrim, className: styles$5["cw-dialog-main"], children: jsxRuntime.jsxs("dialog", { ...props, ref: dialogRef, style: {
615
+ return (props.open && (jsxRuntime.jsx("div", { "data-has-scrim": props.scrim, className: styles$9["cw-dialog-main"], children: jsxRuntime.jsxs("dialog", { ...props, ref: dialogRef, style: {
492
616
  left: `${position.x}px`,
493
617
  top: `${position.y}px`,
494
618
  width: `${size.width}px`,
495
619
  height: `${size.height}px`,
496
- zIndex: props.$zIndex,
620
+ zIndex: props.zIndex,
497
621
  minWidth: "200px", // Set an appropriate minimum size
498
622
  minHeight: "200px", // Set an appropriate minimum size
499
623
  display: "flex",
@@ -519,7 +643,7 @@ const CwModalReportFunctional = (props) => {
519
643
  return (jsxRuntime.jsxs("div", { children: ["Please add a(n) ", props.reportName, " report in ", props.moduleSettings, " Settings"] }));
520
644
  }
521
645
  };
522
- return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: isModal ? (jsxRuntime.jsx(CwDialog, { open: props.visible, "$size": { width: props.width, height: props.height }, "$headline": props.title, "$customFooter": [jsxRuntime.jsx("div", {}, "footer")], "$onClose": props.onCloseModal, isReport: true, children: renderContentModal() })) : (jsxRuntime.jsx("div", { children: renderContentNotModal() })) }));
646
+ return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: isModal ? (jsxRuntime.jsx(CwDialog, { open: props.visible, dialogSize: { width: props.width, height: props.height }, headline: props.title, customFooter: [jsxRuntime.jsx("div", {}, "footer")], onClose: props.onCloseModal, isReport: true, children: renderContentModal() })) : (jsxRuntime.jsx("div", { children: renderContentNotModal() })) }));
523
647
  };
524
648
 
525
649
  class CwReportModal extends React__namespace.Component {
@@ -539,7 +663,7 @@ class CwReportModal extends React__namespace.Component {
539
663
  };
540
664
  }
541
665
  render() {
542
- return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: this.state.isModal === true ? (jsxRuntime.jsxs(CwDialog, { open: this.props.visible, "$size": { width: this.props.width, height: this.props.height }, "$headline": this.props.title, "$customFooter": new Array(jsxRuntime.jsx("div", {})), "$onClose": () => {
666
+ return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: this.state.isModal === true ? (jsxRuntime.jsxs(CwDialog, { open: this.props.visible, dialogSize: { width: this.props.width, height: this.props.height }, headline: this.props.title, customFooter: new Array(jsxRuntime.jsx("div", {})), onClose: () => {
543
667
  this.formRef?.current?.resetFields();
544
668
  this.props.SET_MODAL_REPORT_VISIBLE(false);
545
669
  }, isReport: true, children: [this.props.name !== "Empty.pdf" && (jsxRuntime.jsx("div", { style: { width: "100%", height: "100%", overflowX: "auto", overflowY: "auto" }, children: jsxRuntime.jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", style: { width: "100%", height: "100%", display: "block" } }) })), this.props.name === "Empty.pdf" && (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("h1", { style: { marginLeft: "2em" }, children: [" ", "Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }) }))] })) : (jsxRuntime.jsxs("div", { children: [this.props.name !== "Empty.pdf" && (jsxRuntime.jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", width: "100%", height: "600px" })), this.props.name === "Empty.pdf" && (jsxRuntime.jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
@@ -549,14 +673,14 @@ class CwReportModal extends React__namespace.Component {
549
673
  /**
550
674
  * A modal that appears when an element is hovered
551
675
  * @param children Contents of the modal
552
- * @param $hovereable Element to hover to display the modal
553
- * @param $onFirstOpened Function to run only once when the modal opens for the first time
676
+ * @param hovereable Element to hover to display the modal
677
+ * @param onFirstOpened Function to run only once when the modal opens for the first time
554
678
  * @example
555
- * <CwModalHover $hovereable={<span>Hover me!</span>}>
679
+ * <CwModalHover hovereable={<span>Hover me!</span>}>
556
680
  * <p>Hello there</p>
557
681
  * </CwModalHover>
558
682
  */
559
- const CwModalHover = ({ children, $hovereable, $onFirstOpened, ...dialogProps }) => {
683
+ const CwModalHover = ({ children, hovereable, onFirstOpened, ...dialogProps }) => {
560
684
  // Do not turn these into useState, it will break it.
561
685
  const mouseDialogState = { isInsideDialog: false };
562
686
  const mouseHoverState = { isInsideHover: false };
@@ -592,7 +716,7 @@ const CwModalHover = ({ children, $hovereable, $onFirstOpened, ...dialogProps })
592
716
  };
593
717
  }
594
718
  }, [hoverRef]);
595
- return (jsxRuntime.jsxs("div", { ref: hoverRef, className: "cw-modal-hover", children: [jsxRuntime.jsx("div", { "data-hovereable-icon": true, children: $hovereable }), jsxRuntime.jsx("dialog", { ...dialogProps, ref: dialogRef, onMouseEnter: () => {
719
+ return (jsxRuntime.jsxs("div", { ref: hoverRef, className: "cw-modal-hover", children: [jsxRuntime.jsx("div", { "data-hovereable-icon": true, children: hovereable }), jsxRuntime.jsx("dialog", { ...dialogProps, ref: dialogRef, onMouseEnter: () => {
596
720
  mouseDialogState.isInsideDialog = true;
597
721
  tryOpeningDialog();
598
722
  }, onMouseLeave: () => {
@@ -823,7 +947,7 @@ function CwTable({ columns, data, pagination, itemsPerPage, expandedRowRender, o
823
947
  return (jsxRuntime.jsxs("div", { id: id, className: classNameContainer + " " + "cwTableComp", children: [jsxRuntime.jsxs("table", { className: className + " " + "cw_table", style: style, children: [jsxRuntime.jsx("thead", { className: `${classNameHeader} cw_thead`, children: jsxRuntime.jsxs("tr", { className: "cw_thead_tr", children: [expandedRowRender && jsxRuntime.jsx("th", { className: "cw_thead_th cw_thead_th_expand" }), columns.map(column => (jsxRuntime.jsx("th", { onClick: () => handleSort(column.dataIndex), className: `cw_thead_th ${column.className} ${sortConfig.key === column.dataIndex ? sortConfig.direction : ""}`, children: column.title }, column.key)))] }) }), jsxRuntime.jsx("tbody", { className: "cw_tbody", children: !paginatedData || paginatedData.length === 0 ? (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: columns.length + (expandedRowRender ? 1 : 0), style: { textAlign: "center" }, children: textNoData !== undefined && textNoData !== "" ? textNoData : "No data" }) })) : (paginatedData.map(item => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("tr", { className: `${classNameTr_row} cw_tbody_tr`, children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw_tbody_td", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cwellt_flex cwellt_justify_center cwellt_align_items_center cw_button_expanded_collapse ${expandedRowKey === item.key ? "cw_button_expanded" : "cw_button_collapse"}` }) })), columns.map(column => (jsxRuntime.jsx("td", { className: "cw_tbody_td", children: column.render ? column.render(item) : item[column.dataIndex] }, `${item.key}_${column.key}`)))] }), expandedRowKey === item.key && expandedRowRender && (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: columns.length + 1, children: expandedRowRender(item) }) }))] }, item.key)))) })] }), pagination && totalPages > 1 && (jsxRuntime.jsxs("div", { className: "cw_table_pagination cwellt_flex cwellt_align-items-start cwellt_align_items_center", children: [jsxRuntime.jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1, className: "cw_tb_button_pag cw_tb_button_prev cwellt_flex cwellt_justify_center cwellt_align_items_center" }), jsxRuntime.jsxs("span", { className: "cw_table_pag_desc", children: ["Page ", currentPage, " of ", totalPages] }), jsxRuntime.jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages, className: "cw_tb_button_pag cw_tb_button_next cwellt_flex cwellt_justify_center cwellt_align_items_center" })] }))] }));
824
948
  }
825
949
 
826
- var styles$4 = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
950
+ var styles$8 = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
827
951
 
828
952
  const TabIcon = ({ icon }) => {
829
953
  if (!icon)
@@ -863,31 +987,31 @@ function CwTabs(CwTabsProps) {
863
987
  }
864
988
  };
865
989
  const position = CwTabsProps.tabsPosition || 'top';
866
- return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, className: styles$4['cw-tabs'], "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { children: CwTabsProps.tabs.map(tab => (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$4['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
990
+ return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, className: styles$8['cw-tabs'], "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { children: CwTabsProps.tabs.map(tab => (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$8['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
867
991
  }
868
992
 
869
993
  /**
870
994
  * An expandable element with briefing and children displayed when clicked
871
- * @param $briefing Title of the expandable
872
- * @param $onToggle Function to run when expandable is toggled open/closed
873
- * @param $onClose Function to run when expandable is closed
874
- * @param $onOpen Function to run when expandable is opened
995
+ * @param briefing Title of the expandable
996
+ * @param onToggle Function to run when expandable is toggled open/closed
997
+ * @param onClose Function to run when expandable is closed
998
+ * @param onOpen Function to run when expandable is opened
875
999
  * @example
876
- * <CwExpandable $briefing="Title here">Contents here</CwExpandable>
1000
+ * <CwExpandable briefing="Title here">Contents here</CwExpandable>
877
1001
  */
878
- const CwExpandable = ({ $briefing, $onToggle, $onOpen, $onClose, children, ...detailsProps }) => {
1002
+ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detailsProps }) => {
879
1003
  const myRef = React.useRef(null);
880
1004
  React.useEffect(() => {
881
1005
  myRef.current?.addEventListener("click", ev => {
882
1006
  const isOpen = ev.currentTarget.open;
883
- $onToggle?.(!isOpen);
1007
+ onToggle?.(!isOpen);
884
1008
  if (!isOpen)
885
- $onOpen?.(ev);
1009
+ onOpen?.(ev);
886
1010
  else
887
- $onClose?.(ev);
1011
+ onClose?.(ev);
888
1012
  });
889
- }, [$onClose, $onOpen, $onToggle]);
890
- return (jsxRuntime.jsx("div", { className: "cw-expandable", children: jsxRuntime.jsxs("details", { ref: myRef, ...detailsProps, children: [jsxRuntime.jsx("summary", { children: $briefing }), children && jsxRuntime.jsx("section", { children: children })] }) }));
1013
+ }, [onClose, onOpen, onToggle]);
1014
+ return (jsxRuntime.jsx("div", { className: "cw-expandable", children: jsxRuntime.jsxs("details", { ref: myRef, ...detailsProps, children: [jsxRuntime.jsx("summary", { children: briefing }), children && jsxRuntime.jsx("section", { children: children })] }) }));
891
1015
  };
892
1016
 
893
1017
  /**
@@ -985,12 +1109,6 @@ function CwFileUpload(fileUploadProps) {
985
1109
  if (typeof reader.result === "string") {
986
1110
  const hexContent = arrayBufferToHex(reader.result);
987
1111
  setCurrentHexContent(hexContent);
988
- debugger;
989
- // fileUploadProps.onChange({
990
- // ...file,
991
- // Value:
992
- // Bindata: hexContent // Replace Bindata with the new hexadecimal content
993
- // });
994
1112
  setPreviewURL(reader.result);
995
1113
  setCurrentHexContent(arrayBufferToHex(reader.result));
996
1114
  // Llama a la función para guardar el contenido hexadecimal
@@ -1031,8 +1149,8 @@ function CwInput(CwInputProps) {
1031
1149
  }
1032
1150
 
1033
1151
  function CwButton(props) {
1034
- const { $text, ...buttonProps } = props;
1035
- return (jsxRuntime.jsx("button", { type: "button", className: "cw-button", ...buttonProps, children: buttonProps.children ?? $text }));
1152
+ const { text, ...buttonProps } = props;
1153
+ return (jsxRuntime.jsx("button", { type: "button", className: "cw-button", ...buttonProps, children: buttonProps.children ?? text }));
1036
1154
  }
1037
1155
 
1038
1156
  /**
@@ -1048,15 +1166,15 @@ function CwButton(props) {
1048
1166
  * @example
1049
1167
  * ```tsx
1050
1168
  * <CwDigit
1051
- * $iconProps={{ $id: "home" }}
1052
- * $labelProps={{ children: "Name", width: "100px" }}
1053
- * $buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
1169
+ * iconProps={{ id: "home" }}
1170
+ * labelProps={{ children: "Name", width: "100px" }}
1171
+ * buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
1054
1172
  * />
1055
1173
  * ```
1056
1174
  */
1057
1175
  function CwDigit(props) {
1058
- const { $alignProps, $buttonProps, $iconProps, $labelProps, ...$inputProps } = props;
1059
- return (jsxRuntime.jsx("div", { className: "cw-input-text", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: $inputProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { type: "number", ...$inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1176
+ const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
1177
+ return (jsxRuntime.jsx("div", { className: "cw-input-text", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "number", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1060
1178
  }
1061
1179
 
1062
1180
  /**
@@ -1072,15 +1190,15 @@ function CwDigit(props) {
1072
1190
  * @example
1073
1191
  * ```tsx
1074
1192
  * <CwInputText
1075
- * $iconProps={{ $id: "home" }}
1076
- * $labelProps={{ children: "Name", width: "100px" }}
1077
- * $buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
1193
+ * iconProps={{ id: "home" }}
1194
+ * labelProps={{ children: "Name", width: "100px" }}
1195
+ * buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
1078
1196
  * />
1079
1197
  * ```
1080
1198
  */
1081
1199
  function CwInputText(props) {
1082
- const { $alignProps, $buttonProps, $iconProps, $labelProps, ...inputProps } = props;
1083
- return (jsxRuntime.jsx("div", { className: "cw-input-text", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: inputProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { type: props.type ?? "text", ...inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1200
+ const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
1201
+ return (jsxRuntime.jsx("div", { className: "cw-input-text", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: props.type ?? "text", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1084
1202
  }
1085
1203
 
1086
1204
  /**
@@ -1095,12 +1213,12 @@ function CwInputText(props) {
1095
1213
  * ```
1096
1214
  * @example
1097
1215
  * ```tsx
1098
- * <CwInputPhone $iconProps={{_id:"phone"}} $labelProps={{children:"Phone"}} />
1216
+ * <CwInputPhone iconProps={{iconId:"phone"}} labelProps={{children:"Phone"}} />
1099
1217
  * ```
1100
1218
  */
1101
1219
  function CwInputPhone(props) {
1102
- const { $alignProps, $buttonProps, $iconProps, $labelProps, ...inputProps } = props;
1103
- return (jsxRuntime.jsx("div", { className: "cw-input-phone", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: inputProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { type: "tel", placeholder: "+## ### ### ###", pattern: "[+0-9 ]*", maxLength: 16, ...inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1220
+ const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
1221
+ return (jsxRuntime.jsx("div", { className: "cw-input-phone", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "tel", placeholder: "+## ### ### ###", pattern: "[+0-9 ]*", maxLength: 16, ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1104
1222
  }
1105
1223
 
1106
1224
  function CwInputNumber(CwInputNumberProps) {
@@ -1117,8 +1235,8 @@ function CwInputNumber(CwInputNumberProps) {
1117
1235
  }
1118
1236
 
1119
1237
  function CwTextArea(props) {
1120
- const { $alignProps, $buttonProps, $iconProps, $labelProps, $resize, ...textareaProps } = props;
1121
- return (jsxRuntime.jsx("div", { className: "cw-text-area", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { ...textareaProps.style, resize: $resize } }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1238
+ const { alignProps, buttonProps, iconProps, labelProps, resize, ...textareaProps } = props;
1239
+ return (jsxRuntime.jsx("div", { className: "cw-text-area", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { ...textareaProps.style, resize: resize } }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1122
1240
  }
1123
1241
 
1124
1242
  /**
@@ -1134,16 +1252,16 @@ function CwTextArea(props) {
1134
1252
  * @example
1135
1253
  * ```tsx
1136
1254
  * <CwInputDate
1137
- * $iconProps={{ $id: "Birthdate" }}
1138
- * $labelProps={{ children: "Name", width: "100px" }}
1139
- * $buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1255
+ * iconProps={{ iconId: "Birthdate" }}
1256
+ * labelProps={{ children: "Name", width: "100px" }}
1257
+ * buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1140
1258
  * />
1141
1259
  * ```
1142
1260
  */
1143
1261
  function CwInputDate(props) {
1144
- const { $alignProps, $buttonProps, $iconProps, $labelProps, ...$inputProps } = props;
1145
- $inputProps.max = $inputProps.max ?? "9999-01-01";
1146
- return (jsxRuntime.jsx("div", { className: "cw-input-date", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: $inputProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { type: "date", ...$inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1262
+ const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
1263
+ inputProps.max = inputProps.max ?? "9999-01-01";
1264
+ return (jsxRuntime.jsx("div", { className: "cw-input-date", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "date", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1147
1265
  }
1148
1266
 
1149
1267
  var classes = {"datePicker":"cw-input-date-picker-module_datePicker__jogOq","input":"cw-input-date-picker-module_input__uQshH","calendar":"cw-input-date-picker-module_calendar__q39ic","calendarHeader":"cw-input-date-picker-module_calendarHeader__1btPK","arrowButton":"cw-input-date-picker-module_arrowButton__23tNc","calendarTitle":"cw-input-date-picker-module_calendarTitle__oOODw","calendarBody":"cw-input-date-picker-module_calendarBody__-711a","calendarDay":"cw-input-date-picker-module_calendarDay__z-Mmv","selected":"cw-input-date-picker-module_selected__XQgR7","todayButton":"cw-input-date-picker-module_todayButton__oYamC","emptyDay":"cw-input-date-picker-module_emptyDay__lbI5B"};
@@ -1267,16 +1385,16 @@ const CwInputDatePicker = ({ value, onChange }) => {
1267
1385
  * @example
1268
1386
  * ```tsx
1269
1387
  * <CwInputDate
1270
- * $iconProps={{ $id: "Birthdate" }}
1271
- * $labelProps={{ children: "Name", width: "100px" }}
1272
- * $buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1388
+ * iconProps={{ id: "Birthdate" }}
1389
+ * labelProps={{ children: "Name", width: "100px" }}
1390
+ * buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1273
1391
  * />
1274
1392
  * ```
1275
1393
  */
1276
1394
  function CwInputDatetime(props) {
1277
- const { $alignProps, $buttonProps, $iconProps, $labelProps, ...inputProps } = props;
1395
+ const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
1278
1396
  inputProps.max = inputProps.max ?? "9999-01-01";
1279
- return (jsxRuntime.jsx("div", { className: "cw-input-date", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: inputProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { type: "datetime-local", ...inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1397
+ return (jsxRuntime.jsx("div", { className: "cw-input-date", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "datetime-local", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1280
1398
  }
1281
1399
 
1282
1400
  /**
@@ -1292,16 +1410,16 @@ function CwInputDatetime(props) {
1292
1410
  * @example
1293
1411
  * ```tsx
1294
1412
  * <CwTime
1295
- * $iconProps={{ $id: "Birthdate" }}
1296
- * $labelProps={{ children: "Name", width: "100px" }}
1297
- * $buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1413
+ * iconProps={{ iconId: "Birthdate" }}
1414
+ * labelProps={{ children: "Name", width: "100px" }}
1415
+ * buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1298
1416
  * />
1299
1417
  * ```
1300
1418
  */
1301
1419
  function CwTime(props) {
1302
- const { $alignProps, $buttonProps, $iconProps, $labelProps, ...inputProps } = props;
1420
+ const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
1303
1421
  inputProps.max = inputProps.max ?? "9999-01-01";
1304
- return (jsxRuntime.jsx("div", { className: "cw-input-date", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: inputProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { type: "time", ...inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1422
+ return (jsxRuntime.jsx("div", { className: "cw-input-date", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "time", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1305
1423
  }
1306
1424
 
1307
1425
  /**
@@ -1320,17 +1438,17 @@ function CwTime(props) {
1320
1438
  * @example
1321
1439
  * ```tsx
1322
1440
  * <CwInputDateText
1323
- * $iconProps={{ $id: "Birthdate" }}
1324
- * $labelProps={{ children: "Name", width: "100px" }}
1325
- * $buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1441
+ * iconProps={{ id: "Birthdate" }}
1442
+ * labelProps={{ children: "Name", width: "100px" }}
1443
+ * buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
1326
1444
  * />
1327
1445
  * ```
1328
1446
  */
1329
1447
  function CwInputDateText(props) {
1330
1448
  const displayFormat = "DD.MM.YYYY";
1331
1449
  const internalFormat = "YYYY-MM-DD";
1332
- const { $alignProps, $buttonProps, $iconProps, $labelProps, $format, value, size, onChange, name, required, tabIndex, disabled, readOnly, ...inputProps } = props;
1333
- const format = $format ?? displayFormat;
1450
+ const { alignProps, buttonProps, iconProps, labelProps, dateFormat, value, size, onChange, name, required, tabIndex, disabled, readOnly, ...inputProps } = props;
1451
+ const format = dateFormat ?? displayFormat;
1334
1452
  const width = size ?? 12;
1335
1453
  const formattedDate = (date, inFormat, outFormat) => {
1336
1454
  if (moment(date, inFormat, true).isValid()) {
@@ -1385,15 +1503,15 @@ function CwInputDateText(props) {
1385
1503
  onChange?.({ target: { value: date, name: name } });
1386
1504
  }
1387
1505
  }, [date]);
1388
- return (jsxRuntime.jsx("div", { className: "cw-input-date-text", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: required ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("input", { type: "text", disabled: disabled, maxLength: 10, onChange: onChangeInputText, pattern: "^$ --|[.0-9\\/\\-]{10}", placeholder: format.toLowerCase(), readOnly: readOnly, ref: textInputRef, required: required, size: width, tabIndex: tabIndex, value: displayedDate }), jsxRuntime.jsxs("span", { children: [jsxRuntime.jsx(CwIcon, { "$id": "calendar" }), jsxRuntime.jsx("input", { type: "date", disabled: disabled, onChange: onChangeInputDate, readOnly: readOnly, ref: dateInputRef, tabIndex: -1, value: date, ...inputProps })] })] }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1506
+ return (jsxRuntime.jsx("div", { className: "cw-input-date-text", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("input", { type: "text", disabled: disabled, maxLength: 10, onChange: onChangeInputText, pattern: "^$ --|[.0-9\\/\\-]{10}", placeholder: format.toLowerCase(), readOnly: readOnly, ref: textInputRef, required: required, size: width, tabIndex: tabIndex, value: displayedDate }), jsxRuntime.jsxs("span", { children: [jsxRuntime.jsx(CwIcon, { iconId: "calendar" }), jsxRuntime.jsx("input", { type: "date", disabled: disabled, onChange: onChangeInputDate, readOnly: readOnly, ref: dateInputRef, tabIndex: -1, value: date, ...inputProps })] })] }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1389
1507
  }
1390
1508
 
1391
1509
  function CwInputImage(props) {
1392
1510
  const [_uploadedImage, setUploadedImage] = React.useState(null);
1393
1511
  const inputRef = React.useRef(null);
1394
- const { $allowedImageFormats, onChange, ...inputProps } = props;
1395
- const allowedImageFormats = $allowedImageFormats || ["image/jpeg", "image/png", "image/gif"];
1396
- const isValidFileType = (type) => allowedImageFormats.includes(type);
1512
+ const { allowedImageFormats, onChange, ...inputProps } = props;
1513
+ const allowedFormats = allowedImageFormats || ["image/jpeg", "image/png", "image/gif"];
1514
+ const isValidFileType = (type) => allowedFormats.includes(type);
1397
1515
  const handleFile = (file) => {
1398
1516
  if (file && isValidFileType(file.type)) {
1399
1517
  const imgURL = URL.createObjectURL(file);
@@ -1434,7 +1552,7 @@ function CwInputImage(props) {
1434
1552
  const file = e.target.files?.[0];
1435
1553
  handleFile(file ?? null);
1436
1554
  };
1437
- return (jsxRuntime.jsxs("div", { className: "cw-input-image", children: [jsxRuntime.jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [jsxRuntime.jsx("p", { children: "Drop image here" }), jsxRuntime.jsxs("small", { children: ["(", allowedImageFormats.join(", ").replace(/image\//g, ""), ")"] })] }), jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [jsxRuntime.jsx(CwIcon, { "$id": "clipboard" }), "\u2002Paste"] }), jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [jsxRuntime.jsx(CwIcon, { "$id": "folder" }), "\u2002Browse"] })] }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", accept: allowedImageFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
1555
+ return (jsxRuntime.jsxs("div", { className: "cw-input-image", children: [jsxRuntime.jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [jsxRuntime.jsx("p", { children: "Drop image here" }), jsxRuntime.jsxs("small", { children: ["(", allowedFormats.join(", ").replace(/image\//g, ""), ")"] })] }), jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [jsxRuntime.jsx(CwIcon, { iconId: "clipboard" }), "\u2002Paste"] }), jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [jsxRuntime.jsx(CwIcon, { iconId: "folder" }), "\u2002Browse"] })] }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
1438
1556
  }
1439
1557
 
1440
1558
  /**
@@ -1466,18 +1584,18 @@ function CwInputImage(props) {
1466
1584
  * <CwImageArea src="path/to/image.png" _onSelectionSuccess={img => setImage(img)} />
1467
1585
  */
1468
1586
  const CwImageArea = React.forwardRef((props, ref) => {
1469
- const { $alignProps, $initialSelectionArea, $onSelectionEnd, $onSelectionStart, $onSelectionSuccess, $selectionAreaAttenuation, $selectionAreaStyle, ...imgProps } = props;
1587
+ const { alignProps: alignProps, initialSelectionArea: initialSelectionArea, onSelectionEnd, onSelectionStart, onSelectionSuccess, selectionAreaAttenuation: selectionAreaAttenuation, selectionAreaStyle: selectionAreaStyle, ...imgProps } = props;
1470
1588
  // Default no-op functions for selection callbacks
1471
- const onSelectionStart = $onSelectionStart || (() => true);
1472
- const onSelectionEnd = $onSelectionEnd || (() => true);
1473
- const onSelectionSuccess = $onSelectionSuccess || (() => { });
1589
+ const onSelectionStartHandler = onSelectionStart || (() => true);
1590
+ const onSelectionEndHandler = onSelectionEnd || (() => true);
1591
+ const onSelectionSuccessHandler = onSelectionSuccess || (() => { });
1474
1592
  // Ref to the image element and state management hooks
1475
1593
  const imageRef = React.useRef(null);
1476
1594
  const [selectedImage, setSelectedImage] = React.useState();
1477
- const [opacity, setOpacity] = React.useState($selectionAreaAttenuation ?? $selectionAreaStyle?.opacity ?? "1.0");
1595
+ const [opacity, setOpacity] = React.useState(selectionAreaAttenuation ?? selectionAreaStyle?.opacity ?? "1.0");
1478
1596
  // Track drag start position and selected area
1479
1597
  const [dragStart, setDragStart] = React.useState(null);
1480
- const [selectedArea, setSelectedArea] = React.useState($initialSelectionArea ?? null);
1598
+ const [selectedArea, setSelectedArea] = React.useState(initialSelectionArea ?? null);
1481
1599
  // Expose component methods using ref
1482
1600
  React.useImperativeHandle(ref, () => ({
1483
1601
  getSelectedImage: () => selectedImage
@@ -1488,13 +1606,13 @@ const CwImageArea = React.forwardRef((props, ref) => {
1488
1606
  if (rect) {
1489
1607
  const x = event.clientX - rect.left;
1490
1608
  const y = event.clientY - rect.top;
1491
- if (onSelectionStart(x, y)) {
1609
+ if (onSelectionStartHandler(x, y)) {
1492
1610
  setDragStart({ x, y });
1493
1611
  }
1494
1612
  setSelectedArea(null);
1495
- setOpacity($selectionAreaStyle?.opacity ?? 1);
1613
+ setOpacity(selectionAreaStyle?.opacity ?? 1);
1496
1614
  }
1497
- }, [onSelectionStart]);
1615
+ }, [onSelectionStartHandler]);
1498
1616
  // Update selection area as mouse moves
1499
1617
  const onMouseMove = React.useCallback((event) => {
1500
1618
  if (dragStart && imageRef.current) {
@@ -1514,12 +1632,12 @@ const CwImageArea = React.forwardRef((props, ref) => {
1514
1632
  const scaleX = imageRef.current.naturalWidth / rect.width;
1515
1633
  const scaleY = imageRef.current.naturalHeight / rect.height;
1516
1634
  const scaledArea = new DOMRect(selectedArea.x * scaleX, selectedArea.y * scaleY, selectedArea.width * scaleX, selectedArea.height * scaleY);
1517
- if (onSelectionEnd(scaledArea))
1635
+ if (onSelectionEndHandler(scaledArea))
1518
1636
  createSelectedImage(scaledArea);
1519
- setOpacity($selectionAreaAttenuation ?? $selectionAreaStyle?.opacity ?? 1);
1637
+ setOpacity(selectionAreaAttenuation ?? selectionAreaStyle?.opacity ?? 1);
1520
1638
  setDragStart(null);
1521
1639
  }
1522
- }, [selectedArea, $onSelectionEnd]);
1640
+ }, [selectedArea, onSelectionEndHandler]);
1523
1641
  // Create an image from the selected area
1524
1642
  const createSelectedImage = React.useCallback((scaledArea) => {
1525
1643
  const canvas = document.createElement("canvas");
@@ -1530,12 +1648,12 @@ const CwImageArea = React.forwardRef((props, ref) => {
1530
1648
  ctx.drawImage(imageRef.current, scaledArea.x, scaledArea.y, scaledArea.width, scaledArea.height, 0, 0, canvas.width, canvas.height);
1531
1649
  const selectedImageURL = canvas.toDataURL("image/png");
1532
1650
  setSelectedImage(selectedImageURL);
1533
- onSelectionSuccess(selectedImageURL);
1651
+ onSelectionSuccessHandler(selectedImageURL);
1534
1652
  }
1535
- }, [onSelectionSuccess]);
1653
+ }, [onSelectionSuccessHandler]);
1536
1654
  // Render the component UI
1537
- return (jsxRuntime.jsx("div", { className: "cw-image-area", children: jsxRuntime.jsxs(CwAlign, { "$position": "relative", ...$alignProps, children: [jsxRuntime.jsx("img", { ref: imageRef, onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onMouseUp, onDragStart: e => e.preventDefault(), ...imgProps }), selectedArea && (jsxRuntime.jsx("section", { style: {
1538
- ...$selectionAreaStyle,
1655
+ return (jsxRuntime.jsx("div", { className: "cw-image-area", children: jsxRuntime.jsxs(CwAlign, { position: "relative", ...alignProps, children: [jsxRuntime.jsx("img", { ref: imageRef, onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onMouseUp, onDragStart: e => e.preventDefault(), ...imgProps }), selectedArea && (jsxRuntime.jsx("section", { style: {
1656
+ ...selectionAreaStyle,
1539
1657
  height: `${selectedArea.height}px`,
1540
1658
  left: `${selectedArea.x}px`,
1541
1659
  opacity: opacity,
@@ -1548,7 +1666,7 @@ const CwImageArea = React.forwardRef((props, ref) => {
1548
1666
  });
1549
1667
  CwImageArea.displayName = "CwImageArea";
1550
1668
 
1551
- var styles$3 = {"cw-weekday-selector":"cw-weekday-selector-module_cw-weekday-selector__Iz4GZ"};
1669
+ var styles$7 = {"cw-weekday-selector":"cw-weekday-selector-module_cw-weekday-selector__Iz4GZ"};
1552
1670
 
1553
1671
  /**
1554
1672
  * This class represents a week where days can be selected or unselected
@@ -1688,7 +1806,7 @@ const CwWeekdaySelector = ({ value = "", onChange, disabled = false }) => {
1688
1806
  setSelectedDays(newWeekdays);
1689
1807
  onChange?.(newWeekdays.toString());
1690
1808
  };
1691
- return (jsxRuntime.jsx("div", { className: styles$3["cw-weekday-selector"], children: Weekdays.getFullWeek().map(day => (jsxRuntime.jsx("input", { type: "checkbox", "data-day": day, checked: selectedDays.toArray().includes(day), onChange: (e) => handleChange(day, e.target.checked), disabled: disabled }, day))) }));
1809
+ return (jsxRuntime.jsx("div", { className: styles$7["cw-weekday-selector"], children: Weekdays.getFullWeek().map(day => (jsxRuntime.jsx("input", { type: "checkbox", "data-day": day, checked: selectedDays.toArray().includes(day), onChange: (e) => handleChange(day, e.target.checked), disabled: disabled }, day))) }));
1692
1810
  };
1693
1811
 
1694
1812
  function CwCheckbox(CwCheckboxProps) {
@@ -1714,8 +1832,8 @@ function CwCheckbox(CwCheckboxProps) {
1714
1832
  * <CwToggle checked/>
1715
1833
  */
1716
1834
  function CwToggle(props) {
1717
- const { $alignProps, $labelProps, $buttonProps, $iconProps, ...$inputProps } = props;
1718
- return (jsxRuntime.jsx("div", { className: "cw-toggle", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsx("input", { className: "cw-toggle", type: "checkbox", ...$inputProps }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1835
+ const { alignProps, labelProps, buttonProps, iconProps, ...inputProps } = props;
1836
+ return (jsxRuntime.jsx("div", { className: "cw-toggle", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { className: "cw-toggle", type: "checkbox", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1719
1837
  }
1720
1838
 
1721
1839
  /**
@@ -1730,8 +1848,8 @@ function CwToggle(props) {
1730
1848
  * </CwSelect>
1731
1849
  */
1732
1850
  function CwOption(props) {
1733
- const { $text, ...optionProps } = props;
1734
- return (jsxRuntime.jsx("option", { className: "cw-option", ...optionProps, children: optionProps.children ?? $text }));
1851
+ const { text, ...optionProps } = props;
1852
+ return (jsxRuntime.jsx("option", { className: "cw-option", ...optionProps, children: optionProps.children ?? text }));
1735
1853
  }
1736
1854
 
1737
1855
  /**
@@ -1751,7 +1869,7 @@ function CwOption(props) {
1751
1869
  * ╰────────────────────╯
1752
1870
  * ```
1753
1871
  * @example
1754
- * <CwSelect name="cat" $iconProps={{_id:"pet"}} $labelProps={{children:"Cat:"}}>
1872
+ * <CwSelect name="cat" iconProps={{iconId:"pet"}} labelProps={{children:"Cat:"}}>
1755
1873
  * <CwOption value="" > - Choose a cat - </CwOption>
1756
1874
  * <CwOption value="o" >Orange</CwOption>
1757
1875
  * <CwOption value="b" >Black</CwOption>
@@ -1759,8 +1877,8 @@ function CwOption(props) {
1759
1877
  * </CwSelect>
1760
1878
  */
1761
1879
  function CwSelect(props) {
1762
- const { $alignProps, $labelProps, $buttonProps, $iconProps, $placeholder, children, ...$selectProps } = props;
1763
- return (jsxRuntime.jsx("div", { className: "cw-select", children: jsxRuntime.jsxs(CwAlign, { ...$alignProps, itemProp: $selectProps.required === true ? "required" : "", children: [$labelProps && (jsxRuntime.jsxs(CwLabel, { ...$labelProps, children: [$iconProps && jsxRuntime.jsx(CwIcon, { ...$iconProps }), $labelProps.$text] })), jsxRuntime.jsxs("select", { ...$selectProps, children: [$placeholder && jsxRuntime.jsx(CwOption, { value: "", children: $placeholder }), children] }), $buttonProps && jsxRuntime.jsx(CwButton, { ...$buttonProps })] }) }));
1880
+ const { alignProps, labelProps, buttonProps, iconProps, placeholder, children, ...selectProps } = props;
1881
+ return (jsxRuntime.jsx("div", { className: "cw-select", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsxs("select", { ...selectProps, children: [placeholder && jsxRuntime.jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
1764
1882
  }
1765
1883
 
1766
1884
  function CwDropdown(optionsProps) {
@@ -2656,13 +2774,13 @@ function CwMultiselect(CwelltCustomFilterTabProps) {
2656
2774
  }) }) }, "_" + i))) })] }) }) }));
2657
2775
  }
2658
2776
 
2659
- var styles$2 = {"cw-multifilter-tag":"cw-multi-filter-tag-module_cw-multifilter-tag__Epda-"};
2777
+ var styles$6 = {"cw-multifilter-tag":"cw-multi-filter-tag-module_cw-multifilter-tag__Epda-"};
2660
2778
 
2661
2779
  const CwMultiFilterTag = props => {
2662
2780
  const { ID, Name, Value, Category, Removable, PrimaryColor, OnPrimaryColor, Selectable, Selected, OnSelect } = props;
2663
2781
  const BackgroundColor = `rgb(${PrimaryColor.r},${PrimaryColor.g},${PrimaryColor.b})`;
2664
2782
  const TextColor = `rgb(${OnPrimaryColor.r},${OnPrimaryColor.g},${OnPrimaryColor.b})`;
2665
- return (jsxRuntime.jsxs("li", { className: styles$2["cw-multifilter-tag"], "data-selected": !!props.Selected, "data-removable": !!props.Removable, style: {
2783
+ return (jsxRuntime.jsxs("li", { className: styles$6["cw-multifilter-tag"], "data-selected": !!props.Selected, "data-removable": !!props.Removable, style: {
2666
2784
  color: TextColor,
2667
2785
  backgroundColor: BackgroundColor,
2668
2786
  opacity: Selected && !Removable ? "0.5" : "1",
@@ -2670,10 +2788,10 @@ const CwMultiFilterTag = props => {
2670
2788
  }, onClick: () => {
2671
2789
  if (Selectable)
2672
2790
  OnSelect?.(props);
2673
- }, children: [jsxRuntime.jsx("span", { id: ID, "data-value": Value, "data-category": Category, children: Name }), Removable && (jsxRuntime.jsx("span", { onClick: () => props.OnRemove?.(props), children: jsxRuntime.jsx(CwIcon, { "$id": "xmark" }) }))] }));
2791
+ }, children: [jsxRuntime.jsx("span", { id: ID, "data-value": Value, "data-category": Category, children: Name }), Removable && (jsxRuntime.jsx("span", { onClick: () => props.OnRemove?.(props), children: jsxRuntime.jsx(CwIcon, { iconId: "xmark" }) }))] }));
2674
2792
  };
2675
2793
 
2676
- var styles$1 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-multi-filter-catalog-container__S3nsq","cw-multi-filter":"cw-multi-filter-module_cw-multi-filter__zipBK","cw-multi-filter-search":"cw-multi-filter-module_cw-multi-filter-search__eyHr0"};
2794
+ var styles$5 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-multi-filter-catalog-container__S3nsq","cw-multi-filter":"cw-multi-filter-module_cw-multi-filter__zipBK","cw-multi-filter-search":"cw-multi-filter-module_cw-multi-filter-search__eyHr0"};
2677
2795
 
2678
2796
  /**
2679
2797
  * A multiple filter selector, a MULTI-SELECT even.
@@ -2698,14 +2816,14 @@ var styles$1 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
2698
2816
  * const [selectedCategory, setSelectedCategory] = useState("");
2699
2817
  *
2700
2818
  * <CwMultiFilter
2701
- * $id="multifilter"
2702
- * $onChange={tags => { // Collection of currently active tags
2819
+ * id="multifilter"
2820
+ * onChange={tags => { // Collection of currently active tags
2703
2821
  * console.log("This will get called every time the selected filters change");
2704
2822
  * }}
2705
- * $selectedTags={selectedTags} // Selected filters, in case you want to modify them manually
2823
+ * selectedTags={selectedTags} // Selected filters, in case you want to modify them manually
2706
2824
  * selectedCategory={selectedCategory}
2707
2825
  * onChangeCategory={setSelectedCategory}
2708
- * $allTags={
2826
+ * allTags={
2709
2827
  * new Set([
2710
2828
  * {
2711
2829
  * Name: "DEF", // The text displayed on the tag/filter/chip
@@ -2727,7 +2845,7 @@ var styles$1 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-m
2727
2845
  * }
2728
2846
  * ```
2729
2847
  * @param {CwMultiFilterProps} props
2730
- * @returns Set the `$onChange` callback to a function to check for changes in the selected filters
2848
+ * @returns Set the `onChange` callback to a function to check for changes in the selected filters
2731
2849
  */
2732
2850
  const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, style }) => {
2733
2851
  const [filteredTags, setFilteredTags] = React.useState(new Set());
@@ -2830,9 +2948,9 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, style
2830
2948
  inputRef.current?.focus();
2831
2949
  }
2832
2950
  };
2833
- return (jsxRuntime.jsxs("form", { ref: componentRef, id: id, className: styles$1["cw-multi-filter"], style: style, onSubmit: (e) => {
2951
+ return (jsxRuntime.jsxs("form", { ref: componentRef, id: id, className: styles$5["cw-multi-filter"], style: style, onSubmit: (e) => {
2834
2952
  e.preventDefault();
2835
- }, children: [jsxRuntime.jsxs("div", { onClick: handleDivClick, className: styles$1["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-color-primary)", outlineOffset: "-2px" } : {}, children: [jsxRuntime.jsxs("ul", { id: id + "_selected_filters", children: [Array.from(selectedTags).map(tag => (React.createElement(CwMultiFilterTag, { ...tag, key: tag.ID, Selectable: false, Removable: true, OnRemove: () => removeTag(tag.ID) }))), jsxRuntime.jsx("input", { type: "text", id: id + "_input", ref: inputRef, value: inputTextValue, spellCheck: false, onFocus: () => setIsPanelOpen(true), onChange: e => handleInputText(e.target.value), autoComplete: "off", onKeyDown: e => {
2953
+ }, children: [jsxRuntime.jsxs("div", { onClick: handleDivClick, className: styles$5["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-color-primary)", outlineOffset: "-2px" } : {}, children: [jsxRuntime.jsxs("ul", { id: id + "_selected_filters", children: [Array.from(selectedTags).map(tag => (React.createElement(CwMultiFilterTag, { ...tag, key: tag.ID, Selectable: false, Removable: true, OnRemove: () => removeTag(tag.ID) }))), jsxRuntime.jsx("input", { type: "text", id: id + "_input", ref: inputRef, value: inputTextValue, spellCheck: false, onFocus: () => setIsPanelOpen(true), onChange: e => handleInputText(e.target.value), autoComplete: "off", onKeyDown: e => {
2836
2954
  switch (e.key) {
2837
2955
  case "Enter":
2838
2956
  case "Tab":
@@ -2853,7 +2971,7 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, style
2853
2971
  } })] }), selectedTags.size > 0 ? (jsxRuntime.jsx("input", { type: "reset", value: "\u00D7", onClick: e => {
2854
2972
  e.preventDefault();
2855
2973
  onChangeSelectedTags?.(new Set());
2856
- } })) : null] }), jsxRuntime.jsxs("section", { className: styles$1["cw-multi-filter-catalog-container"], "data-display-none": !isPanelOpen, children: [jsxRuntime.jsxs("nav", { children: [jsxRuntime.jsx("button", { style: selectedCategory === "All"
2974
+ } })) : null] }), jsxRuntime.jsxs("section", { className: styles$5["cw-multi-filter-catalog-container"], "data-display-none": !isPanelOpen, children: [jsxRuntime.jsxs("nav", { children: [jsxRuntime.jsx("button", { style: selectedCategory === "All"
2857
2975
  ? {
2858
2976
  backgroundColor: "var(--cw-color-primary-container)",
2859
2977
  color: "var(--cw-color-primary)",
@@ -2916,7 +3034,7 @@ function CwSearchInput(optionsProps) {
2916
3034
  : "cw_label_text" + " " + optionsProps.labelClassName, children: optionsProps.labelName }), jsxRuntime.jsx("input", { type: "text", value: searchText, onChange: handleInputChange, placeholder: "Search...", className: "cw_input_search", disabled: optionsProps.disabled }), searchText && (jsxRuntime.jsx("button", { className: "cw_button_search_clear cwelt_flex cwellt_justify_center cwellt_align_items_center cwellt_p_abs", onClick: handleClearClick }))] }), filteredOptions.length > 0 && (jsxRuntime.jsx("div", { className: "cw_searchInput_dropDown cwellt_p_abs", children: jsxRuntime.jsx("ul", { className: "cw_searchInput_listContainer", children: filteredOptions.map((option) => (jsxRuntime.jsx("li", { onClick: () => handleOptionSelect(option), className: "cw_searchInput_list cwellt_flex cwellt_align_items_center", children: option.description }, option.id))) }) }))] }));
2917
3035
  }
2918
3036
 
2919
- var styles = {"context-menu":"cw-context-menu-module_context-menu__dbxnO","context-menu-item":"cw-context-menu-module_context-menu-item__B2W-Q"};
3037
+ var styles$4 = {"context-menu":"cw-context-menu-module_context-menu__dbxnO","context-menu-item":"cw-context-menu-module_context-menu-item__B2W-Q"};
2920
3038
 
2921
3039
  /**
2922
3040
  * A context menu that is rendered when the user clicks on a button.
@@ -2953,10 +3071,10 @@ const CwContextMenu = ({ children, options, onSelect }) => {
2953
3071
  document.removeEventListener("mousedown", handleOutsideClick);
2954
3072
  };
2955
3073
  }, []);
2956
- return (jsxRuntime.jsxs("div", { onContextMenu: handleContextMenu, children: [children, isOpen && (jsxRuntime.jsx("div", { ref: menuRef, className: styles["context-menu"], style: {
3074
+ return (jsxRuntime.jsxs("div", { onContextMenu: handleContextMenu, children: [children, isOpen && (jsxRuntime.jsx("div", { ref: menuRef, className: styles$4["context-menu"], style: {
2957
3075
  top: position.y,
2958
3076
  left: position.x
2959
- }, children: options.map(option => (jsxRuntime.jsx("div", { onClick: () => handleOptionClick(option), className: styles["context-menu-item"], children: option }, option))) }))] }));
3077
+ }, children: options.map(option => (jsxRuntime.jsx("div", { onClick: () => handleOptionClick(option), className: styles$4["context-menu-item"], children: option }, option))) }))] }));
2960
3078
  };
2961
3079
 
2962
3080
  function CwDataItem(cwBoxItemsProps) {
@@ -4165,8 +4283,16 @@ class CwScheduler2 extends React.Component {
4165
4283
  super(Props);
4166
4284
  this.init(this.props);
4167
4285
  }
4286
+ resizeObserver;
4287
+ calculateMaxPx = () => {
4288
+ const mainElement = document.querySelector(".cw-scheduler-main-wrapper");
4289
+ if (!mainElement)
4290
+ return window.innerWidth - 402; // sidebar + first column + padding
4291
+ const mainRect = mainElement.getBoundingClientRect();
4292
+ return Math.floor(mainRect.width - 162); // first column + padding
4293
+ };
4168
4294
  init = (props) => {
4169
- const maxPx = (document.getElementById("root")?.clientWidth ?? window.innerWidth) - 150;
4295
+ const maxPx = this.calculateMaxPx();
4170
4296
  const timeHeaders = getTimeHeaders$1(props.startDate, props.endDate);
4171
4297
  const dayPx = maxPx / Math.floor(daysBetweenTwoDates$1(props.startDate, props.endDate));
4172
4298
  const hourPx = dayPx / 24;
@@ -4195,7 +4321,8 @@ class CwScheduler2 extends React.Component {
4195
4321
  };
4196
4322
  };
4197
4323
  initOutside = (events, resources, _nextProps, startDate, endDate) => {
4198
- const maxPx = (document.getElementById("root")?.clientWidth ?? window.innerWidth) - 150;
4324
+ // const maxPx: number = (document.getElementById("root")?.clientWidth ?? window.innerWidth) - 150;
4325
+ const maxPx = this.calculateMaxPx();
4199
4326
  const timeHeaders = getTimeHeaders$1(startDate, endDate);
4200
4327
  const days = Math.floor(daysBetweenTwoDates$1(startDate, endDate));
4201
4328
  const dayPx = maxPx / days;
@@ -4216,7 +4343,7 @@ class CwScheduler2 extends React.Component {
4216
4343
  this.setState({
4217
4344
  startDate: startDate,
4218
4345
  endDate: endDate,
4219
- maxPx: maxPx, // window.screen.width * 0.9,
4346
+ maxPx: maxPx,
4220
4347
  dayPx: dayPx,
4221
4348
  hourPx: hourPx,
4222
4349
  minutePx: minutePx,
@@ -4245,15 +4372,47 @@ class CwScheduler2 extends React.Component {
4245
4372
  division: divisions,
4246
4373
  divisionType: divisionType,
4247
4374
  });
4375
+ // Añadir ResizeObserver
4376
+ const mainElement = document.querySelector(".cw-scheduler-main-wrapper");
4377
+ if (mainElement) {
4378
+ this.resizeObserver = new ResizeObserver(() => {
4379
+ this.handleResize();
4380
+ });
4381
+ this.resizeObserver.observe(mainElement);
4382
+ }
4248
4383
  window?.addEventListener("resize", this.handleResize);
4249
4384
  }
4385
+ componentWillUnmount() {
4386
+ if (this.resizeObserver) {
4387
+ this.resizeObserver.disconnect();
4388
+ }
4389
+ window?.removeEventListener("resize", this.handleResize);
4390
+ }
4391
+ recalculateEventPositions = (events, dayPx, startDate) => {
4392
+ return events.map(event => getEventWithSize$1(event, startDate, dayPx));
4393
+ };
4394
+ updateResourcesWithEvents = (resources, events) => {
4395
+ return resources.map(resource => ({
4396
+ ...resource,
4397
+ events: events.filter(event => event.resourceId === resource.id)
4398
+ }));
4399
+ };
4250
4400
  handleResize = () => {
4251
- const maxPx = (document.getElementById("root")?.clientWidth ?? window.innerWidth) - 150;
4401
+ const maxPx = this.calculateMaxPx();
4252
4402
  const days = Math.floor(daysBetweenTwoDates$1(this.state.startDate, this.state.endDate));
4253
4403
  const dayPx = maxPx / days;
4254
4404
  const hourPx = dayPx / 24;
4255
- const updated = { ...this.state, maxPx: maxPx, hourPx: hourPx, dayPx: dayPx };
4256
- this.setState(updated);
4405
+ const minutePx = dayPx / 1440;
4406
+ const recalculatedEvents = this.recalculateEventPositions(this.state.events, dayPx, this.state.startDate);
4407
+ const updatedResources = this.updateResourcesWithEvents(this.state.resources, recalculatedEvents);
4408
+ this.setState({
4409
+ maxPx,
4410
+ dayPx,
4411
+ hourPx,
4412
+ minutePx,
4413
+ events: recalculatedEvents,
4414
+ resources: updatedResources
4415
+ });
4257
4416
  };
4258
4417
  componentWillReceiveProps(_nextProps) {
4259
4418
  if (this.state.showConsoleLogs) {
@@ -4351,8 +4510,8 @@ class CwScheduler2 extends React.Component {
4351
4510
  return pixels;
4352
4511
  });
4353
4512
  return (jsxRuntime.jsx("div", { id: this.props.id, style: {
4354
- overflowY: "scroll",
4355
- maxHeight: isPinnedTable ? "auto" : schedulerHeight,
4513
+ overflowY: "auto",
4514
+ maxHeight: isPinnedTable ? "auto" : schedulerHeight
4356
4515
  }, className: this.state.resources.length > 0 ? "cwellt_tb_con" : "cwellt_tb_con cw_tb_con_emptyValues", children: jsxRuntime.jsxs("table", { id: "cwelltTableScheduler", children: [this.props.id !== "crewAssignmentsScheduler" && (jsxRuntime.jsx(SchedulerHeader$2, { timelineProps: {
4357
4516
  maxPx: this.state.maxPx,
4358
4517
  hoursList: this.state.timeHeaders,
@@ -5213,9 +5372,13 @@ const getTimeHeaders = (startDate, endDate) => {
5213
5372
 
5214
5373
  class CwScheduler extends React.Component {
5215
5374
  contentArea;
5375
+ calculateMaxPx = () => {
5376
+ const mainRect = document.body.getBoundingClientRect();
5377
+ return Math.floor(mainRect.width - 200);
5378
+ };
5216
5379
  constructor(props) {
5217
5380
  super(props);
5218
- const maxPx = (document.getElementsByTagName("main")[0]?.clientWidth ?? window.innerWidth) - 150;
5381
+ const maxPx = this.calculateMaxPx();
5219
5382
  const timeHeaders = getTimeHeaders(props.startDate, props.endDate);
5220
5383
  const dayPx = maxPx / Math.floor(daysBetweenTwoDates(props.startDate, props.endDate));
5221
5384
  const hourPx = dayPx / 24;
@@ -5250,7 +5413,7 @@ class CwScheduler extends React.Component {
5250
5413
  };
5251
5414
  }
5252
5415
  handleResize = () => {
5253
- const maxPx = (document.getElementsByTagName("main")[0]?.clientWidth ?? window.innerWidth) - 150;
5416
+ const maxPx = this.calculateMaxPx();
5254
5417
  const days = Math.floor(daysBetweenTwoDates(this.props.startDate, this.props.endDate));
5255
5418
  const dayPx = maxPx / days;
5256
5419
  const hourPx = dayPx / 24;
@@ -5275,7 +5438,7 @@ class CwScheduler extends React.Component {
5275
5438
  if (dateChange) {
5276
5439
  const startDate = _nextProps.startDate;
5277
5440
  const endDate = _nextProps.endDate;
5278
- const maxPx = (document.getElementsByTagName("main")[0]?.clientWidth ?? window.innerWidth) - 150;
5441
+ const maxPx = this.calculateMaxPx();
5279
5442
  const timeHeaders = getTimeHeaders(startDate, endDate);
5280
5443
  const days = Math.floor(daysBetweenTwoDates(startDate, endDate));
5281
5444
  const dayPx = maxPx / days;
@@ -5319,7 +5482,7 @@ class CwScheduler extends React.Component {
5319
5482
  if (!areSameEvents || !areSameRows) {
5320
5483
  const startDate = _nextProps.startDate;
5321
5484
  const endDate = _nextProps.endDate;
5322
- const maxPx = (document.getElementsByTagName("main")[0]?.clientWidth ?? window.innerWidth) - 150;
5485
+ const maxPx = this.calculateMaxPx();
5323
5486
  const days = Math.floor(daysBetweenTwoDates(startDate, endDate));
5324
5487
  const dayPx = maxPx / days;
5325
5488
  this.setState({
@@ -5385,6 +5548,7 @@ class CwScheduler extends React.Component {
5385
5548
  return (jsxRuntime.jsx("div", { id: this.props.id, style: {
5386
5549
  overflowY: "scroll",
5387
5550
  maxHeight: isPinnedTable ? "auto" : schedulerHeight,
5551
+ minHeight: (this.state.resources.length === 1 || this.state.resources.length === 2) ? schedulerHeight + 10 : 0
5388
5552
  }, className: this.state.resources.length > 0 ? "cwellt_tb_con" : "cwellt_tb_con cw_tb_con_emptyValues", children: jsxRuntime.jsxs("table", { id: "cwelltTableScheduler", children: [this.props.id !== "crewAssignmentsScheduler" && (jsxRuntime.jsx(SchedulerHeader$1, { timelineProps: {
5389
5553
  maxPx: this.state.maxPx,
5390
5554
  hoursList: this.state.timeHeaders,
@@ -5394,6 +5558,7 @@ class CwScheduler extends React.Component {
5394
5558
  headerName: this.props.resourceName,
5395
5559
  }, descriptionColumn: this.props.descriptionColumn })), jsxRuntime.jsx("tbody", { style: {
5396
5560
  overflow: "visible",
5561
+ width: this.state.maxPx + 150
5397
5562
  }, className: isPinnedTable ? "fc-body cw-fc-body-pinned" : "fc-body", children: jsxRuntime.jsxs("tr", { className: "fc_body_row", children: [jsxRuntime.jsx(ResourcesTitleList, { resources: this.state.resources, canBePinned: this.props.canBePinned ?? false, includesPinned: this.props.id.toLowerCase().includes("pinned"), onCrewPinning: this.handleCrewPinning, onClickResourceContextMenu: (_e, resource) => {
5398
5563
  if (this.props.scheduler_handleOnClickResourceContextMenu) {
5399
5564
  this.props.scheduler_handleOnClickResourceContextMenu(_e, resource);
@@ -5402,32 +5567,6 @@ class CwScheduler extends React.Component {
5402
5567
  }
5403
5568
  }
5404
5569
 
5405
- const SchedulerHeaderDivision = ({ topDivisions, bottomDivisions, classification, topWidth }) => {
5406
- return (jsxRuntime.jsxs("div", { style: {
5407
- width: topWidth,
5408
- cursor: "pointer"
5409
- }, children: [jsxRuntime.jsx("div", { className: "scheduler-dates", style: {
5410
- background: "#e6e6e6",
5411
- borderLeft: "1px white solid",
5412
- display: "flex",
5413
- overflow: "hidden",
5414
- alignItems: "center",
5415
- justifyContent: "center",
5416
- }, children: jsxRuntime.jsx("span", { style: { textAlign: "center", height: "2rem", padding: "2px" }, children: topDivisions }) }), jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "space-between", flex: 1 }, children: bottomDivisions.map((element) => (jsxRuntime.jsx("div", { style: {
5417
- background: "#cacaca",
5418
- display: "flex",
5419
- flex: 1,
5420
- height: "2rem",
5421
- justifyContent: "center",
5422
- borderLeft: "white 1px solid",
5423
- overflow: "hidden"
5424
- }, children: jsxRuntime.jsx("span", { children: element }) }, classification + element + topDivisions))) })] }));
5425
- };
5426
-
5427
- const HeaderTitle = ({ title, dividerText, width }) => {
5428
- return (jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", width: width }, children: [jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "center", background: "white", height: "2rem" }, children: jsxRuntime.jsx("span", { children: title }) }), jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "center", background: "#e6e6e6", height: "2rem" }, children: jsxRuntime.jsx("span", { children: dividerText }) })] }));
5429
- };
5430
-
5431
5570
  function dateFromPercentage(startDate, visibleDays, percentage) {
5432
5571
  const endTime = moment(startDate).add(visibleDays, "day").toDate();
5433
5572
  const timeSpan = endTime.getTime() - startDate.getTime();
@@ -5435,6 +5574,14 @@ function dateFromPercentage(startDate, visibleDays, percentage) {
5435
5574
  return clickedDate;
5436
5575
  }
5437
5576
 
5577
+ function getPercentageFromMouseEvent(event) {
5578
+ const rect = event.currentTarget.getBoundingClientRect();
5579
+ const x = event.clientX - rect.left;
5580
+ const totalWidth = rect.width;
5581
+ const clickPercentage = x / totalWidth;
5582
+ return clickPercentage;
5583
+ }
5584
+
5438
5585
  class OnClickEvent {
5439
5586
  id;
5440
5587
  constructor(id) {
@@ -5550,22 +5697,66 @@ class OnClickContextMenu {
5550
5697
  }
5551
5698
  }
5552
5699
 
5553
- function getPercentageFromMouseEvent(event) {
5554
- const rect = event.currentTarget.getBoundingClientRect();
5555
- const x = event.clientX - rect.left;
5556
- const totalWidth = rect.width;
5557
- const clickPercentage = x / totalWidth;
5558
- return clickPercentage;
5559
- }
5700
+ var styles$3 = {"scheduler-header-divisions":"scheduler-header-module_scheduler-header-divisions__1JrNe","scheduler-timeline-now":"scheduler-header-module_scheduler-timeline-now__naREv","scheduler-timeline-label":"scheduler-header-module_scheduler-timeline-label__mLVAp","scheduler-header-title":"scheduler-header-module_scheduler-header-title__Jzy94","scheduler-dates":"scheduler-header-module_scheduler-dates__O7ePQ","current-day":"scheduler-header-module_current-day__FpHiv","scheduler-hours":"scheduler-header-module_scheduler-hours__ZDCVj"};
5560
5701
 
5561
- const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width, onEvent }) => {
5702
+ const getNow$1 = (isUtc) => {
5703
+ let now = new Date();
5704
+ if (isUtc) {
5705
+ now = new Date(now.getTime() + now.getTimezoneOffset() * 60_000);
5706
+ }
5707
+ return now;
5708
+ };
5709
+ const TimeLine = ({ left, top = "0px", height, color, width = "2px", zIndexNumber = 0, isHeader, isUtc = false }) => {
5710
+ const [currentTime, setCurrentTime] = React.useState(getNow$1(isUtc));
5711
+ React.useEffect(() => {
5712
+ const interval = setInterval(() => {
5713
+ setCurrentTime(getNow$1(isUtc));
5714
+ }, 60000); // Actualiza cada minuto
5715
+ return () => clearInterval(interval);
5716
+ }, [isUtc]);
5717
+ const timeString = currentTime.toLocaleTimeString([], {
5718
+ hour: '2-digit',
5719
+ minute: '2-digit',
5720
+ hour12: false
5721
+ });
5722
+ return (jsxRuntime.jsx("div", { style: {
5723
+ position: "absolute",
5724
+ top: top,
5725
+ height: height,
5726
+ left: left,
5727
+ width: width,
5728
+ background: color,
5729
+ pointerEvents: "none",
5730
+ zIndex: zIndexNumber,
5731
+ }, className: styles$3["scheduler-timeline-now"], children: isHeader && (jsxRuntime.jsx("span", { style: {
5732
+ color: color,
5733
+ }, className: styles$3["scheduler-timeline-label"], children: timeString })) }));
5734
+ };
5735
+
5736
+ const SchedulerHeaderDivision = ({ topDivisions, bottomDivisions, classification, topWidth, startDate, endDate }) => {
5737
+ const isToday = () => {
5738
+ if (!startDate)
5739
+ return false;
5740
+ const today = moment();
5741
+ if (endDate) {
5742
+ return today.isBetween(startDate, endDate, 'day', '[]');
5743
+ }
5744
+ return today.isSame(startDate, 'day');
5745
+ };
5746
+ return (jsxRuntime.jsxs("div", { style: {
5747
+ width: topWidth,
5748
+ cursor: "pointer"
5749
+ }, children: [jsxRuntime.jsx("div", { className: `${styles$3["scheduler-dates"]} ${isToday() ? styles$3["current-day"] : ""}`, children: jsxRuntime.jsx("span", { children: topDivisions }) }), jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "space-between", flex: 1 }, children: bottomDivisions.map((element) => (jsxRuntime.jsx("div", { className: styles$3["scheduler-hours"], children: jsxRuntime.jsx("span", { children: element }) }, classification + element + topDivisions))) })] }));
5750
+ };
5751
+
5752
+ const HeaderTitle = ({ title, dividerText, width }) => {
5753
+ return (jsxRuntime.jsxs("div", { className: styles$3["scheduler-header-title"], style: { width: width }, children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("h5", { children: title }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("span", { children: dividerText }) })] }));
5754
+ };
5755
+
5756
+ const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width, onEvent, timeLinePercentage, isUtc }) => {
5562
5757
  const topWidth = (100 / visibleDays);
5563
5758
  const { title, classification } = content;
5564
- return (jsxRuntime.jsxs("div", { style: {
5565
- display: "flex",
5566
- justifyContent: "space-between",
5567
- alignItems: "center",
5568
- }, children: [jsxRuntime.jsx(HeaderTitle, { title: title, dividerText: classification, width: width }), jsxRuntime.jsx("div", { style: { flex: 1, display: "flex" }, onMouseDown: (e) => {
5759
+ return (jsxRuntime.jsxs("div", { style: { display: "flex" }, children: [jsxRuntime.jsx(HeaderTitle, { title: title, dividerText: classification, width: width }), jsxRuntime.jsxs("div", { className: styles$3["scheduler-header-divisions"], style: { flex: 1, display: "flex", position: "relative" }, onMouseDown: (e) => {
5569
5760
  e.preventDefault();
5570
5761
  const clickPercentage = getPercentageFromMouseEvent(e);
5571
5762
  const date = dateFromPercentage(selectedDate, visibleDays, clickPercentage);
@@ -5575,29 +5766,118 @@ const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width,
5575
5766
  const clickPercentage = getPercentageFromMouseEvent(e);
5576
5767
  const date = dateFromPercentage(selectedDate, visibleDays, clickPercentage);
5577
5768
  onEvent(new OnEndClickHeaderEvent(date));
5578
- }, children: divisions.map((day) => {
5579
- const thisTopWidth = visibleDays > 15
5580
- ? topWidth * day.bottom.length
5581
- : topWidth;
5582
- return (jsxRuntime.jsx(SchedulerHeaderDivision, { topDivisions: day.top, bottomDivisions: day.bottom, classification: classification, topWidth: thisTopWidth + "%" }, day.top + classification));
5583
- }) })] }));
5769
+ }, children: [divisions.map((day) => {
5770
+ const thisTopWidth = visibleDays > 15
5771
+ ? topWidth * day.bottom.length
5772
+ : topWidth;
5773
+ const dateStr = day.startDate ? moment(day.startDate) : moment(day.top, "DD.MM.YYYY");
5774
+ const startDate = dateStr.toDate();
5775
+ const endDate = day.endDate ? moment(day.endDate).toDate() : undefined;
5776
+ return (jsxRuntime.jsx(SchedulerHeaderDivision, { topDivisions: day.top, bottomDivisions: day.bottom, classification: classification, topWidth: thisTopWidth + "%", startDate: startDate, endDate: endDate }, day.top + classification));
5777
+ }), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsxRuntime.jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "50%", height: "50%", isHeader: true, isUtc: isUtc }))] })] }));
5778
+ };
5779
+
5780
+ function colorToHSL(color) {
5781
+ const hexColor = colorToHEX(color);
5782
+ const hex = hexColor.replace('#', '');
5783
+ const r = parseInt(hex.substring(0, 2), 16) / 255;
5784
+ const g = parseInt(hex.substring(2, 4), 16) / 255;
5785
+ const b = parseInt(hex.substring(4, 6), 16) / 255;
5786
+ const max = Math.max(r, g, b);
5787
+ const min = Math.min(r, g, b);
5788
+ let h = 0;
5789
+ let s = 0;
5790
+ const l = (max + min) / 2;
5791
+ if (max !== min) {
5792
+ const d = max - min;
5793
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
5794
+ switch (max) {
5795
+ case r:
5796
+ h = (g - b) / d + (g < b ? 6 : 0);
5797
+ break;
5798
+ case g:
5799
+ h = (b - r) / d + 2;
5800
+ break;
5801
+ case b:
5802
+ h = (r - g) / d + 4;
5803
+ break;
5804
+ }
5805
+ h /= 6;
5806
+ }
5807
+ return {
5808
+ h: Math.round(h * 360),
5809
+ s: Math.round(s * 100),
5810
+ l: Math.round(l * 100)
5811
+ };
5812
+ }
5813
+ function colorToHEX(color) {
5814
+ const canvas = document.createElement('canvas');
5815
+ const context = canvas.getContext('2d');
5816
+ if (!context)
5817
+ throw new Error('Could not create canvas context');
5818
+ context.fillStyle = color;
5819
+ return context.fillStyle;
5820
+ }
5821
+ function getHSLColor(color, alpha = 1) {
5822
+ const hsl = colorToHSL(color);
5823
+ return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${alpha})`;
5824
+ }
5825
+ function getContrastColor(color) {
5826
+ const hsl = colorToHSL(color);
5827
+ const contrastL = hsl.l > 50 ? 20 : 90;
5828
+ return `hsl(${hsl.h}, ${hsl.s}%, ${contrastL}%)`;
5829
+ }
5830
+
5831
+ const BackgroundEvent = ({ value, heightRem }) => {
5832
+ const isVerticalText = value.isVerticalText ?? false;
5833
+ const backColor = getHSLColor(value.color, value.alpha ?? 0.5);
5834
+ const textColor = getContrastColor(value.color);
5835
+ return value.isVisible ? (jsxRuntime.jsx("div", { style: {
5836
+ left: `${value.left}%`,
5837
+ width: `${value.width}%`,
5838
+ position: "absolute",
5839
+ height: `${heightRem}rem`,
5840
+ }, children: jsxRuntime.jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", dissapearsWhenHover: true, showDelay: 200, children: jsxRuntime.jsx("div", { style: {
5841
+ overflow: "hidden",
5842
+ backgroundColor: backColor,
5843
+ height: `${heightRem}rem`,
5844
+ }, children: jsxRuntime.jsx("div", { style: {
5845
+ display: "flex",
5846
+ flexDirection: "row",
5847
+ width: "100%",
5848
+ contentVisibility: "auto",
5849
+ height: `${heightRem}rem`,
5850
+ }, children: jsxRuntime.jsxs("div", { style: {
5851
+ flex: 1,
5852
+ display: "flex",
5853
+ flexDirection: "row",
5854
+ alignItems: "center",
5855
+ whiteSpace: "nowrap",
5856
+ overflow: "hidden",
5857
+ width: value.width + "%",
5858
+ fontSize: "var(--cw-font-size-smallest)"
5859
+ }, children: [value.icons ? jsxRuntime.jsx("div", { style: {
5860
+ display: "flex",
5861
+ flexDirection: "row",
5862
+ alignItems: "center",
5863
+ whiteSpace: "nowrap",
5864
+ color: textColor,
5865
+ }, children: value.icons }) : null, jsxRuntime.jsx("span", { style: {
5866
+ color: textColor,
5867
+ writingMode: isVerticalText ? "vertical-lr" : "initial",
5868
+ textOrientation: isVerticalText ? "upright" : "initial"
5869
+ }, children: value.name })] }) }) }) }) })) : null;
5584
5870
  };
5585
5871
 
5586
- const DefaultRowHeader = ({ value, width, color, onEvent }) => {
5587
- return (jsxRuntime.jsx("div", { style: {
5872
+ var styles$2 = {"scheduler-row-header":"scheduler-row-module_scheduler-row-header__S-iv4"};
5873
+
5874
+ const DefaultRowHeader = ({ value, width, onEvent }) => {
5875
+ return (jsxRuntime.jsxs("div", { style: {
5588
5876
  width: width,
5589
- background: color,
5590
- cursor: "pointer",
5591
- padding: "8px",
5592
- boxSizing: "border-box"
5877
+ // background: color,
5593
5878
  }, onClick: (_) => {
5594
- onEvent(new OnClickRowHeader(value.resourceId));
5595
- }, children: jsxRuntime.jsxs("div", { style: {
5596
- display: "flex",
5597
- flexDirection: "column",
5598
- justifyContent: "center",
5599
- alignItems: "center",
5600
- }, children: [jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [jsxRuntime.jsx("span", { style: { fontWeight: "bold" }, children: value.title }), value.title2 && jsxRuntime.jsxs("span", { children: ["-", value.title2] })] }), jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "row", alignItems: "center", color: "gray" }, children: [value.subtitle && jsxRuntime.jsx("span", { style: { fontWeight: "bold" }, children: value.subtitle }), value.subtitle2 && jsxRuntime.jsxs("span", { children: ["-", value.subtitle2] })] })] }) }));
5879
+ onEvent(new OnClickRowHeader(value.rowId));
5880
+ }, className: styles$2["scheduler-row-header"], children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: value.title }), value.title2 && jsxRuntime.jsxs("span", { children: ["-", value.title2] }), value.title3 && jsxRuntime.jsxs("span", { className: styles$2["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] })] }), value.subtitle && jsxRuntime.jsxs("div", { style: { opacity: 0.5 }, children: [jsxRuntime.jsx("strong", { children: value.subtitle }), value.subtitle2 && jsxRuntime.jsxs("span", { children: ["-", value.subtitle2] })] })] }));
5601
5881
  };
5602
5882
 
5603
5883
  function useSingleAndDoubleClicks(onClick, onDoubleClick) {
@@ -5616,7 +5896,7 @@ function useSingleAndDoubleClicks(onClick, onDoubleClick) {
5616
5896
  timer.current = setTimeout(() => {
5617
5897
  timer.current = null;
5618
5898
  onClick(e);
5619
- }, 300);
5899
+ }, 500);
5620
5900
  }, [timer, cancelPendingClick, onClick]);
5621
5901
  const handleDoubleClick = React.useCallback((e) => {
5622
5902
  e.stopPropagation();
@@ -5627,6 +5907,8 @@ function useSingleAndDoubleClicks(onClick, onDoubleClick) {
5627
5907
  return { handleClick, handleDoubleClick };
5628
5908
  }
5629
5909
 
5910
+ var styles$1 = {"hide-scrollbar":"new-scheduler-module_hide-scrollbar__33GG9","scheduler-event":"new-scheduler-module_scheduler-event__gphwn","scheduler-event-container":"new-scheduler-module_scheduler-event-container__-h1xm","time-marker":"new-scheduler-module_time-marker__2BejU"};
5911
+
5630
5912
  const EventSideDrag = ({ left = false, heightRem, onStartEvent }) => {
5631
5913
  return (jsxRuntime.jsx("span", { draggable: true, onDragStart: (e) => {
5632
5914
  e.stopPropagation();
@@ -5641,16 +5923,24 @@ const EventSideDrag = ({ left = false, heightRem, onStartEvent }) => {
5641
5923
  const SchedulerEvent = ({ value, heightRem, onEvent }) => {
5642
5924
  const [isOnDrag, setIsOnDrag] = React.useState(false);
5643
5925
  const [isContextMenuOpen, setIsContextMenuOpen] = React.useState(false);
5926
+ // Calculate colors of the event
5927
+ const backColor = getHSLColor(value.color, value.alpha ?? 0.75);
5928
+ const textColor = getContrastColor(value.color);
5929
+ const eventTransparent = value.alpha ? value.alpha < 0.7 : false;
5644
5930
  const { handleClick, handleDoubleClick } = useSingleAndDoubleClicks((e) => {
5645
5931
  e.stopPropagation();
5646
5932
  e.preventDefault();
5647
5933
  if (!value.isDraggable) {
5648
5934
  return;
5649
5935
  }
5936
+ // https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform
5937
+ // change for navigator.userAgentData.platform when acepted in all browsers
5938
+ const isMac = navigator.platform.toUpperCase().includes("MAC");
5939
+ const isCtrlOrAltPressed = isMac ? e.altKey : e.ctrlKey;
5650
5940
  if (e.shiftKey) {
5651
5941
  onEvent(new OnRangeClickEvent(value.id));
5652
5942
  }
5653
- else if (e.ctrlKey) {
5943
+ else if (isCtrlOrAltPressed) {
5654
5944
  onEvent(new OnMultiClickEvent(value.id));
5655
5945
  }
5656
5946
  else {
@@ -5661,83 +5951,71 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
5661
5951
  e.preventDefault();
5662
5952
  onEvent(new OnDoubleClickEvent(value.id));
5663
5953
  });
5664
- return (jsxRuntime.jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", dissapearsWhenHover: true, children: jsxRuntime.jsx(antd.Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottomCenter", menu: {
5665
- items: value.contextMenuItems,
5666
- onClick: (e) => {
5667
- e.domEvent.nativeEvent.preventDefault();
5668
- e.domEvent.nativeEvent.stopPropagation();
5669
- e.domEvent.nativeEvent.stopImmediatePropagation();
5670
- e.domEvent.preventDefault();
5671
- e.domEvent.stopPropagation();
5672
- onEvent(new OnClickContextMenu(value.id, e.key));
5673
- },
5674
- onMouseLeave: () => setIsContextMenuOpen(false),
5675
- }, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (value.contextMenuItems?.length ?? 0) > 0, children: jsxRuntime.jsx("div", { style: {
5676
- left: `${value.left}%`,
5677
- width: `${value.width}%`,
5678
- position: "absolute",
5679
- zIndex: isOnDrag ? 999 : undefined,
5680
- contentVisibility: "auto",
5681
- }, onClick: handleClick, onDoubleClick: handleDoubleClick, draggable: value.isDraggable, onMouseDown: (_) => {
5682
- if (value.isDraggable)
5683
- setIsOnDrag(true);
5684
- }, onMouseLeave: (_) => {
5685
- if (value.isDraggable)
5686
- setIsOnDrag(false);
5687
- }, onDragStart: (_) => {
5688
- if (value.isDraggable)
5689
- onEvent(new OnDragEvent(value.id));
5690
- }, onDragEnd: (_) => {
5691
- if (value.isDraggable)
5692
- setIsOnDrag(false);
5693
- }, onContextMenu: (e) => {
5694
- e.stopPropagation();
5695
- e.preventDefault();
5696
- onEvent(new OnRightClickEvent(value.id));
5697
- }, children: jsxRuntime.jsxs("div", { style: {
5698
- borderRadius: "0.5rem",
5699
- border: value.selected ? "1px solid black" : "none",
5700
- overflow: "hidden",
5701
- backgroundColor: value.color,
5702
- height: `${heightRem}rem`,
5703
- display: "flex",
5704
- flexDirection: "column",
5705
- }, children: [jsxRuntime.jsxs("div", { style: {
5954
+ return (jsxRuntime.jsx(antd.Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottomCenter", menu: {
5955
+ items: value.contextMenuItems,
5956
+ onClick: (e) => {
5957
+ e.domEvent.nativeEvent.preventDefault();
5958
+ e.domEvent.nativeEvent.stopPropagation();
5959
+ e.domEvent.nativeEvent.stopImmediatePropagation();
5960
+ e.domEvent.preventDefault();
5961
+ e.domEvent.stopPropagation();
5962
+ onEvent(new OnClickContextMenu(value.id, e.key));
5963
+ },
5964
+ onMouseLeave: () => setIsContextMenuOpen(false),
5965
+ }, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (value.contextMenuItems?.length ?? 0) > 0, children: jsxRuntime.jsx("div", { style: {
5966
+ top: "2px",
5967
+ left: `${value.left}%`,
5968
+ width: `${value.width}%`,
5969
+ position: "absolute",
5970
+ zIndex: isOnDrag ? 999 : undefined,
5971
+ contentVisibility: "auto",
5972
+ pointerEvents: "auto",
5973
+ }, onClick: handleClick, onDoubleClick: handleDoubleClick, draggable: value.isDraggable, onMouseDown: (_) => {
5974
+ if (value.isDraggable)
5975
+ setIsOnDrag(true);
5976
+ }, onMouseLeave: (_) => {
5977
+ if (value.isDraggable)
5978
+ setIsOnDrag(false);
5979
+ }, onDragStart: (_) => {
5980
+ if (value.isDraggable)
5981
+ onEvent(new OnDragEvent(value.id));
5982
+ }, onDragEnd: (_) => {
5983
+ if (value.isDraggable)
5984
+ setIsOnDrag(false);
5985
+ }, onContextMenu: (e) => {
5986
+ e.stopPropagation();
5987
+ e.preventDefault();
5988
+ onEvent(new OnRightClickEvent(value.id));
5989
+ }, children: jsxRuntime.jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", dissapearsWhenHover: true, showDelay: 200, children: jsxRuntime.jsxs("div", { style: {
5990
+ border: value.selected ? "2px solid black" : "none",
5991
+ backgroundColor: backColor,
5992
+ height: `calc(${heightRem}rem - 4px)`,
5993
+ opacity: eventTransparent ? 0.5 : 1,
5994
+ }, className: styles$1["scheduler-event"], children: [jsxRuntime.jsxs("div", { style: {
5706
5995
  display: "flex",
5707
5996
  flexDirection: "row",
5708
5997
  alignItems: "stretch",
5709
5998
  width: "100%",
5710
5999
  cursor: value.isDraggable ? "pointer" : "default",
5711
- height: `${heightRem * 0.8}rem`,
5712
- }, children: [value.isResizable && (jsxRuntime.jsx(EventSideDrag, { left: true, heightRem: heightRem * 0.8, onStartEvent: () => {
6000
+ height: `calc(${heightRem}rem - 10px)`,
6001
+ }, children: [value.isResizable && (jsxRuntime.jsx(EventSideDrag, { left: true, heightRem: heightRem * 0.7, onStartEvent: () => {
5713
6002
  onEvent(new OnLeftDragStart(value.id));
5714
- } })), jsxRuntime.jsxs("div", { style: {
5715
- flex: 1,
5716
- display: "flex",
5717
- flexDirection: "row",
5718
- alignItems: "center",
5719
- whiteSpace: "nowrap",
5720
- overflow: "hidden",
5721
- }, children: [jsxRuntime.jsx("div", { style: {
6003
+ } })), jsxRuntime.jsxs("div", { className: styles$1["scheduler-event-container"], children: [jsxRuntime.jsx("div", { style: {
5722
6004
  display: "flex",
5723
6005
  flexDirection: "row",
5724
6006
  alignItems: "center",
5725
6007
  whiteSpace: "nowrap",
5726
- color: value.isLightColor ? "black" : "white",
6008
+ color: textColor,
5727
6009
  }, children: value.icons }), jsxRuntime.jsx("span", { style: {
5728
6010
  padding: "0.1rem",
5729
- color: value.isLightColor ? "black" : "white",
5730
- }, children: value.name })] }), value.isResizable && (jsxRuntime.jsx(EventSideDrag, { heightRem: heightRem * 0.8, onStartEvent: () => {
6011
+ color: textColor,
6012
+ }, children: value.name })] }), value.isResizable && (jsxRuntime.jsx(EventSideDrag, { heightRem: heightRem * 0.7, onStartEvent: () => {
5731
6013
  onEvent(new OnRightDragStart(value.id));
5732
- } }))] }), value.primaryTimeMarkerColor && (jsxRuntime.jsx("div", { style: {
6014
+ } }))] }), value.primaryTimeMarkerColor && (jsxRuntime.jsx("div", { className: styles$1["time-marker"], style: {
5733
6015
  backgroundColor: value.primaryTimeMarkerColor,
5734
- height: "4px",
5735
- width: "100%",
5736
- } })), value.secondaryTimeMarkerColor && (jsxRuntime.jsx("div", { style: {
6016
+ } })), value.secondaryTimeMarkerColor && (jsxRuntime.jsx("div", { className: styles$1["time-marker"], style: {
5737
6017
  backgroundColor: value.secondaryTimeMarkerColor,
5738
- height: "4px",
5739
- width: "100%",
5740
- } }))] }) }, value.id) }, value.id) }));
6018
+ } }))] }) }) }, value.id) }, value.id));
5741
6019
  };
5742
6020
 
5743
6021
  const eventsCollide = (event1, event2) => {
@@ -5748,7 +6026,14 @@ const eventsCollide = (event1, event2) => {
5748
6026
  };
5749
6027
  // Function to separate events into non-colliding rows
5750
6028
  const separateEventsToInnerRows = (events) => {
5751
- const sortedEvents = [...events].sort((a, b) => a.startDate.getTime() - b.startDate.getTime());
6029
+ const sortedEvents = [...events].sort((a, b) => {
6030
+ const aOrder = a.order ?? Number.MAX_SAFE_INTEGER;
6031
+ const bOrder = b.order ?? Number.MAX_SAFE_INTEGER;
6032
+ if (aOrder !== bOrder) {
6033
+ return aOrder - bOrder; // Prioridad al order si ambos están definidos
6034
+ }
6035
+ return a.startDate.getTime() - b.startDate.getTime();
6036
+ });
5752
6037
  const rows = [];
5753
6038
  for (const event of sortedEvents) {
5754
6039
  let placed = false;
@@ -5766,61 +6051,12 @@ const separateEventsToInnerRows = (events) => {
5766
6051
  return rows;
5767
6052
  };
5768
6053
 
5769
- const TimeLine = ({ left, top = "0px", height, color, width = "2px", zIndexNumber = 0 }) => {
5770
- return (jsxRuntime.jsx("div", { style: {
5771
- position: "absolute",
5772
- top: top,
5773
- height: height,
5774
- left: left,
5775
- width: width,
5776
- background: color,
5777
- pointerEvents: "none",
5778
- zIndex: zIndexNumber,
5779
- } }));
6054
+ const DivisionLine = ({ left, top = "0px", height }) => {
6055
+ return (jsxRuntime.jsx(TimeLine, { color: "rgba(255,255,255,1)", left: left + "%", height: height, width: 1 + "px", top: top }));
5780
6056
  };
5781
6057
 
5782
6058
  const WeekEndLine = ({ left, top = "0px", height, widthPercentage }) => {
5783
- return (jsxRuntime.jsx(TimeLine, { color: "rgba(0,0,0,0.08)", left: left + "%", height: height, width: widthPercentage + "%", top: top }));
5784
- };
5785
-
5786
- const BackgroundEvent = ({ value, }) => {
5787
- return value.isVisible ? (jsxRuntime.jsx("div", { style: {
5788
- left: `${value.left}%`,
5789
- width: `${value.width}%`,
5790
- position: "absolute",
5791
- height: "100%",
5792
- }, children: jsxRuntime.jsx("div", { style: {
5793
- overflow: "hidden",
5794
- backgroundColor: value.color,
5795
- height: "100%",
5796
- }, children: jsxRuntime.jsx("div", { style: {
5797
- display: "flex",
5798
- flexDirection: "row",
5799
- alignItems: "stretch",
5800
- width: "100%",
5801
- contentVisibility: "auto",
5802
- }, children: jsxRuntime.jsxs("div", { style: {
5803
- flex: 1,
5804
- display: "flex",
5805
- flexDirection: "row",
5806
- alignItems: "center",
5807
- whiteSpace: "nowrap",
5808
- overflow: "hidden",
5809
- width: value.width + "%",
5810
- }, children: [jsxRuntime.jsx("div", { style: {
5811
- display: "flex",
5812
- flexDirection: "row",
5813
- alignItems: "center",
5814
- whiteSpace: "nowrap",
5815
- color: value.isLightColor ? "black" : "white",
5816
- }, children: value.icons }), jsxRuntime.jsx("span", { style: {
5817
- padding: "0.2rem",
5818
- color: value.isLightColor ? "black" : "white"
5819
- }, children: value.name })] }) }) }) })) : null;
5820
- };
5821
-
5822
- const DivisionLine = ({ left, top = "0px", height }) => {
5823
- return (jsxRuntime.jsx(TimeLine, { color: "rgba(255,255,255,1)", left: left + "%", height: height, width: 1 + "px", top: top }));
6059
+ return (jsxRuntime.jsx(TimeLine, { color: "rgba(0,0,0,0.05)", left: left + "%", height: height, width: widthPercentage + "%", top: top }));
5824
6060
  };
5825
6061
 
5826
6062
  const onClickMenuItem$1 = (e, event) => {
@@ -5833,33 +6069,30 @@ const onClickMenuItem$1 = (e, event) => {
5833
6069
  };
5834
6070
  const SchedulerRow = React.memo((props) => {
5835
6071
  const [isContextMenuOpen, setIsContextMenuOpen] = React.useState(false);
5836
- const { events, backgroundEvents, rowHeader, contextMenuItems, RowTitleComp, EventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
6072
+ const { events, backgroundEvents, rowHeader, contextMenuItems, RowTitleComp, EventComp, BackgroundEventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
5837
6073
  const internalRows = separateEventsToInnerRows(events);
5838
6074
  const { handleClick, handleDoubleClick } = useSingleAndDoubleClicks((e) => {
5839
6075
  e.stopPropagation();
5840
6076
  e.preventDefault();
5841
- onEvent(new OnClickRowEvent(rowHeader.value.resourceId));
6077
+ onEvent(new OnClickRowEvent(rowHeader.value.rowId));
5842
6078
  }, (e) => {
5843
6079
  e.stopPropagation();
5844
6080
  e.preventDefault();
5845
- onEvent(new OnDoubleClickRowEvent(rowHeader.value.resourceId));
6081
+ onEvent(new OnDoubleClickRowEvent(rowHeader.value.rowId));
5846
6082
  });
5847
6083
  return (jsxRuntime.jsxs("div", { style: {
5848
6084
  display: "flex",
5849
- // contentVisibility: "auto",
5850
- // containIntrinsicSize: "auto auto"
6085
+ minHeight: props.rowHeightInRem + "rem",
5851
6086
  }, children: [jsxRuntime.jsx(RowTitleComp, { ...rowHeader }), jsxRuntime.jsx(antd.Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottomCenter", menu: {
5852
6087
  items: contextMenuItems,
5853
6088
  onClick: (e) => {
5854
6089
  onClickMenuItem$1(e, () => {
5855
- onEvent(new OnClickContextMenu(rowHeader.value.resourceId, e.key));
6090
+ onEvent(new OnClickContextMenu(rowHeader.value.rowId, e.key));
5856
6091
  });
5857
6092
  },
5858
6093
  onMouseLeave: () => setIsContextMenuOpen(false),
5859
6094
  }, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (contextMenuItems?.length ?? 0) > 0, children: jsxRuntime.jsxs("div", { style: {
5860
6095
  flex: 1,
5861
- background: rowHeader.color,
5862
- borderLeft: "1px white solid",
5863
6096
  display: "flex",
5864
6097
  flexDirection: "column",
5865
6098
  position: "relative",
@@ -5867,11 +6100,15 @@ const SchedulerRow = React.memo((props) => {
5867
6100
  e.preventDefault();
5868
6101
  const percentage = getPercentageFromMouseEvent(e);
5869
6102
  const date = dateFromPercentage(selectedDate, visibleDays, percentage);
5870
- if (e.ctrlKey) {
5871
- onEvent(new OnDropCtrlEvent(rowHeader.value.resourceId, date));
6103
+ // https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform
6104
+ // change for navigator.userAgentData.platform when acepted in all browsers
6105
+ const isMac = navigator.platform.toUpperCase().includes("MAC");
6106
+ const isCtrlOrAltPressed = isMac ? e.altKey : e.ctrlKey;
6107
+ if (isCtrlOrAltPressed) {
6108
+ onEvent(new OnDropCtrlEvent(rowHeader.value.rowId, date));
5872
6109
  }
5873
6110
  else {
5874
- onEvent(new OnDropEvent(rowHeader.value.resourceId, date));
6111
+ onEvent(new OnDropEvent(rowHeader.value.rowId, date));
5875
6112
  }
5876
6113
  }, onDragOver: (e) => {
5877
6114
  e.preventDefault();
@@ -5880,16 +6117,21 @@ const SchedulerRow = React.memo((props) => {
5880
6117
  e.stopPropagation();
5881
6118
  const percentage = getPercentageFromMouseEvent(e);
5882
6119
  const date = dateFromPercentage(selectedDate, visibleDays, percentage);
5883
- onEvent(new OnRightClickRow(rowHeader.value.resourceId, date));
6120
+ onEvent(new OnRightClickRow(rowHeader.value.rowId, date));
5884
6121
  }, children: [weekendLines.map((weekend) => (jsxRuntime.jsx(WeekEndLine, { height: "100%", left: weekend.left, widthPercentage: weekend.width }))), divisionLines.map((division) => (jsxRuntime.jsx(DivisionLine, { height: "100%", left: division.left }))), backgroundEvents.length > 0 && backgroundEvents.some((e) => e.isVisible) && (jsxRuntime.jsx("div", { style: {
5885
6122
  height: "100%",
5886
6123
  position: internalRows.length > 0 ? "absolute" : "relative",
5887
6124
  width: "100%",
6125
+ pointerEvents: "none",
5888
6126
  }, children: backgroundEvents.map((event) => {
5889
- return jsxRuntime.jsx(BackgroundEvent, { value: { ...event }, onEvent: onEvent, heightRem: props.remHeight });
5890
- }) })), backgroundEvents.length === 0 && internalRows.length === 0 && (jsxRuntime.jsx("div", { style: { position: "relative", height: props.remHeight + "rem" } })), internalRows.map((internalRow, index) => {
5891
- return (jsxRuntime.jsx("div", { style: { position: "relative", height: props.remHeight + "rem" }, children: internalRow.map((event, index) => (jsxRuntime.jsx(EventComp, { value: event, heightRem: props.remHeight, onEvent: onEvent }, index))) }, index));
5892
- }), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsxRuntime.jsx(TimeLine, { color: "red", left: timeLinePercentage + "%", top: "0px", height: `100%` }))] }) }, rowHeader.value.resourceId)] }));
6127
+ return jsxRuntime.jsx(BackgroundEventComp, { value: { ...event }, onEvent: onEvent, heightRem: props.rowHeightInRem * Math.max(1, internalRows.length) });
6128
+ }) })), backgroundEvents.length === 0 && internalRows.length === 0 && (jsxRuntime.jsx("div", { style: { position: "relative", height: props.rowHeightInRem + "rem" } })), internalRows.map((internalRow, index) => {
6129
+ return (jsxRuntime.jsx("div", { style: {
6130
+ position: "relative",
6131
+ height: props.rowHeightInRem + "rem",
6132
+ pointerEvents: "none"
6133
+ }, children: internalRow.map((event, index) => (jsxRuntime.jsx(EventComp, { value: event, heightRem: props.rowHeightInRem, onEvent: onEvent }, index))) }, index));
6134
+ }), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsxRuntime.jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "0px", height: `100%` }))] }) }, rowHeader.value.rowId)] }));
5893
6135
  }, (prevProps, nextProps) => {
5894
6136
  // This memo is necessary to prevent re-render all the rows when a user makes drag and drop
5895
6137
  const getEventKey = (event) => {
@@ -5955,9 +6197,12 @@ const getDayDivisions = (visibleDays, selectedDate) => {
5955
6197
  const divisions = getHoursFromDivisions(divisionsNumber);
5956
6198
  const calculatedDivision = [];
5957
6199
  for (let i = 0; i < visibleDays; i++) {
6200
+ const currentDate = moment(selectedDate).add(i, "days");
5958
6201
  calculatedDivision.push({
5959
- top: moment(selectedDate).add(i, "days").format("DD.MM.YYYY"),
6202
+ top: currentDate.format("DD.MM.YYYY"),
5960
6203
  bottom: divisions,
6204
+ startDate: currentDate.toDate(),
6205
+ endDate: currentDate.toDate()
5961
6206
  });
5962
6207
  }
5963
6208
  return calculatedDivision;
@@ -5966,12 +6211,15 @@ const getWeekDivisions = (visibleDays, selectedDate) => {
5966
6211
  const weeks = getWeeksByDays(visibleDays, selectedDate);
5967
6212
  const divisions = weeks.map((week) => {
5968
6213
  const days = Array.from({ length: week.days }, (_, i) => moment(week.start).add(i, "days").date().toString());
6214
+ const weekEnd = moment(week.start).add(week.days - 1, "days");
5969
6215
  const top = days.length > 2
5970
6216
  ? moment(week.start).format("DD.MM.YYYY") + " - " + moment(week.start).add(week.days - 1, "days").format("DD.MM.YYYY")
5971
6217
  : moment(week.start).format("DD.MM.YYYY");
5972
6218
  const division = {
5973
6219
  top: top,
5974
6220
  bottom: days,
6221
+ startDate: moment(week.start).toDate(),
6222
+ endDate: weekEnd.toDate()
5975
6223
  };
5976
6224
  return division;
5977
6225
  });
@@ -5981,9 +6229,12 @@ const getMonthDivisions = (visibleDays, selectedDate) => {
5981
6229
  const months = getMonthsByDays(visibleDays, selectedDate);
5982
6230
  const divisions = months.map((month) => {
5983
6231
  const days = Array.from({ length: month.days }, (_, i) => moment(month.start).add(i, "days").date().toString());
6232
+ const monthEnd = moment(month.start).add(month.days - 1, "days");
5984
6233
  const division = {
5985
6234
  top: moment(month.start).format("MM.YYYY"),
5986
6235
  bottom: days,
6236
+ startDate: moment(month.start).toDate(), // Añadir fecha de inicio
6237
+ endDate: monthEnd.toDate()
5987
6238
  };
5988
6239
  return division;
5989
6240
  });
@@ -6094,6 +6345,19 @@ function getLinesByDivisions(headerDivision, _) {
6094
6345
  return finalLines;
6095
6346
  }
6096
6347
 
6348
+ const sortByCategoryAndTitle = (previous, next, orderCategories) => {
6349
+ for (const orderCategory of orderCategories) {
6350
+ const prevOrder = previous[orderCategory];
6351
+ const nextOrder = next[orderCategory];
6352
+ if (prevOrder !== nextOrder) {
6353
+ return prevOrder > nextOrder ? 1 : -1;
6354
+ }
6355
+ }
6356
+ const prevTitle = previous["title"];
6357
+ const nextTitle = next["title"];
6358
+ return prevTitle > nextTitle ? 1 : -1;
6359
+ };
6360
+
6097
6361
  const getWeekendLinesByDatesVisible = (initialDate, visibleDays) => {
6098
6362
  const dateString = initialDate.toISOString().split('T')[0];
6099
6363
  const todayAtO = new Date(dateString);
@@ -6120,35 +6384,6 @@ const getWeekendsDaysInDateRange = (initialDate, visibleDays) => {
6120
6384
 
6121
6385
  class UiEvent {
6122
6386
  }
6123
- function when(event) {
6124
- let found = false;
6125
- const actions = {
6126
- case(eventType, action) {
6127
- if (!found && event instanceof eventType) {
6128
- action(event);
6129
- found = true;
6130
- }
6131
- return actions;
6132
- },
6133
- else(action) {
6134
- if (!found) {
6135
- action(event);
6136
- }
6137
- }
6138
- };
6139
- return actions;
6140
- }
6141
-
6142
- const sortByCategoryAndTitle = (previous, next, orderCategory) => {
6143
- const prevOrder = previous[orderCategory] ?? "";
6144
- const nextOrder = next[orderCategory] ?? "";
6145
- if (prevOrder === nextOrder) {
6146
- const prevTitle = previous["title"] ?? "";
6147
- const nextTitle = next["title"] ?? "";
6148
- return prevTitle > nextTitle ? 1 : -1;
6149
- }
6150
- return prevOrder > nextOrder ? 1 : -1;
6151
- };
6152
6387
 
6153
6388
  const getNow = (isUtc) => {
6154
6389
  let now = new Date();
@@ -6158,32 +6393,39 @@ const getNow = (isUtc) => {
6158
6393
  return now;
6159
6394
  };
6160
6395
  const Scheduler = (props) => {
6161
- const { header: headerContent, id, events, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategory = "title", useOrderCategory, onEvent, } = props;
6396
+ const { header: headerContent, id, events: eventsState, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, } = props;
6397
+ const BackgroundEventComp = props.BackgroundEventComp ?? BackgroundEvent;
6162
6398
  const rows = useOrderCategory === false
6163
6399
  ? props.rows
6164
- : props.rows.sort((a, b) => sortByCategoryAndTitle(a, b, orderCategory));
6400
+ : props.rows.sort((a, b) => sortByCategoryAndTitle(a, b, orderCategories));
6165
6401
  const instanceRef = React.useRef(null);
6402
+ // const rowHeaderWidth = "180px";
6403
+ const { selectedDate, visibleDays, isUtc, isHeaderVisible, visibleRows: stateVisibleRows } = props.state;
6404
+ const events = eventsState.filter((event) => {
6405
+ const lastDayOfScheduler = moment(selectedDate).add(visibleDays, "days");
6406
+ return (moment(event.endDate).isAfter(selectedDate) &&
6407
+ moment(event.startDate).isBefore(lastDayOfScheduler));
6408
+ });
6166
6409
  React.useEffect(() => {
6167
- console.debug("scheduler");
6168
6410
  instanceRef.current?.resetAfterIndex(0);
6169
- }, [orderCategory, props.rows.length]);
6170
- const rowHeaderWidth = "150px";
6171
- const { selectedDate, visibleDays, isUtc, isHeaderVisible, visibleRows: stateVisibleRows } = props.state;
6411
+ }, [orderCategories, props.rows.length, events]);
6412
+ const notEmptyRows = stateVisibleRows ?? rows.length;
6413
+ const visibleRows = height(events, rows, notEmptyRows);
6414
+ const totalHours = visibleDays * 24;
6415
+ const [timeLinePercentage, setTimeLinePercentage] = React.useState(0);
6172
6416
  const header = {
6173
6417
  content: headerContent,
6174
- divisions: isHeaderVisible ? getDefaultDivisions(visibleDays, selectedDate) : [],
6418
+ divisions: getDefaultDivisions(visibleDays, selectedDate),
6175
6419
  visibleDays: visibleDays,
6176
6420
  width: rowHeaderWidth,
6177
6421
  selectedDate,
6178
6422
  onEvent,
6423
+ timeLinePercentage: timeLinePercentage,
6424
+ isUtc: isUtc
6179
6425
  };
6180
- const notEmptyRows = stateVisibleRows ?? rows.length;
6181
- const visibleRows = notEmptyRows > rows.length ? rows.length : notEmptyRows;
6182
- const totalHours = visibleDays * 24;
6183
- const [timeLinePercentage, setTimeLinePercentage] = React.useState(0);
6184
- const evenColor = "#EEEEEE";
6185
- const oddColor = "#E0E0EF";
6186
- const rowsHeight = 2.5; // rem
6426
+ const evenColor = "var(--cw-color-surface-container-low)";
6427
+ const oddColor = "var(--cw-color-surface-container)";
6428
+ const rowsHeight = 1.75; // rem
6187
6429
  const schedulerContentHeight = rowsHeight * visibleRows;
6188
6430
  const weekendsLines = getWeekendLinesByDatesVisible(selectedDate, visibleDays);
6189
6431
  const divisionLines = getLinesByDivisions(header.divisions);
@@ -6194,35 +6436,33 @@ const Scheduler = (props) => {
6194
6436
  setTimeLinePercentage(percentage);
6195
6437
  };
6196
6438
  updateTimeLinePercentage();
6197
- const interval = setInterval(updateTimeLinePercentage, 60_000);
6439
+ const interval = setInterval(updateTimeLinePercentage, 10_000);
6198
6440
  return () => clearInterval(interval);
6199
6441
  }, [selectedDate, isUtc, totalHours]);
6200
6442
  // Memoized Row Component
6201
6443
  const Row = React.memo(({ index, style }) => {
6202
6444
  const row = rows[index];
6445
+ const rowColor = groupRowColors
6446
+ ? Math.floor(index / 2) % 2 === 0 ? evenColor : oddColor
6447
+ : index % 2 === 0 ? evenColor : oddColor;
6203
6448
  const header = {
6204
6449
  value: row,
6205
- color: index % 2 === 0 ? evenColor : oddColor,
6206
6450
  width: rowHeaderWidth,
6207
6451
  onEvent: onEvent,
6208
6452
  };
6209
- return (jsxRuntime.jsx("div", { style: style, children: jsxRuntime.jsx(SchedulerRow, { events: events.filter((it) => it.resourceId === row.resourceId), backgroundEvents: backgroundEvents.filter((it) => it.resourceId === row.resourceId), rowHeader: header, EventComp: EventComp, RowTitleComp: RowTitleComp, weekendLines: weekendsLines, divisionLines: divisionLines, timeLinePercentage: timeLinePercentage, remHeight: rowsHeight, onEvent: onEvent, contextMenuItems: contextMenuItems, visibleDays: visibleDays, selectedDate: selectedDate }) }));
6453
+ return (jsxRuntime.jsx("div", { style: {
6454
+ ...style,
6455
+ backgroundColor: rowColor
6456
+ }, children: jsxRuntime.jsx(SchedulerRow, { events: events.filter((it) => it.rowId === row.rowId), backgroundEvents: backgroundEvents.filter((it) => it.rowId === row.rowId), rowHeader: header, EventComp: EventComp, BackgroundEventComp: BackgroundEventComp, RowTitleComp: RowTitleComp, weekendLines: weekendsLines, divisionLines: divisionLines, timeLinePercentage: timeLinePercentage, rowHeightInRem: rowsHeight, onEvent: onEvent, contextMenuItems: contextMenuItems, visibleDays: visibleDays, selectedDate: selectedDate }) }));
6210
6457
  });
6211
- const getItemSize = (index) => {
6458
+ const getItemSize = React.useCallback((index) => {
6212
6459
  const row = rows[index];
6213
- const filteredEvents = events
6214
- .filter((it) => {
6215
- return it.resourceId === row.resourceId;
6216
- })
6217
- .filter((event) => {
6218
- return (event.endDate > selectedDate &&
6219
- moment(event.startDate).isBefore(moment(selectedDate).add(visibleDays, "days")));
6220
- });
6460
+ const filteredEvents = events.filter((it) => it.rowId === row.rowId);
6221
6461
  const innerRows = separateEventsToInnerRows(filteredEvents);
6222
6462
  const rowsNumber = innerRows.length > 0 ? innerRows.length : 1;
6223
6463
  const pixelsInRem = 16;
6224
6464
  return rowsNumber * rowsHeight * pixelsInRem;
6225
- };
6465
+ }, [rows, events, selectedDate, visibleDays, rowsHeight]);
6226
6466
  // Render
6227
6467
  return (jsxRuntime.jsxs("div", { id: id, style: {
6228
6468
  position: "relative",
@@ -6233,15 +6473,16 @@ const Scheduler = (props) => {
6233
6473
  position: "sticky",
6234
6474
  top: 0,
6235
6475
  zIndex: 1,
6236
- }, children: jsxRuntime.jsx(SchedulerHeader, { ...header }) })), jsxRuntime.jsx("style", { children: `
6237
- .hide-scrollbar::-webkit-scrollbar {
6238
- display: none;
6239
- }
6240
- .hide-scrollbar {
6241
- -ms-overflow-style: none;
6242
- scrollbar-width: none;
6243
- }
6244
- ` }), jsxRuntime.jsx(reactWindow.VariableSizeList, { height: schedulerContentHeight * 16, itemCount: rows.length, itemSize: getItemSize, width: "100%", style: { overflowX: "hidden" }, ref: instanceRef, className: "hide-scrollbar", children: Row })] }));
6476
+ }, children: jsxRuntime.jsx(SchedulerHeader, { ...header }) })), jsxRuntime.jsx(reactWindow.VariableSizeList, { height: schedulerContentHeight * 16, itemCount: rows.length, itemSize: getItemSize, width: "100%", style: { overflowX: "hidden" }, ref: instanceRef, className: styles$1["hide-scrollbar"], children: Row })] }));
6477
+ };
6478
+ const height = (events, rows, rowsNumber) => {
6479
+ const selectedRows = rows.slice(0, rowsNumber);
6480
+ const flatMapped = selectedRows.flatMap(row => {
6481
+ const newEvents = events.filter(it => it.rowId === row.rowId);
6482
+ const innerRows = separateEventsToInnerRows(newEvents);
6483
+ return innerRows.length > 0 ? innerRows : [[]];
6484
+ });
6485
+ return flatMapped.length;
6245
6486
  };
6246
6487
 
6247
6488
  let topsCounter = 0;
@@ -6485,7 +6726,7 @@ class CwSuperScheduler extends React__namespace.Component {
6485
6726
  ? this.props.pinnedEvents.filter(x => this.state.pinnedResources.includes(x.resourceId))
6486
6727
  : new Array();
6487
6728
  const notPinnedEvents = this.props.events.filter(x => !this.props.pinnedResources?.includes(x.resourceId));
6488
- return (jsxRuntime.jsxs("div", { className: "cwelltSuperScheduler_content", children: [jsxRuntime.jsx(CwScheduler, { id: "crewPinnedScheduler", events: pinnedEvents, resources: firstSchedulerResources, height: this.state.height, startDate: this.props.startDate, endDate: this.props.endDate, scheduler_handleCblEventClick: this.props.scheduler_handleCblEventClick, scheduler_handleCblEventClickRight: this.props.scheduler_handleCblEventClickRight, scheduler_handleCblEventDoubleClick: this.props.scheduler_handleCblEventDoubleClick, scheduler_handleOnDropCblEventsOnResource: this.props.scheduler_handleOnDropCblEventsOnResource, parent: this.props.parent, cblEventComp: this.props.cblEventComp, scheduler_handleOnClickEventContextMenu: this.props.scheduler_handleOnClickEventContextMenu, resourceComp: this.props.resourceComp, scheduler_handleOnClickContextMenuResource: this.props.scheduler_handleOnClickContextMenuResource, resourceContextMenuContents: this.props.resourceContextMenuContents, scheduler_handleDblClickOnResourceInScheduler: this.props.scheduler_handleDblClickOnResourceInScheduler, scheduler_handleEmptyClick: this.props.scheduler_handleEmptyClick, canBePinned: false, scheduler_handlePinned: this.scheduler_handlePinnedClick, resourceName: this.props.resourceName, descriptionColumn: this.props.descriptionColumn, scheduler_handleOnClickResourceContextMenu: this.props.scheduler_handleOnClickResourceContextMenu, groupByFunction: this.props.groupByFunction }), havePinnedResources && (jsxRuntime.jsx("div", { style: { padding: "0.5rem" }, children: jsxRuntime.jsx(CwButton, { "$text": "Clear", onClick: () => {
6729
+ return (jsxRuntime.jsxs("div", { className: "cwelltSuperScheduler_content", children: [jsxRuntime.jsx(CwScheduler, { id: "crewPinnedScheduler", events: pinnedEvents, resources: firstSchedulerResources, height: this.state.height, startDate: this.props.startDate, endDate: this.props.endDate, scheduler_handleCblEventClick: this.props.scheduler_handleCblEventClick, scheduler_handleCblEventClickRight: this.props.scheduler_handleCblEventClickRight, scheduler_handleCblEventDoubleClick: this.props.scheduler_handleCblEventDoubleClick, scheduler_handleOnDropCblEventsOnResource: this.props.scheduler_handleOnDropCblEventsOnResource, parent: this.props.parent, cblEventComp: this.props.cblEventComp, scheduler_handleOnClickEventContextMenu: this.props.scheduler_handleOnClickEventContextMenu, resourceComp: this.props.resourceComp, scheduler_handleOnClickContextMenuResource: this.props.scheduler_handleOnClickContextMenuResource, resourceContextMenuContents: this.props.resourceContextMenuContents, scheduler_handleDblClickOnResourceInScheduler: this.props.scheduler_handleDblClickOnResourceInScheduler, scheduler_handleEmptyClick: this.props.scheduler_handleEmptyClick, canBePinned: false, scheduler_handlePinned: this.scheduler_handlePinnedClick, resourceName: this.props.resourceName, descriptionColumn: this.props.descriptionColumn, scheduler_handleOnClickResourceContextMenu: this.props.scheduler_handleOnClickResourceContextMenu, groupByFunction: this.props.groupByFunction }), havePinnedResources && (jsxRuntime.jsx("div", { style: { padding: "0.5rem" }, children: jsxRuntime.jsx(CwButton, { text: "Clear", onClick: () => {
6489
6730
  this.props.scheduler_handleClearPinnedOnParent();
6490
6731
  } }) })), jsxRuntime.jsx(CwScheduler, { id: "crewAssignmentsScheduler", events: notPinnedEvents, resources: secondSchedulerResources, height: this.props.height, startDate: this.props.startDate, endDate: this.props.endDate, scheduler_handleCblEventClick: this.props.scheduler_handleCblEventClick, scheduler_handleCblEventClickRight: this.props.scheduler_handleCblEventClickRight, scheduler_handleCblEventDoubleClick: this.props.scheduler_handleCblEventDoubleClick, scheduler_handleOnDropCblEventsOnResource: this.props.scheduler_handleOnDropCblEventsOnResource, parent: this.props.parent, cblEventComp: this.props.cblEventComp, scheduler_handleOnClickEventContextMenu: this.props.scheduler_handleOnClickEventContextMenu, resourceComp: this.props.resourceComp, scheduler_handleOnClickContextMenuResource: this.handleOnClickContextMenuResource, resourceContextMenuContents: this.props.resourceContextMenuContents, scheduler_handleDblClickOnResourceInScheduler: this.props.scheduler_handleDblClickOnResourceInScheduler, scheduler_handleEmptyClick: this.props.scheduler_handleEmptyClick, canBePinned: true, scheduler_handlePinned: this.scheduler_handlePinnedClick, scheduler_handleCblEventResize: this.props.scheduler_handleCblEventResize, resourceName: this.props.resourceName, descriptionColumn: this.props.descriptionColumn, scheduler_handleOnClickResourceContextMenu: this.props.scheduler_handleOnClickResourceContextMenu, airportSelected: this.props.airportSelected, module: this.props.module, groupByFunction: this.props.groupByFunction })] }));
6491
6732
  }
@@ -6564,6 +6805,8 @@ class Resource {
6564
6805
  }
6565
6806
  }
6566
6807
 
6808
+ var styles = {"super-scheduler-row-header":"super-scheduler-module_super-scheduler-row-header__TTs4e","indicators":"super-scheduler-module_indicators__f4lIT","scheduler-crewmember-functions":"super-scheduler-module_scheduler-crewmember-functions__BS2hs"};
6809
+
6567
6810
  class OnPinRow {
6568
6811
  id;
6569
6812
  constructor(id) {
@@ -6588,107 +6831,37 @@ const onClickMenuItem = (e, event) => {
6588
6831
  e.domEvent.stopPropagation();
6589
6832
  event();
6590
6833
  };
6591
- const PinRowHeader = ({ value, color, width, onEvent }) => {
6834
+ const PinRowHeader = ({ value, width, onEvent }) => {
6592
6835
  const [isContextMenuOpen, setIsContextMenuOpen] = React.useState(false);
6593
6836
  const { highlightColor, isLoading } = value;
6594
6837
  return (jsxRuntime.jsxs("div", { style: {
6595
- display: "flex",
6596
- justifyContent: "space-around",
6597
- alignItems: "center",
6598
6838
  width: width,
6599
- background: highlightColor ?? color,
6600
- }, children: [jsxRuntime.jsx("button", { className: "cw-button-icon", onClick: (_) => {
6601
- onEvent(value.isPinned ? new OnUnpinRow(value.resourceId) : new OnPinRow(value.resourceId));
6602
- }, children: jsxRuntime.jsx("div", { style: {
6603
- transform: value.isPinned ? undefined : "rotateY(0deg) rotate(45deg)",
6604
- alignSelf: "center",
6605
- }, children: jsxRuntime.jsx(CwIcon, { "$id": "thumbtack fa-xs" }) }) }), value.indicators ?? undefined, jsxRuntime.jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", dissapearsWhenHover: true, overlayStyle: value.overlayTooltipStyle, children: jsxRuntime.jsx(antd.Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottomCenter", menu: {
6839
+ background: highlightColor,
6840
+ }, className: styles["super-scheduler-row-header"], children: [jsxRuntime.jsx("button", { className: "cw-button-icon cwi-pin", "data-pinned": value.isPinned, onClick: (_) => {
6841
+ onEvent(value.isPinned ? new OnUnpinRow(value.rowId) : new OnPinRow(value.rowId));
6842
+ } }), jsxRuntime.jsx("div", { className: styles["indicators"], children: value.indicators ?? undefined }), jsxRuntime.jsx(CwGenericTooltip, { content: value.tooltip, position: "right", dissapearsWhenHover: true, overlayStyle: value.overlayTooltipStyle, children: jsxRuntime.jsx(antd.Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottomCenter", menu: {
6606
6843
  items: value.contextMenuItems,
6607
6844
  onClick: (e) => {
6608
6845
  onClickMenuItem(e, () => {
6609
- onEvent(new OnClickContextMenu(value.resourceId, e.key));
6846
+ onEvent(new OnClickContextMenu(value.rowId, e.key));
6610
6847
  });
6611
6848
  },
6612
6849
  onMouseLeave: () => setIsContextMenuOpen(false),
6613
- }, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (value.contextMenuItems?.length ?? 0) > 0, children: jsxRuntime.jsxs("div", { style: {
6850
+ }, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (value.contextMenuItems?.length ?? 0) > 0, children: jsxRuntime.jsxs("div", { className: styles["scheduler-row-header"], style: {
6614
6851
  display: "flex",
6615
6852
  flexDirection: "column",
6616
6853
  justifyContent: "center",
6617
- alignItems: "center",
6618
- }, children: [jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [jsxRuntime.jsx("span", { style: { fontWeight: "bold" }, children: value.title }), value.title2 && jsxRuntime.jsxs("span", { children: ["-", value.title2] })] }), jsxRuntime.jsxs("div", { style: {
6619
- display: "flex",
6620
- flexDirection: "row",
6621
- alignItems: "center",
6622
- color: "lightgray"
6623
- }, children: [value.subtitle && jsxRuntime.jsx("span", { style: { fontWeight: "bold" }, children: value.subtitle }), value.subtitle2 && jsxRuntime.jsxs("span", { children: ["-", value.subtitle2] })] })] }) }, value.resourceId) }, value.resourceId), isLoading ? jsxRuntime.jsx(CwIcon, { "$id": "spinner fa-spin" }) : undefined] }));
6854
+ alignItems: "flex-start",
6855
+ }, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: value.title }), value.title2 && jsxRuntime.jsxs("span", { children: ["-", value.title2] }), value.title3 && jsxRuntime.jsxs("span", { className: styles["scheduler-crewmember-functions"], children: [" (", value.title3, ")"] })] }), value.subtitle && jsxRuntime.jsxs("div", { style: { opacity: 0.5 }, children: [jsxRuntime.jsx("strong", { children: value.subtitle }), value.subtitle2 && jsxRuntime.jsxs("span", { children: ["-", value.subtitle2] })] })] }) }, value.rowId) }, value.rowId), isLoading ? jsxRuntime.jsx(CwIcon, { iconId: "spinner fa-spin" }) : undefined] }));
6624
6856
  };
6625
6857
 
6626
6858
  const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, contextMenuItems, onEvent }) => {
6627
- React.useEffect(() => {
6628
- setNotPinnedRows(rows.filter((it) => !it.isPinned));
6629
- setPinnedRows(rows.filter((it) => it.isPinned));
6630
- }, [rows, events]);
6631
- const [pinnedRows, setPinnedRows] = React.useState([]);
6632
- const [notPinnedRows, setNotPinnedRows] = React.useState([]);
6633
- const customOnEvent = (event) => {
6634
- when(event)
6635
- .case(OnClearPinned, () => {
6636
- setPinnedRows((old) => {
6637
- const oldPinned = old.map((it) => {
6638
- return { ...it, isPinned: false };
6639
- });
6640
- setNotPinnedRows((oldNotPinned) => {
6641
- return [...oldPinned, ...oldNotPinned];
6642
- });
6643
- return [];
6644
- });
6645
- })
6646
- .case(OnPinRow, (event) => {
6647
- setNotPinnedRows((oldNotPinned) => {
6648
- const newNotPinned = [...oldNotPinned];
6649
- const rowToModifyIndex = oldNotPinned.findIndex((it) => it.resourceId == event.id);
6650
- const rowToModify = oldNotPinned[rowToModifyIndex];
6651
- newNotPinned.splice(rowToModifyIndex, 1);
6652
- const modifiedRow = {
6653
- ...rowToModify,
6654
- isPinned: true,
6655
- };
6656
- setPinnedRows((oldPinned) => {
6657
- const modifiedResources = [...oldPinned];
6658
- modifiedResources.push(modifiedRow);
6659
- return modifiedResources;
6660
- });
6661
- return newNotPinned;
6662
- });
6663
- })
6664
- .case(OnUnpinRow, (event) => {
6665
- setPinnedRows((oldPinned) => {
6666
- const modifiedPinnedRows = [...oldPinned];
6667
- const rowToModifyIndex = oldPinned.findIndex((it) => it.resourceId == event.id);
6668
- const rowToModify = oldPinned[rowToModifyIndex];
6669
- modifiedPinnedRows.splice(rowToModifyIndex, 1);
6670
- const modifiedRow = {
6671
- ...rowToModify,
6672
- isPinned: false,
6673
- };
6674
- setNotPinnedRows((oldNotPinned) => {
6675
- const modifiedResources = [...oldNotPinned];
6676
- modifiedResources.push(modifiedRow);
6677
- return modifiedResources;
6678
- });
6679
- return modifiedPinnedRows;
6680
- });
6681
- })
6682
- .else((event) => {
6683
- onEvent(event);
6684
- });
6685
- };
6859
+ const pinnedRows = rows.filter((it) => it.isPinned);
6860
+ const notPinnedRows = rows.filter((it) => !it.isPinned);
6686
6861
  const isFirstVisible = pinnedRows.length > 0;
6687
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isFirstVisible && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Scheduler, { id: `${id}-pinned`, state: state, header: header, rows: pinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategory: pinnedOrderCategory, onEvent: customOnEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader }), jsxRuntime.jsx("div", { style: { padding: "1rem 0" }, children: jsxRuntime.jsx("button", { onClick: () => {
6688
- customOnEvent(new OnClearPinned());
6689
- }, children: "Clear pinned" }) })] })), jsxRuntime.jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategory: unPinnedOrderCategory, onEvent: (it) => {
6690
- customOnEvent(it);
6691
- }, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader })] }));
6862
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isFirstVisible && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Scheduler, { id: `${id}-pinned`, state: state, header: header, rows: pinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategories: pinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(CwButton, { onClick: () => {
6863
+ onEvent(new OnClearPinned());
6864
+ }, children: "Clear pinned" }) })] })), jsxRuntime.jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, contextMenuItems: contextMenuItems, orderCategories: unPinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: PinRowHeader })] }));
6692
6865
  };
6693
6866
 
6694
6867
  const { Option } = antd.Select;