@cwellt_software/cwellt-reactjs-lib 1.2.13 → 1.2.14

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 (774) hide show
  1. package/dist/content/icons/new-cw-icons/NewCwIcons.json +1 -204
  2. package/dist/content/icons/new-cw-icons/css/new-cw-icons.css +9 -1
  3. package/dist/content/icons/new-cw-icons/fonts/NewCwIcons.woff +0 -0
  4. package/dist/index.cjs.js +1170 -1592
  5. package/dist/index.css +1 -1
  6. package/dist/index.d.ts +323 -154
  7. package/dist/index.es.js +1165 -1592
  8. package/dist/playground/main.d.ts +4 -0
  9. package/dist/playground/main.d.ts.map +1 -0
  10. package/dist/src/common/classes/CwSelectList.js +12 -0
  11. package/dist/src/common/classes/CwSelectListItems.js +14 -0
  12. package/dist/src/common/functions/collections.d.ts.map +1 -1
  13. package/dist/src/common/functions/collections.js +18 -0
  14. package/dist/src/common/functions/colorManipulation.js +76 -0
  15. package/dist/src/common/functions/dsl/UiEventDSL.d.ts +1 -1
  16. package/dist/src/common/functions/dsl/UiEventDSL.js +20 -0
  17. package/dist/src/common/functions/useSingleAndDoubleClicks.js +28 -0
  18. package/dist/src/common/interfaces/CwFormTypes.d.ts +5 -0
  19. package/dist/src/common/interfaces/CwFormTypes.d.ts.map +1 -0
  20. package/dist/src/common/interfaces/CwSelectListProps.js +1 -0
  21. package/dist/src/components/control/action/button/CwButton.js +13 -0
  22. package/dist/src/components/control/action/buttons/CwButtons.js +188 -0
  23. package/dist/src/components/control/action/contextmenu/CwContextMenu.js +43 -0
  24. package/dist/src/components/control/action/contextual-menu/CwContextualMenu.js +55 -0
  25. package/dist/src/components/control/action/search/CwSearch.js +67 -0
  26. package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.js +11 -0
  27. package/dist/src/components/control/choice/checkbox/CwCheck.d.ts +15 -0
  28. package/dist/src/components/control/choice/checkbox/CwCheck.d.ts.map +1 -0
  29. package/dist/src/components/control/choice/checkbox/CwCheckbox.d.ts +4 -0
  30. package/dist/src/components/control/choice/checkbox/CwCheckbox.d.ts.map +1 -1
  31. package/dist/src/components/control/choice/checkbox/CwCheckbox.js +15 -0
  32. package/dist/src/components/control/choice/checkbox/CwCheckboxGroup.d.ts +35 -0
  33. package/dist/src/components/control/choice/checkbox/CwCheckboxGroup.d.ts.map +1 -0
  34. package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.js +99 -0
  35. package/dist/src/components/control/choice/dropdown/CwDropdown.js +27 -0
  36. package/dist/src/components/control/choice/dropdown/CwDropdownContainer.js +30 -0
  37. package/dist/src/components/control/choice/dropdown/CwDropdownFilter.js +10 -0
  38. package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +1 -1
  39. package/dist/src/components/control/choice/multi-filter/CwMultiFilter.js +298 -0
  40. package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts +1 -0
  41. package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts.map +1 -1
  42. package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.js +17 -0
  43. package/dist/src/components/control/choice/multiselect/CwHeadFilter.js +80 -0
  44. package/dist/src/components/control/choice/multiselect/CwMultiselect.js +393 -0
  45. package/dist/src/components/control/choice/multiselect/CwOptionList.js +36 -0
  46. package/dist/src/components/control/choice/option/CwOption.js +16 -0
  47. package/dist/src/components/control/choice/select/CwSelect.d.ts +7 -1
  48. package/dist/src/components/control/choice/select/CwSelect.d.ts.map +1 -1
  49. package/dist/src/components/control/choice/select/CwSelect.js +36 -0
  50. package/dist/src/components/control/choice/toggle/CwToggle.d.ts +1 -1
  51. package/dist/src/components/control/choice/toggle/CwToggle.d.ts.map +1 -1
  52. package/dist/src/components/control/choice/toggle/CwToggle.js +9 -0
  53. package/dist/src/components/control/input/any/CwInput.js +16 -0
  54. package/dist/src/components/control/input/color/CwColorPicker.js +210 -0
  55. package/dist/src/components/control/input/color/CwInputColor.d.ts +30 -0
  56. package/dist/src/components/control/input/color/CwInputColor.d.ts.map +1 -1
  57. package/dist/src/components/control/input/color/CwInputColor.js +142 -0
  58. package/dist/src/components/control/input/date/CwInputDate.js +29 -0
  59. package/dist/src/components/control/input/date-picker/CwInputDatePicker.js +109 -0
  60. package/dist/src/components/control/input/date-text/CwInputDateText.js +90 -0
  61. package/dist/src/components/control/input/datetime/CwInputDatetime.js +29 -0
  62. package/dist/src/components/control/input/digit/CwDigit.js +28 -0
  63. package/dist/src/components/control/input/file/CwFileUpload.js +52 -0
  64. package/dist/src/components/control/input/file/CwFileUploadMultiple.js +148 -0
  65. package/dist/src/components/control/input/image/CwInputImage.js +52 -0
  66. package/dist/src/components/control/input/image-area/CwImageArea.js +113 -0
  67. package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts.map +1 -1
  68. package/dist/src/components/control/input/new-dates/CwDateRangePicker.d.ts.map +1 -1
  69. package/dist/src/components/control/input/new-dates/CwDateTimePicker.d.ts +3 -1
  70. package/dist/src/components/control/input/new-dates/CwDateTimePicker.d.ts.map +1 -1
  71. package/dist/src/components/control/input/new-dates/CwDateTimePickerCompact.d.ts.map +1 -1
  72. package/dist/src/components/control/input/new-dates/CwTimePicker.d.ts.map +1 -1
  73. package/dist/src/components/control/input/new-dates/dateRangePresets.d.ts.map +1 -1
  74. package/dist/src/components/control/input/new-dates/example.d.ts +2 -0
  75. package/dist/src/components/control/input/new-dates/example.d.ts.map +1 -0
  76. package/dist/src/components/control/input/new-dates/usePickerPopup.d.ts +24 -0
  77. package/dist/src/components/control/input/new-dates/usePickerPopup.d.ts.map +1 -0
  78. package/dist/src/components/control/input/new-dates/utils/timezoneHelpers.d.ts +22 -0
  79. package/dist/src/components/control/input/new-dates/utils/timezoneHelpers.d.ts.map +1 -0
  80. package/dist/src/components/control/input/number/CwInputNumber.js +11 -0
  81. package/dist/src/components/control/input/phone/CwInputPhone.js +24 -0
  82. package/dist/src/components/control/input/text/CwInputText.d.ts +7 -0
  83. package/dist/src/components/control/input/text/CwInputText.d.ts.map +1 -1
  84. package/dist/src/components/control/input/text/CwInputText.js +31 -0
  85. package/dist/src/components/control/input/text-area/CwTextArea.d.ts +6 -0
  86. package/dist/src/components/control/input/text-area/CwTextArea.d.ts.map +1 -1
  87. package/dist/src/components/control/input/text-area/CwTextArea.js +9 -0
  88. package/dist/src/components/control/input/time/CwTime.js +29 -0
  89. package/dist/src/components/control/input/weekday/CwWeekdaySelector.js +143 -0
  90. package/dist/src/components/custom/find-airport/CwFindAirportComp.d.ts +1 -0
  91. package/dist/src/components/custom/find-airport/CwFindAirportComp.d.ts.map +1 -1
  92. package/dist/src/components/custom/find-airport/CwFindAirportComp.js +240 -0
  93. package/dist/src/components/custom/scheduler/CwSchedulerComp.d.ts.map +1 -1
  94. package/dist/src/components/custom/scheduler/CwSchedulerComp.js +211 -0
  95. package/dist/src/components/custom/scheduler/CwSuperSchedulerComp.d.ts.map +1 -1
  96. package/dist/src/components/custom/scheduler/CwSuperSchedulerComp.js +269 -0
  97. package/dist/src/components/custom/scheduler/components/EventRender.js +142 -0
  98. package/dist/src/components/custom/scheduler/components/ResourceListRender.js +12 -0
  99. package/dist/src/components/custom/scheduler/components/ResourceRender.js +26 -0
  100. package/dist/src/components/custom/scheduler/components/day_headers/DayHeader.js +13 -0
  101. package/dist/src/components/custom/scheduler/components/day_headers/MonthHeader.js +12 -0
  102. package/dist/src/components/custom/scheduler/components/day_headers/MyDaysHeader.js +62 -0
  103. package/dist/src/components/custom/scheduler/components/day_headers/WeekHeader.js +13 -0
  104. package/dist/src/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.js +24 -0
  105. package/dist/src/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.js +17 -0
  106. package/dist/src/components/custom/scheduler/components/scheduler_header/SchedulerHeader.js +26 -0
  107. package/dist/src/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.js +23 -0
  108. package/dist/src/components/custom/scheduler/components/time_headers/TimeHeader.js +31 -0
  109. package/dist/src/components/custom/scheduler/components/time_headers/TimeHeaderRow.js +16 -0
  110. package/dist/src/components/custom/scheduler/components/time_line/TimeLine.d.ts.map +1 -1
  111. package/dist/src/components/custom/scheduler/components/time_line/TimeLine.js +12 -0
  112. package/dist/src/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts.map +1 -1
  113. package/dist/src/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.js +5 -0
  114. package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts.map +1 -1
  115. package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDates.js +15 -0
  116. package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +1 -1
  117. package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.js +5 -0
  118. package/dist/src/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts.map +1 -1
  119. package/dist/src/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.js +43 -0
  120. package/dist/src/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts.map +1 -1
  121. package/dist/src/components/custom/scheduler/logic/dates/getMonthHeaderData.js +35 -0
  122. package/dist/src/components/custom/scheduler/logic/dates/getUtcToday.js +6 -0
  123. package/dist/src/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +1 -1
  124. package/dist/src/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.js +20 -0
  125. package/dist/src/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts.map +1 -1
  126. package/dist/src/components/custom/scheduler/logic/dates/listOfDatesToWeeks.js +55 -0
  127. package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts.map +1 -1
  128. package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisionType.js +13 -0
  129. package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts.map +1 -1
  130. package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisions.js +16 -0
  131. package/dist/src/components/custom/scheduler/logic/filtering/filterEvents.d.ts.map +1 -1
  132. package/dist/src/components/custom/scheduler/logic/filtering/filterEvents.js +33 -0
  133. package/dist/src/components/custom/scheduler/logic/filtering/filterResources.d.ts.map +1 -1
  134. package/dist/src/components/custom/scheduler/logic/filtering/filterResources.js +14 -0
  135. package/dist/src/components/custom/scheduler/logic/filtering/hasSameProperties.d.ts.map +1 -1
  136. package/dist/src/components/custom/scheduler/logic/filtering/hasSameProperties.js +10 -0
  137. package/dist/src/components/custom/scheduler/logic/onDrop/OnDrop.js +45 -0
  138. package/dist/src/components/custom/scheduler/logic/pixels/getHeightLineScheduler.d.ts.map +1 -1
  139. package/dist/src/components/custom/scheduler/logic/pixels/getHeightLineScheduler.js +14 -0
  140. package/dist/src/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts.map +1 -1
  141. package/dist/src/components/custom/scheduler/logic/pixels/getPixelsForEvent.js +32 -0
  142. package/dist/src/components/custom/scheduler/logic/pixels/heightScheduler.d.ts.map +1 -1
  143. package/dist/src/components/custom/scheduler/logic/pixels/heightScheduler.js +14 -0
  144. package/dist/src/components/custom/scheduler/logic/pixels/heightSchedulerPinned.d.ts.map +1 -1
  145. package/dist/src/components/custom/scheduler/logic/pixels/heightSchedulerPinned.js +9 -0
  146. package/dist/src/components/custom/scheduler/logic/state_handle/doubleClickOnResource.d.ts.map +1 -1
  147. package/dist/src/components/custom/scheduler/logic/state_handle/doubleClickOnResource.js +5 -0
  148. package/dist/src/components/custom/scheduler/logic/state_handle/handleResourceChange.d.ts.map +1 -1
  149. package/dist/src/components/custom/scheduler/logic/state_handle/handleResourceChange.js +11 -0
  150. package/dist/src/components/custom/scheduler/logic/state_handle/onDragOver.d.ts.map +1 -1
  151. package/dist/src/components/custom/scheduler/logic/state_handle/onDragOver.js +9 -0
  152. package/dist/src/components/custom/scheduler/logic/state_handle/onDropEventToResource.d.ts.map +1 -1
  153. package/dist/src/components/custom/scheduler/logic/state_handle/onDropEventToResource.js +3 -0
  154. package/dist/src/components/custom/scheduler/logic/strings/compareStrings.d.ts.map +1 -1
  155. package/dist/src/components/custom/scheduler/logic/strings/compareStrings.js +7 -0
  156. package/dist/src/components/custom/scheduler/logic/strings/getGUID.js +7 -0
  157. package/dist/src/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts.map +1 -1
  158. package/dist/src/components/custom/scheduler/logic/ui/checkIfSlotAvailable.js +8 -0
  159. package/dist/src/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts.map +1 -1
  160. package/dist/src/components/custom/scheduler/logic/ui/getEventsOfResource.js +45 -0
  161. package/dist/src/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts.map +1 -1
  162. package/dist/src/components/custom/scheduler/logic/ui/getTimeHeaders.js +35 -0
  163. package/dist/src/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts.map +1 -1
  164. package/dist/src/components/custom/scheduler/logic/ui/isAllowedToMove.js +19 -0
  165. package/dist/src/components/custom/scheduler/logic/ui/updateResourceVisibility.d.ts.map +1 -1
  166. package/dist/src/components/custom/scheduler/logic/ui/updateResourceVisibility.js +15 -0
  167. package/dist/src/components/custom/scheduler/state/CblDragAndDrop.js +18 -0
  168. package/dist/src/components/custom/scheduler/state/CwSchedulerProps.js +1 -0
  169. package/dist/src/components/custom/scheduler/state/Resource.js +18 -0
  170. package/dist/src/components/custom/scheduler/state/State.js +1 -0
  171. package/dist/src/components/custom/scheduler/state/cblEvent.js +28 -0
  172. package/dist/src/components/custom/scheduler/state/cblEventCompProps.js +1 -0
  173. package/dist/src/components/custom/scheduler/state/resourceCompProps2.js +1 -0
  174. package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts +2 -1
  175. package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +1 -1
  176. package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.js +123 -0
  177. package/dist/src/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.js +118 -0
  178. package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts.map +1 -1
  179. package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.js +166 -0
  180. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.js +26 -0
  181. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.js +8 -0
  182. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.js +86 -0
  183. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.js +1 -0
  184. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.js +60 -0
  185. package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.js +24 -0
  186. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +1 -1
  187. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.js +150 -0
  188. package/dist/src/components/custom/scheduler-new/presentation/components/row/EventSideDrag.js +11 -0
  189. package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts +1 -1
  190. package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map +1 -1
  191. package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.js +176 -0
  192. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.d.ts +1 -0
  193. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.d.ts.map +1 -1
  194. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.js +8 -0
  195. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.js +39 -0
  196. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.js +8 -0
  197. package/dist/src/components/custom/scheduler-new/presentation/helpers.d.ts.map +1 -1
  198. package/dist/src/components/custom/scheduler-new/presentation/helpers.js +43 -0
  199. package/dist/src/components/custom/scheduler-new/presentation/logic/WeekendCalc.d.ts.map +1 -1
  200. package/dist/src/components/custom/scheduler-new/presentation/logic/WeekendCalc.js +24 -0
  201. package/dist/src/components/custom/scheduler-new/presentation/logic/dateFromPercentage.js +7 -0
  202. package/dist/src/components/custom/scheduler-new/presentation/logic/eventIsVisible.d.ts.map +1 -1
  203. package/dist/src/components/custom/scheduler-new/presentation/logic/eventIsVisible.js +7 -0
  204. package/dist/src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.d.ts.map +1 -1
  205. package/dist/src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.js +113 -0
  206. package/dist/src/components/custom/scheduler-new/presentation/logic/getDivisions.d.ts +1 -1
  207. package/dist/src/components/custom/scheduler-new/presentation/logic/getDivisions.d.ts.map +1 -1
  208. package/dist/src/components/custom/scheduler-new/presentation/logic/getDivisions.js +21 -0
  209. package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizes.d.ts.map +1 -1
  210. package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizes.js +30 -0
  211. package/dist/src/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.d.ts.map +1 -1
  212. package/dist/src/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.js +13 -0
  213. package/dist/src/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.js +7 -0
  214. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.d.ts.map +1 -1
  215. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.js +32 -0
  216. package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts.map +1 -1
  217. package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.js +12 -0
  218. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerState.d.ts +1 -0
  219. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerState.d.ts.map +1 -1
  220. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerState.js +1 -0
  221. package/dist/src/components/custom/scheduler-new/presentation/state/ui/WeekRange.js +1 -0
  222. package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.js +267 -0
  223. package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.js +269 -0
  224. package/dist/src/components/custom/scheduler-temporal/components/EventRender.js +142 -0
  225. package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.js +12 -0
  226. package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.js +26 -0
  227. package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.js +13 -0
  228. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.js +12 -0
  229. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.js +62 -0
  230. package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.js +13 -0
  231. package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.js +22 -0
  232. package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.js +17 -0
  233. package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.js +26 -0
  234. package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.js +23 -0
  235. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.js +31 -0
  236. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.js +16 -0
  237. package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.js +12 -0
  238. package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.js +5 -0
  239. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.js +15 -0
  240. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.js +5 -0
  241. package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.js +43 -0
  242. package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.js +35 -0
  243. package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.js +6 -0
  244. package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.js +20 -0
  245. package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.js +55 -0
  246. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.js +13 -0
  247. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.js +16 -0
  248. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.js +10 -0
  249. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.js +34 -0
  250. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.js +14 -0
  251. package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.js +10 -0
  252. package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.js +36 -0
  253. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.js +14 -0
  254. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.js +32 -0
  255. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.js +14 -0
  256. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.js +9 -0
  257. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.js +5 -0
  258. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.js +178 -0
  259. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.js +11 -0
  260. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.js +9 -0
  261. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.js +3 -0
  262. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.js +3 -0
  263. package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.js +7 -0
  264. package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.js +7 -0
  265. package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.js +9 -0
  266. package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.js +92 -0
  267. package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.js +242 -0
  268. package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.js +35 -0
  269. package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.js +19 -0
  270. package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.js +241 -0
  271. package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.js +15 -0
  272. package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.js +18 -0
  273. package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.js +1 -0
  274. package/dist/src/components/custom/scheduler-temporal/state/Resource.js +18 -0
  275. package/dist/src/components/custom/scheduler-temporal/state/State.js +1 -0
  276. package/dist/src/components/custom/scheduler-temporal/state/cblEvent.js +28 -0
  277. package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.js +1 -0
  278. package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.js +1 -0
  279. package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts +1 -2
  280. package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts.map +1 -1
  281. package/dist/src/components/custom/super-scheduler/PinRowHeader.js +53 -0
  282. package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts +1 -0
  283. package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts.map +1 -1
  284. package/dist/src/components/custom/super-scheduler/SuperScheduler.js +23 -0
  285. package/dist/src/components/custom/super-scheduler/SuperSchedulerEvents.js +15 -0
  286. package/dist/src/components/custom/super-scheduler/SuperSchedulerPresenter.js +45 -0
  287. package/dist/src/components/display/data/accordion/CwAccordionContainer.js +20 -0
  288. package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +13 -0
  289. package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -1
  290. package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.js +138 -0
  291. package/dist/src/components/display/data/table/CwTable.d.ts +1 -1
  292. package/dist/src/components/display/data/table/CwTable.d.ts.map +1 -1
  293. package/dist/src/components/display/data/table/CwTable.js +203 -0
  294. package/dist/src/components/display/data/table_sortable/CwSortableTable.d.ts +74 -0
  295. package/dist/src/components/display/data/table_sortable/CwSortableTable.d.ts.map +1 -0
  296. package/dist/src/components/display/data/table_sortable/useSortableTable.d.ts +42 -0
  297. package/dist/src/components/display/data/table_sortable/useSortableTable.d.ts.map +1 -0
  298. package/dist/src/components/display/data/tooltip_manager/CwTooltip.d.ts +25 -0
  299. package/dist/src/components/display/data/tooltip_manager/CwTooltip.d.ts.map +1 -0
  300. package/dist/src/components/display/data/tooltip_manager/CwTooltipManager.d.ts +19 -0
  301. package/dist/src/components/display/data/tooltip_manager/CwTooltipManager.d.ts.map +1 -0
  302. package/dist/src/components/display/graphics/icon/CwIcon.js +23 -0
  303. package/dist/src/components/display/graphics/loading/CwLoading.js +27 -0
  304. package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.js +20 -0
  305. package/dist/src/components/display/text/heading/CwHeadingMain.js +5 -0
  306. package/dist/src/components/display/text/heading/CwHeadingSecond.js +5 -0
  307. package/dist/src/components/display/text/label/CwLabel.js +13 -0
  308. package/dist/src/components/display/text/message/CwMessage.js +75 -0
  309. package/dist/src/components/display/text/note/CwNote.d.ts +1 -1
  310. package/dist/src/components/display/text/note/CwNote.d.ts.map +1 -1
  311. package/dist/src/components/display/text/note/CwNote.js +78 -0
  312. package/dist/src/components/display/text/tag/CwChip.d.ts +1 -1
  313. package/dist/src/components/display/text/tag/CwChip.d.ts.map +1 -1
  314. package/dist/src/components/display/text/tag/CwChip.js +57 -0
  315. package/dist/src/components/display/text/tag/CwTag.js +21 -0
  316. package/dist/src/components/display/text/tooltip/CwTooltip.d.ts +4 -1
  317. package/dist/src/components/display/text/tooltip/CwTooltip.d.ts.map +1 -1
  318. package/dist/src/components/display/text/tooltip/CwTooltip.js +4 -0
  319. package/dist/src/components/layout/align/CwAlign.js +54 -0
  320. package/dist/src/components/layout/card/CwCard.js +55 -0
  321. package/dist/src/components/layout/card/CwCardList.js +38 -0
  322. package/dist/src/components/layout/dialog/CwDialog.d.ts +2 -0
  323. package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
  324. package/dist/src/components/layout/dialog/CwDialog.js +255 -0
  325. package/dist/src/components/layout/dialog/CwDialogManager.d.ts.map +1 -1
  326. package/dist/src/components/layout/dialog/CwDialogManager.js +44 -0
  327. package/dist/src/components/layout/list/details/CwExpandable.js +28 -0
  328. package/dist/src/components/layout/list/key-value/CwKeyValueList.js +23 -0
  329. package/dist/src/components/layout/list/sortable/CwSortableList.d.ts +2 -1
  330. package/dist/src/components/layout/list/sortable/CwSortableList.d.ts.map +1 -1
  331. package/dist/src/components/layout/list/sortable/CwSortableList.js +73 -0
  332. package/dist/src/components/layout/list/sortable/useSortableList.js +53 -0
  333. package/dist/src/components/layout/master-detail/CwMasterDetail.d.ts +41 -0
  334. package/dist/src/components/layout/master-detail/CwMasterDetail.d.ts.map +1 -0
  335. package/dist/src/components/layout/modal/CwModalReportFunctional.js +23 -0
  336. package/dist/src/components/layout/modal/hover/CwModalHover.js +61 -0
  337. package/dist/src/components/layout/modal/legacy/cw_modal.d.ts.map +1 -1
  338. package/dist/src/components/layout/modal/legacy/cw_modal.js +44 -0
  339. package/dist/src/components/layout/modal/legacy/cw_modal_confirm.js +39 -0
  340. package/dist/src/components/layout/modal/legacy/cw_modal_iframe.js +44 -0
  341. package/dist/src/components/layout/modal/legacy/cw_modal_report.d.ts +0 -2
  342. package/dist/src/components/layout/modal/legacy/cw_modal_report.d.ts.map +1 -1
  343. package/dist/src/components/layout/modal/legacy/cw_modal_report.js +26 -0
  344. package/dist/{components/layout/table/grouped/CwTableGrouped.d.ts → src/components/layout/table/grouped/CwTableGrouped.js} +13 -23
  345. package/dist/src/components/layout/tabs/CwTabs.js +53 -0
  346. package/dist/src/dev/index.d.ts +5 -0
  347. package/dist/src/dev/index.d.ts.map +1 -0
  348. package/dist/src/dev/palette.d.ts +3 -0
  349. package/dist/src/dev/palette.d.ts.map +1 -0
  350. package/dist/src/dev/previews.d.ts +3 -0
  351. package/dist/src/dev/previews.d.ts.map +1 -0
  352. package/dist/src/dev/useInitial.d.ts +3 -0
  353. package/dist/src/dev/useInitial.d.ts.map +1 -0
  354. package/dist/src/index.d.ts +8 -3
  355. package/dist/src/index.d.ts.map +1 -1
  356. package/dist/src/index.js +187 -0
  357. package/dist/src/main.d.ts +3 -0
  358. package/dist/src/main.d.ts.map +1 -0
  359. package/dist/test/components/control/input/new-dates/timezoneHelpers.test.d.ts +2 -0
  360. package/dist/test/components/control/input/new-dates/timezoneHelpers.test.d.ts.map +1 -0
  361. package/dist/test/components/custom/new-scheduler/presentation/logic/getDefaultDivisions.test.js +48 -0
  362. package/dist/test/components/custom/new-scheduler/presentation/logic/hoursBetween.test.js +15 -0
  363. package/dist/test/components/custom/new-scheduler/presentation/logic/monthDivisions.test.js +42 -0
  364. package/dist/test/components/custom/new-scheduler/presentation/logic/weekendCalc.test.js +30 -0
  365. package/dist/test/components/custom/scheduler/addMinutesToDateFromPx.test.js +43 -0
  366. package/dist/test/components/custom/scheduler/checkIfSlotAvailable.test.js +30 -0
  367. package/dist/test/components/custom/scheduler/daysBetweenTwoDates.test.js +61 -0
  368. package/dist/test/components/custom/scheduler/daysBetweenTwoDatesWithoutCeilForEvent.test.js +27 -0
  369. package/dist/test/components/custom/scheduler/getGUID.test.js +30 -0
  370. package/dist/test/components/custom/scheduler/getPixelsForEvent.test.js +38 -0
  371. package/dist/test/components/custom/scheduler/getTimeHeaders.test.js +35 -0
  372. package/dist/test/components/custom/scheduler/hasSameProperties.test.js +51 -0
  373. package/dist/test/components/custom/scheduler/isAllowedToMove.test.js +28 -0
  374. package/dist/test/components/custom/scheduler/listOfDatesToWeeks.test.js +72 -0
  375. package/dist/test/jest.setup.js +1 -0
  376. package/dist/test/vitest.setup.d.ts +2 -0
  377. package/dist/test/vitest.setup.d.ts.map +1 -0
  378. package/package.json +19 -21
  379. package/dist/common/classes/CwSelectList.d.ts +0 -8
  380. package/dist/common/classes/CwSelectList.d.ts.map +0 -1
  381. package/dist/common/classes/CwSelectListItems.d.ts +0 -9
  382. package/dist/common/classes/CwSelectListItems.d.ts.map +0 -1
  383. package/dist/common/functions/collections.d.ts +0 -15
  384. package/dist/common/functions/collections.d.ts.map +0 -1
  385. package/dist/common/functions/colorManipulation.d.ts +0 -6
  386. package/dist/common/functions/colorManipulation.d.ts.map +0 -1
  387. package/dist/common/functions/dsl/UiEventDSL.d.ts +0 -9
  388. package/dist/common/functions/dsl/UiEventDSL.d.ts.map +0 -1
  389. package/dist/common/functions/useSingleAndDoubleClicks.d.ts +0 -7
  390. package/dist/common/functions/useSingleAndDoubleClicks.d.ts.map +0 -1
  391. package/dist/common/interfaces/CwSelectListProps.d.ts +0 -9
  392. package/dist/common/interfaces/CwSelectListProps.d.ts.map +0 -1
  393. package/dist/components/control/action/button/CwButton.d.ts +0 -26
  394. package/dist/components/control/action/button/CwButton.d.ts.map +0 -1
  395. package/dist/components/control/action/buttons/CwButtons.d.ts +0 -59
  396. package/dist/components/control/action/buttons/CwButtons.d.ts.map +0 -1
  397. package/dist/components/control/action/contextmenu/CwContextMenu.d.ts +0 -23
  398. package/dist/components/control/action/contextmenu/CwContextMenu.d.ts.map +0 -1
  399. package/dist/components/control/action/contextual-menu/CwContextualMenu.d.ts +0 -29
  400. package/dist/components/control/action/contextual-menu/CwContextualMenu.d.ts.map +0 -1
  401. package/dist/components/control/action/search/CwSearch.d.ts +0 -16
  402. package/dist/components/control/action/search/CwSearch.d.ts.map +0 -1
  403. package/dist/components/control/choice/checkbox/CwCheckbox.d.ts +0 -17
  404. package/dist/components/control/choice/checkbox/CwCheckbox.d.ts.map +0 -1
  405. package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts +0 -24
  406. package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts.map +0 -1
  407. package/dist/components/control/choice/dropdown/CwDropdown.d.ts +0 -19
  408. package/dist/components/control/choice/dropdown/CwDropdown.d.ts.map +0 -1
  409. package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts +0 -17
  410. package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts.map +0 -1
  411. package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts +0 -28
  412. package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts.map +0 -1
  413. package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts +0 -21
  414. package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts.map +0 -1
  415. package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts +0 -158
  416. package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +0 -1
  417. package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts +0 -33
  418. package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts.map +0 -1
  419. package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts +0 -16
  420. package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts.map +0 -1
  421. package/dist/components/control/choice/multiselect/CwMultiselect.d.ts +0 -13
  422. package/dist/components/control/choice/multiselect/CwMultiselect.d.ts.map +0 -1
  423. package/dist/components/control/choice/multiselect/CwOptionList.d.ts +0 -15
  424. package/dist/components/control/choice/multiselect/CwOptionList.d.ts.map +0 -1
  425. package/dist/components/control/choice/option/CwOption.d.ts +0 -17
  426. package/dist/components/control/choice/option/CwOption.d.ts.map +0 -1
  427. package/dist/components/control/choice/select/CwSelect.d.ts +0 -48
  428. package/dist/components/control/choice/select/CwSelect.d.ts.map +0 -1
  429. package/dist/components/control/choice/toggle/CwToggle.d.ts +0 -28
  430. package/dist/components/control/choice/toggle/CwToggle.d.ts.map +0 -1
  431. package/dist/components/control/input/any/CwInput.d.ts +0 -17
  432. package/dist/components/control/input/any/CwInput.d.ts.map +0 -1
  433. package/dist/components/control/input/date/CwInputDate.d.ts +0 -40
  434. package/dist/components/control/input/date/CwInputDate.d.ts.map +0 -1
  435. package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts +0 -7
  436. package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts.map +0 -1
  437. package/dist/components/control/input/date-text/CwInputDateText.d.ts +0 -38
  438. package/dist/components/control/input/date-text/CwInputDateText.d.ts.map +0 -1
  439. package/dist/components/control/input/datetime/CwInputDatetime.d.ts +0 -40
  440. package/dist/components/control/input/datetime/CwInputDatetime.d.ts.map +0 -1
  441. package/dist/components/control/input/digit/CwDigit.d.ts +0 -40
  442. package/dist/components/control/input/digit/CwDigit.d.ts.map +0 -1
  443. package/dist/components/control/input/file/CwFileUpload.d.ts +0 -18
  444. package/dist/components/control/input/file/CwFileUpload.d.ts.map +0 -1
  445. package/dist/components/control/input/file/CwFileUploadMultiple.d.ts +0 -15
  446. package/dist/components/control/input/file/CwFileUploadMultiple.d.ts.map +0 -1
  447. package/dist/components/control/input/image/CwInputImage.d.ts +0 -7
  448. package/dist/components/control/input/image/CwInputImage.d.ts.map +0 -1
  449. package/dist/components/control/input/image-area/CwImageArea.d.ts +0 -53
  450. package/dist/components/control/input/image-area/CwImageArea.d.ts.map +0 -1
  451. package/dist/components/control/input/number/CwInputNumber.d.ts +0 -20
  452. package/dist/components/control/input/number/CwInputNumber.d.ts.map +0 -1
  453. package/dist/components/control/input/phone/CwInputPhone.d.ts +0 -36
  454. package/dist/components/control/input/phone/CwInputPhone.d.ts.map +0 -1
  455. package/dist/components/control/input/text/CwInputText.d.ts +0 -40
  456. package/dist/components/control/input/text/CwInputText.d.ts.map +0 -1
  457. package/dist/components/control/input/text-area/CwTextArea.d.ts +0 -24
  458. package/dist/components/control/input/text-area/CwTextArea.d.ts.map +0 -1
  459. package/dist/components/control/input/time/CwTime.d.ts +0 -40
  460. package/dist/components/control/input/time/CwTime.d.ts.map +0 -1
  461. package/dist/components/control/input/weekday/CwWeekdaySelector.d.ts +0 -53
  462. package/dist/components/control/input/weekday/CwWeekdaySelector.d.ts.map +0 -1
  463. package/dist/components/custom/find-airport/CwFindAirportComp.d.ts +0 -35
  464. package/dist/components/custom/find-airport/CwFindAirportComp.d.ts.map +0 -1
  465. package/dist/components/custom/scheduler/CwSchedulerComp.d.ts +0 -19
  466. package/dist/components/custom/scheduler/CwSchedulerComp.d.ts.map +0 -1
  467. package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts +0 -86
  468. package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts.map +0 -1
  469. package/dist/components/custom/scheduler/components/EventRender.d.ts +0 -10
  470. package/dist/components/custom/scheduler/components/EventRender.d.ts.map +0 -1
  471. package/dist/components/custom/scheduler/components/ResourceListRender.d.ts +0 -20
  472. package/dist/components/custom/scheduler/components/ResourceListRender.d.ts.map +0 -1
  473. package/dist/components/custom/scheduler/components/ResourceRender.d.ts +0 -14
  474. package/dist/components/custom/scheduler/components/ResourceRender.d.ts.map +0 -1
  475. package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts +0 -11
  476. package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts.map +0 -1
  477. package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts +0 -11
  478. package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts.map +0 -1
  479. package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts +0 -13
  480. package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts.map +0 -1
  481. package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts +0 -11
  482. package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts.map +0 -1
  483. package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts +0 -14
  484. package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts.map +0 -1
  485. package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts +0 -23
  486. package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts.map +0 -1
  487. package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts +0 -8
  488. package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts.map +0 -1
  489. package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts +0 -12
  490. package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +0 -1
  491. package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts +0 -12
  492. package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts.map +0 -1
  493. package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts +0 -10
  494. package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts.map +0 -1
  495. package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts +0 -12
  496. package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts.map +0 -1
  497. package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts +0 -2
  498. package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts.map +0 -1
  499. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts +0 -2
  500. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts.map +0 -1
  501. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +0 -2
  502. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +0 -1
  503. package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts +0 -7
  504. package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts.map +0 -1
  505. package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts +0 -10
  506. package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts.map +0 -1
  507. package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts +0 -2
  508. package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts.map +0 -1
  509. package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +0 -7
  510. package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +0 -1
  511. package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts +0 -8
  512. package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts.map +0 -1
  513. package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts +0 -2
  514. package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts.map +0 -1
  515. package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts +0 -2
  516. package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts.map +0 -1
  517. package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts +0 -3
  518. package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts.map +0 -1
  519. package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts +0 -3
  520. package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts.map +0 -1
  521. package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts +0 -13
  522. package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts.map +0 -1
  523. package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts +0 -17
  524. package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts.map +0 -1
  525. package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts +0 -3
  526. package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts.map +0 -1
  527. package/dist/components/custom/scheduler/logic/state_handle/doubleClickOnResource.d.ts +0 -4
  528. package/dist/components/custom/scheduler/logic/state_handle/doubleClickOnResource.d.ts.map +0 -1
  529. package/dist/components/custom/scheduler/logic/state_handle/onDragOver.d.ts +0 -2
  530. package/dist/components/custom/scheduler/logic/state_handle/onDragOver.d.ts.map +0 -1
  531. package/dist/components/custom/scheduler/logic/state_handle/onDropEventToResource.d.ts +0 -5
  532. package/dist/components/custom/scheduler/logic/state_handle/onDropEventToResource.d.ts.map +0 -1
  533. package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts +0 -2
  534. package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts.map +0 -1
  535. package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts +0 -2
  536. package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts.map +0 -1
  537. package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts +0 -3
  538. package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts.map +0 -1
  539. package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts +0 -4
  540. package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts.map +0 -1
  541. package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts +0 -2
  542. package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts.map +0 -1
  543. package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts +0 -3
  544. package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts.map +0 -1
  545. package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts +0 -11
  546. package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts.map +0 -1
  547. package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts +0 -43
  548. package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts.map +0 -1
  549. package/dist/components/custom/scheduler/state/Resource.d.ts +0 -14
  550. package/dist/components/custom/scheduler/state/Resource.d.ts.map +0 -1
  551. package/dist/components/custom/scheduler/state/State.d.ts +0 -19
  552. package/dist/components/custom/scheduler/state/State.d.ts.map +0 -1
  553. package/dist/components/custom/scheduler/state/cblEvent.d.ts +0 -18
  554. package/dist/components/custom/scheduler/state/cblEvent.d.ts.map +0 -1
  555. package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts +0 -7
  556. package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts.map +0 -1
  557. package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts +0 -6
  558. package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts.map +0 -1
  559. package/dist/components/custom/scheduler-new/presentation/NewScheduler.d.ts +0 -29
  560. package/dist/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +0 -1
  561. package/dist/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.d.ts +0 -80
  562. package/dist/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.d.ts.map +0 -1
  563. package/dist/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts +0 -27
  564. package/dist/components/custom/scheduler-new/presentation/SchedulerPresenter.d.ts.map +0 -1
  565. package/dist/components/custom/scheduler-new/presentation/components/header/HeaderDivision.d.ts +0 -19
  566. package/dist/components/custom/scheduler-new/presentation/components/header/HeaderDivision.d.ts.map +0 -1
  567. package/dist/components/custom/scheduler-new/presentation/components/header/HeaderTitle.d.ts +0 -10
  568. package/dist/components/custom/scheduler-new/presentation/components/header/HeaderTitle.d.ts.map +0 -1
  569. package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.d.ts +0 -5
  570. package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.d.ts.map +0 -1
  571. package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.d.ts +0 -17
  572. package/dist/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.d.ts.map +0 -1
  573. package/dist/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts +0 -8
  574. package/dist/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts.map +0 -1
  575. package/dist/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts +0 -17
  576. package/dist/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts.map +0 -1
  577. package/dist/components/custom/scheduler-new/presentation/components/row/Event.d.ts +0 -34
  578. package/dist/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +0 -1
  579. package/dist/components/custom/scheduler-new/presentation/components/row/EventSideDrag.d.ts +0 -8
  580. package/dist/components/custom/scheduler-new/presentation/components/row/EventSideDrag.d.ts.map +0 -1
  581. package/dist/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts +0 -27
  582. package/dist/components/custom/scheduler-new/presentation/components/row/SchedulerRow.d.ts.map +0 -1
  583. package/dist/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.d.ts +0 -10
  584. package/dist/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.d.ts.map +0 -1
  585. package/dist/components/custom/scheduler-new/presentation/components/timeline/TimeLine.d.ts +0 -15
  586. package/dist/components/custom/scheduler-new/presentation/components/timeline/TimeLine.d.ts.map +0 -1
  587. package/dist/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.d.ts +0 -11
  588. package/dist/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.d.ts.map +0 -1
  589. package/dist/components/custom/scheduler-new/presentation/helpers.d.ts +0 -19
  590. package/dist/components/custom/scheduler-new/presentation/helpers.d.ts.map +0 -1
  591. package/dist/components/custom/scheduler-new/presentation/logic/WeekendCalc.d.ts +0 -4
  592. package/dist/components/custom/scheduler-new/presentation/logic/WeekendCalc.d.ts.map +0 -1
  593. package/dist/components/custom/scheduler-new/presentation/logic/dateFromPercentage.d.ts +0 -2
  594. package/dist/components/custom/scheduler-new/presentation/logic/dateFromPercentage.d.ts.map +0 -1
  595. package/dist/components/custom/scheduler-new/presentation/logic/eventIsVisible.d.ts +0 -2
  596. package/dist/components/custom/scheduler-new/presentation/logic/eventIsVisible.d.ts.map +0 -1
  597. package/dist/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.d.ts +0 -6
  598. package/dist/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.d.ts.map +0 -1
  599. package/dist/components/custom/scheduler-new/presentation/logic/getDivisions.d.ts +0 -3
  600. package/dist/components/custom/scheduler-new/presentation/logic/getDivisions.d.ts.map +0 -1
  601. package/dist/components/custom/scheduler-new/presentation/logic/getEventSizes.d.ts +0 -6
  602. package/dist/components/custom/scheduler-new/presentation/logic/getEventSizes.d.ts.map +0 -1
  603. package/dist/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.d.ts +0 -4
  604. package/dist/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.d.ts.map +0 -1
  605. package/dist/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.d.ts +0 -2
  606. package/dist/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.d.ts.map +0 -1
  607. package/dist/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.d.ts +0 -3
  608. package/dist/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.d.ts.map +0 -1
  609. package/dist/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts +0 -4
  610. package/dist/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.d.ts.map +0 -1
  611. package/dist/components/custom/scheduler-new/presentation/state/ui/SchedulerState.d.ts +0 -12
  612. package/dist/components/custom/scheduler-new/presentation/state/ui/SchedulerState.d.ts.map +0 -1
  613. package/dist/components/custom/scheduler-new/presentation/state/ui/WeekRange.d.ts +0 -5
  614. package/dist/components/custom/scheduler-new/presentation/state/ui/WeekRange.d.ts.map +0 -1
  615. package/dist/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts +0 -24
  616. package/dist/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts.map +0 -1
  617. package/dist/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts +0 -86
  618. package/dist/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts.map +0 -1
  619. package/dist/components/custom/scheduler-temporal/components/EventRender.d.ts +0 -10
  620. package/dist/components/custom/scheduler-temporal/components/EventRender.d.ts.map +0 -1
  621. package/dist/components/custom/scheduler-temporal/components/ResourceListRender.d.ts +0 -20
  622. package/dist/components/custom/scheduler-temporal/components/ResourceListRender.d.ts.map +0 -1
  623. package/dist/components/custom/scheduler-temporal/components/ResourceRender.d.ts +0 -14
  624. package/dist/components/custom/scheduler-temporal/components/ResourceRender.d.ts.map +0 -1
  625. package/dist/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts +0 -11
  626. package/dist/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts.map +0 -1
  627. package/dist/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts +0 -11
  628. package/dist/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts.map +0 -1
  629. package/dist/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts +0 -13
  630. package/dist/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts.map +0 -1
  631. package/dist/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts +0 -11
  632. package/dist/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts.map +0 -1
  633. package/dist/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts +0 -14
  634. package/dist/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts.map +0 -1
  635. package/dist/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts +0 -23
  636. package/dist/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts.map +0 -1
  637. package/dist/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts +0 -8
  638. package/dist/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts.map +0 -1
  639. package/dist/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts +0 -12
  640. package/dist/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +0 -1
  641. package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts +0 -12
  642. package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts.map +0 -1
  643. package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts +0 -10
  644. package/dist/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts.map +0 -1
  645. package/dist/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts +0 -12
  646. package/dist/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts.map +0 -1
  647. package/dist/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts +0 -2
  648. package/dist/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts.map +0 -1
  649. package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts +0 -2
  650. package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts.map +0 -1
  651. package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +0 -2
  652. package/dist/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +0 -1
  653. package/dist/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts +0 -7
  654. package/dist/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts.map +0 -1
  655. package/dist/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts +0 -10
  656. package/dist/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts.map +0 -1
  657. package/dist/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts +0 -2
  658. package/dist/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts.map +0 -1
  659. package/dist/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +0 -7
  660. package/dist/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +0 -1
  661. package/dist/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts +0 -8
  662. package/dist/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts.map +0 -1
  663. package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts +0 -2
  664. package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts.map +0 -1
  665. package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts +0 -2
  666. package/dist/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts.map +0 -1
  667. package/dist/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +0 -15
  668. package/dist/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +0 -1
  669. package/dist/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts +0 -3
  670. package/dist/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts.map +0 -1
  671. package/dist/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts +0 -3
  672. package/dist/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts.map +0 -1
  673. package/dist/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts +0 -13
  674. package/dist/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts.map +0 -1
  675. package/dist/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +0 -17
  676. package/dist/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +0 -1
  677. package/dist/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +0 -3
  678. package/dist/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +0 -1
  679. package/dist/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts +0 -4
  680. package/dist/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts.map +0 -1
  681. package/dist/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts +0 -2
  682. package/dist/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts.map +0 -1
  683. package/dist/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts +0 -5
  684. package/dist/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts.map +0 -1
  685. package/dist/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts +0 -4
  686. package/dist/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts.map +0 -1
  687. package/dist/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts +0 -2
  688. package/dist/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts.map +0 -1
  689. package/dist/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts +0 -2
  690. package/dist/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts.map +0 -1
  691. package/dist/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +0 -3
  692. package/dist/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +0 -1
  693. package/dist/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts +0 -6
  694. package/dist/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts.map +0 -1
  695. package/dist/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts +0 -2
  696. package/dist/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts.map +0 -1
  697. package/dist/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts +0 -3
  698. package/dist/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts.map +0 -1
  699. package/dist/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts +0 -11
  700. package/dist/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts.map +0 -1
  701. package/dist/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts +0 -43
  702. package/dist/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts.map +0 -1
  703. package/dist/components/custom/scheduler-temporal/state/Resource.d.ts +0 -14
  704. package/dist/components/custom/scheduler-temporal/state/Resource.d.ts.map +0 -1
  705. package/dist/components/custom/scheduler-temporal/state/State.d.ts +0 -25
  706. package/dist/components/custom/scheduler-temporal/state/State.d.ts.map +0 -1
  707. package/dist/components/custom/scheduler-temporal/state/cblEvent.d.ts +0 -18
  708. package/dist/components/custom/scheduler-temporal/state/cblEvent.d.ts.map +0 -1
  709. package/dist/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts +0 -7
  710. package/dist/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts.map +0 -1
  711. package/dist/components/custom/super-scheduler/PinRowHeader.d.ts +0 -15
  712. package/dist/components/custom/super-scheduler/PinRowHeader.d.ts.map +0 -1
  713. package/dist/components/custom/super-scheduler/SuperScheduler.d.ts +0 -25
  714. package/dist/components/custom/super-scheduler/SuperScheduler.d.ts.map +0 -1
  715. package/dist/components/custom/super-scheduler/SuperSchedulerEvents.d.ts +0 -13
  716. package/dist/components/custom/super-scheduler/SuperSchedulerEvents.d.ts.map +0 -1
  717. package/dist/components/custom/super-scheduler/SuperSchedulerPresenter.d.ts +0 -9
  718. package/dist/components/custom/super-scheduler/SuperSchedulerPresenter.d.ts.map +0 -1
  719. package/dist/components/display/data/accordion/CwAccordionContainer.d.ts +0 -14
  720. package/dist/components/display/data/accordion/CwAccordionContainer.d.ts.map +0 -1
  721. package/dist/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +0 -15
  722. package/dist/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +0 -1
  723. package/dist/components/display/data/table/CwTable.d.ts +0 -102
  724. package/dist/components/display/data/table/CwTable.d.ts.map +0 -1
  725. package/dist/components/display/graphics/icon/CwIcon.d.ts +0 -15
  726. package/dist/components/display/graphics/icon/CwIcon.d.ts.map +0 -1
  727. package/dist/components/display/graphics/loading/CwLoading.d.ts +0 -42
  728. package/dist/components/display/graphics/loading/CwLoading.d.ts.map +0 -1
  729. package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts +0 -18
  730. package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts.map +0 -1
  731. package/dist/components/display/text/heading/CwHeadingMain.d.ts +0 -3
  732. package/dist/components/display/text/heading/CwHeadingMain.d.ts.map +0 -1
  733. package/dist/components/display/text/heading/CwHeadingSecond.d.ts +0 -3
  734. package/dist/components/display/text/heading/CwHeadingSecond.d.ts.map +0 -1
  735. package/dist/components/display/text/label/CwLabel.d.ts +0 -28
  736. package/dist/components/display/text/label/CwLabel.d.ts.map +0 -1
  737. package/dist/components/display/text/message/CwMessage.d.ts +0 -31
  738. package/dist/components/display/text/message/CwMessage.d.ts.map +0 -1
  739. package/dist/components/display/text/tag/CwChip.d.ts +0 -36
  740. package/dist/components/display/text/tag/CwChip.d.ts.map +0 -1
  741. package/dist/components/display/text/tag/CwTag.d.ts +0 -16
  742. package/dist/components/display/text/tag/CwTag.d.ts.map +0 -1
  743. package/dist/components/display/text/tooltip/CwTooltip.d.ts +0 -8
  744. package/dist/components/display/text/tooltip/CwTooltip.d.ts.map +0 -1
  745. package/dist/components/layout/align/CwAlign.d.ts +0 -54
  746. package/dist/components/layout/align/CwAlign.d.ts.map +0 -1
  747. package/dist/components/layout/card/CwCard.d.ts +0 -61
  748. package/dist/components/layout/card/CwCard.d.ts.map +0 -1
  749. package/dist/components/layout/card/CwCardList.d.ts +0 -32
  750. package/dist/components/layout/card/CwCardList.d.ts.map +0 -1
  751. package/dist/components/layout/dialog/CwDialog.d.ts +0 -28
  752. package/dist/components/layout/dialog/CwDialog.d.ts.map +0 -1
  753. package/dist/components/layout/dialog/CwDialogManager.d.ts +0 -11
  754. package/dist/components/layout/dialog/CwDialogManager.d.ts.map +0 -1
  755. package/dist/components/layout/list/details/CwExpandable.d.ts +0 -23
  756. package/dist/components/layout/list/details/CwExpandable.d.ts.map +0 -1
  757. package/dist/components/layout/list/key-value/CwKeyValueList.d.ts +0 -33
  758. package/dist/components/layout/list/key-value/CwKeyValueList.d.ts.map +0 -1
  759. package/dist/components/layout/modal/CwModalReportFunctional.d.ts +0 -15
  760. package/dist/components/layout/modal/CwModalReportFunctional.d.ts.map +0 -1
  761. package/dist/components/layout/modal/hover/CwModalHover.d.ts +0 -19
  762. package/dist/components/layout/modal/hover/CwModalHover.d.ts.map +0 -1
  763. package/dist/components/layout/modal/legacy/cw_modal.d.ts +0 -22
  764. package/dist/components/layout/modal/legacy/cw_modal.d.ts.map +0 -1
  765. package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts +0 -16
  766. package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts.map +0 -1
  767. package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts +0 -21
  768. package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts.map +0 -1
  769. package/dist/components/layout/modal/legacy/cw_modal_report.d.ts +0 -32
  770. package/dist/components/layout/modal/legacy/cw_modal_report.d.ts.map +0 -1
  771. package/dist/components/layout/table/grouped/CwTableGrouped.d.ts.map +0 -1
  772. package/dist/components/layout/tabs/CwTabs.d.ts +0 -46
  773. package/dist/components/layout/tabs/CwTabs.d.ts.map +0 -1
  774. package/dist/index.d.ts.map +0 -1
