@cwellt_software/cwellt-reactjs-lib 1.5.0 → 1.5.2

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 (302) hide show
  1. package/dist/content/fonts/roboto-mono/LICENSE +93 -0
  2. package/dist/content/fonts/roboto-mono/RobotoMono.css +43 -0
  3. package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-ext-wght-italic.woff2 +0 -0
  4. package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-ext-wght-normal.woff2 +0 -0
  5. package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-wght-italic.woff2 +0 -0
  6. package/dist/content/fonts/roboto-mono/files/roboto-mono-latin-wght-normal.woff2 +0 -0
  7. package/dist/deprecated/components/MultiSelect_deprecated_.d.ts +24 -0
  8. package/dist/deprecated/components/MultiSelect_deprecated_.d.ts.map +1 -0
  9. package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts +17 -0
  10. package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts.map +1 -0
  11. package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts +17 -0
  12. package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts.map +1 -0
  13. package/dist/deprecated/components/multiselect/CwMultiselect.d.ts +13 -0
  14. package/dist/deprecated/components/multiselect/CwMultiselect.d.ts.map +1 -0
  15. package/dist/deprecated/components/multiselect/CwOptionList.d.ts +14 -0
  16. package/dist/deprecated/components/multiselect/CwOptionList.d.ts.map +1 -0
  17. package/dist/deprecated/components/tag/CwTag.d.ts +15 -0
  18. package/dist/deprecated/components/tag/CwTag.d.ts.map +1 -0
  19. package/dist/index.cjs.js +194 -1423
  20. package/dist/index.css +2 -2
  21. package/dist/index.d.ts +114 -223
  22. package/dist/index.es.js +194 -1420
  23. package/dist/playground/main.d.ts +4 -0
  24. package/dist/playground/main.d.ts.map +1 -0
  25. package/dist/src/components/control/action/button/CwPopoverButton.d.ts +33 -0
  26. package/dist/src/components/control/action/button/CwPopoverButton.d.ts.map +1 -0
  27. package/dist/src/components/control/action/contextual-menu/CwContextualMenu.d.ts +29 -0
  28. package/dist/src/components/control/action/contextual-menu/CwContextualMenu.d.ts.map +1 -0
  29. package/dist/src/components/control/action/search/CwAsyncSearch.d.ts +102 -0
  30. package/dist/src/components/control/action/search/CwAsyncSearch.d.ts.map +1 -0
  31. package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts +19 -0
  32. package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.d.ts.map +1 -0
  33. package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts +19 -0
  34. package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts.map +1 -0
  35. package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts +21 -0
  36. package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts.map +1 -0
  37. package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts +24 -0
  38. package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.d.ts.map +1 -0
  39. package/dist/src/components/control/choice/dropdown/CwDropdown.d.ts +19 -0
  40. package/dist/src/components/control/choice/dropdown/CwDropdown.d.ts.map +1 -0
  41. package/dist/src/components/control/choice/dropdown/CwDropdownContainer.d.ts +17 -0
  42. package/dist/src/components/control/choice/dropdown/CwDropdownContainer.d.ts.map +1 -0
  43. package/dist/src/components/control/choice/dropdown/CwDropdownNavigation.d.ts +21 -0
  44. package/dist/src/components/control/choice/dropdown/CwDropdownNavigation.d.ts.map +1 -0
  45. package/dist/src/components/control/choice/multiselect/CwHeadFilter.d.ts +17 -0
  46. package/dist/src/components/control/choice/multiselect/CwHeadFilter.d.ts.map +1 -0
  47. package/dist/src/components/control/choice/multiselect/CwMultiselect.d.ts +13 -0
  48. package/dist/src/components/control/choice/multiselect/CwMultiselect.d.ts.map +1 -0
  49. package/dist/src/components/control/choice/multiselect/CwOptionList.d.ts +14 -0
  50. package/dist/src/components/control/choice/multiselect/CwOptionList.d.ts.map +1 -0
  51. package/dist/src/components/control/choice/nav-menu/CwNavMenu.d.ts.map +1 -1
  52. package/dist/src/components/control/input/color/CwInputColor.d.ts +2 -0
  53. package/dist/src/components/control/input/color/CwInputColor.d.ts.map +1 -1
  54. package/dist/src/components/control/input/digit/CwDigit.d.ts +6 -0
  55. package/dist/src/components/control/input/digit/CwDigit.d.ts.map +1 -1
  56. package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts +47 -0
  57. package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts.map +1 -0
  58. package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts +24 -0
  59. package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.d.ts.map +1 -0
  60. package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts +86 -0
  61. package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.d.ts.map +1 -0
  62. package/dist/src/components/custom/scheduler-temporal/components/EventRender.d.ts +10 -0
  63. package/dist/src/components/custom/scheduler-temporal/components/EventRender.d.ts.map +1 -0
  64. package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.d.ts +20 -0
  65. package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.d.ts.map +1 -0
  66. package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.d.ts +14 -0
  67. package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.d.ts.map +1 -0
  68. package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts +11 -0
  69. package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.d.ts.map +1 -0
  70. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts +11 -0
  71. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.d.ts.map +1 -0
  72. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts +13 -0
  73. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.d.ts.map +1 -0
  74. package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts +11 -0
  75. package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.d.ts.map +1 -0
  76. package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts +14 -0
  77. package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.d.ts.map +1 -0
  78. package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts +23 -0
  79. package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.d.ts.map +1 -0
  80. package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts +8 -0
  81. package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.d.ts.map +1 -0
  82. package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts +12 -0
  83. package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.d.ts.map +1 -0
  84. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts +12 -0
  85. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.d.ts.map +1 -0
  86. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts +10 -0
  87. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.d.ts.map +1 -0
  88. package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts +12 -0
  89. package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.d.ts.map +1 -0
  90. package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts +2 -0
  91. package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.d.ts.map +1 -0
  92. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts +2 -0
  93. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.d.ts.map +1 -0
  94. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts +2 -0
  95. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.d.ts.map +1 -0
  96. package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts +7 -0
  97. package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.d.ts.map +1 -0
  98. package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts +10 -0
  99. package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.d.ts.map +1 -0
  100. package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts +2 -0
  101. package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.d.ts.map +1 -0
  102. package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts +7 -0
  103. package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.d.ts.map +1 -0
  104. package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts +8 -0
  105. package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.d.ts.map +1 -0
  106. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts +2 -0
  107. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.d.ts.map +1 -0
  108. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts +2 -0
  109. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.d.ts.map +1 -0
  110. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +4 -0
  111. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +1 -0
  112. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts +3 -0
  113. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.d.ts.map +1 -0
  114. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts +3 -0
  115. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.d.ts.map +1 -0
  116. package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.d.ts +3 -0
  117. package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.d.ts.map +1 -0
  118. package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts +13 -0
  119. package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.d.ts.map +1 -0
  120. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.d.ts +2 -0
  121. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.d.ts.map +1 -0
  122. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +7 -0
  123. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +1 -0
  124. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +3 -0
  125. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +1 -0
  126. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.d.ts +2 -0
  127. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.d.ts.map +1 -0
  128. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts +4 -0
  129. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.d.ts.map +1 -0
  130. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.d.ts +6 -0
  131. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.d.ts.map +1 -0
  132. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.d.ts +5 -0
  133. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.d.ts.map +1 -0
  134. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts +2 -0
  135. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.d.ts.map +1 -0
  136. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts +5 -0
  137. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.d.ts.map +1 -0
  138. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts +4 -0
  139. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.d.ts.map +1 -0
  140. package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts +2 -0
  141. package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.d.ts.map +1 -0
  142. package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts +2 -0
  143. package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.d.ts.map +1 -0
  144. package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +3 -0
  145. package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +1 -0
  146. package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts +6 -0
  147. package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.d.ts.map +1 -0
  148. package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.d.ts +4 -0
  149. package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.d.ts.map +1 -0
  150. package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts +2 -0
  151. package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.d.ts.map +1 -0
  152. package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts +3 -0
  153. package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.d.ts.map +1 -0
  154. package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.d.ts +4 -0
  155. package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.d.ts.map +1 -0
  156. package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.d.ts +3 -0
  157. package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.d.ts.map +1 -0
  158. package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts +11 -0
  159. package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.d.ts.map +1 -0
  160. package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts +43 -0
  161. package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.d.ts.map +1 -0
  162. package/dist/src/components/custom/scheduler-temporal/state/Resource.d.ts +14 -0
  163. package/dist/src/components/custom/scheduler-temporal/state/Resource.d.ts.map +1 -0
  164. package/dist/src/components/custom/scheduler-temporal/state/State.d.ts +25 -0
  165. package/dist/src/components/custom/scheduler-temporal/state/State.d.ts.map +1 -0
  166. package/dist/src/components/custom/scheduler-temporal/state/cblEvent.d.ts +18 -0
  167. package/dist/src/components/custom/scheduler-temporal/state/cblEvent.d.ts.map +1 -0
  168. package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts +7 -0
  169. package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.d.ts.map +1 -0
  170. package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.d.ts +6 -0
  171. package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.d.ts.map +1 -0
  172. package/dist/src/components/display/data/table/CwTable.d.ts +4 -1
  173. package/dist/src/components/display/data/table/CwTable.d.ts.map +1 -1
  174. package/dist/src/components/display/data/table-serverside/CwTableServerSide.d.ts +4 -1
  175. package/dist/src/components/display/data/table-serverside/CwTableServerSide.d.ts.map +1 -1
  176. package/dist/src/components/display/data/table_sortable/CwSortableTable.d.ts +4 -2
  177. package/dist/src/components/display/data/table_sortable/CwSortableTable.d.ts.map +1 -1
  178. package/dist/src/components/display/graphics/progress/CwProgress.d.ts +36 -0
  179. package/dist/src/components/display/graphics/progress/CwProgress.d.ts.map +1 -0
  180. package/dist/src/components/display/graphics/skeleton/CwSkeleton.d.ts +31 -0
  181. package/dist/src/components/display/graphics/skeleton/CwSkeleton.d.ts.map +1 -0
  182. package/dist/src/components/display/graphics/skeleton/CwSkeletonCard.d.ts +21 -0
  183. package/dist/src/components/display/graphics/skeleton/CwSkeletonCard.d.ts.map +1 -0
  184. package/dist/src/components/display/graphics/skeleton/normalizeSkeletonCount.d.ts +8 -0
  185. package/dist/src/components/display/graphics/skeleton/normalizeSkeletonCount.d.ts.map +1 -0
  186. package/dist/src/components/display/graphics/skeleton/skeletonCellWidth.d.ts +8 -0
  187. package/dist/src/components/display/graphics/skeleton/skeletonCellWidth.d.ts.map +1 -0
  188. package/dist/src/components/display/text/tag/CwTag.d.ts +15 -0
  189. package/dist/src/components/display/text/tag/CwTag.d.ts.map +1 -0
  190. package/dist/src/components/display/text/tooltip/CwTooltip.d.ts +11 -0
  191. package/dist/src/components/display/text/tooltip/CwTooltip.d.ts.map +1 -0
  192. package/dist/src/components/layout/card/CwCard.d.ts +3 -1
  193. package/dist/src/components/layout/card/CwCard.d.ts.map +1 -1
  194. package/dist/src/components/layout/card/CwCardList.d.ts +4 -2
  195. package/dist/src/components/layout/card/CwCardList.d.ts.map +1 -1
  196. package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts +4 -0
  197. package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts.map +1 -1
  198. package/dist/src/components/layout/master-detail/CwMasterDetail.d.ts +4 -0
  199. package/dist/src/components/layout/master-detail/CwMasterDetail.d.ts.map +1 -1
  200. package/dist/src/components/layout/modal/legacy/cw_modal_confirm.d.ts +16 -0
  201. package/dist/src/components/layout/modal/legacy/cw_modal_confirm.d.ts.map +1 -0
  202. package/dist/src/components/layout/modal/legacy/cw_modal_iframe.d.ts +21 -0
  203. package/dist/src/components/layout/modal/legacy/cw_modal_iframe.d.ts.map +1 -0
  204. package/dist/src/components/layout/tabs/CwTabs.d.ts +7 -0
  205. package/dist/src/components/layout/tabs/CwTabs.d.ts.map +1 -1
  206. package/dist/src/index.d.ts +2 -8
  207. package/dist/src/index.d.ts.map +1 -1
  208. package/dist/src/playground/PlaygroundApp.d.ts.map +1 -1
  209. package/dist/src/playground/pages/ProgressPage.d.ts +3 -0
  210. package/dist/src/playground/pages/ProgressPage.d.ts.map +1 -0
  211. package/dist/src/playground/pages/SkeletonPage.d.ts +3 -0
  212. package/dist/src/playground/pages/SkeletonPage.d.ts.map +1 -0
  213. package/dist/test/components/control/choice/nav-menu/CwNavMenu.test.d.ts +2 -0
  214. package/dist/test/components/control/choice/nav-menu/CwNavMenu.test.d.ts.map +1 -0
  215. package/dist/test/components/display/data/table/CwTable.test.d.ts +2 -0
  216. package/dist/test/components/display/data/table/CwTable.test.d.ts.map +1 -0
  217. package/dist/test/components/display/data/table-serverside/CwTableServerSide.test.d.ts +2 -0
  218. package/dist/test/components/display/data/table-serverside/CwTableServerSide.test.d.ts.map +1 -0
  219. package/dist/test/components/display/data/table_sortable/CwSortableTable.test.d.ts +2 -0
  220. package/dist/test/components/display/data/table_sortable/CwSortableTable.test.d.ts.map +1 -0
  221. package/dist/test/components/display/graphics/progress/CwProgress.test.d.ts +2 -0
  222. package/dist/test/components/display/graphics/progress/CwProgress.test.d.ts.map +1 -0
  223. package/dist/test/components/display/graphics/skeleton/CwSkeleton.test.d.ts +2 -0
  224. package/dist/test/components/display/graphics/skeleton/CwSkeleton.test.d.ts.map +1 -0
  225. package/dist/test/components/display/graphics/skeleton/CwSkeletonCard.test.d.ts +2 -0
  226. package/dist/test/components/display/graphics/skeleton/CwSkeletonCard.test.d.ts.map +1 -0
  227. package/dist/test/components/display/graphics/skeleton/normalizeSkeletonCount.test.d.ts +2 -0
  228. package/dist/test/components/display/graphics/skeleton/normalizeSkeletonCount.test.d.ts.map +1 -0
  229. package/dist/test/components/display/graphics/skeleton/skeletonCellWidth.test.d.ts +2 -0
  230. package/dist/test/components/display/graphics/skeleton/skeletonCellWidth.test.d.ts.map +1 -0
  231. package/dist/test/components/layout/card/CwCard.test.d.ts +2 -0
  232. package/dist/test/components/layout/card/CwCard.test.d.ts.map +1 -0
  233. package/dist/test/components/layout/card/CwCardList.test.d.ts +2 -0
  234. package/dist/test/components/layout/card/CwCardList.test.d.ts.map +1 -0
  235. package/dist/test/components/layout/list/key-value/CwKeyValueList.test.d.ts +2 -0
  236. package/dist/test/components/layout/list/key-value/CwKeyValueList.test.d.ts.map +1 -0
  237. package/dist/test/components/layout/master-detail/CwMasterDetail.test.d.ts +2 -0
  238. package/dist/test/components/layout/master-detail/CwMasterDetail.test.d.ts.map +1 -0
  239. package/dist/test/jest.setup.d.ts +2 -0
  240. package/dist/test/jest.setup.d.ts.map +1 -0
  241. package/package.json +3 -3
  242. package/dist/content/fonts/roboto/LICENSE.txt +0 -202
  243. package/dist/content/fonts/roboto/Roboto-Black.ttf +0 -0
  244. package/dist/content/fonts/roboto/Roboto-BlackItalic.ttf +0 -0
  245. package/dist/content/fonts/roboto/Roboto-Bold.ttf +0 -0
  246. package/dist/content/fonts/roboto/Roboto-BoldItalic.ttf +0 -0
  247. package/dist/content/fonts/roboto/Roboto-Italic.ttf +0 -0
  248. package/dist/content/fonts/roboto/Roboto-Light.ttf +0 -0
  249. package/dist/content/fonts/roboto/Roboto-LightItalic.ttf +0 -0
  250. package/dist/content/fonts/roboto/Roboto-Medium.ttf +0 -0
  251. package/dist/content/fonts/roboto/Roboto-MediumItalic.ttf +0 -0
  252. package/dist/content/fonts/roboto/Roboto-Regular.ttf +0 -0
  253. package/dist/content/fonts/roboto/Roboto-Thin.ttf +0 -0
  254. package/dist/content/fonts/roboto/Roboto-ThinItalic.ttf +0 -0
  255. package/dist/content/fonts/roboto/RobotoFontFamily.css +0 -109
  256. package/dist/content/fonts/roboto-flex/README.md +0 -24
  257. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-grad-normal.woff2 +0 -0
  258. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-opsz-normal.woff2 +0 -0
  259. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-slnt-normal.woff2 +0 -0
  260. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-standard-normal.woff2 +0 -0
  261. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-wdth-normal.woff2 +0 -0
  262. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-wght-normal.woff2 +0 -0
  263. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-xopq-normal.woff2 +0 -0
  264. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-xtra-normal.woff2 +0 -0
  265. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-yopq-normal.woff2 +0 -0
  266. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-ytas-normal.woff2 +0 -0
  267. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-ytde-normal.woff2 +0 -0
  268. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-ytfi-normal.woff2 +0 -0
  269. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-ytlc-normal.woff2 +0 -0
  270. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ext-ytuc-normal.woff2 +0 -0
  271. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-grad-normal.woff2 +0 -0
  272. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-opsz-normal.woff2 +0 -0
  273. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-slnt-normal.woff2 +0 -0
  274. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-standard-normal.woff2 +0 -0
  275. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-wdth-normal.woff2 +0 -0
  276. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-wght-normal.woff2 +0 -0
  277. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-xopq-normal.woff2 +0 -0
  278. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-xtra-normal.woff2 +0 -0
  279. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-yopq-normal.woff2 +0 -0
  280. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ytas-normal.woff2 +0 -0
  281. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ytde-normal.woff2 +0 -0
  282. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ytfi-normal.woff2 +0 -0
  283. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ytlc-normal.woff2 +0 -0
  284. package/dist/content/fonts/roboto-flex/files/roboto-flex-latin-ytuc-normal.woff2 +0 -0
  285. package/dist/content/fonts/roboto-flex/grad.css +0 -19
  286. package/dist/content/fonts/roboto-flex/index.css +0 -19
  287. package/dist/content/fonts/roboto-flex/metadata.json +0 -33
  288. package/dist/content/fonts/roboto-flex/opsz.css +0 -19
  289. package/dist/content/fonts/roboto-flex/slnt.css +0 -19
  290. package/dist/content/fonts/roboto-flex/standard.css +0 -21
  291. package/dist/content/fonts/roboto-flex/unicode.json +0 -4
  292. package/dist/content/fonts/roboto-flex/wdth.css +0 -21
  293. package/dist/content/fonts/roboto-flex/wght.css +0 -20
  294. package/dist/content/fonts/roboto-flex/xopq.css +0 -20
  295. package/dist/content/fonts/roboto-flex/xtra.css +0 -19
  296. package/dist/content/fonts/roboto-flex/yopq.css +0 -19
  297. package/dist/content/fonts/roboto-flex/ytas.css +0 -19
  298. package/dist/content/fonts/roboto-flex/ytde.css +0 -20
  299. package/dist/content/fonts/roboto-flex/ytfi.css +0 -20
  300. package/dist/content/fonts/roboto-flex/ytlc.css +0 -19
  301. package/dist/content/fonts/roboto-flex/ytuc.css +0 -20
  302. package/dist/content/icons/new-cw-icons/NewCwIcons.html +0 -415
