@cwellt_software/cwellt-reactjs-lib 1.2.14 → 1.2.16

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 (272) hide show
  1. package/dist/deprecated/components/MultiSelect_deprecated_.d.ts +24 -0
  2. package/dist/deprecated/components/MultiSelect_deprecated_.d.ts.map +1 -0
  3. package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts +17 -0
  4. package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts.map +1 -0
  5. package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts +17 -0
  6. package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts.map +1 -0
  7. package/dist/deprecated/components/multiselect/CwMultiselect.d.ts +13 -0
  8. package/dist/deprecated/components/multiselect/CwMultiselect.d.ts.map +1 -0
  9. package/dist/deprecated/components/multiselect/CwOptionList.d.ts +14 -0
  10. package/dist/deprecated/components/multiselect/CwOptionList.d.ts.map +1 -0
  11. package/dist/deprecated/components/tag/CwTag.d.ts +15 -0
  12. package/dist/deprecated/components/tag/CwTag.d.ts.map +1 -0
  13. package/dist/index.cjs.js +116 -65
  14. package/dist/index.css +1 -1
  15. package/dist/index.d.ts +35 -2
  16. package/dist/index.es.js +116 -66
  17. package/dist/src/components/control/action/button/CwPopoverButton.d.ts +33 -0
  18. package/dist/src/components/control/action/button/CwPopoverButton.d.ts.map +1 -0
  19. package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts +19 -0
  20. package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts.map +1 -0
  21. package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts +21 -0
  22. package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts.map +1 -0
  23. package/dist/src/components/control/choice/dropdown/CwPopoverButton.d.ts +35 -0
  24. package/dist/src/components/control/choice/dropdown/CwPopoverButton.d.ts.map +1 -0
  25. package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts +47 -0
  26. package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts.map +1 -0
  27. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +1 -12
  28. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +1 -1
  29. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +1 -11
  30. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +1 -1
  31. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +1 -1
  32. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +1 -1
  33. package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +1 -1
  34. package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +1 -1
  35. package/dist/src/index.d.ts +1 -0
  36. package/dist/src/index.d.ts.map +1 -1
  37. package/package.json +2 -2
  38. package/dist/src/common/classes/CwSelectList.js +0 -12
  39. package/dist/src/common/classes/CwSelectListItems.js +0 -14
  40. package/dist/src/common/functions/collections.js +0 -18
  41. package/dist/src/common/functions/colorManipulation.js +0 -76
  42. package/dist/src/common/functions/dsl/UiEventDSL.js +0 -20
  43. package/dist/src/common/functions/useSingleAndDoubleClicks.js +0 -28
  44. package/dist/src/common/interfaces/CwSelectListProps.js +0 -1
  45. package/dist/src/components/control/action/button/CwButton.js +0 -13
  46. package/dist/src/components/control/action/buttons/CwButtons.js +0 -188
  47. package/dist/src/components/control/action/contextmenu/CwContextMenu.js +0 -43
  48. package/dist/src/components/control/action/contextual-menu/CwContextualMenu.js +0 -55
  49. package/dist/src/components/control/action/search/CwSearch.js +0 -67
  50. package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.js +0 -11
  51. package/dist/src/components/control/choice/checkbox/CwCheckbox.js +0 -15
  52. package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.js +0 -99
  53. package/dist/src/components/control/choice/dropdown/CwDropdown.js +0 -27
  54. package/dist/src/components/control/choice/dropdown/CwDropdownContainer.js +0 -30
  55. package/dist/src/components/control/choice/dropdown/CwDropdownFilter.js +0 -10
  56. package/dist/src/components/control/choice/multi-filter/CwMultiFilter.js +0 -298
  57. package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.js +0 -17
  58. package/dist/src/components/control/choice/multiselect/CwHeadFilter.js +0 -80
  59. package/dist/src/components/control/choice/multiselect/CwMultiselect.js +0 -393
  60. package/dist/src/components/control/choice/multiselect/CwOptionList.js +0 -36
  61. package/dist/src/components/control/choice/option/CwOption.js +0 -16
  62. package/dist/src/components/control/choice/select/CwSelect.js +0 -36
  63. package/dist/src/components/control/choice/toggle/CwToggle.js +0 -9
  64. package/dist/src/components/control/input/any/CwInput.js +0 -16
  65. package/dist/src/components/control/input/color/CwColorPicker.js +0 -210
  66. package/dist/src/components/control/input/color/CwInputColor.js +0 -142
  67. package/dist/src/components/control/input/date/CwInputDate.js +0 -29
  68. package/dist/src/components/control/input/date-picker/CwInputDatePicker.js +0 -109
  69. package/dist/src/components/control/input/date-text/CwInputDateText.js +0 -90
  70. package/dist/src/components/control/input/datetime/CwInputDatetime.js +0 -29
  71. package/dist/src/components/control/input/digit/CwDigit.js +0 -28
  72. package/dist/src/components/control/input/file/CwFileUpload.js +0 -52
  73. package/dist/src/components/control/input/file/CwFileUploadMultiple.js +0 -148
  74. package/dist/src/components/control/input/image/CwInputImage.js +0 -52
  75. package/dist/src/components/control/input/image-area/CwImageArea.js +0 -113
  76. package/dist/src/components/control/input/new-dates/example.d.ts +0 -2
  77. package/dist/src/components/control/input/new-dates/example.d.ts.map +0 -1
  78. package/dist/src/components/control/input/number/CwInputNumber.js +0 -11
  79. package/dist/src/components/control/input/phone/CwInputPhone.js +0 -24
  80. package/dist/src/components/control/input/text/CwInputText.js +0 -31
  81. package/dist/src/components/control/input/text-area/CwTextArea.js +0 -9
  82. package/dist/src/components/control/input/time/CwTime.js +0 -29
  83. package/dist/src/components/control/input/weekday/CwWeekdaySelector.js +0 -143
  84. package/dist/src/components/custom/find-airport/CwFindAirportComp.js +0 -240
  85. package/dist/src/components/custom/scheduler/CwSchedulerComp.js +0 -211
  86. package/dist/src/components/custom/scheduler/CwSuperSchedulerComp.js +0 -269
  87. package/dist/src/components/custom/scheduler/components/EventRender.js +0 -142
  88. package/dist/src/components/custom/scheduler/components/ResourceListRender.js +0 -12
  89. package/dist/src/components/custom/scheduler/components/ResourceRender.js +0 -26
  90. package/dist/src/components/custom/scheduler/components/day_headers/DayHeader.js +0 -13
  91. package/dist/src/components/custom/scheduler/components/day_headers/MonthHeader.js +0 -12
  92. package/dist/src/components/custom/scheduler/components/day_headers/MyDaysHeader.js +0 -62
  93. package/dist/src/components/custom/scheduler/components/day_headers/WeekHeader.js +0 -13
  94. package/dist/src/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.js +0 -24
  95. package/dist/src/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.js +0 -17
  96. package/dist/src/components/custom/scheduler/components/scheduler_header/SchedulerHeader.js +0 -26
  97. package/dist/src/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.js +0 -23
  98. package/dist/src/components/custom/scheduler/components/time_headers/TimeHeader.js +0 -31
  99. package/dist/src/components/custom/scheduler/components/time_headers/TimeHeaderRow.js +0 -16
  100. package/dist/src/components/custom/scheduler/components/time_line/TimeLine.js +0 -12
  101. package/dist/src/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.js +0 -5
  102. package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDates.js +0 -15
  103. package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.js +0 -5
  104. package/dist/src/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.js +0 -43
  105. package/dist/src/components/custom/scheduler/logic/dates/getMonthHeaderData.js +0 -35
  106. package/dist/src/components/custom/scheduler/logic/dates/getUtcToday.js +0 -6
  107. package/dist/src/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.js +0 -20
  108. package/dist/src/components/custom/scheduler/logic/dates/listOfDatesToWeeks.js +0 -55
  109. package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisionType.js +0 -13
  110. package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisions.js +0 -16
  111. package/dist/src/components/custom/scheduler/logic/filtering/filterEvents.js +0 -33
  112. package/dist/src/components/custom/scheduler/logic/filtering/filterResources.js +0 -14
  113. package/dist/src/components/custom/scheduler/logic/filtering/hasSameProperties.js +0 -10
  114. package/dist/src/components/custom/scheduler/logic/onDrop/OnDrop.js +0 -45
  115. package/dist/src/components/custom/scheduler/logic/pixels/getHeightLineScheduler.js +0 -14
  116. package/dist/src/components/custom/scheduler/logic/pixels/getPixelsForEvent.js +0 -32
  117. package/dist/src/components/custom/scheduler/logic/pixels/heightScheduler.js +0 -14
  118. package/dist/src/components/custom/scheduler/logic/pixels/heightSchedulerPinned.js +0 -9
  119. package/dist/src/components/custom/scheduler/logic/state_handle/doubleClickOnResource.js +0 -5
  120. package/dist/src/components/custom/scheduler/logic/state_handle/handleResourceChange.js +0 -11
  121. package/dist/src/components/custom/scheduler/logic/state_handle/onDragOver.js +0 -9
  122. package/dist/src/components/custom/scheduler/logic/state_handle/onDropEventToResource.js +0 -3
  123. package/dist/src/components/custom/scheduler/logic/strings/compareStrings.js +0 -7
  124. package/dist/src/components/custom/scheduler/logic/strings/getGUID.js +0 -7
  125. package/dist/src/components/custom/scheduler/logic/ui/checkIfSlotAvailable.js +0 -8
  126. package/dist/src/components/custom/scheduler/logic/ui/getEventsOfResource.js +0 -45
  127. package/dist/src/components/custom/scheduler/logic/ui/getTimeHeaders.js +0 -35
  128. package/dist/src/components/custom/scheduler/logic/ui/isAllowedToMove.js +0 -19
  129. package/dist/src/components/custom/scheduler/logic/ui/updateResourceVisibility.js +0 -15
  130. package/dist/src/components/custom/scheduler/state/CblDragAndDrop.js +0 -18
  131. package/dist/src/components/custom/scheduler/state/CwSchedulerProps.js +0 -1
  132. package/dist/src/components/custom/scheduler/state/Resource.js +0 -18
  133. package/dist/src/components/custom/scheduler/state/State.js +0 -1
  134. package/dist/src/components/custom/scheduler/state/cblEvent.js +0 -28
  135. package/dist/src/components/custom/scheduler/state/cblEventCompProps.js +0 -1
  136. package/dist/src/components/custom/scheduler/state/resourceCompProps2.js +0 -1
  137. package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.js +0 -123
  138. package/dist/src/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.js +0 -118
  139. package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.js +0 -166
  140. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.js +0 -26
  141. package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.js +0 -8
  142. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.js +0 -86
  143. package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.js +0 -1
  144. package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.js +0 -60
  145. package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.js +0 -24
  146. package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.js +0 -150
  147. package/dist/src/components/custom/scheduler-new/presentation/components/row/EventSideDrag.js +0 -11
  148. package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.js +0 -176
  149. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.js +0 -8
  150. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.js +0 -39
  151. package/dist/src/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.js +0 -8
  152. package/dist/src/components/custom/scheduler-new/presentation/helpers.js +0 -43
  153. package/dist/src/components/custom/scheduler-new/presentation/logic/WeekendCalc.js +0 -24
  154. package/dist/src/components/custom/scheduler-new/presentation/logic/dateFromPercentage.js +0 -7
  155. package/dist/src/components/custom/scheduler-new/presentation/logic/eventIsVisible.js +0 -7
  156. package/dist/src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.js +0 -113
  157. package/dist/src/components/custom/scheduler-new/presentation/logic/getDivisions.js +0 -21
  158. package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizes.js +0 -30
  159. package/dist/src/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.js +0 -13
  160. package/dist/src/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.js +0 -7
  161. package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.js +0 -32
  162. package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.js +0 -12
  163. package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerState.js +0 -1
  164. package/dist/src/components/custom/scheduler-new/presentation/state/ui/WeekRange.js +0 -1
  165. package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.js +0 -267
  166. package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.js +0 -269
  167. package/dist/src/components/custom/scheduler-temporal/components/EventRender.js +0 -142
  168. package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.js +0 -12
  169. package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.js +0 -26
  170. package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.js +0 -13
  171. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.js +0 -12
  172. package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.js +0 -62
  173. package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.js +0 -13
  174. package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.js +0 -22
  175. package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.js +0 -17
  176. package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.js +0 -26
  177. package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.js +0 -23
  178. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.js +0 -31
  179. package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.js +0 -16
  180. package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.js +0 -12
  181. package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.js +0 -5
  182. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.js +0 -15
  183. package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.js +0 -5
  184. package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.js +0 -43
  185. package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.js +0 -35
  186. package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.js +0 -6
  187. package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.js +0 -20
  188. package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.js +0 -55
  189. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.js +0 -13
  190. package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.js +0 -16
  191. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.js +0 -10
  192. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.js +0 -34
  193. package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.js +0 -14
  194. package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.js +0 -10
  195. package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.js +0 -36
  196. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.js +0 -14
  197. package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.js +0 -32
  198. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.js +0 -14
  199. package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.js +0 -9
  200. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.js +0 -5
  201. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.js +0 -178
  202. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.js +0 -11
  203. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.js +0 -9
  204. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.js +0 -3
  205. package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.js +0 -3
  206. package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.js +0 -7
  207. package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.js +0 -7
  208. package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.js +0 -9
  209. package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.js +0 -92
  210. package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.js +0 -242
  211. package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.js +0 -35
  212. package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.js +0 -19
  213. package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.js +0 -241
  214. package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.js +0 -15
  215. package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.js +0 -18
  216. package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.js +0 -1
  217. package/dist/src/components/custom/scheduler-temporal/state/Resource.js +0 -18
  218. package/dist/src/components/custom/scheduler-temporal/state/State.js +0 -1
  219. package/dist/src/components/custom/scheduler-temporal/state/cblEvent.js +0 -28
  220. package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.js +0 -1
  221. package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.js +0 -1
  222. package/dist/src/components/custom/super-scheduler/PinRowHeader.js +0 -53
  223. package/dist/src/components/custom/super-scheduler/SuperScheduler.js +0 -23
  224. package/dist/src/components/custom/super-scheduler/SuperSchedulerEvents.js +0 -15
  225. package/dist/src/components/custom/super-scheduler/SuperSchedulerPresenter.js +0 -45
  226. package/dist/src/components/display/data/accordion/CwAccordionContainer.js +0 -20
  227. package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.js +0 -138
  228. package/dist/src/components/display/data/table/CwTable.js +0 -203
  229. package/dist/src/components/display/graphics/icon/CwIcon.js +0 -23
  230. package/dist/src/components/display/graphics/loading/CwLoading.js +0 -27
  231. package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.js +0 -20
  232. package/dist/src/components/display/text/heading/CwHeadingMain.js +0 -5
  233. package/dist/src/components/display/text/heading/CwHeadingSecond.js +0 -5
  234. package/dist/src/components/display/text/label/CwLabel.js +0 -13
  235. package/dist/src/components/display/text/message/CwMessage.js +0 -75
  236. package/dist/src/components/display/text/note/CwNote.js +0 -78
  237. package/dist/src/components/display/text/tag/CwChip.js +0 -57
  238. package/dist/src/components/display/text/tag/CwTag.js +0 -21
  239. package/dist/src/components/display/text/tooltip/CwTooltip.js +0 -4
  240. package/dist/src/components/layout/align/CwAlign.js +0 -54
  241. package/dist/src/components/layout/card/CwCard.js +0 -55
  242. package/dist/src/components/layout/card/CwCardList.js +0 -38
  243. package/dist/src/components/layout/dialog/CwDialog.js +0 -255
  244. package/dist/src/components/layout/dialog/CwDialogManager.js +0 -44
  245. package/dist/src/components/layout/list/details/CwExpandable.js +0 -28
  246. package/dist/src/components/layout/list/key-value/CwKeyValueList.js +0 -23
  247. package/dist/src/components/layout/list/sortable/CwSortableList.js +0 -73
  248. package/dist/src/components/layout/list/sortable/useSortableList.js +0 -53
  249. package/dist/src/components/layout/modal/CwModalReportFunctional.js +0 -23
  250. package/dist/src/components/layout/modal/hover/CwModalHover.js +0 -61
  251. package/dist/src/components/layout/modal/legacy/cw_modal.js +0 -44
  252. package/dist/src/components/layout/modal/legacy/cw_modal_confirm.js +0 -39
  253. package/dist/src/components/layout/modal/legacy/cw_modal_iframe.js +0 -44
  254. package/dist/src/components/layout/modal/legacy/cw_modal_report.js +0 -26
  255. package/dist/src/components/layout/table/grouped/CwTableGrouped.js +0 -70
  256. package/dist/src/components/layout/tabs/CwTabs.js +0 -53
  257. package/dist/src/index.js +0 -187
  258. package/dist/test/components/custom/new-scheduler/presentation/logic/getDefaultDivisions.test.js +0 -48
  259. package/dist/test/components/custom/new-scheduler/presentation/logic/hoursBetween.test.js +0 -15
  260. package/dist/test/components/custom/new-scheduler/presentation/logic/monthDivisions.test.js +0 -42
  261. package/dist/test/components/custom/new-scheduler/presentation/logic/weekendCalc.test.js +0 -30
  262. package/dist/test/components/custom/scheduler/addMinutesToDateFromPx.test.js +0 -43
  263. package/dist/test/components/custom/scheduler/checkIfSlotAvailable.test.js +0 -30
  264. package/dist/test/components/custom/scheduler/daysBetweenTwoDates.test.js +0 -61
  265. package/dist/test/components/custom/scheduler/daysBetweenTwoDatesWithoutCeilForEvent.test.js +0 -27
  266. package/dist/test/components/custom/scheduler/getGUID.test.js +0 -30
  267. package/dist/test/components/custom/scheduler/getPixelsForEvent.test.js +0 -38
  268. package/dist/test/components/custom/scheduler/getTimeHeaders.test.js +0 -35
  269. package/dist/test/components/custom/scheduler/hasSameProperties.test.js +0 -51
  270. package/dist/test/components/custom/scheduler/isAllowedToMove.test.js +0 -28
  271. package/dist/test/components/custom/scheduler/listOfDatesToWeeks.test.js +0 -72
  272. package/dist/test/jest.setup.js +0 -1
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
3
- export function CwFileUpload(fileUploadProps) {
4
- const [previewURL, setPreviewURL] = useState("");
5
- const [error, setError] = useState(null);
6
- const [_selectedFileName, setSelectedFileName] = useState("");
7
- const [_currentHexContent, setCurrentHexContent] = useState("");
8
- useEffect(() => {
9
- // If there is hexadecimal preview content, set the Preview URL
10
- if (fileUploadProps.file?.Bindata) {
11
- setPreviewURL(`data:image/png;base64,${fileUploadProps.file.Bindata}`);
12
- }
13
- }, [fileUploadProps.file?.Bindata]);
14
- const handleFileChange = (event) => {
15
- const file = event.target.files?.[0];
16
- setSelectedFileName(file?.name ?? "");
17
- if (file) {
18
- const allowedExts = fileUploadProps.accept.split(',').map(ext => ext.trim().replace('.', '').toLowerCase());
19
- const fileExt = file.name.split('.').pop()?.toLowerCase() ?? "";
20
- if (!allowedExts.includes(fileExt)) {
21
- setError(`Invalid file type. Only ${fileUploadProps.acceptString} files are allowed.`);
22
- setPreviewURL("");
23
- return;
24
- }
25
- setError(null);
26
- const reader = new FileReader();
27
- reader.onloadend = () => {
28
- if (typeof reader.result === "string") {
29
- const hexContent = arrayBufferToHex(reader.result);
30
- setCurrentHexContent(hexContent);
31
- setPreviewURL(reader.result);
32
- setCurrentHexContent(arrayBufferToHex(reader.result));
33
- // Call function to store hexadecimal content
34
- fileUploadProps.onSaveHexContent(arrayBufferToHex(reader.result));
35
- }
36
- };
37
- reader.readAsDataURL(file);
38
- }
39
- };
40
- // Function to convert the image buffer into hexadecimal content
41
- const arrayBufferToHex = (dataUrl) => {
42
- // Decodes the base64 of the URL data
43
- const base64 = dataUrl.split(",")[1];
44
- const binary = atob(base64);
45
- let hex = "";
46
- for (let i = 0; i < binary.length; i++) {
47
- hex += binary.charCodeAt(i).toString(16).padStart(2, "0");
48
- }
49
- return hex;
50
- };
51
- return (_jsxs("div", { children: [_jsxs("div", { className: "row", children: [_jsx("input", { className: "cw-button", type: "file", accept: fileUploadProps.accept, readOnly: true, placeholder: "No file selected...", onChange: handleFileChange }), previewURL && (_jsx("div", { className: "row", children: _jsx("img", { src: previewURL, alt: "Preview", style: { maxWidth: "200px", maxHeight: "200px" } }) }))] }), error && _jsx("div", { className: "row error", children: error }), _jsx("div", { className: "row", children: _jsxs("label", { children: ["Please note: File/image has to be in ", fileUploadProps.acceptString, " format", fileUploadProps.sizeString && `, ${fileUploadProps.sizeString}`] }) })] }));
52
- }
@@ -1,148 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useState } from 'react';
3
- import { CwIcon } from '../../../display/graphics/icon/CwIcon';
4
- import { CwButton } from '../../action/button/CwButton';
5
- import styles from "./cw-file-upload-multiple.module.css";
6
- export function CwFileUploadMultiple(fileUploadProps) {
7
- const fileInputRef = useRef(null);
8
- const [selectedFiles, setSelectedFiles] = useState([]);
9
- const getFileExtension = (filename) => {
10
- return filename.split('.').pop()?.toUpperCase() || '';
11
- };
12
- const validateFile = (file) => {
13
- // Validate the size of the file
14
- if (fileUploadProps.maxFileSize) {
15
- const fileSizeInMB = file.size / (1024 * 1024);
16
- if (fileSizeInMB > fileUploadProps.maxFileSize) {
17
- return {
18
- isValid: false,
19
- error: `File "${file.name}" is too large. Maximum size allowed is ${fileUploadProps.maxFileSize}MB.`
20
- };
21
- }
22
- }
23
- // Validate file type by extension (based in accept)
24
- if (fileUploadProps.accept) {
25
- const acceptedExtensions = fileUploadProps.accept.split(',').map(ext => ext.trim().toLowerCase());
26
- const fileExtension = '.' + file.name.split('.').pop()?.toLowerCase();
27
- const isExtensionValid = acceptedExtensions.some(ext => {
28
- if (ext.startsWith('.')) {
29
- return ext === fileExtension;
30
- }
31
- return false;
32
- });
33
- if (!isExtensionValid) {
34
- return {
35
- isValid: false,
36
- error: `File "${file.name}" has an invalid format. Allowed formats: ${fileUploadProps.accept}`
37
- };
38
- }
39
- }
40
- // Validate MIME type if specified
41
- if (fileUploadProps.allowedTypes && fileUploadProps.allowedTypes.length > 0) {
42
- const isMimeTypeValid = fileUploadProps.allowedTypes.includes(file.type);
43
- if (!isMimeTypeValid) {
44
- return {
45
- isValid: false,
46
- error: `File "${file.name}" has an invalid MIME type. Allowed types: ${fileUploadProps.allowedTypes.join(', ')}`
47
- };
48
- }
49
- }
50
- return { isValid: true };
51
- };
52
- const processFiles = (files, existingFiles = []) => {
53
- const fileArray = Array.from(files);
54
- const validFiles = [...existingFiles]; // Start with existing files
55
- const errors = [];
56
- for (const file of fileArray) {
57
- // Check if the file already exists (by name and size)
58
- const isDuplicate = existingFiles.some(existingFile => existingFile.name === file.name && existingFile.size === file.size);
59
- if (isDuplicate) {
60
- errors.push(`File "${file.name}" is already selected.`);
61
- continue;
62
- }
63
- const validation = validateFile(file);
64
- if (!validation.isValid) {
65
- errors.push(validation.error);
66
- continue;
67
- }
68
- validFiles.push(file);
69
- }
70
- // Show errors if any
71
- if (errors.length > 0) {
72
- if (fileUploadProps.onError) {
73
- fileUploadProps.onError(errors.join('\n'));
74
- }
75
- else {
76
- console.error(errors.join('\n'));
77
- alert(errors.join('\n')); // Fallback if there is no onError
78
- }
79
- }
80
- // If not multiple, only take the first valid file (replace)
81
- if (!fileUploadProps.multiple && validFiles.length > 1) {
82
- return [validFiles[validFiles.length - 1]]; // Take the last file added
83
- }
84
- return validFiles;
85
- };
86
- const updateFileInput = (files) => {
87
- // Create FileList with all files
88
- const dataTransfer = new DataTransfer();
89
- files.forEach(file => dataTransfer.items.add(file));
90
- if (fileInputRef.current) {
91
- fileInputRef.current.files = dataTransfer.files;
92
- }
93
- if (fileUploadProps.onSelect) {
94
- fileUploadProps.onSelect(dataTransfer.files);
95
- }
96
- };
97
- const handleFileSelect = (event) => {
98
- const files = event.target.files;
99
- if (files && files.length > 0) {
100
- const updatedFiles = processFiles(files, selectedFiles);
101
- if (updatedFiles.length > selectedFiles.length || !fileUploadProps.multiple) {
102
- setSelectedFiles(updatedFiles);
103
- updateFileInput(updatedFiles);
104
- }
105
- else {
106
- // Clear input if no new valid files were added
107
- if (fileInputRef.current) {
108
- fileInputRef.current.value = '';
109
- }
110
- }
111
- }
112
- };
113
- const removeFile = (indexToRemove) => {
114
- const newFiles = selectedFiles.filter((_, index) => index !== indexToRemove);
115
- setSelectedFiles(newFiles);
116
- updateFileInput(newFiles);
117
- };
118
- const removeAllFiles = () => {
119
- setSelectedFiles([]);
120
- if (fileInputRef.current) {
121
- fileInputRef.current.value = '';
122
- }
123
- if (fileUploadProps.onSelect) {
124
- fileUploadProps.onSelect(null);
125
- }
126
- };
127
- const handleButtonClick = () => {
128
- fileInputRef.current?.click();
129
- };
130
- const handleDragOver = (event) => {
131
- event.preventDefault();
132
- event.stopPropagation();
133
- };
134
- const handleDrop = (event) => {
135
- event.preventDefault();
136
- event.stopPropagation();
137
- const files = event.dataTransfer.files;
138
- if (files && files.length > 0) {
139
- const updatedFiles = processFiles(files, selectedFiles);
140
- if (updatedFiles.length > selectedFiles.length || !fileUploadProps.multiple) {
141
- setSelectedFiles(updatedFiles);
142
- updateFileInput(updatedFiles);
143
- }
144
- }
145
- };
146
- return (_jsxs("div", { className: `${styles.fileUploadContainer} ${fileUploadProps.className}`, children: [_jsx("input", { ref: fileInputRef, type: "file", name: fileUploadProps.name, accept: fileUploadProps.accept, multiple: fileUploadProps.multiple, onChange: handleFileSelect, disabled: fileUploadProps.disabled, "aria-label": "files", className: styles.hiddenInput }), selectedFiles.length === 0 ? (_jsxs("div", { className: `${styles.uploadArea} ${fileUploadProps.disabled ? styles.uploadAreaDisabled : ''}`, onDragOver: handleDragOver, onDrop: handleDrop, onClick: !fileUploadProps.disabled ? handleButtonClick : undefined, children: [_jsx(CwIcon, { iconId: "upload" }), _jsx("p", { className: `${styles.uploadTitle}`, children: fileUploadProps.disabled ? 'Upload disabled' : 'Click to upload or drag and drop' }), _jsxs("p", { className: `${styles.uploadSubtitle}`, children: [fileUploadProps.accept ? `Accepted files: ${fileUploadProps.accept}` : 'All file types accepted', !fileUploadProps.multiple && ' (Single file only)'] })] })) : (_jsxs("div", { className: styles.filesContainer, children: [_jsxs("div", { className: "cw-flex-row cw-align-between-center", children: [_jsxs("small", { className: styles.filesCount, children: [selectedFiles.length, " file", selectedFiles.length !== 1 ? 's' : '', " selected"] }), _jsx(CwButton, { onClick: removeAllFiles, disabled: fileUploadProps.disabled, color: "danger", variant: "outline", icon: "delete", text: "Clear all" })] }), selectedFiles.map((file, index) => (_jsxs("div", { className: styles.fileItem, children: [_jsxs("div", { className: styles.fileIcon, children: [_jsx(CwIcon, { iconId: "page" }), _jsx("span", { className: styles.fileExtension, children: getFileExtension(file.name) })] }), _jsxs("div", { className: styles.fileInfo, children: [_jsx("p", { className: styles.fileName, children: file.name }), _jsxs("p", { className: styles.fileSize, children: [(file.size / 1024).toFixed(1), " KB"] })] }), _jsx(CwButton, { variant: "icon", icon: "close", color: "neutral", onClick: () => removeFile(index), className: styles.smallButton })] }, index))), fileUploadProps.multiple && (_jsx(CwButton, { text: "Add More Files", icon: "plus", variant: "outline", onClick: handleButtonClick, disabled: fileUploadProps.disabled })), !fileUploadProps.multiple && (_jsx(CwButton, { text: "Change File", icon: "refresh", onClick: handleButtonClick, disabled: fileUploadProps.disabled }))] }))] }));
147
- }
148
- ;
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useState } from "react";
3
- import { CwButton } from "../../../../components/control/action/button/CwButton";
4
- import { CwIcon } from "../../../../components/display/graphics/icon/CwIcon";
5
- export function CwInputImage(props) {
6
- const [_uploadedImage, setUploadedImage] = useState(null);
7
- const inputRef = useRef(null);
8
- const { allowedImageFormats, onChange, ...inputProps } = props;
9
- const allowedFormats = allowedImageFormats || ["image/jpeg", "image/png", "image/gif"];
10
- const isValidFileType = (type) => allowedFormats.includes(type);
11
- const handleFile = (file) => {
12
- if (file && isValidFileType(file.type)) {
13
- const imgURL = URL.createObjectURL(file);
14
- setUploadedImage(imgURL);
15
- if (onChange)
16
- onChange(imgURL);
17
- }
18
- else {
19
- // Optionally handle unsupported file types
20
- if (onChange)
21
- onChange(null);
22
- }
23
- };
24
- const handleDrop = (e) => {
25
- e.preventDefault();
26
- const file = e.dataTransfer.files[0];
27
- handleFile(file);
28
- };
29
- const onPasteButtonClick = async () => {
30
- try {
31
- const clipboard = navigator.clipboard;
32
- const clipboardItems = await clipboard.read();
33
- for (const clipboardItem of clipboardItems) {
34
- for (const type of clipboardItem.types) {
35
- if (type.startsWith("image/")) {
36
- const blob = await clipboardItem.getType(type);
37
- handleFile(blob);
38
- }
39
- }
40
- }
41
- }
42
- catch (err) {
43
- console.error("Failed to read clipboard:", err);
44
- alert("Failed to read from clipboard. Ensure the app has permission to access clipboard.");
45
- }
46
- };
47
- const handleFileChange = (e) => {
48
- const file = e.target.files?.[0];
49
- handleFile(file ?? null);
50
- };
51
- return (_jsxs("div", { className: "cw-input-image", children: [_jsxs("div", { onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, style: { border: "2px dashed #ccc", padding: "20px", textAlign: "center" }, children: [_jsx("p", { children: "Drop image here" }), _jsxs("small", { children: ["(", allowedFormats.join(", ").replace(/image\//g, ""), ")"] })] }), _jsxs("div", { style: { display: "flex", justifyContent: "center" }, children: [_jsxs(CwButton, { style: { margin: "2px" }, onClick: onPasteButtonClick, children: [_jsx(CwIcon, { iconId: "paste" }), "\u2002Paste"] }), _jsxs(CwButton, { style: { margin: "2px" }, onClick: () => inputRef.current?.click(), children: [_jsx(CwIcon, { iconId: "folder-open" }), "\u2002Browse"] })] }), _jsx("input", { ref: inputRef, type: "file", accept: allowedFormats.join(","), onChange: handleFileChange, style: { display: "none" }, ...inputProps })] }));
52
- }
@@ -1,113 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useImperativeHandle, useRef, useState } from "react";
3
- import { CwAlign } from "../../../../components/layout/align/CwAlign";
4
- /**
5
- * An image with a selectable rectangle region, useful for cropping or selecting a section of the image
6
- * @remarks ```txt
7
- * ╭――――――――――――――――――――――――――――――――――――╮
8
- * │ +═══════════════════+ │
9
- * │ ║ .:::::::. ║ │
10
- * │ ║ .' '::: ║ │
11
- * │ ║ : ::. ║ │
12
- * │ ║ :- -- ' : ║ │
13
- * │ ║ : ..: ║ │
14
- * │ ║ :.-- .'::; ║ │
15
- * │ ║ ::.__ .' ':;_ ║ │
16
- * │ ║ ::/""". .' ""║._ │
17
- * │ +═══════════════════+ : │
18
- * │ .::: .'..' ' │
19
- * │ . :' . ' ': │
20
- * │ : ' .: . . . │
21
- * │ :' .: : .: "--__ │
22
- * │ /' .:: : . │
23
- * │ _: . :::: ' . │
24
- * │.' '-----------: . │
25
- * │ : '---''--'-- │
26
- * │ '--'"""""----------'' │
27
- * ╰――――――――――――――――――――――――――――――――――――╯
28
- * ```
29
- * @example
30
- * <CwImageArea src="path/to/image.png" _onSelectionSuccess={img => setImage(img)} />
31
- */
32
- export const CwImageArea = forwardRef((props, ref) => {
33
- const { alignProps: alignProps, initialSelectionArea: initialSelectionArea, onSelectionEnd, onSelectionStart, onSelectionSuccess, selectionAreaAttenuation: selectionAreaAttenuation, selectionAreaStyle: selectionAreaStyle, ...imgProps } = props;
34
- // Default no-op functions for selection callbacks
35
- const onSelectionStartHandler = onSelectionStart || (() => true);
36
- const onSelectionEndHandler = onSelectionEnd || (() => true);
37
- const onSelectionSuccessHandler = onSelectionSuccess || (() => { });
38
- // Ref to the image element and state management hooks
39
- const imageRef = useRef(null);
40
- const [selectedImage, setSelectedImage] = useState();
41
- const [opacity, setOpacity] = useState(selectionAreaAttenuation ?? selectionAreaStyle?.opacity ?? "1.0");
42
- // Track drag start position and selected area
43
- const [dragStart, setDragStart] = useState(null);
44
- const [selectedArea, setSelectedArea] = useState(initialSelectionArea ?? null);
45
- // Expose component methods using ref
46
- useImperativeHandle(ref, () => ({
47
- getSelectedImage: () => selectedImage
48
- }));
49
- // Handle mouse down event to initiate selection
50
- const onMouseDown = useCallback((event) => {
51
- const rect = imageRef.current?.getBoundingClientRect();
52
- if (rect) {
53
- const x = event.clientX - rect.left;
54
- const y = event.clientY - rect.top;
55
- if (onSelectionStartHandler(x, y)) {
56
- setDragStart({ x, y });
57
- }
58
- setSelectedArea(null);
59
- setOpacity(selectionAreaStyle?.opacity ?? 1);
60
- }
61
- }, [onSelectionStartHandler]);
62
- // Update selection area as mouse moves
63
- const onMouseMove = useCallback((event) => {
64
- if (dragStart && imageRef.current) {
65
- const rect = imageRef.current.getBoundingClientRect();
66
- const currentX = event.clientX - rect.left;
67
- const currentY = event.clientY - rect.top;
68
- const width = Math.abs(currentX - dragStart.x);
69
- const height = Math.abs(currentY - dragStart.y);
70
- setSelectedArea(new DOMRect(Math.min(dragStart.x, currentX), Math.min(dragStart.y, currentY), width, height));
71
- }
72
- }, [dragStart]);
73
- // Finalize selection on mouse up
74
- const onMouseUp = useCallback(() => {
75
- if (selectedArea && imageRef.current) {
76
- // Calculate and scale the selected area to the image's natural size
77
- const rect = imageRef.current.getBoundingClientRect();
78
- const scaleX = imageRef.current.naturalWidth / rect.width;
79
- const scaleY = imageRef.current.naturalHeight / rect.height;
80
- const scaledArea = new DOMRect(selectedArea.x * scaleX, selectedArea.y * scaleY, selectedArea.width * scaleX, selectedArea.height * scaleY);
81
- if (onSelectionEndHandler(scaledArea))
82
- createSelectedImage(scaledArea);
83
- setOpacity(selectionAreaAttenuation ?? selectionAreaStyle?.opacity ?? 1);
84
- setDragStart(null);
85
- }
86
- }, [selectedArea, onSelectionEndHandler]);
87
- // Create an image from the selected area
88
- const createSelectedImage = useCallback((scaledArea) => {
89
- const canvas = document.createElement("canvas");
90
- canvas.width = scaledArea.width;
91
- canvas.height = scaledArea.height;
92
- const ctx = canvas.getContext("2d");
93
- if (imageRef.current && ctx) {
94
- ctx.drawImage(imageRef.current, scaledArea.x, scaledArea.y, scaledArea.width, scaledArea.height, 0, 0, canvas.width, canvas.height);
95
- const selectedImageURL = canvas.toDataURL("image/png");
96
- setSelectedImage(selectedImageURL);
97
- onSelectionSuccessHandler(selectedImageURL);
98
- }
99
- }, [onSelectionSuccessHandler]);
100
- // Render the component UI
101
- return (_jsx("div", { className: "cw-image-area", children: _jsxs(CwAlign, { position: "relative", ...alignProps, children: [_jsx("img", { ref: imageRef, onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onMouseUp, onDragStart: e => e.preventDefault(), ...imgProps }), selectedArea && (_jsx("section", { style: {
102
- ...selectionAreaStyle,
103
- height: `${selectedArea.height}px`,
104
- left: `${selectedArea.x}px`,
105
- opacity: opacity,
106
- pointerEvents: "none",
107
- position: "absolute",
108
- top: `${selectedArea.y}px`,
109
- transition: "opacity 0.5s ease-in-out",
110
- width: `${selectedArea.width}px`
111
- } }))] }) }));
112
- });
113
- CwImageArea.displayName = "CwImageArea";
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../../../../../src/components/control/input/new-dates/example.tsx"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export function CwInputNumber(CwInputNumberProps) {
3
- const handleChange = (e) => {
4
- CwInputNumberProps.onChange(e.target.value);
5
- };
6
- return (_jsxs("div", { className: CwInputNumberProps.labelPosition == "column"
7
- ? "cw-flex-column cw-gap-none"
8
- : "cw-flex-row", children: [_jsx("label", { className: CwInputNumberProps.disabled === true
9
- ? CwInputNumberProps.labelClassName + " " + "cw_label_text cw_label_text_disabled"
10
- : CwInputNumberProps.labelClassName + " " + "cw_label_text", children: CwInputNumberProps.labelName }), _jsx("input", { id: CwInputNumberProps.id, type: "number", value: CwInputNumberProps.value, onChange: e => handleChange(e), className: CwInputNumberProps.className + " " + " cw-input-number", placeholder: CwInputNumberProps.placeholder == undefined ? "Write a number please" : CwInputNumberProps.placeholder, style: CwInputNumberProps.style, disabled: CwInputNumberProps.disabled, required: CwInputNumberProps.required, step: CwInputNumberProps.step, min: CwInputNumberProps.min, max: CwInputNumberProps.max })] }));
11
- }
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CwButton } from "../../../../components/control/action/button/CwButton";
3
- import { CwIcon } from "../../../../components/display/graphics/icon/CwIcon";
4
- import { CwLabel } from "../../../../components/display/text/label/CwLabel";
5
- import { CwAlign } from "../../../../components/layout/align/CwAlign";
6
- /**
7
- * Input for entering a telephone number.
8
- * @remarks
9
- * ```txt
10
- * CwIcon CwLabel CwSelect CwButton
11
- * ↑ ↑ ↑ ↑
12
- * ╭────────────────────╮╭════╮
13
- * ( Phone ││ 0123456789+ │║ Ok ║
14
- * ╰────────────────────╯╰════╯
15
- * ```
16
- * @example
17
- * ```tsx
18
- * <CwInputPhone iconProps={{iconId:"phone"}} labelProps={{children:"Phone"}} />
19
- * ```
20
- */
21
- export function CwInputPhone(props) {
22
- const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
23
- return (_jsx("div", { className: "cw-input-phone", children: _jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (_jsxs(CwLabel, { ...labelProps, children: [iconProps && _jsx(CwIcon, { ...iconProps }), labelProps.text] })), _jsx("input", { type: "tel", placeholder: "+## ### ### ###", pattern: "[+0-9 ]*", maxLength: 16, ...inputProps }), buttonProps && _jsx(CwButton, { ...buttonProps })] }) }));
24
- }
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CwButton } from "../../../../components/control/action/button/CwButton";
3
- import { CwIcon } from "../../../../components/display/graphics/icon/CwIcon";
4
- import { CwLabel } from "../../../../components/display/text/label/CwLabel";
5
- import { CwAlign } from "../../../../components/layout/align/CwAlign";
6
- /**
7
- * Input for entering a string of text.
8
- * @remarks
9
- * ```txt
10
- * CwIcon CwLabel CwSelect CwButton
11
- * ↑ ↑ ↑ ↑
12
- * ╭────────────────────╮╭════╮
13
- * ⌂ Address ││ Sunset Valley, 2 │║ Ok ║
14
- * ╰────────────────────╯╰════╯
15
- * ```
16
- * @example
17
- * ```tsx
18
- * <CwInputText
19
- * iconProps={{ id: "home" }}
20
- * labelProps={{ children: "Name", width: "100px" }}
21
- * buttonProps={{ children: "Ok", onclick:()=>{alert("hi")} }}
22
- * />
23
- * ```
24
- */
25
- export function CwInputText(props) {
26
- const { alignProps, buttonProps, iconProps, labelProps, className, ...inputProps } = props;
27
- const containerClassName = className
28
- ? `cw-input-text ${className}`
29
- : "cw-input-text";
30
- return (_jsx("div", { className: containerClassName, children: _jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (_jsxs(CwLabel, { ...labelProps, children: [iconProps && _jsx(CwIcon, { ...iconProps }), labelProps.text] })), _jsx("input", { type: props.type ?? "text", ...inputProps }), buttonProps && _jsx(CwButton, { ...buttonProps })] }) }));
31
- }
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CwButton } from "../../../../components/control/action/button/CwButton";
3
- import { CwIcon } from "../../../../components/display/graphics/icon/CwIcon";
4
- import { CwLabel } from "../../../../components/display/text/label/CwLabel";
5
- import { CwAlign } from "../../../../components/layout/align/CwAlign";
6
- export function CwTextArea(props) {
7
- const { alignProps, buttonProps, iconProps, labelProps, resize, ...textareaProps } = props;
8
- return (_jsx("div", { className: "cw-text-area", children: _jsxs(CwAlign, { ...alignProps, children: [labelProps && (_jsxs(CwLabel, { ...labelProps, children: [iconProps && _jsx(CwIcon, { ...iconProps }), labelProps.text] })), _jsx("textarea", { ...textareaProps, itemProp: textareaProps.required === true ? "required" : "", style: { ...textareaProps.style, resize: resize } }), buttonProps && _jsx(CwButton, { ...buttonProps })] }) }));
9
- }
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CwButton } from "../../../../components/control/action/button/CwButton";
3
- import { CwIcon } from "../../../../components/display/graphics/icon/CwIcon";
4
- import { CwLabel } from "../../../../components/display/text/label/CwLabel";
5
- import { CwAlign } from "../../../../components/layout/align/CwAlign";
6
- /**
7
- * Input for entering a string of text.
8
- * @remarks
9
- * ```txt
10
- * CwIcon CwLabel input type=time CwButton
11
- * ↑ ↑ ↑ ↑
12
- * ╭────────────────────╮╭════╮
13
- * ⌂ Birthdate │ 00:00 │║ Ok ║
14
- * ╰────────────────────╯╰════╯
15
- * ```
16
- * @example
17
- * ```tsx
18
- * <CwTime
19
- * iconProps={{ iconId: "Birthdate" }}
20
- * labelProps={{ children: "Name", width: "100px" }}
21
- * buttonProps={{ children: "Ok", onClick:()=>{alert("happy happy joy joy")} }}
22
- * />
23
- * ```
24
- */
25
- export function CwTime(props) {
26
- const { alignProps, buttonProps, iconProps, labelProps, ...inputProps } = props;
27
- inputProps.max = inputProps.max ?? "9999-01-01";
28
- return (_jsx("div", { className: "cw-input-date", children: _jsxs(CwAlign, { ...alignProps, itemProp: inputProps.required === true ? "required" : "", children: [labelProps && (_jsxs(CwLabel, { ...labelProps, children: [iconProps && _jsx(CwIcon, { ...iconProps }), labelProps.text] })), _jsx("input", { type: "time", ...inputProps }), buttonProps && _jsx(CwButton, { ...buttonProps })] }) }));
29
- }
@@ -1,143 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
3
- import styles from "./cw-weekday-selector.module.css";
4
- /**
5
- * This class represents a week where days can be selected or unselected
6
- * @remark Selected days are in UPPERCASE, unselected days are in lowercase
7
- * ```
8
- * Monday = "M" | "m"
9
- * Tuesday = "T" | "t"
10
- * Wendnesday = "W" | "w"
11
- * thuRsday = "R" | "r"
12
- * Friday = "F" | "f"
13
- * Saturday = "S" | "s"
14
- * sUnday = "U" | "u"
15
- * ```
16
- */
17
- export class Weekdays {
18
- static WEEKDAYS_STANDARD_ARRAY_FULL = ["M", "T", "W", "R", "F", "S", "U"];
19
- static WEEKDAYS_STANDARD_ARRAY_EMPTY = ["m", "t", "w", "r", "f", "s", "u"];
20
- static WEEKDAYS_STANDARD_STRING_FULL = "MTWRFSU";
21
- static WEEKDAYS_STANDARD_STRING_EMPTY = "mtwrfsu";
22
- static WEEKDAYS_TO_USA_LETTER_FORMAT = new Map([
23
- ["M", "M"],
24
- ["T", "T"],
25
- ["W", "W"],
26
- ["R", "T"],
27
- ["F", "F"],
28
- ["S", "S"],
29
- ["U", "S"]
30
- ]);
31
- static WEEKDAYS_TO_USA_SHORT_FORMAT = new Map([
32
- ["M", "Mon"],
33
- ["T", "Tue"],
34
- ["W", "Wed"],
35
- ["R", "Thu"],
36
- ["F", "Fri"],
37
- ["S", "Sat"],
38
- ["U", "Sun"]
39
- ]);
40
- static WEEKDAY_MAP = {
41
- 0: "U",
42
- 1: "M",
43
- 2: "T",
44
- 3: "W",
45
- 4: "R",
46
- 5: "F",
47
- 6: "S"
48
- };
49
- days;
50
- constructor(days = Weekdays.WEEKDAYS_STANDARD_ARRAY_FULL) {
51
- if (typeof days === "string")
52
- this.days = this.normalize(days.split(""));
53
- else
54
- this.days = this.normalize(days);
55
- }
56
- includes(day) {
57
- return this.days.includes(day);
58
- }
59
- static fromString(value) {
60
- return new Weekdays(value.split(""));
61
- }
62
- static isValidToday(validFrom, validUntil, validWeekdays) {
63
- const today = new Date();
64
- // Check if today is within the validity period
65
- if (today < validFrom || today > validUntil) {
66
- return false;
67
- }
68
- // Convert today's weekday to Weekday type
69
- const todayWeekday = Weekdays.WEEKDAY_MAP[today.getDay()];
70
- // Check if today's weekday is in the validWeekdays array
71
- return validWeekdays.includes(todayWeekday);
72
- }
73
- normalize(weekdays) {
74
- const uniqueWeekdays = new Set(weekdays);
75
- if (uniqueWeekdays.size != 7)
76
- throw Error(`Illegal weekday string ${Array.from(uniqueWeekdays).join("")}`);
77
- return Weekdays.WEEKDAYS_STANDARD_STRING_FULL.split("").map(day => {
78
- if (uniqueWeekdays.has(day)) {
79
- return day;
80
- }
81
- else if (uniqueWeekdays.has(day.toLowerCase())) {
82
- return day.toLowerCase();
83
- }
84
- else {
85
- throw Error(`Illegal weekday string ${weekdays.join("")}`);
86
- }
87
- });
88
- }
89
- toString() {
90
- return this.days.join("").trim();
91
- }
92
- toStringFormatted(limiters = { startExistingDay: "{", endExsitingDay: "}", startMissingDay: "(", endMissingDay: ")", separator: " " }, format = Weekdays.WEEKDAYS_TO_USA_SHORT_FORMAT) {
93
- const result = new Array();
94
- [...this.days].forEach((letter, index) => {
95
- if (letter === letter.toUpperCase()) {
96
- result.push(limiters.startExistingDay + format.get(letter) + limiters.endExsitingDay);
97
- }
98
- else if (letter === letter.toLowerCase()) {
99
- result.push(limiters.startMissingDay +
100
- format.get(Weekdays.WEEKDAYS_STANDARD_STRING_FULL.charAt(index)) +
101
- limiters.endMissingDay);
102
- }
103
- });
104
- return result.join(limiters.separator).trim();
105
- }
106
- toArray() {
107
- return [...this.days];
108
- }
109
- isEmpty() {
110
- return this.toString() === Weekdays.WEEKDAYS_STANDARD_STRING_EMPTY;
111
- }
112
- isFull() {
113
- return this.toString() === Weekdays.WEEKDAYS_STANDARD_STRING_FULL;
114
- }
115
- static getFullWeek() {
116
- return Weekdays.WEEKDAYS_STANDARD_ARRAY_FULL;
117
- }
118
- static getEmptyWeek() {
119
- return Weekdays.WEEKDAYS_STANDARD_ARRAY_EMPTY;
120
- }
121
- }
122
- export const CwWeekdaySelector = ({ value = "", onChange, disabled = false }) => {
123
- const [selectedDays, setSelectedDays] = useState(Weekdays.fromString(value));
124
- useEffect(() => {
125
- setSelectedDays(Weekdays.fromString(value));
126
- }, [value]);
127
- const handleChange = (day, checked) => {
128
- const currentDays = selectedDays.toArray();
129
- let updated;
130
- if (checked) {
131
- updated = currentDays.filter(d => d !== day.toLowerCase());
132
- updated.push(day);
133
- }
134
- else {
135
- updated = currentDays.filter(d => d !== day);
136
- updated.push(day.toLowerCase());
137
- }
138
- const newWeekdays = new Weekdays(updated);
139
- setSelectedDays(newWeekdays);
140
- onChange?.(newWeekdays.toString());
141
- };
142
- return (_jsx("div", { className: styles["cw-weekday-selector"], children: Weekdays.getFullWeek().map(day => (_jsx("input", { type: "checkbox", "data-day": day, checked: selectedDays.toArray().includes(day), onChange: (e) => handleChange(day, e.target.checked), disabled: disabled }, day))) }));
143
- };