@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,3 +1,23 @@
|
|
|
1
|
+
var __spreadArrays = this && this.__spreadArrays || function () {
|
|
2
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
3
|
+
s += arguments[i].length;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
7
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
8
|
+
r[k] = a[j];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return r;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
import { clone } from '@progress/kendo-vue-common'; // import { useSchedulerFieldsContext, useSchedulerGroupsContext,
|
|
16
|
+
// useSchedulerViewSelectedItemsContext } from '../../context';
|
|
17
|
+
// import { useControlledState } from '../../hooks/useControlledState';
|
|
18
|
+
|
|
19
|
+
import { DATA_ACTION } from '../../main';
|
|
20
|
+
import { getField, setField, slotDive } from '../../utils';
|
|
1
21
|
/**
|
|
2
22
|
* Represents the available `action` types for the `SchedulerItemDragItemAction` objects.
|
|
3
23
|
*
|
|
@@ -11,6 +31,7 @@
|
|
|
11
31
|
* - `DRAG_ITEM_RESET'`
|
|
12
32
|
* - `DRAG_ITEM_DRAG_SELECTED`
|
|
13
33
|
*/
|
|
34
|
+
|
|
14
35
|
export var DRAG_ITEM_ACTION;
|
|
15
36
|
|
|
16
37
|
(function (DRAG_ITEM_ACTION) {
|
|
@@ -23,160 +44,214 @@ export var DRAG_ITEM_ACTION;
|
|
|
23
44
|
DRAG_ITEM_ACTION["reset"] = "DRAG_ITEM_RESET";
|
|
24
45
|
DRAG_ITEM_ACTION["dragSelected"] = "DRAG_ITEM_DRAG_SELECTED";
|
|
25
46
|
})(DRAG_ITEM_ACTION || (DRAG_ITEM_ACTION = {}));
|
|
47
|
+
|
|
48
|
+
var offset = 0;
|
|
49
|
+
var initialXRef = 0;
|
|
50
|
+
var initialYRef = 0;
|
|
51
|
+
var oldSlot = null;
|
|
26
52
|
/** @hidden */
|
|
27
53
|
|
|
54
|
+
export var useDragItem = function useDragItem(action) {
|
|
55
|
+
var _this = this;
|
|
56
|
+
|
|
57
|
+
var dataItem = clone(this.dataItem);
|
|
58
|
+
|
|
59
|
+
switch (action.type) {
|
|
60
|
+
case DRAG_ITEM_ACTION.set:
|
|
61
|
+
{
|
|
62
|
+
this.currentDragItem = action.payload;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
case DRAG_ITEM_ACTION.reset:
|
|
67
|
+
{
|
|
68
|
+
this.currentDragItem = null;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
case DRAG_ITEM_ACTION.dragSelected:
|
|
73
|
+
{
|
|
74
|
+
if (Math.abs(initialXRef - action.payload.x) < 10 && Math.abs(initialYRef - action.payload.y) < 10) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var slot = slotDive(action.payload.x, action.payload.y, 7);
|
|
79
|
+
|
|
80
|
+
if (!slot) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (slot === oldSlot) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var slotStart = slot.getAttribute('data-slot-start');
|
|
89
|
+
var slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
90
|
+
|
|
91
|
+
if (!this.ignoreIsAllDay && slotIsAllDay !== this.isAllDay) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var itemStart = new Date(getField(dataItem, this.ks.fields.start));
|
|
96
|
+
var distance_1 = Number(slotStart) - itemStart.getTime();
|
|
97
|
+
var newDragItems = this.bv.selectedItems.map(function (si) {
|
|
98
|
+
if (!si) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var selectedDataItem = clone(si.props.dataItem);
|
|
103
|
+
var selectedStart = new Date(si.props.start.getTime() + distance_1);
|
|
104
|
+
var selectedEnd = new Date(si.props.end.getTime() + distance_1);
|
|
105
|
+
setField(selectedDataItem, _this.ks.fields.start, selectedStart);
|
|
106
|
+
setField(selectedDataItem, _this.ks.fields.end, selectedEnd);
|
|
107
|
+
return selectedDataItem;
|
|
108
|
+
}).filter(Boolean);
|
|
109
|
+
oldSlot = slot;
|
|
110
|
+
this.currentDragItem = __spreadArrays(newDragItems);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
case DRAG_ITEM_ACTION.start:
|
|
115
|
+
{
|
|
116
|
+
var clientX = action.payload.x;
|
|
117
|
+
var clientY = action.payload.y;
|
|
118
|
+
initialXRef = clientX;
|
|
119
|
+
initialYRef = clientY;
|
|
120
|
+
var slot = slotDive(clientX, clientY, 7);
|
|
121
|
+
|
|
122
|
+
if (!slot) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var slotStart = slot.getAttribute('data-slot-start');
|
|
127
|
+
var itemStart = getField(dataItem, this.ks.fields.start);
|
|
128
|
+
|
|
129
|
+
if (slotStart === null) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
offset = Number(slotStart) - new Date(itemStart).getTime();
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
case DRAG_ITEM_ACTION.drag:
|
|
138
|
+
{
|
|
139
|
+
if (Math.abs(initialXRef - action.payload.x) < 10 && Math.abs(initialYRef - action.payload.y) < 10) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
var slot = slotDive(action.payload.x, action.payload.y, 7);
|
|
144
|
+
|
|
145
|
+
if (!slot) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (slot === oldSlot) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var slotStart = slot.getAttribute('data-slot-start');
|
|
154
|
+
var slotGroupIndex_1 = slot.getAttribute('data-slot-group');
|
|
155
|
+
var slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
156
|
+
|
|
157
|
+
if (!this.ignoreIsAllDay && slotIsAllDay !== this.isAllDay) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var itemStart = new Date(getField(dataItem, this.ks.fields.start));
|
|
162
|
+
var itemEnd = new Date(getField(dataItem, this.ks.fields.end));
|
|
163
|
+
var duration = itemEnd.getTime() - itemStart.getTime();
|
|
164
|
+
var start = new Date(Number(slotStart) - Number(offset));
|
|
165
|
+
var end = new Date(Number(slotStart) - Number(offset) + duration);
|
|
166
|
+
var group = this.ks.groups.find(function (g) {
|
|
167
|
+
return g.index === Number(slotGroupIndex_1);
|
|
168
|
+
});
|
|
169
|
+
setField(dataItem, this.ks.fields.start, start);
|
|
170
|
+
setField(dataItem, this.ks.fields.end, end);
|
|
171
|
+
|
|
172
|
+
if (group && this.ks.groups.length > 1) {
|
|
173
|
+
group.resources.forEach(function (resource) {
|
|
174
|
+
if (!resource.multiple) {
|
|
175
|
+
setField(dataItem, resource.field, resource[resource.valueField]);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
oldSlot = slot;
|
|
181
|
+
|
|
182
|
+
if (dataItem) {
|
|
183
|
+
this.currentDragItem = dataItem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
case DRAG_ITEM_ACTION.complete:
|
|
190
|
+
{
|
|
191
|
+
this.currentDragItem = null;
|
|
192
|
+
|
|
193
|
+
if (this.compDragItem) {
|
|
194
|
+
this.$emit('dataaction', {
|
|
195
|
+
type: DATA_ACTION.update,
|
|
196
|
+
series: false,
|
|
197
|
+
dataItem: this.compDragItem
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
case DRAG_ITEM_ACTION.completeOccurrence:
|
|
205
|
+
{
|
|
206
|
+
var newDataItem = Array.isArray(this.compDragItem) ? this.compDragItem.slice() : clone(this.compDragItem);
|
|
207
|
+
this.currentDragItem = null;
|
|
208
|
+
|
|
209
|
+
if (this.compDragItem) {
|
|
210
|
+
this.$emit('dataaction', {
|
|
211
|
+
type: DATA_ACTION.update,
|
|
212
|
+
series: false,
|
|
213
|
+
dataItem: newDataItem
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
case DRAG_ITEM_ACTION.completeSeries:
|
|
221
|
+
{
|
|
222
|
+
var newDataItems = void 0;
|
|
223
|
+
|
|
224
|
+
if (Array.isArray(this.compDragItem)) {
|
|
225
|
+
newDataItems = this.compDragItem.map(function (di) {
|
|
226
|
+
var updated = clone(di);
|
|
227
|
+
setField(updated, _this.ks.fields.start, getField(di, _this.ks.fields.start));
|
|
228
|
+
setField(updated, _this.ks.fields.end, getField(di, _this.ks.fields.end));
|
|
229
|
+
return updated;
|
|
230
|
+
});
|
|
231
|
+
} else {
|
|
232
|
+
var updated = clone(this.compDragItem);
|
|
233
|
+
setField(updated, this.ks.fields.start, getField(this.compDragItem, this.ks.fields.start));
|
|
234
|
+
setField(updated, this.ks.fields.end, getField(this.compDragItem, this.ks.fields.end));
|
|
235
|
+
newDataItems = updated;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
this.currentDragItem = null;
|
|
239
|
+
|
|
240
|
+
if (newDataItems) {
|
|
241
|
+
this.$emit('dataaction', {
|
|
242
|
+
type: DATA_ACTION.update,
|
|
243
|
+
series: true,
|
|
244
|
+
dataItem: newDataItems
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
default:
|
|
252
|
+
this.currentDragItem = this.compDragItem;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
28
255
|
|
|
29
|
-
|
|
30
|
-
// const offset = React.useRef<number>(0);
|
|
31
|
-
// const initialXRef = React.useRef<number>(0);
|
|
32
|
-
// const initialYRef = React.useRef<number>(0);
|
|
33
|
-
// const oldSlot = React.useRef<HTMLElement | null>(null);
|
|
34
|
-
// const [dragItem, setDragItem] = useControlledState<DataItem | null | (DataItem | null)[]>(...state);
|
|
35
|
-
// const [selectedItems] = useSchedulerViewSelectedItemsContext();
|
|
36
|
-
// const fields = useSchedulerFieldsContext();
|
|
37
|
-
// const groups = useSchedulerGroupsContext();
|
|
38
|
-
// const handleDragItemAction = (action: SchedulerItemDragItemAction) => {
|
|
39
|
-
// switch(action.type) {
|
|
40
|
-
// case DRAG_ITEM_ACTION.set:{
|
|
41
|
-
// setDragItem(action.payload);
|
|
42
|
-
// break;
|
|
43
|
-
// }
|
|
44
|
-
// case DRAG_ITEM_ACTION.reset:{
|
|
45
|
-
// setDragItem(null);
|
|
46
|
-
// break;
|
|
47
|
-
// }
|
|
48
|
-
// case DRAG_ITEM_ACTION.dragSelected: {
|
|
49
|
-
// if (
|
|
50
|
-
// Math.abs(initialXRef.current - action.payload.x) < 10
|
|
51
|
-
// && Math.abs(initialYRef.current - action.payload.y) < 10
|
|
52
|
-
// ) {
|
|
53
|
-
// return;
|
|
54
|
-
// }
|
|
55
|
-
// const slot: HTMLElement | null = slotDive(action.payload.x, action.payload.y, 7);
|
|
56
|
-
// if (!slot) { return; }
|
|
57
|
-
// if (slot === oldSlot.current) { return; }
|
|
58
|
-
// const dataItem = clone(config.dataItem);
|
|
59
|
-
// const slotStart = slot.getAttribute('data-slot-start');
|
|
60
|
-
// const slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
61
|
-
// if (!config.ignoreIsAllDay && slotIsAllDay !== config.isAllDay) { return; }
|
|
62
|
-
// const itemStart = new Date(getField(dataItem, fields.start));
|
|
63
|
-
// const distance = Number(slotStart) - itemStart.getTime();
|
|
64
|
-
// const newDragItems = selectedItems.map((si) => {
|
|
65
|
-
// if(!si.current) {return null;}
|
|
66
|
-
// const selectedDataItem = clone(si.current.props.dataItem);
|
|
67
|
-
// const selectedStart = new Date(si.current.props.start.getTime() + distance);
|
|
68
|
-
// const selectedEnd = new Date(si.current.props.end.getTime() + distance);
|
|
69
|
-
// setField(selectedDataItem, fields.start, selectedStart);
|
|
70
|
-
// setField(selectedDataItem, fields.end, selectedEnd);
|
|
71
|
-
// return selectedDataItem;
|
|
72
|
-
// }).filter(Boolean);
|
|
73
|
-
// oldSlot.current = slot;
|
|
74
|
-
// setDragItem([...newDragItems]);
|
|
75
|
-
// break;
|
|
76
|
-
// }
|
|
77
|
-
// case DRAG_ITEM_ACTION.start: {
|
|
78
|
-
// const clientX = action.payload.x;
|
|
79
|
-
// const clientY = action.payload.y;
|
|
80
|
-
// initialXRef.current = clientX;
|
|
81
|
-
// initialYRef.current = clientY;
|
|
82
|
-
// const slot: HTMLElement | null = slotDive(clientX, clientY, 7);
|
|
83
|
-
// if (!slot) { return; }
|
|
84
|
-
// const dataItem = clone(config.dataItem);
|
|
85
|
-
// const slotStart = slot.getAttribute('data-slot-start');
|
|
86
|
-
// const itemStart = getField(dataItem, fields.start);
|
|
87
|
-
// if (slotStart === null) { return; }
|
|
88
|
-
// offset.current = Number(slotStart) - new Date(itemStart).getTime();
|
|
89
|
-
// break;
|
|
90
|
-
// }
|
|
91
|
-
// case DRAG_ITEM_ACTION.drag: {
|
|
92
|
-
// if (
|
|
93
|
-
// Math.abs(initialXRef.current - action.payload.x) < 10
|
|
94
|
-
// && Math.abs(initialYRef.current - action.payload.y) < 10
|
|
95
|
-
// ) {
|
|
96
|
-
// return;
|
|
97
|
-
// }
|
|
98
|
-
// const slot: HTMLElement | null = slotDive(action.payload.x, action.payload.y, 7);
|
|
99
|
-
// if (!slot) { return; }
|
|
100
|
-
// if (slot === oldSlot.current) { return; }
|
|
101
|
-
// const dataItem = clone(config.dataItem);
|
|
102
|
-
// const slotStart = slot.getAttribute('data-slot-start');
|
|
103
|
-
// const slotGroupIndex = slot.getAttribute('data-slot-group');
|
|
104
|
-
// const slotIsAllDay = slot.getAttribute('data-slot-allday') === 'true';
|
|
105
|
-
// if (!config.ignoreIsAllDay && slotIsAllDay !== config.isAllDay) { return; }
|
|
106
|
-
// const itemStart = new Date(getField(dataItem, fields.start));
|
|
107
|
-
// const itemEnd = new Date(getField(dataItem, fields.end));
|
|
108
|
-
// const duration = itemEnd.getTime() - itemStart.getTime();
|
|
109
|
-
// const start = new Date(Number(slotStart) - Number(offset.current));
|
|
110
|
-
// const end = new Date(Number(slotStart) - Number(offset.current) + duration);
|
|
111
|
-
// const group = groups.find((g) => g.index === Number(slotGroupIndex));
|
|
112
|
-
// setField(dataItem, fields.start, start);
|
|
113
|
-
// setField(dataItem, fields.end, end);
|
|
114
|
-
// if (group && groups.length > 1) {
|
|
115
|
-
// group.resources.forEach((resource) => {
|
|
116
|
-
// if (!resource.multiple) {
|
|
117
|
-
// setField(dataItem, resource.field, resource[resource.valueField]);
|
|
118
|
-
// }
|
|
119
|
-
// });
|
|
120
|
-
// }
|
|
121
|
-
// oldSlot.current = slot;
|
|
122
|
-
// if (dataItem) {
|
|
123
|
-
// setDragItem(dataItem);
|
|
124
|
-
// }
|
|
125
|
-
// break;
|
|
126
|
-
// }
|
|
127
|
-
// case DRAG_ITEM_ACTION.complete: {
|
|
128
|
-
// setDragItem(null);
|
|
129
|
-
// if(config.onDataAction && dragItem) {
|
|
130
|
-
// config.onDataAction.call(undefined,{
|
|
131
|
-
// type: DATA_ACTION.update,
|
|
132
|
-
// series: false,
|
|
133
|
-
// dataItem: dragItem
|
|
134
|
-
// });
|
|
135
|
-
// }
|
|
136
|
-
// break;
|
|
137
|
-
// }
|
|
138
|
-
// case DRAG_ITEM_ACTION.completeOccurrence: {
|
|
139
|
-
// const newDataItem = Array.isArray(dragItem) ? dragItem.slice() : clone(dragItem);
|
|
140
|
-
// setDragItem(null);
|
|
141
|
-
// if(config.onDataAction && dragItem) {
|
|
142
|
-
// config.onDataAction.call(undefined,{
|
|
143
|
-
// type: DATA_ACTION.update,
|
|
144
|
-
// series: false,
|
|
145
|
-
// dataItem: newDataItem
|
|
146
|
-
// });
|
|
147
|
-
// }
|
|
148
|
-
// break;
|
|
149
|
-
// }
|
|
150
|
-
// case DRAG_ITEM_ACTION.completeSeries: {
|
|
151
|
-
// let newDataItems;
|
|
152
|
-
// if(Array.isArray(dragItem)) {
|
|
153
|
-
// newDataItems = dragItem.map((di) => {
|
|
154
|
-
// const updated = clone(di);
|
|
155
|
-
// setField(updated, fields.start, getField(di, fields.start));
|
|
156
|
-
// setField(updated, fields.end, getField(di, fields.end));
|
|
157
|
-
// return updated;
|
|
158
|
-
// });
|
|
159
|
-
// } else {
|
|
160
|
-
// const updated = clone(dragItem);
|
|
161
|
-
// setField(updated, fields.start, getField(dragItem, fields.start));
|
|
162
|
-
// setField(updated, fields.end, getField(dragItem, fields.end));
|
|
163
|
-
// newDataItems = updated;
|
|
164
|
-
// }
|
|
165
|
-
// setDragItem(null);
|
|
166
|
-
// if(config.onDataAction && newDataItems) {
|
|
167
|
-
// config.onDataAction.call(undefined,{
|
|
168
|
-
// type: DATA_ACTION.update,
|
|
169
|
-
// series: true,
|
|
170
|
-
// dataItem: newDataItems
|
|
171
|
-
// });
|
|
172
|
-
// }
|
|
173
|
-
// break;
|
|
174
|
-
// }
|
|
175
|
-
// default:
|
|
176
|
-
// setDragItem(dragItem);
|
|
177
|
-
// break;
|
|
178
|
-
// }
|
|
179
|
-
// };
|
|
180
|
-
// return [dragItem, setDragItem, handleDragItemAction];
|
|
181
|
-
return [];
|
|
256
|
+
this.$emit('dragitemchange', this.currentDragItem);
|
|
182
257
|
};
|
|
@@ -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[];
|
|
@@ -14,7 +14,7 @@ export var SERIES_ACTION;
|
|
|
14
14
|
SERIES_ACTION["toggle"] = "SERIES_TOGGLE";
|
|
15
15
|
})(SERIES_ACTION || (SERIES_ACTION = {}));
|
|
16
16
|
|
|
17
|
-
var seriesReducer = function seriesReducer(state, action) {
|
|
17
|
+
export var seriesReducer = function seriesReducer(state, action) {
|
|
18
18
|
switch (action.type) {
|
|
19
19
|
case SERIES_ACTION.reset:
|
|
20
20
|
return null;
|
|
@@ -31,7 +31,6 @@ var seriesReducer = function seriesReducer(state, action) {
|
|
|
31
31
|
};
|
|
32
32
|
/** @hidden */
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
export var useSeries = function useSeries(_defaultProp, _prop, _callback) {
|
|
36
35
|
// const [series, setSeries] = useControlledState<DataItem | null>(defaultProp, prop, callback);
|
|
37
36
|
// const handleSeriesAction = (action: SchedulerItemSeriesAction) => {
|
|
@@ -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[];
|
|
@@ -18,7 +18,7 @@ export var SHOW_OCCURRENCE_DIALOG_ACTION;
|
|
|
18
18
|
SHOW_OCCURRENCE_DIALOG_ACTION["toggle"] = "SHOW_OCCURRENCE_DIALOG_TOGGLE";
|
|
19
19
|
})(SHOW_OCCURRENCE_DIALOG_ACTION || (SHOW_OCCURRENCE_DIALOG_ACTION = {}));
|
|
20
20
|
|
|
21
|
-
var showOccurrenceDialogReducer = function showOccurrenceDialogReducer(state, action) {
|
|
21
|
+
export var showOccurrenceDialogReducer = function showOccurrenceDialogReducer(state, action) {
|
|
22
22
|
switch (action.type) {
|
|
23
23
|
case SHOW_OCCURRENCE_DIALOG_ACTION.reset:
|
|
24
24
|
return false;
|
|
@@ -41,7 +41,6 @@ var showOccurrenceDialogReducer = function showOccurrenceDialogReducer(state, ac
|
|
|
41
41
|
};
|
|
42
42
|
/** @hidden */
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
export var useShowOccurrenceDialog = function useShowOccurrenceDialog(_defaultProp, _prop, _callback) {
|
|
46
45
|
// const [showOccurrenceDialog, setShowOccurrenceDialog] =
|
|
47
46
|
// useControlledState<DataItem | null>(defaultProp, prop, callback);
|
|
@@ -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[];
|
|
@@ -18,7 +18,7 @@ export var SHOW_REMOVE_DIALOG_ACTION;
|
|
|
18
18
|
SHOW_REMOVE_DIALOG_ACTION["toggle"] = "SHOW_REMOVE_DIALOG_TOGGLE";
|
|
19
19
|
})(SHOW_REMOVE_DIALOG_ACTION || (SHOW_REMOVE_DIALOG_ACTION = {}));
|
|
20
20
|
|
|
21
|
-
var showRemoveDialogReducer = function showRemoveDialogReducer(state, action) {
|
|
21
|
+
export var showRemoveDialogReducer = function showRemoveDialogReducer(state, action) {
|
|
22
22
|
switch (action.type) {
|
|
23
23
|
case SHOW_REMOVE_DIALOG_ACTION.reset:
|
|
24
24
|
return false;
|
|
@@ -41,7 +41,6 @@ var showRemoveDialogReducer = function showRemoveDialogReducer(state, action) {
|
|
|
41
41
|
};
|
|
42
42
|
/** @hidden */
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
export var useShowRemoveDialog = function useShowRemoveDialog(_defaultProp, _prop, _callback) {
|
|
46
45
|
// const [showRemoveDialog, setShowRemoveDialog] = useControlledState<DataItem | null>(defaultProp, prop, callback);
|
|
47
46
|
// const handleShowRemoveDialogAction = (action: SchedulerItemShowRemoveDialogAction) => {
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-scheduler',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1649669747,
|
|
9
9
|
version: '',
|
|
10
10
|
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'
|
|
11
11
|
};
|
|
@@ -17,7 +17,12 @@ import { DatePicker } from '@progress/kendo-vue-dateinputs'; // tslint:enable:ma
|
|
|
17
17
|
|
|
18
18
|
var RecurrenceEditorVue2 = {
|
|
19
19
|
name: 'KendoRecurrenceEditor',
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
emits: {
|
|
22
|
+
change: null
|
|
23
|
+
},
|
|
20
24
|
props: {
|
|
25
|
+
name: String,
|
|
21
26
|
value: {
|
|
22
27
|
type: String,
|
|
23
28
|
default: ''
|
|
@@ -7,6 +7,10 @@ import { ButtonGroup, Button } from '@progress/kendo-vue-buttons'; // tslint:ena
|
|
|
7
7
|
|
|
8
8
|
var RecurrenceFrequencyEditorVue2 = {
|
|
9
9
|
name: 'KendoRecurrenceFrequencyEditor',
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
emits: {
|
|
12
|
+
change: null
|
|
13
|
+
},
|
|
10
14
|
props: {
|
|
11
15
|
value: String,
|
|
12
16
|
dataItems: Array
|
|
@@ -22,6 +22,10 @@ import { capitalize } from './common'; // tslint:enable:max-line-length
|
|
|
22
22
|
|
|
23
23
|
var RecurrenceRepeatOnWeekEditorVue2 = {
|
|
24
24
|
name: 'KendoRecurrenceRepeatOnWeekEditor',
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
emits: {
|
|
27
|
+
change: null
|
|
28
|
+
},
|
|
25
29
|
props: {
|
|
26
30
|
dataItems: {
|
|
27
31
|
type: Array,
|
|
@@ -73,7 +73,8 @@ export var getUntil = function (rrule) {
|
|
|
73
73
|
export var getMonths = function (intl) {
|
|
74
74
|
return intl.dateFormatNames({
|
|
75
75
|
type: 'months',
|
|
76
|
-
nameType: 'wide'
|
|
76
|
+
nameType: 'wide',
|
|
77
|
+
standAlone: true
|
|
77
78
|
}).map(function (month, idx) { return ({
|
|
78
79
|
text: month,
|
|
79
80
|
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
|
*/
|