@qld-gov-au/qgds-bootstrap5 1.0.19 → 1.0.21
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/.esbuild/plugins/qgds-plugin-copy-assets.js +4 -3
- package/.esbuild/plugins/qgds-plugin-handlebar-partial-builder.js +91 -0
- package/.esbuild/plugins/qgds-plugin-version.js +3 -2
- package/.storybook/preview.js +1 -1
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +2 -2
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
- package/dist/assets/js/handlebars.helpers.js +57 -11
- package/dist/assets/js/handlebars.init.min.js +2637 -0
- package/dist/assets/js/handlebars.init.min.js.map +7 -0
- package/dist/assets/js/qld.bootstrap.min.js +3 -3
- package/dist/assets/js/qld.bootstrap.min.js.map +2 -2
- package/dist/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.hbs +11 -0
- package/dist/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.test.hbs +7 -0
- package/dist/components/bs5/contentFooter/contentFooter.hbs +4 -0
- package/dist/components/bs5/contentFooterWrapper/contentFooterWrapper.hbs +5 -0
- package/dist/components/bs5/contentFooterWrapper/contentFooterWrapper.test.hbs +13 -0
- package/dist/components/bs5/contentWrapper/contentWrapper.hbs +5 -0
- package/dist/components/bs5/contentWrapper/contentWrapper.test.hbs +12 -0
- package/dist/components/bs5/footer/footer.hbs +88 -24
- package/dist/components/bs5/fullPageWrapper/fullPage.hbs +16 -0
- package/dist/components/bs5/fullPageWrapper/fullPage.test.hbs +4 -0
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/mainContainerWrapper/mainContainerWrapper.hbs +28 -0
- package/dist/components/bs5/mainContainerWrapper/mainContainerWrapper.test.hbs +6 -0
- package/dist/components/bs5/metaDcTerms/metaDcTerms.hbs +17 -0
- package/dist/components/bs5/metaOpenGraph/metaOpenGraph.hbs +18 -0
- package/dist/components/bs5/searchInput/searchInput.hbs +2 -2
- package/dist/components/bs5/sidenavWrapper/sidenavWrapper.hbs +4 -0
- package/dist/components/bs5/sidenavWrapper/sidenavWrapper.test.hbs +15 -0
- package/dist/components/bs5/video/video.hbs +3 -1
- package/dist/components/handlebars.helpers.js +57 -11
- package/dist/components/handlebars.init.js +31 -3
- package/dist/components/handlebars.init.min.js +2637 -0
- package/dist/components/handlebars.init.min.js.map +7 -0
- package/dist/components/handlebars.partials.js +96 -0
- package/dist/sample-data/contentFooter/contentFooter.data.json +3 -0
- package/dist/sample-data/contentWrapper/contentWrapper.data.json +3 -0
- package/dist/sample-data/footer/footer-usingDefaults.data.json +3 -0
- package/dist/sample-data/footer/footer.data.json +31 -74
- package/dist/sample-data/metaDcTerms/MetaDcTerms.data.json +12 -0
- package/dist/sample-data/metaOpenGraph/MetaOpenGraph.data.json +14 -0
- package/esbuild.js +9 -3
- package/package.json +17 -16
- package/src/components/bs5/blockquote/blockquote.scss +31 -28
- package/src/components/bs5/breadcrumbs/breadcrumb.functions.js +1 -1
- package/src/components/bs5/breadcrumbs/breadcrumbs.scss +101 -83
- package/src/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.hbs +11 -0
- package/src/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.stories.js +37 -0
- package/src/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.test.hbs +7 -0
- package/src/components/bs5/breadcumbsWrapper/breadcrumbsWrapper.test.js +13 -0
- package/src/components/bs5/breadcumbsWrapper/manifest.json +0 -0
- package/src/components/bs5/contentFooter/contentFooter.data.json +3 -0
- package/src/components/bs5/contentFooter/contentFooter.hbs +4 -0
- package/src/components/bs5/contentFooter/contentFooter.js +10 -0
- package/src/components/bs5/contentFooter/contentFooter.stories.js +59 -0
- package/src/components/bs5/contentFooter/manifest.json +0 -0
- package/src/components/bs5/contentFooterWrapper/contentFooterWrapper.hbs +5 -0
- package/src/components/bs5/contentFooterWrapper/contentFooterWrapper.stories.js +39 -0
- package/src/components/bs5/contentFooterWrapper/contentFooterWrapper.test.hbs +13 -0
- package/src/components/bs5/contentFooterWrapper/contentFooterWrapper.test.js +13 -0
- package/src/components/bs5/contentFooterWrapper/manifest.json +0 -0
- package/src/components/bs5/contentWrapper/ContentWrapper.test.js +13 -0
- package/src/components/bs5/contentWrapper/contentWrapper.data.json +3 -0
- package/src/components/bs5/contentWrapper/contentWrapper.hbs +5 -0
- package/src/components/bs5/contentWrapper/contentWrapper.stories.js +68 -0
- package/src/components/bs5/contentWrapper/contentWrapper.test.hbs +12 -0
- package/src/components/bs5/contentWrapper/manifest.json +0 -0
- package/src/components/bs5/footer/_colours.scss +3 -2
- package/src/components/bs5/footer/_measurements.scss +3 -1
- package/src/components/bs5/footer/footer-usingDefaults.data.json +3 -0
- package/src/components/bs5/footer/footer.data.json +31 -74
- package/src/components/bs5/footer/footer.hbs +88 -24
- package/src/components/bs5/footer/footer.scss +139 -81
- package/src/components/bs5/footer/footer.stories.js +104 -3
- package/src/components/bs5/fullPageWrapper/fullPage.hbs +16 -0
- package/src/components/bs5/fullPageWrapper/fullPage.stories.js +65 -0
- package/src/components/bs5/fullPageWrapper/fullPage.test.hbs +4 -0
- package/src/components/bs5/fullPageWrapper/fullPage.test.js +13 -0
- package/src/components/bs5/fullPageWrapper/manifest.json +0 -0
- package/src/components/bs5/globalAlert/globalAlert.scss +92 -24
- package/src/components/bs5/head/head.stories.js +6 -6
- package/src/components/bs5/mainContainerWrapper/mainContainerWrapper.hbs +28 -0
- package/src/components/bs5/mainContainerWrapper/mainContainerWrapper.stories.js +51 -0
- package/src/components/bs5/mainContainerWrapper/mainContainerWrapper.test.hbs +6 -0
- package/src/components/bs5/mainContainerWrapper/mainContainerWrapper.test.js +13 -0
- package/src/components/bs5/mainContainerWrapper/manifest.json +0 -0
- package/src/components/bs5/metaDcTerms/MetaDcTerms.data.json +12 -0
- package/src/components/bs5/metaDcTerms/MetaDcTerms.js +10 -0
- package/src/components/bs5/metaDcTerms/manifest.json +0 -0
- package/src/components/bs5/metaDcTerms/metaDcTerms.hbs +17 -0
- package/src/components/bs5/metaDcTerms/metaDcTerms.stories.js +38 -0
- package/src/components/bs5/metaOpenGraph/MetaOpenGraph.data.json +14 -0
- package/src/components/bs5/metaOpenGraph/MetaOpenGraph.js +10 -0
- package/src/components/bs5/metaOpenGraph/manifest.json +0 -0
- package/src/components/bs5/metaOpenGraph/metaOpenGraph.hbs +18 -0
- package/src/components/bs5/metaOpenGraph/metaOpenGraph.stories.js +38 -0
- package/src/components/bs5/navbar/navbar.scss +2 -2
- package/src/components/bs5/searchInput/search.functions.js +6 -6
- package/src/components/bs5/searchInput/searchInput.hbs +2 -2
- package/src/components/bs5/searchInput/searchInput.scss +17 -7
- package/src/components/bs5/sidenavWrapper/SidenavWrapper.mdx +11 -0
- package/src/components/bs5/sidenavWrapper/SidenavWrapper.test.js +13 -0
- package/src/components/bs5/sidenavWrapper/manifest.json +0 -0
- package/src/components/bs5/sidenavWrapper/sidenavWrapper.hbs +4 -0
- package/src/components/bs5/sidenavWrapper/sidenavWrapper.stories.js +68 -0
- package/src/components/bs5/sidenavWrapper/sidenavWrapper.test.hbs +15 -0
- package/src/components/bs5/tag/tag.scss +1 -1
- package/src/components/bs5/textbox/textInput.scss +2 -2
- package/src/components/bs5/typography/typography.stories.js +9 -0
- package/src/components/bs5/video/video.hbs +3 -1
- package/src/components/common/layout/content.scss +3 -0
- package/src/js/handlebars.helpers.js +57 -11
- package/src/js/handlebars.init.js +31 -3
- package/src/js/handlebars.partials.js +96 -0
- package/src/main.js +1 -1
- package/src/scss/qld-print.scss +22 -4
- package/src/scss/qld-type.scss +32 -3
- package/src/scss/qld-variables.scss +1 -1
- package/src/stories/integration/MainIntegration.js +29 -0
- package/src/stories/integration/MainIntegration.mdx +10 -0
- package/src/stories/integration/breadcrumb.data.json +28 -0
- package/src/stories/integration/content.data.json +3 -0
- package/src/stories/integration/contentFooter.data.json +3 -0
- package/src/stories/integration/footer.data.json +154 -0
- package/src/stories/integration/globalAlert.data.json +9 -0
- package/src/stories/integration/header.data.json +173 -0
- package/src/stories/integration/inpagenav.data.json +26 -0
- package/src/stories/integration/integration.stories.js +145 -0
- package/src/stories/integration/main.hbs +13 -0
- package/src/stories/integration/navigation.data.json +22 -0
- package/src/stories/integration/search.data.json +20 -0
- package/src/stories/integration/sidenav.data.json +88 -0
- package/dist/assets/js/handlebars.init.js +0 -6
- package/dist/components/handlebars.init.bundle.js +0 -23
- package/dist/components/handlebars.init.bundle.js.map +0 -7
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from "@storybook/blocks"
|
|
2
|
+
import * as SidenavWrapperStories from "./sidenavWrapper.stories"
|
|
3
|
+
|
|
4
|
+
<Meta of={SidenavWrapperStories} />
|
|
5
|
+
|
|
6
|
+
# Side Wrapper navigation
|
|
7
|
+
This is a partial-block to embed more content inside another partial https://handlebarsjs.com/guide/partials.html#partial-blocks
|
|
8
|
+
<Canvas>
|
|
9
|
+
<Story of={SidenavWrapperStories.Default} />
|
|
10
|
+
</Canvas>
|
|
11
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Component from '../../../js/QGDSComponent.js'
|
|
2
|
+
import template from "./sidenavWrapper.test.hbs?raw";
|
|
3
|
+
|
|
4
|
+
export class SidenavWrapperTest {
|
|
5
|
+
|
|
6
|
+
// Use the global Component class to create a new instance of the Sidenav component.
|
|
7
|
+
// A data object, containing the Handlebars placeholder replacement strings, should be provided as an argument.
|
|
8
|
+
|
|
9
|
+
constructor( data = {} ) {
|
|
10
|
+
return new Component(template, data);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// ComponentExample.stories.js
|
|
2
|
+
import { SidenavWrapperTest } from "./SidenavWrapper.test.js";
|
|
3
|
+
import defaultdata from "./../sidenav/sidenav.data.json";
|
|
4
|
+
import init from "./../../../js/handlebars.init";
|
|
5
|
+
import Handlebars from "handlebars";
|
|
6
|
+
export default {
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
title: "!Layout/Components/Side Navigation Wrapper",
|
|
9
|
+
render: (args) => {
|
|
10
|
+
init(Handlebars);
|
|
11
|
+
return new SidenavWrapperTest(args).html;
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
argTypes: {
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
controls: {
|
|
20
|
+
exclude: ["navlist", "navtitlelink"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Default side navigation
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export const Default = {
|
|
31
|
+
args: defaultdata,
|
|
32
|
+
decorators: [
|
|
33
|
+
(Story) => {
|
|
34
|
+
return `
|
|
35
|
+
<div class="container-fluid">
|
|
36
|
+
<div class="row">
|
|
37
|
+
|
|
38
|
+
${Story()}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Dark side navigation
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export const Dark = {
|
|
52
|
+
args: defaultdata,
|
|
53
|
+
decorators: [
|
|
54
|
+
(Story) => {
|
|
55
|
+
return `
|
|
56
|
+
<div class="container-fluid">
|
|
57
|
+
<div class="row">
|
|
58
|
+
<div class="col-lg-4 col-md-5">
|
|
59
|
+
<div class="dark">
|
|
60
|
+
${Story()}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
`;
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Side Nav test -->
|
|
2
|
+
<div class="container-fluid">
|
|
3
|
+
<div class="row">
|
|
4
|
+
<p>pre sidenaveWrapper prefix</p>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="row">
|
|
7
|
+
{{#>sidenavWrapper}}
|
|
8
|
+
{{> sidenav }}
|
|
9
|
+
<p>inner sidenavWrapper data</p>
|
|
10
|
+
{{/sidenavWrapper}}
|
|
11
|
+
<div class="col-12 col-lg-8 ps-lg-64 qld-content-body" id="content">
|
|
12
|
+
<p>post sidenaveWrapper suffix</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
@@ -96,7 +96,7 @@ $close-icon-hover: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
|
|
|
96
96
|
.tag-item {
|
|
97
97
|
display: inline-block;
|
|
98
98
|
color: var(--#{$prefix}dark-grey-muted);
|
|
99
|
-
margin: 0
|
|
99
|
+
margin-top: 0.5rem;
|
|
100
100
|
padding: 0 0.5rem;
|
|
101
101
|
list-style-type: none;
|
|
102
102
|
border: 1px solid var(--#{$prefix}light-grey);
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.qld-text-input-label {
|
|
43
|
-
color: var(--#{$prefix}
|
|
43
|
+
color: var(--#{$prefix}text-grey);
|
|
44
44
|
display: block;
|
|
45
45
|
font-weight: 600;
|
|
46
46
|
line-height: 1.5;
|
|
@@ -161,7 +161,7 @@ select.qld-select.qld-input-success:not(:focus) {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
.qld-select {
|
|
164
|
-
padding:
|
|
164
|
+
padding: 12px 18px;
|
|
165
165
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='%23008635' d='M4.251 181.1C7.392 177.7 11.69 175.1 16 175.1c3.891 0 7.781 1.406 10.86 4.25l197.1 181.1l197.1-181.1c6.5-6 16.64-5.625 22.61 .9062c6 6.5 5.594 16.59-.8906 22.59l-208 192c-6.156 5.688-15.56 5.688-21.72 0l-208-192C-1.343 197.7-1.749 187.6 4.251 181.1z'/%3E%3C/svg%3E");
|
|
166
166
|
background-repeat: no-repeat;
|
|
167
167
|
appearance: none;
|
|
@@ -32,6 +32,15 @@ export default {
|
|
|
32
32
|
<li>List item</li>
|
|
33
33
|
</ol>
|
|
34
34
|
</div>
|
|
35
|
+
|
|
36
|
+
<dl>
|
|
37
|
+
<dt>Website:</dt>
|
|
38
|
+
<dd><a href="https://www.qld.gov.au" target="_blank">https://www.qld.gov.au</a></dd>
|
|
39
|
+
<dt>Street address:</dt>
|
|
40
|
+
<dd>123 Street Street</dd>
|
|
41
|
+
<dd>Suburb QLD 4000</dd>
|
|
42
|
+
</dl>
|
|
43
|
+
|
|
35
44
|
`;
|
|
36
45
|
},
|
|
37
46
|
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
/* global Handlebars */
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Registers Handlebars Helpers
|
|
5
|
-
* @param {
|
|
4
|
+
* @param {Handlebars} handlebars Templating engine
|
|
6
5
|
* @returns {void} Result of the helper operation
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
export default function handlebarsHelpers(
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
needle =
|
|
13
|
-
haystack =
|
|
8
|
+
export default function handlebarsHelpers(handlebars) {
|
|
9
|
+
// contains - if first object is in collection (second object) to return true
|
|
10
|
+
handlebars.registerHelper("contains", function (needle, haystack, options) {
|
|
11
|
+
needle = handlebars.escapeExpression(needle);
|
|
12
|
+
haystack = handlebars.escapeExpression(haystack);
|
|
14
13
|
return haystack.indexOf(needle) > -1
|
|
15
14
|
? options.fn(this)
|
|
16
15
|
: options.inverse(this);
|
|
17
16
|
});
|
|
18
|
-
// ifCond - checks conditions
|
|
19
|
-
|
|
17
|
+
// ifCond - checks conditions
|
|
18
|
+
handlebars.registerHelper("ifCond", function (v1, operator, v2, options) {
|
|
20
19
|
switch (operator) {
|
|
21
20
|
case "==":
|
|
22
21
|
return v1 == v2 ? options.fn(this) : options.inverse(this);
|
|
@@ -48,14 +47,61 @@ export default function handlebarsHelpers(Handlebars) {
|
|
|
48
47
|
return options.inverse(this);
|
|
49
48
|
}
|
|
50
49
|
});
|
|
51
|
-
// Checks is expected type
|
|
52
|
-
|
|
50
|
+
// isType - Checks is expected type
|
|
51
|
+
handlebars.registerHelper('isType', function (value, expected, options) {
|
|
53
52
|
if (value === expected) {
|
|
54
53
|
return options.fn(this); // Render the block if condition is true
|
|
55
54
|
} else {
|
|
56
55
|
return options.inverse(this); // Render the else block if present
|
|
57
56
|
}
|
|
58
57
|
});
|
|
58
|
+
// ifAny - {{{#ifAny variable1 variable2 variable3 variable4 etc}}, if any set then return true
|
|
59
|
+
handlebars.registerHelper('ifAny', function (...args) {
|
|
60
|
+
const options = args.pop(); // The last argument is the options object
|
|
61
|
+
return args.some(arg => !!arg) ? options.fn(this) : options.inverse(this);
|
|
62
|
+
});
|
|
63
|
+
// now - return current timestamp i.e {{now}}
|
|
64
|
+
handlebars.registerHelper('now', function() {
|
|
65
|
+
return new Date().toISOString();
|
|
66
|
+
});
|
|
67
|
+
// formatDate - Format Date, for footer meta data i.e {{formatDate '2023-06-23'}}
|
|
68
|
+
handlebars.registerHelper('formatDate', function(dateString, defaultDate, format) {
|
|
69
|
+
// Use the dateString if provided, otherwise use the defaultDate, otherwise error
|
|
70
|
+
let date;
|
|
71
|
+
if (dateString) {
|
|
72
|
+
date = new Date(dateString);
|
|
73
|
+
}
|
|
74
|
+
if (isNaN(date) && defaultDate) {
|
|
75
|
+
date = new Date(defaultDate);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Check if the date is valid
|
|
79
|
+
if (isNaN(date)) {
|
|
80
|
+
return 'Invalid Date';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
84
|
+
var day = date.getDate();
|
|
85
|
+
var month = monthNames[date.getMonth()];
|
|
86
|
+
var year = date.getFullYear();
|
|
87
|
+
// Format date based on the format string
|
|
88
|
+
switch (format) {
|
|
89
|
+
case 'YYYY':
|
|
90
|
+
return `${year}`;
|
|
91
|
+
case 'MMMM YYYY':
|
|
92
|
+
return `${month} ${year}`;
|
|
93
|
+
default:
|
|
94
|
+
return `${day} ${month} ${year}`;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// formatDateOrToday - Format Date if passed or today i.e. {{formatDateOrToday '2023-06-23'}} or {{formatDateOrToday}} <!-- This will use the current date -->
|
|
99
|
+
handlebars.registerHelper('formatDateOrToday', function(dateString, format) {
|
|
100
|
+
// Use the current date if dateString is missing or invalid
|
|
101
|
+
const dateToFormat = dateString || new Date().toISOString();
|
|
102
|
+
// Call the formatDate helper with the determined date and format
|
|
103
|
+
return handlebars.helpers.formatDate(dateString, dateToFormat, format);
|
|
104
|
+
});
|
|
59
105
|
}
|
|
60
106
|
|
|
61
107
|
if(typeof(Handlebars) !== 'undefined') {
|
|
@@ -1,6 +1,34 @@
|
|
|
1
|
+
/* global Handlebars */
|
|
1
2
|
import handlebarsHelpers from "./handlebars.helpers.js";
|
|
2
|
-
import
|
|
3
|
-
export * from "./handlebars.helpers.js";
|
|
3
|
+
import handlebarsPartials from "./handlebars.partials.js";
|
|
4
4
|
|
|
5
|
-
export const init = () => handlebarsHelpers(Handlebars);
|
|
6
5
|
|
|
6
|
+
let isHandlebarsHelpersAndPartialsRegistered = false;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* init function to load all HandleBar partials and helpers into passed in handlebars
|
|
10
|
+
* by default the helpers and partials will autoload if handleBars is found in environment
|
|
11
|
+
*
|
|
12
|
+
* @param {Handlebars} handlebars
|
|
13
|
+
*/
|
|
14
|
+
export default function init(handlebars) {
|
|
15
|
+
if (typeof(handlebars) === 'undefined') {
|
|
16
|
+
console.error("Handlebars.init requires HandleBars");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if(typeof(handlebars) !== 'undefined') {
|
|
20
|
+
if (!isHandlebarsHelpersAndPartialsRegistered) {
|
|
21
|
+
isHandlebarsHelpersAndPartialsRegistered = true;
|
|
22
|
+
} else {
|
|
23
|
+
console.log("HandleBars Helpers And Partials already loaded, loading again")
|
|
24
|
+
}
|
|
25
|
+
handlebarsHelpers(handlebars);
|
|
26
|
+
|
|
27
|
+
handlebarsPartials(handlebars);
|
|
28
|
+
} else {
|
|
29
|
+
console.log("Handlebars not found, init failed");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if(typeof(Handlebars) !== 'undefined') {
|
|
33
|
+
init(Handlebars);
|
|
34
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* global Handlebars */
|
|
2
|
+
/** THIS IS A GENERATED FILE **/
|
|
3
|
+
|
|
4
|
+
import accordion from "../components/bs5/accordion/accordion.hbs?raw";
|
|
5
|
+
import banner from "../components/bs5/banner/banner.hbs?raw";
|
|
6
|
+
import blockquote from "../components/bs5/blockquote/blockquote.hbs?raw";
|
|
7
|
+
import breadcrumbs from "../components/bs5/breadcrumbs/breadcrumbs.hbs?raw";
|
|
8
|
+
import breadcrumbsWrapper from "../components/bs5/breadcumbsWrapper/breadcrumbsWrapper.hbs?raw";
|
|
9
|
+
import button from "../components/bs5/button/button.hbs?raw";
|
|
10
|
+
import callout from "../components/bs5/callout/callout.hbs?raw";
|
|
11
|
+
import card from "../components/bs5/card/card.hbs?raw";
|
|
12
|
+
import contentFooter from "../components/bs5/contentFooter/contentFooter.hbs?raw";
|
|
13
|
+
import contentFooterWrapper from "../components/bs5/contentFooterWrapper/contentFooterWrapper.hbs?raw";
|
|
14
|
+
import contentWrapper from "../components/bs5/contentWrapper/contentWrapper.hbs?raw";
|
|
15
|
+
import correctincorrect from "../components/bs5/correctincorrect/correctincorrect.hbs?raw";
|
|
16
|
+
import dateinput from "../components/bs5/dateinput/dateinput.hbs?raw";
|
|
17
|
+
import footer from "../components/bs5/footer/footer.hbs?raw";
|
|
18
|
+
import footerForgov from "../components/bs5/footer/footerForgov.hbs?raw";
|
|
19
|
+
import formcheck from "../components/bs5/formcheck/formcheck.hbs?raw";
|
|
20
|
+
import fullPage from "../components/bs5/fullPageWrapper/fullPage.hbs?raw";
|
|
21
|
+
import globalAlert from "../components/bs5/globalAlert/globalAlert.hbs?raw";
|
|
22
|
+
import head from "../components/bs5/head/head.hbs?raw";
|
|
23
|
+
import header from "../components/bs5/header/header.hbs?raw";
|
|
24
|
+
import inpageAlert from "../components/bs5/inpageAlert/inpageAlert.hbs?raw";
|
|
25
|
+
import inpagenav from "../components/bs5/inpagenav/inpagenav.hbs?raw";
|
|
26
|
+
import mainContainerWrapper from "../components/bs5/mainContainerWrapper/mainContainerWrapper.hbs?raw";
|
|
27
|
+
import metaDcTerms from "../components/bs5/metaDcTerms/metaDcTerms.hbs?raw";
|
|
28
|
+
import metaOpenGraph from "../components/bs5/metaOpenGraph/metaOpenGraph.hbs?raw";
|
|
29
|
+
import modal from "../components/bs5/modal/modal.hbs?raw";
|
|
30
|
+
import navbar from "../components/bs5/navbar/navbar.hbs?raw";
|
|
31
|
+
import pagination from "../components/bs5/pagination/pagination.hbs?raw";
|
|
32
|
+
import quickexit from "../components/bs5/quickexit/quickexit.hbs?raw";
|
|
33
|
+
import searchInput from "../components/bs5/searchInput/searchInput.hbs?raw";
|
|
34
|
+
import select from "../components/bs5/select/select.hbs?raw";
|
|
35
|
+
import sidenav from "../components/bs5/sidenav/sidenav.hbs?raw";
|
|
36
|
+
import sidenavWrapper from "../components/bs5/sidenavWrapper/sidenavWrapper.hbs?raw";
|
|
37
|
+
import spinner from "../components/bs5/spinner/spinner.hbs?raw";
|
|
38
|
+
import table from "../components/bs5/table/table.hbs?raw";
|
|
39
|
+
import tag from "../components/bs5/tag/tag.hbs?raw";
|
|
40
|
+
import textarea from "../components/bs5/textarea/textarea.hbs?raw";
|
|
41
|
+
import textbox from "../components/bs5/textbox/textbox.hbs?raw";
|
|
42
|
+
import typography from "../components/bs5/typography/typography.hbs?raw";
|
|
43
|
+
import video from "../components/bs5/video/video.hbs?raw";
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Registers Handlebars Partials
|
|
48
|
+
* @param {Handlebars} handlebars Templating engine
|
|
49
|
+
* @returns {void} Result of the helper operation
|
|
50
|
+
*/
|
|
51
|
+
export default function handlebarsPartials(handlebars) {
|
|
52
|
+
handlebars.registerPartial("accordion", accordion);
|
|
53
|
+
handlebars.registerPartial("banner", banner);
|
|
54
|
+
handlebars.registerPartial("blockquote", blockquote);
|
|
55
|
+
handlebars.registerPartial("breadcrumbs", breadcrumbs);
|
|
56
|
+
handlebars.registerPartial("breadcrumbsWrapper", breadcrumbsWrapper);
|
|
57
|
+
handlebars.registerPartial("button", button);
|
|
58
|
+
handlebars.registerPartial("callout", callout);
|
|
59
|
+
handlebars.registerPartial("card", card);
|
|
60
|
+
handlebars.registerPartial("contentFooter", contentFooter);
|
|
61
|
+
handlebars.registerPartial("contentFooterWrapper", contentFooterWrapper);
|
|
62
|
+
handlebars.registerPartial("contentWrapper", contentWrapper);
|
|
63
|
+
handlebars.registerPartial("correctincorrect", correctincorrect);
|
|
64
|
+
handlebars.registerPartial("dateinput", dateinput);
|
|
65
|
+
handlebars.registerPartial("footer", footer);
|
|
66
|
+
handlebars.registerPartial("footerForgov", footerForgov);
|
|
67
|
+
handlebars.registerPartial("formcheck", formcheck);
|
|
68
|
+
handlebars.registerPartial("fullPage", fullPage);
|
|
69
|
+
handlebars.registerPartial("globalAlert", globalAlert);
|
|
70
|
+
handlebars.registerPartial("head", head);
|
|
71
|
+
handlebars.registerPartial("header", header);
|
|
72
|
+
handlebars.registerPartial("inpageAlert", inpageAlert);
|
|
73
|
+
handlebars.registerPartial("inpagenav", inpagenav);
|
|
74
|
+
handlebars.registerPartial("mainContainerWrapper", mainContainerWrapper);
|
|
75
|
+
handlebars.registerPartial("metaDcTerms", metaDcTerms);
|
|
76
|
+
handlebars.registerPartial("metaOpenGraph", metaOpenGraph);
|
|
77
|
+
handlebars.registerPartial("modal", modal);
|
|
78
|
+
handlebars.registerPartial("navbar", navbar);
|
|
79
|
+
handlebars.registerPartial("pagination", pagination);
|
|
80
|
+
handlebars.registerPartial("quickexit", quickexit);
|
|
81
|
+
handlebars.registerPartial("searchInput", searchInput);
|
|
82
|
+
handlebars.registerPartial("select", select);
|
|
83
|
+
handlebars.registerPartial("sidenav", sidenav);
|
|
84
|
+
handlebars.registerPartial("sidenavWrapper", sidenavWrapper);
|
|
85
|
+
handlebars.registerPartial("spinner", spinner);
|
|
86
|
+
handlebars.registerPartial("table", table);
|
|
87
|
+
handlebars.registerPartial("tag", tag);
|
|
88
|
+
handlebars.registerPartial("textarea", textarea);
|
|
89
|
+
handlebars.registerPartial("textbox", textbox);
|
|
90
|
+
handlebars.registerPartial("typography", typography);
|
|
91
|
+
handlebars.registerPartial("video", video);
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
if(typeof(Handlebars) !== 'undefined') {
|
|
95
|
+
handlebarsPartials(Handlebars);
|
|
96
|
+
}
|
package/src/main.js
CHANGED
package/src/scss/qld-print.scss
CHANGED
|
@@ -208,6 +208,11 @@
|
|
|
208
208
|
.breadcrumb li:before, .breadcrumb a:before {
|
|
209
209
|
display: none !important;
|
|
210
210
|
}
|
|
211
|
+
// displaying full breadcrumbs
|
|
212
|
+
.breadcrumb .breadcrumb-item.breadcrumb-toggle {
|
|
213
|
+
display: none!important;
|
|
214
|
+
}
|
|
215
|
+
|
|
211
216
|
|
|
212
217
|
/* A few simple lines */
|
|
213
218
|
#qg-site-header {
|
|
@@ -264,7 +269,7 @@
|
|
|
264
269
|
}
|
|
265
270
|
|
|
266
271
|
/* Hide elements not needed for printing */
|
|
267
|
-
.navbar, footer, .sidebar {
|
|
272
|
+
.navbar, footer, .sidebar, footer.qld-footer.dark {
|
|
268
273
|
display: none;
|
|
269
274
|
}
|
|
270
275
|
|
|
@@ -324,14 +329,21 @@
|
|
|
324
329
|
.global-alert {
|
|
325
330
|
display: none;
|
|
326
331
|
}
|
|
332
|
+
|
|
327
333
|
|
|
328
334
|
a.btn:after {
|
|
329
335
|
display: block;
|
|
330
336
|
content:" (" attr(href) ")";
|
|
331
337
|
}
|
|
338
|
+
a.stretched-link:after {
|
|
339
|
+
content:" (" attr(href) ")";
|
|
340
|
+
font-size: 13px;
|
|
341
|
+
line-height: 1;
|
|
342
|
+
position: relative;
|
|
343
|
+
}
|
|
332
344
|
/* Custom qld- styles */
|
|
333
|
-
.qld-side-navigation, .qld-inpage-nav, .qld__header__site-search.qld__header__site-search--closed {
|
|
334
|
-
display: none;
|
|
345
|
+
.qld-side-navigation, .qld-inpage-nav, .qld__header__site-search.qld__header__site-search--closed, .qld__header__pre-header {
|
|
346
|
+
display: none !important;
|
|
335
347
|
}
|
|
336
348
|
.qld__header__brand-image.qld__header__brand-image_subtype, .qld__header__brand-image {
|
|
337
349
|
display: block !important;
|
|
@@ -340,7 +352,7 @@
|
|
|
340
352
|
.qld__header__brand a:after {
|
|
341
353
|
display: none;
|
|
342
354
|
}
|
|
343
|
-
|
|
355
|
+
|
|
344
356
|
/* adding class to print data-href from breadcrumb link */
|
|
345
357
|
.print-current-url {
|
|
346
358
|
display: block;
|
|
@@ -350,6 +362,12 @@
|
|
|
350
362
|
|
|
351
363
|
}
|
|
352
364
|
|
|
365
|
+
/* Print colors to show background elements */
|
|
366
|
+
|
|
367
|
+
.alert, .card-img {
|
|
368
|
+
print-color-adjust: exact;
|
|
369
|
+
}
|
|
370
|
+
|
|
353
371
|
/*print styles for forms*/
|
|
354
372
|
@media only print {
|
|
355
373
|
form abbr[title*=required]:after {
|
package/src/scss/qld-type.scss
CHANGED
|
@@ -99,6 +99,10 @@ body {
|
|
|
99
99
|
p {
|
|
100
100
|
margin-top: 1.5rem;
|
|
101
101
|
margin-bottom: 0;
|
|
102
|
+
|
|
103
|
+
&:first-child {
|
|
104
|
+
margin-top: 0;
|
|
105
|
+
}
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
ul, ol, p {
|
|
@@ -108,15 +112,37 @@ body {
|
|
|
108
112
|
li {
|
|
109
113
|
margin-top: 0.5rem;
|
|
110
114
|
}
|
|
115
|
+
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
// Apply correct bold font-weight
|
|
114
|
-
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
|
|
115
|
-
strong, b, th {
|
|
119
|
+
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
|
|
120
|
+
strong, b, th, dt {
|
|
116
121
|
font-weight: $font-weight-bold;
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
|
|
125
|
+
// Definition list
|
|
126
|
+
dt {
|
|
127
|
+
margin-top: 0.5rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
dd {
|
|
131
|
+
margin-bottom: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Custom format for last updated dl
|
|
135
|
+
dl.qld-content-dates {
|
|
136
|
+
display: flex;
|
|
137
|
+
gap: 4px;
|
|
138
|
+
|
|
139
|
+
dd {
|
|
140
|
+
margin-top: 0.5rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
120
146
|
// Light, Light alt
|
|
121
147
|
|
|
122
148
|
h1, h2, h3, h4, h5, h6 {
|
|
@@ -127,9 +153,11 @@ a,
|
|
|
127
153
|
a.nav-link {
|
|
128
154
|
text-underline-offset: var(--qld-link-underline-offset);
|
|
129
155
|
text-decoration-thickness: var(--qld-link-underline-thickness);
|
|
156
|
+
text-decoration-color: var(--#{$prefix}color-default-color-light-underline-default);
|
|
130
157
|
|
|
131
158
|
&:hover {
|
|
132
159
|
text-decoration-thickness: var(--qld-link-underline-thickness-hover);
|
|
160
|
+
text-decoration-color: var(--#{$prefix}color-default-color-light-underline-default-hover);
|
|
133
161
|
}
|
|
134
162
|
|
|
135
163
|
&:visited {
|
|
@@ -160,7 +188,7 @@ caption {
|
|
|
160
188
|
h1, h2, h3, h4, h5, h6 {
|
|
161
189
|
color: var(--#{$prefix}color-default-color-dark-text-heading);
|
|
162
190
|
}
|
|
163
|
-
|
|
191
|
+
|
|
164
192
|
|
|
165
193
|
body & {
|
|
166
194
|
color: var(--qld-body-color);
|
|
@@ -206,3 +234,4 @@ a.nostyle {
|
|
|
206
234
|
background: var(--qld-selection-bg);
|
|
207
235
|
text-shadow: none;
|
|
208
236
|
}
|
|
237
|
+
|
|
@@ -60,7 +60,7 @@ $qld-soft-grey : $color-default-color-light-border-alt;
|
|
|
60
60
|
$qld-dark-grey-muted : $color-default-color-light-text-lighter;
|
|
61
61
|
$qld-text-grey : $color-default-color-light-text-default;
|
|
62
62
|
$qld-hint-text-color: $color-default-color-light-text-lighter;
|
|
63
|
-
$qld-hint-text-color-muted: $
|
|
63
|
+
$qld-hint-text-color-muted: $color-default-color-dark-text-lighter;
|
|
64
64
|
$qld-color-dark-button-hover: $core-default-color-brand-primary-light-green;
|
|
65
65
|
$qld-text-headings : $color-default-color-light-text-heading;
|
|
66
66
|
$qld-grey : $core-default-color-neutral-light;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* global, __dirname */
|
|
2
|
+
|
|
3
|
+
import init from "./../../js/handlebars.init";
|
|
4
|
+
import Handlebars from 'handlebars';
|
|
5
|
+
|
|
6
|
+
export class MainIntegration {
|
|
7
|
+
|
|
8
|
+
constructor(data, args = {}) {
|
|
9
|
+
init(Handlebars);
|
|
10
|
+
console.log("contracutor");
|
|
11
|
+
this.data = data;
|
|
12
|
+
this.args = args;
|
|
13
|
+
|
|
14
|
+
this.template = data.template;
|
|
15
|
+
// Compile the template
|
|
16
|
+
this.compiled = Handlebars.compile(this.template)(this.data);
|
|
17
|
+
|
|
18
|
+
// For debugging purposes
|
|
19
|
+
console.log('Template:', this.template);
|
|
20
|
+
console.log('Data:', this.data);
|
|
21
|
+
//console.log('Compiled:', this.compiled);
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
template: this.template,
|
|
25
|
+
data: this.data,
|
|
26
|
+
html: this.compiled,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"breadcrumbs": [
|
|
3
|
+
{
|
|
4
|
+
"link": "#",
|
|
5
|
+
"linktext": "For government"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"link": "#",
|
|
9
|
+
"linktext": "Information and communication technology"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"link": "#",
|
|
13
|
+
"linktext": "Communication and publishing"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"link": "#",
|
|
17
|
+
"linktext": "Website and digital publishing"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"link": "#",
|
|
21
|
+
"linktext": "Website standards, guidelines and templates"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"link": "#",
|
|
25
|
+
"linktext": "Single Website Experience"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|