@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.cjs.js CHANGED
@@ -137,20 +137,166 @@ function CwTooltip(CwelltTooltipProps) {
137
137
  return (jsxRuntime.jsxs("div", { className: "cwelltTooltip", children: [jsxRuntime.jsx("div", { className: "cwelltTooltipTitle", style: CwelltTooltipProps.tooltipTitleStyle, children: jsxRuntime.jsx("span", { children: CwelltTooltipProps.tooltipTitle }) }), CwelltTooltipProps.children] }));
138
138
  }
139
139
 
140
+ function colorToHSL(color) {
141
+ const hexColor = colorToHEX(color);
142
+ const hex = hexColor.replace('#', '');
143
+ const r = parseInt(hex.substring(0, 2), 16) / 255;
144
+ const g = parseInt(hex.substring(2, 4), 16) / 255;
145
+ const b = parseInt(hex.substring(4, 6), 16) / 255;
146
+ const max = Math.max(r, g, b);
147
+ const min = Math.min(r, g, b);
148
+ let h = 0;
149
+ let s = 0;
150
+ const l = (max + min) / 2;
151
+ if (max !== min) {
152
+ const d = max - min;
153
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
154
+ switch (max) {
155
+ case r:
156
+ h = (g - b) / d + (g < b ? 6 : 0);
157
+ break;
158
+ case g:
159
+ h = (b - r) / d + 2;
160
+ break;
161
+ case b:
162
+ h = (r - g) / d + 4;
163
+ break;
164
+ }
165
+ h /= 6;
166
+ }
167
+ return {
168
+ h: Math.round(h * 360),
169
+ s: Math.round(s * 100),
170
+ l: Math.round(l * 100)
171
+ };
172
+ }
173
+ function colorToHEX(color) {
174
+ const canvas = document.createElement('canvas');
175
+ const context = canvas.getContext('2d');
176
+ if (!context)
177
+ throw new Error('Could not create canvas context');
178
+ context.fillStyle = color;
179
+ return context.fillStyle;
180
+ }
181
+ function getHSLColor(color, alpha = 1) {
182
+ const hsl = colorToHSL(color);
183
+ return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${alpha})`;
184
+ }
185
+ function getContrastColor(color) {
186
+ if (color === null) {
187
+ return '#000000';
188
+ }
189
+ const hsl = colorToHSL(color);
190
+ // Saturated greenyellow and cyan tones need lower luminance threshold (40-35)
191
+ // Saturated mediumblue and blueviolet tones need higher luminance threshold (55-60)
192
+ // Saturated orangered tones need lower luminance threshold (45)
193
+ const isYellowGreen = (hsl.h >= 45 && hsl.h <= 180);
194
+ const isBlueViolet = (hsl.h >= 210 && hsl.h <= 300);
195
+ const isRedOrange = (hsl.h >= 0 && hsl.h <= 30) || (hsl.h >= 330 && hsl.h <= 360);
196
+ let threshold = 50;
197
+ if (isYellowGreen) {
198
+ threshold = 40;
199
+ if (hsl.s >= 70) {
200
+ threshold = 35;
201
+ }
202
+ }
203
+ else if (isBlueViolet) {
204
+ threshold = 55;
205
+ if (hsl.s >= 70) {
206
+ threshold = 60;
207
+ }
208
+ }
209
+ else if (isRedOrange && hsl.s >= 80) {
210
+ threshold = 45;
211
+ }
212
+ const contrastL = hsl.l >= threshold ? 20 : 90;
213
+ const contrastS = Math.min(hsl.s, 90);
214
+ return `hsl(${hsl.h}, ${contrastS}%, ${contrastL}%)`;
215
+ }
216
+
217
+ /**
218
+ * Icon component that supports both FontAwesome 4 and cwellt icon font
219
+ * @example
220
+ * <CwIcon iconId="house" /> // Uses cwellt icon font
221
+ * <CwIcon iconId="house" source="fontawesome" /> // Uses FontAwesome
222
+ */
223
+ function CwIcon(props) {
224
+ const { iconId, source = 'cwellt', ...iconProps } = props;
225
+ // Return appropriate icon based on source
226
+ if (source === 'fontawesome') {
227
+ return jsxRuntime.jsx("span", { ...iconProps, className: `fa fa-${iconId}` });
228
+ }
229
+ // Use custom icon font
230
+ return jsxRuntime.jsx("span", { ...iconProps, className: `cwi-icons cwi-${iconId}` });
231
+ }
232
+
233
+ /**
234
+ * CwChip - A simple chip/tag component for displaying labels or categories
235
+ *
236
+ * @example
237
+ * <CwChip label="Active" colorScheme="success" />
238
+ * <CwChip label="High Priority" colorScheme="danger" variant="solid" />
239
+ * <CwChip label="Custom" colorScheme="custom" customColor="#8a2be2" />
240
+ * <CwChip label="Outlined" colorScheme="info" variant="outline" />
241
+ * <CwChip label="Removable" closable onClose={() => console.log('closed')} />
242
+ **/
243
+ const CwChip = ({ label, colorScheme = 'info', customColor, variant = 'soft', className = '', closable = false, onClose, icon, style = {}, }) => {
244
+ // Basic validation
245
+ if (closable && !onClose) {
246
+ console.warn('CwChip: onClose prop is required when closable is true');
247
+ }
248
+ // Calculate styles based on colorScheme, customColor and variant
249
+ const chipStyle = React.useMemo(() => {
250
+ if (colorScheme === 'custom' && customColor) {
251
+ if (variant === 'outline') {
252
+ // For outline, customColor is used for border and text
253
+ return {
254
+ color: customColor,
255
+ borderColor: customColor,
256
+ ...style
257
+ };
258
+ }
259
+ else {
260
+ // For soft/solid, customColor is used for background and we calculate contrast
261
+ return {
262
+ backgroundColor: customColor,
263
+ color: getContrastColor(customColor),
264
+ ...style
265
+ };
266
+ }
267
+ }
268
+ return style;
269
+ }, [colorScheme, customColor, variant, style]);
270
+ // Handle click on close icon
271
+ const handleClose = (e) => {
272
+ e.stopPropagation();
273
+ if (onClose) {
274
+ onClose();
275
+ }
276
+ };
277
+ // CSS classes
278
+ const chipClassNames = [
279
+ 'cw-chip',
280
+ className,
281
+ closable ? 'cw-chip-closable' : '',
282
+ ].filter(Boolean).join(' ');
283
+ return (jsxRuntime.jsxs("span", { className: chipClassNames, "data-color-scheme": colorScheme, "data-variant": variant, style: chipStyle, children: [icon && jsxRuntime.jsx(CwIcon, { iconId: icon }), label, closable && (jsxRuntime.jsx("button", { className: "cw-chip-close-button", onClick: handleClose, "aria-label": "Remove", type: "button", children: jsxRuntime.jsx("span", { className: "cwi-icons cwi-close" }) }))] }));
284
+ };
285
+
140
286
  function CwTag(tagProps) {
141
287
  const hideTag = (event_clickTag) => {
142
288
  const tag = event_clickTag.currentTarget.parentElement;
143
- tag.classList.add("cwellt_display_none");
289
+ tag?.classList.add("cwellt_display_none");
144
290
  };
145
291
  const onClickClosableCustomTag = (event_clickClosableT) => {
146
292
  hideTag(event_clickClosableT);
147
- if (typeof tagProps.onClickClosableTag === "function") {
293
+ if (tagProps.onClickClosableTag != undefined) {
148
294
  tagProps.onClickClosableTag(event_clickClosableT);
149
295
  }
150
296
  };
151
297
  const onClickCustomTag = (event_clickTag) => {
152
298
  // click option interface
153
- if (typeof tagProps.onClickTag === "function") {
299
+ if (tagProps.onClickTag !== undefined) {
154
300
  tagProps.onClickTag(event_clickTag);
155
301
  }
156
302
  };
@@ -160,23 +306,12 @@ function CwTag(tagProps) {
160
306
  " cwelltTag_desc cwellt_flex cwellt_justify_flex_start cwellt_align_items_center", style: tagProps.styleTag_description, children: tagProps.children }), tagProps.closableTag && (jsxRuntime.jsx("span", { className: "cwi-icons cwi-close", onClick: event_clickClosableT => onClickClosableCustomTag(event_clickClosableT), style: tagProps.styleClosableButton }))] }));
161
307
  }
162
308
 
163
- /**
164
- * An icon from fontawesome4. Find them here: [fontawesome.com/v4](https://fontawesome.com/v4/icons/)
165
- * @example
166
- * <CwIcon id="house" />
167
- */
168
- function CwIcon(props) {
169
- const { iconId, ...iconProps } = props;
170
- // if you wrap this inside a div I WILL find you 🔪
171
- return jsxRuntime.jsx("i", { ...iconProps, className: `fa fa-${iconId}` });
172
- }
173
-
174
309
  const CW_DEFAULT_MESSAGE_DURATION = 2000;
175
310
  exports.CwMessageType = void 0;
176
311
  (function (CwMessageType) {
177
- CwMessageType["ERROR"] = "times-circle";
178
- CwMessageType["WARN"] = "exclamation-triangle";
179
- CwMessageType["INFO"] = "info-circle";
312
+ CwMessageType["ERROR"] = "close-circle";
313
+ CwMessageType["WARN"] = "warning";
314
+ CwMessageType["INFO"] = "info-bubble";
180
315
  CwMessageType["SUCCESS"] = "check-circle";
181
316
  })(exports.CwMessageType || (exports.CwMessageType = {}));
182
317
  const CwMessage = props => {
@@ -242,30 +377,53 @@ function CwDisplayMessage(message, type, duration) {
242
377
  CwMessageManager.getInstance().showMessage(message, type, duration);
243
378
  }
244
379
 
245
- function CwLoading(props) {
246
- return (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("div", { "aria-busy": props.cwelltBooleanLoading, className: props.cwelltBooleanLoading === true
247
- ? "cwellt_flex cwellt_flex_column cwelltContentLoading " +
248
- (props.cwelltClassNameContentLoading === undefined ? "" : props.cwelltClassNameContentLoading)
249
- : "", children: [props.cwelltBooleanLoading === true ? (
250
- // Container loading [ Icon and text of loading here is the property: cwelltClassNameLoading to custom orientation Vertical or Horizontal ]
251
- jsxRuntime.jsxs("div", { className: props.cwelltClassNameLoading === undefined
252
- ? "cwelltContainerLoading cwellt_flex cwellt_justify_center cwellt_align_items_center cwellt_flex_wrap "
253
- : props.cwelltClassNameLoading +
254
- " cwelltContainerLoading cwellt_flex cwellt_justify_center cwellt_align_items_center cwellt_flex_wrap", children: [jsxRuntime.jsx("div", { className: props.cwelltSizeLoading === undefined
255
- ? "cwelltDefaultLoadingSize cwellt_loading cwellt_flex cwellt_align_items_center "
256
- : props.cwelltSizeLoading +
257
- " cwelltDefaultLoadingSize cwellt_loading cwellt_flex cwellt_align_items_center ", children: jsxRuntime.jsx("span", { className: "cwelltIconLoading cwellt_flex cwellt_justify_center cwellt_align_items_center" }) }), jsxRuntime.jsx("div", { className: "cwelltTextLoading", children: jsxRuntime.jsx("h1", { children: props.cwelltTextLoading }) })] })) : (jsxRuntime.jsx("div", {})), jsxRuntime.jsx("div", { className: props.cwelltBooleanLoading === true ? "cwelltContentLoadingDisabled" : "", children: props.children })] }) }));
380
+ /**
381
+ * CwLoading
382
+ *
383
+ * A versatile loading component that shows a spinner with optional text
384
+ * and disables the wrapped content while in loading state.
385
+ *
386
+ * @example
387
+ * // Basic usage
388
+ * <CwLoading isLoading={isSubmitting}>
389
+ * <form>...</form>
390
+ * </CwLoading>
391
+ *
392
+ * // With custom text and size
393
+ * <CwLoading
394
+ * isLoading={isLoading}
395
+ * text="Please wait..."
396
+ * size="large"
397
+ * >
398
+ * <UserProfile />
399
+ * </CwLoading>
400
+ */
401
+ function CwLoading({ isLoading = false, text = '', size = 'regular', iconPosition = 'outside', iconName = 'cwi-plane-solid', animation = 'spin', children }) {
402
+ const iconClasses = `cwi-icons ${iconName || ''}`;
403
+ return (jsxRuntime.jsxs("div", { "aria-busy": isLoading, className: isLoading ? 'cw-loading-container' : '', children: [isLoading && (jsxRuntime.jsxs("div", { className: "cw-loading-content", "data-size": size, "data-animation": animation, children: [jsxRuntime.jsx("div", { className: "cw-loading", "data-icon-position": iconPosition, children: jsxRuntime.jsx("span", { className: iconClasses }) }), text && (jsxRuntime.jsx("p", { children: text }))] })), jsxRuntime.jsx("div", { className: isLoading ? 'cw-loading-disabled-content' : '', children: children })] }));
258
404
  }
259
405
 
406
+ /**
407
+ * @deprecated since may 2025. Use <CwLoading size="small"> instead.
408
+ *
409
+ * This component will be removed in a future release.
410
+ *
411
+ * @example
412
+ * // Instead of:
413
+ * <CwLoadingSmall />
414
+ *
415
+ * // Use:
416
+ * <CwLoading size="small" />
417
+ */
260
418
  function CwLoadingSmall(CwelltLoadingAppointements) {
261
- return (jsxRuntime.jsx("div", { children: CwelltLoadingAppointements.cwelltBooleanLoadingAppointment === true ? (
419
+ return (jsxRuntime.jsx("div", { children: CwelltLoadingAppointements.isLoading === true ? (
262
420
  // * Show loading appointment
263
- jsxRuntime.jsx("div", { className: "cwellt_loadingAppointmentContainer cwellt_loading cwellt_flex cwellt_align_items_center cwellt_loading cwellt_flex cwellt_align_items_center ", children: jsxRuntime.jsx("span", { className: "cwelltIconLoading cwellt_flex cwellt_justify_center cwellt_align_items_center" }) })) : (
421
+ jsxRuntime.jsx("div", { className: "cw-loading-container", children: jsxRuntime.jsx("div", { className: "cw-loading" }) })) : (
264
422
  // Show empty div
265
- jsxRuntime.jsx("div", { className: "cwellt_d_none" })) }));
423
+ jsxRuntime.jsx("div", {})) }));
266
424
  }
267
425
 
268
- var styles$b = {"cw-generic-tooltip-content":"cw-generic-tooltip-module_cw-generic-tooltip-content__la-Si"};
426
+ 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"};
269
427
 
270
428
  // Constants moved outside to prevent recreation
271
429
  const margin = 16;
@@ -376,12 +534,12 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
376
534
  const { setTooltipTimeout, clearTooltipTimeout } = useTooltipDelay(() => {
377
535
  setIsVisible(true);
378
536
  }, showDelay);
379
- const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$b["cw-generic-tooltip-content"]);
537
+ const { position: tooltipPosition, actualPosition } = useTooltipPosition(isVisible, containerRef, position, styles$c["cw-generic-tooltip-content"]);
380
538
  // Memoize tooltip content creation
381
539
  const tooltipContent = React.useMemo(() => {
382
540
  if (hide || !isVisible || !content)
383
541
  return null;
384
- return reactDom.createPortal(jsxRuntime.jsx("div", { className: styles$b["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, style: {
542
+ return reactDom.createPortal(jsxRuntime.jsx("div", { className: styles$c["cw-generic-tooltip-content"], "data-position": actualPosition, "data-visible": isVisible, style: {
385
543
  position: 'fixed',
386
544
  top: `${tooltipPosition.top}px`,
387
545
  left: `${tooltipPosition.left}px`,
@@ -396,7 +554,7 @@ const CwGenericTooltip = ({ children, content = null, position = defaultPosition
396
554
  clearTooltipTimeout();
397
555
  setIsVisible(false);
398
556
  }, [clearTooltipTimeout]);
399
- return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$b["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, children: [tooltipContent, children] }));
557
+ return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$c["cw-generic-tooltip"], onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, children: [tooltipContent, children] }));
400
558
  };
401
559
 
402
560
  // Reference for draggable modal
@@ -515,62 +673,107 @@ class CwModalIframe extends React__namespace.Component {
515
673
  }
516
674
  }
517
675
 
518
- 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"};
676
+ 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"};
519
677
 
520
678
  // Helper function to parse size values
521
679
  const parseSize = (size) => {
522
680
  if (typeof size === 'number')
523
681
  return { value: size, unit: 'px' };
524
682
  // Match numeric value and unit
525
- const match = size.match(/^([\d.]+)(\D+)$/);
683
+ const match = String(size).match(/^([\d.]+)(\D+)$/);
526
684
  if (match) {
527
- return { value: parseFloat(match[1]), unit: match[2] };
685
+ const unit = match[2];
686
+ // Only allow px, rem, vw, vh
687
+ if (['px', 'rem', 'vw', 'vh'].includes(unit)) {
688
+ return { value: parseFloat(match[1]), unit };
689
+ }
528
690
  }
529
- // Default to pixels if no unit specified
530
- return { value: parseFloat(size), unit: 'px' };
691
+ // Default to pixels if no unit specified or unit not supported
692
+ return { value: parseFloat(String(size)), unit: 'px' };
531
693
  };
532
694
  // Helper to convert size to px for calculations
533
695
  const convertToPx = (size) => {
534
- if (size.unit === 'px')
535
- return size.value;
536
- if (size.unit === 'rem')
537
- return size.value * 16; // Assuming 1rem = 16px
538
- if (size.unit === 'vh')
539
- return (window.innerHeight * size.value) / 100;
540
- if (size.unit === 'vw')
541
- return (window.innerWidth * size.value) / 100;
542
- return size.value; // Default fallback
696
+ switch (size.unit) {
697
+ case 'px': return size.value;
698
+ case 'rem': return size.value * 16; // Assuming 1rem = 16px
699
+ case 'vh': return (window.innerHeight * size.value) / 100;
700
+ case 'vw': return (window.innerWidth * size.value) / 100;
701
+ default: return size.value; // Default fallback
702
+ }
703
+ };
704
+ // Function to convert from px back to original unit
705
+ const convertFromPx = (px, unit) => {
706
+ switch (unit) {
707
+ case 'px': return px;
708
+ case 'rem': return px / 16;
709
+ case 'vh': return (px * 100) / window.innerHeight;
710
+ case 'vw': return (px * 100) / window.innerWidth;
711
+ default: return px;
712
+ }
543
713
  };
544
714
  const CwDialog = props => {
715
+ const { customFooter, customHeader, headline, width, height, dialogSize, scrim, onSave, onClose, hideFooter, children, open, ...domProps } = props;
545
716
  const dialogRef = React.useRef(null);
546
- // Default width and height with units
547
- const defaultWidth = 800;
548
- const defaultHeight = 600;
549
- // Parse width and height from props or use defaults
550
- const initialWidth = props.dialogSize?.width !== undefined ? props.dialogSize.width : defaultWidth;
551
- const initialHeight = props.dialogSize?.height !== undefined ? props.dialogSize.height : defaultHeight;
552
- // Parse the sizes to separate value and unit
553
- const parsedWidth = parseSize(initialWidth);
554
- const parsedHeight = parseSize(initialHeight);
555
- // Convert to px for internal calculations
556
- const initialWidthPx = convertToPx(parsedWidth);
557
- const initialHeightPx = convertToPx(parsedHeight);
558
- const initialDialogSize = {
559
- width: initialWidthPx,
560
- height: initialHeightPx,
561
- widthUnit: parsedWidth.unit,
562
- heightUnit: parsedHeight.unit
563
- };
717
+ const initialSetup = React.useMemo(() => {
718
+ // Default width and height with units
719
+ const defaultWidth = 800;
720
+ // Priority: direct props > dialogSize > default values
721
+ const initialWidth = width !== undefined
722
+ ? width
723
+ : dialogSize?.width !== undefined
724
+ ? dialogSize.width
725
+ : defaultWidth;
726
+ const initialHeight = height !== undefined
727
+ ? height
728
+ : dialogSize?.height !== undefined
729
+ ? dialogSize.height
730
+ : undefined; // Undefined for autoHeight
731
+ // Determine if height is automatic when height is not provided
732
+ const isAutoHeight = initialHeight === undefined;
733
+ // Parse the sizes to separate value and unit
734
+ const parsedWidth = parseSize(initialWidth);
735
+ const parsedHeight = isAutoHeight
736
+ ? { value: 0, unit: 'auto' }
737
+ : parseSize(initialHeight);
738
+ // Convert to px for internal calculations
739
+ const initialWidthPx = convertToPx(parsedWidth);
740
+ const initialHeightPx = isAutoHeight ? 0 : convertToPx(parsedHeight);
741
+ // Use estimated height for initial positioning when autoHeight is true
742
+ const initialEstimatedHeight = isAutoHeight ? 300 : initialHeightPx;
743
+ const initialDialogSize = {
744
+ width: initialWidthPx,
745
+ height: initialHeightPx,
746
+ widthUnit: parsedWidth.unit,
747
+ heightUnit: parsedHeight.unit,
748
+ autoHeight: isAutoHeight
749
+ };
750
+ const initialPosition = {
751
+ x: window.document.body.clientWidth / 2 - initialWidthPx / 2,
752
+ y: window.document.body.clientHeight / 2 - initialEstimatedHeight / 2
753
+ };
754
+ return { initialDialogSize, initialPosition };
755
+ }, [width, height, dialogSize]); // Only recalculate when these props change
564
756
  const [isDragging, setIsDragging] = React.useState(false);
565
757
  const [resizeDirection, setResizeDirection] = React.useState(null);
566
- const [position, setPosition] = React.useState({
567
- x: window.document.body.clientWidth / 2 - initialDialogSize.width / 2,
568
- y: window.document.body.clientHeight / 2 - initialDialogSize.height / 2
569
- });
570
- const [size, setSize] = React.useState(initialDialogSize);
758
+ const [position, setPosition] = React.useState(initialSetup.initialPosition);
759
+ const [size, setSize] = React.useState(initialSetup.initialDialogSize);
571
760
  const [dragStart, setDragStart] = React.useState({ x: 0, y: 0 });
572
761
  // scrim is true by default
573
- const hasScrim = props.scrim !== false;
762
+ const hasScrim = scrim !== false;
763
+ // Adjust position after the dialog is rendered when using autoHeight
764
+ React.useEffect(() => {
765
+ if (size.autoHeight && dialogRef.current && open) {
766
+ // Get the actual height after rendering
767
+ const actualHeight = dialogRef.current.offsetHeight;
768
+ // Only update position if height is available
769
+ if (actualHeight > 0) {
770
+ setPosition(prevPos => ({
771
+ ...prevPos,
772
+ y: window.document.body.clientHeight / 2 - actualHeight / 2
773
+ }));
774
+ }
775
+ }
776
+ }, [size.autoHeight, open]);
574
777
  React.useEffect(() => {
575
778
  const handleMouseMove = (e) => {
576
779
  if (isDragging) {
@@ -600,29 +803,39 @@ const CwDialog = props => {
600
803
  let newY = position.y;
601
804
  const minVisiblePx = 64;
602
805
  const minSize = 100;
603
- if (resizeDirection.includes("w")) {
604
- const dx = e.clientX - position.x;
605
- newWidth = Math.max(size.width - dx, minSize);
606
- newX = Math.min(Math.max(position.x + dx, minVisiblePx - newWidth), position.x + size.width - minSize);
607
- }
608
- if (resizeDirection.includes("e")) {
609
- newWidth = Math.min(Math.max(e.clientX - position.x, minSize), parentRect.width - position.x + dialogRect.width - minVisiblePx);
806
+ // Only allow horizontal resizing if autoHeight is true
807
+ if (!size.autoHeight || (!resizeDirection.includes("n") && !resizeDirection.includes("s"))) {
808
+ // Logic for horizontal resizing
809
+ if (resizeDirection.includes("w")) {
810
+ const dx = e.clientX - position.x;
811
+ newWidth = Math.max(size.width - dx, minSize);
812
+ newX = Math.min(Math.max(position.x + dx, minVisiblePx - newWidth), position.x + size.width - minSize);
813
+ }
814
+ if (resizeDirection.includes("e")) {
815
+ newWidth = Math.min(Math.max(e.clientX - position.x, minSize), parentRect.width - position.x + dialogRect.width - minVisiblePx);
816
+ }
610
817
  }
611
- if (resizeDirection.includes("n")) {
612
- const dy = e.clientY - position.y;
613
- newHeight = Math.max(size.height - dy, minSize);
614
- newY = Math.min(Math.max(position.y + dy, minVisiblePx - newHeight), position.y + size.height - minSize);
615
- }
616
- if (resizeDirection.includes("s")) {
617
- newHeight = Math.min(Math.max(e.clientY - position.y, minSize), parentRect.height - position.y + dialogRect.height - minVisiblePx);
818
+ // Only apply vertical resizing if autoHeight is false
819
+ if (!size.autoHeight) {
820
+ if (resizeDirection.includes("n")) {
821
+ const dy = e.clientY - position.y;
822
+ newHeight = Math.max(size.height - dy, minSize);
823
+ newY = Math.min(Math.max(position.y + dy, minVisiblePx - newHeight), position.y + size.height - minSize);
824
+ }
825
+ if (resizeDirection.includes("s")) {
826
+ newHeight = Math.min(Math.max(e.clientY - position.y, minSize), parentRect.height - position.y + dialogRect.height - minVisiblePx);
827
+ }
618
828
  }
619
829
  // Ensure the modal stays within bounds after resizing
620
830
  newX = Math.min(Math.max(newX, minVisiblePx - newWidth), parentRect.width - minVisiblePx);
621
831
  newY = Math.min(Math.max(newY, minVisiblePx - newHeight), parentRect.height - minVisiblePx);
832
+ // Update state maintaining original units
622
833
  setSize({
623
- ...size,
624
834
  width: newWidth,
625
- height: newHeight
835
+ height: newHeight,
836
+ widthUnit: size.widthUnit,
837
+ heightUnit: size.heightUnit,
838
+ autoHeight: size.autoHeight
626
839
  });
627
840
  setPosition({ x: newX, y: newY });
628
841
  }
@@ -640,41 +853,54 @@ const CwDialog = props => {
640
853
  document.removeEventListener("mouseup", handleMouseUp);
641
854
  };
642
855
  }, [isDragging, resizeDirection, dragStart, position, size]);
643
- const handleMouseDown = (e) => {
856
+ const handleMouseDown = React.useCallback((e) => {
644
857
  setIsDragging(true);
645
858
  setDragStart({ x: e.clientX - position.x, y: e.clientY - position.y });
646
- };
647
- const handleResizeMouseDown = (direction) => (e) => {
859
+ }, [position]);
860
+ const handleResizeMouseDown = React.useCallback((direction) => (e) => {
648
861
  e.stopPropagation();
649
862
  setResizeDirection(direction);
650
- };
651
- const header = (jsxRuntime.jsxs("header", { onMouseDown: handleMouseDown, children: [jsxRuntime.jsx("span", { children: props.headline }), props.customHeader || (jsxRuntime.jsx("button", { className: styles$a["cw-dialog-button-close"], onClick: props.onClose, children: "\u2A2F" }))] }));
652
- const content = (jsxRuntime.jsx("section", { style: { flex: 1, overflowX: "auto", overflowY: "auto", width: "100%" }, children: props.children }));
653
- const footer = (jsxRuntime.jsx("footer", { style: { width: "100%" }, children: props.customFooter || (jsxRuntime.jsx("button", { className: "cw-button-icon cwi-save", onClick: props.onSave })) }));
654
- const resizeHandles = [
655
- jsxRuntime.jsx("div", { "data-handle-n": true, onMouseDown: handleResizeMouseDown("n") }, "handle-n"),
656
- jsxRuntime.jsx("div", { "data-handle-s": true, onMouseDown: handleResizeMouseDown("s") }, "handle-s"),
657
- jsxRuntime.jsx("div", { "data-handle-e": true, onMouseDown: handleResizeMouseDown("e") }, "handle-e"),
658
- jsxRuntime.jsx("div", { "data-handle-w": true, onMouseDown: handleResizeMouseDown("w") }, "handle-w"),
659
- jsxRuntime.jsx("div", { "data-handle-ne": true, onMouseDown: handleResizeMouseDown("ne") }, "handle-ne"),
660
- jsxRuntime.jsx("div", { "data-handle-nw": true, onMouseDown: handleResizeMouseDown("nw") }, "handle-nw"),
661
- jsxRuntime.jsx("div", { "data-handle-se": true, onMouseDown: handleResizeMouseDown("se") }, "handle-se"),
662
- jsxRuntime.jsx("div", { "data-handle-sw": true, onMouseDown: handleResizeMouseDown("sw") }, "handle-sw")
663
- ];
664
- // Prepare width and height with units for display
665
- const displayWidth = `${size.width}${size.widthUnit === 'px' ? 'px' : size.widthUnit}`;
666
- const displayHeight = `${size.height}${size.heightUnit === 'px' ? 'px' : size.heightUnit}`;
667
- return (props.open && (jsxRuntime.jsx("div", { "data-has-scrim": hasScrim, className: styles$a["cw-dialog-main"], children: jsxRuntime.jsxs("dialog", { ...props, ref: dialogRef, style: {
863
+ }, []);
864
+ const handleScrimClick = React.useCallback((e) => {
865
+ if (e.target === e.currentTarget && onClose) {
866
+ onClose();
867
+ }
868
+ }, [onClose]);
869
+ const header = React.useMemo(() => (jsxRuntime.jsxs("header", { onMouseDown: handleMouseDown, children: [jsxRuntime.jsx("span", { children: headline }), customHeader || (jsxRuntime.jsx("button", { className: styles$b["cw-dialog-button-close"], onClick: onClose }))] })), [handleMouseDown, headline, customHeader, onClose]);
870
+ const content = React.useMemo(() => (jsxRuntime.jsx("section", { children: children })), [children]);
871
+ const footer = React.useMemo(() => (jsxRuntime.jsx("footer", { children: customFooter || (jsxRuntime.jsx("button", { className: "cw-button-icon cwi-save", onClick: onSave })) })), [customFooter, onSave]);
872
+ const resizeHandles = React.useMemo(() => size.autoHeight
873
+ ? [
874
+ // Only horizontal handles if autoHeight is true
875
+ jsxRuntime.jsx("div", { "data-handle-e": true, onMouseDown: handleResizeMouseDown("e") }, "handle-e"),
876
+ jsxRuntime.jsx("div", { "data-handle-w": true, onMouseDown: handleResizeMouseDown("w") }, "handle-w")
877
+ ]
878
+ : [
879
+ // All handles if autoHeight is false
880
+ jsxRuntime.jsx("div", { "data-handle-n": true, onMouseDown: handleResizeMouseDown("n") }, "handle-n"),
881
+ jsxRuntime.jsx("div", { "data-handle-s": true, onMouseDown: handleResizeMouseDown("s") }, "handle-s"),
882
+ jsxRuntime.jsx("div", { "data-handle-e": true, onMouseDown: handleResizeMouseDown("e") }, "handle-e"),
883
+ jsxRuntime.jsx("div", { "data-handle-w": true, onMouseDown: handleResizeMouseDown("w") }, "handle-w"),
884
+ jsxRuntime.jsx("div", { "data-handle-ne": true, onMouseDown: handleResizeMouseDown("ne") }, "handle-ne"),
885
+ jsxRuntime.jsx("div", { "data-handle-nw": true, onMouseDown: handleResizeMouseDown("nw") }, "handle-nw"),
886
+ jsxRuntime.jsx("div", { "data-handle-se": true, onMouseDown: handleResizeMouseDown("se") }, "handle-se"),
887
+ jsxRuntime.jsx("div", { "data-handle-sw": true, onMouseDown: handleResizeMouseDown("sw") }, "handle-sw")
888
+ ], [size.autoHeight, handleResizeMouseDown]);
889
+ const displayDimensions = React.useMemo(() => {
890
+ // Prepare width and height with original units for display
891
+ const displayWidth = `${convertFromPx(size.width, size.widthUnit)}${size.widthUnit}`;
892
+ // If autoHeight, don't specify height and let it adapt to content
893
+ const displayHeight = size.autoHeight
894
+ ? 'auto'
895
+ : `${convertFromPx(size.height, size.heightUnit)}${size.heightUnit}`;
896
+ return { displayWidth, displayHeight };
897
+ }, [size.width, size.height, size.widthUnit, size.heightUnit, size.autoHeight]);
898
+ return (open && (jsxRuntime.jsx("div", { "data-has-scrim": hasScrim, className: styles$b["cw-dialog-main"], onClick: handleScrimClick, children: jsxRuntime.jsxs("dialog", { ...domProps, ref: dialogRef, style: {
668
899
  left: `${position.x}px`,
669
900
  top: `${position.y}px`,
670
- width: displayWidth,
671
- height: displayHeight,
672
- zIndex: props.zIndex,
673
- minWidth: "200px", // Set an appropriate minimum size
674
- minHeight: "200px", // Set an appropriate minimum size
675
- display: "flex",
676
- flexDirection: "column"
677
- }, children: [header, content, props.isReport !== true && footer, resizeHandles] }) })));
901
+ width: displayDimensions.displayWidth,
902
+ height: displayDimensions.displayHeight
903
+ }, children: [header, content, hideFooter !== true && footer, resizeHandles] }) })));
678
904
  };
679
905
 
680
906
  const CwModalReportFunctional = (props) => {
@@ -695,7 +921,9 @@ const CwModalReportFunctional = (props) => {
695
921
  return (jsxRuntime.jsxs("div", { children: ["Please add a(n) ", props.reportName, " report in ", props.moduleSettings, " Settings"] }));
696
922
  }
697
923
  };
698
- return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: isModal ? (jsxRuntime.jsx(CwDialog, { open: props.visible, dialogSize: { width: props.width, height: props.height }, headline: props.title, customFooter: [jsxRuntime.jsx("div", {}, "footer")], onClose: props.onCloseModal, isReport: true, children: renderContentModal() })) : (jsxRuntime.jsx("div", { children: renderContentNotModal() })) }));
924
+ return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: isModal ? (jsxRuntime.jsx(CwDialog, { open: props.visible, width: props.width, headline: props.title,
925
+ //customFooter={[<div key="footer"></div>]}
926
+ onClose: props.onCloseModal, hideFooter: true, children: renderContentModal() })) : (jsxRuntime.jsx("div", { children: renderContentNotModal() })) }));
699
927
  };
700
928
 
701
929
  class CwReportModal extends React__namespace.Component {
@@ -715,10 +943,10 @@ class CwReportModal extends React__namespace.Component {
715
943
  };
716
944
  }
717
945
  render() {
718
- return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: this.state.isModal === true ? (jsxRuntime.jsxs(CwDialog, { open: this.props.visible, dialogSize: { width: this.props.width, height: this.props.height }, headline: this.props.title, customFooter: new Array(jsxRuntime.jsx("div", {})), onClose: () => {
946
+ return (jsxRuntime.jsx("div", { id: "cwelltModalReportContent", children: this.state.isModal === true ? (jsxRuntime.jsxs(CwDialog, { open: this.props.visible, width: this.props.width, headline: this.props.title, customFooter: new Array(jsxRuntime.jsx("div", {})), onClose: () => {
719
947
  this.formRef?.current?.resetFields();
720
948
  this.props.SET_MODAL_REPORT_VISIBLE(false);
721
- }, isReport: true, children: [this.props.name !== "Empty.pdf" && (jsxRuntime.jsx("div", { style: { width: "100%", height: "100%", overflowX: "auto", overflowY: "auto" }, children: jsxRuntime.jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", style: { width: "100%", height: "100%", display: "block" } }) })), this.props.name === "Empty.pdf" && (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("h1", { style: { marginLeft: "2em" }, children: [" ", "Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }) }))] })) : (jsxRuntime.jsxs("div", { children: [this.props.name !== "Empty.pdf" && (jsxRuntime.jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", width: "100%", height: "600px" })), this.props.name === "Empty.pdf" && (jsxRuntime.jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
949
+ }, hideFooter: true, children: [this.props.name !== "Empty.pdf" && (jsxRuntime.jsx("div", { style: { width: "100%", height: "100%", overflowX: "auto", overflowY: "auto" }, children: jsxRuntime.jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", style: { width: "100%", height: "100%", display: "block" } }) })), this.props.name === "Empty.pdf" && (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("h1", { style: { marginLeft: "2em" }, children: [" ", "Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }) }))] })) : (jsxRuntime.jsxs("div", { children: [this.props.name !== "Empty.pdf" && (jsxRuntime.jsx("embed", { src: "data:application/pdf;base64," + this.props.content, type: "application/pdf", width: "100%", height: "600px" })), this.props.name === "Empty.pdf" && (jsxRuntime.jsxs("div", { children: ["Please add a(n) ", this.props.reportName, " report in ", this.props.moduleSettings, " Settings"] }))] })) }));
722
950
  }
723
951
  }
724
952
 
@@ -819,6 +1047,59 @@ class CwDialogManager {
819
1047
  }
820
1048
  }
821
1049
 
1050
+ 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"};
1051
+
1052
+ /**
1053
+ * CwCard - A simple card component for displaying content in a contained format
1054
+ *
1055
+ * @example
1056
+ * <CwCard
1057
+ * title="Card Title"
1058
+ * subtitle="Card Subtitle"
1059
+ * onEdit={handleEdit}
1060
+ * onDelete={confirmDeletion}
1061
+ * footer="Last updated: 2 days ago"
1062
+ * chips={[
1063
+ * { label: 'Important', colorScheme: 'danger' },
1064
+ * { label: 'Custom', colorScheme: 'custom', customColor: '#8a2be2' }
1065
+ * ]}
1066
+ * >
1067
+ * <p>This is the main content of the card.</p>
1068
+ * </CwCard>
1069
+ **/
1070
+ 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", }) => {
1071
+ // Construct class names using CSS modules
1072
+ const cardClassNames = [
1073
+ 'cw-card',
1074
+ styles$a.card,
1075
+ className,
1076
+ clickable ? styles$a.clickable : '',
1077
+ disabled ? styles$a.disabled : '',
1078
+ isLoading ? styles$a.loading : '',
1079
+ ].filter(Boolean).join(' ');
1080
+ // Handle click event when card is clickable
1081
+ const handleClick = () => {
1082
+ if (clickable && onClick && !disabled && !isLoading) {
1083
+ onClick();
1084
+ }
1085
+ };
1086
+ // Determine if actions should be rendered
1087
+ const hasActions = onEdit || onDelete || extraActions;
1088
+ // Determine if header should be rendered
1089
+ const hasHeader = title || subtitle || (hasActions && direction === "column");
1090
+ // Determine if chips should be rendered
1091
+ const hasChips = chips.length > 0;
1092
+ // Determine if footer should be rendered
1093
+ const hasFooter = hasChips || footer || (hasActions && direction === "row");
1094
+ // Actions component to reuse
1095
+ const ActionsComponent = hasActions && !disabled ? (jsxRuntime.jsxs("div", { className: styles$a.actions, children: [extraActions ?? null, onEdit && jsxRuntime.jsx("button", { className: "cw-button-icon cwi-edit", onClick: onEdit }), onDelete && jsxRuntime.jsx("button", { className: "cw-button-icon cwi-delete", "data-button-variant": "danger", onClick: onDelete })] })) : null;
1096
+ return (jsxRuntime.jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && {
1097
+ role: 'button',
1098
+ tabIndex: 0,
1099
+ onClick: handleClick,
1100
+ }), "data-variant": variant, "data-direction": direction, children: [hasHeader && (jsxRuntime.jsxs("header", { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: styles$a.headerContent, "data-alignment": alignment, children: [title && jsxRuntime.jsx("h5", { children: title }), subtitle && jsxRuntime.jsx("strong", { children: subtitle })] })), direction === "column" && ActionsComponent] })), jsxRuntime.jsx("div", { className: styles$a.content, children: children }), hasFooter && (jsxRuntime.jsxs("footer", { children: [hasChips && (jsxRuntime.jsx("div", { className: styles$a.footerTags, children: chips.map((chip, index) => (jsxRuntime.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 && (jsxRuntime.jsx("div", { className: styles$a.footerContent, children: footer }))] })), direction === "row" && ActionsComponent, isLoading && (jsxRuntime.jsx("div", { className: styles$a.loadingOverlay, children: jsxRuntime.jsx(CwLoading, { isLoading: isLoading, size: "small" }) }))] }));
1101
+ };
1102
+
822
1103
  var styles$9 = {"cw-accordion":"cw-accordion-module_cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module_cw-accordion-body__xlI8b"};
823
1104
 
824
1105
  /**
@@ -840,161 +1121,202 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
840
1121
  }
841
1122
 
842
1123
  /**
843
- * A Table view
844
- * @param props
1124
+ * A reusable and customizable table component.
1125
+ *
1126
+ * @param props - Component props to configure columns, data, styles, pagination, expanded rows, and more.
1127
+ *
845
1128
  * @example
846
- * const columns = [
1129
+ * const columns: Column<User>[] = [
847
1130
  * {
848
1131
  * title: 'Name',
849
1132
  * dataIndex: 'name',
850
1133
  * key: 'name',
1134
+ * sortable: true, // Column is sortable
1135
+ * width: 100 // You can define the width of the column
851
1136
  * },
852
1137
  * {
853
1138
  * title: 'Age',
854
1139
  * dataIndex: 'age',
855
1140
  * key: 'age',
856
- * render: (age) => <span>{age} years</span>, // Example of custom rendering
1141
+ * sortable: true,
1142
+ * render: (item) => <span>{item.age} years</span> // Custom rendering
857
1143
  * },
858
1144
  * {
859
1145
  * title: 'Address',
860
1146
  * dataIndex: 'address',
861
1147
  * key: 'address',
862
- * render: (address) => (
863
- * <a href={`https://maps.google.com/?q=${encodeURIComponent(address)}`} target="_blank">
864
- * {address}
1148
+ * render: (item) => (
1149
+ * <a href={`https://maps.google.com/?q=${encodeURIComponent(item.address)}`} target="_blank" rel="noreferrer">
1150
+ * {item.address}
865
1151
  * </a>
866
- * ), // Example of custom link rendering
867
- * },
1152
+ * ) // Link rendering
1153
+ * }
868
1154
  * ];
