@progress/kendo-react-scheduler 9.2.0-develop.5 → 9.2.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/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/hooks/useSchedulerItem.js +1 -1
- package/hooks/useSchedulerItem.mjs +31 -19
- package/hooks/useSchedulerSlot.js +1 -1
- package/hooks/useSchedulerSlot.mjs +8 -8
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +29 -30
- package/index.d.mts +10 -2
- package/index.d.ts +10 -2
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +89 -94
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +28 -28
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +98 -92
|
@@ -14,24 +14,24 @@ import { BORDER_WIDTH as f } from "../constants/index.mjs";
|
|
|
14
14
|
import { useInternationalization as ne } from "@progress/kendo-react-intl";
|
|
15
15
|
import { SchedulerItemContent as F } from "./SchedulerItemContent.mjs";
|
|
16
16
|
import { useDir as re, IconWrap as H } from "@progress/kendo-react-common";
|
|
17
|
-
import { caretAltRightIcon as ie, caretAltLeftIcon as
|
|
17
|
+
import { caretAltRightIcon as ie, caretAltLeftIcon as ce, arrowRotateCwIcon as le, arrowsNoRepeatIcon as se } from "@progress/kendo-svg-icons";
|
|
18
18
|
import { useRowSync as oe } from "../hooks/useRowSync.mjs";
|
|
19
19
|
import { useEditable as ae } from "../hooks/useEditable.mjs";
|
|
20
20
|
import { useSchedulerViewItemsContext as ue, useSchedulerViewSlotsContext as me } from "../context/SchedulerViewContext.mjs";
|
|
21
21
|
import { useSchedulerElementContext as de } from "../context/SchedulerContext.mjs";
|
|
22
22
|
const fe = 1, he = n.forwardRef(
|
|
23
23
|
(e, M) => {
|
|
24
|
-
const { item: L, _ref: W, itemRef: $, ...q } = e, S = n.useRef(),
|
|
25
|
-
n.useImperativeHandle(z, () => ({ props: e, element:
|
|
26
|
-
const G = L || ge.item, w = ne(), [K] = ue(), [A] = me(), h = de(), [j, I] = n.useState(!0), [J, Q] = n.useState(!1), D = n.useRef(0), P = re(h), _ = n.useMemo(
|
|
24
|
+
const { item: L, _ref: W, itemRef: $, ...q } = e, S = n.useRef(), c = n.useRef(null), z = n.useRef(null), x = n.useRef(null), B = ae(e.editable);
|
|
25
|
+
n.useImperativeHandle(z, () => ({ props: e, element: c.current && c.current.element })), n.useImperativeHandle(M, () => z.current), n.useImperativeHandle(W, () => c.current), n.useImperativeHandle($, () => c.current);
|
|
26
|
+
const G = L || ge.item, w = ne(), [K] = ue(), [A] = me(), h = de(), [j, I] = n.useState(!0), [J, Q] = n.useState(!1), d = n.useRef(null), D = n.useRef(0), P = re(h), _ = n.useMemo(
|
|
27
27
|
() => e.isAllDay ? w.toString(e.zonedStart, "t") : w.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
|
|
28
28
|
[w, e.isAllDay, e.zonedEnd, e.zonedStart]
|
|
29
29
|
), C = n.useMemo(() => `(${_}): ${e.title}`, [_, e.title]), O = (r, t) => {
|
|
30
|
-
let
|
|
30
|
+
let l = 1;
|
|
31
31
|
return r.forEach((o) => {
|
|
32
32
|
const u = t.filter((m) => g(o.current.props, m.props));
|
|
33
|
-
u.length >
|
|
34
|
-
}),
|
|
33
|
+
u.length > l && (l = u.length);
|
|
34
|
+
}), l;
|
|
35
35
|
}, U = (r, t) => r.map((o) => t.filter((u) => g(o.current.props, u.props))), g = (r, t) => V(r.start, r.end, t.start, t.end) && r.group.index === t.group.index && r.range.index === t.range.index && (e.ignoreIsAllDay || r.isAllDay === t.isAllDay), R = () => {
|
|
36
36
|
const r = (A || []).filter((o) => o.current && g(o.current.props, e));
|
|
37
37
|
if (r.length === 0) {
|
|
@@ -39,52 +39,51 @@ const fe = 1, he = n.forwardRef(
|
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const t = ee(r);
|
|
42
|
-
if (!t.current || !
|
|
42
|
+
if (!t.current || !c.current)
|
|
43
43
|
return;
|
|
44
|
-
const
|
|
45
|
-
N(
|
|
44
|
+
const l = y(t.current.element);
|
|
45
|
+
N(c.current.element, l);
|
|
46
46
|
}, E = () => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = c.current && c.current.element;
|
|
48
48
|
if (!r)
|
|
49
49
|
return;
|
|
50
|
-
const t = (A || []).filter((s) => s.current && g(s.current.props, e)),
|
|
50
|
+
const t = (A || []).filter((s) => s.current && g(s.current.props, e)), l = [], o = [], u = [];
|
|
51
51
|
(K || []).forEach((s) => {
|
|
52
|
-
s.current && (s.current.props.dragHint ? o.push(s.current) : s.current.props.resizeHint ? u.push(s.current) :
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
l.current,
|
|
52
|
+
s.current && (s.current.props.dragHint ? o.push(s.current) : s.current.props.resizeHint ? u.push(s.current) : l.push(s.current));
|
|
53
|
+
}), d.current = e.dragHint || e.resizeHint ? te(
|
|
54
|
+
c.current,
|
|
56
55
|
e.dragHint ? o : u,
|
|
57
56
|
t,
|
|
58
57
|
e.ignoreIsAllDay
|
|
59
58
|
) : e.order || 0;
|
|
60
|
-
let
|
|
61
|
-
const Y = U(t,
|
|
59
|
+
let m = e.dragHint || e.resizeHint ? O(t, e.dragHint ? o : u) : O(t, l);
|
|
60
|
+
const Y = U(t, l);
|
|
62
61
|
let b = 0;
|
|
63
62
|
const i = y(r);
|
|
64
63
|
if (Y.forEach((s) => {
|
|
65
64
|
let v = 0;
|
|
66
65
|
s.forEach((a) => {
|
|
67
|
-
V(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot >
|
|
66
|
+
V(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > m && a.element !== r && (m = a._maxSiblingsPerSlot);
|
|
68
67
|
const T = y(a.element);
|
|
69
|
-
a.props.order !== null && a.props.order <
|
|
68
|
+
a.props.order !== null && a.props.order < d.current && (v = T.top + T.height - i.top - f * d.current + fe);
|
|
70
69
|
}), v > b && (b = v);
|
|
71
70
|
}), t.length === 0) {
|
|
72
71
|
I(!1);
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
74
|
const Z = B.add ? 20 : 0;
|
|
76
|
-
i.width = e.vertical ? i.width /
|
|
75
|
+
i.width = e.vertical ? i.width / m - f - Z / m : i.width * t.length - f, i.height = e.vertical ? i.height * t.length - f : (e.resizeHint || e.dragHint) && m <= 1 ? i.height : e.style && e.style.height ? e.style.height : 25, i.left = e.vertical ? i.left + d.current * i.width + f * d.current : i.left, i.top = e.vertical ? i.top : i.top + b + f * d.current, D.current = m, N(r, i), Q(!0), I(!0);
|
|
77
76
|
}, k = n.useCallback(
|
|
78
77
|
(r) => {
|
|
79
|
-
const t = r && r[0],
|
|
80
|
-
S.current !== void 0 && window.cancelAnimationFrame(S.current),
|
|
78
|
+
const t = r && r[0], l = x.current;
|
|
79
|
+
S.current !== void 0 && window.cancelAnimationFrame(S.current), l && t && (l.width !== t.contentRect.width || l.height !== t.contentRect.height) && (S.current = window.requestAnimationFrame(() => {
|
|
81
80
|
R(), E();
|
|
82
81
|
})), x.current = { width: t.contentRect.width, height: t.contentRect.height };
|
|
83
82
|
},
|
|
84
83
|
[R, E]
|
|
85
84
|
);
|
|
86
85
|
n.useEffect(R), n.useEffect(E);
|
|
87
|
-
const X =
|
|
86
|
+
const X = c.current && c.current.element ? c.current.element.closest(".k-scheduler-layout") : null;
|
|
88
87
|
return oe({
|
|
89
88
|
element: X,
|
|
90
89
|
selector: ".k-resource-row",
|
|
@@ -103,9 +102,10 @@ const fe = 1, he = n.forwardRef(
|
|
|
103
102
|
G,
|
|
104
103
|
{
|
|
105
104
|
...q,
|
|
106
|
-
_ref:
|
|
105
|
+
_ref: c,
|
|
107
106
|
_maxSiblingsPerSlot: D,
|
|
108
|
-
|
|
107
|
+
_order: d,
|
|
108
|
+
itemRef: c,
|
|
109
109
|
style: {
|
|
110
110
|
visibility: J ? void 0 : "hidden",
|
|
111
111
|
display: j ? void 0 : "none",
|
|
@@ -116,9 +116,9 @@ const fe = 1, he = n.forwardRef(
|
|
|
116
116
|
H,
|
|
117
117
|
{
|
|
118
118
|
name: P === "rtl" ? "caret-alt-right" : "caret-alt-left",
|
|
119
|
-
icon: P === "rtl" ? ie :
|
|
119
|
+
icon: P === "rtl" ? ie : ce
|
|
120
120
|
}
|
|
121
|
-
), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrow-rotate-cw", icon:
|
|
121
|
+
), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrow-rotate-cw", icon: le }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrows-no-repeat", icon: se })),
|
|
122
122
|
!e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: C }, !e.isAllDay && /* @__PURE__ */ n.createElement(F, { className: "k-event-time" }, C), /* @__PURE__ */ n.createElement(F, null, e.title))
|
|
123
123
|
);
|
|
124
124
|
}
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-scheduler",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1736851817,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-scheduler",
|
|
3
|
-
"version": "9.2.0-develop.
|
|
3
|
+
"version": "9.2.0-develop.7",
|
|
4
4
|
"description": "React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"@progress/kendo-date-math": "^1.4.1",
|
|
27
27
|
"@progress/kendo-drawing": "^1.21.2",
|
|
28
28
|
"@progress/kendo-licensing": "^1.3.4",
|
|
29
|
-
"@progress/kendo-react-buttons": "9.2.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "9.2.0-develop.
|
|
31
|
-
"@progress/kendo-react-dateinputs": "9.2.0-develop.
|
|
32
|
-
"@progress/kendo-react-dialogs": "9.2.0-develop.
|
|
33
|
-
"@progress/kendo-react-dropdowns": "9.2.0-develop.
|
|
34
|
-
"@progress/kendo-react-form": "9.2.0-develop.
|
|
35
|
-
"@progress/kendo-react-inputs": "9.2.0-develop.
|
|
36
|
-
"@progress/kendo-react-intl": "9.2.0-develop.
|
|
37
|
-
"@progress/kendo-react-popup": "9.2.0-develop.
|
|
29
|
+
"@progress/kendo-react-buttons": "9.2.0-develop.7",
|
|
30
|
+
"@progress/kendo-react-common": "9.2.0-develop.7",
|
|
31
|
+
"@progress/kendo-react-dateinputs": "9.2.0-develop.7",
|
|
32
|
+
"@progress/kendo-react-dialogs": "9.2.0-develop.7",
|
|
33
|
+
"@progress/kendo-react-dropdowns": "9.2.0-develop.7",
|
|
34
|
+
"@progress/kendo-react-form": "9.2.0-develop.7",
|
|
35
|
+
"@progress/kendo-react-inputs": "9.2.0-develop.7",
|
|
36
|
+
"@progress/kendo-react-intl": "9.2.0-develop.7",
|
|
37
|
+
"@progress/kendo-react-popup": "9.2.0-develop.7",
|
|
38
38
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
39
39
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
40
40
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
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 client";"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(
|
|
8
|
+
"use client";"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;
|
package/utils/index.mjs
CHANGED
|
@@ -10,32 +10,32 @@ import "@progress/kendo-date-math";
|
|
|
10
10
|
import { toGroupResources as h, toFlatGroupResources as E } from "../views/common/utils.mjs";
|
|
11
11
|
import { getter as x, setter as M } from "@progress/kendo-react-common";
|
|
12
12
|
import { orderBy as T } from "@progress/kendo-data-query";
|
|
13
|
-
const v = (r) => r[0],
|
|
13
|
+
const v = (r) => r[0], _ = (r) => r[r.length - 1], z = (r) => {
|
|
14
14
|
const e = /* @__PURE__ */ new Set();
|
|
15
|
-
return r.forEach((
|
|
16
|
-
e.add(
|
|
15
|
+
return r.forEach((o) => {
|
|
16
|
+
e.add(o.field);
|
|
17
17
|
}), e.size === r.length;
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
return
|
|
19
|
+
function N(r, e, o, n) {
|
|
20
|
+
const t = { skeleton: "yMMMMEEEEdhm" }, s = { skeleton: "yMMMMEEEEd" };
|
|
21
|
+
return n ? `${r.formatDate(e, s)}` : `${r.formatDate(e, t)}–${r.formatDate(o, "t")}`;
|
|
22
22
|
}
|
|
23
|
-
const y = (r, e,
|
|
24
|
-
if (
|
|
23
|
+
const y = (r, e, o, n = 0) => {
|
|
24
|
+
if (n === o)
|
|
25
25
|
return null;
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
-
return
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
-
const d =
|
|
33
|
-
return
|
|
34
|
-
},
|
|
26
|
+
let t = null;
|
|
27
|
+
const s = document.elementFromPoint(r, e);
|
|
28
|
+
if (!s)
|
|
29
|
+
return t;
|
|
30
|
+
if (s.getAttribute("data-slot") === "true")
|
|
31
|
+
return s;
|
|
32
|
+
const d = s.style.pointerEvents;
|
|
33
|
+
return s.style.pointerEvents = "none", t = y(r, e, o, n + 1), s.style.pointerEvents = d, t;
|
|
34
|
+
}, l = (r, e) => x(e)(r), G = (r, e, o) => {
|
|
35
35
|
if (e)
|
|
36
|
-
return M(e)(r,
|
|
37
|
-
},
|
|
38
|
-
function
|
|
36
|
+
return M(e)(r, o);
|
|
37
|
+
}, P = (r) => r != null;
|
|
38
|
+
function b(r) {
|
|
39
39
|
return new Date(
|
|
40
40
|
Date.UTC(
|
|
41
41
|
r.getFullYear(),
|
|
@@ -48,13 +48,13 @@ function B(r) {
|
|
|
48
48
|
)
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
return
|
|
51
|
+
const k = (r, e, o) => {
|
|
52
|
+
const n = F(r, e) ? l(r, e.id) : l(r, e.recurrenceId);
|
|
53
|
+
return o.find((t) => l(t, e.id) === n);
|
|
54
54
|
}, F = (r, e) => {
|
|
55
|
-
const
|
|
56
|
-
return !!(
|
|
57
|
-
},
|
|
55
|
+
const o = l(r, e.id), n = l(r, e.recurrenceId), t = l(r, e.recurrenceRule);
|
|
56
|
+
return !!(o && t && n == null);
|
|
57
|
+
}, 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 = {
|
|
58
58
|
id: "id",
|
|
59
59
|
start: "start",
|
|
60
60
|
startTimezone: "startTimezone",
|
|
@@ -67,107 +67,113 @@ const P = (r, e, s) => {
|
|
|
67
67
|
recurrenceRule: "recurrenceRule",
|
|
68
68
|
recurrenceId: "recurrenceId",
|
|
69
69
|
recurrenceExceptions: "recurrenceExceptions"
|
|
70
|
-
},
|
|
71
|
-
const
|
|
72
|
-
return
|
|
70
|
+
}, 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) => {
|
|
71
|
+
const o = h(r, e), n = E(o);
|
|
72
|
+
return n.length === 1 ? [
|
|
73
73
|
{
|
|
74
74
|
index: 0,
|
|
75
75
|
// resources: []
|
|
76
76
|
resources: (e || []).reduce(
|
|
77
|
-
(
|
|
78
|
-
...
|
|
79
|
-
...
|
|
77
|
+
(t, s) => [
|
|
78
|
+
...t,
|
|
79
|
+
...s.data.map((u) => ({
|
|
80
80
|
...u,
|
|
81
|
-
field:
|
|
82
|
-
valueField:
|
|
83
|
-
colorField:
|
|
84
|
-
multiple:
|
|
81
|
+
field: s.field,
|
|
82
|
+
valueField: s.valueField,
|
|
83
|
+
colorField: s.colorField,
|
|
84
|
+
multiple: s.multiple
|
|
85
85
|
}))
|
|
86
86
|
],
|
|
87
87
|
[]
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
|
-
] :
|
|
91
|
-
index:
|
|
92
|
-
resources:
|
|
90
|
+
] : n.map((t, s) => ({
|
|
91
|
+
index: s,
|
|
92
|
+
resources: t
|
|
93
93
|
}));
|
|
94
|
-
}, D = (r) => r == null,
|
|
94
|
+
}, D = (r) => r == null, C = (r) => D(r) || r.trim && r.trim().length === 0, g = (r) => {
|
|
95
95
|
let e = 0;
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
|
|
96
|
+
const o = r.slice();
|
|
97
|
+
return o.sort((n, t) => n - t).forEach((n, t) => {
|
|
98
|
+
o[t] === t && (e = t + 1);
|
|
99
99
|
}), e;
|
|
100
|
-
}, U = (r, e,
|
|
101
|
-
let
|
|
102
|
-
return
|
|
100
|
+
}, U = (r, e, o, n = !1) => {
|
|
101
|
+
let t;
|
|
102
|
+
return o.forEach((s) => {
|
|
103
103
|
const u = [];
|
|
104
104
|
e.sort((i, c) => i.props.start.getTime() - c.props.start.getTime()).forEach((i) => {
|
|
105
|
-
if ((
|
|
106
|
-
const
|
|
107
|
-
i === r &&
|
|
105
|
+
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)) {
|
|
106
|
+
const p = g(u);
|
|
107
|
+
i === r && t === void 0 && (t = p), u.splice(p, 0, p);
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
}),
|
|
111
|
-
}, Y = (r, e
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
}), t;
|
|
111
|
+
}, Y = (r, e) => {
|
|
112
|
+
const o = /* @__PURE__ */ new Set();
|
|
113
|
+
return e.forEach((t) => {
|
|
114
|
+
t._order !== void 0 && t._order !== null && o.add(t._order);
|
|
115
|
+
}), g(Array.from(o));
|
|
116
|
+
}, j = (r, e, o = !1) => {
|
|
117
|
+
e.forEach((n) => n.items.splice(0, n.items.length)), e.forEach((n) => {
|
|
118
|
+
const t = [];
|
|
119
|
+
r.forEach((s) => {
|
|
120
|
+
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)) {
|
|
121
|
+
const d = g(t);
|
|
122
|
+
(s.order === null || s.order === void 0 || s.order < d) && (s.order = d), t.splice(s.order, 0, s.order), n.items.push(s);
|
|
118
123
|
}
|
|
119
124
|
});
|
|
120
125
|
});
|
|
121
|
-
},
|
|
122
|
-
r.forEach((
|
|
123
|
-
e.forEach((
|
|
124
|
-
(
|
|
126
|
+
}, q = (r, e, o = !1) => {
|
|
127
|
+
r.forEach((n) => n.slots.splice(0, n.slots.length)), r.forEach((n) => {
|
|
128
|
+
e.forEach((t) => {
|
|
129
|
+
(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);
|
|
125
130
|
});
|
|
126
131
|
});
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
const e = r.props.items.find((
|
|
132
|
+
}, J = (...r) => {
|
|
133
|
+
}, K = (r) => {
|
|
134
|
+
const e = r.props.items.find((o) => o.order === 0) || r.props.items[0];
|
|
130
135
|
return e && e._ref.current;
|
|
131
|
-
},
|
|
132
|
-
const
|
|
133
|
-
if (!
|
|
136
|
+
}, L = (r, e, o = !1, n = !1) => {
|
|
137
|
+
const t = r.current;
|
|
138
|
+
if (!t || !e)
|
|
134
139
|
return null;
|
|
135
|
-
const
|
|
140
|
+
const s = e.filter((c) => c.current !== null && c.current.element !== null), u = T(s, [
|
|
136
141
|
{ field: "current.props.group.index", dir: "asc" },
|
|
137
142
|
{ field: "current.props.range.index", dir: "asc" },
|
|
138
|
-
|
|
143
|
+
o ? { field: "" } : { field: "current.props.isAllDay", dir: "desc" },
|
|
139
144
|
{ field: "current.props.start", dir: "asc" }
|
|
140
145
|
]), d = u.findIndex(
|
|
141
|
-
(c) => c.current !== null && !!(c.current.props.uid ===
|
|
146
|
+
(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))
|
|
142
147
|
);
|
|
143
|
-
return u[d + (
|
|
144
|
-
},
|
|
148
|
+
return u[d + (n ? -1 : 1)];
|
|
149
|
+
}, Q = (r, e) => (r.order || 0) - (e.order || 0);
|
|
145
150
|
export {
|
|
146
151
|
U as calculateOrder,
|
|
152
|
+
Y as calculateProportionalOrder,
|
|
147
153
|
I as defaultModelFields,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
K as findFirstItem,
|
|
155
|
+
k as findMaster,
|
|
156
|
+
g as findMissing,
|
|
157
|
+
L as findNextItem,
|
|
152
158
|
v as first,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
N as formatEventTime,
|
|
160
|
+
l as getField,
|
|
161
|
+
w as getModelFields,
|
|
156
162
|
a as intersects,
|
|
157
163
|
D as isBlank,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
z as isGroupped,
|
|
165
|
+
O as isInDaysRange,
|
|
166
|
+
B as isInTimeRange,
|
|
161
167
|
F as isMaster,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
C as isNullOrEmptyString,
|
|
169
|
+
P as isPresent,
|
|
170
|
+
_ as last,
|
|
171
|
+
q as mapItemsToSlots,
|
|
172
|
+
j as mapSlotsToItems,
|
|
173
|
+
J as noop,
|
|
174
|
+
Q as orderSort,
|
|
175
|
+
G as setField,
|
|
170
176
|
y as slotDive,
|
|
171
|
-
|
|
172
|
-
|
|
177
|
+
$ as toSchedulerGroups,
|
|
178
|
+
b as toUTCDateTime
|
|
173
179
|
};
|