@progress/kendo-react-scheduler 7.2.4-develop.3 → 7.3.0-develop.1
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/Scheduler.js +8 -0
- package/Scheduler.mjs +389 -0
- package/components/BaseView.js +8 -0
- package/components/BaseView.mjs +61 -0
- package/components/CurrentTimeMarket.js +8 -0
- package/components/CurrentTimeMarket.mjs +110 -0
- package/components/DateHeaderCell.js +8 -0
- package/components/DateHeaderCell.mjs +43 -0
- package/components/SchedulerForm.js +8 -0
- package/components/SchedulerForm.mjs +119 -0
- package/components/SchedulerOccurrenceDialog.js +8 -0
- package/components/SchedulerOccurrenceDialog.mjs +48 -0
- package/components/SchedulerRemoveDialog.js +8 -0
- package/components/SchedulerRemoveDialog.mjs +50 -0
- package/components/ShowMoreItemsButton.js +8 -0
- package/components/ShowMoreItemsButton.mjs +49 -0
- package/components/TimeHeaderCell.js +8 -0
- package/components/TimeHeaderCell.mjs +43 -0
- package/components/footer/SchedulerFooter.js +8 -0
- package/components/footer/SchedulerFooter.mjs +35 -0
- package/components/footer/bussiness-hours/BussinessHours.js +8 -0
- package/components/footer/bussiness-hours/BussinessHours.mjs +31 -0
- package/components/header/SchedulerHeader.js +8 -0
- package/components/header/SchedulerHeader.mjs +35 -0
- package/components/header/navigation/NavigationDatePicker.js +8 -0
- package/components/header/navigation/NavigationDatePicker.mjs +113 -0
- package/components/header/navigation/SchedulerNavigation.js +8 -0
- package/components/header/navigation/SchedulerNavigation.mjs +32 -0
- package/components/header/view-selector/SchedulerViewSelector.js +8 -0
- package/components/header/view-selector/SchedulerViewSelector.mjs +32 -0
- package/components/header/view-selector/ViewSelectorItem.js +8 -0
- package/components/header/view-selector/ViewSelectorItem.mjs +39 -0
- package/components/header/view-selector/ViewSelectorList.js +8 -0
- package/components/header/view-selector/ViewSelectorList.mjs +65 -0
- package/constants/index.js +8 -0
- package/constants/index.mjs +28 -0
- package/context/SchedulerContext.js +8 -0
- package/context/SchedulerContext.mjs +78 -0
- package/context/SchedulerEditItemContext.js +8 -0
- package/context/SchedulerEditItemContext.mjs +51 -0
- package/context/SchedulerEditSlotContext.js +8 -0
- package/context/SchedulerEditSlotContext.mjs +25 -0
- package/context/SchedulerEditTaskContext.js +8 -0
- package/context/SchedulerEditTaskContext.mjs +16 -0
- package/context/SchedulerResourceIteratorContext.js +8 -0
- package/context/SchedulerResourceIteratorContext.mjs +16 -0
- package/context/SchedulerViewContext.js +8 -0
- package/context/SchedulerViewContext.mjs +60 -0
- package/dist/cdn/js/kendo-react-scheduler.js +8 -5
- package/editors/FilterableComboBox.js +8 -0
- package/editors/FilterableComboBox.mjs +37 -0
- package/editors/ResourceEditor.js +8 -0
- package/editors/ResourceEditor.mjs +71 -0
- package/editors/SchedulerFormEditor.js +8 -0
- package/editors/SchedulerFormEditor.mjs +368 -0
- package/editors/ZonedDateTime.js +8 -0
- package/editors/ZonedDateTime.mjs +44 -0
- package/hooks/use-items-focus.js +8 -0
- package/hooks/use-items-focus.mjs +42 -0
- package/hooks/use-items-selection.js +8 -0
- package/hooks/use-items-selection.mjs +67 -0
- package/hooks/use-slots-focus.js +8 -0
- package/hooks/use-slots-focus.mjs +49 -0
- package/hooks/use-slots-selection.js +8 -0
- package/hooks/use-slots-selection.mjs +37 -0
- package/hooks/useCellSync.js +8 -0
- package/hooks/useCellSync.mjs +29 -0
- package/hooks/useControlledState.js +8 -0
- package/hooks/useControlledState.mjs +21 -0
- package/hooks/useEditable.js +8 -0
- package/hooks/useEditable.mjs +24 -0
- package/hooks/useRowSync.js +8 -0
- package/hooks/useRowSync.mjs +32 -0
- package/hooks/useSchedulerItem.js +8 -0
- package/hooks/useSchedulerItem.mjs +31 -0
- package/hooks/useSchedulerSlot.js +8 -0
- package/hooks/useSchedulerSlot.mjs +31 -0
- package/hooks/useSlotExpand.js +8 -0
- package/hooks/useSlotExpand.mjs +67 -0
- package/index.d.mts +4220 -5
- package/index.d.ts +4220 -45
- package/index.js +8 -5
- package/index.mjs +145 -5878
- package/items/SchedulerEditItem.js +8 -0
- package/items/SchedulerEditItem.mjs +610 -0
- package/items/SchedulerItem.js +8 -0
- package/items/SchedulerItem.mjs +328 -0
- package/items/SchedulerItemContent.js +8 -0
- package/items/SchedulerItemContent.mjs +23 -0
- package/items/SchedulerProportionalViewItem.js +8 -0
- package/items/SchedulerProportionalViewItem.mjs +120 -0
- package/items/SchedulerViewItem.js +8 -0
- package/items/SchedulerViewItem.mjs +128 -0
- package/items/hooks/use-drag-item.js +8 -0
- package/items/hooks/use-drag-item.mjs +118 -0
- package/items/hooks/use-form-item.js +8 -0
- package/items/hooks/use-form-item.mjs +46 -0
- package/items/hooks/use-remove-item.js +8 -0
- package/items/hooks/use-remove-item.mjs +40 -0
- package/items/hooks/use-resize-item.js +8 -0
- package/items/hooks/use-resize-item.mjs +145 -0
- package/items/hooks/use-series.js +8 -0
- package/items/hooks/use-series.mjs +32 -0
- package/items/hooks/use-show-occurrence-dialog.js +8 -0
- package/items/hooks/use-show-occurrence-dialog.mjs +36 -0
- package/items/hooks/use-show-remove-item-dialog.js +8 -0
- package/items/hooks/use-show-remove-item-dialog.mjs +36 -0
- package/messages/index.js +8 -0
- package/messages/index.mjs +167 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +10 -10
- package/recurrence/RecurrenceEditor.js +8 -0
- package/recurrence/RecurrenceEditor.mjs +438 -0
- package/recurrence/RecurrenceFrequencyEditor.js +8 -0
- package/recurrence/RecurrenceFrequencyEditor.mjs +41 -0
- package/recurrence/RecurrenceRepeatOnWeekEditor.js +8 -0
- package/recurrence/RecurrenceRepeatOnWeekEditor.mjs +35 -0
- package/recurrence/common.js +8 -0
- package/recurrence/common.mjs +127 -0
- package/services/itemsService.js +8 -0
- package/services/itemsService.mjs +56 -0
- package/services/occurrenceService.js +8 -0
- package/services/occurrenceService.mjs +49 -0
- package/services/rangeService.js +8 -0
- package/services/rangeService.mjs +26 -0
- package/services/slotsService.js +8 -0
- package/services/slotsService.mjs +39 -0
- package/slots/SchedulerEditSlot.js +8 -0
- package/slots/SchedulerEditSlot.mjs +191 -0
- package/slots/SchedulerSlot.js +8 -0
- package/slots/SchedulerSlot.mjs +175 -0
- package/slots/SchedulerViewSlot.js +8 -0
- package/slots/SchedulerViewSlot.mjs +24 -0
- package/tasks/SchedulerEditTask.js +8 -0
- package/tasks/SchedulerEditTask.mjs +157 -0
- package/tasks/SchedulerTask.js +8 -0
- package/tasks/SchedulerTask.mjs +67 -0
- package/tasks/SchedulerViewTask.js +8 -0
- package/tasks/SchedulerViewTask.mjs +23 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +171 -0
- package/views/agenda/AgendaView.js +8 -0
- package/views/agenda/AgendaView.mjs +147 -0
- package/views/common/HorizontalResourceIterator.js +8 -0
- package/views/common/HorizontalResourceIterator.mjs +38 -0
- package/views/common/SchedulerDrag.js +8 -0
- package/views/common/SchedulerDrag.mjs +44 -0
- package/views/common/SchedulerResize.js +8 -0
- package/views/common/SchedulerResize.mjs +48 -0
- package/views/common/VerticalResourceIterator.js +8 -0
- package/views/common/VerticalResourceIterator.mjs +78 -0
- package/views/common/utils.js +8 -0
- package/views/common/utils.mjs +75 -0
- package/views/day/DayView.js +8 -0
- package/views/day/DayView.mjs +27 -0
- package/views/day/DayViewAllDayRowContent.js +8 -0
- package/views/day/DayViewAllDayRowContent.mjs +18 -0
- package/views/day/DayViewGroupRowContent.js +8 -0
- package/views/day/DayViewGroupRowContent.mjs +13 -0
- package/views/day/DayViewRowContent.js +8 -0
- package/views/day/DayViewRowContent.mjs +32 -0
- package/views/day/MultiDayView.js +8 -0
- package/views/day/MultiDayView.mjs +376 -0
- package/views/month/MonthView.js +8 -0
- package/views/month/MonthView.mjs +155 -0
- package/views/time/MultiDayTimelineView.js +8 -0
- package/views/time/MultiDayTimelineView.mjs +264 -0
- package/views/time/TimelineView.js +8 -0
- package/views/time/TimelineView.mjs +27 -0
- package/views/time/TimelineViewAllEventsRowContent.js +8 -0
- package/views/time/TimelineViewAllEventsRowContent.mjs +18 -0
- package/views/time/TimelineViewRowContent.js +8 -0
- package/views/time/TimelineViewRowContent.mjs +13 -0
- package/views/week/WeekView.js +8 -0
- package/views/week/WeekView.mjs +44 -0
- package/views/week/WorkWeekView.js +8 -0
- package/views/week/WorkWeekView.mjs +55 -0
- package/Scheduler.d.ts +0 -373
- package/components/BaseView.d.ts +0 -22
- package/components/CurrentTimeMarket.d.ts +0 -14
- package/components/DateHeaderCell.d.ts +0 -50
- package/components/SchedulerForm.d.ts +0 -75
- package/components/SchedulerOccurrenceDialog.d.ts +0 -46
- package/components/SchedulerRemoveDialog.d.ts +0 -42
- package/components/ShowMoreItemsButton.d.ts +0 -30
- package/components/TimeHeaderCell.d.ts +0 -50
- package/components/footer/SchedulerFooter.d.ts +0 -25
- package/components/footer/bussiness-hours/BussinessHours.d.ts +0 -17
- package/components/header/SchedulerHeader.d.ts +0 -22
- package/components/header/navigation/NavigationDatePicker.d.ts +0 -9
- package/components/header/navigation/SchedulerNavigation.d.ts +0 -28
- package/components/header/view-selector/SchedulerViewSelector.d.ts +0 -28
- package/components/header/view-selector/ViewSelectorItem.d.ts +0 -12
- package/components/header/view-selector/ViewSelectorList.d.ts +0 -7
- package/constants/index.d.ts +0 -58
- package/context/SchedulerContext.d.ts +0 -231
- package/context/SchedulerEditItemContext.d.ts +0 -172
- package/context/SchedulerEditSlotContext.d.ts +0 -51
- package/context/SchedulerEditTaskContext.d.ts +0 -33
- package/context/SchedulerResourceIteratorContext.d.ts +0 -20
- package/context/SchedulerViewContext.d.ts +0 -76
- package/context/index.d.ts +0 -9
- package/editors/FilterableComboBox.d.ts +0 -8
- package/editors/ResourceEditor.d.ts +0 -18
- package/editors/SchedulerFormEditor.d.ts +0 -498
- package/editors/ZonedDateTime.d.ts +0 -22
- package/hooks/index.d.ts +0 -14
- package/hooks/use-items-focus.d.ts +0 -27
- package/hooks/use-items-selection.d.ts +0 -35
- package/hooks/use-slots-focus.d.ts +0 -38
- package/hooks/use-slots-selection.d.ts +0 -28
- package/hooks/useAsyncMouseEnterLeave.d.ts +0 -15
- package/hooks/useCellSync.d.ts +0 -14
- package/hooks/useControlledState.d.ts +0 -17
- package/hooks/useEditable.d.ts +0 -7
- package/hooks/usePropOrState.d.ts +0 -6
- package/hooks/useRowSync.d.ts +0 -15
- package/hooks/useSchedulerItem.d.ts +0 -11
- package/hooks/useSchedulerSlot.d.ts +0 -11
- package/hooks/useSlotExpand.d.ts +0 -9
- package/hooks/useWorkHours.d.ts +0 -6
- package/items/SchedulerEditItem.d.ts +0 -417
- package/items/SchedulerItem.d.ts +0 -203
- package/items/SchedulerItemContent.d.ts +0 -15
- package/items/SchedulerProportionalViewItem.d.ts +0 -16
- package/items/SchedulerViewItem.d.ts +0 -37
- package/items/hooks/use-drag-item.d.ts +0 -46
- package/items/hooks/use-form-item.d.ts +0 -26
- package/items/hooks/use-remove-item.d.ts +0 -34
- package/items/hooks/use-resize-item.d.ts +0 -49
- package/items/hooks/use-series.d.ts +0 -27
- package/items/hooks/use-show-occurrence-dialog.d.ts +0 -31
- package/items/hooks/use-show-remove-item-dialog.d.ts +0 -31
- package/messages/index.d.ts +0 -240
- package/models/DataItem.d.ts +0 -12
- package/models/DateRange.d.ts +0 -22
- package/models/EditableProp.d.ts +0 -33
- package/models/Fields.d.ts +0 -21
- package/models/Group.d.ts +0 -12
- package/models/Item.d.ts +0 -68
- package/models/Occurrence.d.ts +0 -56
- package/models/Omit.d.ts +0 -8
- package/models/Orientation.d.ts +0 -6
- package/models/Range.d.ts +0 -14
- package/models/Rect.d.ts +0 -19
- package/models/Resource.d.ts +0 -12
- package/models/SchedulerGroup.d.ts +0 -17
- package/models/SchedulerHandle.d.ts +0 -12
- package/models/SchedulerModelFields.d.ts +0 -66
- package/models/SchedulerResource.d.ts +0 -37
- package/models/SchedulerView.d.ts +0 -80
- package/models/Slot.d.ts +0 -54
- package/models/events.d.ts +0 -87
- package/models/index.d.ts +0 -21
- package/package-metadata.d.ts +0 -9
- package/recurrence/RecurrenceEditor.d.ts +0 -16
- package/recurrence/RecurrenceFrequencyEditor.d.ts +0 -14
- package/recurrence/RecurrenceRepeatOnWeekEditor.d.ts +0 -17
- package/recurrence/common.d.ts +0 -61
- package/recurrence/types/EndRule.d.ts +0 -8
- package/recurrence/types/Frequency.d.ts +0 -8
- package/recurrence/types/FrequencyEntity.d.ts +0 -12
- package/recurrence/types/MonthEntity.d.ts +0 -11
- package/recurrence/types/OffsetPosition.d.ts +0 -8
- package/recurrence/types/OffsetPositionEntity.d.ts +0 -11
- package/recurrence/types/RepeatOnRule.d.ts +0 -8
- package/recurrence/types/WeekDayEntity.d.ts +0 -11
- package/recurrence/types/WeekDayRule.d.ts +0 -11
- package/reducers/editReducer.d.ts +0 -37
- package/reducers/index.d.ts +0 -5
- package/services/index.d.ts +0 -8
- package/services/itemsService.d.ts +0 -16
- package/services/occurrenceService.d.ts +0 -7
- package/services/rangeService.d.ts +0 -7
- package/services/slotsService.d.ts +0 -10
- package/slots/SchedulerEditSlot.d.ts +0 -56
- package/slots/SchedulerSlot.d.ts +0 -131
- package/slots/SchedulerViewSlot.d.ts +0 -50
- package/tasks/SchedulerEditTask.d.ts +0 -84
- package/tasks/SchedulerTask.d.ts +0 -61
- package/tasks/SchedulerViewTask.d.ts +0 -35
- package/utils/index.d.ts +0 -172
- package/views/agenda/AgendaView.d.ts +0 -96
- package/views/common/HorizontalResourceIterator.d.ts +0 -30
- package/views/common/SchedulerDrag.d.ts +0 -43
- package/views/common/SchedulerResize.d.ts +0 -45
- package/views/common/VerticalResourceIterator.d.ts +0 -25
- package/views/common/utils.d.ts +0 -38
- package/views/day/DayView.d.ts +0 -36
- package/views/day/DayViewAllDayRowContent.d.ts +0 -12
- package/views/day/DayViewGroupRowContent.d.ts +0 -12
- package/views/day/DayViewRowContent.d.ts +0 -17
- package/views/day/MultiDayView.d.ts +0 -175
- package/views/month/MonthView.d.ts +0 -98
- package/views/time/MultiDayTimelineView.d.ts +0 -179
- package/views/time/TimelineView.d.ts +0 -36
- package/views/time/TimelineViewAllEventsRowContent.d.ts +0 -11
- package/views/time/TimelineViewRowContent.d.ts +0 -11
- package/views/week/WeekView.d.ts +0 -106
- package/views/week/WorkWeekView.d.ts +0 -24
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { useDir as de, classNames as me, useDraggable as o, IconWrap as T } from "@progress/kendo-react-common";
|
|
11
|
+
import { useInternationalization as ke, useLocalization as ge } from "@progress/kendo-react-intl";
|
|
12
|
+
import { xIcon as fe, caretAltLeftIcon as ve, caretAltRightIcon as be } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { deleteTitle as W, messages as ze } from "../messages/index.mjs";
|
|
14
|
+
import { formatEventTime as he } from "../utils/index.mjs";
|
|
15
|
+
import { useSchedulerItem as Ce } from "../hooks/useSchedulerItem.mjs";
|
|
16
|
+
import { useEditable as Ee } from "../hooks/useEditable.mjs";
|
|
17
|
+
const Re = t.forwardRef((e, $) => {
|
|
18
|
+
const {
|
|
19
|
+
// Focus
|
|
20
|
+
onFocus: d,
|
|
21
|
+
onBlur: m,
|
|
22
|
+
// Mouse
|
|
23
|
+
onMouseDown: k,
|
|
24
|
+
onClick: g,
|
|
25
|
+
onMouseUp: f,
|
|
26
|
+
onMouseOut: v,
|
|
27
|
+
onMouseOver: b,
|
|
28
|
+
onMouseEnter: z,
|
|
29
|
+
onMouseLeave: h,
|
|
30
|
+
onDoubleClick: C,
|
|
31
|
+
onRemoveClick: E,
|
|
32
|
+
// Keyboard
|
|
33
|
+
onKeyUp: R,
|
|
34
|
+
onKeyDown: D,
|
|
35
|
+
onKeyPress: M,
|
|
36
|
+
// Drag
|
|
37
|
+
onPress: y,
|
|
38
|
+
onDrag: N,
|
|
39
|
+
onRelease: x,
|
|
40
|
+
// Resize
|
|
41
|
+
onResizePress: H,
|
|
42
|
+
onResizeEndDrag: I,
|
|
43
|
+
onResizeRelease: P,
|
|
44
|
+
onResizeStartDrag: F
|
|
45
|
+
} = e, { item: a, element: S } = Ce(e, $), K = de(S), w = t.useRef(null), L = t.useRef(null), O = t.useRef(null), U = t.useRef(null), l = Ee(e.editable), c = ke(), A = ge().toLanguageString(W, ze[W]), s = e.group.resources.find((n) => !!(n.colorField && n[n.colorField] !== "" && n[n.colorField] !== void 0)), r = s && s.colorField && s[s.colorField], j = e.tabIndex !== void 0 ? e.tabIndex === null ? void 0 : e.tabIndex : e.selected ? 0 : -1, G = t.useMemo(
|
|
46
|
+
() => me(
|
|
47
|
+
{
|
|
48
|
+
"k-event": !e.resizeHint,
|
|
49
|
+
"k-selected": e.selected && l.select,
|
|
50
|
+
"k-event-drag-hint": e.dragHint,
|
|
51
|
+
"k-scheduler-marquee": e.resizeHint,
|
|
52
|
+
"k-marquee": e.resizeHint,
|
|
53
|
+
"k-first": e.resizeHint && !e.tail,
|
|
54
|
+
"k-last": e.resizeHint && !e.head
|
|
55
|
+
},
|
|
56
|
+
e.className
|
|
57
|
+
),
|
|
58
|
+
[
|
|
59
|
+
e.resizeHint,
|
|
60
|
+
e.selected,
|
|
61
|
+
e.dragHint,
|
|
62
|
+
e.tail,
|
|
63
|
+
e.head,
|
|
64
|
+
e.className,
|
|
65
|
+
l.select
|
|
66
|
+
]
|
|
67
|
+
), J = t.useMemo(
|
|
68
|
+
() => `${he(c, e.zonedStart, e.zonedEnd, e.isAllDay)}, ${e.title}`,
|
|
69
|
+
[c, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
70
|
+
), Q = t.useMemo(
|
|
71
|
+
() => ({
|
|
72
|
+
cursor: "pointer",
|
|
73
|
+
userSelect: "none",
|
|
74
|
+
borderColor: e.resizeHint ? void 0 : r,
|
|
75
|
+
backgroundColor: e.resizeHint ? void 0 : r,
|
|
76
|
+
touchAction: "none",
|
|
77
|
+
...e.style
|
|
78
|
+
}),
|
|
79
|
+
[r, e.style, e.resizeHint]
|
|
80
|
+
), V = t.useCallback(
|
|
81
|
+
(n) => {
|
|
82
|
+
d && d.call(void 0, {
|
|
83
|
+
syntheticEvent: n,
|
|
84
|
+
target: a.current
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
[d, a]
|
|
88
|
+
), X = t.useCallback(
|
|
89
|
+
(n) => {
|
|
90
|
+
m && m.call(void 0, {
|
|
91
|
+
syntheticEvent: n,
|
|
92
|
+
target: a.current
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
[m, a]
|
|
96
|
+
), Y = t.useCallback(
|
|
97
|
+
(n) => {
|
|
98
|
+
k && k.call(void 0, {
|
|
99
|
+
syntheticEvent: n,
|
|
100
|
+
target: a.current
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
[k, a]
|
|
104
|
+
), Z = t.useCallback(
|
|
105
|
+
(n) => {
|
|
106
|
+
g && g.call(void 0, {
|
|
107
|
+
syntheticEvent: n,
|
|
108
|
+
target: a.current
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
[g, a]
|
|
112
|
+
), _ = t.useCallback(
|
|
113
|
+
(n) => {
|
|
114
|
+
f && f.call(void 0, {
|
|
115
|
+
syntheticEvent: n,
|
|
116
|
+
target: a.current
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
[f, a]
|
|
120
|
+
), p = t.useCallback(
|
|
121
|
+
(n) => {
|
|
122
|
+
b && b.call(void 0, {
|
|
123
|
+
syntheticEvent: n,
|
|
124
|
+
target: a.current
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
[b, a]
|
|
128
|
+
), ee = t.useCallback(
|
|
129
|
+
(n) => {
|
|
130
|
+
v && v.call(void 0, {
|
|
131
|
+
syntheticEvent: n,
|
|
132
|
+
target: a.current
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
[v, a]
|
|
136
|
+
), te = t.useCallback(
|
|
137
|
+
(n) => {
|
|
138
|
+
z && z.call(void 0, {
|
|
139
|
+
syntheticEvent: n,
|
|
140
|
+
target: a.current
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
[z, a]
|
|
144
|
+
), ne = t.useCallback(
|
|
145
|
+
(n) => {
|
|
146
|
+
h && h.call(void 0, {
|
|
147
|
+
syntheticEvent: n,
|
|
148
|
+
target: a.current
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
[h, a]
|
|
152
|
+
), ae = t.useCallback(
|
|
153
|
+
(n) => {
|
|
154
|
+
C && C.call(void 0, {
|
|
155
|
+
syntheticEvent: n,
|
|
156
|
+
target: a.current
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
[C, a]
|
|
160
|
+
), le = t.useCallback(
|
|
161
|
+
(n) => {
|
|
162
|
+
E && E.call(void 0, {
|
|
163
|
+
syntheticEvent: n,
|
|
164
|
+
target: a.current
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
[E, a]
|
|
168
|
+
), re = t.useCallback(
|
|
169
|
+
(n) => {
|
|
170
|
+
D && D.call(void 0, {
|
|
171
|
+
syntheticEvent: n,
|
|
172
|
+
target: a.current
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
[D, a]
|
|
176
|
+
), oe = t.useCallback(
|
|
177
|
+
(n) => {
|
|
178
|
+
M && M.call(void 0, {
|
|
179
|
+
syntheticEvent: n,
|
|
180
|
+
target: a.current
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
[M, a]
|
|
184
|
+
), ce = t.useCallback(
|
|
185
|
+
(n) => {
|
|
186
|
+
R && R.call(void 0, {
|
|
187
|
+
syntheticEvent: n,
|
|
188
|
+
target: a.current
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
[R, a]
|
|
192
|
+
), se = t.useCallback(
|
|
193
|
+
(n) => {
|
|
194
|
+
y && y.call(void 0, {
|
|
195
|
+
dragEvent: n,
|
|
196
|
+
target: a.current
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
[y, a]
|
|
200
|
+
), ie = t.useCallback(
|
|
201
|
+
(n) => {
|
|
202
|
+
N && N.call(void 0, {
|
|
203
|
+
dragEvent: n,
|
|
204
|
+
target: a.current
|
|
205
|
+
});
|
|
206
|
+
},
|
|
207
|
+
[N, a]
|
|
208
|
+
), ue = t.useCallback(
|
|
209
|
+
(n) => {
|
|
210
|
+
x && x.call(void 0, {
|
|
211
|
+
dragEvent: n,
|
|
212
|
+
target: a.current
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
[x, a]
|
|
216
|
+
), i = t.useCallback(
|
|
217
|
+
(n) => {
|
|
218
|
+
H && H.call(void 0, {
|
|
219
|
+
dragEvent: n,
|
|
220
|
+
target: a.current
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
[H, a]
|
|
224
|
+
), q = t.useCallback(
|
|
225
|
+
(n) => {
|
|
226
|
+
F && F.call(void 0, {
|
|
227
|
+
dragEvent: n,
|
|
228
|
+
target: a.current
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
[F, a]
|
|
232
|
+
), B = t.useCallback(
|
|
233
|
+
(n) => {
|
|
234
|
+
I && I.call(void 0, {
|
|
235
|
+
dragEvent: n,
|
|
236
|
+
target: a.current
|
|
237
|
+
});
|
|
238
|
+
},
|
|
239
|
+
[I, a]
|
|
240
|
+
), u = t.useCallback(
|
|
241
|
+
(n) => {
|
|
242
|
+
P && P.call(void 0, {
|
|
243
|
+
dragEvent: n,
|
|
244
|
+
target: a.current
|
|
245
|
+
});
|
|
246
|
+
},
|
|
247
|
+
[P, a]
|
|
248
|
+
);
|
|
249
|
+
return o(S, {
|
|
250
|
+
onPress: se,
|
|
251
|
+
onDrag: ie,
|
|
252
|
+
onRelease: ue
|
|
253
|
+
}), o(w, {
|
|
254
|
+
onPress: i,
|
|
255
|
+
onDrag: B,
|
|
256
|
+
onRelease: u
|
|
257
|
+
}), o(L, {
|
|
258
|
+
onPress: i,
|
|
259
|
+
onDrag: q,
|
|
260
|
+
onRelease: u
|
|
261
|
+
}), o(O, {
|
|
262
|
+
onPress: i,
|
|
263
|
+
onDrag: q,
|
|
264
|
+
onRelease: u
|
|
265
|
+
}), o(U, {
|
|
266
|
+
onPress: i,
|
|
267
|
+
onDrag: B,
|
|
268
|
+
onRelease: u
|
|
269
|
+
}), /* @__PURE__ */ t.createElement(
|
|
270
|
+
"div",
|
|
271
|
+
{
|
|
272
|
+
ref: S,
|
|
273
|
+
id: e.id,
|
|
274
|
+
style: Q,
|
|
275
|
+
tabIndex: j,
|
|
276
|
+
className: G,
|
|
277
|
+
role: "button",
|
|
278
|
+
"aria-label": J,
|
|
279
|
+
onFocus: V,
|
|
280
|
+
onBlur: X,
|
|
281
|
+
onMouseUp: _,
|
|
282
|
+
onMouseDown: Y,
|
|
283
|
+
onClick: Z,
|
|
284
|
+
onMouseOver: p,
|
|
285
|
+
onMouseOut: ee,
|
|
286
|
+
onMouseEnter: te,
|
|
287
|
+
onMouseLeave: ne,
|
|
288
|
+
onDoubleClick: ae,
|
|
289
|
+
onKeyDown: re,
|
|
290
|
+
onKeyPress: oe,
|
|
291
|
+
onKeyUp: ce,
|
|
292
|
+
"data-group-index": e.group.index,
|
|
293
|
+
"data-range-index": e.range.index
|
|
294
|
+
},
|
|
295
|
+
e.children,
|
|
296
|
+
!e.resizeHint && /* @__PURE__ */ t.createElement("span", { className: "k-event-actions" }, l.remove && /* @__PURE__ */ t.createElement(
|
|
297
|
+
"a",
|
|
298
|
+
{
|
|
299
|
+
tabIndex: -1,
|
|
300
|
+
"aria-hidden": "true",
|
|
301
|
+
className: "k-link k-event-delete",
|
|
302
|
+
title: A,
|
|
303
|
+
"aria-label": A,
|
|
304
|
+
onClick: le
|
|
305
|
+
},
|
|
306
|
+
/* @__PURE__ */ t.createElement(T, { name: "x", icon: fe })
|
|
307
|
+
), e.head && /* @__PURE__ */ t.createElement(
|
|
308
|
+
T,
|
|
309
|
+
{
|
|
310
|
+
name: K === "rtl" ? "caret-alt-left" : "caret-alt-right",
|
|
311
|
+
icon: K === "rtl" ? ve : be
|
|
312
|
+
}
|
|
313
|
+
)),
|
|
314
|
+
l.resize && e.vertical && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-n", ref: O }), /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-s", ref: U })),
|
|
315
|
+
l.resize && !e.vertical && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-w", ref: L }), /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-e", ref: w })),
|
|
316
|
+
e.resizeHint && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
className: "k-marquee-color",
|
|
320
|
+
style: { borderColor: r, backgroundColor: r }
|
|
321
|
+
}
|
|
322
|
+
), /* @__PURE__ */ t.createElement("div", { className: "k-marquee-text" }, !e.tail && /* @__PURE__ */ t.createElement("div", { className: "k-label-top" }, c.formatDate(e.zonedStart, e.format)), !e.head && /* @__PURE__ */ t.createElement("div", { className: "k-label-bottom" }, c.formatDate(e.zonedEnd, e.format))))
|
|
323
|
+
);
|
|
324
|
+
});
|
|
325
|
+
Re.displayName = "KendoReactSchedulerItem";
|
|
326
|
+
export {
|
|
327
|
+
Re as SchedulerItem
|
|
328
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),o=require("@progress/kendo-react-common");function s(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=s(a),l=c.forwardRef((e,n)=>{const t=c.useMemo(()=>o.classNames("k-event-template",e.className),[e.className]);return c.createElement("div",{ref:n,...e,className:t})});exports.SchedulerItemContent=l;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { classNames as s } from "@progress/kendo-react-common";
|
|
11
|
+
const r = t.forwardRef((e, a) => {
|
|
12
|
+
const m = t.useMemo(
|
|
13
|
+
() => s(
|
|
14
|
+
"k-event-template",
|
|
15
|
+
e.className
|
|
16
|
+
),
|
|
17
|
+
[e.className]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ t.createElement("div", { ref: a, ...e, className: m });
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
r as SchedulerItemContent
|
|
23
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),oe=require("./SchedulerItem.js"),f=require("../utils/index.js"),g=require("../views/common/utils.js"),h=require("../constants/index.js"),ae=require("@progress/kendo-react-intl"),K=require("./SchedulerItemContent.js"),D=require("@progress/kendo-react-common"),H=require("@progress/kendo-svg-icons"),L=require("../context/SchedulerViewContext.js"),ue=require("../context/SchedulerContext.js");function me(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const w=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(S,m,w.get?w:{enumerable:!0,get:()=>e[m]})}}return S.default=e,Object.freeze(S)}const r=me(le),de=1,J=r.forwardRef((e,S)=>{const{item:m,_ref:w,itemRef:U,...X}=e,y=r.useRef(),s=r.useRef(null),q=r.useRef(null),C=r.useRef(null);r.useImperativeHandle(q,()=>({props:e,element:s.current&&s.current.element})),r.useImperativeHandle(S,()=>q.current),r.useImperativeHandle(w,()=>s.current),r.useImperativeHandle(U,()=>s.current);const Y=m||Q.item,x=ae.useInternationalization(),[Z]=L.useSchedulerViewItemsContext(),[M]=L.useSchedulerViewSlotsContext(),v=ue.useSchedulerElementContext(),[p,P]=r.useState(!0),[ee,te]=r.useState(!1),[ne,re]=r.useState(0),k=D.useDir(v),V=r.useMemo(()=>e.isAllDay?x.toString(e.zonedStart,"t"):x.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[x,e.isAllDay,e.zonedEnd,e.zonedStart]),W=r.useMemo(()=>`(${V}): ${e.title}`,[V,e.title]),B=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>b(o.current.props,R.props));u.length>i&&(i=u.length)}),i},ie=(n,t)=>n.map(o=>t.filter(u=>b(o.current.props,u.props))),b=(n,t)=>f.intersects(n.start,n.end,t.start,t.end)&&n.group.index===t.group.index&&n.range.index===t.range.index&&(e.ignoreIsAllDay||n.isAllDay===t.isAllDay),T=()=>{const n=(M||[]).filter(o=>o.current&&b(o.current.props,e));if(n.length===0){P(!1);return}const t=f.first(n);if(!t.current||!s.current)return;const i=g.getRect(t.current.element);g.setRect(s.current.element,i)},z=()=>{const n=(M||[]).filter(l=>l.current&&b(l.current.props,e)),t=s.current&&s.current.element;if(!t||!n.length)return;const i=f.first(n),o=f.last(n);if(!i.current||!s.current||!o.current)return;const u=[],R=[],O=[],j=g.getRect(i.current.element),F=(e.vertical?j.height:j.width)/(i.current.props.end.getTime()-i.current.props.start.getTime()),E=(e.start.getTime()-i.current.props.start.getTime())*F,$=(Math.min(e.end.getTime(),o.current.props.end.getTime())-Math.max(e.start.getTime(),i.current.props.start.getTime()))*F;(Z||[]).forEach(l=>{l.current&&(l.current.props.dragHint?R.push(l.current):l.current.props.resizeHint?O.push(l.current):u.push(l.current))});const I=e.dragHint||e.resizeHint?f.calculateOrder(s.current,e.dragHint?R:O,n,e.ignoreIsAllDay):e.order||0;let d=e.dragHint||e.resizeHint?B(n,e.dragHint?R:O):B(n,u);const ce=ie(n,u);let _=0;const c=g.getRect(t);if(ce.forEach(l=>{let A=0;l.forEach(a=>{f.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a.props._maxSiblingsPerSlot&&a.props._maxSiblingsPerSlot>d&&a.element!==t&&(d=a.props._maxSiblingsPerSlot);const G=g.getRect(a.element);a.props.order!==null&&a.props.order<I&&(A=G.top+G.height-c.top-h.BORDER_WIDTH*I+de)}),A>_&&(_=A)}),n.length===0){P(!1);return}const se=20;c.width=e.vertical?c.width/d-h.BORDER_WIDTH-se/d:$+h.BORDER_WIDTH,c.height=e.vertical?$-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&d<=1?c.height:e.style&&e.style.height?e.style.height:25,c.left=e.vertical?c.left+I*c.width+h.BORDER_WIDTH*I:c.left+(E<0?0:E),c.top=e.vertical?c.top+(E<0?0:E):c.top+_+h.BORDER_WIDTH*I,re(d),g.setRect(t,c),te(!0),P(!0)},N=r.useCallback(n=>{const t=n&&n[0],i=C.current;y.current!==void 0&&window.cancelAnimationFrame(y.current),i&&t&&(i.width!==t.contentRect.width||i.height!==t.contentRect.height)&&(y.current=window.requestAnimationFrame(()=>{T(),z()})),C.current={width:t.contentRect.width,height:t.contentRect.height}},[T,z]);return r.useEffect(T),r.useEffect(z),r.useEffect(()=>{if(!v.current)return;const n=window.ResizeObserver,t=n&&new n(N);return t&&t.observe(v.current),()=>{t&&t.disconnect()}},[N,v]),r.createElement(Y,{...X,_ref:s,_maxSiblingsPerSlot:ne,itemRef:s,style:{visibility:ee?void 0:"hidden",display:p?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(D.IconWrap,{name:k==="rtl"?"caret-alt-right":"caret-alt-left",icon:k==="rtl"?H.caretAltRightIcon:H.caretAltLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(D.IconWrap,{name:"reload",icon:H.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(D.IconWrap,{name:"non-recurrence",icon:H.nonRecurrenceIcon})),!e.resizeHint&&r.createElement("div",{title:W},!e.isAllDay&&r.createElement(K.SchedulerItemContent,{className:"k-event-template k-event-time "},W),r.createElement(K.SchedulerItemContent,{className:"k-event-template"},e.title)))}),Q={item:oe.SchedulerItem};J.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=J;exports.schedulerProportionalViewItemDefaultProps=Q;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as r from "react";
|
|
10
|
+
import { SchedulerItem as ce } from "./SchedulerItem.mjs";
|
|
11
|
+
import { first as $, last as le, calculateOrder as se, intersects as q } from "../utils/index.mjs";
|
|
12
|
+
import { getRect as R, setRect as B } from "../views/common/utils.mjs";
|
|
13
|
+
import { BORDER_WIDTH as d } from "../constants/index.mjs";
|
|
14
|
+
import { useInternationalization as oe } from "@progress/kendo-react-intl";
|
|
15
|
+
import { SchedulerItemContent as G } from "./SchedulerItemContent.mjs";
|
|
16
|
+
import { useDir as ae, IconWrap as P } from "@progress/kendo-react-common";
|
|
17
|
+
import { caretAltRightIcon as me, caretAltLeftIcon as ue, arrowRotateCwIcon as de, nonRecurrenceIcon as fe } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { useSchedulerViewItemsContext as ge, useSchedulerViewSlotsContext as he } from "../context/SchedulerViewContext.mjs";
|
|
19
|
+
import { useSchedulerElementContext as Se } from "../context/SchedulerContext.mjs";
|
|
20
|
+
const Ie = 1, Re = r.forwardRef((e, K) => {
|
|
21
|
+
const { item: L, _ref: j, itemRef: J, ...Q } = e, v = r.useRef(), l = r.useRef(null), A = r.useRef(null), T = r.useRef(null);
|
|
22
|
+
r.useImperativeHandle(A, () => ({ props: e, element: l.current && l.current.element })), r.useImperativeHandle(K, () => A.current), r.useImperativeHandle(j, () => l.current), r.useImperativeHandle(J, () => l.current);
|
|
23
|
+
const U = L || ve.item, w = oe(), [X] = ge(), [D] = he(), h = Se(), [Y, E] = r.useState(!0), [Z, p] = r.useState(!1), [ee, te] = r.useState(0), M = ae(h), _ = r.useMemo(
|
|
24
|
+
() => e.isAllDay ? w.toString(e.zonedStart, "t") : w.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
|
|
25
|
+
[w, e.isAllDay, e.zonedEnd, e.zonedStart]
|
|
26
|
+
), C = r.useMemo(() => `(${_}): ${e.title}`, [_, e.title]), O = (n, t) => {
|
|
27
|
+
let i = 1;
|
|
28
|
+
return n.forEach((o) => {
|
|
29
|
+
const m = t.filter((f) => S(o.current.props, f.props));
|
|
30
|
+
m.length > i && (i = m.length);
|
|
31
|
+
}), i;
|
|
32
|
+
}, ne = (n, t) => n.map((o) => t.filter((m) => S(o.current.props, m.props))), S = (n, t) => q(n.start, n.end, t.start, t.end) && n.group.index === t.group.index && n.range.index === t.range.index && (e.ignoreIsAllDay || n.isAllDay === t.isAllDay), b = () => {
|
|
33
|
+
const n = (D || []).filter((o) => o.current && S(o.current.props, e));
|
|
34
|
+
if (n.length === 0) {
|
|
35
|
+
E(!1);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const t = $(n);
|
|
39
|
+
if (!t.current || !l.current)
|
|
40
|
+
return;
|
|
41
|
+
const i = R(t.current.element);
|
|
42
|
+
B(l.current.element, i);
|
|
43
|
+
}, H = () => {
|
|
44
|
+
const n = (D || []).filter((s) => s.current && S(s.current.props, e)), t = l.current && l.current.element;
|
|
45
|
+
if (!t || !n.length)
|
|
46
|
+
return;
|
|
47
|
+
const i = $(n), o = le(n);
|
|
48
|
+
if (!i.current || !l.current || !o.current)
|
|
49
|
+
return;
|
|
50
|
+
const m = [], f = [], x = [], k = R(i.current.element), N = (e.vertical ? k.height : k.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), I = (e.start.getTime() - i.current.props.start.getTime()) * N, F = (Math.min(e.end.getTime(), o.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * N;
|
|
51
|
+
(X || []).forEach((s) => {
|
|
52
|
+
s.current && (s.current.props.dragHint ? f.push(s.current) : s.current.props.resizeHint ? x.push(s.current) : m.push(s.current));
|
|
53
|
+
});
|
|
54
|
+
const g = e.dragHint || e.resizeHint ? se(l.current, e.dragHint ? f : x, n, e.ignoreIsAllDay) : e.order || 0;
|
|
55
|
+
let u = e.dragHint || e.resizeHint ? O(n, e.dragHint ? f : x) : O(n, m);
|
|
56
|
+
const re = ne(n, m);
|
|
57
|
+
let y = 0;
|
|
58
|
+
const c = R(t);
|
|
59
|
+
if (re.forEach((s) => {
|
|
60
|
+
let z = 0;
|
|
61
|
+
s.forEach((a) => {
|
|
62
|
+
q(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a.props._maxSiblingsPerSlot && a.props._maxSiblingsPerSlot > u && a.element !== t && (u = a.props._maxSiblingsPerSlot);
|
|
63
|
+
const W = R(a.element);
|
|
64
|
+
a.props.order !== null && a.props.order < g && (z = W.top + W.height - c.top - d * g + Ie);
|
|
65
|
+
}), z > y && (y = z);
|
|
66
|
+
}), n.length === 0) {
|
|
67
|
+
E(!1);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const ie = 20;
|
|
71
|
+
c.width = e.vertical ? c.width / u - d - ie / u : F + d, c.height = e.vertical ? F - d : (e.resizeHint || e.dragHint) && u <= 1 ? c.height : e.style && e.style.height ? e.style.height : 25, c.left = e.vertical ? c.left + g * c.width + d * g : c.left + (I < 0 ? 0 : I), c.top = e.vertical ? c.top + (I < 0 ? 0 : I) : c.top + y + d * g, te(u), B(t, c), p(!0), E(!0);
|
|
72
|
+
}, V = r.useCallback(
|
|
73
|
+
(n) => {
|
|
74
|
+
const t = n && n[0], i = T.current;
|
|
75
|
+
v.current !== void 0 && window.cancelAnimationFrame(v.current), i && t && (i.width !== t.contentRect.width || i.height !== t.contentRect.height) && (v.current = window.requestAnimationFrame(() => {
|
|
76
|
+
b(), H();
|
|
77
|
+
})), T.current = { width: t.contentRect.width, height: t.contentRect.height };
|
|
78
|
+
},
|
|
79
|
+
[b, H]
|
|
80
|
+
);
|
|
81
|
+
return r.useEffect(b), r.useEffect(H), r.useEffect(
|
|
82
|
+
() => {
|
|
83
|
+
if (!h.current)
|
|
84
|
+
return;
|
|
85
|
+
const n = window.ResizeObserver, t = n && new n(V);
|
|
86
|
+
return t && t.observe(h.current), () => {
|
|
87
|
+
t && t.disconnect();
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
[V, h]
|
|
91
|
+
), /* @__PURE__ */ r.createElement(
|
|
92
|
+
U,
|
|
93
|
+
{
|
|
94
|
+
...Q,
|
|
95
|
+
_ref: l,
|
|
96
|
+
_maxSiblingsPerSlot: ee,
|
|
97
|
+
itemRef: l,
|
|
98
|
+
style: {
|
|
99
|
+
visibility: Z ? void 0 : "hidden",
|
|
100
|
+
display: Y ? void 0 : "none",
|
|
101
|
+
...e.style
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
!e.resizeHint && /* @__PURE__ */ r.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ r.createElement(
|
|
105
|
+
P,
|
|
106
|
+
{
|
|
107
|
+
name: M === "rtl" ? "caret-alt-right" : "caret-alt-left",
|
|
108
|
+
icon: M === "rtl" ? me : ue
|
|
109
|
+
}
|
|
110
|
+
), e.isRecurring && !e.isException && /* @__PURE__ */ r.createElement(P, { name: "reload", icon: de }), !e.isRecurring && e.isException && /* @__PURE__ */ r.createElement(P, { name: "non-recurrence", icon: fe })),
|
|
111
|
+
!e.resizeHint && /* @__PURE__ */ r.createElement("div", { title: C }, !e.isAllDay && /* @__PURE__ */ r.createElement(G, { className: "k-event-template k-event-time " }, C), /* @__PURE__ */ r.createElement(G, { className: "k-event-template" }, e.title))
|
|
112
|
+
);
|
|
113
|
+
}), ve = {
|
|
114
|
+
item: ce
|
|
115
|
+
};
|
|
116
|
+
Re.displayName = "KendoReactSchedulerProportionalViewItem";
|
|
117
|
+
export {
|
|
118
|
+
Re as SchedulerProportionalViewItem,
|
|
119
|
+
ve as schedulerProportionalViewItemDefaultProps
|
|
120
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("react"),ie=require("./SchedulerItem.js"),b=require("../utils/index.js"),S=require("../views/common/utils.js"),h=require("../constants/index.js"),ce=require("@progress/kendo-react-intl"),N=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),le=require("../hooks/useRowSync.js"),se=require("../hooks/useEditable.js"),B=require("../context/SchedulerViewContext.js"),oe=require("../context/SchedulerContext.js");function ae(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const R=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(g,m,R.get?R:{enumerable:!0,get:()=>e[m]})}}return g.default=e,Object.freeze(g)}const n=ae(re),ue=1,j=n.forwardRef((e,g)=>{const{item:m,_ref:R,itemRef:$,...L}=e,y=n.useRef(),c=n.useRef(null),A=n.useRef(null),P=n.useRef(null),G=se.useEditable(e.editable);n.useImperativeHandle(A,()=>({props:e,element:c.current&&c.current.element})),n.useImperativeHandle(g,()=>A.current),n.useImperativeHandle(R,()=>c.current),n.useImperativeHandle($,()=>c.current);const K=m||F.item,D=ce.useInternationalization(),[J]=B.useSchedulerViewItemsContext(),[q]=B.useSchedulerViewSlotsContext(),I=oe.useSchedulerElementContext(),[Q,H]=n.useState(!0),[U,X]=n.useState(!1),[Y,Z]=n.useState(0),T=E.useDir(I),k=n.useMemo(()=>e.isAllDay?D.toString(e.zonedStart,"t"):D.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[D,e.isAllDay,e.zonedEnd,e.zonedStart]),C=n.useMemo(()=>`(${k}): ${e.title}`,[k,e.title]),V=(r,t)=>{let l=1;return r.forEach(o=>{const u=t.filter(d=>w(o.current.props,d.props));u.length>l&&(l=u.length)}),l},p=(r,t)=>r.map(o=>t.filter(u=>w(o.current.props,u.props))),w=(r,t)=>b.intersects(r.start,r.end,t.start,t.end)&&r.group.index===t.group.index&&r.range.index===t.range.index&&(e.ignoreIsAllDay||r.isAllDay===t.isAllDay),x=()=>{const r=(q||[]).filter(o=>o.current&&w(o.current.props,e));if(r.length===0){H(!1);return}const t=b.first(r);if(!t.current||!c.current)return;const l=S.getRect(t.current.element);S.setRect(c.current.element,l)},z=()=>{const r=c.current&&c.current.element;if(!r)return;const t=(q||[]).filter(s=>s.current&&w(s.current.props,e)),l=[],o=[],u=[];(J||[]).forEach(s=>{s.current&&(s.current.props.dragHint?o.push(s.current):s.current.props.resizeHint?u.push(s.current):l.push(s.current))});const d=e.dragHint||e.resizeHint?b.calculateOrder(c.current,e.dragHint?o:u,t,e.ignoreIsAllDay):e.order||0;let f=e.dragHint||e.resizeHint?V(t,e.dragHint?o:u):V(t,l);const te=p(t,l);let O=0;const i=S.getRect(r);if(te.forEach(s=>{let _=0;s.forEach(a=>{b.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a.props._maxSiblingsPerSlot&&a.props._maxSiblingsPerSlot>f&&a.element!==r&&(f=a.props._maxSiblingsPerSlot);const M=S.getRect(a.element);a.props.order!==null&&a.props.order<d&&(_=M.top+M.height-i.top-h.BORDER_WIDTH*d+ue)}),_>O&&(O=_)}),t.length===0){H(!1);return}const ne=G.add?20:0;i.width=e.vertical?i.width/f-h.BORDER_WIDTH-ne/f:i.width*t.length-h.BORDER_WIDTH,i.height=e.vertical?i.height*t.length-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&f<=1?i.height:e.style&&e.style.height?e.style.height:25,i.left=e.vertical?i.left+d*i.width+h.BORDER_WIDTH*d:i.left,i.top=e.vertical?i.top:i.top+O+h.BORDER_WIDTH*d,Z(f),S.setRect(r,i),X(!0),H(!0)},W=n.useCallback(r=>{const t=r&&r[0],l=P.current;y.current!==void 0&&window.cancelAnimationFrame(y.current),l&&t&&(l.width!==t.contentRect.width||l.height!==t.contentRect.height)&&(y.current=window.requestAnimationFrame(()=>{x(),z()})),P.current={width:t.contentRect.width,height:t.contentRect.height}},[x,z]);n.useEffect(x),n.useEffect(z);const ee=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return le.useRowSync({element:ee,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),n.useEffect(()=>{if(!I.current)return;const r=window.ResizeObserver,t=r&&new r(W);return t&&t.observe(I.current),()=>{t&&t.disconnect()}},[W,I]),n.createElement(K,{...L,_ref:c,_maxSiblingsPerSlot:Y,itemRef:c,style:{visibility:U?void 0:"hidden",display:Q?void 0:"none",...e.style}},!e.resizeHint&&n.createElement("span",{className:"k-event-actions"},e.tail&&n.createElement(E.IconWrap,{name:T==="rtl"?"caret-alt-right":"caret-alt-left",icon:T==="rtl"?v.caretAltRightIcon:v.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(E.IconWrap,{name:"arrow-rotate-cw",icon:v.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(E.IconWrap,{name:"arrows-no-repeat",icon:v.arrowsNoRepeatIcon})),!e.resizeHint&&n.createElement("div",{title:C},!e.isAllDay&&n.createElement(N.SchedulerItemContent,{className:"k-event-template k-event-time "},C),n.createElement(N.SchedulerItemContent,{className:"k-event-template"},e.title)))}),F={item:ie.SchedulerItem};j.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=j;exports.schedulerViewItemDefaultProps=F;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import { SchedulerItem as ee } from "./SchedulerItem.mjs";
|
|
11
|
+
import { first as te, calculateOrder as ne, intersects as N } from "../utils/index.mjs";
|
|
12
|
+
import { getRect as y, setRect as T } from "../views/common/utils.mjs";
|
|
13
|
+
import { BORDER_WIDTH as f } from "../constants/index.mjs";
|
|
14
|
+
import { useInternationalization as re } from "@progress/kendo-react-intl";
|
|
15
|
+
import { SchedulerItemContent as V } from "./SchedulerItemContent.mjs";
|
|
16
|
+
import { useDir as ie, IconWrap as H } from "@progress/kendo-react-common";
|
|
17
|
+
import { caretAltRightIcon as le, caretAltLeftIcon as ce, arrowRotateCwIcon as se, arrowsNoRepeatIcon as oe } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { useRowSync as ae } from "../hooks/useRowSync.mjs";
|
|
19
|
+
import { useEditable as me } from "../hooks/useEditable.mjs";
|
|
20
|
+
import { useSchedulerViewItemsContext as ue, useSchedulerViewSlotsContext as de } from "../context/SchedulerViewContext.mjs";
|
|
21
|
+
import { useSchedulerElementContext as fe } from "../context/SchedulerContext.mjs";
|
|
22
|
+
const he = 1, ge = n.forwardRef((e, M) => {
|
|
23
|
+
const { item: F, _ref: L, itemRef: W, ...$ } = e, S = n.useRef(), l = n.useRef(null), x = n.useRef(null), z = n.useRef(null), q = me(e.editable);
|
|
24
|
+
n.useImperativeHandle(x, () => ({ props: e, element: l.current && l.current.element })), n.useImperativeHandle(M, () => x.current), n.useImperativeHandle(L, () => l.current), n.useImperativeHandle(W, () => l.current);
|
|
25
|
+
const B = F || Se.item, w = re(), [G] = ue(), [A] = de(), h = fe(), [K, I] = n.useState(!0), [j, J] = n.useState(!1), [Q, U] = n.useState(0), D = ie(h), P = n.useMemo(
|
|
26
|
+
() => e.isAllDay ? w.toString(e.zonedStart, "t") : w.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
|
|
27
|
+
[w, e.isAllDay, e.zonedEnd, e.zonedStart]
|
|
28
|
+
), k = n.useMemo(() => `(${P}): ${e.title}`, [P, e.title]), _ = (r, t) => {
|
|
29
|
+
let c = 1;
|
|
30
|
+
return r.forEach((o) => {
|
|
31
|
+
const m = t.filter((u) => g(o.current.props, u.props));
|
|
32
|
+
m.length > c && (c = m.length);
|
|
33
|
+
}), c;
|
|
34
|
+
}, X = (r, t) => r.map((o) => t.filter((m) => g(o.current.props, m.props))), g = (r, t) => N(r.start, r.end, t.start, t.end) && r.group.index === t.group.index && r.range.index === t.range.index && (e.ignoreIsAllDay || r.isAllDay === t.isAllDay), R = () => {
|
|
35
|
+
const r = (A || []).filter((o) => o.current && g(o.current.props, e));
|
|
36
|
+
if (r.length === 0) {
|
|
37
|
+
I(!1);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const t = te(r);
|
|
41
|
+
if (!t.current || !l.current)
|
|
42
|
+
return;
|
|
43
|
+
const c = y(t.current.element);
|
|
44
|
+
T(l.current.element, c);
|
|
45
|
+
}, v = () => {
|
|
46
|
+
const r = l.current && l.current.element;
|
|
47
|
+
if (!r)
|
|
48
|
+
return;
|
|
49
|
+
const t = (A || []).filter((s) => s.current && g(s.current.props, e)), c = [], o = [], m = [];
|
|
50
|
+
(G || []).forEach((s) => {
|
|
51
|
+
s.current && (s.current.props.dragHint ? o.push(s.current) : s.current.props.resizeHint ? m.push(s.current) : c.push(s.current));
|
|
52
|
+
});
|
|
53
|
+
const u = e.dragHint || e.resizeHint ? ne(l.current, e.dragHint ? o : m, t, e.ignoreIsAllDay) : e.order || 0;
|
|
54
|
+
let d = e.dragHint || e.resizeHint ? _(t, e.dragHint ? o : m) : _(t, c);
|
|
55
|
+
const Z = X(t, c);
|
|
56
|
+
let b = 0;
|
|
57
|
+
const i = y(r);
|
|
58
|
+
if (Z.forEach((s) => {
|
|
59
|
+
let E = 0;
|
|
60
|
+
s.forEach((a) => {
|
|
61
|
+
N(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a.props._maxSiblingsPerSlot && a.props._maxSiblingsPerSlot > d && a.element !== r && (d = a.props._maxSiblingsPerSlot);
|
|
62
|
+
const O = y(a.element);
|
|
63
|
+
a.props.order !== null && a.props.order < u && (E = O.top + O.height - i.top - f * u + he);
|
|
64
|
+
}), E > b && (b = E);
|
|
65
|
+
}), t.length === 0) {
|
|
66
|
+
I(!1);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const p = q.add ? 20 : 0;
|
|
70
|
+
i.width = e.vertical ? i.width / d - f - p / d : i.width * t.length - f, i.height = e.vertical ? i.height * t.length - f : (e.resizeHint || e.dragHint) && d <= 1 ? i.height : e.style && e.style.height ? e.style.height : 25, i.left = e.vertical ? i.left + u * i.width + f * u : i.left, i.top = e.vertical ? i.top : i.top + b + f * u, U(d), T(r, i), J(!0), I(!0);
|
|
71
|
+
}, C = n.useCallback(
|
|
72
|
+
(r) => {
|
|
73
|
+
const t = r && r[0], c = z.current;
|
|
74
|
+
S.current !== void 0 && window.cancelAnimationFrame(S.current), c && t && (c.width !== t.contentRect.width || c.height !== t.contentRect.height) && (S.current = window.requestAnimationFrame(() => {
|
|
75
|
+
R(), v();
|
|
76
|
+
})), z.current = { width: t.contentRect.width, height: t.contentRect.height };
|
|
77
|
+
},
|
|
78
|
+
[R, v]
|
|
79
|
+
);
|
|
80
|
+
n.useEffect(R), n.useEffect(v);
|
|
81
|
+
const Y = l.current && l.current.element ? l.current.element.closest(".k-scheduler-layout") : null;
|
|
82
|
+
return ae({
|
|
83
|
+
element: Y,
|
|
84
|
+
selector: ".k-resource-row",
|
|
85
|
+
horizontalAttribute: "data-depth-index",
|
|
86
|
+
verticalAttribute: "data-resource-index",
|
|
87
|
+
applyTo: ".k-resource-cell",
|
|
88
|
+
syncHeight: e.isLast
|
|
89
|
+
}), n.useEffect(
|
|
90
|
+
() => {
|
|
91
|
+
if (!h.current)
|
|
92
|
+
return;
|
|
93
|
+
const r = window.ResizeObserver, t = r && new r(C);
|
|
94
|
+
return t && t.observe(h.current), () => {
|
|
95
|
+
t && t.disconnect();
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
[C, h]
|
|
99
|
+
), /* @__PURE__ */ n.createElement(
|
|
100
|
+
B,
|
|
101
|
+
{
|
|
102
|
+
...$,
|
|
103
|
+
_ref: l,
|
|
104
|
+
_maxSiblingsPerSlot: Q,
|
|
105
|
+
itemRef: l,
|
|
106
|
+
style: {
|
|
107
|
+
visibility: j ? void 0 : "hidden",
|
|
108
|
+
display: K ? void 0 : "none",
|
|
109
|
+
...e.style
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
!e.resizeHint && /* @__PURE__ */ n.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ n.createElement(
|
|
113
|
+
H,
|
|
114
|
+
{
|
|
115
|
+
name: D === "rtl" ? "caret-alt-right" : "caret-alt-left",
|
|
116
|
+
icon: D === "rtl" ? le : ce
|
|
117
|
+
}
|
|
118
|
+
), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrow-rotate-cw", icon: se }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrows-no-repeat", icon: oe })),
|
|
119
|
+
!e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: k }, !e.isAllDay && /* @__PURE__ */ n.createElement(V, { className: "k-event-template k-event-time " }, k), /* @__PURE__ */ n.createElement(V, { className: "k-event-template" }, e.title))
|
|
120
|
+
);
|
|
121
|
+
}), Se = {
|
|
122
|
+
item: ee
|
|
123
|
+
};
|
|
124
|
+
ge.displayName = "KendoReactSchedulerViewItem";
|
|
125
|
+
export {
|
|
126
|
+
ge as SchedulerViewItem,
|
|
127
|
+
Se as schedulerViewItemDefaultProps
|
|
128
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@progress/kendo-react-common"),w=require("react"),h=require("../../hooks/useControlledState.js"),a=require("../../utils/index.js"),_=require("../../constants/index.js"),x=require("../../context/SchedulerViewContext.js"),C=require("../../context/SchedulerContext.js");function O(e){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const i=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(A,d,i.get?i:{enumerable:!0,get:()=>e[d]})}}return A.default=e,Object.freeze(A)}const T=O(w);var F=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(F||{});const k=(e,A)=>{const d=T.useRef(0),i=T.useRef(0),R=T.useRef(0),b=T.useRef(null),[n,c]=h.useControlledState(...A),[G]=x.useSchedulerViewSelectedItemsContext(),s=C.useSchedulerFieldsContext(),g=C.useSchedulerGroupsContext();return[n,c,l=>{switch(l.type){case"DRAG_ITEM_SET":{c(l.payload);break}case"DRAG_ITEM_RESET":{c(null);break}case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(i.current-l.payload.x)<10&&Math.abs(R.current-l.payload.y)<10)return;const t=a.slotDive(l.payload.x,l.payload.y,7);if(!t||t===b.current)return;const r=u.clone(e.dataItem),o=t.getAttribute("data-slot-start"),y=t.getAttribute("data-slot-allday")==="true";if(!e.ignoreIsAllDay&&y!==e.isAllDay)return;const m=new Date(a.getField(r,s.start)),D=Number(o)-m.getTime(),M=G.map(E=>{if(!E.current)return null;const I=u.clone(E.current.props.dataItem),f=new Date(E.current.props.start.getTime()+D),S=new Date(E.current.props.end.getTime()+D);return a.setField(I,s.start,f),a.setField(I,s.end,S),I}).filter(Boolean);b.current=t,c([...M]);break}case"DRAG_ITEM_START":{const t=l.payload.x,r=l.payload.y;i.current=t,R.current=r;const o=a.slotDive(t,r,7);if(!o)return;const y=u.clone(e.dataItem),m=o.getAttribute("data-slot-start"),D=a.getField(y,s.start);if(m===null)return;d.current=Number(m)-new Date(D).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(i.current-l.payload.x)<10&&Math.abs(R.current-l.payload.y)<10)return;const t=a.slotDive(l.payload.x,l.payload.y,7);if(!t||t===b.current)return;const r=u.clone(e.dataItem),o=t.getAttribute("data-slot-start"),y=t.getAttribute("data-slot-group"),m=t.getAttribute("data-slot-allday")==="true";if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const D=new Date(a.getField(r,s.start)),E=new Date(a.getField(r,s.end)).getTime()-D.getTime(),I=new Date(Number(o)-Number(d.current)),f=new Date(Number(o)-Number(d.current)+E),S=g.find(p=>p.index===Number(y));a.setField(r,s.start,I),a.setField(r,s.end,f),S&&g.length>1&&S.resources.forEach(p=>{p.multiple||a.setField(r,p.field,p[p.valueField])}),b.current=t,r&&c(r);break}case"DRAG_ITEM_COMPLETE":{c(null),e.onDataAction&&n&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!1,dataItem:n});break}case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(n)?n.slice():u.clone(n);c(null),e.onDataAction&&n&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(n))t=n.map(r=>{const o=u.clone(r);return a.setField(o,s.start,a.getField(r,s.start)),a.setField(o,s.end,a.getField(r,s.end)),o});else{const r=u.clone(n);a.setField(r,s.start,a.getField(n,s.start)),a.setField(r,s.end,a.getField(n,s.end)),t=r}c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:_.DATA_ACTION.update,series:!0,dataItem:t});break}default:c(n);break}}]};exports.DRAG_ITEM_ACTION=F;exports.useDragItem=k;
|