package/dist/index.es.js CHANGED
@@ -1,16 +1,15 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { cloneElement, useEffect, useState, useCallback, useRef, useMemo, forwardRef, useLayoutEffect, useImperativeHandle, createElement, memo, Fragment as Fragment$1, Component } from 'react';
3
+ import React__default, { cloneElement, useEffect, useState, useCallback, useRef, useMemo, useLayoutEffect, forwardRef, useImperativeHandle, createElement, memo, Fragment as Fragment$1, Component } from 'react';
4
4
  import { createRoot } from 'react-dom/client';
5
5
  import { createPortal } from 'react-dom';
6
- import { Tooltip, Dropdown, Menu } from 'antd';
7
6
  import Draggable from 'react-draggable';
8
7
  import moment from 'moment';
9
8
  import { format } from 'date-fns';
10
9
  import { enGB } from 'date-fns/locale';
11
10
  import { DayPicker } from 'react-day-picker';
12
11
  import 'react-day-picker/dist/style.css';
13
- import { cloneDeep } from 'lodash-es';
12
+ import moment$1 from 'moment-timezone';
14
13
  import { VariableSizeList } from 'react-window';
15
14
 
16
15
  class CwSelectList {
@@ -63,10 +62,6 @@ function CwLabel(props) {
63
62
  return (jsx("label", { className: "cw-label", style: { textAlign: justify, width: labelWidth, height: labelHeight, margin: margin ?? "1px 0 0 0" }, ...labelProps, children: labelProps.children ?? text }));
64
63
  }
65
64
 
66
- function CwTooltip(CwelltTooltipProps) {
67
- return (jsxs("div", { className: "cwelltTooltip", children: [jsx("div", { className: "cwelltTooltipTitle", style: CwelltTooltipProps.tooltipTitleStyle, children: jsx("span", { children: CwelltTooltipProps.tooltipTitle }) }), CwelltTooltipProps.children] }));
68
- }
69
-
70
65
  function colorToHSL(color) {
71
66
  const hexColor = colorToHEX(color);
72
67
  const hex = hexColor.replace('#', '');
@@ -218,7 +213,7 @@ const CwChip = ({ label, colorScheme = 'info', customColor, variant = 'soft', cl
218
213
  className,
219
214
  closable ? 'cw-chip-closable' : '',
220
215
  ].filter(Boolean).join(' ');
221
- return (jsxs("span", { className: chipClassNames, "data-color-scheme": colorScheme, "data-variant": variant, style: chipStyle, children: [icon && jsx(CwIcon, { iconId: icon }), jsx("span", { children: label }), closable && (jsx("button", { className: "cw-chip-close-button", onClick: handleClose, "aria-label": "Remove", type: "button", children: jsx("span", { className: "cwi-icons cwi-close" }) }))] }));
216
+ return (jsxs("span", { className: chipClassNames, "data-color-scheme": colorScheme, "data-variant": variant, style: chipStyle, children: [icon && jsx(CwIcon, { iconId: icon }), label && jsx("span", { children: label }), closable && (jsx("button", { className: "cw-chip-close-button", onClick: handleClose, "aria-label": "Remove", type: "button", children: jsx("span", { className: "cwi-icons cwi-close" }) }))] }));
222
217
  };
223
218
 
224
219
  const CW_DEFAULT_MESSAGE_DURATION = 2000;
@@ -619,33 +614,33 @@ function CwLoadingSmall(CwelltLoadingAppointements) {
619
614
  jsx("div", {})) }));
620
615
  }
621
616
 
622
- var styles$k = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si","cw-generic-tooltip":"cw-generic-tooltip-module_cw-generic-tooltip__Ij76M"};
617
+ var styles$o = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si","cw-generic-tooltip":"cw-generic-tooltip-module_cw-generic-tooltip__Ij76M"};
623
618
 
624
619
  // Constants moved outside to prevent recreation
625
- const margin = 16;
620
+ const margin$1 = 16;
626
621
  const defaultPosition = "right";
627
- const positionOrder = ['right', 'bottom', 'left', 'top'];
622
+ const positionOrder$1 = ['right', 'bottom', 'left', 'top'];
628
623
  // Memoized utility functions to prevent recreation
