@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
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
<div class="ons-table-scrollable ons-table-scrollable--on">
|
|
9
9
|
<div class="ons-table-scrollable__content" tabindex="0" role="region" aria-label="{{ params.caption }}. {{ params.ariaLabel | default("Scrollable table") }}">
|
|
10
10
|
{% endif %}
|
|
11
|
-
<table {% if params.id
|
|
12
|
-
{% if params.caption
|
|
11
|
+
<table {% if params.id %}id="{{ params.id }}"{% endif %} class="ons-table{% if params.tableClasses %} {{ params.tableClasses }}{% endif %}{% if variants %}{% if variants is not string %}{% for variant in variants %} ons-table--{{ variant }}{% endfor %}{% else %} ons-table--{{ variants }}{% endif %}{% endif %}" {% if params.sortBy and 'sortable' in variants %}data-aria-sort="{{ params.sortBy }}" data-aria-asc="{{ params.ariaAsc }}" data-aria-desc="{{ params.ariaDesc }}"{% endif %}>
|
|
12
|
+
{% if params.caption %}
|
|
13
13
|
<caption class="ons-table__caption{{ " ons-u-vh" if params.hideCaption }}">{{ params.caption }}</caption>
|
|
14
14
|
{% endif %}
|
|
15
15
|
<thead class="ons-table__head">
|
|
16
16
|
<tr class="ons-table__row">
|
|
17
17
|
{% for th in params.ths %}
|
|
18
|
-
<th scope="col" class="ons-table__header{{ ' ' + th.thClasses if th.thClasses
|
|
18
|
+
<th scope="col" class="ons-table__header{{ ' ' + th.thClasses if th.thClasses }}{{ " ons-table__header--numeric" if th.numeric }}"{% if 'sortable' in variants %} aria-sort="{{- th.ariaSort | default('none') -}}"{% endif %}>
|
|
19
19
|
<span>{{- th.value -}}</span>
|
|
20
20
|
{% if 'sortable' in variants %}
|
|
21
21
|
{{
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
</thead>
|
|
33
33
|
<tbody class="ons-table__body">
|
|
34
34
|
{% for tr in params.trs %}
|
|
35
|
-
<tr class="ons-table__row{{ " ons-table__row--highlight" if tr.highlight }}" {% if tr.name
|
|
35
|
+
<tr class="ons-table__row{{ " ons-table__row--highlight" if tr.highlight }}" {% if tr.name %} name="{{ tr.name }}"{% endif %} {% if tr.id %} id="{{ tr.id }}"{% endif %}>
|
|
36
36
|
{% for td in tr.tds %}
|
|
37
|
-
<td class="ons-table__cell{{ ' ' + td.tdClasses if td.tdClasses
|
|
38
|
-
{% if td.form
|
|
37
|
+
<td class="ons-table__cell{{ ' ' + td.tdClasses if td.tdClasses }}{{ " ons-table__cell--numeric" if td.numeric }}" {% if td.id %} id="{{ td.id }}"{% endif %} {% if td.name %} name="{{ td.name }}"{% endif %} {% if td.data %} data-th="{{ td.data }}"{% endif %} {% if td.dataSort %} data-sort-value="{{ td.dataSort }}"{% endif %}>
|
|
38
|
+
{% if td.form %}
|
|
39
39
|
<form action="{{ td.form.action }}" method="{{ td.form.method | default('POST')}}">
|
|
40
40
|
{{
|
|
41
41
|
onsButton({
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"name": td.form.button.name if td.form.button.name
|
|
48
48
|
})
|
|
49
49
|
}}
|
|
50
|
-
{% if td.form.hiddenFormField
|
|
50
|
+
{% if td.form.hiddenFormField %}
|
|
51
51
|
{% for hiddenField in td.form.hiddenFormField %}
|
|
52
|
-
<input type="hidden" {% if hiddenField.name
|
|
52
|
+
<input type="hidden" {% if hiddenField.name %} name="{{ hiddenField.name }}"{% endif %} {% if hiddenField.value %} value="{{ hiddenField.value }}"{% endif %} />
|
|
53
53
|
{% endfor %}
|
|
54
54
|
{% endif %}
|
|
55
55
|
</form>
|
|
56
56
|
{% endif %}
|
|
57
|
-
{% if td.value
|
|
57
|
+
{% if td.value %}
|
|
58
58
|
{{ td.value | safe }}
|
|
59
59
|
{% endif %}
|
|
60
60
|
</td>
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</tr>
|
|
63
63
|
{% endfor %}
|
|
64
64
|
</tbody>
|
|
65
|
-
{% if params.tfoot
|
|
65
|
+
{% if params.tfoot %}
|
|
66
66
|
<tfoot class="ons-table__foot">
|
|
67
67
|
<tr class="ons-table__row">
|
|
68
68
|
{% for tfootCell in params.tfoot %}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% from "components/skip-to-content/_macro.njk" import onsSkipToContent %}
|
|
4
4
|
|
|
5
5
|
<aside class="ons-toc-container" role="complementary">
|
|
6
|
-
{% if params.skipLink
|
|
6
|
+
{% if params.skipLink %}
|
|
7
7
|
{{
|
|
8
8
|
onsSkipToContent({
|
|
9
9
|
"url": params.skipLink.url,
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
<nav class="ons-toc" aria-label="{{ params.ariaLabel | default('Table of contents') }}">
|
|
16
16
|
<h2 class="ons-toc__title ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h2>
|
|
17
|
-
{% if params.lists
|
|
17
|
+
{% if params.lists %}
|
|
18
18
|
{% for list in params.lists %}
|
|
19
|
-
{% if list.listHeading
|
|
19
|
+
{% if list.listHeading %}
|
|
20
20
|
<h3 class="ons-u-fs-r ons-u-mb-xs">{{ list.listHeading }}<span class="ons-u-vh"> {{ list.listHeadingHidden }}</span>:</h3>
|
|
21
21
|
{% endif %}
|
|
22
22
|
{{
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
})
|
|
29
29
|
}}
|
|
30
30
|
{% endfor %}
|
|
31
|
-
{% elif params.itemsList
|
|
31
|
+
{% elif params.itemsList %}
|
|
32
32
|
{{
|
|
33
33
|
onsList({
|
|
34
34
|
"element": 'ol',
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{% set field %}
|
|
9
9
|
{% set textareaExclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive else "" %}
|
|
10
10
|
|
|
11
|
-
{% if params.label
|
|
11
|
+
{% if params.label %}
|
|
12
12
|
{{ onsLabel({
|
|
13
13
|
"for": params.id,
|
|
14
14
|
"text": params.label.text,
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
|
|
20
20
|
<textarea
|
|
21
21
|
id="{{ params.id }}"
|
|
22
|
-
class="ons-input ons-input--textarea {% if params.error
|
|
23
|
-
{% if params.name
|
|
22
|
+
class="ons-input ons-input--textarea {% if params.error %} ons-input--error {% endif %}{% if params.charCheckLimit and params.charCheckLimit.limit %} ons-js-char-limit-input{% endif %}{{ textareaExclusiveClass }} {{ params.classes if params.classes }} {% if params.width %}ons-input--w-{{ params.width }}{% endif %}"
|
|
23
|
+
{% if params.name %}
|
|
24
24
|
name="{{ params.name }}"
|
|
25
25
|
{% endif %}
|
|
26
26
|
rows="{{ params.rows | default(8) }}"
|
|
27
|
-
{% if params.charCheckLimit
|
|
27
|
+
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
28
28
|
maxlength="{{ params.charCheckLimit.limit }}"
|
|
29
29
|
data-char-limit-ref="{{ params.id }}-lim-remaining"
|
|
30
30
|
aria-describedby="{{ params.id }}-lim-remaining"
|
|
31
31
|
{% endif %}
|
|
32
|
-
{% if params.attributes
|
|
33
|
-
>{{ params.value if params.value
|
|
32
|
+
{% 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 %}
|
|
33
|
+
>{{ params.value if params.value }}</textarea>
|
|
34
34
|
|
|
35
|
-
{% if params.charCheckLimit
|
|
35
|
+
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
36
36
|
{% call onsCharLimit({
|
|
37
37
|
"id": params.id ~ "-lim",
|
|
38
38
|
"limit": params.charCheckLimit.limit,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
{% endif %}
|
|
44
44
|
{% endset %}
|
|
45
45
|
|
|
46
|
-
{% if params.mutuallyExclusive
|
|
46
|
+
{% if params.mutuallyExclusive %}
|
|
47
47
|
{% call onsMutuallyExclusive({
|
|
48
48
|
"id": params.fieldId,
|
|
49
49
|
"classes": params.fieldClasses,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{%- macro onsVideo(params) -%}
|
|
2
2
|
<div class="ons-video">
|
|
3
|
-
{% if params.youtubeUrl
|
|
3
|
+
{% if params.youtubeUrl %}
|
|
4
4
|
<iframe title="{{ params.title }}" class="ons-video__iframe" src="{{ params.youtubeUrl }}" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
5
5
|
{% endif %}
|
|
6
6
|
</div>
|