package/dist/index.cjs.js CHANGED
@@ -181,7 +181,7 @@ function getContrastColor(color) {
181
181
  return `hsl(${hsl.h}, ${contrastS}%, ${targetL}%)`;
182
182
  }
183
183
 
184
- var styles$v = {"cw-tooltip-content":"cw-tooltip-module__cw-tooltip-content__RZczd","cw-tooltip":"cw-tooltip-module__cw-tooltip__1KYig"};
184
+ var styles$x = {"cw-tooltip-content":"cw-tooltip-module__cw-tooltip-content__RZczd","cw-tooltip":"cw-tooltip-module__cw-tooltip__1KYig"};
185
185
 
186
186
  // Constants
187
187
  const margin$1 = 16;
@@ -471,7 +471,7 @@ const CwTooltipManager = () => {
471
471
  if (!state.isVisible || !state.content) {
472
472
  return null;
473
473
  }
474
- return reactDom.createPortal(jsxRuntime.jsx("div", { ref: tooltipRef, className: styles$v["cw-tooltip-content"], "data-position": actualPosition, "data-visible": state.isVisible, "data-inline": state.displayInline, style: {
474
+ return reactDom.createPortal(jsxRuntime.jsx("div", { ref: tooltipRef, className: styles$x["cw-tooltip-content"], "data-position": actualPosition, "data-visible": state.isVisible, "data-inline": state.displayInline, style: {
475
475
  top: `${tooltipPosition.top}px`,
476
476
  left: `${tooltipPosition.left}px`,
477
477
  opacity: (isPositioned && !isMeasuring) ? 1 : 0,
@@ -552,7 +552,7 @@ const CwTooltipNew = ({ children, content = null, position = "right", dissapears
552
552
  React.useEffect(() => {
553
553
  ensureTooltipManager();
554
554
  }, []);
555
- return (jsxRuntime.jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$v["cw-tooltip"], children: children }));
555
+ return (jsxRuntime.jsx("div", { ref: containerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: overlayStyle, "data-inline": displayInline, className: styles$x["cw-tooltip"], children: children }));
556
556
  };
557
557
 
558
558
  const SVG_ICONS = {
@@ -1011,6 +1011,95 @@ function CwLoading({ isLoading = false, text = '', size = 'regular', iconPositio
1011
1011
  return (jsxRuntime.jsxs("div", { "aria-busy": isLoading, className: "cw-loading-container", "data-children": !!children, children: [overlay, jsxRuntime.jsx("div", { className: "cw-loading-disabled-content", children: children })] }));
1012
1012
  }
1013
1013
 
1014
+ var styles$w = {"skeleton":"cw-skeleton-module__skeleton__Jvx2x","group":"cw-skeleton-module__group__Cm8AU"};
1015
+
1016
+ /*
1017
+ * Internal helper for skeleton allocations (CwSkeleton, tables, cards).
1018
+ * Not exported from the library barrel - not a public API.
1019
+ */
1020
+ /** Upper bound so a pathological count cannot allocate an unbounded number of nodes. */
1021
+ const MAX_SKELETON_COUNT = 100;
1022
+ /**
1023
+ * Normalizes a skeleton count to a finite, floored, non-negative integer capped at
1024
+ * MAX_SKELETON_COUNT. Falls back to `fallback` for undefined, NaN, non-finite or
1025
+ * non-positive input, so valid inputs keep the public default behaviour and only
1026
+ * pathological ones are bounded.
1027
+ */
1028
+ function normalizeSkeletonCount(value, fallback) {
1029
+ if (value === undefined || !Number.isFinite(value) || value < 1) {
1030
+ return fallback;
1031
+ }
1032
+ return Math.min(Math.floor(value), MAX_SKELETON_COUNT);
1033
+ }
1034
+
1035
+ /**
1036
+ * CwSkeleton - a shimmering placeholder that reserves the shape of content while it loads.
1037
+ *
1038
+ * Renders inline <span> elements so it can sit inside text-level contexts. Sizing flows
1039
+ * through component-scoped custom properties; only the props the caller provides are set
1040
+ * inline, so the CSS defaults per variant (and the 60% last-line rule) stay in charge.
1041
+ *
1042
+ * @example
1043
+ * <CwSkeleton count={3} />
1044
+ * <CwSkeleton variant="circle" />
1045
+ * <CwSkeleton variant="rect" height="10rem" />
1046
+ */
1047
+ function CwSkeleton({ variant = 'text', width, height, count = 1, radius, gap }) {
1048
+ // Only forward the custom properties the caller actually set; CSS declares the defaults.
1049
+ const style = {
1050
+ ...(width !== undefined && { '--skeleton-width': width }),
1051
+ ...(height !== undefined && { '--skeleton-height': height }),
1052
+ ...(radius !== undefined && { '--skeleton-radius': radius })
1053
+ };
1054
+ // The un-hashed cw-skeleton / cw-skeleton-group classes carry no styles in the
1055
+ // library - they are stable public hooks for exceptional external overrides.
1056
+ const skeletonClassName = ['cw-skeleton', styles$w.skeleton].filter(Boolean).join(' ');
1057
+ const groupClassName = ['cw-skeleton-group', styles$w.group].filter(Boolean).join(' ');
1058
+ const lineCount = normalizeSkeletonCount(count, 1);
1059
+ if (lineCount <= 1) {
1060
+ return (jsxRuntime.jsx("span", { className: skeletonClassName, "data-variant": variant, "aria-hidden": "true", style: style }));
1061
+ }
1062
+ const skeletonElements = Array.from({ length: lineCount }, (_, index) => (jsxRuntime.jsx("span", { className: skeletonClassName, "data-variant": variant, style: style }, index)));
1063
+ const groupStyle = {
1064
+ ...(gap !== undefined && { '--skeleton-gap': gap })
1065
+ };
1066
+ return (jsxRuntime.jsx("span", { className: groupClassName, "aria-hidden": "true", style: groupStyle, children: skeletonElements }));
1067
+ }
1068
+
1069
+ var styles$v = {"progress":"cw-progress-module__progress__d-g2-","value":"cw-progress-module__value__Q-DrH","header":"cw-progress-module__header__mv5ct","label":"cw-progress-module__label__jwOWp","track":"cw-progress-module__track__572-3","fill":"cw-progress-module__fill__fX1UA"};
1070
+
1071
+ /**
1072
+ * CwProgress - a determinate or indeterminate progress bar.
1073
+ *
1074
+ * Use it for measurable operations (imports, uploads, batch jobs). For short
1075
+ * unmeasurable waits use CwLoading; for initial layout loads use CwSkeleton.
1076
+ *
1077
+ * @example
1078
+ * <CwProgress value={62} label="Import" color="success" />
1079
+ * <CwProgress indeterminate label="Uploading" />
1080
+ */
1081
+ function CwProgress({ value, indeterminate = false, label, rightLabel, size = 'regular', layout = 'row', color = 'primary', monoValue = false, prominent = false }) {
1082
+ const labelId = React.useId();
1083
+ // Determinate: a missing or non-finite value is treated as 0 (never NaN), then
1084
+ // clamped to [0,100] for aria-valuenow and the fill width. Indeterminate has no value.
1085
+ const clamped = indeterminate
1086
+ ? undefined
1087
+ : Math.min(Math.max(Number.isFinite(value) ? value : 0, 0), 100);
1088
+ const percent = clamped !== undefined ? Math.round(clamped) : undefined;
1089
+ const showValue = rightLabel !== undefined || (!indeterminate && percent !== undefined);
1090
+ const valueText = rightLabel ?? (percent !== undefined ? `${percent}%` : '');
1091
+ // The un-hashed cw-progress class carries no styles in the library - a stable
1092
+ // public hook for exceptional external overrides only.
1093
+ const rootClassName = ['cw-progress', styles$v.progress].filter(Boolean).join(' ');
1094
+ const labelSpan = label ? jsxRuntime.jsx("span", { className: styles$v.label, id: labelId, children: label }) : null;
1095
+ const valueLabel = showValue ? (jsxRuntime.jsx("span", { className: styles$v.value, "data-mono": monoValue || undefined, children: valueText })) : null;
1096
+ return (jsxRuntime.jsxs("div", { className: rootClassName, "data-layout": layout, "data-size": size, "data-color": color, "data-prominent": prominent || undefined, "data-indeterminate": indeterminate || undefined, children: [layout === 'column' && (labelSpan || valueLabel) && (jsxRuntime.jsxs("header", { className: styles$v.header, children: [labelSpan, valueLabel] })), layout === 'row' && labelSpan, jsxRuntime.jsx("div", { className: styles$v.track, role: "progressbar", ...(label && { 'aria-labelledby': labelId }), ...(!indeterminate && percent !== undefined && {
1097
+ 'aria-valuenow': percent,
1098
+ 'aria-valuemin': 0,
1099
+ 'aria-valuemax': 100
1100
+ }), children: jsxRuntime.jsx("div", { className: styles$v.fill, style: !indeterminate && clamped !== undefined ? { width: `${clamped}%` } : undefined }) }), layout === 'row' && valueLabel] }));
1101
+ }
1102
+
1014
1103
  var styles$u = {"cw-generic-tooltip-content":"cw-generic-tooltip-module__cw-generic-tooltip-content__la-Si","cw-generic-tooltip":"cw-generic-tooltip-module__cw-generic-tooltip__Ij76M"};
1015
1104
 
1016
1105
  // Constants moved outside to prevent recreation
@@ -1749,7 +1838,7 @@ function CwAlign(props) {
1749
1838
  }, children: props.children }));
1750
1839
  }
1751
1840
 
1752
- var styles$r = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module__clickable__Y-V3X","disabled":"cw-card-module__disabled__0wHh1","loading":"cw-card-module__loading__-fzlx","content":"cw-card-module__content__ma9qy","headerContent":"cw-card-module__headerContent__x4Jfl","footerTags":"cw-card-module__footerTags__80sSW","loadingOverlay":"cw-card-module__loadingOverlay__8-zVV"};
1841
+ var styles$r = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module__clickable__Y-V3X","disabled":"cw-card-module__disabled__0wHh1","content":"cw-card-module__content__ma9qy","headerContent":"cw-card-module__headerContent__x4Jfl","footerTags":"cw-card-module__footerTags__80sSW"};
1753
1842
 
1754
1843
  /**
1755
1844
  * CwCard - A simple card component for displaying content in a contained format
@@ -1769,7 +1858,7 @@ var styles$r = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module
1769
1858
  * <p>This is the main content of the card.</p>
1770
1859
  * </CwCard>
1771
1860
  **/
1772
- 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", layout, }) => {
1861
+ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, onEdit, onDelete, extraActions, className = '', clickable = false, onClick, isLoading = false, skeletonLines = 3, disabled = false, style, chips = [], variant = "border", direction = "column", layout, }) => {
1773
1862
  const resolvedDirection = layout?.direction ?? direction;
1774
1863
  const resolvedAlign = layout?.align ?? (alignment === 'left' ? 'start' : 'center');
1775
1864
  // Construct class names using CSS modules
@@ -1779,7 +1868,6 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
1779
1868
  className,
1780
1869
  clickable ? styles$r.clickable : '',
1781
1870
  disabled ? styles$r.disabled : '',
1782
- isLoading ? styles$r.loading : '',
1783
1871
  ].filter(Boolean).join(' ');
1784
1872
  // Handle click event when card is clickable
1785
1873
  const handleClick = () => {
@@ -1795,16 +1883,17 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
1795
1883
  const hasChips = chips.length > 0;
1796
1884
  // Determine if footer should be rendered
1797
1885
  const hasFooter = hasChips || footer || (hasActions && resolvedDirection === "row");
1798
- // Actions component to reuse
1799
- const ActionsComponent = hasActions && !disabled ? (jsxRuntime.jsxs("div", { className: styles$r.actions, children: [extraActions ?? null, onEdit && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) : null;
1800
- return (jsxRuntime.jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && {
1886
+ // Actions component to reuse. While loading, each provided action renders a circular
1887
+ // ghost sized to the CwButton icon footprint (2rem) - no interactive buttons.
1888
+ const ActionsComponent = hasActions && !disabled ? (jsxRuntime.jsx("div", { className: styles$r.actions, children: isLoading ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [extraActions && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onEdit && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), onDelete && jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [extraActions ?? null, onEdit && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsxRuntime.jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) })) : null;
1889
+ return (jsxRuntime.jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && !isLoading && {
1801
1890
  role: 'button',
1802
1891
  tabIndex: 0,
1803
1892
  onClick: handleClick,
1804
- }), "data-variant": variant, "data-direction": resolvedDirection, children: [hasHeader && (jsxRuntime.jsxs("header", { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: styles$r.headerContent, "data-align": resolvedAlign, children: [title && jsxRuntime.jsx("h5", { children: title }), subtitle && jsxRuntime.jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] })), jsxRuntime.jsx("div", { className: styles$r.content, children: children }), hasFooter && (jsxRuntime.jsxs("footer", { children: [hasChips && (jsxRuntime.jsx("div", { className: styles$r.footerTags, children: chips.map((chip, index) => (jsxRuntime.jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$r.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsxRuntime.jsx("div", { className: styles$r.footerContent, children: footer }))] })), resolvedDirection === "row" && ActionsComponent, isLoading && (jsxRuntime.jsx("div", { className: styles$r.loadingOverlay, children: jsxRuntime.jsx(CwLoading, { isLoading: isLoading, size: "small" }) }))] }));
1893
+ }), "data-variant": variant, "data-direction": resolvedDirection, "aria-busy": isLoading || undefined, children: [isLoading ? (jsxRuntime.jsxs("header", { children: [jsxRuntime.jsx("div", { className: styles$r.headerContent, "data-align": resolvedAlign, children: jsxRuntime.jsx(CwSkeleton, { width: "8rem", height: "1.5em" }) }), resolvedDirection === "column" && ActionsComponent] })) : (hasHeader && (jsxRuntime.jsxs("header", { children: [(title || subtitle) && (jsxRuntime.jsxs("div", { className: styles$r.headerContent, "data-align": resolvedAlign, children: [title && jsxRuntime.jsx("h5", { children: title }), subtitle && jsxRuntime.jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] }))), jsxRuntime.jsx("div", { className: styles$r.content, children: isLoading ? jsxRuntime.jsx(CwSkeleton, { count: normalizeSkeletonCount(skeletonLines, 3) }) : children }), hasFooter && (isLoading ? (jsxRuntime.jsx("footer", { children: jsxRuntime.jsx("div", { className: styles$r.footerTags, children: jsxRuntime.jsx(CwSkeleton, { variant: "rect", width: "4rem", height: "1.5em", radius: "1rem" }) }) })) : (jsxRuntime.jsxs("footer", { children: [hasChips && (jsxRuntime.jsx("div", { className: styles$r.footerTags, children: chips.map((chip, index) => (jsxRuntime.jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$r.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsxRuntime.jsx("div", { className: styles$r.footerContent, children: footer }))] }))), resolvedDirection === "row" && ActionsComponent] }));
1805
1894
  };
1806
1895
 
1807
- var styles$q = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","loading":"cw-card-list-module__loading__cYpND","emptyState":"cw-card-list-module__emptyState__RlqiS"};
1896
+ var styles$q = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","emptyState":"cw-card-list-module__emptyState__RlqiS"};
1808
1897
 
1809
1898
  /**
1810
1899
  * Option to display in the CwSelect
@@ -1862,7 +1951,7 @@ function CwSelect(props) {
1862
1951
  : selectProps.onChange, children: [placeholder && jsxRuntime.jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
1863
1952
  }
1864
1953
 
1865
- function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', defaultCardWidth = 320, cardGap = 16, isLoading = false, emptyState, sortOptions = [], defaultSortKey, keyExtractor, ...htmlProps }) {
1954
+ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', defaultCardWidth = 320, cardGap = 16, isLoading = false, skeletonCards = 6, emptyState, sortOptions = [], defaultSortKey, keyExtractor, ...htmlProps }) {
1866
1955
  const [currentPage, setCurrentPage] = React.useState(1);
1867
1956
  const [sortKey, setSortKey] = React.useState(defaultSortKey || sortOptions[0]?.key || '');
1868
1957
  const [sortDirection, setSortDirection] = React.useState('asc');
@@ -1899,7 +1988,7 @@ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', default
1899
1988
  icon: sortDirection === 'asc' ? 'arrow-up' : 'arrow-down',
1900
1989
  onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'),
1901
1990
  title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}`,
1902
- }, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsxRuntime.jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsxRuntime.jsx("div", { className: styles$q.loading, children: jsxRuntime.jsx(CwLoading, { isLoading: isLoading }) })) : sortedItems.length === 0 ? (jsxRuntime.jsx("div", { className: styles$q.emptyState, children: emptyState || jsxRuntime.jsx("p", { children: "No items to display" }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: `${styles$q.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsxRuntime.jsx(React.Fragment, { children: renderCard(item, index) }, keyExtractor ? keyExtractor(item, index) : index))) }), totalPages > 1 && (jsxRuntime.jsxs("div", { className: styles$q.pagination, children: [jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-left", disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)) }), jsxRuntime.jsxs("span", { className: styles$q.pageInfo, children: [currentPage, " / ", totalPages] }), jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-right", disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)) })] }))] }))] }));
1991
+ }, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsxRuntime.jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsxRuntime.jsx("div", { className: `${styles$q.cardContainer}`, "data-layout": layout, style: gridStyle, "aria-busy": true, children: Array.from({ length: normalizeSkeletonCount(skeletonCards, 6) }, (_, index) => (jsxRuntime.jsx(CwCard, { isLoading: true, children: null }, `skeleton_${index}`))) })) : sortedItems.length === 0 ? (jsxRuntime.jsx("div", { className: styles$q.emptyState, children: emptyState || jsxRuntime.jsx("p", { children: "No items to display" }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: `${styles$q.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsxRuntime.jsx(React.Fragment, { children: renderCard(item, index) }, keyExtractor ? keyExtractor(item, index) : index))) }), totalPages > 1 && (jsxRuntime.jsxs("div", { className: styles$q.pagination, children: [jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-left", disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)) }), jsxRuntime.jsxs("span", { className: styles$q.pageInfo, children: [currentPage, " / ", totalPages] }), jsxRuntime.jsx(CwButton, { variant: "icon", icon: "chevron-right", disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)) })] }))] }))] }));
1903
1992
  }
1904
1993
 
1905
1994
  var styles$p = {"cw-accordion":"cw-accordion-module__cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module__cw-accordion-body__xlI8b"};
@@ -1922,6 +2011,21 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
1922
2011
  return (jsxRuntime.jsxs("div", { className: styles$p["cw-accordion"], style: CwelltAccordionContainerProps.style, "data-open": isVisible_accordionBody, children: [jsxRuntime.jsxs("header", { onClick: () => showAccordionBody(), children: [jsxRuntime.jsx("div", { children: CwelltAccordionContainerProps.desc_text }), jsxRuntime.jsx("button", { className: "cw-button-icon" })] }), jsxRuntime.jsx("div", { className: styles$p["cw-accordion-body"], children: CwelltAccordionContainerProps.children })] }));
1923
2012
  }
1924
2013
 
2014
+ /*
2015
+ * Internal helper for table loading ghosts (CwTable, CwSortableTable).
2016
+ * Not exported from the library barrel - not a public API.
2017
+ */
2018
+ const SKELETON_CELL_WIDTHS = ['85%', '60%', '95%', '70%', '80%', '65%'];
2019
+ /**
2020
+ * Deterministic width for a table ghost cell so skeleton rows look like real,
2021
+ * unevenly sized content. Derived purely from indices - stable across re-renders
2022
+ * (no reshuffling) - and offset by the column count so the pattern does not
2023
+ * repeat identically per row or per column.
2024
+ */
2025
+ function getSkeletonCellWidth(rowIndex, columnIndex, columnCount) {
2026
+ return SKELETON_CELL_WIDTHS[(rowIndex * columnCount + columnIndex) % SKELETON_CELL_WIDTHS.length];
2027
+ }
2028
+
1925
2029
  /**
1926
2030
  * A reusable and customizable table component.
1927
2031
  *
@@ -1991,7 +2095,7 @@ function CwAccordionContainer(CwelltAccordionContainerProps) {
1991
2095
  *
1992
2096
  * @returns React component
1993
2097
  */
1994
- function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, pageLabel = "page", rowSelection }) {
2098
+ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10, 20, 50], expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, skeletonRows = 5, scrollHeight, stickyHeader = false, pageLabel = "page", rowSelection }) {
1995
2099
  const [currentPage, setCurrentPage] = React.useState(1);
1996
2100
  const [expandedRowKey, setExpandedRowKey] = React.useState(null);
1997
2101
  const [sortConfig, setSortConfig] = React.useState({
@@ -2129,7 +2233,9 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
2129
2233
  };
2130
2234
  const renderTableBody = () => {
2131
2235
  if (loading) {
2132
- return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: jsxRuntime.jsx("div", { children: "Loading data..." }) }) }));
2236
+ // Ghost rows: rendered outside the data/selection/expand code paths, so they
2237
+ // cannot trigger row click, selection or expansion.
2238
+ return Array.from({ length: normalizeSkeletonCount(skeletonRows, 5) }, (_, rowIndex) => (jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("td", { className: "cw-table-col-action" }), columns.map((col, columnIndex) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: getSkeletonCellWidth(rowIndex, columnIndex, columns.length) }) }, col.key)))] }, `skeleton_${rowIndex}`)));
2133
2239
  }
