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