@progress/kendo-vue-scheduler 3.8.3 → 3.8.4-dev.202302151223
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
|
@@ -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.js';
|
|
6
7
|
import { GRID_OFFSET } from './MultiDayView.js';
|
|
7
8
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot.js';
|
|
8
9
|
import { DayViewAllDayRowContent } from './DayViewAllDayRowContent.js';
|
|
@@ -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.js';
|
|
6
7
|
import { GRID_OFFSET } from './MultiDayView.js';
|
|
7
8
|
import { isInTimeRange, intersects, first, last } from '../../utils/main.js';
|
|
8
9
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot.js';
|
|
9
10
|
import { DayViewRowContent } from './DayViewRowContent.js';
|
|
10
11
|
import { CurrentTimeMarker } from '../../components/CurrentTimeMarker.js';
|
|
11
12
|
import { CurrentTimeMarkerArrow } from '../../components/CurrentTimeMarkerArrow.js';
|
|
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
|
};
|
|
@@ -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.js';
|
|
6
7
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot.js';
|
|
7
8
|
import { provideIntlService } from '@progress/kendo-vue-intl';
|
|
8
9
|
/** @hidden */
|
|
@@ -31,10 +32,56 @@ var MonthViewBodyVue2 = {
|
|
|
31
32
|
setActiveViewName: {
|
|
32
33
|
default: null
|
|
33
34
|
},
|
|
35
|
+
setSlots: {
|
|
36
|
+
default: null
|
|
37
|
+
},
|
|
34
38
|
kendoIntlService: {
|
|
35
39
|
default: null
|
|
36
40
|
}
|
|
37
41
|
},
|
|
42
|
+
provide: function provide() {
|
|
43
|
+
return {
|
|
44
|
+
ksSlots: this.ksSlots
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
data: function data() {
|
|
48
|
+
var _this = this;
|
|
49
|
+
var groupIndex = this.groupIndex !== undefined ? this.groupIndex : this.ri.groupIndex;
|
|
50
|
+
return {
|
|
51
|
+
ksSlots: {
|
|
52
|
+
cSlots: this.monthSlots.filter(function (slot) {
|
|
53
|
+
return slot.group.index === groupIndex && slot.range.index === _this.rangeIndex;
|
|
54
|
+
})
|
|
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 _this = this;
|
|
66
|
+
var groupIndex = this.groupIndex !== undefined ? this.groupIndex : this.ri.groupIndex;
|
|
67
|
+
return this.monthSlots.filter(function (slot) {
|
|
68
|
+
return slot.group.index === groupIndex && slot.range.index === _this.rangeIndex;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
73
|
+
this.setSlots({
|
|
74
|
+
type: COLLECTION_ACTION.remove,
|
|
75
|
+
item: this
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
unmounted: function unmounted() {
|
|
80
|
+
this.setSlots({
|
|
81
|
+
type: COLLECTION_ACTION.remove,
|
|
82
|
+
item: this
|
|
83
|
+
});
|
|
84
|
+
},
|
|
38
85
|
// @ts-ignore
|
|
39
86
|
setup: !isV3 ? undefined : function () {
|
|
40
87
|
var v3 = !!isV3;
|
|
@@ -44,7 +91,6 @@ var MonthViewBodyVue2 = {
|
|
|
44
91
|
},
|
|
45
92
|
// @ts-ignore
|
|
46
93
|
render: function render(createElement) {
|
|
47
|
-
var _this = this;
|
|
48
94
|
var h = gh || createElement;
|
|
49
95
|
this.intl = provideIntlService(this);
|
|
50
96
|
var EditSlot = this.$props.editSlot || SchedulerEditSlot;
|
|
@@ -53,9 +99,7 @@ var MonthViewBodyVue2 = {
|
|
|
53
99
|
return h("div", {
|
|
54
100
|
"class": "k-scheduler-row",
|
|
55
101
|
key: this.rangeIndex
|
|
56
|
-
}, [this.
|
|
57
|
-
return slot.group.index === groupIndex && slot.range.index === _this.rangeIndex;
|
|
58
|
-
}).map(function (slot, slotIndex, filtered) {
|
|
102
|
+
}, [this.currentCellSlots.map(function (slot, slotIndex, filtered) {
|
|
59
103
|
return (
|
|
60
104
|
// @ts-ignore function children
|
|
61
105
|
h(EditSlot, {
|
|
@@ -64,15 +108,7 @@ var MonthViewBodyVue2 = {
|
|
|
64
108
|
slotRender: this.$props.slotRender,
|
|
65
109
|
viewSlot: that.$props.viewSlot,
|
|
66
110
|
form: that.$props.form,
|
|
67
|
-
index:
|
|
68
|
-
start: slot.start,
|
|
69
|
-
end: slot.end,
|
|
70
|
-
zonedStart: slot.zonedStart,
|
|
71
|
-
zonedEnd: slot.zonedEnd,
|
|
72
|
-
items: slot.items,
|
|
73
|
-
group: slot.group,
|
|
74
|
-
range: slot.range,
|
|
75
|
-
isAllDay: slot.isAllDay,
|
|
111
|
+
index: slotIndex,
|
|
76
112
|
navDay: true,
|
|
77
113
|
itemsPerSlot: that.itemsPerSlot,
|
|
78
114
|
expandable: {
|
|
@@ -84,17 +120,8 @@ var MonthViewBodyVue2 = {
|
|
|
84
120
|
editable: that.$props.editable
|
|
85
121
|
},
|
|
86
122
|
viewSlot: that.$props.viewSlot,
|
|
87
|
-
key: slotIndex,
|
|
88
123
|
form: that.$props.form,
|
|
89
|
-
index:
|
|
90
|
-
start: slot.start,
|
|
91
|
-
end: slot.end,
|
|
92
|
-
zonedStart: slot.zonedStart,
|
|
93
|
-
zonedEnd: slot.zonedEnd,
|
|
94
|
-
items: slot.items,
|
|
95
|
-
group: slot.group,
|
|
96
|
-
range: slot.range,
|
|
97
|
-
isAllDay: slot.isAllDay,
|
|
124
|
+
index: slotIndex,
|
|
98
125
|
navDay: true,
|
|
99
126
|
itemsPerSlot: that.itemsPerSlot,
|
|
100
127
|
expandable: {
|
|
@@ -21,6 +21,34 @@ var MonthViewHeadVue2 = {
|
|
|
21
21
|
default: null
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
+
provide: function provide() {
|
|
25
|
+
return {
|
|
26
|
+
ksSlots: this.ksSlots
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
data: function data() {
|
|
30
|
+
var _this = this;
|
|
31
|
+
return {
|
|
32
|
+
ksSlots: {
|
|
33
|
+
cSlots: this.monthSlots.filter(function (slot) {
|
|
34
|
+
return slot.group.index === _this.ri.groupIndex && slot.range.index === 0;
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
watch: {
|
|
40
|
+
currentCellSlots: function currentCellSlots(newValue) {
|
|
41
|
+
this.ksSlots.cSlots = newValue;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
currentCellSlots: function currentCellSlots() {
|
|
46
|
+
var _this = this;
|
|
47
|
+
return this.monthSlots.filter(function (slot) {
|
|
48
|
+
return slot.group.index === _this.ri.groupIndex && slot.range.index === 0;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
},
|
|
24
52
|
// @ts-ignore
|
|
25
53
|
setup: !isV3 ? undefined : function () {
|
|
26
54
|
var v3 = !!isV3;
|
|
@@ -30,14 +58,11 @@ var MonthViewHeadVue2 = {
|
|
|
30
58
|
},
|
|
31
59
|
// @ts-ignore
|
|
32
60
|
render: function render(createElement) {
|
|
33
|
-
var _this = this;
|
|
34
61
|
var h = gh || createElement;
|
|
35
62
|
return h("div", {
|
|
36
63
|
"class": "k-scheduler-row",
|
|
37
64
|
key: this.ri.groupIndex
|
|
38
|
-
}, [this.
|
|
39
|
-
return slot.group.index === _this.ri.groupIndex && slot.range.index === 0;
|
|
40
|
-
}).map(function (slot, slotIndex) {
|
|
65
|
+
}, [this.currentCellSlots.map(function (slot, slotIndex) {
|
|
41
66
|
return (
|
|
42
67
|
// @ts-ignore function children
|
|
43
68
|
h(DateHeaderCell, {
|
|
@@ -3,7 +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
|
-
|
|
6
|
+
import { COLLECTION_ACTION } from '../../utils/main.js';
|
|
7
7
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot.js';
|
|
8
8
|
import { isInTimeRange, intersects, first, last } from '../../utils/main.js';
|
|
9
9
|
import { CurrentTimeMarker } from '../../components/CurrentTimeMarker.js';
|
|
@@ -30,8 +30,50 @@ var TimelineViewBodyVue2 = {
|
|
|
30
30
|
},
|
|
31
31
|
ks: {
|
|
32
32
|
default: null
|
|
33
|
+
},
|
|
34
|
+
setSlots: {
|
|
35
|
+
default: null
|
|
33
36
|
}
|
|
34
37
|
},
|
|
38
|
+
provide: function provide() {
|
|
39
|
+
return {
|
|
40
|
+
ksSlots: this.ksSlots
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
data: function data() {
|
|
44
|
+
var timelineSlots = this.timelineSlots;
|
|
45
|
+
var groupIndex = this.groupIndex !== undefined ? this.groupIndex : this.ri.groupIndex;
|
|
46
|
+
return {
|
|
47
|
+
ksSlots: {
|
|
48
|
+
cSlots: this.calculateRanges(timelineSlots, groupIndex, this.ranges)
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
watch: {
|
|
53
|
+
currentCellSlots: function currentCellSlots(newValue) {
|
|
54
|
+
this.ksSlots.cSlots = newValue;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
currentCellSlots: function currentCellSlots() {
|
|
59
|
+
var timelineSlots = this.timelineSlots;
|
|
60
|
+
var groupIndex = this.groupIndex !== undefined ? this.groupIndex : this.ri.groupIndex;
|
|
61
|
+
return this.calculateRanges(timelineSlots, groupIndex, this.ranges);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
65
|
+
this.setSlots({
|
|
66
|
+
type: COLLECTION_ACTION.remove,
|
|
67
|
+
item: this
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
unmounted: function unmounted() {
|
|
72
|
+
this.setSlots({
|
|
73
|
+
type: COLLECTION_ACTION.remove,
|
|
74
|
+
item: this
|
|
75
|
+
});
|
|
76
|
+
},
|
|
35
77
|
// @ts-ignore
|
|
36
78
|
setup: !isV3 ? undefined : function () {
|
|
37
79
|
var v3 = !!isV3;
|
|
@@ -49,54 +91,33 @@ var TimelineViewBodyVue2 = {
|
|
|
49
91
|
var editable = this.$props.editable;
|
|
50
92
|
return h("div", {
|
|
51
93
|
"class": "k-scheduler-row"
|
|
52
|
-
}, [this.
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return h(SchedulerEditSlot, {
|
|
57
|
-
key: "".concat(slot.start.getTime(), ":").concat(slot.group.index),
|
|
94
|
+
}, [this.currentCellSlots.map(function (cSlot, slotIndex, filtered) {
|
|
95
|
+
return h(SchedulerEditSlot, {
|
|
96
|
+
slotRender: that.$props.slotRender,
|
|
97
|
+
attrs: this.v3 ? undefined : {
|
|
58
98
|
slotRender: that.$props.slotRender,
|
|
59
|
-
attrs: this.v3 ? undefined : {
|
|
60
|
-
slotRender: that.$props.slotRender,
|
|
61
|
-
viewSlot: that.$props.viewSlot,
|
|
62
|
-
index: slot.index,
|
|
63
|
-
start: slot.start,
|
|
64
|
-
end: slot.end,
|
|
65
|
-
zonedStart: slot.zonedStart,
|
|
66
|
-
zonedEnd: slot.zonedEnd,
|
|
67
|
-
items: slot.items,
|
|
68
|
-
group: slot.group,
|
|
69
|
-
range: slot.range,
|
|
70
|
-
isAllDay: slot.isAllDay,
|
|
71
|
-
form: that.$props.form,
|
|
72
|
-
isWorkHour: isInTimeRange(slot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
73
|
-
col: orientation === 'horizontal' ? rangeIndex * filtered.length + slotIndex + filtered.length * ranges.length * (groupIndex || 0) : rangeIndex * filtered.length + slotIndex,
|
|
74
|
-
row: orientation === 'horizontal' ? 0 : groupIndex || 0,
|
|
75
|
-
expandable: true,
|
|
76
|
-
editable: editable
|
|
77
|
-
},
|
|
78
99
|
viewSlot: that.$props.viewSlot,
|
|
79
|
-
index:
|
|
80
|
-
start: slot.start,
|
|
81
|
-
end: slot.end,
|
|
82
|
-
zonedStart: slot.zonedStart,
|
|
83
|
-
zonedEnd: slot.zonedEnd,
|
|
84
|
-
items: slot.items,
|
|
85
|
-
group: slot.group,
|
|
86
|
-
range: slot.range,
|
|
87
|
-
isAllDay: slot.isAllDay,
|
|
100
|
+
index: slotIndex,
|
|
88
101
|
form: that.$props.form,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"dataaction": that.handleDataAction
|
|
92
|
-
},
|
|
93
|
-
isWorkHour: isInTimeRange(slot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
94
|
-
col: orientation === 'horizontal' ? rangeIndex * filtered.length + slotIndex + filtered.length * ranges.length * (groupIndex || 0) : rangeIndex * filtered.length + slotIndex,
|
|
102
|
+
isWorkHour: isInTimeRange(cSlot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
103
|
+
col: orientation === 'horizontal' ? cSlot.range.index * filtered.length + slotIndex + filtered.length * ranges.length * (groupIndex || 0) : cSlot.range.index * filtered.length + slotIndex,
|
|
95
104
|
row: orientation === 'horizontal' ? 0 : groupIndex || 0,
|
|
96
105
|
expandable: true,
|
|
97
106
|
editable: editable
|
|
98
|
-
}
|
|
99
|
-
|
|
107
|
+
},
|
|
108
|
+
viewSlot: that.$props.viewSlot,
|
|
109
|
+
index: slotIndex,
|
|
110
|
+
form: that.$props.form,
|
|
111
|
+
onDataaction: that.handleDataAction,
|
|
112
|
+
on: this.v3 ? undefined : {
|
|
113
|
+
"dataaction": that.handleDataAction
|
|
114
|
+
},
|
|
115
|
+
isWorkHour: isInTimeRange(cSlot.zonedStart, that.workDayStart, that.workDayEnd),
|
|
116
|
+
col: orientation === 'horizontal' ? cSlot.range.index * filtered.length + slotIndex + filtered.length * ranges.length * (groupIndex || 0) : cSlot.range.index * filtered.length + slotIndex,
|
|
117
|
+
row: orientation === 'horizontal' ? 0 : groupIndex || 0,
|
|
118
|
+
expandable: true,
|
|
119
|
+
editable: editable
|
|
120
|
+
});
|
|
100
121
|
}, this), this.$props.currentTimeMarker && intersects(first(ranges).start, last(ranges).end, new Date(), new Date(), true) && h(CurrentTimeMarker, {
|
|
101
122
|
groupIndex: groupIndex,
|
|
102
123
|
attrs: this.v3 ? undefined : {
|
|
@@ -109,6 +130,13 @@ var TimelineViewBodyVue2 = {
|
|
|
109
130
|
methods: {
|
|
110
131
|
handleDataAction: function handleDataAction(action) {
|
|
111
132
|
this.$emit('dataaction', action);
|
|
133
|
+
},
|
|
134
|
+
calculateRanges: function calculateRanges(timelineSlots, groupIndex, ranges) {
|
|
135
|
+
return ranges.map(function (_, rangeIndex) {
|
|
136
|
+
return timelineSlots.filter(function (s) {
|
|
137
|
+
return s.group.index === groupIndex && s.range.index === rangeIndex;
|
|
138
|
+
});
|
|
139
|
+
}).flat();
|
|
112
140
|
}
|
|
113
141
|
}
|
|
114
142
|
};
|
|
@@ -133,8 +133,7 @@ var BaseViewVue2 = {
|
|
|
133
133
|
this.bv.slots.push(action.item);
|
|
134
134
|
break;
|
|
135
135
|
case main_2.COLLECTION_ACTION.remove:
|
|
136
|
-
|
|
137
|
-
this.bv.slots.splice(index, 1);
|
|
136
|
+
this.bv.slots = [];
|
|
138
137
|
break;
|
|
139
138
|
default:
|
|
140
139
|
break;
|
|
@@ -120,8 +120,9 @@ var CurrentTimeMarkerVue2 = {
|
|
|
120
120
|
if (!this.bv.slots) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
+
var groupIndex = this.$props.groupIndex;
|
|
123
124
|
var sameTimeSlots = this.bv.slots.filter(function (s) {
|
|
124
|
-
return (
|
|
125
|
+
return (groupIndex === undefined || groupIndex === null || s.cSlot.group.index === groupIndex) && (_this.$props.vertical ? (0, main_1.intersects)(new Date(), new Date(), s.cSlot.start, s.cSlot.end, true) : (0, main_1.isInTimeRange)(new Date(), s.cSlot.start, s.cSlot.end)) && !s.isAllDay;
|
|
125
126
|
});
|
|
126
127
|
if (sameTimeSlots && sameTimeSlots.length && this.line) {
|
|
127
128
|
var firstSlot = (0, main_1.first)(sameTimeSlots);
|
|
@@ -131,8 +132,8 @@ var CurrentTimeMarkerVue2 = {
|
|
|
131
132
|
var size = this.$props.vertical ? combineHeights(sameTimeSlots) : combineWidths(sameTimeSlots);
|
|
132
133
|
var rect = (0, utils_1.getRect)(firstSlot.$el);
|
|
133
134
|
var arrowRect = (0, utils_1.getRect)(this.arrowRef);
|
|
134
|
-
var pxPerMillisecond = (this.$props.vertical ? rect.width : rect.height) / (firstSlot.end.getTime() - firstSlot.start.getTime());
|
|
135
|
-
var offset = (Date.now() - setTime(new Date(), firstSlot.start).getTime()) * pxPerMillisecond;
|
|
135
|
+
var pxPerMillisecond = (this.$props.vertical ? rect.width : rect.height) / (firstSlot.cSlot.end.getTime() - firstSlot.cSlot.start.getTime());
|
|
136
|
+
var offset = (Date.now() - setTime(new Date(), firstSlot.cSlot.start).getTime()) * pxPerMillisecond;
|
|
136
137
|
var rtl = this.$props.dir === 'rtl';
|
|
137
138
|
var top_1 = this.$props.vertical ? rect.top : rect.top + offset - arrowRect.height / 2;
|
|
138
139
|
var horizontalDimension = rtl ? 'right' : 'left';
|