Skip to content

Commit 6cc1b1a

Browse files
committed
Revert built assets (clean PR)
1 parent 48cf82e commit 6cc1b1a

15 files changed

Lines changed: 79 additions & 182 deletions

public/assets/scripts/choices.js

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,11 +3668,6 @@
36683668
_this.input.focus();
36693669
}
36703670
_this.passedElement.triggerEvent(EventType.showDropdown);
3671-
var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
3672-
if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
3673-
// We use the native scrollIntoView function instead of choiceList.scrollToChildElement to avoid animated scroll.
3674-
activeElement.scrollIntoView();
3675-
}
36763671
});
36773672
return this;
36783673
};
@@ -3681,7 +3676,6 @@
36813676
if (!this.dropdown.isActive) {
36823677
return this;
36833678
}
3684-
this._removeHighlightedChoices();
36853679
requestAnimationFrame(function () {
36863680
_this.dropdown.hide();
36873681
_this.containerOuter.close();
@@ -4254,7 +4248,7 @@
42544248
if (!items.length || !this.config.removeItems || !this.config.removeItemButton) {
42554249
return;
42564250
}
4257-
var id = element && parseDataSetId(element.closest('[data-id]'));
4251+
var id = element && parseDataSetId(element.parentElement);
42584252
var itemToRemove = id && items.find(function (item) { return item.id === id; });
42594253
if (!itemToRemove) {
42604254
return;
@@ -4834,7 +4828,7 @@
48344828
*/
48354829
Choices.prototype._onMouseDown = function (event) {
48364830
var target = event.target;
4837-
if (!(target instanceof Element)) {
4831+
if (!(target instanceof HTMLElement)) {
48384832
return;
48394833
}
48404834
// If we have our mouse down on the scrollbar and are on IE11...
@@ -4976,18 +4970,6 @@
49764970
Choices.prototype._onInvalid = function () {
49774971
this.containerOuter.addInvalidState();
49784972
};
4979-
/**
4980-
* Removes any highlighted choice options
4981-
*/
4982-
Choices.prototype._removeHighlightedChoices = function () {
4983-
var highlightedState = this.config.classNames.highlightedState;
4984-
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4985-
// Remove any highlighted choices
4986-
highlightedChoices.forEach(function (choice) {
4987-
removeClassesFromElement(choice, highlightedState);
4988-
choice.setAttribute('aria-selected', 'false');
4989-
});
4990-
};
49914973
Choices.prototype._highlightChoice = function (el) {
49924974
if (el === void 0) { el = null; }
49934975
var choices = Array.from(this.dropdown.element.querySelectorAll(selectableChoiceIdentifier));
@@ -4996,7 +4978,12 @@
49964978
}
49974979
var passedEl = el;
49984980
var highlightedState = this.config.classNames.highlightedState;
4999-
this._removeHighlightedChoices();
4981+
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4982+
// Remove any highlighted choices
4983+
highlightedChoices.forEach(function (choice) {
4984+
removeClassesFromElement(choice, highlightedState);
4985+
choice.setAttribute('aria-selected', 'false');
4986+
});
50004987
if (passedEl) {
50014988
this._highlightPosition = choices.indexOf(passedEl);
50024989
}

public/assets/scripts/choices.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/assets/scripts/choices.mjs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3662,11 +3662,6 @@ var Choices = /** @class */ (function () {
36623662
_this.input.focus();
36633663
}
36643664
_this.passedElement.triggerEvent(EventType.showDropdown);
3665-
var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
3666-
if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
3667-
// We use the native scrollIntoView function instead of choiceList.scrollToChildElement to avoid animated scroll.
3668-
activeElement.scrollIntoView();
3669-
}
36703665
});
36713666
return this;
36723667
};
@@ -3675,7 +3670,6 @@ var Choices = /** @class */ (function () {
36753670
if (!this.dropdown.isActive) {
36763671
return this;
36773672
}
3678-
this._removeHighlightedChoices();
36793673
requestAnimationFrame(function () {
36803674
_this.dropdown.hide();
36813675
_this.containerOuter.close();
@@ -4248,7 +4242,7 @@ var Choices = /** @class */ (function () {
42484242
if (!items.length || !this.config.removeItems || !this.config.removeItemButton) {
42494243
return;
42504244
}
4251-
var id = element && parseDataSetId(element.closest('[data-id]'));
4245+
var id = element && parseDataSetId(element.parentElement);
42524246
var itemToRemove = id && items.find(function (item) { return item.id === id; });
42534247
if (!itemToRemove) {
42544248
return;
@@ -4828,7 +4822,7 @@ var Choices = /** @class */ (function () {
48284822
*/
48294823
Choices.prototype._onMouseDown = function (event) {
48304824
var target = event.target;
4831-
if (!(target instanceof Element)) {
4825+
if (!(target instanceof HTMLElement)) {
48324826
return;
48334827
}
48344828
// If we have our mouse down on the scrollbar and are on IE11...
@@ -4970,18 +4964,6 @@ var Choices = /** @class */ (function () {
49704964
Choices.prototype._onInvalid = function () {
49714965
this.containerOuter.addInvalidState();
49724966
};
4973-
/**
4974-
* Removes any highlighted choice options
4975-
*/
4976-
Choices.prototype._removeHighlightedChoices = function () {
4977-
var highlightedState = this.config.classNames.highlightedState;
4978-
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4979-
// Remove any highlighted choices
4980-
highlightedChoices.forEach(function (choice) {
4981-
removeClassesFromElement(choice, highlightedState);
4982-
choice.setAttribute('aria-selected', 'false');
4983-
});
4984-
};
49854967
Choices.prototype._highlightChoice = function (el) {
49864968
if (el === void 0) { el = null; }
49874969
var choices = Array.from(this.dropdown.element.querySelectorAll(selectableChoiceIdentifier));
@@ -4990,7 +4972,12 @@ var Choices = /** @class */ (function () {
49904972
}
49914973
var passedEl = el;
49924974
var highlightedState = this.config.classNames.highlightedState;
4993-
this._removeHighlightedChoices();
4975+
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4976+
// Remove any highlighted choices
4977+
highlightedChoices.forEach(function (choice) {
4978+
removeClassesFromElement(choice, highlightedState);
4979+
choice.setAttribute('aria-selected', 'false');
4980+
});
49944981
if (passedEl) {
49954982
this._highlightPosition = choices.indexOf(passedEl);
49964983
}

public/assets/scripts/choices.search-basic.js

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,11 +3189,6 @@
31893189
_this.input.focus();
31903190
}
31913191
_this.passedElement.triggerEvent(EventType.showDropdown);
3192-
var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
3193-
if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
3194-
// We use the native scrollIntoView function instead of choiceList.scrollToChildElement to avoid animated scroll.
3195-
activeElement.scrollIntoView();
3196-
}
31973192
});
31983193
return this;
31993194
};
@@ -3202,7 +3197,6 @@
32023197
if (!this.dropdown.isActive) {
32033198
return this;
32043199
}
3205-
this._removeHighlightedChoices();
32063200
requestAnimationFrame(function () {
32073201
_this.dropdown.hide();
32083202
_this.containerOuter.close();
@@ -3775,7 +3769,7 @@
37753769
if (!items.length || !this.config.removeItems || !this.config.removeItemButton) {
37763770
return;
37773771
}
3778-
var id = element && parseDataSetId(element.closest('[data-id]'));
3772+
var id = element && parseDataSetId(element.parentElement);
37793773
var itemToRemove = id && items.find(function (item) { return item.id === id; });
37803774
if (!itemToRemove) {
37813775
return;
@@ -4355,7 +4349,7 @@
43554349
*/
43564350
Choices.prototype._onMouseDown = function (event) {
43574351
var target = event.target;
4358-
if (!(target instanceof Element)) {
4352+
if (!(target instanceof HTMLElement)) {
43594353
return;
43604354
}
43614355
// If we have our mouse down on the scrollbar and are on IE11...
@@ -4497,18 +4491,6 @@
44974491
Choices.prototype._onInvalid = function () {
44984492
this.containerOuter.addInvalidState();
44994493
};
4500-
/**
4501-
* Removes any highlighted choice options
4502-
*/
4503-
Choices.prototype._removeHighlightedChoices = function () {
4504-
var highlightedState = this.config.classNames.highlightedState;
4505-
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4506-
// Remove any highlighted choices
4507-
highlightedChoices.forEach(function (choice) {
4508-
removeClassesFromElement(choice, highlightedState);
4509-
choice.setAttribute('aria-selected', 'false');
4510-
});
4511-
};
45124494
Choices.prototype._highlightChoice = function (el) {
45134495
if (el === void 0) { el = null; }
45144496
var choices = Array.from(this.dropdown.element.querySelectorAll(selectableChoiceIdentifier));
@@ -4517,7 +4499,12 @@
45174499
}
45184500
var passedEl = el;
45194501
var highlightedState = this.config.classNames.highlightedState;
4520-
this._removeHighlightedChoices();
4502+
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4503+
// Remove any highlighted choices
4504+
highlightedChoices.forEach(function (choice) {
4505+
removeClassesFromElement(choice, highlightedState);
4506+
choice.setAttribute('aria-selected', 'false');
4507+
});
45214508
if (passedEl) {
45224509
this._highlightPosition = choices.indexOf(passedEl);
45234510
}

public/assets/scripts/choices.search-basic.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/assets/scripts/choices.search-basic.mjs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3183,11 +3183,6 @@ var Choices = /** @class */ (function () {
31833183
_this.input.focus();
31843184
}
31853185
_this.passedElement.triggerEvent(EventType.showDropdown);
3186-
var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
3187-
if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
3188-
// We use the native scrollIntoView function instead of choiceList.scrollToChildElement to avoid animated scroll.
3189-
activeElement.scrollIntoView();
3190-
}
31913186
});
31923187
return this;
31933188
};
@@ -3196,7 +3191,6 @@ var Choices = /** @class */ (function () {
31963191
if (!this.dropdown.isActive) {
31973192
return this;
31983193
}
3199-
this._removeHighlightedChoices();
32003194
requestAnimationFrame(function () {
32013195
_this.dropdown.hide();
32023196
_this.containerOuter.close();
@@ -3769,7 +3763,7 @@ var Choices = /** @class */ (function () {
37693763
if (!items.length || !this.config.removeItems || !this.config.removeItemButton) {
37703764
return;
37713765
}
3772-
var id = element && parseDataSetId(element.closest('[data-id]'));
3766+
var id = element && parseDataSetId(element.parentElement);
37733767
var itemToRemove = id && items.find(function (item) { return item.id === id; });
37743768
if (!itemToRemove) {
37753769
return;
@@ -4349,7 +4343,7 @@ var Choices = /** @class */ (function () {
43494343
*/
43504344
Choices.prototype._onMouseDown = function (event) {
43514345
var target = event.target;
4352-
if (!(target instanceof Element)) {
4346+
if (!(target instanceof HTMLElement)) {
43534347
return;
43544348
}
43554349
// If we have our mouse down on the scrollbar and are on IE11...
@@ -4491,18 +4485,6 @@ var Choices = /** @class */ (function () {
44914485
Choices.prototype._onInvalid = function () {
44924486
this.containerOuter.addInvalidState();
44934487
};
4494-
/**
4495-
* Removes any highlighted choice options
4496-
*/
4497-
Choices.prototype._removeHighlightedChoices = function () {
4498-
var highlightedState = this.config.classNames.highlightedState;
4499-
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4500-
// Remove any highlighted choices
4501-
highlightedChoices.forEach(function (choice) {
4502-
removeClassesFromElement(choice, highlightedState);
4503-
choice.setAttribute('aria-selected', 'false');
4504-
});
4505-
};
45064488
Choices.prototype._highlightChoice = function (el) {
45074489
if (el === void 0) { el = null; }
45084490
var choices = Array.from(this.dropdown.element.querySelectorAll(selectableChoiceIdentifier));
@@ -4511,7 +4493,12 @@ var Choices = /** @class */ (function () {
45114493
}
45124494
var passedEl = el;
45134495
var highlightedState = this.config.classNames.highlightedState;
4514-
this._removeHighlightedChoices();
4496+
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
4497+
// Remove any highlighted choices
4498+
highlightedChoices.forEach(function (choice) {
4499+
removeClassesFromElement(choice, highlightedState);
4500+
choice.setAttribute('aria-selected', 'false');
4501+
});
45154502
if (passedEl) {
45164503
this._highlightPosition = choices.indexOf(passedEl);
45174504
}

public/assets/scripts/choices.search-kmp.js

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,11 +2075,6 @@
20752075
_this.input.focus();
20762076
}
20772077
_this.passedElement.triggerEvent(EventType.showDropdown);
2078-
var activeElement = _this.choiceList.element.querySelector(getClassNamesSelector(_this.config.classNames.selectedState));
2079-
if (activeElement !== null && !isScrolledIntoView(activeElement, _this.choiceList.element)) {
2080-
// We use the native scrollIntoView function instead of choiceList.scrollToChildElement to avoid animated scroll.
2081-
activeElement.scrollIntoView();
2082-
}
20832078
});
20842079
return this;
20852080
};
@@ -2088,7 +2083,6 @@
20882083
if (!this.dropdown.isActive) {
20892084
return this;
20902085
}
2091-
this._removeHighlightedChoices();
20922086
requestAnimationFrame(function () {
20932087
_this.dropdown.hide();
20942088
_this.containerOuter.close();
@@ -2661,7 +2655,7 @@
26612655
if (!items.length || !this.config.removeItems || !this.config.removeItemButton) {
26622656
return;
26632657
}
2664-
var id = element && parseDataSetId(element.closest('[data-id]'));
2658+
var id = element && parseDataSetId(element.parentElement);
26652659
var itemToRemove = id && items.find(function (item) { return item.id === id; });
26662660
if (!itemToRemove) {
26672661
return;
@@ -3241,7 +3235,7 @@
32413235
*/
32423236
Choices.prototype._onMouseDown = function (event) {
32433237
var target = event.target;
3244-
if (!(target instanceof Element)) {
3238+
if (!(target instanceof HTMLElement)) {
32453239
return;
32463240
}
32473241
// If we have our mouse down on the scrollbar and are on IE11...
@@ -3383,18 +3377,6 @@
33833377
Choices.prototype._onInvalid = function () {
33843378
this.containerOuter.addInvalidState();
33853379
};
3386-
/**
3387-
* Removes any highlighted choice options
3388-
*/
3389-
Choices.prototype._removeHighlightedChoices = function () {
3390-
var highlightedState = this.config.classNames.highlightedState;
3391-
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
3392-
// Remove any highlighted choices
3393-
highlightedChoices.forEach(function (choice) {
3394-
removeClassesFromElement(choice, highlightedState);
3395-
choice.setAttribute('aria-selected', 'false');
3396-
});
3397-
};
33983380
Choices.prototype._highlightChoice = function (el) {
33993381
if (el === void 0) { el = null; }
34003382
var choices = Array.from(this.dropdown.element.querySelectorAll(selectableChoiceIdentifier));
@@ -3403,7 +3385,12 @@
34033385
}
34043386
var passedEl = el;
34053387
var highlightedState = this.config.classNames.highlightedState;
3406-
this._removeHighlightedChoices();
3388+
var highlightedChoices = Array.from(this.dropdown.element.querySelectorAll(getClassNamesSelector(highlightedState)));
3389+
// Remove any highlighted choices
3390+
highlightedChoices.forEach(function (choice) {
3391+
removeClassesFromElement(choice, highlightedState);
3392+
choice.setAttribute('aria-selected', 'false');
3393+
});
34073394
if (passedEl) {
34083395
this._highlightPosition = choices.indexOf(passedEl);
34093396
}

public/assets/scripts/choices.search-kmp.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.

0 commit comments

Comments
 (0)