cec-nuxt-lib 0.4.7 → 0.4.9
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
CHANGED
|
@@ -39,6 +39,11 @@ const abbr = (data) => {
|
|
|
39
39
|
return `<abbr title="${text(data.entryDescription)}">${text(data.entryTitle)}</abbr>`;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
const accWithAssets = (props: any) => {
|
|
43
|
+
let data = { ...props.block.value, id: props.block.id };
|
|
44
|
+
return accordion(data);
|
|
45
|
+
};
|
|
46
|
+
|
|
42
47
|
const accordion = (data) => {
|
|
43
48
|
if (!data.id) {
|
|
44
49
|
data.id = data.sys.id;
|
|
@@ -65,6 +70,22 @@ const accordion = (data) => {
|
|
|
65
70
|
`;
|
|
66
71
|
data.accordionSection.forEach((e, i) => {
|
|
67
72
|
let accId = `${data.id}_${i}`;
|
|
73
|
+
if (e.pdfs?.length) {
|
|
74
|
+
let pdfs = e.pdfs.reduce((acc, p) => {
|
|
75
|
+
return (
|
|
76
|
+
acc +
|
|
77
|
+
`
|
|
78
|
+
<li>
|
|
79
|
+
<a href="${baseUrl}${processUri(p.sys.uri)}"
|
|
80
|
+
>${p.title[0].toUpperCase()}${p.title.slice(1)}
|
|
81
|
+
(${p.sys.contentTypeId.toUpperCase()},
|
|
82
|
+
${sizeString(p.sys.properties.fileSize)})
|
|
83
|
+
</a>
|
|
84
|
+
</li>`
|
|
85
|
+
);
|
|
86
|
+
}, '<ul>');
|
|
87
|
+
e.content = `${e.content ? e.content : ''}${pdfs}</ul>`;
|
|
88
|
+
}
|
|
68
89
|
let article = `${e.content ? e.content : ''}${e.genericList ? genList(e.genericList, accId) : ''}`;
|
|
69
90
|
if (!article.length) {
|
|
70
91
|
article = '<p>Nothing to display at present</p>';
|
|
@@ -675,6 +696,7 @@ const renderer = createRenderer({
|
|
|
675
696
|
accordionComponent: accordionComponent,
|
|
676
697
|
cecButton: cecButton,
|
|
677
698
|
centralColumn: centralColumn,
|
|
699
|
+
dragonsLaneAccordion: accWithAssets,
|
|
678
700
|
fullWidthImageWithOverlay: fullWidthImageWithOverlay,
|
|
679
701
|
fullWidthImageWithSideOverlay: fullWidthImageWithSideOverlay,
|
|
680
702
|
centralPromotionalSection: centralPromotionalSection,
|
package/package.json
CHANGED