cec-nuxt-lib 0.10.3 → 0.10.5
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.d.mts +2 -1
- package/dist/module.json +5 -1
- package/dist/runtime/components/cecBreadcrumb.vue +27 -50
- package/dist/runtime/components/cecBreadcrumb.vue.d.ts +2 -0
- package/dist/runtime/components/cecCanvas.vue +148 -220
- package/dist/runtime/components/cecCanvas.vue.d.ts +12 -0
- package/dist/runtime/components/cecFeedback.vue +11 -11
- package/dist/runtime/components/cecFeedback.vue.d.ts +28 -0
- package/dist/runtime/components/cecFooter.vue.d.ts +2 -0
- package/dist/runtime/components/cecHeader.vue +104 -149
- package/dist/runtime/components/cecHeader.vue.d.ts +2 -0
- package/dist/runtime/components/cecMeta.vue +73 -80
- package/dist/runtime/components/cecMeta.vue.d.ts +2 -0
- package/dist/runtime/components/chatbot.vue +50 -65
- package/dist/runtime/components/chatbot.vue.d.ts +2 -0
- package/dist/runtime/components/inThisSection.vue +2 -2
- package/dist/runtime/components/inThisSection.vue.d.ts +2 -0
- package/dist/runtime/components/pagination.vue +5 -6
- package/dist/runtime/components/pagination.vue.d.ts +2 -0
- package/dist/types.d.mts +2 -15
- package/package.json +24 -17
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -7
- package/dist/types.d.ts +0 -16
- /package/dist/runtime/composables/{useMakePages.mjs → useMakePages.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
canvas: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
canvas: {
|
|
8
|
+
type: ObjectConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { useState } from
|
|
3
|
-
const page = useState(
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useState } from "#app";
|
|
3
|
+
const page = useState("page");
|
|
4
|
+
const baseUrl = useState("baseUrl");
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
reviewed: {
|
|
6
7
|
type: String,
|
|
7
|
-
required: true
|
|
8
|
+
required: true
|
|
8
9
|
},
|
|
9
10
|
path: {
|
|
10
11
|
type: String,
|
|
11
|
-
required: true
|
|
12
|
+
required: true
|
|
12
13
|
},
|
|
13
14
|
title: {
|
|
14
15
|
type: String,
|
|
15
|
-
required: true
|
|
16
|
-
}
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
17
18
|
});
|
|
18
|
-
|
|
19
19
|
const { path, title, reviewed } = props;
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
|
-
<div class="mt-4">
|
|
23
|
+
<div class="mt-4 container">
|
|
24
24
|
<div class="row">
|
|
25
25
|
<div class="col-lg-8">
|
|
26
26
|
<p v-if="reviewed && !page.hideReviewDate">
|
|
27
27
|
<small
|
|
28
28
|
>Page last reviewed:
|
|
29
|
-
{{ new Date(reviewed).toLocaleDateString(
|
|
29
|
+
{{ new Date(reviewed).toLocaleDateString("en-GB") }}
|
|
30
30
|
</small>
|
|
31
31
|
</p>
|
|
32
32
|
<div class="accordion pb-4">
|
|
@@ -55,7 +55,7 @@ const { path, title, reviewed } = props;
|
|
|
55
55
|
<ul class="list-unstyled list-inline">
|
|
56
56
|
<li class="list-inline-item me-3">
|
|
57
57
|
<a
|
|
58
|
-
:href="`https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=improve_this_page&pageTitle=${encodeURIComponent(title)}&pagePath
|
|
58
|
+
:href="`https://digital-core.cheshireeast.gov.uk/w/webpage/request?form=improve_this_page&pageTitle=${encodeURIComponent(title)}&pagePath=${baseUrl}${path}`"
|
|
59
59
|
id="yes-feedback"
|
|
60
60
|
class="liberty_form_link btn btn-lg btn-outline-secondary btn-example-1 btn-chevron rounded-pill text-left"
|
|
61
61
|
>Yes<span class="visually-hidden">
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
reviewed: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
path: {
|
|
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>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -1,106 +1,91 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { onMounted } from
|
|
3
|
-
import { useState, navigateTo } from
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const regex =
|
|
12
|
-
/^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
|
|
13
|
-
|
|
14
|
-
// Cookie control config.
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted } from "vue";
|
|
3
|
+
import { useState, navigateTo } from "#app";
|
|
4
|
+
const searchTerm = useState("searchTerm", () => void 0);
|
|
5
|
+
const questions = useState("questions");
|
|
6
|
+
const baseUrl = useState("baseUrl");
|
|
7
|
+
const page = useState("page");
|
|
8
|
+
const path = useState("path");
|
|
9
|
+
const regex = /^https:\/\/digital-core\.cheshireeast\.gov\.uk(?!.*(?:&pagePath|&pageTitle|login)).*$/;
|
|
15
10
|
const config = {
|
|
16
|
-
apiKey:
|
|
17
|
-
product:
|
|
18
|
-
mode:
|
|
19
|
-
consentCookieExpiry:
|
|
11
|
+
apiKey: "c1a902dfad207b122cca32738e623af375e1d2ee",
|
|
12
|
+
product: "PRO_MULTISITE",
|
|
13
|
+
mode: "gdpr",
|
|
14
|
+
consentCookieExpiry: "365",
|
|
20
15
|
statement: {
|
|
21
|
-
description:
|
|
22
|
-
name:
|
|
23
|
-
url:
|
|
24
|
-
updated:
|
|
16
|
+
description: "For more information visit our",
|
|
17
|
+
name: "Cookies page",
|
|
18
|
+
url: "/council_and_democracy/council_information/website_information/website_information.aspx",
|
|
19
|
+
updated: "08/09/2020"
|
|
25
20
|
},
|
|
26
21
|
accessibility: {
|
|
27
|
-
outline: true
|
|
22
|
+
outline: true
|
|
28
23
|
},
|
|
29
24
|
optionalCookies: [
|
|
30
25
|
{
|
|
31
|
-
name:
|
|
32
|
-
label:
|
|
33
|
-
description:
|
|
34
|
-
'We would like to set Google Analytics cookies. This helps us to improve our website by collecting and reporting information on its usage and is done in a way that does not directly identify anyone.',
|
|
26
|
+
name: "analytics",
|
|
27
|
+
label: "Analytics cookies",
|
|
28
|
+
description: "We would like to set Google Analytics cookies. This helps us to improve our website by collecting and reporting information on its usage and is done in a way that does not directly identify anyone.",
|
|
35
29
|
cookies: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
"_ga",
|
|
31
|
+
"_gid",
|
|
32
|
+
"__utma",
|
|
33
|
+
"__utmt",
|
|
34
|
+
"__utmb",
|
|
35
|
+
"__utmc",
|
|
36
|
+
"__utmz",
|
|
37
|
+
"__utm.gif"
|
|
44
38
|
],
|
|
45
|
-
onAccept: function
|
|
46
|
-
// Add Google Analytics via GTM
|
|
47
|
-
// assumes the associated event has been created within GTM
|
|
48
|
-
// and that event in turn loads analytics
|
|
39
|
+
onAccept: function() {
|
|
49
40
|
dataLayer.push({
|
|
50
|
-
event:
|
|
41
|
+
event: "analytics_consent_given"
|
|
51
42
|
});
|
|
52
|
-
// End Google Analytics
|
|
53
43
|
},
|
|
54
|
-
onRevoke: function
|
|
44
|
+
onRevoke: function() {
|
|
45
|
+
}
|
|
55
46
|
},
|
|
56
47
|
{
|
|
57
|
-
name:
|
|
58
|
-
label:
|
|
59
|
-
description:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
!(function (d, s, id) {
|
|
65
|
-
var js,
|
|
66
|
-
fjs = d.getElementsByTagName(s)[0];
|
|
48
|
+
name: "marketing",
|
|
49
|
+
label: "Marketing cookies",
|
|
50
|
+
description: "We would like to embed Facebook feeds. In return they use marketing cookies to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.",
|
|
51
|
+
cookies: ["guest_id", "personalization_id"],
|
|
52
|
+
onAccept: function() {
|
|
53
|
+
!function(d, s, id) {
|
|
54
|
+
var js, fjs2 = d.getElementsByTagName(s)[0];
|
|
67
55
|
if (d.getElementById(id)) return;
|
|
68
56
|
js = d.createElement(s);
|
|
69
57
|
js.id = id;
|
|
70
|
-
js.src =
|
|
71
|
-
|
|
72
|
-
}
|
|
58
|
+
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";
|
|
59
|
+
fjs2.parentNode.insertBefore(js, fjs2);
|
|
60
|
+
}(document, "script", "facebook-jssdk");
|
|
73
61
|
},
|
|
74
|
-
onRevoke: function
|
|
75
|
-
fjs(
|
|
76
|
-
}
|
|
77
|
-
}
|
|
62
|
+
onRevoke: function() {
|
|
63
|
+
fjs("consent", "revoke");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
78
66
|
],
|
|
79
|
-
position:
|
|
80
|
-
theme:
|
|
67
|
+
position: "LEFT",
|
|
68
|
+
theme: "DARK",
|
|
81
69
|
branding: {
|
|
82
|
-
fontColor:
|
|
83
|
-
fontSizeTitle:
|
|
84
|
-
fontSizeIntro:
|
|
85
|
-
fontSizeHeaders:
|
|
86
|
-
fontSize:
|
|
87
|
-
backgroundColor:
|
|
88
|
-
toggleText:
|
|
89
|
-
toggleColor:
|
|
90
|
-
toggleBackground:
|
|
70
|
+
fontColor: "#FFF",
|
|
71
|
+
fontSizeTitle: "1.2em",
|
|
72
|
+
fontSizeIntro: "1em",
|
|
73
|
+
fontSizeHeaders: "1em",
|
|
74
|
+
fontSize: "1em",
|
|
75
|
+
backgroundColor: "#206c49",
|
|
76
|
+
toggleText: "#fff",
|
|
77
|
+
toggleColor: "#68907e",
|
|
78
|
+
toggleBackground: "#144a31",
|
|
91
79
|
buttonIcon: null,
|
|
92
|
-
buttonIconWidth:
|
|
93
|
-
buttonIconHeight:
|
|
80
|
+
buttonIconWidth: "64px",
|
|
81
|
+
buttonIconHeight: "64px",
|
|
94
82
|
removeIcon: false,
|
|
95
|
-
removeAbout: true
|
|
96
|
-
}
|
|
83
|
+
removeAbout: true
|
|
84
|
+
}
|
|
97
85
|
};
|
|
98
|
-
|
|
99
|
-
// Placeholder because we need to wait for browsealoud
|
|
100
86
|
let updateToggleText = () => {
|
|
101
|
-
console.log(
|
|
87
|
+
console.log("toggle");
|
|
102
88
|
};
|
|
103
|
-
|
|
104
89
|
const doSearch = async () => {
|
|
105
90
|
if (searchTerm.value) {
|
|
106
91
|
await navigateTo(
|
|
@@ -109,66 +94,55 @@ const doSearch = async () => {
|
|
|
109
94
|
);
|
|
110
95
|
}
|
|
111
96
|
};
|
|
112
|
-
|
|
113
|
-
// Set some things up once page has mounted.
|
|
114
97
|
onMounted(() => {
|
|
115
98
|
updateToggleText = () => {
|
|
116
|
-
const x = document.getElementById(
|
|
117
|
-
if (x.innerText ===
|
|
118
|
-
x.innerText =
|
|
99
|
+
const x = document.getElementById("baToggleText");
|
|
100
|
+
if (x.innerText === "Listen and translate") {
|
|
101
|
+
x.innerText = "Close listen and translate";
|
|
119
102
|
} else {
|
|
120
|
-
x.innerText =
|
|
103
|
+
x.innerText = "Listen and translate";
|
|
121
104
|
}
|
|
122
105
|
BrowseAloud.panel.toggleBar();
|
|
123
106
|
};
|
|
124
107
|
try {
|
|
125
108
|
CookieControl.load(config);
|
|
126
109
|
} catch (ignore) {
|
|
127
|
-
console.log(
|
|
110
|
+
console.log("No cookie control");
|
|
128
111
|
}
|
|
129
112
|
try {
|
|
130
113
|
BrowseAloud.disableBrowsealoudAnalytics();
|
|
131
114
|
} catch (ignore) {
|
|
132
|
-
console.log(
|
|
115
|
+
console.log("No reachdeck.");
|
|
133
116
|
}
|
|
134
|
-
|
|
135
|
-
// Make accordions spring open if there is a hash (looks for an H3)
|
|
136
|
-
let accordions = document.getElementsByClassName('access-acc-container');
|
|
117
|
+
let accordions = document.getElementsByClassName("access-acc-container");
|
|
137
118
|
if (accordions.length) {
|
|
138
119
|
let hash = window.location.hash;
|
|
139
120
|
let found = false;
|
|
140
121
|
if (hash) {
|
|
141
|
-
hash = hash.toLowerCase().replace(/^#/,
|
|
142
|
-
let l = Array.from(document.getElementsByTagName(
|
|
143
|
-
e.innerText.toLowerCase().startsWith(hash)
|
|
122
|
+
hash = hash.toLowerCase().replace(/^#/, "").replace(/_/g, " ");
|
|
123
|
+
let l = Array.from(document.getElementsByTagName("LABEL")).filter(
|
|
124
|
+
(e) => e.innerText.toLowerCase().startsWith(hash)
|
|
144
125
|
);
|
|
145
126
|
let accs = l.filter(
|
|
146
|
-
(e) =>
|
|
147
|
-
e.parentNode.tagName === 'SECTION' ||
|
|
148
|
-
e.parentNode.tagName === 'TEMPLATE'
|
|
127
|
+
(e) => e.parentNode.tagName === "SECTION" || e.parentNode.tagName === "TEMPLATE"
|
|
149
128
|
);
|
|
150
129
|
if (accs.length) {
|
|
151
130
|
let el = accs[0].previousElementSibling;
|
|
152
|
-
if (el.tagName ===
|
|
131
|
+
if (el.tagName === "INPUT") {
|
|
153
132
|
el.checked = true;
|
|
154
133
|
el.scrollIntoView();
|
|
155
134
|
found = true;
|
|
156
135
|
}
|
|
157
136
|
}
|
|
158
137
|
if (!found) {
|
|
159
|
-
let h3s = Array.from(document.getElementsByTagName(
|
|
160
|
-
e.innerHTML.toLowerCase().includes(hash)
|
|
138
|
+
let h3s = Array.from(document.getElementsByTagName("H3")).filter(
|
|
139
|
+
(e) => e.innerHTML.toLowerCase().includes(hash)
|
|
161
140
|
);
|
|
162
141
|
if (h3s.length) {
|
|
163
142
|
let parent = h3s[0].parentNode;
|
|
164
|
-
if (parent.tagName ===
|
|
143
|
+
if (parent.tagName === "ARTICLE") {
|
|
165
144
|
let el = parent.previousElementSibling;
|
|
166
|
-
let input =
|
|
167
|
-
el.tagName === 'LABEL'
|
|
168
|
-
? el.control
|
|
169
|
-
: el.tagName === 'INPUT'
|
|
170
|
-
? el
|
|
171
|
-
: undefined;
|
|
145
|
+
let input = el.tagName === "LABEL" ? el.control : el.tagName === "INPUT" ? el : void 0;
|
|
172
146
|
if (input) {
|
|
173
147
|
input.checked = true;
|
|
174
148
|
el.scrollIntoView();
|
|
@@ -178,10 +152,8 @@ onMounted(() => {
|
|
|
178
152
|
}
|
|
179
153
|
}
|
|
180
154
|
}
|
|
181
|
-
|
|
182
|
-
// Canvas stuff
|
|
183
155
|
const getQuInfo = (b) => {
|
|
184
|
-
let temp = b.id.split(
|
|
156
|
+
let temp = b.id.split("_");
|
|
185
157
|
let id = temp[3];
|
|
186
158
|
let q = questions.value.find((e) => e.id === id);
|
|
187
159
|
if (q) {
|
|
@@ -196,7 +168,6 @@ onMounted(() => {
|
|
|
196
168
|
}
|
|
197
169
|
}
|
|
198
170
|
};
|
|
199
|
-
|
|
200
171
|
const setSelectBehaviour = (e) => {
|
|
201
172
|
let { q, id, divId } = getQuInfo(e);
|
|
202
173
|
let value = document.getElementById(id).value;
|
|
@@ -211,7 +182,6 @@ onMounted(() => {
|
|
|
211
182
|
goto(divId, target);
|
|
212
183
|
}
|
|
213
184
|
};
|
|
214
|
-
|
|
215
185
|
const setOnClick = (b) => {
|
|
216
186
|
let { content, target, id } = getQuInfo(b);
|
|
217
187
|
if (content) {
|
|
@@ -220,65 +190,55 @@ onMounted(() => {
|
|
|
220
190
|
b.onclick = () => goto(id, target);
|
|
221
191
|
}
|
|
222
192
|
};
|
|
223
|
-
|
|
224
|
-
// Expand all buttons
|
|
225
193
|
const expandAll = (btn) => {
|
|
226
|
-
btn.addEventListener(
|
|
194
|
+
btn.addEventListener("click", (e) => {
|
|
227
195
|
const op = btn.innerText;
|
|
228
|
-
btn.innerText = op ===
|
|
196
|
+
btn.innerText = op === "Expand all" ? "Close all" : "Expand all";
|
|
229
197
|
Array.from(document.getElementsByClassName(btn.id)).forEach(
|
|
230
|
-
(
|
|
198
|
+
(e2) => e2.checked = op === "Expand all"
|
|
231
199
|
);
|
|
232
200
|
});
|
|
233
201
|
};
|
|
234
|
-
Array.from(document.getElementsByClassName(
|
|
202
|
+
Array.from(document.getElementsByClassName("expand-all")).forEach((b) => {
|
|
235
203
|
expandAll(b);
|
|
236
204
|
});
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
let forms = Array.from(document.querySelectorAll('a')).filter(
|
|
240
|
-
(a) =>
|
|
241
|
-
regex.test(a.href) &&
|
|
242
|
-
a.href !== 'https://digital-core.cheshireeast.gov.uk/w/webpage/register'
|
|
205
|
+
let forms = Array.from(document.querySelectorAll("a")).filter(
|
|
206
|
+
(a) => regex.test(a.href) && a.href !== "https://digital-core.cheshireeast.gov.uk/w/webpage/register"
|
|
243
207
|
);
|
|
244
|
-
|
|
245
208
|
forms.forEach((link) => {
|
|
246
209
|
link.href = `${link.href}&pageTitle=${encodeURIComponent(
|
|
247
210
|
page.value.title
|
|
248
211
|
)}&pagePath=${baseUrl.value}${encodeURIComponent(path.value)}`;
|
|
249
212
|
});
|
|
250
|
-
|
|
251
213
|
const setUpListeners = () => {
|
|
252
214
|
let qSelects = Array.from(
|
|
253
|
-
document.getElementsByClassName(
|
|
215
|
+
document.getElementsByClassName("question-select")
|
|
254
216
|
);
|
|
255
217
|
qSelects.forEach((s) => {
|
|
256
|
-
s.onchange = function
|
|
218
|
+
s.onchange = function(e) {
|
|
257
219
|
setSelectBehaviour(e.target);
|
|
258
220
|
};
|
|
259
221
|
});
|
|
260
|
-
let qBtns = Array.from(document.getElementsByClassName(
|
|
222
|
+
let qBtns = Array.from(document.getElementsByClassName("question-btns"));
|
|
261
223
|
qBtns.forEach((b) => {
|
|
262
224
|
setOnClick(b);
|
|
263
225
|
});
|
|
264
226
|
};
|
|
265
|
-
|
|
266
227
|
const makeBreadcrumb = (id, qTop) => {
|
|
267
|
-
let
|
|
228
|
+
let display2 = document.getElementById(id + "_display");
|
|
268
229
|
let breadcrumb = document.getElementById(`${id}_breadcrumb`);
|
|
269
|
-
breadcrumb.innerHTML =
|
|
230
|
+
breadcrumb.innerHTML = "";
|
|
270
231
|
qTop.stack.forEach((el, i) => {
|
|
271
|
-
let li = document.createElement(
|
|
272
|
-
li.classList.add(
|
|
232
|
+
let li = document.createElement("LI");
|
|
233
|
+
li.classList.add("breadcrumb-item");
|
|
273
234
|
li.innerHTML = qTop.question[el].question;
|
|
274
|
-
if (i !== qTop.stack.length - 1 ||
|
|
275
|
-
li.classList.add(
|
|
235
|
+
if (i !== qTop.stack.length - 1 || display2.innerText.length) {
|
|
236
|
+
li.classList.add("fakeLink");
|
|
276
237
|
li.onclick = () => goto(id, el, false);
|
|
277
238
|
}
|
|
278
239
|
breadcrumb.appendChild(li);
|
|
279
240
|
});
|
|
280
241
|
};
|
|
281
|
-
|
|
282
242
|
const goto = (id, index, addToStack = true) => {
|
|
283
243
|
let qTop = questions.value.find((e) => e.id === id);
|
|
284
244
|
if (!index) {
|
|
@@ -288,27 +248,24 @@ onMounted(() => {
|
|
|
288
248
|
qTop.stack.push(index);
|
|
289
249
|
}
|
|
290
250
|
let q = qTop.question[index];
|
|
291
|
-
document.getElementById(id +
|
|
292
|
-
document.getElementById(id +
|
|
251
|
+
document.getElementById(id + "_display").innerHTML = "";
|
|
252
|
+
document.getElementById(id + "_buttons").innerHTML = q.buttons || q.select;
|
|
293
253
|
makeBreadcrumb(id, qTop);
|
|
294
254
|
setUpListeners();
|
|
295
255
|
};
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
document.getElementById(id +
|
|
299
|
-
document.getElementById(id + '_buttons').innerHTML = '';
|
|
256
|
+
const display = (id, display2) => {
|
|
257
|
+
document.getElementById(id + "_display").innerHTML = display2;
|
|
258
|
+
document.getElementById(id + "_buttons").innerHTML = "";
|
|
300
259
|
makeBreadcrumb(
|
|
301
260
|
id,
|
|
302
261
|
questions.value.find((e) => e.id === id)
|
|
303
262
|
);
|
|
304
263
|
};
|
|
305
|
-
|
|
306
264
|
const prev = (id) => {
|
|
307
265
|
let qTop = questions.value.find((e) => e.id === id);
|
|
308
266
|
let ind = qTop.stack.pop();
|
|
309
267
|
goto(id, ind, !qTop.stack.length);
|
|
310
268
|
};
|
|
311
|
-
|
|
312
269
|
const reset = (id) => {
|
|
313
270
|
let qTop = questions.value.find((e) => e.id === id);
|
|
314
271
|
if (qTop.stack.length) {
|
|
@@ -316,18 +273,16 @@ onMounted(() => {
|
|
|
316
273
|
goto(id, 0);
|
|
317
274
|
}
|
|
318
275
|
};
|
|
319
|
-
|
|
320
|
-
let resetBtns = Array.from(document.getElementsByClassName('reset'));
|
|
276
|
+
let resetBtns = Array.from(document.getElementsByClassName("reset"));
|
|
321
277
|
resetBtns.forEach((rb) => {
|
|
322
|
-
let id = rb.id.split(
|
|
278
|
+
let id = rb.id.split("_")[0];
|
|
323
279
|
if (!rb.onclick) {
|
|
324
280
|
rb.onclick = () => reset(id);
|
|
325
281
|
}
|
|
326
282
|
});
|
|
327
|
-
|
|
328
|
-
let prevBtns = Array.from(document.getElementsByClassName('previous'));
|
|
283
|
+
let prevBtns = Array.from(document.getElementsByClassName("previous"));
|
|
329
284
|
prevBtns.forEach((pb) => {
|
|
330
|
-
let id = pb.id.split(
|
|
285
|
+
let id = pb.id.split("_")[0];
|
|
331
286
|
if (!pb.onclick) {
|
|
332
287
|
pb.onclick = () => prev(id);
|
|
333
288
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|