@cwellt_software/cwellt-reactjs-lib 1.0.4 → 1.0.6

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 (312) hide show
  1. package/dist/content/icons/new-cw-icons/NewCwIcons.html +34 -26
  2. package/dist/content/icons/new-cw-icons/NewCwIcons.json +1 -1
  3. package/dist/content/icons/new-cw-icons/css/new-cw-icons.css +10 -2
  4. package/dist/content/icons/new-cw-icons/fonts/NewCwIcons.woff +0 -0
  5. package/dist/index.cjs.js +626 -356
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.css +2 -2
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.d.ts +276 -107
  10. package/dist/index.es.js +624 -353
  11. package/dist/index.esm.js +693 -621
  12. package/dist/src/common/functions/reactor.d.ts +1 -0
  13. package/dist/src/components/control/action/buttons/CwButtons.d.ts +0 -4
  14. package/dist/src/components/control/action/buttons/CwButtons.d.ts.map +1 -1
  15. package/dist/src/components/control/input/any/CwInput.d.ts.map +1 -1
  16. package/dist/src/components/control/input/number/CwInputNumber.d.ts.map +1 -1
  17. package/dist/src/components/custom/find-airport/CwFindAirportComp.d.ts +1 -0
  18. package/dist/src/components/custom/find-airport/CwFindAirportComp.d.ts.map +1 -1
  19. package/dist/src/components/custom/scheduler/components/ClearSchedulerButton.d.ts +2 -2
  20. package/dist/src/components/custom/scheduler/logic/filtering/filterAndProcessResources.d.ts.map +1 -1
  21. package/dist/src/components/custom/scheduler/logic/pixels/calculateMaxPxFromDateRange.d.ts +1 -0
  22. package/dist/src/components/custom/scheduler/logic/state_handle/handleDateChange.d.ts +1 -0
  23. package/dist/src/components/custom/scheduler/logic/state_handle/handlePropChanges.d.ts.map +1 -1
  24. package/dist/src/components/custom/scheduler/logic/ui/getHasPropsChanged.d.ts.map +1 -1
  25. package/dist/src/components/custom/scheduler/logic/ui/shouldTriggerScroll.d.ts.map +1 -1
  26. package/dist/src/components/custom/scheduler/state/EventProps.d.ts +1 -0
  27. package/dist/src/components/custom/scheduler-new/presentation/TestScheduler.d.ts +1 -0
  28. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgrounEvent.d.ts +0 -7
  29. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgrounEvent.d.ts.map +1 -1
  30. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts +1 -0
  31. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +1 -1
  32. package/dist/src/components/custom/scheduler-new/presentation/components/row/cancellablePromise.d.ts +7 -0
  33. package/dist/src/components/custom/scheduler-new/presentation/components/row/cancellablePromise.d.ts.map +1 -0
  34. package/dist/src/components/custom/scheduler-new/presentation/components/row/useCancellablePromise.d.ts +7 -0
  35. package/dist/src/components/custom/scheduler-new/presentation/components/row/useCancellablePromise.d.ts.map +1 -0
  36. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsByResource.d.ts +5 -0
  37. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsByResource.d.ts.map +1 -0
  38. package/dist/src/components/custom/scheduler-new/presentation/state/external/Event.d.ts +1 -0
  39. package/dist/src/components/custom/scheduler-new/presentation/state/external/Event.d.ts.map +1 -0
  40. package/dist/src/components/custom/scheduler-new/presentation/state/external/Row.d.ts +1 -0
  41. package/dist/src/components/custom/scheduler-new/presentation/state/external/Row.d.ts.map +1 -0
  42. package/dist/src/components/custom/scheduler-new/presentation/state/ui/EventSideDragState.d.ts +1 -0
  43. package/dist/src/components/custom/scheduler-new/presentation/state/ui/EventSideDragState.d.ts.map +1 -0
  44. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerEventState.d.ts +2 -3
  45. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerEventState.d.ts.map +1 -0
  46. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerHeaderState.d.ts +5 -2
  47. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerHeaderState.d.ts.map +1 -1
  48. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerRow.d.ts +1 -0
  49. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerRow.d.ts.map +1 -0
  50. package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts.map +1 -1
  51. package/dist/src/components/display/data/table/CwTable.d.ts +57 -72
  52. package/dist/src/components/display/data/table/CwTable.d.ts.map +1 -1
  53. package/dist/src/components/display/graphics/icon/CwIcon.d.ts +6 -3
  54. package/dist/src/components/display/graphics/icon/CwIcon.d.ts.map +1 -1
  55. package/dist/src/components/display/graphics/loading/CwLoading.d.ts +39 -9
  56. package/dist/src/components/display/graphics/loading/CwLoading.d.ts.map +1 -1
  57. package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.d.ts +13 -1
  58. package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.d.ts.map +1 -1
  59. package/dist/src/components/display/text/message/CwMessage.d.ts +3 -3
  60. package/dist/src/components/display/text/message/CwMessage.d.ts.map +1 -1
  61. package/dist/src/components/display/text/tag/CwChip.d.ts +36 -0
  62. package/dist/src/components/display/text/tag/CwChip.d.ts.map +1 -0
  63. package/dist/src/components/display/text/tag/CwTag.d.ts +2 -2
  64. package/dist/src/components/display/text/tag/CwTag.d.ts.map +1 -1
  65. package/dist/src/components/layout/card/CwCard.d.ts +61 -0
  66. package/dist/src/components/layout/card/CwCard.d.ts.map +1 -0
  67. package/dist/src/components/layout/dialog/CwDialog.d.ts +15 -4
  68. package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
  69. package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts +33 -0
  70. package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts.map +1 -0
  71. package/dist/src/components/layout/modal/legacy/cw_modal_report.d.ts.map +1 -1
  72. package/dist/src/components/layout/tabs/CwTabs.d.ts +16 -9
  73. package/dist/src/components/layout/tabs/CwTabs.d.ts.map +1 -1
  74. package/dist/src/index.d.ts +4 -1
  75. package/dist/src/index.d.ts.map +1 -1
  76. package/dist/test/components/custom/newScheduler/presentation/logic/getDefaultDivisions.test.d.ts.map +1 -0
  77. package/dist/test/components/custom/scheduler/calculateMaxPxFromDateRange.test.d.ts +1 -0
  78. package/package.json +1 -1
  79. package/dist/assets/asset-Boimp3FS +0 -46
  80. package/dist/assets/asset-CIKjURuf +0 -48
  81. package/dist/assets/asset-DO0cv1ff +0 -51
  82. package/dist/assets/asset-DitoBYw6 +0 -51
  83. package/dist/common/classes/CwSelectList.d.ts +0 -8
  84. package/dist/common/classes/CwSelectList.d.ts.map +0 -1
  85. package/dist/common/classes/CwSelectListItems.d.ts +0 -9
  86. package/dist/common/classes/CwSelectListItems.d.ts.map +0 -1
  87. package/dist/common/functions/collections.d.ts +0 -5
  88. package/dist/common/functions/collections.d.ts.map +0 -1
  89. package/dist/common/functions/reactor.d.ts +0 -2
  90. package/dist/common/functions/reactor.d.ts.map +0 -1
  91. package/dist/common/interfaces/CwSelectListProps.d.ts +0 -9
  92. package/dist/common/interfaces/CwSelectListProps.d.ts.map +0 -1
  93. package/dist/components/control/action/button/CwButton.d.ts +0 -7
  94. package/dist/components/control/action/button/CwButton.d.ts.map +0 -1
  95. package/dist/components/control/action/buttons/CwButtons.d.ts +0 -326
  96. package/dist/components/control/action/buttons/CwButtons.d.ts.map +0 -1
  97. package/dist/components/control/action/contextmenu/CwContextMenu.d.ts +0 -33
  98. package/dist/components/control/action/contextmenu/CwContextMenu.d.ts.map +0 -1
  99. package/dist/components/control/action/search/CwSearch.d.ts +0 -18
  100. package/dist/components/control/action/search/CwSearch.d.ts.map +0 -1
  101. package/dist/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts +0 -21
  102. package/dist/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts.map +0 -1
  103. package/dist/components/control/choice/checkbox/CwCheckbox.d.ts +0 -19
  104. package/dist/components/control/choice/checkbox/CwCheckbox.d.ts.map +0 -1
  105. package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts +0 -24
  106. package/dist/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts.map +0 -1
  107. package/dist/components/control/choice/dropdown/CwDropdown.d.ts +0 -21
  108. package/dist/components/control/choice/dropdown/CwDropdown.d.ts.map +0 -1
  109. package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts +0 -19
  110. package/dist/components/control/choice/dropdown/CwDropdownContainer.d.ts.map +0 -1
  111. package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts +0 -32
  112. package/dist/components/control/choice/dropdown/CwDropdownFilter.d.ts.map +0 -1
  113. package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts +0 -23
  114. package/dist/components/control/choice/dropdown/CwDropdownNavigation.d.ts.map +0 -1
  115. package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts +0 -68
  116. package/dist/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +0 -1
  117. package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts +0 -34
  118. package/dist/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.d.ts.map +0 -1
  119. package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts +0 -18
  120. package/dist/components/control/choice/multiselect/CwHeadFilter.d.ts.map +0 -1
  121. package/dist/components/control/choice/multiselect/CwMultiselect.d.ts +0 -15
  122. package/dist/components/control/choice/multiselect/CwMultiselect.d.ts.map +0 -1
  123. package/dist/components/control/choice/multiselect/CwOptionList.d.ts +0 -17
  124. package/dist/components/control/choice/multiselect/CwOptionList.d.ts.map +0 -1
  125. package/dist/components/control/choice/option/CwOption.d.ts +0 -17
  126. package/dist/components/control/choice/option/CwOption.d.ts.map +0 -1
  127. package/dist/components/control/choice/select/CwSelect.d.ts +0 -49
  128. package/dist/components/control/choice/select/CwSelect.d.ts.map +0 -1
  129. package/dist/components/control/choice/toggle/CwToggle.d.ts +0 -36
  130. package/dist/components/control/choice/toggle/CwToggle.d.ts.map +0 -1
  131. package/dist/components/control/input/any/CwInput.d.ts +0 -19
  132. package/dist/components/control/input/any/CwInput.d.ts.map +0 -1
  133. package/dist/components/control/input/chipper/CwChip.d.ts +0 -16
  134. package/dist/components/control/input/chipper/CwChip.d.ts.map +0 -1
  135. package/dist/components/control/input/date/CwInputDate.d.ts +0 -40
  136. package/dist/components/control/input/date/CwInputDate.d.ts.map +0 -1
  137. package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts +0 -7
  138. package/dist/components/control/input/date-picker/CwInputDatePicker.d.ts.map +0 -1
  139. package/dist/components/control/input/date-text/CwInputDateText.d.ts +0 -39
  140. package/dist/components/control/input/date-text/CwInputDateText.d.ts.map +0 -1
  141. package/dist/components/control/input/datetime/CwInputDatetime.d.ts +0 -40
  142. package/dist/components/control/input/datetime/CwInputDatetime.d.ts.map +0 -1
  143. package/dist/components/control/input/digit/CwDigit.d.ts +0 -40
  144. package/dist/components/control/input/digit/CwDigit.d.ts.map +0 -1
  145. package/dist/components/control/input/file/CwFileUpload.d.ts +0 -20
  146. package/dist/components/control/input/file/CwFileUpload.d.ts.map +0 -1
  147. package/dist/components/control/input/image/CwInputImage.d.ts +0 -11
  148. package/dist/components/control/input/image/CwInputImage.d.ts.map +0 -1
  149. package/dist/components/control/input/image-area/CwImageArea.d.ts +0 -58
  150. package/dist/components/control/input/image-area/CwImageArea.d.ts.map +0 -1
  151. package/dist/components/control/input/number/CwInputNumber.d.ts +0 -22
  152. package/dist/components/control/input/number/CwInputNumber.d.ts.map +0 -1
  153. package/dist/components/control/input/phone/CwInputPhone.d.ts +0 -36
  154. package/dist/components/control/input/phone/CwInputPhone.d.ts.map +0 -1
  155. package/dist/components/control/input/text/CwInputText.d.ts +0 -40
  156. package/dist/components/control/input/text/CwInputText.d.ts.map +0 -1
  157. package/dist/components/control/input/text-area/CwTextArea.d.ts +0 -25
  158. package/dist/components/control/input/text-area/CwTextArea.d.ts.map +0 -1
  159. package/dist/components/control/input/time/CwTime.d.ts +0 -40
  160. package/dist/components/control/input/time/CwTime.d.ts.map +0 -1
  161. package/dist/components/custom/find-airport/CwFindAirportComp.d.ts +0 -32
  162. package/dist/components/custom/find-airport/CwFindAirportComp.d.ts.map +0 -1
  163. package/dist/components/custom/scheduler/CwSchedulerComp.d.ts +0 -39
  164. package/dist/components/custom/scheduler/CwSchedulerComp.d.ts.map +0 -1
  165. package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts +0 -101
  166. package/dist/components/custom/scheduler/CwSuperSchedulerComp.d.ts.map +0 -1
  167. package/dist/components/custom/scheduler/components/ClearSchedulerButton.d.ts +0 -7
  168. package/dist/components/custom/scheduler/components/ClearSchedulerButton.d.ts.map +0 -1
  169. package/dist/components/custom/scheduler/components/EventRender.d.ts +0 -3
  170. package/dist/components/custom/scheduler/components/EventRender.d.ts.map +0 -1
  171. package/dist/components/custom/scheduler/components/ResourceListRender.d.ts +0 -17
  172. package/dist/components/custom/scheduler/components/ResourceListRender.d.ts.map +0 -1
  173. package/dist/components/custom/scheduler/components/ResourceRender.d.ts +0 -15
  174. package/dist/components/custom/scheduler/components/ResourceRender.d.ts.map +0 -1
  175. package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts +0 -10
  176. package/dist/components/custom/scheduler/components/day_headers/DayHeader.d.ts.map +0 -1
  177. package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts +0 -10
  178. package/dist/components/custom/scheduler/components/day_headers/MonthHeader.d.ts.map +0 -1
  179. package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts +0 -10
  180. package/dist/components/custom/scheduler/components/day_headers/MyDaysHeader.d.ts.map +0 -1
  181. package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts +0 -10
  182. package/dist/components/custom/scheduler/components/day_headers/WeekHeader.d.ts.map +0 -1
  183. package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts +0 -14
  184. package/dist/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.d.ts.map +0 -1
  185. package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts +0 -24
  186. package/dist/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.d.ts.map +0 -1
  187. package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts +0 -8
  188. package/dist/components/custom/scheduler/components/scheduler_header/SchedulerHeader.d.ts.map +0 -1
  189. package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts +0 -11
  190. package/dist/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +0 -1
  191. package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts +0 -11
  192. package/dist/components/custom/scheduler/components/time_headers/TimeHeader.d.ts.map +0 -1
  193. package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts +0 -10
  194. package/dist/components/custom/scheduler/components/time_headers/TimeHeaderRow.d.ts.map +0 -1
  195. package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts +0 -7
  196. package/dist/components/custom/scheduler/components/time_line/TimeLine.d.ts.map +0 -1
  197. package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts +0 -2
  198. package/dist/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.d.ts.map +0 -1
  199. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts +0 -2
  200. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDates.d.ts.map +0 -1
  201. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +0 -2
  202. package/dist/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +0 -1
  203. package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts +0 -11
  204. package/dist/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.d.ts.map +0 -1
  205. package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts +0 -10
  206. package/dist/components/custom/scheduler/logic/dates/getMonthHeaderData.d.ts.map +0 -1
  207. package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts +0 -2
  208. package/dist/components/custom/scheduler/logic/dates/getUtcToday.d.ts.map +0 -1
  209. package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +0 -11
  210. package/dist/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +0 -1
  211. package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts +0 -8
  212. package/dist/components/custom/scheduler/logic/dates/listOfDatesToWeeks.d.ts.map +0 -1
  213. package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts +0 -2
  214. package/dist/components/custom/scheduler/logic/divisions/calculateDivisionType.d.ts.map +0 -1
  215. package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts +0 -2
  216. package/dist/components/custom/scheduler/logic/divisions/calculateDivisions.d.ts.map +0 -1
  217. package/dist/components/custom/scheduler/logic/filtering/filterAndProcessResources.d.ts +0 -19
  218. package/dist/components/custom/scheduler/logic/filtering/filterAndProcessResources.d.ts.map +0 -1
  219. package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts +0 -10
  220. package/dist/components/custom/scheduler/logic/filtering/filterEvents.d.ts.map +0 -1
  221. package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts +0 -10
  222. package/dist/components/custom/scheduler/logic/filtering/filterResources.d.ts.map +0 -1
  223. package/dist/components/custom/scheduler/logic/filtering/hasSameProperties.d.ts +0 -3
  224. package/dist/components/custom/scheduler/logic/filtering/hasSameProperties.d.ts.map +0 -1
  225. package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts +0 -14
  226. package/dist/components/custom/scheduler/logic/onDrop/OnDrop.d.ts.map +0 -1
  227. package/dist/components/custom/scheduler/logic/pixels/calculateMaxPxFromDateRange.d.ts +0 -7
  228. package/dist/components/custom/scheduler/logic/pixels/calculateMaxPxFromDateRange.d.ts.map +0 -1
  229. package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts +0 -8
  230. package/dist/components/custom/scheduler/logic/pixels/getPixelsForEvent.d.ts.map +0 -1
  231. package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts +0 -6
  232. package/dist/components/custom/scheduler/logic/pixels/heightScheduler.d.ts.map +0 -1
  233. package/dist/components/custom/scheduler/logic/pixels/heightSchedulerPinned.d.ts +0 -6
  234. package/dist/components/custom/scheduler/logic/pixels/heightSchedulerPinned.d.ts.map +0 -1
  235. package/dist/components/custom/scheduler/logic/state_handle/handleDateChange.d.ts +0 -10
  236. package/dist/components/custom/scheduler/logic/state_handle/handleDateChange.d.ts.map +0 -1
  237. package/dist/components/custom/scheduler/logic/state_handle/handlePropChanges.d.ts +0 -11
  238. package/dist/components/custom/scheduler/logic/state_handle/handlePropChanges.d.ts.map +0 -1
  239. package/dist/components/custom/scheduler/logic/state_handle/handleResourceChange.d.ts +0 -10
  240. package/dist/components/custom/scheduler/logic/state_handle/handleResourceChange.d.ts.map +0 -1
  241. package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts +0 -2
  242. package/dist/components/custom/scheduler/logic/strings/compareStrings.d.ts.map +0 -1
  243. package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts +0 -2
  244. package/dist/components/custom/scheduler/logic/strings/getGUID.d.ts.map +0 -1
  245. package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts +0 -3
  246. package/dist/components/custom/scheduler/logic/ui/checkIfSlotAvailable.d.ts.map +0 -1
  247. package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts +0 -13
  248. package/dist/components/custom/scheduler/logic/ui/getEventsOfResource.d.ts.map +0 -1
  249. package/dist/components/custom/scheduler/logic/ui/getHasPropsChanged.d.ts +0 -8
  250. package/dist/components/custom/scheduler/logic/ui/getHasPropsChanged.d.ts.map +0 -1
  251. package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts +0 -2
  252. package/dist/components/custom/scheduler/logic/ui/getTimeHeaders.d.ts.map +0 -1
  253. package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts +0 -3
  254. package/dist/components/custom/scheduler/logic/ui/isAllowedToMove.d.ts.map +0 -1
  255. package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts +0 -19
  256. package/dist/components/custom/scheduler/state/CblDragAndDrop.d.ts.map +0 -1
  257. package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts +0 -48
  258. package/dist/components/custom/scheduler/state/CwSchedulerProps.d.ts.map +0 -1
  259. package/dist/components/custom/scheduler/state/EventProps.d.ts +0 -7
  260. package/dist/components/custom/scheduler/state/EventProps.d.ts.map +0 -1
  261. package/dist/components/custom/scheduler/state/Resource.d.ts +0 -14
  262. package/dist/components/custom/scheduler/state/Resource.d.ts.map +0 -1
  263. package/dist/components/custom/scheduler/state/State.d.ts +0 -25
  264. package/dist/components/custom/scheduler/state/State.d.ts.map +0 -1
  265. package/dist/components/custom/scheduler/state/cblEvent.d.ts +0 -26
  266. package/dist/components/custom/scheduler/state/cblEvent.d.ts.map +0 -1
  267. package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts +0 -7
  268. package/dist/components/custom/scheduler/state/cblEventCompProps.d.ts.map +0 -1
  269. package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts +0 -6
  270. package/dist/components/custom/scheduler/state/resourceCompProps2.d.ts.map +0 -1
  271. package/dist/components/display/data/accordion/CwAccordionContainer.d.ts +0 -16
  272. package/dist/components/display/data/accordion/CwAccordionContainer.d.ts.map +0 -1
  273. package/dist/components/display/data/table/CwTable.d.ts +0 -130
  274. package/dist/components/display/data/table/CwTable.d.ts.map +0 -1
  275. package/dist/components/display/graphics/icon/CwIcon.d.ts +0 -14
  276. package/dist/components/display/graphics/icon/CwIcon.d.ts.map +0 -1
  277. package/dist/components/display/graphics/loading/CwLoading.d.ts +0 -19
  278. package/dist/components/display/graphics/loading/CwLoading.d.ts.map +0 -1
  279. package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts +0 -8
  280. package/dist/components/display/graphics/loading-small/CwLoadingSmall.d.ts.map +0 -1
  281. package/dist/components/display/text/heading/CwHeadingMain.d.ts +0 -5
  282. package/dist/components/display/text/heading/CwHeadingMain.d.ts.map +0 -1
  283. package/dist/components/display/text/heading/CwHeadingSecond.d.ts +0 -5
  284. package/dist/components/display/text/heading/CwHeadingSecond.d.ts.map +0 -1
  285. package/dist/components/display/text/label/CwLabel.d.ts +0 -28
  286. package/dist/components/display/text/label/CwLabel.d.ts.map +0 -1
  287. package/dist/components/display/text/message/CwMessage.d.ts +0 -31
  288. package/dist/components/display/text/message/CwMessage.d.ts.map +0 -1
  289. package/dist/components/display/text/tag/CwTag.d.ts +0 -16
  290. package/dist/components/display/text/tag/CwTag.d.ts.map +0 -1
  291. package/dist/components/display/text/tooltip/CwTooltip.d.ts +0 -10
  292. package/dist/components/display/text/tooltip/CwTooltip.d.ts.map +0 -1
  293. package/dist/components/layout/align/CwAlign.d.ts +0 -53
  294. package/dist/components/layout/align/CwAlign.d.ts.map +0 -1
  295. package/dist/components/layout/list/details/CwExpandable.d.ts +0 -23
  296. package/dist/components/layout/list/details/CwExpandable.d.ts.map +0 -1
  297. package/dist/components/layout/modal/hover/CwModalHover.d.ts +0 -19
  298. package/dist/components/layout/modal/hover/CwModalHover.d.ts.map +0 -1
  299. package/dist/components/layout/modal/legacy/cw_modal.d.ts +0 -24
  300. package/dist/components/layout/modal/legacy/cw_modal.d.ts.map +0 -1
  301. package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts +0 -19
  302. package/dist/components/layout/modal/legacy/cw_modal_confirm.d.ts.map +0 -1
  303. package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts +0 -21
  304. package/dist/components/layout/modal/legacy/cw_modal_iframe.d.ts.map +0 -1
  305. package/dist/components/layout/modal/legacy/cw_modal_report.d.ts +0 -35
  306. package/dist/components/layout/modal/legacy/cw_modal_report.d.ts.map +0 -1
  307. package/dist/components/layout/table/grouped/CwTableGrouped.d.ts +0 -80
  308. package/dist/components/layout/table/grouped/CwTableGrouped.d.ts.map +0 -1
  309. package/dist/components/layout/tabs/CwTabs.d.ts +0 -37
  310. package/dist/components/layout/tabs/CwTabs.d.ts.map +0 -1
  311. package/dist/index.es.js.map +0 -1
  312. package/dist/index.esm.js.map +0 -1
