@progress/kendo-react-scheduler 9.0.0-develop.24 → 9.0.0-develop.26
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.js +1 -1
- package/Scheduler.mjs +91 -91
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +80 -81
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: 1731412687,
|
|
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.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.26",
|
|
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.1",
|
|
28
28
|
"@progress/kendo-licensing": "^1.3.4",
|
|
29
|
-
"@progress/kendo-react-buttons": "9.0.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
31
|
-
"@progress/kendo-react-dateinputs": "9.0.0-develop.
|
|
32
|
-
"@progress/kendo-react-dialogs": "9.0.0-develop.
|
|
33
|
-
"@progress/kendo-react-dropdowns": "9.0.0-develop.
|
|
34
|
-
"@progress/kendo-react-form": "9.0.0-develop.
|
|
35
|
-
"@progress/kendo-react-inputs": "9.0.0-develop.
|
|
36
|
-
"@progress/kendo-react-intl": "9.0.0-develop.
|
|
37
|
-
"@progress/kendo-react-popup": "9.0.0-develop.
|
|
29
|
+
"@progress/kendo-react-buttons": "9.0.0-develop.26",
|
|
30
|
+
"@progress/kendo-react-common": "9.0.0-develop.26",
|
|
31
|
+
"@progress/kendo-react-dateinputs": "9.0.0-develop.26",
|
|
32
|
+
"@progress/kendo-react-dialogs": "9.0.0-develop.26",
|
|
33
|
+
"@progress/kendo-react-dropdowns": "9.0.0-develop.26",
|
|
34
|
+
"@progress/kendo-react-form": "9.0.0-develop.26",
|
|
35
|
+
"@progress/kendo-react-inputs": "9.0.0-develop.26",
|
|
36
|
+
"@progress/kendo-react-intl": "9.0.0-develop.26",
|
|
37
|
+
"@progress/kendo-react-popup": "9.0.0-develop.26",
|
|
38
38
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
39
39
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
40
40
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
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"});
|
|
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(s=>{r.add(s.field)}),r.size===e.length};function R(e,r,s,t){const n={skeleton:"yMMMMEEEEdhm"},o={skeleton:"yMMMMEEEEd"};return t?`${e.formatDate(r,o)}`:`${e.formatDate(r,n)}–${e.formatDate(s,"t")}`}const E=(e,r,s,t=0)=>{if(t===s)return null;let n=null;const o=document.elementFromPoint(e,r);if(!o)return n;if(o.getAttribute("data-slot")==="true")return o;const d=o.style.pointerEvents;return o.style.pointerEvents="none",n=E(e,r,s,t+1),o.style.pointerEvents=d,n},l=(e,r)=>T.getter(r)(e),A=(e,r,s)=>{if(r)return T.setter(r)(e,s)},H=e=>e!=null;function v(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const b=(e,r,s)=>{const t=h(e,r)?l(e,r.id):l(e,r.recurrenceId);return s.find(n=>l(n,r.id)===t)},h=(e,r)=>{const s=l(e,r.id),t=l(e,r.recurrenceId),n=l(e,r.recurrenceRule);return!!(s&&n&&t==null)},m=(e,r)=>Math.max(e.getTime(),r.getTime()),M=(e,r)=>Math.min(e.getTime(),r.getTime()),p=(e,r,s,t,n=!1)=>n?m(r,t)-M(e,s)<=r.getTime()-e.getTime()+(t.getTime()-s.getTime()):m(r,t)-M(e,s)<r.getTime()-e.getTime()+(t.getTime()-s.getTime()),x={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},k=e=>({fields:{...x,...e}}),G=(e,r,s)=>(r.getHours()<e.getHours()||r.getHours()===e.getHours()&&r.getMinutes()<=e.getMinutes())&&(e.getHours()<s.getHours()||s.getHours()===e.getHours()&&e.getMinutes()<s.getMinutes()),N=(e,r,s)=>r<s?r<=e&&e<=s:e<=s||r<=e,z=(e,r)=>{const s=f.toGroupResources(e,r),t=f.toFlatGroupResources(s);return t.length===1?[{index:0,resources:(r||[]).reduce((n,o)=>[...n,...o.data.map(c=>({...c,field:o.field,valueField:o.valueField,colorField:o.colorField,multiple:o.multiple}))],[])}]:t.map((n,o)=>({index:o,resources:n}))},y=e=>e==null,O=e=>y(e)||e.trim&&e.trim().length===0,g=e=>{let r=0;const s=e.slice();return s.sort((t,n)=>t-n).forEach((t,n)=>{s[n]===n&&(r=n+1)}),r},P=(e,r,s,t=!1)=>{let n;return s.forEach(o=>{const c=[];r.sort((u,i)=>u.props.start.getTime()-i.props.start.getTime()).forEach(u=>{if((t||u.props.isAllDay===o.current.props.isAllDay)&&u.props.range.index===o.current.props.range.index&&u.props.group.index===o.current.props.group.index&&p(u.props.start,u.props.end,o.current.props.start,o.current.props.end)){const a=g(c);u===e&&n===void 0&&(n=a),c.splice(a,0,a)}})}),n},q=(e,r,s=!1)=>{r.forEach(t=>t.items.splice(0,t.items.length)),r.forEach(t=>{const n=[];e.forEach(o=>{if((s||o.isAllDay===t.isAllDay)&&o.range.index===t.range.index&&o.group.index===t.group.index&&p(o.start,o.end,t.start,t.end)){const d=g(n);(o.order===null||o.order===void 0||o.order<d)&&(o.order=d),n.splice(o.order,0,o.order),t.items.push(o)}})})},B=(e,r,s=!1)=>{e.forEach(t=>t.slots.splice(0,t.slots.length)),e.forEach(t=>{r.forEach(n=>{(s||t.isAllDay===n.isAllDay)&&t.range.index===n.range.index&&t.group.index===n.group.index&&p(t.start,t.end,n.start,n.end)&&t.slots.push(n)})})},C=(...e)=>{},U=e=>{const r=e.props.items.find(s=>s.order===0)||e.props.items[0];return r&&r._ref.current},_=(e,r,s=!1,t=!1)=>{const n=e.current;if(!n||!r)return null;const o=r.filter(i=>i.current!==null&&i.current.element!==null),c=I.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},s?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),d=c.findIndex(i=>i.current!==null&&!!(i.current.props.uid===n.props.uid&&(i.current.props.occurrenceId===void 0||i.current.props.occurrenceId===n.props.occurrenceId)&&i.current.props.group.index===n.props.group.index&&i.current.props.range.index===n.props.range.index&&(s||i.current.props.isAllDay===n.props.isAllDay)));return c[d+(t?-1:1)]},$=(e,r)=>(e.order||0)-(r.order||0);exports.calculateOrder=P;exports.defaultModelFields=x;exports.findFirstItem=U;exports.findMaster=b;exports.findMissing=g;exports.findNextItem=_;exports.first=F;exports.formatEventTime=R;exports.getField=l;exports.getModelFields=k;exports.intersects=p;exports.isBlank=y;exports.isGroupped=S;exports.isInDaysRange=N;exports.isInTimeRange=G;exports.isMaster=h;exports.isNullOrEmptyString=O;exports.isPresent=H;exports.last=D;exports.mapItemsToSlots=B;exports.mapSlotsToItems=q;exports.noop=C;exports.orderSort=$;exports.setField=A;exports.slotDive=E;exports.toSchedulerGroups=z;exports.toUTCDateTime=v;
|
package/utils/index.mjs
CHANGED
|
@@ -6,36 +6,36 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import
|
|
10
|
-
import { toGroupResources as
|
|
11
|
-
import { getter as
|
|
12
|
-
import { orderBy as
|
|
13
|
-
const
|
|
9
|
+
import "@progress/kendo-date-math";
|
|
10
|
+
import { toGroupResources as h, toFlatGroupResources as E } from "../views/common/utils.mjs";
|
|
11
|
+
import { getter as x, setter as M } from "@progress/kendo-react-common";
|
|
12
|
+
import { orderBy as T } from "@progress/kendo-data-query";
|
|
13
|
+
const v = (r) => r[0], z = (r) => r[r.length - 1], b = (r) => {
|
|
14
14
|
const e = /* @__PURE__ */ new Set();
|
|
15
|
-
return r.forEach((
|
|
16
|
-
e.add(
|
|
15
|
+
return r.forEach((s) => {
|
|
16
|
+
e.add(s.field);
|
|
17
17
|
}), e.size === r.length;
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
const n = { skeleton: "yMMMMEEEEdhm" },
|
|
21
|
-
return t ? `${r.formatDate(e,
|
|
19
|
+
function G(r, e, s, t) {
|
|
20
|
+
const n = { skeleton: "yMMMMEEEEdhm" }, o = { skeleton: "yMMMMEEEEd" };
|
|
21
|
+
return t ? `${r.formatDate(e, o)}` : `${r.formatDate(e, n)}–${r.formatDate(s, "t")}`;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
if (t ===
|
|
23
|
+
const y = (r, e, s, t = 0) => {
|
|
24
|
+
if (t === s)
|
|
25
25
|
return null;
|
|
26
26
|
let n = null;
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
27
|
+
const o = document.elementFromPoint(r, e);
|
|
28
|
+
if (!o)
|
|
29
29
|
return n;
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
-
const d =
|
|
33
|
-
return
|
|
34
|
-
}, p = (r, e) =>
|
|
30
|
+
if (o.getAttribute("data-slot") === "true")
|
|
31
|
+
return o;
|
|
32
|
+
const d = o.style.pointerEvents;
|
|
33
|
+
return o.style.pointerEvents = "none", n = y(r, e, s, t + 1), o.style.pointerEvents = d, n;
|
|
34
|
+
}, p = (r, e) => x(e)(r), N = (r, e, s) => {
|
|
35
35
|
if (e)
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
function
|
|
36
|
+
return M(e)(r, s);
|
|
37
|
+
}, k = (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 P(r) {
|
|
|
48
48
|
)
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const P = (r, e, s) => {
|
|
52
52
|
const t = F(r, e) ? p(r, e.id) : p(r, e.recurrenceId);
|
|
53
|
-
return
|
|
53
|
+
return s.find((n) => p(n, e.id) === t);
|
|
54
54
|
}, F = (r, e) => {
|
|
55
|
-
const
|
|
56
|
-
return !!(
|
|
57
|
-
}, g = (r, e) => Math.max(r.getTime(), e.getTime()), f = (r, e) => Math.min(r.getTime(), e.getTime()), a = (r, e,
|
|
55
|
+
const s = p(r, e.id), t = p(r, e.recurrenceId), n = p(r, e.recurrenceRule);
|
|
56
|
+
return !!(s && n && t == null);
|
|
57
|
+
}, g = (r, e) => Math.max(r.getTime(), e.getTime()), f = (r, e) => Math.min(r.getTime(), e.getTime()), a = (r, e, s, t, n = !1) => n ? g(e, t) - f(r, s) <= e.getTime() - r.getTime() + (t.getTime() - s.getTime()) : g(e, t) - f(r, s) < e.getTime() - r.getTime() + (t.getTime() - s.getTime()), I = {
|
|
58
58
|
id: "id",
|
|
59
59
|
start: "start",
|
|
60
60
|
startTimezone: "startTimezone",
|
|
@@ -67,108 +67,107 @@ const _ = (r, e, o) => {
|
|
|
67
67
|
recurrenceRule: "recurrenceRule",
|
|
68
68
|
recurrenceId: "recurrenceId",
|
|
69
69
|
recurrenceExceptions: "recurrenceExceptions"
|
|
70
|
-
},
|
|
71
|
-
const
|
|
70
|
+
}, _ = (r) => ({ fields: { ...I, ...r } }), $ = (r, e, s) => (e.getHours() < r.getHours() || e.getHours() === r.getHours() && e.getMinutes() <= r.getMinutes()) && (r.getHours() < s.getHours() || s.getHours() === r.getHours() && r.getMinutes() < s.getMinutes()), w = (r, e, s) => e < s ? e <= r && r <= s : r <= s || e <= r, C = (r, e) => {
|
|
71
|
+
const s = h(r, e), t = E(s);
|
|
72
72
|
return t.length === 1 ? [
|
|
73
73
|
{
|
|
74
74
|
index: 0,
|
|
75
75
|
// resources: []
|
|
76
76
|
resources: (e || []).reduce(
|
|
77
|
-
(n,
|
|
77
|
+
(n, o) => [
|
|
78
78
|
...n,
|
|
79
|
-
...
|
|
79
|
+
...o.data.map((u) => ({
|
|
80
80
|
...u,
|
|
81
|
-
field:
|
|
82
|
-
valueField:
|
|
83
|
-
colorField:
|
|
84
|
-
multiple:
|
|
81
|
+
field: o.field,
|
|
82
|
+
valueField: o.valueField,
|
|
83
|
+
colorField: o.colorField,
|
|
84
|
+
multiple: o.multiple
|
|
85
85
|
}))
|
|
86
86
|
],
|
|
87
87
|
[]
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
|
-
] : t.map((n,
|
|
91
|
-
index:
|
|
90
|
+
] : t.map((n, o) => ({
|
|
91
|
+
index: o,
|
|
92
92
|
resources: n
|
|
93
93
|
}));
|
|
94
|
-
},
|
|
94
|
+
}, D = (r) => r == null, O = (r) => D(r) || r.trim && r.trim().length === 0, m = (r) => {
|
|
95
95
|
let e = 0;
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
|
|
96
|
+
const s = r.slice();
|
|
97
|
+
return s.sort((t, n) => t - n).forEach((t, n) => {
|
|
98
|
+
s[n] === n && (e = n + 1);
|
|
99
99
|
}), e;
|
|
100
|
-
},
|
|
100
|
+
}, U = (r, e, s, t = !1) => {
|
|
101
101
|
let n;
|
|
102
|
-
return
|
|
102
|
+
return s.forEach((o) => {
|
|
103
103
|
const u = [];
|
|
104
104
|
e.sort((i, c) => i.props.start.getTime() - c.props.start.getTime()).forEach((i) => {
|
|
105
|
-
if ((t || i.props.isAllDay ===
|
|
105
|
+
if ((t || i.props.isAllDay === o.current.props.isAllDay) && i.props.range.index === o.current.props.range.index && i.props.group.index === o.current.props.group.index && a(i.props.start, i.props.end, o.current.props.start, o.current.props.end)) {
|
|
106
106
|
const l = m(u);
|
|
107
107
|
i === r && n === void 0 && (n = l), u.splice(l, 0, l);
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}), n;
|
|
111
|
-
},
|
|
111
|
+
}, Y = (r, e, s = !1) => {
|
|
112
112
|
e.forEach((t) => t.items.splice(0, t.items.length)), e.forEach((t) => {
|
|
113
113
|
const n = [];
|
|
114
|
-
r.forEach((
|
|
115
|
-
if ((
|
|
114
|
+
r.forEach((o) => {
|
|
115
|
+
if ((s || o.isAllDay === t.isAllDay) && o.range.index === t.range.index && o.group.index === t.group.index && a(o.start, o.end, t.start, t.end)) {
|
|
116
116
|
const d = m(n);
|
|
117
|
-
(
|
|
117
|
+
(o.order === null || o.order === void 0 || o.order < d) && (o.order = d), n.splice(o.order, 0, o.order), t.items.push(o);
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
|
-
},
|
|
121
|
+
}, j = (r, e, s = !1) => {
|
|
122
122
|
r.forEach((t) => t.slots.splice(0, t.slots.length)), r.forEach((t) => {
|
|
123
123
|
e.forEach((n) => {
|
|
124
|
-
(
|
|
124
|
+
(s || t.isAllDay === n.isAllDay) && t.range.index === n.range.index && t.group.index === n.group.index && a(t.start, t.end, n.start, n.end) && t.slots.push(n);
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
const e = r.props.items.find((
|
|
127
|
+
}, q = (...r) => {
|
|
128
|
+
}, J = (r) => {
|
|
129
|
+
const e = r.props.items.find((s) => s.order === 0) || r.props.items[0];
|
|
130
130
|
return e && e._ref.current;
|
|
131
|
-
},
|
|
131
|
+
}, K = (r, e, s = !1, t = !1) => {
|
|
132
132
|
const n = r.current;
|
|
133
133
|
if (!n || !e)
|
|
134
134
|
return null;
|
|
135
|
-
const
|
|
135
|
+
const o = e.filter((c) => c.current !== null && c.current.element !== null), u = T(o, [
|
|
136
136
|
{ field: "current.props.group.index", dir: "asc" },
|
|
137
137
|
{ field: "current.props.range.index", dir: "asc" },
|
|
138
|
-
|
|
138
|
+
s ? { field: "" } : { field: "current.props.isAllDay", dir: "desc" },
|
|
139
139
|
{ field: "current.props.start", dir: "asc" }
|
|
140
140
|
]), d = u.findIndex(
|
|
141
|
-
(c) => c.current !== null && !!(c.current.props.uid === n.props.uid && (c.current.props.occurrenceId === void 0 || c.current.props.occurrenceId === n.props.occurrenceId) && c.current.props.group.index === n.props.group.index && c.current.props.range.index === n.props.range.index && (
|
|
141
|
+
(c) => c.current !== null && !!(c.current.props.uid === n.props.uid && (c.current.props.occurrenceId === void 0 || c.current.props.occurrenceId === n.props.occurrenceId) && c.current.props.group.index === n.props.group.index && c.current.props.range.index === n.props.range.index && (s || c.current.props.isAllDay === n.props.isAllDay))
|
|
142
142
|
);
|
|
143
143
|
return u[d + (t ? -1 : 1)];
|
|
144
|
-
},
|
|
144
|
+
}, L = (r, e) => (r.order || 0) - (e.order || 0);
|
|
145
145
|
export {
|
|
146
|
-
|
|
146
|
+
U as calculateOrder,
|
|
147
147
|
I as defaultModelFields,
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
J as findFirstItem,
|
|
149
|
+
P as findMaster,
|
|
150
150
|
m as findMissing,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
K as findNextItem,
|
|
152
|
+
v as first,
|
|
153
|
+
G as formatEventTime,
|
|
154
154
|
p as getField,
|
|
155
|
-
|
|
156
|
-
k as getToday,
|
|
155
|
+
_ as getModelFields,
|
|
157
156
|
a as intersects,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
D as isBlank,
|
|
158
|
+
b as isGroupped,
|
|
159
|
+
w as isInDaysRange,
|
|
160
|
+
$ as isInTimeRange,
|
|
162
161
|
F as isMaster,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
162
|
+
O as isNullOrEmptyString,
|
|
163
|
+
k as isPresent,
|
|
164
|
+
z as last,
|
|
165
|
+
j as mapItemsToSlots,
|
|
166
|
+
Y as mapSlotsToItems,
|
|
167
|
+
q as noop,
|
|
168
|
+
L as orderSort,
|
|
169
|
+
N as setField,
|
|
170
|
+
y as slotDive,
|
|
171
|
+
C as toSchedulerGroups,
|
|
172
|
+
B as toUTCDateTime
|
|
174
173
|
};
|