@ons/design-system 60.0.1 → 60.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/autosuggest/autosuggest.ui.js +2 -1
- package/components/button/_button.scss +53 -25
- package/components/checkboxes/_checkbox-macro.njk +0 -1
- package/components/checkboxes/_checkbox-macro.spec.js +0 -2
- package/components/checkboxes/_checkbox.scss +0 -6
- package/components/checkboxes/_macro.njk +1 -1
- package/components/download-resources/download-resources.js +11 -19
- package/components/download-resources/download-resources.spec.js +172 -232
- package/components/input/_macro.njk +0 -1
- package/components/input/_macro.spec.js +0 -17
- package/components/pagination/_pagination.scss +10 -2
- package/components/radios/_macro.njk +2 -3
- package/components/radios/_macro.spec.js +0 -2
- package/components/summary/_summary.scss +2 -2
- package/components/table/_macro.njk +1 -8
- package/components/table/_macro.spec.js +3 -3
- package/components/tabs/tabs.js +3 -2
- package/components/tabs/tabs.spec.js +67 -1
- package/css/main.css +2 -2
- package/css/print.css +1 -1
- package/layout/_template.njk +3 -4
- package/package.json +2 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/patternlib.scss +1 -15
- package/scss/print.scss +18 -14
- package/css/error.css +0 -1
- package/scss/error.scss +0 -27
|
@@ -408,6 +408,7 @@ export default class AutosuggestUI {
|
|
|
408
408
|
this.listbox.innerHTML = `<li class="${classAutosuggestOption} ${classAutosuggestOptionNoResults}">${message}</li>`;
|
|
409
409
|
} else if (status > 400 || status === '') {
|
|
410
410
|
message = this.errorAPI + (this.errorAPILinkText ? ' <a href="' + window.location.href + '">' + this.errorAPILinkText + '</a>.' : '');
|
|
411
|
+
let ariaMessage = this.errorAPI + (this.errorAPILinkText ? ' ' + this.errorAPILinkText : '');
|
|
411
412
|
|
|
412
413
|
this.input.setAttribute('disabled', true);
|
|
413
414
|
this.input.value = '';
|
|
@@ -415,7 +416,7 @@ export default class AutosuggestUI {
|
|
|
415
416
|
|
|
416
417
|
this.listbox.innerHTML = '';
|
|
417
418
|
this.listbox.insertBefore(this.createWarningElement(message), this.listbox.firstChild);
|
|
418
|
-
this.setAriaStatus(
|
|
419
|
+
this.setAriaStatus(ariaMessage);
|
|
419
420
|
} else {
|
|
420
421
|
message = this.noResults;
|
|
421
422
|
this.listbox.innerHTML = `<li class="${classAutosuggestOption} ${classAutosuggestOptionNoResults}">${message}</li>`;
|
|
@@ -99,7 +99,7 @@ $button-shadow-size: 3px;
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
&:active {
|
|
102
|
+
&:active:not(&--disabled):not(&--loader.ons-is-loading) {
|
|
103
103
|
top: ems($button-shadow-size);
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -154,12 +154,19 @@ $button-shadow-size: 3px;
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
&--secondary:hover & {
|
|
157
|
+
&--secondary:hover:not(&--disabled) & {
|
|
158
158
|
&__inner {
|
|
159
159
|
background: var(--ons-color-button-secondary-hover);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
&--disabled:not(&--secondary) &,
|
|
164
|
+
&--loader.ons-is-loading:hover:not(&--secondary) & {
|
|
165
|
+
&__inner {
|
|
166
|
+
background: var(--ons-color-button);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
163
170
|
// Link button when hovered
|
|
164
171
|
&--link:hover {
|
|
165
172
|
text-decoration: none;
|
|
@@ -361,19 +368,21 @@ $button-shadow-size: 3px;
|
|
|
361
368
|
}
|
|
362
369
|
}
|
|
363
370
|
|
|
364
|
-
&--loader &
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
371
|
+
&--loader & {
|
|
372
|
+
&__inner {
|
|
373
|
+
position: relative;
|
|
374
|
+
transition: color 0.3s ease-in-out;
|
|
375
|
+
.ons-svg-icon {
|
|
376
|
+
height: 27px;
|
|
377
|
+
left: 50%;
|
|
378
|
+
margin: 0;
|
|
379
|
+
opacity: 0;
|
|
380
|
+
position: absolute;
|
|
381
|
+
top: 50%;
|
|
382
|
+
transform: translate(-50%, -50%);
|
|
383
|
+
transition: opacity 0.3s ease-in-out;
|
|
384
|
+
width: 27px;
|
|
385
|
+
}
|
|
377
386
|
}
|
|
378
387
|
}
|
|
379
388
|
|
|
@@ -384,14 +393,26 @@ $button-shadow-size: 3px;
|
|
|
384
393
|
}
|
|
385
394
|
}
|
|
386
395
|
|
|
387
|
-
&--loader.ons-is-loading &
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
396
|
+
&--loader.ons-is-loading & {
|
|
397
|
+
&__inner {
|
|
398
|
+
color: transparent;
|
|
399
|
+
.ons-svg-icon {
|
|
400
|
+
margin-left: 0 !important;
|
|
401
|
+
opacity: 1;
|
|
402
|
+
}
|
|
392
403
|
}
|
|
393
404
|
}
|
|
394
405
|
|
|
406
|
+
&--loader.ons-is-loading:active & {
|
|
407
|
+
&__inner {
|
|
408
|
+
box-shadow: 0 ems($button-shadow-size) 0 var(--ons-color-button-shadow);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&--loader.ons-is-loading:hover {
|
|
413
|
+
cursor: not-allowed;
|
|
414
|
+
}
|
|
415
|
+
|
|
395
416
|
&--dropdown:focus & {
|
|
396
417
|
&__inner {
|
|
397
418
|
box-shadow: inset 0 -4px 0 0 var(--ons-color-text-link-focus);
|
|
@@ -417,15 +438,22 @@ $button-shadow-size: 3px;
|
|
|
417
438
|
}
|
|
418
439
|
|
|
419
440
|
// Disabled buttons
|
|
420
|
-
&--disabled {
|
|
421
|
-
|
|
422
|
-
cursor: not-allowed;
|
|
423
|
-
}
|
|
424
|
-
.ons-btn__inner {
|
|
441
|
+
&--disabled & {
|
|
442
|
+
&__inner {
|
|
425
443
|
opacity: 0.4;
|
|
426
444
|
}
|
|
427
445
|
}
|
|
428
446
|
|
|
447
|
+
&--disabled:hover {
|
|
448
|
+
cursor: not-allowed;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
&--disabled:active & {
|
|
452
|
+
&__inner {
|
|
453
|
+
box-shadow: 0 ems($button-shadow-size) 0 var(--ons-color-button-shadow);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
429
457
|
&--dropdown {
|
|
430
458
|
@extend .ons-btn--mobile;
|
|
431
459
|
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"id": params.other.id,
|
|
35
35
|
"name": params.other.name,
|
|
36
36
|
"type": params.other.type,
|
|
37
|
-
"required": params.other.required,
|
|
38
37
|
"classes": params.other.classes | default(''),
|
|
39
38
|
"width": params.other.width | default('auto'),
|
|
40
39
|
"attributes": params.other.attributes,
|
|
@@ -25,7 +25,6 @@ const EXAMPLE_CHECKBOXES_ITEM_INPUT = {
|
|
|
25
25
|
label: {
|
|
26
26
|
text: 'Enter your own answer',
|
|
27
27
|
},
|
|
28
|
-
required: false,
|
|
29
28
|
classes: 'extra-textbox-class',
|
|
30
29
|
width: 42,
|
|
31
30
|
value: '42',
|
|
@@ -339,7 +338,6 @@ describe('macro: checkboxes/checkbox', () => {
|
|
|
339
338
|
text: 'Enter your own answer',
|
|
340
339
|
classes: 'ons-u-fw-n',
|
|
341
340
|
},
|
|
342
|
-
required: false,
|
|
343
341
|
classes: 'extra-textbox-class',
|
|
344
342
|
width: 42,
|
|
345
343
|
attributes: EXAMPLE_CHECKBOXES_ITEM_INPUT.other.attributes,
|
|
@@ -188,12 +188,6 @@ $checkbox-padding: 11px;
|
|
|
188
188
|
outline: 1px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
.ons-panel--error .ons-radio__input:checked ~ &__other > .ons-input--text:required:not(:focus) {
|
|
192
|
-
border: 1px solid var(--ons-color-ruby-red);
|
|
193
|
-
outline: 1px solid var(--ons-color-ruby-red);
|
|
194
|
-
outline-offset: -2px;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
191
|
&__input:focus + &__label::before {
|
|
198
192
|
@extend %ons-input-focus;
|
|
199
193
|
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"otherType": checkbox.other.otherType,
|
|
80
80
|
"options": checkbox.other.options,
|
|
81
81
|
"width": checkbox.other.width,
|
|
82
|
-
"classes": ("ons-input--error" if params.error else "") + checkbox.other.classes | default('') + exclusiveClass | default(''),
|
|
82
|
+
"classes": ("ons-input--error" if params.error and checkbox.checked else "") + checkbox.other.classes | default('') + exclusiveClass | default(''),
|
|
83
83
|
"attributes": checkbox.other.attributes,
|
|
84
84
|
"label": {
|
|
85
85
|
"text": checkbox.other.label.text
|
|
@@ -783,10 +783,10 @@ Math.easeInOutQuad = function(t, b, c, d) {
|
|
|
783
783
|
|
|
784
784
|
let AdvFilter = function(element) {
|
|
785
785
|
this.element = element;
|
|
786
|
-
this.form =
|
|
786
|
+
this.form = document.getElementsByClassName('ons-js-adv-filter__form');
|
|
787
787
|
this.resultsList = this.element.getElementsByClassName('ons-js-adv-filter__gallery')[0];
|
|
788
788
|
this.resultsCount = this.element.getElementsByClassName('ons-js-adv-filter__results-count');
|
|
789
|
-
this.showCount =
|
|
789
|
+
this.showCount = document.getElementsByClassName('ons-js-adv-filter__show-results');
|
|
790
790
|
|
|
791
791
|
initAdvFilter(this);
|
|
792
792
|
};
|
|
@@ -1011,8 +1011,10 @@ Math.easeInOutQuad = function(t, b, c, d) {
|
|
|
1011
1011
|
let filtersTrigger = filters[0].getElementsByClassName('ons-js-adv-filter__trigger')[0];
|
|
1012
1012
|
let filtersClose = filters[0].getElementsByClassName('ons-js-adv-filter__close')[0];
|
|
1013
1013
|
let filtersShow = filters[0].getElementsByClassName('ons-js-adv-filter__show')[0];
|
|
1014
|
+
let filtersWrap = filters[0].getElementsByClassName('ons-js-adv-filter__wrap')[0];
|
|
1014
1015
|
let filtersPanel = filters[0].getElementsByClassName('ons-js-adv-filter__panel')[0];
|
|
1015
1016
|
let body = document.getElementsByTagName('body')[0];
|
|
1017
|
+
let page = document.getElementsByClassName('ons-page')[0];
|
|
1016
1018
|
|
|
1017
1019
|
// Detect click on filters trigger
|
|
1018
1020
|
filtersTrigger.addEventListener('click', function(event) {
|
|
@@ -1061,28 +1063,18 @@ Math.easeInOutQuad = function(t, b, c, d) {
|
|
|
1061
1063
|
|
|
1062
1064
|
// Toggle filters visibility on small devices
|
|
1063
1065
|
function toggleFilters(bool) {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1066
|
+
if (bool === true) {
|
|
1067
|
+
body.appendChild(filtersPanel);
|
|
1068
|
+
} else {
|
|
1069
|
+
filtersWrap.appendChild(filtersPanel);
|
|
1070
|
+
}
|
|
1071
|
+
Util.toggleClass(page, 'ons-u-d-no', bool);
|
|
1070
1072
|
Util.toggleClass(filtersPanel, 'ons-adv-filter__panel--is-visible', bool);
|
|
1071
1073
|
Util.toggleClass(body, 'ons-no-scroll', bool);
|
|
1072
1074
|
filtersTrigger.setAttribute('aria-expanded', bool);
|
|
1073
1075
|
filtersTrigger.setAttribute('aria-hidden', bool);
|
|
1076
|
+
page.setAttribute('aria-hidden', bool);
|
|
1074
1077
|
Util.toggleClass(filtersTrigger, 'ons-u-d-no', bool);
|
|
1075
|
-
|
|
1076
|
-
Util.toggleClass(resultsOptions, 'ons-u-d-no', bool);
|
|
1077
|
-
Util.toggleClass(resultsList, 'ons-u-d-no', bool);
|
|
1078
|
-
Util.toggleClass(header, 'ons-u-d-no', bool);
|
|
1079
|
-
Util.toggleClass(breadcrumbs, 'ons-u-d-no', bool);
|
|
1080
|
-
Util.toggleClass(footer, 'ons-u-d-no', bool);
|
|
1081
|
-
resultsOptions.setAttribute('aria-hidden', bool);
|
|
1082
|
-
resultsList.setAttribute('aria-hidden', bool);
|
|
1083
|
-
header.setAttribute('aria-hidden', bool);
|
|
1084
|
-
breadcrumbs.setAttribute('aria-hidden', bool);
|
|
1085
|
-
footer.setAttribute('aria-hidden', bool);
|
|
1086
1078
|
}
|
|
1087
1079
|
}
|
|
1088
1080
|
})();
|