@progress/kendo-react-scheduler 16.1.0-develop.3 → 16.1.0-develop.4

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.
@@ -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 d } from "../views/common/utils.mjs";
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 i = d(c.current.element);
21
- r += i.width;
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 i = d(c.current.element);
29
- r += i.height;
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), i = H(), y = N(), h = n.useRef(void 0), a = n.useRef(null), o = n.useRef(null), g = e.updateInterval || V.updateInterval, [, R] = n.useState(!1), u = C(o, y.rtl === !0 ? "rtl" : void 0), [v] = O(), m = n.useCallback(() => {
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 s = v.filter(
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 (s && s.length && a.current && o.current) {
43
- const t = A(s);
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(s) : X(s), l = d(t.current.element), I = d(a.current), k = (e.vertical ? l.width : l.height) / (t.current.props.end.getTime() - t.current.props.start.getTime()), D = (Date.now() - Y(/* @__PURE__ */ new Date(), t.current.props.start).getTime()) * k, E = u === "rtl", b = e.vertical ? l.top : l.top + D - I.height / 2, f = E ? "right" : "left", p = e.vertical ? l[f] + D - I.width / 2 : l[f];
47
- e.vertical ? a.current.style[f] = `${p}px` : a.current.style.top = `${b}px`, o.current.style[f] = `${p}px`, o.current.style.top = `${b}px`, o.current.style[e.vertical ? "height" : "width"] = `${S - 1}px`, c(!0);
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, u]), w = n.useCallback(() => {
51
- m(), R((s) => !s);
52
- }, [m]);
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 (!i.current || !window)
54
+ if (!o.current || !window)
55
55
  return;
56
- clearInterval(h.current), h.current = window.setInterval(w, g);
57
- const s = window.ResizeObserver, t = s && new s(w);
58
- return t && t.observe(i.current), () => {
59
- clearInterval(h.current), t && t.disconnect();
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
- }, [m, w, i, g]), n.useEffect(m);
61
+ }, [f, w, o, g]), n.useEffect(f);
62
62
  const x = /* @__PURE__ */ n.createElement(
63
63
  "div",
64
64
  {
65
- ref: a,
65
+ ref: l,
66
66
  className: z("k-current-time", {
67
- "k-current-time-arrow-right": !e.vertical && u !== "rtl",
68
- "k-current-time-arrow-left": !e.vertical && u === "rtl",
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 ? u === "rtl" ? "translateX(50%)" : "translateX(-50%)" : "translateY(-50%)",
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: o,
81
+ ref: s,
82
82
  style: {
83
83
  transform: e.vertical ? "translateX(-50%)" : "translateY(-50%)",
84
84
  [e.vertical ? "width" : "height"]: "1px",