@progress/kendo-react-scheduler 16.1.0-develop.7 → 16.1.0-develop.9
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 +199 -191
- package/components/BaseView.d.ts +1 -0
- package/components/BaseView.js +1 -1
- package/components/BaseView.mjs +7 -7
- package/components/DateHeaderCell.js +1 -1
- package/components/DateHeaderCell.mjs +5 -5
- package/constants/index.d.ts +2 -0
- package/constants/index.js +1 -1
- package/constants/index.mjs +15 -13
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/editors/SchedulerRecurrenceDialog.js +1 -1
- package/editors/SchedulerRecurrenceDialog.mjs +191 -188
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +22 -22
- package/items/SchedulerViewItem.d.ts +2 -0
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +118 -116
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/slots/SchedulerSlot.d.ts +2 -0
- package/slots/SchedulerSlot.js +1 -1
- package/slots/SchedulerSlot.mjs +1 -0
- package/tasks/SchedulerTask.js +1 -1
- package/tasks/SchedulerTask.mjs +12 -12
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +48 -24
- package/views/common/VerticalResourceIterator.d.ts +1 -0
- package/views/common/VerticalResourceIterator.js +1 -1
- package/views/common/VerticalResourceIterator.mjs +29 -29
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +77 -77
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +67 -67
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +44 -44
- package/components/footer/bussiness-hours/BussinessHours.d.ts +0 -20
- package/components/footer/bussiness-hours/BussinessHours.js +0 -8
- package/components/footer/bussiness-hours/BussinessHours.mjs +0 -29
package/hooks/useSlotExpand.mjs
CHANGED
|
@@ -10,60 +10,60 @@ import { getPadding as k, getRect as C, setRect as z } from "../views/common/uti
|
|
|
10
10
|
import { BORDER_WIDTH as A } from "../constants/index.mjs";
|
|
11
11
|
import { useIsomorphicLayoutEffect as F } from "@progress/kendo-react-common";
|
|
12
12
|
import { useSchedulerElementContext as M } from "../context/SchedulerContext.mjs";
|
|
13
|
-
const j = (
|
|
13
|
+
const j = (t, o) => {
|
|
14
14
|
const l = f.useRef(void 0), b = f.useRef(0), g = M(), B = () => {
|
|
15
|
-
if (!
|
|
15
|
+
if (!t.current)
|
|
16
16
|
return;
|
|
17
|
-
const n =
|
|
17
|
+
const n = t.current.element;
|
|
18
18
|
n && (b.current = n.clientHeight);
|
|
19
19
|
}, p = f.useCallback(() => {
|
|
20
|
-
if (!o || !
|
|
20
|
+
if (!o || !t.current)
|
|
21
21
|
return;
|
|
22
|
-
const n =
|
|
22
|
+
const n = t.current.element, v = t.current.props;
|
|
23
23
|
if (!n)
|
|
24
24
|
return;
|
|
25
25
|
const a = k(n), e = /* @__PURE__ */ new Map();
|
|
26
26
|
let m = !1;
|
|
27
|
-
const s = v.items.filter((
|
|
28
|
-
s.forEach((
|
|
27
|
+
const s = v.items.filter((r) => r._ref.current);
|
|
28
|
+
s.forEach((r) => {
|
|
29
29
|
var _, x, R, H, E;
|
|
30
|
-
if (!
|
|
30
|
+
if (!r._ref.current)
|
|
31
31
|
return;
|
|
32
|
-
const { height: u } = C(
|
|
33
|
-
(H =
|
|
32
|
+
const { height: u } = C(r._ref.current.element), c = (R = (x = (_ = r._ref.current) == null ? void 0 : _._order) != null ? x : r.order) != null ? R : -1;
|
|
33
|
+
(H = r._ref.current.element) != null && H.style.top && (m = !0), ((E = e.get(c)) != null ? E : 0) < u && e.set(c, u);
|
|
34
34
|
});
|
|
35
35
|
let i, w;
|
|
36
36
|
if (!m || e.size === 0) {
|
|
37
37
|
n.style.minHeight = "";
|
|
38
38
|
return;
|
|
39
39
|
} else {
|
|
40
|
-
const
|
|
41
|
-
w =
|
|
40
|
+
const r = Math.max(...Array.from(e.keys()));
|
|
41
|
+
w = r + 1;
|
|
42
42
|
const u = Math.max(...Array.from(e.values()));
|
|
43
43
|
i = 0;
|
|
44
|
-
for (let c = 0; c <=
|
|
44
|
+
for (let c = 0; c <= r; c++)
|
|
45
45
|
i += e.has(c) ? e.get(c) : u;
|
|
46
46
|
}
|
|
47
47
|
const O = typeof o == "object" && o.offsetTop ? o.offsetTop : 0;
|
|
48
48
|
let h = typeof o == "object" && o.offsetBottom ? o.offsetBottom : 0;
|
|
49
49
|
if (h > 0) {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const u = parseFloat(window.getComputedStyle(
|
|
53
|
-
h =
|
|
50
|
+
const r = n.querySelector(".k-more-events");
|
|
51
|
+
if (r) {
|
|
52
|
+
const u = parseFloat(window.getComputedStyle(r).bottom) || 0;
|
|
53
|
+
h = r.offsetHeight + u;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const y = w * A * 2 + i - a + O + h;
|
|
57
57
|
s.length ? y > b.current - a && z(n, { height: y }, !0) : n && (n.style.minHeight = "");
|
|
58
|
-
}, [o,
|
|
58
|
+
}, [o, t]), d = f.useCallback(() => {
|
|
59
59
|
l.current !== void 0 && window.cancelAnimationFrame(l.current), l.current = window.requestAnimationFrame(() => {
|
|
60
60
|
p();
|
|
61
61
|
});
|
|
62
62
|
}, [p]);
|
|
63
|
-
F(B, []), f.useEffect(p, [
|
|
64
|
-
if (!
|
|
63
|
+
F(B, []), f.useEffect(p, [t, t.current && t.current.props, o]), f.useEffect(() => {
|
|
64
|
+
if (!t.current)
|
|
65
65
|
return;
|
|
66
|
-
const a =
|
|
66
|
+
const a = t.current.props.items.filter((e) => e._ref.current).map((e) => {
|
|
67
67
|
if (!e._ref.current || !e._ref.current.element || !g.current)
|
|
68
68
|
return;
|
|
69
69
|
const m = window.ResizeObserver, s = m && new m(d);
|
|
@@ -76,7 +76,7 @@ const j = (r, o) => {
|
|
|
76
76
|
return () => {
|
|
77
77
|
a.forEach((e) => e && e());
|
|
78
78
|
};
|
|
79
|
-
}, [d, g,
|
|
79
|
+
}, [d, g, t, t.current && t.current.props]);
|
|
80
80
|
};
|
|
81
81
|
export {
|
|
82
82
|
j as useSlotExpand
|
|
@@ -13,6 +13,8 @@ import * as React from 'react';
|
|
|
13
13
|
export interface SchedulerViewItemProps extends SchedulerItemProps {
|
|
14
14
|
/** @hidden */
|
|
15
15
|
ignoreIsAllDay?: boolean;
|
|
16
|
+
/** @hidden */
|
|
17
|
+
slotHeaderOffset?: number;
|
|
16
18
|
/**
|
|
17
19
|
* Overrides the default component responsible for visualizing a single item.
|
|
18
20
|
*
|
|
@@ -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 ye=require("react"),Ee=require("./SchedulerItem.js"),q=require("../utils/index.js"),K=require("../views/common/utils.js"),F=require("../constants/index.js"),De=require("@progress/kendo-react-intl"),ne=require("./SchedulerItemContent.js"),H=require("@progress/kendo-react-common"),w=require("@progress/kendo-svg-icons"),Se=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,ie=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=Se.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||ce.item,P=De.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(c=>{const s=r.filter(z=>G(c.current.props,z.props));s.length>l&&(l=s.length)}),l},we=(n,r)=>n.map(c=>r.filter(s=>G(c.current.props,s.props))),Ie=(n,r,l,c=!1)=>{var j;const s=r.filter(i=>i.props.order!==null&&i.props.order!==void 0).map(i=>{let a=i.props.start,u=i.props.end;if(i.props.isAllDay||c){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:i.props.order,start:a,end:u}}),z=Array.from(new Set(s.map(i=>i.order))).sort((i,a)=>i-a),I=new Map;for(const i of s)I.has(i.order)||I.set(i.order,[]),I.get(i.order).push({start:i.start,end:i.end});const O=[],y=new Map;for(const i of z){const a=I.get(i);let u=-1,E=0;y.forEach((g,N)=>{if(N>=i)return;const D=I.get(N);if(!D)return;a.some(M=>D.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(D=>O[g].every(T=>!q.intersects(T.start,T.end,D.start,D.end,l)))){u=g;break}u===-1&&(u=O.length,O.push([])),O[u].push(...a),y.set(i,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,D,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 c=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 S=(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,S,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 i=0;const a=!e.vertical&&f.current!==null;if(j.forEach(o=>{let S=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&&(S=b.top+b.height-c.top-F.BORDER_WIDTH*f.current+L)}}),S>i&&(i=S)}),a){const o=(D=e.style)==null?void 0:D.height,S=typeof o=="number"?o:parseFloat(o);if(o==null)i=f.current*(J+L);else if(!Number.isNaN(S))i=f.current*(S+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))}),i=Array.from(b.values()).reduce((d,v)=>d+v+L,0)}}if(n.length===0){$(!1);return}const u=le.add?20:0;c.width=e.vertical?c.width/y-F.BORDER_WIDTH-u/y:c.width*n.length-F.BORDER_WIDTH,e.vertical?c.height=c.height*n.length-F.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&y<=1||(c.height=(M=(T=e.style)==null?void 0:T.height)!=null?M:J),c.left=e.vertical?c.left+f.current*c.width+F.BORDER_WIDTH*f.current:c.left;const E=!e.vertical&&e.slotHeaderOffset||0;c.top=e.vertical?c.top:c.top+i+F.BORDER_WIDTH*f.current+E,Z.current=y,K.setRect(r,c),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),!e.isAllDay&&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}))))}),ce={item:Ee.SchedulerItem};ie.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=ie;exports.schedulerViewItemDefaultProps=ce;
|
|
@@ -6,139 +6,139 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { SchedulerItem as
|
|
10
|
-
import { first as
|
|
11
|
-
import { getRect as
|
|
9
|
+
import { SchedulerItem as Ie } from "./SchedulerItem.mjs";
|
|
10
|
+
import { first as Re, calculateOrder as Ae, intersects as C } from "../utils/index.mjs";
|
|
11
|
+
import { getRect as X, setRect as Se } from "../views/common/utils.mjs";
|
|
12
12
|
import { BORDER_WIDTH as k } from "../constants/index.mjs";
|
|
13
|
-
import { useInternationalization as
|
|
14
|
-
import { SchedulerItemContent as
|
|
15
|
-
import { useDir as
|
|
16
|
-
import { chevronRightIcon as
|
|
17
|
-
import { useEditable as
|
|
18
|
-
import { useSchedulerViewItemsContext as
|
|
19
|
-
import { useSchedulerElementContext as
|
|
20
|
-
import { useRowSync as
|
|
21
|
-
const
|
|
22
|
-
(e,
|
|
23
|
-
const { item:
|
|
24
|
-
t.useImperativeHandle(
|
|
25
|
-
const
|
|
13
|
+
import { useInternationalization as De } from "@progress/kendo-react-intl";
|
|
14
|
+
import { SchedulerItemContent as Z } from "./SchedulerItemContent.mjs";
|
|
15
|
+
import { useDir as He, IconWrap as z } from "@progress/kendo-react-common";
|
|
16
|
+
import { chevronRightIcon as p, chevronLeftIcon as ee, chevronUpIcon as be, arrowRotateCwIcon as te, arrowsNoRepeatIcon as re, chevronDownIcon as ze } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { useEditable as xe } from "../hooks/useEditable.mjs";
|
|
18
|
+
import { useSchedulerViewItemsContext as Ne, useSchedulerViewSlotsContext as Fe } from "../context/SchedulerViewContext.mjs";
|
|
19
|
+
import { useSchedulerElementContext as ke } from "../context/SchedulerContext.mjs";
|
|
20
|
+
import { useRowSync as Me } from "../hooks/useRowSync.mjs";
|
|
21
|
+
const q = 1, G = 25, Te = t.forwardRef(
|
|
22
|
+
(e, ne) => {
|
|
23
|
+
const { item: ie, _ref: oe, itemRef: ce, ...le } = e, W = t.useRef(void 0), y = t.useRef(void 0), m = t.useRef(null), U = t.useRef(null), $ = t.useRef(null), ae = xe(e.editable);
|
|
24
|
+
t.useImperativeHandle(U, () => ({ props: e, element: m.current && m.current.element })), t.useImperativeHandle(ne, () => U.current), t.useImperativeHandle(oe, () => m.current), t.useImperativeHandle(ce, () => m.current);
|
|
25
|
+
const se = ie || Oe.item, T = De(), [ue] = Ne(), [de] = Fe(), O = ke(), [me, B] = t.useState(!0), [fe, he] = t.useState(!1), f = t.useRef(e.order), K = t.useRef(0), P = He(O), ge = t.useMemo(
|
|
26
26
|
() => {
|
|
27
27
|
var r, n;
|
|
28
|
-
return e.isAllDay ? (r = e.title) != null ? r : "" : `(${
|
|
28
|
+
return e.isAllDay ? (r = e.title) != null ? r : "" : `(${T.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(n = e.title) != null ? n : ""}`;
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[T, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
31
31
|
);
|
|
32
32
|
let D;
|
|
33
33
|
e.isRecurring && !e.isException ? D = "recurring" : !e.isRecurring && e.isException && (D = "non-recurring");
|
|
34
|
-
const
|
|
35
|
-
() =>
|
|
36
|
-
[
|
|
37
|
-
),
|
|
34
|
+
const ve = t.useMemo(
|
|
35
|
+
() => T.format("{0:t} – {1:t}", e.zonedStart, e.zonedEnd),
|
|
36
|
+
[T, e.zonedStart, e.zonedEnd]
|
|
37
|
+
), j = (r, n) => {
|
|
38
38
|
let a = 1;
|
|
39
39
|
return r.forEach((o) => {
|
|
40
|
-
const s = n.filter((H) =>
|
|
40
|
+
const s = n.filter((H) => L(o.current.props, H.props));
|
|
41
41
|
s.length > a && (a = s.length);
|
|
42
42
|
}), a;
|
|
43
|
-
},
|
|
44
|
-
var
|
|
43
|
+
}, we = (r, n) => r.map((o) => n.filter((s) => L(o.current.props, s.props))), ye = (r, n, a, o = !1) => {
|
|
44
|
+
var V;
|
|
45
45
|
const s = n.filter((i) => i.props.order !== null && i.props.order !== void 0).map((i) => {
|
|
46
46
|
let l = i.props.start, u = i.props.end;
|
|
47
47
|
if (i.props.isAllDay || o) {
|
|
48
48
|
l = new Date(l.getFullYear(), l.getMonth(), l.getDate());
|
|
49
|
-
const
|
|
50
|
-
u =
|
|
49
|
+
const I = new Date(u.getFullYear(), u.getMonth(), u.getDate());
|
|
50
|
+
u = I.getTime() <= l.getTime() ? new Date(l.getFullYear(), l.getMonth(), l.getDate() + 1) : I;
|
|
51
51
|
}
|
|
52
52
|
return { order: i.props.order, start: l, end: u };
|
|
53
|
-
}), H = Array.from(new Set(s.map((i) => i.order))).sort((i, l) => i - l),
|
|
53
|
+
}), H = Array.from(new Set(s.map((i) => i.order))).sort((i, l) => i - l), w = /* @__PURE__ */ new Map();
|
|
54
54
|
for (const i of s)
|
|
55
|
-
|
|
56
|
-
const b = [],
|
|
55
|
+
w.has(i.order) || w.set(i.order, []), w.get(i.order).push({ start: i.start, end: i.end });
|
|
56
|
+
const b = [], E = /* @__PURE__ */ new Map();
|
|
57
57
|
for (const i of H) {
|
|
58
|
-
const l =
|
|
59
|
-
let u = -1,
|
|
60
|
-
|
|
58
|
+
const l = w.get(i);
|
|
59
|
+
let u = -1, I = 0;
|
|
60
|
+
E.forEach((g, x) => {
|
|
61
61
|
if (x >= i)
|
|
62
62
|
return;
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
63
|
+
const R = w.get(x);
|
|
64
|
+
if (!R)
|
|
65
65
|
return;
|
|
66
66
|
l.some(
|
|
67
|
-
(
|
|
68
|
-
(
|
|
67
|
+
(M) => R.some(
|
|
68
|
+
(c) => C(c.start, c.end, M.start, M.end, a)
|
|
69
69
|
)
|
|
70
|
-
) &&
|
|
70
|
+
) && g + 1 > I && (I = g + 1);
|
|
71
71
|
});
|
|
72
|
-
for (let
|
|
72
|
+
for (let g = I; g < b.length; g++)
|
|
73
73
|
if (l.every(
|
|
74
|
-
(
|
|
75
|
-
(N) => !
|
|
74
|
+
(R) => b[g].every(
|
|
75
|
+
(N) => !C(
|
|
76
76
|
N.start,
|
|
77
77
|
N.end,
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
R.start,
|
|
79
|
+
R.end,
|
|
80
80
|
a
|
|
81
81
|
)
|
|
82
82
|
)
|
|
83
83
|
)) {
|
|
84
|
-
u =
|
|
84
|
+
u = g;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
-
u === -1 && (u = b.length, b.push([])), b[u].push(...l),
|
|
87
|
+
u === -1 && (u = b.length, b.push([])), b[u].push(...l), E.set(i, u);
|
|
88
88
|
}
|
|
89
|
-
return (
|
|
90
|
-
},
|
|
89
|
+
return (V = E.get(r)) != null ? V : r;
|
|
90
|
+
}, L = (r, n) => C(r.start, r.end, n.start, n.end) && r.group.index === n.group.index && r.range.index === n.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
|
|
91
91
|
// so we need to also check range.isAllDay to distinguish between them.
|
|
92
|
-
(r.range.isAllDay === void 0 || n.range.isAllDay === void 0 || r.range.isAllDay === n.range.isAllDay) && (e.ignoreIsAllDay || r.isAllDay === n.isAllDay),
|
|
93
|
-
var
|
|
94
|
-
const r = (
|
|
92
|
+
(r.range.isAllDay === void 0 || n.range.isAllDay === void 0 || r.range.isAllDay === n.range.isAllDay) && (e.ignoreIsAllDay || r.isAllDay === n.isAllDay), _ = () => {
|
|
93
|
+
var g, x, R, N, M;
|
|
94
|
+
const r = (de || []).filter((c) => c.current && L(c.current.props, e)), n = m.current && m.current.element, a = Re(r);
|
|
95
95
|
if (r.length === 0) {
|
|
96
|
-
|
|
96
|
+
B(!1);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
if (!a.current || !n)
|
|
100
100
|
return;
|
|
101
|
-
const o =
|
|
102
|
-
(
|
|
103
|
-
c.current && (c.current.props.dragHint ? H.push(c.current) : c.current.props.resizeHint ?
|
|
101
|
+
const o = X(a.current.element), s = [], H = [], w = [];
|
|
102
|
+
(ue || []).forEach((c) => {
|
|
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 ? Ae(
|
|
106
106
|
m.current,
|
|
107
|
-
e.dragHint ? H :
|
|
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
|
|
113
|
-
f.current =
|
|
112
|
+
const A = (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, S = typeof h == "number" ? h : parseFloat(h), d = h != null && Number.isNaN(S), v = !!e.ignoreIsAllDay, Y = v ? !0 : !d;
|
|
113
|
+
f.current = ye(
|
|
114
114
|
e.order,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
A,
|
|
116
|
+
Y,
|
|
117
|
+
v
|
|
118
118
|
);
|
|
119
119
|
} else
|
|
120
120
|
f.current = b;
|
|
121
|
-
let
|
|
122
|
-
const
|
|
121
|
+
let E = e.dragHint || e.resizeHint ? j(r, e.dragHint ? H : w) : j(r, s);
|
|
122
|
+
const V = we(r, s);
|
|
123
123
|
let i = 0;
|
|
124
124
|
const l = !e.vertical && f.current !== null;
|
|
125
|
-
if (
|
|
126
|
-
let
|
|
125
|
+
if (V.forEach((c) => {
|
|
126
|
+
let A = 0;
|
|
127
127
|
c.forEach((h) => {
|
|
128
128
|
if (!l) {
|
|
129
|
-
const S =
|
|
130
|
-
h.props.order !== null && h.props.order !== void 0 && h.props.order < f.current && (
|
|
129
|
+
const S = X(h.element);
|
|
130
|
+
h.props.order !== null && h.props.order !== void 0 && h.props.order < f.current && (A = S.top + S.height - o.top - k * f.current + q);
|
|
131
131
|
}
|
|
132
|
-
}),
|
|
132
|
+
}), A > i && (i = A);
|
|
133
133
|
}), l) {
|
|
134
|
-
const c = (
|
|
134
|
+
const c = (R = e.style) == null ? void 0 : R.height, A = typeof c == "number" ? c : parseFloat(c);
|
|
135
135
|
if (c == null)
|
|
136
|
-
i = f.current * (
|
|
137
|
-
else if (!Number.isNaN(
|
|
138
|
-
i = f.current * (
|
|
136
|
+
i = f.current * (G + q);
|
|
137
|
+
else if (!Number.isNaN(A))
|
|
138
|
+
i = f.current * (A + q);
|
|
139
139
|
else {
|
|
140
140
|
const h = (e.ignoreIsAllDay ? s : s.filter((d) => d.props.isAllDay)).filter(
|
|
141
|
-
(d) => d.props.group.index === e.group.index && d.element !== n && (!e.ignoreIsAllDay || !a.current ||
|
|
141
|
+
(d) => d.props.group.index === e.group.index && d.element !== n && (!e.ignoreIsAllDay || !a.current || C(
|
|
142
142
|
d.props.start,
|
|
143
143
|
d.props.end,
|
|
144
144
|
a.current.props.start,
|
|
@@ -146,92 +146,94 @@ const C = 1, Y = 25, Me = t.forwardRef(
|
|
|
146
146
|
))
|
|
147
147
|
), S = /* @__PURE__ */ new Map();
|
|
148
148
|
h.forEach((d) => {
|
|
149
|
-
var F,
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
149
|
+
var F, Q;
|
|
150
|
+
const v = d._order;
|
|
151
|
+
if (v == null || v >= f.current)
|
|
152
152
|
return;
|
|
153
|
-
const
|
|
154
|
-
S.set(
|
|
155
|
-
}), i = Array.from(S.values()).reduce((d,
|
|
153
|
+
const Y = ((F = d.element) == null ? void 0 : F.offsetHeight) || G;
|
|
154
|
+
S.set(v, Math.max((Q = S.get(v)) != null ? Q : 0, Y));
|
|
155
|
+
}), i = Array.from(S.values()).reduce((d, v) => d + v + q, 0);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
if (r.length === 0) {
|
|
159
|
-
|
|
159
|
+
B(!1);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
const u =
|
|
163
|
-
o.width = e.vertical ? o.width /
|
|
164
|
-
|
|
162
|
+
const u = ae.add ? 20 : 0;
|
|
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
|
+
const I = !e.vertical && e.slotHeaderOffset || 0;
|
|
165
|
+
o.top = e.vertical ? o.top : o.top + i + k * f.current + I, K.current = E, Se(n, o), he(!0), B(!0);
|
|
166
|
+
}, J = t.useCallback(
|
|
165
167
|
(r) => {
|
|
166
|
-
const n = r && r[0], a =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
})),
|
|
168
|
+
const n = r && r[0], a = $.current;
|
|
169
|
+
W.current !== void 0 && window.cancelAnimationFrame(W.current), a && n && (a.width !== n.contentRect.width || a.height !== n.contentRect.height) && (W.current = window.requestAnimationFrame(() => {
|
|
170
|
+
_();
|
|
171
|
+
})), $.current = { width: n.contentRect.width, height: n.contentRect.height };
|
|
170
172
|
},
|
|
171
|
-
[
|
|
173
|
+
[_]
|
|
172
174
|
);
|
|
173
|
-
t.useEffect(() => (
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
t.useEffect(() => (_(), y.current !== void 0 && window.cancelAnimationFrame(y.current), y.current = window.requestAnimationFrame(() => {
|
|
176
|
+
y.current = window.requestAnimationFrame(() => {
|
|
177
|
+
y.current = void 0, _();
|
|
176
178
|
});
|
|
177
179
|
}), () => {
|
|
178
|
-
|
|
180
|
+
y.current !== void 0 && (window.cancelAnimationFrame(y.current), y.current = void 0);
|
|
179
181
|
}));
|
|
180
|
-
const
|
|
181
|
-
return
|
|
182
|
-
element:
|
|
182
|
+
const Ee = m.current && m.current.element ? m.current.element.closest(".k-scheduler-layout") : null;
|
|
183
|
+
return Me({
|
|
184
|
+
element: Ee,
|
|
183
185
|
selector: ".k-resource-row",
|
|
184
186
|
horizontalAttribute: "data-depth-index",
|
|
185
187
|
verticalAttribute: "data-resource-index",
|
|
186
188
|
applyTo: ".k-resource-cell",
|
|
187
189
|
syncHeight: e.isLast
|
|
188
190
|
}), t.useEffect(() => {
|
|
189
|
-
if (!
|
|
191
|
+
if (!O.current)
|
|
190
192
|
return;
|
|
191
|
-
const r = window.ResizeObserver, n = r && new r(
|
|
192
|
-
return n && n.observe(
|
|
193
|
+
const r = window.ResizeObserver, n = r && new r(J);
|
|
194
|
+
return n && n.observe(O.current), () => {
|
|
193
195
|
n && n.disconnect();
|
|
194
196
|
};
|
|
195
|
-
}, [
|
|
196
|
-
|
|
197
|
+
}, [J, O]), /* @__PURE__ */ t.createElement(
|
|
198
|
+
se,
|
|
197
199
|
{
|
|
198
|
-
...
|
|
200
|
+
...le,
|
|
199
201
|
_ref: m,
|
|
200
|
-
_maxSiblingsPerSlot:
|
|
202
|
+
_maxSiblingsPerSlot: K,
|
|
201
203
|
_order: f,
|
|
202
204
|
itemRef: m,
|
|
203
205
|
style: {
|
|
204
|
-
visibility:
|
|
205
|
-
display:
|
|
206
|
+
visibility: fe ? void 0 : "hidden",
|
|
207
|
+
display: me ? void 0 : "none",
|
|
206
208
|
...e.style
|
|
207
209
|
}
|
|
208
210
|
},
|
|
209
211
|
!e.resizeHint && /* @__PURE__ */ t.createElement(t.Fragment, null, e.tail && !e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(
|
|
210
212
|
z,
|
|
211
213
|
{
|
|
212
|
-
name:
|
|
213
|
-
icon:
|
|
214
|
+
name: P === "rtl" ? "chevron-right" : "chevron-left",
|
|
215
|
+
icon: P === "rtl" ? p : ee
|
|
214
216
|
}
|
|
215
|
-
)), /* @__PURE__ */ t.createElement("div", { 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), !e.isAllDay && /* @__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(
|
|
216
218
|
z,
|
|
217
219
|
{
|
|
218
220
|
name: D === "recurring" ? "arrow-rotate-cw" : "arrows-no-repeat",
|
|
219
|
-
icon: D === "recurring" ?
|
|
221
|
+
icon: D === "recurring" ? te : re
|
|
220
222
|
}
|
|
221
223
|
)), e.head && !e.vertical && /* @__PURE__ */ t.createElement("span", { className: "k-event-continuation" }, /* @__PURE__ */ t.createElement(
|
|
222
224
|
z,
|
|
223
225
|
{
|
|
224
|
-
name:
|
|
225
|
-
icon:
|
|
226
|
+
name: P === "rtl" ? "chevron-left" : "chevron-right",
|
|
227
|
+
icon: P === "rtl" ? ee : p
|
|
226
228
|
}
|
|
227
229
|
)))
|
|
228
230
|
);
|
|
229
231
|
}
|
|
230
|
-
),
|
|
231
|
-
item:
|
|
232
|
+
), Oe = {
|
|
233
|
+
item: Ie
|
|
232
234
|
};
|
|
233
|
-
|
|
235
|
+
Te.displayName = "KendoReactSchedulerViewItem";
|
|
234
236
|
export {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
+
Te as SchedulerViewItem,
|
|
238
|
+
Oe as schedulerViewItemDefaultProps
|
|
237
239
|
};
|
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: 1787749000,version:"16.1.0-develop.9",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.1.0-develop.
|
|
9
|
+
publishDate: 1787749000,
|
|
10
|
+
version: '16.1.0-develop.9',
|
|
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.1.0-develop.
|
|
3
|
+
"version": "16.1.0-develop.9",
|
|
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",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@progress/kendo-date-math": "^1.4.1",
|
|
30
30
|
"@progress/kendo-drawing": "^1.21.2",
|
|
31
31
|
"@progress/kendo-licensing": "^1.7.2",
|
|
32
|
-
"@progress/kendo-react-buttons": "16.1.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "16.1.0-develop.
|
|
34
|
-
"@progress/kendo-react-dateinputs": "16.1.0-develop.
|
|
35
|
-
"@progress/kendo-react-dialogs": "16.1.0-develop.
|
|
36
|
-
"@progress/kendo-react-dropdowns": "16.1.0-develop.
|
|
37
|
-
"@progress/kendo-react-form": "16.1.0-develop.
|
|
38
|
-
"@progress/kendo-react-inputs": "16.1.0-develop.
|
|
39
|
-
"@progress/kendo-react-intl": "16.1.0-develop.
|
|
40
|
-
"@progress/kendo-react-popup": "16.1.0-develop.
|
|
41
|
-
"@progress/kendo-react-tooltip": "16.1.0-develop.
|
|
32
|
+
"@progress/kendo-react-buttons": "16.1.0-develop.9",
|
|
33
|
+
"@progress/kendo-react-common": "16.1.0-develop.9",
|
|
34
|
+
"@progress/kendo-react-dateinputs": "16.1.0-develop.9",
|
|
35
|
+
"@progress/kendo-react-dialogs": "16.1.0-develop.9",
|
|
36
|
+
"@progress/kendo-react-dropdowns": "16.1.0-develop.9",
|
|
37
|
+
"@progress/kendo-react-form": "16.1.0-develop.9",
|
|
38
|
+
"@progress/kendo-react-inputs": "16.1.0-develop.9",
|
|
39
|
+
"@progress/kendo-react-intl": "16.1.0-develop.9",
|
|
40
|
+
"@progress/kendo-react-popup": "16.1.0-develop.9",
|
|
41
|
+
"@progress/kendo-react-tooltip": "16.1.0-develop.9",
|
|
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": 1787749000,
|
|
117
117
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
|
|
118
118
|
}
|
|
119
119
|
},
|
package/slots/SchedulerSlot.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export interface SchedulerSlotProps extends Slot {
|
|
|
40
40
|
* - `userSelect`: `none`
|
|
41
41
|
*/
|
|
42
42
|
style?: React.CSSProperties;
|
|
43
|
+
/** @hidden */
|
|
44
|
+
role?: string;
|
|
43
45
|
/**
|
|
44
46
|
* Specifies the `children` of the SchedulerSlot. By default, no child elements are rendered.
|
|
45
47
|
*/
|
package/slots/SchedulerSlot.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 T=require("react"),q=require("@progress/kendo-react-common"),B=require("../hooks/useSchedulerSlot.js");function F(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const n=F(T),m=n.forwardRef((e,r)=>{const{onFocus:a,onBlur:o,onClick:c,onMouseEnter:u,onMouseLeave:s,onMouseOut:d,onMouseOver:i,onDoubleClick:k,onKeyDown:b,onKeyPress:f,onKeyUp:y}=e,{slot:l,element:C}=B.useSchedulerSlot(e,r),S=e.tabIndex!==void 0?e.tabIndex===null?void 0:e.tabIndex:e.selected?0:-1,D=n.useMemo(()=>{var v,h;const t=(v=e.isWorkHour)!=null?v:g.isWorkHour,I=(h=e.isWorkDay)!=null?h:g.isWorkDay;return q.classNames("k-scheduler-cell",e.className,"k-slot-cell",{"k-nonwork-hour":!t||!I,"k-selected":e.selected})},[e.className,e.selected,e.isWorkHour,e.isWorkDay]),M=n.useMemo(()=>({userSelect:"none",...e.style}),[e.style]),O=n.useCallback(t=>{a&&a.call(void 0,{syntheticEvent:t,target:l.current})},[a,l]),K=n.useCallback(t=>{o&&o.call(void 0,{syntheticEvent:t,target:l.current})},[o,l]),W=n.useCallback(t=>{c&&c.call(void 0,{syntheticEvent:t,target:l.current})},[c,l]),x=n.useCallback(t=>{i&&i.call(void 0,{syntheticEvent:t,target:l.current})},[i,l]),P=n.useCallback(t=>{d&&d.call(void 0,{syntheticEvent:t,target:l.current})},[d,l]),w=n.useCallback(t=>{u&&u.call(void 0,{syntheticEvent:t,target:l.current})},[u,l]),N=n.useCallback(t=>{s&&s.call(void 0,{syntheticEvent:t,target:l.current})},[s,l]),j=n.useCallback(t=>{k&&k.call(void 0,{syntheticEvent:t,target:l.current})},[k,l]),H=n.useCallback(t=>{b&&b.call(void 0,{syntheticEvent:t,target:l.current})},[b,l]),R=n.useCallback(t=>{f&&f.call(void 0,{syntheticEvent:t,target:l.current})},[f,l]),E=n.useCallback(t=>{y&&y.call(void 0,{syntheticEvent:t,target:l.current})},[y,l]);return n.createElement("div",{ref:C,id:e.id,style:M,className:D,tabIndex:S,"aria-selected":e.selected||void 0,onFocus:O,onBlur:K,onClick:W,onMouseEnter:w,onMouseLeave:N,onMouseOver:x,onMouseOut:P,onDoubleClick:j,onKeyDown:H,onKeyPress:R,onKeyUp:E,"data-slot":!0,"data-slot-allday":e.isAllDay,"data-slot-start":e.start.getTime(),"data-slot-end":e.end.getTime(),"data-slot-group":e.group.index,"data-slot-range":e.range.index,"data-slot-index":e.index},e.children)}),g={isWorkHour:!0,isWorkDay:!0};m.displayName="KendoReactSchedulerSlot";exports.SchedulerSlot=m;exports.schedulerSlotDefaultProps=g;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),q=require("@progress/kendo-react-common"),B=require("../hooks/useSchedulerSlot.js");function F(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const n=F(T),m=n.forwardRef((e,r)=>{const{onFocus:a,onBlur:o,onClick:c,onMouseEnter:u,onMouseLeave:s,onMouseOut:d,onMouseOver:i,onDoubleClick:k,onKeyDown:b,onKeyPress:f,onKeyUp:y}=e,{slot:l,element:C}=B.useSchedulerSlot(e,r),S=e.tabIndex!==void 0?e.tabIndex===null?void 0:e.tabIndex:e.selected?0:-1,D=n.useMemo(()=>{var v,h;const t=(v=e.isWorkHour)!=null?v:g.isWorkHour,I=(h=e.isWorkDay)!=null?h:g.isWorkDay;return q.classNames("k-scheduler-cell",e.className,"k-slot-cell",{"k-nonwork-hour":!t||!I,"k-selected":e.selected})},[e.className,e.selected,e.isWorkHour,e.isWorkDay]),M=n.useMemo(()=>({userSelect:"none",...e.style}),[e.style]),O=n.useCallback(t=>{a&&a.call(void 0,{syntheticEvent:t,target:l.current})},[a,l]),K=n.useCallback(t=>{o&&o.call(void 0,{syntheticEvent:t,target:l.current})},[o,l]),W=n.useCallback(t=>{c&&c.call(void 0,{syntheticEvent:t,target:l.current})},[c,l]),x=n.useCallback(t=>{i&&i.call(void 0,{syntheticEvent:t,target:l.current})},[i,l]),P=n.useCallback(t=>{d&&d.call(void 0,{syntheticEvent:t,target:l.current})},[d,l]),w=n.useCallback(t=>{u&&u.call(void 0,{syntheticEvent:t,target:l.current})},[u,l]),N=n.useCallback(t=>{s&&s.call(void 0,{syntheticEvent:t,target:l.current})},[s,l]),j=n.useCallback(t=>{k&&k.call(void 0,{syntheticEvent:t,target:l.current})},[k,l]),H=n.useCallback(t=>{b&&b.call(void 0,{syntheticEvent:t,target:l.current})},[b,l]),R=n.useCallback(t=>{f&&f.call(void 0,{syntheticEvent:t,target:l.current})},[f,l]),E=n.useCallback(t=>{y&&y.call(void 0,{syntheticEvent:t,target:l.current})},[y,l]);return n.createElement("div",{ref:C,id:e.id,style:M,className:D,tabIndex:S,role:e.role,"aria-selected":e.selected||void 0,onFocus:O,onBlur:K,onClick:W,onMouseEnter:w,onMouseLeave:N,onMouseOver:x,onMouseOut:P,onDoubleClick:j,onKeyDown:H,onKeyPress:R,onKeyUp:E,"data-slot":!0,"data-slot-allday":e.isAllDay,"data-slot-start":e.start.getTime(),"data-slot-end":e.end.getTime(),"data-slot-group":e.group.index,"data-slot-range":e.range.index,"data-slot-index":e.index},e.children)}),g={isWorkHour:!0,isWorkDay:!0};m.displayName="KendoReactSchedulerSlot";exports.SchedulerSlot=m;exports.schedulerSlotDefaultProps=g;
|