cec-nuxt-lib 0.12.2 → 0.12.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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/cecBreadcrumb.vue +5 -1
- package/dist/runtime/components/cecCanvas.vue +13 -9
- package/dist/runtime/components/cecFeedback.vue +2 -3
- package/dist/runtime/components/cecFeedback.vue.d.ts +6 -27
- package/dist/runtime/components/cecHeader.vue +9 -10
- package/dist/runtime/components/cecMeta.vue +2 -3
- package/dist/runtime/components/inThisSection.vue +2 -2
- package/dist/runtime/components/pagination.vue +15 -21
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -52,7 +52,11 @@ const links = hrefs.map(
|
|
|
52
52
|
<li class="breadcrumb-item" v-for="(l, i) in links" :key="i">
|
|
53
53
|
<!-- Node we are on -->
|
|
54
54
|
<span v-if="i === links.length - 1">{{
|
|
55
|
-
links.includes(
|
|
55
|
+
links.includes('Parties')
|
|
56
|
+
? toTitleCase(decodeURIComponent(l))
|
|
57
|
+
: page.eventTitle
|
|
58
|
+
? page.eventTitle
|
|
59
|
+
: decodeURIComponent(l)
|
|
56
60
|
}}</span>
|
|
57
61
|
<!-- Nuxt links -->
|
|
58
62
|
<template v-else-if="i + 1 >= length">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useState } from "#app";
|
|
3
3
|
import { createRenderer, text } from "@contensis/canvas-html";
|
|
4
4
|
const getCanvas = (data) => renderer({ data });
|
|
5
|
-
const
|
|
5
|
+
const page = useState("page");
|
|
6
6
|
let canvasHtml;
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
canvas: {
|
|
@@ -354,8 +354,8 @@ const makeQuestions = (data, id) => {
|
|
|
354
354
|
);
|
|
355
355
|
qu.select += "</select>";
|
|
356
356
|
}
|
|
357
|
-
if (!
|
|
358
|
-
|
|
357
|
+
if (!page.value.questions.some((e) => e.id === id)) {
|
|
358
|
+
page.value.questions.push({
|
|
359
359
|
id,
|
|
360
360
|
question: data.question,
|
|
361
361
|
stack: [0]
|
|
@@ -477,10 +477,14 @@ const promotionalBannerWithText = (props2) => {
|
|
|
477
477
|
style="font-family: myriad-pro, sans-serif"
|
|
478
478
|
>
|
|
479
479
|
${paras[0]}
|
|
480
|
-
</h1
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
480
|
+
</h1>`;
|
|
481
|
+
if (paras[1] && paras[1].length) {
|
|
482
|
+
overlay += `
|
|
483
|
+
<div class="d-flex justify-content-center mt-2 strapline text-white">
|
|
484
|
+
${paras[1]}
|
|
485
|
+
</div>`;
|
|
486
|
+
}
|
|
487
|
+
overlay += `
|
|
484
488
|
</div>
|
|
485
489
|
</div>`;
|
|
486
490
|
}
|
|
@@ -600,10 +604,10 @@ const genericListAsAccordion = (props2) => {
|
|
|
600
604
|
};
|
|
601
605
|
const genList = (item, id) => {
|
|
602
606
|
let heading = item.title ? `<h2 class="fs-4 mt-3">${item.title}</h2>` : "";
|
|
603
|
-
return
|
|
607
|
+
return page.value.listItems[id] && page.value.listItems[id].length ? `
|
|
604
608
|
${heading}
|
|
605
609
|
<ul>
|
|
606
|
-
${
|
|
610
|
+
${page.value.listItems[id].reduce((acc, e) => {
|
|
607
611
|
return e.sys.dataFormat === "webpage" ? `${acc}
|
|
608
612
|
<li><a href="${processUri(e.sys.uri)}">${e.title}</a></li>
|
|
609
613
|
` : `${acc}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useState } from "#app";
|
|
3
3
|
const page = useState("page");
|
|
4
|
-
const settings = useState("settings");
|
|
5
4
|
const props = defineProps({
|
|
6
5
|
reviewed: {
|
|
7
6
|
type: String,
|
|
@@ -31,7 +30,7 @@ const dateOptions = {
|
|
|
31
30
|
<p v-if="reviewed && !page.hideReviewDate">
|
|
32
31
|
<small
|
|
33
32
|
>Page last reviewed:
|
|
34
|
-
{{ new Date(reviewed).toLocaleDateString(
|
|
33
|
+
{{ new Date(reviewed).toLocaleDateString('en-GB', dateOptions) }}
|
|
35
34
|
</small>
|
|
36
35
|
</p>
|
|
37
36
|
<div class="accordion pb-4">
|
|
@@ -60,7 +59,7 @@ const dateOptions = {
|
|
|
60
59
|
<ul class="list-unstyled list-inline">
|
|
61
60
|
<li class="list-inline-item me-3">
|
|
62
61
|
<a
|
|
63
|
-
:href="`https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=improve_this_page&pageTitle=${encodeURIComponent(title)}&pagePath=${
|
|
62
|
+
:href="`https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=improve_this_page&pageTitle=${encodeURIComponent(title)}&pagePath=${page.baseUrl}${path}`"
|
|
64
63
|
id="yes-feedback"
|
|
65
64
|
class="liberty_form_link btn btn-lg btn-outline-secondary btn-example-1 btn-chevron rounded-pill text-left"
|
|
66
65
|
>Yes<span class="visually-hidden">
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type: StringConstructor;
|
|
8
|
-
required: true;
|
|
9
|
-
};
|
|
10
|
-
title: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
required: true;
|
|
13
|
-
};
|
|
14
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
-
reviewed: {
|
|
16
|
-
type: StringConstructor;
|
|
17
|
-
required: true;
|
|
18
|
-
};
|
|
19
|
-
path: {
|
|
20
|
-
type: StringConstructor;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
title: {
|
|
24
|
-
type: StringConstructor;
|
|
25
|
-
required: true;
|
|
26
|
-
};
|
|
27
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
path: string;
|
|
3
|
+
reviewed: string;
|
|
4
|
+
title: string;
|
|
5
|
+
$props: any;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
7
|
export default _default;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { onMounted } from "vue";
|
|
3
3
|
import { useState, navigateTo } from "#app";
|
|
4
4
|
const page = useState("page");
|
|
5
|
-
const settings = useState("settings");
|
|
6
5
|
const regex = /^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
|
|
7
6
|
const config = {
|
|
8
7
|
apiKey: "c1a902dfad207b122cca32738e623af375e1d2ee",
|
|
@@ -81,9 +80,9 @@ const config = {
|
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
const doSearch = async () => {
|
|
84
|
-
if (
|
|
83
|
+
if (page.value.searchTerms) {
|
|
85
84
|
await navigateTo(
|
|
86
|
-
`https://www.cheshireeast.gov.uk/search-results?search_keywords=${encodeURI(
|
|
85
|
+
`https://www.cheshireeast.gov.uk/search-results?search_keywords=${encodeURI(page.value.searchTerms)}`,
|
|
87
86
|
{ external: true }
|
|
88
87
|
);
|
|
89
88
|
}
|
|
@@ -142,7 +141,7 @@ onMounted(() => {
|
|
|
142
141
|
const getQuInfo = (b) => {
|
|
143
142
|
let temp = b.id.split("_");
|
|
144
143
|
let id = temp[3];
|
|
145
|
-
let q =
|
|
144
|
+
let q = page.value.questions.find((e) => e.id === id);
|
|
146
145
|
if (q) {
|
|
147
146
|
let myQ = q.question[parseInt(temp[4])];
|
|
148
147
|
if (temp.length === 6) {
|
|
@@ -195,7 +194,7 @@ onMounted(() => {
|
|
|
195
194
|
forms.forEach((link) => {
|
|
196
195
|
link.href = `${link.href}&pageTitle=${encodeURIComponent(
|
|
197
196
|
page.value.title
|
|
198
|
-
)}&pagePath=${
|
|
197
|
+
)}&pagePath=${page.value.baseUrl}${encodeURIComponent(page.value.path)}`;
|
|
199
198
|
});
|
|
200
199
|
const setUpListeners = () => {
|
|
201
200
|
let qSelects = Array.from(
|
|
@@ -227,7 +226,7 @@ onMounted(() => {
|
|
|
227
226
|
});
|
|
228
227
|
};
|
|
229
228
|
const goto = (id, index, addToStack = true) => {
|
|
230
|
-
let qTop =
|
|
229
|
+
let qTop = page.value.questions.find((e) => e.id === id);
|
|
231
230
|
if (!index) {
|
|
232
231
|
qTop.stack = [0];
|
|
233
232
|
}
|
|
@@ -249,12 +248,12 @@ onMounted(() => {
|
|
|
249
248
|
);
|
|
250
249
|
};
|
|
251
250
|
const prev = (id) => {
|
|
252
|
-
let qTop =
|
|
251
|
+
let qTop = page.value.questions.find((e) => e.id === id);
|
|
253
252
|
let ind = qTop.stack.pop();
|
|
254
253
|
goto(id, ind, !qTop.stack.length);
|
|
255
254
|
};
|
|
256
255
|
const reset = (id) => {
|
|
257
|
-
let qTop =
|
|
256
|
+
let qTop = page.value.questions.find((e) => e.id === id);
|
|
258
257
|
if (qTop.stack.length) {
|
|
259
258
|
qTop.stack = [];
|
|
260
259
|
goto(id, 0);
|
|
@@ -349,10 +348,10 @@ onMounted(() => {
|
|
|
349
348
|
>Search</label
|
|
350
349
|
>
|
|
351
350
|
<input
|
|
352
|
-
v-model="
|
|
351
|
+
v-model="page.searchTerms"
|
|
353
352
|
@keypress.enter="doSearch"
|
|
354
353
|
placeholder="Enter keywords"
|
|
355
|
-
@focus="
|
|
354
|
+
@focus="page.searchTerms = ''"
|
|
356
355
|
type="text"
|
|
357
356
|
id="searchTextBox"
|
|
358
357
|
class="sys_searchbox"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useState, useHead, useSeoMeta } from "#app";
|
|
3
3
|
const page = useState("page");
|
|
4
|
-
const settings = useState("settings");
|
|
5
4
|
let reviewDate = page.value.dateReviewed ? new Date(page.value.dateReviewed) : /* @__PURE__ */ new Date();
|
|
6
5
|
let reviewISO = reviewDate.toISOString().slice(0, 10);
|
|
7
6
|
let meta = [
|
|
@@ -71,7 +70,7 @@ useHead({
|
|
|
71
70
|
},
|
|
72
71
|
{
|
|
73
72
|
"@type": "ContactPoint",
|
|
74
|
-
url: `https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=contact_us&pageTitle=${encodeURIComponent(page.value.title)}&pagePath=${
|
|
73
|
+
url: `https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=contact_us&pageTitle=${encodeURIComponent(page.value.title)}&pagePath=${page.value.baseUrl}${page.value.path}`,
|
|
75
74
|
contactType: "Online contact form",
|
|
76
75
|
areaServed: "Cheshire East"
|
|
77
76
|
}
|
|
@@ -104,7 +103,7 @@ useHead({
|
|
|
104
103
|
});
|
|
105
104
|
useSeoMeta({
|
|
106
105
|
ogTitle: page.value.title,
|
|
107
|
-
ogImage:
|
|
106
|
+
ogImage: page.value.ogImage,
|
|
108
107
|
ogDescription: page.value.title
|
|
109
108
|
});
|
|
110
109
|
</script>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useState } from "#app";
|
|
3
|
-
const
|
|
3
|
+
const page = useState("page");
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
7
7
|
<h2>Related pages</h2>
|
|
8
8
|
<ul>
|
|
9
|
-
<li v-for="item in
|
|
9
|
+
<li v-for="item in page.siblings">
|
|
10
10
|
<a :href="item.path">{{ item.displayName }}</a>
|
|
11
11
|
</li>
|
|
12
12
|
</ul>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useState } from "#app";
|
|
3
3
|
const page = useState("page");
|
|
4
|
-
const settings = useState("settings");
|
|
5
4
|
const goToPage = (n) => {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
page.value.pageIndex = n;
|
|
6
|
+
page.value.scrollTo.scrollIntoView();
|
|
8
7
|
};
|
|
9
8
|
const getResults = () => {
|
|
10
|
-
return
|
|
9
|
+
return page.value.pages.reduce((acc, p) => {
|
|
11
10
|
return acc + p.length;
|
|
12
11
|
}, 0);
|
|
13
12
|
};
|
|
@@ -17,7 +16,7 @@ const getResults = () => {
|
|
|
17
16
|
<div>
|
|
18
17
|
<nav
|
|
19
18
|
class="my-4"
|
|
20
|
-
v-if="
|
|
19
|
+
v-if="page.pages.length > 1"
|
|
21
20
|
aria-label="Results data navigation"
|
|
22
21
|
>
|
|
23
22
|
<ol class="pagination d-flex flex-wrap my-2 ms-0">
|
|
@@ -26,7 +25,7 @@ const getResults = () => {
|
|
|
26
25
|
class="page-link rounded"
|
|
27
26
|
type="button"
|
|
28
27
|
aria-label="First"
|
|
29
|
-
:class="{ disabled: !
|
|
28
|
+
:class="{ disabled: !page.pageIndex }"
|
|
30
29
|
@click="goToPage(0)"
|
|
31
30
|
>
|
|
32
31
|
First
|
|
@@ -37,15 +36,15 @@ const getResults = () => {
|
|
|
37
36
|
class="page-link rounded"
|
|
38
37
|
type="button"
|
|
39
38
|
aria-label="Previous"
|
|
40
|
-
:class="{ disabled: !
|
|
41
|
-
@click="goToPage(
|
|
39
|
+
:class="{ disabled: !page.pageIndex }"
|
|
40
|
+
@click="goToPage(page.pageIndex - 1)"
|
|
42
41
|
>
|
|
43
42
|
Previous
|
|
44
43
|
</button>
|
|
45
44
|
</li>
|
|
46
45
|
<li class="page-item mb-2 rounded disabled current">
|
|
47
46
|
<button class="page-link rounded" type="button">
|
|
48
|
-
{{
|
|
47
|
+
{{ page.pageIndex + 1 }}
|
|
49
48
|
</button>
|
|
50
49
|
</li>
|
|
51
50
|
<li class="page-item mb-2">
|
|
@@ -54,9 +53,9 @@ const getResults = () => {
|
|
|
54
53
|
type="button"
|
|
55
54
|
aria-label="Next"
|
|
56
55
|
:class="{
|
|
57
|
-
disabled:
|
|
56
|
+
disabled: page.pageIndex + 1 === page.pages.length,
|
|
58
57
|
}"
|
|
59
|
-
@click="goToPage(
|
|
58
|
+
@click="goToPage(page.pageIndex + 1)"
|
|
60
59
|
>
|
|
61
60
|
Next
|
|
62
61
|
</button>
|
|
@@ -67,9 +66,9 @@ const getResults = () => {
|
|
|
67
66
|
type="button"
|
|
68
67
|
aria-label="Last"
|
|
69
68
|
:class="{
|
|
70
|
-
disabled:
|
|
69
|
+
disabled: page.pageIndex === page.pages.length - 1,
|
|
71
70
|
}"
|
|
72
|
-
@click="goToPage(
|
|
71
|
+
@click="goToPage(page.pages.length - 1)"
|
|
73
72
|
>
|
|
74
73
|
Last
|
|
75
74
|
</button>
|
|
@@ -78,16 +77,11 @@ const getResults = () => {
|
|
|
78
77
|
</nav>
|
|
79
78
|
<p>
|
|
80
79
|
<span
|
|
81
|
-
v-if="
|
|
82
|
-
page.showResultsNum &&
|
|
83
|
-
settings.pages[0] &&
|
|
84
|
-
settings.pages[0].length > 0
|
|
85
|
-
"
|
|
80
|
+
v-if="page.showResultsNum && page.pages[0] && page.pages[0].length > 0"
|
|
86
81
|
>Total results: {{ getResults() }}. </span
|
|
87
82
|
>
|
|
88
|
-
<span v-if="
|
|
89
|
-
>Viewing page {{
|
|
90
|
-
{{ settings.pages.length }}.</span
|
|
83
|
+
<span v-if="page.pages.length > 1"
|
|
84
|
+
>Viewing page {{ page.pageIndex + 1 }} of {{ page.pages.length }}.</span
|
|
91
85
|
>
|
|
92
86
|
</p>
|
|
93
87
|
</div>
|
package/package.json
CHANGED