package/dist/index.es.js CHANGED
@@ -117,20 +117,166 @@ function CwTooltip(CwelltTooltipProps) {
117
117
  return (jsxs("div", { className: "cwelltTooltip", children: [jsx("div", { className: "cwelltTooltipTitle", style: CwelltTooltipProps.tooltipTitleStyle, children: jsx("span", { children: CwelltTooltipProps.tooltipTitle }) }), CwelltTooltipProps.children] }));
118
118
  }
119
119
 
120
+ function colorToHSL(color) {
121
+ const hexColor = colorToHEX(color);
122
+ const hex = hexColor.replace('#', '');
123
+ const r = parseInt(hex.substring(0, 2), 16) / 255;
124
+ const g = parseInt(hex.substring(2, 4), 16) / 255;
125
+ const b = parseInt(hex.substring(4, 6), 16) / 255;
126
+ const max = Math.max(r, g, b);
127
+ const min = Math.min(r, g, b);
128
+ let h = 0;
129
+ let s = 0;
130
+ const l = (max + min) / 2;
131
+ if (max !== min) {
132
+ const d = max - min;
133
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
134
+ switch (max) {
135
+ case r:
136
+ h = (g - b) / d + (g < b ? 6 : 0);
137
+ break;
138
+ case g:
139
+ h = (b - r) / d + 2;
140
+ break;
141
+ case b:
142
+ h = (r - g) / d + 4;
143
+ break;
144
+ }
145
+ h /= 6;
146
+ }
147
+ return {
148
+ h: Math.round(h * 360),
149
+ s: Math.round(s * 100),
150
+ l: Math.round(l * 100)
151
+ };
152
+ }
153
+ function colorToHEX(color) {
154
+ const canvas = document.createElement('canvas');
155
+ const context = canvas.getContext('2d');
156
+ if (!context)
157
+ throw new Error('Could not create canvas context');
158
+ context.fillStyle = color;
159
+ return context.fillStyle;
160
+ }
161
+ function getHSLColor(color, alpha = 1) {
162
+ const hsl = colorToHSL(color);
163
+ return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${alpha})`;
164
+ }
165
+ function getContrastColor(color) {
166
+ if (color === null) {
167
+ return '#000000';
168
+ }
169
+ const hsl = colorToHSL(color);
170
+ // Saturated greenyellow and cyan tones need lower luminance threshold (40-35)
171
+ // Saturated mediumblue and blueviolet tones need higher luminance threshold (55-60)
172
+ // Saturated orangered tones need lower luminance threshold (45)
173
+ const isYellowGreen = (hsl.h >= 45 && hsl.h <= 180);
174
+ const isBlueViolet = (hsl.h >= 210 && hsl.h <= 300);
175
+ const isRedOrange = (hsl.h >= 0 && hsl.h <= 30) || (hsl.h >= 330 && hsl.h <= 360);
176
+ let threshold = 50;
177
+ if (isYellowGreen) {
178
+ threshold = 40;
179
+ if (hsl.s >= 70) {
180
+ threshold = 35;
181
+ }
182
+ }
183
+ else if (isBlueViolet) {
184
+ threshold = 55;
185
+ if (hsl.s >= 70) {
186
+ threshold = 60;
187
+ }
188
+ }
189
+ else if (isRedOrange && hsl.s >= 80) {
190
+ threshold = 45;
191
+ }
192
+ const contrastL = hsl.l >= threshold ? 20 : 90;
193
+ const contrastS = Math.min(hsl.s, 90);
194
+ return `hsl(${hsl.h}, ${contrastS}%, ${contrastL}%)`;
195
+ }
196
+
197
+ /**
198
+ * Icon component that supports both FontAwesome 4 and cwellt icon font
199
+ * @example
200
+ * <CwIcon iconId="house" /> // Uses cwellt icon font
201
+ * <CwIcon iconId="house" source="fontawesome" /> // Uses FontAwesome
202
+ */
203
+ function CwIcon(props) {
204
+ const { iconId, source = 'cwellt', ...iconProps } = props;
205
+ // Return appropriate icon based on source
206
+ if (source === 'fontawesome') {
207
+ return jsx("span", { ...iconProps, className: `fa fa-${iconId}` });
208
+ }
209
+ // Use custom icon font
210
+ return jsx("span", { ...iconProps, className: `cwi-icons cwi-${iconId}` });
211
+ }
212
+
213
+ /**
214
+ * CwChip - A simple chip/tag component for displaying labels or categories
215
+ *
216
+ * @example
217
+ * <CwChip label="Active" colorScheme="success" />
218
+ * <CwChip label="High Priority" colorScheme="danger" variant="solid" />
219
+ * <CwChip label="Custom" colorScheme="custom" customColor="#8a2be2" />
220
+ * <CwChip label="Outlined" colorScheme="info" variant="outline" />
221
+ * <CwChip label="Removable" closable onClose={() => console.log('closed')} />
222
+ **/
223
+ const CwChip = ({ label, colorScheme = 'info', customColor, variant = 'soft', className = '', closable = false, onClose, icon, style = {}, }) => {
224
+ // Basic validation
225
+ if (closable && !onClose) {
226
+ console.warn('CwChip: onClose prop is required when closable is true');
227
+ }
228
+ // Calculate styles based on colorScheme, customColor and variant
229
+ const chipStyle = React__default.useMemo(() => {
230
+ if (colorScheme === 'custom' && customColor) {
231
+ if (variant === 'outline') {
232
+ // For outline, customColor is used for border and text
233
+ return {
234
+ color: customColor,
235
+ borderColor: customColor,
236
+ ...style
237
+ };
238
+ }
239
+ else {
240
+ // For soft/solid, customColor is used for background and we calculate contrast
241
+ return {
242
+ backgroundColor: customColor,
243
+ color: getContrastColor(customColor),
244
+ ...style
245
+ };
246
+ }
247
+ }
248
+ return style;
249
+ }, [colorScheme, customColor, variant, style]);
250
+ // Handle click on close icon
251
+ const handleClose = (e) => {
252
+ e.stopPropagation();
253
+ if (onClose) {
254
+ onClose();
255
+ }
256
+ };
257
+ // CSS classes
258
+ const chipClassNames = [
259
+ 'cw-chip',
260
+ className,
261
+ closable ? 'cw-chip-closable' : '',
262
+ ].filter(Boolean).join(' ');
263
+ return (jsxs("span", { className: chipClassNames, "data-color-scheme": colorScheme, "data-variant": variant, style: chipStyle, children: [icon && jsx(CwIcon, { iconId: icon }), label, closable && (jsx("button", { className: "cw-chip-close-button", onClick: handleClose, "aria-label": "Remove", type: "button", children: jsx("span", { className: "cwi-icons cwi-close" }) }))] }));
264
+ };
265
+
120
266
  function CwTag(tagProps) {
121
267
  const hideTag = (event_clickTag) => {
122
268
  const tag = event_clickTag.currentTarget.parentElement;
123
- tag.classList.add("cwellt_display_none");
269
+ tag?.classList.add("cwellt_display_none");
124
270
  };
125
271
  const onClickClosableCustomTag = (event_clickClosableT) => {
126
272
  hideTag(event_clickClosableT);
127
- if (typeof tagProps.onClickClosableTag === "function") {
273
+ if (tagProps.onClickClosableTag != undefined) {
128
274
  tagProps.onClickClosableTag(event_clickClosableT);
129
275
  }
130
276
  };
131
277
  const onClickCustomTag = (event_clickTag) => {
132
278
  // click option interface
133
- if (typeof tagProps.onClickTag === "function") {
279
+ if (tagProps.onClickTag !== undefined) {
134
280
  tagProps.onClickTag(event_clickTag);
135
281
  }
136
282
  };
@@ -140,23 +286,12 @@ function CwTag(tagProps) {
140
286
  " cwelltTag_desc cwellt_flex cwellt_justify_flex_start cwellt_align_items_center", style: tagProps.styleTag_description, children: tagProps.children }), tagProps.closableTag && (jsx("span", { className: "cwi-icons cwi-close", onClick: event_clickClosableT => onClickClosableCustomTag(event_clickClosableT), style: tagProps.styleClosableButton }))] }));
141
287
  }
142
288
 
143
- /**
144
- * An icon from fontawesome4. Find them here: [fontawesome.com/v4](https://fontawesome.com/v4/icons/)
145
- * @example
146
- * <CwIcon id="house" />
147
- */
148
- function CwIcon(props) {
149
- const { iconId, ...iconProps } = props;
150
- // if you wrap this inside a div I WILL find you 🔪
151
- return jsx("i", { ...iconProps, className: `fa fa-${iconId}` });
152
- }
153
-
154
289
  const CW_DEFAULT_MESSAGE_DURATION = 2000;
155
290
  var CwMessageType;
156
291
  (function (CwMessageType) {
157
- CwMessageType["ERROR"] = "times-circle";
158
- CwMessageType["WARN"] = "exclamation-triangle";
159
- CwMessageType["INFO"] = "info-circle";
292
+ CwMessageType["ERROR"] = "close-circle";
293
+ CwMessageType["WARN"] = "warning";
294
+ CwMessageType["INFO"] = "info-bubble";
160
295
  CwMessageType["SUCCESS"] = "check-circle";
161
296
  })(CwMessageType || (CwMessageType = {}));
162
297
  const CwMessage = props => {
@@ -222,30 +357,53 @@ function CwDisplayMessage(message, type, duration) {
222
357
  CwMessageManager.getInstance().showMessage(message, type, duration);
223
358
  }
224
359
 
225
- function CwLoading(props) {
226
- return (jsx("div", { children: jsxs("div", { "aria-busy": props.cwelltBooleanLoading, className: props.cwelltBooleanLoading === true
227
- ? "cwellt_flex cwellt_flex_column cwelltContentLoading " +
228
- (props.cwelltClassNameContentLoading === undefined ? "" : props.cwelltClassNameContentLoading)
229
- : "", children: [props.cwelltBooleanLoading === true ? (
230
- // Container loading [ Icon and text of loading here is the property: cwelltClassNameLoading to custom orientation Vertical or Horizontal ]
231
- jsxs("div", { className: props.cwelltClassNameLoading === undefined
232
- ? "cwelltContainerLoading cwellt_flex cwellt_justify_center cwellt_align_items_center cwellt_flex_wrap "
233
- : props.cwelltClassNameLoading +
234
- " cwelltContainerLoading cwellt_flex cwellt_justify_center cwellt_align_items_center cwellt_flex_wrap", children: [jsx("div", { className: props.cwelltSizeLoading === undefined
235
- ? "cwelltDefaultLoadingSize cwellt_loading cwellt_flex cwellt_align_items_center "
236
- : props.cwelltSizeLoading +
237
- " cwelltDefaultLoadingSize cwellt_loading cwellt_flex cwellt_align_items_center ", children: jsx("span", { className: "cwelltIconLoading cwellt_flex cwellt_justify_center cwellt_align_items_center" }) }), jsx("div", { className: "cwelltTextLoading", children: jsx("h1", { children: props.cwelltTextLoading }) })] })) : (jsx("div", {})), jsx("div", { className: props.cwelltBooleanLoading === true ? "cwelltContentLoadingDisabled" : "", children: props.children })] }) }));
360
+ /**
361
+ * CwLoading
362
+ *
363
+ * A versatile loading component that shows a spinner with optional text
364
+ * and disables the wrapped content while in loading state.
365
+ *
366
+ * @example
367
+ * // Basic usage
368
+ * <CwLoading isLoading={isSubmitting}>
369
+ * <form>...</form>
370
+ * </CwLoading>
371
+ *
372
+ * // With custom text and size
373
+ * <CwLoading
374
+ * isLoading={isLoading}
375
+ * text="Please wait..."
376
+ * size="large"
377
+ * >
378
+ * <UserProfile />
379
+ * </CwLoading>
380
+ */
381
+ function CwLoading({ isLoading = false, text = '', size = 'regular', iconPosition = 'outside', iconName = 'cwi-plane-solid', animation = 'spin', children }) {
382
+ const iconClasses = `cwi-icons ${iconName || ''}`;
383
+ return (jsxs("div", { "aria-busy": isLoading, className: isLoading ? 'cw-loading-container' : '', children: [isLoading && (jsxs("div", { className: "cw-loading-content", "data-size": size, "data-animation": animation, children: [jsx("div", { className: "cw-loading", "data-icon-position": iconPosition, children: jsx("span", { className: iconClasses }) }), text && (jsx("p", { children: text }))] })), jsx("div", { className: isLoading ? 'cw-loading-disabled-content' : '', children: children })] }));
238
384
  }
239
385
 
386
+ /**
387
+ * @deprecated since may 2025. Use <CwLoading size="small"> instead.
388
+ *
389
+ * This component will be removed in a future release.
390
+ *
391
+ * @example
392
+ * // Instead of:
393
+ * <CwLoadingSmall />
394
+ *
395
+ * // Use:
396
+ * <CwLoading size="small" />
397
+ */
240
398
  function CwLoadingSmall(CwelltLoadingAppointements) {
241
- return (jsx("div", { children: CwelltLoadingAppointements.cwelltBooleanLoadingAppointment === true ? (
399
+ return (jsx("div", { children: CwelltLoadingAppointements.isLoading === true ? (
242
400
  // * Show loading appointment
243
- jsx("div", { className: "cwellt_loadingAppointmentContainer cwellt_loading cwellt_flex cwellt_align_items_center cwellt_loading cwellt_flex cwellt_align_items_center ", children: jsx("span", { className: "cwelltIconLoading cwellt_flex cwellt_justify_center cwellt_align_items_center" }) })) : (
401
+ jsx("div", { className: "cw-loading-container", children: jsx("div", { className: "cw-loading" }) })) : (
244
402
  // Show empty div
245
- jsx("div", { className: "cwellt_d_none" })) }));
403
+ jsx("div", {})) }));
246
404
  }
247
405
 
248
- var styles$b = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si"};
406
+ var styles$c = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si","cwi-icons":"cw-generic-tooltip-module_cwi-icons__0-vzj"};
249
407
 
250
408
  // Constants moved outside to prevent recreation
251
409
  const margin = 16;
@@ -356,12 +514,12 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
356
514
  const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => {
357
515
  setIsVisible(true);
358
516
  }, showDelay);
359
- const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$b["cw-generic-tooltip-content"]);
517
+ const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$c["cw-generic-tooltip-content"]);
360
518
  // Memoize tooltip content creation
361
519
  const tooltipContent = useMemo(() => {
362
520
  if (hide || !isVisible || !content)
363
521
  return null;
364
- return createPortal(jsx("div", { className: styles$b["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, style: {
522
+ return createPortal(jsx("div", { className: styles$c["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, style: {
365
523
  position: 'fixed',
366
524
  top: `${tooltipPosition.top}px`,
367
525
  left: `${tooltipPosition.left}px`,
@@ -376,7 +534,7 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
376
534
  clearTooltipTimeout();
377
535
  setIsVisible(false);
378
536
  }, [clearTooltipTimeout]);
379
- return (jsxs("div", { ref: containerRef, className: styles$b["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, children: [tooltipContent, children] }));
537
+ return (jsxs("div", { ref: containerRef, className: styles$c["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, children: [tooltipContent, children] }));
380
538
  };
381
539
 
382
540
  // Reference for draggable modal
@@ -495,62 +653,107 @@ class CwModalIframe extends React.Component {
495
653
  }
496
654
  }
497
655
 
498
- var styles$a = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8"};
656
+ var styles$b = {"cw-dialog-main":"cw-dialog-module_cw-dialog-main__cHxHt","cw-dialog-button-close":"cw-dialog-module_cw-dialog-button-close__9GRd8"};
499
657
 
500
658
  // Helper function to parse size values
501
659
  const parseSize = (size) => {
502
660
  if (typeof size === 'number')
503
661
  return { value: size, unit: 'px' };
504
662
  // Match numeric value and unit
505
- const match = size.match(/^([\d.]+)(\D+)$/);
663
+ const match = String(size).match(/^([\d.]+)(\D+)$/);
506
664
  if (match) {
507
- return { value: parseFloat(match[1]), unit: match[2] };
665
+ const unit = match[2];
666
+ // Only allow px, rem, vw, vh
667
+ if (['px', 'rem', 'vw', 'vh'].includes(unit)) {
668
+ return { value: parseFloat(match[1]), unit };
669
+ }
508
670
  }
509
- // Default to pixels if no unit specified
510
- return { value: parseFloat(size), unit: 'px' };
671
+ // Default to pixels if no unit specified or unit not supported
672
+ return { value: parseFloat(String(size)), unit: 'px' };
511
673
  };
512
674
  // Helper to convert size to px for calculations
513
675
  const convertToPx = (size) => {
514
- if (size.unit === 'px')
515
- return size.value;
516
- if (size.unit === 'rem')
517
- return size.value * 16; // Assuming 1rem = 16px
518
- if (size.unit === 'vh')
519
- return (window.innerHeight * size.value) / 100;
520
- if (size.unit === 'vw')
521
- return (window.innerWidth * size.value) / 100;
522
- return size.value; // Default fallback
676
+ switch (size.unit) {
677
+ case 'px': return size.value;
678
+ case 'rem': return size.value * 16; // Assuming 1rem = 16px
679
+ case 'vh': return (window.innerHeight * size.value) / 100;
680
+ case 'vw': return (window.innerWidth * size.value) / 100;
681
+ default: return size.value; // Default fallback
682
+ }
683
+ };
684
+ // Function to convert from px back to original unit
685
+ const convertFromPx = (px, unit) => {
686
+ switch (unit) {
687
+ case 'px': return px;
688
+ case 'rem': return px / 16;
689
+ case 'vh': return (px * 100) / window.innerHeight;
690
+ case 'vw': return (px * 100) / window.innerWidth;
691
+ default: return px;
692
+ }
523
693
  };
524
694
  const CwDialog = props => {
695
+ const { customFooter, customHeader, headline, width, height, dialogSize, scrim, onSave, onClose, hideFooter, children, open, ...domProps } = props;
525
696
  const dialogRef = useRef(null);
526
- // Default width and height with units
527
- const defaultWidth = 800;
528
- const defaultHeight = 600;
529
- // Parse width and height from props or use defaults
530
- const initialWidth = props.dialogSize?.width !== undefined ? props.dialogSize.width : defaultWidth;
531
- const initialHeight = props.dialogSize?.height !== undefined ? props.dialogSize.height : defaultHeight;
532
- // Parse the sizes to separate value and unit
533
- const parsedWidth = parseSize(initialWidth);
534
- const parsedHeight = parseSize(initialHeight);
535
- // Convert to px for internal calculations
536
- const initialWidthPx = convertToPx(parsedWidth);
537
- const initialHeightPx = convertToPx(parsedHeight);
538
- const initialDialogSize = {
539
- width: initialWidthPx,
540
- height: initialHeightPx,
541
- widthUnit: parsedWidth.unit,
542
- heightUnit: parsedHeight.unit
543
- };
697
+ const initialSetup = useMemo(() => {
698
+ // Default width and height with units
699
+ const defaultWidth = 800;
700
+ // Priority: direct props > dialogSize > default values
701
+ const initialWidth = width !== undefined
702
+ ? width
703
+ : dialogSize?.width !== undefined
704
+ ? dialogSize.width
705
+ : defaultWidth;
706
+ const initialHeight = height !== undefined
707
+ ? height
708
+ : dialogSize?.height !== undefined
709
+ ? dialogSize.height
710
+ : undefined; // Undefined for autoHeight
711
+ // Determine if height is automatic when height is not provided
712
+ const isAutoHeight = initialHeight === undefined;
713
+ // Parse the sizes to separate value and unit
714
+ const parsedWidth = parseSize(initialWidth);
715
+ const parsedHeight = isAutoHeight
716
+ ? { value: 0, unit: 'auto' }
717
+ : parseSize(initialHeight);
718
+ // Convert to px for internal calculations
719
+ const initialWidthPx = convertToPx(parsedWidth);
720
+ const initialHeightPx = isAutoHeight ? 0 : convertToPx(parsedHeight);
721
+ // Use estimated height for initial positioning when autoHeight is true
722
+ const initialEstimatedHeight = isAutoHeight ? 300 : initialHeightPx;
723
+ const initialDialogSize = {
724
+ width: initialWidthPx,
725
+ height: initialHeightPx,
726
+ widthUnit: parsedWidth.unit,
727
+ heightUnit: parsedHeight.unit,
728
+ autoHeight: isAutoHeight
729
+ };
730
+ const initialPosition = {
731
+ x: window.document.body.clientWidth / 2 - initialWidthPx / 2,
732
+ y: window.document.body.clientHeight / 2 - initialEstimatedHeight / 2
733
+ };
734
+ return { initialDialogSize, initialPosition };
735
+ }, [width, height, dialogSize]); // Only recalculate when these props change
544
736
  const [isDragging, setIsDragging] = useState(false);
545
737
  const [resizeDirection, setResizeDirection] = useState(null);
546
- const [position, setPosition] = useState({
547
- x: window.document.body.clientWidth / 2 - initialDialogSize.width / 2,
548
- y: window.document.body.clientHeight / 2 - initialDialogSize.height / 2
549
- });
550
- const [size, setSize] = useState(initialDialogSize);
738
+ const [position, setPosition] = useState(initialSetup.initialPosition);
739
+ const [size, setSize] = useState(initialSetup.initialDialogSize);
551
740
  const [dragStart, setDragStart] = useState({ x: 0, y: 0 });
552
741
  // scrim is true by default
553
- const hasScrim = props.scrim !== false;
742
+ const hasScrim = scrim !== false;
743
+ // Adjust position after the dialog is rendered when using autoHeight
744
+ useEffect(() => {
745
+ if (size.autoHeight && dialogRef.current && open) {
746
+ // Get the actual height after rendering
747
+ const actualHeight = dialogRef.current.offsetHeight;
748
+ // Only update position if height is available
749
+ if (actualHeight > 0) {
750
+ setPosition(prevPos => ({
751
+ ...prevPos,
752
+ y: window.document.body.clientHeight / 2 - actualHeight / 2
753
+ }));
754
+ }
755
+ }
756
+ }, [size.autoHeight, open]);
554
757
  useEffect(() => {
555
758
  const handleMouseMove = (e) => {
556
759
  if (isDragging) {
@@ -580,29 +783,39 @@ const CwDialog = props => {
580
783
  let newY = position.y;
581
784
  const minVisiblePx = 64;
582
785
  const minSize = 100;
583
- if (resizeDirection.includes("w")) {
584
- const dx = e.clientX - position.x;
585
- newWidth = Math.max(size.width - dx, minSize);
586
- newX = Math.min(Math.max(position.x + dx, minVisiblePx - newWidth), position.x + size.width - minSize);
587
- }
588
- if (resizeDirection.includes("e")) {
589
- newWidth = Math.min(Math.max(e.clientX - position.x, minSize), parentRect.width - position.x + dialogRect.width - minVisiblePx);
786
+ // Only allow horizontal resizing if autoHeight is true
787
+ if (!size.autoHeight || (!resizeDirection.includes("n") && !resizeDirection.includes("s"))) {
788
+ // Logic for horizontal resizing
789
+ if (resizeDirection.includes("w")) {
790
+ const dx = e.clientX - position.x;
791
+ newWidth = Math.max(size.width - dx, minSize);
792
+ newX = Math.min(Math.max(position.x + dx, minVisiblePx - newWidth), position.x + size.width - minSize);
793
+ }
794
+ if (resizeDirection.includes("e")) {
795
+ newWidth = Math.min(Math.max(e.clientX - position.x, minSize), parentRect.width - position.x + dialogRect.width - minVisiblePx);
796
+ }
590
797
  }
591
- if (resizeDirection.includes("n")) {
592
- const dy = e.clientY - position.y;
593
- newHeight = Math.max(size.height - dy, minSize);
594
- newY = Math.min(Math.max(position.y + dy, minVisiblePx - newHeight), position.y + size.height - minSize);
595
- }
596
- if (resizeDirection.includes("s")) {
597
- newHeight = Math.min(Math.max(e.clientY - position.y, minSize), parentRect.height - position.y + dialogRect.height - minVisiblePx);
798
+ // Only apply vertical resizing if autoHeight is false
799
+ if (!size.autoHeight) {
800
+ if (resizeDirection.includes("n")) {
801
+ const dy = e.clientY - position.y;
802
+ newHeight = Math.max(size.height - dy, minSize);
803
+ newY = Math.min(Math.max(position.y + dy, minVisiblePx - newHeight), position.y + size.height - minSize);
804
+ }
805
+ if (resizeDirection.includes("s")) {
806
+ newHeight = Math.min(Math.max(e.clientY - position.y, minSize), parentRect.height - position.y + dialogRect.height - minVisiblePx);
807
+ }
598
808
  }
599
809
  // Ensure the modal stays within bounds after resizing
600
810
  newX = Math.min(Math.max(newX, minVisiblePx - newWidth), parentRect.width - minVisiblePx);
601
811
  newY = Math.min(Math.max(newY, minVisiblePx - newHeight), parentRect.height - minVisiblePx);
812
+ // Update state maintaining original units
602
813
  setSize({
603
- ...size,
604
814
  width: newWidth,
605
- height: newHeight
815
+ height: newHeight,
816
+ widthUnit: size.widthUnit,
817
+ heightUnit: size.heightUnit,
818
+ autoHeight: size.autoHeight
606
819
  });
607
820
  setPosition({ x: newX, y: newY });
608
821
  }
@@ -620,41 +833,54 @@ const CwDialog = props => {
620
833
  document.removeEventListener("mouseup", handleMouseUp);
621
834
  };
622
835
  }, [isDragging, resizeDirection, dragStart, position, size]);
623
- const handleMouseDown = (e) => {
836
+ const handleMouseDown = useCallback((e) => {
624
837
  setIsDragging(true);
625
838
  setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });
626
- };
627
- const handleResizeMouseDown = (direction) => (e) => {
839
+ }, [position]);
840
+ const handleResizeMouseDown = useCallback((direction) => (e) => {
628
841
  e.stopPropagation();
629
842
  setResizeDirection(direction);
630
- };
631
- const header = (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: props.headline }), props.customHeader || (jsx("button", { className: styles$a["cw-dialog-button-close"], onClick: props.onClose, children: "\u2A2F" }))] }));
632
- const content = (jsx("section", { style: { flex: 1, overflowX: "auto", overflowY: "auto", width: "100%" }, children: props.children }));
633
- const footer = (jsx("footer", { style: { width: "100%" }, children: props.customFooter || (jsx("button", { className: "cw-button-icon cwi-save", onClick: props.onSave })) }));
634
- const resizeHandles = [
635
- jsx("div", { "data-handle-n": true, onMouseDown: handleResizeMouseDown("n") }, "handle-n"),
636
- jsx("div", { "data-handle-s": true, onMouseDown: handleResizeMouseDown("s") }, "handle-s"),
637
- jsx("div", { "data-handle-e": true, onMouseDown: handleResizeMouseDown("e") }, "handle-e"),
638
- jsx("div", { "data-handle-w": true, onMouseDown: handleResizeMouseDown("w") }, "handle-w"),
639
- jsx("div", { "data-handle-ne": true, onMouseDown: handleResizeMouseDown("ne") }, "handle-ne"),
640
- jsx("div", { "data-handle-nw": true, onMouseDown: handleResizeMouseDown("nw") }, "handle-nw"),
641
- jsx("div", { "data-handle-se": true, onMouseDown: handleResizeMouseDown("se") }, "handle-se"),
642
- jsx("div", { "data-handle-sw": true, onMouseDown: handleResizeMouseDown("sw") }, "handle-sw")
643
- ];
644
- // Prepare width and height with units for display
645
- const displayWidth = `${size.width}${size.widthUnit === 'px' ? 'px' : size.widthUnit}`;
646
- const displayHeight = `${size.height}${size.heightUnit === 'px' ? 'px' : size.heightUnit}`;
647
- return (props.open && (jsx("div", { "data-has-scrim": hasScrim, className: styles$a["cw-dialog-main"], children: jsxs("dialog", { ...props, ref: dialogRef, style: {
843
+ }, []);
844
+ const handleScrimClick = useCallback((e) => {
845
+ if (e.target === e.currentTarget && onClose) {
846
+ onClose();
847
+ }
848
+ }, [onClose]);
849
+ const header = useMemo(() => (jsxs("header", { onMouseDown: handleMouseDown, children: [jsx("span", { children: headline }), customHeader || (jsx("button", { className: styles$b["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
850
+ const content = useMemo(() => (jsx("section", { children: children })), [children]);
851
+ const footer = useMemo(() => (jsx("footer", { children: customFooter || (jsx("button", { className: "cw-button-icon cwi-save", onClick: onSave })) })), [customFooter, onSave]);
852
+ const resizeHandles = useMemo(() => size.autoHeight
853
+ ? [
854
+ // Only horizontal handles if autoHeight is true
855
+ jsx("div", { "data-handle-e": true, onMouseDown: handleResizeMouseDown("e") }, "handle-e"),
856
+ jsx("div", { "data-handle-w": true, onMouseDown: handleResizeMouseDown("w") }, "handle-w")
857
+ ]
858
+ : [
859
+ // All handles if autoHeight is false
860
+ jsx("div", { "data-handle-n": true, onMouseDown: handleResizeMouseDown("n") }, "handle-n"),
861
+ jsx("div", { "data-handle-s": true, onMouseDown: handleResizeMouseDown("s") }, "handle-s"),
862
+ jsx("div", { "data-handle-e": true, onMouseDown: handleResizeMouseDown("e") }, "handle-e"),
863
+ jsx("div", { "data-handle-w": true, onMouseDown: handleResizeMouseDown("w") }, "handle-w"),
864
+ jsx("div", { "data-handle-ne": true, onMouseDown: handleResizeMouseDown("ne") }, "handle-ne"),
865
+ jsx("div", { "data-handle-nw": true, onMouseDown: handleResizeMouseDown("nw") }, "handle-nw"),
866
+ jsx("div", { "data-handle-se": true, onMouseDown: handleResizeMouseDown("se") }, "handle-se"),
867
+ jsx("div", { "data-handle-sw": true, onMouseDown: handleResizeMouseDown("sw") }, "handle-sw")
868
+ ], [size.autoHeight, handleResizeMouseDown]);
869
+ const displayDimensions = useMemo(() => {
870
+ // Prepare width and height with original units for display
871
+ const displayWidth = `${convertFromPx(size.width, size.widthUnit)}${size.widthUnit}`;
872
+ // If autoHeight, don't specify height and let it adapt to content
873
+ const displayHeight = size.autoHeight
874
+ ? 'auto'
875
+ : `${convertFromPx(size.height, size.heightUnit)}${size.heightUnit}`;
876
+ return { displayWidth, displayHeight };
877
+ }, [size.width, size.height, size.widthUnit, size.heightUnit, size.autoHeight]);
878
+ return (open && (jsx("div", { "data-has-scrim": hasScrim, className: styles$b["cw-dialog-main"], onClick: handleScrimClick, children: jsxs("dialog", { ...domProps, ref: dialogRef, style: {
648
879
  left: `${position.x}px`,
649
880
  top: `${position.y}px`,
650
- width: displayWidth,
651
- height: displayHeight,
652
- zIndex: props.zIndex,
653
- minWidth: "200px", // Set an appropriate minimum size
654
- minHeight: "200px", // Set an appropriate minimum size
655
- display: "flex",
656
- flexDirection: "column"
657
- }, children: [header, content, props.isReport !== true && footer, resizeHandles] }) })));
881
+ width: displayDimensions.displayWidth,
882
+ height: displayDimensions.displayHeight
883
+ }, children: [header, content, hideFooter !== true && footer, resizeHandles] }) })));
658
884
  };
659
885
 
660
886
  const CwModalReportFunctional = (props) => {
@@ -675,7 +901,9 @@ const CwModalReportFunctional = (props) => {
675
901
  return (jsxs("div", { children: ["Please add a(n) ", props.reportName, " report in ", props.moduleSettings, " Settings"] }));
676
902
  }
677
903
  };
678
- return (jsx("div", { id: "cwelltModalReportContent", children: isModal ? (jsx(CwDialog, { open: props.visible, dialogSize: { width: props.width, height: props.height }, headline: props.title, customFooter: [jsx("div", {}, "footer")], onClose: props.onCloseModal, isReport: true, children: renderContentModal() })) : (jsx("div", { children: renderContentNotModal() })) }));
904
+ return (jsx("div", { id: "cwelltModalReportContent", children: isModal ? (jsx(CwDialog, { open: props.visible, width: props.width, headline: props.title,
905
+ //customFooter={[<div key="footer"></div>]}
906
+ onClose: props.onCloseModal, hideFooter: true, children: renderContentModal() })) : (jsx("div", { children: renderContentNotModal() })) }));
679
907
  };
680
908
 
681
909
  class CwReportModal extends React.Component {
@@ -695,10 +923,10 @@ class CwReportModal extends React.Component {
695
923
  };
696
924
  }
697
925
  render() {
698
- return (jsx("div", { id: "cwelltModalReportContent", children: this.state.isModal === true ? (jsxs(CwDialog, { open: this.props.visible, dialogSize: { width: this.props.width, height: this.props.height }, headline: this.props.title, customFooter: new Array(jsx("div", {})), onClose: () => {
926
+ return (jsx("div", { id: "cwelltModalReportContent", children: this.state.isModal === true ? (jsxs(CwDialog, { open: this.props.visible, width: this.props.width, headline: this.props.title, customFooter: new Array(jsx("div", {})), onClose: () => {
699
927
  this.formRef?.current?.resetFields();
700
928
  this.props.SET_MODAL_REPORT_VISIBLE(false);
701
- }, isReport: true, 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: "600px" })), this.props.name === "Empty.pdf" && (jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
929
+ }, hideFooter: true, 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: "600px" })), this.props.name === "Empty.pdf" && (jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
702
930
  }
703
931
  }
704
932
 
@@ -799,6 +1027,59 @@ class CwDialogManager {
799
1027
  }
800
1028
  }
801
1029
 
1030
+ var styles$a = {"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","headerContent":"cw-card-module_headerContent__x4Jfl","footerTags":"cw-card-module_footerTags__80sSW","loadingOverlay":"cw-card-module_loadingOverlay__8-zVV"};
1031
+
1032
+ /**
1033
+ * CwCard - A simple card component for displaying content in a contained format
1034
+ *
1035
+ * @example
1036
+ * <CwCard
1037
+ * title="Card Title"
1038
+ * subtitle="Card Subtitle"
1039
+ * onEdit={handleEdit}
1040
+ * onDelete={confirmDeletion}
1041
+ * footer="Last updated: 2 days ago"
1042
+ * chips={[
1043
+ * { label: 'Important', colorScheme: 'danger' },
1044
+ * { label: 'Custom', colorScheme: 'custom', customColor: '#8a2be2' }
1045
+ * ]}
1046
+ * >
1047
+ * <p>This is the main content of the card.</p>
1048
+ * </CwCard>
1049
+ **/
1050
+ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, onEdit, onDelete, extraActions, className = '', clickable = false, onClick, isLoading = false, disabled = false, style, chips = [], variant = "border", direction = "column", }) => {
1051
+ // Construct class names using CSS modules
1052
+ const cardClassNames = [
1053
+ 'cw-card',
1054
+ styles$a.card,
1055
+ className,
1056
+ clickable ? styles$a.clickable : '',
1057
+ disabled ? styles$a.disabled : '',
1058
+ isLoading ? styles$a.loading : '',
1059
+ ].filter(Boolean).join(' ');
1060
+ // Handle click event when card is clickable
1061
+ const handleClick = () => {
1062
+ if (clickable && onClick && !disabled && !isLoading) {
1063
+ onClick();
1064
+ }
1065
+ };
1066
+ // Determine if actions should be rendered
1067
+ const hasActions = onEdit || onDelete || extraActions;
1068
+ // Determine if header should be rendered
1069
+ const hasHeader = title || subtitle || (hasActions && direction === "column");
1070
+ // Determine if chips should be rendered
1071
+ const hasChips = chips.length > 0;
1072
+ // Determine if footer should be rendered
1073
+ const hasFooter = hasChips || footer || (hasActions && direction === "row");
1074
+ // Actions component to reuse
1075
+ const ActionsComponent = hasActions && !disabled ? (jsxs("div", { className: styles$a.actions, children: [extraActions ?? null, onEdit && jsx("button", { className: "cw-button-icon cwi-edit", onClick: onEdit }), onDelete && jsx("button", { className: "cw-button-icon cwi-delete", "data-button-variant": "danger", onClick: onDelete })] })) : null;
1076
+ return (jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && {
1077
+ role: 'button',
1078
+ tabIndex: 0,
1079
+ onClick: handleClick,
1080
+ }), "data-variant": variant, "data-direction": direction, children: [hasHeader && (jsxs("header", { children: [(title || subtitle) && (jsxs("div", { className: styles$a.headerContent, "data-alignment": alignment, children: [title && jsx("h5", { children: title }), subtitle && jsx("strong", { children: subtitle })] })), direction === "column" && ActionsComponent] })), jsx("div", { className: styles$a.content, children: children }), hasFooter && (jsxs("footer", { children: [hasChips && (jsx("div", { className: styles$a.footerTags, children: chips.map((chip, index) => (jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$a.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsx("div", { className: styles$a.footerContent, children: footer }))] })), direction === "row" && ActionsComponent, isLoading && (jsx("div", { className: styles$a.loadingOverlay, children: jsx(CwLoading, { isLoading: isLoading, size: "small" }) }))] }));
1081
+ };
1082
+
802
1083
  var styles$9 = {"cw-accordion":"cw-accordion-module_cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module_cw-accordion-body__xlI8b"};
803
1084
 
804
1085
  /**
@@ -820,161 +1101,202 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
820
1101
  }
821
1102
 
822
1103
  /**
823
- * A Table view
824
- * @param props
1104
+ * A reusable and customizable table component.
1105
+ *
1106
+ * @param props - Component props to configure columns, data, styles, pagination, expanded rows, and more.
1107
+ *
825
1108
  * @example
826
- * const columns = [
1109
+ * const columns: Column<User>[] = [
827
1110
  * {
828
1111
  * title: 'Name',
829
1112
  * dataIndex: 'name',
830
1113
  * key: 'name',
1114
+ * sortable: true, // Column is sortable
1115
+ * width: 100 // You can define the width of the column
831
1116
  * },
832
1117
  * {
833
1118
  * title: 'Age',
834
1119
  * dataIndex: 'age',
835
1120
  * key: 'age',
836
- * render: (age) => <span>{age} years</span>, // Example of custom rendering
1121
+ * sortable: true,
1122
+ * render: (item) => <span>{item.age} years</span> // Custom rendering
837
1123
  * },
838
1124
  * {
839
1125
  * title: 'Address',
840
1126
  * dataIndex: 'address',
841
1127
  * key: 'address',
842
- * render: (address) => (
843
- * <a href={`https://maps.google.com/?q=${encodeURIComponent(address)}`} target="_blank">
844
- * {address}
1128
+ * render: (item) => (
1129
+ * <a href={`https://maps.google.com/?q=${encodeURIComponent(item.address)}`} target="_blank" rel="noreferrer">
1130
+ * {item.address}
845
1131
  * </a>
846
- * ), // Example of custom link rendering
847
- * },
1132
+ * ) // Link rendering
1133
+ * }
848
1134
  * ];
