@progress/kendo-vue-scheduler 3.1.3 → 3.1.5-dev.202204110939
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/NOTICE.txt +49 -6
- package/dist/cdn/js/kendo-vue-scheduler.js +2 -2
- package/dist/es/components/SchedulerForm.js +6 -0
- package/dist/es/components/SchedulerOccurrenceDialog.js +52 -7
- package/dist/es/components/SchedulerRemoveDialog.js +52 -7
- package/dist/es/editors/ResourceEditor.js +13 -11
- package/dist/es/editors/SchedulerFormEditor.js +11 -10
- package/dist/es/editors/ZonedDateTime.d.ts +1 -0
- package/dist/es/editors/ZonedDateTime.js +5 -2
- package/dist/es/items/SchedulerEditItem.js +518 -231
- package/dist/es/items/SchedulerItem.js +104 -95
- package/dist/es/items/SchedulerItemContent.js +4 -2
- package/dist/es/items/SchedulerViewItem.js +137 -11
- package/dist/es/items/hooks/use-drag-item.d.ts +2 -6
- package/dist/es/items/hooks/use-drag-item.js +228 -153
- package/dist/es/items/hooks/use-series.d.ts +1 -0
- package/dist/es/items/hooks/use-series.js +1 -2
- package/dist/es/items/hooks/use-show-occurrence-dialog.d.ts +1 -0
- package/dist/es/items/hooks/use-show-occurrence-dialog.js +1 -2
- package/dist/es/items/hooks/use-show-remove-item-dialog.d.ts +1 -0
- package/dist/es/items/hooks/use-show-remove-item-dialog.js +1 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/recurrence/RecurrenceEditor.d.ts +1 -0
- package/dist/es/recurrence/RecurrenceEditor.js +5 -0
- package/dist/es/recurrence/RecurrenceFrequencyEditor.js +4 -0
- package/dist/es/recurrence/RecurrenceRepeatOnWeekEditor.js +4 -0
- package/dist/es/recurrence/common.js +2 -1
- package/dist/es/tasks/SchedulerEditTask.d.ts +9 -0
- package/dist/es/tasks/SchedulerEditTask.js +118 -35
- package/dist/es/tasks/SchedulerTask.js +3 -2
- package/dist/es/tasks/SchedulerViewTask.js +15 -3
- package/dist/es/views/agenda/AgendaView.js +21 -9
- package/dist/es/views/agenda/AgendaViewBody.d.ts +1 -0
- package/dist/es/views/agenda/AgendaViewBody.js +6 -1
- package/dist/es/views/common/SchedulerDrag.js +62 -11
- package/dist/es/views/day/DayView.js +4 -0
- package/dist/es/views/month/MonthView.js +5 -1
- package/dist/es/views/time/MultiDayTimelineView.js +28 -9
- package/dist/es/views/time/TimelineView.js +4 -0
- package/dist/es/views/week/WeekView.js +12 -2
- package/dist/es/views/week/WorkWeekView.js +12 -2
- package/dist/npm/components/SchedulerForm.js +6 -0
- package/dist/npm/components/SchedulerOccurrenceDialog.js +52 -7
- package/dist/npm/components/SchedulerRemoveDialog.js +52 -7
- package/dist/npm/editors/ResourceEditor.js +12 -10
- package/dist/npm/editors/SchedulerFormEditor.js +11 -11
- package/dist/npm/editors/ZonedDateTime.d.ts +1 -0
- package/dist/npm/editors/ZonedDateTime.js +4 -1
- package/dist/npm/items/SchedulerEditItem.js +517 -224
- package/dist/npm/items/SchedulerItem.js +104 -95
- package/dist/npm/items/SchedulerItemContent.js +4 -2
- package/dist/npm/items/SchedulerViewItem.js +137 -11
- package/dist/npm/items/hooks/use-drag-item.d.ts +2 -6
- package/dist/npm/items/hooks/use-drag-item.js +231 -153
- package/dist/npm/items/hooks/use-series.d.ts +1 -0
- package/dist/npm/items/hooks/use-series.js +2 -2
- package/dist/npm/items/hooks/use-show-occurrence-dialog.d.ts +1 -0
- package/dist/npm/items/hooks/use-show-occurrence-dialog.js +2 -2
- package/dist/npm/items/hooks/use-show-remove-item-dialog.d.ts +1 -0
- package/dist/npm/items/hooks/use-show-remove-item-dialog.js +2 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/recurrence/RecurrenceEditor.d.ts +1 -0
- package/dist/npm/recurrence/RecurrenceEditor.js +5 -0
- package/dist/npm/recurrence/RecurrenceFrequencyEditor.js +4 -0
- package/dist/npm/recurrence/RecurrenceRepeatOnWeekEditor.js +4 -0
- package/dist/npm/recurrence/common.js +2 -1
- package/dist/npm/tasks/SchedulerEditTask.d.ts +9 -0
- package/dist/npm/tasks/SchedulerEditTask.js +120 -35
- package/dist/npm/tasks/SchedulerTask.js +3 -2
- package/dist/npm/tasks/SchedulerViewTask.js +15 -3
- package/dist/npm/views/agenda/AgendaView.js +21 -9
- package/dist/npm/views/agenda/AgendaViewBody.d.ts +1 -0
- package/dist/npm/views/agenda/AgendaViewBody.js +6 -1
- package/dist/npm/views/common/SchedulerDrag.js +62 -11
- package/dist/npm/views/day/DayView.js +4 -0
- package/dist/npm/views/month/MonthView.js +5 -1
- package/dist/npm/views/time/MultiDayTimelineView.js +27 -8
- package/dist/npm/views/time/TimelineView.js +4 -0
- package/dist/npm/views/week/WeekView.js +12 -2
- package/dist/npm/views/week/WorkWeekView.js +12 -2
- package/package.json +12 -12
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __spreadArrays = undefined && undefined.__spreadArrays || function () {
|
|
4
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
5
|
+
s += arguments[i].length;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
9
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
10
|
+
r[k] = a[j];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return r;
|
|
15
|
+
};
|
|
16
|
+
|
|
3
17
|
Object.defineProperty(exports, "__esModule", {
|
|
4
18
|
value: true
|
|
5
19
|
});
|
|
6
20
|
exports.useDragItem = exports.DRAG_ITEM_ACTION = void 0;
|
|
21
|
+
|
|
22
|
+
var kendo_vue_common_1 = require("@progress/kendo-vue-common"); // import { useSchedulerFieldsContext, useSchedulerGroupsContext,
|
|
23
|
+
// useSchedulerViewSelectedItemsContext } from '../../context';
|
|
24
|
+
// import { useControlledState } from '../../hooks/useControlledState';
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var main_1 = require("../../main");
|
|
28
|
+
|
|
29
|
+
var utils_1 = require("../../utils");
|
|
7
30
|
/**
|
|
8
31
|
* Represents the available `action` types for the `SchedulerItemDragItemAction` objects.
|
|
9
32
|
*
|
|
@@ -18,6 +41,7 @@ exports.useDragItem = exports.DRAG_ITEM_ACTION = void 0;
|
|
|
18
41
|
* - `DRAG_ITEM_DRAG_SELECTED`
|
|
19
42
|
*/
|
|
20
43
|
|
|
44
|
+
|
|
21
45
|
var DRAG_ITEM_ACTION;
|
|
22
46
|
|
|
23
47
|
(function (DRAG_ITEM_ACTION) {
|
|
@@ -30,160 +54,214 @@ var DRAG_ITEM_ACTION;
|
|
|
30
54
|
DRAG_ITEM_ACTION["reset"] = "DRAG_ITEM_RESET";
|
|
31
55
|
DRAG_ITEM_ACTION["dragSelected"] = "DRAG_ITEM_DRAG_SELECTED";
|
|
32
56
|
})(DRAG_ITEM_ACTION = exports.DRAG_ITEM_ACTION || (exports.DRAG_ITEM_ACTION = {}));
|
|
57
|
+
|
|
58
|
+
var offset = 0;
|
|
59
|
+
var initialXRef = 0;
|
|
60
|
+
var initialYRef = 0;
|
|
61
|
+
var oldSlot = null;
|
|
33
62
|
/** @hidden */
|
|
34
63
|
|
|
64
|
+
exports.useDragItem = function (action) {
|
|
65
|
+
var _this = this;
|
|
66
|
+
|
|
67
|
+
var dataItem = kendo_vue_common_1.clone(this.dataItem);
|
|
68
|
+
|
|
69
|
+
switch (action.type) {
|
|
70
|
+
case DRAG_ITEM_ACTION.set:
|
|
71
|
+
{
|
|
72
|
+
this.currentDragItem = action.payload;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
case DRAG_ITEM_ACTION.reset:
|
|
77
|
+
{
|
|
78
|
+
this.currentDragItem = null;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
case DRAG_ITEM_ACTION.dragSelected:
|
|
83
|
+
{
|
|
84
|
+
if (Math.abs(initialXRef - action.payload.x) < 10 && Math.abs(initialYRef - action.payload.y) < 10) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var slot = utils_1.slotDive(action.payload.x, action.payload.y, 7);
|
|
89
|
+
|
|
90
|
+
if (!slot) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (slot === oldSlot) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
var slotStart = slot.getAttribute('data-slot-start');
|
|
99
|
+
var slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
100
|
+
|
|
101
|
+
if (!this.ignoreIsAllDay && slotIsAllDay !== this.isAllDay) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
var itemStart = new Date(utils_1.getField(dataItem, this.ks.fields.start));
|
|
106
|
+
var distance_1 = Number(slotStart) - itemStart.getTime();
|
|
107
|
+
var newDragItems = this.bv.selectedItems.map(function (si) {
|
|
108
|
+
if (!si) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
var selectedDataItem = kendo_vue_common_1.clone(si.props.dataItem);
|
|
113
|
+
var selectedStart = new Date(si.props.start.getTime() + distance_1);
|
|
114
|
+
var selectedEnd = new Date(si.props.end.getTime() + distance_1);
|
|
115
|
+
utils_1.setField(selectedDataItem, _this.ks.fields.start, selectedStart);
|
|
116
|
+
utils_1.setField(selectedDataItem, _this.ks.fields.end, selectedEnd);
|
|
117
|
+
return selectedDataItem;
|
|
118
|
+
}).filter(Boolean);
|
|
119
|
+
oldSlot = slot;
|
|
120
|
+
this.currentDragItem = __spreadArrays(newDragItems);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
case DRAG_ITEM_ACTION.start:
|
|
125
|
+
{
|
|
126
|
+
var clientX = action.payload.x;
|
|
127
|
+
var clientY = action.payload.y;
|
|
128
|
+
initialXRef = clientX;
|
|
129
|
+
initialYRef = clientY;
|
|
130
|
+
var slot = utils_1.slotDive(clientX, clientY, 7);
|
|
131
|
+
|
|
132
|
+
if (!slot) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var slotStart = slot.getAttribute('data-slot-start');
|
|
137
|
+
var itemStart = utils_1.getField(dataItem, this.ks.fields.start);
|
|
138
|
+
|
|
139
|
+
if (slotStart === null) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
offset = Number(slotStart) - new Date(itemStart).getTime();
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
case DRAG_ITEM_ACTION.drag:
|
|
148
|
+
{
|
|
149
|
+
if (Math.abs(initialXRef - action.payload.x) < 10 && Math.abs(initialYRef - action.payload.y) < 10) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var slot = utils_1.slotDive(action.payload.x, action.payload.y, 7);
|
|
154
|
+
|
|
155
|
+
if (!slot) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (slot === oldSlot) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
var slotStart = slot.getAttribute('data-slot-start');
|
|
164
|
+
var slotGroupIndex_1 = slot.getAttribute('data-slot-group');
|
|
165
|
+
var slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
166
|
+
|
|
167
|
+
if (!this.ignoreIsAllDay && slotIsAllDay !== this.isAllDay) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
var itemStart = new Date(utils_1.getField(dataItem, this.ks.fields.start));
|
|
172
|
+
var itemEnd = new Date(utils_1.getField(dataItem, this.ks.fields.end));
|
|
173
|
+
var duration = itemEnd.getTime() - itemStart.getTime();
|
|
174
|
+
var start = new Date(Number(slotStart) - Number(offset));
|
|
175
|
+
var end = new Date(Number(slotStart) - Number(offset) + duration);
|
|
176
|
+
var group = this.ks.groups.find(function (g) {
|
|
177
|
+
return g.index === Number(slotGroupIndex_1);
|
|
178
|
+
});
|
|
179
|
+
utils_1.setField(dataItem, this.ks.fields.start, start);
|
|
180
|
+
utils_1.setField(dataItem, this.ks.fields.end, end);
|
|
181
|
+
|
|
182
|
+
if (group && this.ks.groups.length > 1) {
|
|
183
|
+
group.resources.forEach(function (resource) {
|
|
184
|
+
if (!resource.multiple) {
|
|
185
|
+
utils_1.setField(dataItem, resource.field, resource[resource.valueField]);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
oldSlot = slot;
|
|
191
|
+
|
|
192
|
+
if (dataItem) {
|
|
193
|
+
this.currentDragItem = dataItem;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
case DRAG_ITEM_ACTION.complete:
|
|
200
|
+
{
|
|
201
|
+
this.currentDragItem = null;
|
|
202
|
+
|
|
203
|
+
if (this.compDragItem) {
|
|
204
|
+
this.$emit('dataaction', {
|
|
205
|
+
type: main_1.DATA_ACTION.update,
|
|
206
|
+
series: false,
|
|
207
|
+
dataItem: this.compDragItem
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
case DRAG_ITEM_ACTION.completeOccurrence:
|
|
215
|
+
{
|
|
216
|
+
var newDataItem = Array.isArray(this.compDragItem) ? this.compDragItem.slice() : kendo_vue_common_1.clone(this.compDragItem);
|
|
217
|
+
this.currentDragItem = null;
|
|
218
|
+
|
|
219
|
+
if (this.compDragItem) {
|
|
220
|
+
this.$emit('dataaction', {
|
|
221
|
+
type: main_1.DATA_ACTION.update,
|
|
222
|
+
series: false,
|
|
223
|
+
dataItem: newDataItem
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
case DRAG_ITEM_ACTION.completeSeries:
|
|
231
|
+
{
|
|
232
|
+
var newDataItems = void 0;
|
|
233
|
+
|
|
234
|
+
if (Array.isArray(this.compDragItem)) {
|
|
235
|
+
newDataItems = this.compDragItem.map(function (di) {
|
|
236
|
+
var updated = kendo_vue_common_1.clone(di);
|
|
237
|
+
utils_1.setField(updated, _this.ks.fields.start, utils_1.getField(di, _this.ks.fields.start));
|
|
238
|
+
utils_1.setField(updated, _this.ks.fields.end, utils_1.getField(di, _this.ks.fields.end));
|
|
239
|
+
return updated;
|
|
240
|
+
});
|
|
241
|
+
} else {
|
|
242
|
+
var updated = kendo_vue_common_1.clone(this.compDragItem);
|
|
243
|
+
utils_1.setField(updated, this.ks.fields.start, utils_1.getField(this.compDragItem, this.ks.fields.start));
|
|
244
|
+
utils_1.setField(updated, this.ks.fields.end, utils_1.getField(this.compDragItem, this.ks.fields.end));
|
|
245
|
+
newDataItems = updated;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
this.currentDragItem = null;
|
|
249
|
+
|
|
250
|
+
if (newDataItems) {
|
|
251
|
+
this.$emit('dataaction', {
|
|
252
|
+
type: main_1.DATA_ACTION.update,
|
|
253
|
+
series: true,
|
|
254
|
+
dataItem: newDataItems
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
default:
|
|
262
|
+
this.currentDragItem = this.compDragItem;
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
35
265
|
|
|
36
|
-
|
|
37
|
-
// const offset = React.useRef<number>(0);
|
|
38
|
-
// const initialXRef = React.useRef<number>(0);
|
|
39
|
-
// const initialYRef = React.useRef<number>(0);
|
|
40
|
-
// const oldSlot = React.useRef<HTMLElement | null>(null);
|
|
41
|
-
// const [dragItem, setDragItem] = useControlledState<DataItem | null | (DataItem | null)[]>(...state);
|
|
42
|
-
// const [selectedItems] = useSchedulerViewSelectedItemsContext();
|
|
43
|
-
// const fields = useSchedulerFieldsContext();
|
|
44
|
-
// const groups = useSchedulerGroupsContext();
|
|
45
|
-
// const handleDragItemAction = (action: SchedulerItemDragItemAction) => {
|
|
46
|
-
// switch(action.type) {
|
|
47
|
-
// case DRAG_ITEM_ACTION.set:{
|
|
48
|
-
// setDragItem(action.payload);
|
|
49
|
-
// break;
|
|
50
|
-
// }
|
|
51
|
-
// case DRAG_ITEM_ACTION.reset:{
|
|
52
|
-
// setDragItem(null);
|
|
53
|
-
// break;
|
|
54
|
-
// }
|
|
55
|
-
// case DRAG_ITEM_ACTION.dragSelected: {
|
|
56
|
-
// if (
|
|
57
|
-
// Math.abs(initialXRef.current - action.payload.x) < 10
|
|
58
|
-
// && Math.abs(initialYRef.current - action.payload.y) < 10
|
|
59
|
-
// ) {
|
|
60
|
-
// return;
|
|
61
|
-
// }
|
|
62
|
-
// const slot: HTMLElement | null = slotDive(action.payload.x, action.payload.y, 7);
|
|
63
|
-
// if (!slot) { return; }
|
|
64
|
-
// if (slot === oldSlot.current) { return; }
|
|
65
|
-
// const dataItem = clone(config.dataItem);
|
|
66
|
-
// const slotStart = slot.getAttribute('data-slot-start');
|
|
67
|
-
// const slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
68
|
-
// if (!config.ignoreIsAllDay && slotIsAllDay !== config.isAllDay) { return; }
|
|
69
|
-
// const itemStart = new Date(getField(dataItem, fields.start));
|
|
70
|
-
// const distance = Number(slotStart) - itemStart.getTime();
|
|
71
|
-
// const newDragItems = selectedItems.map((si) => {
|
|
72
|
-
// if(!si.current) {return null;}
|
|
73
|
-
// const selectedDataItem = clone(si.current.props.dataItem);
|
|
74
|
-
// const selectedStart = new Date(si.current.props.start.getTime() + distance);
|
|
75
|
-
// const selectedEnd = new Date(si.current.props.end.getTime() + distance);
|
|
76
|
-
// setField(selectedDataItem, fields.start, selectedStart);
|
|
77
|
-
// setField(selectedDataItem, fields.end, selectedEnd);
|
|
78
|
-
// return selectedDataItem;
|
|
79
|
-
// }).filter(Boolean);
|
|
80
|
-
// oldSlot.current = slot;
|
|
81
|
-
// setDragItem([...newDragItems]);
|
|
82
|
-
// break;
|
|
83
|
-
// }
|
|
84
|
-
// case DRAG_ITEM_ACTION.start: {
|
|
85
|
-
// const clientX = action.payload.x;
|
|
86
|
-
// const clientY = action.payload.y;
|
|
87
|
-
// initialXRef.current = clientX;
|
|
88
|
-
// initialYRef.current = clientY;
|
|
89
|
-
// const slot: HTMLElement | null = slotDive(clientX, clientY, 7);
|
|
90
|
-
// if (!slot) { return; }
|
|
91
|
-
// const dataItem = clone(config.dataItem);
|
|
92
|
-
// const slotStart = slot.getAttribute('data-slot-start');
|
|
93
|
-
// const itemStart = getField(dataItem, fields.start);
|
|
94
|
-
// if (slotStart === null) { return; }
|
|
95
|
-
// offset.current = Number(slotStart) - new Date(itemStart).getTime();
|
|
96
|
-
// break;
|
|
97
|
-
// }
|
|
98
|
-
// case DRAG_ITEM_ACTION.drag: {
|
|
99
|
-
// if (
|
|
100
|
-
// Math.abs(initialXRef.current - action.payload.x) < 10
|
|
101
|
-
// && Math.abs(initialYRef.current - action.payload.y) < 10
|
|
102
|
-
// ) {
|
|
103
|
-
// return;
|
|
104
|
-
// }
|
|
105
|
-
// const slot: HTMLElement | null = slotDive(action.payload.x, action.payload.y, 7);
|
|
106
|
-
// if (!slot) { return; }
|
|
107
|
-
// if (slot === oldSlot.current) { return; }
|
|
108
|
-
// const dataItem = clone(config.dataItem);
|
|
109
|
-
// const slotStart = slot.getAttribute('data-slot-start');
|
|
110
|
-
// const slotGroupIndex = slot.getAttribute('data-slot-group');
|
|
111
|
-
// const slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
112
|
-
// if (!config.ignoreIsAllDay && slotIsAllDay !== config.isAllDay) { return; }
|
|
113
|
-
// const itemStart = new Date(getField(dataItem, fields.start));
|
|
114
|
-
// const itemEnd = new Date(getField(dataItem, fields.end));
|
|
115
|
-
// const duration = itemEnd.getTime() - itemStart.getTime();
|
|
116
|
-
// const start = new Date(Number(slotStart) - Number(offset.current));
|
|
117
|
-
// const end = new Date(Number(slotStart) - Number(offset.current) + duration);
|
|
118
|
-
// const group = groups.find((g) => g.index === Number(slotGroupIndex));
|
|
119
|
-
// setField(dataItem, fields.start, start);
|
|
120
|
-
// setField(dataItem, fields.end, end);
|
|
121
|
-
// if (group && groups.length > 1) {
|
|
122
|
-
// group.resources.forEach((resource) => {
|
|
123
|
-
// if (!resource.multiple) {
|
|
124
|
-
// setField(dataItem, resource.field, resource[resource.valueField]);
|
|
125
|
-
// }
|
|
126
|
-
// });
|
|
127
|
-
// }
|
|
128
|
-
// oldSlot.current = slot;
|
|
129
|
-
// if (dataItem) {
|
|
130
|
-
// setDragItem(dataItem);
|
|
131
|
-
// }
|
|
132
|
-
// break;
|
|
133
|
-
// }
|
|
134
|
-
// case DRAG_ITEM_ACTION.complete: {
|
|
135
|
-
// setDragItem(null);
|
|
136
|
-
// if(config.onDataAction && dragItem) {
|
|
137
|
-
// config.onDataAction.call(undefined,{
|
|
138
|
-
// type: DATA_ACTION.update,
|
|
139
|
-
// series: false,
|
|
140
|
-
// dataItem: dragItem
|
|
141
|
-
// });
|
|
142
|
-
// }
|
|
143
|
-
// break;
|
|
144
|
-
// }
|
|
145
|
-
// case DRAG_ITEM_ACTION.completeOccurrence: {
|
|
146
|
-
// const newDataItem = Array.isArray(dragItem) ? dragItem.slice() : clone(dragItem);
|
|
147
|
-
// setDragItem(null);
|
|
148
|
-
// if(config.onDataAction && dragItem) {
|
|
149
|
-
// config.onDataAction.call(undefined,{
|
|
150
|
-
// type: DATA_ACTION.update,
|
|
151
|
-
// series: false,
|
|
152
|
-
// dataItem: newDataItem
|
|
153
|
-
// });
|
|
154
|
-
// }
|
|
155
|
-
// break;
|
|
156
|
-
// }
|
|
157
|
-
// case DRAG_ITEM_ACTION.completeSeries: {
|
|
158
|
-
// let newDataItems;
|
|
159
|
-
// if(Array.isArray(dragItem)) {
|
|
160
|
-
// newDataItems = dragItem.map((di) => {
|
|
161
|
-
// const updated = clone(di);
|
|
162
|
-
// setField(updated, fields.start, getField(di, fields.start));
|
|
163
|
-
// setField(updated, fields.end, getField(di, fields.end));
|
|
164
|
-
// return updated;
|
|
165
|
-
// });
|
|
166
|
-
// } else {
|
|
167
|
-
// const updated = clone(dragItem);
|
|
168
|
-
// setField(updated, fields.start, getField(dragItem, fields.start));
|
|
169
|
-
// setField(updated, fields.end, getField(dragItem, fields.end));
|
|
170
|
-
// newDataItems = updated;
|
|
171
|
-
// }
|
|
172
|
-
// setDragItem(null);
|
|
173
|
-
// if(config.onDataAction && newDataItems) {
|
|
174
|
-
// config.onDataAction.call(undefined,{
|
|
175
|
-
// type: DATA_ACTION.update,
|
|
176
|
-
// series: true,
|
|
177
|
-
// dataItem: newDataItems
|
|
178
|
-
// });
|
|
179
|
-
// }
|
|
180
|
-
// break;
|
|
181
|
-
// }
|
|
182
|
-
// default:
|
|
183
|
-
// setDragItem(dragItem);
|
|
184
|
-
// break;
|
|
185
|
-
// }
|
|
186
|
-
// };
|
|
187
|
-
// return [dragItem, setDragItem, handleDragItemAction];
|
|
188
|
-
return [];
|
|
266
|
+
this.$emit('dragitemchange', this.currentDragItem);
|
|
189
267
|
};
|
|
@@ -19,5 +19,6 @@ export declare type SchedulerItemSeriesAction = {
|
|
|
19
19
|
type: SERIES_ACTION;
|
|
20
20
|
payload?: boolean;
|
|
21
21
|
};
|
|
22
|
+
export declare const seriesReducer: (state: any, action: SchedulerItemSeriesAction) => any;
|
|
22
23
|
/** @hidden */
|
|
23
24
|
export declare const useSeries: (_defaultProp: DataItem, _prop?: DataItem, _callback?: any) => any[];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useSeries = exports.SERIES_ACTION = void 0;
|
|
6
|
+
exports.useSeries = exports.seriesReducer = exports.SERIES_ACTION = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Represents the available `action` types for the `SchedulerItemSeriesAction` objects.
|
|
9
9
|
*
|
|
@@ -21,7 +21,7 @@ var SERIES_ACTION;
|
|
|
21
21
|
SERIES_ACTION["toggle"] = "SERIES_TOGGLE";
|
|
22
22
|
})(SERIES_ACTION = exports.SERIES_ACTION || (exports.SERIES_ACTION = {}));
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
exports.seriesReducer = function (state, action) {
|
|
25
25
|
switch (action.type) {
|
|
26
26
|
case SERIES_ACTION.reset:
|
|
27
27
|
return null;
|
|
@@ -23,5 +23,6 @@ export declare type SchedulerItemShowOccurrenceDialogAction = {
|
|
|
23
23
|
type: SHOW_OCCURRENCE_DIALOG_ACTION;
|
|
24
24
|
payload?: boolean;
|
|
25
25
|
};
|
|
26
|
+
export declare const showOccurrenceDialogReducer: (state: any, action: SchedulerItemShowOccurrenceDialogAction) => any;
|
|
26
27
|
/** @hidden */
|
|
27
28
|
export declare const useShowOccurrenceDialog: (_defaultProp: DataItem, _prop?: DataItem, _callback?: any) => any[];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useShowOccurrenceDialog = exports.SHOW_OCCURRENCE_DIALOG_ACTION = void 0;
|
|
6
|
+
exports.useShowOccurrenceDialog = exports.showOccurrenceDialogReducer = exports.SHOW_OCCURRENCE_DIALOG_ACTION = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Represents the available `action` types for the `SchedulerItemShowOccurrenceDialogAction` objects.
|
|
9
9
|
*
|
|
@@ -25,7 +25,7 @@ var SHOW_OCCURRENCE_DIALOG_ACTION;
|
|
|
25
25
|
SHOW_OCCURRENCE_DIALOG_ACTION["toggle"] = "SHOW_OCCURRENCE_DIALOG_TOGGLE";
|
|
26
26
|
})(SHOW_OCCURRENCE_DIALOG_ACTION = exports.SHOW_OCCURRENCE_DIALOG_ACTION || (exports.SHOW_OCCURRENCE_DIALOG_ACTION = {}));
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
exports.showOccurrenceDialogReducer = function (state, action) {
|
|
29
29
|
switch (action.type) {
|
|
30
30
|
case SHOW_OCCURRENCE_DIALOG_ACTION.reset:
|
|
31
31
|
return false;
|
|
@@ -23,5 +23,6 @@ export declare type SchedulerItemShowRemoveDialogAction = {
|
|
|
23
23
|
type: SHOW_REMOVE_DIALOG_ACTION;
|
|
24
24
|
payload?: boolean;
|
|
25
25
|
};
|
|
26
|
+
export declare const showRemoveDialogReducer: (state: any, action: SchedulerItemShowRemoveDialogAction) => any;
|
|
26
27
|
/** @hidden */
|
|
27
28
|
export declare const useShowRemoveDialog: (_defaultProp: DataItem, _prop?: DataItem, _callback?: any) => any[];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useShowRemoveDialog = exports.SHOW_REMOVE_DIALOG_ACTION = void 0;
|
|
6
|
+
exports.useShowRemoveDialog = exports.showRemoveDialogReducer = exports.SHOW_REMOVE_DIALOG_ACTION = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Represents the available `action` types for the `SchedulerItemShowRemoveDialogAction` objects.
|
|
9
9
|
*
|
|
@@ -25,7 +25,7 @@ var SHOW_REMOVE_DIALOG_ACTION;
|
|
|
25
25
|
SHOW_REMOVE_DIALOG_ACTION["toggle"] = "SHOW_REMOVE_DIALOG_TOGGLE";
|
|
26
26
|
})(SHOW_REMOVE_DIALOG_ACTION = exports.SHOW_REMOVE_DIALOG_ACTION || (exports.SHOW_REMOVE_DIALOG_ACTION = {}));
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
exports.showRemoveDialogReducer = function (state, action) {
|
|
29
29
|
switch (action.type) {
|
|
30
30
|
case SHOW_REMOVE_DIALOG_ACTION.reset:
|
|
31
31
|
return false;
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-scheduler',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1649669747,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
14
14
|
};
|
|
@@ -36,7 +36,12 @@ var kendo_vue_dateinputs_1 = require("@progress/kendo-vue-dateinputs"); // tslin
|
|
|
36
36
|
|
|
37
37
|
var RecurrenceEditorVue2 = {
|
|
38
38
|
name: 'KendoRecurrenceEditor',
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
emits: {
|
|
41
|
+
change: null
|
|
42
|
+
},
|
|
39
43
|
props: {
|
|
44
|
+
name: String,
|
|
40
45
|
value: {
|
|
41
46
|
type: String,
|
|
42
47
|
default: ''
|
|
@@ -16,6 +16,10 @@ var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons"); // tslint:enab
|
|
|
16
16
|
|
|
17
17
|
var RecurrenceFrequencyEditorVue2 = {
|
|
18
18
|
name: 'KendoRecurrenceFrequencyEditor',
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
emits: {
|
|
21
|
+
change: null
|
|
22
|
+
},
|
|
19
23
|
props: {
|
|
20
24
|
value: String,
|
|
21
25
|
dataItems: Array
|
|
@@ -32,6 +32,10 @@ var common_1 = require("./common"); // tslint:enable:max-line-length
|
|
|
32
32
|
|
|
33
33
|
var RecurrenceRepeatOnWeekEditorVue2 = {
|
|
34
34
|
name: 'KendoRecurrenceRepeatOnWeekEditor',
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
emits: {
|
|
37
|
+
change: null
|
|
38
|
+
},
|
|
35
39
|
props: {
|
|
36
40
|
dataItems: {
|
|
37
41
|
type: Array,
|
|
@@ -76,7 +76,8 @@ exports.getUntil = function (rrule) {
|
|
|
76
76
|
exports.getMonths = function (intl) {
|
|
77
77
|
return intl.dateFormatNames({
|
|
78
78
|
type: 'months',
|
|
79
|
-
nameType: 'wide'
|
|
79
|
+
nameType: 'wide',
|
|
80
|
+
standAlone: true
|
|
80
81
|
}).map(function (month, idx) { return ({
|
|
81
82
|
text: month,
|
|
82
83
|
value: idx + 1
|
|
@@ -26,6 +26,15 @@ export interface SchedulerEditTaskProps extends SchedulerViewTaskProps {
|
|
|
26
26
|
* Setting this property will force the `showRemoveDialog` to be in controlled state, allowing further control over the display of the `removeDialog` component.
|
|
27
27
|
*/
|
|
28
28
|
showRemoveDialog?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates if the editing should be applied to the whole `series` or to a single `occurrence` when the item is recurring.
|
|
31
|
+
*
|
|
32
|
+
* By default, the `series` prop is set to `null` and additional selection is done through the `occurrence` dialog.
|
|
33
|
+
* If set ot either `true` or `false`:
|
|
34
|
+
* - `true` — indicates that the editing should always be applied to the whole `series`
|
|
35
|
+
* - `false` — indicates that the editing should always be applied to a single `occurrence`.
|
|
36
|
+
*/
|
|
37
|
+
series?: boolean | null;
|
|
29
38
|
/**
|
|
30
39
|
* Called every time the `showRemoveDialog` changes.
|
|
31
40
|
*/
|