869
1155
  *
870
- * const data = [
871
- * {
872
- * key: '1',
873
- * name: 'Mike',
874
- * age: 32,
875
- * address: '10 Downing Street',
876
- * },
877
- * {
878
- * key: '2',
879
- * name: 'John',
880
- * age: 42,
881
- * address: '10 Downing Street',
882
- * },
883
- * {
884
- * key: '3',
885
- * name: 'Andres',
886
- * age: 33,
887
- * address: '10 Downing Street',
888
- * },
889
- * {
890
- * key: '4',
891
- * name: 'Gabriel',
892
- * age: 22,
893
- * address: '10 Downing Street',
894
- * },
895
- * {
896
- * key: '5',
897
- * name: 'Sergio',
898
- * age: 47,
899
- * address: '10 Downing Street',
900
- * },
901
- * {
902
- * key: '6',
903
- * name: 'Zacarias',
904
- * age: 61,
905
- * address: '10 Downing Street',
906
- * },
1156
+ * const data:User[] = [
1157
+ * { key: '1', name: 'Mike', age: 32, address: '10 Downing Street' },
1158
+ * { key: '2', name: 'John', age: 42, address: '11 Downing Street' },
1159
+ * { key: '3', name: 'Andres', age: 33, address: '12 Downing Street' },
1160
+ * { key: '4', name: 'Gabriel', age: 22, address: '13 Downing Street' },
1161
+ * { key: '5', name: 'Sergio', age: 47, address: '14 Downing Street' },
1162
+ * { key: '6', name: 'Zacarias', age: 61, address: '15 Downing Street' }
907
1163
  * ];
908
1164
  *
909
- * const generateExpandedContent = (record) => {
910
- * var testValue = record;
911
- * return (
912
- * <div>
913
- * Contenido expandido personalizado para {record.name}
914
- * </div>
915
- * );
916
- * };
917
- *
918
- * ------------------------- render ---------------------------
1165
+ * const generateExpandedContent = (record) => (
1166
+ * <div>
1167
+ * Custom expanded content for {record.name}
1168
+ * </div>
1169
+ * );
919
1170
  *
920
- * <CwTable
1171
+ * <CwTable<User>
921
1172
  * columns={columns}
922
- * data={data} // WTF whatever array of objects you add here, make sure each has a key otherwise everything will expand
923
- * itemsPerPage={3}
1173
+ * data={data}
924
1174
  * pagination={true}
1175
+ * pageSizeOptions={[3, 5, 10]} // Optional, defaults to [5, 10, 20, 50]
925
1176
  * expandedRowRender={generateExpandedContent}
926
- * onExpand={(e)=> test(e)}
1177
+ * onExpand={(item) => console.log('Expanded:', item)}
1178
+ * rowKey="key" // Optional, defaults to 'key'
1179
+ * textNoData="No data available" // Optional message when no data
1180
+ * loading={false} // Optional, shows loading indicator
1181
+ * scrollHeight={300} // Optional scroll height, defaults to 300
1182
+ * stickyHeader={true} // Optional, makes header sticky on scroll
1183
+ * classNameContainer="my-table-wrapper" // Optional wrapper class
1184
+ * className="my-table" // Optional table class
1185
+ * classNameRow="my-table-row" // Optional class for each row
1186
+ * id="custom-table-id" // Optional ID for the container
1187
+ * style={{ border: '1px solid #ccc' }} // Optional inline styles
927
1188
  * />
1189
+ *
928
1190
  * @returns React component
929
1191
  */
930
- function CwTable({ columns, data, pagination, itemsPerPage, expandedRowRender, onExpand, className, classNameHeader, classNameRow, style, classNameContainer, id, textNoData }) {
1192
+ 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, }) {
931
1193
  const [currentPage, setCurrentPage] = React.useState(1);
932
1194
  const [expandedRowKey, setExpandedRowKey] = React.useState(null);
933
1195
  const [sortConfig, setSortConfig] = React.useState({
934
1196
  key: null,
935
1197
  direction: "asc"
936
1198
  });
937
- // Function to handle expanding/collapsing rows
938
- const handleRowExpand = (rowKey) => {
939
- if (expandedRowKey === rowKey.key) {
940
- setExpandedRowKey(null);
941
- }
942
- else {
943
- setExpandedRowKey(rowKey.key);
944
- }
945
- if (typeof onExpand === "function") {
946
- onExpand(rowKey);
947
- }
948
- };
949
- // Function to handle sorting by column
950
- const handleSort = (columnKey) => {
951
- let direction = "asc";
952
- if (sortConfig.key === columnKey && sortConfig.direction === "asc") {
953
- direction = "desc";
954
- }
955
- setSortConfig({ key: columnKey, direction });
956
- };
957
- // Use useMemo to calculate sortedData
1199
+ const [localItemsPerPage, setLocalItemsPerPage] = React.useState(pageSizeOptions[0]);
1200
+ const [columnWidths, setColumnWidths] = React.useState(() => columns.reduce((acc, col) => {
1201
+ if (col.width)
1202
+ acc[col.key] = col.width;
1203
+ return acc;
1204
+ }, {}));
1205
+ const handleItemsPerPageChange = React.useCallback((e) => {
1206
+ setLocalItemsPerPage(parseInt(e.target.value, 10));
1207
+ setCurrentPage(1);
1208
+ }, []);
1209
+ const handleRowExpand = React.useCallback((item) => {
1210
+ const itemKey = item[rowKey];
1211
+ setExpandedRowKey((prev) => (prev === itemKey ? null : itemKey));
1212
+ onExpand?.(item);
1213
+ }, [rowKey, onExpand]);
1214
+ const handleSort = React.useCallback((columnKey) => {
1215
+ setSortConfig(prev => {
1216
+ if (prev.key !== columnKey)
1217
+ return { key: columnKey, direction: "asc" };
1218
+ if (prev.direction === "asc")
1219
+ return { key: columnKey, direction: "desc" };
1220
+ return { key: null, direction: "asc" };
1221
+ });
1222
+ }, []);
958
1223
  const sortedData = React.useMemo(() => {
959
1224
  if (!data || data.length === 0)
960
- return null;
1225
+ return [];
961
1226
  const dataCopy = [...data];
962
- if (sortConfig.key !== null) {
1227
+ if (sortConfig.key) {
963
1228
  dataCopy.sort((a, b) => {
964
- const aValue = a[sortConfig.key];
965
- const bValue = b[sortConfig.key];
966
- if (aValue < bValue) {
967
- return sortConfig.direction === "asc" ? -1 : 1;
968
- }
969
- if (aValue > bValue) {
970
- return sortConfig.direction === "asc" ? 1 : -1;
971
- }
972
- return 0;
1229
+ const aVal = a[sortConfig.key];
1230
+ const bVal = b[sortConfig.key];
1231
+ return (aVal < bVal ? -1 : aVal > bVal ? 1 : 0) * (sortConfig.direction === "asc" ? 1 : -1);
973
1232
  });
974
1233
  }
975
1234
  return dataCopy;
976
1235
  }, [data, sortConfig]);
977
- // Calculate paged data only if sortedData is not null
978
1236
  const paginatedData = React.useMemo(() => {
979
1237
  if (!sortedData)
980
- return null;
981
- const startIndex = itemsPerPage !== undefined ? (currentPage - 1) * itemsPerPage : 0;
982
- const endIndex = itemsPerPage !== undefined ? startIndex + itemsPerPage : sortedData.length;
983
- return sortedData.slice(startIndex, endIndex);
984
- }, [sortedData, currentPage, itemsPerPage]);
985
- // Calculate the total number of pages for pagination
1238
+ return [];
1239
+ if (!pagination)
1240
+ return sortedData;
1241
+ const start = (currentPage - 1) * localItemsPerPage;
1242
+ return sortedData.slice(start, start + localItemsPerPage);
1243
+ }, [sortedData, currentPage, localItemsPerPage, pagination]);
986
1244
  const totalPages = React.useMemo(() => {
987
- if (!sortedData)
988
- return 0;
989
- return itemsPerPage !== undefined ? Math.ceil(sortedData.length / itemsPerPage) : 1;
990
- }, [sortedData, itemsPerPage]);
991
- // Function to handle page change
992
- const handlePageChange = (newPage) => {
993
- if (newPage >= 1 && newPage <= totalPages) {
994
- setCurrentPage(newPage);
1245
+ return pagination ? Math.ceil(sortedData.length / localItemsPerPage) : 1;
1246
+ }, [sortedData, localItemsPerPage, pagination]);
1247
+ const handlePageChange = (page) => {
1248
+ if (page >= 1 && page <= totalPages)
1249
+ setCurrentPage(page);
1250
+ };
1251
+ const startResize = (e, key) => {
1252
+ e.preventDefault();
1253
+ const startX = e.clientX;
1254
+ const startWidth = e.target.parentElement?.offsetWidth || 0;
1255
+ const onMouseMove = (moveEvent) => {
1256
+ const newWidth = Math.max(startWidth + moveEvent.clientX - startX, 50); // mínimo 50px
1257
+ setColumnWidths(prev => ({ ...prev, [key]: newWidth }));
1258
+ };
1259
+ const onMouseUp = () => {
1260
+ window.removeEventListener("mousemove", onMouseMove);
1261
+ window.removeEventListener("mouseup", onMouseUp);
1262
+ };
1263
+ window.addEventListener("mousemove", onMouseMove);
1264
+ window.addEventListener("mouseup", onMouseUp);
1265
+ };
1266
+ const scrollContainerStyle = React.useMemo(() => {
1267
+ if (stickyHeader || scrollHeight) {
1268
+ return {
1269
+ maxHeight: scrollHeight ?? 300,
1270
+ overflowY: "auto"
1271
+ };
995
1272
  }
1273
+ return {}; // sin altura ni scroll
1274
+ }, [stickyHeader, scrollHeight]);
1275
+ const getColSpan = () => columns.length + (expandedRowRender ? 1 : 0);
1276
+ const renderTableBody = () => {
1277
+ if (loading) {
1278
+ return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: jsxRuntime.jsx("div", { className: "text-center py-4 text-muted-foreground", children: "Loading data..." }) }) }));
1279
+ }
1280
+ if (!paginatedData || paginatedData.length === 0) {
1281
+ return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
1282
+ }
1283
+ return paginatedData.map(item => {
1284
+ const itemKey = item[rowKey];
1285
+ if (!itemKey)
1286
+ console.warn("Missing row key for item", item);
1287
+ return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("tr", { className: classNameRow ?? "", children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === itemKey
1288
+ ? "cwi-chevron-down"
1289
+ : "cwi-chevron-right"}` }) })), columns.map(col => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : String(item[col.dataIndex]) }, `${itemKey}_${col.key}`)))] }), expandedRowRender && expandedRowKey === itemKey && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: expandedRowRender(item) }) }))] }, String(itemKey)));
1290
+ });
996
1291
  };
997
- return (jsxRuntime.jsxs("div", { id: id, className: `cw-table-container ${classNameContainer || ""}`, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className || ""}`, style: style, children: [jsxRuntime.jsx("thead", { className: `${classNameHeader || ""}`, children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(column => (jsxRuntime.jsx("th", { onClick: () => handleSort(column.dataIndex), className: `${column.className || ""} ${sortConfig.key === column.dataIndex ? sortConfig.direction : ""}`.trim(), children: column.title }, column.key)))] }) }), jsxRuntime.jsx("tbody", { children: !paginatedData || paginatedData.length === 0 ? (jsxRuntime.jsx("tr", { children: jsxRuntime.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 => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("tr", { className: `${classNameRow || ""}`, children: [expandedRowRender && (jsxRuntime.jsx("td", { className: "cw-table-col-action cw-table-col-expand", children: jsxRuntime.jsx("button", { onClick: () => handleRowExpand(item), className: `cw-button-icon ${expandedRowKey === item.key ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map(column => (jsxRuntime.jsx("td", { className: column.className || "", children: column.render ? column.render(item) : item[column.dataIndex] }, `${item.key}_${column.key}`)))] }), expandedRowKey === item.key && expandedRowRender && (jsxRuntime.jsx("tr", { className: "cw-table-row-expanded", children: jsxRuntime.jsx("td", { colSpan: columns.length + 1, children: expandedRowRender(item) }) }))] }, item.key)))) })] }), pagination && totalPages > 1 && (jsxRuntime.jsxs("footer", { className: "cw-table-pagination", children: [jsxRuntime.jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1, className: "cw-button-icon cwi-chevron-left" }), jsxRuntime.jsxs("span", { children: ["Page ", currentPage, " of ", totalPages] }), jsxRuntime.jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages, className: "cw-button-icon cwi-chevron-right" })] }))] }));
1292
+ return (jsxRuntime.jsxs("div", { id: id, className: `cw-table-container ${classNameContainer ?? ""}`, style: style, children: [jsxRuntime.jsx("div", { style: scrollContainerStyle, children: jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { style: stickyHeader
1293
+ ? { position: "sticky", top: 0, background: "white", zIndex: 2 }
1294
+ : undefined, children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
1295
+ ? sortConfig.direction
1296
+ : ""}`.trim(), style: {
1297
+ cursor: col.sortable ? "pointer" : "default",
1298
+ userSelect: "none",
1299
+ width: columnWidths[col.key] ?? col.width,
1300
+ ...((col.width || columnWidths[col.key]) && {
1301
+ minWidth: 50,
1302
+ maxWidth: columnWidths[col.key] ?? col.width
1303
+ }),
1304
+ }, children: [jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [jsxRuntime.jsx("span", { children: col.title }), col.sortable && (jsxRuntime.jsx("span", { style: { fontSize: "12px", marginLeft: "6px" }, children: sortConfig.key !== col.dataIndex ? "↕" : sortConfig.direction === "asc"
1305
+ ? "↑"
1306
+ : "↓" }))] }), jsxRuntime.jsx("span", { onMouseDown: (e) => startResize(e, col.key), className: "th-column-resizer" })] }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderTableBody() })] }) }), pagination && totalPages > 1 && (jsxRuntime.jsxs("footer", { className: "cw-table-pagination", children: [jsxRuntime.jsx("button", { onClick: () => handlePageChange(1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left-double", title: "First" }), jsxRuntime.jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage === 1 || totalPages === 1, className: "cw-button-icon cwi-chevron-left", title: "Previous" }), jsxRuntime.jsx("input", { type: "number", value: currentPage, onChange: (e) => {
1307
+ const value = parseInt(e.target.value, 10);
1308
+ if (!isNaN(value))
1309
+ handlePageChange(value);
1310
+ }, onBlur: (e) => {
1311
+ const value = parseInt(e.target.value, 10);
1312
+ if (isNaN(value) || value < 1 || value > totalPages) {
1313
+ handlePageChange(1);
1314
+ }
1315
+ }, min: 1, max: totalPages, style: {
1316
+ width: "4rem",
1317
+ textAlign: "center",
1318
+ marginRight: "0.5rem"
1319
+ } }), "of ", totalPages, jsxRuntime.jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right", title: "Next" }), jsxRuntime.jsx("button", { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages === 1, className: "cw-button-icon cwi-chevron-right-double", title: "Last" }), jsxRuntime.jsx("select", { value: localItemsPerPage, onChange: handleItemsPerPageChange, style: { marginLeft: "1rem" }, children: pageSizeOptions.map(size => (jsxRuntime.jsxs("option", { value: size, children: [size, " / page"] }, size))) })] }))] }));
998
1320
  }
999
1321
 
1000
1322
  var styles$8 = {"cw-tabs":"cw-tabs-module_cw-tabs__1pmji","cw-tabs-content":"cw-tabs-module_cw-tabs-content__HTp8d"};
@@ -1010,20 +1332,27 @@ const TabIcon = ({ icon }) => {
1010
1332
  return icon;
1011
1333
  };
1012
1334
  /**
1013
- *
1335
+ * CwTabs component for displaying tabbed content.
1014
1336
  * @param CwTabsProps
1015
1337
  * @example
1016
- * The way to use the tab component:
1338
+ The way to use the tab component:
1339
+ * const [activeTab, setActiveTab] = useState("1");
1340
+ *
1341
+ * const handleTabChange = (tab) => {
1342
+ * setActiveTab(tab.key);
1343
+ * };
1344
+ *
1017
1345
  * const tabs = [
1018
- * { key: "1", title: 'Tab 1', icon: 'iconClassname', content: <div>Contenido de la pestaña 1</div> },
1019
- * { key: "2", title: 'Tab 2', icon: 'iconClassname', content: <div>Contenido de la pestaña 2</div> },
1020
- * { key: "3", title: 'Tab 3', icon: 'iconClassname', content: <div>Contenido de la pestaña 3</div> },
1346
+ * { key: "1", title: 'Tab 1', icon: 'iconClassname', content: <div>Content for tab 1</div> },
1347
+ * { key: "2", title: 'Tab 2', icon: 'iconClassname', content: <div>Content for tab 2</div> },
1348
+ * { key: "3", title: 'Tab 3', icon: 'iconClassname', content: <div>Content for tab 3</div> },
1021
1349
  * ];
1350
+ *
1022
1351
  * <CwTabs
1023
- * tabs={tabs}
1024
- * tabsPosition="top"
1025
- * defaultActiveKey="2"
1026
- * onTabClick={(e)=> handleInput(e)}
1352
+ * tabs={tabs}
1353
+ * tabsPosition="top"
1354
+ * defaultActiveKey={activeTab} // Use the current state for defaultActiveKey
1355
+ * onTabClick={handleTabChange}
1027
1356
  * />
1028
1357
  * @returns A tab
1029
1358
  */
@@ -1040,7 +1369,7 @@ function CwTabs(CwTabsProps) {
1040
1369
  const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
1041
1370
  ? { minWidth: CwTabsProps.tabsListWidth }
1042
1371
  : undefined;
1043
- return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, className: styles$8['cw-tabs'], "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$8['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
1372
+ return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, className: styles$8['cw-tabs'], style: CwTabsProps.style, "data-tabs-position": position, children: [jsxRuntime.jsx("ul", { style: tabsListStyle, children: CwTabsProps.tabs.map(tab => (jsxRuntime.jsxs("li", { className: `${tab.key === activeTab ? "cw-tab-active" : ""}`, onClick: () => handleTabClick(tab), "data-active": tab.key === activeTab, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$8['cw-tabs-content'], children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
1044
1373
  }
1045
1374
 
1046
1375
  /**
@@ -1067,6 +1396,25 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
1067
1396
  return (jsxRuntime.jsx("div", { className: "cw-expandable", children: jsxRuntime.jsxs("details", { ref: myRef, ...detailsProps, children: [jsxRuntime.jsx("summary", { children: briefing }), children && jsxRuntime.jsx("section", { children: children })] }) }));
1068
1397
  };
1069
1398
 
1399
+ /**
1400
+ * A component for displaying key-value pairs in a definition list format
1401
+ * Used for read-only display of structured data
1402
+ *
1403
+ * @example
1404
+ * <CwKeyValueList
1405
+ * items={[
1406
+ * { key: "length", label: "Length", value: "10", suffix: "m" },
1407
+ * { key: "width", label: "Width", value: null, suffix: "m" }
1408
+ * ]}
1409
+ * emptyValue="N/A"
1410
+ * />
1411
+ */
1412
+ const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "row" }) => {
1413
+ return (jsxRuntime.jsx("dl", { className: `cw-keyvalue-list ${className}`, children: items.map(item => (jsxRuntime.jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${direction}`, children: [jsxRuntime.jsx("dt", { children: item.label }), jsxRuntime.jsx("dd", { children: item.value !== undefined && item.value !== null && item.value !== ""
1414
+ ? `${item.value}${item.suffix ? ` ${item.suffix}` : ''}`
1415
+ : emptyValue })] }, item.key))) }));
1416
+ };
1417
+
1070
1418
  /**
1071
1419
  * A table with expandable row groups.
1072
1420
  * @param props The data to display
@@ -1190,11 +1538,9 @@ function CwInput(CwInputProps) {
1190
1538
  const handleClearClick = () => {
1191
1539
  CwInputProps.onChange("");
1192
1540
  };
1193
- return (jsxRuntime.jsxs("div", { className: CwInputProps.labelPosition === "inline"
1194
- ? "cwellt_flex cwellt_flex_row cwellt_align_items_center cw_inputContent"
1195
- : CwInputProps.labelPosition === "column"
1196
- ? "cwellt_flex cwellt_flex_column cwellt_align-items_baseline cw_inputContent"
1197
- : "cwellt_flex cwellt_flex_row cwellt_align_items_center cw_inputContent", children: [jsxRuntime.jsx("label", { className: CwInputProps.disabled === true
1541
+ return (jsxRuntime.jsxs("div", { className: CwInputProps.labelPosition === "column"
1542
+ ? "cw-flex-column"
1543
+ : "cw-flex-row ", children: [jsxRuntime.jsx("label", { className: CwInputProps.disabled === true
1198
1544
  ? CwInputProps.labelClassName + " " + "cw_label_text cw_label_text_disabled"
1199
1545
  : CwInputProps.labelClassName + " " + "cw_label_text", children: CwInputProps.labelName }), jsxRuntime.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 && (
1200
1546
  // if the component is disabled do not show clear button
@@ -1284,11 +1630,9 @@ function CwInputNumber(CwInputNumberProps) {
1284
1630
  const handleChange = (e) => {
1285
1631
  CwInputNumberProps.onChange(e.target.value);
1286
1632
  };
1287
- return (jsxRuntime.jsxs("div", { className: CwInputNumberProps.labelPosition == "inline"
1288
- ? "cw-label-input"
1289
- : CwInputNumberProps.labelPosition == "column"
1290
- ? "cwellt_flex cwellt_flex_column cwellt_align-items_baseline cw-label-input"
1291
- : "cw-label-input", children: [jsxRuntime.jsx("label", { className: CwInputNumberProps.disabled === true
1633
+ return (jsxRuntime.jsxs("div", { className: CwInputNumberProps.labelPosition == "column"
1634
+ ? "cw-flex-column"
1635
+ : "cw-flex-row", children: [jsxRuntime.jsx("label", { className: CwInputNumberProps.disabled === true
1292
1636
  ? CwInputNumberProps.labelClassName + " " + "cw_label_text cw_label_text_disabled"
1293
1637
  : CwInputNumberProps.labelClassName + " " + "cw_label_text", children: CwInputNumberProps.labelName }), jsxRuntime.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 })] }));
1294
1638
  }
@@ -1611,7 +1955,7 @@ function CwInputImage(props) {
1611
1955
  const file = e.target.files?.[0];
1612
1956
  handleFile(file ?? null);
1613
1957
  };
1614
- return (jsxRuntime.jsxs("div", { className: "cw-input-image", children: [jsxRuntime.jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [jsxRuntime.jsx("p", { children: "Drop image here" }), jsxRuntime.jsxs("small", { children: ["(", allowedFormats.join(", ").replace(/image\//g, ""), ")"] })] }), jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [jsxRuntime.jsx(CwIcon, { iconId: "clipboard" }), "\u2002Paste"] }), jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [jsxRuntime.jsx(CwIcon, { iconId: "folder" }), "\u2002Browse"] })] }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
1958
+ return (jsxRuntime.jsxs("div", { className: "cw-input-image", children: [jsxRuntime.jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [jsxRuntime.jsx("p", { children: "Drop image here" }), jsxRuntime.jsxs("small", { children: ["(", allowedFormats.join(", ").replace(/image\//g, ""), ")"] })] }), jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [jsxRuntime.jsx(CwIcon, { iconId: "paste" }), "\u2002Paste"] }), jsxRuntime.jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [jsxRuntime.jsx(CwIcon, { iconId: "folder-open" }), "\u2002Browse"] })] }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
1615
1959
  }
1616
1960
 
1617
1961
  /**
@@ -2796,7 +3140,7 @@ function CwMultiselect(CwelltCustomFilterTabProps) {
2796
3140
  const luminance = 0.299 * redBgColor_custom_tag_selected_list +
2797
3141
  0.587 * greenBgColor_custom_tag_selected_list +
2798
3142
  0.114 * blueBgColor_custom_tag_selected_list;
2799
- return s.type !== undefined && s.type !== undefined ? (jsxRuntime.jsx("div", { id: "cwContent_tag", "data-id": s.type + "_" + s.id, className: "cwellt_flex cwellt_align_items_center", children: jsxRuntime.jsx(CwTag, { styleTag: {
3143
+ return s.type !== undefined ? (jsxRuntime.jsx("div", { id: "cwContent_tag", "data-id": s.type + "_" + s.id, className: "cwellt_flex cwellt_align_items_center", children: jsxRuntime.jsx(CwTag, { styleTag: {
2800
3144
  background: s.color
2801
3145
  }, styleTag_description: {
2802
3146
  background: s.color,
@@ -2847,7 +3191,7 @@ const CwMultiFilterTag = props => {
2847
3191
  }, onClick: () => {
2848
3192
  if (Selectable)
2849
3193
  OnSelect?.(props);
2850
- }, children: [jsxRuntime.jsx("span", { id: ID, "data-value": Value, "data-category": Category, children: Name }), Removable && (jsxRuntime.jsx("span", { onClick: () => props.OnRemove?.(props), children: jsxRuntime.jsx(CwIcon, { iconId: "xmark" }) }))] }));
3194
+ }, children: [jsxRuntime.jsx("span", { id: ID, "data-value": Value, "data-category": Category, children: Name }), Removable && (jsxRuntime.jsx("span", { onClick: () => props.OnRemove?.(props), children: jsxRuntime.jsx(CwIcon, { iconId: "close" }) }))] }));
2851
3195
  };
2852
3196
 
2853
3197
  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"};
@@ -3420,10 +3764,6 @@ function CwBtnAddFolder({ cw_btnOnclick, cw_btn_disabled }) {
3420
3764
  function CwBtnEditFolder({ cw_btnOnclick, cw_btn_disabled }) {
3421
3765
  return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-folder-edit", disabled: cw_btn_disabled });
3422
3766
  }
3423
- // PropertyFolder
3424
- function CwBtnSelectedFolder({ cw_btnOnclick, cw_btn_disabled }) {
3425
- return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-folder-selected", disabled: cw_btn_disabled });
3426
- }
3427
3767
  // UploadFiles
3428
3768
  function CwBtnUploadFiles({ cw_btnOnclick, cw_btn_disabled }) {
3429
3769
  return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btn_uploadFiles", disabled: cw_btn_disabled });
@@ -3436,14 +3776,6 @@ function CwBtnGoBackFolder({ cw_btnOnclick, cw_btn_disabled }) {
3436
3776
  function CwBtnBookMark({ cw_btnOnclick, cw_btn_disabled }) {
3437
3777
  return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-star", disabled: cw_btn_disabled });
3438
3778
  }
3439
- // Archive
3440
- function CwBtnArchive({ cw_btnOnclick, cw_btn_disabled }) {
3441
- return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-archive", disabled: cw_btn_disabled });
3442
- }
3443
- // Archive
3444
- function CwBtnArchiveRestore({ cw_btnOnclick, cw_btn_disabled }) {
3445
- return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-archive-restore", disabled: cw_btn_disabled });
3446
- }
3447
3779
  // Publish
3448
3780
  function CwBtnPublish({ cw_btnOnclick, cw_btn_disabled }) {
3449
3781
  return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnPublish", disabled: cw_btn_disabled });
@@ -3452,10 +3784,6 @@ function CwBtnPublish({ cw_btnOnclick, cw_btn_disabled }) {
3452
3784
  function CwBtnApprove({ cw_btnOnclick, cw_btn_disabled }) {
3453
3785
  return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnApprove", disabled: cw_btn_disabled });
3454
3786
  }
3455
- // BookMarkLinkPag
3456
- function CwBtnBookMarkLinkPage({ cw_btnOnclick, cw_btn_disabled }) {
3457
- return (jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cwi-icons cwi-favorite-files", disabled: cw_btn_disabled }));
3458
- }
3459
3787
  // Bulk duty
3460
3788
  function CwBtnBulkDuty({ cw_btnOnclick, cw_btn_disabled }) {
3461
3789
  return jsxRuntime.jsx("button", { onClick: cw_btnOnclick, className: "cw-button-icon cw_btnBulkDuty", disabled: cw_btn_disabled });
@@ -5914,83 +6242,6 @@ const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width,
5914
6242
  }), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (jsxRuntime.jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "50%", height: "50%", isHeader: true, isUtc: isUtc }))] })] }));
5915
6243
  };
5916
6244
 
5917
- function colorToHSL(color) {
5918
- const hexColor = colorToHEX(color);
5919
- const hex = hexColor.replace('#', '');
5920
- const r = parseInt(hex.substring(0, 2), 16) / 255;
5921
- const g = parseInt(hex.substring(2, 4), 16) / 255;
5922
- const b = parseInt(hex.substring(4, 6), 16) / 255;
5923
- const max = Math.max(r, g, b);
5924
- const min = Math.min(r, g, b);
5925
- let h = 0;
5926
- let s = 0;
5927
- const l = (max + min) / 2;
5928
- if (max !== min) {
5929
- const d = max - min;
5930
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
5931
- switch (max) {
5932
- case r:
5933
- h = (g - b) / d + (g < b ? 6 : 0);
5934
- break;
5935
- case g:
5936
- h = (b - r) / d + 2;
5937
- break;
5938
- case b:
5939
- h = (r - g) / d + 4;
5940
- break;
5941
- }
5942
- h /= 6;
5943
- }
5944
- return {
5945
- h: Math.round(h * 360),
5946
- s: Math.round(s * 100),
5947
- l: Math.round(l * 100)
5948
- };
5949
- }
5950
- function colorToHEX(color) {
5951
- const canvas = document.createElement('canvas');
5952
- const context = canvas.getContext('2d');
5953
- if (!context)
5954
- throw new Error('Could not create canvas context');
5955
- context.fillStyle = color;
5956
- return context.fillStyle;
5957
- }
5958
- function getHSLColor(color, alpha = 1) {
5959
- const hsl = colorToHSL(color);
5960
- return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${alpha})`;
5961
- }
5962
- function getContrastColor(color) {
5963
- if (color === null) {
5964
- return '#000000';
5965
- }
5966
- const hsl = colorToHSL(color);
5967
- // Saturated greenyellow and cyan tones need lower luminance threshold (40-35)
5968
- // Saturated mediumblue and blueviolet tones need higher luminance threshold (55-60)
5969
- // Saturated orangered tones need lower luminance threshold (45)
5970
- const isYellowGreen = (hsl.h >= 45 && hsl.h <= 180);
5971
- const isBlueViolet = (hsl.h >= 210 && hsl.h <= 300);
5972
- const isRedOrange = (hsl.h >= 0 && hsl.h <= 30) || (hsl.h >= 330 && hsl.h <= 360);
5973
- let threshold = 50;
5974
- if (isYellowGreen) {
5975
- threshold = 40;
5976
- if (hsl.s >= 70) {
5977
- threshold = 35;
5978
- }
5979
- }
5980
- else if (isBlueViolet) {
5981
- threshold = 55;
5982
- if (hsl.s >= 70) {
5983
- threshold = 60;
5984
- }
5985
- }
5986
- else if (isRedOrange && hsl.s >= 80) {
5987
- threshold = 45;
5988
- }
5989
- const contrastL = hsl.l >= threshold ? 20 : 90;
5990
- const contrastS = Math.min(hsl.s, 90);
5991
- return `hsl(${hsl.h}, ${contrastS}%, ${contrastL}%)`;
5992
- }
5993
-
5994
6245
  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"};
5995
6246
 
5996
6247
  const BackgroundEvent = ({ value, heightRem }) => {
@@ -6165,7 +6416,20 @@ const SchedulerEvent = ({ value, heightRem, onEvent }) => {
6165
6416
  }, children: value.icons }), jsxRuntime.jsx("span", { style: {
6166
6417
  padding: "0.1rem",
6167
6418
  color: textColor,
6168
- }, children: value.name })] }), value.isResizable && (jsxRuntime.jsx(EventSideDrag, { heightRem: heightRem * 0.7, onStartEvent: () => {
6419
+ display: "flex",
6420
+ flex: 1,
6421
+ alignItems: "center",
6422
+ width: "100%",
6423
+ }, children: value.rectangleColors && value.rectangleColors.length > 0 ? (jsxRuntime.jsx("div", { style: {
6424
+ display: "flex",
6425
+ width: "100%",
6426
+ }, children: value.rectangleColors.map((item, i) => (jsxRuntime.jsx("div", { className: "cwellt_rectangle_indicator", style: {
6427
+ backgroundColor: item,
6428
+ flex: 1,
6429
+ height: "8px",
6430
+ margin: 0,
6431
+ padding: 0,
6432
+ } }, value.id + "_" + i))) })) : (value.name) })] }), value.isResizable && (jsxRuntime.jsx(EventSideDrag, { heightRem: heightRem * 0.7, onStartEvent: () => {
6169
6433
  onEvent(new OnRightDragStart(value.id));
6170
6434
  } }))] }), value.primaryTimeMarkerColor && (jsxRuntime.jsx("div", { className: styles$2["time-marker"], style: {
6171
6435
  backgroundColor: value.primaryTimeMarkerColor,
@@ -7168,11 +7432,18 @@ class CwFindAirport extends React__namespace.Component {
7168
7432
  });
7169
7433
  });
7170
7434
  }
7435
+ getShortCode(text) {
7436
+ const match = text.match(/([A-Z]{4})\(([A-Z]{3})\)/);
7437
+ if (match && match.length >= 3) {
7438
+ return `${match[1]}(${match[2]})`;
7439
+ }
7440
+ return text;
7441
+ }
7171
7442
  render() {
7172
- const options = this.state.data.map((sl) => (jsxRuntime.jsx(Option, { value: sl.value, children: sl.text }, sl.value)));
7173
- return (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("div", { className: "cwellt_flex cwellt_justify_flex_start cwellt_align_items_center", children: [jsxRuntime.jsx(antd.Select, { id: "InputID",
7443
+ const options = this.state.data.map((sl) => (jsxRuntime.jsxs(Option, { value: sl.value, title: sl.text, label: this.getShortCode(sl.text), children: [(sl.text), " "] }, sl.value)));
7444
+ return (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("div", { className: "cw-flex-row cw-align-left-center", style: { gap: "0.25rem" }, children: [jsxRuntime.jsx(antd.Select, { id: "InputID",
7174
7445
  // this.required === "true" ? "required" : ""
7175
- 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)), jsxRuntime.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) })] }) }));
7446
+ 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)), jsxRuntime.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) })] }) }));
7176
7447
  }
