Skip to content

Commit d51dc0d

Browse files
authored
Merge pull request #162 from w3c/hotfix/spacing-and-bullets
Hotfix/spacing and bullets
2 parents f0d0a79 + eab36f2 commit d51dc0d

File tree

13 files changed

+114
-178
lines changed

13 files changed

+114
-178
lines changed

assets-src/js/multiselect-module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ const MultiselectButtons = function (selectEl, params) {
193193
ulCombo.setAttribute('aria-multiselectable', 'true');
194194
ulCombo.id = baseId + '-listbox';
195195
ulCombo.setAttribute('aria-labelledby', baseId + '-label');
196-
ulCombo.classList.add('combo-menu');
196+
ulCombo.classList.add('combo-menu', 'clean-list');
197197

198198
div.appendChild(divComboBox);
199199
div.appendChild(ulCombo);

assets-src/js/slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let contentSlider = (function () {
6666
function createControls() {
6767

6868
let controls = document.createElement('ul');
69-
controls.setAttribute('class', 'slider-controls');
69+
controls.setAttribute('class', 'clean-list slider-controls');
7070
controls.setAttribute('aria-label', controlsDescription);
7171
controls.innerHTML = '<li><button class="button button--ghost js-previous with-icon--larger" aria-label="' + previousSlide + '" style="padding:0.4375rem;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512" class="icon icon--larger" focusable="false" aria-hidden="true" width="1em" height="1em"><path class="chevron-left" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"/><path class="chevron-right" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></button></li>'
7272
+ '<li style="margin-top:0;margin-inline-start:0.25rem;"><button class="button button--ghost js-next with-icon--larger" aria-label="' + nextSlide + '" style="padding:0.4375rem;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512" class="icon icon--larger" focusable="false" aria-hidden="true" width="1em" height="1em"><path class="chevron-left" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"/><path class="chevron-right" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></button></li>';

assets-src/styles/sass/50-core-components/_evangelists.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
padding-right: rem(24);
4646
}
4747

48+
.l-box {
49+
padding: rem(24);
50+
}
51+
4852
li + li {
4953
border-top: solid 1px #649bc5;
5054
}

public/dist/assets/js/multiselect.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ const MultiselectButtons = function (selectEl, params) {
151151
selectEl.parentNode.appendChild(span);
152152

153153
// hide the original label/hint and create new ones for the new combobox
154-
const selectLabel = document.querySelector("label[for=".concat(selectEl.id, "]"));
154+
const selectLabel = document.querySelector(`label[for=${selectEl.id}]`);
155155
selectLabel.hidden = true;
156-
const selectHint = document.querySelector("#hint-".concat(selectEl.id));
156+
const selectHint = document.querySelector(`#hint-${selectEl.id}`);
157157
if (selectHint) {
158158
selectHint.hidden = true;
159159
}
160160
const div = document.createElement('div');
161161
div.classList.add('combo');
162-
div.id = "".concat(selectEl.id, "-js-multi-buttons");
162+
div.id = `${selectEl.id}-js-multi-buttons`;
163163
const divComboBox = document.createElement('div');
164164
divComboBox.setAttribute('role', 'combobox');
165165
divComboBox.setAttribute('aria-haspopup', 'listbox');
@@ -172,7 +172,7 @@ const MultiselectButtons = function (selectEl, params) {
172172
input.setAttribute('aria-controls', baseId + '-listbox');
173173
input.id = baseId + "-input";
174174
if (selectHint) {
175-
input.setAttribute('aria-describedby', "hint-".concat(input.id));
175+
input.setAttribute('aria-describedby', `hint-${input.id}`);
176176
}
177177
input.classList.add('combo-input');
178178
input.setAttribute('autocomplete', 'off');
@@ -191,14 +191,14 @@ const MultiselectButtons = function (selectEl, params) {
191191
const hintComboBox = selectHint ? selectHint.cloneNode(true) : null;
192192
if (selectHint) {
193193
hintComboBox.hidden = false;
194-
hintComboBox.id = "hint-".concat(input.id);
194+
hintComboBox.id = `hint-${input.id}`;
195195
}
196196
const ulCombo = document.createElement('ul');
197197
ulCombo.setAttribute('role', 'listbox');
198198
ulCombo.setAttribute('aria-multiselectable', 'true');
199199
ulCombo.id = baseId + '-listbox';
200200
ulCombo.setAttribute('aria-labelledby', baseId + '-label');
201-
ulCombo.classList.add('combo-menu');
201+
ulCombo.classList.add('combo-menu', 'clean-list');
202202
div.appendChild(divComboBox);
203203
div.appendChild(ulCombo);
204204
if (selectEl.multiple) {
@@ -248,12 +248,12 @@ const MultiselectButtons = function (selectEl, params) {
248248
const listItem = document.createElement('li');
249249
buttonEl.className = 'remove-option';
250250
buttonEl.type = 'button';
251-
buttonEl.id = "".concat(this.idBase, "-remove-").concat(index);
251+
buttonEl.id = `${this.idBase}-remove-${index}`;
252252
buttonEl.dataset.value = option.value;
253253
buttonEl.addEventListener('click', () => {
254254
this.removeOption(option);
255255
});
256-
buttonEl.innerHTML = "<span class=\"visuallyhidden\">Remove </span>".concat(option.text, " ");
256+
buttonEl.innerHTML = `<span class="visuallyhidden">Remove </span>${option.text} `;
257257
listItem.appendChild(buttonEl);
258258
this.selectedEl.appendChild(listItem);
259259
} else {
@@ -281,7 +281,7 @@ MultiselectButtons.prototype.init = function () {
281281
hint = document.createElement('li');
282282
hint.setAttribute('role', 'alert');
283283
}
284-
hint.innerText = "Please enter ".concat(this.minInput, " or more characters");
284+
hint.innerText = `Please enter ${this.minInput} or more characters`;
285285
if (!alreadyExists) {
286286
this.listboxEl.prepend(hint);
287287
}
@@ -320,7 +320,7 @@ MultiselectButtons.prototype.filterOptions = async function (value) {
320320
optionEl.setAttribute('aria-setsize', count);
321321
optionEl.setAttribute('aria-posinset', k + 1);
322322
}
323-
optionEl.id = "".concat(this.idBase, "-").concat(this.options.indexOf(o));
323+
optionEl.id = `${this.idBase}-${this.options.indexOf(o)}`;
324324
optionEl.className = 'combo-option';
325325
optionEl.setAttribute('aria-selected', alreadySelected);
326326
optionEl.dataset.value = o.value;
@@ -356,15 +356,15 @@ MultiselectButtons.prototype.filterOptions = async function (value) {
356356
};
357357
MultiselectButtons.prototype.updateResults = async function () {
358358
const url = new URL(this.source, window.location.protocol + '//' + window.location.host);
359-
url.search = "".concat(url.search ? url.search + '&' : '?', "q=").concat(this.inputEl.value, "&page=").concat(this.page);
359+
url.search = `${url.search ? url.search + '&' : '?'}q=${this.inputEl.value}&page=${this.page}`;
360360
const response = await fetch(url);
361361
const data = await response.json();
362362
if (this.page === 1) {
363363
this.options = [];
364364
}
365365
data.results.forEach(c => {
366366
this.ajaxResultCount = data.total;
367-
if (!this.select.querySelector("option[value=\"".concat(c.id, "\"]"))) {
367+
if (!this.select.querySelector(`option[value="${c.id}"]`)) {
368368
const o = document.createElement('option');
369369
o.value = c.id;
370370
o.innerText = c.text;
@@ -395,11 +395,10 @@ MultiselectButtons.prototype.onInput = async function () {
395395
await this.updateResults();
396396
hint.remove();
397397
} else {
398-
var _hint;
399398
this.clearOptions();
400-
(_hint = hint) !== null && _hint !== void 0 ? _hint : hint = document.createElement('li');
399+
hint ??= document.createElement('li');
401400
hint.setAttribute('role', 'alert');
402-
hint.innerText = "Please enter ".concat(this.minInput, " or more characters");
401+
hint.innerText = `Please enter ${this.minInput} or more characters`;
403402
this.listboxEl.prepend(hint);
404403
showHint = true;
405404
}
@@ -467,11 +466,11 @@ MultiselectButtons.prototype.onInputBlur = function () {
467466
};
468467
MultiselectButtons.prototype.onOptionChange = function (index) {
469468
this.activeIndex = index;
470-
this.inputEl.setAttribute('aria-activedescendant', "".concat(this.idBase, "-").concat(index));
469+
this.inputEl.setAttribute('aria-activedescendant', `${this.idBase}-${index}`);
471470

472471
// update active style
473472
const options = this.el.querySelectorAll('[role=option]');
474-
const currentOptions = this.el.querySelector("[id=".concat(this.idBase, "-").concat(index, "]"));
473+
const currentOptions = this.el.querySelector(`[id=${this.idBase}-${index}]`);
475474
[...options].forEach(optionEl => {
476475
optionEl.classList.remove('option-current');
477476
});
@@ -502,15 +501,15 @@ MultiselectButtons.prototype.removeOption = function (option) {
502501
// const index = this.options.indexOf(option);
503502

504503
// update aria-selected
505-
const o = this.el.querySelector("[data-value=\"".concat(option.value, "\"]"));
504+
const o = this.el.querySelector(`[data-value="${option.value}"]`);
506505
if (o) {
507506
o.setAttribute('aria-selected', 'false');
508507
o.classList.remove('option-selected');
509508
}
510509

511510
// remove button
512511
if (this.selectedEl) {
513-
const buttonEl = this.selectedEl.querySelector("[data-value=\"".concat(option.value, "\"]"));
512+
const buttonEl = this.selectedEl.querySelector(`[data-value="${option.value}"]`);
514513
this.selectedEl.removeChild(buttonEl.parentElement);
515514
}
516515
this.select.querySelector('option[value="' + option.value + '"]').removeAttribute('selected');
@@ -521,7 +520,7 @@ MultiselectButtons.prototype.selectOption = function (option) {
521520
this.activeIndex = index;
522521

523522
// update aria-selected
524-
const o = this.el.querySelector("[id=".concat(this.idBase, "-").concat(index, "]"));
523+
const o = this.el.querySelector(`[id=${this.idBase}-${index}]`);
525524
o.setAttribute('aria-selected', 'true');
526525
o.classList.add('option-selected');
527526

@@ -530,7 +529,7 @@ MultiselectButtons.prototype.selectOption = function (option) {
530529
const listItem = document.createElement('li');
531530
buttonEl.className = 'remove-option';
532531
buttonEl.type = 'button';
533-
buttonEl.id = "".concat(this.idBase, "-remove-").concat(index);
532+
buttonEl.id = `${this.idBase}-remove-${index}`;
534533
buttonEl.dataset.value = selected.value;
535534
buttonEl.addEventListener('click', () => {
536535
const sibling = listItem.nextSibling;
@@ -541,7 +540,7 @@ MultiselectButtons.prototype.selectOption = function (option) {
541540
this.inputEl.focus();
542541
}
543542
});
544-
buttonEl.innerHTML = "<span class=\"visuallyhidden\">Remove </span> ".concat(selected.text, " ");
543+
buttonEl.innerHTML = `<span class="visuallyhidden">Remove </span> ${selected.text} `;
545544
listItem.appendChild(buttonEl);
546545
if (this.select.multiple) {
547546
this.selectedEl.appendChild(listItem);
@@ -552,7 +551,7 @@ MultiselectButtons.prototype.selectOption = function (option) {
552551
this.select.querySelector('option[value="' + option.value + '"]').setAttribute('selected', 'selected');
553552
};
554553
MultiselectButtons.prototype.updateOption = function (index) {
555-
const optionEl = this.el.querySelector("[id=".concat(this.idBase, "-").concat(index, "]"));
554+
const optionEl = this.el.querySelector(`[id=${this.idBase}-${index}]`);
556555
const isSelected = optionEl.getAttribute('aria-selected') === 'true';
557556
this.inputEl.value = '';
558557
if (isSelected) {
@@ -567,7 +566,7 @@ MultiselectButtons.prototype.updateOption = function (index) {
567566
};
568567
MultiselectButtons.prototype.updateMenuState = function (open) {
569568
this.open = open;
570-
this.comboEl.setAttribute('aria-expanded', "".concat(open));
569+
this.comboEl.setAttribute('aria-expanded', `${open}`);
571570
open ? this.el.classList.add('open') : this.el.classList.remove('open');
572571
};
573572
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MultiselectButtons);

public/dist/assets/js/multiselect.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/assets/js/slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ let contentSlider = function () {
332332
*/
333333
function createControls() {
334334
let controls = document.createElement('ul');
335-
controls.setAttribute('class', 'slider-controls');
335+
controls.setAttribute('class', 'clean-list slider-controls');
336336
controls.setAttribute('aria-label', controlsDescription);
337337
controls.innerHTML = '<li><button class="button button--ghost js-previous with-icon--larger" aria-label="' + previousSlide + '" style="padding:0.4375rem;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512" class="icon icon--larger" focusable="false" aria-hidden="true" width="1em" height="1em"><path class="chevron-left" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"/><path class="chevron-right" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></button></li>' + '<li style="margin-top:0;margin-inline-start:0.25rem;"><button class="button button--ghost js-next with-icon--larger" aria-label="' + nextSlide + '" style="padding:0.4375rem;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512" class="icon icon--larger" focusable="false" aria-hidden="true" width="1em" height="1em"><path class="chevron-left" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"/><path class="chevron-right" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></button></li>';
338338
controls.style.display = 'inline-flex';

0 commit comments

Comments
 (0)