@progress/kendo-vue-scheduler 9.3.0-develop.4 → 9.3.0-develop.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Scheduler.d.ts +67 -4
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +267 -115
- package/components/BaseView.js +1 -1
- package/components/BaseView.mjs +10 -4
- package/components/CurrentTimeMarker.js +1 -1
- package/components/CurrentTimeMarker.mjs +9 -9
- package/components/CurrentTimeMarkerArrow.js +1 -1
- package/components/CurrentTimeMarkerArrow.mjs +3 -3
- package/components/DateHeaderCell.js +1 -1
- package/components/DateHeaderCell.mjs +22 -13
- package/components/MoreEventsPopover.d.ts +77 -0
- package/components/MoreEventsPopover.js +8 -0
- package/components/MoreEventsPopover.mjs +125 -0
- package/components/SchedulerActionButtons.d.ts +6 -0
- package/components/SchedulerActionButtons.js +1 -1
- package/components/SchedulerActionButtons.mjs +25 -19
- package/components/SchedulerForm.d.ts +7 -0
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +69 -61
- package/components/SchedulerOccurrenceDialog.d.ts +4 -4
- package/components/SchedulerOccurrenceDialog.js +1 -1
- package/components/SchedulerOccurrenceDialog.mjs +35 -26
- package/components/SchedulerRemoveDialog.d.ts +6 -0
- package/components/SchedulerRemoveDialog.js +1 -1
- package/components/SchedulerRemoveDialog.mjs +24 -23
- package/components/ShowMoreItemsButton.d.ts +10 -1
- package/components/ShowMoreItemsButton.js +1 -1
- package/components/ShowMoreItemsButton.mjs +40 -18
- package/components/footer/bussiness-hours/BusinessHours.js +1 -1
- package/components/footer/bussiness-hours/BusinessHours.mjs +16 -21
- package/components/header/SchedulerAdaptiveHeader.js +1 -1
- package/components/header/SchedulerAdaptiveHeader.mjs +28 -26
- package/components/header/SchedulerHeader.d.ts +5 -1
- package/components/header/SchedulerHeader.js +1 -1
- package/components/header/SchedulerHeader.mjs +11 -7
- package/components/header/navigation/NavigationDatePicker.d.ts +22 -3
- package/components/header/navigation/NavigationDatePicker.js +1 -1
- package/components/header/navigation/NavigationDatePicker.mjs +27 -30
- package/components/header/view-selector/ViewSelectorList.d.ts +26 -6
- package/components/header/view-selector/ViewSelectorList.js +1 -1
- package/components/header/view-selector/ViewSelectorList.mjs +55 -49
- package/dist/cdn/js/kendo-vue-scheduler.js +1 -1
- package/editors/RemoveRecurrenceConfirmDialog.d.ts +29 -0
- package/editors/RemoveRecurrenceConfirmDialog.js +8 -0
- package/editors/RemoveRecurrenceConfirmDialog.mjs +65 -0
- package/editors/ResourceEditor.d.ts +3 -0
- package/editors/ResourceEditor.js +1 -1
- package/editors/ResourceEditor.mjs +12 -10
- package/editors/SchedulerFormEditor.d.ts +1067 -2953
- package/editors/SchedulerFormEditor.js +1 -1
- package/editors/SchedulerFormEditor.mjs +297 -365
- package/editors/SchedulerRecurrenceDialog.d.ts +143 -0
- package/editors/SchedulerRecurrenceDialog.js +8 -0
- package/editors/SchedulerRecurrenceDialog.mjs +575 -0
- package/editors/TimezoneDropDownList.d.ts +46 -0
- package/editors/TimezoneDropDownList.js +8 -0
- package/editors/TimezoneDropDownList.mjs +63 -0
- package/editors/ZonedSplitDateTime.d.ts +65 -0
- package/editors/ZonedSplitDateTime.js +8 -0
- package/editors/ZonedSplitDateTime.mjs +100 -0
- package/hooks/main.d.ts +1 -0
- package/hooks/useGroupRowHeightSync.d.ts +10 -0
- package/hooks/useRecurrenceSummary.d.ts +10 -0
- package/hooks/useRecurrenceSummary.js +8 -0
- package/hooks/useRecurrenceSummary.mjs +74 -0
- package/hooks/useRowSync.js +1 -1
- package/hooks/useRowSync.mjs +23 -4
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +36 -28
- package/index.d.mts +9 -3
- package/index.d.ts +9 -3
- package/index.js +1 -1
- package/index.mjs +83 -71
- package/items/SchedulerEditItem.d.ts +14 -3
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +130 -72
- package/items/SchedulerItem.d.ts +10 -0
- package/items/SchedulerItem.js +1 -1
- package/items/SchedulerItem.mjs +153 -135
- package/items/SchedulerProportionalViewItem.d.ts +183 -0
- package/items/SchedulerProportionalViewItem.js +8 -0
- package/items/SchedulerProportionalViewItem.mjs +378 -0
- package/items/SchedulerViewItem.d.ts +3 -0
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +107 -67
- package/messages/main.d.ts +186 -0
- package/messages/main.js +1 -1
- package/messages/main.mjs +226 -102
- package/models/Item.d.ts +2 -0
- package/models/Occurrence.d.ts +2 -0
- package/models/SchedulerModelFields.d.ts +5 -0
- package/models/SchedulerResource.d.ts +6 -0
- package/models/SchedulerView.d.ts +2 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -11
- package/recurrence/common.js +1 -1
- package/recurrence/common.mjs +36 -39
- package/services/itemsService.js +1 -1
- package/services/itemsService.mjs +31 -27
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +41 -35
- package/slots/SchedulerEditSlot.d.ts +2 -0
- package/slots/SchedulerEditSlot.js +1 -1
- package/slots/SchedulerEditSlot.mjs +27 -28
- package/slots/SchedulerSlot.d.ts +4 -0
- package/slots/SchedulerSlot.js +1 -1
- package/slots/SchedulerSlot.mjs +10 -1
- package/slots/SchedulerViewSlot.d.ts +5 -0
- package/slots/SchedulerViewSlot.js +1 -1
- package/slots/SchedulerViewSlot.mjs +70 -50
- package/tasks/SchedulerEditTask.d.ts +6 -0
- package/tasks/SchedulerEditTask.js +1 -1
- package/tasks/SchedulerEditTask.mjs +64 -23
- package/tasks/SchedulerTask.d.ts +15 -0
- package/tasks/SchedulerTask.js +1 -1
- package/tasks/SchedulerTask.mjs +39 -28
- package/tasks/SchedulerViewTask.d.ts +9 -0
- package/tasks/SchedulerViewTask.js +1 -1
- package/tasks/SchedulerViewTask.mjs +10 -5
- package/utils/main.d.ts +4 -1
- package/utils/main.js +1 -1
- package/utils/main.mjs +133 -112
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +28 -22
- package/views/agenda/AgendaViewBody.js +1 -1
- package/views/agenda/AgendaViewBody.mjs +44 -42
- package/views/agenda/AgendaViewHead.js +1 -1
- package/views/agenda/AgendaViewHead.mjs +14 -10
- package/views/common/SchedulerDrag.d.ts +12 -0
- package/views/common/SchedulerResize.d.ts +12 -0
- package/views/common/VerticalResourceIterator.d.ts +3 -0
- package/views/common/VerticalResourceIterator.js +1 -1
- package/views/common/VerticalResourceIterator.mjs +16 -9
- package/views/day/DayView.js +1 -1
- package/views/day/DayView.mjs +2 -2
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +98 -127
- package/views/month/MonthView.d.ts +8 -2
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +115 -109
- package/views/month/MonthViewBody.d.ts +7 -2
- package/views/month/MonthViewBody.js +1 -1
- package/views/month/MonthViewBody.mjs +15 -11
- package/views/time/MultiDayTimelineView.d.ts +5 -0
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +125 -132
- package/views/time/TimelineView.js +1 -1
- package/views/time/TimelineView.mjs +2 -2
- package/views/week/WeekView.js +1 -1
- package/views/week/WeekView.mjs +2 -2
- package/views/week/WorkWeekView.js +1 -1
- package/views/week/WorkWeekView.mjs +9 -9
- package/components/header/navigation/DatePickerToggleButton.d.ts +0 -16
- package/editors/FilterableComboBox.d.ts +0 -38
- package/editors/FilterableComboBox.js +0 -8
- package/editors/FilterableComboBox.mjs +0 -61
- package/editors/ZonedDateTime.js +0 -8
- package/editors/ZonedDateTime.mjs +0 -57
package/Scheduler.mjs
CHANGED
|
@@ -5,33 +5,49 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import {
|
|
10
|
-
import { canUseDOM as
|
|
11
|
-
import { SchedulerHeader as
|
|
12
|
-
import { SchedulerAdaptiveHeader as
|
|
13
|
-
import { provideIntlService as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
8
|
+
import { defineComponent as le, createVNode as d, h as R, isVNode as ce } from "vue";
|
|
9
|
+
import { findMaster as v, setField as l, getField as r, toSchedulerGroups as he, getModelFields as P } from "./utils/main.mjs";
|
|
10
|
+
import { canUseDOM as $, clone as w, validatePackage as de, shouldShowValidationUI as ue, getLicenseMessage as me, templateRendering as k, getListeners as M, getTemplate as W, WatermarkOverlay as pe, isRtl as fe } from "@progress/kendo-vue-common";
|
|
11
|
+
import { SchedulerHeader as we } from "./components/header/SchedulerHeader.mjs";
|
|
12
|
+
import { SchedulerAdaptiveHeader as ke } from "./components/header/SchedulerAdaptiveHeader.mjs";
|
|
13
|
+
import { provideIntlService as L, provideLocalizationService as ge } from "@progress/kendo-vue-intl";
|
|
14
|
+
import { ZonedDate as be, addMonths as H, addDays as A } from "@progress/kendo-date-math";
|
|
15
|
+
import { SchedulerFooter as ve } from "./components/footer/SchedulerFooter.mjs";
|
|
16
|
+
import { Button as V, ButtonGroup as De, ToolbarSpacer as z } from "@progress/kendo-vue-buttons";
|
|
17
|
+
import { NavigationDatePicker as Se } from "./components/header/navigation/NavigationDatePicker.mjs";
|
|
18
|
+
import { ViewSelectorList as Ie } from "./components/header/view-selector/ViewSelectorList.mjs";
|
|
19
|
+
import { BusinessHours as Ce } from "./components/footer/bussiness-hours/BusinessHours.mjs";
|
|
20
|
+
import { today as j, messages as C, previousTitle as B, nextTitle as U, newEvent as _, newEventLabel as K, toolbarLabel as G } from "./messages/main.mjs";
|
|
21
|
+
import { packageMetadata as x } from "./package-metadata.mjs";
|
|
22
|
+
import { AgendaView as Ve } from "./views/agenda/AgendaView.mjs";
|
|
23
|
+
import { TimelineView as Ee } from "./views/time/TimelineView.mjs";
|
|
24
|
+
import { DayView as y } from "./views/day/DayView.mjs";
|
|
25
|
+
import { WeekView as ye } from "./views/week/WeekView.mjs";
|
|
26
|
+
import { WorkWeekView as Re } from "./views/week/WorkWeekView.mjs";
|
|
27
|
+
import { MonthView as $e } from "./views/month/MonthView.mjs";
|
|
28
|
+
import { DATA_ACTION as O } from "./constants/main.mjs";
|
|
29
|
+
import { plusIcon as xe, chevronRightIcon as Y, chevronLeftIcon as q } from "@progress/kendo-svg-icons";
|
|
30
|
+
import { SchedulerForm as Oe } from "./components/SchedulerForm.mjs";
|
|
31
|
+
import { parseRule as Te, serializeRule as Ne } from "@progress/kendo-recurrence";
|
|
32
|
+
import { useEditable as Fe } from "./hooks/useEditable.mjs";
|
|
33
|
+
function Z(e) {
|
|
34
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ce(e);
|
|
33
35
|
}
|
|
34
|
-
const
|
|
36
|
+
const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
37
|
+
const s = Math.round(i / 864e5), t = Te({
|
|
38
|
+
recurrenceRule: e
|
|
39
|
+
});
|
|
40
|
+
if (s % 7 === 0 || (t == null ? void 0 : t.freq) !== "weekly" || !t.byWeekDay)
|
|
41
|
+
return e;
|
|
42
|
+
const a = Ne({
|
|
43
|
+
...t,
|
|
44
|
+
byWeekDay: t.byWeekDay.map((o) => ({
|
|
45
|
+
...o,
|
|
46
|
+
day: (o.day + s + 7) % 7
|
|
47
|
+
}))
|
|
48
|
+
});
|
|
49
|
+
return e.toUpperCase().includes("WKST=") ? a : a.replace(";WKST=SU", "");
|
|
50
|
+
}, nt = /* @__PURE__ */ le({
|
|
35
51
|
name: "KendoScheduler",
|
|
36
52
|
emits: ["datechange", "viewchange", "datachange", "itemclick", "itemdoubleclick", "slotclick", "slotdoubleclick", "taskclick", "taskdoubleclick"],
|
|
37
53
|
props: {
|
|
@@ -90,6 +106,11 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
90
106
|
task: [String, Function, Object],
|
|
91
107
|
form: [String, Function, Object],
|
|
92
108
|
resizeHint: [String, Function, Object],
|
|
109
|
+
editItem: [String, Function, Object],
|
|
110
|
+
viewTask: [String, Function, Object],
|
|
111
|
+
editTask: [String, Function, Object],
|
|
112
|
+
editSlot: [String, Function, Object],
|
|
113
|
+
className: String,
|
|
93
114
|
dialogProps: Object,
|
|
94
115
|
formProps: Object,
|
|
95
116
|
dateHeaderCell: [String, Function, Object],
|
|
@@ -106,22 +127,26 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
106
127
|
isMobile() {
|
|
107
128
|
return this.$props.adaptive && this.media === "mobile";
|
|
108
129
|
},
|
|
130
|
+
canAdd() {
|
|
131
|
+
return typeof this.$props.editable == "object" ? this.$props.editable.add : !!this.$props.editable;
|
|
132
|
+
},
|
|
109
133
|
wrapperClassName() {
|
|
110
134
|
return {
|
|
111
135
|
"k-rtl": this.isRtl,
|
|
112
136
|
"k-scheduler": !0,
|
|
113
|
-
"k-scheduler-mobile": this.isMobile
|
|
137
|
+
"k-scheduler-mobile": this.isMobile,
|
|
138
|
+
[this.$props.className]: !!this.$props.className
|
|
114
139
|
};
|
|
115
140
|
},
|
|
116
141
|
fields() {
|
|
117
|
-
return
|
|
142
|
+
return P(this.$props.modelFields).fields;
|
|
118
143
|
}
|
|
119
144
|
},
|
|
120
145
|
mounted() {
|
|
121
|
-
this.currentRtl =
|
|
146
|
+
this.currentRtl = fe(this.$el), this.calculateMedia(), this.$props.adaptive && $ && window.ResizeObserver && (this.resizeObserver = new window.ResizeObserver(this.calculateMedia), this.resizeObserver.observe(this.$el)), $ && window.ResizeObserver && (this.toolbarObserver = new window.ResizeObserver(this.measureToolbar), this.toolbarElement && this.toolbarObserver.observe(this.toolbarElement));
|
|
122
147
|
},
|
|
123
148
|
unmounted() {
|
|
124
|
-
this.resizeObserver && this.resizeObserver.disconnect();
|
|
149
|
+
this.resizeObserver && this.resizeObserver.disconnect(), this.toolbarObserver && this.toolbarObserver.disconnect();
|
|
125
150
|
},
|
|
126
151
|
provide() {
|
|
127
152
|
return {
|
|
@@ -148,7 +173,7 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
148
173
|
}
|
|
149
174
|
},
|
|
150
175
|
data() {
|
|
151
|
-
const e =
|
|
176
|
+
const e = L(this), i = this.$props.date || this.$props.defaultDate, s = this.$props.view || this.$props.defaultView || this.views[0] && this.views[0].name || "day", t = this.views.find((c) => c.name === s) || this.views[0] || d(y, null, null), a = this.getViewPropValue(t, "selectedDateFormat", s) || J, o = this.getViewPropValue(t, "selectedShortDateFormat", s) || Q, n = this.getViewComponentByName(s).props.dateRange.default()({
|
|
152
177
|
intl: e,
|
|
153
178
|
date: i,
|
|
154
179
|
timezone: this.$props.timezone,
|
|
@@ -158,6 +183,9 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
158
183
|
});
|
|
159
184
|
return {
|
|
160
185
|
media: "desktop",
|
|
186
|
+
toolbarLevel: 0,
|
|
187
|
+
toolbarBreakpoints: [1 / 0, 1 / 0, 1 / 0],
|
|
188
|
+
newEventDialogItem: null,
|
|
161
189
|
ks: {
|
|
162
190
|
activeViewName: s,
|
|
163
191
|
currentDate: i,
|
|
@@ -168,11 +196,11 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
168
196
|
},
|
|
169
197
|
views: this.views,
|
|
170
198
|
view: t,
|
|
171
|
-
fields:
|
|
172
|
-
groups:
|
|
173
|
-
dateRange:
|
|
199
|
+
fields: P(this.$props.modelFields).fields,
|
|
200
|
+
groups: he(this.$props.group, this.$props.resources),
|
|
201
|
+
dateRange: n,
|
|
174
202
|
orientation: this.$props.group && this.$props.group.orientation ? this.$props.group.orientation : "horizontal",
|
|
175
|
-
dateFormat:
|
|
203
|
+
dateFormat: a,
|
|
176
204
|
shortDateFormat: o,
|
|
177
205
|
scheduler: this,
|
|
178
206
|
dataItems: this.dataItems
|
|
@@ -197,10 +225,10 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
197
225
|
}
|
|
198
226
|
},
|
|
199
227
|
render() {
|
|
200
|
-
|
|
201
|
-
const e = this.views.find((
|
|
202
|
-
this.ks.form =
|
|
203
|
-
const
|
|
228
|
+
de(x), this.showLicenseWatermark = ue(x), this.licenseMessage = me(x);
|
|
229
|
+
const e = this.views.find((oe) => oe.name === this.ks.activeViewName) || this.views[0] || d(y, null, null), i = this.getViewPropValue(this.ks.view, "slotDuration", this.ks.activeViewName), s = k.call(this, e.header || this.$props.header, M.call(this)), t = k.call(this, e.footer || this.$props.footer, M.call(this)), a = k.call(this, e.slot || this.$props.slotRender, {}), o = k.call(this, e.viewSlot || this.$props.viewSlot, {}), n = k.call(this, e.item || this.$props.item, {}), c = k.call(this, e.viewItem || this.$props.viewItem, {}), h = k.call(this, e.task || this.$props.task, {}), p = e.form || this.$props.form || Oe, f = k.call(this, e.dateHeaderCell || this.$props.dateHeaderCell, {}), u = k.call(this, e.timeHeaderCell || this.$props.timeHeaderCell, {}), m = k.call(this, e.resizeHint || this.$props.resizeHint, {});
|
|
230
|
+
this.ks.form = k.call(this, e.form || this.$props.form, {}), this.ks.dialogProps = e.dialogProps || this.$props.dialogProps, this.ks.formProps = e.formProps || this.$props.formProps;
|
|
231
|
+
const g = Fe(e.editable !== void 0 ? e.editable : this.$props.editable), S = this.getViewComponentByName(this.ks.activeViewName || e.name), E = {
|
|
204
232
|
...this.$props,
|
|
205
233
|
...this.ks.view,
|
|
206
234
|
showWorkHours: this.ks.showWorkHours,
|
|
@@ -208,33 +236,71 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
208
236
|
views: void 0,
|
|
209
237
|
defaultDate: void 0,
|
|
210
238
|
dateRange: this.ks.dateRange,
|
|
211
|
-
slotRender:
|
|
239
|
+
slotRender: a,
|
|
212
240
|
viewSlot: o,
|
|
213
|
-
item:
|
|
214
|
-
viewItem:
|
|
215
|
-
task:
|
|
216
|
-
dateHeaderCell:
|
|
217
|
-
timeHeaderCell:
|
|
218
|
-
resizeHint:
|
|
219
|
-
editable:
|
|
220
|
-
},
|
|
241
|
+
item: n,
|
|
242
|
+
viewItem: c,
|
|
243
|
+
task: h,
|
|
244
|
+
dateHeaderCell: f,
|
|
245
|
+
timeHeaderCell: u,
|
|
246
|
+
resizeHint: m,
|
|
247
|
+
editable: g
|
|
248
|
+
}, b = ge(this), D = b.toLanguageString(j, C[j]), T = b.toLanguageString(B, C[B]), N = b.toLanguageString(U, C[U]), ee = b.toLanguageString(_, C[_]), te = b.toLanguageString(K, C[K]), F = b.toLanguageString(G, C[G]), I = this.toolbarLevel, ie = this.isMobile ? d(ke, {
|
|
221
249
|
isRtl: this.isRtl,
|
|
222
250
|
onPrevclick: this.handlePrevClick,
|
|
223
251
|
onNextclick: this.handleNextClick
|
|
224
|
-
}, null) :
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
252
|
+
}, null) : d(we, {
|
|
253
|
+
ref: this.setToolbarRef,
|
|
254
|
+
ariaLabel: F
|
|
255
|
+
}, {
|
|
256
|
+
default: () => [this.canAdd && d(V, {
|
|
257
|
+
class: "k-toolbar-button",
|
|
258
|
+
themeColor: "primary",
|
|
259
|
+
svgIcon: xe,
|
|
260
|
+
"aria-label": te,
|
|
261
|
+
tabIndex: -1,
|
|
262
|
+
onClick: this.handleNewEventClick
|
|
263
|
+
}, {
|
|
264
|
+
default: () => [I < 2 && ee]
|
|
265
|
+
}), I < 2 && d(V, {
|
|
266
|
+
class: "k-toolbar-button",
|
|
267
|
+
fillMode: "flat",
|
|
268
|
+
tabIndex: -1,
|
|
269
|
+
title: D,
|
|
270
|
+
onClick: this.handleTodayClick
|
|
271
|
+
}, Z(D) ? D : {
|
|
272
|
+
default: () => [D]
|
|
273
|
+
}), I < 3 && d(De, {
|
|
274
|
+
class: "k-button-group-flat k-toolbar-button-group"
|
|
275
|
+
}, {
|
|
276
|
+
default: () => [d(V, {
|
|
277
|
+
fillMode: "flat",
|
|
278
|
+
tabIndex: -1,
|
|
279
|
+
svgIcon: this.isRtl ? Y : q,
|
|
280
|
+
"aria-label": T,
|
|
281
|
+
title: T,
|
|
282
|
+
onClick: this.handlePrevClick
|
|
283
|
+
}, null), d(V, {
|
|
284
|
+
fillMode: "flat",
|
|
285
|
+
tabIndex: -1,
|
|
286
|
+
svgIcon: this.isRtl ? q : Y,
|
|
287
|
+
"aria-label": N,
|
|
288
|
+
title: N,
|
|
289
|
+
onClick: this.handleNextClick
|
|
290
|
+
}, null)]
|
|
291
|
+
}), d(Se, {
|
|
231
292
|
value: this.ks.currentDate,
|
|
232
|
-
onChange: this.handleDatePickerChange
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
293
|
+
onChange: this.handleDatePickerChange,
|
|
294
|
+
level: I
|
|
295
|
+
}, null), d(z, null, null), I === 1 && d("span", {
|
|
296
|
+
class: "k-separator"
|
|
297
|
+
}, null), d(Ie, {
|
|
298
|
+
level: I
|
|
299
|
+
}, null)]
|
|
300
|
+
}), se = W.call(this, {
|
|
301
|
+
h: R,
|
|
236
302
|
template: s,
|
|
237
|
-
defaultRendering:
|
|
303
|
+
defaultRendering: ie,
|
|
238
304
|
additionalProps: {
|
|
239
305
|
currentDate: this.ks.currentDate
|
|
240
306
|
},
|
|
@@ -244,31 +310,33 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
244
310
|
todayclick: this.handleTodayClick,
|
|
245
311
|
datepickerchange: this.handleDatePickerChange
|
|
246
312
|
}
|
|
247
|
-
}),
|
|
248
|
-
|
|
313
|
+
}), re = d(ve, {
|
|
314
|
+
"aria-label": F
|
|
315
|
+
}, {
|
|
316
|
+
default: () => [this.isMobile && d(V, {
|
|
249
317
|
class: "k-scheduler-today",
|
|
250
318
|
tabIndex: -1,
|
|
251
319
|
onClick: this.handleTodayClick
|
|
252
|
-
},
|
|
253
|
-
default: () => [
|
|
254
|
-
}), this.isMobile &&
|
|
320
|
+
}, Z(D) ? D : {
|
|
321
|
+
default: () => [D]
|
|
322
|
+
}), this.isMobile && d(z, null, null), d(Ce, {
|
|
255
323
|
slotDuration: i,
|
|
256
324
|
onClick: this.handleShowWorkHoursClick
|
|
257
325
|
}, null)]
|
|
258
|
-
}),
|
|
259
|
-
h:
|
|
326
|
+
}), ae = W.call(this, {
|
|
327
|
+
h: R,
|
|
260
328
|
template: t,
|
|
261
|
-
defaultRendering:
|
|
329
|
+
defaultRendering: re,
|
|
262
330
|
additionalProps: {
|
|
263
331
|
slotDuration: i
|
|
264
332
|
},
|
|
265
333
|
additionalListeners: {
|
|
266
334
|
showworkhoursclick: this.handleShowWorkHoursClick
|
|
267
335
|
}
|
|
268
|
-
}),
|
|
336
|
+
}), ne = this.showLicenseWatermark ? d(pe, {
|
|
269
337
|
message: this.licenseMessage
|
|
270
338
|
}, null) : null;
|
|
271
|
-
return
|
|
339
|
+
return d("div", {
|
|
272
340
|
id: this.$props.id,
|
|
273
341
|
style: {
|
|
274
342
|
height: this.$props.height + "px"
|
|
@@ -281,27 +349,32 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
281
349
|
"aria-labelledby": this.$props.ariaLabelledby,
|
|
282
350
|
onFocusin: this.handleFocus,
|
|
283
351
|
onFocusout: this.handleBlur
|
|
284
|
-
}, [
|
|
285
|
-
key: this.ks.view.name
|
|
352
|
+
}, [se, R(S, {
|
|
353
|
+
key: `${this.ks.view.name}-${this.ks.showWorkHours}`,
|
|
286
354
|
onDataaction: this.handleDataAction,
|
|
287
|
-
...
|
|
288
|
-
}),
|
|
355
|
+
...E
|
|
356
|
+
}), !["agenda", "month"].includes(this.ks.activeViewName) && ae, ne, this.newEventDialogItem && d(p, {
|
|
357
|
+
dataItem: this.newEventDialogItem,
|
|
358
|
+
onSubmit: this.handleNewEventFormSubmit,
|
|
359
|
+
onCancel: this.handleNewEventFormCancel,
|
|
360
|
+
onClose: this.handleNewEventFormCancel
|
|
361
|
+
}, null)]);
|
|
289
362
|
},
|
|
290
363
|
methods: {
|
|
291
364
|
getViewComponentByName(e) {
|
|
292
365
|
switch (e.toLowerCase()) {
|
|
293
366
|
case "week":
|
|
294
|
-
return
|
|
367
|
+
return ye;
|
|
295
368
|
case "workweek":
|
|
296
|
-
return
|
|
369
|
+
return Re;
|
|
297
370
|
case "agenda":
|
|
298
|
-
return
|
|
371
|
+
return Ve;
|
|
299
372
|
case "timeline":
|
|
300
|
-
return
|
|
373
|
+
return Ee;
|
|
301
374
|
case "month":
|
|
302
|
-
return
|
|
375
|
+
return $e;
|
|
303
376
|
default:
|
|
304
|
-
return
|
|
377
|
+
return y;
|
|
305
378
|
}
|
|
306
379
|
},
|
|
307
380
|
getViewPropValue(e, i, s) {
|
|
@@ -320,6 +393,29 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
320
393
|
};
|
|
321
394
|
this.$emit("datachange", t);
|
|
322
395
|
},
|
|
396
|
+
handleNewEventClick(e) {
|
|
397
|
+
e.preventDefault();
|
|
398
|
+
const i = /* @__PURE__ */ new Date(), s = this.getViewPropValue(this.ks.view, "slotDuration", this.ks.activeViewName) || 30, t = s * 60 * 1e3, a = i.getMinutes(), o = Math.ceil(a / s) * s;
|
|
399
|
+
let n = new Date(i);
|
|
400
|
+
n.setHours(i.getHours() + Math.floor(o / 60), o % 60, 0, 0);
|
|
401
|
+
const c = this.$props.dataItems || [], h = this.fields, p = (m, g) => c.some((S) => {
|
|
402
|
+
const E = r(S, h.start), b = r(S, h.end);
|
|
403
|
+
return !E || !b ? !1 : E.getTime() < g.getTime() && b.getTime() > m.getTime();
|
|
404
|
+
});
|
|
405
|
+
let f = new Date(n.getTime() + t);
|
|
406
|
+
for (let m = 0; m < 48 && p(n, f); m++)
|
|
407
|
+
n = new Date(n.getTime() + t), f = new Date(n.getTime() + t);
|
|
408
|
+
const u = {};
|
|
409
|
+
l(u, h.start, n), l(u, h.end, f), l(u, h.isAllDay, !1), l(u, h.title, ""), l(u, h.description, ""), this.newEventDialogItem = u;
|
|
410
|
+
},
|
|
411
|
+
handleNewEventFormSubmit(e) {
|
|
412
|
+
this.handleDataChange({
|
|
413
|
+
created: [e.value]
|
|
414
|
+
}), this.newEventDialogItem = null;
|
|
415
|
+
},
|
|
416
|
+
handleNewEventFormCancel() {
|
|
417
|
+
this.newEventDialogItem = null;
|
|
418
|
+
},
|
|
323
419
|
handleCreate(e) {
|
|
324
420
|
const i = [e.dataItem];
|
|
325
421
|
this.handleDataChange({
|
|
@@ -329,29 +425,67 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
329
425
|
handleUpdate(e) {
|
|
330
426
|
const i = [], s = [];
|
|
331
427
|
if (e.series)
|
|
332
|
-
if (Array.isArray(e.dataItem))
|
|
333
|
-
e.dataItem
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
428
|
+
if (Array.isArray(e.dataItem)) {
|
|
429
|
+
const t = e.dataItem[0];
|
|
430
|
+
if (r(t, this.fields.recurrenceId) !== null && r(t, this.fields.recurrenceId) !== void 0) {
|
|
431
|
+
const o = w(v(t, this.fields, this.dataItems)), n = new Date(r(t, this.fields.originalStart)).getTime(), c = new Date(r(t, this.fields.start)).getTime(), h = new Date(r(t, this.fields.end)).getTime(), p = c - n, f = h - c, u = new Date(r(o, this.fields.start)).getTime();
|
|
432
|
+
l(o, this.fields.start, new Date(u + p)), l(o, this.fields.end, new Date(u + p + f));
|
|
433
|
+
const m = r(o, this.fields.recurrenceExceptions) || [];
|
|
434
|
+
if (m.length > 0 && p !== 0) {
|
|
435
|
+
const g = m.map((S) => new Date(new Date(S).getTime() + p));
|
|
436
|
+
l(o, this.fields.recurrenceExceptions, g);
|
|
437
|
+
}
|
|
438
|
+
l(o, this.fields.recurrenceRule, X(r(o, this.fields.recurrenceRule), p)), s.push(o);
|
|
439
|
+
} else
|
|
440
|
+
e.dataItem.forEach((o) => {
|
|
441
|
+
const n = w(v(o, this.fields, this.dataItems)), c = w(o);
|
|
442
|
+
l(c, this.fields.originalStart, r(n, this.fields.originalStart)), l(c, this.fields.recurrenceId, r(n, this.fields.recurrenceId));
|
|
443
|
+
const h = r(n, this.fields.recurrenceExceptions) || [], p = new Date(r(n, this.fields.start)).getTime(), u = new Date(r(c, this.fields.start)).getTime() - p;
|
|
444
|
+
if (h.length > 0 && u !== 0) {
|
|
445
|
+
const m = h.map((g) => new Date(new Date(g).getTime() + u));
|
|
446
|
+
l(c, this.fields.recurrenceExceptions, m);
|
|
447
|
+
} else
|
|
448
|
+
l(c, this.fields.recurrenceExceptions, h);
|
|
449
|
+
s.push(c);
|
|
450
|
+
});
|
|
451
|
+
} else if (r(e.dataItem, this.fields.recurrenceId) !== null && r(e.dataItem, this.fields.recurrenceId) !== void 0) {
|
|
452
|
+
const a = w(v(e.dataItem, this.fields, this.dataItems)), o = new Date(r(e.dataItem, this.fields.originalStart)).getTime(), n = new Date(r(e.dataItem, this.fields.start)).getTime(), c = new Date(r(e.dataItem, this.fields.end)).getTime(), h = n - o, p = c - n, f = new Date(r(a, this.fields.start)).getTime();
|
|
453
|
+
l(a, this.fields.start, new Date(f + h)), l(a, this.fields.end, new Date(f + h + p));
|
|
454
|
+
const u = r(a, this.fields.recurrenceExceptions) || [];
|
|
455
|
+
if (u.length > 0 && h !== 0) {
|
|
456
|
+
const m = u.map((g) => new Date(new Date(g).getTime() + h));
|
|
457
|
+
l(a, this.fields.recurrenceExceptions, m);
|
|
458
|
+
}
|
|
459
|
+
l(a, this.fields.recurrenceRule, X(r(a, this.fields.recurrenceRule), h)), s.push(a);
|
|
460
|
+
} else {
|
|
461
|
+
const a = w(e.dataItem);
|
|
462
|
+
if (r(a, this.fields.recurrenceRule)) {
|
|
463
|
+
const n = w(v(e.dataItem, this.fields, this.dataItems));
|
|
464
|
+
l(a, this.fields.originalStart, r(n, this.fields.originalStart)), l(a, this.fields.recurrenceId, r(n, this.fields.recurrenceId));
|
|
465
|
+
const c = r(n, this.fields.recurrenceExceptions) || [], h = new Date(r(n, this.fields.start)).getTime(), f = new Date(r(a, this.fields.start)).getTime() - h;
|
|
466
|
+
if (c.length > 0 && f !== 0) {
|
|
467
|
+
const u = c.map((m) => new Date(new Date(m).getTime() + f));
|
|
468
|
+
l(a, this.fields.recurrenceExceptions, u);
|
|
469
|
+
} else
|
|
470
|
+
l(a, this.fields.recurrenceExceptions, c);
|
|
471
|
+
} else
|
|
472
|
+
l(a, this.fields.recurrenceExceptions, null);
|
|
473
|
+
s.push(a);
|
|
340
474
|
}
|
|
341
475
|
else if (Array.isArray(e.dataItem))
|
|
342
|
-
e.dataItem.
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
const
|
|
346
|
-
l(
|
|
476
|
+
e.dataItem.forEach((t) => {
|
|
477
|
+
const a = r(t, this.fields.recurrenceRule) !== null && r(t, this.fields.recurrenceRule) !== void 0;
|
|
478
|
+
if (r(t, this.fields.recurrenceId) !== null && r(t, this.fields.recurrenceId) !== void 0 && a) {
|
|
479
|
+
const n = w(v(t, this.fields, this.dataItems)), c = r(t, this.fields.originalStart), h = r(n, this.fields.recurrenceExceptions) || [];
|
|
480
|
+
l(n, this.fields.recurrenceExceptions, [...h, c]), l(t, this.fields.recurrenceRule, null), s.push(n), i.push(t);
|
|
347
481
|
} else
|
|
348
482
|
s.push(t);
|
|
349
483
|
});
|
|
350
484
|
else {
|
|
351
|
-
const t =
|
|
352
|
-
if (
|
|
353
|
-
const o =
|
|
354
|
-
l(o, this.fields.recurrenceExceptions, [...
|
|
485
|
+
const t = r(e.dataItem, this.fields.recurrenceRule) !== null && r(e.dataItem, this.fields.recurrenceRule) !== void 0;
|
|
486
|
+
if (r(e.dataItem, this.fields.recurrenceId) !== null && r(e.dataItem, this.fields.recurrenceId) !== void 0 && t) {
|
|
487
|
+
const o = w(v(e.dataItem, this.fields, this.dataItems)), n = r(e.dataItem, this.fields.originalStart), c = r(o, this.fields.recurrenceExceptions) || [];
|
|
488
|
+
l(o, this.fields.recurrenceExceptions, [...c, n]), l(e.dataItem, this.fields.recurrenceRule, null), s.push(o), i.push(e.dataItem);
|
|
355
489
|
} else
|
|
356
490
|
s.push(e.dataItem);
|
|
357
491
|
}
|
|
@@ -363,13 +497,13 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
363
497
|
handleRemove(e) {
|
|
364
498
|
const i = [], s = [];
|
|
365
499
|
if (e.series) {
|
|
366
|
-
const t =
|
|
367
|
-
l(
|
|
368
|
-
} else if (!(
|
|
500
|
+
const t = w(v(e.dataItem, this.fields, this.dataItems)), a = w(e.dataItem);
|
|
501
|
+
l(a, this.fields.originalStart, r(t, this.fields.originalStart)), l(a, this.fields.recurrenceId, r(t, this.fields.recurrenceId)), l(a, this.fields.recurrenceRule, r(t, this.fields.recurrenceRule)), l(a, this.fields.recurrenceExceptions, r(t, this.fields.recurrenceExceptions)), s.push(a);
|
|
502
|
+
} else if (!(r(e.dataItem, this.fields.recurrenceRule) !== null && r(e.dataItem, this.fields.recurrenceRule) !== void 0))
|
|
369
503
|
s.push(e.dataItem);
|
|
370
504
|
else {
|
|
371
|
-
const
|
|
372
|
-
l(
|
|
505
|
+
const a = w(v(e.dataItem, this.fields, this.dataItems)), o = r(e.dataItem, this.fields.originalStart), n = r(a, this.fields.recurrenceExceptions) || [];
|
|
506
|
+
l(a, this.fields.recurrenceExceptions, [...n, o]), l(e.dataItem, this.fields.recurrenceRule, null), i.push(a);
|
|
373
507
|
}
|
|
374
508
|
this.handleDataChange({
|
|
375
509
|
updated: i,
|
|
@@ -378,24 +512,28 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
378
512
|
},
|
|
379
513
|
handleDataAction(e) {
|
|
380
514
|
switch (e.type) {
|
|
381
|
-
case
|
|
515
|
+
case O.create:
|
|
382
516
|
this.handleCreate(e);
|
|
383
517
|
break;
|
|
384
|
-
case
|
|
518
|
+
case O.update:
|
|
385
519
|
this.handleUpdate(e);
|
|
386
520
|
break;
|
|
387
|
-
case
|
|
521
|
+
case O.remove:
|
|
388
522
|
this.handleRemove(e);
|
|
389
523
|
break;
|
|
390
524
|
}
|
|
391
525
|
},
|
|
392
526
|
handleActiveViewNameChange(e, i) {
|
|
393
|
-
this.updatePassedState(e), this.$emit("viewchange", {
|
|
527
|
+
this.$props.view === void 0 && this.updatePassedState(e), this.$emit("viewchange", {
|
|
394
528
|
viewName: e,
|
|
395
529
|
...i,
|
|
396
530
|
target: this.ks.scheduler.$el
|
|
397
531
|
});
|
|
398
532
|
},
|
|
533
|
+
setToolbarRef(e) {
|
|
534
|
+
const i = (e == null ? void 0 : e.$el) || null;
|
|
535
|
+
i !== this.toolbarElement && (this.toolbarObserver && this.toolbarElement && this.toolbarObserver.unobserve(this.toolbarElement), this.toolbarElement = i, this.toolbarObserver && i && this.toolbarObserver.observe(i));
|
|
536
|
+
},
|
|
399
537
|
handleDateChange(e, i) {
|
|
400
538
|
this.setDate(e, {
|
|
401
539
|
...i,
|
|
@@ -411,18 +549,18 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
411
549
|
},
|
|
412
550
|
handleNextClick(e) {
|
|
413
551
|
e.preventDefault();
|
|
414
|
-
const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ?
|
|
552
|
+
const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ? H(this.ks.currentDate, Math.round(i / 27)) : A(this.ks.currentDate, i);
|
|
415
553
|
this.setDate(t, e);
|
|
416
554
|
},
|
|
417
555
|
handlePrevClick(e) {
|
|
418
556
|
e.preventDefault();
|
|
419
|
-
const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ?
|
|
557
|
+
const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ? H(this.ks.currentDate, -Math.round(i / 27)) : A(this.ks.currentDate, -i);
|
|
420
558
|
this.setDate(t, e);
|
|
421
559
|
},
|
|
422
560
|
handleTodayClick(e) {
|
|
423
561
|
e.preventDefault();
|
|
424
|
-
const i =
|
|
425
|
-
this.setDate(i, e);
|
|
562
|
+
const i = be.fromLocalDate(/* @__PURE__ */ new Date(), this.ks.timezone);
|
|
563
|
+
this.setDate(new Date(i.getTime()), e);
|
|
426
564
|
},
|
|
427
565
|
handleShowWorkHoursClick() {
|
|
428
566
|
this.ks.showWorkHours = !this.ks.showWorkHours;
|
|
@@ -452,14 +590,14 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
452
590
|
this.$emit("taskdoubleclick", e);
|
|
453
591
|
},
|
|
454
592
|
setDate(e, i) {
|
|
455
|
-
this.ks.currentDate = e, this.updatePassedState(), this.$emit("datechange", {
|
|
593
|
+
this.$props.date === void 0 && (this.ks.currentDate = e, this.updatePassedState()), this.$emit("datechange", {
|
|
456
594
|
date: e,
|
|
457
595
|
event: i
|
|
458
596
|
});
|
|
459
597
|
},
|
|
460
598
|
updatePassedState(e) {
|
|
461
|
-
const i =
|
|
462
|
-
this.ks.activeViewName = s, this.ks.view = this.views.find((t) => t.name === s) || this.views[0] ||
|
|
599
|
+
const i = L(this), s = e || this.ks.activeViewName;
|
|
600
|
+
this.ks.activeViewName = s, this.ks.view = this.views.find((t) => t.name === s) || this.views[0] || d(y, null, null), this.ks.dateFormat = this.getViewPropValue(this.ks.view, "selectedDateFormat", s) || J, this.ks.shortDateFormat = this.getViewPropValue(this.ks.view, "selectedShortDateFormat", s) || Q, this.ks.dateRange = this.getViewComponentByName(s).props.dateRange.default()({
|
|
463
601
|
intl: i,
|
|
464
602
|
date: this.ks.currentDate,
|
|
465
603
|
timezone: this.$props.timezone,
|
|
@@ -469,10 +607,24 @@ const P = "{0:D}", x = "{0:d}", We = /* @__PURE__ */ B({
|
|
|
469
607
|
});
|
|
470
608
|
},
|
|
471
609
|
calculateMedia() {
|
|
472
|
-
|
|
610
|
+
$ && window.matchMedia && (this.media = window.matchMedia("(min-width: 1024px)").matches ? "desktop" : "mobile");
|
|
611
|
+
},
|
|
612
|
+
measureToolbar() {
|
|
613
|
+
const i = this.toolbarElement;
|
|
614
|
+
if (!i)
|
|
615
|
+
return;
|
|
616
|
+
const s = i.clientWidth;
|
|
617
|
+
if (!s)
|
|
618
|
+
return;
|
|
619
|
+
const t = parseInt(window.getComputedStyle(i).gap || "0", 10), a = Array.from(i.children), o = a.reduce((c, h) => c + h.offsetWidth, 0) + (a.length - 1) * t, n = this.toolbarLevel;
|
|
620
|
+
if (o > s && n < 3) {
|
|
621
|
+
this.toolbarBreakpoints[n] = s, this.toolbarLevel = n + 1;
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
n > 0 && s > this.toolbarBreakpoints[n - 1] + 20 && (this.toolbarLevel = n - 1);
|
|
473
625
|
}
|
|
474
626
|
}
|
|
475
627
|
});
|
|
476
628
|
export {
|
|
477
|
-
|
|
629
|
+
nt as Scheduler
|
|
478
630
|
};
|
package/components/BaseView.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("../hooks/use-items-selection.js"),i=require("../hooks/use-slots-selection.js"),o=require("@progress/kendo-vue-common"),s=require("../utils/main.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("../hooks/use-items-selection.js"),i=require("../hooks/use-slots-selection.js"),o=require("@progress/kendo-vue-common"),s=require("../utils/main.js"),a=require("../hooks/use-slots-focus.js"),r=require("../hooks/use-items-focus.js"),d=require("../hooks/useCellSync.js"),h=c.defineComponent({name:"KendoBaseView",inheritAttrs:!1,props:{viewProps:Object,baseSlots:Array,ranges:Array,id:String,isAgendaView:{type:Boolean,default:!1}},provide(){return{bv:this.bv,setItems:this.dispatchItems,setSlots:this.dispatchSlots,dispatchSelectedSlots:this.handleSchedulerSlotsSelectAction,dispatchSelectedItems:this.handleSchedulerItemsSelectAction,dispatchFocusedItems:this.setFocusedItems,dispatchFocusedSlots:this.setFocusedSlots}},data(){return{bv:{viewProps:this.viewProps,ranges:this.ranges,items:[],slots:[],focusedItems:[],focusedSlots:[],selectedItems:[],selectedSlots:[]}}},mounted(){this.syncCells()},watch:{ranges(e){this.bv.ranges=e}},updated(){this.syncCells()},render(){const e=o.getDefaultSlots(this);return c.createVNode("div",{class:["k-scheduler-layout k-scheduler-layout-flex",this.$attrs.class],role:this.$props.isAgendaView?"grid":"none"},[e])},methods:{syncCells(){d.useCellSync({element:this.$el,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),d.useCellSync({element:this.$el,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1})},handleSchedulerItemsSelectAction(e,t){i.dispatchSelectedSlots.call(this,{type:i.SLOTS_SELECT_ACTION.reset}),l.dispatchSelectedItems.call(this,e,t)},handleSchedulerSlotsSelectAction(e,t){l.dispatchSelectedItems.call(this,{type:l.ITEMS_SELECT_ACTION.reset},t),i.dispatchSelectedSlots.call(this,e)},setFocusedItems(e,t){r.dispatchFocusedItems.call(this,e,t)},setFocusedSlots(e,t){a.dispatchFocusedSlots.call(this,e,t)},dispatchItems(e){let t;switch(e.type){case s.COLLECTION_ACTION.add:this.bv.items.push(e.item);break;case s.COLLECTION_ACTION.remove:t=this.bv.items.indexOf(e.item),this.bv.items.splice(t,1);break}},dispatchSlots(e){let t;switch(e.type){case s.COLLECTION_ACTION.add:this.bv.slots.push(e.item);break;case s.COLLECTION_ACTION.remove:t=this.bv.slots.indexOf(e.item),this.bv.slots.splice(t,1);break}}}});exports.BaseView=h;
|