7177
7448
  }
7178
7449
 
@@ -7184,10 +7455,7 @@ exports.CwBtnAddFolder = CwBtnAddFolder;
7184
7455
  exports.CwBtnAirport = CwBtnAirport;
7185
7456
  exports.CwBtnAlert = CwBtnAlert;
7186
7457
  exports.CwBtnApprove = CwBtnApprove;
7187
- exports.CwBtnArchive = CwBtnArchive;
7188
- exports.CwBtnArchiveRestore = CwBtnArchiveRestore;
7189
7458
  exports.CwBtnBookMark = CwBtnBookMark;
7190
- exports.CwBtnBookMarkLinkPage = CwBtnBookMarkLinkPage;
7191
7459
  exports.CwBtnBulkDuty = CwBtnBulkDuty;
7192
7460
  exports.CwBtnCancel = CwBtnCancel;
7193
7461
  exports.CwBtnCrewPlanning = CwBtnCrewPlanning;
@@ -7218,7 +7486,6 @@ exports.CwBtnReleasePeriod = CwBtnReleasePeriod;
7218
7486
  exports.CwBtnSave = CwBtnSave;
7219
7487
  exports.CwBtnSearch = CwBtnSearch;
7220
7488
  exports.CwBtnSelect = CwBtnSelect;
