@explorer-1/vue 0.2.28 → 0.2.30
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/package.json +2 -2
- package/src/components/AboutTheAuthor/AboutTheAuthor.vue +1 -1
- package/src/components/BaseAccordionItem/BaseAccordionItem.vue +1 -1
- package/src/components/BlockCardGrid/BlockCardGrid.vue +1 -1
- package/src/components/BlockLinkCard/BlockLinkCard.vue +1 -1
- package/src/components/BlockStreamfield/BlockStreamfield.vue +5 -3
- package/src/components/CalendarButton/CalendarButton.vue +5 -4
- package/src/components/MetaPanel/MetaPanel.stories.js +1 -1
- package/src/components/MetaPanel/MetaPanel.vue +3 -3
- package/src/components/MetaPanelItems/MetaPanelItems.vue +6 -9
- package/src/components/MetadataEduResource/MetadataEduResource.vue +1 -1
- package/src/components/MetadataEvent/MetadataEvent.stories.js +6 -4
- package/src/components/NavDesktop/NavDesktop.vue +7 -4
- package/src/components/NavJumpMenu/NavJumpMenu.vue +1 -0
- package/src/components/NavSecondary/NavSecondary.vue +11 -2
- package/src/interfaces.ts +1 -0
- package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.stories.js +1 -0
- package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.vue +27 -6
- package/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +1 -1
- package/src/templates/edu/PageEduLesson/PageEduLesson.vue +0 -1
- package/src/templates/edu/PageEduNewsDetail/PageEduNewsDetail.vue +1 -1
- package/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.stories.js +1 -0
- package/src/templates/edu/PageEduTeachableMoment/PageEduTeachableMoment.vue +2 -1
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.vue +1 -1
- package/src/utils/dayjs.js +2 -0
- package/src/utils/mixins.ts +7 -3
- package/src/utils/rangeifyGrades.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@explorer-1/vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.30",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vue-bind-once": "^0.2.1",
|
|
31
31
|
"vue-observe-visibility": "^1.0.0",
|
|
32
32
|
"vue3-compare-image": "^1.2.5",
|
|
33
|
-
"@explorer-1/common": "1.1.
|
|
33
|
+
"@explorer-1/common": "1.1.9"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
@@ -271,7 +271,7 @@ export default defineComponent({
|
|
|
271
271
|
} else if (this.medium) {
|
|
272
272
|
classes = 'can-hover:group-hover:-translate-y-3 edu:can-hover:group-hover:-translate-y-2'
|
|
273
273
|
} else if (this.large) {
|
|
274
|
-
classes = 'sm:pl-8 sm:w-2/3'
|
|
274
|
+
classes = 'sm:pl-8 sm:w-2/3 lg:pt-2'
|
|
275
275
|
}
|
|
276
276
|
return classes
|
|
277
277
|
},
|
|
@@ -202,9 +202,11 @@
|
|
|
202
202
|
<div
|
|
203
203
|
v-else-if="block.blockType == 'ListBlock' && block.field === 'card_grid'"
|
|
204
204
|
:key="`cardGridBlock${index}`"
|
|
205
|
-
class="lg:mb-18 mb-10"
|
|
205
|
+
class="LayoutHelper md:BaseGrid md:container md:mx-auto lg:mb-18 mb-10"
|
|
206
206
|
>
|
|
207
|
-
<
|
|
207
|
+
<div class="lg:col-start-2 lg:col-end-12 md:col-span-full md:px-4 px-0 relative">
|
|
208
|
+
<BlockCardGrid :cards="block.items" />
|
|
209
|
+
</div>
|
|
208
210
|
</div>
|
|
209
211
|
|
|
210
212
|
<div
|
|
@@ -218,7 +220,7 @@
|
|
|
218
220
|
<LayoutHelper
|
|
219
221
|
v-else-if="block.blockType === 'LinkCardListBlock' && block.blocks?.length"
|
|
220
222
|
:key="`linkCardListBlock${index}`"
|
|
221
|
-
indent="col-
|
|
223
|
+
indent="col-2"
|
|
222
224
|
class="lg:mb-18 mb-10"
|
|
223
225
|
>
|
|
224
226
|
<BlockLinkCardList :items="block.blocks" />
|
|
@@ -80,11 +80,10 @@ export default defineComponent({
|
|
|
80
80
|
init() {
|
|
81
81
|
let recurrence = undefined
|
|
82
82
|
if ((this.isAllDay && this.endDatetime) || (this.startDate && this.endDatetime)) {
|
|
83
|
-
console.log('initing')
|
|
84
83
|
// Calculate how many full days
|
|
85
84
|
const startDateDayjs = this.startDatetime
|
|
86
85
|
? dayjs(this.startDatetime)
|
|
87
|
-
: dayjs(this.startDate)
|
|
86
|
+
: dayjs(this.startDate).tz('America/Los_Angeles')
|
|
88
87
|
const endDateDayjs = dayjs(this.endDatetime)
|
|
89
88
|
const difference = endDateDayjs.diff(startDateDayjs, 'day') + 1
|
|
90
89
|
recurrence = { frequency: 'DAILY', interval: 1, count: difference }
|
|
@@ -95,9 +94,11 @@ export default defineComponent({
|
|
|
95
94
|
location: this.location ? this.location : undefined,
|
|
96
95
|
description: this.icsDescription,
|
|
97
96
|
start: this.startDatetime
|
|
98
|
-
?
|
|
97
|
+
? // @ts-ignore
|
|
98
|
+
new Date(dayjs(this.startDatetime))
|
|
99
99
|
: this.startDate
|
|
100
|
-
?
|
|
100
|
+
? // @ts-ignore
|
|
101
|
+
new Date(dayjs(this.startDate).tz('America/Los_Angeles'))
|
|
101
102
|
: new Date(),
|
|
102
103
|
end: !this.isAllDay && this.endDatetime ? new Date(this.endDatetime) : undefined,
|
|
103
104
|
recurrence
|
|
@@ -30,7 +30,7 @@ export const BaseStory = {
|
|
|
30
30
|
button: 'View Standards',
|
|
31
31
|
primarySubject: { subject: 'Math' },
|
|
32
32
|
additionalSubjects: [{ subject: 'Science' }],
|
|
33
|
-
time: '30mins - hr',
|
|
33
|
+
time: { time: '30mins - hr' },
|
|
34
34
|
gradeLevels: [
|
|
35
35
|
{ gradeLevel: 'All Ages' },
|
|
36
36
|
{ gradeLevel: 'K' },
|
|
@@ -102,7 +102,7 @@ const standardsEla = computed(() => {
|
|
|
102
102
|
return sortedStandards.value ? sortedStandards.value['ccss_english_language_arts'] : undefined
|
|
103
103
|
})
|
|
104
104
|
const standardsMath = computed(() => {
|
|
105
|
-
return sortedStandards.value ? sortedStandards.value['
|
|
105
|
+
return sortedStandards.value ? sortedStandards.value['ccss_maths'] : undefined
|
|
106
106
|
})
|
|
107
107
|
const standardsNgss = computed(() => {
|
|
108
108
|
return sortedStandards.value ? sortedStandards.value['ngss'] : undefined
|
|
@@ -128,7 +128,7 @@ const standardsIste = computed(() => {
|
|
|
128
128
|
>
|
|
129
129
|
<div class="col-start-container lg:col-start-indent-col-2 col-end-container">
|
|
130
130
|
<div class="MetaPanel-heading lg:grid grid-cols-12 col-end-container container">
|
|
131
|
-
<div class="col-start-1 col-end-10 xl:col-end-9 pl-4 lg:pl-10 pr-
|
|
131
|
+
<div class="col-start-1 col-end-10 xl:col-end-9 pl-4 lg:pl-10 pr-6 py-6 lg:py-10">
|
|
132
132
|
<MetaPanelItems
|
|
133
133
|
:theme="theme"
|
|
134
134
|
:primary-subject="primarySubject"
|
|
@@ -139,7 +139,7 @@ const standardsIste = computed(() => {
|
|
|
139
139
|
</div>
|
|
140
140
|
<div
|
|
141
141
|
v-if="button"
|
|
142
|
-
class="ThemeVariantLight col-start-10 col-end-13 pl-4 pt-4 pb-6 lg:py-10 lg:text-right"
|
|
142
|
+
class="ThemeVariantLight col-start-10 col-end-13 pl-4 lg:pl-0 pt-4 pb-6 lg:pr-4 xl:pr-10 2xl:pr-0 lg:py-10 lg:text-right"
|
|
143
143
|
>
|
|
144
144
|
<BaseButton
|
|
145
145
|
variant="secondary"
|
|
@@ -31,7 +31,7 @@ const props = withDefaults(defineProps<MetaPanelProps>(), {
|
|
|
31
31
|
const { theme, primarySubject, additionalSubjects, gradeLevels, time } = reactive(props)
|
|
32
32
|
|
|
33
33
|
const audience = computed(() => {
|
|
34
|
-
return gradeLevels ? rangeifyGrades(gradeLevels) : undefined
|
|
34
|
+
return gradeLevels ? rangeifyGrades(gradeLevels, false) : undefined
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
const subjects = computed(() => {
|
|
@@ -85,11 +85,11 @@ const themeVariant = computed(() => {
|
|
|
85
85
|
|
|
86
86
|
<template>
|
|
87
87
|
<div
|
|
88
|
-
class="MetaPanelItems md:flex gap-10"
|
|
89
|
-
:class="{ 'justify-between': subjects && audience && time }"
|
|
88
|
+
class="MetaPanelItems md:flex gap-10 pr-5 sm:pr-10 lg:pr-20"
|
|
89
|
+
:class="{ 'justify-between': subjects && audience && time?.time }"
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
|
-
v-if="
|
|
92
|
+
v-if="primarySubject?.subject"
|
|
93
93
|
class="MetaPanelItem"
|
|
94
94
|
>
|
|
95
95
|
<div
|
|
@@ -103,14 +103,13 @@ const themeVariant = computed(() => {
|
|
|
103
103
|
class="MetaPanelItem-heading"
|
|
104
104
|
:class="`${themeVariant} ${headingColor}`"
|
|
105
105
|
>
|
|
106
|
-
|
|
107
|
-
<span class="sr-only">.</span>
|
|
106
|
+
Subject
|
|
108
107
|
</div>
|
|
109
108
|
<div
|
|
110
109
|
class="MetaPanelItem-content"
|
|
111
110
|
:class="textColor"
|
|
112
111
|
>
|
|
113
|
-
{{
|
|
112
|
+
{{ primarySubject.subject }}
|
|
114
113
|
</div>
|
|
115
114
|
</div>
|
|
116
115
|
</div>
|
|
@@ -130,7 +129,6 @@ const themeVariant = computed(() => {
|
|
|
130
129
|
:class="`${themeVariant} ${headingColor}`"
|
|
131
130
|
>
|
|
132
131
|
Grade Levels
|
|
133
|
-
<span class="sr-only">.</span>
|
|
134
132
|
</div>
|
|
135
133
|
<div
|
|
136
134
|
class="MetaPanelItem-content"
|
|
@@ -156,7 +154,6 @@ const themeVariant = computed(() => {
|
|
|
156
154
|
:class="`${themeVariant} ${headingColor}`"
|
|
157
155
|
>
|
|
158
156
|
Time Required
|
|
159
|
-
<span class="sr-only">.</span>
|
|
160
157
|
</div>
|
|
161
158
|
<div
|
|
162
159
|
class="MetaPanelItem-content"
|
|
@@ -12,12 +12,14 @@ export const MetadataEventData = {
|
|
|
12
12
|
event: {
|
|
13
13
|
title: 'Event title',
|
|
14
14
|
location: 'Location',
|
|
15
|
-
startDate: '
|
|
16
|
-
startDatetime: '
|
|
17
|
-
|
|
15
|
+
startDate: '2024-08-08',
|
|
16
|
+
startDatetime: '2024-08-08T14:00:00-07:00',
|
|
17
|
+
startTime: '15:00:00',
|
|
18
|
+
endDate: '2024-08-08',
|
|
19
|
+
endDatetime: '2024-08-08T22:00:00-07:00',
|
|
20
|
+
endTime: '22:00:00',
|
|
18
21
|
ongoing: false,
|
|
19
22
|
isVirtualEvent: false,
|
|
20
|
-
endDatetime: '2021-11-11T23:59:59.999999-08:00',
|
|
21
23
|
locationName: 'Webcast',
|
|
22
24
|
locationLink: 'https://www.nasa.gov',
|
|
23
25
|
customDate: undefined
|
|
@@ -246,14 +246,17 @@ export default defineComponent({
|
|
|
246
246
|
// to determine active class on menu links and 'more' menu links
|
|
247
247
|
checkActive(item: LinkObject) {
|
|
248
248
|
const urlKey = this.getUrlKey(item)
|
|
249
|
-
if (urlKey && this.breadcrumb
|
|
249
|
+
if (urlKey && this.breadcrumb?.menu_links) {
|
|
250
250
|
// key into the breadcrumbs for each section
|
|
251
|
-
const
|
|
251
|
+
const sectionLinks = this.breadcrumb.menu_links[urlKey]
|
|
252
252
|
// check if any of the paths contained in the array are active
|
|
253
|
-
const isActive =
|
|
253
|
+
const isActive = sectionLinks.some((link: BreadcrumbPathObject) =>
|
|
254
|
+
mixinIsActivePath(link.path)
|
|
255
|
+
)
|
|
254
256
|
if (isActive) {
|
|
255
|
-
mixinUpdateGlobalChildren(
|
|
257
|
+
mixinUpdateGlobalChildren(sectionLinks)
|
|
256
258
|
}
|
|
259
|
+
console.log(isActive)
|
|
257
260
|
return isActive
|
|
258
261
|
}
|
|
259
262
|
return false
|
|
@@ -79,6 +79,10 @@ export default defineComponent({
|
|
|
79
79
|
type: Boolean,
|
|
80
80
|
required: false,
|
|
81
81
|
default: false
|
|
82
|
+
},
|
|
83
|
+
jumpMenu: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
82
86
|
}
|
|
83
87
|
},
|
|
84
88
|
data(): {
|
|
@@ -101,9 +105,12 @@ export default defineComponent({
|
|
|
101
105
|
if (this.breadcrumb) {
|
|
102
106
|
// we also want to update the store to override secondary nav
|
|
103
107
|
mixinUpdateSecondary(JSON.parse(this.breadcrumb))
|
|
108
|
+
|
|
104
109
|
return JSON.parse(this.breadcrumb)
|
|
105
110
|
} else if (this.headerStore) {
|
|
106
|
-
|
|
111
|
+
if (!this.jumpMenu) {
|
|
112
|
+
return this.headerStore.globalChildren
|
|
113
|
+
}
|
|
107
114
|
}
|
|
108
115
|
return undefined
|
|
109
116
|
},
|
|
@@ -117,7 +124,9 @@ export default defineComponent({
|
|
|
117
124
|
mounted() {
|
|
118
125
|
if (this.enabled) {
|
|
119
126
|
// if there is a secondary nav displayed, then don't highlight the primary active item
|
|
120
|
-
|
|
127
|
+
if (!this.jumpMenu) {
|
|
128
|
+
mixinHighlightPrimary(false)
|
|
129
|
+
}
|
|
121
130
|
}
|
|
122
131
|
|
|
123
132
|
if (
|
package/src/interfaces.ts
CHANGED
|
@@ -10,12 +10,13 @@ import BlockRelatedLinks from '../../../components/BlockRelatedLinks/BlockRelate
|
|
|
10
10
|
import HeroLarge from './../../../components/HeroLarge/HeroLarge.vue'
|
|
11
11
|
import NavJumpMenu from './../../../components/NavJumpMenu/NavJumpMenu.vue'
|
|
12
12
|
import MetaPanel from '../../../components/MetaPanel/MetaPanel.vue'
|
|
13
|
+
import ShareButtonsEdu from '../../../components/ShareButtonsEdu/ShareButtonsEdu.vue'
|
|
13
14
|
|
|
14
15
|
interface PageEduCollectionsDetail extends PageEduResourcesObject {
|
|
15
16
|
heroImage: ImageObject
|
|
16
17
|
heroImageCaption: string
|
|
17
18
|
showMetaPanel: boolean
|
|
18
|
-
|
|
19
|
+
heroSummary: string
|
|
19
20
|
}
|
|
20
21
|
interface PageEduCollectionsDetailProps {
|
|
21
22
|
data?: PageEduCollectionsDetail
|
|
@@ -57,16 +58,16 @@ const computedClass = computed((): string => {
|
|
|
57
58
|
v-if="!heroInline && data.heroImage"
|
|
58
59
|
:title="data.title"
|
|
59
60
|
:image="data.heroImage"
|
|
60
|
-
:summary="
|
|
61
|
+
:summary="data.heroSummary"
|
|
61
62
|
:custom-pill-type="data.__typename"
|
|
62
|
-
:class="!data.showMetaPanel ? 'mb-10
|
|
63
|
+
:class="!data.showMetaPanel ? 'mb-10' : ''"
|
|
63
64
|
/>
|
|
64
65
|
|
|
65
66
|
<NavJumpMenu
|
|
67
|
+
v-if="data.showJumpMenu"
|
|
66
68
|
ref="PageEduCollectionsDetailJumpMenu"
|
|
67
69
|
:title="data.title"
|
|
68
70
|
:blocks="data.body"
|
|
69
|
-
:enabled="data.showJumpMenu"
|
|
70
71
|
dropdown-text="In this collection"
|
|
71
72
|
/>
|
|
72
73
|
|
|
@@ -81,11 +82,18 @@ const computedClass = computed((): string => {
|
|
|
81
82
|
pill
|
|
82
83
|
pill-color="primary-inverted"
|
|
83
84
|
/>
|
|
85
|
+
|
|
86
|
+
<ShareButtonsEdu
|
|
87
|
+
class="mt-4"
|
|
88
|
+
:title="data.title"
|
|
89
|
+
:url="data.url"
|
|
90
|
+
/>
|
|
84
91
|
</LayoutHelper>
|
|
92
|
+
|
|
85
93
|
<MetaPanel
|
|
86
94
|
v-if="data.showMetaPanel"
|
|
87
95
|
theme="primary"
|
|
88
|
-
:class="{ 'mb-10 lg:mb-
|
|
96
|
+
:class="{ 'mb-10 lg:mb-12': true }"
|
|
89
97
|
:primary-subject="data.primarySubject"
|
|
90
98
|
:additional-subjects="data.additionalSubjects"
|
|
91
99
|
:grade-levels="data.gradeLevels"
|
|
@@ -96,7 +104,7 @@ const computedClass = computed((): string => {
|
|
|
96
104
|
<!-- TODO: put this in a component (exclude layout though) -->
|
|
97
105
|
<LayoutHelper
|
|
98
106
|
v-if="data.heroImage && heroInline"
|
|
99
|
-
class="
|
|
107
|
+
class="mb-10 lg:mb-18"
|
|
100
108
|
>
|
|
101
109
|
<BlockImageStandard
|
|
102
110
|
:data="data.heroImage"
|
|
@@ -106,6 +114,19 @@ const computedClass = computed((): string => {
|
|
|
106
114
|
/>
|
|
107
115
|
</LayoutHelper>
|
|
108
116
|
|
|
117
|
+
<LayoutHelper
|
|
118
|
+
v-if="!heroInline"
|
|
119
|
+
indent="col-2"
|
|
120
|
+
class="mb-6 lg:mb-12"
|
|
121
|
+
:class="{ '-mt-4': data.showMetaPanel }"
|
|
122
|
+
>
|
|
123
|
+
<ShareButtonsEdu
|
|
124
|
+
class="mt-4"
|
|
125
|
+
:title="data.title"
|
|
126
|
+
:url="data.url"
|
|
127
|
+
/>
|
|
128
|
+
</LayoutHelper>
|
|
129
|
+
|
|
109
130
|
<!-- streamfield blocks -->
|
|
110
131
|
<BlockStreamfield :data="data.body" />
|
|
111
132
|
|
|
@@ -120,9 +120,9 @@ export default defineComponent({
|
|
|
120
120
|
</LayoutHelper>
|
|
121
121
|
|
|
122
122
|
<NavJumpMenu
|
|
123
|
+
v-if="data.showJumpMenu"
|
|
123
124
|
:title="data.title"
|
|
124
125
|
:blocks="data.body"
|
|
125
|
-
:enabled="data.showJumpMenu"
|
|
126
126
|
dropdown-text="In this article"
|
|
127
127
|
/>
|
|
128
128
|
<!-- inline hero content -->
|
|
@@ -69,10 +69,10 @@ defineExpose({
|
|
|
69
69
|
itemtype="http://schema.org/Article"
|
|
70
70
|
>
|
|
71
71
|
<NavJumpMenu
|
|
72
|
+
v-if="data.showJumpMenu"
|
|
72
73
|
ref="PageEduNewsDetailJumpMenu"
|
|
73
74
|
:title="data.title"
|
|
74
75
|
:blocks="data.body"
|
|
75
|
-
:enabled="data.showJumpMenu"
|
|
76
76
|
dropdown-text="In this news article"
|
|
77
77
|
/>
|
|
78
78
|
|
|
@@ -42,6 +42,7 @@ export const BaseStory = {
|
|
|
42
42
|
url: 'http://localhost:3000/edu/resources/teachable-moment',
|
|
43
43
|
pageType: 'EDUTeachableMomentPage',
|
|
44
44
|
contentType: 'edu_resources.EDUTeachableMomentPage',
|
|
45
|
+
readTime: '5 min read',
|
|
45
46
|
showJumpMenu: true,
|
|
46
47
|
thumbnailImage: {
|
|
47
48
|
__typename: 'CustomImage',
|
|
@@ -67,10 +67,10 @@ const computedClass = computed((): string => {
|
|
|
67
67
|
:class="computedClass"
|
|
68
68
|
>
|
|
69
69
|
<NavJumpMenu
|
|
70
|
+
v-if="data.showJumpMenu"
|
|
70
71
|
ref="PageEduTeachableMomentJumpMenu"
|
|
71
72
|
:title="data.title"
|
|
72
73
|
:blocks="data.body"
|
|
73
|
-
:enabled="data.showJumpMenu"
|
|
74
74
|
dropdown-text="In this Teachable Moment"
|
|
75
75
|
/>
|
|
76
76
|
|
|
@@ -97,6 +97,7 @@ const computedClass = computed((): string => {
|
|
|
97
97
|
>
|
|
98
98
|
<DetailHeadline
|
|
99
99
|
:title="data.title"
|
|
100
|
+
:read-time="data.readTime"
|
|
100
101
|
label="Teachable Moment"
|
|
101
102
|
pill
|
|
102
103
|
/>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<!-- facts -->
|
|
39
39
|
<BlockCardGrid
|
|
40
40
|
v-if="data.facts"
|
|
41
|
-
class="3xl:col-end-13 xl:col-end-11 md:px-4 lg:px-0 relative col-start-2 col-end-13 px-0 mt-12"
|
|
41
|
+
class="3xl:col-end-13 xl:col-end-11 md:px-4 lg:px-0 relative sm:col-start-2 sm:col-end-13 px-0 mt-12"
|
|
42
42
|
:cards="data.facts"
|
|
43
43
|
/>
|
|
44
44
|
</div>
|
package/src/utils/dayjs.js
CHANGED
|
@@ -2,6 +2,7 @@ import dayjs from 'dayjs'
|
|
|
2
2
|
import updateLocale from 'dayjs/plugin/updateLocale.js'
|
|
3
3
|
import localizedFormat from 'dayjs/plugin/localizedFormat.js'
|
|
4
4
|
import timezone from 'dayjs/plugin/timezone.js'
|
|
5
|
+
import utc from 'dayjs/plugin/utc.js'
|
|
5
6
|
import advancedFormat from 'dayjs/plugin/advancedFormat.js'
|
|
6
7
|
import duration from 'dayjs/plugin/duration.js'
|
|
7
8
|
import minMax from 'dayjs/plugin/minMax.js'
|
|
@@ -10,6 +11,7 @@ import minMax from 'dayjs/plugin/minMax.js'
|
|
|
10
11
|
import 'dayjs/locale/en-gb.js'
|
|
11
12
|
|
|
12
13
|
dayjs.extend(timezone)
|
|
14
|
+
dayjs.extend(utc)
|
|
13
15
|
dayjs.extend(advancedFormat)
|
|
14
16
|
dayjs.extend(localizedFormat)
|
|
15
17
|
dayjs.extend(updateLocale)
|
package/src/utils/mixins.ts
CHANGED
|
@@ -149,12 +149,16 @@ export const mixinHighlightPrimary = (value: boolean) => {
|
|
|
149
149
|
*/
|
|
150
150
|
export const mixinIsActivePath = (itemPath: string): Boolean => {
|
|
151
151
|
const route = useRoute()
|
|
152
|
-
const currentPath = route ? route.path :
|
|
153
|
-
const path = itemPath
|
|
154
|
-
const ancestorPath = path ? (path.endsWith('/') ? path : path + '/') :
|
|
152
|
+
const currentPath = route ? route.path : false
|
|
153
|
+
const path = itemPath.startsWith('http') ? itemPath.replace(/^.*\/\/[^/]+/, '') : itemPath
|
|
154
|
+
const ancestorPath = path ? (path.endsWith('/') ? path : path + '/') : false
|
|
155
|
+
|
|
155
156
|
if (currentPath && path && ancestorPath) {
|
|
156
157
|
if (currentPath === path) {
|
|
157
158
|
return true
|
|
159
|
+
} else if (currentPath.startsWith('/edu/events')) {
|
|
160
|
+
// special treatment since EDU combines News & Events in the main nav
|
|
161
|
+
return path.startsWith('/edu/news')
|
|
158
162
|
} else {
|
|
159
163
|
return currentPath.startsWith(ancestorPath)
|
|
160
164
|
}
|
|
@@ -47,7 +47,7 @@ const rangeify = (a: number[]): string[] => {
|
|
|
47
47
|
return res
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export const rangeifyGrades = (gradeLevels: GradeLevelsObject[]) => {
|
|
50
|
+
export const rangeifyGrades = (gradeLevels: GradeLevelsObject[], showLabel: boolean = true) => {
|
|
51
51
|
if (gradeLevels) {
|
|
52
52
|
const allAgesArray = gradeLevels.map((item) => {
|
|
53
53
|
if (item.gradeLevel === 'All Ages') return item.gradeLevel
|
|
@@ -65,7 +65,7 @@ export const rangeifyGrades = (gradeLevels: GradeLevelsObject[]) => {
|
|
|
65
65
|
if (filteredGrades?.length) {
|
|
66
66
|
const gradeString = filteredGrades.length > 0 ? 'Grades ' : 'Grade '
|
|
67
67
|
preparedGrades = filteredGrades
|
|
68
|
-
.map((grade, index) => (index === 0 ? gradeString + grade : grade))
|
|
68
|
+
.map((grade, index) => (index === 0 && showLabel ? gradeString + grade : grade))
|
|
69
69
|
.join(', ')
|
|
70
70
|
}
|
|
71
71
|
|