@progress/kendo-react-scheduler 14.1.2-develop.1 → 14.2.0-develop.1

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/utils/index.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"});require("@progress/kendo-date-math");const f=require("../views/common/utils.js"),T=require("@progress/kendo-react-common"),I=require("@progress/kendo-data-query"),F=e=>e[0],D=e=>e[e.length-1],S=e=>{const r=new Set;return e.forEach(o=>{r.add(o.field)}),r.size===e.length};function A(e,r,o,n){const t={skeleton:"yMMMMEEEEdhm"},s={skeleton:"yMMMMEEEEd"};return n?`${e.formatDate(r,s)}`:`${e.formatDate(r,t)}–${e.formatDate(o,"t")}`}const E=(e,r,o,n=0)=>{if(n===o)return null;let t=null;const s=document.elementFromPoint(e,r);if(!s)return t;if(s.getAttribute("data-slot")==="true")return s;const d=s.style.pointerEvents;return s.style.pointerEvents="none",t=E(e,r,o,n+1),s.style.pointerEvents=d,t},l=(e,r)=>T.getter(r)(e),R=(e,r,o)=>{if(r)return T.setter(r)(e,o)},v=e=>e!=null;function H(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const N=(e,r,o)=>{const n=h(e,r)?l(e,r.id):l(e,r.recurrenceId);return o.find(t=>l(t,r.id)===n)},h=(e,r)=>{const o=l(e,r.id),n=l(e,r.recurrenceId),t=l(e,r.recurrenceRule);return!!(o&&t&&n==null)},m=(e,r)=>Math.max(e.getTime(),r.getTime()),M=(e,r)=>Math.min(e.getTime(),r.getTime()),p=(e,r,o,n,t=!1)=>t?m(r,n)-M(e,o)<=r.getTime()-e.getTime()+(n.getTime()-o.getTime()):m(r,n)-M(e,o)<r.getTime()-e.getTime()+(n.getTime()-o.getTime()),y={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},O=e=>({fields:{...y,...e}}),P=(e,r,o)=>(r.getHours()<e.getHours()||r.getHours()===e.getHours()&&r.getMinutes()<=e.getMinutes())&&(e.getHours()<o.getHours()||o.getHours()===e.getHours()&&e.getMinutes()<o.getMinutes()),k=(e,r,o)=>r<o?r<=e&&e<=o:e<=o||r<=e,G=(e,r)=>{const o=f.toGroupResources(e,r),n=f.toFlatGroupResources(o);return n.length===1?[{index:0,resources:(r||[]).reduce((t,s)=>[...t,...s.data.map(i=>({...i,field:s.field,valueField:s.valueField,colorField:s.colorField,multiple:s.multiple}))],[])}]:n.map((t,s)=>({index:s,resources:t}))},x=e=>e==null,_=e=>x(e)||e.trim&&e.trim().length===0,a=e=>{let r=0;const o=e.slice();return o.sort((n,t)=>n-t).forEach((n,t)=>{o[t]===t&&(r=t+1)}),r},b=(e,r,o,n=!1)=>{let t;return o.forEach(s=>{const i=[];r.sort((u,c)=>u.props.start.getTime()-c.props.start.getTime()).forEach(u=>{if((n||u.props.isAllDay===s.current.props.isAllDay)&&u.props.range.index===s.current.props.range.index&&u.props.group.index===s.current.props.group.index&&p(u.props.start,u.props.end,s.current.props.start,s.current.props.end)){const g=a(i);u===e&&t===void 0&&(t=g),i.splice(g,0,g)}})}),t},z=(e,r)=>{const o=new Set;return r.forEach(t=>{t._order!==void 0&&t._order!==null&&o.add(t._order)}),a(Array.from(o))},q=(e,r,o=!1)=>{r.forEach(n=>n.items.splice(0,n.items.length)),r.forEach(n=>{const t=[];e.forEach(s=>{if((o||s.isAllDay===n.isAllDay)&&s.range.index===n.range.index&&s.group.index===n.group.index&&p(s.start,s.end,n.start,n.end)){const d=a(t);(s.order===null||s.order===void 0||s.order<d)&&(s.order=d),t.splice(s.order,0,s.order),n.items.push(s)}})})},B=(e,r,o=!1)=>{e.forEach(n=>n.slots.splice(0,n.slots.length)),e.forEach(n=>{r.forEach(t=>{(o||n.isAllDay===t.isAllDay)&&n.range.index===t.range.index&&n.group.index===t.group.index&&p(n.start,n.end,t.start,t.end)&&n.slots.push(t)})})},C=(...e)=>{},w=e=>{const r=e.props.items.find(o=>o.order===0)||e.props.items[0];return r&&r._ref.current},U=(e,r,o=!1,n=!1)=>{const t=e.current;if(!t||!r)return null;const s=r.filter(c=>c.current!==null&&c.current.element!==null),i=I.orderBy(s,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},o?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),d=i.findIndex(c=>c.current!==null&&!!(c.current.props.uid===t.props.uid&&(c.current.props.occurrenceId===void 0||c.current.props.occurrenceId===t.props.occurrenceId)&&c.current.props.group.index===t.props.group.index&&c.current.props.range.index===t.props.range.index&&(o||c.current.props.isAllDay===t.props.isAllDay)));return i[d+(n?-1:1)]},$=(e,r)=>(e.order||0)-(r.order||0);exports.calculateOrder=b;exports.calculateProportionalOrder=z;exports.defaultModelFields=y;exports.findFirstItem=w;exports.findMaster=N;exports.findMissing=a;exports.findNextItem=U;exports.first=F;exports.formatEventTime=A;exports.getField=l;exports.getModelFields=O;exports.intersects=p;exports.isBlank=x;exports.isGroupped=S;exports.isInDaysRange=k;exports.isInTimeRange=P;exports.isMaster=h;exports.isNullOrEmptyString=_;exports.isPresent=v;exports.last=D;exports.mapItemsToSlots=B;exports.mapSlotsToItems=q;exports.noop=C;exports.orderSort=$;exports.setField=R;exports.slotDive=E;exports.toSchedulerGroups=G;exports.toUTCDateTime=H;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@progress/kendo-date-math");const f=require("../views/common/utils.js"),D=require("@progress/kendo-react-common"),I=require("@progress/kendo-data-query"),x=e=>e[0],F=e=>e[e.length-1],A=e=>{const r=new Set;return e.forEach(n=>{r.add(n.field)}),r.size===e.length};function S(e,r,n,o,t="all day"){const s={skeleton:"yMMMMEEEEdhm"},i={skeleton:"yMMMMEEEEd"},l="t",u=r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()&&r.getDate()===n.getDate();if(o){const c=n.getHours()===0&&n.getMinutes()===0&&n.getSeconds()===0&&n.getTime()-r.getTime()===864e5;return u||c?`${e.formatDate(r,i)} (${t})`:`${e.formatDate(r,i)} to ${e.formatDate(n,i)} (${t})`}return u?`${e.formatDate(r,s)}–${e.formatDate(n,l)}`:`${e.formatDate(r,s)}-${e.formatDate(n,s)}`}const M=(e,r,n,o=0)=>{if(o===n)return null;let t=null;const s=document.elementFromPoint(e,r);if(!s)return t;if(s.getAttribute("data-slot")==="true")return s;const l=s.style.pointerEvents;return s.style.pointerEvents="none",t=M(e,r,n,o+1),s.style.pointerEvents=l,t},d=(e,r)=>D.getter(r)(e),v=(e,r,n)=>{if(r)return D.setter(r)(e,n)},R=e=>e!=null;function H(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const $=(e,r,n)=>{const o=h(e,r)?d(e,r.id):d(e,r.recurrenceId);return n.find(t=>d(t,r.id)===o)},h=(e,r)=>{const n=d(e,r.id),o=d(e,r.recurrenceId),t=d(e,r.recurrenceRule);return!!(n&&t&&o==null)},m=(e,r)=>Math.max(e.getTime(),r.getTime()),y=(e,r)=>Math.min(e.getTime(),r.getTime()),p=(e,r,n,o,t=!1)=>t?m(r,o)-y(e,n)<=r.getTime()-e.getTime()+(o.getTime()-n.getTime()):m(r,o)-y(e,n)<r.getTime()-e.getTime()+(o.getTime()-n.getTime()),T={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},N=e=>({fields:{...T,...e}}),O=(e,r,n)=>(r.getHours()<e.getHours()||r.getHours()===e.getHours()&&r.getMinutes()<=e.getMinutes())&&(e.getHours()<n.getHours()||n.getHours()===e.getHours()&&e.getMinutes()<n.getMinutes()),P=(e,r,n)=>r<n?r<=e&&e<=n:e<=n||r<=e,k=(e,r)=>{const n=f.toGroupResources(e,r),o=f.toFlatGroupResources(n);return o.length===1?[{index:0,resources:(r||[]).reduce((t,s)=>[...t,...s.data.map(i=>({...i,field:s.field,valueField:s.valueField,colorField:s.colorField,multiple:s.multiple}))],[])}]:o.map((t,s)=>({index:s,resources:t}))},E=e=>e==null,G=e=>E(e)||e.trim&&e.trim().length===0,g=e=>{let r=0;const n=e.slice();return n.sort((o,t)=>o-t).forEach((o,t)=>{n[t]===t&&(r=t+1)}),r},_=(e,r,n,o=!1)=>{let t;return n.forEach(s=>{const i=[];r.sort((u,c)=>u.props.start.getTime()-c.props.start.getTime()).forEach(u=>{if((o||u.props.isAllDay===s.current.props.isAllDay)&&u.props.range.index===s.current.props.range.index&&u.props.group.index===s.current.props.group.index&&p(u.props.start,u.props.end,s.current.props.start,s.current.props.end)){const a=g(i);u===e&&t===void 0&&(t=a),i.splice(a,0,a)}})}),t},b=(e,r)=>{const n=new Set;return r.forEach(t=>{t._order!==void 0&&t._order!==null&&n.add(t._order)}),g(Array.from(n))},z=(e,r,n=!1)=>{e.forEach(t=>{t.order=null}),r.forEach(t=>t.items.splice(0,t.items.length));const o=[...e].sort((t,s)=>t.start.getTime()-s.start.getTime());r.forEach(t=>{const s=[];o.forEach(i=>{if((n||i.isAllDay===t.isAllDay)&&i.range.index===t.range.index&&(i.range.isAllDay===void 0||t.range.isAllDay===void 0||i.range.isAllDay===t.range.isAllDay)&&i.group.index===t.group.index&&p(i.start,i.end,t.start,t.end)){if(i.order!==null&&i.order!==void 0)s.includes(i.order)||(s.push(i.order),s.sort((u,c)=>u-c));else{const u=g(s);i.order=u,s.push(u),s.sort((c,a)=>c-a)}t.items.push(i)}})})},q=(e,r,n=!1)=>{e.forEach(o=>o.slots.splice(0,o.slots.length)),e.forEach(o=>{r.forEach(t=>{(n||o.isAllDay===t.isAllDay)&&o.range.index===t.range.index&&(o.range.isAllDay===void 0||t.range.isAllDay===void 0||o.range.isAllDay===t.range.isAllDay)&&o.group.index===t.group.index&&p(o.start,o.end,t.start,t.end)&&o.slots.push(t)})})},B=(...e)=>{},C=e=>{const r=e.props.items.find(n=>n.order===0)||e.props.items[0];return r&&r._ref.current},w=(e,r,n=!1,o=!1)=>{const t=e.current;if(!t||!r)return null;const s=r.filter(c=>c.current!==null&&c.current.element!==null),i=I.orderBy(s,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},n?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),l=i.findIndex(c=>c.current!==null&&!!(c.current.props.uid===t.props.uid&&(c.current.props.occurrenceId===void 0||c.current.props.occurrenceId===t.props.occurrenceId)&&c.current.props.group.index===t.props.group.index&&c.current.props.range.index===t.props.range.index&&(n||c.current.props.isAllDay===t.props.isAllDay)));return i[l+(o?-1:1)]},U=(e,r)=>(e.order||0)-(r.order||0);exports.calculateOrder=_;exports.calculateProportionalOrder=b;exports.defaultModelFields=T;exports.findFirstItem=C;exports.findMaster=$;exports.findMissing=g;exports.findNextItem=w;exports.first=x;exports.formatEventTime=S;exports.getField=d;exports.getModelFields=N;exports.intersects=p;exports.isBlank=E;exports.isGroupped=A;exports.isInDaysRange=P;exports.isInTimeRange=O;exports.isMaster=h;exports.isNullOrEmptyString=G;exports.isPresent=R;exports.last=F;exports.mapItemsToSlots=q;exports.mapSlotsToItems=z;exports.noop=B;exports.orderSort=U;exports.setField=v;exports.slotDive=M;exports.toSchedulerGroups=k;exports.toUTCDateTime=H;
package/utils/index.mjs CHANGED
@@ -6,21 +6,25 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import "@progress/kendo-date-math";
9
- import { toGroupResources as h, toFlatGroupResources as E } from "../views/common/utils.mjs";
10
- import { setter as x, getter as M } from "@progress/kendo-react-common";
11
- import { orderBy as T } from "@progress/kendo-data-query";
12
- const v = (r) => r[0], _ = (r) => r[r.length - 1], z = (r) => {
9
+ import { toGroupResources as h, toFlatGroupResources as D } from "../views/common/utils.mjs";
10
+ import { setter as y, getter as M } from "@progress/kendo-react-common";
11
+ import { orderBy as E } from "@progress/kendo-data-query";
12
+ const R = (r) => r[0], $ = (r) => r[r.length - 1], N = (r) => {
13
13
  const e = /* @__PURE__ */ new Set();
14
- return r.forEach((o) => {
15
- e.add(o.field);
14
+ return r.forEach((n) => {
15
+ e.add(n.field);
16
16
  }), e.size === r.length;
17
17
  };
18
- function N(r, e, o, n) {
19
- const t = { skeleton: "yMMMMEEEEdhm" }, s = { skeleton: "yMMMMEEEEd" };
20
- return n ? `${r.formatDate(e, s)}` : `${r.formatDate(e, t)}–${r.formatDate(o, "t")}`;
18
+ function _(r, e, n, o, t = "all day") {
19
+ const s = { skeleton: "yMMMMEEEEdhm" }, c = { skeleton: "yMMMMEEEEd" }, d = "t", i = e.getFullYear() === n.getFullYear() && e.getMonth() === n.getMonth() && e.getDate() === n.getDate();
20
+ if (o) {
21
+ const u = n.getHours() === 0 && n.getMinutes() === 0 && n.getSeconds() === 0 && n.getTime() - e.getTime() === 864e5;
22
+ return i || u ? `${r.formatDate(e, c)} (${t})` : `${r.formatDate(e, c)} to ${r.formatDate(n, c)} (${t})`;
23
+ }
24
+ return i ? `${r.formatDate(e, s)}–${r.formatDate(n, d)}` : `${r.formatDate(e, s)}-${r.formatDate(n, s)}`;
21
25
  }
22
- const y = (r, e, o, n = 0) => {
23
- if (n === o)
26
+ const T = (r, e, n, o = 0) => {
27
+ if (o === n)
24
28
  return null;
25
29
  let t = null;
26
30
  const s = document.elementFromPoint(r, e);
@@ -29,12 +33,12 @@ const y = (r, e, o, n = 0) => {
29
33
  if (s.getAttribute("data-slot") === "true")
30
34
  return s;
31
35
  const d = s.style.pointerEvents;
32
- return s.style.pointerEvents = "none", t = y(r, e, o, n + 1), s.style.pointerEvents = d, t;
33
- }, p = (r, e) => M(e)(r), G = (r, e, o) => {
36
+ return s.style.pointerEvents = "none", t = T(r, e, n, o + 1), s.style.pointerEvents = d, t;
37
+ }, l = (r, e) => M(e)(r), z = (r, e, n) => {
34
38
  if (e)
35
- return x(e)(r, o);
36
- }, P = (r) => r != null;
37
- function b(r) {
39
+ return y(e)(r, n);
40
+ }, G = (r) => r != null;
41
+ function P(r) {
38
42
  return new Date(
39
43
  Date.UTC(
40
44
  r.getFullYear(),
@@ -47,13 +51,13 @@ function b(r) {
47
51
  )
48
52
  );
49
53
  }
50
- const k = (r, e, o) => {
51
- const n = F(r, e) ? p(r, e.id) : p(r, e.recurrenceId);
52
- return o.find((t) => p(t, e.id) === n);
53
- }, F = (r, e) => {
54
- const o = p(r, e.id), n = p(r, e.recurrenceId), t = p(r, e.recurrenceRule);
55
- return !!(o && t && n == null);
56
- }, f = (r, e) => Math.max(r.getTime(), e.getTime()), m = (r, e) => Math.min(r.getTime(), e.getTime()), a = (r, e, o, n, t = !1) => t ? f(e, n) - m(r, o) <= e.getTime() - r.getTime() + (n.getTime() - o.getTime()) : f(e, n) - m(r, o) < e.getTime() - r.getTime() + (n.getTime() - o.getTime()), I = {
54
+ const b = (r, e, n) => {
55
+ const o = x(r, e) ? l(r, e.id) : l(r, e.recurrenceId);
56
+ return n.find((t) => l(t, e.id) === o);
57
+ }, x = (r, e) => {
58
+ const n = l(r, e.id), o = l(r, e.recurrenceId), t = l(r, e.recurrenceRule);
59
+ return !!(n && t && o == null);
60
+ }, f = (r, e) => Math.max(r.getTime(), e.getTime()), m = (r, e) => Math.min(r.getTime(), e.getTime()), p = (r, e, n, o, t = !1) => t ? f(e, o) - m(r, n) <= e.getTime() - r.getTime() + (o.getTime() - n.getTime()) : f(e, o) - m(r, n) < e.getTime() - r.getTime() + (o.getTime() - n.getTime()), A = {
57
61
  id: "id",
58
62
  start: "start",
59
63
  startTimezone: "startTimezone",
@@ -66,17 +70,17 @@ const k = (r, e, o) => {
66
70
  recurrenceRule: "recurrenceRule",
67
71
  recurrenceId: "recurrenceId",
68
72
  recurrenceExceptions: "recurrenceExceptions"
69
- }, w = (r) => ({ fields: { ...I, ...r } }), B = (r, e, o) => (e.getHours() < r.getHours() || e.getHours() === r.getHours() && e.getMinutes() <= r.getMinutes()) && (r.getHours() < o.getHours() || o.getHours() === r.getHours() && r.getMinutes() < o.getMinutes()), O = (r, e, o) => e < o ? e <= r && r <= o : r <= o || e <= r, $ = (r, e) => {
70
- const o = h(r, e), n = E(o);
71
- return n.length === 1 ? [
73
+ }, k = (r) => ({ fields: { ...A, ...r } }), w = (r, e, n) => (e.getHours() < r.getHours() || e.getHours() === r.getHours() && e.getMinutes() <= r.getMinutes()) && (r.getHours() < n.getHours() || n.getHours() === r.getHours() && r.getMinutes() < n.getMinutes()), B = (r, e, n) => e < n ? e <= r && r <= n : r <= n || e <= r, O = (r, e) => {
74
+ const n = h(r, e), o = D(n);
75
+ return o.length === 1 ? [
72
76
  {
73
77
  index: 0,
74
78
  // resources: []
75
79
  resources: (e || []).reduce(
76
80
  (t, s) => [
77
81
  ...t,
78
- ...s.data.map((u) => ({
79
- ...u,
82
+ ...s.data.map((c) => ({
83
+ ...c,
80
84
  field: s.field,
81
85
  valueField: s.valueField,
82
86
  colorField: s.colorField,
@@ -86,93 +90,106 @@ const k = (r, e, o) => {
86
90
  []
87
91
  )
88
92
  }
89
- ] : n.map((t, s) => ({
93
+ ] : o.map((t, s) => ({
90
94
  index: s,
91
95
  resources: t
92
96
  }));
93
- }, D = (r) => r == null, C = (r) => D(r) || r.trim && r.trim().length === 0, g = (r) => {
97
+ }, F = (r) => r == null, Y = (r) => F(r) || r.trim && r.trim().length === 0, g = (r) => {
94
98
  let e = 0;
95
- const o = r.slice();
96
- return o.sort((n, t) => n - t).forEach((n, t) => {
97
- o[t] === t && (e = t + 1);
99
+ const n = r.slice();
100
+ return n.sort((o, t) => o - t).forEach((o, t) => {
101
+ n[t] === t && (e = t + 1);
98
102
  }), e;
99
- }, U = (r, e, o, n = !1) => {
103
+ }, C = (r, e, n, o = !1) => {
100
104
  let t;
101
- return o.forEach((s) => {
102
- const u = [];
103
- e.sort((i, c) => i.props.start.getTime() - c.props.start.getTime()).forEach((i) => {
104
- if ((n || i.props.isAllDay === s.current.props.isAllDay) && i.props.range.index === s.current.props.range.index && i.props.group.index === s.current.props.group.index && a(i.props.start, i.props.end, s.current.props.start, s.current.props.end)) {
105
- const l = g(u);
106
- i === r && t === void 0 && (t = l), u.splice(l, 0, l);
105
+ return n.forEach((s) => {
106
+ const c = [];
107
+ e.sort((i, u) => i.props.start.getTime() - u.props.start.getTime()).forEach((i) => {
108
+ if ((o || i.props.isAllDay === s.current.props.isAllDay) && i.props.range.index === s.current.props.range.index && i.props.group.index === s.current.props.group.index && p(i.props.start, i.props.end, s.current.props.start, s.current.props.end)) {
109
+ const a = g(c);
110
+ i === r && t === void 0 && (t = a), c.splice(a, 0, a);
107
111
  }
108
112
  });
109
113
  }), t;
110
- }, Y = (r, e) => {
111
- const o = /* @__PURE__ */ new Set();
114
+ }, U = (r, e) => {
115
+ const n = /* @__PURE__ */ new Set();
112
116
  return e.forEach((t) => {
113
- t._order !== void 0 && t._order !== null && o.add(t._order);
114
- }), g(Array.from(o));
115
- }, j = (r, e, o = !1) => {
116
- e.forEach((n) => n.items.splice(0, n.items.length)), e.forEach((n) => {
117
- const t = [];
118
- r.forEach((s) => {
119
- if ((o || s.isAllDay === n.isAllDay) && s.range.index === n.range.index && s.group.index === n.group.index && a(s.start, s.end, n.start, n.end)) {
120
- const d = g(t);
121
- (s.order === null || s.order === void 0 || s.order < d) && (s.order = d), t.splice(s.order, 0, s.order), n.items.push(s);
117
+ t._order !== void 0 && t._order !== null && n.add(t._order);
118
+ }), g(Array.from(n));
119
+ }, j = (r, e, n = !1) => {
120
+ r.forEach((t) => {
121
+ t.order = null;
122
+ }), e.forEach((t) => t.items.splice(0, t.items.length));
123
+ const o = [...r].sort((t, s) => t.start.getTime() - s.start.getTime());
124
+ e.forEach((t) => {
125
+ const s = [];
126
+ o.forEach((c) => {
127
+ if ((n || c.isAllDay === t.isAllDay) && c.range.index === t.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
128
+ // so we need to also check range.isAllDay to distinguish between them.
129
+ (c.range.isAllDay === void 0 || t.range.isAllDay === void 0 || c.range.isAllDay === t.range.isAllDay) && c.group.index === t.group.index && p(c.start, c.end, t.start, t.end)) {
130
+ if (c.order !== null && c.order !== void 0)
131
+ s.includes(c.order) || (s.push(c.order), s.sort((i, u) => i - u));
132
+ else {
133
+ const i = g(s);
134
+ c.order = i, s.push(i), s.sort((u, a) => u - a);
135
+ }
136
+ t.items.push(c);
122
137
  }
123
138
  });
124
139
  });
125
- }, q = (r, e, o = !1) => {
126
- r.forEach((n) => n.slots.splice(0, n.slots.length)), r.forEach((n) => {
140
+ }, q = (r, e, n = !1) => {
141
+ r.forEach((o) => o.slots.splice(0, o.slots.length)), r.forEach((o) => {
127
142
  e.forEach((t) => {
128
- (o || n.isAllDay === t.isAllDay) && n.range.index === t.range.index && n.group.index === t.group.index && a(n.start, n.end, t.start, t.end) && n.slots.push(t);
143
+ (n || o.isAllDay === t.isAllDay) && o.range.index === t.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
144
+ // so we need to also check range.isAllDay to distinguish between them.
145
+ (o.range.isAllDay === void 0 || t.range.isAllDay === void 0 || o.range.isAllDay === t.range.isAllDay) && o.group.index === t.group.index && p(o.start, o.end, t.start, t.end) && o.slots.push(t);
129
146
  });
130
147
  });
131
148
  }, J = (...r) => {
132
149
  }, K = (r) => {
133
- const e = r.props.items.find((o) => o.order === 0) || r.props.items[0];
150
+ const e = r.props.items.find((n) => n.order === 0) || r.props.items[0];
134
151
  return e && e._ref.current;
135
- }, L = (r, e, o = !1, n = !1) => {
152
+ }, L = (r, e, n = !1, o = !1) => {
136
153
  const t = r.current;
137
154
  if (!t || !e)
138
155
  return null;
139
- const s = e.filter((c) => c.current !== null && c.current.element !== null), u = T(s, [
156
+ const s = e.filter((u) => u.current !== null && u.current.element !== null), c = E(s, [
140
157
  { field: "current.props.group.index", dir: "asc" },
141
158
  { field: "current.props.range.index", dir: "asc" },
142
- o ? { field: "" } : { field: "current.props.isAllDay", dir: "desc" },
159
+ n ? { field: "" } : { field: "current.props.isAllDay", dir: "desc" },
143
160
  { field: "current.props.start", dir: "asc" }
144
- ]), d = u.findIndex(
145
- (c) => c.current !== null && !!(c.current.props.uid === t.props.uid && (c.current.props.occurrenceId === void 0 || c.current.props.occurrenceId === t.props.occurrenceId) && c.current.props.group.index === t.props.group.index && c.current.props.range.index === t.props.range.index && (o || c.current.props.isAllDay === t.props.isAllDay))
161
+ ]), d = c.findIndex(
162
+ (u) => u.current !== null && !!(u.current.props.uid === t.props.uid && (u.current.props.occurrenceId === void 0 || u.current.props.occurrenceId === t.props.occurrenceId) && u.current.props.group.index === t.props.group.index && u.current.props.range.index === t.props.range.index && (n || u.current.props.isAllDay === t.props.isAllDay))
146
163
  );
147
- return u[d + (n ? -1 : 1)];
164
+ return c[d + (o ? -1 : 1)];
148
165
  }, Q = (r, e) => (r.order || 0) - (e.order || 0);
149
166
  export {
150
- U as calculateOrder,
151
- Y as calculateProportionalOrder,
152
- I as defaultModelFields,
167
+ C as calculateOrder,
168
+ U as calculateProportionalOrder,
169
+ A as defaultModelFields,
153
170
  K as findFirstItem,
154
- k as findMaster,
171
+ b as findMaster,
155
172
  g as findMissing,
156
173
  L as findNextItem,
157
- v as first,
158
- N as formatEventTime,
159
- p as getField,
160
- w as getModelFields,
161
- a as intersects,
162
- D as isBlank,
163
- z as isGroupped,
164
- O as isInDaysRange,
165
- B as isInTimeRange,
166
- F as isMaster,
167
- C as isNullOrEmptyString,
168
- P as isPresent,
169
- _ as last,
174
+ R as first,
175
+ _ as formatEventTime,
176
+ l as getField,
177
+ k as getModelFields,
178
+ p as intersects,
179
+ F as isBlank,
180
+ N as isGroupped,
181
+ B as isInDaysRange,
182
+ w as isInTimeRange,
183
+ x as isMaster,
184
+ Y as isNullOrEmptyString,
185
+ G as isPresent,
186
+ $ as last,
170
187
  q as mapItemsToSlots,
171
188
  j as mapSlotsToItems,
172
189
  J as noop,
173
190
  Q as orderSort,
174
- G as setField,
175
- y as slotDive,
176
- $ as toSchedulerGroups,
177
- b as toUTCDateTime
191
+ z as setField,
192
+ T as slotDive,
193
+ O as toSchedulerGroups,
194
+ P as toUTCDateTime
178
195
  };