7221
- exports.CwBtnSelectedFolder = CwBtnSelectedFolder;
7222
7489
  exports.CwBtnShare = CwBtnShare;
7223
7490
  exports.CwBtnStatistic = CwBtnStatistic;
7224
7491
  exports.CwBtnUploadFiles = CwBtnUploadFiles;
@@ -7227,7 +7494,9 @@ exports.CwBtnView = CwBtnView;
7227
7494
  exports.CwBtnWarning = CwBtnWarning;
7228
7495
  exports.CwButton = CwButton;
7229
7496
  exports.CwButtonDef = CwButtonDef;
7497
+ exports.CwCard = CwCard;
7230
7498
  exports.CwCheckbox = CwCheckbox;
7499
+ exports.CwChip = CwChip;
7231
7500
  exports.CwContextMenu = CwContextMenu;
7232
7501
  exports.CwContextualMenu = CwContextualMenu;
7233
7502
  exports.CwDialog = CwDialog;
@@ -7257,6 +7526,7 @@ exports.CwInputImage = CwInputImage;
7257
7526
  exports.CwInputNumber = CwInputNumber;
7258
7527
  exports.CwInputPhone = CwInputPhone;
7259
7528
  exports.CwInputText = CwInputText;
7529
+ exports.CwKeyValueList = CwKeyValueList;
7260
7530
  exports.CwLabel = CwLabel;
7261
7531
  exports.CwLoading = CwLoading;
7262
7532
  exports.CwLoadingSmall = CwLoadingSmall;