@progress/kendo-react-scheduler 16.1.0-develop.9 → 16.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/constants/index.d.ts +2 -0
- package/constants/index.js +1 -1
- package/constants/index.mjs +6 -5
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/hooks/index.d.ts +1 -1
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +42 -54
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +206 -206
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +37 -37
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +17 -17
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +52 -41
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +2 -2
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +153 -118
- package/hooks/useGroupRowHeightSync.js +0 -8
- package/hooks/useGroupRowHeightSync.mjs +0 -84
|
@@ -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"});const ge=require("react"),ve=require("./SchedulerItem.js"),h=require("../utils/index.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("react"),ve=require("./SchedulerItem.js"),h=require("../utils/index.js"),k=require("../views/common/utils.js"),R=require("../constants/index.js"),Ie=require("@progress/kendo-react-intl"),J=require("./SchedulerItemContent.js"),f=require("@progress/kendo-react-common"),m=require("@progress/kendo-svg-icons"),Q=require("../context/SchedulerViewContext.js"),we=require("../context/SchedulerContext.js"),Re=require("../hooks/useRowSync.js");function Se(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const I in e)if(I!=="default"){const x=Object.getOwnPropertyDescriptor(e,I);Object.defineProperty(S,I,x.get?x:{enumerable:!0,get:()=>e[I]})}}return S.default=e,Object.freeze(S)}const t=Se(ge),Ee=1,X=12,Y=t.forwardRef((e,S)=>{const{item:I,_ref:x,itemRef:ee,...te}=e,A=t.useRef(void 0),o=t.useRef(null),C=t.useRef(null),W=t.useRef(null);t.useImperativeHandle(C,()=>({props:e,element:o.current&&o.current.element})),t.useImperativeHandle(S,()=>C.current),t.useImperativeHandle(x,()=>o.current),t.useImperativeHandle(ee,()=>o.current);const ne=I||Z.item,_=Ie.useInternationalization(),[re]=Q.useSchedulerViewItemsContext(),[ce]=Q.useSchedulerViewSlotsContext(),M=we.useSchedulerElementContext(),[ie,p]=t.useState(!0),[oe,ae]=t.useState(!1),V=t.useRef(0),g=t.useRef(null),E=t.useRef([]),H=f.useDir(M),se=t.useMemo(()=>{var r,n;return e.isAllDay?(r=e.title)!=null?r:"":`(${_.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(n=e.title)!=null?n:""}`},[_,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let v;e.isRecurring&&!e.isException?v="recurring":!e.isRecurring&&e.isException&&(v="non-recurring");const le=t.useMemo(()=>_.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[_,e.zonedStart,e.zonedEnd]),ue=(r,n)=>{var d;let i=(d=r._order)!=null?d:0;return n.forEach(a=>{a._order!==void 0&&a._order!==null&&i<a._order&&(i=a._order)}),i+1},me=(r,n,i)=>{const[d,a]=n,l=new Date(Math.min(a.props.end.getTime()-i,Math.max(e.start.getTime(),d.props.start.getTime()))),w=new Date(Math.max(l.getTime()+i,Math.min(e.end.getTime(),a.props.end.getTime())));return r.filter(u=>{const z=Math.max(Math.min(a.props.end.getTime()-i,u.props.start.getTime()),d.props.start.getTime()),T=Math.min(Math.max(z+i,u.props.end.getTime()),a.props.end.getTime());return u.props.id!==e.id&&u.props.group.index===e.group.index&&u.props.range.index===e.range.index&&(e.ignoreIsAllDay||u.props.isAllDay===e.isAllDay)&&h.intersects(new Date(z),new Date(T),l,w)&&h.intersects(d.props.start,a.props.end,u.props.start,u.props.end)})},de=(r,n)=>r.group.index===n.group.index&&r.range.index===n.range.index&&(r.range.isAllDay===void 0||n.range.isAllDay===void 0||r.range.isAllDay===n.range.isAllDay)&&(e.ignoreIsAllDay||r.isAllDay===n.isAllDay),P=()=>{var L,$,G,K,U;const r=ce.filter(c=>c.current&&de(c.current.props,e)).sort((c,y)=>c.current.props.start.getTime()-y.current.props.start.getTime()),n=r.filter(c=>h.intersects(c.current.props.start,c.current.props.end,e.start,e.end)),i=o.current&&o.current.element;if(!i||!n.length)return;const d=h.first(r),a=h.last(r),l=h.first(n),w=h.last(n);if(!l.current||!o.current||!w.current||!d.current||!a.current)return;if(!h.intersects(l.current.props.start,w.current.props.end,e.start,e.end)){p(!1);return}const b=[],u=[],z=[],T=k.getRect(l.current.element),N=(e.vertical?T.height:T.width)/(l.current.props.end.getTime()-l.current.props.start.getTime()),j=(e.vertical?X:8)/N,O=(Math.min(e.start.getTime(),w.current.props.end.getTime()-j)-l.current.props.start.getTime())*N,F=Math.floor(Math.min(e.end.getTime(),w.current.props.end.getTime())-Math.max(e.start.getTime(),l.current.props.start.getTime()))*N;(re||[]).forEach(c=>{c.current&&(c.current.props.dragHint?u.push(c.current):c.current.props.resizeHint?z.push(c.current):b.push(c.current))}),E.current=me(b,[d.current,a.current],j),g.current=e.resizeHint||e.dragHint?0:h.calculateProportionalOrder(o.current,E.current);let D=1;e.resizeHint||e.dragHint||(D=ue(o.current,E.current));let q=0;const s=T;E.current.forEach(c=>{let y=0;c._order!==void 0&&c._order!==null&&c._order<g.current&&(y=k.getRect(c.element).top+k.getRect(c.element).height-s.top-R.BORDER_WIDTH*g.current+Ee),y>q&&(q=y)});const fe=20;s.width=e.vertical?s.width/D-R.BORDER_WIDTH-fe/D:F-R.BORDER_WIDTH,e.vertical?s.height=F-R.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&D<=1||(s.height=($=(L=e.style)==null?void 0:L.height)!=null?$:X),s.left=e.vertical?s.left+((G=g.current)!=null?G:0)+R.BORDER_WIDTH*((K=g.current)!=null?K:0)*s.width:s.left+(O<0?0:O),s.top=e.vertical?s.top+(O<0?0:O):s.top+q+R.BORDER_WIDTH*((U=g.current)!=null?U:0),V.current=D,k.setRect(i,s),ae(!0),p(!0)},B=t.useCallback(r=>{const n=r&&r[0],i=W.current;A.current!==void 0&&window.cancelAnimationFrame(A.current),i&&n&&(i.width!==n.contentRect.width||i.height!==n.contentRect.height)&&(A.current=window.requestAnimationFrame(()=>{P()})),W.current={width:n.contentRect.width,height:n.contentRect.height}},[P]);t.useEffect(P);const he=o.current&&o.current.element?o.current.element.closest(".k-scheduler-layout"):null;return Re.useRowSync({element:he,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!M.current)return;const r=window.ResizeObserver,n=r&&new r(B);return n&&n.observe(M.current),()=>{n&&n.disconnect()}},[B,M]),t.createElement(ne,{...te,_ref:o,_order:g,_maxSiblingsPerSlot:V,_siblings:E,itemRef:o,style:{visibility:oe?void 0:"hidden",display:ie?void 0:"none",...e.style}},!e.resizeHint&&t.createElement(t.Fragment,null,e.tail&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:H==="rtl"?"chevron-right":"chevron-left",icon:H==="rtl"?m.chevronRightIcon:m.chevronLeftIcon})),t.createElement("div",{title:se},e.tail&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:"chevron-up",icon:m.chevronUpIcon})),t.createElement(J.SchedulerItemContent,{className:"k-event-title"},e.title),t.createElement(J.SchedulerItemContent,{className:"k-event-time"},v==="recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(f.IconWrap,{name:"arrow-rotate-cw",icon:m.arrowRotateCwIcon})),v==="non-recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(f.IconWrap,{name:"arrows-no-repeat",icon:m.arrowsNoRepeatIcon})),le),e.head&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:"chevron-down",icon:m.chevronDownIcon}))),v&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(f.IconWrap,{name:v==="recurring"?"arrow-rotate-cw":"arrows-no-repeat",icon:v==="recurring"?m.arrowRotateCwIcon:m.arrowsNoRepeatIcon})),e.head&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(f.IconWrap,{name:H==="rtl"?"chevron-left":"chevron-right",icon:H==="rtl"?m.chevronLeftIcon:m.chevronRightIcon}))))}),Z={item:ve.SchedulerItem};Y.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Y;exports.schedulerProportionalViewItemDefaultProps=Z;
|
|
@@ -7,21 +7,21 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import { SchedulerItem as we } from "./SchedulerItem.mjs";
|
|
10
|
-
import { intersects as
|
|
10
|
+
import { intersects as D, first as B, last as K, calculateProportionalOrder as Ee } from "../utils/index.mjs";
|
|
11
11
|
import { getRect as N, setRect as Se } from "../views/common/utils.mjs";
|
|
12
12
|
import { BORDER_WIDTH as v } from "../constants/index.mjs";
|
|
13
13
|
import { useInternationalization as Ie } from "@progress/kendo-react-intl";
|
|
14
14
|
import { SchedulerItemContent as U } from "./SchedulerItemContent.mjs";
|
|
15
15
|
import { useDir as Re, IconWrap as f } from "@progress/kendo-react-common";
|
|
16
|
-
import { chevronRightIcon as j, chevronLeftIcon as J, chevronUpIcon as Te, arrowRotateCwIcon as Q, arrowsNoRepeatIcon as X, chevronDownIcon as
|
|
17
|
-
import { useSchedulerViewItemsContext as
|
|
18
|
-
import { useSchedulerElementContext as
|
|
16
|
+
import { chevronRightIcon as j, chevronLeftIcon as J, chevronUpIcon as Te, arrowRotateCwIcon as Q, arrowsNoRepeatIcon as X, chevronDownIcon as xe } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { useSchedulerViewItemsContext as ye, useSchedulerViewSlotsContext as Me } from "../context/SchedulerViewContext.mjs";
|
|
18
|
+
import { useSchedulerElementContext as De } from "../context/SchedulerContext.mjs";
|
|
19
19
|
import { useRowSync as ze } from "../hooks/useRowSync.mjs";
|
|
20
20
|
const _e = 1, Y = 12, Ae = t.forwardRef(
|
|
21
21
|
(e, Z) => {
|
|
22
|
-
const { item: ee, _ref: te, itemRef: re, ...ne } = e, z = t.useRef(void 0),
|
|
23
|
-
t.useImperativeHandle(P, () => ({ props: e, element:
|
|
24
|
-
const ce = ee || He.item, R = Ie(), [ie] =
|
|
22
|
+
const { item: ee, _ref: te, itemRef: re, ...ne } = e, z = t.useRef(void 0), o = t.useRef(null), P = t.useRef(null), b = t.useRef(null);
|
|
23
|
+
t.useImperativeHandle(P, () => ({ props: e, element: o.current && o.current.element })), t.useImperativeHandle(Z, () => P.current), t.useImperativeHandle(te, () => o.current), t.useImperativeHandle(re, () => o.current);
|
|
24
|
+
const ce = ee || He.item, R = Ie(), [ie] = ye(), [oe] = Me(), T = De(), [ae, C] = t.useState(!0), [se, le] = t.useState(!1), O = t.useRef(0), d = t.useRef(null), w = t.useRef([]), x = Re(T), ue = t.useMemo(
|
|
25
25
|
() => {
|
|
26
26
|
var n, r;
|
|
27
27
|
return e.isAllDay ? (n = e.title) != null ? n : "" : `(${R.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
|
|
@@ -36,52 +36,52 @@ const _e = 1, Y = 12, Ae = t.forwardRef(
|
|
|
36
36
|
), de = (n, r) => {
|
|
37
37
|
var m;
|
|
38
38
|
let i = (m = n._order) != null ? m : 0;
|
|
39
|
-
return r.forEach((
|
|
40
|
-
|
|
39
|
+
return r.forEach((a) => {
|
|
40
|
+
a._order !== void 0 && a._order !== null && i < a._order && (i = a._order);
|
|
41
41
|
}), i + 1;
|
|
42
42
|
}, he = (n, r, i) => {
|
|
43
|
-
const [m,
|
|
43
|
+
const [m, a] = r, l = new Date(
|
|
44
44
|
Math.min(
|
|
45
|
-
|
|
45
|
+
a.props.end.getTime() - i,
|
|
46
46
|
Math.max(e.start.getTime(), m.props.start.getTime())
|
|
47
47
|
)
|
|
48
48
|
), g = new Date(
|
|
49
|
-
Math.max(l.getTime() + i, Math.min(e.end.getTime(),
|
|
49
|
+
Math.max(l.getTime() + i, Math.min(e.end.getTime(), a.props.end.getTime()))
|
|
50
50
|
);
|
|
51
51
|
return n.filter((u) => {
|
|
52
|
-
const
|
|
53
|
-
Math.min(
|
|
52
|
+
const y = Math.max(
|
|
53
|
+
Math.min(a.props.end.getTime() - i, u.props.start.getTime()),
|
|
54
54
|
m.props.start.getTime()
|
|
55
55
|
), E = Math.min(
|
|
56
|
-
Math.max(
|
|
57
|
-
|
|
56
|
+
Math.max(y + i, u.props.end.getTime()),
|
|
57
|
+
a.props.end.getTime()
|
|
58
58
|
);
|
|
59
|
-
return u.props.id !== e.id && u.props.group.index === e.group.index && u.props.range.index === e.range.index && (e.ignoreIsAllDay || u.props.isAllDay === e.isAllDay) &&
|
|
59
|
+
return u.props.id !== e.id && u.props.group.index === e.group.index && u.props.range.index === e.range.index && (e.ignoreIsAllDay || u.props.isAllDay === e.isAllDay) && D(new Date(y), new Date(E), l, g) && D(m.props.start, a.props.end, u.props.start, u.props.end);
|
|
60
60
|
});
|
|
61
61
|
}, fe = (n, r) => n.group.index === r.group.index && n.range.index === r.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
|
|
62
62
|
// so we need to also check range.isAllDay to distinguish between them.
|
|
63
63
|
(n.range.isAllDay === void 0 || r.range.isAllDay === void 0 || n.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || n.isAllDay === r.isAllDay), _ = () => {
|
|
64
64
|
var G, L, W, $, q;
|
|
65
|
-
const n =
|
|
66
|
-
(c) =>
|
|
67
|
-
), i =
|
|
65
|
+
const n = oe.filter((c) => c.current && fe(c.current.props, e)).sort((c, I) => c.current.props.start.getTime() - I.current.props.start.getTime()), r = n.filter(
|
|
66
|
+
(c) => D(c.current.props.start, c.current.props.end, e.start, e.end)
|
|
67
|
+
), i = o.current && o.current.element;
|
|
68
68
|
if (!i || !r.length)
|
|
69
69
|
return;
|
|
70
|
-
const m = B(n),
|
|
71
|
-
if (!l.current || !
|
|
70
|
+
const m = B(n), a = K(n), l = B(r), g = K(r);
|
|
71
|
+
if (!l.current || !o.current || !g.current || !m.current || !a.current)
|
|
72
72
|
return;
|
|
73
|
-
if (!
|
|
73
|
+
if (!D(l.current.props.start, g.current.props.end, e.start, e.end)) {
|
|
74
74
|
C(!1);
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
const A = [], u = [],
|
|
77
|
+
const A = [], u = [], y = [], E = N(l.current.element), H = (e.vertical ? E.height : E.width) / (l.current.props.end.getTime() - l.current.props.start.getTime()), p = (e.vertical ? Y : 8) / H, M = (Math.min(e.start.getTime(), g.current.props.end.getTime() - p) - l.current.props.start.getTime()) * H, F = Math.floor(
|
|
78
78
|
Math.min(e.end.getTime(), g.current.props.end.getTime()) - Math.max(e.start.getTime(), l.current.props.start.getTime())
|
|
79
79
|
) * H;
|
|
80
80
|
(ie || []).forEach((c) => {
|
|
81
|
-
c.current && (c.current.props.dragHint ? u.push(c.current) : c.current.props.resizeHint ?
|
|
82
|
-
}), w.current = he(A, [m.current,
|
|
81
|
+
c.current && (c.current.props.dragHint ? u.push(c.current) : c.current.props.resizeHint ? y.push(c.current) : A.push(c.current));
|
|
82
|
+
}), w.current = he(A, [m.current, a.current], p), d.current = e.resizeHint || e.dragHint ? 0 : Ee(o.current, w.current);
|
|
83
83
|
let S = 1;
|
|
84
|
-
e.resizeHint || e.dragHint || (S = de(
|
|
84
|
+
e.resizeHint || e.dragHint || (S = de(o.current, w.current));
|
|
85
85
|
let k = 0;
|
|
86
86
|
const s = E;
|
|
87
87
|
w.current.forEach((c) => {
|
|
@@ -89,7 +89,7 @@ const _e = 1, Y = 12, Ae = t.forwardRef(
|
|
|
89
89
|
c._order !== void 0 && c._order !== null && c._order < d.current && (I = N(c.element).top + N(c.element).height - s.top - v * d.current + _e), I > k && (k = I);
|
|
90
90
|
});
|
|
91
91
|
const ve = 20;
|
|
92
|
-
s.width = e.vertical ? s.width / S - v - ve / S :
|
|
92
|
+
s.width = e.vertical ? s.width / S - v - ve / S : F - v, e.vertical ? s.height = F - v : (e.resizeHint || e.dragHint) && S <= 1 || (s.height = (L = (G = e.style) == null ? void 0 : G.height) != null ? L : Y), s.left = e.vertical ? s.left + ((W = d.current) != null ? W : 0) + v * (($ = d.current) != null ? $ : 0) * s.width : s.left + (M < 0 ? 0 : M), s.top = e.vertical ? s.top + (M < 0 ? 0 : M) : s.top + k + v * ((q = d.current) != null ? q : 0), O.current = S, Se(i, s), le(!0), C(!0);
|
|
93
93
|
}, V = t.useCallback(
|
|
94
94
|
(n) => {
|
|
95
95
|
const r = n && n[0], i = b.current;
|
|
@@ -100,7 +100,7 @@ const _e = 1, Y = 12, Ae = t.forwardRef(
|
|
|
100
100
|
[_]
|
|
101
101
|
);
|
|
102
102
|
t.useEffect(_);
|
|
103
|
-
const ge =
|
|
103
|
+
const ge = o.current && o.current.element ? o.current.element.closest(".k-scheduler-layout") : null;
|
|
104
104
|
return ze({
|
|
105
105
|
element: ge,
|
|
106
106
|
selector: ".k-resource-row",
|
|
@@ -119,24 +119,24 @@ const _e = 1, Y = 12, Ae = t.forwardRef(
|
|
|
119
119
|
ce,
|
|
120
120
|
{
|
|
121
121
|
...ne,
|
|
122
|
-
_ref:
|
|
122
|
+
_ref: o,
|
|
123
123
|
_order: d,
|
|
124
124
|
_maxSiblingsPerSlot: O,
|
|
125
125
|
_siblings: w,
|
|
126
|
-
itemRef:
|
|
126
|
+
itemRef: o,
|
|
127
127
|
style: {
|
|
128
128
|
visibility: se ? void 0 : "hidden",
|
|
129
|
-
display:
|
|
129
|
+
display: ae ? void 0 : "none",
|
|
130
130
|
...e.style
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
!e.resizeHint && /* @__PURE__ */ t.createElement(t.Fragment, null, e.tail && !e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(
|
|
134
134
|
f,
|
|
135
135
|
{
|
|
136
|
-
name:
|
|
137
|
-
icon:
|
|
136
|
+
name: x === "rtl" ? "chevron-right" : "chevron-left",
|
|
137
|
+
icon: x === "rtl" ? j : J
|
|
138
138
|
}
|
|
139
|
-
)), /* @__PURE__ */ t.createElement("div", { title: ue }, e.tail && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(f, { name: "chevron-up", icon: Te })), /* @__PURE__ */ t.createElement(U, { className: "k-event-title" }, e.title),
|
|
139
|
+
)), /* @__PURE__ */ t.createElement("div", { title: ue }, e.tail && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(f, { name: "chevron-up", icon: Te })), /* @__PURE__ */ t.createElement(U, { className: "k-event-title" }, e.title), /* @__PURE__ */ t.createElement(U, { className: "k-event-time" }, h === "recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(f, { name: "arrow-rotate-cw", icon: Q })), h === "non-recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(f, { name: "arrows-no-repeat", icon: X })), me), e.head && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(f, { name: "chevron-down", icon: xe }))), h && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(
|
|
140
140
|
f,
|
|
141
141
|
{
|
|
142
142
|
name: h === "recurring" ? "arrow-rotate-cw" : "arrows-no-repeat",
|
|
@@ -145,8 +145,8 @@ const _e = 1, Y = 12, Ae = t.forwardRef(
|
|
|
145
145
|
)), e.head && !e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(
|
|
146
146
|
f,
|
|
147
147
|
{
|
|
148
|
-
name:
|
|
149
|
-
icon:
|
|
148
|
+
name: x === "rtl" ? "chevron-left" : "chevron-right",
|
|
149
|
+
icon: x === "rtl" ? J : j
|
|
150
150
|
}
|
|
151
151
|
)))
|
|
152
152
|
);
|
|
@@ -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"});const ye=require("react"),Ee=require("./SchedulerItem.js"),q=require("../utils/index.js"),K=require("../views/common/utils.js"),F=require("../constants/index.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("react"),Ee=require("./SchedulerItem.js"),q=require("../utils/index.js"),K=require("../views/common/utils.js"),F=require("../constants/index.js"),Se=require("@progress/kendo-react-intl"),ne=require("./SchedulerItemContent.js"),H=require("@progress/kendo-react-common"),w=require("@progress/kendo-svg-icons"),De=require("../hooks/useEditable.js"),re=require("../context/SchedulerViewContext.js"),be=require("../context/SchedulerContext.js"),He=require("../hooks/useRowSync.js");function Ae(e){const _=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const x in e)if(x!=="default"){const W=Object.getOwnPropertyDescriptor(e,x);Object.defineProperty(_,x,W.get?W:{enumerable:!0,get:()=>e[x]})}}return _.default=e,Object.freeze(_)}const t=Ae(ye),L=1,J=25,ce=t.forwardRef((e,_)=>{const{item:x,_ref:W,itemRef:oe,...ae}=e,Y=t.useRef(void 0),R=t.useRef(void 0),m=t.useRef(null),Q=t.useRef(null),X=t.useRef(null),le=De.useEditable(e.editable);t.useImperativeHandle(Q,()=>({props:e,element:m.current&&m.current.element})),t.useImperativeHandle(_,()=>Q.current),t.useImperativeHandle(W,()=>m.current),t.useImperativeHandle(oe,()=>m.current);const se=x||ie.item,P=Se.useInternationalization(),[ue]=re.useSchedulerViewItemsContext(),[de]=re.useSchedulerViewSlotsContext(),C=be.useSchedulerElementContext(),[me,$]=t.useState(!0),[fe,he]=t.useState(!1),f=t.useRef(e.order),Z=t.useRef(0),V=H.useDir(C),ge=t.useMemo(()=>{var n,r;return e.isAllDay?(n=e.title)!=null?n:"":`(${P.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${(r=e.title)!=null?r:""}`},[P,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let A;e.isRecurring&&!e.isException?A="recurring":!e.isRecurring&&e.isException&&(A="non-recurring");const ve=t.useMemo(()=>P.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[P,e.zonedStart,e.zonedEnd]),p=(n,r)=>{let l=1;return n.forEach(i=>{const s=r.filter(z=>G(i.current.props,z.props));s.length>l&&(l=s.length)}),l},we=(n,r)=>n.map(i=>r.filter(s=>G(i.current.props,s.props))),Ie=(n,r,l,i=!1)=>{var j;const s=r.filter(c=>c.props.order!==null&&c.props.order!==void 0).map(c=>{let a=c.props.start,u=c.props.end;if(c.props.isAllDay||i){a=new Date(a.getFullYear(),a.getMonth(),a.getDate());const E=new Date(u.getFullYear(),u.getMonth(),u.getDate());u=E.getTime()<=a.getTime()?new Date(a.getFullYear(),a.getMonth(),a.getDate()+1):E}return{order:c.props.order,start:a,end:u}}),z=Array.from(new Set(s.map(c=>c.order))).sort((c,a)=>c-a),I=new Map;for(const c of s)I.has(c.order)||I.set(c.order,[]),I.get(c.order).push({start:c.start,end:c.end});const O=[],y=new Map;for(const c of z){const a=I.get(c);let u=-1,E=0;y.forEach((g,N)=>{if(N>=c)return;const S=I.get(N);if(!S)return;a.some(M=>S.some(o=>q.intersects(o.start,o.end,M.start,M.end,l)))&&g+1>E&&(E=g+1)});for(let g=E;g<O.length;g++)if(a.every(S=>O[g].every(T=>!q.intersects(T.start,T.end,S.start,S.end,l)))){u=g;break}u===-1&&(u=O.length,O.push([])),O[u].push(...a),y.set(c,u)}return(j=y.get(n))!=null?j:n},G=(n,r)=>q.intersects(n.start,n.end,r.start,r.end)&&n.group.index===r.group.index&&n.range.index===r.range.index&&(n.range.isAllDay===void 0||r.range.isAllDay===void 0||n.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||n.isAllDay===r.isAllDay),B=()=>{var g,N,S,T,M;const n=(de||[]).filter(o=>o.current&&G(o.current.props,e)),r=m.current&&m.current.element,l=q.first(n);if(n.length===0){$(!1);return}if(!l.current||!r)return;const i=K.getRect(l.current.element),s=[],z=[],I=[];(ue||[]).forEach(o=>{o.current&&(o.current.props.dragHint?z.push(o.current):o.current.props.resizeHint?I.push(o.current):s.push(o.current))});const O=e.dragHint||e.resizeHint?q.calculateOrder(m.current,e.dragHint?z:I,n,e.ignoreIsAllDay):(g=e.order)!=null?g:0;if(!e.vertical&&!(e.dragHint||e.resizeHint)&&e.order!==null&&e.order!==void 0){const D=(e.ignoreIsAllDay?s:s.filter(k=>k.props.isAllDay)).filter(k=>k.props.group.index===e.group.index),h=(N=e.style)==null?void 0:N.height,b=typeof h=="number"?h:parseFloat(h),d=h!=null&&Number.isNaN(b),v=!!e.ignoreIsAllDay,U=v?!0:!d;f.current=Ie(e.order,D,U,v)}else f.current=O;let y=e.dragHint||e.resizeHint?p(n,e.dragHint?z:I):p(n,s);const j=we(n,s);let c=0;const a=!e.vertical&&f.current!==null;if(j.forEach(o=>{let D=0;o.forEach(h=>{if(!a){const b=K.getRect(h.element);h.props.order!==null&&h.props.order!==void 0&&h.props.order<f.current&&(D=b.top+b.height-i.top-F.BORDER_WIDTH*f.current+L)}}),D>c&&(c=D)}),a){const o=(S=e.style)==null?void 0:S.height,D=typeof o=="number"?o:parseFloat(o);if(o==null)c=f.current*(J+L);else if(!Number.isNaN(D))c=f.current*(D+L);else{const h=(e.ignoreIsAllDay?s:s.filter(d=>d.props.isAllDay)).filter(d=>d.props.group.index===e.group.index&&d.element!==r&&(!e.ignoreIsAllDay||!l.current||q.intersects(d.props.start,d.props.end,l.current.props.start,l.current.props.end))),b=new Map;h.forEach(d=>{var k,te;const v=d._order;if(v==null||v>=f.current)return;const U=((k=d.element)==null?void 0:k.offsetHeight)||J;b.set(v,Math.max((te=b.get(v))!=null?te:0,U))}),c=Array.from(b.values()).reduce((d,v)=>d+v+L,0)}}if(n.length===0){$(!1);return}const u=le.add?20:0;i.width=e.vertical?i.width/y-F.BORDER_WIDTH-u/y:i.width*n.length-F.BORDER_WIDTH,e.vertical?i.height=i.height*n.length-F.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&y<=1||(i.height=(M=(T=e.style)==null?void 0:T.height)!=null?M:J),i.left=e.vertical?i.left+f.current*i.width+F.BORDER_WIDTH*f.current:i.left;const E=!e.vertical&&e.slotHeaderOffset||0;i.top=e.vertical?i.top:i.top+c+F.BORDER_WIDTH*f.current+E,Z.current=y,K.setRect(r,i),he(!0),$(!0)},ee=t.useCallback(n=>{const r=n&&n[0],l=X.current;Y.current!==void 0&&window.cancelAnimationFrame(Y.current),l&&r&&(l.width!==r.contentRect.width||l.height!==r.contentRect.height)&&(Y.current=window.requestAnimationFrame(()=>{B()})),X.current={width:r.contentRect.width,height:r.contentRect.height}},[B]);t.useEffect(()=>(B(),R.current!==void 0&&window.cancelAnimationFrame(R.current),R.current=window.requestAnimationFrame(()=>{R.current=window.requestAnimationFrame(()=>{R.current=void 0,B()})}),()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0)}));const Re=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return He.useRowSync({element:Re,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),t.useEffect(()=>{if(!C.current)return;const n=window.ResizeObserver,r=n&&new n(ee);return r&&r.observe(C.current),()=>{r&&r.disconnect()}},[ee,C]),t.createElement(se,{...ae,_ref:m,_maxSiblingsPerSlot:Z,_order:f,itemRef:m,style:{visibility:fe?void 0:"hidden",display:me?void 0:"none",...e.style}},!e.resizeHint&&t.createElement(t.Fragment,null,e.tail&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:V==="rtl"?"chevron-right":"chevron-left",icon:V==="rtl"?w.chevronRightIcon:w.chevronLeftIcon})),t.createElement("div",{title:ge},e.tail&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:"chevron-up",icon:w.chevronUpIcon})),t.createElement(ne.SchedulerItemContent,{className:"k-event-title"},e.title),t.createElement(ne.SchedulerItemContent,{className:"k-event-time"},A==="recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:"arrow-rotate-cw",icon:w.arrowRotateCwIcon})),A==="non-recurring"&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:"arrows-no-repeat",icon:w.arrowsNoRepeatIcon})),ve),e.head&&e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:"chevron-down",icon:w.chevronDownIcon}))),A&&t.createElement("span",{className:"k-event-recurrence-icon"},t.createElement(H.IconWrap,{name:A==="recurring"?"arrow-rotate-cw":"arrows-no-repeat",icon:A==="recurring"?w.arrowRotateCwIcon:w.arrowsNoRepeatIcon})),e.head&&!e.vertical&&t.createElement("span",{className:"k-event-continuation"},t.createElement(H.IconWrap,{name:V==="rtl"?"chevron-left":"chevron-right",icon:V==="rtl"?w.chevronLeftIcon:w.chevronRightIcon}))))}),ie={item:Ee.SchedulerItem};ce.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=ce;exports.schedulerViewItemDefaultProps=ie;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import { SchedulerItem as Ie } from "./SchedulerItem.mjs";
|
|
10
|
-
import { first as Re, calculateOrder as
|
|
11
|
-
import { getRect as X, setRect as
|
|
10
|
+
import { first as Re, calculateOrder as Se, intersects as C } from "../utils/index.mjs";
|
|
11
|
+
import { getRect as X, setRect as Ae } from "../views/common/utils.mjs";
|
|
12
12
|
import { BORDER_WIDTH as k } from "../constants/index.mjs";
|
|
13
13
|
import { useInternationalization as De } from "@progress/kendo-react-intl";
|
|
14
14
|
import { SchedulerItemContent as Z } from "./SchedulerItemContent.mjs";
|
|
@@ -102,17 +102,17 @@ const q = 1, G = 25, Te = t.forwardRef(
|
|
|
102
102
|
(ue || []).forEach((c) => {
|
|
103
103
|
c.current && (c.current.props.dragHint ? H.push(c.current) : c.current.props.resizeHint ? w.push(c.current) : s.push(c.current));
|
|
104
104
|
});
|
|
105
|
-
const b = e.dragHint || e.resizeHint ?
|
|
105
|
+
const b = e.dragHint || e.resizeHint ? Se(
|
|
106
106
|
m.current,
|
|
107
107
|
e.dragHint ? H : w,
|
|
108
108
|
r,
|
|
109
109
|
e.ignoreIsAllDay
|
|
110
110
|
) : (g = e.order) != null ? g : 0;
|
|
111
111
|
if (!e.vertical && !(e.dragHint || e.resizeHint) && e.order !== null && e.order !== void 0) {
|
|
112
|
-
const
|
|
112
|
+
const S = (e.ignoreIsAllDay ? s : s.filter((F) => F.props.isAllDay)).filter((F) => F.props.group.index === e.group.index), h = (x = e.style) == null ? void 0 : x.height, A = typeof h == "number" ? h : parseFloat(h), d = h != null && Number.isNaN(A), v = !!e.ignoreIsAllDay, Y = v ? !0 : !d;
|
|
113
113
|
f.current = ye(
|
|
114
114
|
e.order,
|
|
115
|
-
|
|
115
|
+
S,
|
|
116
116
|
Y,
|
|
117
117
|
v
|
|
118
118
|
);
|
|
@@ -123,19 +123,19 @@ const q = 1, G = 25, Te = t.forwardRef(
|
|
|
123
123
|
let i = 0;
|
|
124
124
|
const l = !e.vertical && f.current !== null;
|
|
125
125
|
if (V.forEach((c) => {
|
|
126
|
-
let
|
|
126
|
+
let S = 0;
|
|
127
127
|
c.forEach((h) => {
|
|
128
128
|
if (!l) {
|
|
129
|
-
const
|
|
130
|
-
h.props.order !== null && h.props.order !== void 0 && h.props.order < f.current && (
|
|
129
|
+
const A = X(h.element);
|
|
130
|
+
h.props.order !== null && h.props.order !== void 0 && h.props.order < f.current && (S = A.top + A.height - o.top - k * f.current + q);
|
|
131
131
|
}
|
|
132
|
-
}),
|
|
132
|
+
}), S > i && (i = S);
|
|
133
133
|
}), l) {
|
|
134
|
-
const c = (R = e.style) == null ? void 0 : R.height,
|
|
134
|
+
const c = (R = e.style) == null ? void 0 : R.height, S = typeof c == "number" ? c : parseFloat(c);
|
|
135
135
|
if (c == null)
|
|
136
136
|
i = f.current * (G + q);
|
|
137
|
-
else if (!Number.isNaN(
|
|
138
|
-
i = f.current * (
|
|
137
|
+
else if (!Number.isNaN(S))
|
|
138
|
+
i = f.current * (S + q);
|
|
139
139
|
else {
|
|
140
140
|
const h = (e.ignoreIsAllDay ? s : s.filter((d) => d.props.isAllDay)).filter(
|
|
141
141
|
(d) => d.props.group.index === e.group.index && d.element !== n && (!e.ignoreIsAllDay || !a.current || C(
|
|
@@ -144,15 +144,15 @@ const q = 1, G = 25, Te = t.forwardRef(
|
|
|
144
144
|
a.current.props.start,
|
|
145
145
|
a.current.props.end
|
|
146
146
|
))
|
|
147
|
-
),
|
|
147
|
+
), A = /* @__PURE__ */ new Map();
|
|
148
148
|
h.forEach((d) => {
|
|
149
149
|
var F, Q;
|
|
150
150
|
const v = d._order;
|
|
151
151
|
if (v == null || v >= f.current)
|
|
152
152
|
return;
|
|
153
153
|
const Y = ((F = d.element) == null ? void 0 : F.offsetHeight) || G;
|
|
154
|
-
|
|
155
|
-
}), i = Array.from(
|
|
154
|
+
A.set(v, Math.max((Q = A.get(v)) != null ? Q : 0, Y));
|
|
155
|
+
}), i = Array.from(A.values()).reduce((d, v) => d + v + q, 0);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
if (r.length === 0) {
|
|
@@ -162,7 +162,7 @@ const q = 1, G = 25, Te = t.forwardRef(
|
|
|
162
162
|
const u = ae.add ? 20 : 0;
|
|
163
163
|
o.width = e.vertical ? o.width / E - k - u / E : o.width * r.length - k, e.vertical ? o.height = o.height * r.length - k : (e.resizeHint || e.dragHint) && E <= 1 || (o.height = (M = (N = e.style) == null ? void 0 : N.height) != null ? M : G), o.left = e.vertical ? o.left + f.current * o.width + k * f.current : o.left;
|
|
164
164
|
const I = !e.vertical && e.slotHeaderOffset || 0;
|
|
165
|
-
o.top = e.vertical ? o.top : o.top + i + k * f.current + I, K.current = E,
|
|
165
|
+
o.top = e.vertical ? o.top : o.top + i + k * f.current + I, K.current = E, Ae(n, o), he(!0), B(!0);
|
|
166
166
|
}, J = t.useCallback(
|
|
167
167
|
(r) => {
|
|
168
168
|
const n = r && r[0], a = $.current;
|
|
@@ -214,7 +214,7 @@ const q = 1, G = 25, Te = t.forwardRef(
|
|
|
214
214
|
name: P === "rtl" ? "chevron-right" : "chevron-left",
|
|
215
215
|
icon: P === "rtl" ? p : ee
|
|
216
216
|
}
|
|
217
|
-
)), /* @__PURE__ */ t.createElement("div", { title: ge }, e.tail && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(z, { name: "chevron-up", icon: be })), /* @__PURE__ */ t.createElement(Z, { className: "k-event-title" }, e.title),
|
|
217
|
+
)), /* @__PURE__ */ t.createElement("div", { title: ge }, e.tail && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(z, { name: "chevron-up", icon: be })), /* @__PURE__ */ t.createElement(Z, { className: "k-event-title" }, e.title), /* @__PURE__ */ t.createElement(Z, { className: "k-event-time" }, D === "recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(z, { name: "arrow-rotate-cw", icon: te })), D === "non-recurring" && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(z, { name: "arrows-no-repeat", icon: re })), ve), e.head && e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(z, { name: "chevron-down", icon: ze }))), D && /* @__PURE__ */ t.createElement("span", { className: "k-event-recurrence-icon" }, /* @__PURE__ */ t.createElement(
|
|
218
218
|
z,
|
|
219
219
|
{
|
|
220
220
|
name: D === "recurring" ? "arrow-rotate-cw" : "arrows-no-repeat",
|
package/package-metadata.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"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1789024362,version:"16.2.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export const packageMetadata = Object.freeze({
|
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCode: 'KENDOUIREACT',
|
|
8
8
|
productCodes: ['KENDOUIREACT'],
|
|
9
|
-
publishDate:
|
|
10
|
-
version: '16.
|
|
9
|
+
publishDate: 1789024362,
|
|
10
|
+
version: '16.2.0-develop.1',
|
|
11
11
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui'
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-scheduler",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0-develop.1",
|
|
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",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-data-query": "^1.7.2",
|
|
29
29
|
"@progress/kendo-date-math": "^1.4.1",
|
|
30
|
-
"@progress/kendo-drawing": "^1.
|
|
30
|
+
"@progress/kendo-drawing": "^1.25.5",
|
|
31
31
|
"@progress/kendo-licensing": "^1.7.2",
|
|
32
|
-
"@progress/kendo-react-buttons": "16.
|
|
33
|
-
"@progress/kendo-react-common": "16.
|
|
34
|
-
"@progress/kendo-react-dateinputs": "16.
|
|
35
|
-
"@progress/kendo-react-dialogs": "16.
|
|
36
|
-
"@progress/kendo-react-dropdowns": "16.
|
|
37
|
-
"@progress/kendo-react-form": "16.
|
|
38
|
-
"@progress/kendo-react-inputs": "16.
|
|
39
|
-
"@progress/kendo-react-intl": "16.
|
|
40
|
-
"@progress/kendo-react-popup": "16.
|
|
41
|
-
"@progress/kendo-react-tooltip": "16.
|
|
32
|
+
"@progress/kendo-react-buttons": "16.2.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-common": "16.2.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-dateinputs": "16.2.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-dialogs": "16.2.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-dropdowns": "16.2.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-form": "16.2.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-inputs": "16.2.0-develop.1",
|
|
39
|
+
"@progress/kendo-react-intl": "16.2.0-develop.1",
|
|
40
|
+
"@progress/kendo-react-popup": "16.2.0-develop.1",
|
|
41
|
+
"@progress/kendo-react-tooltip": "16.2.0-develop.1",
|
|
42
42
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
43
43
|
"react": "^18.0.0 || ^19.0.0",
|
|
44
44
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"package": {
|
|
114
114
|
"productName": "KendoReact",
|
|
115
115
|
"productCode": "KENDOUIREACT",
|
|
116
|
-
"publishDate":
|
|
116
|
+
"publishDate": 1789024362,
|
|
117
117
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
|
|
118
118
|
}
|
|
119
119
|
},
|
|
@@ -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"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@progress/kendo-react-common"),I=require("@progress/kendo-recurrence"),S=require("@progress/kendo-date-math"),i=require("../utils/index.js"),L=(e,{dateRange:r,fields:c,timezone:o})=>{const a=n.getter(c.recurrenceId||"recurrenceId"),t=n.getter(c.recurrenceRule||"recurrenceRule"),l=new Set(e.filter(d=>{const p=a(d);return p!=null&&!!t(d)}).map(a));return e.map(E(c)).reduce(y(r,o,c,l),[]).filter(d=>!i.isMaster(d.dataItem,c))},E=e=>r=>{const c=n.getter(e.start||"start")(r),o=n.getter(e.originalStart||"originalStart")(r),a=n.getter(e.recurrenceId||"recurrenceId")(r),t=n.getter(e.recurrenceRule||"recurrenceRule")(r),l=a!=null&&!!t&&o==null,D=n.clone(r);return l&&i.setField(D,e.originalStart||"originalStart",c),{uid:n.getter(e.id||"id")(r),start:c,startTimezone:n.getter(e.startTimezone||"startTimezone")(r),originalStart:l?c:o,end:n.getter(e.end||"end")(r),endTimezone:n.getter(e.endTimezone||"endTimezone")(r),isAllDay:n.getter(e.isAllDay||"isAllDay")(r),title:n.getter(e.title||"title")(r),description:n.getter(e.description||"description")(r),occurrenceId:n.getter("occurrenceId")(r),recurrenceRule:t,recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(r),recurrenceId:a,readonly:n.getter(e.readonly||"readonly")(r),dataItem:D}},y=(e,r,c,o)=>(a,t)=>[...a,...t.recurrenceRule&&(t.recurrenceId===null||t.recurrenceId===void 0)&&i.isMaster(t.dataItem,c)&&!o.has(t.uid)?[...m(t,{dateRange:e,timezone:r,fields:c})]:[t]],m=(e,{dateRange:r,timezone:c,fields:o})=>{const a=e.recurrenceRule,t=I.parseRule({recurrenceRule:a});if(!t)return[];t.start||(t.start=S.ZonedDate.fromLocalDate(e.start,c)),t.end||(t.end=S.ZonedDate.fromLocalDate(e.end,c));const l=e.recurrenceExceptions;l&&(t.exceptionDates=l.map(u=>S.ZonedDate.fromLocalDate(u,c)));const D=t.end.getTime()-t.start.getTime(),d=S.ZonedDate.fromLocalDate(new Date(r.zonedStart.toLocalDate().getTime()-D),c),p=r.zonedEnd,R=I.expand(t,{rangeStart:d,rangeEnd:p});if(!R.events.length)return[];const v=t.until,T=v&&t.bySetPosition?R.events.filter(u=>u.start.getTime()<=v.getTime()):R.events;return T.length?T.map((u,x)=>{const s=n.clone(e),g=n.clone(e.dataItem);return s.recurrenceId=s.uid,i.setField(g,o.recurrenceId,e.uid),s.originalStart=u.start.toLocalDate(),i.setField(g,o.originalStart,u.start.toLocalDate()),s.start=u.start.toLocalDate(),i.setField(g,o.start,u.start.toLocalDate()),s.end=u.end.toLocalDate(),i.setField(g,o.end,u.end.toLocalDate()),s.occurrenceId=String(x),i.setField(g,"occurrenceId",String(x)),s.dataItem=g,s}):[]};exports.toOccurrences=L;
|
|
@@ -5,51 +5,62 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { parseRule as
|
|
10
|
-
import { ZonedDate as
|
|
11
|
-
import { isMaster as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
8
|
+
import { getter as c, clone as m } from "@progress/kendo-react-common";
|
|
9
|
+
import { parseRule as T, expand as E } from "@progress/kendo-recurrence";
|
|
10
|
+
import { ZonedDate as S } from "@progress/kendo-date-math";
|
|
11
|
+
import { isMaster as L, setField as p } from "../utils/index.mjs";
|
|
12
|
+
const b = (e, { dateRange: t, fields: n, timezone: o }) => {
|
|
13
|
+
const a = c(n.recurrenceId || "recurrenceId"), r = c(n.recurrenceRule || "recurrenceRule"), i = new Set(
|
|
14
|
+
e.filter((l) => {
|
|
15
|
+
const D = a(l);
|
|
16
|
+
return D != null && !!r(l);
|
|
17
|
+
}).map(a)
|
|
18
|
+
);
|
|
19
|
+
return e.map(y(n)).reduce(z(t, o, n, i), []).filter((l) => !L(l.dataItem, n));
|
|
20
|
+
}, y = (e) => (t) => {
|
|
21
|
+
const n = c(e.start || "start")(t), o = c(e.originalStart || "originalStart")(t), a = c(e.recurrenceId || "recurrenceId")(t), r = c(e.recurrenceRule || "recurrenceRule")(t), i = a != null && !!r && o == null, g = m(t);
|
|
22
|
+
return i && p(g, e.originalStart || "originalStart", n), {
|
|
23
|
+
uid: c(e.id || "id")(t),
|
|
24
|
+
start: n,
|
|
25
|
+
startTimezone: c(e.startTimezone || "startTimezone")(t),
|
|
26
|
+
originalStart: i ? n : o,
|
|
27
|
+
end: c(e.end || "end")(t),
|
|
28
|
+
endTimezone: c(e.endTimezone || "endTimezone")(t),
|
|
29
|
+
isAllDay: c(e.isAllDay || "isAllDay")(t),
|
|
30
|
+
title: c(e.title || "title")(t),
|
|
31
|
+
description: c(e.description || "description")(t),
|
|
32
|
+
occurrenceId: c("occurrenceId")(t),
|
|
33
|
+
recurrenceRule: r,
|
|
34
|
+
recurrenceExceptions: c(e.recurrenceExceptions || "recurrenceExceptions")(t),
|
|
35
|
+
recurrenceId: a,
|
|
36
|
+
readonly: c(e.readonly || "readonly")(t),
|
|
37
|
+
dataItem: g
|
|
38
|
+
};
|
|
39
|
+
}, z = (e, t, n, o) => (a, r) => [
|
|
40
|
+
...a,
|
|
41
|
+
...r.recurrenceRule && (r.recurrenceId === null || r.recurrenceId === void 0) && L(r.dataItem, n) && !o.has(r.uid) ? [...h(r, { dateRange: e, timezone: t, fields: n })] : [r]
|
|
42
|
+
], h = (e, { dateRange: t, timezone: n, fields: o }) => {
|
|
43
|
+
const a = e.recurrenceRule, r = T({ recurrenceRule: a });
|
|
44
|
+
if (!r)
|
|
34
45
|
return [];
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
new Date(
|
|
40
|
-
|
|
41
|
-
),
|
|
42
|
-
rangeStart:
|
|
43
|
-
rangeEnd:
|
|
46
|
+
r.start || (r.start = S.fromLocalDate(e.start, n)), r.end || (r.end = S.fromLocalDate(e.end, n));
|
|
47
|
+
const i = e.recurrenceExceptions;
|
|
48
|
+
i && (r.exceptionDates = i.map((u) => S.fromLocalDate(u, n)));
|
|
49
|
+
const g = r.end.getTime() - r.start.getTime(), l = S.fromLocalDate(
|
|
50
|
+
new Date(t.zonedStart.toLocalDate().getTime() - g),
|
|
51
|
+
n
|
|
52
|
+
), D = t.zonedEnd, R = E(r, {
|
|
53
|
+
rangeStart: l,
|
|
54
|
+
rangeEnd: D
|
|
44
55
|
});
|
|
45
|
-
if (!
|
|
56
|
+
if (!R.events.length)
|
|
46
57
|
return [];
|
|
47
|
-
const
|
|
48
|
-
return
|
|
49
|
-
const s =
|
|
50
|
-
return s.recurrenceId = s.uid,
|
|
58
|
+
const v = r.until, x = v && r.bySetPosition ? R.events.filter((u) => u.start.getTime() <= v.getTime()) : R.events;
|
|
59
|
+
return x.length ? x.map((u, I) => {
|
|
60
|
+
const s = m(e), d = m(e.dataItem);
|
|
61
|
+
return s.recurrenceId = s.uid, p(d, o.recurrenceId, e.uid), s.originalStart = u.start.toLocalDate(), p(d, o.originalStart, u.start.toLocalDate()), s.start = u.start.toLocalDate(), p(d, o.start, u.start.toLocalDate()), s.end = u.end.toLocalDate(), p(d, o.end, u.end.toLocalDate()), s.occurrenceId = String(I), p(d, "occurrenceId", String(I)), s.dataItem = d, s;
|
|
51
62
|
}) : [];
|
|
52
63
|
};
|
|
53
64
|
export {
|
|
54
|
-
|
|
65
|
+
b as toOccurrences
|
|
55
66
|
};
|