@progress/kendo-react-scheduler 17.1.0-develop.6 → 17.1.0-develop.7

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.mjs CHANGED
@@ -7,438 +7,454 @@
7
7
  */
8
8
  import * as a from "react";
9
9
  import u from "prop-types";
10
- import { getModelFields as at, toSchedulerGroups as ot, getField as n, findMaster as N, setField as d } from "./utils/index.mjs";
11
- import { validatePackage as st, getLicenseMessage as ct, useWebMcpRegister as lt, useRtl as it, clone as b, classNames as ut, WatermarkOverlay as dt } from "@progress/kendo-react-common";
12
- import { SchedulerContext as mt } from "./context/SchedulerContext.mjs";
13
- import { useControlledState as J } from "./hooks/useControlledState.mjs";
14
- import { useInternationalization as ft, useLocalization as gt } from "@progress/kendo-react-intl";
15
- import { SchedulerHeader as pt } from "./components/header/SchedulerHeader.mjs";
16
- import { SchedulerNavigation as wt } from "./components/header/navigation/SchedulerNavigation.mjs";
17
- import { SchedulerViewSelector as ht } from "./components/header/view-selector/SchedulerViewSelector.mjs";
18
- import { addMonths as pe, addDays as we, ZonedDate as Dt } from "@progress/kendo-date-math";
19
- import { SchedulerFooter as bt } from "./components/footer/SchedulerFooter.mjs";
20
- import { Button as U, ButtonGroup as Et, ToolbarSpacer as It } from "@progress/kendo-react-buttons";
21
- import { useToolbarResponsive as vt } from "./hooks/useToolbarResponsive.mjs";
22
- import { today as he, messages as P, previousTitle as De, nextTitle as be, editorNewEvent as Ee, toolbarLabel as Ie, showFullDay as ve, showWorkDay as ke } from "./messages/index.mjs";
23
- import { NavigationDatePicker as kt } from "./components/header/navigation/NavigationDatePicker.mjs";
24
- import { ViewSelectorList as St } from "./components/header/view-selector/ViewSelectorList.mjs";
25
- import { SchedulerForm as xt } from "./components/SchedulerForm.mjs";
26
- import { DayView as X, dayViewDefaultProps as Ct } from "./views/day/DayView.mjs";
27
- import { packageMetadata as Se } from "./package-metadata.mjs";
28
- import { plusIcon as Tt, chevronRightIcon as xe, chevronLeftIcon as Ce, clockIcon as yt } from "@progress/kendo-svg-icons";
29
- import { DATA_ACTION as Q } from "./constants/index.mjs";
30
- import { AgendaView as Rt, agendaViewDefaultProps as Mt } from "./views/agenda/AgendaView.mjs";
31
- import { MonthView as Ft, monthViewDefaultProps as Nt } from "./views/month/MonthView.mjs";
32
- import { WeekView as Ot, weekViewDefaultProps as Vt } from "./views/week/WeekView.mjs";
33
- import { WorkWeekView as At, workWeekDefaultProps as Lt } from "./views/week/WorkWeekView.mjs";
34
- import { TimelineView as Wt, timeLineViewDefaultProps as Pt } from "./views/time/TimelineView.mjs";
35
- const Ht = "{0:D}", zt = "{0:d}", _t = "application", Te = (r, y, R) => r.filter((B) => {
36
- const V = n(B, y.recurrenceId);
37
- return V != null && V === R && !n(B, y.recurrenceRule);
38
- }), ye = (r, y) => {
39
- const R = b(r);
40
- return d(R, y.recurrenceId, null), d(R, y.recurrenceRule, null), d(R, y.originalStart, null), R;
41
- }, O = /* @__PURE__ */ new Map();
42
- O.set(Rt, Mt);
43
- O.set(X, Ct);
44
- O.set(Ft, Nt);
45
- O.set(Ot, Vt);
46
- O.set(At, Lt);
47
- O.set(Wt, Pt);
48
- const Re = a.forwardRef((r, y) => {
49
- var de, me, fe, ge;
50
- const R = !st(Se, { component: "Scheduler" }), B = ct(Se), { timezone: V, onDataChange: j } = r, v = a.useRef(null), C = a.useRef(null);
51
- a.useImperativeHandle(C, () => ({ props: r, element: v.current })), a.useImperativeHandle(y, () => C.current), lt("scheduler", C, r, r.webMcp);
52
- const H = it(v), K = ft(), L = gt(), { fields: e } = a.useMemo(() => at(r.modelFields), [r.modelFields]), [T, k] = J(
53
- r.defaultDate || x.defaultDate,
54
- r.date,
55
- r.onDateChange
56
- ), z = a.Children.toArray(r.children || []).map(
10
+ import { getModelFields as ot, toSchedulerGroups as ct, getField as r, findMaster as O, setField as d } from "./utils/index.mjs";
11
+ import { validatePackage as st, getLicenseMessage as lt, useWebMcpRegister as it, useRtl as ut, clone as v, classNames as dt, WatermarkOverlay as mt } from "@progress/kendo-react-common";
12
+ import { SchedulerContext as ft } from "./context/SchedulerContext.mjs";
13
+ import { useControlledState as X } from "./hooks/useControlledState.mjs";
14
+ import { useInternationalization as gt, useLocalization as pt } from "@progress/kendo-react-intl";
15
+ import { SchedulerHeader as wt } from "./components/header/SchedulerHeader.mjs";
16
+ import { SchedulerNavigation as ht } from "./components/header/navigation/SchedulerNavigation.mjs";
17
+ import { SchedulerViewSelector as Dt } from "./components/header/view-selector/SchedulerViewSelector.mjs";
18
+ import { addMonths as he, addDays as De, ZonedDate as bt } from "@progress/kendo-date-math";
19
+ import { SchedulerFooter as Et } from "./components/footer/SchedulerFooter.mjs";
20
+ import { Button as B, ButtonGroup as vt, ToolbarSpacer as It } from "@progress/kendo-react-buttons";
21
+ import { useToolbarResponsive as kt } from "./hooks/useToolbarResponsive.mjs";
22
+ import { today as be, messages as H, previousTitle as Ee, nextTitle as ve, editorNewEvent as Ie, toolbarLabel as ke, showFullDay as Se, showWorkDay as xe } from "./messages/index.mjs";
23
+ import { NavigationDatePicker as St } from "./components/header/navigation/NavigationDatePicker.mjs";
24
+ import { ViewSelectorList as xt } from "./components/header/view-selector/ViewSelectorList.mjs";
25
+ import { SchedulerForm as Rt } from "./components/SchedulerForm.mjs";
26
+ import { DayView as $, dayViewDefaultProps as Ct } from "./views/day/DayView.mjs";
27
+ import { packageMetadata as Re } from "./package-metadata.mjs";
28
+ import { plusIcon as Tt, chevronRightIcon as Ce, chevronLeftIcon as Te, clockIcon as yt } from "@progress/kendo-svg-icons";
29
+ import { DATA_ACTION as Y } from "./constants/index.mjs";
30
+ import { isSameRecurrence as Mt, alignRecurrenceRuleToStart as Ft, remapRecurrenceExceptions as Nt } from "./recurrence/common.mjs";
31
+ import { AgendaView as Ot, agendaViewDefaultProps as Vt } from "./views/agenda/AgendaView.mjs";
32
+ import { MonthView as At, monthViewDefaultProps as Lt } from "./views/month/MonthView.mjs";
33
+ import { WeekView as Wt, weekViewDefaultProps as Pt } from "./views/week/WeekView.mjs";
34
+ import { WorkWeekView as Ht, workWeekDefaultProps as zt } from "./views/week/WorkWeekView.mjs";
35
+ import { TimelineView as _t, timeLineViewDefaultProps as Ut } from "./views/time/TimelineView.mjs";
36
+ const Bt = "{0:D}", qt = "{0:d}", Gt = "application", ye = (n, M, F) => n.filter((q) => {
37
+ const k = r(q, M.recurrenceId);
38
+ return k != null && k === F && !r(q, M.recurrenceRule);
39
+ }), Me = (n, M) => {
40
+ const F = v(n);
41
+ return d(F, M.recurrenceId, null), d(F, M.recurrenceRule, null), d(F, M.originalStart, null), F;
42
+ }, V = /* @__PURE__ */ new Map();
43
+ V.set(Ot, Vt);
44
+ V.set($, Ct);
45
+ V.set(At, Lt);
46
+ V.set(Wt, Pt);
47
+ V.set(Ht, zt);
48
+ V.set(_t, Ut);
49
+ const Fe = a.forwardRef((n, M) => {
50
+ var fe, ge, pe, we;
51
+ const F = !st(Re, { component: "Scheduler" }), q = lt(Re), { timezone: k, onDataChange: Z } = n, x = a.useRef(null), T = a.useRef(null);
52
+ a.useImperativeHandle(T, () => ({ props: n, element: x.current })), a.useImperativeHandle(M, () => T.current), it("scheduler", T, n, n.webMcp);
53
+ const z = ut(x), J = gt(), L = pt(), { fields: e } = a.useMemo(() => ot(n.modelFields), [n.modelFields]), [y, R] = X(
54
+ n.defaultDate || C.defaultDate,
55
+ n.date,
56
+ n.onDateChange
57
+ ), _ = a.Children.toArray(n.children || []).map(
57
58
  (t) => {
58
- var c;
59
- return a.isValidElement(t) ? a.cloneElement(t, { ...O.get(t.type), ...(c = t.props) != null ? c : {} }) : t;
59
+ var i;
60
+ return a.isValidElement(t) ? a.cloneElement(t, { ...V.get(t.type), ...(i = t.props) != null ? i : {} }) : t;
60
61
  }
61
- ), Me = a.cloneElement(/* @__PURE__ */ a.createElement(X, null), O.get(X)), [W, Y] = J(
62
- r.defaultView || z[0] && z[0].props.name || "day",
63
- r.view,
64
- r.onViewChange
65
- ), m = z.find((t) => t.props.name === W) || z[0] || Me, $ = m.props, [_, ee] = J(
66
- (de = $.defaultShowWorkHours) != null ? de : !0,
67
- $.showWorkHours
68
- ), h = ((me = r.data) != null ? me : x.data) || x.data, Fe = ot(r.group, r.resources), Ne = r.group && r.group.orientation ? r.group.orientation : "horizontal", Oe = m.props.selectedDateFormat || Ht, Ve = m.props.selectedShortDateFormat || zt, q = m.props.slotDuration, Ae = m.props.dateRange !== void 0 ? typeof m.props.dateRange == "function" ? m.props.dateRange.call(void 0, {
69
- intl: K,
70
- date: T,
71
- timezone: V,
72
- numberOfDays: m.props.numberOfDays,
73
- workWeekStart: m.props.workWeekStart || K.firstDay(),
74
- workWeekEnd: m.props.workWeekEnd || (K.firstDay() + m.props.numberOfDays) % 6
75
- }) : m.props.dateRange : { start: x.defaultDate, end: x.defaultDate }, M = a.useCallback(
62
+ ), Ne = a.cloneElement(/* @__PURE__ */ a.createElement($, null), V.get($)), [W, ee] = X(
63
+ n.defaultView || _[0] && _[0].props.name || "day",
64
+ n.view,
65
+ n.onViewChange
66
+ ), f = _.find((t) => t.props.name === W) || _[0] || Ne, te = f.props, [U, re] = X(
67
+ (fe = te.defaultShowWorkHours) != null ? fe : !0,
68
+ te.showWorkHours
69
+ ), D = ((ge = n.data) != null ? ge : C.data) || C.data, Oe = ct(n.group, n.resources), Ve = n.group && n.group.orientation ? n.group.orientation : "horizontal", Ae = f.props.selectedDateFormat || Bt, Le = f.props.selectedShortDateFormat || qt, G = f.props.slotDuration, We = f.props.dateRange !== void 0 ? typeof f.props.dateRange == "function" ? f.props.dateRange.call(void 0, {
70
+ intl: J,
71
+ date: y,
72
+ timezone: k,
73
+ numberOfDays: f.props.numberOfDays,
74
+ workWeekStart: f.props.workWeekStart || J.firstDay(),
75
+ workWeekEnd: f.props.workWeekEnd || (J.firstDay() + f.props.numberOfDays) % 6
76
+ }) : f.props.dateRange : { start: C.defaultDate, end: C.defaultDate }, N = a.useCallback(
76
77
  ({
77
78
  created: t = [],
78
- updated: c = [],
79
+ updated: i = [],
79
80
  deleted: g = []
80
81
  }) => {
81
- if (j) {
82
- const w = {
82
+ if (Z) {
83
+ const h = {
83
84
  created: t,
84
- updated: c,
85
+ updated: i,
85
86
  deleted: g
86
87
  };
87
- j.call(void 0, w);
88
+ Z.call(void 0, h);
88
89
  }
89
90
  },
90
- [j]
91
- ), te = a.useCallback(
91
+ [Z]
92
+ ), ne = a.useCallback(
92
93
  (t) => {
93
- const c = [t.dataItem];
94
- M({ created: c });
94
+ const i = [t.dataItem];
95
+ N({ created: i });
95
96
  },
96
- [M]
97
- ), re = a.useCallback(
97
+ [N]
98
+ ), ae = a.useCallback(
98
99
  (t) => {
99
- const c = [], g = [], w = [];
100
+ const i = [], g = [], h = [], p = (o, s, l) => {
101
+ const c = r(o, e.recurrenceRule);
102
+ c && d(
103
+ o,
104
+ e.recurrenceRule,
105
+ Ft(c, s, l, k)
106
+ );
107
+ }, b = (o, s, l, c) => {
108
+ const m = r(o, e.recurrenceRule);
109
+ return m && m !== c ? Nt(
110
+ s,
111
+ m,
112
+ new Date(r(o, e.start)),
113
+ new Date(r(o, e.end)),
114
+ l,
115
+ k
116
+ ) : s.map((w) => new Date(new Date(w).getTime() + l));
117
+ };
100
118
  if (t.series)
101
119
  if (Array.isArray(t.dataItem)) {
102
120
  const o = t.dataItem[0];
103
- if (n(o, e.recurrenceId) !== null && n(o, e.recurrenceId) !== void 0) {
104
- const l = b(N(o, e, h)), i = new Date(n(o, e.originalStart)).getTime(), f = new Date(n(o, e.start)).getTime(), p = new Date(n(o, e.end)).getTime(), D = f - i, S = p - f, E = new Date(n(l, e.start)).getTime();
105
- d(l, e.start, new Date(E + D)), d(l, e.end, new Date(E + D + S));
106
- const I = n(l, e.recurrenceExceptions) || [];
107
- if (I.length > 0 && D !== 0) {
108
- const F = I.map(
109
- (nt) => new Date(new Date(nt).getTime() + D)
110
- );
111
- d(l, e.recurrenceExceptions, F);
112
- }
113
- g.push(l);
121
+ if (r(o, e.recurrenceId) !== null && r(o, e.recurrenceId) !== void 0) {
122
+ const l = v(O(o, e, D)), c = new Date(r(o, e.originalStart)).getTime(), m = new Date(r(o, e.start)).getTime(), w = new Date(r(o, e.end)).getTime(), E = m - c, S = w - m, I = new Date(r(l, e.start)).getTime();
123
+ d(l, e.start, new Date(I + E)), d(l, e.end, new Date(I + E + S));
124
+ const P = r(l, e.recurrenceRule);
125
+ p(l, new Date(c), new Date(m));
126
+ const K = r(l, e.recurrenceExceptions) || [];
127
+ K.length > 0 && E !== 0 && d(
128
+ l,
129
+ e.recurrenceExceptions,
130
+ b(l, K, E, P)
131
+ ), g.push(l);
114
132
  } else
115
133
  t.dataItem.forEach((l) => {
116
- const i = b(N(l, e, h)), f = b(l);
117
- d(f, e.originalStart, n(i, e.originalStart)), d(f, e.recurrenceId, n(i, e.recurrenceId));
118
- const p = n(i, e.recurrenceExceptions) || [], D = new Date(n(i, e.start)).getTime(), E = new Date(n(f, e.start)).getTime() - D;
119
- if (p.length > 0 && E !== 0) {
120
- const I = p.map(
121
- (F) => new Date(new Date(F).getTime() + E)
134
+ const c = v(O(l, e, D)), m = v(l);
135
+ d(m, e.originalStart, r(c, e.originalStart)), d(m, e.recurrenceId, r(c, e.recurrenceId));
136
+ const w = r(c, e.recurrenceExceptions) || [], E = new Date(r(c, e.start)).getTime(), I = new Date(r(m, e.start)).getTime() - E;
137
+ if (w.length > 0 && I !== 0) {
138
+ const P = w.map(
139
+ (K) => new Date(new Date(K).getTime() + I)
122
140
  );
123
- d(f, e.recurrenceExceptions, I);
141
+ d(m, e.recurrenceExceptions, P);
124
142
  } else
125
- d(f, e.recurrenceExceptions, p);
126
- g.push(f);
143
+ d(m, e.recurrenceExceptions, w);
144
+ g.push(m);
127
145
  });
128
- } else if (n(t.dataItem, e.recurrenceId) !== null && n(t.dataItem, e.recurrenceId) !== void 0) {
129
- const s = b(N(t.dataItem, e, h)), l = new Date(n(t.dataItem, e.originalStart)).getTime(), i = new Date(n(t.dataItem, e.start)).getTime(), f = new Date(n(t.dataItem, e.end)).getTime(), p = i - l, D = f - i, S = new Date(n(s, e.start)).getTime();
130
- d(s, e.start, new Date(S + p)), d(s, e.end, new Date(S + p + D));
131
- const E = n(s, e.recurrenceExceptions) || [];
132
- if (E.length > 0 && p !== 0) {
133
- const I = E.map(
134
- (F) => new Date(new Date(F).getTime() + p)
135
- );
136
- d(s, e.recurrenceExceptions, I);
137
- }
138
- g.push(s);
146
+ } else if (r(t.dataItem, e.recurrenceId) !== null && r(t.dataItem, e.recurrenceId) !== void 0) {
147
+ const s = v(O(t.dataItem, e, D)), l = new Date(r(t.dataItem, e.originalStart)).getTime(), c = new Date(r(t.dataItem, e.start)).getTime(), m = new Date(r(t.dataItem, e.end)).getTime(), w = c - l, E = m - c, S = new Date(r(s, e.start)).getTime();
148
+ d(s, e.start, new Date(S + w)), d(s, e.end, new Date(S + w + E));
149
+ const I = r(s, e.recurrenceRule);
150
+ p(s, new Date(l), new Date(c));
151
+ const P = r(s, e.recurrenceExceptions) || [];
152
+ P.length > 0 && w !== 0 && d(
153
+ s,
154
+ e.recurrenceExceptions,
155
+ b(s, P, w, I)
156
+ ), g.push(s);
139
157
  } else {
140
- const s = b(t.dataItem);
141
- if (n(s, e.recurrenceRule)) {
142
- const i = b(N(t.dataItem, e, h));
143
- d(s, e.originalStart, n(i, e.originalStart)), d(s, e.recurrenceId, n(i, e.recurrenceId));
144
- const f = n(i, e.recurrenceExceptions) || [], p = new Date(n(i, e.start)).getTime(), S = new Date(n(s, e.start)).getTime() - p;
145
- if (f.length > 0 && S !== 0) {
146
- const E = f.map(
147
- (I) => new Date(new Date(I).getTime() + S)
148
- );
149
- d(s, e.recurrenceExceptions, E);
150
- } else
151
- d(s, e.recurrenceExceptions, f);
158
+ const s = v(t.dataItem), l = r(s, e.recurrenceRule);
159
+ if (l) {
160
+ const c = v(O(t.dataItem, e, D));
161
+ d(s, e.originalStart, r(c, e.originalStart)), d(s, e.recurrenceId, r(c, e.recurrenceId));
162
+ const m = r(c, e.recurrenceExceptions) || [], w = new Date(r(c, e.start)).getTime(), E = new Date(r(s, e.start)).getTime(), S = E - w, I = l;
163
+ Mt(l, r(c, e.recurrenceRule), k) && p(s, new Date(w), new Date(E)), m.length > 0 && S !== 0 ? d(
164
+ s,
165
+ e.recurrenceExceptions,
166
+ b(s, m, S, I)
167
+ ) : d(s, e.recurrenceExceptions, m);
152
168
  } else if (d(s, e.recurrenceExceptions, null), !t.resetExceptions) {
153
- const i = n(s, e.id);
154
- Te(h, e, i).forEach((f) => {
155
- g.push(ye(f, e));
169
+ const c = r(s, e.id);
170
+ ye(D, e, c).forEach((m) => {
171
+ g.push(Me(m, e));
156
172
  });
157
173
  }
158
174
  g.push(s);
159
175
  }
160
176
  else if (Array.isArray(t.dataItem))
161
177
  t.dataItem.forEach((o) => {
162
- const s = n(o, e.recurrenceRule) !== null && n(o, e.recurrenceRule) !== void 0;
163
- if (n(o, e.recurrenceId) !== null && n(o, e.recurrenceId) !== void 0 && s) {
164
- const i = b(N(o, e, h)), f = n(o, e.originalStart), p = n(i, e.recurrenceExceptions) || [];
165
- d(i, e.recurrenceExceptions, [...p, f]), d(o, e.recurrenceRule, null), g.push(i), c.push(o);
178
+ const s = r(o, e.recurrenceRule) !== null && r(o, e.recurrenceRule) !== void 0;
179
+ if (r(o, e.recurrenceId) !== null && r(o, e.recurrenceId) !== void 0 && s) {
180
+ const c = v(O(o, e, D)), m = r(o, e.originalStart), w = r(c, e.recurrenceExceptions) || [];
181
+ d(c, e.recurrenceExceptions, [...w, m]), d(o, e.recurrenceRule, null), g.push(c), i.push(o);
166
182
  } else
167
183
  g.push(o);
168
184
  });
169
185
  else {
170
- const o = n(t.dataItem, e.recurrenceRule) !== null && n(t.dataItem, e.recurrenceRule) !== void 0;
171
- if (n(t.dataItem, e.recurrenceId) !== null && n(t.dataItem, e.recurrenceId) !== void 0 && o) {
172
- const l = b(N(t.dataItem, e, h)), i = n(t.dataItem, e.originalStart), f = n(l, e.recurrenceExceptions) || [];
173
- d(l, e.recurrenceExceptions, [...f, i]), d(t.dataItem, e.recurrenceRule, null), g.push(l), c.push(t.dataItem);
186
+ const o = r(t.dataItem, e.recurrenceRule) !== null && r(t.dataItem, e.recurrenceRule) !== void 0;
187
+ if (r(t.dataItem, e.recurrenceId) !== null && r(t.dataItem, e.recurrenceId) !== void 0 && o) {
188
+ const l = v(O(t.dataItem, e, D)), c = r(t.dataItem, e.originalStart), m = r(l, e.recurrenceExceptions) || [];
189
+ d(l, e.recurrenceExceptions, [...m, c]), d(t.dataItem, e.recurrenceRule, null), g.push(l), i.push(t.dataItem);
174
190
  } else
175
191
  g.push(t.dataItem);
176
192
  }
177
193
  if (t.series && t.resetExceptions) {
178
- const o = Array.isArray(t.dataItem) ? t.dataItem[0] : t.dataItem, s = o && n(o, e.recurrenceId), l = s != null ? s : o && n(o, e.id);
179
- l != null && (h.forEach((i) => {
180
- const f = n(i, e.recurrenceId), p = n(i, e.recurrenceRule);
181
- f === l && !p && w.push(b(i));
182
- }), g.forEach((i) => {
183
- n(i, e.id) === l && d(i, e.recurrenceExceptions, null);
194
+ const o = Array.isArray(t.dataItem) ? t.dataItem[0] : t.dataItem, s = o && r(o, e.recurrenceId), l = s != null ? s : o && r(o, e.id);
195
+ l != null && (D.forEach((c) => {
196
+ const m = r(c, e.recurrenceId), w = r(c, e.recurrenceRule);
197
+ m === l && !w && h.push(v(c));
198
+ }), g.forEach((c) => {
199
+ r(c, e.id) === l && d(c, e.recurrenceExceptions, null);
184
200
  }));
185
201
  }
186
- M({ updated: g, created: c, deleted: w });
202
+ N({ updated: g, created: i, deleted: h });
187
203
  },
188
- [M, e, h]
189
- ), ne = a.useCallback(
204
+ [N, e, D, k]
205
+ ), oe = a.useCallback(
190
206
  (t) => {
191
- const c = [], g = [];
207
+ const i = [], g = [];
192
208
  if (t.series) {
193
- const w = b(N(t.dataItem, e, h)), o = b(t.dataItem);
194
- d(o, e.originalStart, n(w, e.originalStart)), d(o, e.recurrenceId, n(w, e.recurrenceId)), d(o, e.recurrenceRule, n(w, e.recurrenceRule)), d(o, e.recurrenceExceptions, n(w, e.recurrenceExceptions)), g.push(o);
195
- const s = n(w, e.id), l = Te(h, e, s);
196
- t.resetExceptions ? l.forEach((i) => g.push(b(i))) : l.forEach((i) => c.push(ye(i, e)));
197
- } else if (!(n(t.dataItem, e.recurrenceRule) !== null && n(t.dataItem, e.recurrenceRule) !== void 0))
209
+ const h = v(O(t.dataItem, e, D)), p = v(t.dataItem);
210
+ d(p, e.originalStart, r(h, e.originalStart)), d(p, e.recurrenceId, r(h, e.recurrenceId)), d(p, e.recurrenceRule, r(h, e.recurrenceRule)), d(p, e.recurrenceExceptions, r(h, e.recurrenceExceptions)), g.push(p);
211
+ const b = r(h, e.id), o = ye(D, e, b);
212
+ t.resetExceptions ? o.forEach((s) => g.push(v(s))) : o.forEach((s) => i.push(Me(s, e)));
213
+ } else if (!(r(t.dataItem, e.recurrenceRule) !== null && r(t.dataItem, e.recurrenceRule) !== void 0))
198
214
  g.push(t.dataItem);
199
215
  else {
200
- const o = b(N(t.dataItem, e, h)), s = n(t.dataItem, e.originalStart), l = n(o, e.recurrenceExceptions) || [];
201
- d(o, e.recurrenceExceptions, [...l, s]), d(t.dataItem, e.recurrenceRule, null), c.push(o);
216
+ const p = v(O(t.dataItem, e, D)), b = r(t.dataItem, e.originalStart), o = r(p, e.recurrenceExceptions) || [];
217
+ d(p, e.recurrenceExceptions, [...o, b]), d(t.dataItem, e.recurrenceRule, null), i.push(p);
202
218
  }
203
- M({ updated: c, deleted: g });
219
+ N({ updated: i, deleted: g });
204
220
  },
205
- [M, e, h]
206
- ), ae = a.useCallback(
221
+ [N, e, D]
222
+ ), ce = a.useCallback(
207
223
  (t) => {
208
224
  switch (t.type) {
209
- case Q.create:
210
- te(t);
225
+ case Y.create:
226
+ ne(t);
211
227
  break;
212
- case Q.update:
213
- re(t);
228
+ case Y.update:
229
+ ae(t);
214
230
  break;
215
- case Q.remove:
216
- ne(t);
231
+ case Y.remove:
232
+ oe(t);
217
233
  break;
218
234
  }
219
235
  },
220
- [te, ne, re]
221
- ), Le = a.useCallback(
222
- (t, c) => {
223
- Y(t, {
224
- ...c,
225
- target: C.current
236
+ [ne, oe, ae]
237
+ ), Pe = a.useCallback(
238
+ (t, i) => {
239
+ ee(t, {
240
+ ...i,
241
+ target: T.current
226
242
  });
227
243
  },
228
- [Y, C]
229
- ), We = a.useCallback(
230
- (t, c) => {
231
- k(t, {
232
- ...c,
233
- target: C.current
244
+ [ee, T]
245
+ ), He = a.useCallback(
246
+ (t, i) => {
247
+ R(t, {
248
+ ...i,
249
+ target: T.current
234
250
  });
235
251
  },
236
- [k, C]
237
- ), Pe = a.useCallback(
252
+ [R, T]
253
+ ), ze = a.useCallback(
238
254
  (t) => {
239
- t.value && k(t.value, {
255
+ t.value && R(t.value, {
240
256
  ...t,
241
- target: C.current,
257
+ target: T.current,
242
258
  nativeEvent: t.nativeEvent
243
259
  });
244
260
  },
245
- [k, C]
246
- ), He = a.useCallback(
261
+ [R, T]
262
+ ), _e = a.useCallback(
247
263
  (t) => {
248
- var o, s;
264
+ var p, b;
249
265
  t.preventDefault();
250
- const c = (s = (o = m.props.step) != null ? o : m.props.numberOfDays) != null ? s : 1, w = c > 27 ? pe(T, Math.round(c / 27)) : we(T, c);
251
- k(w, t);
266
+ const i = (b = (p = f.props.step) != null ? p : f.props.numberOfDays) != null ? b : 1, h = i > 27 ? he(y, Math.round(i / 27)) : De(y, i);
267
+ R(h, t);
252
268
  },
253
- [T, k, m.props.numberOfDays, m.props.step]
254
- ), ze = a.useCallback(
269
+ [y, R, f.props.numberOfDays, f.props.step]
270
+ ), Ue = a.useCallback(
255
271
  (t) => {
256
- var o, s;
272
+ var p, b;
257
273
  t.preventDefault();
258
- const c = (s = (o = m.props.step) != null ? o : m.props.numberOfDays) != null ? s : 1, w = c > 27 ? pe(T, -Math.round(c / 27)) : we(T, -c);
259
- k(w, t);
274
+ const i = (b = (p = f.props.step) != null ? p : f.props.numberOfDays) != null ? b : 1, h = i > 27 ? he(y, -Math.round(i / 27)) : De(y, -i);
275
+ R(h, t);
260
276
  },
261
- [T, k, m.props.numberOfDays, m.props.step]
262
- ), _e = a.useCallback(
277
+ [y, R, f.props.numberOfDays, f.props.step]
278
+ ), Be = a.useCallback(
263
279
  (t) => {
264
280
  t.preventDefault();
265
- const c = Dt.fromLocalDate(/* @__PURE__ */ new Date(), V);
266
- k(new Date(c.getTime()), t);
281
+ const i = bt.fromLocalDate(/* @__PURE__ */ new Date(), k);
282
+ R(new Date(i.getTime()), t);
267
283
  },
268
- [k, V]
269
- ), Ue = a.useCallback(() => {
270
- ee(!_);
271
- }, [ee, _]), Be = a.useCallback(() => {
272
- v.current && (v.current.style.boxShadow = "0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)");
273
- }, [v]), qe = a.useCallback(() => {
274
- v.current && (v.current.style.boxShadow = "");
275
- }, [v]), Ge = a.useMemo(
284
+ [R, k]
285
+ ), qe = a.useCallback(() => {
286
+ re(!U);
287
+ }, [re, U]), Ge = a.useCallback(() => {
288
+ x.current && (x.current.style.boxShadow = "0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)");
289
+ }, [x]), je = a.useCallback(() => {
290
+ x.current && (x.current.style.boxShadow = "");
291
+ }, [x]), Ke = a.useMemo(
276
292
  () => {
277
293
  var t;
278
- return { ...r.style, height: (t = r.height) != null ? t : x.height };
294
+ return { ...n.style, height: (t = n.height) != null ? t : C.height };
279
295
  },
280
- [r.height, r.style]
281
- ), je = a.useMemo(
282
- () => ut(
283
- { "k-rtl": r.rtl !== void 0 ? r.rtl : H === "rtl" },
296
+ [n.height, n.style]
297
+ ), Ze = a.useMemo(
298
+ () => dt(
299
+ { "k-rtl": n.rtl !== void 0 ? n.rtl : z === "rtl" },
284
300
  "k-scheduler",
285
- r.className
301
+ n.className
286
302
  ),
287
- [r.className, r.rtl, H]
288
- ), Ke = L.toLanguageString(he, P[he]), oe = L.toLanguageString(De, P[De]), se = L.toLanguageString(be, P[be]), ce = L.toLanguageString(Ee, P[Ee]), le = L.toLanguageString(Ie, P[Ie]), ie = a.useRef(null), A = vt(ie), Ze = m.props.header || r.header || x.header, Je = m.props.footer || r.footer || x.footer, Qe = m.props.form || r.form || xt, [Z, Xe] = a.useState(null), [ue, G] = a.useState(null), Ye = a.useCallback(
303
+ [n.className, n.rtl, z]
304
+ ), Je = L.toLanguageString(be, H[be]), se = L.toLanguageString(Ee, H[Ee]), le = L.toLanguageString(ve, H[ve]), ie = L.toLanguageString(Ie, H[Ie]), ue = L.toLanguageString(ke, H[ke]), de = a.useRef(null), A = kt(de), Qe = f.props.header || n.header || C.header, Xe = f.props.footer || n.footer || C.footer, Ye = f.props.form || n.form || Rt, [Q, $e] = a.useState(null), [me, j] = a.useState(null), et = a.useCallback(
289
305
  (t) => {
290
306
  t.preventDefault();
291
- const c = /* @__PURE__ */ new Date(), g = q || 30, w = g * 60 * 1e3, o = c.getMinutes(), s = Math.ceil(o / g) * g;
292
- let l = new Date(c);
293
- l.setHours(c.getHours() + Math.floor(s / 60), s % 60, 0, 0);
294
- const i = (D, S) => h.some((E) => {
295
- const I = n(E, e.start), F = n(E, e.end);
296
- return !I || !F ? !1 : I.getTime() < S.getTime() && F.getTime() > D.getTime();
307
+ const i = /* @__PURE__ */ new Date(), g = G || 30, h = g * 60 * 1e3, p = i.getMinutes(), b = Math.ceil(p / g) * g;
308
+ let o = new Date(i);
309
+ o.setHours(i.getHours() + Math.floor(b / 60), b % 60, 0, 0);
310
+ const s = (m, w) => D.some((E) => {
311
+ const S = r(E, e.start), I = r(E, e.end);
312
+ return !S || !I ? !1 : S.getTime() < w.getTime() && I.getTime() > m.getTime();
297
313
  });
298
- let f = new Date(l.getTime() + w);
299
- for (let D = 0; D < 48 && i(l, f); D++)
300
- l = new Date(l.getTime() + w), f = new Date(l.getTime() + w);
301
- const p = {};
302
- d(p, e.start, l), d(p, e.end, f), d(p, e.isAllDay, !1), d(p, e.title, ""), d(p, e.description, ""), G(p);
314
+ let l = new Date(o.getTime() + h);
315
+ for (let m = 0; m < 48 && s(o, l); m++)
316
+ o = new Date(o.getTime() + h), l = new Date(o.getTime() + h);
317
+ const c = {};
318
+ d(c, e.start, o), d(c, e.end, l), d(c, e.isAllDay, !1), d(c, e.title, ""), d(c, e.description, ""), j(c);
303
319
  },
304
- [h, e, q]
305
- ), $e = a.useCallback(
320
+ [D, e, G]
321
+ ), tt = a.useCallback(
306
322
  (t) => {
307
- t.value && M({ created: [t.value] }), G(null);
323
+ t.value && N({ created: [t.value] }), j(null);
308
324
  },
309
- [M]
310
- ), et = a.useCallback((t) => {
311
- G(null);
312
- }, []), tt = a.useCallback((t) => {
313
- G(null);
314
- }, []), rt = typeof r.editable == "object" ? r.editable.add : !!r.editable;
325
+ [N]
326
+ ), rt = a.useCallback((t) => {
327
+ j(null);
328
+ }, []), nt = a.useCallback((t) => {
329
+ j(null);
330
+ }, []), at = typeof n.editable == "object" ? n.editable.add : !!n.editable;
315
331
  return /* @__PURE__ */ a.createElement(
316
- mt,
332
+ ft,
317
333
  {
318
- element: v,
319
- props: r,
320
- views: z,
334
+ element: x,
335
+ props: n,
336
+ views: _,
321
337
  fields: e,
322
- groups: Fe,
323
- dateRange: Ae,
324
- orientation: Ne,
325
- dateFormat: { dateFormat: Oe, shortDateFormat: Ve },
326
- date: [T, We],
327
- activeView: [W, Le],
328
- selection: [Z, Xe],
329
- data: [h, ae]
338
+ groups: Oe,
339
+ dateRange: We,
340
+ orientation: Ve,
341
+ dateFormat: { dateFormat: Ae, shortDateFormat: Le },
342
+ date: [y, He],
343
+ activeView: [W, Pe],
344
+ selection: [Q, $e],
345
+ data: [D, ce]
330
346
  },
331
347
  /* @__PURE__ */ a.createElement(
332
348
  "div",
333
349
  {
334
- ref: v,
335
- id: r.id,
336
- style: Ge,
337
- className: je,
338
- tabIndex: (fe = r.tabIndex) != null ? fe : x.tabIndex,
339
- dir: H,
340
- role: r.role || _t,
341
- "aria-label": r.ariaLabel,
342
- "aria-labelledby": r.ariaLabelledby,
343
- "aria-activedescendant": Z && Z.props.id || void 0,
344
- onFocus: Be,
345
- onBlur: qe
350
+ ref: x,
351
+ id: n.id,
352
+ style: Ke,
353
+ className: Ze,
354
+ tabIndex: (pe = n.tabIndex) != null ? pe : C.tabIndex,
355
+ dir: z,
356
+ role: n.role || Gt,
357
+ "aria-label": n.ariaLabel,
358
+ "aria-labelledby": n.ariaLabelledby,
359
+ "aria-activedescendant": Q && Q.props.id || void 0,
360
+ onFocus: Ge,
361
+ onBlur: je
346
362
  },
347
363
  /* @__PURE__ */ a.createElement(
348
- Ze,
364
+ Qe,
349
365
  {
350
366
  ref: (t) => {
351
- var c;
352
- ie.current = (c = t == null ? void 0 : t.element) != null ? c : null;
367
+ var i;
368
+ de.current = (i = t == null ? void 0 : t.element) != null ? i : null;
353
369
  },
354
- ariaLabel: le,
370
+ ariaLabel: ue,
355
371
  style: { flexWrap: A < 3 ? "nowrap" : "wrap" }
356
372
  },
357
- rt && /* @__PURE__ */ a.createElement(
358
- U,
373
+ at && /* @__PURE__ */ a.createElement(
374
+ B,
359
375
  {
360
376
  className: "k-toolbar-button",
361
377
  themeColor: "primary",
362
378
  svgIcon: Tt,
363
- "aria-label": ce,
379
+ "aria-label": ie,
364
380
  tabIndex: -1,
365
- onClick: Ye
381
+ onClick: et
366
382
  },
367
- A < 2 && ce
383
+ A < 2 && ie
368
384
  ),
369
- A < 2 && /* @__PURE__ */ a.createElement(U, { className: "k-toolbar-button", fillMode: "flat", tabIndex: -1, onClick: _e }, Ke),
370
- A < 3 && /* @__PURE__ */ a.createElement(Et, { className: "k-button-group-flat k-toolbar-button-group" }, /* @__PURE__ */ a.createElement(
371
- U,
385
+ A < 2 && /* @__PURE__ */ a.createElement(B, { className: "k-toolbar-button", fillMode: "flat", tabIndex: -1, onClick: Be }, Je),
386
+ A < 3 && /* @__PURE__ */ a.createElement(vt, { className: "k-button-group-flat k-toolbar-button-group" }, /* @__PURE__ */ a.createElement(
387
+ B,
372
388
  {
373
389
  fillMode: "flat",
374
390
  tabIndex: -1,
375
- svgIcon: H === "rtl" ? xe : Ce,
376
- "aria-label": oe,
377
- title: oe,
378
- onClick: ze
391
+ svgIcon: z === "rtl" ? Ce : Te,
392
+ "aria-label": se,
393
+ title: se,
394
+ onClick: Ue
379
395
  }
380
396
  ), /* @__PURE__ */ a.createElement(
381
- U,
397
+ B,
382
398
  {
383
399
  fillMode: "flat",
384
400
  tabIndex: -1,
385
- svgIcon: H === "rtl" ? Ce : xe,
386
- "aria-label": se,
387
- title: se,
388
- onClick: He
401
+ svgIcon: z === "rtl" ? Te : Ce,
402
+ "aria-label": le,
403
+ title: le,
404
+ onClick: _e
389
405
  }
390
406
  )),
391
- /* @__PURE__ */ a.createElement(kt, { value: T, onChange: Pe, level: A }),
407
+ /* @__PURE__ */ a.createElement(St, { value: y, onChange: ze, level: A }),
392
408
  /* @__PURE__ */ a.createElement(It, null),
393
409
  A === 1 && /* @__PURE__ */ a.createElement("span", { className: "k-separator" }),
394
- /* @__PURE__ */ a.createElement(St, { level: A })
410
+ /* @__PURE__ */ a.createElement(xt, { level: A })
395
411
  ),
396
- m && /* @__PURE__ */ a.createElement(
397
- m.type,
412
+ f && /* @__PURE__ */ a.createElement(
413
+ f.type,
398
414
  {
399
- editable: (ge = r.editable) != null ? ge : x.editable,
400
- key: m.props.name,
401
- item: r.item,
402
- viewItem: r.viewItem,
403
- editItem: r.editItem,
404
- task: r.task,
405
- viewTask: r.viewTask,
406
- editTask: r.viewTask,
407
- slot: r.slot,
408
- viewSlot: r.viewSlot,
409
- editSlot: r.editSlot,
410
- form: r.form,
411
- onDataAction: ae,
412
- showWorkHours: _,
413
- ...m.props
415
+ editable: (we = n.editable) != null ? we : C.editable,
416
+ key: f.props.name,
417
+ item: n.item,
418
+ viewItem: n.viewItem,
419
+ editItem: n.editItem,
420
+ task: n.task,
421
+ viewTask: n.viewTask,
422
+ editTask: n.viewTask,
423
+ slot: n.slot,
424
+ viewSlot: n.viewSlot,
425
+ editSlot: n.editSlot,
426
+ form: n.form,
427
+ onDataAction: ce,
428
+ showWorkHours: U,
429
+ ...f.props
414
430
  }
415
431
  ),
416
- (m.props.footer || r.footer || W !== "agenda" && W !== "month") && /* @__PURE__ */ a.createElement(Je, { ariaLabel: le }, W !== "agenda" && W !== "month" && q && q < 1440 && /* @__PURE__ */ a.createElement(
417
- U,
432
+ (f.props.footer || n.footer || W !== "agenda" && W !== "month") && /* @__PURE__ */ a.createElement(Xe, { ariaLabel: ue }, W !== "agenda" && W !== "month" && G && G < 1440 && /* @__PURE__ */ a.createElement(
433
+ B,
418
434
  {
419
435
  className: "k-toolbar-button k-scheduler-fullday",
420
436
  tabIndex: -1,
421
- onClick: Ue,
437
+ onClick: qe,
422
438
  svgIcon: yt
423
439
  },
424
440
  L.toLanguageString(
425
- _ ? ve : ke,
426
- P[_ ? ve : ke]
441
+ U ? Se : xe,
442
+ H[U ? Se : xe]
427
443
  )
428
444
  )),
429
- R && /* @__PURE__ */ a.createElement(dt, { message: B }),
430
- ue && /* @__PURE__ */ a.createElement(
431
- Qe,
445
+ F && /* @__PURE__ */ a.createElement(mt, { message: q }),
446
+ me && /* @__PURE__ */ a.createElement(
447
+ Ye,
432
448
  {
433
- dataItem: ue,
434
- onSubmit: $e,
435
- onCancel: et,
436
- onClose: tt
449
+ dataItem: me,
450
+ onSubmit: tt,
451
+ onCancel: rt,
452
+ onClose: nt
437
453
  }
438
454
  )
439
455
  )
440
456
  );
441
- }), x = {
457
+ }), C = {
442
458
  data: [],
443
459
  height: 600,
444
460
  tabIndex: -1,
@@ -446,12 +462,12 @@ const Re = a.forwardRef((r, y) => {
446
462
  quickCreate: !0,
447
463
  eventOverview: !0,
448
464
  defaultDate: /* @__PURE__ */ new Date(),
449
- header: pt,
450
- footer: bt,
451
- navigation: wt,
452
- viewSelector: ht
465
+ header: wt,
466
+ footer: Et,
467
+ navigation: ht,
468
+ viewSelector: Dt
453
469
  };
454
- Re.propTypes = {
470
+ Fe.propTypes = {
455
471
  data: u.array,
456
472
  editable: u.oneOfType([
457
473
  u.bool,
@@ -489,8 +505,8 @@ Re.propTypes = {
489
505
  recurrenceException: u.string
490
506
  })
491
507
  };
492
- Re.displayName = "KendoReactScheduler";
508
+ Fe.displayName = "KendoReactScheduler";
493
509
  export {
494
- Re as Scheduler,
495
- x as schedulerDefaultProps
510
+ Fe as Scheduler,
511
+ C as schedulerDefaultProps
496
512
  };