@progress/kendo-vue-scheduler 3.8.3 → 3.8.4-dev.202302151437
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-vue-scheduler.js +1 -1
- package/dist/es/components/BaseView.js +1 -2
- package/dist/es/components/CurrentTimeMarker.js +4 -3
- package/dist/es/components/CurrentTimeMarkerArrow.js +4 -3
- package/dist/es/hooks/useSlotExpand.js +1 -2
- package/dist/es/items/SchedulerEditItem.js +4 -4
- package/dist/es/items/SchedulerViewItem.js +15 -14
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/slots/SchedulerEditSlot.js +17 -11
- package/dist/es/slots/SchedulerSlot.js +32 -40
- package/dist/es/slots/SchedulerViewSlot.js +8 -0
- package/dist/es/views/agenda/AgendaViewBody.js +45 -23
- package/dist/es/views/day/DayViewAllDaySlots.js +72 -41
- package/dist/es/views/day/DayViewMiddleRow.js +73 -43
- package/dist/es/views/day/DayViewVerticalRow.js +70 -43
- package/dist/es/views/day/DayViewVerticalSlotsRow.js +74 -44
- package/dist/es/views/month/MonthViewBody.js +50 -23
- package/dist/es/views/month/MonthViewHead.js +29 -4
- package/dist/es/views/time/TimelineViewBody.js +71 -43
- package/dist/esm/components/BaseView.js +1 -2
- package/dist/esm/components/CurrentTimeMarker.js +4 -3
- package/dist/esm/components/CurrentTimeMarkerArrow.js +4 -3
- package/dist/esm/hooks/useSlotExpand.js +1 -2
- package/dist/esm/items/SchedulerEditItem.js +4 -4
- package/dist/esm/items/SchedulerViewItem.js +15 -14
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/slots/SchedulerEditSlot.js +17 -11
- package/dist/esm/slots/SchedulerSlot.js +32 -40
- package/dist/esm/slots/SchedulerViewSlot.js +8 -0
- package/dist/esm/views/agenda/AgendaViewBody.js +45 -23
- package/dist/esm/views/day/DayViewAllDaySlots.js +72 -41
- package/dist/esm/views/day/DayViewMiddleRow.js +73 -43
- package/dist/esm/views/day/DayViewVerticalRow.js +70 -43
- package/dist/esm/views/day/DayViewVerticalSlotsRow.js +74 -44
- package/dist/esm/views/month/MonthViewBody.js +50 -23
- package/dist/esm/views/month/MonthViewHead.js +29 -4
- package/dist/esm/views/time/TimelineViewBody.js +71 -43
- package/dist/npm/components/BaseView.js +1 -2
- package/dist/npm/components/CurrentTimeMarker.js +4 -3
- package/dist/npm/components/CurrentTimeMarkerArrow.js +4 -3
- package/dist/npm/hooks/useSlotExpand.js +1 -2
- package/dist/npm/items/SchedulerEditItem.js +4 -4
- package/dist/npm/items/SchedulerViewItem.js +15 -14
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/slots/SchedulerEditSlot.js +17 -11
- package/dist/npm/slots/SchedulerSlot.js +32 -40
- package/dist/npm/slots/SchedulerViewSlot.js +8 -0
- package/dist/npm/views/agenda/AgendaViewBody.js +48 -26
- package/dist/npm/views/day/DayViewAllDaySlots.js +72 -41
- package/dist/npm/views/day/DayViewMiddleRow.js +75 -45
- package/dist/npm/views/day/DayViewVerticalRow.js +70 -43
- package/dist/npm/views/day/DayViewVerticalSlotsRow.js +76 -46
- package/dist/npm/views/month/MonthViewBody.js +50 -23
- package/dist/npm/views/month/MonthViewHead.js +29 -4
- package/dist/npm/views/time/TimelineViewBody.js +73 -45
- package/package.json +12 -12
|
@@ -4,6 +4,7 @@ var allVue = Vue;
|
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
6
|
var inject = allVue.inject;
|
|
7
|
+
import { COLLECTION_ACTION } from '../../utils/main';
|
|
7
8
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot';
|
|
8
9
|
/** @hidden */
|
|
9
10
|
var DayViewAllDaySlotsVue2 = {
|
|
@@ -27,8 +28,50 @@ var DayViewAllDaySlotsVue2 = {
|
|
|
27
28
|
},
|
|
28
29
|
ks: {
|
|
29
30
|
default: null
|
|
31
|
+
},
|
|
32
|
+
setSlots: {
|
|
33
|
+
default: null
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
provide: function provide() {
|
|
37
|
+
return {
|
|
38
|
+
ksSlots: this.ksSlots
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
data: function data() {
|
|
42
|
+
var daySlots = this.daySlots;
|
|
43
|
+
var groupIndex = this.groupIndex !== undefined ? this.groupIndex : this.ri.groupIndex;
|
|
44
|
+
return {
|
|
45
|
+
ksSlots: {
|
|
46
|
+
cSlots: this.calculateRanges(daySlots, groupIndex, this.dayRanges)
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
watch: {
|
|
51
|
+
currentCellSlots: function currentCellSlots(newValue) {
|
|
52
|
+
this.ksSlots.cSlots = newValue;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
currentCellSlots: function currentCellSlots() {
|
|
57
|
+
var daySlots = this.daySlots;
|
|
58
|
+
var groupIndex = this.groupIndex !== undefined ? this.groupIndex : this.ri.groupIndex;
|
|
59
|
+
return this.calculateRanges(daySlots, groupIndex, this.dayRanges);
|
|
30
60
|
}
|
|
31
61
|
},
|
|
62
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
63
|
+
this.setSlots({
|
|
64
|
+
type: COLLECTION_ACTION.remove,
|
|
65
|
+
item: this
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
unmounted: function unmounted() {
|
|
70
|
+
this.setSlots({
|
|
71
|
+
type: COLLECTION_ACTION.remove,
|
|
72
|
+
item: this
|
|
73
|
+
});
|
|
74
|
+
},
|
|
32
75
|
// @ts-ignore
|
|
33
76
|
setup: !isV3 ? undefined : function () {
|
|
34
77
|
var v3 = !!isV3;
|
|
@@ -47,59 +90,47 @@ var DayViewAllDaySlotsVue2 = {
|
|
|
47
90
|
return h("div", {
|
|
48
91
|
key: groupIndex,
|
|
49
92
|
"class": "k-scheduler-row"
|
|
50
|
-
}, [this.
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
index: slot.index,
|
|
56
|
-
attrs: this.v3 ? undefined : {
|
|
57
|
-
index: slot.index,
|
|
58
|
-
start: slot.start,
|
|
59
|
-
end: slot.end,
|
|
60
|
-
zonedStart: slot.zonedStart,
|
|
61
|
-
zonedEnd: slot.zonedEnd,
|
|
62
|
-
items: slot.items,
|
|
63
|
-
group: slot.group,
|
|
64
|
-
range: slot.range,
|
|
65
|
-
isAllDay: slot.isAllDay,
|
|
66
|
-
form: this.$props.form,
|
|
67
|
-
slotRender: this.$props.slotRender,
|
|
68
|
-
viewSlot: this.$props.viewSlot,
|
|
69
|
-
row: 0,
|
|
70
|
-
col: this.ks.orientation === 'horizontal' ? filtered.length * (groupIndex || 0) + slotIndex : slotIndex,
|
|
71
|
-
isWorkDay: 0 <= slot.zonedStart.getDay() + (numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (numberOfDays - workWeekStart)) % numberOfDays <= workWeekEnd + (numberOfDays - workWeekStart),
|
|
72
|
-
expandable: true,
|
|
73
|
-
editable: this.$props.editable
|
|
74
|
-
},
|
|
75
|
-
start: slot.start,
|
|
76
|
-
end: slot.end,
|
|
77
|
-
zonedStart: slot.zonedStart,
|
|
78
|
-
zonedEnd: slot.zonedEnd,
|
|
79
|
-
items: slot.items,
|
|
80
|
-
group: slot.group,
|
|
81
|
-
range: slot.range,
|
|
82
|
-
isAllDay: slot.isAllDay,
|
|
83
|
-
onDataaction: this.handleDataAction,
|
|
84
|
-
on: this.v3 ? undefined : {
|
|
85
|
-
"dataaction": this.handleDataAction
|
|
86
|
-
},
|
|
93
|
+
}, [this.currentCellSlots.map(function (slot, slotIndex, filtered) {
|
|
94
|
+
return h(SchedulerEditSlot, {
|
|
95
|
+
index: slotIndex,
|
|
96
|
+
attrs: this.v3 ? undefined : {
|
|
97
|
+
index: slotIndex,
|
|
87
98
|
form: this.$props.form,
|
|
88
99
|
slotRender: this.$props.slotRender,
|
|
89
|
-
viewSlot: this.$props.viewSlot
|
|
90
|
-
key
|
|
100
|
+
viewSlot: this.$props.viewSlot
|
|
101
|
+
// key={`${slot.start.getTime()}:${slot.group.index}`}
|
|
102
|
+
,
|
|
91
103
|
row: 0,
|
|
92
104
|
col: this.ks.orientation === 'horizontal' ? filtered.length * (groupIndex || 0) + slotIndex : slotIndex,
|
|
93
105
|
isWorkDay: 0 <= slot.zonedStart.getDay() + (numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (numberOfDays - workWeekStart)) % numberOfDays <= workWeekEnd + (numberOfDays - workWeekStart),
|
|
94
106
|
expandable: true,
|
|
95
107
|
editable: this.$props.editable
|
|
96
|
-
}
|
|
97
|
-
|
|
108
|
+
},
|
|
109
|
+
onDataaction: this.handleDataAction,
|
|
110
|
+
on: this.v3 ? undefined : {
|
|
111
|
+
"dataaction": this.handleDataAction
|
|
112
|
+
},
|
|
113
|
+
form: this.$props.form,
|
|
114
|
+
slotRender: this.$props.slotRender,
|
|
115
|
+
viewSlot: this.$props.viewSlot,
|
|
116
|
+
row: 0,
|
|
117
|
+
col: this.ks.orientation === 'horizontal' ? filtered.length * (groupIndex || 0) + slotIndex : slotIndex,
|
|
118
|
+
isWorkDay: 0 <= slot.zonedStart.getDay() + (numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (numberOfDays - workWeekStart)) % numberOfDays <= workWeekEnd + (numberOfDays - workWeekStart),
|
|
119
|
+
expandable: true,
|
|
120
|
+
editable: this.$props.editable
|
|
121
|
+
});
|
|
98
122
|
}, this)]);
|
|
99
123
|
},
|
|
100
124
|
methods: {
|
|
101
125
|
handleDataAction: function handleDataAction(action) {
|
|
102
126
|
this.$emit('dataaction', action);
|
|
127
|
+
},
|
|
128
|
+
calculateRanges: function calculateRanges(daySlots, groupIndex, dayRanges) {
|
|
129
|
+
return dayRanges.map(function (_, rangeIndex) {
|
|
130
|
+
return daySlots.filter(function (s) {
|
|
131
|
+
return s.group.index === groupIndex && s.range.index === rangeIndex;
|
|
132
|
+
});
|
|
133
|
+
}).flat();
|
|
103
134
|
}
|
|
104
135
|
}
|
|
105
136
|
};
|
|
@@ -4,6 +4,7 @@ var allVue = Vue;
|
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
6
|
var inject = allVue.inject;
|
|
7
|
+
import { COLLECTION_ACTION } from '../../utils/main';
|
|
7
8
|
import { classNames } from '@progress/kendo-vue-common';
|
|
8
9
|
import { GRID_OFFSET } from './MultiDayView';
|
|
9
10
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot';
|
|
@@ -34,8 +35,52 @@ var DayViewMiddleRowVue2 = {
|
|
|
34
35
|
inject: {
|
|
35
36
|
ri: {
|
|
36
37
|
default: null
|
|
38
|
+
},
|
|
39
|
+
setSlots: {
|
|
40
|
+
default: null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
provide: function provide() {
|
|
44
|
+
return {
|
|
45
|
+
ksSlots: this.ksSlots
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
data: function data() {
|
|
49
|
+
var timeSlots = this.timeSlots;
|
|
50
|
+
var groupIndex = this.ri.groupIndex;
|
|
51
|
+
var root = this.root;
|
|
52
|
+
return {
|
|
53
|
+
ksSlots: {
|
|
54
|
+
cSlots: this.calculateRanges(timeSlots, groupIndex, this.timeRanges, root)
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
watch: {
|
|
59
|
+
currentCellSlots: function currentCellSlots(newValue) {
|
|
60
|
+
this.ksSlots.cSlots = newValue;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
currentCellSlots: function currentCellSlots() {
|
|
65
|
+
var timeSlots = this.timeSlots;
|
|
66
|
+
var groupIndex = this.ri.groupIndex;
|
|
67
|
+
var root = this.root;
|
|
68
|
+
return this.calculateRanges(timeSlots, groupIndex, this.timeRanges, root);
|
|
37
69
|
}
|
|
38
70
|
},
|
|
71
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
72
|
+
this.setSlots({
|
|
73
|
+
type: COLLECTION_ACTION.remove,
|
|
74
|
+
item: this
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
unmounted: function unmounted() {
|
|
79
|
+
this.setSlots({
|
|
80
|
+
type: COLLECTION_ACTION.remove,
|
|
81
|
+
item: this
|
|
82
|
+
});
|
|
83
|
+
},
|
|
39
84
|
// @ts-ignore
|
|
40
85
|
setup: !isV3 ? undefined : function () {
|
|
41
86
|
var v3 = !!isV3;
|
|
@@ -53,60 +98,45 @@ var DayViewMiddleRowVue2 = {
|
|
|
53
98
|
"class": classNames('k-scheduler-row', {
|
|
54
99
|
'k-middle-row': !((this.rootIndex + 1) % this.slotDivisions === 0)
|
|
55
100
|
})
|
|
56
|
-
}, [this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return h(EditSlot, {
|
|
62
|
-
key: "".concat(slot.start.getTime(), ":").concat(slot.group.index),
|
|
63
|
-
index: slot.index,
|
|
64
|
-
attrs: this.v3 ? undefined : {
|
|
65
|
-
index: slot.index,
|
|
66
|
-
start: slot.start,
|
|
67
|
-
end: slot.end,
|
|
68
|
-
zonedStart: slot.zonedStart,
|
|
69
|
-
zonedEnd: slot.zonedEnd,
|
|
70
|
-
items: slot.items,
|
|
71
|
-
group: slot.group,
|
|
72
|
-
range: slot.range,
|
|
73
|
-
isAllDay: slot.isAllDay,
|
|
74
|
-
slotRender: this.$props.slotRender,
|
|
75
|
-
viewSlot: this.$props.viewSlot,
|
|
76
|
-
form: this.$props.form,
|
|
77
|
-
row: this.rootIndex + GRID_OFFSET,
|
|
78
|
-
col: this.timeRanges.length * (this.ri.groupIndex || 0) + rangeIndex,
|
|
79
|
-
isWorkHour: isInTimeRange(slot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
80
|
-
isWorkDay: 0 <= slot.zonedStart.getDay() + (that.numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (that.numberOfDays - workWeekStart)) % that.numberOfDays <= that.workWeekEnd + (that.numberOfDays - workWeekStart),
|
|
81
|
-
editable: that.$props.editable
|
|
82
|
-
},
|
|
83
|
-
start: slot.start,
|
|
84
|
-
end: slot.end,
|
|
85
|
-
zonedStart: slot.zonedStart,
|
|
86
|
-
zonedEnd: slot.zonedEnd,
|
|
87
|
-
items: slot.items,
|
|
88
|
-
group: slot.group,
|
|
89
|
-
range: slot.range,
|
|
90
|
-
isAllDay: slot.isAllDay,
|
|
91
|
-
onDataaction: this.handleDataAction,
|
|
92
|
-
on: this.v3 ? undefined : {
|
|
93
|
-
"dataaction": this.handleDataAction
|
|
94
|
-
},
|
|
101
|
+
}, [this.currentCellSlots.map(function (slot, slotIndex) {
|
|
102
|
+
return h(EditSlot, {
|
|
103
|
+
index: slotIndex,
|
|
104
|
+
attrs: this.v3 ? undefined : {
|
|
105
|
+
index: slotIndex,
|
|
95
106
|
slotRender: this.$props.slotRender,
|
|
96
107
|
viewSlot: this.$props.viewSlot,
|
|
97
108
|
form: this.$props.form,
|
|
98
109
|
row: this.rootIndex + GRID_OFFSET,
|
|
99
|
-
col: this.timeRanges.length * (this.ri.groupIndex || 0) +
|
|
110
|
+
col: this.timeRanges.length * (this.ri.groupIndex || 0) + slot.range.index,
|
|
100
111
|
isWorkHour: isInTimeRange(slot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
101
112
|
isWorkDay: 0 <= slot.zonedStart.getDay() + (that.numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (that.numberOfDays - workWeekStart)) % that.numberOfDays <= that.workWeekEnd + (that.numberOfDays - workWeekStart),
|
|
102
113
|
editable: that.$props.editable
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
},
|
|
115
|
+
onDataaction: this.handleDataAction,
|
|
116
|
+
on: this.v3 ? undefined : {
|
|
117
|
+
"dataaction": this.handleDataAction
|
|
118
|
+
},
|
|
119
|
+
slotRender: this.$props.slotRender,
|
|
120
|
+
viewSlot: this.$props.viewSlot,
|
|
121
|
+
form: this.$props.form,
|
|
122
|
+
row: this.rootIndex + GRID_OFFSET,
|
|
123
|
+
col: this.timeRanges.length * (this.ri.groupIndex || 0) + slot.range.index,
|
|
124
|
+
isWorkHour: isInTimeRange(slot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
125
|
+
isWorkDay: 0 <= slot.zonedStart.getDay() + (that.numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (that.numberOfDays - workWeekStart)) % that.numberOfDays <= that.workWeekEnd + (that.numberOfDays - workWeekStart),
|
|
126
|
+
editable: that.$props.editable
|
|
127
|
+
});
|
|
128
|
+
}, that)]);
|
|
106
129
|
},
|
|
107
130
|
methods: {
|
|
108
131
|
handleDataAction: function handleDataAction(action) {
|
|
109
132
|
this.$emit('dataaction', action);
|
|
133
|
+
},
|
|
134
|
+
calculateRanges: function calculateRanges(timeSlots, groupIndex, timeRanges, root) {
|
|
135
|
+
return timeRanges.map(function (_range, rangeIndex) {
|
|
136
|
+
return timeSlots.filter(function (s) {
|
|
137
|
+
return s.index === root.index && s.range.index === rangeIndex && s.group.index === groupIndex;
|
|
138
|
+
});
|
|
139
|
+
}).flat();
|
|
110
140
|
}
|
|
111
141
|
}
|
|
112
142
|
};
|
|
@@ -3,6 +3,7 @@ import * as Vue from 'vue';
|
|
|
3
3
|
var allVue = Vue;
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { COLLECTION_ACTION } from '../../utils/main';
|
|
6
7
|
import { GRID_OFFSET } from './MultiDayView';
|
|
7
8
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot';
|
|
8
9
|
import { DayViewAllDayRowContent } from './DayViewAllDayRowContent';
|
|
@@ -19,8 +20,50 @@ var DayViewVerticalRowVue2 = {
|
|
|
19
20
|
inject: {
|
|
20
21
|
ri: {
|
|
21
22
|
default: null
|
|
23
|
+
},
|
|
24
|
+
setSlots: {
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
provide: function provide() {
|
|
29
|
+
return {
|
|
30
|
+
ksSlots: this.ksSlots
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
data: function data() {
|
|
34
|
+
var daySlots = this.daySlots;
|
|
35
|
+
var groupIndex = this.ri.groupIndex;
|
|
36
|
+
return {
|
|
37
|
+
ksSlots: {
|
|
38
|
+
cSlots: this.calculateRanges(daySlots, groupIndex, this.dayRanges)
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
watch: {
|
|
43
|
+
currentCellSlots: function currentCellSlots(newValue) {
|
|
44
|
+
this.ksSlots.cSlots = newValue;
|
|
22
45
|
}
|
|
23
46
|
},
|
|
47
|
+
computed: {
|
|
48
|
+
currentCellSlots: function currentCellSlots() {
|
|
49
|
+
var daySlots = this.daySlots;
|
|
50
|
+
var groupIndex = this.ri.groupIndex;
|
|
51
|
+
return this.calculateRanges(daySlots, groupIndex, this.dayRanges);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
55
|
+
this.setSlots({
|
|
56
|
+
type: COLLECTION_ACTION.remove,
|
|
57
|
+
item: this
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
unmounted: function unmounted() {
|
|
62
|
+
this.setSlots({
|
|
63
|
+
type: COLLECTION_ACTION.remove,
|
|
64
|
+
item: this
|
|
65
|
+
});
|
|
66
|
+
},
|
|
24
67
|
// @ts-ignore
|
|
25
68
|
setup: !isV3 ? undefined : function () {
|
|
26
69
|
var v3 = !!isV3;
|
|
@@ -33,9 +76,7 @@ var DayViewVerticalRowVue2 = {
|
|
|
33
76
|
var h = gh || createElement;
|
|
34
77
|
var EditSlot = this.$props.editSlot || SchedulerEditSlot;
|
|
35
78
|
var groupIndex = this.ri.groupIndex;
|
|
36
|
-
var
|
|
37
|
-
timeSlots = _a.timeSlots,
|
|
38
|
-
daySlots = _a.daySlots;
|
|
79
|
+
var timeSlots = this.$props.timeSlots;
|
|
39
80
|
return h("div", {
|
|
40
81
|
"class": "k-scheduler-row"
|
|
41
82
|
}, [h(DayViewAllDayRowContent, {
|
|
@@ -43,61 +84,47 @@ var DayViewVerticalRowVue2 = {
|
|
|
43
84
|
attrs: this.v3 ? undefined : {
|
|
44
85
|
groupIndex: groupIndex
|
|
45
86
|
}
|
|
46
|
-
}), this.
|
|
87
|
+
}), this.currentCellSlots.map(function (_slot, slotIndex) {
|
|
47
88
|
var groupOffset = timeSlots.filter(function (s) {
|
|
48
89
|
return s.group.index === groupIndex && s.range.index === FIRST_INDEX;
|
|
49
90
|
}).length;
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return h(EditSlot, {
|
|
91
|
+
return h(EditSlot, {
|
|
92
|
+
slotRender: this.$props.slotRender,
|
|
93
|
+
attrs: this.v3 ? undefined : {
|
|
54
94
|
slotRender: this.$props.slotRender,
|
|
55
|
-
attrs: this.v3 ? undefined : {
|
|
56
|
-
slotRender: this.$props.slotRender,
|
|
57
|
-
viewSlot: this.$props.viewSlot,
|
|
58
|
-
form: this.$props.form,
|
|
59
|
-
index: slot.index,
|
|
60
|
-
start: slot.start,
|
|
61
|
-
end: slot.end,
|
|
62
|
-
zonedStart: slot.zonedStart,
|
|
63
|
-
zonedEnd: slot.zonedEnd,
|
|
64
|
-
items: slot.items,
|
|
65
|
-
group: slot.group,
|
|
66
|
-
range: slot.range,
|
|
67
|
-
isAllDay: slot.isAllDay,
|
|
68
|
-
row: groupOffset * (groupIndex || 0) + (groupIndex || 0) * GRID_OFFSET,
|
|
69
|
-
col: slotIndex,
|
|
70
|
-
expandable: true,
|
|
71
|
-
editable: this.$props.editable
|
|
72
|
-
},
|
|
73
95
|
viewSlot: this.$props.viewSlot,
|
|
74
96
|
form: this.$props.form,
|
|
75
|
-
index:
|
|
76
|
-
start: slot.start,
|
|
77
|
-
end: slot.end,
|
|
78
|
-
zonedStart: slot.zonedStart,
|
|
79
|
-
zonedEnd: slot.zonedEnd,
|
|
80
|
-
items: slot.items,
|
|
81
|
-
group: slot.group,
|
|
82
|
-
range: slot.range,
|
|
83
|
-
isAllDay: slot.isAllDay,
|
|
84
|
-
onDataaction: this.handleDataAction,
|
|
85
|
-
on: this.v3 ? undefined : {
|
|
86
|
-
"dataaction": this.handleDataAction
|
|
87
|
-
},
|
|
88
|
-
key: "".concat(slot.start.getTime(), ":").concat(slot.group.index),
|
|
89
|
-
"class": 'k-scheduler-alldays-slot',
|
|
97
|
+
index: slotIndex,
|
|
90
98
|
row: groupOffset * (groupIndex || 0) + (groupIndex || 0) * GRID_OFFSET,
|
|
91
99
|
col: slotIndex,
|
|
92
100
|
expandable: true,
|
|
93
101
|
editable: this.$props.editable
|
|
94
|
-
}
|
|
95
|
-
|
|
102
|
+
},
|
|
103
|
+
viewSlot: this.$props.viewSlot,
|
|
104
|
+
form: this.$props.form,
|
|
105
|
+
index: slotIndex,
|
|
106
|
+
onDataaction: this.handleDataAction,
|
|
107
|
+
on: this.v3 ? undefined : {
|
|
108
|
+
"dataaction": this.handleDataAction
|
|
109
|
+
},
|
|
110
|
+
"class": 'k-scheduler-alldays-slot',
|
|
111
|
+
row: groupOffset * (groupIndex || 0) + (groupIndex || 0) * GRID_OFFSET,
|
|
112
|
+
col: slotIndex,
|
|
113
|
+
expandable: true,
|
|
114
|
+
editable: this.$props.editable
|
|
115
|
+
});
|
|
96
116
|
}, this)]);
|
|
97
117
|
},
|
|
98
118
|
methods: {
|
|
99
119
|
handleDataAction: function handleDataAction(action) {
|
|
100
120
|
this.$emit('dataaction', action);
|
|
121
|
+
},
|
|
122
|
+
calculateRanges: function calculateRanges(daySlots, groupIndex, dayRanges) {
|
|
123
|
+
return dayRanges.map(function (_, rangeIndex) {
|
|
124
|
+
return daySlots.filter(function (s) {
|
|
125
|
+
return s.group.index === groupIndex && s.range.index === rangeIndex;
|
|
126
|
+
});
|
|
127
|
+
}).flat();
|
|
101
128
|
}
|
|
102
129
|
}
|
|
103
130
|
};
|
|
@@ -3,13 +3,13 @@ import * as Vue from 'vue';
|
|
|
3
3
|
var allVue = Vue;
|
|
4
4
|
var gh = allVue.h;
|
|
5
5
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { COLLECTION_ACTION } from '../../utils/main';
|
|
6
7
|
import { GRID_OFFSET } from './MultiDayView';
|
|
7
8
|
import { isInTimeRange, intersects, first, last } from '../../utils/main';
|
|
8
9
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot';
|
|
9
10
|
import { DayViewRowContent } from './DayViewRowContent';
|
|
10
11
|
import { CurrentTimeMarker } from '../../components/CurrentTimeMarker';
|
|
11
12
|
import { CurrentTimeMarkerArrow } from '../../components/CurrentTimeMarkerArrow';
|
|
12
|
-
var FIRST_INDEX = 0;
|
|
13
13
|
/** @hidden */
|
|
14
14
|
var DayViewVerticalSlotsRowVue2 = {
|
|
15
15
|
name: 'KendoDayViewVerticalSlotsRow',
|
|
@@ -40,8 +40,53 @@ var DayViewVerticalSlotsRowVue2 = {
|
|
|
40
40
|
inject: {
|
|
41
41
|
ri: {
|
|
42
42
|
default: null
|
|
43
|
+
},
|
|
44
|
+
setSlots: {
|
|
45
|
+
default: null
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
provide: function provide() {
|
|
49
|
+
return {
|
|
50
|
+
ksSlots: this.ksSlots
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
data: function data() {
|
|
54
|
+
var timeSlots = this.timeSlots;
|
|
55
|
+
var root = this.root;
|
|
56
|
+
var groupIndex = this.groupIndex;
|
|
57
|
+
var cSlots = this.calculateRanges(timeSlots, groupIndex, this.timeRanges, root);
|
|
58
|
+
return {
|
|
59
|
+
ksSlots: {
|
|
60
|
+
cSlots: cSlots
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
watch: {
|
|
65
|
+
currentCellSlots: function currentCellSlots(newValue) {
|
|
66
|
+
this.ksSlots.cSlots = newValue;
|
|
43
67
|
}
|
|
44
68
|
},
|
|
69
|
+
computed: {
|
|
70
|
+
currentCellSlots: function currentCellSlots() {
|
|
71
|
+
var timeSlots = this.timeSlots;
|
|
72
|
+
var root = this.root;
|
|
73
|
+
var groupIndex = this.groupIndex;
|
|
74
|
+
return this.calculateRanges(timeSlots, groupIndex, this.timeRanges, root);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
78
|
+
this.setSlots({
|
|
79
|
+
type: COLLECTION_ACTION.remove,
|
|
80
|
+
item: this
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
unmounted: function unmounted() {
|
|
85
|
+
this.setSlots({
|
|
86
|
+
type: COLLECTION_ACTION.remove,
|
|
87
|
+
item: this
|
|
88
|
+
});
|
|
89
|
+
},
|
|
45
90
|
// @ts-ignore
|
|
46
91
|
setup: !isV3 ? undefined : function () {
|
|
47
92
|
var v3 = !!isV3;
|
|
@@ -56,7 +101,6 @@ var DayViewVerticalSlotsRowVue2 = {
|
|
|
56
101
|
var groupIndex = this.groupIndex;
|
|
57
102
|
var that = this;
|
|
58
103
|
var _a = this.$props,
|
|
59
|
-
timeSlots = _a.timeSlots,
|
|
60
104
|
root = _a.root,
|
|
61
105
|
rootIndex = _a.rootIndex,
|
|
62
106
|
slotDivisions = _a.slotDivisions,
|
|
@@ -84,55 +128,34 @@ var DayViewVerticalSlotsRowVue2 = {
|
|
|
84
128
|
isMaster: rootIndex % slotDivisions === 0,
|
|
85
129
|
isLast: (rootIndex + 1) % slotDivisions === 0,
|
|
86
130
|
timeHeaderCell: this.$props.timeHeaderCell
|
|
87
|
-
}), this.
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return h(EditSlot, {
|
|
131
|
+
}), this.currentCellSlots.map(function (slot, slotIndex) {
|
|
132
|
+
return h(EditSlot, {
|
|
133
|
+
slotRender: renderSlot,
|
|
134
|
+
attrs: this.v3 ? undefined : {
|
|
92
135
|
slotRender: renderSlot,
|
|
93
|
-
attrs: this.v3 ? undefined : {
|
|
94
|
-
slotRender: renderSlot,
|
|
95
|
-
viewSlot: viewSlot,
|
|
96
|
-
form: form,
|
|
97
|
-
index: slot.index,
|
|
98
|
-
start: slot.start,
|
|
99
|
-
end: slot.end,
|
|
100
|
-
zonedStart: slot.zonedStart,
|
|
101
|
-
zonedEnd: slot.zonedEnd,
|
|
102
|
-
items: slot.items,
|
|
103
|
-
group: slot.group,
|
|
104
|
-
range: slot.range,
|
|
105
|
-
isAllDay: slot.isAllDay,
|
|
106
|
-
row: filtered.length * (groupIndex || 0) + rootIndex + (groupIndex || 0) * GRID_OFFSET + GRID_OFFSET,
|
|
107
|
-
col: rangeIndex,
|
|
108
|
-
editable: editable,
|
|
109
|
-
isWorkHour: isInTimeRange(slot.zonedStart, workDayStart, workDayEnd),
|
|
110
|
-
isWorkDay: 0 <= slot.zonedStart.getDay() + (numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (numberOfDays - workWeekStart)) % numberOfDays <= workWeekEnd + (numberOfDays - workWeekStart)
|
|
111
|
-
},
|
|
112
136
|
viewSlot: viewSlot,
|
|
113
137
|
form: form,
|
|
114
|
-
|
|
115
|
-
on: this.v3 ? undefined : {
|
|
116
|
-
"dataaction": that.handleDataAction
|
|
117
|
-
},
|
|
118
|
-
index: slot.index,
|
|
119
|
-
start: slot.start,
|
|
120
|
-
end: slot.end,
|
|
121
|
-
zonedStart: slot.zonedStart,
|
|
122
|
-
zonedEnd: slot.zonedEnd,
|
|
123
|
-
items: slot.items,
|
|
124
|
-
group: slot.group,
|
|
125
|
-
range: slot.range,
|
|
126
|
-
isAllDay: slot.isAllDay,
|
|
127
|
-
key: "".concat(slot.start.getTime(), ":").concat(slot.group.index),
|
|
138
|
+
index: slotIndex,
|
|
128
139
|
row: filtered.length * (groupIndex || 0) + rootIndex + (groupIndex || 0) * GRID_OFFSET + GRID_OFFSET,
|
|
129
|
-
col:
|
|
140
|
+
col: slot.range.index,
|
|
130
141
|
editable: editable,
|
|
131
142
|
isWorkHour: isInTimeRange(slot.zonedStart, workDayStart, workDayEnd),
|
|
132
143
|
isWorkDay: 0 <= slot.zonedStart.getDay() + (numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (numberOfDays - workWeekStart)) % numberOfDays <= workWeekEnd + (numberOfDays - workWeekStart)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
144
|
+
},
|
|
145
|
+
viewSlot: viewSlot,
|
|
146
|
+
form: form,
|
|
147
|
+
onDataaction: that.handleDataAction,
|
|
148
|
+
on: this.v3 ? undefined : {
|
|
149
|
+
"dataaction": that.handleDataAction
|
|
150
|
+
},
|
|
151
|
+
index: slotIndex,
|
|
152
|
+
row: filtered.length * (groupIndex || 0) + rootIndex + (groupIndex || 0) * GRID_OFFSET + GRID_OFFSET,
|
|
153
|
+
col: slot.range.index,
|
|
154
|
+
editable: editable,
|
|
155
|
+
isWorkHour: isInTimeRange(slot.zonedStart, workDayStart, workDayEnd),
|
|
156
|
+
isWorkDay: 0 <= slot.zonedStart.getDay() + (numberOfDays - workWeekStart) && (slot.zonedStart.getDay() + (numberOfDays - workWeekStart)) % numberOfDays <= workWeekEnd + (numberOfDays - workWeekStart)
|
|
157
|
+
});
|
|
158
|
+
}, true), this.$props.currentTimeMarker && intersects(first(this.timeRanges).start, last(this.timeRanges).end, new Date(), new Date(), true) && [h(CurrentTimeMarkerArrow, {
|
|
136
159
|
groupIndex: groupIndex,
|
|
137
160
|
attrs: this.v3 ? undefined : {
|
|
138
161
|
groupIndex: groupIndex
|
|
@@ -147,6 +170,13 @@ var DayViewVerticalSlotsRowVue2 = {
|
|
|
147
170
|
methods: {
|
|
148
171
|
handleDataAction: function handleDataAction(action) {
|
|
149
172
|
this.$emit('dataaction', action);
|
|
173
|
+
},
|
|
174
|
+
calculateRanges: function calculateRanges(timeSlots, groupIndex, timeRanges, root) {
|
|
175
|
+
return timeRanges.map(function (_, rangeIndex) {
|
|
176
|
+
return timeSlots.filter(function (s) {
|
|
177
|
+
return s.index === root.index && s.group.index === groupIndex && s.range.index === rangeIndex;
|
|
178
|
+
});
|
|
179
|
+
}).flat();
|
|
150
180
|
}
|
|
151
181
|
}
|
|
152
182
|
};
|