@ons/design-system 67.2.0 → 69.0.0
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/README.md +5 -0
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +2 -10
- package/components/access-code/access-code.dom.js +1 -1
- package/components/access-code/access-code.spec.js +2 -2
- package/components/access-code/example-access-code-error.njk +9 -14
- package/components/access-code/example-access-code.njk +3 -5
- package/components/accordion/accordion.js +4 -4
- package/components/address-input/_macro.spec.js +3 -15
- package/components/address-input/autosuggest.address.dom.js +1 -1
- package/components/address-input/autosuggest.address.js +3 -2
- package/components/address-input/autosuggest.address.setter.js +3 -3
- package/components/address-input/autosuggest.address.spec.js +66 -69
- package/components/address-output/_macro.spec.js +6 -30
- package/components/autosuggest/autosuggest.dom.js +1 -1
- package/components/autosuggest/autosuggest.helpers.js +1 -1
- package/components/back-to-top/_back-to-top.scss +34 -0
- package/components/back-to-top/_macro.njk +17 -0
- package/components/back-to-top/_macro.spec.js +60 -0
- package/components/back-to-top/back-to-top.dom.js +12 -0
- package/components/back-to-top/back-to-top.js +58 -0
- package/components/back-to-top/back-to-top.spec.js +117 -0
- package/components/back-to-top/example-back-to-top.njk +37 -0
- package/components/back-to-top/example-full-page-back-to-top.njk +192 -0
- package/components/browser-banner/_macro.spec.js +4 -12
- package/components/button/_macro.njk +6 -6
- package/components/button/_macro.spec.js +1 -5
- package/components/button/button.js +7 -8
- package/components/button/button.spec.js +17 -39
- package/components/call-to-action/_macro.spec.js +2 -6
- package/components/card/_macro.njk +25 -25
- package/components/card/_macro.spec.js +6 -30
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +3 -7
- package/components/char-check-limit/character-check.spec.js +24 -20
- package/components/checkboxes/_checkbox-macro.njk +1 -1
- package/components/checkboxes/_checkbox.scss +0 -3
- package/components/checkboxes/_macro.spec.js +1 -5
- package/components/checkboxes/checkbox-with-autoselect.js +3 -3
- package/components/checkboxes/checkbox-with-fieldset.js +2 -2
- package/components/checkboxes/checkboxes-with-reveal.js +4 -2
- package/components/checkboxes/checkboxes.dom.js +2 -2
- package/components/checkboxes/checkboxes.spec.js +13 -13
- package/components/content-pagination/_macro.spec.js +2 -2
- package/components/cookies-banner/cookies-banner.dom.js +1 -1
- package/components/cookies-banner/cookies-banner.js +1 -1
- package/components/cookies-banner/cookies-banner.spec.js +7 -7
- package/components/details/details.spec.js +12 -12
- package/components/details/example-details-with-warning.njk +5 -7
- package/components/document-list/_macro.spec.js +9 -27
- package/components/document-list/document-list.scss +1 -1
- package/components/document-list/example-document-list-downloads.njk +3 -3
- package/components/document-list/example-document-list-search-result-featured.njk +1 -1
- package/components/document-list/example-document-list-search-results.njk +3 -3
- package/components/download-resources/download-resources.js +54 -54
- package/components/download-resources/download-resources.spec.js +3 -1
- package/components/error/_macro.njk +1 -1
- package/components/error/_macro.spec.js +2 -6
- package/components/feedback/_macro.spec.js +4 -20
- package/components/field/_macro.spec.js +1 -3
- package/components/fieldset/_fieldset.scss +1 -2
- package/components/fieldset/_macro.spec.js +3 -9
- package/components/footer/_footer.scss +8 -0
- package/components/footer/_macro.njk +8 -7
- package/components/footer/_macro.spec.js +14 -2
- package/components/helpers/grid.njk +15 -15
- package/components/icon/_macro.njk +7 -3
- package/components/icon/_macro.spec.js +4 -12
- package/components/image/_macro.spec.js +1 -5
- package/components/input/_macro.njk +22 -23
- package/components/input/_macro.spec.js +1 -1
- package/components/input/character-check.dom.js +1 -1
- package/components/input/input.spec.js +1 -4
- package/components/label/_label.scss +1 -0
- package/components/label/_macro.njk +2 -2
- package/components/label/_macro.spec.js +4 -13
- package/components/list/_macro.spec.js +4 -12
- package/components/message/_macro.njk +17 -17
- package/components/message/_macro.spec.js +9 -33
- package/components/message-list/_macro.spec.js +7 -39
- package/components/modal/_macro.spec.js +3 -9
- package/components/modal/modal.dom.js +1 -1
- package/components/modal/modal.spec.js +5 -5
- package/components/mutually-exclusive/_macro.spec.js +2 -10
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +26 -26
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +9 -9
- package/components/mutually-exclusive/mutually-exclusive.dom.js +1 -1
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +8 -8
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +7 -7
- package/components/mutually-exclusive/mutually-exclusive.js +13 -13
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +29 -29
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +7 -7
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +8 -8
- package/components/navigation/navigation.spec.js +0 -2
- package/components/pagination/_macro.spec.js +11 -53
- package/components/panel/_macro.njk +17 -17
- package/components/panel/_macro.spec.js +25 -25
- package/components/panel/_panel.scss +10 -9
- package/components/panel/example-panel-bare.njk +3 -4
- package/components/panel/example-panel-with-announcement.njk +6 -10
- package/components/panel/example-panel-with-error-summary.njk +2 -2
- package/components/panel/example-panel-with-information.njk +0 -1
- package/components/panel/example-panel-with-success-message.njk +1 -1
- package/components/panel/example-panel-with-warning.njk +2 -3
- package/components/password/password.dom.js +1 -1
- package/components/phase-banner/_macro.spec.js +3 -9
- package/components/question/_macro.njk +1 -1
- package/components/question/_macro.spec.js +5 -19
- package/components/question/_question.scss +1 -4
- package/components/question/example-question-interviewer-note.njk +1 -1
- package/components/quote/_macro.spec.js +2 -10
- package/components/radios/clear-radios.js +3 -3
- package/components/radios/radio-with-fieldset.js +4 -4
- package/components/radios/radios.dom.js +1 -1
- package/components/radios/radios.spec.js +26 -26
- package/components/related-content/_macro.spec.js +2 -4
- package/components/related-content/_section-macro.spec.js +2 -8
- package/components/relationships/example-relationships-error.njk +16 -18
- package/components/relationships/relationships.dom.js +1 -1
- package/components/relationships/relationships.js +2 -2
- package/components/reply/_macro.spec.js +3 -3
- package/components/reply/reply.dom.js +1 -1
- package/components/reply/reply.spec.js +3 -3
- package/components/section-navigation/_macro.spec.js +13 -21
- package/components/select/_macro.spec.js +6 -6
- package/components/share-page/_macro.spec.js +6 -14
- package/components/skip-to-content/_macro.spec.js +3 -11
- package/components/skip-to-content/skip-to-content.dom.js +1 -1
- package/components/skip-to-content/skip-to-content.js +1 -1
- package/components/skip-to-content/skip-to-content.spec.js +2 -2
- package/components/status/_macro.njk +2 -2
- package/components/status/_macro.spec.js +5 -9
- package/components/status/example-status-dead.njk +1 -1
- package/components/status/example-status-error.njk +1 -1
- package/components/status/example-status-pending.njk +1 -1
- package/components/status/example-status-small.njk +1 -1
- package/components/status/example-status-success.njk +1 -1
- package/components/summary/_macro.njk +4 -5
- package/components/summary/_macro.spec.js +27 -9
- package/components/table/_macro.spec.js +6 -10
- package/components/table/scrollable-table.dom.js +1 -1
- package/components/table/scrollable-table.js +1 -1
- package/components/table/sortable-table.js +4 -4
- package/components/table/table.spec.js +21 -17
- package/components/table-of-contents/_macro.njk +31 -31
- package/components/table-of-contents/_macro.spec.js +3 -11
- package/components/table-of-contents/toc.dom.js +1 -1
- package/components/table-of-contents/toc.spec.js +36 -32
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/tabs/tabs.dom.js +1 -1
- package/components/tabs/tabs.js +8 -8
- package/components/text-indent/_macro.spec.js +2 -6
- package/components/textarea/textarea.dom.js +1 -1
- package/components/textarea/textarea.spec.js +8 -8
- package/components/timeout-modal/_macro.spec.js +1 -3
- package/components/timeout-modal/timeout-modal.dom.js +1 -1
- package/components/timeout-modal/timeout-modal.spec.js +10 -10
- package/components/timeout-panel/_macro.njk +16 -17
- package/components/timeout-panel/_macro.spec.js +1 -1
- package/components/timeout-panel/timeout-panel.dom.js +1 -1
- package/components/timeout-panel/timeout-panel.spec.js +8 -8
- package/components/video/_macro.spec.js +1 -5
- package/components/video/video.dom.js +1 -1
- package/components/video/video.spec.js +16 -12
- package/css/main.css +1 -1
- package/favicons/safari-pinned-tab.svg +23 -23
- package/js/analytics.js +15 -14
- package/js/cookies-settings.dom.js +1 -1
- package/js/cookies-settings.spec.js +19 -19
- package/js/domready.js +1 -1
- package/js/fetch.js +1 -1
- package/js/inpagelink.js +3 -3
- package/js/main.js +1 -0
- package/js/print-button.js +1 -1
- package/js/timeout.js +1 -1
- package/package.json +2 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_typography.scss +8 -2
- package/scss/main.scss +1 -0
- package/scss/overrides/hcm.scss +8 -1
- package/scss/vars/_colors.scss +2 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
2
2
|
<path d="M23.6,1.5c0.3-0.1,0.4,0,0.4,0c0,0,0,0.2,0,0.5l0,0.3c0,0.1,0,0.1,0,0.2L24,3c0,0.1,0,0.1,0,0.2l0,1c0,0.1,0,0.2,0,0.3
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</svg>
|
|
3
|
+
l0,2.3c0,0.1,0,0.2,0,0.4l0,1.9c0,0.1,0,0.3,0,0.4l0,0.8c0,0.1,0,0.3,0,0.4l0,0.8c0,0.1,0,0.3,0,0.4l0,0.8c0,4.4,0,8.5,0,8.6
|
|
4
|
+
c0,0.2,0,0.3-0.1,0.4c0,0.1,0,0.1,0,0.1c0,0-0.2,0.6-0.3,0.8c-0.2,0.3-0.6,0.8-1,1c-0.1,0.1-0.4,0.2-0.6,0.2
|
|
5
|
+
C21.7,24,21.6,24,20.9,24c-0.7,0-1.3,0-1.6-0.1c-0.1,0-0.2,0-0.4,0c-0.1,0-0.3,0-0.3,0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-0.4-0.1-0.4c0-0.1-0.2-0.9-0.2-1.1c0-0.2-0.1-0.4-0.1-0.6c0-0.1,0-0.1,0-0.3l0-0.2C0,4.4,0,3,0,2.3
|
|
23
|
+
c0.1-1.2,0.8-2,1.8-2.3C2,0,2.8,0,6.8,0l0.5,0c0.1,0,0.2,0,0.3,0l0.6,0c0.1,0,0.2,0,0.3,0l1,0c0.1,0,0.2,0,0.3,0l1.5,0l0,0l0.4,0
|
|
24
|
+
l0,0L17.1,0z"/>
|
|
25
|
+
</svg>
|
package/js/analytics.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import domready from './domready';
|
|
2
2
|
|
|
3
|
-
export let trackEvent = () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
console.log('GA active');
|
|
3
|
+
export let trackEvent = () => {};
|
|
4
|
+
|
|
5
|
+
if (window.google_tag_manager !== undefined) {
|
|
6
|
+
console.log('GA active');
|
|
7
|
+
trackEvent = (type, data) => {
|
|
9
8
|
window.dataLayer = window.dataLayer || [];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
}
|
|
9
|
+
function gtag() {
|
|
10
|
+
dataLayer.push(arguments);
|
|
11
|
+
}
|
|
12
|
+
gtag('event', type, { ...data });
|
|
13
|
+
console.log('Data sent to Data Layer');
|
|
14
|
+
};
|
|
15
|
+
} else {
|
|
16
|
+
console.log('Google analytics not connected');
|
|
17
|
+
}
|
|
16
18
|
|
|
17
19
|
export const trackElement = (el, type) => {
|
|
18
|
-
return trackEvent({
|
|
19
|
-
event_type: type,
|
|
20
|
+
return trackEvent(type, {
|
|
20
21
|
event_category: el.getAttribute('data-ga-category') || '',
|
|
21
22
|
event_action: el.getAttribute('data-ga-action') || '',
|
|
22
23
|
event_label: el.getAttribute('data-ga-label') || '',
|
|
@@ -4,7 +4,7 @@ async function cookiesSettings() {
|
|
|
4
4
|
const cookiesSettings = [...document.querySelectorAll('[data-module=cookie-settings]')];
|
|
5
5
|
if (cookiesSettings.length) {
|
|
6
6
|
const CookiesSettings = (await import('./cookies-settings')).default;
|
|
7
|
-
cookiesSettings.forEach(form => {
|
|
7
|
+
cookiesSettings.forEach((form) => {
|
|
8
8
|
new CookiesSettings(form);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -46,7 +46,7 @@ describe('script: cookies-settings', () => {
|
|
|
46
46
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
47
47
|
|
|
48
48
|
const cookies = await page.cookies();
|
|
49
|
-
const ons_cookie_policy = cookies.find(cookie => cookie.name === 'ons_cookie_policy');
|
|
49
|
+
const ons_cookie_policy = cookies.find((cookie) => cookie.name === 'ons_cookie_policy');
|
|
50
50
|
const policy = JSON.parse(ons_cookie_policy.value.replace(/'/g, '"'));
|
|
51
51
|
|
|
52
52
|
expect(policy).toEqual({
|
|
@@ -60,9 +60,9 @@ describe('script: cookies-settings', () => {
|
|
|
60
60
|
it('sets all radio buttons to the default values of every `cookieType`', async () => {
|
|
61
61
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
62
62
|
|
|
63
|
-
const cookiesSettingsOffRadio = await page.$eval('input[name=cookies-settings][value=off]', node => node.checked);
|
|
64
|
-
const cookiesUsageOffRadio = await page.$eval('input[name=cookies-usage][value=off]', node => node.checked);
|
|
65
|
-
const cookiesCampaignsOffRadio = await page.$eval('input[name=cookies-campaigns][value=off]', node => node.checked);
|
|
63
|
+
const cookiesSettingsOffRadio = await page.$eval('input[name=cookies-settings][value=off]', (node) => node.checked);
|
|
64
|
+
const cookiesUsageOffRadio = await page.$eval('input[name=cookies-usage][value=off]', (node) => node.checked);
|
|
65
|
+
const cookiesCampaignsOffRadio = await page.$eval('input[name=cookies-campaigns][value=off]', (node) => node.checked);
|
|
66
66
|
|
|
67
67
|
expect(cookiesSettingsOffRadio).toBe(true);
|
|
68
68
|
expect(cookiesUsageOffRadio).toBe(true);
|
|
@@ -72,8 +72,8 @@ describe('script: cookies-settings', () => {
|
|
|
72
72
|
it('sets the provided radio buttons to the default values of every matched `cookieType`', async () => {
|
|
73
73
|
await setTestPage('/test', EXAMPLE_PART_COOKIES_SETTINGS_PAGE);
|
|
74
74
|
|
|
75
|
-
const cookiesSettingsOffRadio = await page.$eval('input[name=cookies-settings][value=off]', node => node.checked);
|
|
76
|
-
const cookiesCampaignsOffRadio = await page.$eval('input[name=cookies-campaigns][value=off]', node => node.checked);
|
|
75
|
+
const cookiesSettingsOffRadio = await page.$eval('input[name=cookies-settings][value=off]', (node) => node.checked);
|
|
76
|
+
const cookiesCampaignsOffRadio = await page.$eval('input[name=cookies-campaigns][value=off]', (node) => node.checked);
|
|
77
77
|
|
|
78
78
|
expect(cookiesSettingsOffRadio).toBe(true);
|
|
79
79
|
expect(cookiesCampaignsOffRadio).toBe(true);
|
|
@@ -84,23 +84,23 @@ describe('script: cookies-settings', () => {
|
|
|
84
84
|
|
|
85
85
|
await page.click('.ons-js-accept-cookies');
|
|
86
86
|
|
|
87
|
-
const cookiesSettingsOnRadio = await page.$eval('input[name=cookies-settings][value=on]', node => node.checked);
|
|
88
|
-
const cookiesUsageOnRadio = await page.$eval('input[name=cookies-usage][value=on]', node => node.checked);
|
|
89
|
-
const cookiesCampaignsOnRadio = await page.$eval('input[name=cookies-campaigns][value=on]', node => node.checked);
|
|
87
|
+
const cookiesSettingsOnRadio = await page.$eval('input[name=cookies-settings][value=on]', (node) => node.checked);
|
|
88
|
+
const cookiesUsageOnRadio = await page.$eval('input[name=cookies-usage][value=on]', (node) => node.checked);
|
|
89
|
+
const cookiesCampaignsOnRadio = await page.$eval('input[name=cookies-campaigns][value=on]', (node) => node.checked);
|
|
90
90
|
|
|
91
91
|
expect(cookiesSettingsOnRadio).toBe(true);
|
|
92
92
|
expect(cookiesUsageOnRadio).toBe(true);
|
|
93
93
|
expect(cookiesCampaignsOnRadio).toBe(true);
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
it.each([['settings'], ['usage'], ['campaigns']])('updates consent cookie when "%s" policy is turned on', async policyName => {
|
|
96
|
+
it.each([['settings'], ['usage'], ['campaigns']])('updates consent cookie when "%s" policy is turned on', async (policyName) => {
|
|
97
97
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
98
98
|
|
|
99
99
|
await page.click(`input[name=cookies-${policyName}][value=on]`);
|
|
100
100
|
await page.click('#submit-button');
|
|
101
101
|
|
|
102
102
|
const cookies = await page.cookies();
|
|
103
|
-
const ons_cookie_policy = cookies.find(cookie => cookie.name === 'ons_cookie_policy');
|
|
103
|
+
const ons_cookie_policy = cookies.find((cookie) => cookie.name === 'ons_cookie_policy');
|
|
104
104
|
const policy = JSON.parse(ons_cookie_policy.value.replace(/'/g, '"'));
|
|
105
105
|
|
|
106
106
|
expect(policy).toHaveProperty(policyName, true);
|
|
@@ -108,7 +108,7 @@ describe('script: cookies-settings', () => {
|
|
|
108
108
|
|
|
109
109
|
it.each([['settings'], ['usage'], ['campaigns']])(
|
|
110
110
|
'updates consent cookie when "%s" policy is turned on and then off',
|
|
111
|
-
async policyName => {
|
|
111
|
+
async (policyName) => {
|
|
112
112
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
113
113
|
|
|
114
114
|
await page.click(`input[name=cookies-${policyName}][value=on]`);
|
|
@@ -118,7 +118,7 @@ describe('script: cookies-settings', () => {
|
|
|
118
118
|
await page.click('#submit-button');
|
|
119
119
|
|
|
120
120
|
const cookies = await page.cookies();
|
|
121
|
-
const ons_cookie_policy = cookies.find(cookie => cookie.name === 'ons_cookie_policy');
|
|
121
|
+
const ons_cookie_policy = cookies.find((cookie) => cookie.name === 'ons_cookie_policy');
|
|
122
122
|
const policy = JSON.parse(ons_cookie_policy.value.replace(/'/g, '"'));
|
|
123
123
|
|
|
124
124
|
expect(policy).toHaveProperty(policyName, false);
|
|
@@ -129,13 +129,13 @@ describe('script: cookies-settings', () => {
|
|
|
129
129
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
130
130
|
|
|
131
131
|
const cookiesBefore = await page.cookies();
|
|
132
|
-
const ons_cookie_message_displayed_before = cookiesBefore.find(cookie => cookie.name === 'ons_cookie_message_displayed');
|
|
132
|
+
const ons_cookie_message_displayed_before = cookiesBefore.find((cookie) => cookie.name === 'ons_cookie_message_displayed');
|
|
133
133
|
expect(ons_cookie_message_displayed_before).toBeUndefined();
|
|
134
134
|
|
|
135
135
|
await page.click('#submit-button');
|
|
136
136
|
|
|
137
137
|
const cookiesAfter = await page.cookies();
|
|
138
|
-
const ons_cookie_message_displayed_after = cookiesAfter.find(cookie => cookie.name === 'ons_cookie_message_displayed');
|
|
138
|
+
const ons_cookie_message_displayed_after = cookiesAfter.find((cookie) => cookie.name === 'ons_cookie_message_displayed');
|
|
139
139
|
|
|
140
140
|
expect(ons_cookie_message_displayed_after.value).toBe('true');
|
|
141
141
|
});
|
|
@@ -143,7 +143,7 @@ describe('script: cookies-settings', () => {
|
|
|
143
143
|
it('does not hide the cookie banner by default', async () => {
|
|
144
144
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
145
145
|
|
|
146
|
-
const displayStyle = await page.$eval('.ons-cookies-banner', node => window.getComputedStyle(node).getPropertyValue('display'));
|
|
146
|
+
const displayStyle = await page.$eval('.ons-cookies-banner', (node) => window.getComputedStyle(node).getPropertyValue('display'));
|
|
147
147
|
expect(displayStyle).not.toBe('none');
|
|
148
148
|
});
|
|
149
149
|
|
|
@@ -152,14 +152,14 @@ describe('script: cookies-settings', () => {
|
|
|
152
152
|
|
|
153
153
|
await page.click('#submit-button');
|
|
154
154
|
|
|
155
|
-
const displayStyle = await page.$eval('.ons-cookies-banner', node => window.getComputedStyle(node).getPropertyValue('display'));
|
|
155
|
+
const displayStyle = await page.$eval('.ons-cookies-banner', (node) => window.getComputedStyle(node).getPropertyValue('display'));
|
|
156
156
|
expect(displayStyle).toBe('none');
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
it('does not show a confirmation message by default', async () => {
|
|
160
160
|
await setTestPage('/test', EXAMPLE_COOKIES_SETTINGS_PAGE);
|
|
161
161
|
|
|
162
|
-
const displayStyle = await page.$eval('.ons-cookies-confirmation-message', node =>
|
|
162
|
+
const displayStyle = await page.$eval('.ons-cookies-confirmation-message', (node) =>
|
|
163
163
|
window.getComputedStyle(node).getPropertyValue('display'),
|
|
164
164
|
);
|
|
165
165
|
expect(displayStyle).toBe('none');
|
|
@@ -170,7 +170,7 @@ describe('script: cookies-settings', () => {
|
|
|
170
170
|
|
|
171
171
|
await page.click('#submit-button');
|
|
172
172
|
|
|
173
|
-
const displayStyle = await page.$eval('.ons-cookies-confirmation-message', node =>
|
|
173
|
+
const displayStyle = await page.$eval('.ons-cookies-confirmation-message', (node) =>
|
|
174
174
|
window.getComputedStyle(node).getPropertyValue('display'),
|
|
175
175
|
);
|
|
176
176
|
expect(displayStyle).not.toBe('none');
|
package/js/domready.js
CHANGED
package/js/fetch.js
CHANGED
package/js/inpagelink.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default function inPageLinks(links) {
|
|
2
|
-
links.forEach(link => {
|
|
2
|
+
links.forEach((link) => {
|
|
3
3
|
const id = link.getAttribute('href').replace('#', '');
|
|
4
4
|
|
|
5
|
-
link.addEventListener('click', event => {
|
|
5
|
+
link.addEventListener('click', (event) => {
|
|
6
6
|
event.preventDefault();
|
|
7
7
|
focusOnInput(id);
|
|
8
8
|
});
|
|
@@ -17,7 +17,7 @@ function focusOnInput(id) {
|
|
|
17
17
|
...container.getElementsByTagName('INPUT'),
|
|
18
18
|
...container.getElementsByTagName('TEXTAREA'),
|
|
19
19
|
...container.getElementsByTagName('SELECT'),
|
|
20
|
-
].filter(input => {
|
|
20
|
+
].filter((input) => {
|
|
21
21
|
const type = input.getAttribute('type');
|
|
22
22
|
|
|
23
23
|
return type !== 'readonly' && type !== 'hidden';
|
package/js/main.js
CHANGED
|
@@ -7,6 +7,7 @@ import '../components/textarea/textarea.dom';
|
|
|
7
7
|
import '../components/password/password.dom';
|
|
8
8
|
import '../components/tabs/tabs.dom';
|
|
9
9
|
import '../components/table-of-contents/toc.dom';
|
|
10
|
+
import '../components/back-to-top/back-to-top.dom';
|
|
10
11
|
import '../components/accordion/accordion.dom';
|
|
11
12
|
import '../components/details/details.dom';
|
|
12
13
|
import '../components/table/scrollable-table.dom';
|
package/js/print-button.js
CHANGED
|
@@ -3,7 +3,7 @@ import domready from './domready';
|
|
|
3
3
|
export default function addEventListeners() {
|
|
4
4
|
const buttons = [...document.querySelectorAll('.ons-js-print-btn')];
|
|
5
5
|
|
|
6
|
-
buttons.forEach(button => {
|
|
6
|
+
buttons.forEach((button) => {
|
|
7
7
|
button.addEventListener('click', handleClick);
|
|
8
8
|
button.classList.remove('ons-u-d-no');
|
|
9
9
|
});
|
package/js/timeout.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ons/design-system",
|
|
3
3
|
"description": "ONS Design System built CSS, JS, and Nunjucks templates",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "69.0.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"eslint-cli": "^1.1.1",
|
|
77
77
|
"eslint-config-prettier": "^9.0.0",
|
|
78
78
|
"eslint-plugin-prettier": "^5.0.0",
|
|
79
|
+
"eslint-plugin-unused-imports": "^3.1.0",
|
|
79
80
|
"express": "^4.17.1",
|
|
80
81
|
"front-matter": "^4.0.2",
|
|
81
82
|
"fs-extra": "^11.1.1",
|