@progress/kendo-react-scheduler 16.0.1-develop.1 → 16.1.0-develop.10
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 +239 -228
- package/components/BaseView.d.ts +1 -0
- package/components/BaseView.js +1 -1
- package/components/BaseView.mjs +7 -7
- package/components/CurrentTimeMarket.js +1 -1
- package/components/CurrentTimeMarket.mjs +26 -26
- package/components/DateHeaderCell.js +1 -1
- package/components/DateHeaderCell.mjs +5 -5
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +45 -29
- 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/index.d.ts +2 -2
- package/hooks/usePropOrState.d.ts +2 -1
- package/hooks/usePropOrState.js +8 -0
- package/hooks/usePropOrState.mjs +16 -0
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +22 -22
- package/hooks/useWorkHours.d.ts +1 -1
- package/hooks/useWorkHours.js +8 -0
- package/hooks/useWorkHours.mjs +18 -0
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +94 -97
- package/items/SchedulerViewItem.d.ts +2 -0
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +152 -150
- package/models/Group.d.ts +2 -0
- package/models/SchedulerView.d.ts +4 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/services/itemsService.js +1 -1
- package/services/itemsService.mjs +34 -34
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +40 -34
- 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/utils/index.js +1 -1
- package/utils/index.mjs +14 -14
- 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 +108 -104
- 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 +101 -96
- 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/components/BaseView.d.ts
CHANGED
package/components/BaseView.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"),a=require("@progress/kendo-react-common"),w=require("../context/SchedulerViewContext.js"),d=require("../hooks/use-items-selection.js"),S=require("../hooks/use-slots-selection.js"),m=require("../hooks/useCellSync.js"),x=require("../hooks/use-slots-focus.js"),E=require("../hooks/use-items-focus.js");function _(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const s=_(T),f=s.forwardRef((e,l)=>{const t=s.useRef(null);s.useImperativeHandle(l,()=>t.current);const[c,h]=a.useCollection([]),[i,p]=a.useCollection([]),[I,y]=E.useItemsFocus(c),[C,b]=x.useSlotsFocus(i),[g,o]=d.useItemsSelection(c),[O,n]=S.useSlotsSelection(),k=s.useCallback((u,r)=>{n({type:S.SLOTS_SELECT_ACTION.reset}),o(u,r)},[o,n]),q=s.useCallback((u,r)=>{o({type:d.ITEMS_SELECT_ACTION.reset},r),n(u)},[o,n]),N=s.useMemo(()=>a.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return m.useCellSync({element:t,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),m.useCellSync({element:t,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),s.createElement(w.SchedulerViewContext,{props:e.props,ranges:e.ranges,items:[c,h],slots:[i,p],selectedItems:[g,k],selectedSlots:[O,q],focusedItems:[I,y],focusedSlots:[C,b]},s.createElement("div",{ref:t,style:e.style,className:N,role:"
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),a=require("@progress/kendo-react-common"),w=require("../context/SchedulerViewContext.js"),d=require("../hooks/use-items-selection.js"),S=require("../hooks/use-slots-selection.js"),m=require("../hooks/useCellSync.js"),x=require("../hooks/use-slots-focus.js"),E=require("../hooks/use-items-focus.js");function _(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const s=_(T),f=s.forwardRef((e,l)=>{const t=s.useRef(null);s.useImperativeHandle(l,()=>t.current);const[c,h]=a.useCollection([]),[i,p]=a.useCollection([]),[I,y]=E.useItemsFocus(c),[C,b]=x.useSlotsFocus(i),[g,o]=d.useItemsSelection(c),[O,n]=S.useSlotsSelection(),k=s.useCallback((u,r)=>{n({type:S.SLOTS_SELECT_ACTION.reset}),o(u,r)},[o,n]),q=s.useCallback((u,r)=>{o({type:d.ITEMS_SELECT_ACTION.reset},r),n(u)},[o,n]),N=s.useMemo(()=>a.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return m.useCellSync({element:t,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),m.useCellSync({element:t,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),s.createElement(w.SchedulerViewContext,{props:e.props,ranges:e.ranges,items:[c,h],slots:[i,p],selectedItems:[g,k],selectedSlots:[O,q],focusedItems:[I,y],focusedSlots:[C,b]},s.createElement("div",{ref:t,style:e.style,className:N,role:e.role||"none"},e.children))});f.displayName="KendoReactSchedulerBaseView";exports.BaseView=f;
|
package/components/BaseView.mjs
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { useCollection as
|
|
9
|
+
import { useCollection as m, classNames as k } from "@progress/kendo-react-common";
|
|
10
10
|
import { SchedulerViewContext as T } from "../context/SchedulerViewContext.mjs";
|
|
11
11
|
import { useItemsSelection as b, ITEMS_SELECT_ACTION as w } from "../hooks/use-items-selection.mjs";
|
|
12
12
|
import { useSlotsSelection as A, SLOTS_SELECT_ACTION as F } from "../hooks/use-slots-selection.mjs";
|
|
13
|
-
import { useCellSync as
|
|
13
|
+
import { useCellSync as i } from "../hooks/useCellSync.mjs";
|
|
14
14
|
import { useSlotsFocus as R } from "../hooks/use-slots-focus.mjs";
|
|
15
15
|
import { useItemsFocus as _ } from "../hooks/use-items-focus.mjs";
|
|
16
16
|
const g = e.forwardRef((t, n) => {
|
|
17
17
|
const s = e.useRef(null);
|
|
18
18
|
e.useImperativeHandle(n, () => s.current);
|
|
19
|
-
const [o, u] =
|
|
19
|
+
const [o, u] = m([]), [d, S] = m([]), [h, f] = _(o), [p, I] = R(d), [C, l] = b(o), [y, c] = A(), x = e.useCallback(
|
|
20
20
|
(a, r) => {
|
|
21
21
|
c({ type: F.reset }), l(a, r);
|
|
22
22
|
},
|
|
@@ -30,7 +30,7 @@ const g = e.forwardRef((t, n) => {
|
|
|
30
30
|
() => k("k-scheduler-layout k-scheduler-layout-flex", t.className),
|
|
31
31
|
[t.className]
|
|
32
32
|
);
|
|
33
|
-
return
|
|
33
|
+
return i({ element: s, selector: ".k-group-cell", attribute: "data-depth-index", explicitDepth: !0 }), i({ element: s, selector: ".k-side-cell", attribute: "data-depth-index", explicitDepth: !1 }), /* @__PURE__ */ e.createElement(
|
|
34
34
|
T,
|
|
35
35
|
{
|
|
36
36
|
props: t.props,
|
|
@@ -39,10 +39,10 @@ const g = e.forwardRef((t, n) => {
|
|
|
39
39
|
slots: [d, S],
|
|
40
40
|
selectedItems: [C, x],
|
|
41
41
|
selectedSlots: [y, E],
|
|
42
|
-
focusedItems: [
|
|
43
|
-
focusedSlots: [
|
|
42
|
+
focusedItems: [h, f],
|
|
43
|
+
focusedSlots: [p, I]
|
|
44
44
|
},
|
|
45
|
-
/* @__PURE__ */ e.createElement("div", { ref: s, style: t.style, className: N, role: "
|
|
45
|
+
/* @__PURE__ */ e.createElement("div", { ref: s, style: t.style, className: N, role: t.role || "none" }, t.children)
|
|
46
46
|
);
|
|
47
47
|
});
|
|
48
48
|
g.displayName = "KendoReactSchedulerBaseView";
|
|
@@ -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=require("react"),P=require("react-dom"),z=require("@progress/kendo-date-math"),k=require("@progress/kendo-react-common"),w=require("../utils/index.js"),h=require("../views/common/utils.js"),I=require("../context/SchedulerContext.js"),j=require("../context/SchedulerViewContext.js");function M(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const c=M(E),_=M(P),$=e=>{let r=0;return e.forEach(n=>{if(n.current){const s=h.getRect(n.current.element);r+=s.width}}),r},A=e=>{let r=0;return e.forEach(n=>{if(n.current){const s=h.getRect(n.current.element);r+=s.height}}),r},N=(e,r)=>{const n=z.cloneDate(e);return n.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),n},H=e=>{const[r,n]=c.useState(!1),s=I.useSchedulerElementContext(),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),P=require("react-dom"),z=require("@progress/kendo-date-math"),k=require("@progress/kendo-react-common"),w=require("../utils/index.js"),h=require("../views/common/utils.js"),I=require("../context/SchedulerContext.js"),j=require("../context/SchedulerViewContext.js");function M(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const c=M(E),_=M(P),$=e=>{let r=0;return e.forEach(n=>{if(n.current){const s=h.getRect(n.current.element);r+=s.width}}),r},A=e=>{let r=0;return e.forEach(n=>{if(n.current){const s=h.getRect(n.current.element);r+=s.height}}),r},N=(e,r)=>{const n=z.cloneDate(e);return n.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),n},H=e=>{const[r,n]=c.useState(!1),s=I.useSchedulerElementContext(),p=I.useSchedulerPropsContext(),m=c.useRef(void 0),o=c.useRef(null),i=c.useRef(null),y=e.updateInterval||X.updateInterval,[,T]=c.useState(!1),a=k.useDir(i,p.rtl===!0?"rtl":void 0),[v]=j.useSchedulerViewSlotsContext(),d=c.useCallback(()=>{if(!v)return;const l=v.filter(t=>t.current&&(e.groupIndex===void 0||e.groupIndex===null||t.current.props.group.index===e.groupIndex)&&(e.vertical?w.intersects(new Date,new Date,t.current.props.start,t.current.props.end,!0):w.isInTimeRange(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay);if(l&&l.length&&o.current&&i.current){const t=w.first(l);if(!t.current)return;const C=e.vertical?A(l):$(l),u=h.getRect(t.current.element),x=h.getRect(o.current),O=(e.vertical?u.width:u.height)/(t.current.props.end.getTime()-t.current.props.start.getTime()),R=(Date.now()-N(new Date,t.current.props.start).getTime())*O,q=a==="rtl",S=e.vertical?u.top:u.top+R-x.height/2,f=q?"right":"left",D=e.vertical?u[f]+R-x.width/2:u[f];e.vertical?o.current.style[f]=`${D}px`:o.current.style.top=`${S}px`,i.current.style[f]=`${D}px`,i.current.style.top=`${S}px`,i.current.style[e.vertical?"height":"width"]=`${C-1}px`,n(!0)}else o.current&&(o.current.style.top="",o.current.style.left="",o.current.style.right=""),i.current&&(i.current.style.top="",i.current.style.left="",i.current.style.right=""),n(!1)},[v,e.groupIndex,e.vertical,a]),g=c.useCallback(()=>{d(),T(l=>!l)},[d]);c.useEffect(()=>{if(!s.current||!window)return;clearInterval(m.current),m.current=window.setInterval(g,y);const l=window.ResizeObserver,t=l&&new l(g);return t&&t.observe(s.current),()=>{clearInterval(m.current),t&&t.disconnect()}},[d,g,s,y]),c.useEffect(d);const b=c.createElement("div",{ref:o,className:k.classNames("k-current-time",{"k-current-time-arrow-right":!e.vertical&&a!=="rtl","k-current-time-arrow-left":!e.vertical&&a==="rtl","k-current-time-arrow-down":e.vertical}),style:{transform:e.vertical?a==="rtl"?"translateX(50%)":"translateX(-50%)":"translateY(-50%)",visibility:r?void 0:"hidden"}});return c.createElement(c.Fragment,null,e.attachArrow&&e.attachArrow.current?_.createPortal(b,e.attachArrow.current):b,c.createElement("div",{className:"k-current-time",ref:i,style:{transform:e.vertical?"translateX(-50%)":"translateY(-50%)",[e.vertical?"width":"height"]:"1px",visibility:r?void 0:"hidden"}}))},X={updateInterval:6e4};exports.CurrentTimeMarker=H;
|
|
@@ -10,66 +10,66 @@ import * as T from "react-dom";
|
|
|
10
10
|
import { cloneDate as M } from "@progress/kendo-date-math";
|
|
11
11
|
import { useDir as C, classNames as z } from "@progress/kendo-react-common";
|
|
12
12
|
import { intersects as P, isInTimeRange as $, first as A } from "../utils/index.mjs";
|
|
13
|
-
import { getRect as
|
|
13
|
+
import { getRect as h } from "../views/common/utils.mjs";
|
|
14
14
|
import { useSchedulerElementContext as H, useSchedulerPropsContext as N } from "../context/SchedulerContext.mjs";
|
|
15
15
|
import { useSchedulerViewSlotsContext as O } from "../context/SchedulerViewContext.mjs";
|
|
16
16
|
const X = (e) => {
|
|
17
17
|
let r = 0;
|
|
18
18
|
return e.forEach((c) => {
|
|
19
19
|
if (c.current) {
|
|
20
|
-
const
|
|
21
|
-
r +=
|
|
20
|
+
const o = h(c.current.element);
|
|
21
|
+
r += o.width;
|
|
22
22
|
}
|
|
23
23
|
}), r;
|
|
24
24
|
}, F = (e) => {
|
|
25
25
|
let r = 0;
|
|
26
26
|
return e.forEach((c) => {
|
|
27
27
|
if (c.current) {
|
|
28
|
-
const
|
|
29
|
-
r +=
|
|
28
|
+
const o = h(c.current.element);
|
|
29
|
+
r += o.height;
|
|
30
30
|
}
|
|
31
31
|
}), r;
|
|
32
32
|
}, Y = (e, r) => {
|
|
33
33
|
const c = M(e);
|
|
34
34
|
return c.setHours(r.getHours(), r.getMinutes(), r.getSeconds(), r.getMilliseconds()), c;
|
|
35
35
|
}, K = (e) => {
|
|
36
|
-
const [r, c] = n.useState(!1),
|
|
36
|
+
const [r, c] = n.useState(!1), o = H(), b = N(), d = n.useRef(void 0), l = n.useRef(null), s = n.useRef(null), g = e.updateInterval || V.updateInterval, [, R] = n.useState(!1), a = C(s, b.rtl === !0 ? "rtl" : void 0), [v] = O(), f = n.useCallback(() => {
|
|
37
37
|
if (!v)
|
|
38
38
|
return;
|
|
39
|
-
const
|
|
39
|
+
const i = v.filter(
|
|
40
40
|
(t) => t.current && (e.groupIndex === void 0 || e.groupIndex === null || t.current.props.group.index === e.groupIndex) && (e.vertical ? P(/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date(), t.current.props.start, t.current.props.end, !0) : $(/* @__PURE__ */ new Date(), t.current.props.start, t.current.props.end)) && !t.current.props.isAllDay
|
|
41
41
|
);
|
|
42
|
-
if (
|
|
43
|
-
const t = A(
|
|
42
|
+
if (i && i.length && l.current && s.current) {
|
|
43
|
+
const t = A(i);
|
|
44
44
|
if (!t.current)
|
|
45
45
|
return;
|
|
46
|
-
const S = e.vertical ? F(
|
|
47
|
-
e.vertical ?
|
|
46
|
+
const S = e.vertical ? F(i) : X(i), u = h(t.current.element), y = h(l.current), k = (e.vertical ? u.width : u.height) / (t.current.props.end.getTime() - t.current.props.start.getTime()), p = (Date.now() - Y(/* @__PURE__ */ new Date(), t.current.props.start).getTime()) * k, E = a === "rtl", I = e.vertical ? u.top : u.top + p - y.height / 2, m = E ? "right" : "left", D = e.vertical ? u[m] + p - y.width / 2 : u[m];
|
|
47
|
+
e.vertical ? l.current.style[m] = `${D}px` : l.current.style.top = `${I}px`, s.current.style[m] = `${D}px`, s.current.style.top = `${I}px`, s.current.style[e.vertical ? "height" : "width"] = `${S - 1}px`, c(!0);
|
|
48
48
|
} else
|
|
49
|
-
c(!1);
|
|
50
|
-
}, [v, e.groupIndex, e.vertical,
|
|
51
|
-
|
|
52
|
-
}, [
|
|
49
|
+
l.current && (l.current.style.top = "", l.current.style.left = "", l.current.style.right = ""), s.current && (s.current.style.top = "", s.current.style.left = "", s.current.style.right = ""), c(!1);
|
|
50
|
+
}, [v, e.groupIndex, e.vertical, a]), w = n.useCallback(() => {
|
|
51
|
+
f(), R((i) => !i);
|
|
52
|
+
}, [f]);
|
|
53
53
|
n.useEffect(() => {
|
|
54
|
-
if (!
|
|
54
|
+
if (!o.current || !window)
|
|
55
55
|
return;
|
|
56
|
-
clearInterval(
|
|
57
|
-
const
|
|
58
|
-
return t && t.observe(
|
|
59
|
-
clearInterval(
|
|
56
|
+
clearInterval(d.current), d.current = window.setInterval(w, g);
|
|
57
|
+
const i = window.ResizeObserver, t = i && new i(w);
|
|
58
|
+
return t && t.observe(o.current), () => {
|
|
59
|
+
clearInterval(d.current), t && t.disconnect();
|
|
60
60
|
};
|
|
61
|
-
}, [
|
|
61
|
+
}, [f, w, o, g]), n.useEffect(f);
|
|
62
62
|
const x = /* @__PURE__ */ n.createElement(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
ref:
|
|
65
|
+
ref: l,
|
|
66
66
|
className: z("k-current-time", {
|
|
67
|
-
"k-current-time-arrow-right": !e.vertical &&
|
|
68
|
-
"k-current-time-arrow-left": !e.vertical &&
|
|
67
|
+
"k-current-time-arrow-right": !e.vertical && a !== "rtl",
|
|
68
|
+
"k-current-time-arrow-left": !e.vertical && a === "rtl",
|
|
69
69
|
"k-current-time-arrow-down": e.vertical
|
|
70
70
|
}),
|
|
71
71
|
style: {
|
|
72
|
-
transform: e.vertical ?
|
|
72
|
+
transform: e.vertical ? a === "rtl" ? "translateX(50%)" : "translateX(-50%)" : "translateY(-50%)",
|
|
73
73
|
visibility: r ? void 0 : "hidden"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -78,7 +78,7 @@ const X = (e) => {
|
|
|
78
78
|
"div",
|
|
79
79
|
{
|
|
80
80
|
className: "k-current-time",
|
|
81
|
-
ref:
|
|
81
|
+
ref: s,
|
|
82
82
|
style: {
|
|
83
83
|
transform: e.vertical ? "translateX(-50%)" : "translateY(-50%)",
|
|
84
84
|
[e.vertical ? "width" : "height"]: "1px",
|
|
@@ -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 k=require("react"),y=require("@progress/kendo-react-intl"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),y=require("@progress/kendo-react-intl"),D=require("@progress/kendo-react-common");function g(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const c=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(l,a,c.get?c:{enumerable:!0,get:()=>e[a]})}}return l.default=e,Object.freeze(l)}const t=g(k),u=t.forwardRef((e,l)=>{var m;const{as:a=d.as,...c}=e,n=t.useRef(null),s=t.useRef(null),o=y.useInternationalization(),i=t.useMemo(()=>D.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);t.useImperativeHandle(s,()=>({element:n.current&&n.current.element?n.current.element:n.current,props:e})),t.useImperativeHandle(l,()=>s.current);const r=(m=e.format)!=null?m:d.format,f=typeof r=="object"&&"skeleton"in r&&typeof r.skeleton=="string"&&r.skeleton.includes("E")&&r.skeleton.includes("d");return t.createElement(a,{ref:a!==d.as?void 0:n,...c,className:i},f?t.createElement(t.Fragment,null,t.createElement("span",{className:"k-scheduler-date-day"},o.formatDate(e.date,"EEE")),t.createElement("span",{className:"k-link k-nav-day","aria-label":o.formatDate(e.date,{skeleton:"Ed"})},o.formatDate(e.date,{skeleton:"d"}))," "):t.createElement("span",{className:"k-link k-nav-day"},o.formatDate(e.date,r)))}),d={as:t.forwardRef(({as:e,format:l,start:a,end:c,...n},s)=>t.createElement("div",{...n,ref:s})),format:"d"};u.displayName="KendoReactSchedulerDateHeaderCell";exports.DateHeaderCell=u;exports.dateHeaderCellDefaultProps=d;
|
|
@@ -10,7 +10,7 @@ import { useInternationalization as u } from "@progress/kendo-react-intl";
|
|
|
10
10
|
import { classNames as k } from "@progress/kendo-react-common";
|
|
11
11
|
const E = e.forwardRef((t, m) => {
|
|
12
12
|
var d;
|
|
13
|
-
const { as:
|
|
13
|
+
const { as: s = c.as, ...o } = t, a = e.useRef(null), l = e.useRef(null), r = u(), f = e.useMemo(
|
|
14
14
|
() => k("k-scheduler-cell k-heading-cell", t.className),
|
|
15
15
|
[t.className]
|
|
16
16
|
);
|
|
@@ -20,16 +20,16 @@ const E = e.forwardRef((t, m) => {
|
|
|
20
20
|
})), e.useImperativeHandle(m, () => l.current);
|
|
21
21
|
const n = (d = t.format) != null ? d : c.format, i = typeof n == "object" && "skeleton" in n && typeof n.skeleton == "string" && n.skeleton.includes("E") && n.skeleton.includes("d");
|
|
22
22
|
return /* @__PURE__ */ e.createElement(
|
|
23
|
-
|
|
23
|
+
s,
|
|
24
24
|
{
|
|
25
|
-
ref:
|
|
25
|
+
ref: s !== c.as ? void 0 : a,
|
|
26
26
|
...o,
|
|
27
27
|
className: f
|
|
28
28
|
},
|
|
29
|
-
i ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { className: "k-scheduler-date-day" },
|
|
29
|
+
i ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { className: "k-scheduler-date-day" }, r.formatDate(t.date, "EEE")), /* @__PURE__ */ e.createElement("span", { className: "k-link k-nav-day", "aria-label": r.formatDate(t.date, { skeleton: "Ed" }) }, r.formatDate(t.date, { skeleton: "d" })), " ") : /* @__PURE__ */ e.createElement("span", { className: "k-link k-nav-day" }, r.formatDate(t.date, n))
|
|
30
30
|
);
|
|
31
31
|
}), c = {
|
|
32
|
-
as: e.forwardRef(({ as: t, format: m, start:
|
|
32
|
+
as: e.forwardRef(({ as: t, format: m, start: s, end: o, ...a }, l) => /* @__PURE__ */ e.createElement("div", { ...a, ref: l })),
|
|
33
33
|
format: "d"
|
|
34
34
|
};
|
|
35
35
|
E.displayName = "KendoReactSchedulerDateHeaderCell";
|
|
@@ -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 w=require("react"),P=require("@progress/kendo-react-tooltip"),h=require("@progress/kendo-react-intl"),i=require("../messages/index.js");function R(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const n in l)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(l,n);Object.defineProperty(s,n,t.get?t:{enumerable:!0,get:()=>l[n]})}}return s.default=l,Object.freeze(s)}const e=R(w),C={skeleton:"MMM"},L={skeleton:"dd"},_="t",b=l=>{const{show:s,anchor:n,slot:t,itemsPerSlot:v,onDayClick:m,onClose:r}=l,p=h.useInternationalization(),g=h.useLocalization(),k=e.useMemo(()=>t?t.items.filter((o,d)=>d>=v):[],[t,v]),D=e.useCallback(o=>{t&&m&&m(t)},[t,m]);e.useEffect(()=>{if(!s)return;const o=d=>{const a=d.target,c=document.querySelector(".k-scheduler-popover");c&&!c.contains(a)&&n&&!n.contains(a)&&(r==null||r())};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[s,n,r]);const M=e.useCallback(o=>{o.key==="Escape"&&(r==null||r())},[r]);if(!t)return null;const f=new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),T=p.formatDate(f,C),S=p.formatDate(f,L),N=g.toLanguageString(i.noEvents,i.messages[i.noEvents]),O=g.toLanguageString(i.popoverEvents,i.messages[i.popoverEvents]),z=e.createElement(e.Fragment,null,e.createElement("div",{className:"k-month"},T),e.createElement("div",{className:"k-link k-day",onClick:D},S));return e.createElement(P.Popover,{anchor:n,show:s,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"flip"},callout:!0,title:z,style:{width:220},onKeyDown:M,animate:{type:"slide",direction:"right",openDuration:500,closeDuration:500}},k.length>0?e.createElement("div",{className:"k-popover-events",role:"list","aria-label":O},k.map((o,d)=>{var E,y;const a=(y=(E=o.group)==null?void 0:E.resources)==null?void 0:y.find(u=>!!(u.colorField&&u[u.colorField]!==""&&u[u.colorField]!==void 0)),c=(a==null?void 0:a.colorField)&&a[a.colorField],F=c?{backgroundColor:c,borderColor:c}:void 0;return e.createElement("div",{key:o.uid||d,className:"k-popover-event k-event",role:"listitem",style:F},e.createElement("div",{className:"k-event-title"},o.title||""),e.createElement("span",{className:"k-event-time"},p.formatDate(o.zonedStart,_)))})):e.createElement("span",{className:"k-no-data"},N))};b.displayName="KendoReactSchedulerMoreEventsPopover";exports.MoreEventsPopover=b;
|
|
@@ -6,54 +6,70 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { Popover as
|
|
10
|
-
import { useInternationalization as
|
|
11
|
-
import { noEvents as
|
|
12
|
-
const
|
|
13
|
-
const { show:
|
|
14
|
-
(
|
|
15
|
-
|
|
9
|
+
import { Popover as L } from "@progress/kendo-react-tooltip";
|
|
10
|
+
import { useInternationalization as S, useLocalization as R } from "@progress/kendo-react-intl";
|
|
11
|
+
import { noEvents as g, messages as h, popoverEvents as y } from "../messages/index.mjs";
|
|
12
|
+
const A = { skeleton: "MMM" }, O = { skeleton: "dd" }, P = "t", _ = (D) => {
|
|
13
|
+
const { show: c, anchor: i, slot: o, itemsPerSlot: u, onDayClick: d, onClose: n } = D, m = S(), p = R(), v = e.useMemo(() => o ? o.items.filter((t, r) => r >= u) : [], [o, u]), M = e.useCallback(
|
|
14
|
+
(t) => {
|
|
15
|
+
o && d && d(o);
|
|
16
16
|
},
|
|
17
|
-
[
|
|
17
|
+
[o, d]
|
|
18
18
|
);
|
|
19
19
|
e.useEffect(() => {
|
|
20
|
-
if (!
|
|
20
|
+
if (!c)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
22
|
+
const t = (r) => {
|
|
23
|
+
const a = r.target, l = document.querySelector(".k-scheduler-popover");
|
|
24
|
+
l && !l.contains(a) && i && !i.contains(a) && (n == null || n());
|
|
25
25
|
};
|
|
26
|
-
return document.addEventListener("mousedown",
|
|
27
|
-
document.removeEventListener("mousedown",
|
|
26
|
+
return document.addEventListener("mousedown", t), () => {
|
|
27
|
+
document.removeEventListener("mousedown", t);
|
|
28
28
|
};
|
|
29
|
-
}, [
|
|
30
|
-
const
|
|
31
|
-
(
|
|
32
|
-
|
|
29
|
+
}, [c, i, n]);
|
|
30
|
+
const T = e.useCallback(
|
|
31
|
+
(t) => {
|
|
32
|
+
t.key === "Escape" && (n == null || n());
|
|
33
33
|
},
|
|
34
|
-
[
|
|
34
|
+
[n]
|
|
35
35
|
);
|
|
36
|
-
if (!
|
|
36
|
+
if (!o)
|
|
37
37
|
return null;
|
|
38
|
-
const
|
|
38
|
+
const k = new Date(o.zonedEnd.getTime() - (o.zonedEnd.getTime() - o.zonedStart.getTime()) / 2), F = m.formatDate(k, A), N = m.formatDate(k, O), z = p.toLanguageString(g, h[g]), b = p.toLanguageString(y, h[y]), w = /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "k-month" }, F), /* @__PURE__ */ e.createElement("div", { className: "k-link k-day", onClick: M }, N));
|
|
39
39
|
return /* @__PURE__ */ e.createElement(
|
|
40
|
-
|
|
40
|
+
L,
|
|
41
41
|
{
|
|
42
|
-
anchor:
|
|
43
|
-
show:
|
|
42
|
+
anchor: i,
|
|
43
|
+
show: c,
|
|
44
44
|
popoverClass: "k-scheduler-popover",
|
|
45
45
|
position: "right",
|
|
46
46
|
collision: { horizontal: "flip", vertical: "flip" },
|
|
47
47
|
callout: !0,
|
|
48
|
-
title:
|
|
48
|
+
title: w,
|
|
49
49
|
style: { width: 220 },
|
|
50
|
-
onKeyDown:
|
|
50
|
+
onKeyDown: T,
|
|
51
51
|
animate: { type: "slide", direction: "right", openDuration: 500, closeDuration: 500 }
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
v.length > 0 ? /* @__PURE__ */ e.createElement("div", { className: "k-popover-events", role: "list", "aria-label": b }, v.map((t, r) => {
|
|
54
|
+
var E, f;
|
|
55
|
+
const a = (f = (E = t.group) == null ? void 0 : E.resources) == null ? void 0 : f.find(
|
|
56
|
+
(s) => !!(s.colorField && s[s.colorField] !== "" && s[s.colorField] !== void 0)
|
|
57
|
+
), l = (a == null ? void 0 : a.colorField) && a[a.colorField], C = l ? { backgroundColor: l, borderColor: l } : void 0;
|
|
58
|
+
return /* @__PURE__ */ e.createElement(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
key: t.uid || r,
|
|
62
|
+
className: "k-popover-event k-event",
|
|
63
|
+
role: "listitem",
|
|
64
|
+
style: C
|
|
65
|
+
},
|
|
66
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-event-title" }, t.title || ""),
|
|
67
|
+
/* @__PURE__ */ e.createElement("span", { className: "k-event-time" }, m.formatDate(t.zonedStart, P))
|
|
68
|
+
);
|
|
69
|
+
})) : /* @__PURE__ */ e.createElement("span", { className: "k-no-data" }, z)
|
|
54
70
|
);
|
|
55
71
|
};
|
|
56
|
-
|
|
72
|
+
_.displayName = "KendoReactSchedulerMoreEventsPopover";
|
|
57
73
|
export {
|
|
58
|
-
|
|
74
|
+
_ as MoreEventsPopover
|
|
59
75
|
};
|
package/constants/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export declare const DAYS_IN_WEEK_COUNT = 7;
|
|
|
28
28
|
/** @hidden */
|
|
29
29
|
export declare const WEEKS_COUNT = 6;
|
|
30
30
|
/** @hidden */
|
|
31
|
+
export declare const DAY_SLOT_HEADER_HEIGHT = 35;
|
|
32
|
+
/** @hidden */
|
|
31
33
|
export declare const HOURS_IN_DAY_COUNT = 24;
|
|
32
34
|
/** @hidden */
|
|
33
35
|
export declare const EMPTY_RESOURCE: {}[];
|
package/constants/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@progress/kendo-date-math"),t=1e3,D=60*t,r=1,a=25,c=7,R=35,S=[{}],T={index:0,resources:[]},_=new Date(1900,0,1),o=new Date(2099,11,31);E.ZonedDate.fromLocalDate(_),E.ZonedDate.fromLocalDate(o);var n=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(n||{});Object.defineProperty(exports,"MS_PER_DAY",{enumerable:!0,get:()=>E.MS_PER_DAY});exports.BORDER_WIDTH=r;exports.DATA_ACTION=n;exports.DAYS_IN_WEEK_COUNT=c;exports.DAY_SLOT_HEADER_HEIGHT=R;exports.DEFAULT_EVENT_HEIGHT=a;exports.DEFAULT_GROUP=T;exports.EMPTY_RESOURCE=S;exports.MAX_DATE=o;exports.MIN_DATE=_;exports.MS_PER_MINUTE=D;exports.MS_PER_SECOND=t;
|
package/constants/index.mjs
CHANGED
|
@@ -6,22 +6,24 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { ZonedDate as o } from "@progress/kendo-date-math";
|
|
9
|
-
import { MS_PER_DAY as
|
|
10
|
-
const t = 1e3,
|
|
9
|
+
import { MS_PER_DAY as H } from "@progress/kendo-date-math";
|
|
10
|
+
const t = 1e3, _ = 60 * t, a = 1, s = 25, D = 7, R = 35, S = [{}], d = {
|
|
11
11
|
index: 0,
|
|
12
12
|
resources: []
|
|
13
|
-
},
|
|
14
|
-
o.fromLocalDate(
|
|
15
|
-
var
|
|
13
|
+
}, E = new Date(1900, 0, 1), n = new Date(2099, 11, 31);
|
|
14
|
+
o.fromLocalDate(E), o.fromLocalDate(n);
|
|
15
|
+
var r = /* @__PURE__ */ ((e) => (e[e.create = 0] = "create", e[e.update = 1] = "update", e[e.remove = 2] = "remove", e))(r || {});
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
R as
|
|
21
|
-
|
|
17
|
+
a as BORDER_WIDTH,
|
|
18
|
+
r as DATA_ACTION,
|
|
19
|
+
D as DAYS_IN_WEEK_COUNT,
|
|
20
|
+
R as DAY_SLOT_HEADER_HEIGHT,
|
|
21
|
+
s as DEFAULT_EVENT_HEIGHT,
|
|
22
|
+
d as DEFAULT_GROUP,
|
|
23
|
+
S as EMPTY_RESOURCE,
|
|
22
24
|
n as MAX_DATE,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
E as MIN_DATE,
|
|
26
|
+
H as MS_PER_DAY,
|
|
27
|
+
_ as MS_PER_MINUTE,
|
|
26
28
|
t as MS_PER_SECOND
|
|
27
29
|
};
|