@scrippsproduct/networks-ui-library 1.1.1 → 1.1.2
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.
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as t, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useCallback as S, useEffect as m } from "react";
|
|
3
3
|
import { f as w } from "../../format-YhWt2D8M.mjs";
|
|
4
|
-
import { l } from "../../logger-C0N7U0YY.mjs";
|
|
5
|
-
import { classes as
|
|
4
|
+
import { l as b } from "../../logger-C0N7U0YY.mjs";
|
|
5
|
+
import { classes as g } from "../../utils/helpers.js";
|
|
6
6
|
import { ScheduleProvider as E } from "./ScheduleContext.js";
|
|
7
7
|
import { useScheduleContext as T } from "./useScheduleContext.js";
|
|
8
|
-
import { DateNavigation as
|
|
9
|
-
import { ScheduleList as
|
|
10
|
-
|
|
11
|
-
import '../../assets/ScheduleLayout.css';function
|
|
12
|
-
handleScheduleClicks:
|
|
8
|
+
import { DateNavigation as q } from "../DateNavigation/DateNavigation.js";
|
|
9
|
+
import { ScheduleList as k } from "../ScheduleList/ScheduleList.js";
|
|
10
|
+
b.setComponent("ScheduleLayout");
|
|
11
|
+
import '../../assets/ScheduleLayout.css';function C({
|
|
12
|
+
handleScheduleClicks: d = () => !0
|
|
13
13
|
}) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
console.warn("ScheduleLayoutContent rendered");
|
|
15
|
+
const { currentDate: r } = T(), n = l(null), f = l(0), o = l(null), c = l(null), i = l(null), u = S((a) => {
|
|
16
16
|
const s = () => {
|
|
17
17
|
let e;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
|
|
18
|
+
const h = document.querySelector(`.date-navigation__day[aria-controls="${w(a, "yyyy-MM-dd")}"]`);
|
|
19
|
+
if (h && (e = h.parentElement), e && n.current) {
|
|
20
|
+
const v = e.offsetLeft + e.offsetWidth / 2;
|
|
21
|
+
f.current = v, n.current.style.setProperty(
|
|
22
22
|
"--pointer-position",
|
|
23
|
-
`${
|
|
23
|
+
`${v}px`
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
}, y = () => {
|
|
27
|
-
|
|
27
|
+
c.current || (c.current = document.querySelector(".schedule-list")), i.current || (i.current = document.querySelector("sticky-content-wrapper"));
|
|
28
28
|
const e = document.querySelector(".mobile-nav");
|
|
29
|
-
c.current && i.current &&
|
|
29
|
+
c.current && i.current && window.scrollTo({
|
|
30
30
|
behavior: "auto",
|
|
31
31
|
top: e && window.getComputedStyle(e).display !== "none" ? c.current.offsetTop - i.current.offsetHeight - e.offsetHeight - 8 : c.current.offsetTop - i.current.offsetHeight - 16,
|
|
32
32
|
left: 0
|
|
33
|
-
})
|
|
33
|
+
});
|
|
34
34
|
};
|
|
35
35
|
if (!n.current) {
|
|
36
36
|
const e = setInterval(() => {
|
|
37
|
-
n.current = document.querySelector(".date-navigation__list"), n.current && (clearInterval(e), c.current = document.querySelector(".schedule-list"), i.current = document.querySelector("sticky-content-wrapper"), s()
|
|
37
|
+
n.current = document.querySelector(".date-navigation__list"), n.current && (clearInterval(e), c.current = document.querySelector(".schedule-list"), i.current = document.querySelector("sticky-content-wrapper"), s());
|
|
38
38
|
}, 100);
|
|
39
39
|
setTimeout(() => {
|
|
40
40
|
clearInterval(e);
|
|
@@ -42,14 +42,14 @@ import '../../assets/ScheduleLayout.css';function x({
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
s(), y();
|
|
45
|
-
}, []),
|
|
45
|
+
}, []), p = S(() => {
|
|
46
46
|
o.current && clearTimeout(o.current), o.current = window.setTimeout(() => {
|
|
47
47
|
u(r);
|
|
48
48
|
}, 250);
|
|
49
49
|
}, [r, u]);
|
|
50
|
-
return
|
|
51
|
-
window.removeEventListener("resize",
|
|
52
|
-
}), [u,
|
|
50
|
+
return m(() => (window.addEventListener("resize", p), () => {
|
|
51
|
+
window.removeEventListener("resize", p), o.current && clearTimeout(o.current);
|
|
52
|
+
}), [u, p]), m(() => {
|
|
53
53
|
const a = document.querySelector(".header-divider"), s = document.querySelector("sticky-content-wrapper");
|
|
54
54
|
s && a && new IntersectionObserver(
|
|
55
55
|
([e]) => {
|
|
@@ -60,39 +60,39 @@ import '../../assets/ScheduleLayout.css';function x({
|
|
|
60
60
|
rootMargin: "-37px"
|
|
61
61
|
}
|
|
62
62
|
).observe(a);
|
|
63
|
-
}, []),
|
|
63
|
+
}, []), m(() => {
|
|
64
64
|
u(r);
|
|
65
|
-
}, [r, u]), /* @__PURE__ */
|
|
65
|
+
}, [r, u]), /* @__PURE__ */ L("schedule-layout", { children: [
|
|
66
66
|
/* @__PURE__ */ t("sticky-content-wrapper", { "data-pinned-state": "unpinned", children: /* @__PURE__ */ t(
|
|
67
67
|
"content-constrainer",
|
|
68
68
|
{
|
|
69
|
-
class:
|
|
69
|
+
class: g([
|
|
70
70
|
"content-constrainer--no-padding",
|
|
71
71
|
"content-constrainer--no-border",
|
|
72
72
|
"content-constrainer--lead-container",
|
|
73
73
|
"schedule-date-nav-constrainer"
|
|
74
74
|
]),
|
|
75
|
-
children: /* @__PURE__ */ t(
|
|
75
|
+
children: /* @__PURE__ */ t(q, {})
|
|
76
76
|
}
|
|
77
77
|
) }),
|
|
78
|
-
/* @__PURE__ */ t("section", { className: "page-section", id: "schedule-section", children: /* @__PURE__ */ t("content-constrainer", { class: "content-constrainer--no-border schedule-content-constrainer", children: /* @__PURE__ */ t("div", { id: w(r, "yyyy-MM-dd"), role: "tabpanel", children: /* @__PURE__ */ t(
|
|
78
|
+
/* @__PURE__ */ t("section", { className: "page-section", id: "schedule-section", children: /* @__PURE__ */ t("content-constrainer", { class: "content-constrainer--no-border schedule-content-constrainer", children: /* @__PURE__ */ t("div", { id: w(r, "yyyy-MM-dd"), role: "tabpanel", children: /* @__PURE__ */ t(k, { handleClicks: d }) }) }) })
|
|
79
79
|
] });
|
|
80
80
|
}
|
|
81
81
|
function N({
|
|
82
|
-
fetchSchedule:
|
|
82
|
+
fetchSchedule: d,
|
|
83
83
|
initialSchedule: r = [],
|
|
84
84
|
weeks: n = [],
|
|
85
|
-
handleScheduleClicks:
|
|
85
|
+
handleScheduleClicks: f = () => !0,
|
|
86
86
|
handleDateChanged: o = () => !0
|
|
87
87
|
}) {
|
|
88
88
|
return /* @__PURE__ */ t(
|
|
89
89
|
E,
|
|
90
90
|
{
|
|
91
|
-
fetchSchedule:
|
|
91
|
+
fetchSchedule: d,
|
|
92
92
|
handleDateChanged: o,
|
|
93
93
|
initialSchedule: r,
|
|
94
94
|
weeks: n,
|
|
95
|
-
children: /* @__PURE__ */ t(
|
|
95
|
+
children: /* @__PURE__ */ t(C, { handleScheduleClicks: f })
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
}
|
package/package.json
CHANGED