2134
2240
  if (!paginatedData || paginatedData.length === 0) {
2135
2241
  return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
@@ -2151,7 +2257,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
2151
2257
  : "cwi-chevron-right"}` }) })), columns.map(col => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? 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)));
2152
2258
  });
2153
2259
  };
2154
- return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
2260
+ return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map(col => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${sortConfig.key === col.dataIndex
2155
2261
  ? sortConfig.direction
2156
2262
  : ""}`.trim(), style: {
2157
2263
  cursor: col.sortable ? "pointer" : "default",
@@ -2177,7 +2283,7 @@ function CwTable({ columns, data, pagination = false, pageSizeOptions = [5, 10,
2177
2283
  }, min: 1, max: totalPages }), jsxRuntime.jsx("span", { children: "/" }), jsxRuntime.jsx("span", { children: totalPages }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right" }), jsxRuntime.jsx(CwButton, { onClick: () => handlePageChange(totalPages), disabled: currentPage === totalPages || totalPages <= 1, variant: "icon", icon: "chevron-right-double" })] })] }))] }));
2178
2284
  }
2179
2285
 
2180
- var styles$o = {"dropIndicator":"cw-sortable-table-module__dropIndicator__ov-Jz","dragging":"cw-sortable-table-module__dragging__MrLrz","skeletonRow":"cw-sortable-table-module__skeletonRow__vyD0M","skeleton":"cw-sortable-table-module__skeleton__QGXAD","saveBar":"cw-sortable-table-module__saveBar__3OdoZ cw-flex-row cw-align-center-center cw-gap-small"};
2286
+ var styles$o = {"dropIndicator":"cw-sortable-table-module__dropIndicator__ov-Jz","dragging":"cw-sortable-table-module__dragging__MrLrz","saveBar":"cw-sortable-table-module__saveBar__3OdoZ cw-flex-row cw-align-center-center cw-gap-small"};
2181
2287
 
2182
2288
  /**
2183
2289
  * Hook that provides state management for CwSortableTable.
@@ -2242,7 +2348,12 @@ function useSortableTable(initialItems) {
2242
2348
  // ─── Drop indicator row ───────────────────────────────────────────────────────
2243
2349
  const DropIndicatorRow = ({ colSpan }) => (jsxRuntime.jsx("tr", { className: styles$o.dropIndicator, "aria-hidden": true, children: jsxRuntime.jsx("td", { colSpan: colSpan, children: jsxRuntime.jsx("div", {}) }) }));
2244
2350
  // ─── Loading skeleton ─────────────────────────────────────────────────────────
2245
- const LoadingRows = ({ colSpan }) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: 4 }).map((_, i) => (jsxRuntime.jsx("tr", { className: styles$o.skeletonRow, children: jsxRuntime.jsx("td", { colSpan: colSpan, children: jsxRuntime.jsx("div", { className: styles$o.skeleton }) }) }, i))) }));
2351
+ // Plain td cells (no local class): the ghost cells get the same global cw-table
2352
+ // padding as real body cells, so row heights match the loaded rows exactly.
2353
+ // One cell per real column, so column classNames/widths apply to the ghost too.
2354
+ function LoadingRows({ columns, showHandle, skeletonRows }) {
2355
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: skeletonRows }).map((_, rowIndex) => (jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("td", { className: "cw-table-col-action" }), columns.map((col, columnIndex) => (jsxRuntime.jsx("td", { className: col.className ?? "", style: col.width ? { width: col.width } : undefined, children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: getSkeletonCellWidth(rowIndex, columnIndex, columns.length) }) }, col.key)))] }, rowIndex))) }));
2356
+ }
2246
2357
  // ─── Component ────────────────────────────────────────────────────────────────
2247
2358
  /**
2248
2359
  * CwSortableTable
@@ -2259,7 +2370,7 @@ const LoadingRows = ({ colSpan }) => (jsxRuntime.jsx(jsxRuntime.Fragment, { chil
2259
2370
  * - Reorder is calculated in onDragEnd using lastValidDropIndex
2260
2371
  * - draggedItem is tracked in state, not via dataTransfer
2261
2372
  */
2262
- function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = false, textNoData = "No data available", className, tableClassName, maxHeight, showHandle = true, style, saveLabel = "Save order", discardLabel = "Discard", }) {
2373
+ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = false, skeletonRows = 5, textNoData = "No data available", className, tableClassName, maxHeight, showHandle = true, style, saveLabel = "Save order", discardLabel = "Discard", }) {
2263
2374
  const { items, hasChanges, handleReorder, handleSave, handleDiscard, } = useSortableTable(data);
2264
2375
  // Drag state lives in the component, same as CwSortableList
2265
2376
  const [draggedItem, setDraggedItem] = React.useState(null);
@@ -2278,11 +2389,15 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
2278
2389
  setLastValidDropIndex(null);
2279
2390
  };
2280
2391
  const handleDragStart = (e, item) => {
2392
+ if (loading)
2393
+ return;
2281
2394
  setDraggedItem(item);
2282
2395
  setLastValidDropIndex(null);
2283
2396
  e.dataTransfer.effectAllowed = "move";
2284
2397
  };
2285
2398
  const handleDragOver = (e, index) => {
2399
+ if (loading)
2400
+ return;
2286
2401
  e.preventDefault();
2287
2402
  if (!draggedItem)
2288
2403
  return;
@@ -2295,6 +2410,11 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
2295
2410
  }
2296
2411
  };
2297
2412
  const handleDragEnd = () => {
2413
+ // Never persist a reorder computed against stale/ghost data while loading.
2414
+ if (loading) {
2415
+ cleanupDragState();
2416
+ return;
2417
+ }
2298
2418
  if (draggedItem && lastValidDropIndex !== null) {
2299
2419
  const dragIndex = items.findIndex(item => item[rowKey] === draggedItem[rowKey]);
2300
2420
  if (dragIndex !== lastValidDropIndex && dragIndex !== lastValidDropIndex - 1) {
@@ -2321,7 +2441,7 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
2321
2441
  };
2322
2442
  const renderBody = () => {
2323
2443
  if (loading) {
2324
- return jsxRuntime.jsx(LoadingRows, { colSpan: totalCols });
2444
+ return jsxRuntime.jsx(LoadingRows, { columns: columns, showHandle: showHandle, skeletonRows: normalizeSkeletonCount(skeletonRows, 5) });
2325
2445
  }
2326
2446
  if (!items || items.length === 0) {
2327
2447
  return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: totalCols, className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
@@ -2333,7 +2453,7 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
2333
2453
  });
2334
2454
  };
2335
2455
  // ── Render ──────────────────────────────────────────────────────────────
2336
- return (jsxRuntime.jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, children: [jsxRuntime.jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsxRuntime.jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderBody() })] }), hasChanges && (jsxRuntime.jsxs("footer", { className: styles$o.saveBar, children: [jsxRuntime.jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsxRuntime.jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
2456
+ return (jsxRuntime.jsxs("div", { className: `cw-table-container ${className ?? ""}`, style: containerStyle, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table cw-sortable-table ${tableClassName ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [showHandle && jsxRuntime.jsx("th", { className: "cw-table-col-action" }), columns.map(col => (jsxRuntime.jsx("th", { className: col.className ?? "", style: col.width ? { width: col.width, minWidth: 50 } : undefined, children: col.title }, col.key)))] }) }), jsxRuntime.jsx("tbody", { children: renderBody() })] }), !loading && hasChanges && (jsxRuntime.jsxs("footer", { className: styles$o.saveBar, children: [jsxRuntime.jsx(CwButton, { variant: "outline", color: "neutral", icon: "undo", text: discardLabel, onClick: handleDiscard }), jsxRuntime.jsx(CwButton, { variant: "solid", color: "primary", icon: "save", text: saveLabel, onClick: () => handleSave(onReorder) })] }))] }));
2337
2457
  }
2338
2458
 
2339
2459
  /**
@@ -2389,7 +2509,7 @@ function CwSortableTable({ columns, data, rowKey = "key", onReorder, loading = f
2389
2509
  *
2390
2510
  * @returns React component
2391
2511
  */
2392
- function CwTableServerSide({ columns, data, totalItems, pagination = false, pageSizeOptions = [5, 10, 20, 50], pageLabel = "page", expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, scrollHeight, stickyHeader = false, rowSelection, onChange, serverState, }) {
2512
+ function CwTableServerSide({ columns, data, totalItems, pagination = false, pageSizeOptions = [5, 10, 20, 50], pageLabel = "page", expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, testId, textNoData = "No data available at the moment", rowKey = "key", loading = false, skeletonRows = 5, scrollHeight, stickyHeader = false, rowSelection, onChange, serverState, }) {
2393
2513
  const [internalState, setInternalState] = React.useState({
2394
2514
  page: 1,
2395
2515
  pageSize: pageSizeOptions[0],
@@ -2490,7 +2610,9 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
2490
2610
  };
2491
2611
  const renderTableBody = () => {
2492
2612
  if (loading) {
2493
- return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), children: jsxRuntime.jsx("div", { children: "Loading data..." }) }) }));
2613
+ // Ghost rows: rendered outside the data/selection/expand code paths, so they
2614
+ // cannot trigger row click, selection or expansion.
2615
+ return Array.from({ length: normalizeSkeletonCount(skeletonRows, 5) }, (_, rowIndex) => (jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("td", { className: "cw-table-col-action" }), columns.map((col, columnIndex) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: getSkeletonCellWidth(rowIndex, columnIndex, columns.length) }) }, col.key)))] }, `skeleton_${rowIndex}`)));
2494
2616
  }
2495
2617
  if (!data || data.length === 0) {
2496
2618
  return (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: getColSpan(), className: "cw-table-cell-empty", style: { textAlign: "center" }, children: textNoData }) }));
