@progress/kendo-react-scheduler 16.2.0-develop.16 → 16.2.0-develop.17
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/components/MoreEventsPopover.d.ts +1 -0
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +31 -29
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +246 -146
|
@@ -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 w=require("react"),P=require("@progress/kendo-react-
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),w=require("@progress/kendo-react-tooltip"),P=require("@progress/kendo-react-common"),D=require("@progress/kendo-react-intl"),d=require("../messages/index.js");function L(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=L(R),_={skeleton:"MMM"},q={skeleton:"dd"},j="t",h=l=>{const{show:s,anchor:n,slot:t,itemsPerSlot:p,onDayClick:m,onItemDoubleClick:k,onClose:a}=l,v=D.useInternationalization(),f=D.useLocalization(),g=e.useMemo(()=>t?t.items.filter((o,u)=>u>=p):[],[t,p]),M=e.useCallback(o=>{t&&m&&m(t)},[t,m]);e.useEffect(()=>{if(!s)return;const o=u=>{const r=u.target,i=document.querySelector(".k-scheduler-popover");i&&!i.contains(r)&&n&&!n.contains(r)&&(a==null||a())};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[s,n,a]);const T=e.useCallback(o=>{o.key==="Escape"&&(a==null||a())},[a]);if(!t)return null;const E=new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),N=v.formatDate(E,_),S=v.formatDate(E,q),C=f.toLanguageString(d.noEvents,d.messages[d.noEvents]),O=f.toLanguageString(d.popoverEvents,d.messages[d.popoverEvents]),z=e.createElement(e.Fragment,null,e.createElement("div",{className:"k-month"},N),e.createElement("div",{className:"k-link k-day",onClick:M},S));return e.createElement(w.Popover,{anchor:n,show:s,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"flip"},callout:!0,title:z,style:{width:220},onKeyDown:T,animate:{openDuration:1,closeDuration:1}},g.length>0?e.createElement("div",{className:"k-popover-events",role:"list","aria-label":O},g.map((o,u)=>{var y,b;const r=(b=(y=o.group)==null?void 0:y.resources)==null?void 0:b.find(c=>!!(c.colorField&&c[c.colorField]!==""&&c[c.colorField]!==void 0)),i=(r==null?void 0:r.colorField)&&r[r.colorField],F=i?{backgroundColor:i,borderColor:i}:void 0;return e.createElement("div",{key:o.uid||u,className:P.classNames("k-popover-event k-event",{"k-readonly":!!o.readonly}),role:"listitem",style:F,onDoubleClick:k?c=>k(o,c):void 0},e.createElement("div",{className:"k-event-title"},o.title||""),e.createElement("span",{className:"k-event-time"},v.formatDate(o.zonedStart,j)))})):e.createElement("span",{className:"k-no-data"},C))};h.displayName="KendoReactSchedulerMoreEventsPopover";exports.MoreEventsPopover=h;
|
|
@@ -6,27 +6,28 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { Popover as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { Popover as S } from "@progress/kendo-react-tooltip";
|
|
10
|
+
import { classNames as R } from "@progress/kendo-react-common";
|
|
11
|
+
import { useInternationalization as A, useLocalization as I } from "@progress/kendo-react-intl";
|
|
12
|
+
import { noEvents as h, messages as D, popoverEvents as y } from "../messages/index.mjs";
|
|
13
|
+
const O = { skeleton: "MMM" }, P = { skeleton: "dd" }, _ = "t", x = (M) => {
|
|
14
|
+
const { show: i, anchor: c, slot: o, itemsPerSlot: u, onDayClick: m, onItemDoubleClick: p, onClose: n } = M, d = A(), v = I(), k = e.useMemo(() => o ? o.items.filter((t, s) => s >= u) : [], [o, u]), N = e.useCallback(
|
|
14
15
|
(t) => {
|
|
15
|
-
o &&
|
|
16
|
+
o && m && m(o);
|
|
16
17
|
},
|
|
17
|
-
[o,
|
|
18
|
+
[o, m]
|
|
18
19
|
);
|
|
19
20
|
e.useEffect(() => {
|
|
20
|
-
if (!
|
|
21
|
+
if (!i)
|
|
21
22
|
return;
|
|
22
|
-
const t = (
|
|
23
|
-
const a =
|
|
24
|
-
|
|
23
|
+
const t = (s) => {
|
|
24
|
+
const a = s.target, r = document.querySelector(".k-scheduler-popover");
|
|
25
|
+
r && !r.contains(a) && c && !c.contains(a) && (n == null || n());
|
|
25
26
|
};
|
|
26
27
|
return document.addEventListener("mousedown", t), () => {
|
|
27
28
|
document.removeEventListener("mousedown", t);
|
|
28
29
|
};
|
|
29
|
-
}, [
|
|
30
|
+
}, [i, c, n]);
|
|
30
31
|
const T = e.useCallback(
|
|
31
32
|
(t) => {
|
|
32
33
|
t.key === "Escape" && (n == null || n());
|
|
@@ -35,12 +36,12 @@ const A = { skeleton: "MMM" }, O = { skeleton: "dd" }, P = "t", _ = (D) => {
|
|
|
35
36
|
);
|
|
36
37
|
if (!o)
|
|
37
38
|
return null;
|
|
38
|
-
const
|
|
39
|
+
const E = new Date(o.zonedEnd.getTime() - (o.zonedEnd.getTime() - o.zonedStart.getTime()) / 2), b = d.formatDate(E, O), C = d.formatDate(E, P), F = v.toLanguageString(h, D[h]), z = v.toLanguageString(y, D[y]), w = /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "k-month" }, b), /* @__PURE__ */ e.createElement("div", { className: "k-link k-day", onClick: N }, C));
|
|
39
40
|
return /* @__PURE__ */ e.createElement(
|
|
40
|
-
|
|
41
|
+
S,
|
|
41
42
|
{
|
|
42
|
-
anchor:
|
|
43
|
-
show:
|
|
43
|
+
anchor: c,
|
|
44
|
+
show: i,
|
|
44
45
|
popoverClass: "k-scheduler-popover",
|
|
45
46
|
position: "right",
|
|
46
47
|
collision: { horizontal: "flip", vertical: "flip" },
|
|
@@ -48,28 +49,29 @@ const A = { skeleton: "MMM" }, O = { skeleton: "dd" }, P = "t", _ = (D) => {
|
|
|
48
49
|
title: w,
|
|
49
50
|
style: { width: 220 },
|
|
50
51
|
onKeyDown: T,
|
|
51
|
-
animate: {
|
|
52
|
+
animate: { openDuration: 1, closeDuration: 1 }
|
|
52
53
|
},
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
const a = (
|
|
56
|
-
(
|
|
57
|
-
),
|
|
54
|
+
k.length > 0 ? /* @__PURE__ */ e.createElement("div", { className: "k-popover-events", role: "list", "aria-label": z }, k.map((t, s) => {
|
|
55
|
+
var f, g;
|
|
56
|
+
const a = (g = (f = t.group) == null ? void 0 : f.resources) == null ? void 0 : g.find(
|
|
57
|
+
(l) => !!(l.colorField && l[l.colorField] !== "" && l[l.colorField] !== void 0)
|
|
58
|
+
), r = (a == null ? void 0 : a.colorField) && a[a.colorField], L = r ? { backgroundColor: r, borderColor: r } : void 0;
|
|
58
59
|
return /* @__PURE__ */ e.createElement(
|
|
59
60
|
"div",
|
|
60
61
|
{
|
|
61
|
-
key: t.uid ||
|
|
62
|
-
className: "k-popover-event k-event",
|
|
62
|
+
key: t.uid || s,
|
|
63
|
+
className: R("k-popover-event k-event", { "k-readonly": !!t.readonly }),
|
|
63
64
|
role: "listitem",
|
|
64
|
-
style:
|
|
65
|
+
style: L,
|
|
66
|
+
onDoubleClick: p ? (l) => p(t, l) : void 0
|
|
65
67
|
},
|
|
66
68
|
/* @__PURE__ */ e.createElement("div", { className: "k-event-title" }, t.title || ""),
|
|
67
|
-
/* @__PURE__ */ e.createElement("span", { className: "k-event-time" },
|
|
69
|
+
/* @__PURE__ */ e.createElement("span", { className: "k-event-time" }, d.formatDate(t.zonedStart, _))
|
|
68
70
|
);
|
|
69
|
-
})) : /* @__PURE__ */ e.createElement("span", { className: "k-no-data" },
|
|
71
|
+
})) : /* @__PURE__ */ e.createElement("span", { className: "k-no-data" }, F)
|
|
70
72
|
);
|
|
71
73
|
};
|
|
72
|
-
|
|
74
|
+
x.displayName = "KendoReactSchedulerMoreEventsPopover";
|
|
73
75
|
export {
|
|
74
|
-
|
|
76
|
+
x as MoreEventsPopover
|
|
75
77
|
};
|