@progress/kendo-vue-scheduler 10.0.1-develop.2 → 10.0.1-develop.4
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 +20 -21
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +109 -114
- package/dist/cdn/js/kendo-vue-scheduler.js +1 -1
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +2 -2
- package/items/SchedulerItem.d.ts +3 -0
- package/items/SchedulerItem.js +1 -1
- package/items/SchedulerItem.mjs +29 -15
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/views/common/SchedulerDrag.d.ts +6 -0
- package/views/common/SchedulerResize.d.ts +6 -0
- package/components/header/SchedulerAdaptiveHeader.d.ts +0 -44
- package/components/header/SchedulerAdaptiveHeader.js +0 -8
- package/components/header/SchedulerAdaptiveHeader.mjs +0 -110
package/Scheduler.mjs
CHANGED
|
@@ -5,49 +5,48 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as le, createVNode as d, h as
|
|
8
|
+
import { defineComponent as le, createVNode as d, h as $, isVNode as ce } from "vue";
|
|
9
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
|
|
10
|
+
import { canUseDOM as R, 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
11
|
import { SchedulerHeader as we } from "./components/header/SchedulerHeader.mjs";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { BusinessHours as Ce } from "./components/footer/bussiness-hours/BusinessHours.mjs";
|
|
12
|
+
import { provideIntlService as L, provideLocalizationService as ke } from "@progress/kendo-vue-intl";
|
|
13
|
+
import { ZonedDate as ge, addMonths as H, addDays as A } from "@progress/kendo-date-math";
|
|
14
|
+
import { SchedulerFooter as be } from "./components/footer/SchedulerFooter.mjs";
|
|
15
|
+
import { Button as V, ButtonGroup as ve, ToolbarSpacer as z } from "@progress/kendo-vue-buttons";
|
|
16
|
+
import { NavigationDatePicker as De } from "./components/header/navigation/NavigationDatePicker.mjs";
|
|
17
|
+
import { ViewSelectorList as Se } from "./components/header/view-selector/ViewSelectorList.mjs";
|
|
18
|
+
import { BusinessHours as Ie } from "./components/footer/bussiness-hours/BusinessHours.mjs";
|
|
20
19
|
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
20
|
import { packageMetadata as x } from "./package-metadata.mjs";
|
|
22
|
-
import { AgendaView as
|
|
23
|
-
import { TimelineView as
|
|
21
|
+
import { AgendaView as Ce } from "./views/agenda/AgendaView.mjs";
|
|
22
|
+
import { TimelineView as Ve } from "./views/time/TimelineView.mjs";
|
|
24
23
|
import { DayView as y } from "./views/day/DayView.mjs";
|
|
25
|
-
import { WeekView as
|
|
26
|
-
import { WorkWeekView as
|
|
24
|
+
import { WeekView as Ee } from "./views/week/WeekView.mjs";
|
|
25
|
+
import { WorkWeekView as ye } from "./views/week/WorkWeekView.mjs";
|
|
27
26
|
import { MonthView as $e } from "./views/month/MonthView.mjs";
|
|
28
27
|
import { DATA_ACTION as O } from "./constants/main.mjs";
|
|
29
|
-
import { plusIcon as
|
|
30
|
-
import { SchedulerForm as
|
|
31
|
-
import { parseRule as
|
|
32
|
-
import { useEditable as
|
|
28
|
+
import { plusIcon as Re, chevronRightIcon as Y, chevronLeftIcon as q } from "@progress/kendo-svg-icons";
|
|
29
|
+
import { SchedulerForm as xe } from "./components/SchedulerForm.mjs";
|
|
30
|
+
import { parseRule as Oe, serializeRule as Te } from "@progress/kendo-recurrence";
|
|
31
|
+
import { useEditable as Ne } from "./hooks/useEditable.mjs";
|
|
33
32
|
function Z(e) {
|
|
34
33
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ce(e);
|
|
35
34
|
}
|
|
36
|
-
const J = "{0:D}", Q = "{0:d}", X = (e,
|
|
37
|
-
const
|
|
35
|
+
const J = "{0:D}", Q = "{0:d}", X = (e, s) => {
|
|
36
|
+
const i = Math.round(s / 864e5), t = Oe({
|
|
38
37
|
recurrenceRule: e
|
|
39
38
|
});
|
|
40
|
-
if (
|
|
39
|
+
if (i % 7 === 0 || (t == null ? void 0 : t.freq) !== "weekly" || !t.byWeekDay)
|
|
41
40
|
return e;
|
|
42
|
-
const a =
|
|
41
|
+
const a = Te({
|
|
43
42
|
...t,
|
|
44
43
|
byWeekDay: t.byWeekDay.map((o) => ({
|
|
45
44
|
...o,
|
|
46
|
-
day: (o.day +
|
|
45
|
+
day: (o.day + i + 7) % 7
|
|
47
46
|
}))
|
|
48
47
|
});
|
|
49
48
|
return e.toUpperCase().includes("WKST=") ? a : a.replace(";WKST=SU", "");
|
|
50
|
-
},
|
|
49
|
+
}, rt = /* @__PURE__ */ le({
|
|
51
50
|
name: "KendoScheduler",
|
|
52
51
|
emits: ["datechange", "viewchange", "datachange", "itemclick", "itemdoubleclick", "slotclick", "slotdoubleclick", "taskclick", "taskdoubleclick"],
|
|
53
52
|
props: {
|
|
@@ -117,7 +116,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
117
116
|
timeHeaderCell: [String, Function, Object],
|
|
118
117
|
adaptive: {
|
|
119
118
|
type: Boolean,
|
|
120
|
-
default: !
|
|
119
|
+
default: !0
|
|
121
120
|
}
|
|
122
121
|
},
|
|
123
122
|
computed: {
|
|
@@ -143,7 +142,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
143
142
|
}
|
|
144
143
|
},
|
|
145
144
|
mounted() {
|
|
146
|
-
this.currentRtl = fe(this.$el), this.calculateMedia(), this.$props.adaptive &&
|
|
145
|
+
this.currentRtl = fe(this.$el), this.calculateMedia(), this.$props.adaptive && R && window.ResizeObserver && (this.resizeObserver = new window.ResizeObserver(this.calculateMedia), this.resizeObserver.observe(this.$el)), R && window.ResizeObserver && (this.toolbarObserver = new window.ResizeObserver(this.measureToolbar), this.toolbarElement && (this.toolbarObserver.observe(this.toolbarElement), this.measureToolbar()));
|
|
147
146
|
},
|
|
148
147
|
unmounted() {
|
|
149
148
|
this.resizeObserver && this.resizeObserver.disconnect(), this.toolbarObserver && this.toolbarObserver.disconnect();
|
|
@@ -173,13 +172,13 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
173
172
|
}
|
|
174
173
|
},
|
|
175
174
|
data() {
|
|
176
|
-
const e = L(this),
|
|
175
|
+
const e = L(this), s = this.$props.date || this.$props.defaultDate, i = this.$props.view || this.$props.defaultView || this.views[0] && this.views[0].name || "day", t = this.views.find((c) => c.name === i) || this.views[0] || d(y, null, null), a = this.getViewPropValue(t, "selectedDateFormat", i) || J, o = this.getViewPropValue(t, "selectedShortDateFormat", i) || Q, n = this.getViewComponentByName(i).props.dateRange.default()({
|
|
177
176
|
intl: e,
|
|
178
|
-
date:
|
|
177
|
+
date: s,
|
|
179
178
|
timezone: this.$props.timezone,
|
|
180
|
-
numberOfDays: this.getViewPropValue(t, "numberOfDays",
|
|
181
|
-
workWeekStart: this.getViewPropValue(t, "workWeekStart",
|
|
182
|
-
workWeekEnd: this.getViewPropValue(t, "workWeekEnd",
|
|
179
|
+
numberOfDays: this.getViewPropValue(t, "numberOfDays", i),
|
|
180
|
+
workWeekStart: this.getViewPropValue(t, "workWeekStart", i) || e.firstDay(),
|
|
181
|
+
workWeekEnd: this.getViewPropValue(t, "workWeekEnd", i) || (e.firstDay() + this.getViewPropValue(t, "numberOfDays", i)) % 6
|
|
183
182
|
});
|
|
184
183
|
return {
|
|
185
184
|
media: "desktop",
|
|
@@ -187,8 +186,8 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
187
186
|
toolbarBreakpoints: [1 / 0, 1 / 0, 1 / 0],
|
|
188
187
|
newEventDialogItem: null,
|
|
189
188
|
ks: {
|
|
190
|
-
activeViewName:
|
|
191
|
-
currentDate:
|
|
189
|
+
activeViewName: i,
|
|
190
|
+
currentDate: s,
|
|
192
191
|
showWorkHours: t.showWorkHours !== void 0 ? t.showWorkHours : !0,
|
|
193
192
|
timezone: this.$props.timezone,
|
|
194
193
|
props: {
|
|
@@ -226,9 +225,9 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
226
225
|
},
|
|
227
226
|
render() {
|
|
228
227
|
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),
|
|
228
|
+
const e = this.views.find((oe) => oe.name === this.ks.activeViewName) || this.views[0] || d(y, null, null), s = this.getViewPropValue(this.ks.view, "slotDuration", this.ks.activeViewName), i = 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 || xe, 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
229
|
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 =
|
|
230
|
+
const g = Ne(e.editable !== void 0 ? e.editable : this.$props.editable), S = this.getViewComponentByName(this.ks.activeViewName || e.name), E = {
|
|
232
231
|
...this.$props,
|
|
233
232
|
...this.ks.view,
|
|
234
233
|
showWorkHours: this.ks.showWorkHours,
|
|
@@ -245,18 +244,14 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
245
244
|
timeHeaderCell: u,
|
|
246
245
|
resizeHint: m,
|
|
247
246
|
editable: g
|
|
248
|
-
}, b =
|
|
249
|
-
isRtl: this.isRtl,
|
|
250
|
-
onPrevclick: this.handlePrevClick,
|
|
251
|
-
onNextclick: this.handleNextClick
|
|
252
|
-
}, null) : d(we, {
|
|
247
|
+
}, b = ke(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, se = d(we, {
|
|
253
248
|
ref: this.setToolbarRef,
|
|
254
249
|
ariaLabel: F
|
|
255
250
|
}, {
|
|
256
251
|
default: () => [this.canAdd && d(V, {
|
|
257
252
|
class: "k-toolbar-button",
|
|
258
253
|
themeColor: "primary",
|
|
259
|
-
svgIcon:
|
|
254
|
+
svgIcon: Re,
|
|
260
255
|
"aria-label": te,
|
|
261
256
|
tabIndex: -1,
|
|
262
257
|
onClick: this.handleNewEventClick
|
|
@@ -270,7 +265,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
270
265
|
onClick: this.handleTodayClick
|
|
271
266
|
}, Z(D) ? D : {
|
|
272
267
|
default: () => [D]
|
|
273
|
-
}), I < 3 && d(
|
|
268
|
+
}), I < 3 && d(ve, {
|
|
274
269
|
class: "k-button-group-flat k-toolbar-button-group"
|
|
275
270
|
}, {
|
|
276
271
|
default: () => [d(V, {
|
|
@@ -288,19 +283,19 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
288
283
|
title: N,
|
|
289
284
|
onClick: this.handleNextClick
|
|
290
285
|
}, null)]
|
|
291
|
-
}), d(
|
|
286
|
+
}), d(De, {
|
|
292
287
|
value: this.ks.currentDate,
|
|
293
288
|
onChange: this.handleDatePickerChange,
|
|
294
289
|
level: I
|
|
295
290
|
}, null), d(z, null, null), I === 1 && d("span", {
|
|
296
291
|
class: "k-separator"
|
|
297
|
-
}, null), d(
|
|
292
|
+
}, null), d(Se, {
|
|
298
293
|
level: I
|
|
299
294
|
}, null)]
|
|
300
|
-
}),
|
|
301
|
-
h:
|
|
302
|
-
template:
|
|
303
|
-
defaultRendering:
|
|
295
|
+
}), ie = W.call(this, {
|
|
296
|
+
h: $,
|
|
297
|
+
template: i,
|
|
298
|
+
defaultRendering: se,
|
|
304
299
|
additionalProps: {
|
|
305
300
|
currentDate: this.ks.currentDate
|
|
306
301
|
},
|
|
@@ -310,7 +305,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
310
305
|
todayclick: this.handleTodayClick,
|
|
311
306
|
datepickerchange: this.handleDatePickerChange
|
|
312
307
|
}
|
|
313
|
-
}), re = d(
|
|
308
|
+
}), re = d(be, {
|
|
314
309
|
"aria-label": F
|
|
315
310
|
}, {
|
|
316
311
|
default: () => [this.isMobile && d(V, {
|
|
@@ -319,16 +314,16 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
319
314
|
onClick: this.handleTodayClick
|
|
320
315
|
}, Z(D) ? D : {
|
|
321
316
|
default: () => [D]
|
|
322
|
-
}), this.isMobile && d(z, null, null), d(
|
|
323
|
-
slotDuration:
|
|
317
|
+
}), this.isMobile && d(z, null, null), d(Ie, {
|
|
318
|
+
slotDuration: s,
|
|
324
319
|
onClick: this.handleShowWorkHoursClick
|
|
325
320
|
}, null)]
|
|
326
321
|
}), ae = W.call(this, {
|
|
327
|
-
h:
|
|
322
|
+
h: $,
|
|
328
323
|
template: t,
|
|
329
324
|
defaultRendering: re,
|
|
330
325
|
additionalProps: {
|
|
331
|
-
slotDuration:
|
|
326
|
+
slotDuration: s
|
|
332
327
|
},
|
|
333
328
|
additionalListeners: {
|
|
334
329
|
showworkhoursclick: this.handleShowWorkHoursClick
|
|
@@ -349,7 +344,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
349
344
|
"aria-labelledby": this.$props.ariaLabelledby,
|
|
350
345
|
onFocusin: this.handleFocus,
|
|
351
346
|
onFocusout: this.handleBlur
|
|
352
|
-
}, [
|
|
347
|
+
}, [ie, $(S, {
|
|
353
348
|
key: `${this.ks.view.name}-${this.ks.showWorkHours}`,
|
|
354
349
|
onDataaction: this.handleDataAction,
|
|
355
350
|
...E
|
|
@@ -364,40 +359,40 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
364
359
|
getViewComponentByName(e) {
|
|
365
360
|
switch (e.toLowerCase()) {
|
|
366
361
|
case "week":
|
|
367
|
-
return
|
|
362
|
+
return Ee;
|
|
368
363
|
case "workweek":
|
|
369
|
-
return
|
|
364
|
+
return ye;
|
|
370
365
|
case "agenda":
|
|
371
|
-
return
|
|
366
|
+
return Ce;
|
|
372
367
|
case "timeline":
|
|
373
|
-
return
|
|
368
|
+
return Ve;
|
|
374
369
|
case "month":
|
|
375
370
|
return $e;
|
|
376
371
|
default:
|
|
377
372
|
return y;
|
|
378
373
|
}
|
|
379
374
|
},
|
|
380
|
-
getViewPropValue(e,
|
|
381
|
-
const t = this.getViewComponentByName(
|
|
382
|
-
return e[
|
|
375
|
+
getViewPropValue(e, s, i) {
|
|
376
|
+
const t = this.getViewComponentByName(i).props[s];
|
|
377
|
+
return e[s] || (t ? t.default : void 0);
|
|
383
378
|
},
|
|
384
379
|
handleDataChange({
|
|
385
380
|
created: e = [],
|
|
386
|
-
updated:
|
|
387
|
-
deleted:
|
|
381
|
+
updated: s = [],
|
|
382
|
+
deleted: i = []
|
|
388
383
|
}) {
|
|
389
384
|
const t = {
|
|
390
385
|
created: e,
|
|
391
|
-
updated:
|
|
392
|
-
deleted:
|
|
386
|
+
updated: s,
|
|
387
|
+
deleted: i
|
|
393
388
|
};
|
|
394
389
|
this.$emit("datachange", t);
|
|
395
390
|
},
|
|
396
391
|
handleNewEventClick(e) {
|
|
397
392
|
e.preventDefault();
|
|
398
|
-
const
|
|
399
|
-
let n = new Date(
|
|
400
|
-
n.setHours(
|
|
393
|
+
const s = /* @__PURE__ */ new Date(), i = this.getViewPropValue(this.ks.view, "slotDuration", this.ks.activeViewName) || 30, t = i * 60 * 1e3, a = s.getMinutes(), o = Math.ceil(a / i) * i;
|
|
394
|
+
let n = new Date(s);
|
|
395
|
+
n.setHours(s.getHours() + Math.floor(o / 60), o % 60, 0, 0);
|
|
401
396
|
const c = this.$props.dataItems || [], h = this.fields, p = (m, g) => c.some((S) => {
|
|
402
397
|
const E = r(S, h.start), b = r(S, h.end);
|
|
403
398
|
return !E || !b ? !1 : E.getTime() < g.getTime() && b.getTime() > m.getTime();
|
|
@@ -417,13 +412,13 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
417
412
|
this.newEventDialogItem = null;
|
|
418
413
|
},
|
|
419
414
|
handleCreate(e) {
|
|
420
|
-
const
|
|
415
|
+
const s = [e.dataItem];
|
|
421
416
|
this.handleDataChange({
|
|
422
|
-
created:
|
|
417
|
+
created: s
|
|
423
418
|
});
|
|
424
419
|
},
|
|
425
420
|
handleUpdate(e) {
|
|
426
|
-
const
|
|
421
|
+
const s = [], i = [];
|
|
427
422
|
if (e.series)
|
|
428
423
|
if (Array.isArray(e.dataItem)) {
|
|
429
424
|
const t = e.dataItem[0];
|
|
@@ -435,7 +430,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
435
430
|
const g = m.map((S) => new Date(new Date(S).getTime() + p));
|
|
436
431
|
l(o, this.fields.recurrenceExceptions, g);
|
|
437
432
|
}
|
|
438
|
-
l(o, this.fields.recurrenceRule, X(r(o, this.fields.recurrenceRule), p)),
|
|
433
|
+
l(o, this.fields.recurrenceRule, X(r(o, this.fields.recurrenceRule), p)), i.push(o);
|
|
439
434
|
} else
|
|
440
435
|
e.dataItem.forEach((o) => {
|
|
441
436
|
const n = w(v(o, this.fields, this.dataItems)), c = w(o);
|
|
@@ -446,7 +441,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
446
441
|
l(c, this.fields.recurrenceExceptions, m);
|
|
447
442
|
} else
|
|
448
443
|
l(c, this.fields.recurrenceExceptions, h);
|
|
449
|
-
|
|
444
|
+
i.push(c);
|
|
450
445
|
});
|
|
451
446
|
} else if (r(e.dataItem, this.fields.recurrenceId) !== null && r(e.dataItem, this.fields.recurrenceId) !== void 0) {
|
|
452
447
|
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();
|
|
@@ -456,7 +451,7 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
456
451
|
const m = u.map((g) => new Date(new Date(g).getTime() + h));
|
|
457
452
|
l(a, this.fields.recurrenceExceptions, m);
|
|
458
453
|
}
|
|
459
|
-
l(a, this.fields.recurrenceRule, X(r(a, this.fields.recurrenceRule), h)),
|
|
454
|
+
l(a, this.fields.recurrenceRule, X(r(a, this.fields.recurrenceRule), h)), i.push(a);
|
|
460
455
|
} else {
|
|
461
456
|
const a = w(e.dataItem);
|
|
462
457
|
if (r(a, this.fields.recurrenceRule)) {
|
|
@@ -470,44 +465,44 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
470
465
|
l(a, this.fields.recurrenceExceptions, c);
|
|
471
466
|
} else
|
|
472
467
|
l(a, this.fields.recurrenceExceptions, null);
|
|
473
|
-
|
|
468
|
+
i.push(a);
|
|
474
469
|
}
|
|
475
470
|
else if (Array.isArray(e.dataItem))
|
|
476
471
|
e.dataItem.forEach((t) => {
|
|
477
472
|
const a = r(t, this.fields.recurrenceRule) !== null && r(t, this.fields.recurrenceRule) !== void 0;
|
|
478
473
|
if (r(t, this.fields.recurrenceId) !== null && r(t, this.fields.recurrenceId) !== void 0 && a) {
|
|
479
474
|
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),
|
|
475
|
+
l(n, this.fields.recurrenceExceptions, [...h, c]), l(t, this.fields.recurrenceRule, null), i.push(n), s.push(t);
|
|
481
476
|
} else
|
|
482
|
-
|
|
477
|
+
i.push(t);
|
|
483
478
|
});
|
|
484
479
|
else {
|
|
485
480
|
const t = r(e.dataItem, this.fields.recurrenceRule) !== null && r(e.dataItem, this.fields.recurrenceRule) !== void 0;
|
|
486
481
|
if (r(e.dataItem, this.fields.recurrenceId) !== null && r(e.dataItem, this.fields.recurrenceId) !== void 0 && t) {
|
|
487
482
|
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),
|
|
483
|
+
l(o, this.fields.recurrenceExceptions, [...c, n]), l(e.dataItem, this.fields.recurrenceRule, null), i.push(o), s.push(e.dataItem);
|
|
489
484
|
} else
|
|
490
|
-
|
|
485
|
+
i.push(e.dataItem);
|
|
491
486
|
}
|
|
492
487
|
this.handleDataChange({
|
|
493
|
-
updated:
|
|
494
|
-
created:
|
|
488
|
+
updated: i,
|
|
489
|
+
created: s
|
|
495
490
|
});
|
|
496
491
|
},
|
|
497
492
|
handleRemove(e) {
|
|
498
|
-
const
|
|
493
|
+
const s = [], i = [];
|
|
499
494
|
if (e.series) {
|
|
500
495
|
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)),
|
|
496
|
+
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)), i.push(a);
|
|
502
497
|
} else if (!(r(e.dataItem, this.fields.recurrenceRule) !== null && r(e.dataItem, this.fields.recurrenceRule) !== void 0))
|
|
503
|
-
|
|
498
|
+
i.push(e.dataItem);
|
|
504
499
|
else {
|
|
505
500
|
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),
|
|
501
|
+
l(a, this.fields.recurrenceExceptions, [...n, o]), l(e.dataItem, this.fields.recurrenceRule, null), s.push(a);
|
|
507
502
|
}
|
|
508
503
|
this.handleDataChange({
|
|
509
|
-
updated:
|
|
510
|
-
deleted:
|
|
504
|
+
updated: s,
|
|
505
|
+
deleted: i
|
|
511
506
|
});
|
|
512
507
|
},
|
|
513
508
|
handleDataAction(e) {
|
|
@@ -523,20 +518,20 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
523
518
|
break;
|
|
524
519
|
}
|
|
525
520
|
},
|
|
526
|
-
handleActiveViewNameChange(e,
|
|
521
|
+
handleActiveViewNameChange(e, s) {
|
|
527
522
|
this.$props.view === void 0 && this.updatePassedState(e), this.$emit("viewchange", {
|
|
528
523
|
viewName: e,
|
|
529
|
-
...
|
|
524
|
+
...s,
|
|
530
525
|
target: this.ks.scheduler.$el
|
|
531
526
|
});
|
|
532
527
|
},
|
|
533
528
|
setToolbarRef(e) {
|
|
534
|
-
const
|
|
535
|
-
|
|
529
|
+
const s = (e == null ? void 0 : e.$el) || null;
|
|
530
|
+
s !== this.toolbarElement && (this.toolbarObserver && this.toolbarElement && this.toolbarObserver.unobserve(this.toolbarElement), this.toolbarElement = s, this.toolbarObserver && s && this.toolbarObserver.observe(s));
|
|
536
531
|
},
|
|
537
|
-
handleDateChange(e,
|
|
532
|
+
handleDateChange(e, s) {
|
|
538
533
|
this.setDate(e, {
|
|
539
|
-
...
|
|
534
|
+
...s,
|
|
540
535
|
target: this.ks.scheduler.$el
|
|
541
536
|
});
|
|
542
537
|
},
|
|
@@ -549,18 +544,18 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
549
544
|
},
|
|
550
545
|
handleNextClick(e) {
|
|
551
546
|
e.preventDefault();
|
|
552
|
-
const
|
|
547
|
+
const s = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = s > 27 ? H(this.ks.currentDate, Math.round(s / 27)) : A(this.ks.currentDate, s);
|
|
553
548
|
this.setDate(t, e);
|
|
554
549
|
},
|
|
555
550
|
handlePrevClick(e) {
|
|
556
551
|
e.preventDefault();
|
|
557
|
-
const
|
|
552
|
+
const s = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = s > 27 ? H(this.ks.currentDate, -Math.round(s / 27)) : A(this.ks.currentDate, -s);
|
|
558
553
|
this.setDate(t, e);
|
|
559
554
|
},
|
|
560
555
|
handleTodayClick(e) {
|
|
561
556
|
e.preventDefault();
|
|
562
|
-
const
|
|
563
|
-
this.setDate(new Date(
|
|
557
|
+
const s = ge.fromLocalDate(/* @__PURE__ */ new Date(), this.ks.timezone);
|
|
558
|
+
this.setDate(new Date(s.getTime()), e);
|
|
564
559
|
},
|
|
565
560
|
handleShowWorkHoursClick() {
|
|
566
561
|
this.ks.showWorkHours = !this.ks.showWorkHours;
|
|
@@ -589,42 +584,42 @@ const J = "{0:D}", Q = "{0:d}", X = (e, i) => {
|
|
|
589
584
|
handleTaskDoubleClick(e) {
|
|
590
585
|
this.$emit("taskdoubleclick", e);
|
|
591
586
|
},
|
|
592
|
-
setDate(e,
|
|
587
|
+
setDate(e, s) {
|
|
593
588
|
this.$props.date === void 0 && (this.ks.currentDate = e, this.updatePassedState()), this.$emit("datechange", {
|
|
594
589
|
date: e,
|
|
595
|
-
event:
|
|
590
|
+
event: s
|
|
596
591
|
});
|
|
597
592
|
},
|
|
598
593
|
updatePassedState(e) {
|
|
599
|
-
const
|
|
600
|
-
this.ks.activeViewName =
|
|
601
|
-
intl:
|
|
594
|
+
const s = L(this), i = e || this.ks.activeViewName;
|
|
595
|
+
this.ks.activeViewName = i, this.ks.view = this.views.find((t) => t.name === i) || this.views[0] || d(y, null, null), this.ks.dateFormat = this.getViewPropValue(this.ks.view, "selectedDateFormat", i) || J, this.ks.shortDateFormat = this.getViewPropValue(this.ks.view, "selectedShortDateFormat", i) || Q, this.ks.dateRange = this.getViewComponentByName(i).props.dateRange.default()({
|
|
596
|
+
intl: s,
|
|
602
597
|
date: this.ks.currentDate,
|
|
603
598
|
timezone: this.$props.timezone,
|
|
604
599
|
numberOfDays: this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName),
|
|
605
|
-
workWeekStart: this.getViewPropValue(this.ks.view, "workWeekStart", this.ks.activeViewName) ||
|
|
606
|
-
workWeekEnd: this.getViewPropValue(this.ks.view, "workWeekEnd", this.ks.activeViewName) || (
|
|
600
|
+
workWeekStart: this.getViewPropValue(this.ks.view, "workWeekStart", this.ks.activeViewName) || s.firstDay(),
|
|
601
|
+
workWeekEnd: this.getViewPropValue(this.ks.view, "workWeekEnd", this.ks.activeViewName) || (s.firstDay() + this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName)) % 6
|
|
607
602
|
});
|
|
608
603
|
},
|
|
609
604
|
calculateMedia() {
|
|
610
|
-
|
|
605
|
+
R && window.matchMedia && (this.media = window.matchMedia("(min-width: 1024px)").matches ? "desktop" : "mobile");
|
|
611
606
|
},
|
|
612
607
|
measureToolbar() {
|
|
613
|
-
const
|
|
614
|
-
if (!i)
|
|
615
|
-
return;
|
|
616
|
-
const s = i.clientWidth;
|
|
608
|
+
const s = this.toolbarElement;
|
|
617
609
|
if (!s)
|
|
618
610
|
return;
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
|
|
611
|
+
const i = s.clientWidth;
|
|
612
|
+
if (!i)
|
|
613
|
+
return;
|
|
614
|
+
const t = parseInt(window.getComputedStyle(s).gap || "0", 10), a = Array.from(s.children), o = a.reduce((c, h) => c + h.offsetWidth, 0) + (a.length - 1) * t, n = this.toolbarLevel;
|
|
615
|
+
if (o > i && n < 3) {
|
|
616
|
+
this.toolbarBreakpoints[n] = i, this.toolbarLevel = n + 1;
|
|
622
617
|
return;
|
|
623
618
|
}
|
|
624
|
-
n > 0 &&
|
|
619
|
+
n > 0 && i > this.toolbarBreakpoints[n - 1] + 20 && (this.toolbarLevel = n - 1);
|
|
625
620
|
}
|
|
626
621
|
}
|
|
627
622
|
});
|
|
628
623
|
export {
|
|
629
|
-
|
|
624
|
+
rt as Scheduler
|
|
630
625
|
};
|