@ons/design-system 70.0.8 → 70.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/access-code/_macro.njk +31 -25
- package/components/access-code/example-access-code-error.njk +49 -37
- package/components/access-code/example-access-code.njk +40 -30
- package/components/accordion/_macro.njk +7 -6
- package/components/accordion/example-accordion-open.njk +0 -1
- package/components/address-input/_macro.njk +23 -11
- package/components/address-input/autosuggest.address.js +0 -5
- package/components/address-input/example-address-input-editable.njk +52 -50
- package/components/address-input/example-address-input-manual.njk +23 -21
- package/components/address-input/example-address-input.njk +40 -38
- package/components/address-output/_macro.njk +6 -6
- package/components/autosuggest/_macro.njk +57 -37
- package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
- package/components/autosuggest/example-autosuggest-country.njk +24 -24
- package/components/back-to-top/example-back-to-top.njk +183 -6
- package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
- package/components/breadcrumbs/_macro.njk +12 -4
- package/components/browser-banner/_macro.njk +6 -3
- package/components/button/_button.scss +36 -1
- package/components/button/_macro.njk +63 -62
- package/components/button/example-button-ghost.njk +1 -0
- package/components/call-to-action/_macro.njk +7 -5
- package/components/call-to-action/example-call-to-action-default.njk +3 -2
- package/components/card/_macro.njk +26 -10
- package/components/card/example-card-set-with-images.njk +31 -29
- package/components/card/example-card-set-with-lists.njk +58 -56
- package/components/card/example-card-set.njk +28 -26
- package/components/card/example-card.njk +9 -7
- package/components/char-check-limit/_macro.njk +1 -3
- package/components/checkboxes/_checkbox-macro.njk +19 -15
- package/components/checkboxes/_macro.njk +81 -72
- package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
- package/components/checkboxes/example-checkboxes-error.njk +0 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
- package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes.njk +7 -5
- package/components/content-pagination/_macro.njk +34 -32
- package/components/content-pagination/example-content-pagination.njk +17 -17
- package/components/cookies-banner/_macro.njk +19 -6
- package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
- package/components/cookies-banner/example-cookies-banner.njk +3 -4
- package/components/date-input/_macro.njk +71 -63
- package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
- package/components/date-input/example-date-input-error.njk +0 -1
- package/components/description-list/_macro.njk +20 -11
- package/components/details/_macro.njk +18 -11
- package/components/details/example-details-with-warning.njk +15 -10
- package/components/document-list/_macro.njk +102 -93
- package/components/document-list/example-document-list-article-featured.njk +27 -25
- package/components/document-list/example-document-list-articles.njk +55 -53
- package/components/document-list/example-document-list-downloads.njk +49 -47
- package/components/document-list/example-document-list-search-result-featured.njk +19 -17
- package/components/document-list/example-document-list-search-results.njk +60 -58
- package/components/duration/_macro.njk +61 -55
- package/components/duration/example-duration-error-for-single-field.njk +28 -26
- package/components/duration/example-duration-single-field.njk +23 -19
- package/components/duration/example-duration.njk +33 -29
- package/components/error/_macro.njk +8 -6
- package/components/external-link/_macro.njk +7 -5
- package/components/external-link/example-external-link.njk +9 -6
- package/components/feedback/_macro.njk +7 -5
- package/components/field/_macro.njk +2 -2
- package/components/fieldset/_macro.njk +23 -16
- package/components/footer/_macro.njk +28 -21
- package/components/footer/_macro.spec.js +1 -1
- package/components/footer/example-footer-cymraeg.njk +2 -1
- package/components/footer/example-footer-default.njk +3 -4
- package/components/footer/example-footer-transactional.njk +2 -1
- package/components/footer/example-footer-warning.njk +2 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
- package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
- package/components/footer/example-footer-with-copyright.njk +2 -1
- package/components/footer/example-footer.njk +2 -1
- package/components/header/_header.scss +24 -19
- package/components/header/_macro.njk +183 -141
- package/components/header/example-header-default.njk +2 -1
- package/components/header/example-header-external-for-survey-with-description.njk +2 -1
- package/components/header/example-header-external-for-surveys.njk +2 -1
- package/components/header/example-header-external-welsh.njk +7 -7
- package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
- package/components/header/example-header-external-with-navigation.njk +2 -1
- package/components/header/example-header-external-with-service-links.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation.njk +3 -2
- package/components/header/example-header-internal.njk +2 -1
- package/components/header/example-header-multiple-logos.njk +2 -1
- package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
- package/components/helpers/grid.njk +17 -16
- package/components/hero/_macro.njk +6 -11
- package/components/hero/example-hero-dark.njk +2 -1
- package/components/hero/example-hero-default.njk +2 -1
- package/components/icon/_macro.njk +601 -168
- package/components/image/_macro.njk +7 -5
- package/components/input/_macro.njk +114 -95
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search-with-placeholder.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_macro.njk +32 -26
- package/components/language-selector/_macro.njk +11 -2
- package/components/list/_list.scss +13 -0
- package/components/list/_macro.njk +93 -73
- package/components/message/_macro.njk +20 -7
- package/components/message-list/_macro.njk +26 -20
- package/components/modal/_macro.njk +11 -12
- package/components/multiple-input-fields/_macro.njk +30 -28
- package/components/mutually-exclusive/_macro.njk +20 -13
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
- package/components/navigation/_macro.njk +133 -67
- package/components/navigation/_navigation.scss +0 -9
- package/components/pagination/_macro.njk +42 -20
- package/components/panel/_macro.njk +27 -16
- package/components/panel/example-panel-bare.njk +6 -4
- package/components/panel/example-panel-with-announcement.njk +7 -4
- package/components/panel/example-panel-with-error-summary.njk +6 -4
- package/components/panel/example-panel-with-warning.njk +5 -3
- package/components/password/_macro.njk +7 -5
- package/components/phase-banner/_macro.njk +3 -3
- package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
- package/components/phase-banner/example-phase-banner-beta.njk +4 -3
- package/components/question/_macro.njk +62 -47
- package/components/question/example-question-ccs.njk +40 -35
- package/components/question/example-question-fieldset.njk +84 -80
- package/components/question/example-question-interviewer-note.njk +27 -24
- package/components/question/example-question-no-fieldset.njk +39 -33
- package/components/quote/_macro.njk +3 -1
- package/components/radios/_macro.njk +54 -36
- package/components/radios/_macro.spec.js +21 -0
- package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
- package/components/radios/example-radios-with-clear-button.njk +6 -4
- package/components/radios/example-radios-with-descriptions.njk +7 -5
- package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
- package/components/radios/example-radios-with-revealed-select.njk +6 -4
- package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
- package/components/radios/example-radios-with-separator.njk +6 -4
- package/components/radios/example-radios-with-visible-text-input.njk +7 -5
- package/components/radios/example-radios-without-border.njk +0 -1
- package/components/radios/example-radios.njk +7 -5
- package/components/related-content/_macro.njk +10 -11
- package/components/related-content/_section-macro.njk +7 -7
- package/components/related-content/example-related-content-general.njk +5 -3
- package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
- package/components/related-content/example-related-content-social-media.njk +40 -38
- package/components/relationships/_macro.njk +10 -8
- package/components/relationships/example-relationships-error.njk +176 -168
- package/components/relationships/example-relationships-you.njk +169 -163
- package/components/relationships/example-relationships.njk +167 -161
- package/components/section-navigation/_macro.njk +34 -12
- package/components/select/_macro.njk +21 -18
- package/components/share-page/_macro.njk +10 -5
- package/components/skip-to-content/_macro.njk +1 -1
- package/components/skip-to-content/example-skip-to-content.njk +1 -0
- package/components/status/_macro.njk +1 -1
- package/components/summary/_macro.njk +53 -23
- package/components/summary/example-summary-household-no-rows.njk +18 -16
- package/components/summary/example-summary-household.njk +75 -73
- package/components/summary/example-summary-hub-minimal.njk +74 -72
- package/components/summary/example-summary-hub.njk +169 -167
- package/components/table/_macro.njk +72 -45
- package/components/table-of-contents/_macro.njk +34 -32
- package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
- package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
- package/components/tabs/_macro.njk +12 -6
- package/components/tabs/example-tabs-details.njk +5 -6
- package/components/text-indent/_macro.njk +1 -3
- package/components/textarea/_macro.njk +49 -46
- package/components/textarea/_macro.spec.js +0 -11
- package/components/timeline/_macro.njk +4 -6
- package/components/timeout-modal/_macro.njk +21 -19
- package/components/timeout-modal/example-timeout-modal.njk +16 -14
- package/components/timeout-panel/_macro.njk +19 -17
- package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
- package/components/upload/_macro.njk +20 -16
- package/components/video/_macro.njk +16 -2
- package/components/video/example-video.njk +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +22 -20
- package/layout/_template.njk +63 -49
- package/package.json +4 -3
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/overrides/hcm.scss +1 -1
- package/scss/vars/_colors.scss +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{%- macro onsImage(params) -%}
|
|
2
2
|
<figure class="ons-image">
|
|
3
3
|
{% if params.image %}
|
|
4
|
-
<img
|
|
4
|
+
<img
|
|
5
|
+
class="ons-image__img"
|
|
6
|
+
{% if params.image.largeSrc %}srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x"{% endif %}src="{{ params.image.smallSrc }}"
|
|
7
|
+
alt="{{ params.alt if params.alt }}"
|
|
8
|
+
/>
|
|
5
9
|
{% else %}
|
|
6
|
-
<img class="ons-image__img" src="{{ params.url }}" alt="{{ params.alt }}"
|
|
10
|
+
<img class="ons-image__img" src="{{ params.url }}" alt="{{ params.alt }}" />
|
|
7
11
|
{% endif %}
|
|
8
12
|
|
|
9
13
|
{% if params.caption %}
|
|
10
|
-
<figcaption class="ons-image__caption">
|
|
11
|
-
{{ params.caption }}
|
|
12
|
-
</figcaption>
|
|
14
|
+
<figcaption class="ons-image__caption">{{ params.caption }}</figcaption>
|
|
13
15
|
{% endif %}
|
|
14
16
|
</figure>
|
|
15
17
|
{%- endmacro -%}
|
|
@@ -18,17 +18,20 @@
|
|
|
18
18
|
{% else %}
|
|
19
19
|
{% set type = "text" %}
|
|
20
20
|
{% endif %}
|
|
21
|
-
|
|
22
|
-
{% set
|
|
23
|
-
{% set inputPlaceholder = ' ons-input--placeholder' if params.accessiblePlaceholder else "" %}
|
|
21
|
+
{% set exclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive %}
|
|
22
|
+
{% set inputPlaceholder = " ons-input--placeholder" if params.accessiblePlaceholder %}
|
|
24
23
|
|
|
25
24
|
{% set input %}
|
|
26
25
|
<input
|
|
27
26
|
type="{{ type }}"
|
|
28
27
|
id="{{ params.id }}"
|
|
29
|
-
class="ons-input ons-input--text ons-input-type__input{
|
|
28
|
+
class="ons-input ons-input--text ons-input-type__input{{ ' ons-input--error' if params.error }}{{ ' ons-search__input' if params.searchButton }}{{ ' ' + params.classes if params.classes else '' }}{% if params.width %}{{ ' ' }}ons-input{% if params.type == 'number' or params.type == 'tel' %}-number{% endif %}--w-{{ params.width }}{% endif %}{{ exclusiveClass }}{{ inputPlaceholder }}"
|
|
30
29
|
{% 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 %}
|
|
30
|
+
{% if params.prefix and params.prefix.id %}
|
|
31
|
+
aria-labelledby="{{ params.id }} {{ params.prefix.id }}"
|
|
32
|
+
{% elif params.suffix and params.suffix.id %}
|
|
33
|
+
aria-labelledby="{{ params.id }} {{ params.suffix.id }}"
|
|
34
|
+
{% endif %}
|
|
32
35
|
{% if params.name %}name="{{ params.name }}"{% endif %}
|
|
33
36
|
{% if params.value %}value="{{ params.value }}"{% endif %}
|
|
34
37
|
{% if params.accept %}accept="{{ params.accept }}"{% endif %}
|
|
@@ -40,80 +43,89 @@
|
|
|
40
43
|
{% if inputmode %}inputmode="{{ inputmode }}"{% endif %}
|
|
41
44
|
{% if params.autocomplete %}autocomplete="{{ params.autocomplete }}"{% endif %}
|
|
42
45
|
{% if params.accessiblePlaceholder %}placeholder="{{ params.label.text }}"{% endif %}
|
|
43
|
-
{% if params.charCheckLimit %}
|
|
46
|
+
{% if params.charCheckLimit %}
|
|
47
|
+
data-char-check-ref="{{ params.id }}-check" data-char-check-num="{{ params.charCheckLimit.limit }}"
|
|
48
|
+
aria-describedby="{{ params.id }}-check"
|
|
49
|
+
{% endif %}
|
|
44
50
|
{% if params.charCheckLimit and params.charCheckLimit.charcheckCountdown %}data-char-check-countdown="true"{% endif %}
|
|
45
|
-
{% 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 %}
|
|
51
|
+
{% 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 %}
|
|
46
52
|
{% if params.label and params.label.description %}{% if params.label.id %}aria-describedby="{{ params.label.id }}-description-hint"{% else %}aria-describedby="description-hint"{% endif %}{% endif %}
|
|
47
53
|
/>
|
|
48
54
|
{% if params.listeners %}
|
|
49
|
-
|
|
50
|
-
{%
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
<!-- prettier-ignore-start -->
|
|
56
|
+
<script {% if csp_nonce %}nonce="{{ csp_nonce() }}"{% endif %}>
|
|
57
|
+
{% for listener, value in (params.listeners.items() if params.listeners is mapping and params.listeners.items else params.listeners) %}
|
|
58
|
+
document.getElementById("{{ params.id }}").addEventListener('{{ listener }}', function(){ {{ value }} });
|
|
59
|
+
{% endfor %}
|
|
53
60
|
</script>
|
|
61
|
+
<!-- prettier-ignore-end -->
|
|
54
62
|
{% endif %}
|
|
55
63
|
{% if params.postTextboxLinkText %}
|
|
56
64
|
<a class="ons-u-fs-s ons-input__post-link" href="{{ params.postTextboxLinkUrl }}">{{ params.postTextboxLinkText }}</a>
|
|
57
65
|
{% endif %}
|
|
58
66
|
{% endset %}
|
|
67
|
+
|
|
59
68
|
{% set field %}
|
|
60
|
-
{% if (not params.accessiblePlaceholder or params.label.description) and (params.label and params.label.text)%}
|
|
61
|
-
{{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
{% if (not params.accessiblePlaceholder or params.label.description) and (params.label and params.label.text) %}
|
|
70
|
+
{{
|
|
71
|
+
onsLabel({
|
|
72
|
+
"for": params.id,
|
|
73
|
+
"id": params.label.id,
|
|
74
|
+
"text": params.label.text,
|
|
75
|
+
"classes": params.label.classes,
|
|
76
|
+
"description": params.label.description,
|
|
77
|
+
"attributes": params.label.attributes,
|
|
78
|
+
"accessiblePlaceholder": params.accessiblePlaceholder,
|
|
79
|
+
"inline": params.label.inline
|
|
80
|
+
})
|
|
81
|
+
}}
|
|
71
82
|
{% endif %}
|
|
72
83
|
|
|
73
84
|
{% if params.prefix or params.suffix %}
|
|
74
85
|
{% if (params.prefix and params.prefix.id) or (params.suffix and params.suffix.id) %}
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<span class="ons-input-type{{ prefixClass }}{% if params.prefix or params.suffix %} ons-js-input-container-abbr{% endif %}">
|
|
86
|
+
<span
|
|
87
|
+
class="ons-input-type{{ ' ons-input-type--prefix' if params.prefix }}{{ ' ons-js-input-container-abbr' if params.prefix or params.suffix }}"
|
|
88
|
+
>
|
|
80
89
|
<span class="ons-input-type__inner">
|
|
81
90
|
{{ input | safe }}
|
|
82
|
-
|
|
83
91
|
{% set abbr = params.prefix or params.suffix %}
|
|
84
92
|
{% if params.prefix.title or params.suffix.title %}
|
|
85
|
-
{% set tag = 'abbr' %}
|
|
93
|
+
{% set tag = '<abbr' %}
|
|
94
|
+
{% set endTag = '</abbr>' %}
|
|
86
95
|
{% else %}
|
|
87
|
-
{% set tag = 'span' %}
|
|
96
|
+
{% set tag = '<span' %}
|
|
97
|
+
{% set endTag = '</span>' %}
|
|
88
98
|
{% endif %}
|
|
89
99
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
>{{ abbr.text }}</{{ tag }}>
|
|
100
|
+
{{ tag | safe }}
|
|
101
|
+
id="{{ abbr.id }}" class="ons-input-type__type ons-js-input-abbr"
|
|
102
|
+
{% if params.prefix or params.suffix %}
|
|
103
|
+
aria-label="{{ abbr.title }}" role="figure"
|
|
104
|
+
{% endif %}
|
|
105
|
+
{% if abbr.title %}title="{{ abbr.title }}"{% endif %}
|
|
106
|
+
>{{ abbr.text }}
|
|
107
|
+
{{ endTag | safe }}
|
|
99
108
|
</span>
|
|
100
109
|
</span>
|
|
101
110
|
{% endif %}
|
|
102
111
|
{% elif params.searchButton %}
|
|
103
|
-
<span class="ons-grid--flex
|
|
112
|
+
<span class="ons-grid--flex ons-input_search-button{{ ' ons-input--with-text-description' if params.label.description }}">
|
|
104
113
|
{% if params.accessiblePlaceholder %}
|
|
105
|
-
{{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
{{
|
|
115
|
+
onsLabel({
|
|
116
|
+
"for": params.id,
|
|
117
|
+
"id": params.label.id,
|
|
118
|
+
"text": params.label.text,
|
|
119
|
+
"classes": params.label.classes,
|
|
120
|
+
"attributes": params.label.attributes,
|
|
121
|
+
"accessiblePlaceholder": params.accessiblePlaceholder,
|
|
122
|
+
"inline": params.label.inline
|
|
123
|
+
})
|
|
124
|
+
}}
|
|
114
125
|
{% endif %}
|
|
115
126
|
|
|
116
127
|
{{ input | safe }}
|
|
128
|
+
|
|
117
129
|
{%- set buttonLabel -%}
|
|
118
130
|
{%- if params.searchButton.visuallyHideButtonText == true -%}
|
|
119
131
|
<span class="ons-u-vh">{{ params.searchButton.text }}</span>
|
|
@@ -121,6 +133,7 @@
|
|
|
121
133
|
{{ params.searchButton.text }}
|
|
122
134
|
{%- endif -%}
|
|
123
135
|
{%- endset -%}
|
|
136
|
+
|
|
124
137
|
{{
|
|
125
138
|
onsButton({
|
|
126
139
|
"type": params.searchButton.type,
|
|
@@ -137,58 +150,62 @@
|
|
|
137
150
|
</span>
|
|
138
151
|
{% else %}
|
|
139
152
|
{% if params.accessiblePlaceholder %}
|
|
140
|
-
<span class="ons-grid--flex
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{{ input | safe }}
|
|
154
|
-
{% if params.accessiblePlaceholder %}
|
|
153
|
+
<span class="ons-grid--flex{{ ' ons-input--with-text-description' if params.label.description }}">
|
|
154
|
+
{{
|
|
155
|
+
onsLabel({
|
|
156
|
+
"for": params.id,
|
|
157
|
+
"id": params.label.id,
|
|
158
|
+
"text": params.label.text,
|
|
159
|
+
"classes": params.label.classes,
|
|
160
|
+
"attributes": params.label.attributes,
|
|
161
|
+
"accessiblePlaceholder": params.accessiblePlaceholder,
|
|
162
|
+
"inline": params.label.inline
|
|
163
|
+
})
|
|
164
|
+
}}
|
|
165
|
+
{{ input | safe }}
|
|
155
166
|
</span>
|
|
167
|
+
{% else %}
|
|
168
|
+
{{ input | safe }}
|
|
156
169
|
{% endif %}
|
|
157
170
|
{% endif %}
|
|
158
171
|
{% endset %}
|
|
159
172
|
|
|
160
173
|
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
161
174
|
{% set charCheckField %}
|
|
162
|
-
{%
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
175
|
+
{%
|
|
176
|
+
call onsCharLimit({
|
|
177
|
+
"id": params.id ~ "-check",
|
|
178
|
+
"limit": params.charCheckLimit.limit,
|
|
179
|
+
"variant": "check",
|
|
180
|
+
"charCountSingular": params.charCheckLimit.charCountSingular,
|
|
181
|
+
"charCountPlural": params.charCheckLimit.charCountPlural,
|
|
182
|
+
"charCountOverLimitSingular": params.charCheckLimit.charCountOverLimitSingular,
|
|
183
|
+
"charCountOverLimitPlural": params.charCheckLimit.charCountOverLimitPlural
|
|
184
|
+
})
|
|
185
|
+
%}
|
|
171
186
|
{{ field | safe }}
|
|
172
187
|
{% endcall %}
|
|
173
188
|
{% endset %}
|
|
174
189
|
{% endif %}
|
|
175
190
|
|
|
176
191
|
{% if params.mutuallyExclusive %}
|
|
177
|
-
{%
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
{%
|
|
193
|
+
call onsMutuallyExclusive({
|
|
194
|
+
"id": params.fieldId,
|
|
195
|
+
"legend": params.legend,
|
|
196
|
+
"legendClasses": params.legendClasses ~ " ons-js-input-legend",
|
|
197
|
+
"description": params.description,
|
|
198
|
+
"dontWrap": params.dontWrap,
|
|
199
|
+
"legendIsQuestionTitle": params.legendIsQuestionTitle,
|
|
200
|
+
"exclusiveOptions": params.mutuallyExclusive.exclusiveOptions,
|
|
201
|
+
"or": params.mutuallyExclusive.or,
|
|
202
|
+
"deselectMessage": params.mutuallyExclusive.deselectMessage,
|
|
203
|
+
"deselectGroupAdjective": params.mutuallyExclusive.deselectGroupAdjective,
|
|
204
|
+
"deselectExclusiveOptionAdjective": params.mutuallyExclusive.deselectExclusiveOptionAdjective,
|
|
205
|
+
"error": params.error,
|
|
206
|
+
"autosuggestResults": params.autosuggestResults
|
|
207
|
+
})
|
|
208
|
+
%}
|
|
192
209
|
{% if charCheckField %}
|
|
193
210
|
{{ charCheckField | safe }}
|
|
194
211
|
{% else %}
|
|
@@ -198,13 +215,15 @@
|
|
|
198
215
|
{% elif type == "hidden" %}
|
|
199
216
|
{{ field | safe }}
|
|
200
217
|
{% else %}
|
|
201
|
-
{%
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
218
|
+
{%
|
|
219
|
+
call onsField({
|
|
220
|
+
"id": params.fieldId,
|
|
221
|
+
"classes": params.fieldClasses,
|
|
222
|
+
"dontWrap": params.dontWrap,
|
|
223
|
+
"error": params.error,
|
|
224
|
+
"inline": params.label.inline if params.label
|
|
225
|
+
})
|
|
226
|
+
%}
|
|
208
227
|
{% if charCheckField %}
|
|
209
228
|
{{ charCheckField | safe }}
|
|
210
229
|
{% else %}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{% macro onsLabel(params) %}
|
|
2
2
|
{% if params.id %}
|
|
3
|
-
{% set
|
|
3
|
+
{% set descriptionId = params.id ~ "-description-hint" %}
|
|
4
4
|
{% else %}
|
|
5
|
-
{% set
|
|
5
|
+
{% set descriptionId = "description-hint" %}
|
|
6
6
|
{% endif %}
|
|
7
7
|
|
|
8
8
|
{% if params.inputType == "checkbox" or params.inputType == "radio" %}
|
|
@@ -11,37 +11,43 @@
|
|
|
11
11
|
{% set isCheckboxOrRadio = false %}
|
|
12
12
|
{% endif %}
|
|
13
13
|
|
|
14
|
-
{
|
|
15
|
-
<span
|
|
16
|
-
|
|
14
|
+
{%- set description -%}
|
|
15
|
+
<span
|
|
16
|
+
{% if isCheckboxOrRadio == false %}id="{{ descriptionId }}"{% endif %}class="ons-label__description{% if params.inputType %}{{ ' ' }}ons-{{ params.inputType }}__label--with-description{% else %}{{ ' ' }}ons-input--with-description{% endif %}"
|
|
17
|
+
>
|
|
18
|
+
{{- params.description -}}
|
|
17
19
|
</span>
|
|
18
|
-
{%- endset
|
|
20
|
+
{%- endset -%}
|
|
21
|
+
|
|
19
22
|
{%- if params.description and params.accessiblePlaceholder -%}
|
|
20
23
|
{{- description | safe -}}
|
|
21
24
|
{%- else -%}
|
|
22
|
-
<label
|
|
23
|
-
class="{% if params.inputType is not defined -%}ons-label{%- endif %}{{- ' ' + params.classes if params.classes else "" -}}{%- if params.description %} ons-label--with-description{%- endif %} {{- ' ons-label--placeholder' if params.accessiblePlaceholder else "" -}}"
|
|
24
|
-
for="{{ params.for }}"
|
|
25
|
-
{% if params.description %}aria-describedby="{{ descriptionID }}"{% endif %}
|
|
26
|
-
{% if params.id %} id="{{ params.id }}"{% endif %}
|
|
27
|
-
{% 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 %}
|
|
28
|
-
>
|
|
29
|
-
|
|
30
|
-
{{- params.text | safe -}}
|
|
31
25
|
|
|
32
26
|
{%- if isCheckboxOrRadio == true -%}
|
|
33
|
-
{%-
|
|
27
|
+
{%- set ariaHiddenDescription -%}
|
|
34
28
|
<span class="ons-label__aria-hidden-description" aria-hidden="true">{{- description | safe -}}</span>
|
|
29
|
+
{%- endset -%}
|
|
30
|
+
|
|
31
|
+
{%- set description -%}
|
|
32
|
+
<span class="ons-label__visually-hidden-description ons-u-vh" id="{{ descriptionId }}">{{- params.description -}}</span>
|
|
33
|
+
{%- endset -%}
|
|
34
|
+
{%- endif -%}
|
|
35
|
+
|
|
36
|
+
<label
|
|
37
|
+
class="{{ 'ons-label' if params.inputType is not defined }}{{ ' ' + params.classes if params.classes else '' }}{{ ' ons-label--with-description' if params.description }}{{ ' ons-label--placeholder' if params.accessiblePlaceholder }}"
|
|
38
|
+
for="{{ params.for }}"
|
|
39
|
+
{% if params.description %}aria-describedby="{{ descriptionId }}"{% endif %}
|
|
40
|
+
{% if params.id %}id="{{ params.id }}"{% endif %}
|
|
41
|
+
{% 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 %}
|
|
42
|
+
>
|
|
43
|
+
{{- params.text | safe -}}
|
|
44
|
+
|
|
45
|
+
{%- if isCheckboxOrRadio == true and params.description -%}
|
|
46
|
+
{{- ariaHiddenDescription | safe -}}
|
|
35
47
|
{%- endif -%}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{%- else -%}
|
|
41
|
-
</label>
|
|
42
|
-
{%- if params.description -%}
|
|
43
|
-
{{- description | safe -}}
|
|
44
|
-
{%- endif -%}
|
|
45
|
-
{%- endif %}
|
|
48
|
+
</label>
|
|
49
|
+
{%- if params.description -%}
|
|
50
|
+
{{- description | safe -}}
|
|
51
|
+
{%- endif -%}
|
|
46
52
|
{%- endif -%}
|
|
47
53
|
{% endmacro %}
|
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
{% set alternativeLanguages = params.languages | rejectattr("current") %}
|
|
3
3
|
{% set languageNumber = params.languages | length %}
|
|
4
4
|
|
|
5
|
-
<ul class="ons-language-links{
|
|
5
|
+
<ul class="ons-language-links{{ ' ons-u-d-no@xxs@m' if languageNumber and languageNumber != 2 }}">
|
|
6
6
|
{% for language in alternativeLanguages %}
|
|
7
7
|
<li class="ons-language-links__item">
|
|
8
|
-
<a
|
|
8
|
+
<a
|
|
9
|
+
href="{{ language.url }}"
|
|
10
|
+
lang="{{ language.ISOCode }}"
|
|
11
|
+
{% if language.attributes %}{% for attribute, value in (language.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
12
|
+
>{% if language.abbrText %}
|
|
13
|
+
<span class="ons-u-d-no@s">{{ language.abbrText }}</span><span class="ons-u-d-no@xxs@s">{{- language.text -}}</span>
|
|
14
|
+
{% else %}
|
|
15
|
+
{{- language.text -}}
|
|
16
|
+
{% endif %}</a
|
|
17
|
+
>
|
|
9
18
|
</li>
|
|
10
19
|
{% endfor %}
|
|
11
20
|
</ul>
|
|
@@ -92,6 +92,19 @@
|
|
|
92
92
|
&--p {
|
|
93
93
|
padding: 0;
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
&--summary {
|
|
97
|
+
list-style: none;
|
|
98
|
+
@extend .ons-u-pl-no;
|
|
99
|
+
.ons-list__item:not(:last-child) {
|
|
100
|
+
@extend .ons-u-bb;
|
|
101
|
+
}
|
|
102
|
+
.ons-list__item {
|
|
103
|
+
@extend .ons-u-pt-s;
|
|
104
|
+
@extend .ons-u-pb-s;
|
|
105
|
+
@extend .ons-u-m-no;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
95
108
|
}
|
|
96
109
|
|
|
97
110
|
@include bp-suffix('ons-list--inline') {
|