Skip to content

Commit

Permalink
Compile JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Sep 4, 2024
1 parent 3d79892 commit acd1db0
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 103 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "choices.js",
"version": "11.0.1",
"version": "11.0.2",
"description": "A vanilla JS customisable text input/select box plugin",
"type": "module",
"main": "./public/assets/scripts/choices.js",
Expand Down
27 changes: 11 additions & 16 deletions public/assets/scripts/choices.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.1 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.2 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -3543,7 +3543,7 @@
}
this._store.dispatch(highlightItem(choice, false));
if (runEvent) {
this.passedElement.triggerEvent(EventType.highlightItem, this._getChoiceForOutput(choice));
this.passedElement.triggerEvent(EventType.unhighlightItem, this._getChoiceForOutput(choice));
}
return this;
};
Expand Down Expand Up @@ -3880,6 +3880,7 @@
if (!choice) {
return this;
}
this._clearNotice();
this._store.dispatch(removeChoice(choice));
// @todo integrate with Store
this._searcher.reset();
Expand All @@ -3895,7 +3896,7 @@
Choices.prototype.clearStore = function () {
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._stopSearch();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand All @@ -3906,10 +3907,7 @@
Choices.prototype.clearInput = function () {
var shouldSetInputWidth = !this._isSelectOneElement;
this.input.clear(shouldSetInputWidth);
this._clearNotice();
if (this._isSearching) {
this._stopSearch();
}
this._stopSearch();
return this;
};
Choices.prototype._validateConfig = function () {
Expand Down Expand Up @@ -4021,19 +4019,15 @@
renderChoices(renderableChoices(activeChoices), false, undefined);
}
}
var notice = this._notice;
if (!selectableChoices) {
if (!notice) {
if (!this._notice) {
this._notice = {
text: resolveStringFunction(config.noChoicesText),
type: NoticeTypes.noChoices,
text: resolveStringFunction(isSearching ? config.noResultsText : config.noChoicesText),
type: isSearching ? NoticeTypes.noResults : NoticeTypes.noChoices,
};
}
fragment.replaceChildren('');
}
else if (notice && notice.type === NoticeTypes.noChoices) {
this._notice = undefined;
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
if (selectableChoices) {
Expand Down Expand Up @@ -4427,6 +4421,7 @@
var wasSearching = this._isSearching;
this._currentValue = '';
this._isSearching = false;
this._clearNotice();
if (wasSearching) {
this._store.dispatch(activateChoices(true));
this.passedElement.triggerEvent(EventType.search, {
Expand Down Expand Up @@ -4579,7 +4574,6 @@
else {
this._stopSearch();
}
this._clearNotice();
return;
}
if (!this._canAddItems()) {
Expand Down Expand Up @@ -4965,6 +4959,7 @@
if ((prependValue || appendValue) && choice.element) {
choice.element.value = choice.value;
}
this._clearNotice();
this._store.dispatch(addChoice(choice));
if (choice.selected) {
this._addItem(choice, withEvents, userTriggered);
Expand Down Expand Up @@ -5153,7 +5148,7 @@
throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
}
};
Choices.version = '11.0.1';
Choices.version = '11.0.2';
return Choices;
}());

Expand Down
4 changes: 2 additions & 2 deletions public/assets/scripts/choices.min.js

Large diffs are not rendered by default.

27 changes: 11 additions & 16 deletions public/assets/scripts/choices.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.1 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.2 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

/******************************************************************************
Copyright (c) Microsoft Corporation.
Expand Down Expand Up @@ -3537,7 +3537,7 @@ var Choices = /** @class */ (function () {
}
this._store.dispatch(highlightItem(choice, false));
if (runEvent) {
this.passedElement.triggerEvent(EventType.highlightItem, this._getChoiceForOutput(choice));
this.passedElement.triggerEvent(EventType.unhighlightItem, this._getChoiceForOutput(choice));
}
return this;
};
Expand Down Expand Up @@ -3874,6 +3874,7 @@ var Choices = /** @class */ (function () {
if (!choice) {
return this;
}
this._clearNotice();
this._store.dispatch(removeChoice(choice));
// @todo integrate with Store
this._searcher.reset();
Expand All @@ -3889,7 +3890,7 @@ var Choices = /** @class */ (function () {
Choices.prototype.clearStore = function () {
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._stopSearch();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand All @@ -3900,10 +3901,7 @@ var Choices = /** @class */ (function () {
Choices.prototype.clearInput = function () {
var shouldSetInputWidth = !this._isSelectOneElement;
this.input.clear(shouldSetInputWidth);
this._clearNotice();
if (this._isSearching) {
this._stopSearch();
}
this._stopSearch();
return this;
};
Choices.prototype._validateConfig = function () {
Expand Down Expand Up @@ -4015,19 +4013,15 @@ var Choices = /** @class */ (function () {
renderChoices(renderableChoices(activeChoices), false, undefined);
}
}
var notice = this._notice;
if (!selectableChoices) {
if (!notice) {
if (!this._notice) {
this._notice = {
text: resolveStringFunction(config.noChoicesText),
type: NoticeTypes.noChoices,
text: resolveStringFunction(isSearching ? config.noResultsText : config.noChoicesText),
type: isSearching ? NoticeTypes.noResults : NoticeTypes.noChoices,
};
}
fragment.replaceChildren('');
}
else if (notice && notice.type === NoticeTypes.noChoices) {
this._notice = undefined;
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
if (selectableChoices) {
Expand Down Expand Up @@ -4421,6 +4415,7 @@ var Choices = /** @class */ (function () {
var wasSearching = this._isSearching;
this._currentValue = '';
this._isSearching = false;
this._clearNotice();
if (wasSearching) {
this._store.dispatch(activateChoices(true));
this.passedElement.triggerEvent(EventType.search, {
Expand Down Expand Up @@ -4573,7 +4568,6 @@ var Choices = /** @class */ (function () {
else {
this._stopSearch();
}
this._clearNotice();
return;
}
if (!this._canAddItems()) {
Expand Down Expand Up @@ -4959,6 +4953,7 @@ var Choices = /** @class */ (function () {
if ((prependValue || appendValue) && choice.element) {
choice.element.value = choice.value;
}
this._clearNotice();
this._store.dispatch(addChoice(choice));
if (choice.selected) {
this._addItem(choice, withEvents, userTriggered);
Expand Down Expand Up @@ -5147,7 +5142,7 @@ var Choices = /** @class */ (function () {
throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
}
};
Choices.version = '11.0.1';
Choices.version = '11.0.2';
return Choices;
}());

Expand Down
27 changes: 11 additions & 16 deletions public/assets/scripts/choices.search-basic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.1 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.2 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand Down Expand Up @@ -3061,7 +3061,7 @@
}
this._store.dispatch(highlightItem(choice, false));
if (runEvent) {
this.passedElement.triggerEvent(EventType.highlightItem, this._getChoiceForOutput(choice));
this.passedElement.triggerEvent(EventType.unhighlightItem, this._getChoiceForOutput(choice));
}
return this;
};
Expand Down Expand Up @@ -3398,6 +3398,7 @@
if (!choice) {
return this;
}
this._clearNotice();
this._store.dispatch(removeChoice(choice));
// @todo integrate with Store
this._searcher.reset();
Expand All @@ -3413,7 +3414,7 @@
Choices.prototype.clearStore = function () {
this.itemList.element.replaceChildren('');
this.choiceList.element.replaceChildren('');
this._clearNotice();
this._stopSearch();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
Expand All @@ -3424,10 +3425,7 @@
Choices.prototype.clearInput = function () {
var shouldSetInputWidth = !this._isSelectOneElement;
this.input.clear(shouldSetInputWidth);
this._clearNotice();
if (this._isSearching) {
this._stopSearch();
}
this._stopSearch();
return this;
};
Choices.prototype._validateConfig = function () {
Expand Down Expand Up @@ -3539,19 +3537,15 @@
renderChoices(renderableChoices(activeChoices), false, undefined);
}
}
var notice = this._notice;
if (!selectableChoices) {
if (!notice) {
if (!this._notice) {
this._notice = {
text: resolveStringFunction(config.noChoicesText),
type: NoticeTypes.noChoices,
text: resolveStringFunction(isSearching ? config.noResultsText : config.noChoicesText),
type: isSearching ? NoticeTypes.noResults : NoticeTypes.noChoices,
};
}
fragment.replaceChildren('');
}
else if (notice && notice.type === NoticeTypes.noChoices) {
this._notice = undefined;
}
this._renderNotice(fragment);
this.choiceList.element.replaceChildren(fragment);
if (selectableChoices) {
Expand Down Expand Up @@ -3945,6 +3939,7 @@
var wasSearching = this._isSearching;
this._currentValue = '';
this._isSearching = false;
this._clearNotice();
if (wasSearching) {
this._store.dispatch(activateChoices(true));
this.passedElement.triggerEvent(EventType.search, {
Expand Down Expand Up @@ -4097,7 +4092,6 @@
else {
this._stopSearch();
}
this._clearNotice();
return;
}
if (!this._canAddItems()) {
Expand Down Expand Up @@ -4483,6 +4477,7 @@
if ((prependValue || appendValue) && choice.element) {
choice.element.value = choice.value;
}
this._clearNotice();
this._store.dispatch(addChoice(choice));
if (choice.selected) {
this._addItem(choice, withEvents, userTriggered);
Expand Down Expand Up @@ -4671,7 +4666,7 @@
throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
}
};
Choices.version = '11.0.1';
Choices.version = '11.0.2';
return Choices;
}());

Expand Down
4 changes: 2 additions & 2 deletions public/assets/scripts/choices.search-basic.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit acd1db0

Please sign in to comment.