@ons/design-system 44.1.2 → 45.0.3
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/uac.scss +5 -5
- package/components/autosuggest/autosuggest.ui.js +2 -2
- package/components/autosuggest/{code.list.searcher.js → fuse-config.js} +1 -3
- package/components/checkboxes/_checkbox-macro.njk +1 -1
- package/components/checkboxes/_macro.njk +1 -1
- package/components/fieldset/_macro.njk +1 -1
- package/components/header/_header.scss +3 -4
- package/components/header/_macro.njk +2 -2
- package/components/highlight/_highlight.scss +5 -0
- package/components/input/_input.scss +2 -2
- package/components/metadata/_macro.njk +1 -1
- package/components/metadata/_metadata.scss +1 -1
- package/components/radios/_macro.njk +2 -2
- package/components/table-of-contents/_macro.njk +7 -7
- package/components/textarea/_macro.njk +2 -2
- package/components/timeout-modal/_macro.njk +1 -1
- package/components/timeout-modal/timeout.dom.js +2 -1
- package/components/timeout-modal/timeout.js +6 -1
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/js/abortable-fetch.js +55 -0
- package/js/analytics.js +70 -0
- package/js/cookies-functions.js +182 -0
- package/js/cookies-settings.dom.js +13 -0
- package/js/cookies-settings.js +105 -0
- package/{src/js → js}/domready.js +0 -0
- package/js/fetch.js +19 -0
- package/js/inpagelink.dom.js +13 -0
- package/js/inpagelink.js +31 -0
- package/js/main.js +27 -0
- package/js/polyfills.js +9 -0
- package/js/print-button.js +16 -0
- package/{page-templates → layout}/_template.njk +0 -0
- package/package.json +2 -2
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/main.scss +1 -5
- package/scss/patternlib.scss +3 -0
- package/scss/vars/_vars.scss +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
.ons-uac {
|
|
2
2
|
&__input {
|
|
3
|
-
font-family: $font-mono;
|
|
3
|
+
font-family: $font-mono !important;
|
|
4
4
|
font-weight: 700;
|
|
5
5
|
letter-spacing: 0.14em;
|
|
6
6
|
text-transform: uppercase;
|
|
7
7
|
width: 15.1em;
|
|
8
8
|
|
|
9
9
|
@media all and (min-width: 375px) {
|
|
10
|
-
font-size: 20px;
|
|
11
|
-
width: 15.1em;
|
|
10
|
+
font-size: 20px !important;
|
|
11
|
+
width: 15.1em !important;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
@media all and (max-width: 374px) {
|
|
15
15
|
letter-spacing: 0;
|
|
16
|
-
max-width: 12.6em;
|
|
16
|
+
max-width: 12.6em !important;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@media all and (max-width: 299px) {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@include mq('s') {
|
|
24
|
-
font-size: 24px;
|
|
24
|
+
font-size: 24px !important;
|
|
25
25
|
max-width: 14.9em;
|
|
26
26
|
width: 14.9em !important;
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import abortableFetch from '../../js/abortable-fetch';
|
|
2
2
|
import { sanitiseAutosuggestText } from './autosuggest.helpers';
|
|
3
|
-
import
|
|
3
|
+
import runFuse from './fuse-config';
|
|
4
4
|
|
|
5
5
|
export const baseClass = 'ons-js-autosuggest';
|
|
6
6
|
|
|
@@ -295,7 +295,7 @@ export default class AutosuggestUI {
|
|
|
295
295
|
|
|
296
296
|
async fetchSuggestions(sanitisedQuery, data) {
|
|
297
297
|
this.abortFetch();
|
|
298
|
-
const results = await
|
|
298
|
+
const results = await runFuse(sanitisedQuery, data, this.lang, this.resultLimit);
|
|
299
299
|
results.forEach(result => {
|
|
300
300
|
result.sanitisedText = sanitiseAutosuggestText(result[this.lang], this.sanitisedQueryReplaceChars);
|
|
301
301
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import Fuse from 'fuse.js';
|
|
2
2
|
|
|
3
|
-
export default function
|
|
3
|
+
export default function runFuse(query, data, searchFields) {
|
|
4
4
|
const options = {
|
|
5
5
|
shouldSort: true,
|
|
6
6
|
threshold: 0.2,
|
|
7
|
-
location: 1,
|
|
8
|
-
distance: 1000,
|
|
9
7
|
keys: [
|
|
10
8
|
{
|
|
11
9
|
name: searchFields,
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"otherType": checkbox.other.otherType,
|
|
73
73
|
"options": checkbox.other.options,
|
|
74
74
|
"width": checkbox.other.width,
|
|
75
|
-
"classes": checkbox.other.classes | default('') + exclusiveClass | default(''),
|
|
75
|
+
"classes": ("ons-input--error" if params.error else "") + checkbox.other.classes | default('') + exclusiveClass | default(''),
|
|
76
76
|
"attributes": checkbox.other.attributes,
|
|
77
77
|
"label": {
|
|
78
78
|
"text": checkbox.other.label.text
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
class="ons-fieldset{% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}"
|
|
13
13
|
{% if params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value is defined and value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
|
|
14
14
|
>
|
|
15
|
-
<legend class="ons-fieldset__legend{% if params.legendClasses is defined and params.legendClasses %} {{ params.legendClasses }}{% endif %}">
|
|
15
|
+
<legend class="ons-fieldset__legend{% if params.legendIsQuestionTitle is defined and params.legendIsQuestionTitle %} ons-u-mb-no{% endif %}{% if params.legendClasses is defined and params.legendClasses %} {{ params.legendClasses }}{% endif %}">
|
|
16
16
|
{% if params.legendIsQuestionTitle %}
|
|
17
17
|
<h1 id="fieldset-legend-title" class="ons-fieldset__legend-title {% if params.legendTitleClasses is defined and params.legendTitleClasses %}{{ params.legendTitleClasses }}{% endif %}">
|
|
18
18
|
{{- params.legend | safe -}}
|
|
@@ -59,11 +59,10 @@
|
|
|
59
59
|
margin-top: 0.8rem;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
&--with-description
|
|
63
|
-
&--with-button {
|
|
62
|
+
&--with-description {
|
|
64
63
|
@include mq(m) {
|
|
65
64
|
margin-bottom: 0;
|
|
66
|
-
margin-top: 0.
|
|
65
|
+
margin-top: 0.5rem;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
|
|
@@ -103,7 +102,7 @@
|
|
|
103
102
|
margin: 0;
|
|
104
103
|
|
|
105
104
|
@include mq(m) {
|
|
106
|
-
margin: 0 0 1rem;
|
|
105
|
+
margin: 0 0 1.1rem;
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
108
|
// Modifier - Hero variant
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</div>
|
|
45
45
|
|
|
46
46
|
{% if params.language is defined and params.language or params.serviceLinks is defined and params.serviceLinks %}
|
|
47
|
-
<div class="ons-header__links grid__col col-auto">
|
|
47
|
+
<div class="ons-header__links ons-grid__col ons-col-auto">
|
|
48
48
|
{% if params.language is defined and params.language %}
|
|
49
49
|
<div class="ons-grid__col ons-col-auto">
|
|
50
50
|
{% from "components/language-selector/_macro.njk" import onsLanguageSelector %}
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</div>
|
|
53
53
|
{% endif %}
|
|
54
54
|
{% if params.serviceLinks is defined and params.serviceLinks %}
|
|
55
|
-
<div class="ons-grid__col col-auto ons-u-d-no@xxs@m">
|
|
55
|
+
<div class="ons-grid__col ons-col-auto ons-u-d-no@xxs@m">
|
|
56
56
|
<nav class="ons-header-service-nav {{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
57
57
|
<ul class="ons-header-service-nav__list" aria-label="{{ params.serviceLinks.ariaListLabel | default("Service Links") }}">
|
|
58
58
|
{% for item in (params.serviceLinks.itemsList if params.serviceLinks.itemsList is iterable else params.serviceLinks.itemsList.items()) %}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{% macro onsMetadata(params) %}
|
|
2
|
-
<dl class="ons-metadata metadata__list ons-grid ons-grid--gutterless ons-u-cf
|
|
2
|
+
<dl class="ons-metadata ons-metadata__list ons-grid ons-grid--gutterless ons-u-cf{{ (' ' + params.classes) if params.classes is defined and params.classes }}"{% if params.id is defined and params.id %} id="{{ params.id }}" {% endif %}{% if params.metadataLabel is defined and params.metadataLabel %} title="{{ params.metadataLabel }}" aria-label="{{ params.metadataLabel }}"{% endif %}>
|
|
3
3
|
{% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
|
|
4
4
|
{% if item.term | length %}
|
|
5
5
|
<dt class="ons-metadata__term ons-grid__col ons-col-{{ params.termCol }}@m">{{ item.term }}</dt>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"name": radio.other.name,
|
|
56
56
|
"type": radio.other.type,
|
|
57
57
|
"required": radio.other.required,
|
|
58
|
-
"classes": radio.other.classes | default(''),
|
|
58
|
+
"classes": ("ons-input--error" if params.error else "") + radio.other.classes | default(''),
|
|
59
59
|
"width": radio.other.width | default('auto'),
|
|
60
60
|
"attributes": radio.other.attributes,
|
|
61
61
|
"label": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"id": radio.other.id,
|
|
75
75
|
"name": radio.other.name,
|
|
76
76
|
"options": radio.other.options,
|
|
77
|
-
"classes": radio.other.classes,
|
|
77
|
+
"classes": ("ons-input--error" if params.error else "") + radio.other.classes | default(''),
|
|
78
78
|
"label": {
|
|
79
79
|
"id": radio.other.id + "-label",
|
|
80
80
|
"text": radio.other.label.text,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{% macro onsTableOfContents(params) %}
|
|
2
2
|
{% from "components/lists/_macro.njk" import onsList %}
|
|
3
3
|
{% from "components/skip-to-content/_macro.njk" import onsSkipToContent %}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
<aside class="ons-toc-container" role="complementary">
|
|
6
|
+
{% if params.skipLink is defined and params.skipLink %}
|
|
7
7
|
{{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
onsSkipToContent({
|
|
9
|
+
"url": params.skipLink.url,
|
|
10
|
+
"text": params.skipLink.text
|
|
11
|
+
})
|
|
12
12
|
}}
|
|
13
13
|
{% endif %}
|
|
14
14
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
{% set field %}
|
|
9
|
-
{% set
|
|
9
|
+
{% set textareaExclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive else "" %}
|
|
10
10
|
|
|
11
11
|
{% if params.label is defined and params.label %}
|
|
12
12
|
{{ onsLabel({
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
<textarea
|
|
21
21
|
id="{{ params.id }}"
|
|
22
|
-
class="ons-input ons-input--textarea {% if params.error is defined and params.error %} ons-input--error {% endif %}{% if params.charCheckLimit is defined and params.charCheckLimit and params.charCheckLimit.limit is defined and params.charCheckLimit.limit %} ons-js-char-limit-input{% endif %}{{
|
|
22
|
+
class="ons-input ons-input--textarea {% if params.error is defined and params.error %} ons-input--error {% endif %}{% if params.charCheckLimit is defined and params.charCheckLimit and params.charCheckLimit.limit is defined and params.charCheckLimit.limit %} ons-js-char-limit-input{% endif %}{{ textareaExclusiveClass }} {{ params.classes }} {% if params.width is defined and params.width %}ons-input--w-{{ params.width }}{% endif %}"
|
|
23
23
|
name="{{ params.name }}"
|
|
24
24
|
rows="{{ params.rows | default(8) }}"
|
|
25
25
|
{% if params.charCheckLimit is defined and params.charCheckLimit and params.charCheckLimit.limit is defined and params.charCheckLimit.limit %}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"classes": "ons-js-timeout-modal",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"data-redirect-url": params.redirectUrl,
|
|
9
|
-
"data-
|
|
9
|
+
"data-server-session-expires-at": params.sessionExpiresAt,
|
|
10
10
|
"data-show-modal-time": params.showModalTimeInSeconds,
|
|
11
11
|
"data-server-session-expiry-endpoint": params.serverSessionExpiryEndpoint,
|
|
12
12
|
"data-countdown-text": params.countdownText,
|
|
@@ -8,7 +8,8 @@ async function modals() {
|
|
|
8
8
|
|
|
9
9
|
timeouts.forEach(context => {
|
|
10
10
|
let url = context.getAttribute('data-server-session-expiry-endpoint');
|
|
11
|
-
|
|
11
|
+
let time = context.getAttribute('data-server-session-expires-at');
|
|
12
|
+
new Timeout(context, url, time);
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -34,7 +34,12 @@ export default class Timeout {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
async initialise() {
|
|
37
|
-
this.
|
|
37
|
+
if (this.initialExpiryTime && this.sessionExpiryEndpoint) {
|
|
38
|
+
this.expiryTime = this.initialExpiryTime;
|
|
39
|
+
} else {
|
|
40
|
+
this.expiryTime = await this.setNewExpiryTime();
|
|
41
|
+
}
|
|
42
|
+
|
|
38
43
|
this.expiryTimeInMilliseconds = this.convertTimeToMilliSeconds(this.expiryTime);
|
|
39
44
|
|
|
40
45
|
this.bindEventListeners();
|