@ons/design-system 62.2.4 → 64.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/components/access-code/example-access-code-error.njk +1 -1
- package/components/accordion/_macro.njk +1 -1
- package/components/breadcrumbs/_macro.njk +2 -2
- package/components/breadcrumbs/_macro.spec.js +1 -1
- package/components/button/_macro.njk +1 -1
- package/components/button/_macro.spec.js +6 -6
- package/components/card/_macro.njk +1 -1
- package/components/card/_macro.spec.js +1 -1
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +1 -1
- package/components/char-check-limit/character-check.spec.js +16 -16
- package/components/checkboxes/_macro.njk +3 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
- package/components/collapsible/_macro.spec.js +1 -1
- package/components/content-pagination/_macro.njk +2 -2
- package/components/content-pagination/_macro.spec.js +2 -2
- package/components/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +2 -2
- package/components/details/_macro.njk +1 -1
- package/components/details/_macro.spec.js +1 -1
- package/components/document-list/_macro.njk +1 -1
- package/components/footer/_macro.njk +2 -2
- package/components/footer/_macro.spec.js +7 -7
- package/components/header/_macro.njk +3 -3
- package/components/header/_macro.spec.js +5 -6
- package/components/{icons → icon}/_macro.spec.js +7 -7
- package/components/{images → image}/_macro.spec.js +13 -13
- package/components/{images/example-images-for-regular-screens.njk → image/example-image-for-regular-screens.njk} +1 -1
- package/components/{images/example-images-for-retina-screens.njk → image/example-image-for-retina-screens.njk} +1 -1
- package/components/input/_input.scss +6 -0
- package/components/input/_macro.njk +20 -13
- package/components/input/_macro.spec.js +2 -22
- package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
- package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
- package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
- package/components/{lists → list}/_macro.njk +3 -3
- package/components/{lists → list}/_macro.spec.js +42 -42
- package/components/message/_macro.njk +2 -2
- package/components/message/_macro.spec.js +0 -1
- package/components/metadata/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
- package/components/navigation/_macro.njk +3 -3
- package/components/pagination/_macro.njk +65 -69
- package/components/pagination/_macro.spec.js +18 -16
- package/components/pagination/example-pagination-first.njk +5 -5
- package/components/pagination/example-pagination-last.njk +5 -5
- package/components/pagination/example-pagination-with-no-range-indicator.njk +11 -11
- package/components/pagination/example-pagination.njk +2 -2
- package/components/panel/_macro.njk +2 -2
- package/components/panel/_macro.spec.js +2 -2
- package/components/panel/example-panel-with-error-summary.njk +1 -1
- package/components/phase-banner/_phase-banner.scss +2 -1
- package/components/question/_macro.njk +1 -1
- package/components/question/_macro.spec.js +1 -1
- package/components/quote/_macro.njk +1 -1
- package/components/quote/_macro.spec.js +1 -1
- package/components/related-content/_macro.njk +1 -1
- package/components/related-content/_macro.spec.js +1 -1
- package/components/related-content/example-related-content-general.njk +1 -1
- package/components/relationships/example-relationships-error.njk +1 -1
- package/components/section-navigation/_macro.njk +2 -2
- package/components/select/_macro.njk +1 -2
- package/components/share-page/_macro.njk +1 -1
- package/components/share-page/_macro.spec.js +5 -5
- package/components/summary/_macro.njk +5 -6
- package/components/summary/_macro.spec.js +8 -23
- package/components/summary/example-summary-grouped-total.njk +0 -2
- package/components/summary/example-summary-grouped-with-errors.njk +0 -4
- package/components/summary/example-summary-grouped.njk +0 -19
- package/components/summary/example-summary-household.njk +0 -5
- package/components/summary/example-summary-hub.njk +0 -8
- package/components/summary/example-summary-multiple.njk +0 -4
- package/components/summary/example-summary.njk +0 -4
- package/components/table/_macro.njk +4 -4
- package/components/table/_macro.spec.js +17 -1
- package/components/table/example-table-basic.njk +1 -2
- package/components/table/example-table-numeric.njk +6 -3
- package/components/table-of-contents/_macro.njk +1 -1
- package/components/table-of-contents/_macro.spec.js +2 -2
- package/components/tabs/_macro.njk +6 -5
- package/components/tabs/_macro.spec.js +25 -2
- package/components/tabs/_tabs.scss +11 -15
- package/components/tabs/example-tabs.njk +6 -6
- package/components/tabs/tabs.js +24 -8
- package/components/tabs/tabs.spec.js +40 -2
- package/components/textarea/_macro.njk +2 -2
- package/components/textarea/_macro.spec.js +2 -2
- package/components/textarea/textarea.spec.js +6 -10
- package/components/timeline/_macro.njk +1 -1
- package/components/timeline/_macro.spec.js +1 -1
- package/css/main.css +3 -3
- package/css/print.css +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/main.scss +3 -4
- package/components/search/_macro.njk +0 -30
- package/components/search/_macro.spec.js +0 -69
- package/components/search/_search.scss +0 -9
- /package/components/{icons/_icons.scss → icon/_icon.scss} +0 -0
- /package/components/{icons → icon}/_macro.njk +0 -0
- /package/components/{images/_images.scss → image/_image.scss} +0 -0
- /package/components/{images → image}/_macro.njk +0 -0
- /package/components/{lists → list}/_list.scss +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% macro onsMetadata(params) %}
|
|
2
2
|
<dl class="ons-metadata ons-metadata__list ons-grid ons-grid--gutterless ons-u-cf{{ (' ' + params.classes) if params.classes }}"{% if params.id %} id="{{ params.id }}" {% endif %}{% if params.metadataLabel %} title="{{ params.metadataLabel }}" aria-label="{{ params.metadataLabel }}"{% endif %}>
|
|
3
|
-
{% for item in
|
|
3
|
+
{% for item in params.itemsList %}
|
|
4
4
|
{% if item.term | length %}
|
|
5
5
|
<dt class="ons-metadata__term ons-grid__col ons-col-{{ params.termCol }}@m">{{ item.term }}</dt>
|
|
6
6
|
{% endif %}
|
|
@@ -63,7 +63,7 @@ describe('script: mutually-exclusive', () => {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
it('then the characters remaining readout should be reset', async () => {
|
|
66
|
-
const limitText = await page.$eval('#feedback-lim
|
|
66
|
+
const limitText = await page.$eval('#feedback-lim', node => node.textContent);
|
|
67
67
|
expect(limitText).toBe('You have 200 characters remaining');
|
|
68
68
|
});
|
|
69
69
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
{% endif %}
|
|
41
41
|
<nav class="ons-navigation ons-navigation--main ons-js-navigation" id="{{ params.navigation.id }}" aria-label="{{ params.navigation.ariaLabel | default("Main menu") }}" data-analytics="header-navigation">
|
|
42
42
|
<ul class="ons-navigation__list">
|
|
43
|
-
{% for item in
|
|
43
|
+
{% for item in params.navigation.itemsList %}
|
|
44
44
|
<li class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}">
|
|
45
45
|
<a class="ons-navigation__link" href="{{ item.url }}" {% if item.id %}id="{{ item.id }}" {% endif %}{% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %}>{{ item.title }}</a>
|
|
46
46
|
</li>
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<nav class="ons-navigation ons-navigation--sub ons-u-d-no@xxs@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes }}" id="{{ params.navigation.subNavigation.id }}" aria-label="{{ params.navigation.subNavigation.ariaLabel | default("Section menu") }}" data-analytics="header-section-navigation">
|
|
54
54
|
<div class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}">
|
|
55
55
|
<ul class="ons-navigation__list ons-navigation__list">
|
|
56
|
-
{% for item in
|
|
56
|
+
{% for item in params.navigation.subNavigation.itemsList %}
|
|
57
57
|
<li class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}">
|
|
58
58
|
<a class="ons-navigation__link ons-navigation__link" href="{{ item.url }}" {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %} {% if item.id %}id="{{ item.id }}" {% endif %}>{{ item.title }}</a>
|
|
59
59
|
</li>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<li class="ons-navigation__item">
|
|
80
80
|
<a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewURL }}">{{ params.navigation.subNavigation.overviewText | default('Overview') }}</a>
|
|
81
81
|
</li>
|
|
82
|
-
{% for item in
|
|
82
|
+
{% for item in params.navigation.subNavigation.itemsList %}
|
|
83
83
|
<li class="ons-navigation__item {{ ' ons-navigation__item--active' if (item.url == params.navigation.subNavigation.currentPath) or (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}">
|
|
84
84
|
<a class="ons-navigation__link" href="{{ item.url }}" {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %} {% if item.id %}id="{{ item.id }}--mobile" {% endif %}>{{ item.title }}</a>
|
|
85
85
|
{% if item.sections %}
|
|
@@ -1,72 +1,68 @@
|
|
|
1
1
|
{% macro onsPagination(params) %}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
{% set currentPageIndex = params.currentPageNumber|int %}
|
|
3
|
+
{% set totalPages = params.pages | length|int %}
|
|
4
|
+
{% set position = "Page " ~ currentPageIndex ~ " of " ~ totalPages %}
|
|
5
|
+
{% set lastPage = params.pages | last %}
|
|
6
|
+
{% set firstPage = params.pages | first %}
|
|
7
|
+
{% set prevPageIndex = currentPageIndex - 1 %}
|
|
8
|
+
{% set nextPageIndex = currentPageIndex + 1 %}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a>
|
|
68
|
-
</li>
|
|
69
|
-
{% endif %}
|
|
70
|
-
</ul>
|
|
71
|
-
</nav>
|
|
10
|
+
<nav class="ons-pagination {{ params.classes }}{% if params.hideRangeIndicator %} ons-pagination--no-indicator{% endif %}" aria-label="Pagination ({{ position }})">
|
|
11
|
+
<div class="ons-pagination__position">{{ position }}</div>
|
|
12
|
+
<ul class="ons-pagination__items">
|
|
13
|
+
{% if currentPageIndex != 1 %}
|
|
14
|
+
{% set prevPageIndex = currentPageIndex - 2 %}
|
|
15
|
+
<li class="ons-pagination__item ons-pagination__item--previous">
|
|
16
|
+
<a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a>
|
|
17
|
+
</li>
|
|
18
|
+
{% endif %}
|
|
19
|
+
{% if currentPageIndex > 2 %}
|
|
20
|
+
<li class="ons-pagination__item{% if (currentPageIndex == 1) %} ons-pagination__item--current{% endif %}">
|
|
21
|
+
<a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a>
|
|
22
|
+
</li>
|
|
23
|
+
{% endif %}
|
|
24
|
+
{% if currentPageIndex > 4 %}
|
|
25
|
+
<li class="ons-pagination__item ons-pagination__item--gap">…</li>
|
|
26
|
+
{% endif %}
|
|
27
|
+
{% for page in params.pages %}
|
|
28
|
+
{% set showPage = false %}
|
|
29
|
+
{# Show the current, next and previous page
|
|
30
|
+
Show page 2 if the current page index is within the first 4 pages
|
|
31
|
+
Show the penultimate page if the current page index is within the last 4 pages #}
|
|
32
|
+
{% if (loop.index == currentPageIndex) or (loop.index == currentPageIndex + 1) or (loop.index == currentPageIndex - 1) or (loop.index == 2 and currentPageIndex <= 4) or ((loop.index == totalPages - 1) and (currentPageIndex > totalPages - 4)) %}
|
|
33
|
+
{% set showPage = true %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
{% if showPage == true %}
|
|
36
|
+
<li class="ons-pagination__item{% if loop.index == currentPageIndex %} ons-pagination__item--current{% endif %}">
|
|
37
|
+
<a href="{{ page.url }}" class="ons-pagination__link"
|
|
38
|
+
{%- if loop.index == currentPageIndex -%}
|
|
39
|
+
aria-current="true" aria-label="Current page ({{ position }})"
|
|
40
|
+
{%- else -%}
|
|
41
|
+
aria-label="Go to page {{ loop.index }}"
|
|
42
|
+
{%- endif -%}
|
|
43
|
+
{%- if loop.index == currentPageIndex - 1 -%}
|
|
44
|
+
rel="prev"
|
|
45
|
+
{%- endif -%}
|
|
46
|
+
{%- if loop.index == currentPageIndex + 1 -%}
|
|
47
|
+
rel="next"
|
|
48
|
+
{%- endif -%}
|
|
49
|
+
>{{ loop.index }}</a>
|
|
50
|
+
</li>
|
|
51
|
+
{% endif %}
|
|
52
|
+
{% endfor %}
|
|
53
|
+
{% if currentPageIndex < totalPages - 3 %}
|
|
54
|
+
<li class="ons-pagination__item ons-pagination__item--gap">…</li>
|
|
55
|
+
{% endif %}
|
|
56
|
+
{% if currentPageIndex < totalPages - 1 %}
|
|
57
|
+
<li class="ons-pagination__item{% if currentPageIndex == totalPages %} ons-pagination__item--current{% endif %}">
|
|
58
|
+
<a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})">{{ totalPages }}</a>
|
|
59
|
+
</li>
|
|
60
|
+
{% endif %}
|
|
61
|
+
{% if totalPages > 1 and totalPages != currentPageIndex %}
|
|
62
|
+
<li class="ons-pagination__item ons-pagination__item--next">
|
|
63
|
+
<a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a>
|
|
64
|
+
</li>
|
|
65
|
+
{% endif %}
|
|
66
|
+
</ul>
|
|
67
|
+
</nav>
|
|
72
68
|
{% endmacro %}
|
|
@@ -12,7 +12,8 @@ const PAGINATION_PREV_NEXT_LABELS = {
|
|
|
12
12
|
|
|
13
13
|
const EXAMPLE_PAGINATION_MINIMAL = {
|
|
14
14
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
15
|
-
|
|
15
|
+
currentPageNumber: 1,
|
|
16
|
+
pages: [{ url: '/page/1' }],
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
describe('macro: pagination', () => {
|
|
@@ -54,7 +55,8 @@ describe('macro: pagination', () => {
|
|
|
54
55
|
const $ = cheerio.load(
|
|
55
56
|
renderComponent('pagination', {
|
|
56
57
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
57
|
-
|
|
58
|
+
currentPageNumber: 1,
|
|
59
|
+
pages: [{ url: '/page/1' }],
|
|
58
60
|
}),
|
|
59
61
|
);
|
|
60
62
|
|
|
@@ -85,7 +87,8 @@ describe('macro: pagination', () => {
|
|
|
85
87
|
const $ = cheerio.load(
|
|
86
88
|
renderComponent('pagination', {
|
|
87
89
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
88
|
-
|
|
90
|
+
currentPageNumber: 1,
|
|
91
|
+
pages: [{ url: '/page/1' }, { url: '/page/2' }],
|
|
89
92
|
}),
|
|
90
93
|
);
|
|
91
94
|
|
|
@@ -118,7 +121,8 @@ describe('macro: pagination', () => {
|
|
|
118
121
|
const $ = cheerio.load(
|
|
119
122
|
renderComponent('pagination', {
|
|
120
123
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
121
|
-
|
|
124
|
+
currentPageNumber: 2,
|
|
125
|
+
pages: [{ url: '/page/1' }, { url: '/page/2' }],
|
|
122
126
|
}),
|
|
123
127
|
);
|
|
124
128
|
|
|
@@ -151,7 +155,8 @@ describe('macro: pagination', () => {
|
|
|
151
155
|
const $ = cheerio.load(
|
|
152
156
|
renderComponent('pagination', {
|
|
153
157
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
154
|
-
|
|
158
|
+
currentPageNumber: 2,
|
|
159
|
+
pages: [{ url: '/page/1' }, { url: '/page/2' }, { url: '/page/3' }],
|
|
155
160
|
}),
|
|
156
161
|
);
|
|
157
162
|
|
|
@@ -186,7 +191,8 @@ describe('macro: pagination', () => {
|
|
|
186
191
|
const $ = cheerio.load(
|
|
187
192
|
renderComponent('pagination', {
|
|
188
193
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
189
|
-
|
|
194
|
+
currentPageNumber: 2,
|
|
195
|
+
pages: [{ url: '/page/1' }, { url: '/page/2' }, { url: '/page/3' }, { url: '/page/4' }, { url: '/page/5' }],
|
|
190
196
|
}),
|
|
191
197
|
);
|
|
192
198
|
|
|
@@ -223,14 +229,8 @@ describe('macro: pagination', () => {
|
|
|
223
229
|
const $ = cheerio.load(
|
|
224
230
|
renderComponent('pagination', {
|
|
225
231
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
{ url: '/page/2', current: true },
|
|
229
|
-
{ url: '/page/3' },
|
|
230
|
-
{ url: '/page/4' },
|
|
231
|
-
{ url: '/page/5' },
|
|
232
|
-
{ url: '/page/6' },
|
|
233
|
-
],
|
|
232
|
+
currentPageNumber: 2,
|
|
233
|
+
pages: [{ url: '/page/1' }, { url: '/page/2' }, { url: '/page/3' }, { url: '/page/4' }, { url: '/page/5' }, { url: '/page/6' }],
|
|
234
234
|
}),
|
|
235
235
|
);
|
|
236
236
|
|
|
@@ -267,12 +267,13 @@ describe('macro: pagination', () => {
|
|
|
267
267
|
const $ = cheerio.load(
|
|
268
268
|
renderComponent('pagination', {
|
|
269
269
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
270
|
+
currentPageNumber: 5,
|
|
270
271
|
pages: [
|
|
271
272
|
{ url: '/page/1' },
|
|
272
273
|
{ url: '/page/2' },
|
|
273
274
|
{ url: '/page/3' },
|
|
274
275
|
{ url: '/page/4' },
|
|
275
|
-
{ url: '/page/5'
|
|
276
|
+
{ url: '/page/5' },
|
|
276
277
|
{ url: '/page/6' },
|
|
277
278
|
{ url: '/page/7' },
|
|
278
279
|
{ url: '/page/8' },
|
|
@@ -318,6 +319,7 @@ describe('macro: pagination', () => {
|
|
|
318
319
|
const $ = cheerio.load(
|
|
319
320
|
renderComponent('pagination', {
|
|
320
321
|
...PAGINATION_PREV_NEXT_LABELS,
|
|
322
|
+
currentPageNumber: 10,
|
|
321
323
|
pages: [
|
|
322
324
|
{ url: '/page/1' },
|
|
323
325
|
{ url: '/page/2' },
|
|
@@ -328,7 +330,7 @@ describe('macro: pagination', () => {
|
|
|
328
330
|
{ url: '/page/7' },
|
|
329
331
|
{ url: '/page/8' },
|
|
330
332
|
{ url: '/page/9' },
|
|
331
|
-
{ url: '/page/10'
|
|
333
|
+
{ url: '/page/10' },
|
|
332
334
|
{ url: '/page/11' },
|
|
333
335
|
],
|
|
334
336
|
}),
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
"previous": "Previous",
|
|
6
6
|
"next": "Next",
|
|
7
7
|
"hideRangeIndicator": true,
|
|
8
|
+
"currentPageNumber": 1,
|
|
8
9
|
"pages": [
|
|
9
10
|
{
|
|
10
|
-
"url": "#
|
|
11
|
-
"current": true
|
|
11
|
+
"url": "#0"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"url": "#
|
|
14
|
+
"url": "#0"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"url": "#
|
|
17
|
+
"url": "#0"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
"url": "#
|
|
20
|
+
"url": "#0"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
})
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
"previous": "Previous",
|
|
6
6
|
"next": "Next",
|
|
7
7
|
"hideRangeIndicator": true,
|
|
8
|
+
"currentPageNumber": 4,
|
|
8
9
|
"pages": [
|
|
9
10
|
{
|
|
10
|
-
"url": "#
|
|
11
|
+
"url": "#0"
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
|
-
"url": "#
|
|
14
|
+
"url": "#0"
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
|
-
"url": "#
|
|
17
|
+
"url": "#0"
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
|
-
"url": "#
|
|
20
|
-
"current": true
|
|
20
|
+
"url": "#0"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
})
|
|
@@ -5,37 +5,37 @@
|
|
|
5
5
|
"previous": "Previous",
|
|
6
6
|
"next": "Next",
|
|
7
7
|
"hideRangeIndicator": true,
|
|
8
|
+
"currentPageNumber": 5,
|
|
8
9
|
"pages": [
|
|
9
10
|
{
|
|
10
|
-
"url": "#
|
|
11
|
+
"url": "#0"
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
|
-
"url": "#
|
|
14
|
+
"url": "#0"
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
|
-
"url": "#
|
|
17
|
+
"url": "#0"
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
|
-
"url": "#
|
|
20
|
+
"url": "#0"
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
"url": "#
|
|
23
|
-
"current": true
|
|
23
|
+
"url": "#0"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
"url": "#
|
|
26
|
+
"url": "#0"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"url": "#
|
|
29
|
+
"url": "#0"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
"url": "#
|
|
32
|
+
"url": "#0"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
"url": "#
|
|
35
|
+
"url": "#0"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
"url": "#
|
|
38
|
+
"url": "#0"
|
|
39
39
|
}
|
|
40
40
|
]
|
|
41
41
|
})
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{% endif %}
|
|
40
40
|
|
|
41
41
|
{% if params.type == "announcement" %}
|
|
42
|
-
{% from "components/
|
|
42
|
+
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
43
43
|
<span class="ons-panel__icon" aria-hidden="true">
|
|
44
44
|
{{
|
|
45
45
|
onsIcon({
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
{% endif %}
|
|
71
71
|
|
|
72
72
|
{% if params.iconType %}
|
|
73
|
-
{% from "components/
|
|
73
|
+
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
74
74
|
<span class= "ons-panel__icon ons-u-fs-{{ params.iconSize | default('r') }}">
|
|
75
75
|
{{
|
|
76
76
|
onsIcon({
|
|
@@ -313,7 +313,7 @@ describe('macro: panel', () => {
|
|
|
313
313
|
|
|
314
314
|
it('has `arrow-forward` icon', () => {
|
|
315
315
|
const faker = templateFaker();
|
|
316
|
-
const iconsSpy = faker.spy('
|
|
316
|
+
const iconsSpy = faker.spy('icon');
|
|
317
317
|
|
|
318
318
|
faker.renderComponent('panel', {
|
|
319
319
|
...EXAMPLE_PANEL_BASIC,
|
|
@@ -385,7 +385,7 @@ describe('macro: panel', () => {
|
|
|
385
385
|
|
|
386
386
|
it('has a custom icon `iconType`', () => {
|
|
387
387
|
const faker = templateFaker();
|
|
388
|
-
const iconsSpy = faker.spy('
|
|
388
|
+
const iconsSpy = faker.spy('icon');
|
|
389
389
|
|
|
390
390
|
faker.renderComponent('panel', {
|
|
391
391
|
...EXAMPLE_PANEL_BASIC,
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
{% if item.listLeadingLine %}
|
|
53
53
|
<p class="ons-question-guidance__list-leading-line">{{ item.listLeadingLine }}</p>
|
|
54
54
|
{% endif %}
|
|
55
|
-
{% from "components/
|
|
55
|
+
{% from "components/list/_macro.njk" import onsList %}
|
|
56
56
|
{{
|
|
57
57
|
onsList({
|
|
58
58
|
"itemsList": item.itemsList
|
|
@@ -239,7 +239,7 @@ describe('macro: question', () => {
|
|
|
239
239
|
|
|
240
240
|
it('outputs the expected list', () => {
|
|
241
241
|
const faker = templateFaker();
|
|
242
|
-
const listSpy = faker.spy('
|
|
242
|
+
const listSpy = faker.spy('list');
|
|
243
243
|
|
|
244
244
|
faker.renderComponent('question', EXAMPLE_QUESTION_GUIDANCE);
|
|
245
245
|
|
|
@@ -111,7 +111,7 @@ describe('macro: related-content', () => {
|
|
|
111
111
|
|
|
112
112
|
it('renders the expected list items using the list macro', () => {
|
|
113
113
|
const faker = templateFaker();
|
|
114
|
-
const listsSpy = faker.spy('
|
|
114
|
+
const listsSpy = faker.spy('list');
|
|
115
115
|
|
|
116
116
|
faker.renderComponent('related-content', EXAMPLE_RELATED_CONTENT_LINKS);
|
|
117
117
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% from "components/related-content/_macro.njk" import onsRelatedContent %}
|
|
2
2
|
{% from "components/related-content/_section-macro.njk" import onsRelatedContentSection %}
|
|
3
|
-
{% from "components/
|
|
3
|
+
{% from "components/list/_macro.njk" import onsList %}
|
|
4
4
|
|
|
5
5
|
{% call onsRelatedContent({
|
|
6
6
|
"ariaLabel": 'Related content'
|
|
@@ -6,7 +6,7 @@ layout: ~
|
|
|
6
6
|
{% from "components/question/_macro.njk" import onsQuestion %}
|
|
7
7
|
{% from "components/relationships/_macro.njk" import onsRelationships %}
|
|
8
8
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
9
|
-
{% from "components/
|
|
9
|
+
{% from "components/list/_macro.njk" import onsList %}
|
|
10
10
|
|
|
11
11
|
{% set pageConfig = {
|
|
12
12
|
"header": {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
{% if section.title %}
|
|
7
7
|
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ section.title }}</h3>{% endif %}
|
|
8
8
|
<ul class="ons-section-nav__list">
|
|
9
|
-
{% for item in
|
|
9
|
+
{% for item in section.itemsList %}
|
|
10
10
|
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
|
|
11
11
|
{% set isCurrent = true %}
|
|
12
12
|
{% else %}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h3>
|
|
34
34
|
{% endif %}
|
|
35
35
|
<ul class="ons-section-nav__list">
|
|
36
|
-
{% for item in
|
|
36
|
+
{% for item in params.itemsList %}
|
|
37
37
|
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
|
|
38
38
|
{% set isCurrent = true %}
|
|
39
39
|
{% else %}
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
id="{{ params.id }}"
|
|
23
23
|
name="{{ params.name }}"
|
|
24
24
|
class="ons-input ons-input--select{% if params.classes %} {{ params.classes }}{% endif %}{% if params.error %} ons-input--error{% endif %}"
|
|
25
|
-
{% if params.value %}value="{{ params.value}}" {% endif %}
|
|
26
25
|
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
|
|
27
26
|
>
|
|
28
27
|
{% for option in params.options %}
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
{% if option.id %}id="{{ option.id }}" {% endif %}
|
|
31
30
|
{% if option.selected %}selected {% endif %}
|
|
32
31
|
{% if option.disabled %}disabled {% endif %}
|
|
33
|
-
{% if
|
|
32
|
+
{% if option.attributes %}{% for attribute, value in option.attributes %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
34
33
|
>
|
|
35
34
|
{{- option.text -}}
|
|
36
35
|
</option>
|