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