Skip to content

Commit

Permalink
Compile JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Dec 22, 2024
1 parent d0849aa commit 08c6ce8
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 75 deletions.
29 changes: 17 additions & 12 deletions public/assets/scripts/choices.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@
score: 0,
rank: 0,
value: option.value,
label: option.innerHTML,
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
element: option,
active: true,
// this returns true if nothing is selected on initial load, which will break placeholder support
Expand Down Expand Up @@ -3630,11 +3630,15 @@
if (this.dropdown.isActive) {
return this;
}
if (preventInputFocus === undefined) {
// eslint-disable-next-line no-param-reassign
preventInputFocus = !this._canSearch;
}
requestAnimationFrame(function () {
_this.dropdown.show();
var rect = _this.dropdown.element.getBoundingClientRect();
_this.containerOuter.open(rect.bottom, rect.height);
if (!preventInputFocus && _this._canSearch) {
if (!preventInputFocus) {
_this.input.focus();
}
_this.passedElement.triggerEvent(EventType.showDropdown);
Expand Down Expand Up @@ -3936,6 +3940,7 @@
}
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand Down Expand Up @@ -4392,6 +4397,7 @@
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
this.choiceList.element.replaceChildren('');
this._notice = undefined;
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
return false;
}
Expand Down Expand Up @@ -4704,6 +4710,7 @@
if (hasActiveDropdown) {
event.stopPropagation();
this.hideDropdown(true);
this._stopSearch();
this.containerOuter.element.focus();
}
};
Expand Down Expand Up @@ -4880,17 +4887,11 @@
var blurWasWithinContainer = target && containerOuter.element.contains(target);
if (blurWasWithinContainer && !this._isScrollingOnIe) {
var targetIsInput = target === this.input.element;
if (this._isTextElement || this._isSelectMultipleElement) {
if (targetIsInput) {
containerOuter.removeFocusState();
this.hideDropdown(true);
this.unhighlightAll();
}
}
else {
if (targetIsInput) {
containerOuter.removeFocusState();
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
this.hideDropdown(true);
this.hideDropdown(true);
if (this._isTextElement || this._isSelectMultipleElement) {
this.unhighlightAll();
}
}
}
Expand Down Expand Up @@ -4978,6 +4979,10 @@
return;
}
this._store.dispatch(removeItem$1(item));
var notice = this._notice;
if (notice && notice.type === NoticeTypes.noChoices) {
this._clearNotice();
}
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
};
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {
Expand Down
2 changes: 1 addition & 1 deletion public/assets/scripts/choices.min.js

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions public/assets/scripts/choices.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ var WrappedSelect = /** @class */ (function (_super) {
score: 0,
rank: 0,
value: option.value,
label: option.innerHTML,
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
element: option,
active: true,
// this returns true if nothing is selected on initial load, which will break placeholder support
Expand Down Expand Up @@ -3624,11 +3624,15 @@ var Choices = /** @class */ (function () {
if (this.dropdown.isActive) {
return this;
}
if (preventInputFocus === undefined) {
// eslint-disable-next-line no-param-reassign
preventInputFocus = !this._canSearch;
}
requestAnimationFrame(function () {
_this.dropdown.show();
var rect = _this.dropdown.element.getBoundingClientRect();
_this.containerOuter.open(rect.bottom, rect.height);
if (!preventInputFocus && _this._canSearch) {
if (!preventInputFocus) {
_this.input.focus();
}
_this.passedElement.triggerEvent(EventType.showDropdown);
Expand Down Expand Up @@ -3930,6 +3934,7 @@ var Choices = /** @class */ (function () {
}
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand Down Expand Up @@ -4386,6 +4391,7 @@ var Choices = /** @class */ (function () {
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
this.choiceList.element.replaceChildren('');
this._notice = undefined;
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
return false;
}
Expand Down Expand Up @@ -4698,6 +4704,7 @@ var Choices = /** @class */ (function () {
if (hasActiveDropdown) {
event.stopPropagation();
this.hideDropdown(true);
this._stopSearch();
this.containerOuter.element.focus();
}
};
Expand Down Expand Up @@ -4874,17 +4881,11 @@ var Choices = /** @class */ (function () {
var blurWasWithinContainer = target && containerOuter.element.contains(target);
if (blurWasWithinContainer && !this._isScrollingOnIe) {
var targetIsInput = target === this.input.element;
if (this._isTextElement || this._isSelectMultipleElement) {
if (targetIsInput) {
containerOuter.removeFocusState();
this.hideDropdown(true);
this.unhighlightAll();
}
}
else {
if (targetIsInput) {
containerOuter.removeFocusState();
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
this.hideDropdown(true);
this.hideDropdown(true);
if (this._isTextElement || this._isSelectMultipleElement) {
this.unhighlightAll();
}
}
}
Expand Down Expand Up @@ -4972,6 +4973,10 @@ var Choices = /** @class */ (function () {
return;
}
this._store.dispatch(removeItem$1(item));
var notice = this._notice;
if (notice && notice.type === NoticeTypes.noChoices) {
this._clearNotice();
}
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
};
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {
Expand Down
29 changes: 17 additions & 12 deletions public/assets/scripts/choices.search-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@
score: 0,
rank: 0,
value: option.value,
label: option.innerHTML,
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
element: option,
active: true,
// this returns true if nothing is selected on initial load, which will break placeholder support
Expand Down Expand Up @@ -3148,11 +3148,15 @@
if (this.dropdown.isActive) {
return this;
}
if (preventInputFocus === undefined) {
// eslint-disable-next-line no-param-reassign
preventInputFocus = !this._canSearch;
}
requestAnimationFrame(function () {
_this.dropdown.show();
var rect = _this.dropdown.element.getBoundingClientRect();
_this.containerOuter.open(rect.bottom, rect.height);
if (!preventInputFocus && _this._canSearch) {
if (!preventInputFocus) {
_this.input.focus();
}
_this.passedElement.triggerEvent(EventType.showDropdown);
Expand Down Expand Up @@ -3454,6 +3458,7 @@
}
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand Down Expand Up @@ -3910,6 +3915,7 @@
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
this.choiceList.element.replaceChildren('');
this._notice = undefined;
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
return false;
}
Expand Down Expand Up @@ -4222,6 +4228,7 @@
if (hasActiveDropdown) {
event.stopPropagation();
this.hideDropdown(true);
this._stopSearch();
this.containerOuter.element.focus();
}
};
Expand Down Expand Up @@ -4398,17 +4405,11 @@
var blurWasWithinContainer = target && containerOuter.element.contains(target);
if (blurWasWithinContainer && !this._isScrollingOnIe) {
var targetIsInput = target === this.input.element;
if (this._isTextElement || this._isSelectMultipleElement) {
if (targetIsInput) {
containerOuter.removeFocusState();
this.hideDropdown(true);
this.unhighlightAll();
}
}
else {
if (targetIsInput) {
containerOuter.removeFocusState();
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
this.hideDropdown(true);
this.hideDropdown(true);
if (this._isTextElement || this._isSelectMultipleElement) {
this.unhighlightAll();
}
}
}
Expand Down Expand Up @@ -4496,6 +4497,10 @@
return;
}
this._store.dispatch(removeItem$1(item));
var notice = this._notice;
if (notice && notice.type === NoticeTypes.noChoices) {
this._clearNotice();
}
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
};
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {
Expand Down
2 changes: 1 addition & 1 deletion public/assets/scripts/choices.search-basic.min.js

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions public/assets/scripts/choices.search-basic.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ var WrappedSelect = /** @class */ (function (_super) {
score: 0,
rank: 0,
value: option.value,
label: option.innerHTML,
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
element: option,
active: true,
// this returns true if nothing is selected on initial load, which will break placeholder support
Expand Down Expand Up @@ -3142,11 +3142,15 @@ var Choices = /** @class */ (function () {
if (this.dropdown.isActive) {
return this;
}
if (preventInputFocus === undefined) {
// eslint-disable-next-line no-param-reassign
preventInputFocus = !this._canSearch;
}
requestAnimationFrame(function () {
_this.dropdown.show();
var rect = _this.dropdown.element.getBoundingClientRect();
_this.containerOuter.open(rect.bottom, rect.height);
if (!preventInputFocus && _this._canSearch) {
if (!preventInputFocus) {
_this.input.focus();
}
_this.passedElement.triggerEvent(EventType.showDropdown);
Expand Down Expand Up @@ -3448,6 +3452,7 @@ var Choices = /** @class */ (function () {
}
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand Down Expand Up @@ -3904,6 +3909,7 @@ var Choices = /** @class */ (function () {
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
this.choiceList.element.replaceChildren('');
this._notice = undefined;
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
return false;
}
Expand Down Expand Up @@ -4216,6 +4222,7 @@ var Choices = /** @class */ (function () {
if (hasActiveDropdown) {
event.stopPropagation();
this.hideDropdown(true);
this._stopSearch();
this.containerOuter.element.focus();
}
};
Expand Down Expand Up @@ -4392,17 +4399,11 @@ var Choices = /** @class */ (function () {
var blurWasWithinContainer = target && containerOuter.element.contains(target);
if (blurWasWithinContainer && !this._isScrollingOnIe) {
var targetIsInput = target === this.input.element;
if (this._isTextElement || this._isSelectMultipleElement) {
if (targetIsInput) {
containerOuter.removeFocusState();
this.hideDropdown(true);
this.unhighlightAll();
}
}
else {
if (targetIsInput) {
containerOuter.removeFocusState();
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
this.hideDropdown(true);
this.hideDropdown(true);
if (this._isTextElement || this._isSelectMultipleElement) {
this.unhighlightAll();
}
}
}
Expand Down Expand Up @@ -4490,6 +4491,10 @@ var Choices = /** @class */ (function () {
return;
}
this._store.dispatch(removeItem$1(item));
var notice = this._notice;
if (notice && notice.type === NoticeTypes.noChoices) {
this._clearNotice();
}
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
};
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {
Expand Down
Loading

0 comments on commit 08c6ce8

Please sign in to comment.