@ons/design-system 55.1.0 → 55.2.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/_macro.njk +3 -3
- package/components/accordion/_macro.njk +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-output/_macro.njk +7 -7
- package/components/autosuggest/_macro.njk +19 -19
- package/components/breadcrumbs/_macro.njk +3 -3
- package/components/button/_button.scss +1 -1
- package/components/button/_macro.njk +24 -24
- package/components/call-to-action/_macro.njk +1 -1
- package/components/card/_macro.njk +10 -10
- package/components/checkboxes/_checkbox-macro.njk +9 -9
- package/components/checkboxes/_macro.njk +10 -10
- package/components/checkboxes/checkbox-with-fieldset.js +6 -5
- package/components/checkboxes/checkboxes.dom.js +6 -9
- package/components/code-highlight/_macro.njk +1 -1
- package/components/collapsible/_macro.njk +7 -7
- package/components/date-input/_macro.njk +5 -5
- package/components/document-list/_macro.njk +29 -29
- package/components/duration/_macro.njk +9 -9
- package/components/duration/_macro.spec.js +0 -3
- package/components/error/_macro.njk +1 -1
- package/components/external-link/_macro.njk +1 -1
- package/components/feedback/_macro.njk +2 -2
- package/components/field/_macro.njk +5 -5
- package/components/fieldset/_macro.njk +8 -8
- package/components/footer/_macro.njk +17 -17
- package/components/header/_macro.njk +33 -33
- package/components/hero/_macro.njk +15 -15
- package/components/icons/_macro.njk +2 -2
- package/components/images/_macro.njk +3 -3
- package/components/input/_input-type.scss +4 -0
- package/components/input/_macro.njk +40 -34
- package/components/input/_macro.spec.js +64 -59
- package/components/label/_macro.njk +1 -1
- package/components/language-selector/_macro.njk +1 -1
- package/components/lists/_macro.njk +22 -22
- package/components/message/_macro.njk +6 -6
- package/components/message-list/_macro.njk +1 -1
- package/components/metadata/_macro.njk +2 -2
- package/components/modal/_macro.njk +4 -4
- package/components/mutually-exclusive/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.js +3 -1
- package/components/navigation/_macro.njk +8 -8
- package/components/pagination/_macro.njk +3 -3
- package/components/panel/_macro.njk +37 -39
- package/components/panel/_macro.spec.js +1 -13
- package/components/promotional-banner/_macro.njk +2 -2
- package/components/question/_macro.njk +18 -18
- package/components/quote/_macro.njk +2 -2
- package/components/radios/_macro.njk +8 -8
- package/components/radios/check-radios.js +5 -1
- package/components/related-content/_macro.njk +2 -2
- package/components/relationships/_macro.njk +2 -2
- package/components/section-navigation/_macro.njk +2 -2
- package/components/select/_macro.njk +8 -8
- package/components/share-page/_macro.njk +2 -2
- package/components/status/_macro.njk +2 -2
- package/components/summary/_macro.njk +25 -25
- package/components/table/_macro.njk +10 -10
- package/components/table-of-contents/_macro.njk +4 -4
- package/components/textarea/_macro.njk +8 -8
- package/components/timeline/_macro.njk +1 -1
- package/components/video/_macro.njk +1 -1
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/layout/_template.njk +35 -35
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
{% set title_tag = "h1" if params.titleAsH1 else "div" %}
|
|
8
8
|
{% set currentLanguageISOCode = "en" %}
|
|
9
9
|
|
|
10
|
-
{% if params.language
|
|
10
|
+
{% if params.language and params.language.languages %}
|
|
11
11
|
{% set currentLanguage = params.language.languages | selectattr("current") | first %}
|
|
12
12
|
{% set currentLanguageISOCode = currentLanguage.ISOCode %}
|
|
13
13
|
{% endif %}
|
|
14
14
|
|
|
15
|
-
<header class="ons-header {% if params.classes
|
|
15
|
+
<header class="ons-header {% if params.classes %} {{ params.classes }}{% endif %}{% if params.variants is not string %}{% for variant in params.variants %} ons-header--{{ variant }}{% endfor %}{% else %} ons-header--{{ params.variants }}{% endif %}" role="banner">
|
|
16
16
|
{{
|
|
17
17
|
onsBrowserBanner({
|
|
18
18
|
"lang": currentLanguageISOCode,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"fullWidth": params.fullWidth
|
|
21
21
|
})
|
|
22
22
|
}}
|
|
23
|
-
{% if params.phase
|
|
23
|
+
{% if params.phase %}
|
|
24
24
|
{% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
|
|
25
25
|
{{ onsPhaseBanner({
|
|
26
26
|
"fullWidth": params.fullWidth,
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
{% if params.noMasthead != true %}
|
|
34
34
|
<div class="ons-header__top">
|
|
35
35
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
36
|
-
<div class="ons-header__grid-top ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap{{ ' ons-header__grid-top-tall' if params.customHeaderLogo
|
|
36
|
+
<div class="ons-header__grid-top ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap{{ ' ons-header__grid-top-tall' if params.customHeaderLogo }}">
|
|
37
37
|
<div class="ons-grid__col ons-col-auto">
|
|
38
|
-
{%-if params.orgLogoHref
|
|
38
|
+
{%-if params.orgLogoHref %}
|
|
39
39
|
<a class="ons-header__org-logo-link" href="{{ params.orgLogoHref }}">
|
|
40
40
|
{% endif -%}
|
|
41
41
|
<div class="ons-header__org-logo ons-header__org-logo--large">
|
|
@@ -55,20 +55,20 @@
|
|
|
55
55
|
})
|
|
56
56
|
}}
|
|
57
57
|
</div>
|
|
58
|
-
{% if params.orgLogoHref
|
|
58
|
+
{% if params.orgLogoHref %}
|
|
59
59
|
</a>
|
|
60
60
|
{% endif %}
|
|
61
61
|
</div>
|
|
62
|
-
{% if params.language
|
|
62
|
+
{% if params.language or params.serviceLinks %}
|
|
63
63
|
<div class="ons-header__links ons-grid__col ons-col-auto">
|
|
64
|
-
{% if params.language
|
|
65
|
-
<div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks
|
|
64
|
+
{% if params.language %}
|
|
65
|
+
<div class="ons-grid__col ons-col-auto {{ ' ons-u-mr-s ons-u-d-no@xxs@xs' if params.serviceLinks else '' }}">
|
|
66
66
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
67
67
|
{{ onsLanguageSelector(params.language) }}
|
|
68
68
|
</div>
|
|
69
69
|
{% endif %}
|
|
70
|
-
{% if params.serviceLinks
|
|
71
|
-
{% if params.serviceLinks.itemsList | length == 1 and params.language
|
|
70
|
+
{% if params.serviceLinks %}
|
|
71
|
+
{% if params.serviceLinks.itemsList | length == 1 and params.language %}
|
|
72
72
|
{% set breakpoint = 'xs' %}
|
|
73
73
|
{% set controlVisibility = true %}
|
|
74
74
|
{% elif params.serviceLinks.itemsList | length > 1 %}
|
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
<ul class="ons-header-service-nav__list">
|
|
83
83
|
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
84
84
|
<li class="ons-header-service-nav__item">
|
|
85
|
-
{% if item.iconType
|
|
85
|
+
{% if item.iconType %}
|
|
86
86
|
{{
|
|
87
87
|
onsIcon({
|
|
88
88
|
"iconType": item.iconType
|
|
89
89
|
})
|
|
90
90
|
}}
|
|
91
91
|
{% endif %}
|
|
92
|
-
{% if item.url
|
|
92
|
+
{% if item.url %}
|
|
93
93
|
<a
|
|
94
94
|
href="{{ item.url }}"
|
|
95
95
|
class="ons-header-service-nav__link"
|
|
96
|
-
{% if item.id
|
|
96
|
+
{% if item.id %} id="{{ item.id }}"{% endif %}
|
|
97
97
|
>{{ item.title }}</a>
|
|
98
98
|
{% else %}
|
|
99
99
|
{{ item.title }}
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
</ul>
|
|
104
104
|
</nav>
|
|
105
105
|
</div>
|
|
106
|
-
{% if params.serviceLinks.itemsList | length > 1
|
|
106
|
+
{% if params.serviceLinks.itemsList | length > 1 or params.language %}
|
|
107
107
|
{% if params.variants == 'internal' or params.variants == 'neutral' %}
|
|
108
108
|
{% set buttonVariant = ["text-link", "text-link-inverse"] %}
|
|
109
109
|
{% else %}
|
|
@@ -129,30 +129,30 @@
|
|
|
129
129
|
{% endif %}
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
|
-
{% if params.serviceLinks
|
|
132
|
+
{% if params.serviceLinks %}
|
|
133
133
|
<nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
134
134
|
<ul class="ons-header-service-nav__list">
|
|
135
135
|
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
136
136
|
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
137
|
-
{% if item.iconType
|
|
137
|
+
{% if item.iconType %}
|
|
138
138
|
{{
|
|
139
139
|
onsIcon({
|
|
140
140
|
"iconType": item.iconType
|
|
141
141
|
})
|
|
142
142
|
}}
|
|
143
143
|
{% endif %}
|
|
144
|
-
{% if item.url
|
|
144
|
+
{% if item.url %}
|
|
145
145
|
<a
|
|
146
146
|
href="{{ item.url }}"
|
|
147
147
|
class="ons-header-service-nav__link"
|
|
148
|
-
{% if item.id
|
|
148
|
+
{% if item.id %} id="{{ item.id }}"{% endif %}
|
|
149
149
|
>{{ item.title }}</a>
|
|
150
150
|
{% else %}
|
|
151
151
|
{{ item.title }}
|
|
152
152
|
{% endif %}
|
|
153
153
|
</li>
|
|
154
154
|
{% endfor %}
|
|
155
|
-
{% if params.language
|
|
155
|
+
{% if params.language %}
|
|
156
156
|
<div class="ons-u-d-no@xs">
|
|
157
157
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
158
158
|
{{ onsLanguageSelector(params.language) }}
|
|
@@ -167,11 +167,11 @@
|
|
|
167
167
|
<div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
|
|
168
168
|
<div class="ons-grid ons-grid--gutterless ons-grid--flex ons-grid--between ons-grid--vertical-center ons-grid--no-wrap">
|
|
169
169
|
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
|
|
170
|
-
{% if params.titleLogo
|
|
171
|
-
{% if params.titleLogoHref
|
|
170
|
+
{% if params.titleLogo and params.titleLogoAlt %}
|
|
171
|
+
{% if params.titleLogoHref %}
|
|
172
172
|
<a class="ons-header__title-logo-link" href="{{ params.titleLogoHref }}">
|
|
173
173
|
{% endif %}
|
|
174
|
-
<div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogoClasses %} {{ params.titleLogoClasses }} {% endif %}{% if params.titleLogoMobile
|
|
174
|
+
<div class="ons-header__title-logo ons-header__title-logo--large {% if params.titleLogoClasses %} {{ params.titleLogoClasses }} {% endif %}{% if params.titleLogoMobile %}ons-u-d-no@xxs@s{% endif %}">
|
|
175
175
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
176
176
|
{{
|
|
177
177
|
onsIcon({
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
})
|
|
181
181
|
}}
|
|
182
182
|
</div>
|
|
183
|
-
{% if params.titleLogoMobile
|
|
183
|
+
{% if params.titleLogoMobile %}
|
|
184
184
|
<div class="ons-header__title-logo ons-header__title-logo--mobile ons-u-d-no@s{% if params.titleLogoMobileClasses %} {{ params.titleLogoMobileClasses }}{% endif %}">
|
|
185
185
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
186
186
|
{{
|
|
@@ -191,24 +191,24 @@
|
|
|
191
191
|
}}
|
|
192
192
|
</div>
|
|
193
193
|
{% endif %}
|
|
194
|
-
{% if params.titleLogoHref
|
|
194
|
+
{% if params.titleLogoHref %}
|
|
195
195
|
</a>
|
|
196
196
|
{% endif %}
|
|
197
197
|
{% else %}
|
|
198
|
-
{% if params.titleLogoHref
|
|
198
|
+
{% if params.titleLogoHref %}
|
|
199
199
|
<a class="ons-header__title-link" href="{{ params.titleLogoHref }}">
|
|
200
200
|
{% endif %}
|
|
201
201
|
<{{ title_tag }} class="ons-header__title">{{ params.title }}</{{ title_tag }}>
|
|
202
|
-
{% if params.titleLogoHref
|
|
202
|
+
{% if params.titleLogoHref %}
|
|
203
203
|
</a>
|
|
204
204
|
{% endif %}
|
|
205
205
|
{% endif %}
|
|
206
|
-
{% if params.description
|
|
206
|
+
{% if params.description %}
|
|
207
207
|
<p class="ons-header__description">{{ params.description }}</p>
|
|
208
208
|
{% endif %}
|
|
209
209
|
</div>
|
|
210
210
|
|
|
211
|
-
{% if params.button
|
|
211
|
+
{% if params.button %}
|
|
212
212
|
{% if params.variants == 'neutral' %}
|
|
213
213
|
{% set buttonVariant = ["ghost", "ghost-dark"] %}
|
|
214
214
|
{% else %}
|
|
@@ -227,10 +227,10 @@
|
|
|
227
227
|
}) }}
|
|
228
228
|
</div>
|
|
229
229
|
{% endif %}
|
|
230
|
-
{% if params.navigation
|
|
230
|
+
{% if params.navigation %}
|
|
231
231
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
|
|
232
232
|
{% if params.noMasthead == true %}
|
|
233
|
-
{% if params.language
|
|
233
|
+
{% if params.language %}
|
|
234
234
|
<div class="ons-grid__col ons-col-auto ons-u-mt-xxs@xxs@l ons-u-mr-xs@xxs@s {% if params.navigation.siteSearchAutosuggest %}ons-header__lang-adjustment{% endif %}">
|
|
235
235
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
236
236
|
{{ onsLanguageSelector(params.language) }}
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
}) }}
|
|
259
259
|
</span>
|
|
260
260
|
{% endif %}
|
|
261
|
-
{% if params.navigation.toggleNavigationButton
|
|
261
|
+
{% if params.navigation.toggleNavigationButton %}
|
|
262
262
|
{% if params.variants == 'neutral' %}
|
|
263
263
|
{% set buttonVariant = ["mobile", "ghost-dark"] %}
|
|
264
264
|
{% else %}
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
</div>
|
|
282
282
|
</div>
|
|
283
283
|
</div>
|
|
284
|
-
{% if params.navigation
|
|
284
|
+
{% if params.navigation %}
|
|
285
285
|
{{ onsNavigation(params) }}
|
|
286
286
|
{% endif %}
|
|
287
287
|
</header>
|
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
{% from "components/icons/_macro.njk" import onsIcon %}
|
|
4
4
|
|
|
5
5
|
{# style adjustments if dark or light skin #}
|
|
6
|
-
{% if params.variants
|
|
6
|
+
{% if params.variants and 'dark' in params.variants %}
|
|
7
7
|
{% set skinName = "dark" %}
|
|
8
8
|
{% else %}
|
|
9
9
|
{% set skinName = "light" %}
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
12
|
{# If hero contains a collapsible, style it differently #}
|
|
13
|
-
{% if params.collapsible
|
|
13
|
+
{% if params.collapsible %}
|
|
14
14
|
{% set containerClasses = " ons-hero__container--has-collapsible" %}
|
|
15
15
|
{% endif %}
|
|
16
16
|
|
|
17
17
|
{# Set number of columns used for hero content after medium breakpoint #}
|
|
18
18
|
{% set detailsColumns = params.detailsColumns | default ('8') %}
|
|
19
19
|
|
|
20
|
-
<section class="ons-hero ons-grid--gutterless{% if params.variants
|
|
20
|
+
<section class="ons-hero ons-grid--gutterless{% if params.variants %}{% if params.variants is not string %}{% for variant in params.variants %} ons-hero--{{ variant }}{% endfor %}{% else %} ons-hero--{{ params.variants }}{% endif %}{% endif %}">
|
|
21
21
|
|
|
22
22
|
<div class="ons-hero__container ons-container{{ ' ons-container--wide' if params.wide }}{{ containerClasses }}">
|
|
23
23
|
|
|
24
24
|
<div class="ons-hero__details{{ detailsClasses }} ons-grid__col ons-col-{{ detailsColumns }}@m ons-col-10@s@m">
|
|
25
25
|
|
|
26
26
|
<header>
|
|
27
|
-
{% if params.preTitleImage
|
|
27
|
+
{% if params.preTitleImage %}
|
|
28
28
|
{% set preTitleImageWithModifier = params.preTitleImage.name ~ "--" ~ skinName ~ ".svg" %}
|
|
29
29
|
<img class="ons-hero__pre-title" src="{{ params.placeholderURL }}/img/{{ preTitleImageWithModifier }}" alt="{{ params.preTitleImage.alt }}">
|
|
30
30
|
{% endif %}
|
|
31
|
-
{% if params.title
|
|
31
|
+
{% if params.title %}
|
|
32
32
|
<h1 class="ons-hero__title ons-u-fs-xxxl">{{ params.title }}</h1>
|
|
33
33
|
{% endif %}
|
|
34
|
-
{% if params.subtitle
|
|
34
|
+
{% if params.subtitle %}
|
|
35
35
|
<h2 class="ons-hero__subtitle ons-u-fs-r--b">{{ params.subtitle }}</h2>
|
|
36
36
|
{% endif %}
|
|
37
37
|
</header>
|
|
38
38
|
|
|
39
|
-
{% if params.text
|
|
39
|
+
{% if params.text %}
|
|
40
40
|
<p class="ons-hero__text">{{ params.text | safe }}</p>
|
|
41
41
|
{% endif %}
|
|
42
42
|
|
|
43
|
-
{% if params.button
|
|
43
|
+
{% if params.button %}
|
|
44
44
|
{% from "components/button/_macro.njk" import onsButton %}
|
|
45
|
-
{% set btnClasses = params.button.classes if params.button.classes
|
|
45
|
+
{% set btnClasses = params.button.classes if params.button.classes else '' %}
|
|
46
46
|
{% if skinName == 'dark' %}
|
|
47
47
|
{% set btnClasses = btnClasses + ' ons-btn--ghost' %}
|
|
48
48
|
{% endif %}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}}
|
|
57
57
|
{% endif %}
|
|
58
58
|
|
|
59
|
-
{% if params.collapsible
|
|
59
|
+
{% if params.collapsible %}
|
|
60
60
|
{% from "components/collapsible/_macro.njk" import onsCollapsible %}
|
|
61
61
|
{{
|
|
62
62
|
onsCollapsible({
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
}}
|
|
74
74
|
{% endif %}
|
|
75
75
|
|
|
76
|
-
{% if params.suffixText
|
|
76
|
+
{% if params.suffixText %}
|
|
77
77
|
<p class="ons-hero__suffixText ons-u-fs-s ons-u-mt-m ons-u-mb-no">{{ params.suffixText | safe }}</p>
|
|
78
78
|
{% endif %}
|
|
79
79
|
|
|
80
80
|
</div>
|
|
81
|
-
{% if params.variants
|
|
81
|
+
{% if params.variants and 'census' in params.variants %}
|
|
82
82
|
|
|
83
|
-
{% if params.image
|
|
83
|
+
{% if params.image %}
|
|
84
84
|
<div class="ons-hero__circle-image">
|
|
85
|
-
<img height="558" width="558" {% if params.image.largeSrc
|
|
85
|
+
<img height="558" width="558" {% if params.image.largeSrc %}srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x" {% endif %}src="{{ params.image.smallSrc }}" alt="">
|
|
86
86
|
</div>
|
|
87
87
|
{% endif %}
|
|
88
88
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
|
|
95
95
|
<div class="ons-hero__circle-gradient"></div>
|
|
96
96
|
|
|
97
|
-
{% if (params.variants
|
|
97
|
+
{% if (params.variants and 'census' in params.variants) and ('dark' not in params.variants) %}
|
|
98
98
|
<div class="ons-hero__circle"></div>
|
|
99
99
|
{% endif %}
|
|
100
100
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{% macro onsIcon(params) %}
|
|
2
2
|
|
|
3
|
-
{% if params.classes
|
|
3
|
+
{% if params.classes %}
|
|
4
4
|
{% set iconClasses = ' ' + params.classes %}
|
|
5
5
|
{% endif %}
|
|
6
6
|
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<path d="M11.86 10.23 8.62 6.99a4.63 4.63 0 1 0-6.34 1.64 4.55 4.55 0 0 0 2.36.64 4.65 4.65 0 0 0 2.33-.65l3.24 3.23a.46.46 0 0 0 .65 0l1-1a.48.48 0 0 0 0-.62Zm-5-3.32a3.28 3.28 0 0 1-2.31.93 3.22 3.22 0 1 1 2.35-.93Z"/>
|
|
63
63
|
</svg>
|
|
64
64
|
{% elif params.iconType == "sort-sprite" %}
|
|
65
|
-
<svg id="sort-sprite{% if params.id
|
|
65
|
+
<svg id="sort-sprite{% if params.id %}-{{ params.id | lower }}{% endif %}" class="ons-svg-icon{{ iconClasses }}" viewBox="0 0 12 19" xmlns="http://www.w3.org/2000/svg" focusable="false" fill="currentColor">
|
|
66
66
|
<path class="ons-topTriangle" d="M6 0l6 7.2H0L6 0zm0 18.6l6-7.2H0l6 7.2zm0 3.6l6 7.2H0l6-7.2z"/>
|
|
67
67
|
<path class="ons-bottomTriangle" d="M6 18.6l6-7.2H0l6 7.2zm0 3.6l6 7.2H0l6-7.2z"/>
|
|
68
68
|
</svg>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{%- macro onsImage(params) -%}
|
|
2
2
|
<figure class="ons-figure">
|
|
3
3
|
|
|
4
|
-
{% if params.image
|
|
5
|
-
<img class="ons-figure__image" {% if params.image.largeSrc
|
|
4
|
+
{% if params.image %}
|
|
5
|
+
<img class="ons-figure__image" {% if params.image.largeSrc %}srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x"{% endif %}src="{{ params.image.smallSrc }}" alt="{{ params.alt if params.alt else '' }}">
|
|
6
6
|
{% else %}
|
|
7
7
|
<img class="ons-figure__image" src="{{ params.url }}" alt="{{ params.alt }}">
|
|
8
8
|
{% endif %}
|
|
9
9
|
|
|
10
|
-
{% if params.caption
|
|
10
|
+
{% if params.caption %}
|
|
11
11
|
<figcaption class="ons-figure__caption">
|
|
12
12
|
{{ params.caption }}
|
|
13
13
|
</figcaption>
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
{% set type = "text" %}
|
|
12
12
|
{% set pattern = "[0-9]*" %}
|
|
13
13
|
{% set inputmode = "numeric" %}
|
|
14
|
-
{% elif params.type
|
|
14
|
+
{% elif params.type %}
|
|
15
15
|
{% set type = params.type %}
|
|
16
|
-
{% elif params.searchButton
|
|
16
|
+
{% elif params.searchButton %}
|
|
17
17
|
{% set type = "search" %}
|
|
18
18
|
{% else %}
|
|
19
19
|
{% set type = "text" %}
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
<input
|
|
27
27
|
type="{{ type }}"
|
|
28
28
|
id="{{ params.id }}"
|
|
29
|
-
class="ons-input ons-input--text ons-input-type__input{% if params.error
|
|
30
|
-
{% if params.prefix
|
|
31
|
-
{% if params.name
|
|
32
|
-
{% if params.value
|
|
33
|
-
{% if params.accept
|
|
34
|
-
{% if params.min
|
|
35
|
-
{% if params.max
|
|
36
|
-
{% if params.minLength
|
|
37
|
-
{% if params.maxLength
|
|
38
|
-
{% if pattern
|
|
39
|
-
{% if inputmode
|
|
40
|
-
{% if params.autocomplete
|
|
41
|
-
{% if params.accessiblePlaceholder
|
|
42
|
-
{% if params.charCheckLimit
|
|
43
|
-
{% if params.charCheckLimit
|
|
44
|
-
{% if params.attributes
|
|
45
|
-
{% if params.label
|
|
46
|
-
{% if params.required
|
|
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 %}
|
|
31
|
+
{% if params.name %}name="{{ params.name }}"{% endif %}
|
|
32
|
+
{% if params.value %}value="{{ params.value }}"{% endif %}
|
|
33
|
+
{% if params.accept %}accept="{{ params.accept }}"{% endif %}
|
|
34
|
+
{% if params.min %}min="{{ params.min }}"{% endif %}
|
|
35
|
+
{% if params.max %}max="{{ params.max }}"{% endif %}
|
|
36
|
+
{% if params.minLength %}minlength="{{ params.minLength }}"{% endif %}
|
|
37
|
+
{% if params.maxLength %}maxlength="{{ params.maxLength }}"{% endif %}
|
|
38
|
+
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
|
39
|
+
{% if inputmode %}inputmode="{{ inputmode }}"{% endif %}
|
|
40
|
+
{% if params.autocomplete %}autocomplete="{{ params.autocomplete }}"{% endif %}
|
|
41
|
+
{% if params.accessiblePlaceholder %}placeholder="{{ params.label.text }}"{% endif %}
|
|
42
|
+
{% if params.charCheckLimit %}data-char-check-ref="{{ params.id }}-check-remaining" data-char-check-num="{{ params.charCheckLimit.limit }}" aria-describedby="{{ params.id }}-check-remaining"{% endif %}
|
|
43
|
+
{% if params.charCheckLimit and params.charCheckLimit.charcheckCountdown %}data-char-check-countdown="true"{% endif %}
|
|
44
|
+
{% 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 %}
|
|
45
|
+
{% 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 %}
|
|
46
|
+
{% if params.required == true %}required="required"{% endif %}
|
|
47
47
|
/>
|
|
48
48
|
{% if params.listeners %}
|
|
49
49
|
<script{% if csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
{% endfor %}
|
|
53
53
|
</script>
|
|
54
54
|
{% endif %}
|
|
55
|
-
{% if params.postTextboxLinkText
|
|
55
|
+
{% if params.postTextboxLinkText %}
|
|
56
56
|
<a class="ons-u-fs-s ons-input__post-link" href="{{ params.postTextboxLinkUrl }}">{{ params.postTextboxLinkText }}</a>
|
|
57
57
|
{% endif %}
|
|
58
58
|
{% endset %}
|
|
59
59
|
{% set field %}
|
|
60
|
-
{% if params.label
|
|
60
|
+
{% if params.label and params.label.text %}
|
|
61
61
|
{{ onsLabel({
|
|
62
62
|
"for": params.id,
|
|
63
63
|
"id": params.label.id,
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
}) }}
|
|
71
71
|
{% endif %}
|
|
72
72
|
|
|
73
|
-
{% if params.prefix
|
|
74
|
-
{% if (params.prefix
|
|
75
|
-
{% if params.prefix
|
|
73
|
+
{% if params.prefix or params.suffix %}
|
|
74
|
+
{% if (params.prefix and params.prefix.id) or (params.suffix and params.suffix.id) %}
|
|
75
|
+
{% if params.prefix %}
|
|
76
76
|
{% set prefixClass = " ons-input-type--prefix" %}
|
|
77
77
|
{% endif %}
|
|
78
78
|
|
|
@@ -81,15 +81,21 @@
|
|
|
81
81
|
{{ input | safe }}
|
|
82
82
|
|
|
83
83
|
{% set abbr = params.prefix or params.suffix %}
|
|
84
|
-
|
|
84
|
+
{% if params.prefix.title or params.suffix.title %}
|
|
85
|
+
{% set tag = 'abbr' %}
|
|
86
|
+
{% else %}
|
|
87
|
+
{% set tag = 'span' %}
|
|
88
|
+
{% endif %}
|
|
89
|
+
|
|
90
|
+
<{{ tag }}
|
|
85
91
|
id="{{ abbr.id }}"
|
|
86
92
|
class="ons-input-type__type ons-js-input-abbr"
|
|
87
|
-
title="{{ abbr.title }}"
|
|
88
|
-
>{{ abbr.text
|
|
93
|
+
{% if abbr.title %}title="{{ abbr.title }}"{% endif %}
|
|
94
|
+
>{{ abbr.text }}</{{ tag }}>
|
|
89
95
|
</span>
|
|
90
96
|
</span>
|
|
91
97
|
{% endif %}
|
|
92
|
-
{% elif params.searchButton
|
|
98
|
+
{% elif params.searchButton %}
|
|
93
99
|
<span class="ons-grid--flex ons-search">
|
|
94
100
|
{% call onsSearch({
|
|
95
101
|
"accessiblePlaceholder": params.accessiblePlaceholder,
|
|
@@ -110,7 +116,7 @@
|
|
|
110
116
|
{% endif %}
|
|
111
117
|
{% endset %}
|
|
112
118
|
|
|
113
|
-
{% if params.charCheckLimit
|
|
119
|
+
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
114
120
|
{% set charCheckField %}
|
|
115
121
|
{% call onsCharLimit({
|
|
116
122
|
"id": params.id ~ "-check",
|
|
@@ -126,7 +132,7 @@
|
|
|
126
132
|
{% endset %}
|
|
127
133
|
{% endif %}
|
|
128
134
|
|
|
129
|
-
{% if params.mutuallyExclusive
|
|
135
|
+
{% if params.mutuallyExclusive %}
|
|
130
136
|
{% call onsMutuallyExclusive({
|
|
131
137
|
"id": params.fieldId,
|
|
132
138
|
"legend": params.legend,
|
|
@@ -142,7 +148,7 @@
|
|
|
142
148
|
"error": params.error,
|
|
143
149
|
"autosuggestResults": params.autosuggestResults
|
|
144
150
|
}) %}
|
|
145
|
-
{% if charCheckField
|
|
151
|
+
{% if charCheckField %}
|
|
146
152
|
{{ charCheckField | safe }}
|
|
147
153
|
{% else %}
|
|
148
154
|
{{ field | safe }}
|
|
@@ -156,9 +162,9 @@
|
|
|
156
162
|
"classes": params.fieldClasses,
|
|
157
163
|
"dontWrap": params.dontWrap,
|
|
158
164
|
"error": params.error,
|
|
159
|
-
"inline": params.label.inline if params.label
|
|
165
|
+
"inline": params.label.inline if params.label else ''
|
|
160
166
|
}) %}
|
|
161
|
-
{% if charCheckField
|
|
167
|
+
{% if charCheckField %}
|
|
162
168
|
{{ charCheckField | safe }}
|
|
163
169
|
{% else %}
|
|
164
170
|
{{ field | safe }}
|