@progress/kendo-react-scheduler 16.2.0-develop.2 → 16.2.0-develop.20

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.
@@ -6,27 +6,28 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as e from "react";
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(
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 && d && d(o);
16
+ o && m && m(o);
16
17
  },
17
- [o, d]
18
+ [o, m]
18
19
  );
19
20
  e.useEffect(() => {
20
- if (!c)
21
+ if (!i)
21
22
  return;
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());
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
- }, [c, i, n]);
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 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
+ 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
- L,
41
+ S,
41
42
  {
42
- anchor: i,
43
- show: c,
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: { type: "slide", direction: "right", openDuration: 500, closeDuration: 500 }
52
+ animate: { openDuration: 1, closeDuration: 1 }
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;
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 || r,
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: C
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" }, m.formatDate(t.zonedStart, P))
69
+ /* @__PURE__ */ e.createElement("span", { className: "k-event-time" }, d.formatDate(t.zonedStart, _))
68
70
  );
69
- })) : /* @__PURE__ */ e.createElement("span", { className: "k-no-data" }, z)
71
+ })) : /* @__PURE__ */ e.createElement("span", { className: "k-no-data" }, F)
70
72
  );
71
73
  };
72
- _.displayName = "KendoReactSchedulerMoreEventsPopover";
74
+ x.displayName = "KendoReactSchedulerMoreEventsPopover";
73
75
  export {
74
- _ as MoreEventsPopover
76
+ x as MoreEventsPopover
75
77
  };