@explorer-1/vue 0.2.29 → 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 +1 -1
- 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/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.stories.js +1 -0
- package/src/templates/edu/PageEduCollectionsDetail/PageEduCollectionsDetail.vue +26 -5
- package/src/utils/mixins.ts +7 -3
package/package.json
CHANGED
|
@@ -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 (
|
|
@@ -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,9 +58,9 @@ 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
|
|
@@ -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
|
|
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
|
}
|