@ons/design-system 62.2.1 → 62.2.2
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 +27 -1
- package/components/autosuggest/_macro.njk +1 -1
- package/components/autosuggest/_macro.spec.js +2 -2
- package/components/document-list/example-document-list-articles.njk +1 -1
- package/components/document-list/example-document-list-downloads.njk +2 -8
- package/components/input/_macro.njk +6 -1
- package/components/input/_macro.spec.js +27 -1
- package/components/section-navigation/_macro.njk +55 -22
- package/components/section-navigation/_macro.spec.js +64 -0
- package/components/section-navigation/_section-navigation.scss +5 -0
- package/components/section-navigation/example-section-navigation-vertical.njk +61 -21
- package/components/textarea/textarea.dom.js +0 -4
- package/components/timeout-modal/example-timeout-modal.njk +1 -1
- package/css/main.css +1 -1
- package/package.json +8 -6
- package/scripts/main.es5.js +1 -7
- package/scripts/main.js +1 -7
- package/scss/main.scss +1 -0
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ yarn start
|
|
|
43
43
|
|
|
44
44
|
Once the server has started, navigate to <http://localhost:3030>
|
|
45
45
|
|
|
46
|
-
## Testing
|
|
46
|
+
## Testing - macros and scripts
|
|
47
47
|
|
|
48
48
|
This project uses [jest](https://jestjs.io/docs/cli) and supports its command line options.
|
|
49
49
|
|
|
@@ -109,6 +109,32 @@ It is sometimes useful to adjust the following settings when writing tests or di
|
|
|
109
109
|
|
|
110
110
|
- `testTimeout` in 'jest.config.js' - set to a high value such as `1000000` to prevent tests from timing out when doing the above.
|
|
111
111
|
|
|
112
|
+
## Testing - Visual regression tests
|
|
113
|
+
|
|
114
|
+
This project uses [Backstop JS](https://github.com/garris/BackstopJS) for visual regression testing. The tests run in Chrome headless using pupeteer inside docker and run in three viewports; 1920 (desktop), 768 (tablet) and 375 (mobile). Reference images are stored in Git LFS and any approved changes will automatically be stored in Git LFS when pushed to the repository.
|
|
115
|
+
|
|
116
|
+
The visual tests will run automatically on pull requests and the result will be available in the Github Action logs. If the tests fail, the process for viewing the failures and approving changes will need to be handled locally using the following workflow and commands.
|
|
117
|
+
|
|
118
|
+
The first time you run the tests locally you will need to install Git LFS on your machine. Follow the install instructions for [Git LFS](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage).
|
|
119
|
+
|
|
120
|
+
You will need to have Docker installed and started locally. We are using Docker as there are font rendering issues that caused failures across different os versions when we run the tests in CI. There is further information on this in the [Backstop JS docs](https://github.com/garris/BackstopJS#using-docker-for-testing-across-different-environments).
|
|
121
|
+
|
|
122
|
+
Checkout the branch locally and run:
|
|
123
|
+
|
|
124
|
+
`git lfs fetch` - This downloads the files into your `.git/lfs` if you have never run vr test locally.
|
|
125
|
+
|
|
126
|
+
`git lfs checkout` - This will pull the current reference images from the repository for you to test against.
|
|
127
|
+
|
|
128
|
+
`yarn test-visual` - This will run the same tests locally as were run in Github Actions. After they have completed the report will open in your default browser.
|
|
129
|
+
|
|
130
|
+
`yarn test-visual:approve` - This will approve the failures/diff caught by the tests.
|
|
131
|
+
|
|
132
|
+
`yarn test-visual:reference` - This will update the reference images locally on your machine.
|
|
133
|
+
|
|
134
|
+
`git lfs push --all origin` - First commit the files in the normal way then run the command. This will push the new reference images to Git LFS.
|
|
135
|
+
|
|
136
|
+
You can then commit and push your changes. The test images that would have been created when you ran `yest test-visual` are gitignored and the new references images will be pushed to Git LFS.
|
|
137
|
+
|
|
112
138
|
## Build
|
|
113
139
|
|
|
114
140
|
Generate a build into `./build`.
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
{% set autosuggestResults %}
|
|
39
39
|
<div class="ons-autosuggest-input__results ons-js-autosuggest-results">
|
|
40
|
-
<
|
|
40
|
+
<div id="{{ params.resultsTitleId }}" class="ons-autosuggest-input__results-title ons-u-fs-s">{{ params.resultsTitle }}</div>
|
|
41
41
|
<ul class="ons-autosuggest-input__listbox ons-js-autosuggest-listbox" title="{{ params.resultsTitle }}" role="listbox" id="{{ params.id }}-listbox" tabindex="-1"></ul>
|
|
42
42
|
</div>
|
|
43
43
|
<div class="ons-autosuggest-input__instructions ons-u-vh ons-js-autosuggest-instructions" id="{{ params.id }}-instructions" tabindex="-1">{{ params.instructions }}</div>
|
|
@@ -182,13 +182,13 @@ describe('macro: autosuggest', () => {
|
|
|
182
182
|
expect($('.ons-autosuggest-input__results').length).toBe(0);
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
-
it('renders
|
|
185
|
+
it('renders div with the provided title identifier', () => {
|
|
186
186
|
const $ = cheerio.load(renderComponent('autosuggest', EXAMPLE_AUTOSUGGEST));
|
|
187
187
|
|
|
188
188
|
expect($('.ons-autosuggest-input__results-title').attr('id')).toBe('country-of-birth-suggestions');
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
-
it('renders
|
|
191
|
+
it('renders div with the provided title text', () => {
|
|
192
192
|
const $ = cheerio.load(renderComponent('autosuggest', EXAMPLE_AUTOSUGGEST));
|
|
193
193
|
|
|
194
194
|
expect(
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
{
|
|
25
25
|
"thumbnail": {
|
|
26
26
|
"smallSrc": '/img/small/ons-award-winners.jpg',
|
|
27
|
-
"largeSrc": '/img/large/
|
|
27
|
+
"largeSrc": '/img/large/ons-award-winners.jpg'
|
|
28
28
|
},
|
|
29
29
|
"url": '#0',
|
|
30
30
|
"title": 'Office for National Statistics win top Royal Statistical Society award',
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
{{ onsDocumentList({
|
|
3
3
|
"documents": [
|
|
4
4
|
{
|
|
5
|
-
"thumbnail":
|
|
6
|
-
"smallSrc": '/patternlib-img/download-resources/img/small/including-everyone-in-census-2021-v2.png',
|
|
7
|
-
"largeSrc": '/patternlib-img/download-resources/img/large/including-everyone-in-census-2021-v2.png'
|
|
8
|
-
},
|
|
5
|
+
"thumbnail": true,
|
|
9
6
|
"url": '#',
|
|
10
7
|
"title": 'Including everyone in Census 2021',
|
|
11
8
|
"metadata": {
|
|
@@ -21,10 +18,7 @@
|
|
|
21
18
|
"description": 'Empty belly poster, aimed at advertising census events.'
|
|
22
19
|
},
|
|
23
20
|
{
|
|
24
|
-
"thumbnail":
|
|
25
|
-
"smallSrc": '/patternlib-img/download-resources/img/small/including-everyone-in-census-2021.png',
|
|
26
|
-
"largeSrc": '/patternlib-img/download-resources/img/large/including-everyone-in-census-2021.png'
|
|
27
|
-
},
|
|
21
|
+
"thumbnail": true,
|
|
28
22
|
"url": '#',
|
|
29
23
|
"title": 'Community handbook for Census 2021',
|
|
30
24
|
"metadata": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
type="{{ type }}"
|
|
28
28
|
id="{{ params.id }}"
|
|
29
29
|
class="ons-input ons-input--text ons-input-type__input{% if params.error %} ons-input--error{% endif %}{% if params.searchButton %} ons-search__input{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}{% if params.width %} ons-input{% if params.type == 'number' or params.type == 'tel' %}-number{% endif %}--w-{{ params.width }}{% endif %}{{ exclusiveClass }}{{ inputPlaceholder }}"
|
|
30
|
-
{% if params.prefix and params.prefix.id %}aria-labelledby="{{ params.prefix.id }}"{% elif params.suffix and params.suffix.id %}aria-labelledby="{{ params.suffix.id }}"{% endif %}
|
|
30
|
+
{% if params.prefix and params.prefix.id and not params.prefix.title %}aria-labelledby="{{ params.prefix.id }}"{% elif params.suffix and params.suffix.id and not params.suffix.title %}aria-labelledby="{{ params.suffix.id }}"{% endif %}
|
|
31
|
+
{% if params.prefix and params.prefix.id %}aria-labelledby="{{ params.id }} {{ params.prefix.id }}"{% elif params.suffix and params.suffix.id %}aria-labelledby="{{ params.id }} {{ params.suffix.id }}"{% endif %}
|
|
31
32
|
{% if params.name %}name="{{ params.name }}"{% endif %}
|
|
32
33
|
{% if params.value %}value="{{ params.value }}"{% endif %}
|
|
33
34
|
{% if params.accept %}accept="{{ params.accept }}"{% endif %}
|
|
@@ -89,6 +90,10 @@
|
|
|
89
90
|
<{{ tag }}
|
|
90
91
|
id="{{ abbr.id }}"
|
|
91
92
|
class="ons-input-type__type ons-js-input-abbr"
|
|
93
|
+
{% if params.prefix or params.suffix %}
|
|
94
|
+
aria-label="{{ abbr.title }}"
|
|
95
|
+
role="figure"
|
|
96
|
+
{% endif %}
|
|
92
97
|
{% if abbr.title %}title="{{ abbr.title }}"{% endif %}
|
|
93
98
|
>{{ abbr.text }}</{{ tag }}>
|
|
94
99
|
</span>
|
|
@@ -380,7 +380,7 @@ describe('macro: input', () => {
|
|
|
380
380
|
expect(results).toHaveNoViolations();
|
|
381
381
|
});
|
|
382
382
|
|
|
383
|
-
it('adds `aria-labelledby` attribute when `prefix` is provided', () => {
|
|
383
|
+
it('adds `aria-labelledby` attribute when `prefix` is provided with `prefix.title`', () => {
|
|
384
384
|
const $ = cheerio.load(
|
|
385
385
|
renderComponent('input', {
|
|
386
386
|
...EXAMPLE_INPUT_MINIMAL,
|
|
@@ -391,6 +391,19 @@ describe('macro: input', () => {
|
|
|
391
391
|
}),
|
|
392
392
|
);
|
|
393
393
|
|
|
394
|
+
expect($('.ons-input').attr('aria-labelledby')).toBe('example-id example-prefix-id');
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
it('adds `aria-labelledby` attribute when `prefix` is provided without `prefix.title`', () => {
|
|
398
|
+
const $ = cheerio.load(
|
|
399
|
+
renderComponent('input', {
|
|
400
|
+
...EXAMPLE_INPUT_MINIMAL,
|
|
401
|
+
prefix: {
|
|
402
|
+
id: 'example-prefix-id',
|
|
403
|
+
},
|
|
404
|
+
}),
|
|
405
|
+
);
|
|
406
|
+
|
|
394
407
|
expect($('.ons-input').attr('aria-labelledby')).toBe('example-prefix-id');
|
|
395
408
|
});
|
|
396
409
|
|
|
@@ -440,6 +453,19 @@ describe('macro: input', () => {
|
|
|
440
453
|
}),
|
|
441
454
|
);
|
|
442
455
|
|
|
456
|
+
expect($('.ons-input').attr('aria-labelledby')).toBe('example-id example-suffix-id');
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
it('adds `aria-labelledby` attribute when `suffix` is provided without `suffix.title`', () => {
|
|
460
|
+
const $ = cheerio.load(
|
|
461
|
+
renderComponent('input', {
|
|
462
|
+
...EXAMPLE_INPUT_MINIMAL,
|
|
463
|
+
suffix: {
|
|
464
|
+
id: 'example-suffix-id',
|
|
465
|
+
},
|
|
466
|
+
}),
|
|
467
|
+
);
|
|
468
|
+
|
|
443
469
|
expect($('.ons-input').attr('aria-labelledby')).toBe('example-suffix-id');
|
|
444
470
|
});
|
|
445
471
|
|
|
@@ -1,25 +1,58 @@
|
|
|
1
1
|
{% macro onsSectionNavigation(params) %}
|
|
2
|
-
<nav class="ons-section-nav{% if params.variants == 'vertical' %} ons-section-nav--vertical{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %} aria-label="{{ params.ariaLabel | default("Section menu") }}">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
<nav class="ons-section-nav{% if params.variants == 'vertical' %} ons-section-nav--vertical{% endif %} {% if params.classes %} {{ params.classes }} {% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %} aria-label="{{ params.ariaLabel | default("Section menu") }}">
|
|
3
|
+
{% if params.sections %}
|
|
4
|
+
{% for section in params.sections %}
|
|
5
|
+
<div class="ons-section-nav__sub">
|
|
6
|
+
{% if section.title %}
|
|
7
|
+
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ section.title }}</h3>{% endif %}
|
|
8
|
+
<ul class="ons-section-nav__list">
|
|
9
|
+
{% for item in (section.itemsList if section.itemsList is iterable else section.itemsList.items()) %}
|
|
10
|
+
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
|
|
11
|
+
{% set isCurrent = true %}
|
|
12
|
+
{% else %}
|
|
13
|
+
{% set isCurrent = false %}
|
|
14
|
+
{% endif %}
|
|
15
|
+
<li class="ons-section-nav__item{% if item.classes %} ' ' + {{ item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
|
|
16
|
+
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
|
|
17
|
+
{% if item.anchors and isCurrent == true %}
|
|
18
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
|
|
19
|
+
{% for anchor in item.anchors %}
|
|
20
|
+
<li class="ons-section-nav__item ons-list__item">
|
|
21
|
+
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.title }}</a>
|
|
22
|
+
</li>
|
|
23
|
+
{% endfor %}
|
|
24
|
+
</ul>
|
|
25
|
+
{% endif %}
|
|
26
|
+
</li>
|
|
27
|
+
{% endfor %}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
{% endfor %}
|
|
31
|
+
{% else %}
|
|
32
|
+
{% if params.title %}
|
|
33
|
+
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h3>
|
|
34
|
+
{% endif %}
|
|
35
|
+
<ul class="ons-section-nav__list">
|
|
36
|
+
{% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
|
|
37
|
+
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
|
|
38
|
+
{% set isCurrent = true %}
|
|
39
|
+
{% else %}
|
|
40
|
+
{% set isCurrent = false %}
|
|
41
|
+
{% endif %}
|
|
42
|
+
<li class="ons-section-nav__item{% if item.classes %} ' ' + {{ item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
|
|
43
|
+
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
|
|
44
|
+
{% if item.anchors %}
|
|
45
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
|
|
46
|
+
{% for anchor in item.anchors %}
|
|
47
|
+
<li class="ons-section-nav__item ons-list__item">
|
|
48
|
+
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.title }}</a>
|
|
49
|
+
</li>
|
|
50
|
+
{% endfor %}
|
|
51
|
+
</ul>
|
|
52
|
+
{% endif %}
|
|
53
|
+
</li>
|
|
54
|
+
{% endfor %}
|
|
55
|
+
</ul>
|
|
56
|
+
{% endif %}
|
|
24
57
|
</nav>
|
|
25
58
|
{% endmacro %}
|
|
@@ -54,6 +54,44 @@ const EXAMPLE_SECTION_NAVIGATION_VERTICAL = {
|
|
|
54
54
|
],
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
const EXAMPLE_SECTION_NAVIGATION_VERTICAL_WITH_SECTIONS = {
|
|
58
|
+
variants: 'vertical',
|
|
59
|
+
currentPath: '#section-2',
|
|
60
|
+
sections: [
|
|
61
|
+
{
|
|
62
|
+
title: 'Section Title',
|
|
63
|
+
itemsList: [
|
|
64
|
+
{
|
|
65
|
+
title: 'Section 1',
|
|
66
|
+
url: '#section-1',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: 'Section 2',
|
|
70
|
+
url: '#section-2',
|
|
71
|
+
anchors: [
|
|
72
|
+
{
|
|
73
|
+
title: 'Sub section 1',
|
|
74
|
+
url: '#sub-section-1',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: 'Sub section 2',
|
|
78
|
+
url: '#sub-section-2',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: 'Sub section 3',
|
|
82
|
+
url: '#sub-section-3',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: 'Section 3',
|
|
88
|
+
url: '#0',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
|
|
57
95
|
describe('macro: section-navigation', () => {
|
|
58
96
|
describe('variant: horizontal', () => {
|
|
59
97
|
it('passes jest-axe checks', async () => {
|
|
@@ -208,5 +246,31 @@ describe('macro: section-navigation', () => {
|
|
|
208
246
|
expect(itemLinks).toEqual(['#sub-section-1', '#sub-section-2', '#sub-section-3']);
|
|
209
247
|
});
|
|
210
248
|
});
|
|
249
|
+
|
|
250
|
+
describe('Section Items', () => {
|
|
251
|
+
it('passes jest-axe checks', async () => {
|
|
252
|
+
const $ = cheerio.load(renderComponent('section-navigation', EXAMPLE_SECTION_NAVIGATION_VERTICAL_WITH_SECTIONS));
|
|
253
|
+
|
|
254
|
+
const results = await axe($.html());
|
|
255
|
+
expect(results).toHaveNoViolations();
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('renders itemsLists, anchors and heading for each section', () => {
|
|
259
|
+
const $ = cheerio.load(renderComponent('section-navigation', EXAMPLE_SECTION_NAVIGATION_VERTICAL_WITH_SECTIONS));
|
|
260
|
+
|
|
261
|
+
const anchors = mapAll($('.ons-section-nav__sub-items .ons-section-nav__item .ons-section-nav__link'), node => node.text().trim());
|
|
262
|
+
expect(anchors).toEqual(['Sub section 1', 'Sub section 2', 'Sub section 3']);
|
|
263
|
+
|
|
264
|
+
const itemLists = mapAll($('.ons-section-nav__item .ons-section-nav__link'), node => node.text().trim());
|
|
265
|
+
expect(itemLists).toEqual(['Section 1', 'Section 2', 'Sub section 1', 'Sub section 2', 'Sub section 3', 'Section 3']);
|
|
266
|
+
|
|
267
|
+
const headings = mapAll($('h3'), node =>
|
|
268
|
+
$(node)
|
|
269
|
+
.text()
|
|
270
|
+
.trim(),
|
|
271
|
+
);
|
|
272
|
+
expect(headings).toEqual(['Section Title']);
|
|
273
|
+
});
|
|
274
|
+
});
|
|
211
275
|
});
|
|
212
276
|
});
|
|
@@ -3,37 +3,77 @@
|
|
|
3
3
|
onsSectionNavigation({
|
|
4
4
|
"variants": "vertical",
|
|
5
5
|
"id": "section-menu",
|
|
6
|
-
"currentPath": "#section-
|
|
7
|
-
"
|
|
6
|
+
"currentPath": "#section-6",
|
|
7
|
+
"sections":[
|
|
8
8
|
{
|
|
9
|
-
"title": "Section
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
"title": "Section Title",
|
|
10
|
+
"itemsList": [
|
|
11
|
+
{
|
|
12
|
+
"title": "Section 1",
|
|
13
|
+
"url": "#section-1",
|
|
14
|
+
"anchors": [
|
|
15
|
+
{
|
|
16
|
+
"title": "Sub section 1",
|
|
17
|
+
"url": "#sub-section-1"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"title": "Sub section 2",
|
|
21
|
+
"url": "#sub-section-2"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"title": "Sub section 3",
|
|
25
|
+
"url": "#sub-section-3"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
16
29
|
{
|
|
17
|
-
"title": "
|
|
18
|
-
"url": "#
|
|
30
|
+
"title": "Section 2",
|
|
31
|
+
"url": "#section-2"
|
|
19
32
|
},
|
|
20
33
|
{
|
|
21
|
-
"title": "
|
|
22
|
-
"url": "#
|
|
34
|
+
"title": "Section 3",
|
|
35
|
+
"url": "#section-3"
|
|
23
36
|
},
|
|
24
37
|
{
|
|
25
|
-
"title": "
|
|
26
|
-
"url": "#
|
|
38
|
+
"title": "Section 4",
|
|
39
|
+
"url": "#section-4"
|
|
27
40
|
}
|
|
28
41
|
]
|
|
29
42
|
},
|
|
30
43
|
{
|
|
31
|
-
"title": "Section
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
"title": "Section Title",
|
|
45
|
+
"itemsList": [
|
|
46
|
+
{
|
|
47
|
+
"title": "Section 5",
|
|
48
|
+
"url": "#section-5"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"title": "Section 6",
|
|
52
|
+
"url": "#section-6",
|
|
53
|
+
"anchors": [
|
|
54
|
+
{
|
|
55
|
+
"title": "Sub section 1",
|
|
56
|
+
"url": "#sub-section-1"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"title": "Sub section 2",
|
|
60
|
+
"url": "#sub-section-2"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"title": "Sub section 3",
|
|
64
|
+
"url": "#sub-section-3"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"title": "Section 7",
|
|
70
|
+
"url": "#0"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"title": "Section 8",
|
|
74
|
+
"url": "#0"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
37
77
|
}
|
|
38
78
|
]
|
|
39
79
|
})
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import autosize from 'autosize';
|
|
2
|
-
|
|
3
1
|
import domready from '../../js/domready';
|
|
4
2
|
|
|
5
3
|
async function initialise() {
|
|
6
4
|
const limitedInputs = [...document.querySelectorAll('.ons-js-char-limit-input')];
|
|
7
|
-
autosize(document.querySelectorAll('textarea'));
|
|
8
|
-
|
|
9
5
|
if (limitedInputs.length) {
|
|
10
6
|
const CharLimit = (await import('../char-check-limit/character-limit')).default;
|
|
11
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{% from "components/timeout-modal/_macro.njk" import onsTimeoutModal %}
|
|
2
2
|
|
|
3
3
|
{{ onsTimeoutModal({
|
|
4
|
-
"showModalTimeInSeconds":
|
|
4
|
+
"showModalTimeInSeconds": 60,
|
|
5
5
|
"redirectUrl": "#!",
|
|
6
6
|
"title": "You will be signed out soon",
|
|
7
7
|
"textFirstLine": "It appears you have been inactive for a while.",
|