849
1135
  *
850
- * const data = [
851
- * {
852
- * key: '1',
853
- * name: 'Mike',
854
- * age: 32,
855
- * address: '10 Downing Street',
856
- * },
857
- * {
858
- * key: '2',
859
- * name: 'John',
860
- * age: 42,
861
- * address: '10 Downing Street',
862
- * },
863
- * {
864
- * key: '3',
865
- * name: 'Andres',
866
- * age: 33,
867
- * address: '10 Downing Street',
868
- * },
869
- * {
870
- * key: '4',
871
- * name: 'Gabriel',
872
- * age: 22,
873
- * address: '10 Downing Street',
874
- * },
875
- * {
876
- * key: '5',
877
- * name: 'Sergio',
878
- * age: 47,
879
- * address: '10 Downing Street',
880
- * },
881
- * {
882
- * key: '6',
883
- * name: 'Zacarias',
884
- * age: 61,
885
- * address: '10 Downing Street',
886
- * },
1136
+ * const data:User[] = [
1137
+ * { key: '1', name: 'Mike', age: 32, address: '10 Downing Street' },
1138
+ * { key: '2', name: 'John', age: 42, address: '11 Downing Street' },
1139
+ * { key: '3', name: 'Andres', age: 33, address: '12 Downing Street' },
1140
+ * { key: '4', name: 'Gabriel', age: 22, address: '13 Downing Street' },
1141
+ * { key: '5', name: 'Sergio', age: 47, address: '14 Downing Street' },
1142
+ * { key: '6', name: 'Zacarias', age: 61, address: '15 Downing Street' }
887
1143
  * ];
888
1144
  *
889
- * const generateExpandedContent = (record) => {
890
- * var testValue = record;
891
- * return (
892
- * <div>
893
- * Contenido expandido personalizado para {record.name}
894
- * </div>
895
- * );
896
- * };
897
- *
898
- * ------------------------- render ---------------------------
1145
+ * const generateExpandedContent = (record) => (
1146
+ * <div>
1147
+ * Custom expanded content for {record.name}
1148
+ * </div>
1149
+ * );
899
1150
  *
900
- * <CwTable
1151
+ * <CwTable<User>
901
1152
  * columns={columns}
902
- * data={data} // WTF whatever array of objects you add here, make sure each has a key otherwise everything will expand
903
- * itemsPerPage={3}
1153
+ * data={data}
904
1154
  * pagination={true}
1155
+ * pageSizeOptions={[3, 5, 10]} // Optional, defaults to [5, 10, 20, 50]
905
1156
  * expandedRowRender={generateExpandedContent}
906
- * onExpand={(e)=> test(e)}
1157
+ * onExpand={(item) => console.log('Expanded:', item)}
1158
+ * rowKey="key" // Optional, defaults to 'key'
1159
+ * textNoData="No data available" // Optional message when no data
1160
+ * loading={false} // Optional, shows loading indicator
1161
+ * scrollHeight={300} // Optional scroll height, defaults to 300
1162
+ * stickyHeader={true} // Optional, makes header sticky on scroll
1163
+ * classNameContainer="my-table-wrapper" // Optional wrapper class
1164
+ * className="my-table" // Optional table class
1165
+ * classNameRow="my-table-row" // Optional class for each row
1166
+ * id="custom-table-id" // Optional ID for the container
1167
+ * style={{ border: '1px solid #ccc' }} // Optional inline styles
907
1168
  * />
1169
+ *
908
1170
  * @returns React component
909
1171
  */
910
- function CwTable({ columns, data, pagination, itemsPerPage, expandedRowRender, onExpand, className, classNameHeader, classNameRow, style, classNameContainer, id, textNoData }) {
1172
+ 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, }) {
911
1173
  const [currentPage, setCurrentPage] = useState(1);
912
1174
  const [expandedRowKey, setExpandedRowKey] = useState(null);
913
1175
  const [sortConfig, setSortConfig] = useState({
914
1176
  key: null,
915
1177
  direction: "asc"
916
1178
  });
917
- // Function to handle expanding/collapsing rows
918
- const handleRowExpand = (rowKey) => {
919
- if (expandedRowKey === rowKey.key) {
920
- setExpandedRowKey(null);
921
- }
922
- else {
923
- setExpandedRowKey(rowKey.key);
924
- }
925
- if (typeof onExpand === "function") {
926
- onExpand(rowKey);
927
- }
928
- };
929
- // Function to handle sorting by column
930
- const handleSort = (columnKey) => {
931
- let direction = "asc";
932
- if (sortConfig.key === columnKey && sortConfig.direction === "asc") {
933
- direction = "desc";
934
- }
935
- setSortConfig({ key: columnKey, direction });
936
- };
937
- // Use useMemo to calculate sortedData
1179
+ const [localItemsPerPage, setLocalItemsPerPage] = useState(pageSizeOptions[0]);
1180
+ const [columnWidths, setColumnWidths] = useState(() => columns.reduce((acc, col) => {
1181
+ if (col.width)
1182
+ acc[col.key] = col.width;
1183
+ return acc;
1184
+ }, {}));
1185
+ const handleItemsPerPageChange = useCallback((e) => {
1186
+ setLocalItemsPerPage(parseInt(e.target.value, 10));
1187
+ setCurrentPage(1);
1188
+ }, []);
1189
+ const handleRowExpand = useCallback((item) => {
1190
+ const itemKey = item[rowKey];
1191
+ setExpandedRowKey((prev) => (prev === itemKey ? null : itemKey));
1192
+ onExpand?.(item);
1193
+ }, [rowKey, onExpand]);
1194
+ const handleSort = useCallback((columnKey) => {
1195
+ setSortConfig(prev => {
1196
+ if (prev.key !== columnKey)
1197
+ return { key: columnKey, direction: "asc" };
1198
+ if (prev.direction === "asc")
1199
+ return { key: columnKey, direction: "desc" };
1200
+ return { key: null, direction: "asc" };
1201
+ });
1202
+ }, []);
938
1203
  const sortedData = useMemo(() => {
939
1204
  if (!data || data.length === 0)
940
- return null;
1205
+ return [];
941
1206
  const dataCopy = [...data];
942
- if (sortConfig.key !== null) {
1207
+ if (sortConfig.key) {
943
1208
  dataCopy.sort((a, b) => {
944
- const aValue = a[sortConfig.key];
945
- const bValue = b[sortConfig.key];
946
- if (aValue < bValue) {
947
- return sortConfig.direction === "asc" ? -1 : 1;
948
- }
949
- if (aValue > bValue) {
950
- return sortConfig.direction === "asc" ? 1 : -1;
951
- }
952
- return 0;
1209
+ const aVal = a[sortConfig.key];
1210
+ const bVal = b[sortConfig.key];
1211
+ return (aVal < bVal ? -1 : aVal > bVal ? 1 : 0) * (sortConfig.direction === "asc" ? 1 : -1);
953
1212
  });
954
1213
  }
955
1214
  return dataCopy;
956
1215
  }, [data, sortConfig]);
957
- // Calculate paged data only if sortedData is not null
958
1216
  const paginatedData = useMemo(() => {
959
1217
  if (!sortedData)
960
- return null;
961
- const startIndex = itemsPerPage !== undefined ? (currentPage - 1) * itemsPerPage : 0;
962
- const endIndex = itemsPerPage !== undefined ? startIndex + itemsPerPage : sortedData.length;
963
- return sortedData.slice(startIndex, endIndex);
964
- }, [sortedData, currentPage, itemsPerPage]);
965
- // Calculate the total number of pages for pagination
1218
+ return [];
1219
+ if (!pagination)
1220
+ return sortedData;
1221
+ const start = (currentPage - 1) * localItemsPerPage;
1222
+ return sortedData.slice(start, start + localItemsPerPage);
1223
+ }, [sortedData, currentPage, localItemsPerPage, pagination]);
966
1224
  const totalPages = useMemo(() => {
967
- if (!sortedData)
968
- return 0;
969
- return itemsPerPage !== undefined ? Math.ceil(sortedData.length / itemsPerPage) : 1;
970
- }, [sortedData, itemsPerPage]);
971
- // Function to handle page change
972
- const handlePageChange = (newPage) => {
973
- if (newPage >= 1 && newPage <= totalPages) {
974
- setCurrentPage(newPage);
1225
+ return pagination ? Math.ceil(sortedData.length / localItemsPerPage) : 1;
1226
+ }, [sortedData, localItemsPerPage, pagination]);
1227
+ const handlePageChange = (page) => {
1228
+ if (page >= 1 && page <= totalPages)
1229
+ setCurrentPage(page);
1230
+ };
1231
+ const startResize = (e, key) => {
1232
+ e.preventDefault();
1233
+ const startX = e.clientX;
1234
+ const startWidth = e.target.parentElement?.offsetWidth || 0;
1235
+ const onMouseMove = (moveEvent) => {
1236
+ const newWidth = Math.max(startWidth + moveEvent.clientX - startX, 50); // mínimo 50px
1237
+ setColumnWidths(prev => ({ ...prev, [key]: newWidth }));
1238
+ };
1239
+ const onMouseUp = () => {
1240
+ window.removeEventListener("mousemove", onMouseMove);
1241
+ window.removeEventListener("mouseup", onMouseUp);
1242
+ };
1243
+ window.addEventListener("mousemove", onMouseMove);
1244
+ window.addEventListener("mouseup", onMouseUp);
1245
+ };
1246
+ const scrollContainerStyle = useMemo(() => {
1247
+ if (stickyHeader || scrollHeight) {
1248
+ return {
1249
+ maxHeight: scrollHeight ?? 300,
1250
+ overflowY: "auto"
1251
+ };
975
1252
  }
1253
+ return {}; // sin altura ni scroll
1254
+ }, [stickyHeader, scrollHeight]);
1255
+ const getColSpan = () => columns.length + (expandedRowRender ? 1 : 0);
1256
+ const renderTableBody = () => {
1257
+ if (loading) {
1258
+ return (jsx("tr", { children: jsx("td", { colSpan: getColSpan(), children: jsx("div", { className: "text-center py-4 text-muted-foreground", children: "Loading data..." }) }) }));
1259
+ }
1260
+ if (!paginatedData || paginatedData.length === 0) {
1261
+ return (jsx("tr", { children: jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
1262
+ }
1263
+ return paginatedData.map(item => {
1264
+ const itemKey = item[rowKey];
1265
+ if (!itemKey)
1266
+ console.warn("Missing row key for item", item);
1267
+ return (jsxs(React__default.Fragment, { children: [jsxs("tr", { className: classNameRow ?? "", 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
1268
+ ? "cwi-chevron-down"
1269
+ : "cwi-chevron-right"}` }) })), columns.map(col => (jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : 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)));
1270
+ });
976
1271
  };
977
- return (jsxs("div", { id: id, className: `cw-table-container ${classNameContainer || ""}`, children: [jsxs("table", { className: `cw-table ${className || ""}`, style: style, children: [jsx("thead", { className: `${classNameHeader || ""}`, children: jsxs("tr", { children: [expandedRowRender && jsx("th", {}), columns.map(column => (jsx("th", { onClick: () => handleSort(column.dataIndex), className: `${column.className || ""} ${sortConfig.key === column.dataIndex ? sortConfig.direction : ""}`.trim(), children: column.title }, column.key)))] }) }), jsx("tbody", { children: !paginatedData || paginatedData.length === 0 ? (jsx("tr", { children: jsx("td", { colSpan: columns.length + (expandedRowRender ? 1 : 0), style: { textAlign: "center" }, className: "cw-table-cell-empty", children: textNoData !== undefined && textNoData !== "" ? textNoData : "No data available at the moment" }) })) : (paginatedData.map(item => (jsxs(React__default.Fragment, { children: [jsxs("tr", { className: `${classNameRow || ""}`, children: [expandedRowRender && (jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === item.key ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map(column => (jsx("td", { className: column.className || "", children: column.render ? column.render(item) : item[column.dataIndex] }, `${item.key}_${column.key}`)))] }), expandedRowKey === item.key && expandedRowRender && (jsx("tr", { className: "cw-table-row-expanded", children: jsx("td", { colSpan: columns.length + 1, children: expandedRowRender(item) }) }))] }, item.key)))) })] }), pagination && totalPages > 1 && (jsxs("footer", { className: "cw-table-pagination", children: [jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1, className: "cw-button-icon cwi-chevron-left" }), jsxs("span", { children: ["Page ", currentPage, " of ", totalPages] }), jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages, className: "cw-button-icon cwi-chevron-right" })] }))] }));
1272
+ 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
1273
+ ? { position: "sticky", top: 0, background: "white", zIndex: 2 }
1274
+ : undefined, children: jsxs("tr", { children: [expandedRowRender && jsx("th", {}), columns.map(col => (jsxs("th", { onClick: () => col.sortable && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
1275
+ ? sortConfig.direction
1276
+ : ""}`.trim(), style: {
1277
+ cursor: col.sortable ? "pointer" : "default",
1278
+ userSelect: "none",
1279
+ width: columnWidths[col.key] ?? col.width,
1280
+ ...((col.width || columnWidths[col.key]) && {
1281
+ minWidth: 50,
1282
+ maxWidth: columnWidths[col.key] ?? col.width
1283
+ }),
1284
+ }, children: [jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [jsx("span", { children: col.title }), col.sortable && (jsx("span", { style: { fontSize: "12px", marginLeft: "6px" }, children: sortConfig.key !== col.dataIndex ? "↕" : sortConfig.direction === "asc"
1285
+ ? "↑"
1286
+ : "↓" }))] }), 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: "number", value: currentPage, onChange: (e) => {
1287
+ const value = parseInt(e.target.value, 10);
1288
+ if (!isNaN(value))
1289
+ handlePageChange(value);
1290
+ }, onBlur: (e) => {
1291
+ const value = parseInt(e.target.value, 10);
1292
+ if (isNaN(value) || value < 1 || value > totalPages) {
1293
+ handlePageChange(1);
1294
+ }
1295
+ }, min: 1, max: totalPages, style: {
1296
+ width: "4rem",
1297
+ textAlign: "center",
1298
+ marginRight: "0.5rem"
1299
+ } }), "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, style: { marginLeft: "1rem" }, children: pageSizeOptions.map(size => (jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
978
1300
  }
979
1301
 
980
1302
  var styles$8 = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
@@ -990,20 +1312,27 @@ const TabIcon = ({ icon }) => {
990
1312
  return icon;
991
1313
  };
992
1314
  /**
993
- *
1315
+ * CwTabs component for displaying tabbed content.
994
1316
  * @param CwTabsProps
995
1317
  * @example
996
- * The way to use the tab component:
1318
+ The way to use the tab component:
1319
+ * const [activeTab, setActiveTab] = useState("1");
1320
+ *
1321
+ * const handleTabChange = (tab) => {
1322
+ * setActiveTab(tab.key);
1323
+ * };
1324
+ *
997
1325
  * const tabs = [
998
- * { key: "1", title: 'Tab 1', icon: 'iconClassname', content: <div>Contenido de la pestaña 1</div> },
999
- * { key: "2", title: 'Tab 2', icon: 'iconClassname', content: <div>Contenido de la pestaña 2</div> },
1000
- * { key: "3", title: 'Tab 3', icon: 'iconClassname', content: <div>Contenido de la pestaña 3</div> },
1326
+ * { key: "1", title: 'Tab 1', icon: 'iconClassname', content: <div>Content for tab 1</div> },
1327
+ * { key: "2", title: 'Tab 2', icon: 'iconClassname', content: <div>Content for tab 2</div> },
1328
+ * { key: "3", title: 'Tab 3', icon: 'iconClassname', content: <div>Content for tab 3</div> },
1001
1329
  * ];
1330
+ *
1002
1331
  * <CwTabs
1003
- * tabs={tabs}
1004
- * tabsPosition="top"
1005
- * defaultActiveKey="2"
1006
- * onTabClick={(e)=> handleInput(e)}
1332
+ * tabs={tabs}
1333
+ * tabsPosition="top"
1334
+ * defaultActiveKey={activeTab} // Use the current state for defaultActiveKey
1335
+ * onTabClick={handleTabChange}
1007
1336
  * />
1008
1337
  * @returns A tab
1009
1338
  */
@@ -1020,7 +1349,7 @@ function CwTabs(CwTabsProps) {
1020
1349
  const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
1021
1350
  ? { minWidth: CwTabsProps.tabsListWidth }
1022
1351
  : undefined;
1023
- return (jsxs("div", { id: CwTabsProps.id, className: styles$8['cw-tabs'], "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.key))) }), jsx("div", { className: styles$8['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
1352
+ return (jsxs("div", { id: CwTabsProps.id, className: styles$8['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.key))) }), jsx("div", { className: styles$8['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
1024
1353
  }
1025
1354
 
1026
1355
  /**
@@ -1047,6 +1376,25 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
1047
1376
  return (jsx("div", { className: "cw-expandable", children: jsxs("details", { ref: myRef, ...detailsProps, children: [jsx("summary", { children: briefing }), children && jsx("section", { children: children })] }) }));
1048
1377
  };
1049
1378
 
1379
+ /**
1380
+ * A component for displaying key-value pairs in a definition list format
1381
+ * Used for read-only display of structured data
1382
+ *
1383
+ * @example
1384
+ * <CwKeyValueList
1385
+ * items={[
1386
+ * { key: "length", label: "Length", value: "10", suffix: "m" },
1387
+ * { key: "width", label: "Width", value: null, suffix: "m" }
1388
+ * ]}
1389
+ * emptyValue="N/A"
1390
+ * />
1391
+ */
1392
+ const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "row" }) => {
1393
+ return (jsx("dl", { className: `cw-keyvalue-list ${className}`, children: items.map(item => (jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${direction}`, children: [jsx("dt", { children: item.label }), jsx("dd", { children: item.value !== undefined && item.value !== null && item.value !== ""
1394
+ ? `${item.value}${item.suffix ? ` ${item.suffix}` : ''}`
1395
+ : emptyValue })] }, item.key))) }));
1396
+ };
1397
+
1050
1398
  /**
1051
1399
  * A table with expandable row groups.
1052
1400
  * @param props The data to display
@@ -1170,11 +1518,9 @@ function CwInput(CwInputProps) {
1170
1518
  const handleClearClick = () => {
1171
1519
  CwInputProps.onChange("");
1172
1520
  };
1173
- return (jsxs("div", { className: CwInputProps.labelPosition === "inline"
1174
- ? "cwellt_flex cwellt_flex_row cwellt_align_items_center cw_inputContent"
1175
- : CwInputProps.labelPosition === "column"
1176
- ? "cwellt_flex cwellt_flex_column cwellt_align-items_baseline cw_inputContent"
1177
- : "cwellt_flex cwellt_flex_row cwellt_align_items_center cw_inputContent", children: [jsx("label", { className: CwInputProps.disabled === true
1521
+ return (jsxs("div", { className: CwInputProps.labelPosition === "column"
1522
+ ? "cw-flex-column"
1523
+ : "cw-flex-row ", children: [jsx("label", { className: CwInputProps.disabled === true
1178
1524
  ? CwInputProps.labelClassName + " " + "cw_label_text cw_label_text_disabled"
1179
1525
  : CwInputProps.labelClassName + " " + "cw_label_text", children: CwInputProps.labelName }), jsx("input", { id: CwInputProps.id, type: "text", value: CwInputProps.value, onChange: e => handleChange(e), className: CwInputProps.className + " " + "cw_input", placeholder: CwInputProps.placeholder === undefined ? "Write a text please" : CwInputProps.placeholder, style: CwInputProps.style, disabled: CwInputProps.disabled, required: CwInputProps.required }), CwInputProps.value && (
1180
1526
  // if the component is disabled do not show clear button
@@ -1264,11 +1610,9 @@ function CwInputNumber(CwInputNumberProps) {
1264
1610
  const handleChange = (e) => {
1265
1611
  CwInputNumberProps.onChange(e.target.value);
1266
1612
  };
1267
- return (jsxs("div", { className: CwInputNumberProps.labelPosition == "inline"
1268
- ? "cw-label-input"
1269
- : CwInputNumberProps.labelPosition == "column"
1270
- ? "cwellt_flex cwellt_flex_column cwellt_align-items_baseline cw-label-input"
1271
- : "cw-label-input", children: [jsx("label", { className: CwInputNumberProps.disabled === true
1613
+ return (jsxs("div", { className: CwInputNumberProps.labelPosition == "column"
1614
+ ? "cw-flex-column"
1615
+ : "cw-flex-row", children: [jsx("label", { className: CwInputNumberProps.disabled === true
1272
1616
  ? CwInputNumberProps.labelClassName + " " + "cw_label_text cw_label_text_disabled"
1273
1617
  : CwInputNumberProps.labelClassName + " " + "cw_label_text", children: CwInputNumberProps.labelName }), jsx("input", { id: CwInputNumberProps.id, type: "number", value: CwInputNumberProps.value, onChange: e => handleChange(e), className: CwInputNumberProps.className + " " + " cw-input-number", placeholder: CwInputNumberProps.placeholder == undefined ? "Write a number please" : CwInputNumberProps.placeholder, style: CwInputNumberProps.style, disabled: CwInputNumberProps.disabled, required: CwInputNumberProps.required, step: CwInputNumberProps.step, min: CwInputNumberProps.min, max: CwInputNumberProps.max })] }));
1274
1618
  }
@@ -1591,7 +1935,7 @@ function CwInputImage(props) {
1591
1935
  const file = e.target.files?.[0];
1592
1936
  handleFile(file ?? null);
1593
1937
  };
1594
- return (jsxs("div", { className: "cw-input-image", children: [jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [jsx("p", { children: "Drop image here" }), jsxs("small", { children: ["(", allowedFormats.join(", ").replace(/image\//g, ""), ")"] })] }), jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [jsx(CwIcon, { iconId: "clipboard" }), "\u2002Paste"] }), jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [jsx(CwIcon, { iconId: "folder" }), "\u2002Browse"] })] }), jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
1938
+ return (jsxs("div", { className: "cw-input-image", children: [jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [jsx("p", { children: "Drop image here" }), jsxs("small", { children: ["(", allowedFormats.join(", ").replace(/image\//g, ""), ")"] })] }), jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [jsx(CwIcon, { iconId: "paste" }), "\u2002Paste"] }), jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [jsx(CwIcon, { iconId: "folder-open" }), "\u2002Browse"] })] }), jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
1595
1939
  }
1596
1940
 
1597
1941
  /**
@@ -2776,7 +3120,7 @@ function CwMultiselect(CwelltCustomFilterTabProps) {
2776
3120
  const luminance = 0.299 * redBgColor_custom_tag_selected_list +
2777
3121
  0.587 * greenBgColor_custom_tag_selected_list +
2778
3122
  0.114 * blueBgColor_custom_tag_selected_list;
2779
- return s.type !== undefined && s.type !== undefined ? (jsx("div", { id: "cwContent_tag", "data-id": s.type + "_" + s.id, className: "cwellt_flex cwellt_align_items_center", children: jsx(CwTag, { styleTag: {
3123
+ return s.type !== undefined ? (jsx("div", { id: "cwContent_tag", "data-id": s.type + "_" + s.id, className: "cwellt_flex cwellt_align_items_center", children: jsx(CwTag, { styleTag: {
2780
3124
  background: s.color
2781
3125
  }, styleTag_description: {
2782
3126
  background: s.color,
@@ -2827,7 +3171,7 @@ const CwMultiFilterTag = props => {
2827
3171
  }, onClick: () => {
2828
3172
  if (Selectable)
2829
3173
  OnSelect?.(props);
2830
- }, children: [jsx("span", { id: ID, "data-value": Value, "data-category": Category, children: Name }), Removable && (jsx("span", { onClick: () => props.OnRemove?.(props), children: jsx(CwIcon, { iconId: "xmark" }) }))] }));
3174
+ }, children: [jsx("span", { id: ID, "data-value": Value, "data-category": Category, children: Name }), Removable && (jsx("span", { onClick: () => props.OnRemove?.(props), children: jsx(CwIcon, { iconId: "close" }) }))] }));
2831
3175
  };
2832
3176
 
2833
3177
  var styles$5 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module_cw-multi-filter-catalog-container__S3nsq","cw-multi-filter":"cw-multi-filter-module_cw-multi-filter__zipBK","cw-multi-filter-search":"cw-multi-filter-module_cw-multi-filter-search__eyHr0"};
@@ -3400,10 +3744,6 @@ function CwBtnAddFolder({ cw_btnOnclick, cw_btn_disabled }) {
3400
3744
  function CwBtnEditFolder({ cw_btnOnclick, cw_btn_disabled }) {
3401
3745
  return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-folder-edit", disabled: cw_btn_disabled });
3402
3746
  }
3403
- // PropertyFolder
3404
- function CwBtnSelectedFolder({ cw_btnOnclick, cw_btn_disabled }) {
3405
- return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-folder-selected", disabled: cw_btn_disabled });
3406
- }
3407
3747
  // UploadFiles
3408
3748
  function CwBtnUploadFiles({ cw_btnOnclick, cw_btn_disabled }) {
3409
3749
  return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btn_uploadFiles", disabled: cw_btn_disabled });
@@ -3416,14 +3756,6 @@ function CwBtnGoBackFolder({ cw_btnOnclick, cw_btn_disabled }) {
3416
3756
  function CwBtnBookMark({ cw_btnOnclick, cw_btn_disabled }) {
3417
3757
  return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-star", disabled: cw_btn_disabled });
3418
3758
  }
3419
- // Archive
3420
- function CwBtnArchive({ cw_btnOnclick, cw_btn_disabled }) {
3421
- return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-archive", disabled: cw_btn_disabled });
3422
- }
3423
- // Archive
3424
- function CwBtnArchiveRestore({ cw_btnOnclick, cw_btn_disabled }) {
3425
- return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-archive-restore", disabled: cw_btn_disabled });
3426
- }
3427
3759
  // Publish
3428
3760
  function CwBtnPublish({ cw_btnOnclick, cw_btn_disabled }) {
3429
3761
  return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnPublish", disabled: cw_btn_disabled });
@@ -3432,10 +3764,6 @@ function CwBtnPublish({ cw_btnOnclick, cw_btn_disabled }) {
3432
3764
  function CwBtnApprove({ cw_btnOnclick, cw_btn_disabled }) {
3433
3765
  return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnApprove", disabled: cw_btn_disabled });
3434
3766
  }
3435
- // BookMarkLinkPag
3436
- function CwBtnBookMarkLinkPage({ cw_btnOnclick, cw_btn_disabled }) {
3437
- return (jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-favorite-files", disabled: cw_btn_disabled }));
3438
- }
3439
3767
  // Bulk duty
3440
3768
  function CwBtnBulkDuty({ cw_btnOnclick, cw_btn_disabled }) {
3441
3769
  return jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnBulkDuty", disabled: cw_btn_disabled });
@@ -5894,83 +6222,6 @@ const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width,
5894
6222
  }), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "50%", height: "50%", isHeader: true, isUtc: isUtc }))] })] }));
5895
6223
  };
5896
6224
 
5897
- function colorToHSL(color) {
5898
- const hexColor = colorToHEX(color);
5899
- const hex = hexColor.replace('#', '');
5900
- const r = parseInt(hex.substring(0, 2), 16) / 255;
5901
- const g = parseInt(hex.substring(2, 4), 16) / 255;
5902
- const b = parseInt(hex.substring(4, 6), 16) / 255;
5903
- const max = Math.max(r, g, b);
5904
- const min = Math.min(r, g, b);
5905
- let h = 0;
5906
- let s = 0;
5907
- const l = (max + min) / 2;
5908
- if (max !== min) {
5909
- const d = max - min;
5910
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
5911
- switch (max) {
5912
- case r:
5913
- h = (g - b) / d + (g < b ? 6 : 0);
5914
- break;
5915
- case g:
5916
- h = (b - r) / d + 2;
5917
- break;
5918
- case b:
5919
- h = (r - g) / d + 4;
5920
- break;
5921
- }
5922
- h /= 6;
5923
- }
5924
- return {
5925
- h: Math.round(h * 360),
5926
- s: Math.round(s * 100),
5927
- l: Math.round(l * 100)
5928
- };
5929
- }
5930
- function colorToHEX(color) {
5931
- const canvas = document.createElement('canvas');
5932
- const context = canvas.getContext('2d');
5933
- if (!context)
5934
- throw new Error('Could not create canvas context');
5935
- context.fillStyle = color;
5936
- return context.fillStyle;
5937
- }
5938
- function getHSLColor(color, alpha = 1) {
5939
- const hsl = colorToHSL(color);
5940
- return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${alpha})`;
5941
- }
5942
- function getContrastColor(color) {
5943
- if (color === null) {
5944
- return '#000000';
5945
- }
5946
- const hsl = colorToHSL(color);
5947
- // Saturated greenyellow and cyan tones need lower luminance threshold (40-35)
5948
- // Saturated mediumblue and blueviolet tones need higher luminance threshold (55-60)
5949
- // Saturated orangered tones need lower luminance threshold (45)
5950
- const isYellowGreen = (hsl.h >= 45 && hsl.h <= 180);
5951
- const isBlueViolet = (hsl.h >= 210 && hsl.h <= 300);
5952
- const isRedOrange = (hsl.h >= 0 && hsl.h <= 30) || (hsl.h >= 330 && hsl.h <= 360);
5953
- let threshold = 50;
5954
- if (isYellowGreen) {
5955
- threshold = 40;
5956
- if (hsl.s >= 70) {
5957
- threshold = 35;
5958
- }
5959
- }
5960
- else if (isBlueViolet) {
5961
- threshold = 55;
5962
- if (hsl.s >= 70) {
5963
- threshold = 60;
5964
- }
5965
- }
5966
- else if (isRedOrange && hsl.s >= 80) {
5967
- threshold = 45;
5968
- }
5969
- const contrastL = hsl.l >= threshold ? 20 : 90;
5970
- const contrastS = Math.min(hsl.s, 90);
5971
- return `hsl(${hsl.h}, ${contrastS}%, ${contrastL}%)`;
5972
- }
5973
-
5974
6225
  var styles$2 = {"hide-scrollbar":"new-scheduler-module_hide-scrollbar__33GG9","scheduler-event":"new-scheduler-module_scheduler-event__gphwn","scheduler-event-container":"new-scheduler-module_scheduler-event-container__-h1xm","time-marker":"new-scheduler-module_time-marker__2BejU","scheduler-event-text":"new-scheduler-module_scheduler-event-text__zjvd7"};
5975
6226
 
5976
6227
  const BackgroundEvent = ({ value, heightRem }) => {
@@ -6145,7 +6396,20 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
6145
6396
  }, children: value.icons }), jsx("span", { style: {
6146
6397
  padding: "0.1rem",
6147
6398
  color: textColor,
6148
- }, children: value.name })] }), value.isResizable && (jsx(EventSideDrag, { heightRem: heightRem * 0.7, onStartEvent: () => {
6399
+ display: "flex",
6400
+ flex: 1,
6401
+ alignItems: "center",
6402
+ width: "100%",
6403
+ }, children: value.rectangleColors && value.rectangleColors.length > 0 ? (jsx("div", { style: {
6404
+ display: "flex",
6405
+ width: "100%",
6406
+ }, children: value.rectangleColors.map((item, i) => (jsx("div", { className: "cwellt_rectangle_indicator", style: {
6407
+ backgroundColor: item,
6408
+ flex: 1,
6409
+ height: "8px",
6410
+ margin: 0,
6411
+ padding: 0,
6412
+ } }, value.id + "_" + i))) })) : (value.name) })] }), value.isResizable && (jsx(EventSideDrag, { heightRem: heightRem * 0.7, onStartEvent: () => {
6149
6413
  onEvent(new OnRightDragStart(value.id));
6150
6414
  } }))] }), value.primaryTimeMarkerColor && (jsx("div", { className: styles$2["time-marker"], style: {
6151
6415
  backgroundColor: value.primaryTimeMarkerColor,
@@ -7148,12 +7412,19 @@ class CwFindAirport extends React.Component {
7148
7412
  });
7149
7413
  });
7150
7414
  }
7415
+ getShortCode(text) {
7416
+ const match = text.match(/([A-Z]{4})\(([A-Z]{3})\)/);
7417
+ if (match && match.length >= 3) {
7418
+ return `${match[1]}(${match[2]})`;
7419
+ }
7420
+ return text;
7421
+ }
7151
7422
  render() {
7152
- const options = this.state.data.map((sl) => (jsx(Option, { value: sl.value, children: sl.text }, sl.value)));
7153
- return (jsx("div", { children: jsxs("div", { className: "cwellt_flex cwellt_justify_flex_start cwellt_align_items_center", children: [jsx(Select, { id: "InputID",
7423
+ const options = this.state.data.map((sl) => (jsxs(Option, { value: sl.value, title: sl.text, label: this.getShortCode(sl.text), children: [(sl.text), " "] }, sl.value)));
7424
+ return (jsx("div", { children: jsxs("div", { className: "cw-flex-row cw-align-left-center", style: { gap: "0.25rem" }, children: [jsx(Select, { id: "InputID",
7154
7425
  // this.required === "true" ? "required" : ""
7155
- showSearch: true, allowClear: true, "aria-required": true, value: this.state.valueId, placeholder: this.props.placeHolder, defaultActiveFirstOption: false, showArrow: true, filterOption: false, onSearch: this.handleSearch.bind(this), onChange: this.handleChange.bind(this), onSelect: this.handleSelect.bind(this), notFoundContent: null, dropdownClassName: "cwelltItemFindAirport", className: this.props.className, disabled: !!(this.props.disabled !== undefined && this.props.disabled !== null && this.props.disabled === true), children: options }, JSON.stringify(this.state.valueId)), jsx("button", { id: "findAirportInProviderButtonID", className: "cwellt_btn_Nbg cwellt_btnSearchAirport", hidden: this.props.searchType === "OnlyDatabase", onClick: this.onClick.bind(this), disabled: !!(this.props.disabled !== undefined && this.props.disabled !== null && this.props.disabled === true) })] }) }));
7426
+ showSearch: true, allowClear: true, "aria-required": true, value: this.state.valueId, placeholder: this.props.placeHolder, defaultActiveFirstOption: false, showArrow: true, filterOption: false, onSearch: this.handleSearch.bind(this), onChange: this.handleChange.bind(this), onSelect: this.handleSelect.bind(this), notFoundContent: null, popupClassName: "cwelltItemFindAirport", className: this.props.className, labelInValue: false, optionLabelProp: "label", disabled: !!(this.props.disabled !== undefined && this.props.disabled !== null && this.props.disabled === true), style: { flexGrow: 1 }, children: options }, JSON.stringify(this.state.valueId)), jsx("button", { id: "findAirportInProviderButtonID", className: "cw-button-icon cwi-airport", title: "Search external airport", hidden: this.props.searchType === "OnlyDatabase" || this.props.disabled, onClick: this.onClick.bind(this), disabled: !!(this.props.disabled !== undefined && this.props.disabled !== null && this.props.disabled === true) })] }) }));
7156
7427
  }
7157
7428
  }
7158
7429
 
7159
- export { CblDragAndDrop, CwAccordionContainer, CwAlign, CwBtnAdd, CwBtnAddFolder, CwBtnAirport, CwBtnAlert, CwBtnApprove, CwBtnArchive, CwBtnArchiveRestore, CwBtnBookMark, CwBtnBookMarkLinkPage, CwBtnBulkDuty, CwBtnCancel, CwBtnCrewPlanning, CwBtnDelay, CwBtnDelete, CwBtnDownLoadAllInfo, CwBtnDownload, CwBtnDropDownMenu, CwBtnEdit, CwBtnEditFolder, CwBtnFiles, CwBtnGeneratePairing, CwBtnGoBackFolder, CwBtnHide, CwBtnImportRequests, CwBtnInfo, CwBtnMVT, CwBtnNavFirstItemView, CwBtnNavLastItemView, CwBtnNavNextDay, CwBtnNavPreviewItem, CwBtnPairing, CwBtnPrint, CwBtnPropertyFolder, CwBtnPublish, CwBtnRefresh, CwBtnReleasePeriod, CwBtnSave, CwBtnSearch, CwBtnSelect, CwBtnSelectedFolder, CwBtnShare, CwBtnStatistic, CwBtnUploadFiles, CwBtnVacations, CwBtnView, CwBtnWarning, CwButton, CwButtonDef, CwCheckbox, CwContextMenu, CwContextualMenu, CwDialog, CwDialogManager, CwDigit, CwDisplayMessage, CwDropdown, CwDropdownContainer, CwDropdownFilter, CwDropdownNavigation, CwExpandable, CwFileUpload, CwFindAirport, CwFloatingButton, CwGenericTooltip, CwHeadFilter, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, CwInput, CwInputDate, CwInputDatePicker, CwInputDateText, CwInputDatetime, CwInputImage, CwInputNumber, CwInputPhone, CwInputText, CwLabel, CwLoading, CwLoadingSmall, CwMessage, CwMessageManager, CwMessageType, CwModal, CwModalConfirm, CwModalHover, CwModalIframe, CwModalReportFunctional, CwMultiFilter, CwMultiFilterTag, CwMultiselect, CwOption, CwOptionList, CwReportModal, CwScheduler, CwScheduler2, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, CwSuperScheduler, CwTable, CwTableGrouped, CwTabs, CwTag, CwTextArea, CwTime, CwToggle, CwTooltip, CwWeekdaySelector, DefaultRowHeader, MultiSelect, 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 };
7430
+ export { CblDragAndDrop, CwAccordionContainer, CwAlign, CwBtnAdd, CwBtnAddFolder, CwBtnAirport, CwBtnAlert, CwBtnApprove, CwBtnBookMark, CwBtnBulkDuty, CwBtnCancel, CwBtnCrewPlanning, CwBtnDelay, CwBtnDelete, CwBtnDownLoadAllInfo, CwBtnDownload, CwBtnDropDownMenu, CwBtnEdit, CwBtnEditFolder, CwBtnFiles, CwBtnGeneratePairing, CwBtnGoBackFolder, CwBtnHide, CwBtnImportRequests, CwBtnInfo, CwBtnMVT, CwBtnNavFirstItemView, CwBtnNavLastItemView, CwBtnNavNextDay, CwBtnNavPreviewItem, CwBtnPairing, CwBtnPrint, CwBtnPropertyFolder, CwBtnPublish, CwBtnRefresh, CwBtnReleasePeriod, CwBtnSave, CwBtnSearch, CwBtnSelect, CwBtnShare, CwBtnStatistic, CwBtnUploadFiles, CwBtnVacations, CwBtnView, CwBtnWarning, CwButton, CwButtonDef, CwCard, CwCheckbox, CwChip, CwContextMenu, CwContextualMenu, CwDialog, CwDialogManager, CwDigit, CwDisplayMessage, CwDropdown, CwDropdownContainer, CwDropdownFilter, CwDropdownNavigation, CwExpandable, CwFileUpload, CwFindAirport, CwFloatingButton, CwGenericTooltip, CwHeadFilter, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, CwInput, CwInputDate, CwInputDatePicker, CwInputDateText, CwInputDatetime, CwInputImage, CwInputNumber, CwInputPhone, CwInputText, CwKeyValueList, CwLabel, CwLoading, CwLoadingSmall, CwMessage, CwMessageManager, CwMessageType, CwModal, CwModalConfirm, CwModalHover, CwModalIframe, CwModalReportFunctional, CwMultiFilter, CwMultiFilterTag, CwMultiselect, CwOption, CwOptionList, CwReportModal, CwScheduler, CwScheduler2, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, CwSuperScheduler, CwTable, CwTableGrouped, CwTabs, CwTag, CwTextArea, CwTime, CwToggle, CwTooltip, CwWeekdaySelector, DefaultRowHeader, MultiSelect, 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 };