@cwellt_software/cwellt-reactjs-lib 1.2.14 → 1.2.15
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 +30 -30
- package/dist/index.css +1 -1
- package/dist/index.es.js +30 -30
- 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/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,42 +0,0 @@
|
|
|
1
|
-
import { getMonthsByDays, } from "../../../../../../src/components/custom/scheduler-new/presentation/logic/getDefaultDivisions";
|
|
2
|
-
describe("getMonthdivisions", () => {
|
|
3
|
-
test("should return empty list if 0 days", () => {
|
|
4
|
-
expect(getMonthsByDays(0, new Date("2024-10-13"))).toStrictEqual([]);
|
|
5
|
-
});
|
|
6
|
-
test("should return empty list if 0 days", () => {
|
|
7
|
-
expect(getMonthsByDays(1, new Date("2024-10-13"))).toStrictEqual([
|
|
8
|
-
{
|
|
9
|
-
start: new Date("2024-10-13"),
|
|
10
|
-
days: 1
|
|
11
|
-
}
|
|
12
|
-
]);
|
|
13
|
-
});
|
|
14
|
-
test("should return 2 divisions 31 days", () => {
|
|
15
|
-
expect(getMonthsByDays(31, new Date("2024-12-30"))).toStrictEqual([
|
|
16
|
-
{
|
|
17
|
-
start: new Date("2024-12-30"),
|
|
18
|
-
days: 2
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
start: new Date("2025-01-01"),
|
|
22
|
-
days: 29
|
|
23
|
-
}
|
|
24
|
-
]);
|
|
25
|
-
});
|
|
26
|
-
test("should return 3 divisions 45 days", () => {
|
|
27
|
-
expect(getMonthsByDays(45, new Date("2024-12-30"))).toStrictEqual([
|
|
28
|
-
{
|
|
29
|
-
start: new Date("2024-12-30"),
|
|
30
|
-
days: 2
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
start: new Date("2025-01-01"),
|
|
34
|
-
days: 31
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
start: new Date("2025-02-01"),
|
|
38
|
-
days: 12
|
|
39
|
-
}
|
|
40
|
-
]);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { getWeekendLinesByDatesVisible, getWeekendsDaysInDateRange } from "../../../../../../src/components/custom/scheduler-new/presentation/logic/WeekendCalc";
|
|
2
|
-
describe("getWeekendsDaysInDateRange", () => {
|
|
3
|
-
test("from monday to friday should return 0 days", () => {
|
|
4
|
-
const days = getWeekendsDaysInDateRange(new Date("2004-03-22"), 5);
|
|
5
|
-
expect(days.length).toBe(0);
|
|
6
|
-
});
|
|
7
|
-
test("from monday to sunday should return 2 days", () => {
|
|
8
|
-
const days = getWeekendsDaysInDateRange(new Date("2004-03-22"), 7);
|
|
9
|
-
expect(days.length).toBe(2);
|
|
10
|
-
});
|
|
11
|
-
test("from monday to sunday should return saturday and sunday of the week", () => {
|
|
12
|
-
const days = getWeekendsDaysInDateRange(new Date("2004-03-22"), 7);
|
|
13
|
-
expect(days[0].toString()).toStrictEqual(new Date("2004-03-27").toString());
|
|
14
|
-
expect(days[1].toString()).toStrictEqual(new Date("2004-03-28").toString());
|
|
15
|
-
});
|
|
16
|
-
test("from monday to sunday in two weeks should return 4 days", () => {
|
|
17
|
-
const days = getWeekendsDaysInDateRange(new Date("2004-03-22"), 14);
|
|
18
|
-
expect(days.length).toBe(4);
|
|
19
|
-
});
|
|
20
|
-
test("from sunday to sunday in two weeks should return 3 days", () => {
|
|
21
|
-
const days = getWeekendsDaysInDateRange(new Date("2004-03-28"), 8);
|
|
22
|
-
expect(days.length).toBe(3);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
describe("getWeekendLinesByDatesVisible", () => {
|
|
26
|
-
test("from day 28-11-24 to 5 days show return 2 positive widths", () => {
|
|
27
|
-
const days = getWeekendLinesByDatesVisible(new Date("2024-11-28"), 5);
|
|
28
|
-
expect(days[1].width).toBeGreaterThan(0);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { addMinutesToDateFromPx } from "../../../../src/components/custom/scheduler/logic/dates/addMinutesToDateFromPx";
|
|
2
|
-
describe("addMinutesToDateFromPx", () => {
|
|
3
|
-
it("should correctly add minutes to the original date", () => {
|
|
4
|
-
const originalDate = new Date("2023-01-01T00:00:00Z");
|
|
5
|
-
const leftPx = 100;
|
|
6
|
-
const minutesPerPx = 10;
|
|
7
|
-
const expectedDate = new Date("2023-01-01T00:10:00Z");
|
|
8
|
-
const result = addMinutesToDateFromPx(originalDate, leftPx, minutesPerPx);
|
|
9
|
-
expect(result).toEqual(expectedDate);
|
|
10
|
-
});
|
|
11
|
-
it("should handle zero pixels correctly", () => {
|
|
12
|
-
const originalDate = new Date("2023-01-01T00:00:00Z");
|
|
13
|
-
const leftPx = 0;
|
|
14
|
-
const minutesPerPx = 10;
|
|
15
|
-
const expectedDate = new Date("2023-01-01T00:00:00Z");
|
|
16
|
-
const result = addMinutesToDateFromPx(originalDate, leftPx, minutesPerPx);
|
|
17
|
-
expect(result).toEqual(expectedDate);
|
|
18
|
-
});
|
|
19
|
-
it("should handle negative pixel values correctly", () => {
|
|
20
|
-
const originalDate = new Date("2023-01-01T00:00:00Z");
|
|
21
|
-
const leftPx = -50;
|
|
22
|
-
const minutesPerPx = 10;
|
|
23
|
-
const expectedDate = new Date("2022-12-31T23:55:00Z");
|
|
24
|
-
const result = addMinutesToDateFromPx(originalDate, leftPx, minutesPerPx);
|
|
25
|
-
expect(result).toEqual(expectedDate);
|
|
26
|
-
});
|
|
27
|
-
it("should handle non-integer minutes per pixel correctly", () => {
|
|
28
|
-
const originalDate = new Date("2023-01-01T00:00:00Z");
|
|
29
|
-
const leftPx = 46.5;
|
|
30
|
-
const minutesPerPx = 15.5;
|
|
31
|
-
const expectedDate = new Date("2023-01-01T00:03:00Z");
|
|
32
|
-
const result = addMinutesToDateFromPx(originalDate, leftPx, minutesPerPx);
|
|
33
|
-
expect(result).toEqual(expectedDate);
|
|
34
|
-
});
|
|
35
|
-
it("should handle non-integer pixel values correctly", () => {
|
|
36
|
-
const originalDate = new Date("2023-01-01T00:00:00Z");
|
|
37
|
-
const leftPx = 75.5;
|
|
38
|
-
const minutesPerPx = 10;
|
|
39
|
-
const expectedDate = new Date("2023-01-01T00:07:33Z");
|
|
40
|
-
const result = addMinutesToDateFromPx(originalDate, leftPx, minutesPerPx);
|
|
41
|
-
expect(result).toEqual(expectedDate);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { checkIfSlotAvailable } from "../../../../src/components/custom/scheduler/logic/ui/checkIfSlotAvailable";
|
|
2
|
-
import { cblEvent } from "../../../../src/components/custom/scheduler/state/cblEvent";
|
|
3
|
-
describe("checkIfSlotAvailable", () => {
|
|
4
|
-
const baseDate = new Date("2023-01-01T00:00:00");
|
|
5
|
-
test("returns true when event starts after the last event ends", () => {
|
|
6
|
-
const events = [new cblEvent(new Date(baseDate.getTime()), new Date(baseDate.getTime() + 3600000), 1)];
|
|
7
|
-
const newEvent = new cblEvent(new Date(baseDate.getTime() + 3600001), new Date(baseDate.getTime() + 7200000), 1);
|
|
8
|
-
expect(checkIfSlotAvailable(events, newEvent)).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
test("returns false when event starts before the last event ends", () => {
|
|
11
|
-
const events = [new cblEvent(new Date(baseDate.getTime()), new Date(baseDate.getTime() + 3600000), 1)];
|
|
12
|
-
const newEvent = new cblEvent(new Date(baseDate.getTime() + 3599999), new Date(baseDate.getTime() + 7200000), 1);
|
|
13
|
-
expect(checkIfSlotAvailable(events, newEvent)).toBe(false);
|
|
14
|
-
});
|
|
15
|
-
test("returns true when the last event is full height, regardless of timing", () => {
|
|
16
|
-
const events = [new cblEvent(new Date(baseDate.getTime()), new Date(baseDate.getTime() + 3600000), 1, null, true)];
|
|
17
|
-
const newEvent = new cblEvent(new Date(baseDate.getTime() + 1800000), new Date(baseDate.getTime() + 5400000), 1);
|
|
18
|
-
expect(checkIfSlotAvailable(events, newEvent)).toBe(true);
|
|
19
|
-
});
|
|
20
|
-
test("returns true when events array is empty", () => {
|
|
21
|
-
const events = [];
|
|
22
|
-
const newEvent = new cblEvent(new Date(baseDate.getTime()), new Date(baseDate.getTime() + 3600000), 1);
|
|
23
|
-
expect(checkIfSlotAvailable(events, newEvent)).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
test("returns true when new event starts exactly when last event ends", () => {
|
|
26
|
-
const events = [new cblEvent(new Date(baseDate.getTime()), new Date(baseDate.getTime() + 3600000), 1)];
|
|
27
|
-
const newEvent = new cblEvent(new Date(baseDate.getTime() + 3600000), new Date(baseDate.getTime() + 7200000), 1);
|
|
28
|
-
expect(checkIfSlotAvailable(events, newEvent)).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { daysBetweenTwoDates } from "../../../../src/components/custom/scheduler/logic/dates/daysBetweenTwoDates";
|
|
2
|
-
describe("daysBetweenTwoDates", () => {
|
|
3
|
-
test("should return 0 for the same dates", () => {
|
|
4
|
-
const date1 = new Date("2024-07-19");
|
|
5
|
-
const date2 = new Date("2024-07-19");
|
|
6
|
-
const result = daysBetweenTwoDates(date1, date2);
|
|
7
|
-
expect(result).toBe(0);
|
|
8
|
-
});
|
|
9
|
-
test("should return 1 for dates one day apart", () => {
|
|
10
|
-
const date1 = new Date("2024-07-18");
|
|
11
|
-
const date2 = new Date("2024-07-19");
|
|
12
|
-
const result = daysBetweenTwoDates(date1, date2);
|
|
13
|
-
expect(result).toBe(1);
|
|
14
|
-
});
|
|
15
|
-
test("handles reverse order of dates", () => {
|
|
16
|
-
const date1 = new Date("2023-01-01");
|
|
17
|
-
const date2 = new Date("2023-01-05");
|
|
18
|
-
expect(daysBetweenTwoDates(date2, date1)).toBe(4);
|
|
19
|
-
});
|
|
20
|
-
test("handles dates across months", () => {
|
|
21
|
-
const date1 = new Date("2023-01-31");
|
|
22
|
-
const date2 = new Date("2023-02-02");
|
|
23
|
-
expect(daysBetweenTwoDates(date1, date2)).toBe(2);
|
|
24
|
-
});
|
|
25
|
-
test("handles dates across years", () => {
|
|
26
|
-
const date1 = new Date("2022-12-31");
|
|
27
|
-
const date2 = new Date("2023-01-01");
|
|
28
|
-
expect(daysBetweenTwoDates(date1, date2)).toBe(1);
|
|
29
|
-
});
|
|
30
|
-
test("handles leap year", () => {
|
|
31
|
-
const date1 = new Date("2024-02-28");
|
|
32
|
-
const date2 = new Date("2024-03-01");
|
|
33
|
-
expect(daysBetweenTwoDates(date1, date2)).toBe(2);
|
|
34
|
-
});
|
|
35
|
-
test("should return 1 for dates hours apart", () => {
|
|
36
|
-
const date1 = new Date("2024-07-19T00:00:00");
|
|
37
|
-
const date2 = new Date("2024-07-19T01:00:00");
|
|
38
|
-
const result = daysBetweenTwoDates(date1, date2);
|
|
39
|
-
expect(result).toBe(1);
|
|
40
|
-
});
|
|
41
|
-
test("doesn't handles daylight saving time change (spring forward)", () => {
|
|
42
|
-
// Note: This test assumes a timezone that observes DST
|
|
43
|
-
const date1 = new Date("2023-03-12T01:59:59-05:00");
|
|
44
|
-
const date2 = new Date("2023-03-12T03:00:00-04:00");
|
|
45
|
-
// TODO: should be 0 change after the refactor
|
|
46
|
-
expect(daysBetweenTwoDates(date1, date2)).toBe(1);
|
|
47
|
-
});
|
|
48
|
-
test("handles daylight saving time change (fall back)", () => {
|
|
49
|
-
// Using America/New_York timezone for this test
|
|
50
|
-
const date1 = new Date("2023-11-05T01:59:59-04:00");
|
|
51
|
-
const date2 = new Date("2023-11-05T01:00:00-05:00");
|
|
52
|
-
// TODO: should be 0 change after the refactor
|
|
53
|
-
expect(daysBetweenTwoDates(date1, date2)).toBe(1);
|
|
54
|
-
});
|
|
55
|
-
test("should return 30 for dates one month apart (June to July)", () => {
|
|
56
|
-
const date1 = new Date("2024-06-19");
|
|
57
|
-
const date2 = new Date("2024-07-19");
|
|
58
|
-
const result = daysBetweenTwoDates(date1, date2);
|
|
59
|
-
expect(result).toBe(30);
|
|
60
|
-
});
|
|
61
|
-
});
|
package/dist/test/components/custom/scheduler/daysBetweenTwoDatesWithoutCeilForEvent.test.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { daysBetweenTwoDatesIncludingBoth } from "../../../../src/components/custom/scheduler/logic/dates/daysBetweenTwoDatesWithoutCeil";
|
|
2
|
-
describe("daysBetweenTwoDatesWithoutCeilForEvent", () => {
|
|
3
|
-
test("should return 0 for the same dates", () => {
|
|
4
|
-
const date1 = new Date("2024-07-19");
|
|
5
|
-
const date2 = new Date("2024-07-19");
|
|
6
|
-
const result = daysBetweenTwoDatesIncludingBoth(date1, date2);
|
|
7
|
-
expect(result).toBe(0);
|
|
8
|
-
});
|
|
9
|
-
test("should return 1 for dates one day apart", () => {
|
|
10
|
-
const date1 = new Date("2024-07-18");
|
|
11
|
-
const date2 = new Date("2024-07-19");
|
|
12
|
-
const result = daysBetweenTwoDatesIncludingBoth(date1, date2);
|
|
13
|
-
expect(result).toBe(1);
|
|
14
|
-
});
|
|
15
|
-
test("should return 0.5 for dates 12 hours apart", () => {
|
|
16
|
-
const date1 = new Date("2024-07-19T00:00:00");
|
|
17
|
-
const date2 = new Date("2024-07-19T12:00:00");
|
|
18
|
-
const result = daysBetweenTwoDatesIncludingBoth(date1, date2);
|
|
19
|
-
expect(result).toBe(0.5);
|
|
20
|
-
});
|
|
21
|
-
test("should return 30 for dates one month apart (June to July)", () => {
|
|
22
|
-
const date1 = new Date("2024-06-19");
|
|
23
|
-
const date2 = new Date("2024-07-19");
|
|
24
|
-
const result = daysBetweenTwoDatesIncludingBoth(date1, date2);
|
|
25
|
-
expect(result).toBe(30);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { getGUID } from "../../../../src/components/custom/scheduler/logic/strings/getGUID";
|
|
2
|
-
describe("getGUID", () => {
|
|
3
|
-
it("should return a string", () => {
|
|
4
|
-
const result = getGUID();
|
|
5
|
-
expect(typeof result).toBe("string");
|
|
6
|
-
});
|
|
7
|
-
it("should return a string of length 36", () => {
|
|
8
|
-
const result = getGUID();
|
|
9
|
-
expect(result.length).toBe(36);
|
|
10
|
-
});
|
|
11
|
-
it("should return a string with four hyphens", () => {
|
|
12
|
-
const result = getGUID();
|
|
13
|
-
const hyphens = result.match(/-/g);
|
|
14
|
-
expect(hyphens).toHaveLength(4);
|
|
15
|
-
});
|
|
16
|
-
it("should return a string with hyphens at positions 8 and 13", () => {
|
|
17
|
-
const result = getGUID();
|
|
18
|
-
expect(result.charAt(8)).toBe("-");
|
|
19
|
-
expect(result.charAt(13)).toBe("-");
|
|
20
|
-
});
|
|
21
|
-
it("should return a string with only hexadecimal characters and hyphens", () => {
|
|
22
|
-
const result = getGUID();
|
|
23
|
-
expect(result).toMatch(/^[0-9a-f-]+$/i);
|
|
24
|
-
});
|
|
25
|
-
it("should return different GUIDs on subsequent calls", () => {
|
|
26
|
-
const guid1 = getGUID();
|
|
27
|
-
const guid2 = getGUID();
|
|
28
|
-
expect(guid1).not.toBe(guid2);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getLeftPixels, } from "../../../../src/components/custom/scheduler/logic/pixels/getPixelsForEvent";
|
|
2
|
-
describe("getLeftPixels", () => {
|
|
3
|
-
it("should calculate pixels correctly when stateStart is after eventStart", () => {
|
|
4
|
-
const stateStart = new Date("2024-01-10");
|
|
5
|
-
const eventStart = new Date("2024-01-01");
|
|
6
|
-
const dayPx = 10;
|
|
7
|
-
const result = getLeftPixels(stateStart, eventStart, dayPx);
|
|
8
|
-
expect(result).toBe(90);
|
|
9
|
-
});
|
|
10
|
-
it("should return 0 if eventStart is before newStart", () => {
|
|
11
|
-
const eventStart = new Date("2024-01-01");
|
|
12
|
-
const newStart = new Date("2024-01-10");
|
|
13
|
-
const dayPx = 10;
|
|
14
|
-
const result = getLeftPixels(eventStart, newStart, dayPx);
|
|
15
|
-
expect(result).toBe(0);
|
|
16
|
-
});
|
|
17
|
-
it("should return good if eventStart is 16.10.2024 12:00 and start is 14-10-2024", () => {
|
|
18
|
-
const eventStart = new Date("2024-10-16T12:00:00Z");
|
|
19
|
-
const newStart = new Date("2024-10-14");
|
|
20
|
-
const dayPx = 10;
|
|
21
|
-
const result = getLeftPixels(eventStart, newStart, dayPx);
|
|
22
|
-
expect(result).toBe(25);
|
|
23
|
-
});
|
|
24
|
-
it("should return", () => {
|
|
25
|
-
const eventStart = new Date("2024-11-04T04:10:00Z");
|
|
26
|
-
const newStart = new Date("2024-11-04");
|
|
27
|
-
const dayPx = 1;
|
|
28
|
-
const result = getLeftPixels(eventStart, newStart, dayPx);
|
|
29
|
-
expect(result).toBeCloseTo(0.173);
|
|
30
|
-
});
|
|
31
|
-
it("should return", () => {
|
|
32
|
-
const eventStart = new Date("2024-11-04T15:05:00Z");
|
|
33
|
-
const newStart = new Date("2024-11-04");
|
|
34
|
-
const dayPx = 1;
|
|
35
|
-
const result = getLeftPixels(eventStart, newStart, dayPx);
|
|
36
|
-
expect(result).toBeCloseTo(0.628);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { getTimeHeaders } from "../../../../src/components/custom/scheduler/logic/ui/getTimeHeaders";
|
|
2
|
-
describe("getTimeHeaders", () => {
|
|
3
|
-
it("should return correct array of dates for summer offset", () => {
|
|
4
|
-
const startDate = new Date("2024-07-01T00:00:00Z");
|
|
5
|
-
const endDate = new Date("2024-07-01T02:00:00Z");
|
|
6
|
-
const result = getTimeHeaders(startDate, endDate);
|
|
7
|
-
expect(result).toEqual([new Date("2024-07-01T00:00:00Z"), new Date("2024-07-01T01:00:00Z")]);
|
|
8
|
-
});
|
|
9
|
-
it("should handle empty range", () => {
|
|
10
|
-
const startDate = new Date("2024-07-01T00:00:00Z");
|
|
11
|
-
const endDate = new Date("2024-07-01T00:00:00Z");
|
|
12
|
-
const result = getTimeHeaders(startDate, endDate);
|
|
13
|
-
expect(result).toEqual([]);
|
|
14
|
-
});
|
|
15
|
-
it("should handle different time zones correctly", () => {
|
|
16
|
-
const startDate = new Date("2024-07-01T00:00:00+02:00");
|
|
17
|
-
const endDate = new Date("2024-07-01T03:00:00+02:00");
|
|
18
|
-
const result = getTimeHeaders(startDate, endDate);
|
|
19
|
-
expect(result).toEqual([
|
|
20
|
-
new Date("2024-07-01T00:00:00+02:00"),
|
|
21
|
-
new Date("2024-07-01T01:00:00+02:00"),
|
|
22
|
-
new Date("2024-07-01T02:00:00+02:00")
|
|
23
|
-
]);
|
|
24
|
-
});
|
|
25
|
-
it("should handle date ranges spanning multiple days", () => {
|
|
26
|
-
const startDate = new Date("2024-07-01T23:00:00Z");
|
|
27
|
-
const endDate = new Date("2024-07-02T02:00:00Z");
|
|
28
|
-
const result = getTimeHeaders(startDate, endDate);
|
|
29
|
-
expect(result).toEqual([
|
|
30
|
-
new Date("2024-07-01T23:00:00Z"),
|
|
31
|
-
new Date("2024-07-02T00:00:00Z"),
|
|
32
|
-
new Date("2024-07-02T01:00:00Z")
|
|
33
|
-
]);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { hasSameProperties } from "../../../../src/components/custom/scheduler/logic/filtering/hasSameProperties";
|
|
2
|
-
import { cblEvent } from "../../../../src/components/custom/scheduler/state/cblEvent";
|
|
3
|
-
describe("hasSameProperties", () => {
|
|
4
|
-
it("should return true for events with the same properties", () => {
|
|
5
|
-
const event1 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
6
|
-
key: "value"
|
|
7
|
-
});
|
|
8
|
-
const event2 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
9
|
-
key: "value"
|
|
10
|
-
});
|
|
11
|
-
expect(hasSameProperties(event1, event2)).toBe(false);
|
|
12
|
-
// TODO: this test is testing old behavior of scheduler
|
|
13
|
-
// must be changed to .toBe(true)
|
|
14
|
-
});
|
|
15
|
-
it("should return false for events with different resourceId", () => {
|
|
16
|
-
const event1 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
17
|
-
key: "value"
|
|
18
|
-
});
|
|
19
|
-
const event2 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 2, {
|
|
20
|
-
key: "value"
|
|
21
|
-
});
|
|
22
|
-
expect(hasSameProperties(event1, event2)).toBe(false);
|
|
23
|
-
});
|
|
24
|
-
it("should return false for events with different start times", () => {
|
|
25
|
-
const event1 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
26
|
-
key: "value"
|
|
27
|
-
});
|
|
28
|
-
const event2 = new cblEvent(new Date("2023-07-01T11:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
29
|
-
key: "value"
|
|
30
|
-
});
|
|
31
|
-
expect(hasSameProperties(event1, event2)).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
it("should return false for events with different end times", () => {
|
|
34
|
-
const event1 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
35
|
-
key: "value"
|
|
36
|
-
});
|
|
37
|
-
const event2 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T13:00:00Z"), 1, {
|
|
38
|
-
key: "value"
|
|
39
|
-
});
|
|
40
|
-
expect(hasSameProperties(event1, event2)).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
it("should return false for events with different data", () => {
|
|
43
|
-
const event1 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
44
|
-
key: "value"
|
|
45
|
-
});
|
|
46
|
-
const event2 = new cblEvent(new Date("2023-07-01T10:00:00Z"), new Date("2023-07-01T12:00:00Z"), 1, {
|
|
47
|
-
key: "differentValue"
|
|
48
|
-
});
|
|
49
|
-
expect(hasSameProperties(event1, event2)).toBe(false);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { isAllowedToMove } from "../../../../src/components/custom/scheduler/logic/ui/isAllowedToMove";
|
|
2
|
-
import { CblDragAndDrop } from "../../../../src/components/custom/scheduler/state/CblDragAndDrop";
|
|
3
|
-
describe("isAllowedToMove", () => {
|
|
4
|
-
it("should return true if data.eventType is not 1", () => {
|
|
5
|
-
const data = { eventType: 0 };
|
|
6
|
-
const resData = {};
|
|
7
|
-
const cblDragNDrop = new CblDragAndDrop("", "", null);
|
|
8
|
-
expect(isAllowedToMove(data, resData, cblDragNDrop)).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
it("should return true if the allowed move in crewControll ", () => {
|
|
11
|
-
const data = { eventType: 1 };
|
|
12
|
-
const resData = {};
|
|
13
|
-
const cblDragNDrop = new CblDragAndDrop("acftsScheduler", "flightsPairingsScheduler", null);
|
|
14
|
-
expect(isAllowedToMove(data, resData, cblDragNDrop)).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
it("should return true if the move is not allowed but Crew ids do not match", () => {
|
|
17
|
-
const data = { eventType: 1, Crew: 1 };
|
|
18
|
-
const resData = { Crewmember_Id: 2 };
|
|
19
|
-
const cblDragNDrop = new CblDragAndDrop("", "", null);
|
|
20
|
-
expect(isAllowedToMove(data, resData, cblDragNDrop)).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
it("should return false if the move is not allowed and Crew ids match", () => {
|
|
23
|
-
const data = { eventType: 1, Crew: 1 };
|
|
24
|
-
const resData = { Crewmember_Id: 1 };
|
|
25
|
-
const cblDragNDrop = new CblDragAndDrop("", "", null);
|
|
26
|
-
expect(isAllowedToMove(data, resData, cblDragNDrop)).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
import { listOfDatesToWeekRangeList } from "../../../../src/components/custom/scheduler/logic/dates/listOfDatesToWeeks";
|
|
3
|
-
describe("listOfDatesToWeeks", () => {
|
|
4
|
-
test("empty list return empty", () => {
|
|
5
|
-
expect(listOfDatesToWeekRangeList([])).toStrictEqual([]);
|
|
6
|
-
});
|
|
7
|
-
test("1st day of week should return a weekRange of day to day", () => {
|
|
8
|
-
const start = moment("20240721", "YYYYMMDD").toDate();
|
|
9
|
-
const expected = [
|
|
10
|
-
{
|
|
11
|
-
start: start,
|
|
12
|
-
end: start,
|
|
13
|
-
days: 1,
|
|
14
|
-
isShortWeek: true
|
|
15
|
-
}
|
|
16
|
-
];
|
|
17
|
-
expect(listOfDatesToWeekRangeList([start])).toStrictEqual(expected);
|
|
18
|
-
});
|
|
19
|
-
test("7 day starting on monday should return a weekRange of monday to sunday", () => {
|
|
20
|
-
const days = [];
|
|
21
|
-
for (let i = 0; i <= 6; i++) {
|
|
22
|
-
days.push(moment("20240722").add(i, "days").toDate());
|
|
23
|
-
}
|
|
24
|
-
const expected = [
|
|
25
|
-
{
|
|
26
|
-
start: days[0],
|
|
27
|
-
end: days[6],
|
|
28
|
-
days: 7,
|
|
29
|
-
isShortWeek: false
|
|
30
|
-
}
|
|
31
|
-
];
|
|
32
|
-
const actual = listOfDatesToWeekRangeList(days);
|
|
33
|
-
expect(actual).toStrictEqual(expected);
|
|
34
|
-
});
|
|
35
|
-
test("1st day of week + 7 day should return 2 weekRanges", () => {
|
|
36
|
-
const days = [];
|
|
37
|
-
for (let i = 0; i <= 6; i++) {
|
|
38
|
-
days.push(moment("20240721").add(i, "days"));
|
|
39
|
-
}
|
|
40
|
-
const expected = [
|
|
41
|
-
{
|
|
42
|
-
start: days[0].toDate(),
|
|
43
|
-
end: days[0].toDate(),
|
|
44
|
-
isShortWeek: true,
|
|
45
|
-
days: 1
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
start: days[1].toDate(),
|
|
49
|
-
end: days[6].add(1, "days").toDate(),
|
|
50
|
-
isShortWeek: false,
|
|
51
|
-
days: 7
|
|
52
|
-
}
|
|
53
|
-
];
|
|
54
|
-
const actual = listOfDatesToWeekRangeList(days.map(element => element.toDate()));
|
|
55
|
-
expect(actual.length).toBe(2);
|
|
56
|
-
expect(actual).toStrictEqual(expected);
|
|
57
|
-
});
|
|
58
|
-
test("start on wednesday should return 1 weekRange of 5 days", () => {
|
|
59
|
-
const start = moment("20240724");
|
|
60
|
-
const startDate = start.toDate();
|
|
61
|
-
const expected = [
|
|
62
|
-
{
|
|
63
|
-
start: startDate,
|
|
64
|
-
end: start.add(4, "days").toDate(),
|
|
65
|
-
days: 5,
|
|
66
|
-
isShortWeek: true
|
|
67
|
-
}
|
|
68
|
-
];
|
|
69
|
-
const actual = listOfDatesToWeekRangeList([startDate]);
|
|
70
|
-
expect(actual).toStrictEqual(expected);
|
|
71
|
-
});
|
|
72
|
-
});
|
package/dist/test/jest.setup.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|