@@ -2508,7 +2630,7 @@ function CwTableServerSide({ columns, data, totalItems, pagination = false, page
2508
2630
  }, 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 ? "cwi-chevron-down" : "cwi-chevron-right"}` }) })), columns.map((col) => (jsxRuntime.jsx("td", { className: col.className ?? "", children: col.render ? col.render(item) : col.dataIndex ? 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)));
2509
2631
  });
2510
2632
  };
2511
- return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map((col) => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${state.sortKey === col.dataIndex ? state.sortDirection : ""}`.trim(), style: {
2633
+ return (jsxRuntime.jsxs("div", { id: id, "data-testid": testId, className: `cw-table-container${stickyHeader || scrollHeight ? " cw-table-scroll" : ""} ${classNameContainer ?? ""}`, style: { ...(scrollHeight ? { "--table-height": typeof scrollHeight === "number" ? `${scrollHeight}px` : scrollHeight } : {}), ...style }, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("table", { className: `cw-table ${className ?? ""}`, style: { width: "100%" }, children: [jsxRuntime.jsx("thead", { children: jsxRuntime.jsxs("tr", { children: [expandedRowRender && jsxRuntime.jsx("th", {}), columns.map((col) => (jsxRuntime.jsxs("th", { onClick: () => col.sortable && col.dataIndex && handleSort(col.dataIndex), className: `${col.className ?? ""} ${state.sortKey === col.dataIndex ? state.sortDirection : ""}`.trim(), style: {
2512
2634
  cursor: col.sortable ? "pointer" : "default",
2513
2635
  userSelect: "none",
2514
2636
  width: columnWidths[col.key] ?? col.width,
@@ -2582,7 +2704,7 @@ function CwTabs(CwTabsProps) {
2582
2704
  const tabsListStyle = position === 'left' && CwTabsProps.tabsListWidth
2583
2705
  ? { minWidth: CwTabsProps.tabsListWidth }
2584
2706
  : undefined;
2585
- return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$n['cw-tabs'] + (CwTabsProps.className ? ` ${CwTabsProps.className}` : "") + "", 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, "data-tab-key": tab.key, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title, (tab.badge !== undefined || tab.badgeColor) && (jsxRuntime.jsx("span", { className: styles$n['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$n['cw-tabs-content'], "data-active-tab-key": activeTab ?? undefined, children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
2707
+ return (jsxRuntime.jsxs("div", { id: CwTabsProps.id, "data-testid": CwTabsProps.testId, className: styles$n['cw-tabs'] + (CwTabsProps.className ? ` ${CwTabsProps.className}` : "") + "", 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, "data-tab-key": tab.key, children: [jsxRuntime.jsx(TabIcon, { icon: tab.icon }), tab.title, (tab.badge !== undefined || tab.badgeColor) && (jsxRuntime.jsx("span", { className: styles$n['badge'], style: tab.badgeColor ? { backgroundColor: tab.badgeColor, color: getContrastColor(tab.badgeColor) } : undefined, children: tab.badge }))] }, tab.key))) }), jsxRuntime.jsx("div", { className: styles$n['cw-tabs-content'], "data-active-tab-key": activeTab ?? undefined, style: CwTabsProps.contentHeight ? { '--tabs-height': CwTabsProps.contentHeight } : undefined, children: activeTab !== null && CwTabsProps.tabs.find(tab => tab.key === activeTab)?.content })] }));
2586
2708
  }
2587
2709
 
2588
2710
  /**
@@ -2609,9 +2731,17 @@ const CwExpandable = ({ briefing, onToggle, onOpen, onClose, children, ...detail
2609
2731
  return (jsxRuntime.jsxs("details", { ref: myRef, ...detailsProps, className: "cw-expandable", children: [jsxRuntime.jsx("summary", { children: briefing }), children && jsxRuntime.jsx("section", { children: children })] }));
2610
2732
  };
2611
2733
 
2612
- var styles$m = {"cw-master-detail":"cw-master-detail-module__cw-master-detail__O8-FA","resizer":"cw-master-detail-module__resizer__hvGhL","detail":"cw-master-detail-module__detail__BG4Dm","detail-empty":"cw-master-detail-module__detail-empty__KFScK"};
2734
+ var styles$m = {"cw-master-detail":"cw-master-detail-module__cw-master-detail__O8-FA","resizer":"cw-master-detail-module__resizer__hvGhL","detail":"cw-master-detail-module__detail__BG4Dm","skeletonRow":"cw-master-detail-module__skeletonRow__6BUgt","detailSkeleton":"cw-master-detail-module__detailSkeleton__GcDS4","detail-empty":"cw-master-detail-module__detail-empty__KFScK"};
2613
2735
 
2614
- const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, detailContent, emptyDetail, searchPlaceholder = 'Search...', onSearch, masterHeader, masterFooter, masterWidth: initialWidth = 320, minMasterWidth = 240, maxMasterWidth = 500, resizable = true, showSearch = true, }) => {
2736
+ /*
2737
+ * Fixed rem widths for the ghosts: the master rows and detail panel size their
2738
+ * content freely, so a percentage-width skeleton would resolve to 100% of ~0 and
2739
+ * collapse to nothing. Fixed widths render regardless of layout. Cycled so rows do
2740
+ * not all look identical.
2741
+ */
2742
+ const MASTER_TITLE_WIDTHS = ['9rem', '11rem', '8rem', '10rem'];
2743
+ const MASTER_SUBTITLE_WIDTH = '5rem';
2744
+ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, detailContent, emptyDetail, searchPlaceholder = 'Search...', onSearch, masterHeader, masterFooter, masterWidth: initialWidth = 320, minMasterWidth = 240, maxMasterWidth = 500, resizable = true, showSearch = true, loading = false, skeletonRows = 5, }) => {
2615
2745
  const [masterWidth, setMasterWidth] = React.useState(initialWidth);
2616
2746
  const [isResizing, setIsResizing] = React.useState(false);
2617
2747
  const containerRef = React.useRef(null);
@@ -2646,11 +2776,21 @@ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, de
2646
2776
  };
2647
2777
  }, [isResizing, minMasterWidth, maxMasterWidth]);
2648
2778
  const rootClassName = [styles$m['cw-master-detail'], className].filter(Boolean).join(' ');
2649
- return (jsxRuntime.jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, children: [jsxRuntime.jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsxRuntime.jsx("search", { children: jsxRuntime.jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsxRuntime.jsx("header", { children: masterHeader })), jsxRuntime.jsx("ul", { children: items.map((item) => (jsxRuntime.jsx("li", { "data-master-key": item.key, "data-selected": item.key === selectedKey, "data-disabled": item.disabled, onClick: () => onSelect?.(item.key), children: item.content }, item.key))) }), masterFooter && (jsxRuntime.jsx("footer", { children: masterFooter }))] }), resizable && (jsxRuntime.jsx("div", { className: styles$m.resizer, "data-resizing": isResizing, onMouseDown: handleMouseDown })), jsxRuntime.jsx("section", { className: styles$m.detail, children: selectedKey && detailContent
2779
+ return (jsxRuntime.jsxs("div", { id: id, ref: containerRef, className: rootClassName, style: style, "aria-busy": loading || undefined, children: [jsxRuntime.jsxs("aside", { style: { width: masterWidth, minWidth: masterWidth }, children: [showSearch && (jsxRuntime.jsx("search", { children: jsxRuntime.jsx("input", { type: "text", placeholder: searchPlaceholder, onChange: (e) => onSearch?.(e.target.value) }) })), masterHeader && (jsxRuntime.jsx("header", { children: masterHeader })), jsxRuntime.jsx("ul", { children: loading
2780
+ ? Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxRuntime.jsxs("li", { "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "circle", height: "2rem" }), jsxRuntime.jsxs("div", { className: styles$m.skeletonRow, children: [jsxRuntime.jsx(CwSkeleton, { variant: "text", width: MASTER_TITLE_WIDTHS[rowIndex % MASTER_TITLE_WIDTHS.length] }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: MASTER_SUBTITLE_WIDTH })] })] }, `skeleton_${rowIndex}`)))
2781
+ : items.map((item) => (jsxRuntime.jsx("li", { "data-master-key": item.key, "data-selected": item.key === selectedKey, "data-disabled": item.disabled, onClick: () => onSelect?.(item.key), children: item.content }, item.key))) }), masterFooter && (jsxRuntime.jsx("footer", { children: masterFooter }))] }), resizable && (jsxRuntime.jsx("div", { className: styles$m.resizer, "data-resizing": isResizing, onMouseDown: handleMouseDown })), jsxRuntime.jsx("section", { className: styles$m.detail, children: loading ? (jsxRuntime.jsxs("div", { className: styles$m.detailSkeleton, "aria-hidden": "true", children: [jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "14rem", height: "1.5em" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "22rem" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "18rem" }), jsxRuntime.jsx(CwSkeleton, { variant: "text", width: "20rem" })] })) : selectedKey && detailContent
2650
2782
  ? detailContent
2651
2783
  : (jsxRuntime.jsx("div", { className: styles$m['detail-empty'], children: emptyDetail ?? 'Select an item to view details' })) })] }));
2652
2784
  };
2653
2785
 
2786
+ /*
2787
+ * Fixed rem widths (not percentages): dt and dd size to their content in the list
2788
+ * item, so a percentage-width skeleton would resolve to 100% of ~0 and collapse to
2789
+ * nothing. Fixed widths are visible in both row (dt beside dd) and column (dt above
2790
+ * dd) item layouts. Cycled by row so keys and values do not all look identical.
2791
+ */
2792
+ const SKELETON_KEY_WIDTHS = ["5rem", "6.5rem", "4.5rem", "6rem"];
2793
+ const SKELETON_VALUE_WIDTHS = ["8rem", "6rem", "9rem", "7rem"];
2654
2794
  /**
2655
2795
  * A component for displaying key-value pairs in a definition list format
2656
2796
  * Used for read-only display of structured data
@@ -2664,13 +2804,20 @@ const CwMasterDetail = ({ id, className, style, items, selectedKey, onSelect, de
2664
2804
  * emptyValue="N/A"
2665
2805
  * />
2666
2806
  */
2667
- const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "row", groupLayout, itemLayout, ...htmlProps }) => {
2807
+ const CwKeyValueList = ({ items, className = "", emptyValue = "-", direction = "row", loading = false, skeletonRows = 4, groupLayout, itemLayout, ...htmlProps }) => {
2668
2808
  const itemDirection = itemLayout?.direction ?? direction;
2669
- return (jsxRuntime.jsx("dl", { className: `cw-keyvalue-list ${className}`, "data-direction": groupLayout?.direction, "data-align": groupLayout?.align, "data-justify": groupLayout?.justify, "data-gap": groupLayout?.gap, ...htmlProps, children: items.map(item => (jsxRuntime.jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${itemDirection}`, "data-align": itemLayout?.align, "data-justify": itemLayout?.justify, "data-gap": itemLayout?.gap, children: [jsxRuntime.jsx("dt", { children: item.label }), jsxRuntime.jsx("dd", { children: item.value !== undefined && item.value !== null && item.value !== ""
2809
+ const renderItems = () => {
2810
+ if (loading) {
2811
+ // The whole list comes from one data load, so both key and value ghost.
2812
+ return Array.from({ length: skeletonRows }, (_unused, rowIndex) => (jsxRuntime.jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${itemDirection}`, "data-align": itemLayout?.align, "data-justify": itemLayout?.justify, "data-gap": itemLayout?.gap, "aria-hidden": "true", children: [jsxRuntime.jsx("dt", { children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: SKELETON_KEY_WIDTHS[rowIndex % SKELETON_KEY_WIDTHS.length] }) }), jsxRuntime.jsx("dd", { children: jsxRuntime.jsx(CwSkeleton, { variant: "text", width: SKELETON_VALUE_WIDTHS[rowIndex % SKELETON_VALUE_WIDTHS.length] }) })] }, `skeleton_${rowIndex}`)));
2813
+ }
2814
+ return items.map(item => (jsxRuntime.jsxs("div", { className: `cw-keyvalue-list-item cw-flex-${itemDirection}`, "data-align": itemLayout?.align, "data-justify": itemLayout?.justify, "data-gap": itemLayout?.gap, children: [jsxRuntime.jsx("dt", { children: item.label }), jsxRuntime.jsx("dd", { children: item.value !== undefined && item.value !== null && item.value !== ""
2670
2815
  ? (React.isValidElement(item.value)
2671
2816
  ? item.value
2672
2817
  : `${item.value}${item.suffix ? ` ${item.suffix}` : ''}`)
2673
- : emptyValue })] }, item.key))) }));
2818
+ : emptyValue })] }, item.key)));
2819
+ };
2820
+ return (jsxRuntime.jsx("dl", { className: `cw-keyvalue-list ${className}`, "data-direction": groupLayout?.direction, "data-align": groupLayout?.align, "data-justify": groupLayout?.justify, "data-gap": groupLayout?.gap, "aria-busy": loading || undefined, ...htmlProps, children: renderItems() }));
2674
2821
  };
2675
2822
 
2676
2823
  var styles$l = {"sortableList":"cw-sortable-list-module__sortableList__PyLO-","sortableItem":"cw-sortable-list-module__sortableItem__FAnn2","readOnly":"cw-sortable-list-module__readOnly__r7GcH","dragging":"cw-sortable-list-module__dragging__MD715","moved":"cw-sortable-list-module__moved__sE6-N","expandedContent":"cw-sortable-list-module__expandedContent__Kocna","sortableHandle":"cw-sortable-list-module__sortableHandle__HvYBK","sortableContent":"cw-sortable-list-module__sortableContent__C6JhR","sortableTitle":"cw-sortable-list-module__sortableTitle__EgWXr","sortableExtraContent":"cw-sortable-list-module__sortableExtraContent__s4LSv","sortableActions":"cw-sortable-list-module__sortableActions__gwQOU","dropIndicator":"cw-sortable-list-module__dropIndicator__MNSF-","emptyMessage":"cw-sortable-list-module__emptyMessage__gMpaL"};
