@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.
- package/dist/deprecated/components/MultiSelect_deprecated_.d.ts +24 -0
- package/dist/deprecated/components/MultiSelect_deprecated_.d.ts.map +1 -0
- package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts +17 -0
- package/dist/deprecated/components/dropdown/CwDropdownContainer.d.ts.map +1 -0
- package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts +17 -0
- package/dist/deprecated/components/multiselect/CwHeadFilter.d.ts.map +1 -0
- package/dist/deprecated/components/multiselect/CwMultiselect.d.ts +13 -0
- package/dist/deprecated/components/multiselect/CwMultiselect.d.ts.map +1 -0
- package/dist/deprecated/components/multiselect/CwOptionList.d.ts +14 -0
- package/dist/deprecated/components/multiselect/CwOptionList.d.ts.map +1 -0
- package/dist/deprecated/components/tag/CwTag.d.ts +15 -0
- package/dist/deprecated/components/tag/CwTag.d.ts.map +1 -0
- package/dist/index.cjs.js +116 -65
- package/dist/index.css +1 -1
- package/dist/index.d.ts +35 -2
- package/dist/index.es.js +116 -66
- package/dist/src/components/control/action/button/CwPopoverButton.d.ts +33 -0
- package/dist/src/components/control/action/button/CwPopoverButton.d.ts.map +1 -0
- package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts +19 -0
- package/dist/src/components/control/choice/deprecated/CwDropdown.d.ts.map +1 -0
- package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts +21 -0
- package/dist/src/components/control/choice/deprecated/CwDropdownNavigation.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.d.ts +35 -0
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts +47 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePicker2.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts +1 -12
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts +1 -11
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts +1 -1
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/src/common/classes/CwSelectList.js +0 -12
- package/dist/src/common/classes/CwSelectListItems.js +0 -14
- package/dist/src/common/functions/collections.js +0 -18
- package/dist/src/common/functions/colorManipulation.js +0 -76
- package/dist/src/common/functions/dsl/UiEventDSL.js +0 -20
- package/dist/src/common/functions/useSingleAndDoubleClicks.js +0 -28
- package/dist/src/common/interfaces/CwSelectListProps.js +0 -1
- package/dist/src/components/control/action/button/CwButton.js +0 -13
- package/dist/src/components/control/action/buttons/CwButtons.js +0 -188
- package/dist/src/components/control/action/contextmenu/CwContextMenu.js +0 -43
- package/dist/src/components/control/action/contextual-menu/CwContextualMenu.js +0 -55
- package/dist/src/components/control/action/search/CwSearch.js +0 -67
- package/dist/src/components/control/action/tooltip-dialog/CwTooltipDialog.js +0 -11
- package/dist/src/components/control/choice/checkbox/CwCheckbox.js +0 -15
- package/dist/src/components/control/choice/deprecated/MultiSelect_deprecated_.js +0 -99
- package/dist/src/components/control/choice/dropdown/CwDropdown.js +0 -27
- package/dist/src/components/control/choice/dropdown/CwDropdownContainer.js +0 -30
- package/dist/src/components/control/choice/dropdown/CwDropdownFilter.js +0 -10
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.js +0 -298
- package/dist/src/components/control/choice/multi-filter/components/tag/CwMultiFilterTag.js +0 -17
- package/dist/src/components/control/choice/multiselect/CwHeadFilter.js +0 -80
- package/dist/src/components/control/choice/multiselect/CwMultiselect.js +0 -393
- package/dist/src/components/control/choice/multiselect/CwOptionList.js +0 -36
- package/dist/src/components/control/choice/option/CwOption.js +0 -16
- package/dist/src/components/control/choice/select/CwSelect.js +0 -36
- package/dist/src/components/control/choice/toggle/CwToggle.js +0 -9
- package/dist/src/components/control/input/any/CwInput.js +0 -16
- package/dist/src/components/control/input/color/CwColorPicker.js +0 -210
- package/dist/src/components/control/input/color/CwInputColor.js +0 -142
- package/dist/src/components/control/input/date/CwInputDate.js +0 -29
- package/dist/src/components/control/input/date-picker/CwInputDatePicker.js +0 -109
- package/dist/src/components/control/input/date-text/CwInputDateText.js +0 -90
- package/dist/src/components/control/input/datetime/CwInputDatetime.js +0 -29
- package/dist/src/components/control/input/digit/CwDigit.js +0 -28
- package/dist/src/components/control/input/file/CwFileUpload.js +0 -52
- package/dist/src/components/control/input/file/CwFileUploadMultiple.js +0 -148
- package/dist/src/components/control/input/image/CwInputImage.js +0 -52
- package/dist/src/components/control/input/image-area/CwImageArea.js +0 -113
- package/dist/src/components/control/input/new-dates/example.d.ts +0 -2
- package/dist/src/components/control/input/new-dates/example.d.ts.map +0 -1
- package/dist/src/components/control/input/number/CwInputNumber.js +0 -11
- package/dist/src/components/control/input/phone/CwInputPhone.js +0 -24
- package/dist/src/components/control/input/text/CwInputText.js +0 -31
- package/dist/src/components/control/input/text-area/CwTextArea.js +0 -9
- package/dist/src/components/control/input/time/CwTime.js +0 -29
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.js +0 -143
- package/dist/src/components/custom/find-airport/CwFindAirportComp.js +0 -240
- package/dist/src/components/custom/scheduler/CwSchedulerComp.js +0 -211
- package/dist/src/components/custom/scheduler/CwSuperSchedulerComp.js +0 -269
- package/dist/src/components/custom/scheduler/components/EventRender.js +0 -142
- package/dist/src/components/custom/scheduler/components/ResourceListRender.js +0 -12
- package/dist/src/components/custom/scheduler/components/ResourceRender.js +0 -26
- package/dist/src/components/custom/scheduler/components/day_headers/DayHeader.js +0 -13
- package/dist/src/components/custom/scheduler/components/day_headers/MonthHeader.js +0 -12
- package/dist/src/components/custom/scheduler/components/day_headers/MyDaysHeader.js +0 -62
- package/dist/src/components/custom/scheduler/components/day_headers/WeekHeader.js +0 -13
- package/dist/src/components/custom/scheduler/components/resources_title_list/ResourcesTitleList.js +0 -24
- package/dist/src/components/custom/scheduler/components/scheduler_content_area/SchedulerContentArea.js +0 -17
- package/dist/src/components/custom/scheduler/components/scheduler_header/SchedulerHeader.js +0 -26
- package/dist/src/components/custom/scheduler/components/scheduler_timeline/SchedulerTimeLine.js +0 -23
- package/dist/src/components/custom/scheduler/components/time_headers/TimeHeader.js +0 -31
- package/dist/src/components/custom/scheduler/components/time_headers/TimeHeaderRow.js +0 -16
- package/dist/src/components/custom/scheduler/components/time_line/TimeLine.js +0 -12
- package/dist/src/components/custom/scheduler/logic/dates/addMinutesToDateFromPx.js +0 -5
- package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDates.js +0 -15
- package/dist/src/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil.js +0 -5
- package/dist/src/components/custom/scheduler/logic/dates/getFormatedTimeForHeader.js +0 -43
- package/dist/src/components/custom/scheduler/logic/dates/getMonthHeaderData.js +0 -35
- package/dist/src/components/custom/scheduler/logic/dates/getUtcToday.js +0 -6
- package/dist/src/components/custom/scheduler/logic/dates/getWeekHeaderDataFromWeekRange.js +0 -20
- package/dist/src/components/custom/scheduler/logic/dates/listOfDatesToWeeks.js +0 -55
- package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisionType.js +0 -13
- package/dist/src/components/custom/scheduler/logic/divisions/calculateDivisions.js +0 -16
- package/dist/src/components/custom/scheduler/logic/filtering/filterEvents.js +0 -33
- package/dist/src/components/custom/scheduler/logic/filtering/filterResources.js +0 -14
- package/dist/src/components/custom/scheduler/logic/filtering/hasSameProperties.js +0 -10
- package/dist/src/components/custom/scheduler/logic/onDrop/OnDrop.js +0 -45
- package/dist/src/components/custom/scheduler/logic/pixels/getHeightLineScheduler.js +0 -14
- package/dist/src/components/custom/scheduler/logic/pixels/getPixelsForEvent.js +0 -32
- package/dist/src/components/custom/scheduler/logic/pixels/heightScheduler.js +0 -14
- package/dist/src/components/custom/scheduler/logic/pixels/heightSchedulerPinned.js +0 -9
- package/dist/src/components/custom/scheduler/logic/state_handle/doubleClickOnResource.js +0 -5
- package/dist/src/components/custom/scheduler/logic/state_handle/handleResourceChange.js +0 -11
- package/dist/src/components/custom/scheduler/logic/state_handle/onDragOver.js +0 -9
- package/dist/src/components/custom/scheduler/logic/state_handle/onDropEventToResource.js +0 -3
- package/dist/src/components/custom/scheduler/logic/strings/compareStrings.js +0 -7
- package/dist/src/components/custom/scheduler/logic/strings/getGUID.js +0 -7
- package/dist/src/components/custom/scheduler/logic/ui/checkIfSlotAvailable.js +0 -8
- package/dist/src/components/custom/scheduler/logic/ui/getEventsOfResource.js +0 -45
- package/dist/src/components/custom/scheduler/logic/ui/getTimeHeaders.js +0 -35
- package/dist/src/components/custom/scheduler/logic/ui/isAllowedToMove.js +0 -19
- package/dist/src/components/custom/scheduler/logic/ui/updateResourceVisibility.js +0 -15
- package/dist/src/components/custom/scheduler/state/CblDragAndDrop.js +0 -18
- package/dist/src/components/custom/scheduler/state/CwSchedulerProps.js +0 -1
- package/dist/src/components/custom/scheduler/state/Resource.js +0 -18
- package/dist/src/components/custom/scheduler/state/State.js +0 -1
- package/dist/src/components/custom/scheduler/state/cblEvent.js +0 -28
- package/dist/src/components/custom/scheduler/state/cblEventCompProps.js +0 -1
- package/dist/src/components/custom/scheduler/state/resourceCompProps2.js +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.js +0 -123
- package/dist/src/components/custom/scheduler-new/presentation/NewSchedulerUiEvents.js +0 -118
- package/dist/src/components/custom/scheduler-new/presentation/SchedulerPresenter.js +0 -166
- package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.js +0 -26
- package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.js +0 -8
- package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.js +0 -86
- package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeaderState.js +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.js +0 -60
- package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.js +0 -24
- package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.js +0 -150
- package/dist/src/components/custom/scheduler-new/presentation/components/row/EventSideDrag.js +0 -11
- package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.js +0 -176
- package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.js +0 -8
- package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.js +0 -39
- package/dist/src/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.js +0 -8
- package/dist/src/components/custom/scheduler-new/presentation/helpers.js +0 -43
- package/dist/src/components/custom/scheduler-new/presentation/logic/WeekendCalc.js +0 -24
- package/dist/src/components/custom/scheduler-new/presentation/logic/dateFromPercentage.js +0 -7
- package/dist/src/components/custom/scheduler-new/presentation/logic/eventIsVisible.js +0 -7
- package/dist/src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions.js +0 -113
- package/dist/src/components/custom/scheduler-new/presentation/logic/getDivisions.js +0 -21
- package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizes.js +0 -30
- package/dist/src/components/custom/scheduler-new/presentation/logic/getLinesByDivisions.js +0 -13
- package/dist/src/components/custom/scheduler-new/presentation/logic/getPercentageFromMouseEvent.js +0 -7
- package/dist/src/components/custom/scheduler-new/presentation/logic/separateEventsToInnerRows.js +0 -32
- package/dist/src/components/custom/scheduler-new/presentation/logic/sortByCategoryAndTitle.js +0 -12
- package/dist/src/components/custom/scheduler-new/presentation/state/ui/SchedulerState.js +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/state/ui/WeekRange.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/CwSchedulerComp2.js +0 -267
- package/dist/src/components/custom/scheduler-temporal/CwSuperSchedulerComp.js +0 -269
- package/dist/src/components/custom/scheduler-temporal/components/EventRender.js +0 -142
- package/dist/src/components/custom/scheduler-temporal/components/ResourceListRender.js +0 -12
- package/dist/src/components/custom/scheduler-temporal/components/ResourceRender.js +0 -26
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/DayHeader.js +0 -13
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MonthHeader.js +0 -12
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/MyDaysHeader.js +0 -62
- package/dist/src/components/custom/scheduler-temporal/components/day_headers/WeekHeader.js +0 -13
- package/dist/src/components/custom/scheduler-temporal/components/resources_title_list/ResourcesTitleList.js +0 -22
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_content_area/SchedulerContentArea.js +0 -17
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_header/SchedulerHeader.js +0 -26
- package/dist/src/components/custom/scheduler-temporal/components/scheduler_timeline/SchedulerTimeLine.js +0 -23
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeader.js +0 -31
- package/dist/src/components/custom/scheduler-temporal/components/time_headers/TimeHeaderRow.js +0 -16
- package/dist/src/components/custom/scheduler-temporal/components/time_line/TimeLine.js +0 -12
- package/dist/src/components/custom/scheduler-temporal/logic/dates/addMinutesToDateFromPx.js +0 -5
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDates.js +0 -15
- package/dist/src/components/custom/scheduler-temporal/logic/dates/daysBetweenTwoDatesWithoutCeil.js +0 -5
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getFormatedTimeForHeader.js +0 -43
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getMonthHeaderData.js +0 -35
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getUtcToday.js +0 -6
- package/dist/src/components/custom/scheduler-temporal/logic/dates/getWeekHeaderDataFromWeekRange.js +0 -20
- package/dist/src/components/custom/scheduler-temporal/logic/dates/listOfDatesToWeeks.js +0 -55
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisionType.js +0 -13
- package/dist/src/components/custom/scheduler-temporal/logic/divisions/calculateDivisions.js +0 -16
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterAndProcessResources.js +0 -10
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterEvents.js +0 -34
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/filterResources.js +0 -14
- package/dist/src/components/custom/scheduler-temporal/logic/filtering/hasSameProperties.js +0 -10
- package/dist/src/components/custom/scheduler-temporal/logic/onDrop/OnDrop.js +0 -36
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getHeightLineScheduler.js +0 -14
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/getPixelsForEvent.js +0 -32
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightScheduler.js +0 -14
- package/dist/src/components/custom/scheduler-temporal/logic/pixels/heightSchedulerPinned.js +0 -9
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/doubleClickOnResource.js +0 -5
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handlePropChanges.js +0 -178
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/handleResourceChange.js +0 -11
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDragOver.js +0 -9
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onDropEventToResource.js +0 -3
- package/dist/src/components/custom/scheduler-temporal/logic/state_handle/onResizeEvent.js +0 -3
- package/dist/src/components/custom/scheduler-temporal/logic/strings/compareStrings.js +0 -7
- package/dist/src/components/custom/scheduler-temporal/logic/strings/getGUID.js +0 -7
- package/dist/src/components/custom/scheduler-temporal/logic/ui/checkIfSlotAvailable.js +0 -9
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getEventsOfResource.js +0 -92
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getHasPropsChanged.js +0 -242
- package/dist/src/components/custom/scheduler-temporal/logic/ui/getTimeHeaders.js +0 -35
- package/dist/src/components/custom/scheduler-temporal/logic/ui/isAllowedToMove.js +0 -19
- package/dist/src/components/custom/scheduler-temporal/logic/ui/shouldTriggerScroll.js +0 -241
- package/dist/src/components/custom/scheduler-temporal/logic/ui/updateResourceVisibility.js +0 -15
- package/dist/src/components/custom/scheduler-temporal/state/CblDragAndDrop.js +0 -18
- package/dist/src/components/custom/scheduler-temporal/state/CwSchedulerProps.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/state/Resource.js +0 -18
- package/dist/src/components/custom/scheduler-temporal/state/State.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/state/cblEvent.js +0 -28
- package/dist/src/components/custom/scheduler-temporal/state/cblEventCompProps.js +0 -1
- package/dist/src/components/custom/scheduler-temporal/state/resourceCompProps2.js +0 -1
- package/dist/src/components/custom/super-scheduler/PinRowHeader.js +0 -53
- package/dist/src/components/custom/super-scheduler/SuperScheduler.js +0 -23
- package/dist/src/components/custom/super-scheduler/SuperSchedulerEvents.js +0 -15
- package/dist/src/components/custom/super-scheduler/SuperSchedulerPresenter.js +0 -45
- package/dist/src/components/display/data/accordion/CwAccordionContainer.js +0 -20
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.js +0 -138
- package/dist/src/components/display/data/table/CwTable.js +0 -203
- package/dist/src/components/display/graphics/icon/CwIcon.js +0 -23
- package/dist/src/components/display/graphics/loading/CwLoading.js +0 -27
- package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.js +0 -20
- package/dist/src/components/display/text/heading/CwHeadingMain.js +0 -5
- package/dist/src/components/display/text/heading/CwHeadingSecond.js +0 -5
- package/dist/src/components/display/text/label/CwLabel.js +0 -13
- package/dist/src/components/display/text/message/CwMessage.js +0 -75
- package/dist/src/components/display/text/note/CwNote.js +0 -78
- package/dist/src/components/display/text/tag/CwChip.js +0 -57
- package/dist/src/components/display/text/tag/CwTag.js +0 -21
- package/dist/src/components/display/text/tooltip/CwTooltip.js +0 -4
- package/dist/src/components/layout/align/CwAlign.js +0 -54
- package/dist/src/components/layout/card/CwCard.js +0 -55
- package/dist/src/components/layout/card/CwCardList.js +0 -38
- package/dist/src/components/layout/dialog/CwDialog.js +0 -255
- package/dist/src/components/layout/dialog/CwDialogManager.js +0 -44
- package/dist/src/components/layout/list/details/CwExpandable.js +0 -28
- package/dist/src/components/layout/list/key-value/CwKeyValueList.js +0 -23
- package/dist/src/components/layout/list/sortable/CwSortableList.js +0 -73
- package/dist/src/components/layout/list/sortable/useSortableList.js +0 -53
- package/dist/src/components/layout/modal/CwModalReportFunctional.js +0 -23
- package/dist/src/components/layout/modal/hover/CwModalHover.js +0 -61
- package/dist/src/components/layout/modal/legacy/cw_modal.js +0 -44
- package/dist/src/components/layout/modal/legacy/cw_modal_confirm.js +0 -39
- package/dist/src/components/layout/modal/legacy/cw_modal_iframe.js +0 -44
- package/dist/src/components/layout/modal/legacy/cw_modal_report.js +0 -26
- package/dist/src/components/layout/table/grouped/CwTableGrouped.js +0 -70
- package/dist/src/components/layout/tabs/CwTabs.js +0 -53
- package/dist/src/index.js +0 -187
- package/dist/test/components/custom/new-scheduler/presentation/logic/getDefaultDivisions.test.js +0 -48
- package/dist/test/components/custom/new-scheduler/presentation/logic/hoursBetween.test.js +0 -15
- package/dist/test/components/custom/new-scheduler/presentation/logic/monthDivisions.test.js +0 -42
- package/dist/test/components/custom/new-scheduler/presentation/logic/weekendCalc.test.js +0 -30
- package/dist/test/components/custom/scheduler/addMinutesToDateFromPx.test.js +0 -43
- package/dist/test/components/custom/scheduler/checkIfSlotAvailable.test.js +0 -30
- package/dist/test/components/custom/scheduler/daysBetweenTwoDates.test.js +0 -61
- package/dist/test/components/custom/scheduler/daysBetweenTwoDatesWithoutCeilForEvent.test.js +0 -27
- package/dist/test/components/custom/scheduler/getGUID.test.js +0 -30
- package/dist/test/components/custom/scheduler/getPixelsForEvent.test.js +0 -38
- package/dist/test/components/custom/scheduler/getTimeHeaders.test.js +0 -35
- package/dist/test/components/custom/scheduler/hasSameProperties.test.js +0 -51
- package/dist/test/components/custom/scheduler/isAllowedToMove.test.js +0 -28
- package/dist/test/components/custom/scheduler/listOfDatesToWeeks.test.js +0 -72
- package/dist/test/jest.setup.js +0 -1
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const isAllowedToMove = (data, resData, cblDragNDrop) => {
|
|
2
|
-
if (data?.eventType !== 1) {
|
|
3
|
-
return true;
|
|
4
|
-
}
|
|
5
|
-
const allowedMoves = [
|
|
6
|
-
{ from: "acftsScheduler", to: "flightsPairingsScheduler" },
|
|
7
|
-
{ from: "flightsScheduler", to: "crewAssignmentsScheduler" },
|
|
8
|
-
{ from: "opstoolScheduler", to: "opstoolScheduler" },
|
|
9
|
-
{ from: "opstoolScheduler", to: "opstoolSchedulerVirtual" },
|
|
10
|
-
{ from: "opstoolSchedulerVirtual", to: "opstoolScheduler" },
|
|
11
|
-
{ from: "opstoolSchedulerVirtual", to: "opstoolSchedulerVirtual" },
|
|
12
|
-
{ from: "vacationsScheduler", to: "vacationsScheduler" }
|
|
13
|
-
];
|
|
14
|
-
const crewControllAllowedMove = allowedMoves.some(move => move.from === cblDragNDrop.fromId && move.to === cblDragNDrop.toId);
|
|
15
|
-
if (crewControllAllowedMove) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
return data.Crew !== resData.Crewmember_Id;
|
|
19
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const updateResourceVisibility = (viewportTop, viewportBottom, stateResources, propsResources) => {
|
|
2
|
-
if (propsResources.length === 0)
|
|
3
|
-
return [];
|
|
4
|
-
let currentHeight = 0;
|
|
5
|
-
return stateResources.map(resource => {
|
|
6
|
-
const newResource = { ...resource };
|
|
7
|
-
newResource.isInViewport = isResourceInViewport(currentHeight, viewportTop, viewportBottom);
|
|
8
|
-
currentHeight += resource.maxTop;
|
|
9
|
-
return newResource;
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
const isResourceInViewport = (resourceTop, viewportTop, viewportBottom) => {
|
|
13
|
-
const buffer = 100;
|
|
14
|
-
return viewportBottom + 50 > resourceTop && resourceTop >= viewportTop - buffer;
|
|
15
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class CblDragAndDrop {
|
|
2
|
-
fromId;
|
|
3
|
-
toId;
|
|
4
|
-
data;
|
|
5
|
-
droppedOnDate;
|
|
6
|
-
resizeFromStart;
|
|
7
|
-
resizeFromEnd;
|
|
8
|
-
isCtrlKey;
|
|
9
|
-
constructor(fromId, toId, data, droppedOnDate = null, resizeFromStart = null, resizeFromEnd = null, isCtrlKey = null) {
|
|
10
|
-
this.fromId = fromId;
|
|
11
|
-
this.toId = toId;
|
|
12
|
-
this.data = data;
|
|
13
|
-
this.droppedOnDate = droppedOnDate;
|
|
14
|
-
this.resizeFromStart = resizeFromStart;
|
|
15
|
-
this.resizeFromEnd = resizeFromEnd;
|
|
16
|
-
this.isCtrlKey = isCtrlKey;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class Resource {
|
|
2
|
-
uid = "";
|
|
3
|
-
id;
|
|
4
|
-
name;
|
|
5
|
-
maxTop;
|
|
6
|
-
events = [];
|
|
7
|
-
isInViewport = false;
|
|
8
|
-
schedulerResourceDisplay;
|
|
9
|
-
isLoading = false;
|
|
10
|
-
data = null;
|
|
11
|
-
constructor(id, name, eventHeight, data = null, schedulerResourceDisplay = null) {
|
|
12
|
-
this.id = id;
|
|
13
|
-
this.name = name;
|
|
14
|
-
this.maxTop = eventHeight;
|
|
15
|
-
this.data = data;
|
|
16
|
-
this.schedulerResourceDisplay = schedulerResourceDisplay || this.name;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { getGUID } from "../logic/strings/getGUID";
|
|
2
|
-
export class cblEvent {
|
|
3
|
-
id = "";
|
|
4
|
-
start;
|
|
5
|
-
end;
|
|
6
|
-
resourceId;
|
|
7
|
-
selected = false;
|
|
8
|
-
top = 0;
|
|
9
|
-
leftPx = 0;
|
|
10
|
-
rightPx = 0;
|
|
11
|
-
width = 0;
|
|
12
|
-
isFullHeight = false;
|
|
13
|
-
isReadOnly = false;
|
|
14
|
-
isResizable = false;
|
|
15
|
-
isDraggable = false;
|
|
16
|
-
data = null;
|
|
17
|
-
constructor(start, end, resourceId, data = null, isFullHeight = false, isReadOnly = false, isResizable = false, isDraggable = false) {
|
|
18
|
-
this.start = start;
|
|
19
|
-
this.end = end;
|
|
20
|
-
this.resourceId = resourceId;
|
|
21
|
-
this.data = data;
|
|
22
|
-
this.isFullHeight = isFullHeight;
|
|
23
|
-
this.isReadOnly = isReadOnly;
|
|
24
|
-
this.isResizable = isResizable;
|
|
25
|
-
this.isDraggable = isDraggable;
|
|
26
|
-
this.id = getGUID();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import moment from "moment";
|
|
3
|
-
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
-
import { VariableSizeList as List } from "react-window";
|
|
5
|
-
import { SchedulerHeader } from "./components/header/SchedulerHeader";
|
|
6
|
-
import { BackgroundEvent } from "./components/row/BackgroundEvent";
|
|
7
|
-
import { DefaultRowHeader } from "./components/row/DefaultRowHeader";
|
|
8
|
-
import { SchedulerEvent } from "./components/row/Event";
|
|
9
|
-
import { SchedulerRow } from "./components/row/SchedulerRow";
|
|
10
|
-
import { getDefaultDivisions } from "./logic/getDefaultDivisions";
|
|
11
|
-
import { hoursBetween } from "./logic/getEventSizes";
|
|
12
|
-
import { getLinesByDivisions } from "./logic/getLinesByDivisions";
|
|
13
|
-
import { separateEventsToInnerRows } from "./logic/separateEventsToInnerRows";
|
|
14
|
-
import { sortByCategoryAndTitle } from "./logic/sortByCategoryAndTitle";
|
|
15
|
-
import { getWeekendLinesByDatesVisible } from "./logic/WeekendCalc";
|
|
16
|
-
import { OnClickUtc, UpdateApi } from "./NewSchedulerUiEvents";
|
|
17
|
-
import { SchedulerPresenter } from "./SchedulerPresenter";
|
|
18
|
-
import styles from "./styles/new-scheduler.module.css";
|
|
19
|
-
const getNow = (isUtc) => {
|
|
20
|
-
let now = new Date();
|
|
21
|
-
if (!isUtc) {
|
|
22
|
-
now = new Date(now.getTime() - now.getTimezoneOffset() * 60000);
|
|
23
|
-
}
|
|
24
|
-
return now;
|
|
25
|
-
};
|
|
26
|
-
const rowsHeight = 1.75; // rem
|
|
27
|
-
export const Scheduler = (props) => {
|
|
28
|
-
const { header: headerContent, id, events: eventsState, backgroundEvents, contextMenuItems, EventComp, RowTitleComp, orderCategories = ["title"], useOrderCategory, onEvent, groupRowColors, rowHeaderWidth = 180, } = props;
|
|
29
|
-
const BackgroundEventComp = props.BackgroundEventComp ?? BackgroundEvent;
|
|
30
|
-
const rows = useOrderCategory === false
|
|
31
|
-
? props.rows
|
|
32
|
-
: props.rows.sort((a, b) => sortByCategoryAndTitle(a, b, orderCategories));
|
|
33
|
-
const instanceRef = useRef(null);
|
|
34
|
-
// const rowHeaderWidth = "180px";
|
|
35
|
-
const { selectedDate, visibleDays, isUtc, isHeaderVisible, visibleRows: stateVisibleRows } = props.state;
|
|
36
|
-
const events = eventsState.filter((event) => {
|
|
37
|
-
const lastDayOfScheduler = moment(selectedDate).add(visibleDays, "days");
|
|
38
|
-
return (moment(event.endDate).isAfter(selectedDate) &&
|
|
39
|
-
moment(event.startDate).isBefore(lastDayOfScheduler));
|
|
40
|
-
});
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
instanceRef.current?.resetAfterIndex(0);
|
|
43
|
-
}, [orderCategories, props.rows.length, events]);
|
|
44
|
-
const notEmptyRows = stateVisibleRows ?? rows.length;
|
|
45
|
-
const visibleRows = height(events, rows, notEmptyRows);
|
|
46
|
-
const totalHours = visibleDays * 24;
|
|
47
|
-
const [timeLinePercentage, setTimeLinePercentage] = useState(0);
|
|
48
|
-
const header = {
|
|
49
|
-
content: headerContent,
|
|
50
|
-
divisions: getDefaultDivisions(visibleDays, selectedDate),
|
|
51
|
-
visibleDays: visibleDays,
|
|
52
|
-
width: rowHeaderWidth,
|
|
53
|
-
selectedDate,
|
|
54
|
-
onEvent,
|
|
55
|
-
timeLinePercentage: timeLinePercentage,
|
|
56
|
-
isUtc: isUtc
|
|
57
|
-
};
|
|
58
|
-
const evenColor = "var(--cw-color-surface-container-low)";
|
|
59
|
-
const oddColor = "var(--cw-color-surface-container)";
|
|
60
|
-
const schedulerContentHeight = rowsHeight * visibleRows;
|
|
61
|
-
const weekendsLines = getWeekendLinesByDatesVisible(selectedDate, visibleDays);
|
|
62
|
-
const divisionLines = getLinesByDivisions(header.divisions, visibleDays);
|
|
63
|
-
// Timeline percentage calculation
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
const updateTimeLinePercentage = () => {
|
|
66
|
-
const percentage = (hoursBetween(selectedDate, getNow(isUtc)) * 100) / totalHours;
|
|
67
|
-
setTimeLinePercentage(percentage);
|
|
68
|
-
};
|
|
69
|
-
updateTimeLinePercentage();
|
|
70
|
-
const interval = setInterval(updateTimeLinePercentage, 10_000);
|
|
71
|
-
return () => clearInterval(interval);
|
|
72
|
-
}, [selectedDate, isUtc, totalHours]);
|
|
73
|
-
// Memoized Row Component
|
|
74
|
-
const Row = React.memo(({ index, style }) => {
|
|
75
|
-
const row = rows[index];
|
|
76
|
-
const rowColor = groupRowColors
|
|
77
|
-
? Math.floor(index / 2) % 2 === 0 ? evenColor : oddColor
|
|
78
|
-
: index % 2 === 0 ? evenColor : oddColor;
|
|
79
|
-
const header = {
|
|
80
|
-
value: row,
|
|
81
|
-
width: rowHeaderWidth,
|
|
82
|
-
onEvent: onEvent,
|
|
83
|
-
};
|
|
84
|
-
return (_jsx("div", { style: {
|
|
85
|
-
...style,
|
|
86
|
-
backgroundColor: rowColor
|
|
87
|
-
}, children: _jsx(SchedulerRow, { events: events.filter((it) => it.rowId === row.rowId), backgroundEvents: backgroundEvents.filter((it) => it.rowId === row.rowId), rowHeader: header, EventComp: EventComp, BackgroundEventComp: BackgroundEventComp, RowTitleComp: RowTitleComp, weekendLines: weekendsLines, divisionLines: divisionLines, timeLinePercentage: timeLinePercentage, rowHeightInRem: rowsHeight, onEvent: onEvent, contextMenuItems: contextMenuItems, visibleDays: visibleDays, selectedDate: selectedDate }) }, row.rowId));
|
|
88
|
-
});
|
|
89
|
-
const getItemSize = useCallback((index) => {
|
|
90
|
-
const row = rows[index];
|
|
91
|
-
const filteredEvents = events.filter((it) => it.rowId === row.rowId);
|
|
92
|
-
const innerRows = separateEventsToInnerRows(filteredEvents);
|
|
93
|
-
const rowsNumber = innerRows.length > 0 ? innerRows.length : 1;
|
|
94
|
-
const pixelsInRem = 16;
|
|
95
|
-
return rowsNumber * rowsHeight * pixelsInRem;
|
|
96
|
-
}, [rows, events]);
|
|
97
|
-
// Render
|
|
98
|
-
return (_jsxs("div", { id: id, style: {
|
|
99
|
-
position: "relative",
|
|
100
|
-
height: `${schedulerContentHeight + 4}rem`,
|
|
101
|
-
overflowY: "auto",
|
|
102
|
-
scrollbarWidth: "thin",
|
|
103
|
-
}, children: [isHeaderVisible && (_jsx("div", { style: {
|
|
104
|
-
position: "sticky",
|
|
105
|
-
top: 0,
|
|
106
|
-
zIndex: 1,
|
|
107
|
-
}, children: _jsx(SchedulerHeader, { ...header }) })), _jsx(List, { height: schedulerContentHeight * 16, itemCount: rows.length, itemSize: getItemSize, width: "100%", style: { overflowX: "hidden" }, ref: instanceRef, className: styles["hide-scrollbar"], children: Row })] }));
|
|
108
|
-
};
|
|
109
|
-
const height = (events, rows, rowsNumber) => {
|
|
110
|
-
const selectedRows = rows.slice(0, rowsNumber);
|
|
111
|
-
const flatMapped = selectedRows.flatMap(row => {
|
|
112
|
-
const newEvents = events.filter(it => it.rowId === row.rowId);
|
|
113
|
-
const innerRows = separateEventsToInnerRows(newEvents);
|
|
114
|
-
return innerRows.length > 0 ? innerRows : [[]];
|
|
115
|
-
});
|
|
116
|
-
return flatMapped.length;
|
|
117
|
-
};
|
|
118
|
-
//@ts-ignore
|
|
119
|
-
const _preview = () => {
|
|
120
|
-
const { state, resources, events, backgroundEvents, onEvent } = SchedulerPresenter();
|
|
121
|
-
return (_jsxs("div", { children: [_jsx("button", { onClick: (_) => onEvent(new UpdateApi()), children: "update" }), _jsx("button", { onClick: (_) => onEvent(new OnClickUtc()), children: state.isUtc ? "set Local" : "set UTC" }), _jsx(Scheduler, { id: "test", state: state, header: { title: "Flights", classification: "ACFT" }, rows: resources, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: DefaultRowHeader, events: events, backgroundEvents: backgroundEvents, contextMenuItems: [] })] }));
|
|
122
|
-
};
|
|
123
|
-
export default Scheduler;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
export class OnClickEvent {
|
|
2
|
-
id;
|
|
3
|
-
constructor(id) {
|
|
4
|
-
this.id = id;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export class OnRangeClickEvent {
|
|
8
|
-
id;
|
|
9
|
-
constructor(id) {
|
|
10
|
-
this.id = id;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export class OnMultiClickEvent {
|
|
14
|
-
id;
|
|
15
|
-
constructor(id) {
|
|
16
|
-
this.id = id;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export class OnDoubleClickEvent {
|
|
20
|
-
id;
|
|
21
|
-
constructor(id) {
|
|
22
|
-
this.id = id;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export class OnDragEvent {
|
|
26
|
-
id;
|
|
27
|
-
constructor(id) {
|
|
28
|
-
this.id = id;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export class OnDropEvent {
|
|
32
|
-
id;
|
|
33
|
-
date;
|
|
34
|
-
constructor(id, date) {
|
|
35
|
-
this.id = id;
|
|
36
|
-
this.date = date;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export class OnDropCtrlEvent {
|
|
40
|
-
id;
|
|
41
|
-
date;
|
|
42
|
-
constructor(id, date) {
|
|
43
|
-
this.id = id;
|
|
44
|
-
this.date = date;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
export class OnClickRowEvent {
|
|
48
|
-
id;
|
|
49
|
-
constructor(id) {
|
|
50
|
-
this.id = id;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
export class OnDoubleClickRowEvent {
|
|
54
|
-
id;
|
|
55
|
-
constructor(id) {
|
|
56
|
-
this.id = id;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export class OnRightClickEvent {
|
|
60
|
-
id;
|
|
61
|
-
constructor(id) {
|
|
62
|
-
this.id = id;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export class OnStartClickHeaderEvent {
|
|
66
|
-
date;
|
|
67
|
-
constructor(date) {
|
|
68
|
-
this.date = date;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export class OnEndClickHeaderEvent {
|
|
72
|
-
date;
|
|
73
|
-
constructor(date) {
|
|
74
|
-
this.date = date;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export class OnRightClickRow {
|
|
78
|
-
id;
|
|
79
|
-
date;
|
|
80
|
-
constructor(id, date) {
|
|
81
|
-
this.id = id;
|
|
82
|
-
this.date = date;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
export class OnLeftDragStart {
|
|
86
|
-
id;
|
|
87
|
-
constructor(id) {
|
|
88
|
-
this.id = id;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
export class OnRightDragStart {
|
|
92
|
-
id;
|
|
93
|
-
constructor(id) {
|
|
94
|
-
this.id = id;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
export class OnClickRowHeader {
|
|
98
|
-
id;
|
|
99
|
-
constructor(id) {
|
|
100
|
-
this.id = id;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
export class UpdateApi {
|
|
104
|
-
constructor() {
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
export class OnClickUtc {
|
|
108
|
-
constructor() {
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
export class OnClickContextMenu {
|
|
112
|
-
id;
|
|
113
|
-
clickedMenu;
|
|
114
|
-
constructor(id, clickedMenu) {
|
|
115
|
-
this.id = id;
|
|
116
|
-
this.clickedMenu = clickedMenu;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { when } from "../../../../common/functions/dsl/UiEventDSL";
|
|
4
|
-
import { CwIcon } from "../../../display/graphics/icon/CwIcon";
|
|
5
|
-
import { getListOfNumbers, getRandomEvents } from "./helpers";
|
|
6
|
-
import { eventIsVisible } from "./logic/eventIsVisible";
|
|
7
|
-
import { getEventSizes } from "./logic/getEventSizes";
|
|
8
|
-
import { OnClickEvent, OnClickRowEvent, OnClickRowHeader, OnClickUtc, OnDoubleClickEvent, OnDragEvent, OnDropCtrlEvent, OnDropEvent, OnLeftDragStart, OnRightClickEvent, OnRightClickRow, OnRightDragStart, UpdateApi, } from "./NewSchedulerUiEvents";
|
|
9
|
-
export const eventToUiState = (it, selectedDate, visibleDays, tooltip) => {
|
|
10
|
-
const { left, width } = getEventSizes(selectedDate, visibleDays, it.startDate, it.endDate);
|
|
11
|
-
const eventState = {
|
|
12
|
-
...it,
|
|
13
|
-
left,
|
|
14
|
-
width,
|
|
15
|
-
tooltip: tooltip,
|
|
16
|
-
selected: false,
|
|
17
|
-
isResizable: false,
|
|
18
|
-
isDraggable: false,
|
|
19
|
-
};
|
|
20
|
-
return eventState;
|
|
21
|
-
};
|
|
22
|
-
export const SchedulerPresenter = () => {
|
|
23
|
-
const [events, setEvents] = useState([]);
|
|
24
|
-
const [backgroundEvents, setBackgroundEvents] = useState([]);
|
|
25
|
-
const [uiState, setUiState] = useState(() => {
|
|
26
|
-
const visibleDays = 1;
|
|
27
|
-
const selectedDate = new Date("2024-12-03");
|
|
28
|
-
const isHeaderVisible = true;
|
|
29
|
-
return {
|
|
30
|
-
isUtc: false,
|
|
31
|
-
selectedDate: selectedDate,
|
|
32
|
-
isHeaderVisible: isHeaderVisible,
|
|
33
|
-
visibleDays: visibleDays,
|
|
34
|
-
rowsHeight: 2,
|
|
35
|
-
visibleRows: 8,
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
const [resources, setResources] = useState([]);
|
|
39
|
-
const selectedEventRef = useRef("");
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
updateDataFromApi();
|
|
42
|
-
}, []);
|
|
43
|
-
const updateDataFromApi = () => {
|
|
44
|
-
const rows = 1;
|
|
45
|
-
// api call here to events
|
|
46
|
-
const apiEvents = getListOfNumbers(rows).flatMap((e) => {
|
|
47
|
-
return getRandomEvents(uiState.selectedDate, uiState.visibleDays * 3, e);
|
|
48
|
-
});
|
|
49
|
-
const eventsWithSizes = apiEvents.map((it) => {
|
|
50
|
-
return eventToUiState(it, uiState.selectedDate, uiState.visibleDays, _jsxs("div", { children: [it.startDate.getHours() + ":" + it.startDate.getMinutes(), " -", it.endDate.getHours() + ":" + it.endDate.getMinutes()] }));
|
|
51
|
-
});
|
|
52
|
-
const visibleEvents = eventsWithSizes.filter((event) => {
|
|
53
|
-
return eventIsVisible(event.startDate, event.endDate, uiState.selectedDate, uiState.visibleDays);
|
|
54
|
-
});
|
|
55
|
-
setEvents(visibleEvents);
|
|
56
|
-
const apiBackgroundEvents = getListOfNumbers(1).map((e) => {
|
|
57
|
-
const backgroundEvent = {
|
|
58
|
-
id: e.toString(),
|
|
59
|
-
rowId: e.toString(),
|
|
60
|
-
color: "orange",
|
|
61
|
-
isResizable: false,
|
|
62
|
-
isDraggable: false,
|
|
63
|
-
width: 100 / uiState.visibleDays,
|
|
64
|
-
name: "Birthday",
|
|
65
|
-
icons: _jsx(CwIcon, { iconId: "house", style: { padding: "0.5rem" } }, "cosa"),
|
|
66
|
-
startDate: new Date(),
|
|
67
|
-
left: 0,
|
|
68
|
-
endDate: new Date(),
|
|
69
|
-
isVisible: true,
|
|
70
|
-
selected: false,
|
|
71
|
-
};
|
|
72
|
-
return backgroundEvent;
|
|
73
|
-
});
|
|
74
|
-
setBackgroundEvents(apiBackgroundEvents);
|
|
75
|
-
// api call here to rows
|
|
76
|
-
const apiRows = getListOfNumbers(rows).map((e) => {
|
|
77
|
-
return {
|
|
78
|
-
resourceId: e.toString(),
|
|
79
|
-
title: "JAC" + e,
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
const headerProps = apiRows.map((row) => {
|
|
83
|
-
return {
|
|
84
|
-
rowId: row.resourceId,
|
|
85
|
-
title: row.title,
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
setResources(headerProps);
|
|
89
|
-
};
|
|
90
|
-
const onEvent = (event) => {
|
|
91
|
-
when(event)
|
|
92
|
-
.case(OnClickEvent, (event) => {
|
|
93
|
-
console.log("onClick event: " + event.id);
|
|
94
|
-
})
|
|
95
|
-
.case(OnDoubleClickEvent, (event) => {
|
|
96
|
-
const eventData = resources
|
|
97
|
-
.map((resource) => {
|
|
98
|
-
const element = events
|
|
99
|
-
.filter((it) => {
|
|
100
|
-
return it.rowId === resource.rowId;
|
|
101
|
-
})
|
|
102
|
-
.find((it) => it.id == event.id);
|
|
103
|
-
return element;
|
|
104
|
-
})
|
|
105
|
-
.filter((it) => it !== undefined)[0];
|
|
106
|
-
console.log("found", eventData?.startDate, eventData?.endDate);
|
|
107
|
-
})
|
|
108
|
-
.case(OnDragEvent, (event) => {
|
|
109
|
-
console.log("onDrag event: " + event.id);
|
|
110
|
-
selectedEventRef.current = event.id;
|
|
111
|
-
console.log("selectedEvent set to: " + selectedEventRef.current);
|
|
112
|
-
})
|
|
113
|
-
.case(OnDropEvent, (event) => {
|
|
114
|
-
console.log("onDrop event: " + selectedEventRef.current + " to row: " + event.id);
|
|
115
|
-
setEvents((prevEvents) => {
|
|
116
|
-
// Find the index of the event to be updated
|
|
117
|
-
const eventIndex = prevEvents.findIndex((e) => e.id === selectedEventRef.current);
|
|
118
|
-
// If event is found, create a new array with the updated event
|
|
119
|
-
const updatedEvents = [...prevEvents];
|
|
120
|
-
updatedEvents[eventIndex] = {
|
|
121
|
-
...updatedEvents[eventIndex],
|
|
122
|
-
rowId: event.id,
|
|
123
|
-
};
|
|
124
|
-
return updatedEvents;
|
|
125
|
-
});
|
|
126
|
-
console.log("drop on");
|
|
127
|
-
selectedEventRef.current = ""; // Reset the selected event ref
|
|
128
|
-
})
|
|
129
|
-
.case(OnDropCtrlEvent, (event) => {
|
|
130
|
-
alert(`Clicked row is ${event.id}`);
|
|
131
|
-
})
|
|
132
|
-
.case(OnClickRowEvent, (event) => {
|
|
133
|
-
alert(`Clicked row is ${event.id}`);
|
|
134
|
-
})
|
|
135
|
-
.case(OnRightClickEvent, (event) => {
|
|
136
|
-
alert(`RightClick event ${event.id}`);
|
|
137
|
-
})
|
|
138
|
-
.case(OnRightClickRow, (event) => {
|
|
139
|
-
alert(`RightClick row ${event.id}`);
|
|
140
|
-
})
|
|
141
|
-
.case(OnLeftDragStart, (event) => {
|
|
142
|
-
alert(`Start left Drag ${event.id}`);
|
|
143
|
-
})
|
|
144
|
-
.case(OnRightDragStart, (event) => {
|
|
145
|
-
alert(`Start Right Drag ${event.id}`);
|
|
146
|
-
})
|
|
147
|
-
.case(UpdateApi, () => {
|
|
148
|
-
updateDataFromApi();
|
|
149
|
-
})
|
|
150
|
-
.case(OnClickRowHeader, (event) => {
|
|
151
|
-
console.log(`Clicked row ${event.id}`);
|
|
152
|
-
})
|
|
153
|
-
.case(OnClickUtc, () => {
|
|
154
|
-
setUiState((old) => {
|
|
155
|
-
return { ...old, isUtc: !old.isUtc };
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
return {
|
|
160
|
-
state: uiState,
|
|
161
|
-
resources: resources,
|
|
162
|
-
events,
|
|
163
|
-
backgroundEvents,
|
|
164
|
-
onEvent: onEvent,
|
|
165
|
-
};
|
|
166
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderDivision.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import moment from "moment";
|
|
3
|
-
import styles from "../../styles/scheduler-header.module.css";
|
|
4
|
-
export const SchedulerHeaderDivision = ({ topDivisions, bottomDivisions, classification, topWidth, startDate, endDate }) => {
|
|
5
|
-
const isToday = () => {
|
|
6
|
-
if (!startDate)
|
|
7
|
-
return false;
|
|
8
|
-
const today = moment();
|
|
9
|
-
if (endDate) {
|
|
10
|
-
return today.isBetween(startDate, endDate, 'day', '[]');
|
|
11
|
-
}
|
|
12
|
-
return today.isSame(startDate, 'day');
|
|
13
|
-
};
|
|
14
|
-
return (_jsxs("div", { style: {
|
|
15
|
-
width: topWidth,
|
|
16
|
-
cursor: "pointer"
|
|
17
|
-
}, children: [_jsx("div", { className: `${styles["scheduler-dates"]} ${isToday() ? styles["current-day"] : ""}`, children: _jsx("span", { children: topDivisions }) }), _jsx("div", { style: { display: "flex", justifyContent: "space-between", flex: 1 }, children: bottomDivisions.map((element) => (_jsx("div", { className: styles["scheduler-hours"], children: _jsx("span", { children: element }) }, classification + element + topDivisions))) })] }));
|
|
18
|
-
};
|
|
19
|
-
export const _preview = () => {
|
|
20
|
-
const today = new Date();
|
|
21
|
-
return (_jsx(SchedulerHeaderDivision, { topDivisions: new Date().toLocaleDateString(), bottomDivisions: [
|
|
22
|
-
new Date(1, 1, 1).toLocaleDateString(),
|
|
23
|
-
new Date(1, 2, 3).toLocaleDateString(),
|
|
24
|
-
new Date(2, 2, 2).toLocaleDateString(),
|
|
25
|
-
], classification: "test", startDate: today, endDate: today }));
|
|
26
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/header/HeaderTitle.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styles from "../../styles/scheduler-header.module.css";
|
|
3
|
-
export const HeaderTitle = ({ title, dividerText, width }) => {
|
|
4
|
-
return (_jsxs("div", { className: styles["scheduler-header-title"], style: { width: width }, children: [_jsx("div", { children: _jsx("h5", { children: title }) }), _jsx("div", { children: _jsx("span", { children: dividerText }) })] }));
|
|
5
|
-
};
|
|
6
|
-
export const _preview = () => {
|
|
7
|
-
return _jsx(HeaderTitle, { title: "Test title", dividerText: "Divider test", width: 5 });
|
|
8
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/header/SchedulerHeader.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import moment from "moment";
|
|
3
|
-
import { dateFromPercentage } from "../../logic/dateFromPercentage";
|
|
4
|
-
import { getPercentageFromMouseEvent } from "../../logic/getPercentageFromMouseEvent";
|
|
5
|
-
import { OnEndClickHeaderEvent, OnStartClickHeaderEvent } from "../../NewSchedulerUiEvents";
|
|
6
|
-
import styles from "../../styles/scheduler-header.module.css";
|
|
7
|
-
import { TimeLine } from "../timeline/TimeLine";
|
|
8
|
-
import { SchedulerHeaderDivision } from "./HeaderDivision";
|
|
9
|
-
import { HeaderTitle } from "./HeaderTitle";
|
|
10
|
-
export const SchedulerHeader = ({ content, divisions, visibleDays, selectedDate, width, onEvent, timeLinePercentage, isUtc }) => {
|
|
11
|
-
const topWidth = (100 / visibleDays);
|
|
12
|
-
const { title, classification } = content;
|
|
13
|
-
return (_jsxs("div", { style: { display: "flex" }, children: [_jsx(HeaderTitle, { title: title, dividerText: classification, width: width }), _jsxs("div", { className: styles["scheduler-header-divisions"], style: { flex: 1, display: "flex", position: "relative" }, onMouseDown: (e) => {
|
|
14
|
-
e.preventDefault();
|
|
15
|
-
const clickPercentage = getPercentageFromMouseEvent(e);
|
|
16
|
-
const date = dateFromPercentage(selectedDate, visibleDays, clickPercentage);
|
|
17
|
-
onEvent(new OnStartClickHeaderEvent(date));
|
|
18
|
-
}, onMouseUp: (e) => {
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
const clickPercentage = getPercentageFromMouseEvent(e);
|
|
21
|
-
const date = dateFromPercentage(selectedDate, visibleDays, clickPercentage);
|
|
22
|
-
onEvent(new OnEndClickHeaderEvent(date));
|
|
23
|
-
}, children: [divisions.map((day) => {
|
|
24
|
-
const thisTopWidth = visibleDays > 15
|
|
25
|
-
? topWidth * day.bottom.length
|
|
26
|
-
: topWidth;
|
|
27
|
-
const dateStr = day.startDate ? moment(day.startDate) : moment(day.top, "DD.MM.YYYY");
|
|
28
|
-
const startDate = dateStr.toDate();
|
|
29
|
-
const endDate = day.endDate ? moment(day.endDate).toDate() : undefined;
|
|
30
|
-
return (_jsx(SchedulerHeaderDivision, { topDivisions: day.top, bottomDivisions: day.bottom, classification: classification, topWidth: thisTopWidth + "%", startDate: startDate, endDate: endDate }, day.top + classification));
|
|
31
|
-
}), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (_jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "50%", height: "50%", isHeader: true, isUtc: isUtc }))] })] }));
|
|
32
|
-
};
|
|
33
|
-
export const _preview = () => {
|
|
34
|
-
const header = {
|
|
35
|
-
width: 100,
|
|
36
|
-
content: {
|
|
37
|
-
title: "Flights",
|
|
38
|
-
classification: "Aircraft/Time",
|
|
39
|
-
},
|
|
40
|
-
isUtc: true,
|
|
41
|
-
divisions: [
|
|
42
|
-
{
|
|
43
|
-
top: "Aug 21",
|
|
44
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"],
|
|
45
|
-
startDate: new Date(2024, 7, 21), // Mes es 0-based, así que 7 es Agosto
|
|
46
|
-
endDate: new Date(2024, 7, 21)
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
top: "Aug 22",
|
|
50
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"],
|
|
51
|
-
startDate: new Date(2024, 7, 22),
|
|
52
|
-
endDate: new Date(2024, 7, 22)
|
|
53
|
-
},
|
|
54
|
-
/*{
|
|
55
|
-
top: "Aug 23",
|
|
56
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"]
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
top: "Aug 24",
|
|
60
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"]
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
top: "Aug 25",
|
|
64
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"]
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
top: "Aug 26",
|
|
68
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"]
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
top: "Aug 27",
|
|
72
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"]
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
top: "Aug 28",
|
|
76
|
-
bottom: ["12am", "3am", "6am", "9am", "12pm", "3pm", "6pm", "9pm"]
|
|
77
|
-
}*/
|
|
78
|
-
],
|
|
79
|
-
visibleDays: 2,
|
|
80
|
-
selectedDate: new Date(),
|
|
81
|
-
timeLinePercentage: 50,
|
|
82
|
-
onEvent: () => {
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
return _jsx(SchedulerHeader, { ...header });
|
|
86
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|