629
- const calculatePositionForSide = (position, triggerRect, tooltipRect) => {
624
+ const calculatePositionForSide$1 = (position, triggerRect, tooltipRect) => {
630
625
  switch (position) {
631
626
  case 'left':
632
627
  return {
633
628
  top: triggerRect.top + (triggerRect.height - tooltipRect.height) / 2,
634
- left: triggerRect.left - tooltipRect.width - margin
629
+ left: triggerRect.left - tooltipRect.width - margin$1
635
630
  };
636
631
  case 'right':
637
632
  return {
638
633
  top: triggerRect.top + (triggerRect.height - tooltipRect.height) / 2,
639
- left: triggerRect.right + margin
634
+ left: triggerRect.right + margin$1
640
635
  };
641
636
  case 'top':
642
637
  return {
643
- top: triggerRect.top - tooltipRect.height - margin,
638
+ top: triggerRect.top - tooltipRect.height - margin$1,
644
639
  left: triggerRect.left + (triggerRect.width - tooltipRect.width) / 2
645
640
  };
646
641
  case 'bottom':
647
642
  return {
648
- top: triggerRect.bottom + margin,
643
+ top: triggerRect.bottom + margin$1,
649
644
  left: triggerRect.left + (triggerRect.width - tooltipRect.width) / 2
650
645
  };
651
646
  }
@@ -686,26 +681,26 @@ const useTooltipPosition = (isVisible, containerRef, preferredPosition, tooltipC
686
681
  const triggerRect = containerRef.current.getBoundingClientRect();
687
682
  const tooltipRect = tooltipElement.getBoundingClientRect();
688
683
  // Try preferred position first
689
- const position = calculatePositionForSide(preferredPosition, triggerRect, tooltipRect);
684
+ const position = calculatePositionForSide$1(preferredPosition, triggerRect, tooltipRect);
690
685
  const windowWidth = window.innerWidth;
691
686
  const windowHeight = window.innerHeight;
692
687
  // Quick bounds check
693
- if (position.left >= margin &&
694
- position.top >= margin &&
695
- position.left + tooltipRect.width <= windowWidth - margin &&
696
- position.top + tooltipRect.height <= windowHeight - margin) {
688
+ if (position.left >= margin$1 &&
689
+ position.top >= margin$1 &&
690
+ position.left + tooltipRect.width <= windowWidth - margin$1 &&
691
+ position.top + tooltipRect.height <= windowHeight - margin$1) {
697
692
  setTooltipState({ position, actualPosition: preferredPosition });
698
693
  return;
699
694
  }
700
695
  // Try other positions if preferred doesn't fit
701
- for (const pos of positionOrder) {
696
+ for (const pos of positionOrder$1) {
702
697
  if (pos === preferredPosition)
703
698
  continue;
704
- const newPosition = calculatePositionForSide(pos, triggerRect, tooltipRect);
705
- if (newPosition.left >= margin &&
706
- newPosition.top >= margin &&
707
- newPosition.left + tooltipRect.width <= windowWidth - margin &&
708
- newPosition.top + tooltipRect.height <= windowHeight - margin) {
699
+ const newPosition = calculatePositionForSide$1(pos, triggerRect, tooltipRect);
700
+ if (newPosition.left >= margin$1 &&
701
+ newPosition.top >= margin$1 &&
702
+ newPosition.left + tooltipRect.width <= windowWidth - margin$1 &&
703
+ newPosition.top + tooltipRect.height <= windowHeight - margin$1) {
709
704
  setTooltipState({ position: newPosition, actualPosition: pos });
710
705
  return;
711
706
  }
@@ -723,19 +718,31 @@ const useTooltipPosition = (isVisible, containerRef, preferredPosition, tooltipC
723
718
  }, [updatePosition]);
724
719
  return tooltipState;
725
720
  };
726
- // Main component with optimizations
721
+ /**
722
+ * Standalone tooltip component. Each instance manages its own portal,
723
+ * requiring no external dependencies or global setup.
724
+ *
725
+ * Suitable for low-density use cases with few tooltip instances.
726
+ * For high-density scenarios (e.g. schedulers, tables, lists),
727
+ * prefer CwTooltipNew which shares a single DOM portal for better performance.
728
+ *
729
+ * @remarks Not formally deprecated, but CwTooltipNew is now the recommended
730
+ * approach for new implementations. Cannot be deprecated yet due to potential use on projects such as Operon and Improve.
731
+ *
732
+ * @see CwTooltipNew
733
+ */
727
734
  const CwGenericTooltip = ({ children, content = null, position = defaultPosition, dissapearsWhenHover = false, hide = false, overlayStyle = {}, showDelay = 0, displayInline = false, }) => {
728
735
  const [isVisible, setIsVisible] = useState(false);
729
736
  const containerRef = useRef(null);
730
737
  const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => {
731
738
  setIsVisible(true);
732
739
  }, showDelay);
733
- const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$k["cw-generic-tooltip-content"]);
740
+ const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$o["cw-generic-tooltip-content"]);
734
741
  // Memoize tooltip content creation
735
742
  const tooltipContent = useMemo(() => {
736
743
  if (hide || !isVisible || !content)
737
744
  return null;
738
- return createPortal(jsx("div", { className: styles$k["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, "data-inline": displayInline, style: {
745
+ return createPortal(jsx("div", { className: styles$o["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, "data-inline": displayInline, style: {
739
746
  position: 'fixed',
740
747
  top: `${tooltipPosition.top}px`,
741
748
  left: `${tooltipPosition.left}px`,
@@ -750,9 +757,310 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
750
757
  clearTooltipTimeout();
751
758
  setIsVisible(false);
752
759
  }, [clearTooltipTimeout]);
753
- return (jsxs("div", { ref: containerRef, className: styles$k["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, children: [tooltipContent, children] }));
760
+ return (jsxs("div", { ref: containerRef, className: styles$o["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, children: [tooltipContent, children] }));
761
+ };
762
+
763
+ var styles$n = {"cw-tooltip-content":"cw-tooltip-module_cw-tooltip-content__RZczd","cw-tooltip":"cw-tooltip-module_cw-tooltip__1KYig"};
764
+
765
+ // Constants
766
+ const margin = 16;
767
+ const positionOrder = ['right', 'bottom', 'left', 'top'];
768
+ // Singleton state
769
+ let currentState = {
770
+ isVisible: false,
771
+ content: null,
772
+ triggerRect: null,
773
+ position: "right",
774
+ dissapearsWhenHover: false
775
+ };
776
+ const stateUpdateCallbacks = new Set();
777
+ let hideTimeout;
778
+ // Public API
779
+ const showTooltip = (content, triggerElement, position = "right", dissapearsWhenHover = false) => {
780
+ if (hideTimeout !== undefined) {
781
+ window.clearTimeout(hideTimeout);
782
+ hideTimeout = undefined;
783
+ }
784
+ currentState = {
785
+ isVisible: true,
786
+ content,
787
+ triggerRect: triggerElement.getBoundingClientRect(),
788
+ position,
789
+ dissapearsWhenHover
790
+ };
791
+ stateUpdateCallbacks.forEach((cb) => cb());
792
+ };
793
+ const hideTooltip = (delay = 100) => {
794
+ if (hideTimeout !== undefined) {
795
+ window.clearTimeout(hideTimeout);
796
+ }
797
+ hideTimeout = window.setTimeout(() => {
798
+ hideTimeout = undefined;
799
+ currentState = {
800
+ ...currentState,
801
+ isVisible: false
802
+ };
803
+ stateUpdateCallbacks.forEach((cb) => cb());
804
+ }, delay);
805
+ };
806
+ // Position calculation
807
+ const calculatePositionForSide = (position, triggerRect, tooltipRect) => {
808
+ switch (position) {
809
+ case 'left':
810
+ return {
811
+ top: triggerRect.top + (triggerRect.height - tooltipRect.height) / 2,
812
+ left: triggerRect.left - tooltipRect.width - margin
813
+ };
814
+ case 'right':
815
+ return {
816
+ top: triggerRect.top + (triggerRect.height - tooltipRect.height) / 2,
817
+ left: triggerRect.right + margin
818
+ };
819
+ case 'top':
820
+ return {
821
+ top: triggerRect.top - tooltipRect.height - margin,
822
+ left: triggerRect.left + (triggerRect.width - tooltipRect.width) / 2
823
+ };
824
+ case 'bottom':
825
+ return {
826
+ top: triggerRect.bottom + margin,
827
+ left: triggerRect.left + (triggerRect.width - tooltipRect.width) / 2
828
+ };
829
+ }
830
+ };
831
+ const MANAGER_CONTAINER_CLASS = "cw-tooltip-manager";
832
+ const ensureTooltipManager = () => {
833
+ if (document.querySelector(`.${MANAGER_CONTAINER_CLASS}`))
834
+ return;
835
+ const container = document.createElement("div");
836
+ container.className = MANAGER_CONTAINER_CLASS;
837
+ document.body.appendChild(container);
838
+ const root = createRoot(container);
839
+ root.render(jsx(CwTooltipManager, {}));
840
+ };
841
+ // Main component
842
+ /**
843
+ * Global tooltip renderer. Manages a single portal instance in the DOM,
844
+ * shared across all CwTooltipNew instances for optimal performance.
845
+ *
846
+ * Mount once at the app root, or let CwTooltipNew handle it automatically
847
+ * via ensureTooltipManager().
848
+ *
849
+ * @see CwTooltipNew
850
+ * @see showTooltip
851
+ * @see hideTooltip
852
+ */
853
+ const CwTooltipManager = () => {
854
+ const [state, setState] = useState(currentState);
855
+ const [tooltipPosition, setTooltipPosition] = useState({ top: 0, left: 0 });
856
+ const [actualPosition, setActualPosition] = useState("right");
857
+ const [isPositioned, setIsPositioned] = useState(false);
858
+ const tooltipRef = useRef(null);
859
+ const [isMeasuring, setIsMeasuring] = useState(false);
860
+ // Register update callback
861
+ useEffect(() => {
862
+ const update = () => {
863
+ setState({ ...currentState });
864
+ if (!currentState.isVisible)
865
+ setIsMeasuring(false);
866
+ };
867
+ stateUpdateCallbacks.add(update);
868
+ return () => {
869
+ stateUpdateCallbacks.delete(update);
870
+ };
871
+ }, []);
872
+ // Function to calculate position
873
+ const calculatePosition = useCallback(() => {
874
+ if (!state.isVisible || !state.triggerRect || !tooltipRef.current) {
875
+ return;
876
+ }
877
+ const tooltipRect = tooltipRef.current.getBoundingClientRect();
878
+ const windowWidth = window.innerWidth;
879
+ const windowHeight = window.innerHeight;
880
+ // Try preferred position first
881
+ let position = calculatePositionForSide(state.position, state.triggerRect, tooltipRect);
882
+ // Check if it fits
883
+ if (position.left >= margin &&
884
+ position.top >= margin &&
885
+ position.left + tooltipRect.width <= windowWidth - margin &&
886
+ position.top + tooltipRect.height <= windowHeight - margin) {
887
+ setTooltipPosition(position);
888
+ setActualPosition(state.position);
889
+ setIsPositioned(true);
890
+ setIsMeasuring(false);
891
+ return;
892
+ }
893
+ // Try other positions
894
+ for (const pos of positionOrder) {
895
+ if (pos === state.position)
896
+ continue;
897
+ const newPosition = calculatePositionForSide(pos, state.triggerRect, tooltipRect);
898
+ if (newPosition.left >= margin &&
899
+ newPosition.top >= margin &&
900
+ newPosition.left + tooltipRect.width <= windowWidth - margin &&
901
+ newPosition.top + tooltipRect.height <= windowHeight - margin) {
902
+ setTooltipPosition(newPosition);
903
+ setActualPosition(pos);
904
+ setIsPositioned(true);
905
+ setIsMeasuring(false);
906
+ return;
907
+ }
908
+ }
909
+ // Fallback if none fit - adjust to fit within viewport
910
+ const triggerRect = state.triggerRect;
911
+ // Calculate available space around the trigger element
912
+ const spaceTop = triggerRect.top;
913
+ const spaceBottom = windowHeight - triggerRect.bottom;
914
+ const spaceLeft = triggerRect.left;
915
+ const spaceRight = windowWidth - triggerRect.right;
916
+ // Find the side with the most space
917
+ let bestPosition;
918
+ const maxSpace = Math.max(spaceTop, spaceBottom, spaceLeft, spaceRight);
919
+ if (maxSpace === spaceRight) {
920
+ bestPosition = 'right';
921
+ }
922
+ else if (maxSpace === spaceBottom) {
923
+ bestPosition = 'bottom';
924
+ }
925
+ else if (maxSpace === spaceLeft) {
926
+ bestPosition = 'left';
927
+ }
928
+ else {
929
+ bestPosition = 'top';
930
+ }
931
+ // Find the coordinates for the best position
932
+ let bestPositionCoords = calculatePositionForSide(bestPosition, triggerRect, tooltipRect);
933
+ // Adjust to fit within the viewport (but without covering the trigger element)
934
+ if (bestPositionCoords.left < margin) {
935
+ bestPositionCoords.left = margin;
936
+ }
937
+ else if (bestPositionCoords.left + tooltipRect.width > windowWidth - margin) {
938
+ bestPositionCoords.left = windowWidth - tooltipRect.width - margin;
939
+ }
940
+ if (bestPositionCoords.top < margin) {
941
+ bestPositionCoords.top = margin;
942
+ }
943
+ else if (bestPositionCoords.top + tooltipRect.height > windowHeight - margin) {
944
+ bestPositionCoords.top = windowHeight - tooltipRect.height - margin;
945
+ }
946
+ setTooltipPosition(bestPositionCoords);
947
+ setActualPosition(bestPosition);
948
+ setIsPositioned(true);
949
+ setIsMeasuring(false);
950
+ }, [state]);
951
+ // Reset isPositioned when state changes (new tooltip)
952
+ // useLayouteffect is used to ensure it runs before the browser paints, preventing flashes of incorrectly positioned tooltips
953
+ useLayoutEffect(() => {
954
+ if (state.isVisible) {
955
+ setIsPositioned(false);
956
+ // Calculate position in next frame
957
+ calculatePosition();
958
+ }
959
+ }, [state.isVisible, state.triggerRect, state.content, calculatePosition]);
960
+ // ResizeObserver to reposition when content size changes (e.g., data loads)
961
+ useLayoutEffect(() => {
962
+ if (!state.isVisible || !tooltipRef.current) {
963
+ return;
964
+ }
965
+ const resizeObserver = new ResizeObserver(() => {
966
+ setIsMeasuring(true);
967
+ setIsPositioned(false);
968
+ calculatePosition();
969
+ });
970
+ resizeObserver.observe(tooltipRef.current);
971
+ return () => {
972
+ resizeObserver.disconnect();
973
+ };
974
+ }, [state.isVisible, calculatePosition]);
975
+ if (!state.isVisible || !state.content) {
976
+ return null;
977
+ }
978
+ return createPortal(jsx("div", { ref: tooltipRef, className: styles$n["cw-tooltip-content"], "data-position": actualPosition, "data-visible": state.isVisible, style: {
979
+ top: `${tooltipPosition.top}px`,
980
+ left: `${tooltipPosition.left}px`,
981
+ opacity: (isPositioned && !isMeasuring) ? 1 : 0,
982
+ }, onMouseEnter: () => state.dissapearsWhenHover && hideTooltip(), children: state.content }), document.body);
983
+ };
984
+
985
+ /**
986
+ * Tooltip component backed by the global CwTooltipManager singleton.
987
+ * More performant than CwGenericTooltip for high-density scenarios (e.g. schedulers)
988
+ * as it shares a single DOM portal across all instances.
989
+ *
990
+ * Self-initializes the Manager if not already mounted via ensureTooltipManager().
991
+ * Drop-in replacement for CwGenericTooltip with the same API.
992
+ *
993
+ * @see CwTooltipManager
994
+ * @see CwGenericTooltip
995
+ */
996
+ const CwTooltipNew = ({ children, content = null, position = "right", dissapearsWhenHover = false, hide = false, showDelay = 0, overlayStyle = {}, displayInline = false, }) => {
997
+ const containerRef = useRef(null);
998
+ const timeoutRef = useRef();
999
+ const handleMouseEnter = useCallback(() => {
1000
+ if (hide || !content || !containerRef.current)
1001
+ return;
1002
+ if (timeoutRef.current) {
1003
+ window.clearTimeout(timeoutRef.current);
1004
+ }
1005
+ if (showDelay > 0) {
1006
+ timeoutRef.current = window.setTimeout(() => {
1007
+ if (containerRef.current) {
1008
+ showTooltip(content, containerRef.current, position, dissapearsWhenHover);
1009
+ }
1010
+ }, showDelay);
1011
+ }
1012
+ else {
1013
+ showTooltip(content, containerRef.current, position, dissapearsWhenHover);
1014
+ }
1015
+ }, [content, position, showDelay, hide, dissapearsWhenHover]);
1016
+ const handleMouseLeave = useCallback(() => {
1017
+ if (timeoutRef.current) {
1018
+ window.clearTimeout(timeoutRef.current);
1019
+ }
1020
+ hideTooltip();
1021
+ }, []);
1022
+ // Cleanup on unmount to prevent memory leaks
1023
+ useEffect(() => {
1024
+ return () => {
1025
+ if (timeoutRef.current) {
1026
+ window.clearTimeout(timeoutRef.current);
1027
+ }
1028
+ };
1029
+ }, []);
1030
+ // Hide tooltip when mousedown / drag events
1031
+ useEffect(() => {
1032
+ const handleDocumentMouseDown = () => {
1033
+ if (timeoutRef.current) {
1034
+ window.clearTimeout(timeoutRef.current);
1035
+ }
1036
+ hideTooltip();
1037
+ };
1038
+ document.addEventListener("mousedown", handleDocumentMouseDown);
1039
+ return () => {
1040
+ document.removeEventListener("mousedown", handleDocumentMouseDown);
1041
+ };
1042
+ }, []);
1043
+ useEffect(() => {
1044
+ ensureTooltipManager();
1045
+ }, []);
1046
+ return (jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$n["cw-tooltip"], children: children }));
754
1047
  };
755
1048
 
1049
+ function CwButton({ text, variant = 'solid', color = 'primary', className = '', icon = "", title, tooltipPosition = "bottom", children, ...buttonProps }) {
1050
+ // Build CSS classes based on variant and props
1051
+ let buttonClass = `cw-button-${variant}`;
1052
+ // Add icon class only for icon variant without children
1053
+ if (variant === 'icon' && icon && !children) {
1054
+ buttonClass += ` cwi-${icon}`;
1055
+ }
1056
+ if (className) {
1057
+ buttonClass += ` ${className}`;
1058
+ }
1059
+ const tooltipContent = title || (variant === 'icon' && text ? text : undefined);
1060
+ const buttonElement = (jsx("button", { type: "button", className: buttonClass, ...buttonProps, "data-color": color, "aria-label": tooltipContent, children: variant === 'icon' ? null : (children ?? (jsxs(Fragment, { children: [icon && jsx(CwIcon, { iconId: icon }), text && jsx("strong", { children: text })] }))) }));
1061
+ return tooltipContent ? (jsx(CwTooltipNew, { content: tooltipContent, position: tooltipPosition, displayInline: true, children: buttonElement })) : (buttonElement);
1062
+ }
1063
+
756
1064
  // Reference for draggable modal
757
1065
  /**
758
1066
  * **Note:** For new development, we recommend using {@link CwDialog} instead. CwModal remains supported for existing code.
@@ -766,10 +1074,6 @@ function CwModal(custModalProps) {
766
1074
  const isHide = custModalProps.hideModalActions !== null && custModalProps.hideModalActions !== undefined
767
1075
  ? custModalProps.hideModalActions
768
1076
  : false;
769
- // [ Show custom button === true ? show : default buttons ]
770
- const isShowcustButton = custModalProps.ShowcustButton !== null && custModalProps.ShowcustButton !== undefined
771
- ? custModalProps.ShowcustButton
772
- : false;
773
1077
  const cwelltOnMouseOverModal = () => {
774
1078
  setModalDisabled(false);
775
1079
  };
@@ -791,13 +1095,12 @@ function CwModal(custModalProps) {
791
1095
  };
792
1096
  return (jsx("div", { children: custModalProps.modalState && (jsxs("div", { className: custModalProps.classNameModalOverlay + " cwelltModalOverlay", children: [jsx("div", { className: "cwelltModalOverlayBg", onClick: custModalProps.onCloseModal }), jsx(Draggable, { disabled: isModalDisabled, axis: "both", nodeRef: draggableRef, children: jsxs("div", { className: custModalProps.classNameModal + " cwelltContainerModal", ref: draggableRef, style: widthModalDef !== "40em" ? modalStyle.widthCustomStyle : modalStyle.widthDefStyle, children: [jsxs("div", { className: "cwelltModalHeader", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx("div", { className: "cwelltModalTitle", children: custModalProps.titleModal }), jsx("button", { className: "cwelltBtnCloseModal", onClick: custModalProps.onCloseModal, children: jsx("span", { className: "cwelltCloseIcon" }) })] }), jsx("div", { className: "cwelltModalBody", children: jsx("div", { className: "cwelltContainerModalBody", style: { position: "relative" }, children: custModalProps.children }) }), isHide === false ? (
793
1097
  // [ false : show modal ]
794
- jsxs("div", { className: "cwelltModalFooter", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: [jsx(Tooltip, { placement: "bottom", title: "Save", color: "#368ee0", children: jsx("div", { className: "cwellt_flex cwellt_justify_center ", style: { width: "2em" }, children: jsx("button", { className: "cw-button-icon cwi-save", onClick: custModalProps.onSaveModal, form: custModalProps.formSaveModal, hidden: custModalProps.HideBtnModal, type: custModalProps.HtmlSubmitModal }) }) }), isShowcustButton === true ? (jsx(Tooltip, { placement: "bottom", title: custModalProps.custButtonTitle, color: custModalProps.custColorButtonTooltip, children: jsx("div", { className: "cwellt_flex cwellt_justify_center", style: { width: "2em" }, children: jsx("button", { className: "cw-button-icon " +
795
- custModalProps.custButtonClassName, onClick: custModalProps.custButtonClick }) }) })) : (jsx("div", {}))] })) : (
1098
+ jsx("footer", { className: "legacy-modal-footer", onMouseOver: cwelltOnMouseOverModal, onMouseOut: cwelltOnMouseOutModal, children: jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: custModalProps.onSaveModal, form: custModalProps.formSaveModal, hidden: custModalProps.HideBtnModal, type: custModalProps.HtmlSubmitModal }) })) : (
796
1099
  // true [ do not show the modal ]
797
1100
  jsx("div", { style: { display: "none" } }))] }) })] })) }));
798
1101
  }
799
1102
 
800
- var styles$j = {"overlayPositioned":"CwConfirmationPopup-module_overlayPositioned__11qYB","popup":"CwConfirmationPopup-module_popup__ahPjM","message":"CwConfirmationPopup-module_message__MnNL4","buttons":"CwConfirmationPopup-module_buttons__fGYYE","button":"CwConfirmationPopup-module_button__ugYQE","confirmButton":"CwConfirmationPopup-module_confirmButton__rTP4S","cancelButton":"CwConfirmationPopup-module_cancelButton__Ry694"};
1103
+ var styles$m = {"overlayPositioned":"CwConfirmationPopup-module_overlayPositioned__11qYB","popup":"CwConfirmationPopup-module_popup__ahPjM","message":"CwConfirmationPopup-module_message__MnNL4","buttons":"CwConfirmationPopup-module_buttons__fGYYE","button":"CwConfirmationPopup-module_button__ugYQE","confirmButton":"CwConfirmationPopup-module_confirmButton__rTP4S","cancelButton":"CwConfirmationPopup-module_cancelButton__Ry694"};
801
1104
 
802
1105
  function CwConfirmationPopup(props) {
803
1106
  const { isOpen, onConfirm, onCancel, message = "Are you sure you want to proceed?", confirmText = "Confirm", cancelText = "Cancel", placement = 'bottom', children } = props;
@@ -861,30 +1164,15 @@ function CwConfirmationPopup(props) {
861
1164
  onCancel();
862
1165
  }
863
1166
  };
864
- return (jsxs(Fragment, { children: [renderChildren(), isOpen && (jsx("div", { className: styles$j.overlayPositioned, onClick: handleOverlayClick, children: jsxs("div", { ref: popupRef, className: styles$j.popup, style: {
1167
+ return (jsxs(Fragment, { children: [renderChildren(), isOpen && (jsx("div", { className: styles$m.overlayPositioned, onClick: handleOverlayClick, children: jsxs("div", { ref: popupRef, className: styles$m.popup, style: {
865
1168
  position: 'absolute',
866
1169
  top: `${position.top}px`,
867
1170
  left: `${position.left}px`,
868
1171
  transform: 'none'
869
- }, children: [jsx("p", { className: styles$j.message, children: message }), jsxs("div", { className: styles$j.buttons, children: [jsx("button", { className: `${styles$j.button} ${styles$j.confirmButton}`, onClick: onConfirm, children: confirmText }), jsx("button", { className: `${styles$j.button} ${styles$j.cancelButton}`, onClick: onCancel, children: cancelText })] })] }) }))] }));
870
- }
871
-
872
- function CwButton({ text, variant = 'solid', color = 'primary', className = '', icon = "", title, tooltipPosition = "bottom", children, ...buttonProps }) {
873
- // Build CSS classes based on variant and props
874
- let buttonClass = `cw-button-${variant}`;
875
- // Add icon class only for icon variant without children
876
- if (variant === 'icon' && icon && !children) {
877
- buttonClass += ` cwi-${icon}`;
878
- }
879
- if (className) {
880
- buttonClass += ` ${className}`;
881
- }
882
- const tooltipContent = title || (variant === 'icon' && text ? text : undefined);
883
- const buttonElement = (jsx("button", { type: "button", className: buttonClass, ...buttonProps, "data-color": color, "aria-label": tooltipContent, children: variant === 'icon' ? null : (children ?? (jsxs(Fragment, { children: [icon && jsx(CwIcon, { iconId: icon }), text && jsx("strong", { children: text })] }))) }));
884
- return tooltipContent ? (jsx(CwGenericTooltip, { content: tooltipContent, position: tooltipPosition, displayInline: true, children: buttonElement })) : (buttonElement);
1172
+ }, children: [jsx("p", { className: styles$m.message, children: message }), jsxs("div", { className: styles$m.buttons, children: [jsx("button", { className: `${styles$m.button} ${styles$m.confirmButton}`, onClick: onConfirm, children: confirmText }), jsx("button", { className: `${styles$m.button} ${styles$m.cancelButton}`, onClick: onCancel, children: cancelText })] })] }) }))] }));
885
1173
  }
886
1174
 
887
- var styles$i = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8"};
1175
+ var styles$l = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8"};
888
1176
 
889
1177
  // Helper function to parse size values
890
1178
  const parseSize = (size) => {
@@ -923,7 +1211,7 @@ const convertFromPx = (px, unit) => {
923
1211
  }
924
1212
  };
925
1213
  const CwDialog = props => {
926
- const { customFooter, customHeader, headline, width, height, dialogSize, scrim, onSave, onClose, hideFooter, children, open, autoReposition = false, ...domProps } = props;
1214
+ const { customFooter, customHeader, headline, width, height, dialogSize, scrim, onSave, onClose, hideFooter, children, open, autoReposition = false, disableSave, ...domProps } = props;
927
1215
  const dialogRef = useRef(null);
928
1216
  const [isPressingScrim, setIsPressingScrim] = useState(false);
929
1217
  const pressTimerRef = useRef(0);
@@ -960,9 +1248,13 @@ const CwDialog = props => {
960
1248
  heightUnit: parsedHeight.unit,
961
1249
  autoHeight: isAutoHeight
962
1250
  };
1251
+ const maxWidth = window.innerWidth * 0.9;
1252
+ const maxHeight = window.innerHeight * 0.9;
1253
+ const clampedWidth = Math.min(initialWidthPx, maxWidth);
1254
+ const clampedHeight = Math.min(initialEstimatedHeight, maxHeight);
963
1255
  const initialPosition = {
964
- x: window.document.body.clientWidth / 2 - initialWidthPx / 2,
965
- y: window.document.body.clientHeight / 2 - initialEstimatedHeight / 2
1256
+ x: Math.max(0, window.document.body.clientWidth / 2 - clampedWidth / 2),
1257
+ y: Math.max(0, window.document.body.clientHeight / 2 - clampedHeight / 2)
966
1258
  };
967
1259
  return { initialDialogSize, initialPosition };
968
1260
  }, [width, height, dialogSize]); // Only recalculate when these props change
@@ -971,6 +1263,7 @@ const CwDialog = props => {
971
1263
  const [position, setPosition] = useState(initialSetup.initialPosition);
972
1264
  const [size, setSize] = useState(initialSetup.initialDialogSize);
973
1265
  const [dragStart, setDragStart] = useState({ x: 0, y: 0 });
1266
+ const userDraggedRef = useRef(false);
974
1267
  // scrim is true by default
975
1268
  const hasScrim = scrim !== false;
976
1269
  // Adjust position after the dialog is rendered when using autoHeight
@@ -1010,6 +1303,35 @@ const CwDialog = props => {
1010
1303
  resizeObserver?.disconnect();
1011
1304
  };
1012
1305
  }, [size.autoHeight, open, autoReposition]);
1306
+ // Keep dialog visible when viewport is resized; re-center only if user hasn't dragged
1307
+ const originalWidthPx = initialSetup.initialDialogSize.width;
1308
+ useEffect(() => {
1309
+ if (!open)
1310
+ return;
1311
+ userDraggedRef.current = false;
1312
+ const handleWindowResize = () => {
1313
+ const vw = window.innerWidth;
1314
+ const vh = window.innerHeight;
1315
+ const w = Math.min(originalWidthPx, vw * 0.9);
1316
+ setSize(prev => w !== prev.width ? { ...prev, width: w } : prev);
1317
+ if (!userDraggedRef.current) {
1318
+ const dh = dialogRef.current?.offsetHeight ?? 300;
1319
+ setPosition({
1320
+ x: Math.max(0, (vw - w) / 2),
1321
+ y: Math.max(0, (vh - dh) / 2),
1322
+ });
1323
+ }
1324
+ else {
1325
+ // Clamp so dialog stays on screen
1326
+ setPosition(prev => ({
1327
+ x: Math.max(0, Math.min(prev.x, vw - w - 8)),
1328
+ y: Math.max(0, Math.min(prev.y, vh - (dialogRef.current?.offsetHeight ?? 300) - 8)),
1329
+ }));
1330
+ }
1331
+ };
1332
+ window.addEventListener("resize", handleWindowResize);
1333
+ return () => window.removeEventListener("resize", handleWindowResize);
1334
+ }, [open]);
1013
1335
  useEffect(() => {
1014
1336
  const handleMouseMove = (e) => {
1015
1337
  if (isDragging) {
@@ -1091,6 +1413,7 @@ const CwDialog = props => {
1091
1413
  }, [isDragging, resizeDirection, dragStart, position, size]);
1092
1414
  const handleMouseDown = useCallback((e) => {
1093
1415
  setIsDragging(true);
1416
+ userDraggedRef.current = true;
1094
1417
  setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });
1095
1418
  }, [position]);
1096
1419
  const handleResizeMouseDown = useCallback((direction) => (e) => {
@@ -1122,9 +1445,9 @@ const CwDialog = props => {
1122
1445
  }
1123
1446
  }
1124
1447
  }, [open]);
1125
- const header = useMemo(() => (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: headline }), customHeader || (jsx("button", { className: styles$i["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
1448
+ const header = useMemo(() => (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: headline }), customHeader || (jsx("button", { className: styles$l["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
1126
1449
  const content = useMemo(() => (jsx("section", { children: children })), [children]);
1127
- const footer = useMemo(() => (jsx("footer", { children: customFooter || (jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: onSave, tooltipPosition: "top" })) })), [customFooter, onSave]);
1450
+ const footer = useMemo(() => (jsx("footer", { children: customFooter || (jsx(CwButton, { variant: "icon", icon: "save", title: "Save", onClick: onSave, tooltipPosition: "top", disabled: disableSave })) })), [customFooter, onSave, disableSave]);
1128
1451
  const resizeHandles = useMemo(() => size.autoHeight
1129
1452
  ? [
1130
1453
  // Only horizontal handles if autoHeight is true
@@ -1151,7 +1474,7 @@ const CwDialog = props => {
1151
1474
  : `${convertFromPx(size.height, size.heightUnit)}${size.heightUnit}`;
1152
1475
  return { displayWidth, displayHeight };
1153
1476
  }, [size.width, size.height, size.widthUnit, size.heightUnit, size.autoHeight]);
1154
- const dialogContent = (jsx("div", { "data-has-scrim": hasScrim, className: styles$i["cw-dialog-main"], onMouseDown: handleScrimMouseDown, onMouseUp: handleScrimMouseUpOrLeave, onMouseLeave: handleScrimMouseUpOrLeave, "data-pressing": isPressingScrim, children: jsxs("dialog", { ...domProps, ref: dialogRef, style: {
1477
+ const dialogContent = (jsx("div", { "data-has-scrim": hasScrim, className: styles$l["cw-dialog-main"], onMouseDown: handleScrimMouseDown, onMouseUp: handleScrimMouseUpOrLeave, onMouseLeave: handleScrimMouseUpOrLeave, "data-pressing": isPressingScrim, children: jsxs("dialog", { ...domProps, ref: dialogRef, style: {
1155
1478
  left: `${position.x}px`,
1156
1479
  top: `${position.y}px`,
1157
1480
  width: displayDimensions.displayWidth,
@@ -1182,7 +1505,6 @@ const CwModalReportFunctional = (props) => {
1182
1505
  };
1183
1506
 
1184
1507
  class CwReportModal extends React.Component {
1185
- formRef = React.createRef();
1186
1508
  constructor(props) {
1187
1509
  super(props);
1188
1510
  this.state = {
@@ -1199,7 +1521,6 @@ class CwReportModal extends React.Component {
1199
1521
  }
1200
1522
  render() {
1201
1523
  return (jsx("div", { id: "modal-report-content", children: this.state.isModal === true ? (jsxs(CwDialog, { open: this.props.visible, width: this.props.width, height: this.props.height, headline: this.props.title, onClose: () => {
1202
- this.formRef?.current?.resetFields();
1203
1524
  this.props.SET_MODAL_REPORT_VISIBLE(false);
1204
1525
  }, hideFooter: true, className: "modal-report-content", children: [this.props.name !== "Empty.pdf" && (jsx("div", { style: { width: "100%", height: "100%", overflowX: "auto", overflowY: "auto" }, children: 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" && (jsx("div", { children: jsxs("h1", { style: { marginLeft: "2em" }, children: [" ", "Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }) }))] })) : (jsxs("div", { children: [this.props.name !== "Empty.pdf" && (jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", width: "100%", height: "800px" })), this.props.name === "Empty.pdf" && (jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
1205
1526
  }
@@ -1356,7 +1677,7 @@ function CwAlign(props) {
1356
1677
  }, children: props.children }));
1357
1678
  }
1358
1679
 
1359
- var styles$h = {"card":"cw-card-module_card__HJUT0","clickable":"cw-card-module_clickable__Y-V3X","disabled":"cw-card-module_disabled__0wHh1","loading":"cw-card-module_loading__-fzlx","content":"cw-card-module_content__ma9qy","headerContent":"cw-card-module_headerContent__x4Jfl","footerTags":"cw-card-module_footerTags__80sSW","loadingOverlay":"cw-card-module_loadingOverlay__8-zVV"};
1680
+ var styles$k = {"card":"cw-card-module_card__HJUT0","clickable":"cw-card-module_clickable__Y-V3X","disabled":"cw-card-module_disabled__0wHh1","loading":"cw-card-module_loading__-fzlx","content":"cw-card-module_content__ma9qy","headerContent":"cw-card-module_headerContent__x4Jfl","footerTags":"cw-card-module_footerTags__80sSW","loadingOverlay":"cw-card-module_loadingOverlay__8-zVV"};
1360
1681
 
1361
1682
  /**
1362
1683
  * CwCard - A simple card component for displaying content in a contained format
@@ -1380,11 +1701,11 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
1380
1701
  // Construct class names using CSS modules
1381
1702
  const cardClassNames = [
1382
1703
  'cw-card',
1383
- styles$h.card,
1704
+ styles$k.card,
1384
1705
  className,
1385
- clickable ? styles$h.clickable : '',
1386
- disabled ? styles$h.disabled : '',
1387
- isLoading ? styles$h.loading : '',
1706
+ clickable ? styles$k.clickable : '',
1707
+ disabled ? styles$k.disabled : '',
1708
+ isLoading ? styles$k.loading : '',
1388
1709
  ].filter(Boolean).join(' ');
1389
1710
  // Handle click event when card is clickable
1390
1711
  const handleClick = () => {
@@ -1401,15 +1722,15 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
1401
1722
  // Determine if footer should be rendered
1402
1723
  const hasFooter = hasChips || footer || (hasActions && direction === "row");
1403
1724
  // Actions component to reuse
1404
- const ActionsComponent = hasActions && !disabled ? (jsxs("div", { className: styles$h.actions, children: [extraActions ?? null, onEdit && jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) : null;
1725
+ const ActionsComponent = hasActions && !disabled ? (jsxs("div", { className: styles$k.actions, children: [extraActions ?? null, onEdit && jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) : null;
1405
1726
  return (jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && {
1406
1727
  role: 'button',
1407
1728
  tabIndex: 0,
1408
1729
  onClick: handleClick,
1409
- }), "data-variant": variant, "data-direction": direction, children: [hasHeader && (jsxs("header", { children: [(title || subtitle) && (jsxs("div", { className: styles$h.headerContent, "data-alignment": alignment, children: [title && jsx("h5", { children: title }), subtitle && jsx("strong", { children: subtitle })] })), direction === "column" && ActionsComponent] })), jsx("div", { className: styles$h.content, children: children }), hasFooter && (jsxs("footer", { children: [hasChips && (jsx("div", { className: styles$h.footerTags, children: chips.map((chip, index) => (jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$h.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsx("div", { className: styles$h.footerContent, children: footer }))] })), direction === "row" && ActionsComponent, isLoading && (jsx("div", { className: styles$h.loadingOverlay, children: jsx(CwLoading, { isLoading: isLoading, size: "small" }) }))] }));
1730
+ }), "data-variant": variant, "data-direction": direction, children: [hasHeader && (jsxs("header", { children: [(title || subtitle) && (jsxs("div", { className: styles$k.headerContent, "data-alignment": alignment, children: [title && jsx("h5", { children: title }), subtitle && jsx("strong", { children: subtitle })] })), direction === "column" && ActionsComponent] })), jsx("div", { className: styles$k.content, children: children }), hasFooter && (jsxs("footer", { children: [hasChips && (jsx("div", { className: styles$k.footerTags, children: chips.map((chip, index) => (jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$k.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsx("div", { className: styles$k.footerContent, children: footer }))] })), direction === "row" && ActionsComponent, isLoading && (jsx("div", { className: styles$k.loadingOverlay, children: jsx(CwLoading, { isLoading: isLoading, size: "small" }) }))] }));
1410
1731
  };
1411
1732
 
1412
- var styles$g = {"cardContainer":"cw-card-list-module_cardContainer__l3YEh","pagination":"cw-card-list-module_pagination__5Ay78","pageInfo":"cw-card-list-module_pageInfo__uiMel","loading":"cw-card-list-module_loading__cYpND","emptyState":"cw-card-list-module_emptyState__RlqiS","sortControls":"cw-card-list-module_sortControls__mWgZA"};
1733
+ var styles$j = {"cardContainer":"cw-card-list-module_cardContainer__l3YEh","pagination":"cw-card-list-module_pagination__5Ay78","pageInfo":"cw-card-list-module_pageInfo__uiMel","loading":"cw-card-list-module_loading__cYpND","emptyState":"cw-card-list-module_emptyState__RlqiS","sortControls":"cw-card-list-module_sortControls__mWgZA"};
1413
1734
 
1414
1735
  function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', defaultCardWidth = 320, cardGap = 16, isLoading = false, emptyState, sortOptions = [], defaultSortKey, ...htmlProps }) {
1415
1736
  const [currentPage, setCurrentPage] = useState(1);
@@ -1443,10 +1764,10 @@ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', default
1443
1764
  '--card-width': `${defaultCardWidth}px`,
1444
1765
  '--card-gap': `${cardGap}px`
1445
1766
  };
1446
- return (jsxs("div", { ...htmlProps, children: [sortOptions.length > 0 && (jsxs("div", { className: styles$g.sortControls, children: [jsx("label", { htmlFor: "cardlist-sort-select", children: "Sort by:" }), jsx("select", { id: "cardlist-sort-select", value: sortKey, onChange: (e) => handleSortChange(e.target.value), className: styles$g.sortSelect, children: sortOptions.map(option => (jsx("option", { value: option.key, children: option.label }, option.key))) }), jsx("button", { onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'), className: `cw-button-icon ${sortDirection === 'asc' ? 'cwi-arrow-up' : 'cwi-arrow-down'}`, title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}` })] })), isLoading ? (jsx("div", { className: styles$g.loading, children: jsx(CwLoading, { isLoading: isLoading }) })) : sortedItems.length === 0 ? (jsx("div", { className: styles$g.emptyState, children: emptyState || jsx("p", { children: "No items to display" }) })) : (jsxs(Fragment, { children: [jsx("div", { className: `${styles$g.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsx("div", { className: styles$g.cardWrapper, children: renderCard(item, index) }, index))) }), totalPages > 1 && (jsxs("div", { className: styles$g.pagination, children: [jsx("button", { disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)), className: "cw-button-icon cwi-chevron-left" }), jsxs("span", { className: styles$g.pageInfo, children: [currentPage, " of ", totalPages] }), jsx("button", { disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)), className: "cw-button-icon cwi-chevron-right" })] }))] }))] }));
1767
+ return (jsxs("div", { ...htmlProps, children: [sortOptions.length > 0 && (jsxs("div", { className: styles$j.sortControls, children: [jsx("label", { htmlFor: "cardlist-sort-select", children: "Sort by:" }), jsx("select", { id: "cardlist-sort-select", value: sortKey, onChange: (e) => handleSortChange(e.target.value), className: styles$j.sortSelect, children: sortOptions.map(option => (jsx("option", { value: option.key, children: option.label }, option.key))) }), jsx("button", { onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'), className: `cw-button-icon ${sortDirection === 'asc' ? 'cwi-arrow-up' : 'cwi-arrow-down'}`, title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}` })] })), isLoading ? (jsx("div", { className: styles$j.loading, children: jsx(CwLoading, { isLoading: isLoading }) })) : sortedItems.length === 0 ? (jsx("div", { className: styles$j.emptyState, children: emptyState || jsx("p", { children: "No items to display" }) })) : (jsxs(Fragment, { children: [jsx("div", { className: `${styles$j.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsx("div", { className: styles$j.cardWrapper, children: renderCard(item, index) }, index))) }), totalPages > 1 && (jsxs("div", { className: styles$j.pagination, children: [jsx("button", { disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)), className: "cw-button-icon cwi-chevron-left" }), jsxs("span", { className: styles$j.pageInfo, children: [currentPage, " of ", totalPages] }), jsx("button", { disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)), className: "cw-button-icon cwi-chevron-right" })] }))] }))] }));
1447
1768
  }
1448
1769
 
1449
- var styles$f = {"cw-accordion":"cw-accordion-module_cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module_cw-accordion-body__xlI8b"};
1770
+ var styles$i = {"cw-accordion":"cw-accordion-module_cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module_cw-accordion-body__xlI8b"};
1450
1771
 
1451
1772
  /**
1452
1773
  *
@@ -1463,7 +1784,7 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
1463
1784
  setVisible_accordionBody(!isVisible_accordionBody);
1464
1785
  };
1465
1786
  // #endregion
1466
- return (jsxs("div", { className: styles$f["cw-accordion"], style: CwelltAccordionContainerProps.style, "data-open": isVisible_accordionBody, children: [jsxs("header", { onClick: () => showAccordionBody(), children: [jsx("div", { children: CwelltAccordionContainerProps.desc_text }), jsx("button", { className: "cw-button-icon" })] }), jsx("div", { className: styles$f["cw-accordion-body"], children: CwelltAccordionContainerProps.children })] }));
1787
+ return (jsxs("div", { className: styles$i["cw-accordion"], style: CwelltAccordionContainerProps.style, "data-open": isVisible_accordionBody, children: [jsxs("header", { onClick: () => showAccordionBody(), children: [jsx("div", { children: CwelltAccordionContainerProps.desc_text }), jsx("button", { className: "cw-button-icon" })] }), jsx("div", { className: styles$i["cw-accordion-body"], children: CwelltAccordionContainerProps.children })] }));
1467
1788
  }
1468
1789
 
1469
1790
  /**
@@ -1535,12 +1856,12 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
1535
1856
  *
1536
1857
  * @returns React component
1537
1858
  */
1538
- function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection, }) {
1859
+ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection }) {
1539
1860
  const [currentPage, setCurrentPage] = useState(1);
1540
1861
  const [expandedRowKey, setExpandedRowKey] = useState(null);
1541
1862
  const [sortConfig, setSortConfig] = useState({
1542
1863
  key: null,
1543
- direction: "asc",
1864
+ direction: "asc"
1544
1865
  });
1545
1866
  const [localItemsPerPage, setLocalItemsPerPage] = useState(pageSizeOptions[0]);
1546
1867
  const [columnWidths, setColumnWidths] = useState(() => columns.reduce((acc, col) => {
@@ -1565,7 +1886,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1565
1886
  onExpand?.(item);
1566
1887
  }, [rowKey, onExpand]);
1567
1888
  const handleSort = useCallback((columnKey) => {
1568
- setSortConfig((prev) => {
1889
+ setSortConfig(prev => {
1569
1890
  if (prev.key !== columnKey)
1570
1891
  return { key: columnKey, direction: "asc" };
1571
1892
  if (prev.direction === "asc")
@@ -1592,7 +1913,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1592
1913
  if (typeof aVal === "string" && typeof bVal === "string") {
1593
1914
  const comparison = aVal.localeCompare(bVal, undefined, {
1594
1915
  sensitivity: "base",
1595
- numeric: true,
1916
+ numeric: true
1596
1917
  });
1597
1918
  return comparison * (sortConfig.direction === "asc" ? 1 : -1);
1598
1919
  }
@@ -1608,7 +1929,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1608
1929
  return;
1609
1930
  }
1610
1931
  const itemKey = item[rowKey];
1611
- setSelectedKeys((prev) => {
1932
+ setSelectedKeys(prev => {
1612
1933
  const newSet = new Set(prev);
1613
1934
  if (rowSelection?.type === "single") {
1614
1935
  // Single mode: only one row selected
@@ -1629,7 +1950,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1629
1950
  newSet.add(itemKey);
1630
1951
  }
1631
1952
  }
1632
- const selectedRows = sortedData.filter((item) => newSet.has(item[rowKey]));
1953
+ const selectedRows = sortedData.filter(item => newSet.has(item[rowKey]));
1633
1954
  // Run after render to avoid "Cannot update a component while rendering another component"
1634
1955
  setTimeout(() => {
1635
1956
  rowSelection?.onChange?.(Array.from(newSet), selectedRows);
@@ -1658,7 +1979,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1658
1979
  const startWidth = e.target.parentElement?.offsetWidth || 0;
1659
1980
  const onMouseMove = (moveEvent) => {
1660
1981
  const newWidth = Math.max(startWidth + moveEvent.clientX - startX, 50); // min 50px
1661
- setColumnWidths((prev) => ({ ...prev, [key]: newWidth }));
1982
+ setColumnWidths(prev => ({ ...prev, [key]: newWidth }));
1662
1983
  };
1663
1984
  const onMouseUp = () => {
1664
1985
  window.removeEventListener("mousemove", onMouseMove);
@@ -1671,7 +1992,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1671
1992
  if (stickyHeader || scrollHeight) {
1672
1993
  return {
1673
1994
  maxHeight: scrollHeight ?? 300,
1674
- overflowY: "auto",
1995
+ overflowY: "auto"
1675
1996
  };
1676
1997
  }
1677
1998
  return {}; // no height or scroll
@@ -1687,32 +2008,40 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1687
2008
  if (!paginatedData || paginatedData.length === 0) {
1688
2009
  return (jsx("tr", { children: jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
1689
2010
  }
1690
- return paginatedData.map((item) => {
2011
+ return paginatedData.map(item => {
1691
2012
  const itemKey = item[rowKey];
1692
2013
  if (!itemKey)
1693
2014
  console.warn("Missing row key for item", item);
1694
2015
  const isSelected = selectedKeys.has(itemKey);
1695
- const dynamicClassName = typeof classNameRow === "function" ? classNameRow(item) : (classNameRow ?? "");
2016
+ const dynamicClassName = typeof classNameRow === "function"
2017
+ ? classNameRow(item)
2018
+ : classNameRow ?? "";
1696
2019
  return (jsxs(React__default.Fragment, { children: [jsxs("tr", { className: `${dynamicClassName} ${hasClassNameRow(item) ? item.classNameRow : ""} ${isSelected ? "cw-table-row-selected" : ""}`, onClick: (e) => rowSelection && handleRowClick(item, e), style: {
1697
2020
  cursor: rowSelection ? "pointer" : "default",
1698
2021
  backgroundColor: isSelected ? "var(--cw-color-info-container)" : undefined,
1699
2022
  transition: "background-color 0.2s ease",
1700
- }, children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map((col) => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex]) : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
2023
+ }, children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
2024
+ ? "cwi-chevron-down"
2025
+ : "cwi-chevron-right"}` }) })), columns.map(col => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? String(item[col.dataIndex] ?? "") : "" }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
1701
2026
  });
1702
2027
  };
1703
- return (jsxs("div", { id: id, className: `cw-table-container ${classNameContainer ?? ""}`, style: style, children: [jsx("div", { style: scrollContainerStyle, children: jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsx("thead", { style: stickyHeader ? { position: "sticky", top: 0, background: "white", zIndex: 2 } : undefined, children: jsxs("tr", { children: [expandedRowRender && jsx("th", {}), columns.map((col) => (jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex ? sortConfig.direction : ""}`.trim(), style: {
2028
+ return (jsxs("div", { id: id, className: `cw-table-container ${classNameContainer ?? ""}`, style: style, children: [jsx("div", { style: scrollContainerStyle, children: jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsx("thead", { style: stickyHeader
2029
+ ? { position: "sticky", top: 0, background: "white", zIndex: 2 }
2030
+ : undefined, children: jsxs("tr", { children: [expandedRowRender && jsx("th", {}), columns.map(col => (jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
2031
+ ? sortConfig.direction
2032
+ : ""}`.trim(), style: {
1704
2033
  cursor: col.sortable ? "pointer" : "default",
1705
2034
  userSelect: "none",
1706
2035
  width: columnWidths[col.key] ?? col.width,
1707
2036
  ...((col.width || columnWidths[col.key]) && {
1708
2037
  minWidth: 50,
1709
- maxWidth: columnWidths[col.key] ?? col.width,
2038
+ maxWidth: columnWidths[col.key] ?? col.width
1710
2039
  }),
1711
- }, children: [jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [jsx("span", { children: col.title }), col.sortable && col.dataIndex && (jsx(CwIcon, { size: "large", iconId: sortConfig.key !== col.dataIndex
2040
+ }, children: [jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [jsx("span", { children: col.title }), col.sortable && col.dataIndex && (jsx(CwIcon, { style: { fontSize: "1.25em" }, iconId: sortConfig.key !== col.dataIndex
1712
2041
  ? "sortable"
1713
2042
  : sortConfig.direction === "asc"
1714
2043
  ? "sortable-asc"
1715
- : "sortable-desc" }))] }), jsx("span", { onMouseDown: (e) => startResize(e, col.key), className: "th-column-resizer" })] }, col.key)))] }) }), jsx("tbody", { children: renderTableBody() })] }) }), pagination && totalPages > 1 && (jsxs("footer", { className: "cw-table-pagination", children: [jsx("button", { onClick: () => handlePageChange(1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left-double", title: "First" }), jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left", title: "Previous" }), jsx("input", { type: "text", inputMode: "numeric", value: currentPage, onChange: (e) => {
2044
+ : "sortable-desc" }))] }), jsx("span", { onMouseDown: (e) => startResize(e, col.key), className: "th-column-resizer" })] }, col.key)))] }) }), jsx("tbody", { children: renderTableBody() })] }) }), pagination && data.length > pageSizeOptions[0] && (jsxs("footer", { className: "cw-table-pagination", children: [jsx("button", { onClick: () => handlePageChange(1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left-double", title: "First" }), jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left", title: "Previous" }), jsx("input", { type: "text", inputMode: "numeric", value: currentPage, onChange: (e) => {
1716
2045
  const value = parseInt(e.target.value, 10);
1717
2046
  if (!isNaN(value))
1718
2047
  handlePageChange(value);
@@ -1721,66 +2050,225 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
1721
2050
  if (isNaN(value) || value < 1 || value > totalPages) {
1722
2051
  handlePageChange(1);
1723
2052
  }
1724
- }, min: 1, max: totalPages }), jsxs("span", { children: ["of ", totalPages] }), jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right", title: "Next" }), jsx("button", { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right-double", title: "Last" }), jsx("select", { value: localItemsPerPage, onChange: handleItemsPerPageChange, children: pageSizeOptions.map((size) => (jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
2053
+ }, min: 1, max: totalPages }), jsxs("span", { children: ["of ", totalPages] }), jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right", title: "Next" }), jsx("button", { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right-double", title: "Last" }), jsx("select", { value: localItemsPerPage, onChange: handleItemsPerPageChange, children: pageSizeOptions.map(size => (jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
1725
2054
  }
1726
2055
 
2056
+ var styles$h = {"dropIndicator":"cw-sortable-table-module_dropIndicator__ov-Jz","dragging":"cw-sortable-table-module_dragging__MrLrz","skeletonRow":"cw-sortable-table-module_skeletonRow__vyD0M","skeleton":"cw-sortable-table-module_skeleton__QGXAD","saveBar":"cw-sortable-table-module_saveBar__3OdoZ cw-flex-row cw-align-center-center cw-gap-small"};
2057
+
1727
2058
  /**
1728
- * A reusable and customizable table component (server-side pagination and sorting).
1729
- *
1730
- * @param props - Component props to configure columns, data, styles, pagination, expanded rows, and more.
2059
+ * Hook that provides state management for CwSortableTable.
1731
2060
  *
1732
- * @example
1733
- * // --- Component ---
1734
- * const columns: Column<User>[] = [
1735
- * { title: "Name", dataIndex: "name", key: "name", sortable: true },
1736
- * { title: "Age", dataIndex: "age", key: "age", sortable: true },
1737
- * { title: "Address", dataIndex: "address", key: "address" }
1738
- * ];
2061
+ * Follows the same pattern as useSortableList:
2062
+ * - The hook only manages STATE (items, hasChanges, save, discard)
2063
+ * - The component manages INTERACTION (drag, drop, calculating new order)
2064
+ * - handleReorder receives the already-reordered array and just stores it
2065
+ * - Changes are only persisted when handleSave is called
2066
+ * - handleDiscard restores the original order
1739
2067
  *
2068
+ * @param initialItems - The initial array of items to display
1740
2069
  *
1741
- * const [tableState, setTableState] = useState<ServerSideTableState<User>>({
1742
- * page: 1,
1743
- * pageSize: 5,
1744
- * sortKey: null,
1745
- * sortDirection: null
1746
- * });
1747
- * const [data, setData] = useState<User[]>([]);
1748
- * const [totalItems, setTotalItems] = useState(0);
1749
- * const [loading, setLoading] = useState(false);
2070
+ * @example
2071
+ * ```tsx
2072
+ * const { items, hasChanges, handleReorder, handleSave, handleDiscard } = useSortableTable(data);
2073
+ * ```
2074
+ */
2075
+ function useSortableTable(initialItems) {
2076
+ const [items, setItems] = useState(initialItems);
2077
+ const [originalItems, setOriginalItems] = useState(initialItems);
2078
+ const [hasChanges, setHasChanges] = useState(false);
2079
+ // Sync items only when initialItems changes from outside (e.g. after initial fetch).
2080
+ // We skip the sync when there are local unsaved changes to avoid
2081
+ // overwriting the user's reordering work.
2082
+ const prevInitialRef = useRef(initialItems);
2083
+ useEffect(() => {
2084
+ if (prevInitialRef.current === initialItems)
2085
+ return;
2086
+ prevInitialRef.current = initialItems;
2087
+ if (!hasChanges) {
2088
+ setItems(initialItems);
2089
+ setOriginalItems(initialItems);
2090
+ }
2091
+ }, [initialItems, hasChanges]);
2092
+ // Receives the already-reordered array from the component and stores it.
2093
+ // No splice logic here — same pattern as useSortableList.handleReorder.
2094
+ const handleReorder = useCallback((newItems) => {
2095
+ setItems(newItems);
2096
+ setHasChanges(true);
2097
+ }, []);
2098
+ const handleSave = async (onSave) => {
2099
+ await onSave(items);
2100
+ setOriginalItems(items);
2101
+ setHasChanges(false);
2102
+ };
2103
+ const handleDiscard = useCallback(() => {
2104
+ setItems(originalItems);
2105
+ setHasChanges(false);
2106
+ }, [originalItems]);
2107
+ return {
2108
+ items,
2109
+ hasChanges,
2110
+ handleReorder,
2111
+ handleSave,
2112
+ handleDiscard,
2113
+ // dragState is managed in the component, same as CwSortableList
2114
+ dragState: { dragSourceIndex: -1, dropTargetIndex: -1 },
2115
+ };
2116
+ }
2117
+
2118
+ // ─── Drop indicator row ───────────────────────────────────────────────────────
2119
+ const DropIndicatorRow = ({ colSpan }) => (jsx("tr", { className: styles$h.dropIndicator, "aria-hidden": true, children: jsx("td", { colSpan: colSpan, children: jsx("div", {}) }) }));
2120
+ // ─── Loading skeleton ─────────────────────────────────────────────────────────
2121
+ const LoadingRows = ({ colSpan }) => (jsx(Fragment, { children: Array.from({ length: 4 }).map((_, i) => (jsx("tr", { className: styles$h.skeletonRow, children: jsx("td", { colSpan: colSpan, children: jsx("div", { className: styles$h.skeleton }) }) }, i))) }));
2122
+ // ─── Component ────────────────────────────────────────────────────────────────
2123
+ /**
2124
+ * CwSortableTable
1750
2125
  *
1751
- * // Fetch simulation on table state change
1752
- * useEffect(() => {
1753
- * setLoading(true);
1754
- * fetch(`/api/users?page=${tableState.page}&pageSize=${tableState.pageSize}` +
1755
- * (tableState.sortKey ? `&sortKey=${tableState.sortKey}&sortDirection=${tableState.sortDirection}` : "")
1756
- * )
1757
- * .then(res => res.json())
1758
- * .then(({ items, total }) => {
1759
- * setData(items);
1760
- * setTotalItems(total);
1761
- * })
1762
- * .finally(() => setLoading(false));
1763
- * }, [tableState]);
2126
+ * A table with drag-and-drop row reordering and save/discard support.
2127
+ * Shares visual styles with CwTable but is intentionally simpler:
2128
+ * no column sorting, no pagination.
1764
2129
  *
1765
- * <CwTableServerSide<User>
1766
- * columns={columns}
1767
- * data={data}
1768
- * totalItems={totalItems}
1769
- * pagination={true}
1770
- * pageSizeOptions={[5, 10, 20]}
1771
- * loading={loading}
1772
- * serverState={tableState}
1773
- * onChange={setTableState}
1774
- * rowKey="id"
1775
- * textNoData="No data available"
1776
- * />
2130
+ * When the user reorders rows, changes are held locally until they
2131
+ * click Save. A save bar appears automatically when there are pending changes.
1777
2132
  *
1778
- * @returns React component
2133
+ * Follows the same pattern as CwSortableList:
2134
+ * - All rows are draggable — the handle is visual only
2135
+ * - Reorder is calculated in onDragEnd using lastValidDropIndex
2136
+ * - draggedItem is tracked in state, not via dataTransfer
1779
2137
  */
1780
- function CwTableServerSide({ columns, data, totalItems, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection, onChange, serverState, }) {
1781
- const [internalState, setInternalState] = useState({
1782
- page: 1,
1783
- pageSize: pageSizeOptions[0],
2138
+ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = false, textNoData = "No data available", className, tableClassName, maxHeight, showHandle = true, style, saveLabel = "Save order", discardLabel = "Discard", }) {
2139
+ const { items, hasChanges, handleReorder, handleSave, handleDiscard, } = useSortableTable(data);
2140
+ // Drag state lives in the component, same as CwSortableList
2141
+ const [draggedItem, setDraggedItem] = useState(null);
2142
+ const [dropIndicatorIndex, setDropIndicatorIndex] = useState(null);
2143
+ const [lastValidDropIndex, setLastValidDropIndex] = useState(null);
2144
+ // Total columns = handle column (optional) + user columns
2145
+ const totalCols = columns.length + (showHandle ? 1 : 0);
2146
+ const containerStyle = {
2147
+ ...style,
2148
+ ...(maxHeight ? { maxHeight, overflowY: "auto" } : {}),
2149
+ };
2150
+ // ── Drag handlers — replicating CwSortableList pattern exactly ──────────
2151
+ const cleanupDragState = () => {
2152
+ setDraggedItem(null);
2153
+ setDropIndicatorIndex(null);
2154
+ setLastValidDropIndex(null);
2155
+ };
2156
+ const handleDragStart = (e, item) => {
2157
+ setDraggedItem(item);
2158
+ setLastValidDropIndex(null);
2159
+ e.dataTransfer.effectAllowed = "move";
2160
+ };
2161
+ const handleDragOver = (e, index) => {
2162
+ e.preventDefault();
2163
+ if (!draggedItem)
2164
+ return;
2165
+ const rect = e.currentTarget.getBoundingClientRect();
2166
+ const elementCenterY = rect.top + rect.height / 2;
2167
+ const dropIndex = e.clientY < elementCenterY ? index : index + 1;
2168
+ if (dropIndicatorIndex !== dropIndex) {
2169
+ setDropIndicatorIndex(dropIndex);
2170
+ setLastValidDropIndex(dropIndex);
2171
+ }
2172
+ };
2173
+ const handleDragEnd = () => {
2174
+ if (draggedItem && lastValidDropIndex !== null) {
2175
+ const dragIndex = items.findIndex(item => item[rowKey] === draggedItem[rowKey]);
2176
+ if (dragIndex !== lastValidDropIndex && dragIndex !== lastValidDropIndex - 1) {
2177
+ const newItems = [...items];
2178
+ const [draggedElement] = newItems.splice(dragIndex, 1);
2179
+ let finalIndex = lastValidDropIndex;
2180
+ if (dragIndex < finalIndex)
2181
+ finalIndex -= 1;
2182
+ newItems.splice(finalIndex, 0, draggedElement);
2183
+ handleReorder(newItems);
2184
+ }
2185
+ }
2186
+ cleanupDragState();
2187
+ };
2188
+ // ── Render helpers ──────────────────────────────────────────────────────
2189
+ const renderCell = (item, col) => {
2190
+ if (col.render)
2191
+ return col.render(item);
2192
+ if (col.dataIndex) {
2193
+ const value = item[col.dataIndex];
2194
+ return value != null ? String(value) : "";
2195
+ }
2196
+ return "";
2197
+ };
2198
+ const renderBody = () => {
2199
+ if (loading) {
2200
+ return jsx(LoadingRows, { colSpan: totalCols });
2201
+ }
2202
+ if (!items || items.length === 0) {
2203
+ return (jsx("tr", { children: jsx("td", { colSpan: totalCols, className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
2204
+ }
2205
+ return items.map((item, index) => {
2206
+ const key = item[rowKey];
2207
+ const isDragging = draggedItem?.[rowKey] === key;
2208
+ return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && (jsx(DropIndicatorRow, { colSpan: totalCols })), jsxs("tr", { draggable: true, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, className: isDragging ? styles$h.dragging : "", children: [showHandle && (jsx("td", { className: "cw-table-col-action", children: jsx(CwIcon, { iconId: "grip-dots", color: "neutral", style: { opacity: 0.75 } }) })), columns.map(col => (jsx("td", { className: col.className ?? "", style: col.width ? { width: col.width } : undefined, children: renderCell(item, col) }, `${String(key)}_${col.key}`)))] }), index === items.length - 1 && dropIndicatorIndex === items.length && (jsx(DropIndicatorRow, { colSpan: totalCols }))] }, String(key)));
2209
+ });
2210
+ };
2211
+ // ── Render ──────────────────────────────────────────────────────────────
2212
+ return (jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, children: [jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsx("thead", { children: jsxs("tr", { children: [showHandle && jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsx("tbody", { children: renderBody() })] }), hasChanges && (jsxs("footer", { className: styles$h.saveBar, children: [jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
2213
+ }
2214
+
2215
+ /**
2216
+ * A reusable and customizable table component (server-side pagination and sorting).
2217
+ *
2218
+ * @param props - Component props to configure columns, data, styles, pagination, expanded rows, and more.
2219
+ *
2220
+ * @example
2221
+ * // --- Component ---
2222
+ * const columns: Column<User>[] = [
2223
+ * { title: "Name", dataIndex: "name", key: "name", sortable: true },
2224
+ * { title: "Age", dataIndex: "age", key: "age", sortable: true },
2225
+ * { title: "Address", dataIndex: "address", key: "address" }
2226
+ * ];
2227
+ *
2228
+ *
2229
+ * const [tableState, setTableState] = useState<ServerSideTableState<User>>({
2230
+ * page: 1,
2231
+ * pageSize: 5,
2232
+ * sortKey: null,
2233
+ * sortDirection: null
2234
+ * });
2235
+ * const [data, setData] = useState<User[]>([]);
2236
+ * const [totalItems, setTotalItems] = useState(0);
2237
+ * const [loading, setLoading] = useState(false);
2238
+ *
2239
+ * // Fetch simulation on table state change
2240
+ * useEffect(() => {
2241
+ * setLoading(true);
2242
+ * fetch(`/api/users?page=${tableState.page}&pageSize=${tableState.pageSize}` +
2243
+ * (tableState.sortKey ? `&sortKey=${tableState.sortKey}&sortDirection=${tableState.sortDirection}` : "")
2244
+ * )
2245
+ * .then(res => res.json())
2246
+ * .then(({ items, total }) => {
2247
+ * setData(items);
2248
+ * setTotalItems(total);
2249
+ * })
2250
+ * .finally(() => setLoading(false));
2251
+ * }, [tableState]);
2252
+ *
2253
+ * <CwTableServerSide<User>
2254
+ * columns={columns}
2255
+ * data={data}
2256
+ * totalItems={totalItems}
2257
+ * pagination={true}
2258
+ * pageSizeOptions={[5, 10, 20]}
2259
+ * loading={loading}
2260
+ * serverState={tableState}
2261
+ * onChange={setTableState}
2262
+ * rowKey="id"
2263
+ * textNoData="No data available"
2264
+ * />
2265
+ *
2266
+ * @returns React component
2267
+ */
2268
+ function CwTableServerSide({ columns, data, totalItems, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection, onChange, serverState, }) {
2269
+ const [internalState, setInternalState] = useState({
2270
+ page: 1,
2271
+ pageSize: pageSizeOptions[0],
1784
2272
  sortKey: null,
1785
2273
  sortDirection: null,
1786
2274
  });
@@ -1929,7 +2417,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
1929
2417
  }, min: 1, max: totalPages }), jsxs("span", { children: ["of ", totalPages] }), jsx("button", { onClick: () => handlePageChange(state.page + 1), disabled: state.page === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right", title: "Next" }), jsx("button", { onClick: () => handlePageChange(totalPages), disabled: state.page === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right-double", title: "Last" }), jsx("select", { value: state.pageSize, onChange: handleItemsPerPageChange, children: pageSizeOptions.map((size) => (jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
1930
2418
  }
1931
2419
 
1932
- var styles$e = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","badge":"cw-tabs-module_badge__AmVxW","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
2420
+ var styles$g = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","badge":"cw-tabs-module_badge__AmVxW","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
1933
2421
 
1934
2422
  const TabIcon = ({ icon }) => {
1935
2423
  if (!icon)
@@ -1979,7 +2467,7 @@ function CwTabs(CwTabsProps) {
1979
2467
  const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
1980
2468
  ? { minWidth: CwTabsProps.tabsListWidth }
1981
2469
  : undefined;
1982
- return (jsxs("div", { id: CwTabsProps.id, className: styles$e['cw-tabs'], style: CwTabsProps.style, "data-tabs-position": position, children: [jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsx(TabIcon, { icon: tab.icon }), tab.title, tab.badge !== undefined && (jsx("span", { className: styles$e['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsx("div", { className: styles$e['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
2470
+ return (jsxs("div", { id: CwTabsProps.id, className: styles$g['cw-tabs'] + (CwTabsProps.className ? ` ${CwTabsProps.className}` : "") + "", style: CwTabsProps.style, "data-tabs-position": position, children: [jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsx(TabIcon, { icon: tab.icon }), tab.title, tab.badge !== undefined && (jsx("span", { className: styles$g['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsx("div", { className: styles$g['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
1983
2471
  }
1984
2472
 
1985
2473
  /**
@@ -2006,6 +2494,48 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
2006
2494
  return (jsx("div", { className: "cw-expandable", children: jsxs("details", { ref: myRef, ...detailsProps, children: [jsx("summary", { children: briefing }), children && jsx("section", { children: children })] }) }));
2007
2495
  };
2008
2496
 
2497
+ var styles$f = {"cw-master-detail":"cw-master-detail-module_cw-master-detail__O8-FA","resizer":"cw-master-detail-module_resizer__hvGhL","detail":"cw-master-detail-module_detail__BG4Dm","detail-empty":"cw-master-detail-module_detail-empty__KFScK"};
2498
+
2499
+ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, detailContent, emptyDetail, searchPlaceholder = 'Search...', onSearch, masterHeader, masterFooter, masterWidth: initialWidth = 320, minMasterWidth = 240, maxMasterWidth = 500, resizable = true, showSearch = true, }) => {
2500
+ const [masterWidth, setMasterWidth] = useState(initialWidth);
2501
+ const [isResizing, setIsResizing] = useState(false);
2502
+ const containerRef = useRef(null);
2503
+ const handleMouseDown = useCallback((e) => {
2504
+ if (!resizable)
2505
+ return;
2506
+ e.preventDefault();
2507
+ setIsResizing(true);
2508
+ }, [resizable]);
2509
+ useEffect(() => {
2510
+ if (!isResizing)
2511
+ return;
2512
+ const handleMouseMove = (e) => {
2513
+ if (!containerRef.current)
2514
+ return;
2515
+ const rect = containerRef.current.getBoundingClientRect();
2516
+ const newWidth = Math.max(minMasterWidth, Math.min(maxMasterWidth, e.clientX - rect.left));
2517
+ setMasterWidth(newWidth);
2518
+ };
2519
+ const handleMouseUp = () => {
2520
+ setIsResizing(false);
2521
+ };
2522
+ document.addEventListener('mousemove', handleMouseMove);
2523
+ document.addEventListener('mouseup', handleMouseUp);
2524
+ document.body.style.cursor = 'col-resize';
2525
+ document.body.style.userSelect = 'none';
2526
+ return () => {
2527
+ document.removeEventListener('mousemove', handleMouseMove);
2528
+ document.removeEventListener('mouseup', handleMouseUp);
2529
+ document.body.style.cursor = '';
2530
+ document.body.style.userSelect = '';
2531
+ };
2532
+ }, [isResizing, minMasterWidth, maxMasterWidth]);
2533
+ const rootClassName = [styles$f['cw-master-detail'], className].filter(Boolean).join(' ');
2534
+ return (jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, children: [jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsx("search", { children: jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsx("header", { children: masterHeader })), jsx("ul", { children: items.map((item) => (jsx("li", { "data-selected": item.key === selectedKey, "data-disabled": item.disabled, onClick: () => onSelect?.(item.key), children: item.content }, item.key))) }), masterFooter && (jsx("footer", { children: masterFooter }))] }), resizable && (jsx("div", { className: styles$f.resizer, "data-resizing": isResizing, onMouseDown: handleMouseDown })), jsx("section", { className: styles$f.detail, children: selectedKey && detailContent
2535
+ ? detailContent
2536
+ : (jsx("div", { className: styles$f['detail-empty'], children: emptyDetail ?? 'Select an item to view details' })) })] }));
2537
+ };
2538
+
2009
2539
  /**
2010
2540
  * A component for displaying key-value pairs in a definition list format
2011
2541
  * Used for read-only display of structured data
@@ -2027,9 +2557,9 @@ const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "
2027
2557
  : emptyValue })] }, item.key))) }));
2028
2558
  };
2029
2559
 
2030
- var styles$d = {"sortableList":"cw-sortable-list-module_sortableList__PyLO-","sortableItem":"cw-sortable-list-module_sortableItem__FAnn2","readOnly":"cw-sortable-list-module_readOnly__r7GcH","dragging":"cw-sortable-list-module_dragging__MD715","moved":"cw-sortable-list-module_moved__sE6-N","expandedContent":"cw-sortable-list-module_expandedContent__Kocna","sortableHandle":"cw-sortable-list-module_sortableHandle__HvYBK","sortableContent":"cw-sortable-list-module_sortableContent__C6JhR","sortableTitle":"cw-sortable-list-module_sortableTitle__EgWXr","sortableExtraContent":"cw-sortable-list-module_sortableExtraContent__s4LSv","sortableActions":"cw-sortable-list-module_sortableActions__gwQOU","dropIndicator":"cw-sortable-list-module_dropIndicator__MNSF-","emptyMessage":"cw-sortable-list-module_emptyMessage__gMpaL"};
2560
+ var styles$e = {"sortableList":"cw-sortable-list-module_sortableList__PyLO-","sortableItem":"cw-sortable-list-module_sortableItem__FAnn2","readOnly":"cw-sortable-list-module_readOnly__r7GcH","dragging":"cw-sortable-list-module_dragging__MD715","moved":"cw-sortable-list-module_moved__sE6-N","expandedContent":"cw-sortable-list-module_expandedContent__Kocna","sortableHandle":"cw-sortable-list-module_sortableHandle__HvYBK","sortableContent":"cw-sortable-list-module_sortableContent__C6JhR","sortableTitle":"cw-sortable-list-module_sortableTitle__EgWXr","sortableExtraContent":"cw-sortable-list-module_sortableExtraContent__s4LSv","sortableActions":"cw-sortable-list-module_sortableActions__gwQOU","dropIndicator":"cw-sortable-list-module_dropIndicator__MNSF-","emptyMessage":"cw-sortable-list-module_emptyMessage__gMpaL"};
2031
2561
 
2032
- function CwSortableList({ items, onReorder, renderItem, className = '', movedItems = new Set(), emptyMessage = "No elements to show", readOnly = false, }) {
2562
+ function CwSortableList({ items, onReorder, renderItem, className = '', movedItems = new Set(), emptyMessage = "No elements to show", readOnly = false, maxHeight = "300px", }) {
2033
2563
  const [draggedItem, setDraggedItem] = useState(null);
2034
2564
  const [dropIndicatorIndex, setDropIndicatorIndex] = useState(null);
2035
2565
  const [lastValidDropIndex, setLastValidDropIndex] = useState(null);
@@ -2090,15 +2620,15 @@ function CwSortableList({ items, onReorder, renderItem, className = '', movedIte
2090
2620
  }
2091
2621
  };
2092
2622
  if (items.length === 0) {
2093
- return (jsx("div", { className: `${styles$d.sortableList} ${styles$d.emptyState} ${className}`, children: jsx("div", { className: styles$d.emptyMessage, children: emptyMessage }) }));
2623
+ return (jsx("div", { className: `${styles$e.sortableList} ${styles$e.emptyState} ${className}`, children: jsx("div", { className: styles$e.emptyMessage, children: emptyMessage }) }));
2094
2624
  }
2095
- return (jsx("div", { className: `${styles$d.sortableList} ${className}`, children: items.map((item, index) => {
2625
+ return (jsx("div", { className: `${styles$e.sortableList} ${className}`, style: { maxHeight }, children: items.map((item, index) => {
2096
2626
  const { title, extraContent, actions, showHandle = true, expandedContent } = renderItem(item);
2097
2627
  const isDragging = draggedItem?.id === item.id;
2098
2628
  const isMoved = movedItems.has(item.id);
2099
2629
  const canExpand = Boolean(expandedContent);
2100
2630
  const isExpanded = expandedItems.has(item.id);
2101
- return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && jsx("div", { className: styles$d.dropIndicator }), jsxs("div", { className: `${styles$d.sortableItem} ${isDragging ? styles$d.dragging : ''} ${isMoved ? styles$d.moved : ''} ${readOnly ? styles$d.readOnly : ''}`, draggable: !readOnly, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, children: [jsxs("header", { children: [canExpand ? (jsx(CwButton, { variant: "icon", onClick: () => toggleExpanded(item.id), type: "button", title: isExpanded ? "Collapse" : "Expand", icon: isExpanded ? "chevron-up" : "chevron-down" })) : showHandle ? (jsx("div", { className: styles$d.sortableHandle, children: jsx(CwIcon, { iconId: "grip-dots" }) })) : null, jsxs("div", { className: styles$d.sortableContent, children: [jsx("div", { className: styles$d.sortableTitle, children: title }), extraContent && jsx("div", { className: styles$d.sortableExtraContent, children: extraContent })] }), jsx("div", { className: styles$d.sortableActions, children: actions })] }), isExpanded && expandedContent && (jsx("div", { className: styles$d.expandedContent, children: expandedContent }))] }), !readOnly && dropIndicatorIndex === items.length && index === items.length - 1 && (jsx("div", { className: styles$d.dropIndicator }))] }, item.id));
2631
+ return (jsxs(React__default.Fragment, { children: [dropIndicatorIndex === index && jsx("div", { className: styles$e.dropIndicator }), jsxs("div", { className: `${styles$e.sortableItem} ${isDragging ? styles$e.dragging : ''} ${isMoved ? styles$e.moved : ''} ${readOnly ? styles$e.readOnly : ''}`, draggable: !readOnly, onDragStart: (e) => handleDragStart(e, item), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, children: [jsxs("header", { children: [canExpand ? (jsx(CwButton, { variant: "icon", onClick: () => toggleExpanded(item.id), type: "button", title: isExpanded ? "Collapse" : "Expand", icon: isExpanded ? "chevron-up" : "chevron-down" })) : showHandle ? (jsx("div", { className: styles$e.sortableHandle, children: jsx(CwIcon, { iconId: "grip-dots" }) })) : null, jsxs("div", { className: styles$e.sortableContent, children: [jsx("div", { className: styles$e.sortableTitle, children: title }), extraContent && jsx("div", { className: styles$e.sortableExtraContent, children: extraContent })] }), jsx("div", { className: styles$e.sortableActions, children: actions })] }), isExpanded && expandedContent && (jsx("div", { className: styles$e.expandedContent, children: expandedContent }))] }), !readOnly && dropIndicatorIndex === items.length && index === items.length - 1 && (jsx("div", { className: styles$e.dropIndicator }))] }, item.id));
2102
2632
  }) }));
2103
2633
  }
2104
2634
 
@@ -2275,7 +2805,7 @@ function CwFileUpload(fileUploadProps) {
2275
2805
  return (jsxs("div", { children: [jsxs("div", { className: "row", children: [jsx("input", { className: "cw-button", type: "file", accept: fileUploadProps.accept, readOnly: true, placeholder: "No file selected...", onChange: handleFileChange }), previewURL && (jsx("div", { className: "row", children: jsx("img", { src: previewURL, alt: "Preview", style: { maxWidth: "200px", maxHeight: "200px" } }) }))] }), error && jsx("div", { className: "row error", children: error }), jsx("div", { className: "row", children: jsxs("label", { children: ["Please note: File/image has to be in ", fileUploadProps.acceptString, " format", fileUploadProps.sizeString && `, ${fileUploadProps.sizeString}`] }) })] }));
2276
2806
  }
2277
2807
 
2278
- var styles$c = {"fileUploadContainer":"cw-file-upload-multiple-module_fileUploadContainer__liEc1","hiddenInput":"cw-file-upload-multiple-module_hiddenInput__TZBBI","uploadArea":"cw-file-upload-multiple-module_uploadArea__DdOhs","uploadAreaDisabled":"cw-file-upload-multiple-module_uploadAreaDisabled__VWeFX","uploadTitle":"cw-file-upload-multiple-module_uploadTitle__gjRk8","uploadSubtitle":"cw-file-upload-multiple-module_uploadSubtitle__Z0S5t","filesContainer":"cw-file-upload-multiple-module_filesContainer__g44PY","fileItem":"cw-file-upload-multiple-module_fileItem__w27Dg","fileIcon":"cw-file-upload-multiple-module_fileIcon__iJJUX","fileExtension":"cw-file-upload-multiple-module_fileExtension__vOuHv","fileInfo":"cw-file-upload-multiple-module_fileInfo__R5ZTv","fileName":"cw-file-upload-multiple-module_fileName__DjepK","fileSize":"cw-file-upload-multiple-module_fileSize__b8GSm","smallButton":"cw-file-upload-multiple-module_smallButton__siUAh"};
2808
+ var styles$d = {"fileUploadContainer":"cw-file-upload-multiple-module_fileUploadContainer__liEc1","hiddenInput":"cw-file-upload-multiple-module_hiddenInput__TZBBI","uploadArea":"cw-file-upload-multiple-module_uploadArea__DdOhs","uploadAreaDisabled":"cw-file-upload-multiple-module_uploadAreaDisabled__VWeFX","uploadTitle":"cw-file-upload-multiple-module_uploadTitle__gjRk8","uploadSubtitle":"cw-file-upload-multiple-module_uploadSubtitle__Z0S5t","filesContainer":"cw-file-upload-multiple-module_filesContainer__g44PY","fileItem":"cw-file-upload-multiple-module_fileItem__w27Dg","fileIcon":"cw-file-upload-multiple-module_fileIcon__iJJUX","fileExtension":"cw-file-upload-multiple-module_fileExtension__vOuHv","fileInfo":"cw-file-upload-multiple-module_fileInfo__R5ZTv","fileName":"cw-file-upload-multiple-module_fileName__DjepK","fileSize":"cw-file-upload-multiple-module_fileSize__b8GSm","smallButton":"cw-file-upload-multiple-module_smallButton__siUAh"};
2279
2809
 
2280
2810
  function CwFileUploadMultiple(fileUploadProps) {
2281
2811
  const fileInputRef = useRef(null);
@@ -2426,12 +2956,12 @@ function CwFileUploadMultiple(fileUploadProps) {
2426
2956
  }
2427
2957
  }
2428
2958
  };
2429
- return (jsxs("div", { className: `${styles$c.fileUploadContainer} ${fileUploadProps.className}`, children: [jsx("input", { ref: fileInputRef, type: "file", name: fileUploadProps.name, accept: fileUploadProps.accept, multiple: fileUploadProps.multiple, onChange: handleFileSelectInternal, disabled: fileUploadProps.disabled, "aria-label": "files", className: styles$c.hiddenInput }), selectedFiles.length === 0 && !existingFile ? (jsxs("div", { className: `${styles$c.uploadArea} ${fileUploadProps.disabled ? styles$c.uploadAreaDisabled : ''}`, onDragOver: handleDragOver, onDrop: handleDrop, onClick: !fileUploadProps.disabled ? handleButtonClick : undefined, children: [jsx(CwIcon, { iconId: "upload" }), jsx("p", { className: `${styles$c.uploadTitle}`, children: fileUploadProps.disabled ? 'Upload disabled' : 'Click to upload or drag and drop' }), jsxs("p", { className: `${styles$c.uploadSubtitle}`, children: [fileUploadProps.accept ? `Accepted files: ${fileUploadProps.accept}` : 'All file types accepted', !fileUploadProps.multiple && ' (Single file only)'] })] })) : selectedFiles.length === 0 && existingFile ? (jsxs("div", { className: styles$c.filesContainer, children: [jsxs("div", { className: styles$c.fileItem, children: [jsxs("div", { className: styles$c.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$c.fileExtension, children: getFileExtension(existingFile) })] }), jsx("div", { className: styles$c.fileInfo, children: jsx("p", { className: styles$c.fileName, children: existingFile }) }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => {
2959
+ return (jsxs("div", { className: `${styles$d.fileUploadContainer} ${fileUploadProps.className}`, children: [jsx("input", { ref: fileInputRef, type: "file", name: fileUploadProps.name, accept: fileUploadProps.accept, multiple: fileUploadProps.multiple, onChange: handleFileSelectInternal, disabled: fileUploadProps.disabled, "aria-label": "files", className: styles$d.hiddenInput }), selectedFiles.length === 0 && !existingFile ? (jsxs("div", { className: `${styles$d.uploadArea} ${fileUploadProps.disabled ? styles$d.uploadAreaDisabled : ''}`, onDragOver: handleDragOver, onDrop: handleDrop, onClick: !fileUploadProps.disabled ? handleButtonClick : undefined, children: [jsx(CwIcon, { iconId: "upload" }), jsx("p", { className: `${styles$d.uploadTitle}`, children: fileUploadProps.disabled ? 'Upload disabled' : 'Click to upload or drag and drop' }), jsxs("p", { className: `${styles$d.uploadSubtitle}`, children: [fileUploadProps.accept ? `Accepted files: ${fileUploadProps.accept}` : 'All file types accepted', !fileUploadProps.multiple && ' (Single file only)'] })] })) : selectedFiles.length === 0 && existingFile ? (jsxs("div", { className: styles$d.filesContainer, children: [jsxs("div", { className: styles$d.fileItem, children: [jsxs("div", { className: styles$d.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$d.fileExtension, children: getFileExtension(existingFile) })] }), jsx("div", { className: styles$d.fileInfo, children: jsx("p", { className: styles$d.fileName, children: existingFile }) }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => {
2430
2960
  setExistingFile(undefined);
2431
2961
  if (fileUploadProps.onSelect) {
2432
2962
  fileUploadProps.onSelect(null);
2433
2963
  }
2434
- }, disabled: fileUploadProps.disabled, className: styles$c.smallButton })] }), jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled })] })) : (jsxs("div", { className: styles$c.filesContainer, children: [jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [jsxs("small", { className: styles$c.filesCount, children: [selectedFiles.length, " file", selectedFiles.length !== 1 ? 's' : '', " selected"] }), jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: "Clear all" })] }), selectedFiles.map((file, index) => (jsxs("div", { className: styles$c.fileItem, children: [jsxs("div", { className: styles$c.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$c.fileExtension, children: getFileExtension(file.name) })] }), jsxs("div", { className: styles$c.fileInfo, children: [jsx("p", { className: styles$c.fileName, children: file.name }), jsxs("p", { className: styles$c.fileSize, children: [(file.size / 1024).toFixed(1), " KB"] })] }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => removeFile(index), className: styles$c.smallButton })] }, index))), fileUploadProps.multiple && (jsx(CwButton, { text: "Add More Files", icon: "plus", variant: "outline", onClick: handleButtonClick, disabled: fileUploadProps.disabled })), !fileUploadProps.multiple && (jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled }))] }))] }));
2964
+ }, disabled: fileUploadProps.disabled, className: styles$d.smallButton })] }), jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled })] })) : (jsxs("div", { className: styles$d.filesContainer, children: [jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [jsxs("small", { className: styles$d.filesCount, children: [selectedFiles.length, " file", selectedFiles.length !== 1 ? 's' : '', " selected"] }), jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: "Clear all" })] }), selectedFiles.map((file, index) => (jsxs("div", { className: styles$d.fileItem, children: [jsxs("div", { className: styles$d.fileIcon, children: [jsx(CwIcon, { iconId: "page" }), jsx("span", { className: styles$d.fileExtension, children: getFileExtension(file.name) })] }), jsxs("div", { className: styles$d.fileInfo, children: [jsx("p", { className: styles$d.fileName, children: file.name }), jsxs("p", { className: styles$d.fileSize, children: [(file.size / 1024).toFixed(1), " KB"] })] }), jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => removeFile(index), className: styles$d.smallButton })] }, index))), fileUploadProps.multiple && (jsx(CwButton, { text: "Add More Files", icon: "plus", variant: "outline", onClick: handleButtonClick, disabled: fileUploadProps.disabled })), !fileUploadProps.multiple && (jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled }))] }))] }));
2435
2965
  }
2436
2966
 
2437
2967
  function CwInput(CwInputProps) {
@@ -2474,7 +3004,7 @@ function CwDigit(props) {
2474
3004
  return (jsx("div", { className: "cw-input-text", children: jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsx("input", { type: "number", ...inputProps }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
2475
3005
  }
2476
3006
 
2477
- var styles$b = {"colorPreview":"cw-color-picker-module_colorPreview__ylJcD","hueBar":"cw-color-picker-module_hueBar__bFhyC","hueBarSlider":"cw-color-picker-module_hueBarSlider__D53IV","colorPickerInteractiveArea":"cw-color-picker-module_colorPickerInteractiveArea__KZFR1","colorArea":"cw-color-picker-module_colorArea__xgpSE","colorAreaOverlay":"cw-color-picker-module_colorAreaOverlay__pmgOc","hueBackground":"cw-color-picker-module_hueBackground__Mks78","whiteGradient":"cw-color-picker-module_whiteGradient__Bt-fU","blackGradient":"cw-color-picker-module_blackGradient__VnEKJ","colorAreaCursor":"cw-color-picker-module_colorAreaCursor__lotg3"};
3007
+ var styles$c = {"colorPreview":"cw-color-picker-module_colorPreview__ylJcD","hueBar":"cw-color-picker-module_hueBar__bFhyC","hueBarSlider":"cw-color-picker-module_hueBarSlider__D53IV","colorPickerInteractiveArea":"cw-color-picker-module_colorPickerInteractiveArea__KZFR1","colorArea":"cw-color-picker-module_colorArea__xgpSE","colorAreaOverlay":"cw-color-picker-module_colorAreaOverlay__pmgOc","hueBackground":"cw-color-picker-module_hueBackground__Mks78","whiteGradient":"cw-color-picker-module_whiteGradient__Bt-fU","blackGradient":"cw-color-picker-module_blackGradient__VnEKJ","colorAreaCursor":"cw-color-picker-module_colorAreaCursor__lotg3"};
2478
3008
 
2479
3009
  const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }) => {
2480
3010
  const [rgb, setRgb] = useState({ r: 255, g: 255, b: 255 });
@@ -2677,15 +3207,15 @@ const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }
2677
3207
  // Calculate background color for the main area based on current hue
2678
3208
  const hueColor = hsvToRgb(hsv.h, 100, 100);
2679
3209
  const hueHex = rgbToHex(hueColor.r, hueColor.g, hueColor.b);
2680
- return (jsxs("div", { className: "cw-flex-column cw-gap-small", children: [jsxs("div", { className: "cw-flex-row cw-align-between-center cw-gap-small", children: [jsx("div", { className: styles$b.colorPreview, style: { backgroundColor: hexColor, color: getContrastColor(hexColor) }, children: previewText }), jsx("button", { type: "button", className: "cw-button", onClick: toggleInputMode, style: { minWidth: "3ch" }, children: inputMode === 'hex' ? 'RGB' : 'HEX' })] }), jsx("div", { className: "color-inputs-row", children: inputMode === 'hex' ? (jsx("input", { type: "text", value: hexColor, onChange: handleHexChange })) : (jsxs("div", { className: "cw-grid-base-3 cw-gap-small", children: [jsxs("div", { children: [jsx("label", { children: "R:" }), jsx("input", { type: "number", name: "r", min: "0", max: "255", value: rgb.r, onChange: handleRgbChange })] }), jsxs("div", { children: [jsx("label", { children: "G:" }), jsx("input", { type: "number", name: "g", min: "0", max: "255", value: rgb.g, onChange: handleRgbChange })] }), jsxs("div", { children: [jsx("label", { children: "B:" }), jsx("input", { type: "number", name: "b", min: "0", max: "255", value: rgb.b, onChange: handleRgbChange })] })] })) }), jsxs("div", { className: styles$b.colorPickerInteractiveArea, children: [jsx("div", { className: styles$b.hueBar, ref: hueBarRef, onClick: handleHueBarClick, children: jsx("div", { className: styles$b.hueBarSlider, style: { top: `${(360 - hsv.h) / 360 * 100}%` } }) }), jsxs("div", { className: styles$b.colorArea, ref: colorAreaRef, onClick: handleColorAreaClick, children: [jsxs("div", { className: styles$b.colorAreaOverlay, children: [jsx("div", { className: styles$b.hueBackground, style: { backgroundColor: hueHex } }), jsx("div", { className: styles$b.whiteGradient }), jsx("div", { className: styles$b.blackGradient })] }), jsx("div", { className: styles$b.colorAreaCursor, style: {
3210
+ return (jsxs("div", { className: "cw-flex-column cw-gap-small", children: [jsxs("div", { className: "cw-flex-row cw-align-between-center cw-gap-small", children: [jsx("div", { className: styles$c.colorPreview, style: { backgroundColor: hexColor, color: getContrastColor(hexColor) }, children: previewText }), jsx("button", { type: "button", className: "cw-button", onClick: toggleInputMode, style: { minWidth: "3ch" }, children: inputMode === 'hex' ? 'RGB' : 'HEX' })] }), jsx("div", { className: "color-inputs-row", children: inputMode === 'hex' ? (jsx("input", { type: "text", value: hexColor, onChange: handleHexChange })) : (jsxs("div", { className: "cw-grid-base-3 cw-gap-small", children: [jsxs("div", { children: [jsx("label", { children: "R:" }), jsx("input", { type: "number", name: "r", min: "0", max: "255", value: rgb.r, onChange: handleRgbChange })] }), jsxs("div", { children: [jsx("label", { children: "G:" }), jsx("input", { type: "number", name: "g", min: "0", max: "255", value: rgb.g, onChange: handleRgbChange })] }), jsxs("div", { children: [jsx("label", { children: "B:" }), jsx("input", { type: "number", name: "b", min: "0", max: "255", value: rgb.b, onChange: handleRgbChange })] })] })) }), jsxs("div", { className: styles$c.colorPickerInteractiveArea, children: [jsx("div", { className: styles$c.hueBar, ref: hueBarRef, onClick: handleHueBarClick, children: jsx("div", { className: styles$c.hueBarSlider, style: { top: `${(360 - hsv.h) / 360 * 100}%` } }) }), jsxs("div", { className: styles$c.colorArea, ref: colorAreaRef, onClick: handleColorAreaClick, children: [jsxs("div", { className: styles$c.colorAreaOverlay, children: [jsx("div", { className: styles$c.hueBackground, style: { backgroundColor: hueHex } }), jsx("div", { className: styles$c.whiteGradient }), jsx("div", { className: styles$c.blackGradient })] }), jsx("div", { className: styles$c.colorAreaCursor, style: {
2681
3211
  left: `${hsv.s}%`,
2682
3212
  top: `${100 - hsv.v}%`
2683
3213
  } })] })] })] }));
2684
3214
  };
2685
3215
 
2686
- var styles$a = {"selectColor":"cw-input-color-module_selectColor__DTo3V","disabled":"cw-input-color-module_disabled__O1fK5","colorDropdown":"cw-input-color-module_colorDropdown__pX2bc"};
3216
+ var styles$b = {"container":"cw-input-color-module_container__x7gpk","selectColor":"cw-input-color-module_selectColor__DTo3V","disabled":"cw-input-color-module_disabled__O1fK5","readOnly":"cw-input-color-module_readOnly__HL-Bz","colorDropdown":"cw-input-color-module_colorDropdown__pX2bc"};
2687
3217
 
2688
- const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled = false, width = '4rem', height = '2rem' }) => {
3218
+ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled = false, readOnly = false, width = '4rem', height = '2rem', labelProps, layoutProps, }) => {
2689
3219
  const [isOpen, setIsOpen] = useState(false);
2690
3220
  const containerRef = useRef(null);
2691
3221
  const dropdownRef = useRef(null);
@@ -2734,7 +3264,7 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
2734
3264
  };
2735
3265
  }, [isOpen]);
2736
3266
  const handleToggle = () => {
2737
- if (disabled)
3267
+ if (disabled || readOnly)
2738
3268
  return;
2739
3269
  setIsOpen(prev => !prev);
2740
3270
  };
@@ -2816,11 +3346,11 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
2816
3346
  break;
2817
3347
  }
2818
3348
  };
2819
- return (jsxs(Fragment, { children: [jsx("div", { ref: containerRef, onClick: handleToggle, className: `${styles$a.selectColor} ${disabled ? styles$a.disabled : ''}`, style: {
3349
+ return (jsxs("div", { className: `cw-input-color ${styles$b.container}`, "data-direction": layoutProps?.direction ?? "row", "data-align": layoutProps?.align, children: [labelProps && (jsx(CwLabel, { ...labelProps })), jsx("div", { ref: containerRef, onClick: handleToggle, className: `${styles$b.selectColor} ${disabled ? styles$b.disabled : ''} ${readOnly ? styles$b.readOnly : ''}`, style: {
2820
3350
  width,
2821
3351
  height,
2822
3352
  backgroundColor: value,
2823
- }, "aria-label": "Open color picker", "aria-expanded": isOpen, "aria-haspopup": "dialog", role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown }), isOpen && createPortal(jsx("div", { ref: dropdownRef, className: styles$a.colorDropdown, style: dropdownStyle, role: "dialog", "aria-modal": "true", "aria-label": "Color picker", children: jsx(CwColorPicker, { initialColor: value, onChange: handleColorChange, previewText: previewText }) }), document.body)] }));
3353
+ }, "aria-label": "Open color picker", "aria-expanded": isOpen, "aria-haspopup": "dialog", "aria-readonly": readOnly, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown }), isOpen && createPortal(jsx("div", { ref: dropdownRef, className: styles$b.colorDropdown, style: dropdownStyle, role: "dialog", "aria-modal": "true", "aria-label": "Color picker", children: jsx(CwColorPicker, { initialColor: value, onChange: handleColorChange, previewText: previewText }) }), document.body)] }));
2824
3354
  };
2825
3355
 
2826
3356
  /**
@@ -2839,15 +3369,20 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
2839
3369
  * iconProps={{ id: "home" }}
2840
3370
  * labelProps={{ children: "Name", width: "100px" }}
2841
3371
  * buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
3372
+ * feedback={{ type: "danger", message: "This field is required" }}
2842
3373
  * />
2843
3374
  * ```
2844
3375
  */
2845
3376
  function CwInputText(props) {
2846
- const { alignProps, buttonProps, iconProps, labelProps, className, ...inputProps } = props;
3377
+ const { alignProps, buttonProps, iconProps, labelProps, className, feedback, ...inputProps } = props;
3378
+ const feedbackMessages = feedback
3379
+ ? Array.isArray(feedback) ? feedback : [feedback]
3380
+ : [];
2847
3381
  const containerClassName = className
2848
3382
  ? `cw-input-text ${className}`
2849
3383
  : "cw-input-text";
2850
- return (jsx("div", { className: containerClassName, children: jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-input-button", children: [jsx("input", { type: props.type ?? "text", ...inputProps }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }) }));
3384
+ const flexDirection = alignProps?.flexDirection ?? "row";
3385
+ return (jsxs("div", { className: containerClassName, "data-direction": flexDirection, children: [jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-input-button", children: [jsx("input", { type: props.type ?? "text", ...inputProps }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
2851
3386
  }
2852
3387
 
2853
3388
  /**
@@ -2882,8 +3417,13 @@ function CwInputNumber(CwInputNumberProps) {
2882
3417
  }
2883
3418
 
2884
3419
  function CwTextArea(props) {
2885
- const { alignProps, buttonProps, iconProps, labelProps, resize, ...textareaProps } = props;
2886
- return (jsx("div", { className: "cw-text-area", children: jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { ...textareaProps.style, resize: resize } }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
3420
+ const { alignProps, buttonProps, iconProps, labelProps, resize, feedback, style, ...textareaProps } = props;
3421
+ const feedbackMessages = feedback
3422
+ ? Array.isArray(feedback) ? feedback : [feedback]
3423
+ : [];
3424
+ const flexDirection = alignProps?.flexDirection ?? "row";
3425
+ const dataDirection = { 'data-direction': flexDirection };
3426
+ return (jsxs("div", { className: "cw-text-area", ...dataDirection, style: style, children: [jsxs(CwAlign, { ...alignProps, children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { resize: resize } }), buttonProps && jsx(CwButton, { ...buttonProps })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
2887
3427
  }
2888
3428
 
2889
3429
  /**
@@ -3313,7 +3853,7 @@ const CwImageArea = forwardRef((props, ref) => {
3313
3853
  });
3314
3854
  CwImageArea.displayName = "CwImageArea";
3315
3855
 
3316
- var styles$9 = {"cw-weekday-selector":"cw-weekday-selector-module_cw-weekday-selector__Iz4GZ"};
3856
+ var styles$a = {"cw-weekday-selector":"cw-weekday-selector-module_cw-weekday-selector__Iz4GZ"};
3317
3857
 
3318
3858
  /**
3319
3859
  * This class represents a week where days can be selected or unselected
@@ -3453,9 +3993,17 @@ const CwWeekdaySelector = ({ value = "", onChange, disabled = false }) => {
3453
3993
  setSelectedDays(newWeekdays);
3454
3994
  onChange?.(newWeekdays.toString());
3455
3995
  };
3456
- return (jsx("div", { className: styles$9["cw-weekday-selector"], children: Weekdays.getFullWeek().map(day => (jsx("input", { type: "checkbox", "data-day": day, checked: selectedDays.toArray().includes(day), onChange: (e) => handleChange(day, e.target.checked), disabled: disabled }, day))) }));
3996
+ return (jsx("div", { className: styles$a["cw-weekday-selector"], children: Weekdays.getFullWeek().map(day => (jsx("input", { type: "checkbox", "data-day": day, checked: selectedDays.toArray().includes(day), onChange: (e) => handleChange(day, e.target.checked), disabled: disabled }, day))) }));
3457
3997
  };
3458
3998
 
3999
+ var styles$9 = {"check-container":"cw-check-module_check-container__4nscZ","checkbox-group-container":"cw-check-module_checkbox-group-container__WMNbG"};
4000
+
4001
+ function CwCheck(props) {
4002
+ const { labelProps, labelText, iconProps, alignment = "row", className, ...inputProps } = props;
4003
+ const displayText = labelText || labelProps?.text;
4004
+ return (jsx("div", { className: `cw-check ${styles$9["check-container"]}${className ? ` ${className}` : ''}`, children: jsxs("label", { "data-direction": alignment, children: [jsx("input", { type: "checkbox", ...inputProps }), displayText && (jsxs("span", { className: "cw-icon-text", children: [iconProps && jsx(CwIcon, { ...iconProps }), displayText] }))] }) }));
4005
+ }
4006
+
3459
4007
  function CwCheckbox(CwCheckboxProps) {
3460
4008
  const handleChange = (e) => {
3461
4009
  CwCheckboxProps.onChange?.(e.target.checked);
@@ -3471,6 +4019,23 @@ function CwCheckbox(CwCheckboxProps) {
3471
4019
  : "cw_checkboxContent cwellt_flex_row" + " " + CwCheckboxProps.classNameContainer, style: CwCheckboxProps.styleContainer, children: [inputElement, CwCheckboxProps.labelName ? (jsx("label", { htmlFor: CwCheckboxProps.id, className: CwCheckboxProps.labelClassName, children: CwCheckboxProps.labelName })) : null] }));
3472
4020
  }
3473
4021
 
4022
+ function CwCheckboxGroup({ options, value = [], onChange, labelProps, alignProps, required, disabled, optionsAlignment = "row", className, feedback, }) {
4023
+ const handleChange = (optionValue, checked) => {
4024
+ if (checked) {
4025
+ onChange([...value, optionValue]);
4026
+ }
4027
+ else {
4028
+ onChange(value.filter(v => v !== optionValue));
4029
+ }
4030
+ };
4031
+ const feedbackMessages = feedback
4032
+ ? Array.isArray(feedback) ? feedback : [feedback]
4033
+ : [];
4034
+ const flexDirection = alignProps?.flexDirection ?? "row";
4035
+ const dataDirection = { 'data-direction': flexDirection };
4036
+ return (jsxs("div", { className: `cw-checkbox-group ${styles$9["checkbox-group-container"]}${className ? ` ${className}` : ''}`, ...dataDirection, children: [jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsx("div", { className: `${optionsAlignment === "row" ? "cw-flex-column cw-gap-small" : "cw-flex-row cw-flex-wrap"}`, children: options.map((option) => (jsx(CwCheck, { labelText: option.label, checked: value.includes(option.value), disabled: disabled || option.disabled, alignment: optionsAlignment, onChange: (e) => handleChange(option.value, e.target.checked) }, option.value))) })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
4037
+ }
4038
+
3474
4039
  function CwToggle(props) {
3475
4040
  const { labelProps, labelText, iconProps, alignment = "row", className, style, ...inputProps } = props;
3476
4041
  const displayText = labelText || labelProps?.text;
@@ -3520,10 +4085,13 @@ function CwOption(props) {
3520
4085
  * </CwSelect>
3521
4086
  */
3522
4087
  function CwSelect(props) {
3523
- const { alignProps, labelProps, buttonProps, iconProps, placeholder, children, style, ...selectProps } = props;
3524
- const flexDirection = alignProps?.flexDirection;
3525
- const dataDirection = flexDirection ? { 'data-direction': flexDirection } : {};
3526
- return (jsx("div", { className: "cw-select", ...dataDirection, style: style, children: jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("select", { ...selectProps, children: [placeholder && jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsx(CwButton, { ...buttonProps })] }) }));
4088
+ const { alignProps, labelProps, buttonProps, iconProps, placeholder, feedback, children, style, className, ...selectProps } = props;
4089
+ const feedbackMessages = feedback
4090
+ ? Array.isArray(feedback) ? feedback : [feedback]
4091
+ : [];
4092
+ const flexDirection = alignProps?.flexDirection ?? "row";
4093
+ const dataDirection = { 'data-direction': flexDirection };
4094
+ return (jsxs("div", { className: `cw-select${className ? ` ${className}` : ''}`, ...dataDirection, style: style, children: [jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-flex-row cw-gap-small cw-flex-grow", children: [jsxs("select", { ...selectProps, children: [placeholder && jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-type": feedbackItem.type, children: feedbackItem.message }, index)))] }));
3527
4095
  }
3528
4096
 
3529
4097
  function CwDropdownFilter(props) {
@@ -3557,7 +4125,7 @@ const CwMultiFilterTag = props => {
3557
4125
  const { ID, Name, Value, Category, Removable, PrimaryColor, Selectable, Selected } = props;
3558
4126
  const backgroundColor = `rgb(${PrimaryColor.r},${PrimaryColor.g},${PrimaryColor.b})`;
3559
4127
  const isOutlineMode = Selected && !Removable;
3560
- return (jsx("li", { className: styles$8["cw-multifilter-tag"], id: ID, "data-value": Value, "data-category": Category, "data-selected": !!Selected, title: Name, onClick: () => {
4128
+ return (jsx("li", { className: styles$8["cw-multifilter-tag"], id: ID, "data-value": Value, "data-category": Category, "data-selected": !!Selected, title: props.tooltip ?? Name, onClick: () => {
3561
4129
  if (Selectable)
3562
4130
  props.OnSelect?.(props);
3563
4131
  }, children: jsx(CwChip, { label: Name, colorScheme: "custom", customColor: backgroundColor, variant: isOutlineMode ? "outline" : "soft", closable: Removable, onClose: () => props.OnRemove?.(props),
@@ -3815,14 +4383,23 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, style
3815
4383
  }, children: [jsxs("div", { onClick: handleDivClick, className: styles$7["cw-multi-filter-search"], style: isPanelOpen ? { outline: "1px solid var(--cw-color-primary)", outlineOffset: "-2px" } : {}, children: [jsxs("ul", { id: id + "_selected_filters", children: [Array.from(selectedTags).map(tag => (createElement(CwMultiFilterTag, { ...tag, key: tag.ID, Selectable: false, Removable: true, OnRemove: () => removeTag(tag.ID) }))), jsx("input", { type: "text", id: id + "_input", ref: inputRef, value: inputTextValue, spellCheck: false, onFocus: () => setIsPanelOpen(true), onChange: e => handleInputText(e.target.value), autoComplete: "off", placeholder: "Write to filter", onKeyDown: e => {
3816
4384
  switch (e.key) {
3817
4385
  case "Enter":
3818
- case "Tab":
4386
+ case "Tab": {
3819
4387
  if (inputTextValue.trim().length > 0 && filteredTags.size > 0) {
3820
- const foundTag = Array.from(filteredTags)[0];
4388
+ const input = inputTextValue.trim().toLowerCase();
4389
+ const tagsArr = Array.from(filteredTags);
4390
+ let foundTag = tagsArr.find(tag => tag.Name.trim().toLowerCase() === input);
4391
+ if (!foundTag) {
4392
+ foundTag = tagsArr.find(tag => tag.Name.trim().toLowerCase().startsWith(input));
4393
+ }
4394
+ if (!foundTag) {
4395
+ foundTag = tagsArr[0];
4396
+ }
3821
4397
  if (foundTag) {
3822
4398
  addTag(foundTag);
3823
4399
  }
3824
4400
  }
3825
4401
  break;
4402
+ }
3826
4403
  case "Backspace": {
3827
4404
  if (inputTextValue === "" && selectedTags.size > 0) {
3828
4405
  removeTag(Array.from(selectedTags).toReversed()[0].ID);
@@ -3852,7 +4429,22 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, style
3852
4429
  : {
3853
4430
  backgroundColor: getColor(category).primary,
3854
4431
  color: getColor(category).onPrimary,
3855
- }, onClick: () => handleClickCategory(category), children: category }, category)))] }), jsx("ul", { children: Array.from(filteredTags).map((props) => (jsx(CwMultiFilterTag, { ...props, Selectable: true, Removable: false, Selected: Array.from(selectedTags).some(p => p.ID === props.ID), OnSelect: () => {
4432
+ }, onClick: () => handleClickCategory(category), children: category }, category)))] }), jsx("ul", { children: Array.from(filteredTags)
4433
+ .sort((a, b) => {
4434
+ const input = inputTextValue.trim().toLowerCase();
4435
+ const aName = a.Name.trim().toLowerCase();
4436
+ const bName = b.Name.trim().toLowerCase();
4437
+ if (aName === input && bName !== input)
4438
+ return -1;
4439
+ if (bName === input && aName !== input)
4440
+ return 1;
4441
+ if (aName.startsWith(input) && !bName.startsWith(input))
4442
+ return -1;
4443
+ if (bName.startsWith(input) && !aName.startsWith(input))
4444
+ return 1;
4445
+ return 0;
4446
+ })
4447
+ .map((props) => (jsx(CwMultiFilterTag, { ...props, Selectable: true, Removable: false, Selected: Array.from(selectedTags).some(p => p.ID === props.ID), OnSelect: () => {
3856
4448
  if (Array.from(selectedTags).some(p => p.ID === props.ID))
3857
4449
  removeTag(props.ID);
3858
4450
  else
@@ -4296,12 +4888,100 @@ function CwBtnDelete({ cw_btnOnclick, cw_btn_disabled, onClick, disabled, ...res
4296
4888
 
4297
4889
  var styles$4 = {"pickerWrapper":"cw-pickers-base-module_pickerWrapper__Fb9Zo","pickerIcons":"cw-pickers-base-module_pickerIcons__dyd2-","pickerPopup":"cw-pickers-base-module_pickerPopup__dkxJo"};
4298
4890
 
4891
+ /**
4892
+ * Renders a picker popup in a portal so it escapes overflow containers.
4893
+ * Positions itself relative to the anchor element.
4894
+ */
4895
+ function usePickerPopup({ anchorRef, isOpen, onClose, position = "left-bottom" }) {
4896
+ const popupRef = useRef(null);
4897
+ const [style, setStyle] = useState({ position: "fixed", top: 0, left: 0, zIndex: 1000 });
4898
+ const reposition = useCallback(() => {
4899
+ const anchor = anchorRef.current;
4900
+ const popup = popupRef.current;
4901
+ if (!anchor || !popup)
4902
+ return;
4903
+ const rect = anchor.getBoundingClientRect();
4904
+ const popupRect = popup.getBoundingClientRect();
4905
+ // Determine vertical placement
4906
+ const preferTop = position.includes("top");
4907
+ const spaceBelow = window.innerHeight - rect.bottom;
4908
+ const spaceAbove = rect.top;
4909
+ const popupH = popupRect.height || 300; // fallback for first render
4910
+ let top;
4911
+ if (preferTop && spaceAbove >= popupH) {
4912
+ top = rect.top - popupH;
4913
+ }
4914
+ else if (!preferTop && spaceBelow >= popupH + 4) {
4915
+ top = rect.bottom + 4;
4916
+ }
4917
+ else {
4918
+ // Flip if preferred side doesn't fit
4919
+ top = spaceBelow >= popupH + 4 ? rect.bottom + 4 : rect.top - popupH;
4920
+ }
4921
+ // Determine horizontal placement
4922
+ let left;
4923
+ if (position.includes("right")) {
4924
+ left = rect.right - (popupRect.width || rect.width);
4925
+ }
4926
+ else {
4927
+ left = rect.left;
4928
+ }
4929
+ // Clamp to viewport
4930
+ left = Math.max(4, Math.min(left, window.innerWidth - (popupRect.width || 200) - 4));
4931
+ top = Math.max(4, top);
4932
+ setStyle({ position: "fixed", top, left, zIndex: 1000 });
4933
+ }, [anchorRef, position]);
4934
+ // Reposition on open + observe scroll/resize on all ancestors
4935
+ useEffect(() => {
4936
+ if (!isOpen)
4937
+ return;
4938
+ reposition();
4939
+ // Re-measure after the popup renders to get its actual size
4940
+ requestAnimationFrame(reposition);
4941
+ const handleUpdate = () => reposition();
4942
+ window.addEventListener("resize", handleUpdate);
4943
+ window.addEventListener("scroll", handleUpdate, true); // capture phase catches all scrollable ancestors
4944
+ return () => {
4945
+ window.removeEventListener("resize", handleUpdate);
4946
+ window.removeEventListener("scroll", handleUpdate, true);
4947
+ };
4948
+ }, [isOpen, reposition]);
4949
+ // Close on outside click — checks both anchor and popup
4950
+ useEffect(() => {
4951
+ if (!isOpen)
4952
+ return;
4953
+ const handleMouseDown = (e) => {
4954
+ const target = e.target;
4955
+ if (anchorRef.current?.contains(target) ||
4956
+ popupRef.current?.contains(target))
4957
+ return;
4958
+ onClose();
4959
+ };
4960
+ document.addEventListener("mousedown", handleMouseDown);
4961
+ return () => document.removeEventListener("mousedown", handleMouseDown);
4962
+ }, [isOpen, onClose, anchorRef]);
4963
+ const renderPopup = useCallback((children) => {
4964
+ if (!isOpen)
4965
+ return null;
4966
+ return createPortal(children, document.body);
4967
+ }, [isOpen]);
4968
+ return { popupRef, popupStyle: style, renderPopup };
4969
+ }
4970
+
4299
4971
  function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabledMatcher, defaultMonth, labelProps, alignProps, placeholder = "Select a date", displayFormat = "dd.MM.yyyy", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 1, showTodayButton = false, }) {
4300
4972
  const [isOpen, setIsOpen] = useState(false);
4301
4973
  const [inputValue, setInputValue] = useState("");
4302
4974
  const containerRef = useRef(null);
4975
+ const wrapperRef = useRef(null);
4303
4976
  const inputRef = useRef(null);
4304
4977
  const prevValueRef = useRef(undefined);
4978
+ const handleClose = useCallback(() => setIsOpen(false), []);
4979
+ const { popupRef, popupStyle, renderPopup } = usePickerPopup({
4980
+ anchorRef: wrapperRef,
4981
+ isOpen,
4982
+ onClose: handleClose,
4983
+ position: popupPosition,
4984
+ });
4305
4985
  // Parse date from string based on format
4306
4986
  const parseDate = useCallback((dateString, formatStr) => {
4307
4987
  try {
@@ -4384,20 +5064,6 @@ function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabl
4384
5064
  }
4385
5065
  }
4386
5066
  }, [value, displayFormat]);
4387
- // Close calendar when clicking outside
4388
- useEffect(() => {
4389
- const handleClickOutside = (event) => {
4390
- if (containerRef.current && !containerRef.current.contains(event.target)) {
4391
- setIsOpen(false);
4392
- }
4393
- };
4394
- if (isOpen) {
4395
- document.addEventListener("mousedown", handleClickOutside);
4396
- }
4397
- return () => {
4398
- document.removeEventListener("mousedown", handleClickOutside);
4399
- };
4400
- }, [isOpen]);
4401
5067
  const handleDaySelect = useCallback((date) => {
4402
5068
  onChange(date);
4403
5069
  setIsOpen(false);
@@ -4473,7 +5139,7 @@ function CwDatePicker({ value, onChange, minDate, maxDate, disabledDates, disabl
4473
5139
  ...(maxDate ? [{ after: maxDate }] : []),
4474
5140
  ...(disabledMatcher ? [disabledMatcher] : []),
4475
5141
  ], [disabledDates, minDate, maxDate, disabledMatcher]);
4476
- return (jsx("div", { ref: containerRef, className: `cw-datepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClear, tabIndex: -1, "aria-label": "Clear date" })) : (jsx(CwIcon, { iconId: "calendar" })) }), isOpen && (jsxs("div", { className: styles$4.pickerPopup, "data-position": popupPosition, children: [jsx(DayPicker, { mode: "single", selected: value || undefined, defaultMonth: defaultMonth || value || undefined, onSelect: handleDaySelect, disabled: disabledDays, numberOfMonths: numberOfMonths, modifiers: {
5142
+ return (jsx("div", { ref: containerRef, className: `cw-datepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { ref: wrapperRef, className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClear, tabIndex: -1, "aria-label": "Clear date" })) : (jsx(CwIcon, { iconId: "calendar" })) }), renderPopup(jsxs("div", { ref: popupRef, className: styles$4.pickerPopup, style: popupStyle, children: [jsx(DayPicker, { mode: "single", selected: value || undefined, defaultMonth: defaultMonth || value || undefined, onSelect: handleDaySelect, disabled: disabledDays, numberOfMonths: numberOfMonths, modifiers: {
4477
5143
  today: new Date(),
4478
5144
  }, modifiersClassNames: {
4479
5145
  today: "rdp-day-today",
@@ -4757,9 +5423,20 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
4757
5423
  const [inputToValue, setInputToValue] = useState("");
4758
5424
  const [focusedInput, setFocusedInput] = useState();
4759
5425
  const containerRef = useRef(null);
5426
+ const wrapperRef = useRef(null);
4760
5427
  const inputFromRef = useRef(null);
4761
5428
  const inputToRef = useRef(null);
4762
5429
  const prevValueRef = useRef(undefined);
5430
+ const handleClose = useCallback(() => {
5431
+ setIsOpen(false);
5432
+ setFocusedInput(undefined);
5433
+ }, []);
5434
+ const { popupRef, popupStyle, renderPopup } = usePickerPopup({
5435
+ anchorRef: wrapperRef,
5436
+ isOpen,
5437
+ onClose: handleClose,
5438
+ position: popupPosition,
5439
+ });
4763
5440
  // Calculate presets to render
4764
5441
  const presetsToRender = useMemo(() => {
4765
5442
  let presets = [];
@@ -4868,21 +5545,6 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
4868
5545
  }
4869
5546
  }
4870
5547
  }, [value, displayFormat]);
4871
- // Close calendar when clicking outside
4872
- useEffect(() => {
4873
- const handleClickOutside = (event) => {
4874
- if (containerRef.current && !containerRef.current.contains(event.target)) {
4875
- setIsOpen(false);
4876
- setFocusedInput(undefined);
4877
- }
4878
- };
4879
- if (isOpen) {
4880
- document.addEventListener("mousedown", handleClickOutside);
4881
- }
4882
- return () => {
4883
- document.removeEventListener("mousedown", handleClickOutside);
4884
- };
4885
- }, [isOpen]);
4886
5548
  const handleRangeSelect = useCallback((range, // El rango sugerido por react-day-picker
4887
5549
  selectedDay) => {
4888
5550
  let newRange;
@@ -5103,7 +5765,7 @@ function CwDateRangePicker({ value, onChange, minDate, maxDate, disabledDates, d
5103
5765
  }
5104
5766
  return undefined;
5105
5767
  }, [value]);
5106
- return (jsx("div", { ref: containerRef, className: `cw-rangepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: rangeStyles.rangeWrapper, children: [jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputFromRef, type: "text", value: inputFromValue, placeholder: placeholderFrom, onChange: handleInputFromChange, onBlur: () => handleInputBlur('from'), onClick: handleInputFromClick, onKeyDown: (e) => handleInputKeyDown(e, 'from'), disabled: disabled, required: required, "data-focused": focusedInput === 'from' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.from && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearFrom, tabIndex: -1, "aria-label": "Clear from date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), jsx(CwIcon, { iconId: "arrow-right", size: "medium" }), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputToRef, type: "text", value: inputToValue, placeholder: placeholderTo, onChange: handleInputToChange, onBlur: () => handleInputBlur('to'), onClick: handleInputToClick, onKeyDown: (e) => handleInputKeyDown(e, 'to'), disabled: disabled, required: required, "data-focused": focusedInput === 'to' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.to && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearTo, tabIndex: -1, "aria-label": "Clear to date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), isOpen && (jsxs("div", { className: `${styles$4.pickerPopup} ${rangeStyles.rangePopup}`, "data-position": popupPosition, children: [showPresets && presetsToRender.length > 0 && (jsx("div", { className: rangeStyles.presetList, children: presetsToRender.map((preset) => (jsx("button", { type: "button", onClick: (e) => handlePresetClick(preset, e), children: preset.label }, preset.key))) })), jsx(DayPicker, { mode: "range", selected: selectedRange, onSelect: handleRangeSelect, disabled: disabledDays, numberOfMonths: numberOfMonths, defaultMonth: defaultMonth || value?.from || undefined, modifiers: {
5768
+ return (jsx("div", { ref: containerRef, className: `cw-rangepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { ref: wrapperRef, className: rangeStyles.rangeWrapper, children: [jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputFromRef, type: "text", value: inputFromValue, placeholder: placeholderFrom, onChange: handleInputFromChange, onBlur: () => handleInputBlur('from'), onClick: handleInputFromClick, onKeyDown: (e) => handleInputKeyDown(e, 'from'), disabled: disabled, required: required, "data-focused": focusedInput === 'from' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.from && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearFrom, tabIndex: -1, "aria-label": "Clear from date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), jsx(CwIcon, { iconId: "arrow-right", size: "medium" }), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputToRef, type: "text", value: inputToValue, placeholder: placeholderTo, onChange: handleInputToChange, onBlur: () => handleInputBlur('to'), onClick: handleInputToClick, onKeyDown: (e) => handleInputKeyDown(e, 'to'), disabled: disabled, required: required, "data-focused": focusedInput === 'to' }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value?.to && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClearTo, tabIndex: -1, "aria-label": "Clear to date" })) : (jsx(CwIcon, { iconId: "calendar" })) })] }), renderPopup(jsxs("div", { ref: popupRef, className: `${styles$4.pickerPopup} ${rangeStyles.rangePopup}`, style: popupStyle, children: [showPresets && presetsToRender.length > 0 && (jsx("div", { className: rangeStyles.presetList, children: presetsToRender.map((preset) => (jsx("button", { type: "button", onClick: (e) => handlePresetClick(preset, e), children: preset.label }, preset.key))) })), jsx(DayPicker, { mode: "range", selected: selectedRange, onSelect: handleRangeSelect, disabled: disabledDays, numberOfMonths: numberOfMonths, defaultMonth: defaultMonth || value?.from || undefined, modifiers: {
5107
5769
  today: new Date(),
5108
5770
  }, modifiersClassNames: {
5109
5771
  today: "rdp-day-today",
@@ -5119,8 +5781,16 @@ function CwTimePicker({ value, onChange, interval = 15, minTime, maxTime, labelP
5119
5781
  const [isOpen, setIsOpen] = useState(false);
5120
5782
  const [inputValue, setInputValue] = useState("");
5121
5783
  const containerRef = useRef(null);
5784
+ const wrapperRef = useRef(null);
5122
5785
  const inputRef = useRef(null);
5123
5786
  const selectedItemRef = useRef(null);
5787
+ const handleClose = useCallback(() => setIsOpen(false), []);
5788
+ const { popupRef, popupStyle, renderPopup } = usePickerPopup({
5789
+ anchorRef: wrapperRef,
5790
+ isOpen,
5791
+ onClose: handleClose,
5792
+ position: popupPosition,
5793
+ });
5124
5794
  // Sync input value with prop value
5125
5795
  useEffect(() => {
5126
5796
  if (value) {
@@ -5148,20 +5818,6 @@ function CwTimePicker({ value, onChange, interval = 15, minTime, maxTime, labelP
5148
5818
  return options;
5149
5819
  };
5150
5820
  const timeOptions = generateTimeOptions();
5151
- // Close dropdown when clicking outside
5152
- useEffect(() => {
5153
- const handleClickOutside = (event) => {
5154
- if (containerRef.current && !containerRef.current.contains(event.target)) {
5155
- setIsOpen(false);
5156
- }
5157
- };
5158
- if (isOpen) {
5159
- document.addEventListener("mousedown", handleClickOutside);
5160
- }
5161
- return () => {
5162
- document.removeEventListener("mousedown", handleClickOutside);
5163
- };
5164
- }, [isOpen]);
5165
5821
  // Scroll to selected time when opening dropdown
5166
5822
  useEffect(() => {
5167
5823
  if (isOpen && selectedItemRef.current) {
@@ -5272,13 +5928,40 @@ function CwTimePicker({ value, onChange, interval = 15, minTime, maxTime, labelP
5272
5928
  return (jsx("div", { className: `cw-timepicker cw-timepicker-native ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsx("div", { className: styles$4.pickerWrapper, children: jsx("input", { type: "time", value: displayValue, onChange: handleNativeChange, min: minTime, max: maxTime, step: interval * 60, disabled: disabled, required: required, placeholder: placeholder, className: "cw-timepicker-native" }) })] }) }));
5273
5929
  }
5274
5930
  // Custom time picker
5275
- return (jsx("div", { ref: containerRef, className: `cw-timepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required, maxLength: 5, className: showClear ? timeStyles.hasIcons : timeStyles.notIcons }), showClear && (jsx("div", { className: styles$4.pickerIcons, children: value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", icon: "close", color: "neutral", onClick: handleClear, tabIndex: -1, "aria-label": "Clear time" })) : (jsx(CwIcon, { iconId: "clock" })) })), isOpen && (jsx("div", { className: `${styles$4.pickerPopup} ${timeStyles.timePickerPopup}`, "data-position": popupPosition, children: jsx("div", { className: timeStyles.timePickerList, children: timeOptions.map((time) => {
5931
+ return (jsx("div", { ref: containerRef, className: `cw-timepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { ref: wrapperRef, className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required, maxLength: 5, className: showClear ? timeStyles.hasIcons : timeStyles.notIcons }), showClear && (jsx("div", { className: styles$4.pickerIcons, children: value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", icon: "close", color: "neutral", onClick: handleClear, tabIndex: -1, "aria-label": "Clear time" })) : (jsx(CwIcon, { iconId: "clock" })) })), renderPopup(jsx("div", { ref: popupRef, className: `${styles$4.pickerPopup} ${timeStyles.timePickerPopup}`, style: popupStyle, children: jsx("div", { className: timeStyles.timePickerList, children: timeOptions.map((time) => {
5276
5932
  const isSelected = time === value;
5277
5933
  return (jsx("button", { ref: isSelected ? selectedItemRef : null, type: "button", className: isSelected ? timeStyles.selected : "", onClick: () => handleTimeSelect(time), children: time }, time));
5278
5934
  }) }) }))] })] }) }));
5279
5935
  }
5280
5936
 
5281
- function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledDates, disabledMatcher, timeInterval = 15, minTime, maxTime, labelProps, alignProps, datePlaceholder = "dd.MM.yyyy", timePlaceholder = "HH:mm", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 1, showNowButton = false, }) {
5937
+ /**
5938
+ * Converts a Date to a new Date whose local year/month/day
5939
+ * reflect the date in the given UTC offset.
5940
+ *
5941
+ * This is necessary because date-fns format() and DayPicker
5942
+ * always use the browser's local timezone. By "shifting" the date,
5943
+ * we ensure the correct date displays regardless of browser timezone.
5944
+ *
5945
+ * @param date - The original Date object
5946
+ * @param timezoneOffset - Numeric offset in hours (e.g., 0 for UTC, 1 for CET, -5 for EST, 5.5 for IST)
5947
+ * @returns A new Date with local fields matching the target timezone's date
5948
+ */
5949
+ function getDateInOffset(date, timezoneOffset) {
5950
+ const m = moment$1(date).utcOffset(timezoneOffset * 60);
5951
+ return new Date(m.year(), m.month(), m.date());
5952
+ }
5953
+ /**
5954
+ * Gets the time string (HH:mm) for a Date in the given UTC offset.
5955
+ *
5956
+ * @param date - The original Date object
5957
+ * @param timezoneOffset - Numeric offset in hours (e.g., 0 for UTC, 1 for CET, -5 for EST, 5.5 for IST)
5958
+ * @returns Time string in "HH:mm" format for the given offset
5959
+ */
5960
+ function getTimeInOffset(date, timezoneOffset) {
5961
+ return moment$1(date).utcOffset(timezoneOffset * 60).format("HH:mm");
5962
+ }
5963
+
5964
+ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledDates, disabledMatcher, timeInterval = 15, minTime, maxTime, labelProps, alignProps, datePlaceholder = "dd.MM.yyyy", timePlaceholder = "HH:mm", disabled, required, className, showClear = true, popupPosition = "left-bottom", numberOfMonths = 1, showNowButton = false, timezoneOffset, }) {
5282
5965
  // ========================================
5283
5966
  // PROPS NORMALIZATION
5284
5967
  // ========================================
@@ -5310,10 +5993,32 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
5310
5993
  const normalizedMinDateTime = useMemo(() => normalizeDateTime(minDateTime, 'minDateTime'), [minDateTime, normalizeDateTime]);
5311
5994
  const normalizedMaxDateTime = useMemo(() => normalizeDateTime(maxDateTime, 'maxDateTime'), [maxDateTime, normalizeDateTime]);
5312
5995
  // ========================================
5996
+ // HELPERS CON MOMENT
5997
+ // ========================================
5998
+ /**
5999
+ * Convert a Date to a "display date" whose local year/month/day
6000
+ * reflect the date in the target timezone offset.
6001
+ * When timezoneOffset is undefined, returns the date as-is.
6002
+ */
6003
+ const toDisplayDate = useCallback((date) => {
6004
+ return timezoneOffset !== undefined
6005
+ ? getDateInOffset(date, timezoneOffset)
6006
+ : date;
6007
+ }, [timezoneOffset]);
6008
+ /**
6009
+ * Get the time string (HH:mm) for a Date, adjusted for timezone offset.
6010
+ * When timezoneOffset is undefined, uses local time.
6011
+ */
6012
+ const toDisplayTime = useCallback((date) => {
6013
+ return timezoneOffset !== undefined
6014
+ ? getTimeInOffset(date, timezoneOffset)
6015
+ : `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
6016
+ }, [timezoneOffset]);
6017
+ // ========================================
5313
6018
  // INTERNAL STATE
5314
6019
  // ========================================
5315
- const [selectedDate, setSelectedDate] = useState(value);
5316
- const [selectedTime, setSelectedTime] = useState(value ? `${value.getHours().toString().padStart(2, "0")}:${value.getMinutes().toString().padStart(2, "0")}` : undefined);
6020
+ const [selectedDate, setSelectedDate] = useState(value ? toDisplayDate(value) : undefined);
6021
+ const [selectedTime, setSelectedTime] = useState(value ? toDisplayTime(value) : undefined);
5317
6022
  // Track previous value to detect external changes
5318
6023
  const prevValueRef = useRef(undefined);
5319
6024
  // ========================================
@@ -5328,28 +6033,24 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
5328
6033
  const combineDateTime = useCallback((date, time) => {
5329
6034
  if (!date)
5330
6035
  return undefined;
5331
- // If no time is selected, use 00:00
5332
- if (!time) {
5333
- const combined = new Date(date);
5334
- combined.setHours(0, 0, 0, 0);
5335
- // Validate against min/max datetime
5336
- if (normalizedMinDateTime && combined < normalizedMinDateTime)
5337
- return undefined;
5338
- if (normalizedMaxDateTime && combined > normalizedMaxDateTime)
5339
- return undefined;
5340
- return combined;
6036
+ const [hours, minutes] = (time ?? "00:00").split(':').map(Number);
6037
+ let m;
6038
+ if (timezoneOffset !== undefined) {
6039
+ // Interpretamos los valores como pertenecientes al offset especificado
6040
+ m = moment$1.utc([date.getFullYear(), date.getMonth(), date.getDate(), hours, minutes]);
6041
+ m.utcOffset(timezoneOffset * 60, true);
5341
6042
  }
5342
- // Parse time and combine with date
5343
- const [hours, minutes] = time.split(':').map(Number);
5344
- const combined = new Date(date);
5345
- combined.setHours(hours, minutes, 0, 0);
6043
+ else {
6044
+ m = moment$1(date).hours(hours).minutes(minutes).seconds(0).milliseconds(0);
6045
+ }
6046
+ const combined = m.toDate();
5346
6047
  // Validate against min/max datetime
5347
6048
  if (normalizedMinDateTime && combined < normalizedMinDateTime)
5348
6049
  return undefined;
5349
6050
  if (normalizedMaxDateTime && combined > normalizedMaxDateTime)
5350
6051
  return undefined;
5351
6052
  return combined;
5352
- }, [normalizedMinDateTime, normalizedMaxDateTime]);
6053
+ }, [normalizedMinDateTime, normalizedMaxDateTime, timezoneOffset]);
5353
6054
  /**
5354
6055
  * Calculate dynamic time restrictions based on selected date
5355
6056
  *
@@ -5363,33 +6064,38 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
5363
6064
  const calculateTimeRestrictions = useCallback((selectedDate) => {
5364
6065
  if (!selectedDate)
5365
6066
  return { minTime, maxTime };
5366
- // Normalize selected date to date-only (ignore time component)
5367
- const selectedDateOnly = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate());
6067
+ // selectedDate is already a "display date" (shifted for timezone),
6068
+ // so we compare using local date fields via moment (no utcOffset needed here)
6069
+ const mSelected = moment$1(selectedDate);
5368
6070
  let calculatedMinTime = minTime;
5369
6071
  let calculatedMaxTime = maxTime;
5370
6072
  // If selected date matches minDateTime date, restrict minimum time
5371
6073
  if (normalizedMinDateTime) {
5372
- const minDateOnly = new Date(normalizedMinDateTime.getFullYear(), normalizedMinDateTime.getMonth(), normalizedMinDateTime.getDate());
5373
- if (selectedDateOnly.getTime() === minDateOnly.getTime()) {
5374
- const hours = normalizedMinDateTime.getHours().toString().padStart(2, "0");
5375
- const minutes = normalizedMinDateTime.getMinutes().toString().padStart(2, "0");
5376
- calculatedMinTime = `${hours}:${minutes}`;
6074
+ const mMin = timezoneOffset !== undefined
6075
+ ? moment$1(getDateInOffset(normalizedMinDateTime, timezoneOffset))
6076
+ : moment$1(normalizedMinDateTime);
6077
+ if (mSelected.isSame(mMin, 'day')) {
6078
+ calculatedMinTime = timezoneOffset !== undefined
6079
+ ? getTimeInOffset(normalizedMinDateTime, timezoneOffset)
6080
+ : moment$1(normalizedMinDateTime).format("HH:mm");
5377
6081
  }
5378
6082
  }
5379
6083
  // If selected date matches maxDateTime date, restrict maximum time
5380
6084
  if (normalizedMaxDateTime) {
5381
- const maxDateOnly = new Date(normalizedMaxDateTime.getFullYear(), normalizedMaxDateTime.getMonth(), normalizedMaxDateTime.getDate());
5382
- if (selectedDateOnly.getTime() === maxDateOnly.getTime()) {
5383
- const hours = normalizedMaxDateTime.getHours().toString().padStart(2, "0");
5384
- const minutes = normalizedMaxDateTime.getMinutes().toString().padStart(2, "0");
5385
- calculatedMaxTime = `${hours}:${minutes}`;
6085
+ const mMax = timezoneOffset !== undefined
6086
+ ? moment$1(getDateInOffset(normalizedMaxDateTime, timezoneOffset))
6087
+ : moment$1(normalizedMaxDateTime);
6088
+ if (mSelected.isSame(mMax, 'day')) {
6089
+ calculatedMaxTime = timezoneOffset !== undefined
6090
+ ? getTimeInOffset(normalizedMaxDateTime, timezoneOffset)
6091
+ : moment$1(normalizedMaxDateTime).format("HH:mm");
5386
6092
  }
5387
6093
  }
5388
6094
  return {
5389
6095
  minTime: calculatedMinTime,
5390
6096
  maxTime: calculatedMaxTime
5391
6097
  };
5392
- }, [normalizedMinDateTime, normalizedMaxDateTime, minTime, maxTime]);
6098
+ }, [normalizedMinDateTime, normalizedMaxDateTime, minTime, maxTime, timezoneOffset]);
5393
6099
  // Calculate current time restrictions based on selected date
5394
6100
  // Recalculates whenever selectedDate or the calculation function changes
5395
6101
  const timeRestrictions = useMemo(() => calculateTimeRestrictions(selectedDate), [selectedDate, calculateTimeRestrictions]);
@@ -5409,15 +6115,15 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
5409
6115
  if (currentTime !== prevTime) {
5410
6116
  prevValueRef.current = value;
5411
6117
  if (value) {
5412
- setSelectedDate(value);
5413
- setSelectedTime(`${value.getHours().toString().padStart(2, "0")}:${value.getMinutes().toString().padStart(2, "0")}`);
6118
+ setSelectedDate(toDisplayDate(value));
6119
+ setSelectedTime(toDisplayTime(value));
5414
6120
  }
5415
6121
  else {
5416
6122
  setSelectedDate(undefined);
5417
6123
  setSelectedTime(undefined);
5418
6124
  }
5419
6125
  }
5420
- }, [value]);
6126
+ }, [value, toDisplayDate, toDisplayTime]);
5421
6127
  // ========================================
5422
6128
  // EVENT HANDLERS
5423
6129
  // ========================================
@@ -5486,13 +6192,17 @@ function CwDateTimePicker({ value, onChange, minDateTime, maxDateTime, disabledD
5486
6192
  onChange(now);
5487
6193
  }
5488
6194
  }, [normalizedMinDateTime, normalizedMaxDateTime, onChange]);
5489
- // Extract min/max date from normalized datetime for DatePicker
5490
- const minDate = normalizedMinDateTime;
5491
- const maxDate = normalizedMaxDateTime;
5492
6195
  // ========================================
5493
6196
  // RENDER
5494
6197
  // ========================================
5495
- return (jsx("div", { className: `cw-datetimepicker cw-datetimepicker-separate ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: "cw-flex-row cw-align-left-center cw-gap-small", children: [jsx(CwDatePicker, { value: selectedDate, onChange: handleDateChange, minDate: minDate, maxDate: maxDate, disabledDates: disabledDates, disabledMatcher: disabledMatcher, placeholder: datePlaceholder, disabled: disabled, required: required, showClear: showClear, numberOfMonths: numberOfMonths, popupPosition: popupPosition }), jsx(CwTimePicker, { value: selectedTime, onChange: handleTimeChange, interval: timeInterval, minTime: timeRestrictions.minTime, maxTime: timeRestrictions.maxTime, placeholder: timePlaceholder, disabled: disabled, required: required, showClear: showClear, popupPosition: popupPosition }), showNowButton && (jsx(CwButton, { type: "button", variant: "outline", onClick: handleNowClick, disabled: disabled, title: "Set to current date and time", text: "Now" }))] })] }) }));
6198
+ // Shift min/max dates for CwDatePicker display (it uses local timezone internally)
6199
+ const displayMinDate = useMemo(() => normalizedMinDateTime && timezoneOffset !== undefined
6200
+ ? getDateInOffset(normalizedMinDateTime, timezoneOffset)
6201
+ : normalizedMinDateTime, [normalizedMinDateTime, timezoneOffset]);
6202
+ const displayMaxDate = useMemo(() => normalizedMaxDateTime && timezoneOffset !== undefined
6203
+ ? getDateInOffset(normalizedMaxDateTime, timezoneOffset)
6204
+ : normalizedMaxDateTime, [normalizedMaxDateTime, timezoneOffset]);
6205
+ return jsx("div", { className: `cw-datetimepicker cw-datetimepicker-separate ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: "cw-flex-row cw-align-left-center cw-gap-small", children: [jsx(CwDatePicker, { value: selectedDate, onChange: handleDateChange, minDate: displayMinDate, maxDate: displayMaxDate, disabledDates: disabledDates, disabledMatcher: disabledMatcher, placeholder: datePlaceholder, disabled: disabled, required: required, showClear: showClear, numberOfMonths: numberOfMonths, popupPosition: popupPosition }), jsx(CwTimePicker, { value: selectedTime, onChange: handleTimeChange, interval: timeInterval, minTime: timeRestrictions.minTime, maxTime: timeRestrictions.maxTime, placeholder: timePlaceholder, disabled: disabled, required: required, showClear: showClear, popupPosition: popupPosition }), showNowButton && (jsx(CwButton, { type: "button", variant: "outline", onClick: handleNowClick, disabled: disabled, title: "Set to current date and time", text: "Now" }))] })] }) });
5496
6206
  }
5497
6207
 
5498
6208
  var compactStyles = {"compactPopup":"cw-datetime-compact-module_compactPopup__GiuNY","calendarWrapper":"cw-datetime-compact-module_calendarWrapper__P4Nlq","timeWrapper":"cw-datetime-compact-module_timeWrapper__uMe-A","compactTimeList":"cw-datetime-compact-module_compactTimeList__MzSQT"};
@@ -5503,9 +6213,17 @@ function CwDateTimePickerCompact({ value, onChange, minDateTime, maxDateTime, di
5503
6213
  const [selectedDate, setSelectedDate] = useState(value);
5504
6214
  const [selectedTime, setSelectedTime] = useState("");
5505
6215
  const containerRef = useRef(null);
6216
+ const wrapperRef = useRef(null);
5506
6217
  const inputRef = useRef(null);
5507
6218
  const timeListRef = useRef(null);
5508
6219
  const prevValueRef = useRef(value);
6220
+ const handleClose = useCallback(() => setIsOpen(false), []);
6221
+ const { popupRef, popupStyle, renderPopup } = usePickerPopup({
6222
+ anchorRef: wrapperRef,
6223
+ isOpen,
6224
+ onClose: handleClose,
6225
+ position: popupPosition,
6226
+ });
5509
6227
  // Generate time options based on interval - memoized
5510
6228
  const timeOptions = useMemo(() => {
5511
6229
  const options = [];
@@ -5598,20 +6316,6 @@ function CwDateTimePickerCompact({ value, onChange, minDateTime, maxDateTime, di
5598
6316
  }
5599
6317
  }
5600
6318
  }, [value]);
5601
- // Close popup when clicking outside
5602
- useEffect(() => {
5603
- const handleClickOutside = (event) => {
5604
- if (containerRef.current && !containerRef.current.contains(event.target)) {
5605
- setIsOpen(false);
5606
- }
5607
- };
5608
- if (isOpen) {
5609
- document.addEventListener("mousedown", handleClickOutside);
5610
- }
5611
- return () => {
5612
- document.removeEventListener("mousedown", handleClickOutside);
5613
- };
5614
- }, [isOpen]);
5615
6319
  // Scroll to selected time when opening
5616
6320
  useEffect(() => {
5617
6321
  if (isOpen && selectedTime && timeListRef.current) {
@@ -5660,1231 +6364,88 @@ function CwDateTimePickerCompact({ value, onChange, minDateTime, maxDateTime, di
5660
6364
  setSelectedDate(undefined);
5661
6365
  setSelectedTime("");
5662
6366
  }, [onChange]);
5663
- const handleInputClick = useCallback(() => {
5664
- if (!disabled) {
5665
- setIsOpen(true);
5666
- }
5667
- }, [disabled]);
5668
- const handleInputChange = useCallback((e) => {
5669
- const newValue = e.target.value;
5670
- setInputValue(newValue);
5671
- // Try to parse the full datetime string: dd.MM.yyyy HH:mm
5672
- if (newValue.length >= 16) {
5673
- validateAndSetDateTime(newValue);
5674
- }
5675
- else if (newValue === "") {
5676
- onChange(undefined);
5677
- setSelectedDate(undefined);
5678
- setSelectedTime("");
5679
- }
5680
- }, [validateAndSetDateTime, onChange]);
5681
- const handleInputBlur = useCallback(() => {
5682
- // Try to parse if there's text
5683
- if (inputValue && inputValue.trim() !== "") {
5684
- const parsed = parseDateTime(inputValue);
5685
- if (parsed && !isNaN(parsed.getTime())) {
5686
- const isValid = (!minDateTime || parsed >= minDateTime) &&
5687
- (!maxDateTime || parsed <= maxDateTime);
5688
- if (isValid) {
5689
- onChange(parsed);
5690
- const dateStr = format(parsed, "dd.MM.yyyy", { locale: enGB });
5691
- const timeStr = format(parsed, "HH:mm", { locale: enGB });
5692
- setInputValue(`${dateStr} ${timeStr}`);
5693
- setSelectedDate(parsed);
5694
- setSelectedTime(timeStr);
5695
- return;
5696
- }
5697
- }
5698
- }
5699
- // Sync with current value
5700
- if (value) {
5701
- const dateStr = format(value, "dd.MM.yyyy", { locale: enGB });
5702
- const timeStr = format(value, "HH:mm", { locale: enGB });
5703
- setInputValue(`${dateStr} ${timeStr}`);
5704
- }
5705
- else {
5706
- setInputValue("");
5707
- }
5708
- }, [inputValue, parseDateTime, minDateTime, maxDateTime, onChange, value]);
5709
- const handleInputKeyDown = useCallback((e) => {
5710
- if (e.key === "Enter") {
5711
- e.preventDefault();
5712
- inputRef.current?.blur();
5713
- setIsOpen(false);
5714
- }
5715
- else if (e.key === "Escape") {
5716
- setIsOpen(false);
5717
- inputRef.current?.blur();
5718
- }
5719
- }, []);
5720
- const handleNowClick = useCallback(() => {
5721
- const now = new Date();
5722
- // Check if now is within allowed range
5723
- const isNowValid = (!minDateTime || now >= minDateTime) &&
5724
- (!maxDateTime || now <= maxDateTime);
5725
- if (isNowValid) {
5726
- onChange(now);
5727
- setIsOpen(false);
5728
- }
5729
- }, [minDateTime, maxDateTime, onChange]);
5730
- // Memoize disabled days
5731
- const disabledDays = useMemo(() => [
5732
- ...(disabledDates || []),
5733
- ...(minDateTime ? [{ before: minDateTime }] : []),
5734
- ...(maxDateTime ? [{ after: maxDateTime }] : []),
5735
- ...(disabledMatcher ? [disabledMatcher] : []),
5736
- ], [disabledDates, minDateTime, maxDateTime, disabledMatcher]);
5737
- return (jsx("div", { ref: containerRef, className: `cw-datetimepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required, maxLength: 16, style: { width: "24ch" } }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClear, tabIndex: -1, "aria-label": "Clear datetime" })) : (jsx(CwIcon, { iconId: "calendar-time" })) }), isOpen && (jsxs("div", { className: `${styles$4.pickerPopup} ${compactStyles.compactPopup}`, "data-position": popupPosition, children: [jsxs("div", { className: compactStyles.calendarWrapper, children: [jsx(DayPicker, { mode: "single", selected: selectedDate, onSelect: handleDaySelect, defaultMonth: selectedDate, disabled: disabledDays, numberOfMonths: numberOfMonths, modifiers: {
5738
- today: new Date(),
5739
- }, modifiersClassNames: {
5740
- today: "rdp-day-today",
5741
- } }), showTodayButton && (jsx("footer", { className: "cw-flex-row cw-align-center-center", children: jsx(CwButton, { type: "button", variant: "outline", icon: "check-big", onClick: handleNowClick, text: "Now" }) }))] }), jsxs("div", { className: compactStyles.timeWrapper, children: [jsxs("header", { children: [jsx(CwIcon, { iconId: "clock", size: "medium" }), jsx("span", { children: "Time" })] }), jsx("div", { ref: timeListRef, className: `${timeStyles.timePickerList} ${compactStyles.compactTimeList}`, children: timeOptions.map((time) => {
5742
- const isSelected = time === selectedTime;
5743
- return (jsx("button", { type: "button", className: isSelected ? timeStyles.selected : "", onClick: () => handleTimeSelect(time), children: time }, time));
5744
- }) })] })] }))] })] }) }));
5745
- }
5746
-
5747
- const ResourcesTitleList$1 = ({ resources, canBePinned, includesPinned, onCrewPinning, onClickResourceContextMenu, ResourceTitleComponent }) => {
5748
- return (jsx("td", { className: "resourceArea", style: { width: "100px" }, children: resources.map((r, _i) => (jsxs("div", { className: "resource CwelltFunctionDescription", style: { height: r.maxTop }, children: [(canBePinned || includesPinned) && (jsx(PinButton$1, { canBePinned: canBePinned, resource: r, onCrewPinning: onCrewPinning })), jsx(ResourceTitleComponent, { resource: r, handleOnClickResourceContextMenu: (e) => {
5749
- if (onClickResourceContextMenu) {
5750
- onClickResourceContextMenu(e, r);
5751
- }
5752
- } })] }, r.id.toString()))) }));
5753
- };
5754
- const PinButton$1 = ({ canBePinned, resource, onCrewPinning }) => {
5755
- const buttonProps = canBePinned
5756
- ? {
5757
- id: "cbl_pinL",
5758
- onClick: () => onCrewPinning(resource, ""),
5759
- children: jsx("span", { className: "cbl_pin", style: { visibility: "visible" } })
5760
- }
5761
- : {
5762
- id: "cbl_pinLess45deg",
5763
- onClick: () => onCrewPinning(resource, "remove"),
5764
- children: jsx("span", { className: "cbl_pinLess45deg cbl_pin", style: { color: "black", visibility: "visible" } })
5765
- };
5766
- return jsx("button", { className: "cw-button-icon cw-icon-pin", ...buttonProps });
5767
- };
5768
-
5769
- const doubleClickOnResource$1 = (props, resource) => {
5770
- if (props.scheduler_handleDblClickOnResourceInScheduler) {
5771
- props.scheduler_handleDblClickOnResourceInScheduler(resource);
5772
- }
5773
- };
5774
-
5775
- let CblDragAndDrop$2 = class CblDragAndDrop {
5776
- fromId;
5777
- toId;
5778
- data;
5779
- droppedOnDate;
5780
- resizeFromStart;
5781
- resizeFromEnd;
5782
- isCtrlKey;
5783
- constructor(fromId, toId, data, droppedOnDate = null, resizeFromStart = null, resizeFromEnd = null, isCtrlKey = null) {
5784
- this.fromId = fromId;
5785
- this.toId = toId;
5786
- this.data = data;
5787
- this.droppedOnDate = droppedOnDate;
5788
- this.resizeFromStart = resizeFromStart;
5789
- this.resizeFromEnd = resizeFromEnd;
5790
- this.isCtrlKey = isCtrlKey;
5791
- }
5792
- };
5793
-
5794
- const BIRTHDATE$1 = 15;
5795
- const NOT_WORKING$1 = 16;
5796
- const REST_TIME$1 = 10;
5797
- const MAX_FLIGHT_DUTY_PERIOD$1 = 11;
5798
- const DUTY_REGULATION$1 = 20;
5799
- const unHandleableEvents$1 = [REST_TIME$1, MAX_FLIGHT_DUTY_PERIOD$1, NOT_WORKING$1, DUTY_REGULATION$1];
5800
- const getEventStyle$1 = (event, reslTime) => {
5801
- const baseStyle = {
5802
- left: event.leftPx,
5803
- width: event.width,
5804
- top: event.top,
5805
- overflow: "hidden",
5806
- zIndex: event.isFullHeight ? 4 : 5,
5807
- };
5808
- if (event.data.eventType === BIRTHDATE$1) {
5809
- return {
5810
- ...baseStyle,
5811
- height: event.isFullHeight ? "100%" : "auto",
5812
- marginTop: event.isFullHeight ? -1 * event.top : 0,
5813
- pointerEvents: "none",
5814
- borderBottom: "solid 1px rgba(0, 0, 0, 0.4)",
5815
- backgroundColor: event.data.category.color || "orange",
5816
- display: "flex",
5817
- opacity: 0.3,
5818
- alignItems: "flex-end",
5819
- };
5820
- }
5821
- if ([REST_TIME$1, MAX_FLIGHT_DUTY_PERIOD$1, DUTY_REGULATION$1].includes(event.data.eventType)) {
5822
- return {
5823
- ...baseStyle,
5824
- zIndex: event.isFullHeight ? 4 : 6,
5825
- marginTop: event.isFullHeight ? -1 * event.top : 0,
5826
- borderRadius: "0px",
5827
- backgroundColor: event.data.category.color || "grey",
5828
- opacity: 0.3,
5829
- borderBottom: event.data.eventType === DUTY_REGULATION$1 ? "solid 1px rgba(0, 0, 0, 0.4)" : "",
5830
- };
5831
- }
5832
- return {
5833
- ...baseStyle,
5834
- height: event.isFullHeight ? "100%" : "auto",
5835
- marginTop: event.isFullHeight ? -1 * event.top : 0,
5836
- borderRadius: reslTime <= 0.99 ? "3px" : "5px",
5837
- minWidth: reslTime <= 1.5 ? "5px" : "",
5838
- maxWidth: reslTime <= 1.5 ? "25px" : "",
5839
- };
5840
- };
5841
- const EventRender$1 = ({ event, schedulerProps }) => {
5842
- const dateStart = new Date(event.data.start);
5843
- const dateEnd = new Date(event.data.end);
5844
- const reslTime = (dateEnd.getTime() - dateStart.getTime()) / 3600000;
5845
- const eventStyle = getEventStyle$1(event, reslTime);
5846
- const onClickEvent = (e) => {
5847
- if (!unHandleableEvents$1.includes(event.data.eventType)) {
5848
- e.stopPropagation();
5849
- const props = schedulerProps;
5850
- props.scheduler_handleCblEventClick.call(props.parent, event, schedulerProps.id);
5851
- }
5852
- };
5853
- const onRightClickEvent = (e) => {
5854
- if (!unHandleableEvents$1.includes(event.data.eventType)) {
5855
- e.stopPropagation();
5856
- const props = schedulerProps;
5857
- if (props.scheduler_handleCblEventClickRight) {
5858
- props.scheduler_handleCblEventClickRight.call(props.parent, event, schedulerProps.id);
5859
- }
5860
- }
5861
- };
5862
- const safeHandleDragStart = (e, isLeft, isRight) => {
5863
- if (!unHandleableEvents$1.includes(event.data.eventType)) {
5864
- handleDragStart(e, isLeft, isRight);
5865
- }
5866
- };
5867
- const handleDragStart = (e, isResizeFromStart, isResizeFromEnd) => {
5868
- if (!unHandleableEvents$1.includes(event.data.eventType)) {
5869
- [].forEach.call(document.querySelectorAll(".ant-tooltip"), function (el) {
5870
- el.style.visibility = "hidden";
5871
- });
5872
- // We don't know in which case is necessary
5873
- if (e.target !== e.currentTarget) {
5874
- // e.preventDefault();
5875
- return;
5876
- }
5877
- const isResize = isResizeFromStart || isResizeFromEnd;
5878
- const isAllowed = !event.isReadOnly && (isResize ? event.isResizable : event.isDraggable);
5879
- if (!isAllowed) {
5880
- e.preventDefault();
5881
- return;
5882
- }
5883
- const cblDragNDrop = new CblDragAndDrop$2(schedulerProps.id, null, [event], null, isResizeFromStart, isResizeFromEnd);
5884
- if (!isResize) {
5885
- e.dataTransfer.dropEffect = e.ctrlKey ? "copy" : "link";
5886
- }
5887
- e.dataTransfer.setData("data", JSON.stringify(cblDragNDrop));
5888
- }
5889
- };
5890
- const handleDoubleClick = (e) => {
5891
- if (!unHandleableEvents$1.includes(event.data.eventType)) {
5892
- e.preventDefault();
5893
- e.stopPropagation();
5894
- const props = schedulerProps;
5895
- props.scheduler_handleCblEventDoubleClick.call(props.parent, event, schedulerProps.id);
5896
- }
5897
- };
5898
- const onClickContextMenu = (e) => {
5899
- if (!unHandleableEvents$1.includes(event.data.eventType)) {
5900
- const props = schedulerProps;
5901
- if (props.scheduler_handleOnClickEventContextMenu) {
5902
- props.scheduler_handleOnClickEventContextMenu(e, event);
5903
- }
5904
- }
5905
- };
5906
- const renderBirthdayEvent = () => (jsxs("div", { className: `fc-timeline-event cwellt_timeline_event cwellt_event_bday ${event.selected ? "cblEventSelected" : ""}`, style: eventStyle, children: [jsx("span", { className: "cwi-icons cwi-birthday", style: { visibility: "visible" } }), event.data.subject && jsx("span", { style: { lineHeight: "1em" }, children: event.data.subject })] }, event.id));
5907
- const renderRegularEvent = () => (jsxs("div", { draggable: ![10, 11, 16, 20, 21].includes(event.data.eventType), className: "fc-timeline-event cwellt_timeline_event cwellt_timeline_event_opstool " +
5908
- (event.selected === true ? "cblEventSelected " : "") +
5909
- (event.data.eventType === REST_TIME$1 ||
5910
- event.data.eventType === MAX_FLIGHT_DUTY_PERIOD$1 ||
5911
- event.data.eventType === DUTY_REGULATION$1
5912
- ? " cwellt_event_bhnd_appt "
5913
- : " "), style: eventStyle, onClick: onClickEvent, onContextMenu: onRightClickEvent, onDragStart: (e) => safeHandleDragStart(e, false, false), onDoubleClick: handleDoubleClick, children: [schedulerProps.scheduler_handleCblEventResize &&
5914
- !event.isReadOnly &&
5915
- !unHandleableEvents$1.includes(event.data.eventType) && (jsx("span", { draggable: true, onDragStart: (e) => handleDragStart(e, true, false), style: {
5916
- position: "absolute",
5917
- cursor: "e-resize",
5918
- zIndex: 10,
5919
- left: "0",
5920
- border: "solid 1px rgba(46,49,49,0.5)",
5921
- }, children: "\u200B" })), jsx(schedulerProps.cblEventComp, { cblEvent: event, handleOnClickEventContextMenu: onClickContextMenu }, event.id), schedulerProps.scheduler_handleCblEventResize &&
5922
- !event.isReadOnly &&
5923
- !unHandleableEvents$1.includes(event.data.eventType) && (jsx("span", { draggable: true, onDragStart: (e) => handleDragStart(e, false, true), style: {
5924
- position: "absolute",
5925
- right: "0",
5926
- cursor: "e-resize",
5927
- zIndex: 10,
5928
- border: "solid 1px rgba(46,49,49,0.5)",
5929
- marginTop: "-25px",
5930
- }, children: "\u200B" }))] }, event.id));
5931
- const render = event.data.eventType === BIRTHDATE$1 ? renderBirthdayEvent() : renderRegularEvent();
5932
- return render;
5933
- };
5934
-
5935
- const addMinutesToDateFromPx$1 = (originalDate, leftPx, minutesPerPx) => {
5936
- const minutes = leftPx / minutesPerPx;
5937
- const datePlusMinutes = new Date(originalDate.getTime() + minutes * 60000);
5938
- return datePlusMinutes;
5939
- };
5940
-
5941
- const onDropEventToResource$1 = (props, cblDragNDrop, resource) => {
5942
- props.scheduler_handleOnDropCblEventsOnResource.call(props.parent, cblDragNDrop, resource);
5943
- };
5944
-
5945
- const handleOnResize = (props, cblDragNDrop) => {
5946
- props.scheduler_handleCblEventResize?.call(props.parent, cblDragNDrop);
5947
- };
5948
-
5949
- const isAllowedToMove$1 = (data, resData, cblDragNDrop) => {
5950
- if (data?.eventType !== 1) {
5951
- return true;
5952
- }
5953
- const allowedMoves = [
5954
- { from: "acftsScheduler", to: "flightsPairingsScheduler" },
5955
- { from: "flightsScheduler", to: "crewAssignmentsScheduler" },
5956
- { from: "opstoolScheduler", to: "opstoolScheduler" },
5957
- { from: "opstoolScheduler", to: "opstoolSchedulerVirtual" },
5958
- { from: "opstoolSchedulerVirtual", to: "opstoolScheduler" },
5959
- { from: "opstoolSchedulerVirtual", to: "opstoolSchedulerVirtual" },
5960
- { from: "vacationsScheduler", to: "vacationsScheduler" }
5961
- ];
5962
- const crewControllAllowedMove = allowedMoves.some(move => move.from === cblDragNDrop.fromId && move.to === cblDragNDrop.toId);
5963
- if (crewControllAllowedMove) {
5964
- return true;
5965
- }
5966
- return data.Crew !== resData.Crewmember_Id;
5967
- };
5968
-
5969
- const OnDrop$1 = ({ e, resource, id, contentArea, state, schedulerProps }) => {
5970
- e.dataTransfer.dropEffect = "move";
5971
- const cblDragNDrop = JSON.parse(e.dataTransfer.getData("data"));
5972
- if (!cblDragNDrop.data || !cblDragNDrop.data[0]) {
5973
- return;
5974
- }
5975
- cblDragNDrop.toId = id;
5976
- const obj = cblDragNDrop.data[0];
5977
- cblDragNDrop.isCtrlKey = e.ctrlKey;
5978
- const isResizeEvent = cblDragNDrop.resizeFromStart === true || cblDragNDrop.resizeFromEnd === true;
5979
- if (isResizeEvent) {
5980
- // Resize
5981
- if (obj.data === undefined || obj.data.eventType === 1) {
5982
- return;
5983
- }
5984
- const _eventX = e.clientX;
5985
- const _caLeft = contentArea?.getBoundingClientRect()?.left ?? 0;
5986
- const leftPos = _eventX - _caLeft;
5987
- const datetime = addMinutesToDateFromPx$1(state.startDate, leftPos, state.minutePx);
5988
- cblDragNDrop.droppedOnDate = datetime;
5989
- handleOnResize(schedulerProps, cblDragNDrop);
5990
- return;
5991
- }
5992
- // Drag & Drop
5993
- if (!isAllowedToMove$1(obj.data, resource.data, cblDragNDrop)) {
5994
- return;
5995
- }
5996
- const d = e.clientX - (contentArea?.getBoundingClientRect()?.left ?? 0);
5997
- const date = new Date(state.startDate.getTime() + (d / state.minutePx) * 60000);
5998
- cblDragNDrop.droppedOnDate = date;
5999
- onDropEventToResource$1(schedulerProps, cblDragNDrop, resource);
6000
- };
6001
-
6002
- const onDragOver$1 = (e) => {
6003
- if (e.ctrlKey === true) {
6004
- e.dataTransfer.dropEffect = "copy";
6005
- }
6006
- else {
6007
- e.dataTransfer.dropEffect = "link";
6008
- }
6009
- e.preventDefault();
6010
- };
6011
-
6012
- const arePropsEqual$1 = (prevProps, nextProps) => {
6013
- return prevProps.res.events === nextProps.res.events && prevProps.isInViewport === nextProps.isInViewport;
6014
- };
6015
- const ResourceRender$1 = memo(({ res, schedulerProps, contentArea, state }) => {
6016
- return (jsx("div", { style: {
6017
- backgroundColor: "#F9F8F8",
6018
- height: res.maxTop,
6019
- width: "100%",
6020
- position: "relative",
6021
- borderBottom: "1px solid rgb(255,255,255)",
6022
- }, onDragOver: (e) => onDragOver$1(e), onDrop: (e) => {
6023
- OnDrop$1({
6024
- e,
6025
- resource: res,
6026
- id: schedulerProps.id,
6027
- contentArea,
6028
- state,
6029
- schedulerProps,
6030
- });
6031
- }, className: "cwellt_divRow_schContent", children: res.events.map((evnt) => (jsx(EventRender$1, { event: evnt, schedulerProps: schedulerProps }, evnt.id))) }, res.id));
6032
- }, arePropsEqual$1);
6033
-
6034
- const ResourceListRender$1 = ({ resources, schedulerProps, state, contentArea, onClickContextMenu, crewAssignmentSchedulerContextMenu, }) => {
6035
- return (jsx(Fragment$1, { children: resources.map((r, _i) => (jsx(Dropdown, { placement: "topLeft", dropdownRender: () => {
6036
- return (jsx(Menu, { style: { pointerEvents: "auto" }, onClick: (e) => {
6037
- onClickContextMenu(e, r);
6038
- }, children: crewAssignmentSchedulerContextMenu?.map((m) => (jsxs(Menu.Item, { children: [jsx("span", { className: m.icon, style: { color: m.color } }), jsx("span", { className: "cwellt_contextMenu", children: m.text })] }, m.key))) }));
6039
- }, trigger: ["contextMenu"], children: jsx("span", { onDoubleClick: () => doubleClickOnResource$1(schedulerProps, r), id: schedulerProps.id + "_" + r.id, children: jsx(ResourceRender$1, { res: r, schedulerProps: schedulerProps, contentArea: contentArea, state: state, isInViewport: r.isInViewport }, r.id) }) }, r.id))) }));
6040
- };
6041
-
6042
- const TimeLine$2 = ({ id, toolTipTitle, marginLeft, color = "rgba(255,0,0,.6)", pixels = 2, height = "100%", zIndex = 1, }) => {
6043
- return (jsx(Tooltip, { title: toolTipTitle, children: jsx("div", { id: id, style: {
6044
- borderLeft: `${pixels}px solid ${color}`,
6045
- marginLeft: marginLeft,
6046
- width: "0px",
6047
- height: height,
6048
- position: "absolute",
6049
- zIndex: zIndex,
6050
- } }) }));
6051
- };
6052
-
6053
- const SchedulerContentArea$1 = ({ now, showTimeline, timeLineLeftPx, timeSeparatorLeftPx, resources, scheduler, contextMenuContents, onEmptyClick, setContentArea, onClickContextMenu, }) => {
6054
- return (jsxs("td", { className: "contentArea", style: { width: "100%", overflow: "hidden", position: "relative" }, ref: (reference) => {
6055
- if (reference) {
6056
- setContentArea(reference);
6057
- }
6058
- }, children: [showTimeline && (jsx(TimeLine$2, { id: scheduler.props.id + "_timeline", marginLeft: timeLineLeftPx, zIndex: 8, toolTipTitle: moment(now).format("HH:mm") })), timeSeparatorLeftPx.map((pixels) => {
6059
- return jsx(TimeLine$2, { marginLeft: pixels, color: "rgba(255,255,255,0.7)" });
6060
- }), jsx("span", { onClick: () => {
6061
- if (onEmptyClick) {
6062
- onEmptyClick(scheduler.props.id);
6063
- }
6064
- }, children: jsx(ResourceListRender$1, { resources: resources, state: scheduler.state, schedulerProps: scheduler.props, contentArea: scheduler.contentArea, onClickContextMenu: onClickContextMenu, crewAssignmentSchedulerContextMenu: contextMenuContents }) })] }));
6065
- };
6066
-
6067
- const daysBetweenTwoDates$1 = (date1, date2) => {
6068
- const diff = Math.abs(date1.getTime() - date2.getTime());
6069
- let diffDays = 0;
6070
- const startOffset = Math.abs(date1.getTimezoneOffset());
6071
- const endOffset = Math.abs(date2.getTimezoneOffset());
6072
- // Summer: +1 -> +2, true
6073
- // Winter: +2 -> -1, false
6074
- if (startOffset > endOffset) {
6075
- diffDays = Math.floor(diff / (1000 * 3600 * 24));
6076
- }
6077
- else {
6078
- diffDays = Math.ceil(diff / (1000 * 3600 * 24));
6079
- }
6080
- return diffDays;
6081
- };
6082
-
6083
- const calculateDivisionType$1 = (start, end) => {
6084
- const diffDays = daysBetweenTwoDates$1(start, end);
6085
- if (diffDays <= 15) {
6086
- return "d";
6087
- }
6088
- else if (diffDays <= 30) {
6089
- return "w";
6090
- }
6091
- else {
6092
- return "m";
6093
- }
6094
- };
6095
-
6096
- const getMonthHeaderData$1 = (dates, maxWidth) => {
6097
- if (dates.length === 0)
6098
- return [];
6099
- const dayWidth = maxWidth / dates.length;
6100
- const ranges = getMonthRanges$1(dates);
6101
- return ranges.map((range) => {
6102
- return {
6103
- monthFormatted: range.start.getMonth() + 1 + "." + range.start.getFullYear(),
6104
- width: dayWidth * range.daysLong,
6105
- };
6106
- });
6107
- };
6108
- const getMonthRanges$1 = (dates) => {
6109
- const firstDay = dates[0];
6110
- const lastDay = dates[dates.length - 1];
6111
- let currentDate = new Date(firstDay);
6112
- const ranges = [];
6113
- while (currentDate <= lastDay) {
6114
- const rangeStart = new Date(currentDate);
6115
- let rangeEnd = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
6116
- if (rangeEnd >= lastDay) {
6117
- rangeEnd = lastDay;
6118
- }
6119
- ranges.push({
6120
- start: rangeStart,
6121
- daysLong: getDaysBetweenDates$1(rangeStart, rangeEnd),
6122
- });
6123
- currentDate = new Date(rangeEnd.getFullYear(), rangeEnd.getMonth() + 1, 1);
6124
- }
6125
- return ranges;
6126
- };
6127
- const getDaysBetweenDates$1 = (startDate, endDate) => {
6128
- const timeDifference = endDate.getTime() - startDate.getTime();
6129
- return Math.floor(timeDifference / (1000 * 60 * 60 * 24)) + 1;
6130
- };
6131
-
6132
- const getWeekHeaderDataFromWeekRange$1 = (weekRange, maxWidth, dateFormatter) => weekRange.map(week => {
6133
- const numberOfDaysInScheduler = weekRange
6134
- .flatMap(element => {
6135
- return element.days;
6136
- })
6137
- .reduce((el1, el2) => {
6138
- return el1 + el2;
6139
- });
6140
- return {
6141
- formattedString: getStringForWeekRange$1(week, dateFormatter),
6142
- width: getWidthForWeekRange$1(maxWidth, week.days, numberOfDaysInScheduler)
6143
- };
6144
- });
6145
- const getStringForWeekRange$1 = (weekRange, dateFormatter) => weekRange.days == 1
6146
- ? dateFormatter(weekRange.start)
6147
- : `${dateFormatter(weekRange.start)} - ${dateFormatter(weekRange.end)}`;
6148
- const getWidthForWeekRange$1 = (maxWidth, weekDays, monthDays) => {
6149
- const dayWidth = maxWidth / monthDays;
6150
- return dayWidth * weekDays;
6151
- };
6152
-
6153
- // stringRange: `${formatter(date)} - ${formatter(end)}`,
6154
- const listOfDatesToWeekRangeList$1 = (dates) => {
6155
- if (dates.length === 0) {
6156
- return [];
6157
- }
6158
- const datesToReturn = [];
6159
- dates.forEach((date, index) => {
6160
- const dayOfWeek = date.getDay();
6161
- const isFirstDay = index === 0;
6162
- const isLastDay = index === dates.length - 1;
6163
- const isSunday = dayOfWeek === 0;
6164
- const isMonday = dayOfWeek === 1;
6165
- if (isFirstDay && !isSunday) {
6166
- datesToReturn.push(createWeekRange$1(date, 8 - dayOfWeek));
6167
- return;
6168
- }
6169
- if (isLastDay && !isSunday) {
6170
- if (!isMonday) {
6171
- datesToReturn.pop();
6172
- }
6173
- const firstOfWeek = getFirstDayOfWeek$1(date);
6174
- datesToReturn.push(createWeekRange$1(firstOfWeek, dayOfWeek));
6175
- return;
6176
- }
6177
- if (isMonday) {
6178
- datesToReturn.push(createWeekRange$1(date, 7));
6179
- return;
6180
- }
6181
- // this is because sunday is 0
6182
- if (isFirstDay && isSunday) {
6183
- datesToReturn.push(createWeekRange$1(date, 1));
6184
- return;
6185
- }
6186
- });
6187
- return datesToReturn;
6188
- };
6189
- const createWeekRange$1 = (start, days) => {
6190
- const end = new Date(start);
6191
- end.setDate(end.getDate() + days - 1);
6192
- return {
6193
- days,
6194
- start,
6195
- end,
6196
- isShortWeek: days < 7
6197
- };
6198
- };
6199
- const getFirstDayOfWeek$1 = (date) => {
6200
- const currentDate = new Date(date);
6201
- const dayOfWeek = currentDate.getDay();
6202
- // dayOfWeek 0 == (Sunday)
6203
- const diffToMonday = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
6204
- // Set the date to the first day of the week
6205
- currentDate.setDate(currentDate.getDate() - diffToMonday);
6206
- return currentDate;
6207
- };
6208
-
6209
- const DayHeader$1 = ({ index, text, width, headerType }) => {
6210
- const isFirstDay = index == 0;
6211
- return (jsx("td", { style: {
6212
- display: "inline-block",
6213
- fontSize: "10px",
6214
- width: width,
6215
- maxWidth: width,
6216
- }, id: headerType + index, children: jsx("span", { className: isFirstDay ? "cwelltFirstDate_desc" : "", children: text }) }));
6217
- };
6218
-
6219
- const MonthHeader$1 = ({ index, text, width, headerType }) => {
6220
- return (jsx("td", { style: {
6221
- display: "inline-block",
6222
- fontSize: "10px",
6223
- width: width,
6224
- maxWidth: width,
6225
- }, id: headerType + index, children: jsx("span", { children: text }) }));
6226
- };
6227
-
6228
- const WeekHeader$1 = ({ index, text, width, headerType }) => {
6229
- const isFirstDay = index == 0;
6230
- return (jsx("td", { style: {
6231
- display: "inline-block",
6232
- fontSize: "10px",
6233
- width: width,
6234
- maxWidth: width,
6235
- }, id: headerType + index, children: jsx("span", { className: isFirstDay ? "cwelltFirstDate_desc" : "", style: { whiteSpace: "nowrap" }, children: text }) }));
6236
- };
6237
-
6238
- const DaysHeader$1 = ({ days, divisionType, maxWidth, headerType }) => {
6239
- let headerToDraw = [];
6240
- const filteredDays = days.filter((date) => {
6241
- return date.getHours() === 0;
6242
- });
6243
- const dateFormatter = (date) => {
6244
- return `${date.getDate()}.${date.getMonth() + 1}.${date.getFullYear()}`;
6245
- };
6246
- switch (divisionType) {
6247
- case "d":
6248
- {
6249
- headerToDraw = filteredDays.map((date, index) => {
6250
- return (jsx(DayHeader$1, { text: dateFormatter(date), index: index, width: maxWidth / filteredDays.length, headerType: headerType }, index));
6251
- });
6252
- }
6253
- break;
6254
- case "w":
6255
- {
6256
- const weekRanges = listOfDatesToWeekRangeList$1(filteredDays);
6257
- headerToDraw = getWeekHeaderDataFromWeekRange$1(weekRanges, maxWidth, dateFormatter).map((week, index) => {
6258
- return (jsx(WeekHeader$1, { index: index, text: week.formattedString, width: week.width, headerType: headerType }, index));
6259
- });
6260
- }
6261
- break;
6262
- case "m":
6263
- {
6264
- const monthData = getMonthHeaderData$1(filteredDays, maxWidth);
6265
- headerToDraw = monthData.map(({ monthFormatted, width }, index) => (jsx(MonthHeader$1, { index: index, text: monthFormatted, width: width, headerType: headerType }, index)));
6266
- }
6267
- break;
6268
- }
6269
- return jsx("tr", { className: "cwelltSchRowDate", children: headerToDraw });
6270
- };
6271
-
6272
- const getFormattedTimeForHeader$1 = (calculatedDivType, calculatedDivision, timeHeader) => {
6273
- let showDate = "";
6274
- switch (calculatedDivType) {
6275
- case "d":
6276
- switch (calculatedDivision) {
6277
- case 8:
6278
- showDate =
6279
- timeHeader.getHours() === 0 ||
6280
- timeHeader.getHours() === 3 ||
6281
- timeHeader.getHours() === 6 ||
6282
- timeHeader.getHours() === 9 ||
6283
- timeHeader.getHours() === 12 ||
6284
- timeHeader.getHours() === 15 ||
6285
- timeHeader.getHours() === 18 ||
6286
- timeHeader.getHours() === 21
6287
- ? moment(timeHeader).format("HH:mm")
6288
- : "";
6289
- break;
6290
- case 3:
6291
- showDate =
6292
- timeHeader.getHours() === 0 || timeHeader.getHours() === 8 || timeHeader.getHours() === 16
6293
- ? moment(timeHeader).format("HH:mm")
6294
- : "";
6295
- break;
6296
- case 2:
6297
- showDate =
6298
- timeHeader.getHours() === 0 || timeHeader.getHours() === 12 ? moment(timeHeader).format("HH:mm") : "";
6299
- break;
6300
- }
6301
- break;
6302
- case "m":
6303
- showDate = timeHeader.getHours() === 0 ? timeHeader.getDate().toString() : "";
6304
- break;
6305
- case "w":
6306
- showDate = timeHeader.getHours() === 0 ? timeHeader.getDate().toString() : "";
6307
- break;
6308
- }
6309
- return {
6310
- text: showDate,
6311
- isWeekend: timeHeader.getDay() === 6 || timeHeader.getDay() === 0,
6312
- };
6313
- };
6314
-
6315
- const calculateDivisions$1 = (start, end) => {
6316
- const diffDays = daysBetweenTwoDates$1(start, end);
6317
- if (diffDays <= 3) {
6318
- return 8;
6319
- }
6320
- else if (diffDays < 8) {
6321
- return 3;
6322
- }
6323
- else if (diffDays <= 15) {
6324
- return 2;
6325
- }
6326
- else {
6327
- return 1;
6328
- }
6329
- };
6330
-
6331
- const TimeHeader$1 = ({ isWeekend, index, text, width, header }) => {
6332
- if (text === "") {
6333
- return;
6334
- }
6335
- const commonStyles = {
6336
- display: "flex",
6337
- alignItems: "center",
6338
- justifyContent: "left",
6339
- fontSize: "10px",
6340
- width: width,
6341
- maxWidth: width,
6342
- height: "2rem",
6343
- borderLeft: "1px solid white",
6344
- background: isWeekend ? "#cbc9c9" : "",
6345
- color: "#000000d9",
6346
- fontWeight: 700,
6347
- };
6348
- return (jsx("td", { style: commonStyles, id: `${header}Time${index}`, children: jsx("span", { style: { paddingLeft: "8px" }, children: text }) }, `t${index}`));
6349
- };
6350
-
6351
- const TimeHeaderRow$1 = ({ timeHeaders, startDate, endDate, maxWidth, header }) => {
6352
- const calculatedDivision = calculateDivisions$1(startDate, endDate);
6353
- const calculatedDivType = calculateDivisionType$1(startDate, endDate);
6354
- const formattedHeaders = timeHeaders.map((th) => {
6355
- return getFormattedTimeForHeader$1(calculatedDivType, calculatedDivision, th);
6356
- });
6357
- const filteredHeaders = formattedHeaders.filter((element) => element.text !== "");
6358
- return (jsx("tr", { className: "cwelltSchRowTime", style: { height: "30px" }, children: filteredHeaders.map(({ text, isWeekend }, index) => {
6359
- return (jsx(TimeHeader$1, { isWeekend: isWeekend, index: index, text: text, width: maxWidth / filteredHeaders.length, header: header }, index));
6360
- }) }));
6361
- };
6362
-
6363
- const SchedulerTimeLine$1 = ({ maxPx, hoursList, startDate, endDate, pxPerHour, headerName, }) => {
6364
- return (jsx("table", { className: "content-area cwelltSchTable", style: { width: maxPx }, children: jsxs("tbody", { style: { width: "100%", borderSpacing: 0 }, className: "content-area cwelltSchTbody", children: [jsx(DaysHeader$1, { days: hoursList, divisionType: calculateDivisionType$1(startDate, endDate), maxWidth: pxPerHour * hoursList.length, headerType: headerName ?? "schedulerDateHeader" }), jsx(TimeHeaderRow$1, { timeHeaders: hoursList, startDate: startDate, endDate: endDate, maxWidth: pxPerHour * hoursList.length, header: headerName ?? "schedulerTimeHeader" })] }) }));
6365
- };
6366
-
6367
- const SchedulerHeader$2 = ({ timelineProps, descriptionColumn }) => {
6368
- const { maxPx, hoursList, startDate, endDate, pxPerHour, headerName } = timelineProps;
6369
- return (jsx("thead", { className: "cwellt_fc_header_scheduler", style: { position: "sticky", zIndex: 9 }, children: jsxs("tr", { className: "cwellt_fc_header_row", children: [jsxs("td", { className: "border", style: {
6370
- position: "sticky",
6371
- top: 0,
6372
- backgroundColor: "white",
6373
- width: "100px",
6374
- }, children: [jsx("div", { style: {
6375
- display: "flex",
6376
- height: "30px",
6377
- alignItems: "center",
6378
- width: "150px",
6379
- }, children: jsx("label", { children: headerName }) }), jsx("div", { style: {
6380
- display: "flex",
6381
- height: "30px",
6382
- alignItems: "center",
6383
- background: "rgba(0, 0, 0, 0.04)",
6384
- }, children: jsx("span", { children: descriptionColumn }) })] }), jsx("td", { style: {
6385
- position: "sticky",
6386
- top: 0,
6387
- zIndex: 6,
6388
- backgroundColor: "white",
6389
- }, children: jsx(SchedulerTimeLine$1, { maxPx: maxPx, hoursList: hoursList, pxPerHour: pxPerHour, startDate: startDate, endDate: endDate, headerName: headerName }) })] }) }));
6390
- };
6391
-
6392
- const daysBetweenTwoDatesIncludingBoth$1 = (date1, date2) => {
6393
- const diff = Math.abs(date1.getTime() - date2.getTime());
6394
- const diffDays = diff / (1000 * 3600 * 24);
6395
- return diffDays;
6396
- };
6397
-
6398
- const getUtcToday$1 = () => {
6399
- const now = new Date();
6400
- const userTimezoneOffset = now.getTimezoneOffset() * 60000;
6401
- const nowUtc = new Date(now.getTime() + userTimezoneOffset);
6402
- return nowUtc;
6403
- };
6404
-
6405
- const filterEvents$1 = (events, start, end, id, resId, module = undefined) => {
6406
- const hasSameResourceId = (event) => event.resourceId === resId;
6407
- const datesCollide = (event) => event.start <= end && event.end >= start;
6408
- let eventsFiltered = events.filter(event => hasSameResourceId(event) && datesCollide(event));
6409
- if (id !== "flightWatchScheduler") {
6410
- eventsFiltered = sortByDate$1(eventsFiltered);
6411
- }
6412
- if (id !== "crewAssignmentsScheduler" && id !== "vacationsScheduler") {
6413
- return eventsFiltered;
6414
- }
6415
- eventsFiltered = setNotFullHeightEventsFirst$1(eventsFiltered);
6416
- if (module === "CrewControl") {
6417
- eventsFiltered = removeDuplicated$1(eventsFiltered, "Crew_Id");
6418
- }
6419
- if (module === "CrewScheduling") {
6420
- eventsFiltered = removeDuplicated$1(eventsFiltered, "AssignmentID");
6421
- }
6422
- if (module === "CrewSchedulingVacations") {
6423
- eventsFiltered = removeDuplicated$1(eventsFiltered, "ID");
6424
- }
6425
- return eventsFiltered;
6426
- };
6427
- const sortByDate$1 = (events) => events.sort((a, b) => +new Date(a.start) - +new Date(b.start));
6428
- const removeDuplicated$1 = (events, key) => {
6429
- return events.filter((obj, index, self) => index === self.findIndex(o => o.data[key] === obj.data[key] && o.data.subject === obj.data.subject));
6430
- };
6431
- const setNotFullHeightEventsFirst$1 = (events) => {
6432
- const notFullHeight = [];
6433
- const isFullHeight = [];
6434
- events.forEach(element => {
6435
- element.isFullHeight ? notFullHeight.push(element) : isFullHeight.push(element);
6436
- });
6437
- return notFullHeight.concat(isFullHeight);
6438
- };
6439
-
6440
- const getLeftPixels$1 = (eventStart, scheduleStart, dayPx) => {
6441
- if (scheduleStart >= eventStart)
6442
- return 0;
6443
- return daysBetweenTwoDatesIncludingBoth$1(scheduleStart, eventStart) * dayPx;
6444
- };
6445
- const getEventWithSize$1 = (event, schedulerStart, dayPx) => {
6446
- const eventStartBeforeScheduleStart = event.start.getTime() < schedulerStart.getTime();
6447
- const lengthOfEvent = daysBetweenTwoDatesIncludingBoth$1(event.start, event.end);
6448
- const daysUntilSchedulerStart = daysBetweenTwoDatesIncludingBoth$1(event.start, schedulerStart);
6449
- const daysLong = eventStartBeforeScheduleStart ? lengthOfEvent - daysUntilSchedulerStart : lengthOfEvent;
6450
- // we want minimum of 8 px
6451
- const eventMinSize = 8;
6452
- const newEvent = {
6453
- ...event,
6454
- leftPx: getLeftPixels$1(event.start, schedulerStart, dayPx),
6455
- width: Math.max(daysLong * dayPx, eventMinSize),
6456
- };
6457
- return newEvent;
6458
- };
6459
-
6460
- const checkIfSlotAvailable$1 = (events, event) => {
6461
- const lastElement = events.length - 1;
6462
- if (events.length == 0)
6463
- return true;
6464
- const collide = events.some(existent => {
6465
- return !(existent.end <= event.start || event.end <= existent.start);
6466
- });
6467
- return !collide || events[lastElement].isFullHeight;
6468
- };
6469
-
6470
- const getEventsOfResource = (res, events, state, id, module, start, end) => {
6471
- let maxTop = 0;
6472
- const tops = [];
6473
- tops[0] = new Array();
6474
- const eventsOrdered = filterEvents$1(events, start ?? state.startDate, end ?? state.endDate, id, res.id, module);
6475
- eventsOrdered.forEach((event, i) => {
6476
- if (i === 0 || event.isFullHeight) {
6477
- event.top = 0;
6478
- tops[0].push(event);
6479
- }
6480
- else {
6481
- let found = false;
6482
- for (let j = 0; j < tops.length && found === false; j++) {
6483
- found = checkIfSlotAvailable$1(tops[j], event);
6484
- if (found === true || event.isFullHeight) {
6485
- event.top = j * state.eventHeight;
6486
- tops[j].push(event);
6487
- }
6488
- }
6489
- if (found === false && !event.isFullHeight) {
6490
- maxTop++;
6491
- tops[maxTop] = new Array();
6492
- event.top = maxTop * state.eventHeight;
6493
- tops[maxTop].push(event);
6494
- }
6495
- else {
6496
- // This is for flightwatch
6497
- if (found === true && event.data.order === 2 && maxTop < 1) {
6498
- maxTop++;
6499
- tops[maxTop] = new Array();
6500
- event.top = maxTop * state.eventHeight;
6501
- tops[maxTop].push(event);
6502
- maxTop--;
6503
- }
6504
- }
6505
- }
6506
- event = getEventWithSize$1(event, start, state.dayPx);
6507
- });
6508
- let OrderedArray = new Array();
6509
- for (let h = 0; h < tops.length; h++) {
6510
- if (tops.length === 0) {
6511
- res.maxTop = state.eventHeight;
6512
- }
6513
- else {
6514
- res.maxTop = tops.length * state.eventHeight;
6515
- }
6516
- OrderedArray = OrderedArray.concat(tops[h]);
6517
- }
6518
- return OrderedArray;
6519
- };
6520
- const getEventsInInnerRows$1 = (res, state, start) => {
6521
- let maxTop = 0;
6522
- const tops = [];
6523
- tops[0] = new Array();
6524
- res.events.forEach((event, i) => {
6525
- if (i === 0 || event.isFullHeight) {
6526
- event.top = 0;
6527
- tops[0].push(event);
6528
- }
6529
- else {
6530
- let found = false;
6531
- for (let j = 0; j < tops.length && found === false; j++) {
6532
- found = checkIfSlotAvailable$1(tops[j], event);
6533
- if (found === true || event.isFullHeight) {
6534
- event.top = j * state.eventHeight;
6535
- tops[j].push(event);
6536
- }
6537
- }
6538
- if (found === false && !event.isFullHeight) {
6539
- maxTop++;
6540
- tops[maxTop] = new Array();
6541
- event.top = maxTop * state.eventHeight;
6542
- tops[maxTop].push(event);
6543
- }
6544
- else {
6545
- // This is for flightwatch
6546
- if (found === true && event.data.order === 2 && maxTop < 1) {
6547
- maxTop++;
6548
- tops[maxTop] = new Array();
6549
- event.top = maxTop * state.eventHeight;
6550
- tops[maxTop].push(event);
6551
- maxTop--;
6552
- }
6553
- }
6554
- }
6555
- event = getEventWithSize$1(event, start, state.dayPx);
6556
- });
6557
- return tops;
6558
- };
6559
-
6560
- const compareStrings$1 = (str1, str2) => {
6561
- if (str1 > str2)
6562
- return 1;
6563
- if (str1 < str2)
6564
- return -1;
6565
- return 0;
6566
- };
6567
-
6568
- const filterResources$1 = (module, resourceName, resources, groupByFunction, endDate, startDate) => {
6569
- if ((module === "CrewControl" || module === "CrewScheduling" || module === "CrewSchedulingVacations") &&
6570
- resourceName === "Employees") {
6571
- resources = resources.filter(c => (c.data.Eintritt === null || (c.data.Eintritt !== null && moment(c.data.Eintritt).toDate() <= endDate)) &&
6572
- (c.data.Austritt === null || (c.data.Austritt !== null && moment(c.data.Austritt).toDate() >= startDate)));
6573
- }
6574
- if (module === "CrewScheduling" && resourceName === "Employees") {
6575
- const sortKey = groupByFunction ? "mainFunction" : "C3_LC";
6576
- resources = resources.sort((a, b) => compareStrings$1(a.data[sortKey], b.data[sortKey]));
6577
- }
6578
- return resources;
6579
- };
6580
-
6581
- const filterAndProcessResources = (props, state) => {
6582
- const events = [...props.events];
6583
- const filteredResources = filterResources$1(props.module, props.resourceName, [...props.resources], props.groupByFunction, props.endDate, props.startDate);
6584
- return filteredResources.map(r => ({
6585
- ...r,
6586
- events: getEventsOfResource(r, events, state, props.id, props.module, props.startDate, props.endDate)
6587
- }));
6588
- };
6589
-
6590
- const heightScheduler$1 = (resources, visibleRows, isPinnerScheduler) => {
6591
- if (resources.length <= 0) {
6592
- return 100;
6593
- }
6594
- const realVisibleRows = visibleRows > resources.length ? resources.length : visibleRows;
6595
- const rowsHeight = resources.slice(0, realVisibleRows).map((row) => {
6596
- return row.maxTop;
6597
- });
6598
- const height = rowsHeight.reduce((sum, row) => {
6599
- return sum + row;
6600
- }, 0);
6601
- const headerHeight = isPinnerScheduler ? 0 : 60;
6602
- return height + headerHeight;
6603
- };
6604
-
6605
- const getTimeHeaders$1 = (startDate, endDate) => {
6606
- const dateArray = new Array();
6607
- const currentDate = new Date(startDate);
6608
- const startOffset = Math.abs(startDate.getTimezoneOffset());
6609
- const endOffset = Math.abs(endDate.getTimezoneOffset());
6610
- // Summer: +1 -> +2, true
6611
- // Winter: +2 -> -1, false
6612
- const offsetSummerWinter = startOffset < endOffset;
6613
- if (offsetSummerWinter === true) {
6614
- while (currentDate < endDate) {
6615
- if (dateArray.length > 0) {
6616
- const lastPosition = dateArray[dateArray.length - 1];
6617
- const differenceHours = currentDate.getHours() - lastPosition.getHours();
6618
- if (differenceHours === 1 || differenceHours < 0) {
6619
- dateArray.push(new Date(currentDate));
6620
- }
6621
- else if (differenceHours > 1) {
6622
- dateArray.push(new Date(currentDate.getHours() - 1));
6623
- dateArray.push(new Date(currentDate));
6624
- }
6625
- }
6626
- else {
6627
- dateArray.push(new Date(currentDate));
6628
- }
6629
- currentDate.setHours(currentDate.getHours() + 1);
6630
- }
6631
- }
6632
- else {
6633
- while (currentDate < endDate) {
6634
- dateArray.push(new Date(currentDate));
6635
- currentDate.setHours(currentDate.getHours() + 1);
6636
- }
6637
- }
6638
- return dateArray;
6639
- };
6640
-
6641
- class CwScheduler2 extends Component {
6642
- contentArea;
6643
- constructor(Props) {
6644
- super(Props);
6645
- this.init(this.props);
6646
- }
6647
- resizeObserver;
6648
- calculateMaxPx = () => {
6649
- const mainElement = document.querySelector(".cw-scheduler-main-wrapper");
6650
- if (!mainElement)
6651
- return window.innerWidth - 402; // sidebar + first column + padding
6652
- const mainRect = mainElement.getBoundingClientRect();
6653
- return Math.floor(mainRect.width - 162); // first column + padding
6654
- };
6655
- init = (props) => {
6656
- const maxPx = this.calculateMaxPx();
6657
- const timeHeaders = getTimeHeaders$1(props.startDate, props.endDate);
6658
- const dayPx = maxPx / Math.floor(daysBetweenTwoDates$1(props.startDate, props.endDate));
6659
- const hourPx = dayPx / 24;
6660
- const minutePx = dayPx / 1440;
6661
- this.state = {
6662
- startDate: props.startDate,
6663
- endDate: props.endDate,
6664
- maxPx: maxPx,
6665
- dayPx: dayPx,
6666
- hourPx: hourPx,
6667
- minutePx: minutePx,
6668
- timeHeaders: timeHeaders,
6669
- eventHeight: 30,
6670
- events: props.events,
6671
- resources: props.resources,
6672
- top: 0,
6673
- bottom: 1000,
6674
- lineStyle: 0,
6675
- nowUtc: getUtcToday$1(),
6676
- division: 0,
6677
- divisionType: "",
6678
- pinnedResources: props.pinnedResources ? props.pinnedResources : [],
6679
- selectedEvents: [],
6680
- showConsoleLogs: false, // Change to false to not show the console.log(...)
6681
- groupByFunction: props.groupByFunction ?? false,
6682
- };
6683
- };
6684
- initOutside = (events, resources, _nextProps, startDate, endDate) => {
6685
- // const maxPx: number = (document.getElementById("root")?.clientWidth ?? window.innerWidth) - 150;
6686
- const maxPx = this.calculateMaxPx();
6687
- const timeHeaders = getTimeHeaders$1(startDate, endDate);
6688
- const days = Math.floor(daysBetweenTwoDates$1(startDate, endDate));
6689
- const dayPx = maxPx / days;
6690
- const hourPx = dayPx / 24;
6691
- const minutePx = dayPx / 1440;
6692
- const eventHeight = 30;
6693
- resources = filterResources$1(this.props.module, this.props.resourceName, this.props.resources, this.props.groupByFunction, endDate, startDate);
6694
- resources = resources.map((resource) => {
6695
- return {
6696
- ...resource,
6697
- events: getEventsOfResource(resource, events, this.state, this.props.id, this.props.module, startDate, endDate),
6698
- };
6699
- });
6700
- const groupByFunction = this.props.groupByFunction ?? false;
6701
- const now = getUtcToday$1();
6702
- const isInDateRange = now >= startDate && now <= endDate && this.contentArea !== undefined;
6703
- const lineStyle = isInDateRange ? daysBetweenTwoDatesIncludingBoth$1(startDate, now) * dayPx : 0;
6704
- this.setState({
6705
- startDate: startDate,
6706
- endDate: endDate,
6707
- maxPx: maxPx,
6708
- dayPx: dayPx,
6709
- hourPx: hourPx,
6710
- minutePx: minutePx,
6711
- timeHeaders: timeHeaders,
6712
- eventHeight: eventHeight,
6713
- events: [...events],
6714
- resources: [...resources],
6715
- top: 0,
6716
- bottom: 1000,
6717
- lineStyle: lineStyle,
6718
- nowUtc: now,
6719
- division: 0,
6720
- divisionType: "",
6721
- pinnedResources: this.props.pinnedResources ?? [],
6722
- groupByFunction: groupByFunction,
6723
- });
6724
- };
6725
- componentDidMount() {
6726
- const eventsCopy = [...this.props.events];
6727
- const filteredResources = filterAndProcessResources(this.props, this.state);
6728
- const divisions = calculateDivisions$1(this.state.startDate, this.state.endDate);
6729
- const divisionType = calculateDivisionType$1(this.state.startDate, this.state.endDate);
6730
- this.setState({
6731
- events: eventsCopy,
6732
- resources: filteredResources,
6733
- division: divisions,
6734
- divisionType: divisionType,
6735
- });
6736
- // Añadir ResizeObserver
6737
- const mainElement = document.querySelector(".cw-scheduler-main-wrapper");
6738
- if (mainElement) {
6739
- this.resizeObserver = new ResizeObserver(() => {
6740
- this.handleResize();
6741
- });
6742
- this.resizeObserver.observe(mainElement);
6743
- }
6744
- window?.addEventListener("resize", this.handleResize);
6745
- }
6746
- componentWillUnmount() {
6747
- if (this.resizeObserver) {
6748
- this.resizeObserver.disconnect();
6749
- }
6750
- window?.removeEventListener("resize", this.handleResize);
6751
- }
6752
- recalculateEventPositions = (events, dayPx, startDate) => {
6753
- return events.map(event => getEventWithSize$1(event, startDate, dayPx));
6754
- };
6755
- updateResourcesWithEvents = (resources, events) => {
6756
- return resources.map(resource => ({
6757
- ...resource,
6758
- events: events.filter(event => event.resourceId === resource.id)
6759
- }));
6760
- };
6761
- handleResize = () => {
6762
- const maxPx = this.calculateMaxPx();
6763
- const days = Math.floor(daysBetweenTwoDates$1(this.state.startDate, this.state.endDate));
6764
- const dayPx = maxPx / days;
6765
- const hourPx = dayPx / 24;
6766
- const minutePx = dayPx / 1440;
6767
- const recalculatedEvents = this.recalculateEventPositions(this.state.events, dayPx, this.state.startDate);
6768
- const updatedResources = this.updateResourcesWithEvents(this.state.resources, recalculatedEvents);
6769
- this.setState({
6770
- maxPx,
6771
- dayPx,
6772
- hourPx,
6773
- minutePx,
6774
- events: recalculatedEvents,
6775
- resources: updatedResources
6776
- });
6777
- };
6778
- componentWillReceiveProps(_nextProps) {
6779
- if (this.state.showConsoleLogs) {
6780
- console.log("Schedule - componentWillReceiveProps, start: ", moment(new Date()).toString());
6781
- console.log("Schedule - componentWillReceiveProps - has changes, start: ", moment(new Date()).toString());
6367
+ const handleInputClick = useCallback(() => {
6368
+ if (!disabled) {
6369
+ setIsOpen(true);
6782
6370
  }
6783
- const dateChange = _nextProps.startDate.toISOString() !== this.state.startDate.toISOString() ||
6784
- _nextProps.endDate.toISOString() !== this.state.endDate.toISOString();
6785
- if (document.getElementById("root") !== null) {
6786
- this.handleResize();
6371
+ }, [disabled]);
6372
+ const handleInputChange = useCallback((e) => {
6373
+ const newValue = e.target.value;
6374
+ setInputValue(newValue);
6375
+ // Try to parse the full datetime string: dd.MM.yyyy HH:mm
6376
+ if (newValue.length >= 16) {
6377
+ validateAndSetDateTime(newValue);
6787
6378
  }
6788
- if (dateChange) {
6789
- const events = cloneDeep(this.props.events);
6790
- const resources = cloneDeep(this.props.resources);
6791
- this.initOutside(events, resources, _nextProps, _nextProps.startDate, _nextProps.endDate);
6792
- if (this.state.showConsoleLogs) {
6793
- console.log("Schedule - componentWillReceiveProps - print on schedule, end: ", moment(new Date()).toString());
6794
- console.log("Schedule - componentWillReceiveProps, end: ", moment(new Date()).toString());
6795
- }
6796
- return;
6379
+ else if (newValue === "") {
6380
+ onChange(undefined);
6381
+ setSelectedDate(undefined);
6382
+ setSelectedTime("");
6797
6383
  }
6798
- const mappedEvents = _nextProps.events
6799
- .map((event) => {
6800
- return getEventWithSize$1(event, _nextProps.startDate, this.state.dayPx);
6801
- })
6802
- .filter((event) => {
6803
- const outOfRange = event.end <= this.props.startDate || event.start >= this.props.endDate;
6804
- return !outOfRange;
6805
- });
6806
- const newResources = _nextProps.resources
6807
- .map((resource) => {
6808
- return {
6809
- ...resource,
6810
- events: mappedEvents.filter((event) => event.resourceId === resource.id),
6811
- };
6812
- })
6813
- .map((resource) => {
6814
- const tops = getEventsInInnerRows$1(resource, this.state, _nextProps.startDate);
6815
- const height = tops.length === 0 ? this.state.eventHeight : tops.length * this.state.eventHeight;
6816
- let flatMapEvents = [];
6817
- for (let h = 0; h < tops.length; h++) {
6818
- flatMapEvents = flatMapEvents.concat(tops[h]);
6384
+ }, [validateAndSetDateTime, onChange]);
6385
+ const handleInputBlur = useCallback(() => {
6386
+ // Try to parse if there's text
6387
+ if (inputValue && inputValue.trim() !== "") {
6388
+ const parsed = parseDateTime(inputValue);
6389
+ if (parsed && !isNaN(parsed.getTime())) {
6390
+ const isValid = (!minDateTime || parsed >= minDateTime) &&
6391
+ (!maxDateTime || parsed <= maxDateTime);
6392
+ if (isValid) {
6393
+ onChange(parsed);
6394
+ const dateStr = format(parsed, "dd.MM.yyyy", { locale: enGB });
6395
+ const timeStr = format(parsed, "HH:mm", { locale: enGB });
6396
+ setInputValue(`${dateStr} ${timeStr}`);
6397
+ setSelectedDate(parsed);
6398
+ setSelectedTime(timeStr);
6399
+ return;
6400
+ }
6819
6401
  }
6820
- return {
6821
- ...resource,
6822
- maxTop: height,
6823
- events: flatMapEvents,
6824
- };
6825
- });
6826
- this.setState({
6827
- events: mappedEvents,
6828
- resources: newResources,
6829
- });
6830
- }
6831
- handleOnClickContextMenuResourceScheduler = (_clickEvent, _resource) => {
6832
- let datetime = new Date();
6833
- const _ca = this.contentArea;
6834
- if (_clickEvent.domEvent.currentTarget !== undefined) {
6835
- const leftPos = _clickEvent.domEvent.currentTarget.parentElement.getBoundingClientRect().left -
6836
- (_ca?.getBoundingClientRect()?.left ?? 0) -
6837
- window.scrollX;
6838
- datetime = addMinutesToDateFromPx$1(this.state.startDate, leftPos, this.state.minutePx);
6839
6402
  }
6840
- if (this.props.scheduler_handleOnClickContextMenuResource) {
6841
- this.props.scheduler_handleOnClickContextMenuResource(datetime, _resource, _clickEvent.key, this.props.id);
6403
+ // Sync with current value
6404
+ if (value) {
6405
+ const dateStr = format(value, "dd.MM.yyyy", { locale: enGB });
6406
+ const timeStr = format(value, "HH:mm", { locale: enGB });
6407
+ setInputValue(`${dateStr} ${timeStr}`);
6842
6408
  }
6843
- };
6844
- handleOnClickResourceContextMenu = (_e, resource) => {
6845
- if (this.props.scheduler_handleOnClickResourceContextMenu) {
6846
- this.props.scheduler_handleOnClickResourceContextMenu(_e, resource);
6409
+ else {
6410
+ setInputValue("");
6847
6411
  }
6848
- };
6849
- handleCrewPinning = (resource, text) => {
6850
- if (this.props.scheduler_handlePinned) {
6851
- this.props.scheduler_handlePinned.call(this.props.parent, resource.id, text, this.props.id);
6412
+ }, [inputValue, parseDateTime, minDateTime, maxDateTime, onChange, value]);
6413
+ const handleInputKeyDown = useCallback((e) => {
6414
+ if (e.key === "Enter") {
6415
+ e.preventDefault();
6416
+ inputRef.current?.blur();
6417
+ setIsOpen(false);
6852
6418
  }
6853
- };
6854
- render() {
6855
- const isInDateRange = this.state.nowUtc >= this.state.startDate &&
6856
- this.state.nowUtc <= this.state.endDate &&
6857
- this.contentArea !== undefined;
6858
- const showTimeline = isInDateRange && this.state.lineStyle < this.state.maxPx;
6859
- const isPinnedTable = this.props.id.toLowerCase().includes("pinned");
6860
- const schedulerHeight = heightScheduler$1(this.state.resources, this.props.height, this.props.id === "crewAssignmentsScheduler");
6861
- const timeHeaders = this.state.timeHeaders;
6862
- const referenceDate = timeHeaders[0];
6863
- const divisions = 24 / calculateDivisions$1(timeHeaders[0], timeHeaders[timeHeaders.length - 1]);
6864
- const hoursPixels = timeHeaders
6865
- .filter((_, index) => {
6866
- return index != 0 && index % divisions == 0;
6867
- })
6868
- .map((date) => {
6869
- const daysDiff = daysBetweenTwoDatesIncludingBoth$1(date, referenceDate);
6870
- const pixels = daysDiff * 24 * this.state.hourPx;
6871
- return pixels;
6872
- });
6873
- return (jsx("div", { id: this.props.id, style: {
6874
- overflowY: "auto",
6875
- maxHeight: isPinnedTable ? "auto" : schedulerHeight
6876
- }, className: this.state.resources.length > 0 ? "cwellt_tb_con" : "cwellt_tb_con cw_tb_con_emptyValues", children: jsxs("table", { id: "cwelltTableScheduler", children: [this.props.id !== "crewAssignmentsScheduler" && (jsx(SchedulerHeader$2, { timelineProps: {
6877
- maxPx: this.state.maxPx,
6878
- hoursList: this.state.timeHeaders,
6879
- pxPerHour: this.state.hourPx,
6880
- startDate: this.state.startDate,
6881
- endDate: this.state.endDate,
6882
- headerName: this.props.resourceName,
6883
- }, descriptionColumn: this.props.descriptionColumn })), jsx("tbody", { style: {
6884
- overflow: "visible",
6885
- width: this.state.maxPx + 150
6886
- }, className: isPinnedTable ? "fc-body cw-fc-body-pinned" : "fc-body", children: jsxs("tr", { className: "fc_body_row", children: [jsx(ResourcesTitleList$1, { resources: this.state.resources, canBePinned: this.props.canBePinned ?? false, includesPinned: this.props.id.toLowerCase().includes("pinned"), onCrewPinning: this.handleCrewPinning, onClickResourceContextMenu: this.handleOnClickResourceContextMenu, ResourceTitleComponent: this.props.resourceComp }), jsx("td", { className: "dividerArea" }), jsx(SchedulerContentArea$1, { now: this.state.nowUtc, showTimeline: showTimeline, timeSeparatorLeftPx: hoursPixels, timeLineLeftPx: this.state.lineStyle, resources: this.state.resources, contextMenuContents: this.props.resourceContextMenuContents, scheduler: this, onEmptyClick: this.props.scheduler_handleEmptyClick, setContentArea: (n) => (this.contentArea = n), onClickContextMenu: this.handleOnClickContextMenuResourceScheduler })] }) })] }) }));
6887
- }
6419
+ else if (e.key === "Escape") {
6420
+ setIsOpen(false);
6421
+ inputRef.current?.blur();
6422
+ }
6423
+ }, []);
6424
+ const handleNowClick = useCallback(() => {
6425
+ const now = new Date();
6426
+ // Check if now is within allowed range
6427
+ const isNowValid = (!minDateTime || now >= minDateTime) &&
6428
+ (!maxDateTime || now <= maxDateTime);
6429
+ if (isNowValid) {
6430
+ onChange(now);
6431
+ setIsOpen(false);
6432
+ }
6433
+ }, [minDateTime, maxDateTime, onChange]);
6434
+ // Memoize disabled days
6435
+ const disabledDays = useMemo(() => [
6436
+ ...(disabledDates || []),
6437
+ ...(minDateTime ? [{ before: minDateTime }] : []),
6438
+ ...(maxDateTime ? [{ after: maxDateTime }] : []),
6439
+ ...(disabledMatcher ? [disabledMatcher] : []),
6440
+ ], [disabledDates, minDateTime, maxDateTime, disabledMatcher]);
6441
+ return (jsx("div", { ref: containerRef, className: `cw-datetimepicker ${className || ""}`, children: jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { ref: wrapperRef, className: styles$4.pickerWrapper, children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, placeholder: placeholder, onChange: handleInputChange, onBlur: handleInputBlur, onClick: handleInputClick, onKeyDown: handleInputKeyDown, disabled: disabled, required: required, maxLength: 16, style: { width: "24ch" } }), jsx("div", { className: styles$4.pickerIcons, children: showClear && value && !disabled ? (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onClick: handleClear, tabIndex: -1, "aria-label": "Clear datetime" })) : (jsx(CwIcon, { iconId: "calendar-time" })) }), renderPopup(jsxs("div", { ref: popupRef, className: `${styles$4.pickerPopup} ${compactStyles.compactPopup}`, style: popupStyle, children: [jsxs("div", { className: compactStyles.calendarWrapper, children: [jsx(DayPicker, { mode: "single", selected: selectedDate, onSelect: handleDaySelect, defaultMonth: selectedDate, disabled: disabledDays, numberOfMonths: numberOfMonths, modifiers: {
6442
+ today: new Date(),
6443
+ }, modifiersClassNames: {
6444
+ today: "rdp-day-today",
6445
+ } }), showTodayButton && (jsx("footer", { className: "cw-flex-row cw-align-center-center", children: jsx(CwButton, { type: "button", variant: "outline", icon: "check-big", onClick: handleNowClick, text: "Now" }) }))] }), jsxs("div", { className: compactStyles.timeWrapper, children: [jsxs("header", { children: [jsx(CwIcon, { iconId: "clock", size: "medium" }), jsx("span", { children: "Time" })] }), jsx("div", { ref: timeListRef, className: `${timeStyles.timePickerList} ${compactStyles.compactTimeList}`, children: timeOptions.map((time) => {
6446
+ const isSelected = time === selectedTime;
6447
+ return (jsx("button", { type: "button", className: isSelected ? timeStyles.selected : "", onClick: () => handleTimeSelect(time), children: time }, time));
6448
+ }) })] })] }))] })] }) }));
6888
6449
  }
6889
6450
 
6890
6451
  const ResourcesTitleList = ({ resources, canBePinned, includesPinned, onCrewPinning, onClickResourceContextMenu, ResourceTitleComponent, }) => {
@@ -7203,7 +6764,7 @@ crewAssignmentSchedulerContextMenu, }) => {
7203
6764
  };
7204
6765
 
7205
6766
  const TimeLine$1 = ({ id, toolTipTitle, marginLeft, color = "rgba(255,0,0,.6)", pixels = 2, height = "100%", zIndex = 1, }) => {
7206
- return (jsx(Tooltip, { title: toolTipTitle, children: jsx("div", { id: id, style: {
6767
+ return (jsx(CwGenericTooltip, { content: toolTipTitle, position: "top", children: jsx("div", { id: id, style: {
7207
6768
  borderLeft: `${pixels}px solid ${color}`,
7208
6769
  marginLeft: marginLeft,
7209
6770
  width: "0px",
@@ -8195,17 +7756,6 @@ const BackgroundEvent = ({ value, heightRem }) => {
8195
7756
  }, children: value.icons }) : null, jsx("span", { className: styles$2["scheduler-event-text"], children: value.name })] }) }) }) }) })) : null;
8196
7757
  };
8197
7758
 
8198
- var styles$1 = {"scheduler-row-header":"scheduler-row-module_scheduler-row-header__S-iv4"};
8199
-
8200
- const DefaultRowHeader = ({ value, width, onEvent }) => {
8201
- return (jsxs("div", { style: {
8202
- width: width,
8203
- // background: color,
8204
- }, onClick: (_) => {
8205
- onEvent(new OnClickRowHeader(value.rowId));
8206
- }, className: styles$1["scheduler-row-header"], children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 && jsxs("span", { className: styles$1["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }));
8207
- };
8208
-
8209
7759
  function useSingleAndDoubleClicks(onClick, onDoubleClick) {
8210
7760
  const timer = useRef(null);
8211
7761
  const cancelPendingClick = useCallback(() => {
@@ -8233,6 +7783,60 @@ function useSingleAndDoubleClicks(onClick, onDoubleClick) {
8233
7783
  return { handleClick, handleDoubleClick };
8234
7784
  }
8235
7785
 
7786
+ const eventsCollide = (event1, event2) => {
7787
+ const eventInsideOther = event1.startDate <= event2.startDate && event1.endDate >= event2.endDate;
7788
+ const eventCollideStart = event1.endDate > event2.startDate && event1.endDate < event2.endDate;
7789
+ const eventCollideEnd = event2.endDate > event1.startDate && event2.endDate < event1.endDate;
7790
+ return eventInsideOther || eventCollideStart || eventCollideEnd;
7791
+ };
7792
+ // Function to separate events into non-colliding rows
7793
+ const separateEventsToInnerRows = (events) => {
7794
+ const sortedEvents = [...events].sort((a, b) => {
7795
+ const aOrder = a.order ?? Number.MAX_SAFE_INTEGER;
7796
+ const bOrder = b.order ?? Number.MAX_SAFE_INTEGER;
7797
+ if (aOrder !== bOrder) {
7798
+ return aOrder - bOrder; // Prioridad al order si ambos están definidos
7799
+ }
7800
+ return a.startDate.getTime() - b.startDate.getTime();
7801
+ });
7802
+ const rows = [];
7803
+ for (const event of sortedEvents) {
7804
+ let placed = false;
7805
+ for (const row of rows) {
7806
+ if (!row.some((existingEvent) => eventsCollide(existingEvent, event))) {
7807
+ row.push(event);
7808
+ placed = true;
7809
+ break;
7810
+ }
7811
+ }
7812
+ if (!placed) {
7813
+ rows.push([event]);
7814
+ }
7815
+ }
7816
+ return rows;
7817
+ };
7818
+
7819
+ const DivisionLine = ({ left, top = "0px", height, isDayBoundary }) => {
7820
+ const color = isDayBoundary ? "rgba(255,255,255,1)" : "rgba(255,255,255,0.8)";
7821
+ const width = isDayBoundary ? "2px" : "1px";
7822
+ return (jsx(TimeLine, { color: color, left: left + "%", height: height, width: width, top: top }));
7823
+ };
7824
+
7825
+ const WeekEndLine = ({ left, top = "0px", height, widthPercentage }) => {
7826
+ return (jsx(TimeLine, { color: "rgba(0,0,0,0.05)", left: left + "%", height: height, width: widthPercentage + "%", top: top }));
7827
+ };
7828
+
7829
+ var styles$1 = {"scheduler-row-header":"scheduler-row-module_scheduler-row-header__S-iv4"};
7830
+
7831
+ const DefaultRowHeader = ({ value, width, onEvent }) => {
7832
+ return (jsxs("div", { style: {
7833
+ width: width,
7834
+ // background: color,
7835
+ }, onClick: (_) => {
7836
+ onEvent(new OnClickRowHeader(value.rowId));
7837
+ }, className: styles$1["scheduler-row-header"], children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 && jsxs("span", { className: styles$1["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }));
7838
+ };
7839
+
8236
7840
  const EventSideDrag = ({ left = false, heightRem, onStartEvent }) => {
8237
7841
  return (jsx("span", { draggable: true, onDragStart: (e) => {
8238
7842
  e.stopPropagation();
@@ -8285,6 +7889,7 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
8285
7889
  top: "2px",
8286
7890
  left: `${value.left}%`,
8287
7891
  width: `${value.width}%`,
7892
+ minWidth: "5px",
8288
7893
  position: "absolute",
8289
7894
  zIndex: isOnDrag ? 999 : undefined,
8290
7895
  contentVisibility: "auto",
@@ -8301,7 +7906,7 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
8301
7906
  }, onDragEnd: (_) => {
8302
7907
  if (value.isDraggable)
8303
7908
  setIsOnDrag(false);
8304
- }, children: jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", hide: isOnDrag, dissapearsWhenHover: true, showDelay: 200, children: jsxs("div", { style: {
7909
+ }, children: jsx(CwTooltipNew, { content: value.tooltip, position: "bottom", hide: isOnDrag, showDelay: 200, children: jsxs("div", { style: {
8305
7910
  border: value.selected ? "2px solid black" : "none",
8306
7911
  backgroundColor: backColor,
8307
7912
  height: `calc(${heightRem}rem - 4px)`,
@@ -8346,47 +7951,6 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
8346
7951
  } }))] }) }) }, value.id) }));
8347
7952
  };
8348
7953
 
8349
- const eventsCollide = (event1, event2) => {
8350
- const eventInsideOther = event1.startDate <= event2.startDate && event1.endDate >= event2.endDate;
8351
- const eventCollideStart = event1.endDate > event2.startDate && event1.endDate < event2.endDate;
8352
- const eventCollideEnd = event2.endDate > event1.startDate && event2.endDate < event1.endDate;
8353
- return eventInsideOther || eventCollideStart || eventCollideEnd;
8354
- };
8355
- // Function to separate events into non-colliding rows
8356
- const separateEventsToInnerRows = (events) => {
8357
- const sortedEvents = [...events].sort((a, b) => {
8358
- const aOrder = a.order ?? Number.MAX_SAFE_INTEGER;
8359
- const bOrder = b.order ?? Number.MAX_SAFE_INTEGER;
8360
- if (aOrder !== bOrder) {
8361
- return aOrder - bOrder; // Prioridad al order si ambos están definidos
8362
- }
8363
- return a.startDate.getTime() - b.startDate.getTime();
8364
- });
8365
- const rows = [];
8366
- for (const event of sortedEvents) {
8367
- let placed = false;
8368
- for (const row of rows) {
8369
- if (!row.some((existingEvent) => eventsCollide(existingEvent, event))) {
8370
- row.push(event);
8371
- placed = true;
8372
- break;
8373
- }
8374
- }
8375
- if (!placed) {
8376
- rows.push([event]);
8377
- }
8378
- }
8379
- return rows;
8380
- };
8381
-
8382
- const DivisionLine = ({ left, top = "0px", height }) => {
8383
- return (jsx(TimeLine, { color: "rgba(255,255,255,1)", left: left + "%", height: height, width: 1 + "px", top: top }));
8384
- };
8385
-
8386
- const WeekEndLine = ({ left, top = "0px", height, widthPercentage }) => {
8387
- return (jsx(TimeLine, { color: "rgba(0,0,0,0.05)", left: left + "%", height: height, width: widthPercentage + "%", top: top }));
8388
- };
8389
-
8390
7954
  const SchedulerRow = memo((props) => {
8391
7955
  const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
8392
7956
  const { events, backgroundEvents, rowHeader, contextMenuItems, RowTitleComp, EventComp, BackgroundEventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
@@ -8433,7 +7997,7 @@ const SchedulerRow = memo((props) => {
8433
7997
  }
8434
7998
  }, onDragOver: (e) => {
8435
7999
  e.preventDefault();
8436
- }, onClick: handleClick, onDoubleClick: handleDoubleClick, children: [weekendLines.map((weekend) => (jsx(WeekEndLine, { height: "100%", left: weekend.left, widthPercentage: weekend.width }, weekend.left))), divisionLines.map((division) => (jsx(DivisionLine, { height: "100%", left: division.left }, division.left))), backgroundEvents.length > 0 && backgroundEvents.some((e) => e.isVisible) && (jsx("div", { style: {
8000
+ }, onClick: handleClick, onDoubleClick: handleDoubleClick, children: [weekendLines.map((weekend) => (jsx(WeekEndLine, { height: "100%", left: weekend.left, widthPercentage: weekend.width }, weekend.left))), divisionLines.map((division) => (jsx(DivisionLine, { height: "100%", left: division.left, isDayBoundary: division.isDayBoundary }, division.left))), backgroundEvents.length > 0 && backgroundEvents.some((e) => e.isVisible) && (jsx("div", { style: {
8437
8001
  height: "100%",
8438
8002
  position: internalRows.length > 0 ? "absolute" : "relative",
8439
8003
  width: "100%",
@@ -8476,22 +8040,26 @@ const SchedulerRow = memo((props) => {
8476
8040
  return true;
8477
8041
  });
8478
8042
 
8043
+ const DIVISION_RULES = [
8044
+ { maxDays: 2, divisions: 24 },
8045
+ { maxDays: 3, divisions: 12 },
8046
+ { maxDays: 4, divisions: 8 },
8047
+ { maxDays: 5, divisions: 6 },
8048
+ { maxDays: 7, divisions: 3 },
8049
+ ];
8050
+ const DEFAULT_DIVISIONS = 2;
8479
8051
  const calculateDivisionsByDays = (days) => {
8480
- if (days <= 3) {
8481
- return 8;
8482
- }
8483
- if (days <= 7) {
8484
- return 3;
8485
- }
8486
- return 2;
8052
+ const rule = DIVISION_RULES.find((it) => days <= it.maxDays);
8053
+ return rule?.divisions ?? DEFAULT_DIVISIONS;
8487
8054
  };
8488
- const getHoursFromDivisions = (divisions) => {
8055
+ const getHoursFromDivisions = (divisions, useCompactHourFormat = false) => {
8489
8056
  const hoursInterval = 24 / divisions;
8057
+ const hourFormat = useCompactHourFormat ? "HH[h]" : "HH:mm";
8490
8058
  const array = [];
8491
8059
  for (let i = 0; i < divisions; i++) {
8492
8060
  const newHour = moment(new Date(1, 1, 1))
8493
8061
  .add(hoursInterval * i, "hours")
8494
- .format("HH:mm");
8062
+ .format(hourFormat);
8495
8063
  array.push(newHour);
8496
8064
  }
8497
8065
  return array;
@@ -8509,12 +8077,16 @@ const getDefaultDivisions = (visibleDays, selectedDate) => {
8509
8077
  };
8510
8078
  const getDayDivisions = (visibleDays, selectedDate) => {
8511
8079
  const divisionsNumber = calculateDivisionsByDays(visibleDays);
8512
- const divisions = getHoursFromDivisions(divisionsNumber);
8080
+ const divisions = getHoursFromDivisions(divisionsNumber, visibleDays < 3);
8513
8081
  const calculatedDivision = [];
8514
8082
  for (let i = 0; i < visibleDays; i++) {
8515
8083
  const currentDate = moment(selectedDate).add(i, "days");
8084
+ const weekdayShort = currentDate.format("ddd");
8085
+ const weekdayLabel = visibleDays < 8
8086
+ ? weekdayShort
8087
+ : weekdayShort.charAt(0).toUpperCase();
8516
8088
  calculatedDivision.push({
8517
- top: currentDate.format("DD.MM.YYYY"),
8089
+ top: `${weekdayLabel} ${currentDate.format("DD.MM")}`,
8518
8090
  bottom: divisions,
8519
8091
  startDate: currentDate.toDate(),
8520
8092
  endDate: currentDate.toDate()
@@ -8639,7 +8211,10 @@ const getEventSizes = (schedulerDate, totalDays, startDate, endDate) => {
8639
8211
  startHours = 0;
8640
8212
  }
8641
8213
  const left = (startHours / totalHours) * 100;
8642
- const width = (durationHours * 100) / totalHours;
8214
+ // Minimum width equivalent to 15 minutes so zero/near-zero duration events stay visible
8215
+ const MIN_WIDTH_HOURS = 0.25;
8216
+ const minWidth = (MIN_WIDTH_HOURS * 100) / totalHours;
8217
+ const width = Math.max((durationHours * 100) / totalHours, minWidth);
8643
8218
  return {
8644
8219
  left,
8645
8220
  width,
@@ -8647,16 +8222,13 @@ const getEventSizes = (schedulerDate, totalDays, startDate, endDate) => {
8647
8222
  };
8648
8223
 
8649
8224
  function getLinesByDivisions(headerDivision, _) {
8650
- const lines = headerDivision.flatMap((division) => {
8651
- return division.bottom;
8652
- });
8225
+ const lines = headerDivision.flatMap((division) => division.bottom.map((_, i) => ({ isDayBoundary: i === 0 })));
8653
8226
  const left = 100 / lines.length;
8654
- const finalLines = lines.map((_, index) => {
8655
- return {
8656
- left: left * index,
8657
- width: 1,
8658
- };
8659
- }).filter((_, index) => index !== 0);
8227
+ const finalLines = lines.map((line, index) => ({
8228
+ left: left * index,
8229
+ width: 1,
8230
+ isDayBoundary: line.isDayBoundary,
8231
+ })).filter((_, index) => index !== 0);
8660
8232
  return finalLines;
8661
8233
  }
8662
8234
 
@@ -8695,9 +8267,6 @@ const getWeekendsDaysInDateRange = (initialDate, visibleDays) => {
8695
8267
  return weekends;
8696
8268
  };
8697
8269
 
8698
- class UiEvent {
8699
- }
8700
-
8701
8270
  const getNow = (isUtc) => {
8702
8271
  let now = new Date();
8703
8272
  if (!isUtc) {
@@ -8705,11 +8274,10 @@ const getNow = (isUtc) => {
8705
8274
  }
8706
8275
  return now;
8707
8276
  };
8708
- const rowsHeight = 1.75; // rem
8709
8277
  const milliSecondsInSecond = 1000;
8710
8278
  const refreshMilliSeconds = 45 * milliSecondsInSecond;
8711
8279
  const Scheduler = (props) => {
8712
- const { header: headerContent, id, events: eventsState, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, } = props;
8280
+ const { header: headerContent, id, events: eventsState, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, rowHeightRem = 1.75, } = props;
8713
8281
  const BackgroundEventComp = props.BackgroundEventComp ?? BackgroundEvent;
8714
8282
  const rows = useOrderCategory === false
8715
8283
  ? props.rows
@@ -8725,8 +8293,12 @@ const Scheduler = (props) => {
8725
8293
  useEffect(() => {
8726
8294
  instanceRef.current?.resetAfterIndex(0);
8727
8295
  }, [orderCategories, props.rows.length, events]);
8728
- const notEmptyRows = stateVisibleRows ?? rows.length;
8729
- const visibleRows = height(events, rows, notEmptyRows);
8296
+ const totalSubRows = rows.reduce((acc, row) => {
8297
+ const filteredEvents = events.filter((it) => it.rowId === row.rowId);
8298
+ const innerRows = separateEventsToInnerRows(filteredEvents);
8299
+ return acc + Math.max(innerRows.length, 1);
8300
+ }, 0);
8301
+ const visibleRows = Math.min(stateVisibleRows ?? totalSubRows, totalSubRows);
8730
8302
  const totalHours = visibleDays * 24;
8731
8303
  const [timeLinePercentage, setTimeLinePercentage] = useState(0);
8732
8304
  const header = {
@@ -8741,7 +8313,7 @@ const Scheduler = (props) => {
8741
8313
  };
8742
8314
  const evenColor = "var(--cw-color-surface-container-low)";
8743
8315
  const oddColor = "var(--cw-color-surface-container)";
8744
- const schedulerContentHeight = rowsHeight * visibleRows;
8316
+ const schedulerContentHeight = rowHeightRem * Math.max(visibleRows, 1);
8745
8317
  const weekendsLines = getWeekendLinesByDatesVisible(selectedDate, visibleDays);
8746
8318
  const divisionLines = getLinesByDivisions(header.divisions);
8747
8319
  // Timeline percentage calculation
@@ -8768,7 +8340,7 @@ const Scheduler = (props) => {
8768
8340
  return (jsx("div", { style: {
8769
8341
  ...style,
8770
8342
  backgroundColor: rowColor
8771
- }, children: 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 }) }, row.rowId));
8343
+ }, children: 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: rowHeightRem, onEvent: onEvent, contextMenuItems: contextMenuItems, visibleDays: visibleDays, selectedDate: selectedDate }) }, row.rowId));
8772
8344
  });
8773
8345
  const getItemSize = useCallback((index) => {
8774
8346
  const row = rows[index];
@@ -8776,7 +8348,7 @@ const Scheduler = (props) => {
8776
8348
  const innerRows = separateEventsToInnerRows(filteredEvents);
8777
8349
  const rowsNumber = innerRows.length > 0 ? innerRows.length : 1;
8778
8350
  const pixelsInRem = 16;
8779
- return rowsNumber * rowsHeight * pixelsInRem;
8351
+ return rowsNumber * rowHeightRem * pixelsInRem;
8780
8352
  }, [rows, events]);
8781
8353
  // Render
8782
8354
  return (jsxs("div", { id: id, style: {
@@ -8790,15 +8362,9 @@ const Scheduler = (props) => {
8790
8362
  zIndex: 1,
8791
8363
  }, children: jsx(SchedulerHeader, { ...header }) })), jsx(VariableSizeList, { height: schedulerContentHeight * 16, itemCount: rows.length, itemSize: getItemSize, width: "100%", style: { overflowX: "hidden" }, ref: instanceRef, className: styles$2["hide-scrollbar"], children: Row })] }));
8792
8364
  };
8793
- const height = (events, rows, rowsNumber) => {
8794
- const selectedRows = rows.slice(0, rowsNumber);
8795
- const flatMapped = selectedRows.flatMap(row => {
8796
- const newEvents = events.filter(it => it.rowId === row.rowId);
8797
- const innerRows = separateEventsToInnerRows(newEvents);
8798
- return innerRows.length > 0 ? innerRows : [[]];
8799
- });
8800
- return flatMapped.length;
8801
- };
8365
+
8366
+ class UiEvent {
8367
+ }
8802
8368
 
8803
8369
  let topsCounter = 0;
8804
8370
  class CwSuperScheduler extends React.Component {
@@ -9140,11 +8706,12 @@ class OnClearPinned {
9140
8706
  const PinRowHeader = ({ value, width, onEvent }) => {
9141
8707
  const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
9142
8708
  const { highlightColor, isLoading } = value;
9143
- return (jsx(CwAnchoredMenu, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "right", options: value.contextMenuItems ?? [], onSelect: (key) => {
8709
+ return jsx(CwAnchoredMenu, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "right", options: value.contextMenuItems ?? [], onSelect: (key) => {
9144
8710
  onEvent(new OnClickContextMenu(value.rowId, key));
9145
- }, children: jsx(CwGenericTooltip, { content: value.tooltip, position: "right", dissapearsWhenHover: true, overlayStyle: value.overlayTooltipStyle, children: jsxs("div", { style: {
8711
+ }, children: jsx(CwTooltipNew, { content: value.tooltip, position: "right", dissapearsWhenHover: true, children: jsxs("div", { style: {
9146
8712
  width: width,
9147
- background: highlightColor,
8713
+ height: "100%",
8714
+ background: highlightColor
9148
8715
  }, className: styles["super-scheduler-row-header"], children: [jsx("button", { className: "cw-button-icon cwi-pin", "data-pinned": value.isPinned, onClick: (_) => {
9149
8716
  onEvent(value.isPinned ? new OnUnpinRow(value.rowId) : new OnPinRow(value.rowId));
9150
8717
  } }), jsx("div", { className: styles["indicators"], children: value.indicators ?? undefined }), jsxs("div", { style: {
@@ -9153,19 +8720,19 @@ const PinRowHeader = ({ value, width, onEvent }) => {
9153
8720
  justifyContent: "center",
9154
8721
  alignItems: "flex-start",
9155
8722
  }, children: [jsxs("div", { children: [jsx("strong", { children: value.title }), value.title2 && jsxs("span", { children: ["-", value.title2] }), " ", jsx("strong", { children: value.subtitle })] }), value.subtitle && jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 &&
9156
- jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }), isLoading ? jsx("span", { className: "cwi-icons cwi-spinner" }) : undefined] }) }, value.rowId) }, value.rowId));
8723
+ jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }), isLoading ? jsx("span", { className: "cwi-icons cwi-spinner" }) : undefined] }) }, value.rowId) }, value.rowId);
9157
8724
  };
9158
8725
 
9159
- const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, contextMenuItems, onEvent }) => {
8726
+ const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, contextMenuItems, onEvent, rowHeightRem = 1.75 }) => {
9160
8727
  const pinnedRows = rows.filter((it) => it.isPinned);
9161
8728
  const notPinnedRows = rows.filter((it) => !it.isPinned);
9162
8729
  const isFirstVisible = pinnedRows.length > 0;
9163
- return (jsxs(Fragment, { children: [isFirstVisible && (jsxs(Fragment, { children: [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 }), jsx("div", { children: jsx(CwButton, { onClick: () => {
8730
+ return (jsxs(Fragment, { children: [isFirstVisible && (jsxs(Fragment, { children: [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, rowHeightRem: rowHeightRem }), jsx("div", { children: jsx(CwButton, { onClick: () => {
9164
8731
  onEvent(new OnClearPinned());
9165
- }, children: "Clear pinned" }) })] })), 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 })] }));
8732
+ }, children: "Clear pinned" }) })] })), 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, rowHeightRem: rowHeightRem })] }));
9166
8733
  };
9167
8734
 
9168
- const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder = "Search airport…", required = false, cblConfig, className = "", value, disabled = false, displayMode, labelProps, alignProps, width }) => {
8735
+ const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder = "Search airport…", required = false, cblConfig, className = "", value, disabled = false, displayMode, initialDisplayText, labelProps, alignProps, width }) => {
9169
8736
  // State
9170
8737
  const [inputValue, setInputValue] = useState("");
9171
8738
  const [options, setOptions] = useState([]);
@@ -9371,9 +8938,15 @@ const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder
9371
8938
  // Load initial value
9372
8939
  useEffect(() => {
9373
8940
  if (value && value !== 0 && value !== -1) {
9374
- fetchAirportData(value);
8941
+ if (initialDisplayText) {
8942
+ setInputValue(initialDisplayText);
8943
+ setTooltipText(initialDisplayText);
8944
+ }
8945
+ else {
8946
+ fetchAirportData(value);
8947
+ }
9375
8948
  }
9376
- }, [value, fetchAirportData]);
8949
+ }, [value, fetchAirportData, initialDisplayText]);
9377
8950
  useEffect(() => {
9378
8951
  if (!value || value === 0 || value === -1) {
9379
8952
  setInputValue("");
@@ -9406,4 +8979,4 @@ const CwFindAirport = ({ handleChange, searchType = "OnlyDatabase", placeHolder
9406
8979
  }, "data-direction": direction, children: [jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxs("div", { className: "cw-search-input-wrapper", children: [jsx("input", { ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, onKeyDown: handleKeyDown, onFocus: handleInputFocus, placeholder: isInitialLoading ? "Loading…" : placeHolder, disabled: disabled, required: required, autoComplete: "off", "aria-expanded": showDropdown, "aria-haspopup": "listbox", role: "combobox", title: tooltipText }), (isLoading || isInitialLoading) && (jsx("div", { className: "cw-search-input-loading", children: jsx(CwIcon, { iconId: "spinner" }) })), jsx("div", { className: "cw-search-input-icons", children: inputValue && !disabled && !isInitialLoading ? (jsx(CwButton, { type: "button", onClick: handleClear, "aria-label": "Clear selected airport", variant: "icon", icon: "close", color: "neutral" })) : (jsx(CwIcon, { iconId: "control-tower" })) })] })] }), showDropdown && options.length > 0 && (jsx("div", { ref: dropdownRef, className: "cw-input-search-dropdown", role: "listbox", children: jsx("ul", { children: options.map((option, index) => (jsx("li", { className: index === highlightedIndex ? "highlighted" : "", onClick: () => handleOptionSelect(option.value), onMouseDown: (e) => e.preventDefault(), role: "option", "aria-selected": index === highlightedIndex, children: option.text }, option.value))) }) }))] }));
9407
8980
  };
9408
8981
 
9409
- export { CblDragAndDrop, CwAccordionContainer, CwAlign, CwAnchoredMenu, CwBtnDelete, CwBtnEdit, CwBtnSave, CwButton, CwCard, CwCardList, CwCheckbox, CwChip, CwColorPicker, CwConfirmationPopup, CwContextMenu, CwDatePicker, CwDateRangePicker, CwDateTimePicker, CwDateTimePickerCompact, CwDialog, CwDialogManager, CwDigit, CwDisplayMessage, CwDropdownFilter, CwExpandable, CwFileUpload, CwFileUploadMultiple, CwFindAirport, CwGenericTooltip, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, CwImageGallery, CwImageZoom, CwInput, CwInputColor, CwInputDate, CwInputDatePicker, CwInputDateText, CwInputDatetime, CwInputImage, CwInputNumber, CwInputPhone, CwInputText, CwKeyValueList, CwLabel, CwLoading, CwLoadingSmall, CwMessage, CwMessageManager, CwMessageType, CwModal, CwModalHover, CwModalReportFunctional, CwMultiFilter, CwMultiFilterTag, CwNote, CwOption, CwReportModal, CwScheduler, CwScheduler2, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, CwSortableList, CwSuperScheduler, CwTable, CwTableGrouped, CwTableServerSide, CwTabs, CwTextArea, CwTime, CwTimePicker, CwToggle, CwTooltip, CwTreeView, CwWeekdaySelector, DefaultRowHeader, OnClearPinned, OnClickContextMenu, OnClickEvent, OnClickRowEvent, OnClickRowHeader, OnClickUtc, OnDoubleClickEvent, OnDoubleClickRowEvent, OnDragEvent, OnDropCtrlEvent, OnDropEvent, OnEndClickHeaderEvent, OnLeftDragStart, OnMultiClickEvent, OnPinRow, OnRangeClickEvent, OnRightClickEvent, OnRightClickRow, OnRightDragStart, OnStartClickHeaderEvent, OnUnpinRow, PinRowHeader, Resource, Scheduler, SchedulerEvent, SuperScheduler, UiEvent, Weekdays, cblEvent, eventIsVisible, getDefaultDivisions, getEventSizes, itemsToMultiFilterTags, useCwMessage, useSortableList };
8982
+ export { CblDragAndDrop, CwAccordionContainer, CwAlign, CwAnchoredMenu, CwBtnDelete, CwBtnEdit, CwBtnSave, CwButton, CwCard, CwCardList, CwCheck, CwCheckbox, CwCheckboxGroup, CwChip, CwColorPicker, CwConfirmationPopup, CwContextMenu, CwDatePicker, CwDateRangePicker, CwDateTimePicker, CwDateTimePickerCompact, CwDialog, CwDialogManager, CwDigit, CwDisplayMessage, CwDropdownFilter, CwExpandable, CwFileUpload, CwFileUploadMultiple, CwFindAirport, CwGenericTooltip, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, CwImageGallery, CwImageZoom, CwInput, CwInputColor, CwInputDate, CwInputDatePicker, CwInputDateText, CwInputDatetime, CwInputImage, CwInputNumber, CwInputPhone, CwInputText, CwKeyValueList, CwLabel, CwLoading, CwLoadingSmall, CwMasterDetail, CwMessage, CwMessageManager, CwMessageType, CwModal, CwModalHover, CwModalReportFunctional, CwMultiFilter, CwMultiFilterTag, CwNote, CwOption, CwReportModal, CwScheduler, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, CwSortableList, CwSortableTable, CwSuperScheduler, CwTable, CwTableGrouped, CwTableServerSide, CwTabs, CwTextArea, CwTime, CwTimePicker, CwToggle, CwTooltipManager, CwTooltipNew, CwTreeView, CwWeekdaySelector, DefaultRowHeader, OnClearPinned, OnClickContextMenu, OnClickEvent, OnClickRowEvent, OnClickRowHeader, OnClickUtc, OnDoubleClickEvent, OnDoubleClickRowEvent, OnDragEvent, OnDropCtrlEvent, OnDropEvent, OnEndClickHeaderEvent, OnLeftDragStart, OnMultiClickEvent, OnPinRow, OnRangeClickEvent, OnRightClickEvent, OnRightClickRow, OnRightDragStart, OnStartClickHeaderEvent, OnUnpinRow, PinRowHeader, Resource, Scheduler, SchedulerEvent, SuperScheduler, UiEvent, Weekdays, cblEvent, eventIsVisible, getDefaultDivisions, getEventSizes, itemsToMultiFilterTags, useCwMessage, useSortableList, useSortableTable };