@@ -3106,8 +3253,14 @@ function CwInput(CwInputProps) {
3106
3253
  * ```
3107
3254
  */
3108
3255
  function CwDigit(props) {
3109
- const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
3110
- return (jsxRuntime.jsx("div", { className: "cw-input-text", children: jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "number", ...inputProps }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }) }));
3256
+ const { alignProps, buttonProps, iconProps, labelProps, feedback, ...inputProps } = props;
3257
+ const feedbackMessages = feedback
3258
+ ? Array.isArray(feedback) ? feedback : [feedback]
3259
+ : [];
3260
+ const feedbackId = React.useId();
3261
+ const feedbackIds = feedbackMessages.map((_, index) => `${feedbackId}-${index}`);
3262
+ const describedBy = [inputProps["aria-describedby"], ...feedbackIds].filter(Boolean).join(" ") || undefined;
3263
+ return (jsxRuntime.jsxs("div", { className: "cw-input-text", children: [jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (jsxRuntime.jsxs(CwLabel, { ...labelProps, children: [iconProps && jsxRuntime.jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxRuntime.jsx("input", { type: "number", ...inputProps, "aria-describedby": describedBy }), buttonProps && jsxRuntime.jsx(CwButton, { ...buttonProps })] }), feedbackMessages.map((feedbackItem, index) => (jsxRuntime.jsx("p", { id: feedbackIds[index], className: "cw-input-info", "data-color": feedbackItem.type, "aria-live": "polite", children: feedbackItem.message }, index)))] }));
3111
3264
  }
3112
3265
 
3113
3266
  var styles$j = {"colorPreview":"cw-color-picker-module__colorPreview__ylJcD","hueBar":"cw-color-picker-module__hueBar__bFhyC","hueBarSlider":"cw-color-picker-module__hueBarSlider__D53IV","colorPickerInteractiveArea":"cw-color-picker-module__colorPickerInteractiveArea__KZFR1","colorArea":"cw-color-picker-module__colorArea__xgpSE","colorAreaOverlay":"cw-color-picker-module__colorAreaOverlay__pmgOc","hueBackground":"cw-color-picker-module__hueBackground__Mks78","whiteGradient":"cw-color-picker-module__whiteGradient__Bt-fU","blackGradient":"cw-color-picker-module__blackGradient__VnEKJ","colorAreaCursor":"cw-color-picker-module__colorAreaCursor__lotg3"};
@@ -3321,7 +3474,7 @@ const CwColorPicker = ({ initialColor, onChange, previewText = "Color preview" }
3321
3474
 
3322
3475
  var styles$i = {"container":"cw-input-color-module__container__x7gpk","selectColor":"cw-input-color-module__selectColor__DTo3V","disabled":"cw-input-color-module__disabled__O1fK5","readOnly":"cw-input-color-module__readOnly__HL-Bz","colorDropdown":"cw-input-color-module__colorDropdown__pX2bc"};
3323
3476
 
3324
- const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled = false, readOnly = false, width = '4rem', height = '2rem', labelProps, layoutProps, }) => {
3477
+ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled = false, readOnly = false, width = '4rem', height = '2rem', labelProps, layoutProps, className, style, }) => {
3325
3478
  const [isOpen, setIsOpen] = React.useState(false);
3326
3479
  const containerRef = React.useRef(null);
3327
3480
  const dropdownRef = React.useRef(null);
@@ -3452,7 +3605,7 @@ const CwInputColor = ({ value, onChange, previewText = "Color preview", disabled
3452
3605
  break;
3453
3606
  }
3454
3607
  };
3455
- return (jsxRuntime.jsxs("div", { className: `cw-input-color ${styles$i.container}`, "data-direction": layoutProps?.direction ?? "row", "data-align": layoutProps?.align, children: [labelProps && (jsxRuntime.jsx(CwLabel, { ...labelProps })), jsxRuntime.jsx("div", { ref: containerRef, onClick: handleToggle, className: `${styles$i.selectColor} ${disabled ? styles$i.disabled : ''} ${readOnly ? styles$i.readOnly : ''}`, style: {
3608
+ return (jsxRuntime.jsxs("div", { className: `cw-input-color ${styles$i.container}${className ? ` ${className}` : ''}`, style: style, "data-direction": layoutProps?.direction ?? "row", "data-align": layoutProps?.align, children: [labelProps && (jsxRuntime.jsx(CwLabel, { ...labelProps })), jsxRuntime.jsx("div", { ref: containerRef, onClick: handleToggle, className: `${styles$i.selectColor} ${disabled ? styles$i.disabled : ''} ${readOnly ? styles$i.readOnly : ''}`, style: {
3456
3609
  width,
3457
3610
  height,
3458
3611
  backgroundColor: value,
@@ -5135,8 +5288,8 @@ function CwNavMenu({ items, loading = false, isActive, renderLink = defaultRende
5135
5288
  }
5136
5289
  return (jsxRuntime.jsx("li", { "data-active": isActive?.(item) ? "true" : undefined, children: renderLink(item, jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [item.icon && jsxRuntime.jsx(CwIcon, { iconId: item.icon, size: "medium" }), item.label, isFavorite?.(item) && jsxRuntime.jsx(CwIcon, { iconId: "star", size: "small", className: styles$8.favoriteStar })] })) }, item.id));
5137
5290
  };
5138
- return (jsxRuntime.jsxs("nav", { ...navProps, className: [styles$8.menu, className].filter(Boolean).join(" "), children: [favoritesSlot && (jsxRuntime.jsxs("details", { open: true, ...favoritesProps, className: [styles$8.favorites, favoritesProps?.className].filter(Boolean).join(" "), children: [jsxRuntime.jsxs("summary", { children: [jsxRuntime.jsx(CwIcon, { iconId: "star", size: "medium" }), favoritesLabel] }), jsxRuntime.jsx("div", { className: styles$8.favoritesContent, children: favoritesSlot })] })), beforeTreeSlot, jsxRuntime.jsx("ul", { children: loading
5139
- ? Array.from({ length: SKELETON_ROW_COUNT }, (_unused, index) => (jsxRuntime.jsx("li", { className: styles$8.skeleton }, index)))
5291
+ return (jsxRuntime.jsxs("nav", { ...navProps, className: [styles$8.menu, className].filter(Boolean).join(" "), "aria-busy": loading || undefined, children: [favoritesSlot && (jsxRuntime.jsxs("details", { open: true, ...favoritesProps, className: [styles$8.favorites, favoritesProps?.className].filter(Boolean).join(" "), children: [jsxRuntime.jsxs("summary", { children: [jsxRuntime.jsx(CwIcon, { iconId: "star", size: "medium" }), favoritesLabel] }), jsxRuntime.jsx("div", { className: styles$8.favoritesContent, children: favoritesSlot })] })), beforeTreeSlot, jsxRuntime.jsx("ul", { children: loading
5292
+ ? Array.from({ length: SKELETON_ROW_COUNT }, (_unused, index) => (jsxRuntime.jsx("li", { className: styles$8.skeleton, children: jsxRuntime.jsx(CwSkeleton, { height: "var(--cw-size-small)", radius: "var(--cw-border-radius-small)" }) }, index)))
5140
5293
  : visibleItems.map(item => renderItem(item, 1)) }), showEmptyMessage && jsxRuntime.jsx("p", { className: styles$8.emptyMessage, children: emptyMessage })] }));
5141
5294
  }
5142
5295
 
@@ -8526,1066 +8679,6 @@ function CwDateRangePickerTemporal({ value, onChange, minDate, maxDate, disabled
8526
8679
  } })] }), jsxRuntime.jsx("div", { role: "alert", "aria-live": "polite", className: rangeStyles.rangeError, children: rangeErrorMessage })] }))] })] }) }));
8527
8680
  }
8528
8681
 
8529
- const ResourcesTitleList = ({ resources, canBePinned, includesPinned, onCrewPinning, onClickResourceContextMenu, ResourceTitleComponent, }) => {
8530
- const onClickContextMenu = React.useCallback((key, resource) => {
8531
- if (onClickResourceContextMenu) {
8532
- onClickResourceContextMenu(key, resource);
8533
- }
8534
- }, []);
8535
- return (jsxRuntime.jsx("td", { className: "resourceArea", style: { width: "100px" }, children: resources.map((r, _i) => (jsxRuntime.jsxs("div", { className: "resource CwelltFunctionDescription", style: { height: r.maxTop }, children: [(canBePinned || includesPinned) && (jsxRuntime.jsx(PinButton, { canBePinned: canBePinned, resource: r, onCrewPinning: onCrewPinning })), jsxRuntime.jsx(ResourceTitleComponent, { resource: r, handleOnClickResourceContextMenu: onClickContextMenu })] }, r.id.toString()))) }));
8536
- };
8537
- const PinButton = ({ canBePinned, resource, onCrewPinning }) => {
8538
- const buttonProps = canBePinned
8539
- ? {
8540
- id: "cbl_pinL",
8541
- onClick: () => onCrewPinning(resource, ""),
8542
- children: jsxRuntime.jsx("span", { className: "cwi-pin", style: { visibility: "visible" } }),
8543
- }
8544
- : {
8545
- id: "cbl_pinLess45deg",
8546
- onClick: () => onCrewPinning(resource, "remove"),
8547
- children: jsxRuntime.jsx("span", { className: "cwi-pinned cwi-pin", style: { visibility: "visible" } }),
8548
- };
8549
- return jsxRuntime.jsx("button", { className: "cw-button-icon cw-icon-pin", ...buttonProps });
8550
- };
8551
-
8552
- const addMinutesToDateFromPx = (originalDate, leftPx, minutesPerPx) => {
8553
- const minutes = leftPx / minutesPerPx;
8554
- const datePlusMinutes = new Date(originalDate.getTime() + minutes * 60000);
8555
- return datePlusMinutes;
8556
- };
8557
-
8558
- const doubleClickOnResource = (props, resource) => {
8559
- if (props.scheduler_handleDblClickOnResourceInScheduler) {
8560
- props.scheduler_handleDblClickOnResourceInScheduler(resource);
8561
- }
8562
- };
8563
-
8564
- let CblDragAndDrop$1 = class CblDragAndDrop {
8565
- fromId;
8566
- toId;
8567
- data;
8568
- droppedOnDate;
8569
- resizeFromStart;
8570
- resizeFromEnd;
8571
- isCtrlKey;
8572
- constructor(fromId, toId, data, droppedOnDate = null, resizeFromStart = null, resizeFromEnd = null, isCtrlKey = null) {
8573
- this.fromId = fromId;
8574
- this.toId = toId;
8575
- this.data = data;
8576
- this.droppedOnDate = droppedOnDate;
8577
- this.resizeFromStart = resizeFromStart;
8578
- this.resizeFromEnd = resizeFromEnd;
8579
- this.isCtrlKey = isCtrlKey;
8580
- }
8581
- };
8582
-
8583
- const BIRTHDATE = 15;
8584
- const NOT_WORKING = 16;
8585
- const REST_TIME = 10;
8586
- const MAX_FLIGHT_DUTY_PERIOD = 11;
8587
- const DUTY_REGULATION = 20;
8588
- const unHandleableEvents = [REST_TIME, MAX_FLIGHT_DUTY_PERIOD, NOT_WORKING, DUTY_REGULATION];
8589
- const getEventStyle = (event, reslTime) => {
8590
- const baseStyle = {
8591
- left: event.leftPx,
8592
- width: event.width,
8593
- top: event.top,
8594
- overflow: "hidden",
8595
- zIndex: event.isFullHeight ? 4 : 5,
8596
- };
8597
- if (event.data.eventType === BIRTHDATE) {
8598
- return {
8599
- ...baseStyle,
8600
- height: event.isFullHeight ? "100%" : "auto",
8601
- marginTop: event.isFullHeight ? -1 * event.top : 0,
8602
- pointerEvents: "none",
8603
- borderBottom: "solid 1px rgba(0, 0, 0, 0.4)",
8604
- backgroundColor: event.data.category.color || "orange",
8605
- display: "flex",
8606
- opacity: 0.3,
8607
- alignItems: "flex-end",
8608
- };
8609
- }
8610
- if ([REST_TIME, MAX_FLIGHT_DUTY_PERIOD, DUTY_REGULATION].includes(event.data.eventType)) {
8611
- return {
8612
- ...baseStyle,
8613
- zIndex: event.isFullHeight ? 4 : 6,
8614
- marginTop: event.isFullHeight ? -1 * event.top : 0,
8615
- borderRadius: "0px",
8616
- backgroundColor: event.data.category.color || "grey",
8617
- opacity: 0.3,
8618
- borderBottom: event.data.eventType === DUTY_REGULATION ? "solid 1px rgba(0, 0, 0, 0.4)" : "",
8619
- };
8620
- }
8621
- return {
8622
- ...baseStyle,
8623
- height: event.isFullHeight ? "100%" : "auto",
8624
- marginTop: event.isFullHeight ? -1 * event.top : 0,
8625
- borderRadius: reslTime <= 0.99 ? "3px" : "5px",
8626
- minWidth: reslTime <= 1.5 ? "5px" : "",
8627
- maxWidth: reslTime <= 1.5 ? "25px" : "",
8628
- };
8629
- };
8630
- const EventRender = ({ event, schedulerProps }) => {
8631
- const dateStart = new Date(event.data.start);
8632
- const dateEnd = new Date(event.data.end);
8633
- const reslTime = (dateEnd.getTime() - dateStart.getTime()) / 3600000;
8634
- const eventStyle = getEventStyle(event, reslTime);
8635
- const onClickEvent = (e) => {
8636
- if (!unHandleableEvents.includes(event.data.eventType)) {
8637
- e.stopPropagation();
8638
- const props = schedulerProps;
8639
- props.scheduler_handleCblEventClick.call(props.parent, event, schedulerProps.id);
8640
- }
8641
- };
8642
- const onRightClickEvent = (e) => {
8643
- if (!unHandleableEvents.includes(event.data.eventType)) {
8644
- e.stopPropagation();
8645
- const props = schedulerProps;
8646
- if (props.scheduler_handleCblEventClickRight) {
8647
- props.scheduler_handleCblEventClickRight.call(props.parent, event, schedulerProps.id);
8648
- }
8649
- }
8650
- };
8651
- const safeHandleDragStart = (e, isLeft, isRight) => {
8652
- if (!unHandleableEvents.includes(event.data.eventType)) {
8653
- handleDragStart(e, isLeft, isRight);
8654
- }
8655
- };
8656
- const handleDragStart = (e, isResizeFromStart, isResizeFromEnd) => {
8657
- if (!unHandleableEvents.includes(event.data.eventType)) {
8658
- [].forEach.call(document.querySelectorAll(".ant-tooltip"), function (el) {
8659
- el.style.visibility = "hidden";
8660
- });
8661
- // We don't know in which case is necessary
8662
- if (e.target !== e.currentTarget) {
8663
- // e.preventDefault();
8664
- return;
8665
- }
8666
- const isResize = isResizeFromStart || isResizeFromEnd;
8667
- const isAllowed = !event.isReadOnly && (isResize ? event.isResizable : event.isDraggable);
8668
- if (!isAllowed) {
8669
- e.preventDefault();
8670
- return;
8671
- }
8672
- const cblDragNDrop = new CblDragAndDrop$1(schedulerProps.id, null, [event], null, isResizeFromStart, isResizeFromEnd);
8673
- if (!isResize) {
8674
- e.dataTransfer.dropEffect = e.ctrlKey ? "copy" : "link";
8675
- }
8676
- e.dataTransfer.setData("data", JSON.stringify(cblDragNDrop));
8677
- }
8678
- };
8679
- const handleDoubleClick = (e) => {
8680
- if (!unHandleableEvents.includes(event.data.eventType)) {
8681
- e.preventDefault();
8682
- e.stopPropagation();
8683
- const props = schedulerProps;
8684
- props.scheduler_handleCblEventDoubleClick.call(props.parent, event, schedulerProps.id);
8685
- }
8686
- };
8687
- const onClickContextMenu = (e) => {
8688
- if (!unHandleableEvents.includes(event.data.eventType)) {
8689
- const props = schedulerProps;
8690
- if (props.scheduler_handleOnClickEventContextMenu) {
8691
- props.scheduler_handleOnClickEventContextMenu(e, event);
8692
- }
8693
- }
8694
- };
8695
- const renderBirthdayEvent = () => (jsxRuntime.jsxs("div", { className: `fc-timeline-event cwellt_timeline_event cwellt_event_bday ${event.selected ? "cblEventSelected" : ""}`, style: eventStyle, children: [jsxRuntime.jsx("span", { className: "cwi-icons cwi-birthday", style: { visibility: "visible" } }), event.data.subject && jsxRuntime.jsx("span", { style: { lineHeight: "1em" }, children: event.data.subject })] }, event.id));
8696
- const renderRegularEvent = () => (jsxRuntime.jsxs("div", { draggable: ![10, 11, 16, 20, 21].includes(event.data.eventType), className: "fc-timeline-event cwellt_timeline_event " +
8697
- (event.selected === true ? "cblEventSelected " : "") +
8698
- (event.data.eventType === REST_TIME ||
8699
- event.data.eventType === MAX_FLIGHT_DUTY_PERIOD ||
8700
- event.data.eventType === DUTY_REGULATION
8701
- ? " cwellt_event_bhnd_appt "
8702
- : " "), style: eventStyle, onClick: onClickEvent, onContextMenu: onRightClickEvent, onDragStart: (e) => safeHandleDragStart(e, false, false), onDoubleClick: handleDoubleClick, children: [schedulerProps.scheduler_handleCblEventResize &&
8703
- !event.isReadOnly &&
8704
- !unHandleableEvents.includes(event.data.eventType) && (jsxRuntime.jsx("span", { draggable: true, onDragStart: (e) => handleDragStart(e, true, false), style: {
8705
- position: "absolute",
8706
- cursor: "e-resize",
8707
- zIndex: 10,
8708
- left: "0",
8709
- border: "solid 1px rgba(46,49,49,0.5)",
8710
- }, children: "\u200B" })), jsxRuntime.jsx(schedulerProps.cblEventComp, { cblEvent: event, handleOnClickEventContextMenu: onClickContextMenu }, event.id), schedulerProps.scheduler_handleCblEventResize &&
8711
- !event.isReadOnly &&
8712
- !unHandleableEvents.includes(event.data.eventType) && (jsxRuntime.jsx("span", { draggable: true, onDragStart: (e) => handleDragStart(e, false, true), style: {
8713
- position: "absolute",
8714
- right: "0",
8715
- cursor: "e-resize",
8716
- zIndex: 10,
8717
- border: "solid 1px rgba(46,49,49,0.5)",
8718
- marginTop: "-25px",
8719
- }, children: "\u200B" }))] }, event.id));
8720
- const render = event.data.eventType === BIRTHDATE ? renderBirthdayEvent() : renderRegularEvent();
8721
- return render;
8722
- };
8723
-
8724
- const onDropEventToResource = (props, cblDragNDrop, resource) => {
8725
- props.scheduler_handleOnDropCblEventsOnResource.call(props.parent, cblDragNDrop, resource);
8726
- };
8727
-
8728
- const isAllowedToMove = (data, resData, cblDragNDrop) => {
8729
- if (data?.eventType !== 1) {
8730
- return true;
8731
- }
8732
- const allowedMoves = [
8733
- { from: "acftsScheduler", to: "flightsPairingsScheduler" },
8734
- { from: "flightsScheduler", to: "crewAssignmentsScheduler" },
8735
- { from: "opstoolScheduler", to: "opstoolScheduler" },
8736
- { from: "opstoolScheduler", to: "opstoolSchedulerVirtual" },
8737
- { from: "opstoolSchedulerVirtual", to: "opstoolScheduler" },
8738
- { from: "opstoolSchedulerVirtual", to: "opstoolSchedulerVirtual" },
8739
- { from: "vacationsScheduler", to: "vacationsScheduler" }
8740
- ];
8741
- const crewControllAllowedMove = allowedMoves.some(move => move.from === cblDragNDrop.fromId && move.to === cblDragNDrop.toId);
8742
- if (crewControllAllowedMove) {
8743
- return true;
8744
- }
8745
- return data.Crew !== resData.Crewmember_Id;
8746
- };
8747
-
8748
- const OnDrop = ({ e, resource, id, contentArea, state, schedulerProps }) => {
8749
- e.dataTransfer.dropEffect = "move";
8750
- const cblDragNDrop = JSON.parse(e.dataTransfer.getData("data"));
8751
- if (!cblDragNDrop.data || !cblDragNDrop.data[0]) {
8752
- return;
8753
- }
8754
- cblDragNDrop.toId = id;
8755
- const obj = cblDragNDrop.data[0];
8756
- cblDragNDrop.isCtrlKey = e.ctrlKey;
8757
- const isResizeEvent = cblDragNDrop.resizeFromStart === true || cblDragNDrop.resizeFromEnd === true;
8758
- if (isResizeEvent) {
8759
- // Resize
8760
- if (obj.data === undefined || obj.data.eventType === 1) {
8761
- return;
8762
- }
8763
- const _eventX = e.clientX;
8764
- const _caLeft = contentArea?.getBoundingClientRect()?.left ?? 0;
8765
- const leftPos = _eventX - _caLeft;
8766
- let droppedDate = addMinutesToDateFromPx(schedulerProps.startDate, leftPos, state.minutePx);
8767
- if (cblDragNDrop.resizeFromEnd === true) {
8768
- const eventStart = new Date(Date.parse(obj.start));
8769
- droppedDate = droppedDate < eventStart ? eventStart : droppedDate;
8770
- }
8771
- if (cblDragNDrop.resizeFromStart === true) {
8772
- const eventEnd = new Date(Date.parse(obj.end));
8773
- // 3 hours before is the minimun size in the backend
8774
- eventEnd.setHours(eventEnd.getHours() - 3);
8775
- droppedDate = droppedDate > eventEnd ? eventEnd : droppedDate;
8776
- }
8777
- cblDragNDrop.droppedOnDate = droppedDate;
8778
- schedulerProps.scheduler_handleCblEventResize?.call(schedulerProps.parent, cblDragNDrop);
8779
- return;
8780
- }
8781
- // Drag & Drop
8782
- if (!isAllowedToMove(obj.data, resource.data, cblDragNDrop)) {
8783
- return;
8784
- }
8785
- const d = e.clientX - (contentArea?.getBoundingClientRect()?.left ?? 0);
8786
- const date = new Date(schedulerProps.startDate.getTime() + (d / state.minutePx) * 60000);
8787
- cblDragNDrop.droppedOnDate = date;
8788
- onDropEventToResource(schedulerProps, cblDragNDrop, resource);
8789
- };
8790
-
8791
- const onDragOver = (e) => {
8792
- if (e.ctrlKey === true) {
8793
- e.dataTransfer.dropEffect = "copy";
8794
- }
8795
- else {
8796
- e.dataTransfer.dropEffect = "link";
8797
- }
8798
- e.preventDefault();
8799
- };
8800
-
8801
- const arePropsEqual = (prevProps, nextProps) => {
8802
- return prevProps.res.events === nextProps.res.events && prevProps.isInViewport === nextProps.isInViewport;
8803
- };
8804
- const ResourceRender = React.memo(({ res, schedulerProps, contentArea, state }) => {
8805
- return (jsxRuntime.jsx("div", { style: {
8806
- backgroundColor: "#F9F8F8",
8807
- height: res.maxTop,
8808
- width: "100%",
8809
- position: "relative",
8810
- borderBottom: "1px solid rgb(255,255,255)",
8811
- }, onDragOver: (e) => onDragOver(e), onDrop: (e) => {
8812
- OnDrop({
8813
- e,
8814
- resource: res,
8815
- id: schedulerProps.id,
8816
- contentArea,
8817
- state,
8818
- schedulerProps,
8819
- });
8820
- }, className: "cwellt_divRow_schContent", children: res.events.map((evnt) => (jsxRuntime.jsx(EventRender, { event: evnt, schedulerProps: schedulerProps }, evnt.id))) }, res.id));
8821
- }, arePropsEqual);
8822
-
8823
- const ResourceListRender = ({ resources, schedulerProps, state, contentArea,
8824
- // onClickContextMenu,
8825
- crewAssignmentSchedulerContextMenu, }) => {
8826
- return (jsxRuntime.jsx(React.Fragment, { children: resources.map((r, _i) => (jsxRuntime.jsx(CwAnchoredMenu, { placement: "bottom", onContextMenu: (e) => {
8827
- // Dirty temporal solution to remove ANT design, this can be killed when this scheduler is deprecated
8828
- const leftPos = e.currentTarget.getBoundingClientRect().left -
8829
- (contentArea?.getBoundingClientRect()?.left ?? 0) -
8830
- window.scrollX;
8831
- const calculatedDatetime = addMinutesToDateFromPx(schedulerProps.startDate, leftPos, state.minutePx);
8832
- r.__contextMenuDatetime = calculatedDatetime;
8833
- }, options: crewAssignmentSchedulerContextMenu?.map(m => ({
8834
- key: m.key,
8835
- label: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: m.icon, style: { color: m.color } }), jsxRuntime.jsx("span", { children: m.text })] }))
8836
- })) ?? [], onSelect: (key) => {
8837
- const datetime = r.__contextMenuDatetime ?? new Date();
8838
- if (schedulerProps.scheduler_handleOnClickContextMenuResource) {
8839
- schedulerProps.scheduler_handleOnClickContextMenuResource(datetime, r, key, schedulerProps.id);
8840
- }
8841
- }, children: jsxRuntime.jsx("span", { onDoubleClick: () => doubleClickOnResource(schedulerProps, r), id: schedulerProps.id + "_" + r.id, children: jsxRuntime.jsx(ResourceRender, { res: r, schedulerProps: schedulerProps, contentArea: contentArea, state: state, isInViewport: r.isInViewport }, r.id) }) }, r.id))) }));
8842
- };
8843
-
8844
- const TimeLine$1 = ({ id, toolTipTitle, marginLeft, color = "rgba(255,0,0,.6)", pixels = 2, height = "100%", zIndex = 1, }) => {
8845
- return (jsxRuntime.jsx(CwTooltipNew, { content: toolTipTitle, position: "top", children: jsxRuntime.jsx("div", { id: id, style: {
8846
- borderLeft: `${pixels}px solid ${color}`,
8847
- marginLeft: marginLeft,
8848
- width: "0px",
8849
- height: height,
8850
- position: "absolute",
8851
- zIndex: zIndex,
8852
- } }) }));
8853
- };
8854
-
8855
- const SchedulerContentArea = ({ now, showTimeline, timeLineLeftPx, timeSeparatorLeftPx, resources, scheduler, contextMenuContents, onEmptyClick, setContentArea, onClickContextMenu, }) => {
8856
- return (jsxRuntime.jsxs("td", { className: "contentArea", style: { width: "100%", overflow: "hidden", position: "relative" }, ref: (reference) => {
8857
- if (reference) {
8858
- setContentArea(reference);
8859
- }
8860
- }, children: [showTimeline && (jsxRuntime.jsx(TimeLine$1, { id: scheduler.props.id + "_timeline", marginLeft: timeLineLeftPx, zIndex: 8, toolTipTitle: Temporal.PlainTime.from({
8861
- hour: now.getHours(),
8862
- minute: now.getMinutes(),
8863
- }).toString({ smallestUnit: "minute" }) })), timeSeparatorLeftPx.map((pixels) => {
8864
- return jsxRuntime.jsx(TimeLine$1, { marginLeft: pixels, color: "rgba(255,255,255,0.7)" });
8865
- }), jsxRuntime.jsx("span", { onClick: () => {
8866
- if (onEmptyClick) {
8867
- onEmptyClick(scheduler.props.id);
8868
- }
8869
- }, children: jsxRuntime.jsx(ResourceListRender, { resources: resources, state: scheduler.state, schedulerProps: scheduler.props, contentArea: scheduler.contentArea, onClickContextMenu: onClickContextMenu, crewAssignmentSchedulerContextMenu: contextMenuContents }) })] }));
8870
- };
8871
-
8872
- const daysBetweenTwoDates = (date1, date2) => {
8873
- const diff = Math.abs(date1.getTime() - date2.getTime());
8874
- let diffDays = 0;
8875
- const startOffset = Math.abs(date1.getTimezoneOffset());
8876
- const endOffset = Math.abs(date2.getTimezoneOffset());
8877
- // Summer: +1 -> +2, true
8878
- // Winter: +2 -> -1, false
8879
- if (startOffset > endOffset) {
8880
- diffDays = Math.floor(diff / (1000 * 3600 * 24));
8881
- }
8882
- else {
8883
- diffDays = Math.ceil(diff / (1000 * 3600 * 24));
8884
- }
8885
- return diffDays;
8886
- };
8887
-
8888
- const calculateDivisionType = (start, end) => {
8889
- const diffDays = daysBetweenTwoDates(start, end);
8890
- if (diffDays <= 15) {
8891
- return "d";
8892
- }
8893
- else if (diffDays <= 30) {
8894
- return "w";
8895
- }
8896
- else {
8897
- return "m";
8898
- }
8899
- };
8900
-
8901
- const getMonthHeaderData = (dates, maxWidth) => {
8902
- if (dates.length === 0)
8903
- return [];
8904
- const dayWidth = maxWidth / dates.length;
8905
- const ranges = getMonthRanges(dates);
8906
- return ranges.map((range) => {
8907
- return {
8908
- monthFormatted: range.start.getMonth() + 1 + "." + range.start.getFullYear(),
8909
- width: dayWidth * range.daysLong,
8910
- };
8911
- });
8912
- };
8913
- const getMonthRanges = (dates) => {
8914
- const firstDay = dates[0];
8915
- const lastDay = dates[dates.length - 1];
8916
- let currentDate = new Date(firstDay);
8917
- const ranges = [];
8918
- while (currentDate <= lastDay) {
8919
- const rangeStart = new Date(currentDate);
8920
- let rangeEnd = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
8921
- if (rangeEnd >= lastDay) {
8922
- rangeEnd = lastDay;
8923
- }
8924
- ranges.push({
8925
- start: rangeStart,
8926
- daysLong: getDaysBetweenDates(rangeStart, rangeEnd),
8927
- });
8928
- currentDate = new Date(rangeEnd.getFullYear(), rangeEnd.getMonth() + 1, 1);
8929
- }
8930
- return ranges;
8931
- };
8932
- const getDaysBetweenDates = (startDate, endDate) => {
8933
- const timeDifference = endDate.getTime() - startDate.getTime();
8934
- return Math.floor(timeDifference / (1000 * 60 * 60 * 24)) + 1;
8935
- };
8936
-
8937
- const getWeekHeaderDataFromWeekRange = (weekRange, maxWidth, dateFormatter) => weekRange.map(week => {
8938
- const numberOfDaysInScheduler = weekRange
8939
- .flatMap(element => {
8940
- return element.days;
8941
- })
8942
- .reduce((el1, el2) => {
8943
- return el1 + el2;
8944
- });
8945
- return {
8946
- formattedString: getStringForWeekRange(week, dateFormatter),
8947
- width: getWidthForWeekRange(maxWidth, week.days, numberOfDaysInScheduler)
8948
- };
8949
- });
8950
- const getStringForWeekRange = (weekRange, dateFormatter) => weekRange.days == 1
8951
- ? dateFormatter(weekRange.start)
8952
- : `${dateFormatter(weekRange.start)} - ${dateFormatter(weekRange.end)}`;
8953
- const getWidthForWeekRange = (maxWidth, weekDays, monthDays) => {
8954
- const dayWidth = maxWidth / monthDays;
8955
- return dayWidth * weekDays;
8956
- };
8957
-
8958
- // stringRange: `${formatter(date)} - ${formatter(end)}`,
8959
- const listOfDatesToWeekRangeList = (dates) => {
8960
- if (dates.length === 0) {
8961
- return [];
8962
- }
8963
- const datesToReturn = [];
8964
- dates.forEach((date, index) => {
8965
- const dayOfWeek = date.getDay();
8966
- const isFirstDay = index === 0;
8967
- const isLastDay = index === dates.length - 1;
8968
- const isSunday = dayOfWeek === 0;
8969
- const isMonday = dayOfWeek === 1;
8970
- if (isFirstDay && !isSunday) {
8971
- datesToReturn.push(createWeekRange(date, 8 - dayOfWeek));
8972
- return;
8973
- }
8974
- if (isLastDay && !isSunday) {
8975
- if (!isMonday) {
8976
- datesToReturn.pop();
8977
- }
8978
- const firstOfWeek = getFirstDayOfWeek(date);
8979
- datesToReturn.push(createWeekRange(firstOfWeek, dayOfWeek));
8980
- return;
8981
- }
8982
- if (isMonday) {
8983
- datesToReturn.push(createWeekRange(date, 7));
8984
- return;
8985
- }
8986
- // this is because sunday is 0
8987
- if (isFirstDay && isSunday) {
8988
- datesToReturn.push(createWeekRange(date, 1));
8989
- return;
8990
- }
8991
- });
8992
- return datesToReturn;
8993
- };
8994
- const createWeekRange = (start, days) => {
8995
- const end = new Date(start);
8996
- end.setDate(end.getDate() + days - 1);
8997
- return {
8998
- days,
8999
- start,
9000
- end,
9001
- isShortWeek: days < 7
9002
- };
9003
- };
9004
- const getFirstDayOfWeek = (date) => {
9005
- const currentDate = new Date(date);
9006
- const dayOfWeek = currentDate.getDay();
9007
- // dayOfWeek 0 == (Sunday)
9008
- const diffToMonday = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
9009
- // Set the date to the first day of the week
9010
- currentDate.setDate(currentDate.getDate() - diffToMonday);
9011
- return currentDate;
9012
- };
9013
-
9014
- const DayHeader = ({ index, text, width, headerType }) => {
9015
- const isFirstDay = index == 0;
9016
- return (jsxRuntime.jsx("td", { style: {
9017
- display: "inline-block",
9018
- fontSize: "10px",
9019
- width: width,
9020
- maxWidth: width,
9021
- }, id: headerType + index, children: jsxRuntime.jsx("span", { className: isFirstDay ? "cwelltFirstDate_desc" : "", children: text }) }));
9022
- };
9023
-
9024
- const MonthHeader = ({ index, text, width, headerType }) => {
9025
- return (jsxRuntime.jsx("td", { style: {
9026
- display: "inline-block",
9027
- fontSize: "10px",
9028
- width: width,
9029
- maxWidth: width,
9030
- }, id: headerType + index, children: jsxRuntime.jsx("span", { children: text }) }));
9031
- };
9032
-
9033
- const WeekHeader = ({ index, text, width, headerType }) => {
9034
- const isFirstDay = index == 0;
9035
- return (jsxRuntime.jsx("td", { style: {
9036
- display: "inline-block",
9037
- fontSize: "10px",
9038
- width: width,
9039
- maxWidth: width,
9040
- }, id: headerType + index, children: jsxRuntime.jsx("span", { className: isFirstDay ? "cwelltFirstDate_desc" : "", style: { whiteSpace: "nowrap" }, children: text }) }));
9041
- };
9042
-
9043
- const DaysHeader = ({ days, divisionType, maxWidth, headerType }) => {
9044
- let headerToDraw = [];
9045
- const filteredDays = days.filter((date) => {
9046
- return date.getHours() === 0;
9047
- });
9048
- const dateFormatter = (date) => {
9049
- return `${date.getDate()}.${date.getMonth() + 1}.${date.getFullYear()}`;
9050
- };
9051
- switch (divisionType) {
9052
- case "d":
9053
- {
9054
- headerToDraw = filteredDays.map((date, index) => {
9055
- return (jsxRuntime.jsx(DayHeader, { text: dateFormatter(date), index: index, width: maxWidth / filteredDays.length, headerType: headerType }, index));
9056
- });
9057
- }
9058
- break;
9059
- case "w":
9060
- {
9061
- const weekRanges = listOfDatesToWeekRangeList(filteredDays);
9062
- headerToDraw = getWeekHeaderDataFromWeekRange(weekRanges, maxWidth, dateFormatter).map((week, index) => {
9063
- return (jsxRuntime.jsx(WeekHeader, { index: index, text: week.formattedString, width: week.width, headerType: headerType }, index));
9064
- });
9065
- }
9066
- break;
9067
- case "m":
9068
- {
9069
- const monthData = getMonthHeaderData(filteredDays, maxWidth);
9070
- headerToDraw = monthData.map(({ monthFormatted, width }, index) => (jsxRuntime.jsx(MonthHeader, { index: index, text: monthFormatted, width: width, headerType: headerType }, index)));
9071
- }
9072
- break;
9073
- }
9074
- return jsxRuntime.jsx("tr", { className: "cwelltSchRowDate", children: headerToDraw });
9075
- };
9076
-
9077
- function formatHHmm(date) {
9078
- const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
9079
- const zdt = Temporal.Instant.fromEpochMilliseconds(date.getTime()).toZonedDateTimeISO(timeZone);
9080
- return `${zdt.hour.toString().padStart(2, "0")}:${zdt.minute.toString().padStart(2, "0")}`;
9081
- }
9082
- const getFormattedTimeForHeader = (calculatedDivType, calculatedDivision, timeHeader) => {
9083
- let showDate = "";
9084
- switch (calculatedDivType) {
9085
- case "d":
9086
- switch (calculatedDivision) {
9087
- case 8:
9088
- showDate =
9089
- timeHeader.getHours() === 0 ||
9090
- timeHeader.getHours() === 3 ||
9091
- timeHeader.getHours() === 6 ||
9092
- timeHeader.getHours() === 9 ||
9093
- timeHeader.getHours() === 12 ||
9094
- timeHeader.getHours() === 15 ||
9095
- timeHeader.getHours() === 18 ||
9096
- timeHeader.getHours() === 21
9097
- ? formatHHmm(timeHeader)
9098
- : "";
9099
- break;
9100
- case 3:
9101
- showDate =
9102
- timeHeader.getHours() === 0 || timeHeader.getHours() === 8 || timeHeader.getHours() === 16
9103
- ? formatHHmm(timeHeader)
9104
- : "";
9105
- break;
9106
- case 2:
9107
- showDate =
9108
- timeHeader.getHours() === 0 || timeHeader.getHours() === 12 ? formatHHmm(timeHeader) : "";
9109
- break;
9110
- }
9111
- break;
9112
- case "m":
9113
- showDate = timeHeader.getHours() === 0 ? timeHeader.getDate().toString() : "";
9114
- break;
9115
- case "w":
9116
- showDate = timeHeader.getHours() === 0 ? timeHeader.getDate().toString() : "";
9117
- break;
9118
- }
9119
- return {
9120
- text: showDate,
9121
- isWeekend: timeHeader.getDay() === 6 || timeHeader.getDay() === 0,
9122
- };
9123
- };
9124
-
9125
- const calculateDivisions = (start, end) => {
9126
- const diffDays = daysBetweenTwoDates(start, end);
9127
- if (diffDays <= 3) {
9128
- return 8;
9129
- }
9130
- else if (diffDays < 8) {
9131
- return 3;
9132
- }
9133
- else if (diffDays <= 15) {
9134
- return 2;
9135
- }
9136
- else {
9137
- return 1;
9138
- }
9139
- };
9140
-
9141
- const TimeHeader = ({ isWeekend, index, text, width, header }) => {
9142
- if (text === "") {
9143
- return;
9144
- }
9145
- const commonStyles = {
9146
- display: "flex",
9147
- alignItems: "center",
9148
- justifyContent: "left",
9149
- fontSize: "10px",
9150
- width: width,
9151
- maxWidth: width,
9152
- height: "30px",
9153
- borderLeft: "1px solid white",
9154
- background: isWeekend ? "#cbc9c9" : "",
9155
- color: "#000000d9",
9156
- fontWeight: 700,
9157
- };
9158
- return (jsxRuntime.jsx("td", { style: commonStyles, id: `${header}Time${index}`, children: jsxRuntime.jsx("span", { style: { paddingLeft: "8px" }, children: text }) }, `t${index}`));
9159
- };
9160
-
9161
- const TimeHeaderRow = ({ timeHeaders, startDate, endDate, maxWidth, header }) => {
9162
- const calculatedDivision = calculateDivisions(startDate, endDate);
9163
- const calculatedDivType = calculateDivisionType(startDate, endDate);
9164
- const formattedHeaders = timeHeaders.map((th) => {
9165
- return getFormattedTimeForHeader(calculatedDivType, calculatedDivision, th);
9166
- });
9167
- const filteredHeaders = formattedHeaders.filter((element) => element.text !== "");
9168
- return (jsxRuntime.jsx("tr", { className: "cwelltSchRowTime", style: { height: "30px" }, children: filteredHeaders.map(({ text, isWeekend }, index) => {
9169
- return (jsxRuntime.jsx(TimeHeader, { isWeekend: isWeekend, index: index, text: text, width: maxWidth / filteredHeaders.length, header: header }, index));
9170
- }) }));
9171
- };
9172
-
9173
- const SchedulerTimeLine = ({ maxPx, hoursList, startDate, endDate, pxPerHour, headerName, }) => {
9174
- return (jsxRuntime.jsx("table", { className: "content-area cwelltSchTable", style: { width: maxPx }, children: jsxRuntime.jsxs("tbody", { style: { width: "100%", borderSpacing: 0 }, className: "content-area cwelltSchTbody", children: [jsxRuntime.jsx(DaysHeader, { days: hoursList, divisionType: calculateDivisionType(startDate, endDate), maxWidth: pxPerHour * hoursList.length, headerType: headerName ?? "schedulerDateHeader" }), jsxRuntime.jsx(TimeHeaderRow, { timeHeaders: hoursList, startDate: startDate, endDate: endDate, maxWidth: pxPerHour * hoursList.length, header: headerName ?? "schedulerTimeHeader" })] }) }));
9175
- };
9176
-
9177
- const SchedulerHeader$1 = ({ timelineProps, descriptionColumn }) => {
9178
- const { maxPx, hoursList, startDate, endDate, pxPerHour, headerName } = timelineProps;
9179
- return (jsxRuntime.jsx("thead", { className: "cwellt_fc_header_scheduler", style: { position: "sticky", zIndex: 9 }, children: jsxRuntime.jsxs("tr", { className: "cwellt_fc_header_row", children: [jsxRuntime.jsxs("td", { className: "border", style: {
9180
- position: "sticky",
9181
- top: 0,
9182
- backgroundColor: "white",
9183
- width: "100px",
9184
- }, children: [jsxRuntime.jsx("div", { style: {
9185
- display: "flex",
9186
- height: "30px",
9187
- alignItems: "center",
9188
- width: "150px",
9189
- }, children: jsxRuntime.jsx("label", { children: headerName }) }), jsxRuntime.jsx("div", { style: {
9190
- display: "flex",
9191
- height: "30px",
9192
- alignItems: "center",
9193
- background: "rgba(0, 0, 0, 0.04)",
9194
- }, children: jsxRuntime.jsx("span", { children: descriptionColumn }) })] }), jsxRuntime.jsx("td", { style: {
9195
- position: "sticky",
9196
- top: 0,
9197
- zIndex: 6,
9198
- backgroundColor: "white",
9199
- }, children: jsxRuntime.jsx(SchedulerTimeLine, { maxPx: maxPx, hoursList: hoursList, pxPerHour: pxPerHour, startDate: startDate, endDate: endDate, headerName: headerName }) })] }) }));
9200
- };
9201
-
9202
- const daysBetweenTwoDatesIncludingBoth = (date1, date2) => {
9203
- const diff = Math.abs(date1.getTime() - date2.getTime());
9204
- const diffDays = diff / (1000 * 3600 * 24);
9205
- return diffDays;
9206
- };
9207
-
9208
- const getUtcToday = () => {
9209
- const now = new Date();
9210
- const userTimezoneOffset = now.getTimezoneOffset() * 60000;
9211
- const nowUtc = new Date(now.getTime() + userTimezoneOffset);
9212
- return nowUtc;
9213
- };
9214
-
9215
- const filterEvents = (events, start, end, id, module = undefined) => {
9216
- const datesCollide = (event) => event.start <= end && event.end >= start;
9217
- let eventsFiltered = events.filter(event => datesCollide(event));
9218
- if (id !== "flightWatchScheduler") {
9219
- eventsFiltered = sortByDate(eventsFiltered);
9220
- }
9221
- if (id !== "crewAssignmentsScheduler" && id !== "vacationsScheduler") {
9222
- return eventsFiltered;
9223
- }
9224
- eventsFiltered = setNotFullHeightEventsFirst(eventsFiltered);
9225
- if (module === "CrewControl") {
9226
- eventsFiltered = removeDuplicated(eventsFiltered, "Crew_Id");
9227
- }
9228
- if (module === "CrewScheduling") {
9229
- eventsFiltered = removeDuplicated(eventsFiltered, "AssignmentID");
9230
- }
9231
- if (module === "CrewSchedulingVacations") {
9232
- eventsFiltered = removeDuplicated(eventsFiltered, "ID");
9233
- }
9234
- return eventsFiltered;
9235
- };
9236
- const sortByDate = (events) => events.sort((a, b) => +new Date(a.start) - +new Date(b.start));
9237
- const removeDuplicated = (events, key) => {
9238
- return events.filter((obj, index, self) => index === self.findIndex(o => o.data[key] === obj.data[key] && o.data.subject === obj.data.subject));
9239
- };
9240
- const setNotFullHeightEventsFirst = (events) => {
9241
- const notFullHeight = [];
9242
- const isFullHeight = [];
9243
- events.forEach(element => {
9244
- element.isFullHeight ? notFullHeight.push(element) : isFullHeight.push(element);
9245
- });
9246
- return notFullHeight.concat(isFullHeight);
9247
- };
9248
-
9249
- const compareStrings = (str1, str2) => {
9250
- if (str1 > str2)
9251
- return 1;
9252
- if (str1 < str2)
9253
- return -1;
9254
- return 0;
9255
- };
9256
-
9257
- const filterResources = (module, resourceName, resources, groupByFunction, endDate, startDate, scheduleName) => {
9258
- if ((module === "CrewControl" || module === "CrewScheduling" || module === "CrewSchedulingVacations") &&
9259
- resourceName === "Employees") {
9260
- resources = resources.filter(c => (c.data.Eintritt === null || (new Date(c.data.Eintritt) <= endDate)) && (c.data.Austritt === null || (new Date(c.data.Austritt) >= startDate)));
9261
- }
9262
- if (scheduleName === "crewPinnedScheduler" || (module === "CrewControl" || module === "CrewScheduling") && resourceName === "Employees") {
9263
- const sortKey = (groupByFunction || scheduleName === "crewPinnedScheduler") ? "mainFunction" : "C3_LC";
9264
- resources = resources.sort((a, b) => compareStrings(a.data[sortKey], b.data[sortKey]));
9265
- }
9266
- return resources;
9267
- };
9268
-
9269
- const heightScheduler = (resources, visibleRows, isPinnerScheduler) => {
9270
- if (resources.length <= 0) {
9271
- return 100;
9272
- }
9273
- const realVisibleRows = visibleRows > resources.length ? resources.length : visibleRows;
9274
- const rowsHeight = resources.slice(0, realVisibleRows).map((row) => {
9275
- return row.maxTop;
9276
- });
9277
- const height = rowsHeight.reduce((sum, row) => {
9278
- return sum + row;
9279
- }, 0);
9280
- const headerHeight = isPinnerScheduler ? 0 : 60;
9281
- return height + headerHeight;
9282
- };
9283
-
9284
- const getLeftPixels = (eventStart, scheduleStart, dayPx) => {
9285
- if (scheduleStart >= eventStart)
9286
- return 0;
9287
- return daysBetweenTwoDatesIncludingBoth(scheduleStart, eventStart) * dayPx;
9288
- };
9289
- const getEventWithSize = (event, schedulerStart, dayPx) => {
9290
- const eventStartBeforeScheduleStart = event.start.getTime() < schedulerStart.getTime();
9291
- const lengthOfEvent = daysBetweenTwoDatesIncludingBoth(event.start, event.end);
9292
- const daysUntilSchedulerStart = daysBetweenTwoDatesIncludingBoth(event.start, schedulerStart);
9293
- const daysLong = eventStartBeforeScheduleStart ? lengthOfEvent - daysUntilSchedulerStart : lengthOfEvent;
9294
- // we want minimum of 8 px
9295
- const eventMinSize = 8;
9296
- const newEvent = {
9297
- ...event,
9298
- leftPx: getLeftPixels(event.start, schedulerStart, dayPx),
9299
- width: Math.max(daysLong * dayPx, eventMinSize),
9300
- };
9301
- return newEvent;
9302
- };
9303
-
9304
- const checkIfSlotAvailable = (events, event) => {
9305
- if (events.length == 0)
9306
- return true;
9307
- const collide = events.some(existent => {
9308
- return !(existent.end <= event.start || event.end <= existent.start) && !existent.isFullHeight;
9309
- });
9310
- return !collide;
9311
- };
9312
-
9313
- const getEventsInInnerRows = (res, eventHeight, dayPx, start) => {
9314
- let maxTop = 0;
9315
- const tops = [];
9316
- tops[0] = new Array();
9317
- res.events
9318
- .map((e) => {
9319
- return getEventWithSize(e, start, dayPx);
9320
- })
9321
- .forEach((event, i) => {
9322
- if (i === 0 || event.isFullHeight) {
9323
- event.top = 0;
9324
- tops[0].push(event);
9325
- }
9326
- else {
9327
- let found = false;
9328
- for (let j = 0; j < tops.length && found === false; j++) {
9329
- found = checkIfSlotAvailable(tops[j], event);
9330
- if (found === true || event.isFullHeight) {
9331
- event.top = j * eventHeight;
9332
- tops[j].push(event);
9333
- break;
9334
- }
9335
- }
9336
- if (found === false && !event.isFullHeight) {
9337
- maxTop++;
9338
- tops[maxTop] = new Array();
9339
- event.top = maxTop * eventHeight;
9340
- tops[maxTop].push(event);
9341
- }
9342
- else {
9343
- // This is for flightwatch
9344
- if (found === true && event.data.order === 2 && maxTop < 1) {
9345
- maxTop++;
9346
- tops[maxTop] = new Array();
9347
- event.top = maxTop * eventHeight;
9348
- tops[maxTop].push(event);
9349
- maxTop--;
9350
- }
9351
- }
9352
- }
9353
- });
9354
- return tops;
9355
- };
9356
-
9357
- const getTimeHeaders = (startDate, endDate) => {
9358
- const dateArray = new Array();
9359
- const currentDate = new Date(startDate);
9360
- const startOffset = Math.abs(startDate.getTimezoneOffset());
9361
- const endOffset = Math.abs(endDate.getTimezoneOffset());
9362
- // Summer: +1 -> +2, true
9363
- // Winter: +2 -> -1, false
9364
- const offsetSummerWinter = startOffset < endOffset;
9365
- if (offsetSummerWinter === true) {
9366
- while (currentDate < endDate) {
9367
- if (dateArray.length > 0) {
9368
- const lastPosition = dateArray[dateArray.length - 1];
9369
- const differenceHours = currentDate.getHours() - lastPosition.getHours();
9370
- if (differenceHours === 1 || differenceHours < 0) {
9371
- dateArray.push(new Date(currentDate));
9372
- }
9373
- else if (differenceHours > 1) {
9374
- dateArray.push(new Date(currentDate.getHours() - 1));
9375
- dateArray.push(new Date(currentDate));
9376
- }
9377
- }
9378
- else {
9379
- dateArray.push(new Date(currentDate));
9380
- }
9381
- currentDate.setHours(currentDate.getHours() + 1);
9382
- }
9383
- }
9384
- else {
9385
- while (currentDate < endDate) {
9386
- dateArray.push(new Date(currentDate));
9387
- currentDate.setHours(currentDate.getHours() + 1);
9388
- }
9389
- }
9390
- return dateArray;
9391
- };
9392
-
9393
- class CwScheduler extends React.Component {
9394
- contentArea;
9395
- calculateMaxPx = () => {
9396
- const mainElement = document.body;
9397
- const mainRect = mainElement.getBoundingClientRect();
9398
- return Math.floor(mainRect.width - 190);
9399
- };
9400
- constructor(props) {
9401
- super(props);
9402
- const maxPx = this.calculateMaxPx();
9403
- const timeHeaders = getTimeHeaders(props.startDate, props.endDate);
9404
- const dayPx = maxPx / Math.floor(daysBetweenTwoDates(props.startDate, props.endDate));
9405
- const hourPx = dayPx / 24;
9406
- const minutePx = dayPx / 1440;
9407
- window?.addEventListener("resize", this.handleResize);
9408
- const divisions = calculateDivisions(this.props.startDate, this.props.endDate);
9409
- const divisionsLeftPx = timeHeaders
9410
- .filter((_, index) => {
9411
- return index != 0 && index % (24 / divisions) == 0;
9412
- })
9413
- .map((date) => {
9414
- const daysDiff = daysBetweenTwoDatesIncludingBoth(date, props.startDate);
9415
- const pixels = daysDiff * 24 * hourPx;
9416
- return pixels;
9417
- });
9418
- this.state = {
9419
- maxPx: maxPx,
9420
- dayPx: dayPx,
9421
- hourPx: hourPx,
9422
- minutePx: minutePx,
9423
- timeHeaders: timeHeaders,
9424
- divisionsLeftPx: divisionsLeftPx,
9425
- eventHeight: 30,
9426
- resources: props.resources,
9427
- lineStyle: 0,
9428
- nowUtc: getUtcToday(),
9429
- division: divisions,
9430
- divisionType: "",
9431
- pinnedResources: props.pinnedResources ? props.pinnedResources : [],
9432
- selectedEvents: [],
9433
- showConsoleLogs: false, // Change to false to not show the console.log(...)
9434
- };
9435
- }
9436
- handleResize = () => {
9437
- const maxPx = this.calculateMaxPx();
9438
- const days = Math.floor(daysBetweenTwoDates(this.props.startDate, this.props.endDate));
9439
- const dayPx = maxPx / days;
9440
- const hourPx = dayPx / 24;
9441
- const updated = { ...this.state, maxPx: maxPx, hourPx: hourPx, dayPx: dayPx };
9442
- this.setState(updated);
9443
- };
9444
- objectsEqual = (o1, o2) => {
9445
- Object.keys(o1).length === Object.keys(o2).length && Object.keys(o1).every((p) => o1[p] === o2[p]);
9446
- };
9447
- objectsEqualDeep = (o1, o2) => typeof o1 === "object" && Object.keys(o1).length > 0
9448
- ? Object.keys(o1).length === Object.keys(o2).length &&
9449
- Object.keys(o1).every((p) => this.objectsEqual(o1[p], o2[p]))
9450
- : o1 === o2;
9451
- arraysEqual = (a1, a2) => a1.length === a2.length && a1.every((o, idx) => this.objectsEqualDeep(o, a2[idx]));
9452
- componentWillReceiveProps(_nextProps) {
9453
- if (this.state.showConsoleLogs) {
9454
- console.log("Schedule - componentWillReceiveProps, start: ", new Date());
9455
- console.log("Schedule - componentWillReceiveProps - has changes, start: ", new Date());
9456
- }
9457
- const dateChange = _nextProps.startDate.toISOString() !== this.props.startDate.toISOString() ||
9458
- _nextProps.endDate.toISOString() !== this.props.endDate.toISOString();
9459
- if (dateChange) {
9460
- const startDate = _nextProps.startDate;
9461
- const endDate = _nextProps.endDate;
9462
- const maxPx = this.calculateMaxPx();
9463
- const timeHeaders = getTimeHeaders(startDate, endDate);
9464
- const days = Math.floor(daysBetweenTwoDates(startDate, endDate));
9465
- const dayPx = maxPx / days;
9466
- const hourPx = dayPx / 24;
9467
- const minutePx = dayPx / 1440;
9468
- const now = getUtcToday();
9469
- const isInDateRange = now >= startDate && now <= endDate && this.contentArea !== undefined;
9470
- const lineStyle = isInDateRange ? daysBetweenTwoDatesIncludingBoth(startDate, now) * dayPx : 0;
9471
- const divisions = calculateDivisions(startDate, endDate);
9472
- const divisionsLeftPx = timeHeaders
9473
- .filter((_, index) => {
9474
- return index != 0 && index % (24 / divisions) == 0;
9475
- })
9476
- .map((date) => {
9477
- const daysDiff = daysBetweenTwoDatesIncludingBoth(date, startDate);
9478
- const pixels = daysDiff * dayPx;
9479
- return pixels;
9480
- });
9481
- this.setState({
9482
- maxPx: maxPx, // window.screen.width * 0.9,
9483
- dayPx: dayPx,
9484
- hourPx: hourPx,
9485
- minutePx: minutePx,
9486
- timeHeaders: timeHeaders,
9487
- divisionsLeftPx: divisionsLeftPx,
9488
- resources: this.getNewResources(_nextProps, dayPx),
9489
- lineStyle: lineStyle,
9490
- nowUtc: now,
9491
- division: divisions,
9492
- divisionType: "",
9493
- pinnedResources: this.props.pinnedResources ?? [],
9494
- });
9495
- if (this.state.showConsoleLogs) {
9496
- console.log("Schedule - componentWillReceiveProps - print on schedule, end: ", new Date());
9497
- console.log("Schedule - componentWillReceiveProps, end: ", new Date());
9498
- }
9499
- return;
9500
- }
9501
- const areSameEvents = this.arraysEqual(_nextProps.events, this.props.events);
9502
- const areSameRows = this.arraysEqual(_nextProps.resources, this.props.resources);
9503
- if (!areSameEvents || !areSameRows) {
9504
- const startDate = _nextProps.startDate;
9505
- const endDate = _nextProps.endDate;
9506
- const maxPx = this.calculateMaxPx();
9507
- const days = Math.floor(daysBetweenTwoDates(startDate, endDate));
9508
- const dayPx = maxPx / days;
9509
- this.setState({
9510
- resources: this.getNewResources(_nextProps, dayPx),
9511
- });
9512
- return;
9513
- }
9514
- }
9515
- getNewResources = (_nextProps, dayPx) => {
9516
- const mappedEvents = filterEvents(_nextProps.events, _nextProps.startDate, _nextProps.endDate, this.props.id, this.props.module)
9517
- .filter((event) => {
9518
- const outOfRange = event.end <= this.props.startDate || event.start >= this.props.endDate;
9519
- return !outOfRange;
9520
- });
9521
- const resources = filterResources(this.props.module, this.props.resourceName, _nextProps.resources, this.props.groupByFunction, _nextProps.endDate, _nextProps.startDate, this.props.id);
9522
- const newResources = resources
9523
- .map((resource) => {
9524
- return {
9525
- ...resource,
9526
- events: mappedEvents.filter((event) => event.resourceId === resource.id),
9527
- };
9528
- })
9529
- .map((resource) => {
9530
- const tops = getEventsInInnerRows(resource, this.state.eventHeight, dayPx, _nextProps.startDate);
9531
- const height = tops.length === 0 ? this.state.eventHeight : tops.length * this.state.eventHeight;
9532
- let flatMapEvents = [];
9533
- for (let h = 0; h < tops.length; h++) {
9534
- flatMapEvents = flatMapEvents.concat(tops[h]);
9535
- }
9536
- return {
9537
- ...resource,
9538
- maxTop: height,
9539
- events: flatMapEvents,
9540
- };
9541
- });
9542
- return newResources;
9543
- };
9544
- handleOnClickContextMenuResourceScheduler = (_clickEvent, _resource) => {
9545
- let datetime = new Date();
9546
- const _ca = this.contentArea;
9547
- if (_clickEvent.domEvent.currentTarget !== undefined) {
9548
- const leftPos = _clickEvent.domEvent.currentTarget.parentElement.getBoundingClientRect().left -
9549
- (_ca?.getBoundingClientRect()?.left ?? 0) -
9550
- window.scrollX;
9551
- datetime = addMinutesToDateFromPx(this.props.startDate, leftPos, this.state.minutePx);
9552
- }
9553
- if (this.props.scheduler_handleOnClickContextMenuResource) {
9554
- this.props.scheduler_handleOnClickContextMenuResource(datetime, _resource, _clickEvent.key, this.props.id);
9555
- }
9556
- };
9557
- handleCrewPinning = (resource, text) => {
9558
- if (this.props.scheduler_handlePinned) {
9559
- this.props.scheduler_handlePinned.call(this.props.parent, resource.id, text, this.props.id);
9560
- }
9561
- };
9562
- render() {
9563
- const isInDateRange = this.state.nowUtc >= this.props.startDate &&
9564
- this.state.nowUtc <= this.props.endDate &&
9565
- this.contentArea !== undefined;
9566
- const showTimeline = isInDateRange && this.state.lineStyle < this.state.maxPx;
9567
- const isPinnedTable = this.props.id.toLowerCase().includes("pinned");
9568
- const schedulerHeight = heightScheduler(this.state.resources, this.props.height, this.props.id === "crewAssignmentsScheduler");
9569
- return (jsxRuntime.jsx("div", { id: this.props.id, style: {
9570
- maxHeight: isPinnedTable ? "auto" : schedulerHeight,
9571
- }, className: this.state.resources.length > 0 ? "cwellt_tb_con" : "cwellt_tb_con cw_tb_con_emptyValues", children: jsxRuntime.jsxs("table", { id: "cwelltTableScheduler", children: [this.props.id !== "crewAssignmentsScheduler" && (jsxRuntime.jsx(SchedulerHeader$1, { timelineProps: {
9572
- maxPx: this.state.maxPx,
9573
- hoursList: this.state.timeHeaders,
9574
- pxPerHour: this.state.hourPx,
9575
- startDate: this.props.startDate,
9576
- endDate: this.props.endDate,
9577
- headerName: this.props.resourceName,
9578
- }, descriptionColumn: this.props.descriptionColumn })), jsxRuntime.jsx("tbody", { style: {
9579
- width: this.state.maxPx + 150,
9580
- maxHeight: isPinnedTable ? "auto" : schedulerHeight,
9581
- }, className: isPinnedTable ? "fc-body cw-fc-body-pinned" : "fc-body", children: jsxRuntime.jsxs("tr", { className: "fc_body_row", children: [jsxRuntime.jsx(ResourcesTitleList, { resources: this.state.resources, canBePinned: this.props.canBePinned ?? false, includesPinned: this.props.id.toLowerCase().includes("pinned"), onCrewPinning: this.handleCrewPinning, onClickResourceContextMenu: (_e, resource) => {
9582
- if (this.props.scheduler_handleOnClickResourceContextMenu) {
9583
- this.props.scheduler_handleOnClickResourceContextMenu(_e, resource);
9584
- }
9585
- }, ResourceTitleComponent: this.props.resourceComp }), jsxRuntime.jsx("td", { className: "dividerArea" }), jsxRuntime.jsx(SchedulerContentArea, { now: this.state.nowUtc, showTimeline: showTimeline, timeSeparatorLeftPx: this.state.divisionsLeftPx, timeLineLeftPx: this.state.lineStyle, resources: this.state.resources, contextMenuContents: this.props.resourceContextMenuContents, scheduler: this, onEmptyClick: this.props.scheduler_handleEmptyClick, setContentArea: (n) => (this.contentArea = n), onClickContextMenu: this.handleOnClickContextMenuResourceScheduler })] }) })] }) }));
9586
- }
9587
- }
9588
-
9589
8682
  function dateFromPercentage(startDate, visibleDays, percentage) {
9590
8683
  const start = Temporal.Instant.fromEpochMilliseconds(startDate.getTime());
9591
8684
  const spanMs = Math.round(visibleDays) * 24 * 60 * 60 * 1000;
@@ -9726,7 +8819,7 @@ class OnClickContextMenu {
9726
8819
  }
9727
8820
  }
9728
8821
 
9729
- var styles$3 = {"scheduler-header-divisions":"scheduler-header-module__scheduler-header-divisions__1JrNe","scheduler-timeline-now":"scheduler-header-module__scheduler-timeline-now__naREv","scheduler-timeline-label":"scheduler-header-module__scheduler-timeline-label__mLVAp","scheduler-header-title":"scheduler-header-module__scheduler-header-title__Jzy94","scheduler-dates":"scheduler-header-module__scheduler-dates__O7ePQ","current-day":"scheduler-header-module__current-day__FpHiv","scheduler-hours":"scheduler-header-module__scheduler-hours__ZDCVj"};
8822
+ var styles$3 = {"scheduler-header":"scheduler-header-module__scheduler-header__Y7SNV","scheduler-header-divisions":"scheduler-header-module__scheduler-header-divisions__1JrNe","scheduler-timeline-now":"scheduler-header-module__scheduler-timeline-now__naREv","scheduler-timeline-label":"scheduler-header-module__scheduler-timeline-label__mLVAp","scheduler-header-title":"scheduler-header-module__scheduler-header-title__Jzy94","scheduler-dates":"scheduler-header-module__scheduler-dates__O7ePQ","current-day":"scheduler-header-module__current-day__FpHiv","scheduler-hours":"scheduler-header-module__scheduler-hours__ZDCVj"};
9730
8823
 
9731
8824
  const getNow$1 = (isUtc) => {
9732
8825
  let now = new Date();
@@ -9792,7 +8885,7 @@ const HeaderTitle = ({ title, dividerText, width }) => {
9792
8885
  const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width, onEvent, timeLinePercentage, isUtc }) => {
9793
8886
  const topWidth = (100 / visibleDays);
9794
8887
  const { title, classification } = content;
9795
- return (jsxRuntime.jsxs("div", { style: { display: "flex" }, children: [jsxRuntime.jsx(HeaderTitle, { title: title, dividerText: classification, width: width }), jsxRuntime.jsxs("div", { className: styles$3["scheduler-header-divisions"], style: { flex: 1, display: "flex", position: "relative" }, onMouseDown: (e) => {
8888
+ return (jsxRuntime.jsxs("div", { className: styles$3["scheduler-header"], children: [jsxRuntime.jsx(HeaderTitle, { title: title, dividerText: classification, width: width }), jsxRuntime.jsxs("div", { className: styles$3["scheduler-header-divisions"], style: { flex: 1, display: "flex", position: "relative" }, onMouseDown: (e) => {
9796
8889
  e.preventDefault();
9797
8890
  const clickPercentage = getPercentageFromMouseEvent(e);
9798
8891
  const date = dateFromPercentage(selectedDate, visibleDays, clickPercentage);
@@ -10660,325 +9753,6 @@ const Scheduler = (props) => {
10660
9753
  class UiEvent {
10661
9754
  }
10662
9755
 
10663
- let topsCounter = 0;
10664
- class CwSuperScheduler extends React__namespace.Component {
10665
- constructor(Props) {
10666
- super(Props);
10667
- this.state = {
10668
- topsCalculated: 0,
10669
- height: 50,
10670
- dataConfig: this.props.dataConfig ? this.props.dataConfig : undefined,
10671
- pinnedResources: []
10672
- };
10673
- }
10674
- componentDidUpdate(_previousProps, _previousState) {
10675
- if (this.props.pinnedResources !== _previousProps.pinnedResources) {
10676
- let returnedTops = 0;
10677
- let returnedHeight = 50;
10678
- let data;
10679
- if (this.props.pinnedResources) {
10680
- const pinned = [...new Set(this.props.pinnedResources)];
10681
- for (let i = 0; i < pinned.length; i++) {
10682
- data = this.returnDynamicHeight(pinned[i], returnedTops);
10683
- returnedTops = data.topsCalculated;
10684
- returnedHeight = data.height;
10685
- }
10686
- this.setState({
10687
- topsCalculated: returnedTops,
10688
- height: returnedHeight !== 50 ? 80 + returnedHeight : 50,
10689
- pinnedResources: this.props.pinnedResources
10690
- });
10691
- }
10692
- }
10693
- }
10694
- scheduler_handleCblEventClick = (cblEvent, schedulerId) => {
10695
- this.props.scheduler_handleCblEventClick(cblEvent, schedulerId);
10696
- };
10697
- scheduler_handleCblEventClickRight = (cblEvent, schedulerId) => {
10698
- if (this.props.scheduler_handleCblEventClickRight) {
10699
- this.props.scheduler_handleCblEventClickRight(cblEvent, schedulerId);
10700
- }
10701
- };
10702
- scheduler_handleCblEventDoubleClick = (cblEvent, schedulerId) => {
10703
- this.props.scheduler_handleCblEventDoubleClick(cblEvent, schedulerId);
10704
- };
10705
- scheduler_handlePinnedClickMultipleIds = (resIds, schedulerId, requestString) => {
10706
- this.props.scheduler_handlePinningOfResources(resIds, "", schedulerId, requestString);
10707
- };
10708
- scheduler_handlePinnedClick = (resId, text, schedulerId) => {
10709
- const array = new Array();
10710
- array.push(resId);
10711
- this.props.scheduler_handlePinningOfResources(array, text, schedulerId, "resources");
10712
- };
10713
- returnDynamicHeight(pinned, topsCalculated) {
10714
- let height = 100;
10715
- let maxTop = 0;
10716
- const eventHeight = 30;
10717
- const tops = new Array();
10718
- tops[0] = new Array();
10719
- const diffDates = this.props.endDate.getTime() - this.props.startDate.getTime();
10720
- const diffDays = diffDates / (1000 * 3600 * 24);
10721
- const dateToFilter = new Date(this.props.startDate.getTime());
10722
- dateToFilter.setDate(dateToFilter.getDate() + diffDays);
10723
- let events = this.props.pinnedEvents !== undefined ? this.props.pinnedEvents : new Array();
10724
- events = events
10725
- .filter(x => pinned === x.resourceId && x.start >= this.props.startDate && x.start <= dateToFilter)
10726
- .sort((a, b) => {
10727
- return +new Date(a.start) - +new Date(b.start);
10728
- });
10729
- for (let i = 0; i < events.length; i++) {
10730
- const event = events[i];
10731
- if (i === 0 || event.isFullHeight) {
10732
- tops[0].push(event);
10733
- }
10734
- else {
10735
- let found = false;
10736
- for (let j = 0; j < tops.length && found === false; j++) {
10737
- found = this.checkIfSlotAvailable(tops[j], event);
10738
- if (found === true || event.isFullHeight) {
10739
- tops[j].push(event);
10740
- }
10741
- }
10742
- if (found === false) {
10743
- maxTop++;
10744
- tops[maxTop] = new Array();
10745
- tops[maxTop].push(event);
10746
- }
10747
- }
10748
- }
10749
- for (let h = 0; h < tops.length; h++) {
10750
- if (tops.length === 0) {
10751
- height = 100;
10752
- }
10753
- else {
10754
- height = (topsCalculated + tops.length) * eventHeight;
10755
- }
10756
- }
10757
- topsCounter = topsCounter + tops.length;
10758
- return {
10759
- topsCalculated: topsCalculated + tops.length,
10760
- height: height
10761
- };
10762
- }
10763
- checkIfSlotAvailable(array, event) {
10764
- let found = false;
10765
- if (array[array.length - 1].end <= event.start || array[array.length - 1].isFullHeight) {
10766
- found = true;
10767
- }
10768
- return found;
10769
- }
10770
- handleOnClickContextMenuResource = (date, resource, key, schedulerId) => {
10771
- let url = "";
10772
- switch (key) {
10773
- case "showReserves": {
10774
- // CrewControl
10775
- if (this.props.module === "CrewControl") {
10776
- url = "/Winops/CrewControl/CrewControlReact/GetCrewIdsOfReserve";
10777
- }
10778
- // CrewScheduling
10779
- if (this.props.module === "CrewScheduling") {
10780
- url = "/Winops/CrewPlanning/CrewPlanning/GetCrewIdsOfReserve";
10781
- }
10782
- const requestOptions = {
10783
- method: "POST",
10784
- headers: { "Content-Type": "application/json" },
10785
- body: JSON.stringify({
10786
- from: this.dateUTCString(this.props.startDate),
10787
- to: this.dateUTCString(this.props.endDate),
10788
- acftCategories: [],
10789
- functions: [],
10790
- clickedDate: this.dateUTCString(date),
10791
- airportSelected: this.props.airportSelected
10792
- })
10793
- };
10794
- if (this.state.dataConfig) {
10795
- fetch(this.state.dataConfig + url, requestOptions)
10796
- .then(response => response.json())
10797
- .then(res => {
10798
- if (res.length > 0) {
10799
- this.scheduler_handlePinnedClickMultipleIds(res, schedulerId, "Reserves");
10800
- }
10801
- else {
10802
- alert("No Reserves");
10803
- }
10804
- });
10805
- }
10806
- break;
10807
- }
10808
- case "showStandbys": {
10809
- // CrewControl
10810
- if (this.props.module === "CrewControl") {
10811
- url = "/Winops/CrewControl/CrewControlReact/GetCrewIdsOfStandby";
10812
- }
10813
- // CrewScheduling
10814
- if (this.props.module === "CrewScheduling") {
10815
- url = "/Winops/CrewPlanning/CrewPlanning/GetCrewIdsOfStandby";
10816
- }
10817
- const requestOptions2 = {
10818
- method: "POST",
10819
- headers: { "Content-Type": "application/json" },
10820
- body: JSON.stringify({
10821
- from: this.dateUTCString(this.props.startDate),
10822
- to: this.dateUTCString(this.props.startDate),
10823
- acftCategories: [],
10824
- functions: [],
10825
- clickedDate: this.dateUTCString(date),
10826
- airportSelected: this.props.airportSelected
10827
- })
10828
- };
10829
- if (this.state.dataConfig) {
10830
- fetch(this.state.dataConfig + url, requestOptions2)
10831
- .then(response => response.json())
10832
- .then(res => {
10833
- if (res.length > 0) {
10834
- this.scheduler_handlePinnedClickMultipleIds(res, schedulerId, "Standbys");
10835
- }
10836
- else {
10837
- alert("No Standbys");
10838
- }
10839
- });
10840
- }
10841
- break;
10842
- }
10843
- case "showAvailables": {
10844
- // CrewControl
10845
- if (this.props.module === "CrewControl") {
10846
- url = "/Winops/CrewControl/CrewControlReact/GetCrewIdsOfAvailables";
10847
- }
10848
- // CrewScheduling
10849
- if (this.props.module === "CrewScheduling") {
10850
- url = "/Winops/CrewPlanning/CrewPlanning/GetCrewIdsOfAvailables";
10851
- }
10852
- const requestOptions3 = {
10853
- method: "POST",
10854
- headers: { "Content-Type": "application/json" },
10855
- body: JSON.stringify({
10856
- from: this.dateUTCString(this.props.startDate),
10857
- to: this.dateUTCString(this.props.startDate),
10858
- acftCategories: [],
10859
- functions: [],
10860
- clickedDate: this.dateUTCString(date),
10861
- airportSelected: this.props.airportSelected
10862
- })
10863
- };
10864
- if (this.state.dataConfig) {
10865
- fetch(this.state.dataConfig + url, requestOptions3)
10866
- .then(response => response.json())
10867
- .then(res => {
10868
- if (res.length > 0) {
10869
- this.scheduler_handlePinnedClickMultipleIds(res, schedulerId, "Availables");
10870
- }
10871
- else {
10872
- alert("No Availables");
10873
- }
10874
- });
10875
- }
10876
- break;
10877
- }
10878
- default: {
10879
- if (this.props.scheduler_handleOnClickContextMenuResource) {
10880
- this.props.scheduler_handleOnClickContextMenuResource(date, resource, key);
10881
- }
10882
- break;
10883
- }
10884
- }
10885
- };
10886
- dateUTCString(date) {
10887
- if (date instanceof Date) {
10888
- if (date.getFullYear() > 1901)
10889
- return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes())).toISOString();
10890
- }
10891
- return date;
10892
- }
10893
- render() {
10894
- const havePinnedResources = this.state.pinnedResources?.length > 0;
10895
- const firstSchedulerResources = havePinnedResources
10896
- ? this.props.resourcesToPin.filter(x => this.state.pinnedResources.includes(x.id))
10897
- : new Array();
10898
- const secondSchedulerResources = this.props.resources.filter(x => !this.state.pinnedResources.includes(x.id));
10899
- const pinnedEvents = this.props.pinnedEvents !== undefined
10900
- ? this.props.pinnedEvents.filter(x => this.state.pinnedResources.includes(x.resourceId))
10901
- : new Array();
10902
- const notPinnedEvents = this.props.events.filter(x => !this.props.pinnedResources?.includes(x.resourceId));
10903
- return (jsxRuntime.jsxs("div", { className: "cwelltSuperScheduler_content", children: [jsxRuntime.jsx(CwScheduler, { id: "crewPinnedScheduler", events: pinnedEvents, resources: firstSchedulerResources, height: this.state.height, startDate: this.props.startDate, endDate: this.props.endDate, scheduler_handleCblEventClick: this.props.scheduler_handleCblEventClick, scheduler_handleCblEventClickRight: this.props.scheduler_handleCblEventClickRight, scheduler_handleCblEventDoubleClick: this.props.scheduler_handleCblEventDoubleClick, scheduler_handleOnDropCblEventsOnResource: this.props.scheduler_handleOnDropCblEventsOnResource, parent: this.props.parent, cblEventComp: this.props.cblEventComp, scheduler_handleOnClickEventContextMenu: this.props.scheduler_handleOnClickEventContextMenu, resourceComp: this.props.resourceComp, scheduler_handleOnClickContextMenuResource: this.props.scheduler_handleOnClickContextMenuResource, resourceContextMenuContents: this.props.resourceContextMenuContents, scheduler_handleDblClickOnResourceInScheduler: this.props.scheduler_handleDblClickOnResourceInScheduler, scheduler_handleEmptyClick: this.props.scheduler_handleEmptyClick, canBePinned: false, scheduler_handlePinned: this.scheduler_handlePinnedClick, resourceName: this.props.resourceName, descriptionColumn: this.props.descriptionColumn, scheduler_handleOnClickResourceContextMenu: this.props.scheduler_handleOnClickResourceContextMenu, groupByFunction: this.props.groupByFunction }), havePinnedResources && (jsxRuntime.jsx("div", { style: { padding: "0.5rem" }, children: jsxRuntime.jsx(CwButton, { text: "Clear", onClick: () => {
10904
- this.props.scheduler_handleClearPinnedOnParent();
10905
- } }) })), jsxRuntime.jsx(CwScheduler, { id: "crewAssignmentsScheduler", events: notPinnedEvents, resources: secondSchedulerResources, height: this.props.height, startDate: this.props.startDate, endDate: this.props.endDate, scheduler_handleCblEventClick: this.props.scheduler_handleCblEventClick, scheduler_handleCblEventClickRight: this.props.scheduler_handleCblEventClickRight, scheduler_handleCblEventDoubleClick: this.props.scheduler_handleCblEventDoubleClick, scheduler_handleOnDropCblEventsOnResource: this.props.scheduler_handleOnDropCblEventsOnResource, parent: this.props.parent, cblEventComp: this.props.cblEventComp, scheduler_handleOnClickEventContextMenu: this.props.scheduler_handleOnClickEventContextMenu, resourceComp: this.props.resourceComp, scheduler_handleOnClickContextMenuResource: this.handleOnClickContextMenuResource, resourceContextMenuContents: this.props.resourceContextMenuContents, scheduler_handleDblClickOnResourceInScheduler: this.props.scheduler_handleDblClickOnResourceInScheduler, scheduler_handleEmptyClick: this.props.scheduler_handleEmptyClick, canBePinned: true, scheduler_handlePinned: this.scheduler_handlePinnedClick, scheduler_handleCblEventResize: this.props.scheduler_handleCblEventResize, resourceName: this.props.resourceName, descriptionColumn: this.props.descriptionColumn, scheduler_handleOnClickResourceContextMenu: this.props.scheduler_handleOnClickResourceContextMenu, airportSelected: this.props.airportSelected, module: this.props.module, groupByFunction: this.props.groupByFunction })] }));
10906
- }
10907
- }
10908
- class CblDragAndDrop {
10909
- fromId;
10910
- toId;
10911
- data;
10912
- droppedOnDate;
10913
- resizeFromStart;
10914
- resizeFromEnd;
10915
- isCtrlKey;
10916
- constructor(fromId, toId, data, droppedOnDate = null, resizeFromStart = null, resizeFromEnd = null, isCtrlKey = null) {
10917
- this.fromId = fromId;
10918
- this.toId = toId;
10919
- this.data = data;
10920
- this.droppedOnDate = droppedOnDate;
10921
- this.resizeFromStart = resizeFromStart;
10922
- this.resizeFromEnd = resizeFromEnd;
10923
- this.isCtrlKey = isCtrlKey;
10924
- }
10925
- }
10926
-
10927
- const getGUID = () => {
10928
- return generateSegment(false) + generateSegment(true) + generateSegment(true) + generateSegment(false);
10929
- };
10930
- const generateSegment = (includeHyphens) => {
10931
- const p = (Math.random().toString(16) + "000000000").substring(2, 10);
10932
- return includeHyphens ? "-" + p.substring(0, 4) + "-" + p.substring(4, 8) : p;
10933
- };
10934
-
10935
- class cblEvent {
10936
- id = "";
10937
- start;
10938
- end;
10939
- resourceId;
10940
- selected = false;
10941
- top = 0;
10942
- leftPx = 0;
10943
- rightPx = 0;
10944
- width = 0;
10945
- isFullHeight = false;
10946
- isReadOnly = false;
10947
- isResizable = false;
10948
- isDraggable = false;
10949
- data = null;
10950
- constructor(start, end, resourceId, data = null, isFullHeight = false, isReadOnly = false, isResizable = false, isDraggable = false) {
10951
- this.start = start;
10952
- this.end = end;
10953
- this.resourceId = resourceId;
10954
- this.data = data;
10955
- this.isFullHeight = isFullHeight;
10956
- this.isReadOnly = isReadOnly;
10957
- this.isResizable = isResizable;
10958
- this.isDraggable = isDraggable;
10959
- this.id = getGUID();
10960
- }
10961
- }
10962
-
10963
- class Resource {
10964
- uid = "";
10965
- id;
10966
- name;
10967
- maxTop;
10968
- events = [];
10969
- isInViewport = false;
10970
- schedulerResourceDisplay;
10971
- isLoading = false;
10972
- data = null;
10973
- constructor(id, name, eventHeight, data = null, schedulerResourceDisplay = null) {
10974
- this.id = id;
10975
- this.name = name;
10976
- this.maxTop = eventHeight;
10977
- this.data = data;
10978
- this.schedulerResourceDisplay = schedulerResourceDisplay || this.name;
10979
- }
10980
- }
10981
-
10982
9756
  var styles = {"super-scheduler-row-header":"super-scheduler-module__super-scheduler-row-header__TTs4e","indicators":"super-scheduler-module__indicators__f4lIT","scheduler-crewmember-functions":"super-scheduler-module__scheduler-crewmember-functions__BS2hs"};
10983
9757
 
10984
9758
  class OnPinRow {
@@ -11461,7 +10235,6 @@ const CwFindCrewmember = ({ handleChange, placeHolder = "Search crew…", requir
11461
10235
  }, "data-direction": direction, children: [jsxRuntime.jsxs(CwAlign, { ...alignProps, itemProp: required ? "required" : "", children: [labelProps && (jsxRuntime.jsx(CwLabel, { ...labelProps, children: labelProps.text })), jsxRuntime.jsxs("div", { className: "cw-search-input-wrapper", ref: wrapperRef, children: [jsxRuntime.jsx("input", { ref: inputRef, type: "text", value: inputValue, onChange: handleInputChange, onKeyDown: handleKeyDown, onFocus: handleInputFocus, placeholder: isInitialLoading ? "Loading…" : placeHolder, disabled: disabled, required: required, autoComplete: "off", "aria-expanded": showDropdown, "aria-haspopup": "listbox", role: "combobox", title: tooltipText }), (isLoading || isInitialLoading) && (jsxRuntime.jsx("div", { className: "cw-search-input-loading", children: jsxRuntime.jsx(CwIcon, { iconId: "spinner" }) })), jsxRuntime.jsx("div", { className: "cw-search-input-icons", children: inputValue && !disabled && !isInitialLoading ? (jsxRuntime.jsx(CwButton, { type: "button", onClick: handleClear, "aria-label": "Clear selected crewmember", variant: "icon", icon: "close", color: "neutral" })) : (jsxRuntime.jsx(CwIcon, { iconId: "person" })) })] })] }), renderPanel(jsxRuntime.jsx("div", { ref: panelRef, className: dropdownStyles.dropdown, style: panelStyle, role: "listbox", children: jsxRuntime.jsx("ul", { children: options.map((option, index) => (jsxRuntime.jsx("li", { className: `${dropdownStyles.option}${index === highlightedIndex ? ` ${dropdownStyles.optionFocused}` : ""}`, onClick: () => handleOptionSelect(option.value), onMouseDown: (e) => e.preventDefault(), onMouseEnter: () => setHighlightedIndex(index), role: "option", "aria-selected": index === highlightedIndex, children: option.text }, option.value))) }) }))] }));
11462
10236
  };
11463
10237
 
11464
- exports.CblDragAndDrop = CblDragAndDrop;
11465
10238
  exports.CwAccordionContainer = CwAccordionContainer;
11466
10239
  exports.CwAlign = CwAlign;
11467
10240
  exports.CwAnchoredMenu = CwAnchoredMenu;
@@ -11528,17 +10301,17 @@ exports.CwNavMenu = CwNavMenu;
11528
10301
  exports.CwNote = CwNote;
11529
10302
  exports.CwOption = CwOption;
11530
10303
  exports.CwPopoverButton = CwPopoverButton;
10304
+ exports.CwProgress = CwProgress;
11531
10305
  exports.CwRadioGroup = CwRadioGroup;
11532
10306
  exports.CwReportModal = CwReportModal;
11533
- exports.CwScheduler = CwScheduler;
11534
10307
  exports.CwSearchAsync = CwSearchAsync;
11535
10308
  exports.CwSearchInput = CwSearchInput;
11536
10309
  exports.CwSelect = CwSelect;
11537
10310
  exports.CwSelectList = CwSelectList;
11538
10311
  exports.CwSelectListItems = CwSelectListItems;
10312
+ exports.CwSkeleton = CwSkeleton;
11539
10313
  exports.CwSortableList = CwSortableList;
11540
10314
  exports.CwSortableTable = CwSortableTable;
11541
- exports.CwSuperScheduler = CwSuperScheduler;
11542
10315
  exports.CwTable = CwTable;
11543
10316
  exports.CwTableGrouped = CwTableGrouped;
11544
10317
  exports.CwTableServerSide = CwTableServerSide;
@@ -11576,14 +10349,12 @@ exports.OnStartClickHeaderEvent = OnStartClickHeaderEvent;
11576
10349
  exports.OnUnpinRow = OnUnpinRow;
11577
10350
  exports.PRESET_LIBRARY_TEMPORAL = PRESET_LIBRARY_TEMPORAL;
11578
10351
  exports.PinRowHeader = PinRowHeader;
11579
- exports.Resource = Resource;
11580
10352
  exports.Scheduler = Scheduler;
11581
10353
  exports.SchedulerEvent = SchedulerEvent;
11582
10354
  exports.SuperScheduler = SuperScheduler;
11583
10355
  exports.TooltipConstraintContext = TooltipConstraintContext;
11584
10356
  exports.UiEvent = UiEvent;
11585
10357
  exports.Weekdays = Weekdays;
11586
- exports.cblEvent = cblEvent;
11587
10358
  exports.configureCwLoading = configureCwLoading;
11588
10359
  exports.eventIsVisible = eventIsVisible;
11589
10360
  exports.filterNavItems = filterNavItems;