@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
package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getContrastColor, getHSLColor } from '../../../../../../common/functions/colorManipulation';
|
|
3
|
-
import { CwGenericTooltip } from "../../../../../display/data/generic_tooltip/CwGenericTooltip";
|
|
4
|
-
import styles from "../../styles/new-scheduler.module.css";
|
|
5
|
-
export const BackgroundEvent = ({ value, heightRem }) => {
|
|
6
|
-
const backColor = getHSLColor(value.color, value.alpha ?? 0.5);
|
|
7
|
-
const textColor = getContrastColor(value.color);
|
|
8
|
-
return value.isVisible ? (_jsx("div", { style: {
|
|
9
|
-
left: `${value.left}%`,
|
|
10
|
-
width: `${value.width}%`,
|
|
11
|
-
position: "absolute",
|
|
12
|
-
height: `${heightRem}rem`,
|
|
13
|
-
pointerEvents: "auto",
|
|
14
|
-
}, children: _jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", dissapearsWhenHover: true, showDelay: 200, children: _jsx("div", { style: {
|
|
15
|
-
overflow: "hidden",
|
|
16
|
-
backgroundColor: backColor,
|
|
17
|
-
height: `${heightRem}rem`,
|
|
18
|
-
}, children: _jsx("div", { style: {
|
|
19
|
-
display: "flex",
|
|
20
|
-
flexDirection: "row",
|
|
21
|
-
width: "100%",
|
|
22
|
-
contentVisibility: "auto",
|
|
23
|
-
height: `${heightRem}rem`,
|
|
24
|
-
}, children: _jsxs("div", { style: {
|
|
25
|
-
width: value.width + "%",
|
|
26
|
-
fontSize: "var(--cw-font-size-smallest)",
|
|
27
|
-
padding: "0.25rem",
|
|
28
|
-
color: textColor,
|
|
29
|
-
alignItems: "flex-end"
|
|
30
|
-
}, className: styles["scheduler-event-container"], children: [value.icons ? _jsx("div", { style: {
|
|
31
|
-
display: "flex",
|
|
32
|
-
flexDirection: "row",
|
|
33
|
-
alignItems: "center",
|
|
34
|
-
whiteSpace: "nowrap",
|
|
35
|
-
color: textColor,
|
|
36
|
-
}, children: value.icons }) : null, _jsx("span", { className: styles["scheduler-event-text"], children: value.name })] }) }) }) }) })) : null;
|
|
37
|
-
};
|
|
38
|
-
export const BackgroundEventPreview = () => {
|
|
39
|
-
const event = {
|
|
40
|
-
value: {
|
|
41
|
-
id: "",
|
|
42
|
-
startDate: new Date(),
|
|
43
|
-
endDate: new Date(),
|
|
44
|
-
rowId: "",
|
|
45
|
-
color: "orange",
|
|
46
|
-
left: 0,
|
|
47
|
-
width: 30,
|
|
48
|
-
name: "Birthday",
|
|
49
|
-
icons: _jsx("span", { className: "cwi-icons cwi-birthday" }),
|
|
50
|
-
isVisible: true,
|
|
51
|
-
isDraggable: false,
|
|
52
|
-
isResizable: false,
|
|
53
|
-
selected: false,
|
|
54
|
-
},
|
|
55
|
-
heightRem: 2,
|
|
56
|
-
onEvent: () => {
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
return _jsx(BackgroundEvent, { ...event });
|
|
60
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { OnClickRowHeader } from "../../NewSchedulerUiEvents";
|
|
3
|
-
import styles from "../../styles/scheduler-row.module.css";
|
|
4
|
-
export const DefaultRowHeader = ({ value, width, onEvent }) => {
|
|
5
|
-
return (_jsxs("div", { style: {
|
|
6
|
-
width: width,
|
|
7
|
-
// background: color,
|
|
8
|
-
}, onClick: (_) => {
|
|
9
|
-
onEvent(new OnClickRowHeader(value.rowId));
|
|
10
|
-
}, className: styles["scheduler-row-header"], children: [_jsxs("div", { children: [_jsx("strong", { children: value.title }), value.title2 && _jsxs("span", { children: ["-", value.title2] }), " ", _jsx("strong", { children: value.subtitle })] }), value.subtitle && _jsxs("div", { style: { opacity: 0.5 }, children: [value.title3 && _jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && _jsxs("span", { children: ["-", value.subtitle2] })] })] }));
|
|
11
|
-
};
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
const _preview = () => {
|
|
14
|
-
return _jsx(DefaultRowHeader, { value: {
|
|
15
|
-
rowId: "1",
|
|
16
|
-
title: "JAC",
|
|
17
|
-
title2: "CMD",
|
|
18
|
-
subtitle: "ICAO",
|
|
19
|
-
subtitle2: "IATA"
|
|
20
|
-
},
|
|
21
|
-
// color={"red"}
|
|
22
|
-
width: 180, onEvent: () => {
|
|
23
|
-
} });
|
|
24
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dropdown } from "antd";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { getContrastColor, getHSLColor } from '../../../../../../common/functions/colorManipulation';
|
|
5
|
-
import useSingleAndDoubleClicks from "../../../../../../common/functions/useSingleAndDoubleClicks";
|
|
6
|
-
import { CwGenericTooltip } from "../../../../../display/data/generic_tooltip/CwGenericTooltip";
|
|
7
|
-
import { OnClickContextMenu, OnClickEvent, OnDoubleClickEvent, OnDragEvent, OnLeftDragStart, OnMultiClickEvent, OnRangeClickEvent, OnRightClickEvent, OnRightDragStart, } from "../../NewSchedulerUiEvents";
|
|
8
|
-
import styles from "../../styles/new-scheduler.module.css";
|
|
9
|
-
import { EventSideDrag } from "./EventSideDrag";
|
|
10
|
-
export const SchedulerEvent = ({ value, heightRem, onEvent }) => {
|
|
11
|
-
const [isOnDrag, setIsOnDrag] = useState(false);
|
|
12
|
-
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
13
|
-
// Calculate colors of the event
|
|
14
|
-
const backColor = getHSLColor(value.color, value.alpha ?? 0.75);
|
|
15
|
-
const textColor = getContrastColor(value.color);
|
|
16
|
-
const eventTransparent = value.alpha ? value.alpha < 0.7 : false;
|
|
17
|
-
const canClick = value.isDraggable || value.isClickable === true;
|
|
18
|
-
const { handleClick, handleDoubleClick } = useSingleAndDoubleClicks((e) => {
|
|
19
|
-
e.stopPropagation();
|
|
20
|
-
e.preventDefault();
|
|
21
|
-
if (!canClick) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform
|
|
25
|
-
// change for navigator.userAgentData.platform when acepted in all browsers
|
|
26
|
-
const isMac = navigator.platform.toUpperCase().includes("MAC");
|
|
27
|
-
const isCtrlOrAltPressed = isMac ? e.altKey : e.ctrlKey;
|
|
28
|
-
if (e.shiftKey) {
|
|
29
|
-
onEvent(new OnRangeClickEvent(value.id));
|
|
30
|
-
}
|
|
31
|
-
else if (isCtrlOrAltPressed) {
|
|
32
|
-
onEvent(new OnMultiClickEvent(value.id));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
onEvent(new OnClickEvent(value.id));
|
|
36
|
-
}
|
|
37
|
-
}, (e) => {
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
onEvent(new OnDoubleClickEvent(value.id));
|
|
41
|
-
});
|
|
42
|
-
return (_jsx(Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottom", menu: {
|
|
43
|
-
items: value.contextMenuItems,
|
|
44
|
-
onClick: (e) => {
|
|
45
|
-
e.domEvent.nativeEvent.preventDefault();
|
|
46
|
-
e.domEvent.nativeEvent.stopPropagation();
|
|
47
|
-
e.domEvent.nativeEvent.stopImmediatePropagation();
|
|
48
|
-
e.domEvent.preventDefault();
|
|
49
|
-
e.domEvent.stopPropagation();
|
|
50
|
-
onEvent(new OnClickContextMenu(value.id, e.key));
|
|
51
|
-
},
|
|
52
|
-
onMouseLeave: () => setIsContextMenuOpen(false),
|
|
53
|
-
}, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (value.contextMenuItems?.length ?? 0) > 0, children: _jsx("div", { style: {
|
|
54
|
-
top: "2px",
|
|
55
|
-
left: `${value.left}%`,
|
|
56
|
-
width: `${value.width}%`,
|
|
57
|
-
position: "absolute",
|
|
58
|
-
zIndex: isOnDrag ? 999 : undefined,
|
|
59
|
-
contentVisibility: "auto",
|
|
60
|
-
pointerEvents: "auto",
|
|
61
|
-
}, onClick: handleClick, onDoubleClick: handleDoubleClick, draggable: value.isDraggable, onMouseDown: (_) => {
|
|
62
|
-
if (value.isDraggable)
|
|
63
|
-
setIsOnDrag(true);
|
|
64
|
-
}, onMouseLeave: (_) => {
|
|
65
|
-
if (value.isDraggable)
|
|
66
|
-
setIsOnDrag(false);
|
|
67
|
-
}, onDragStart: (_) => {
|
|
68
|
-
if (value.isDraggable)
|
|
69
|
-
onEvent(new OnDragEvent(value.id));
|
|
70
|
-
}, onDragEnd: (_) => {
|
|
71
|
-
if (value.isDraggable)
|
|
72
|
-
setIsOnDrag(false);
|
|
73
|
-
}, onContextMenu: (e) => {
|
|
74
|
-
e.stopPropagation();
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
onEvent(new OnRightClickEvent(value.id));
|
|
77
|
-
}, children: _jsx(CwGenericTooltip, { content: value.tooltip, position: "bottom", hide: isOnDrag, dissapearsWhenHover: true, showDelay: 200, children: _jsxs("div", { style: {
|
|
78
|
-
border: value.selected ? "2px solid black" : "none",
|
|
79
|
-
backgroundColor: backColor,
|
|
80
|
-
height: `calc(${heightRem}rem - 4px)`,
|
|
81
|
-
opacity: eventTransparent ? 0.5 : 1,
|
|
82
|
-
}, className: styles["scheduler-event"], children: [_jsxs("div", { style: {
|
|
83
|
-
display: "flex",
|
|
84
|
-
flexDirection: "row",
|
|
85
|
-
alignItems: "stretch",
|
|
86
|
-
width: "100%",
|
|
87
|
-
cursor: value.isDraggable ? "pointer" : "default",
|
|
88
|
-
height: `calc(${heightRem}rem - 10px)`,
|
|
89
|
-
}, children: [value.isResizable && (_jsx(EventSideDrag, { left: true, heightRem: heightRem * 0.7, onStartEvent: () => {
|
|
90
|
-
onEvent(new OnLeftDragStart(value.id));
|
|
91
|
-
} })), _jsxs("div", { className: styles["scheduler-event-container"], children: [_jsx("div", { style: {
|
|
92
|
-
display: "flex",
|
|
93
|
-
flexDirection: "row",
|
|
94
|
-
alignItems: "center",
|
|
95
|
-
whiteSpace: "nowrap",
|
|
96
|
-
color: textColor,
|
|
97
|
-
}, children: value.icons }), _jsx("span", { style: {
|
|
98
|
-
padding: "0.1rem",
|
|
99
|
-
color: textColor,
|
|
100
|
-
display: "flex",
|
|
101
|
-
flex: 1,
|
|
102
|
-
alignItems: "center",
|
|
103
|
-
width: "100%",
|
|
104
|
-
}, children: value.rectangleColors && value.rectangleColors.length > 0 ? (_jsx("div", { style: {
|
|
105
|
-
display: "flex",
|
|
106
|
-
width: "100%",
|
|
107
|
-
}, children: value.rectangleColors.map((item, i) => (_jsx("div", { className: "cwellt_rectangle_indicator", style: {
|
|
108
|
-
backgroundColor: item,
|
|
109
|
-
flex: 1,
|
|
110
|
-
height: "8px",
|
|
111
|
-
margin: 0,
|
|
112
|
-
padding: 0,
|
|
113
|
-
} }, value.id + "_" + i))) })) : (value.name) })] }), value.isResizable && (_jsx(EventSideDrag, { heightRem: heightRem * 0.7, onStartEvent: () => {
|
|
114
|
-
onEvent(new OnRightDragStart(value.id));
|
|
115
|
-
} }))] }), value.primaryTimeMarkerColor && (_jsx("div", { className: styles["time-marker"], style: {
|
|
116
|
-
backgroundColor: value.primaryTimeMarkerColor,
|
|
117
|
-
} })), value.secondaryTimeMarkerColor && (_jsx("div", { className: styles["time-marker"], style: {
|
|
118
|
-
backgroundColor: value.secondaryTimeMarkerColor,
|
|
119
|
-
} }))] }) }) }, value.id) }, value.id));
|
|
120
|
-
};
|
|
121
|
-
export const _preview = () => {
|
|
122
|
-
const props = {
|
|
123
|
-
value: {
|
|
124
|
-
id: "",
|
|
125
|
-
rowId: "1",
|
|
126
|
-
name: "test",
|
|
127
|
-
color: "red",
|
|
128
|
-
startDate: new Date(),
|
|
129
|
-
endDate: new Date(),
|
|
130
|
-
isDraggable: true,
|
|
131
|
-
isResizable: true,
|
|
132
|
-
icons: _jsx("span", { className: "cwi-icons cwi-plane" }),
|
|
133
|
-
left: 0,
|
|
134
|
-
width: 10,
|
|
135
|
-
tooltip: _jsx("div", {}),
|
|
136
|
-
contextMenuItems: [
|
|
137
|
-
{
|
|
138
|
-
key: "removeRemarks",
|
|
139
|
-
label: _jsx("span", { className: "cwellt_contextMenu", children: "DELETE Remark" }),
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
selected: false,
|
|
143
|
-
},
|
|
144
|
-
heightRem: 10,
|
|
145
|
-
onEvent: (uiEvent) => {
|
|
146
|
-
console.log("event: " + uiEvent);
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
return _jsx(SchedulerEvent, { ...props });
|
|
150
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/EventSideDrag.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const EventSideDrag = ({ left = false, heightRem, onStartEvent }) => {
|
|
3
|
-
return (_jsx("span", { draggable: true, onDragStart: (e) => {
|
|
4
|
-
e.stopPropagation();
|
|
5
|
-
onStartEvent(e.clientX);
|
|
6
|
-
}, style: {
|
|
7
|
-
cursor: left ? "w-resize" : "e-resize",
|
|
8
|
-
width: "0.3rem",
|
|
9
|
-
height: `${heightRem}rem`,
|
|
10
|
-
} }));
|
|
11
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/row/SchedulerRow.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dropdown } from "antd";
|
|
3
|
-
import { memo, useState } from "react";
|
|
4
|
-
import useSingleAndDoubleClicks from "../../../../../../common/functions/useSingleAndDoubleClicks";
|
|
5
|
-
import { OnClickContextMenu, OnClickRowEvent, OnDoubleClickRowEvent, OnDropCtrlEvent, OnDropEvent, OnRightClickRow, } from "../../NewSchedulerUiEvents";
|
|
6
|
-
import { dateFromPercentage } from "../../logic/dateFromPercentage";
|
|
7
|
-
import { getPercentageFromMouseEvent } from "../../logic/getPercentageFromMouseEvent";
|
|
8
|
-
import { separateEventsToInnerRows } from "../../logic/separateEventsToInnerRows";
|
|
9
|
-
import { DivisionLine } from "../timeline/DivisionLine";
|
|
10
|
-
import { TimeLine } from "../timeline/TimeLine";
|
|
11
|
-
import { WeekEndLine } from "../timeline/WeekEndLine";
|
|
12
|
-
import { BackgroundEvent } from "./BackgroundEvent";
|
|
13
|
-
import { DefaultRowHeader } from "./DefaultRowHeader";
|
|
14
|
-
import { SchedulerEvent } from "./Event";
|
|
15
|
-
const onClickMenuItem = (e, event) => {
|
|
16
|
-
e.domEvent.nativeEvent.preventDefault();
|
|
17
|
-
e.domEvent.nativeEvent.stopPropagation();
|
|
18
|
-
e.domEvent.nativeEvent.stopImmediatePropagation();
|
|
19
|
-
e.domEvent.preventDefault();
|
|
20
|
-
e.domEvent.stopPropagation();
|
|
21
|
-
event();
|
|
22
|
-
};
|
|
23
|
-
export const SchedulerRow = memo((props) => {
|
|
24
|
-
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
|
|
25
|
-
const { events, backgroundEvents, rowHeader, contextMenuItems, RowTitleComp, EventComp, BackgroundEventComp, weekendLines, divisionLines, timeLinePercentage, selectedDate, visibleDays, onEvent, } = props;
|
|
26
|
-
const internalRows = separateEventsToInnerRows(events);
|
|
27
|
-
const { handleClick, handleDoubleClick } = useSingleAndDoubleClicks((e) => {
|
|
28
|
-
e.stopPropagation();
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
onEvent(new OnClickRowEvent(rowHeader.value.rowId));
|
|
31
|
-
}, (e) => {
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
onEvent(new OnDoubleClickRowEvent(rowHeader.value.rowId));
|
|
35
|
-
});
|
|
36
|
-
return (_jsxs("div", { style: {
|
|
37
|
-
display: "flex",
|
|
38
|
-
minHeight: props.rowHeightInRem + "rem",
|
|
39
|
-
}, children: [_jsx(RowTitleComp, { ...rowHeader }), _jsx(Dropdown, { open: isContextMenuOpen, onOpenChange: setIsContextMenuOpen, placement: "bottom", menu: {
|
|
40
|
-
items: contextMenuItems,
|
|
41
|
-
onClick: (e) => {
|
|
42
|
-
onClickMenuItem(e, () => {
|
|
43
|
-
onEvent(new OnClickContextMenu(rowHeader.value.rowId, e.key));
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
onMouseLeave: () => setIsContextMenuOpen(false),
|
|
47
|
-
}, trigger: ["contextMenu"], overlayStyle: { animationDuration: "0" }, arrow: (contextMenuItems?.length ?? 0) > 0, children: _jsxs("div", { style: {
|
|
48
|
-
flex: 1,
|
|
49
|
-
display: "flex",
|
|
50
|
-
flexDirection: "column",
|
|
51
|
-
position: "relative",
|
|
52
|
-
}, onDrop: (e) => {
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
const percentage = getPercentageFromMouseEvent(e);
|
|
55
|
-
const date = dateFromPercentage(selectedDate, visibleDays, percentage);
|
|
56
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform
|
|
57
|
-
// change for navigator.userAgentData.platform when acepted in all browsers
|
|
58
|
-
const isMac = navigator.platform.toUpperCase().includes("MAC");
|
|
59
|
-
const isCtrlOrAltPressed = isMac ? e.altKey : e.ctrlKey;
|
|
60
|
-
if (isCtrlOrAltPressed) {
|
|
61
|
-
onEvent(new OnDropCtrlEvent(rowHeader.value.rowId, date));
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
onEvent(new OnDropEvent(rowHeader.value.rowId, date));
|
|
65
|
-
}
|
|
66
|
-
}, onDragOver: (e) => {
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
}, onClick: handleClick, onDoubleClick: handleDoubleClick, onContextMenu: (e) => {
|
|
69
|
-
e.preventDefault();
|
|
70
|
-
e.stopPropagation();
|
|
71
|
-
const percentage = getPercentageFromMouseEvent(e);
|
|
72
|
-
const date = dateFromPercentage(selectedDate, visibleDays, percentage);
|
|
73
|
-
onEvent(new OnRightClickRow(rowHeader.value.rowId, date));
|
|
74
|
-
}, children: [weekendLines.map((weekend) => (_jsx(WeekEndLine, { height: "100%", left: weekend.left, widthPercentage: weekend.width }, weekend.left))), divisionLines.map((division) => (_jsx(DivisionLine, { height: "100%", left: division.left }, division.left))), backgroundEvents.length > 0 && backgroundEvents.some((e) => e.isVisible) && (_jsx("div", { style: {
|
|
75
|
-
height: "100%",
|
|
76
|
-
position: internalRows.length > 0 ? "absolute" : "relative",
|
|
77
|
-
width: "100%",
|
|
78
|
-
pointerEvents: "none",
|
|
79
|
-
}, children: backgroundEvents.map((event) => {
|
|
80
|
-
return _jsx(BackgroundEventComp, { value: { ...event }, onEvent: onEvent, heightRem: props.rowHeightInRem * Math.max(1, internalRows.length) }, event.id);
|
|
81
|
-
}) })), backgroundEvents.length === 0 && internalRows.length === 0 && (_jsx("div", { style: { position: "relative", height: props.rowHeightInRem + "rem" } })), internalRows.map((internalRow, index) => {
|
|
82
|
-
return (_jsx("div", { style: {
|
|
83
|
-
position: "relative",
|
|
84
|
-
height: props.rowHeightInRem + "rem",
|
|
85
|
-
pointerEvents: "none"
|
|
86
|
-
}, children: internalRow.map((event) => (_jsx(EventComp, { value: event, heightRem: props.rowHeightInRem, onEvent: onEvent }, event.id))) }, index));
|
|
87
|
-
}), !(timeLinePercentage < 0 || timeLinePercentage > 100) && (_jsx(TimeLine, { color: "red", left: `${timeLinePercentage}%`, top: "0px", height: `100%` }))] }) }, rowHeader.value.rowId)] }));
|
|
88
|
-
}, (prevProps, nextProps) => {
|
|
89
|
-
// This memo is necessary to prevent re-render all the rows when a user makes drag and drop
|
|
90
|
-
const getEventKey = (event) => {
|
|
91
|
-
// Adjust these properties based on what uniquely identifies an event in your application
|
|
92
|
-
return `${event.id}-${event.startDate}-${event.endDate}`;
|
|
93
|
-
};
|
|
94
|
-
if (prevProps.timeLinePercentage != nextProps.timeLinePercentage) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
if (prevProps.rowHeader !== nextProps.rowHeader) {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
// Create Sets of event keys for efficient comparison
|
|
101
|
-
const prevEventKeys = new Set(prevProps.events.map((it) => getEventKey(it)));
|
|
102
|
-
const nextEventKeys = new Set(nextProps.events.map((it) => getEventKey(it)));
|
|
103
|
-
// Check if both sets have the same size
|
|
104
|
-
if (prevEventKeys.size !== nextEventKeys.size) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
// Check if every event in prevProps exists in nextProps
|
|
108
|
-
for (const eventKey of prevEventKeys) {
|
|
109
|
-
if (!nextEventKeys.has(eventKey)) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
// If we got here, the events are the same
|
|
114
|
-
return true;
|
|
115
|
-
});
|
|
116
|
-
export const SchedulerRowPreview = () => {
|
|
117
|
-
const logOnEvent = (event) => {
|
|
118
|
-
console.log("Event:", event);
|
|
119
|
-
};
|
|
120
|
-
const events = [
|
|
121
|
-
{
|
|
122
|
-
id: "event-1",
|
|
123
|
-
name: "Sample Event",
|
|
124
|
-
rowId: "1",
|
|
125
|
-
color: "#4287f5",
|
|
126
|
-
startDate: new Date(),
|
|
127
|
-
endDate: new Date(Date.now() + 3600000),
|
|
128
|
-
isResizable: true,
|
|
129
|
-
isDraggable: true,
|
|
130
|
-
left: 0,
|
|
131
|
-
width: 100,
|
|
132
|
-
tooltip: _jsx("div", { children: "Sample Tooltip" }),
|
|
133
|
-
selected: false,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: `${it}`,
|
|
137
|
-
name: `event ${it}`,
|
|
138
|
-
rowId: `${it}`,
|
|
139
|
-
color: "red",
|
|
140
|
-
startDate: new Date("2024-12-03T18:40:00.000Z"),
|
|
141
|
-
endDate: new Date("2024-12-03T18:50:00.000Z"),
|
|
142
|
-
isResizable: true,
|
|
143
|
-
isDraggable: true,
|
|
144
|
-
left: 0,
|
|
145
|
-
width: 30,
|
|
146
|
-
tooltip: _jsx("div", { children: "Sample Tooltip" }),
|
|
147
|
-
selected: false,
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
return (_jsx(SchedulerRow, { EventComp: SchedulerEvent, events: events, backgroundEvents: [
|
|
151
|
-
{
|
|
152
|
-
id: "event-1",
|
|
153
|
-
name: "Sample Event",
|
|
154
|
-
rowId: "1",
|
|
155
|
-
isResizable: false,
|
|
156
|
-
isDraggable: false,
|
|
157
|
-
color: "#4287f5",
|
|
158
|
-
startDate: new Date(),
|
|
159
|
-
endDate: new Date(Date.now() + 3600000),
|
|
160
|
-
left: 0,
|
|
161
|
-
width: 100,
|
|
162
|
-
tooltip: _jsx("div", { children: "Sample Tooltip" }),
|
|
163
|
-
isVisible: true,
|
|
164
|
-
selected: false,
|
|
165
|
-
},
|
|
166
|
-
], onEvent: logOnEvent, RowTitleComp: DefaultRowHeader, rowHeader: {
|
|
167
|
-
value: {
|
|
168
|
-
rowId: "1",
|
|
169
|
-
title: "Default Header",
|
|
170
|
-
},
|
|
171
|
-
width: 200,
|
|
172
|
-
onEvent: () => {
|
|
173
|
-
},
|
|
174
|
-
}, BackgroundEventComp: BackgroundEvent, rowHeightInRem: 2, timeLinePercentage: 50, weekendLines: [], divisionLines: [], visibleDays: 3, selectedDate: new Date() }));
|
|
175
|
-
};
|
|
176
|
-
export default SchedulerRow;
|
package/dist/src/components/custom/scheduler-new/presentation/components/timeline/DivisionLine.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TimeLine } from "./TimeLine";
|
|
3
|
-
export const DivisionLine = ({ left, top = "0px", height }) => {
|
|
4
|
-
return (_jsx(TimeLine, { color: "rgba(255,255,255,1)", left: left + "%", height: height, width: 1 + "px", top: top }));
|
|
5
|
-
};
|
|
6
|
-
export const _preview = () => {
|
|
7
|
-
return (_jsx("div", { style: { height: "100px" }, children: _jsx(DivisionLine, { left: 100, height: "100px" }) }));
|
|
8
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/timeline/TimeLine.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import styles from "../../styles/scheduler-header.module.css";
|
|
4
|
-
const getNow = (isUtc) => {
|
|
5
|
-
let now = new Date();
|
|
6
|
-
if (isUtc) {
|
|
7
|
-
now = new Date(now.getTime() + now.getTimezoneOffset() * 60_000);
|
|
8
|
-
}
|
|
9
|
-
return now;
|
|
10
|
-
};
|
|
11
|
-
export const TimeLine = ({ left, top = "0px", height, color, width = "2px", zIndexNumber = 0, isHeader, isUtc = false }) => {
|
|
12
|
-
const [currentTime, setCurrentTime] = useState(getNow(isUtc));
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const interval = setInterval(() => {
|
|
15
|
-
setCurrentTime(getNow(isUtc));
|
|
16
|
-
}, 60000); // Actualiza cada minuto
|
|
17
|
-
return () => clearInterval(interval);
|
|
18
|
-
}, [isUtc]);
|
|
19
|
-
const timeString = currentTime.toLocaleTimeString([], {
|
|
20
|
-
hour: '2-digit',
|
|
21
|
-
minute: '2-digit',
|
|
22
|
-
hour12: false
|
|
23
|
-
});
|
|
24
|
-
return (_jsx("div", { style: {
|
|
25
|
-
position: "absolute",
|
|
26
|
-
top: top,
|
|
27
|
-
height: height,
|
|
28
|
-
left: left,
|
|
29
|
-
width: width,
|
|
30
|
-
background: color,
|
|
31
|
-
pointerEvents: "none",
|
|
32
|
-
zIndex: zIndexNumber,
|
|
33
|
-
}, className: styles["scheduler-timeline-now"], children: isHeader && (_jsx("span", { style: {
|
|
34
|
-
color: color,
|
|
35
|
-
}, className: styles["scheduler-timeline-label"], children: timeString })) }));
|
|
36
|
-
};
|
|
37
|
-
export const _preview = () => {
|
|
38
|
-
return (_jsx("div", { style: { height: "100px" }, children: _jsx(TimeLine, { color: "red", left: "100px", height: "100px" }) }));
|
|
39
|
-
};
|
package/dist/src/components/custom/scheduler-new/presentation/components/timeline/WeekEndLine.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TimeLine } from "./TimeLine";
|
|
3
|
-
export const WeekEndLine = ({ left, top = "0px", height, widthPercentage }) => {
|
|
4
|
-
return (_jsx(TimeLine, { color: "rgba(0,0,0,0.05)", left: left + "%", height: height, width: widthPercentage + "%", top: top }));
|
|
5
|
-
};
|
|
6
|
-
export const _preview = () => {
|
|
7
|
-
return (_jsx("div", { style: { height: "100px" }, children: _jsx(WeekEndLine, { left: 100, height: "100px", widthPercentage: 20 }) }));
|
|
8
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
export const getListOfNumbers = (len) => Array(len)
|
|
3
|
-
.fill(0)
|
|
4
|
-
.map((_, idx) => idx);
|
|
5
|
-
const getRandomColor = () => {
|
|
6
|
-
return "#" + (0x1000000 + Math.random() * 0xffffff).toString(16).substr(1, 6);
|
|
7
|
-
};
|
|
8
|
-
export const getRandomEvents = (date, visibleDays, resourceId) => {
|
|
9
|
-
return getListOfNumbers(visibleDays).map((e) => {
|
|
10
|
-
const len1 = Math.floor(Math.random() * 24) + 1;
|
|
11
|
-
const moment1 = moment(date).add(e, "days").add(e, "minutes");
|
|
12
|
-
const len2 = Math.floor(Math.random() * 25) + 1;
|
|
13
|
-
return {
|
|
14
|
-
id: crypto.randomUUID(),
|
|
15
|
-
rowId: resourceId.toString(),
|
|
16
|
-
name: "API Design",
|
|
17
|
-
color: getRandomColor(),
|
|
18
|
-
startDate: moment1.add(-len1, "hour").toDate(),
|
|
19
|
-
endDate: moment1.add(len2, "hour").toDate(),
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
export const isLight = (color) => {
|
|
24
|
-
// extract values of red, green and blue from color
|
|
25
|
-
const clrarr = color.match(/\d+/g)?.map((num) => +num);
|
|
26
|
-
// Check if clrarr is valid and has the necessary values
|
|
27
|
-
if (clrarr && clrarr.length === 3) {
|
|
28
|
-
if (clrarr[0] + clrarr[1] + clrarr[2] >= (255 * 3) / 2)
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
};
|
|
33
|
-
export function hexToRGB(hex) {
|
|
34
|
-
hex = hex.replaceAll("#", "").trim();
|
|
35
|
-
const r = parseInt(hex.slice(0, 2), 16);
|
|
36
|
-
const g = parseInt(hex.slice(2, 4), 16);
|
|
37
|
-
const b = parseInt(hex.slice(4, 6), 16);
|
|
38
|
-
return { r, g, b };
|
|
39
|
-
}
|
|
40
|
-
export const getColorLuminanceOf = (r, g, b, a = 1) => {
|
|
41
|
-
a; // discard
|
|
42
|
-
return 0.299 * r + 0.587 * g + 0.114 * b;
|
|
43
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getEventSizes } from "./getEventSizes";
|
|
2
|
-
export const getWeekendLinesByDatesVisible = (initialDate, visibleDays) => {
|
|
3
|
-
const dateString = initialDate.toISOString().split('T')[0];
|
|
4
|
-
const todayAtO = new Date(dateString);
|
|
5
|
-
const days = getWeekendsDaysInDateRange(todayAtO, visibleDays);
|
|
6
|
-
return days.map(it => {
|
|
7
|
-
const endDate = new Date(it);
|
|
8
|
-
endDate.setDate(it.getDate() + 1);
|
|
9
|
-
const weekLine = getEventSizes(initialDate, visibleDays, it, endDate);
|
|
10
|
-
return weekLine;
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export const getWeekendsDaysInDateRange = (initialDate, visibleDays) => {
|
|
14
|
-
const weekends = [];
|
|
15
|
-
for (let i = 0; i < visibleDays; i++) {
|
|
16
|
-
const currentDate = new Date(initialDate);
|
|
17
|
-
currentDate.setDate(initialDate.getDate() + i);
|
|
18
|
-
const dayOfWeek = currentDate.getDay(); // 0 is Sunday, 6 is Saturday
|
|
19
|
-
if (dayOfWeek === 0 || dayOfWeek === 6) {
|
|
20
|
-
weekends.push(currentDate);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return weekends;
|
|
24
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
export function dateFromPercentage(startDate, visibleDays, percentage) {
|
|
3
|
-
const endTime = moment(startDate).add(visibleDays, "day").toDate();
|
|
4
|
-
const timeSpan = endTime.getTime() - startDate.getTime();
|
|
5
|
-
const clickedDate = new Date(startDate.getTime() + (timeSpan * percentage));
|
|
6
|
-
return clickedDate;
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
export const eventIsVisible = (startDate, endDate, selectedDate, visibleDays) => {
|
|
3
|
-
const schedulerEnd = moment(selectedDate).add(visibleDays, "days").toDate();
|
|
4
|
-
const isBefore = selectedDate > startDate && selectedDate > endDate;
|
|
5
|
-
const isAfter = schedulerEnd < startDate && schedulerEnd < endDate;
|
|
6
|
-
return !isBefore && !isAfter;
|
|
7
|
-
};
|