@scrippsproduct/networks-ui-library 1.1.0-alpha.8 → 1.1.0
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.
- package/dist/assets/DateNavigation.css +1 -1
- package/dist/assets/ScheduleLayout.css +1 -1
- package/dist/assets/ScheduleList.css +1 -1
- package/dist/components/ChannelSearch/ChannelSearch.js +53 -55
- package/dist/components/DateNavigation/DateNavigation.js +43 -43
- package/dist/components/ScheduleLayout/ScheduleContext.js +441 -433
- package/dist/components/ScheduleLayout/ScheduleLayout.js +35 -35
- package/dist/components/ScheduleList/ScheduleList.js +73 -73
- package/dist/components/ScheduleList/schedule-list-items/SeriesItem.js +26 -26
- package/dist/hooks/getSchedule.d.ts +22 -0
- package/dist/hooks/getSchedule.js +62 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
._date-
|
|
1
|
+
._date-navigation__list_1jjng_1{display:flex;justify-content:flex-start;position:relative;--pointer-position: 0;margin:0 auto;padding:.5rem 1rem 1.5rem;list-style:none;background:transparent}date-navigation{position:relative;padding-block-start:1rem;display:block}date-navigation[data-state=retracting] ._date-navigation__list_1jjng_1{animation-name:_slidein_1jjng_1;animation-duration:.325s;animation-timing-function:cubic-bezier(.18,.1,.09,1.04);animation-fill-mode:forwards;animation-direction:normal}date-navigation[data-state=advancing] ._date-navigation__list_1jjng_1{animation-name:_slideout_1jjng_1;animation-duration:.325s;animation-timing-function:cubic-bezier(.18,.1,.09,1.04);animation-fill-mode:forwards;animation-direction:normal}@media screen and (max-width:60rem){date-navigation{padding-block-start:0}}date-navigation-list{overflow:hidden;display:block}@keyframes _slidein_1jjng_1{0%{transform:translate3d(-20rem,0,0);opacity:.1}50%{opacity:.2}to{transform:translateZ(0);opacity:1}}@keyframes _slideout_1jjng_1{0%{transform:translate3d(20rem,0,0);opacity:1}50%{opacity:.5}to{transform:translateZ(0);opacity:1}}date-navigation-controls{display:contents}._date-navigation__control_1jjng_72{cursor:pointer;scale:1.5;translate:0 1rem;position:absolute;z-index:1;top:50%;transform:translateY(-50%);overflow:hidden;display:flex;align-items:center;justify-content:center;aspect-ratio:1;inline-size:4rem;padding:0;border:1px solid transparent;border-radius:50%;color:#000;text-indent:10ch;background:#fff;transition:opacity .5s ease-in-out}._date-navigation__control_1jjng_72>i>svg{display:block;max-inline-size:100%;block-size:auto;stroke:currentcolor}._date-navigation__control--previous_1jjng_101{inset-inline-start:-2rem;padding-inline-end:5px}._date-navigation__control--next_1jjng_106{inset-inline-end:-2rem;padding-inline-start:5px}._date-navigation__control_1jjng_72[disabled]{cursor:not-allowed;opacity:.4}._date-navigation__item_1jjng_117{--flex-basis: 14.285714%;border-right:1px solid rgba(255,255,255,.4);flex-basis:var(--flex-basis);text-align:center}._date-navigation__item_1jjng_117:last-child{border-width:0}@media screen and (max-width:37.5rem){._date-navigation__item_1jjng_117{--flex-basis: 25%}}._date-navigation__day_1jjng_132{cursor:pointer;border:none;background:transparent}._date-navigation__month-day-break_1jjng_138{display:none}._date-navigation__weekday_1jjng_142,._date-navigation__date_1jjng_143{color:var(--mono-color-100);font-size:1.2rem;text-transform:uppercase;transition:transform .225s ease-out}._date-navigation__weekday_1jjng_142{font-size:2rem}@media screen and (max-width:80rem){._date-navigation__control--previous_1jjng_101{inset-inline-start:-1.4rem}._date-navigation__control--next_1jjng_106{inset-inline-end:-1.2rem}}@media screen and (max-width:71.5rem){._date-navigation__weekday_1jjng_142{font-size:1.4rem}._date-navigation__date_1jjng_143{font-size:1rem}}@media screen and (max-width:60rem){._date-navigation__control_1jjng_72{translate:0 .6rem}._date-navigation__item_1jjng_117{padding-inline:.35rem}}@media screen and (max-width:46.875rem){._date-navigation__control_1jjng_72{scale:.7;translate:0 -1rem}._date-navigation__control--previous_1jjng_101{inset-inline-start:-1.6rem}._date-navigation__control--next_1jjng_106{inset-inline-end:-1.5rem}}@media screen and (max-width:31.25rem){._date-navigation__weekday_1jjng_142{font-size:1rem}._date-navigation__date_1jjng_143{font-size:.8rem;white-space:nowrap}}@media screen and (max-width:25rem){._date-navigation__month-day-break_1jjng_138{display:inline}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.schedule-content-constrainer{min-height:100vh;min-height:100dvh}sticky-content-wrapper{position:sticky;z-index:10;top:-1px
|
|
1
|
+
.schedule-content-constrainer{min-height:100vh;min-height:100dvh}sticky-content-wrapper{display:block;position:sticky;z-index:10;top:-1px}sticky-content-wrapper[data-pinned-state=pinned]{background-image:radial-gradient(ellipse at top left,var(--theme-color-200) 0,var(--theme-color-200) 50%,var(--theme-color-100) 90%)}.date-navigation__list:before{content:"";width:0;height:0;border-style:solid;border-width:0 14px 14px;border-color:transparent transparent var(--mono-color-100) transparent;position:absolute;bottom:-1px;transform:translate(calc(var(--pointer-position) - 100%));transition:transform .325s ease-in-out}@media screen and (max-width:80rem){.schedule-content-constrainer{padding-top:.01rem}}@media screen and (max-width:60rem){.schedule-date-nav-constrainer{width:calc(100% - 1.8rem);padding-block-start:.5rem}.schedule-page .header-divider{display:none}sticky-content-wrapper{top:5rem}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._schedule-
|
|
1
|
+
._schedule-list__item_686v7_1{display:grid;grid-template-columns:10% 1fr;column-gap:2.5rem;padding:1rem 0;padding:2rem 0 2.4rem;border-bottom:1px solid}._schedule-list__item_686v7_1:last-child{border:none}._schedule-list__airdate_686v7_14{align-self:center;font-size:2.25rem;font-weight:500;color:var(--mono-color-400);text-wrap:balance;overflow-wrap:break-word}._schedule-list__airdate_686v7_14 ._airdate-formatter__date_686v7_22,._schedule-list__airdate_686v7_14 ._airdate-formatter__day_686v7_23{display:none}._schedule-list__airdate_686v7_14 ._airdate-formatter__time-wrap_686v7_26 br{display:inline}._schedule-list_686v7_1{padding:0;opacity:1}._schedule-list_686v7_1[data-state=idle]{opacity:1}._schedule-list_686v7_1[data-state=exiting]{animation-name:_fade-out_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list_686v7_1[data-state=entering]{animation-name:_fade-in_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_686v7_50{padding:2rem;text-align:center;opacity:1}._schedule-list__no-schedule_686v7_50[data-state=idle]{opacity:1}._schedule-list__no-schedule_686v7_50[data-state=exiting]{animation-name:_fade-out_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_686v7_50[data-state=entering]{animation-name:_fade-in_686v7_1;animation-duration:.4s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}._schedule-list__no-schedule_686v7_50 h2{margin-bottom:1rem}._schedule-list__no-schedule_686v7_50 p{margin:0}._schedule-list__no-schedule_686v7_50 a{color:inherit;text-decoration:underline}@media screen and (max-width:93.75rem){._schedule-list__airdate_686v7_14{font-size:2rem}}@media screen and (max-width:80rem){._schedule-list__item_686v7_1{display:block}._schedule-list__airdate_686v7_14{margin-block-end:.5rem}._schedule-list__airdate_686v7_14 ._airdate-formatter__time-wrap_686v7_26 br{display:none}._schedule-content-constrainer_686v7_102{padding-top:.01rem}}@media screen and (max-width:71.5rem){._schedule-list__item_686v7_1{grid-template-columns:15% 1fr}}@media screen and (max-width:50rem){._schedule-list__item_686v7_1 image-card{flex-direction:column;gap:1.5rem}._schedule-list__item_686v7_1 ._image-card__content_686v7_116{align-self:flex-start}}@keyframes _fade-in_686v7_1{0%{opacity:0}to{opacity:1}}@keyframes _fade-out_686v7_1{0%{opacity:1}to{opacity:0}}.schedule-list__airdate .airdate-formatter__date,.schedule-list__airdate .airdate-formatter__day{display:none}.schedule-list__item .h4{margin-bottom:.5rem;font-size:clamp(1.8rem,1.5vw + 1rem,2.625rem);line-height:1.2;color:var(--mono-color-400);text-transform:uppercase}.schedule-list__item .image-card__content{font-size:1.125rem}.schedule-list__item .image-card__content:first-of-type,.schedule-list__item .image-card__content~div{max-inline-size:80ch;margin-top:1.5rem;line-height:1.5;color:#444}@media screen and (max-width:50rem){.schedule-list__item .image-card__content:first-of-type{margin-block-start:0}}.schedule-list__item .image-card__content>div{margin:.5rem 0 1rem}.schedule-list__item .image-card__content>div:first-of-type:not(:last-of-type){font-size:1.372rem;font-weight:400;color:#444}.schedule-list__item .image-card__content>.string-list{color:var(--mono-color-400)}.schedule-list__item .string-list__pipe{margin:0 .4em;margin-inline:.4em;font-size:1.1em;vertical-align:baseline}.schedule-list__item .image-card__cta{font-weight:500;color:#861d42}.schedule-list__item .image-card__img-wrapper{flex:0 0 clamp(330px,47%,580px);align-self:flex-start;padding-top:.75rem}.schedule-list__on-now{width:max-content;margin-bottom:.75rem;margin-block-end:.75rem;padding:.5rem 1.75rem;font-size:1.125rem;color:var(--mono-color-100);text-transform:uppercase;text-wrap:nowrap;overflow-wrap:normal;white-space:nowrap;background-image:var(--on-now-gradient)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as o, jsx as a, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { statesForCustomList as
|
|
2
|
+
import { useRef as T, useState as $, useEffect as x } from "react";
|
|
3
|
+
import { statesForCustomList as k } from "../../data-resources/FakeDataResource.js";
|
|
4
4
|
import { publish as V } from "../../utils/events.js";
|
|
5
|
-
import { classes as
|
|
5
|
+
import { classes as r } from "../../utils/helpers.js";
|
|
6
6
|
import { Input as j } from "../Input/Input.js";
|
|
7
7
|
import { CustomDataList as z } from "../CustomDataList/CustomDataList.js";
|
|
8
8
|
import { ActionButton as K } from "../ActionButton/ActionButton.js";
|
|
9
|
-
import { ResultsTable as
|
|
10
|
-
import { AdBlock as
|
|
9
|
+
import { ResultsTable as F } from "../ResultsTable/ResultsTable.js";
|
|
10
|
+
import { AdBlock as Y } from "../AdBlock/AdBlock.js";
|
|
11
11
|
import '../../assets/ChannelSearch.css';const n = {
|
|
12
12
|
"channel-search": "_channel-search_1kyd9_6",
|
|
13
13
|
"channel-search__inputs": "_channel-search__inputs_1kyd9_19",
|
|
@@ -18,13 +18,13 @@ import '../../assets/ChannelSearch.css';const n = {
|
|
|
18
18
|
"channel-search__label": "_channel-search__label_1kyd9_90"
|
|
19
19
|
};
|
|
20
20
|
function M({
|
|
21
|
-
network:
|
|
22
|
-
baseApiUrl:
|
|
23
|
-
allowZipcodeSearch:
|
|
24
|
-
allowStateSearch:
|
|
25
|
-
compactLayout:
|
|
26
|
-
allowAutoScroll:
|
|
27
|
-
autoScrollOffset:
|
|
21
|
+
network: l,
|
|
22
|
+
baseApiUrl: N,
|
|
23
|
+
allowZipcodeSearch: u = !0,
|
|
24
|
+
allowStateSearch: p = !0,
|
|
25
|
+
compactLayout: _ = !1,
|
|
26
|
+
allowAutoScroll: w = !0,
|
|
27
|
+
autoScrollOffset: v = 25,
|
|
28
28
|
ad: i = {
|
|
29
29
|
campaign: "",
|
|
30
30
|
source: "",
|
|
@@ -32,9 +32,9 @@ function M({
|
|
|
32
32
|
content: ""
|
|
33
33
|
}
|
|
34
34
|
}) {
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const e = `${
|
|
35
|
+
const C = T(""), m = async (c = { type: "", term: "" }) => {
|
|
36
|
+
const g = async () => {
|
|
37
|
+
const e = `${N}/${l.slug}?${c.type}=${c.term}`;
|
|
38
38
|
try {
|
|
39
39
|
const t = await fetch(e);
|
|
40
40
|
return t.ok ? (await t.json()).map((s) => ({
|
|
@@ -47,24 +47,24 @@ function M({
|
|
|
47
47
|
return console.error(t), [];
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
return
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
const
|
|
50
|
+
return c.term === "" ? [] : await g();
|
|
51
|
+
}, S = async (c) => {
|
|
52
|
+
c.preventDefault();
|
|
53
|
+
const g = new FormData(document.getElementById("channel-search"));
|
|
54
54
|
let e = {};
|
|
55
|
-
for (let [t,
|
|
55
|
+
for (let [t, h] of g.entries())
|
|
56
56
|
e = {
|
|
57
57
|
...e,
|
|
58
|
-
[t]:
|
|
58
|
+
[t]: h
|
|
59
59
|
};
|
|
60
60
|
if (e.zipcode && (e == null ? void 0 : e.zipcode) !== "") {
|
|
61
|
-
const t = await
|
|
62
|
-
|
|
61
|
+
const t = await m({ type: "zip", term: e.zipcode });
|
|
62
|
+
d(t.length === 0 ? [] : t), f(!0);
|
|
63
63
|
} else if (e.state && (e == null ? void 0 : e.state) !== "") {
|
|
64
|
-
const t =
|
|
65
|
-
|
|
64
|
+
const t = k.find((h) => Number.parseInt(h.id, 10) === Number.parseInt(e.state, 10));
|
|
65
|
+
C.current = t === void 0 ? "" : t.label, d(await m({ type: "state", term: t == null ? void 0 : t.value })), f(!0);
|
|
66
66
|
} else
|
|
67
|
-
|
|
67
|
+
d(await m()), f(!1);
|
|
68
68
|
setTimeout(() => {
|
|
69
69
|
V("scripps:action:completed");
|
|
70
70
|
}, 250);
|
|
@@ -85,39 +85,37 @@ function M({
|
|
|
85
85
|
title: "Cable/Satellite",
|
|
86
86
|
resultKey: "provider"
|
|
87
87
|
}
|
|
88
|
-
], [
|
|
88
|
+
], [R, d] = $([]), [b, f] = $(!1), y = T(null);
|
|
89
89
|
return x(() => {
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
b && w && setTimeout(() => {
|
|
91
|
+
y.current !== null && window.scroll({
|
|
92
92
|
left: 0,
|
|
93
|
-
top:
|
|
93
|
+
top: y.current.getBoundingClientRect().y + window.pageYOffset - v,
|
|
94
94
|
behavior: "smooth"
|
|
95
95
|
});
|
|
96
|
-
}, 100)
|
|
97
|
-
|
|
98
|
-
})();
|
|
99
|
-
}), /* @__PURE__ */ o("channel-search__wrapper", { children: [
|
|
96
|
+
}, 100);
|
|
97
|
+
}, [b, w, v]), /* @__PURE__ */ o("channel-search__wrapper", { children: [
|
|
100
98
|
/* @__PURE__ */ o(
|
|
101
99
|
"form",
|
|
102
100
|
{
|
|
103
|
-
className:
|
|
101
|
+
className: r([
|
|
104
102
|
n["channel-search"],
|
|
105
103
|
"channel-search"
|
|
106
104
|
]),
|
|
107
105
|
id: "channel-search",
|
|
108
106
|
children: [
|
|
109
|
-
/* @__PURE__ */ o("span", { className:
|
|
110
|
-
|
|
107
|
+
/* @__PURE__ */ o("span", { className: r([n["channel-search__label"], "channel-search__label"]), children: [
|
|
108
|
+
l.brand_name,
|
|
111
109
|
" Channel Search:"
|
|
112
110
|
] }),
|
|
113
|
-
/* @__PURE__ */ o("span", { className:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
/* @__PURE__ */ o("span", { className: r([n["channel-search__inputs"], "channel-search__inputs"]), children: [
|
|
112
|
+
u && /* @__PURE__ */ a(j, { name: "zipcode", placeholder: "Enter ZIP Code", showValidation: !1 }),
|
|
113
|
+
u && p && "or",
|
|
114
|
+
p && /* @__PURE__ */ a(
|
|
117
115
|
z,
|
|
118
116
|
{
|
|
119
117
|
name: "state",
|
|
120
|
-
options:
|
|
118
|
+
options: k,
|
|
121
119
|
placeholder: "Select Your State",
|
|
122
120
|
showValidation: !1
|
|
123
121
|
}
|
|
@@ -126,40 +124,40 @@ function M({
|
|
|
126
124
|
/* @__PURE__ */ a(
|
|
127
125
|
K,
|
|
128
126
|
{
|
|
129
|
-
classname:
|
|
127
|
+
classname: r(["channel-search__submit-btn", n["channel-search__submit-btn"]]),
|
|
130
128
|
label: "Submit",
|
|
131
129
|
type: "submit",
|
|
132
|
-
onClick:
|
|
130
|
+
onClick: S
|
|
133
131
|
}
|
|
134
132
|
)
|
|
135
133
|
]
|
|
136
134
|
}
|
|
137
135
|
),
|
|
138
|
-
|
|
136
|
+
b && /* @__PURE__ */ o(I, { children: [
|
|
139
137
|
/* @__PURE__ */ a(
|
|
140
138
|
"div",
|
|
141
139
|
{
|
|
142
|
-
className:
|
|
140
|
+
className: r([
|
|
143
141
|
n["results-table__header"],
|
|
144
142
|
"search-results-header",
|
|
145
|
-
|
|
143
|
+
_ ? n["results-table__header--compact"] : ""
|
|
146
144
|
]),
|
|
147
|
-
ref:
|
|
148
|
-
children:
|
|
145
|
+
ref: y,
|
|
146
|
+
children: R.length > 1 ? `${p && !u ? C.current : "Your"} ${l.brand_name} Channels` : `Your ${l.brand_name} Channel`
|
|
149
147
|
}
|
|
150
148
|
),
|
|
151
149
|
/* @__PURE__ */ a(
|
|
152
|
-
|
|
150
|
+
F,
|
|
153
151
|
{
|
|
154
152
|
columns: B,
|
|
155
|
-
compactLayout:
|
|
156
|
-
noResultsMsg: `Sorry there are no channels carrying ${
|
|
157
|
-
results:
|
|
153
|
+
compactLayout: _,
|
|
154
|
+
noResultsMsg: `Sorry there are no channels carrying ${l.brand_name} in your area at this time.`,
|
|
155
|
+
results: R
|
|
158
156
|
}
|
|
159
157
|
)
|
|
160
158
|
] }),
|
|
161
|
-
!
|
|
162
|
-
|
|
159
|
+
!_ && /* @__PURE__ */ a("div", { className: r([n["ad-wrapper"], "ad-wrapper"]), children: /* @__PURE__ */ a(
|
|
160
|
+
Y,
|
|
163
161
|
{
|
|
164
162
|
ad: {
|
|
165
163
|
header: "Fall in love with subscription-free TV.",
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsxs as _, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as g, useReducer as
|
|
2
|
+
import { useState as g, useReducer as I, useRef as m, useCallback as M, useEffect as p } from "react";
|
|
3
3
|
import { f as l } from "../../format-YhWt2D8M.mjs";
|
|
4
4
|
import { classes as o } from "../../utils/helpers.js";
|
|
5
|
-
import { useScheduleContext as
|
|
6
|
-
import { C as
|
|
5
|
+
import { useScheduleContext as S } from "../ScheduleLayout/useScheduleContext.js";
|
|
6
|
+
import { C as W } from "../../chevron-left-DRvpaLmK.mjs";
|
|
7
7
|
import { C as w } from "../../chevron-right-C8yCnmfx.mjs";
|
|
8
|
-
import '../../assets/DateNavigation.css';const
|
|
9
|
-
"date-navigation__list": "_date-
|
|
10
|
-
"date-navigation__control": "_date-
|
|
11
|
-
"date-navigation__control--previous": "_date-navigation__control--
|
|
12
|
-
"date-navigation__control--next": "_date-navigation__control--
|
|
13
|
-
"date-navigation__item": "_date-
|
|
14
|
-
"date-navigation__day": "_date-
|
|
15
|
-
"date-navigation__month-day-break": "_date-navigation__month-day-
|
|
16
|
-
"date-navigation__weekday": "_date-
|
|
17
|
-
"date-navigation__date": "_date-
|
|
8
|
+
import '../../assets/DateNavigation.css';const a = {
|
|
9
|
+
"date-navigation__list": "_date-navigation__list_1jjng_1",
|
|
10
|
+
"date-navigation__control": "_date-navigation__control_1jjng_72",
|
|
11
|
+
"date-navigation__control--previous": "_date-navigation__control--previous_1jjng_101",
|
|
12
|
+
"date-navigation__control--next": "_date-navigation__control--next_1jjng_106",
|
|
13
|
+
"date-navigation__item": "_date-navigation__item_1jjng_117",
|
|
14
|
+
"date-navigation__day": "_date-navigation__day_1jjng_132",
|
|
15
|
+
"date-navigation__month-day-break": "_date-navigation__month-day-break_1jjng_138",
|
|
16
|
+
"date-navigation__weekday": "_date-navigation__weekday_1jjng_142",
|
|
17
|
+
"date-navigation__date": "_date-navigation__date_1jjng_143"
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function A(n, i) {
|
|
20
20
|
switch (i.type) {
|
|
21
21
|
case "NAVIGATE_TO_WEEK":
|
|
22
|
-
return i.targetWeekIndex > i.currentWeekIndex ? "advancing" : i.targetWeekIndex < i.currentWeekIndex ? "retracting" :
|
|
22
|
+
return i.targetWeekIndex > i.currentWeekIndex ? "advancing" : i.targetWeekIndex < i.currentWeekIndex ? "retracting" : n;
|
|
23
23
|
case "ANIMATION_COMPLETE":
|
|
24
24
|
return "idle";
|
|
25
25
|
default:
|
|
26
|
-
return
|
|
26
|
+
return n;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const { weeks:
|
|
31
|
-
h({ type: "NAVIGATE_TO_WEEK", currentWeekIndex: r, targetWeekIndex: t }),
|
|
32
|
-
},
|
|
29
|
+
function V() {
|
|
30
|
+
const { weeks: n, setCurrentDate: i } = S(), [r, j] = g(0), [x, b] = g(n[0]), [s, y] = g(n[0][0]), [C, h] = I(A, "idle"), d = m(null), N = m(0), f = m(l(new Date(s.fullDateStr), "yyyy-MM-dd")), k = (t) => {
|
|
31
|
+
h({ type: "NAVIGATE_TO_WEEK", currentWeekIndex: r, targetWeekIndex: t }), j(t);
|
|
32
|
+
}, D = (t) => {
|
|
33
33
|
l(t.date, "yyyy-MM-dd") !== f.current && (f.current = l(t.date, "yyyy-MM-dd"), y(t), i(t.date));
|
|
34
|
-
}, c =
|
|
34
|
+
}, c = M(() => {
|
|
35
35
|
if (d.current === null) return;
|
|
36
36
|
const t = d.current;
|
|
37
37
|
t.addEventListener("animationstart", () => {
|
|
@@ -41,22 +41,22 @@ function P() {
|
|
|
41
41
|
return p(() => {
|
|
42
42
|
d.current !== null && (d.current.removeEventListener("animationend", c), d.current.addEventListener("animationend", c, { once: !0 }));
|
|
43
43
|
}, [c]), p(() => {
|
|
44
|
-
|
|
45
|
-
const t = r ? 0 : 1,
|
|
46
|
-
(v) => l(v.date, "yyyy-MM-dd") ===
|
|
44
|
+
b(n[r]);
|
|
45
|
+
const t = r ? 0 : 1, E = l(s.date, "yyyy-MM-dd"), u = n[t].findIndex(
|
|
46
|
+
(v) => l(v.date, "yyyy-MM-dd") === E
|
|
47
47
|
);
|
|
48
|
-
if (u !== -1 &&
|
|
49
|
-
const v =
|
|
50
|
-
|
|
48
|
+
if (u !== -1 && n[r][u]) {
|
|
49
|
+
const v = n[r][u];
|
|
50
|
+
N.current = u, y(v), i(v.date);
|
|
51
51
|
}
|
|
52
|
-
}, [r,
|
|
52
|
+
}, [r, n, i, s]), /* @__PURE__ */ _("date-navigation", { "data-state": C, children: [
|
|
53
53
|
/* @__PURE__ */ _("date-navigation-controls", { children: [
|
|
54
54
|
/* @__PURE__ */ _(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
57
57
|
className: o([
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
a["date-navigation__control"],
|
|
59
|
+
a["date-navigation__control--previous"],
|
|
60
60
|
"date-navigation__control",
|
|
61
61
|
"date-navigation__control--previous"
|
|
62
62
|
]),
|
|
@@ -66,7 +66,7 @@ function P() {
|
|
|
66
66
|
k(0);
|
|
67
67
|
},
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */ e("i", { "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
69
|
+
/* @__PURE__ */ e("i", { "aria-hidden": "true", children: /* @__PURE__ */ e(W, { height: 48, width: 48 }) }),
|
|
70
70
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Current Week" })
|
|
71
71
|
]
|
|
72
72
|
}
|
|
@@ -75,8 +75,8 @@ function P() {
|
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
77
|
className: o([
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
a["date-navigation__control"],
|
|
79
|
+
a["date-navigation__control--next"],
|
|
80
80
|
"date-navigation__control",
|
|
81
81
|
"date-navigation__control--next"
|
|
82
82
|
]),
|
|
@@ -96,44 +96,44 @@ function P() {
|
|
|
96
96
|
"ul",
|
|
97
97
|
{
|
|
98
98
|
"aria-label": "Date Tabs",
|
|
99
|
-
className: o([
|
|
99
|
+
className: o([a["date-navigation__list"], "date-navigation__list"]),
|
|
100
100
|
ref: d,
|
|
101
101
|
role: "tablist",
|
|
102
|
-
children:
|
|
102
|
+
children: x.map((t) => /* @__PURE__ */ e(
|
|
103
103
|
"li",
|
|
104
104
|
{
|
|
105
|
-
className: [
|
|
105
|
+
className: [a["date-navigation__item"], "date-navigation__item"].join(" "),
|
|
106
106
|
role: "presentation",
|
|
107
107
|
children: /* @__PURE__ */ _(
|
|
108
108
|
"button",
|
|
109
109
|
{
|
|
110
110
|
"aria-controls": `${t.fullDateStr}`,
|
|
111
111
|
"aria-selected": s.fullDateStr === t.fullDateStr,
|
|
112
|
-
className: o([
|
|
112
|
+
className: o([a["date-navigation__day"], "date-navigation__day"]),
|
|
113
113
|
role: "tab",
|
|
114
114
|
type: "button",
|
|
115
115
|
onClick: () => {
|
|
116
|
-
|
|
116
|
+
D(t);
|
|
117
117
|
},
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ e(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
|
-
className: o([
|
|
122
|
+
className: o([a["date-navigation__weekday"], "date-navigation__weekday"]),
|
|
123
123
|
children: t.dayStr
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
126
|
/* @__PURE__ */ _(
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
129
|
-
className: o([
|
|
129
|
+
className: o([a["date-navigation__date"], "date-navigation__date"]),
|
|
130
130
|
children: [
|
|
131
131
|
t.monthStr,
|
|
132
132
|
/* @__PURE__ */ e(
|
|
133
133
|
"br",
|
|
134
134
|
{
|
|
135
135
|
className: o([
|
|
136
|
-
|
|
136
|
+
a["date-navigation__month-day-break"],
|
|
137
137
|
"date-navigation__month-day-break"
|
|
138
138
|
])
|
|
139
139
|
}
|
|
@@ -153,6 +153,6 @@ function P() {
|
|
|
153
153
|
] });
|
|
154
154
|
}
|
|
155
155
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
V as DateNavigation,
|
|
157
|
+
V as default
|
|
158
158
|
};
|