Skip to content

Commit 08c6ce8

Browse files
committed
Compile JS files
1 parent d0849aa commit 08c6ce8

9 files changed

+105
-75
lines changed

public/assets/scripts/choices.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@
871871
score: 0,
872872
rank: 0,
873873
value: option.value,
874-
label: option.innerHTML,
874+
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
875875
element: option,
876876
active: true,
877877
// this returns true if nothing is selected on initial load, which will break placeholder support
@@ -3630,11 +3630,15 @@
36303630
if (this.dropdown.isActive) {
36313631
return this;
36323632
}
3633+
if (preventInputFocus === undefined) {
3634+
// eslint-disable-next-line no-param-reassign
3635+
preventInputFocus = !this._canSearch;
3636+
}
36333637
requestAnimationFrame(function () {
36343638
_this.dropdown.show();
36353639
var rect = _this.dropdown.element.getBoundingClientRect();
36363640
_this.containerOuter.open(rect.bottom, rect.height);
3637-
if (!preventInputFocus && _this._canSearch) {
3641+
if (!preventInputFocus) {
36383642
_this.input.focus();
36393643
}
36403644
_this.passedElement.triggerEvent(EventType.showDropdown);
@@ -3936,6 +3940,7 @@
39363940
}
39373941
this.itemList.element.replaceChildren('');
39383942
this.choiceList.element.replaceChildren('');
3943+
this._clearNotice();
39393944
this._store.reset();
39403945
this._lastAddedChoiceId = 0;
39413946
this._lastAddedGroupId = 0;
@@ -4392,6 +4397,7 @@
43924397
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
43934398
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
43944399
this.choiceList.element.replaceChildren('');
4400+
this._notice = undefined;
43954401
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
43964402
return false;
43974403
}
@@ -4704,6 +4710,7 @@
47044710
if (hasActiveDropdown) {
47054711
event.stopPropagation();
47064712
this.hideDropdown(true);
4713+
this._stopSearch();
47074714
this.containerOuter.element.focus();
47084715
}
47094716
};
@@ -4880,17 +4887,11 @@
48804887
var blurWasWithinContainer = target && containerOuter.element.contains(target);
48814888
if (blurWasWithinContainer && !this._isScrollingOnIe) {
48824889
var targetIsInput = target === this.input.element;
4883-
if (this._isTextElement || this._isSelectMultipleElement) {
4884-
if (targetIsInput) {
4885-
containerOuter.removeFocusState();
4886-
this.hideDropdown(true);
4887-
this.unhighlightAll();
4888-
}
4889-
}
4890-
else {
4890+
if (targetIsInput) {
48914891
containerOuter.removeFocusState();
4892-
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
4893-
this.hideDropdown(true);
4892+
this.hideDropdown(true);
4893+
if (this._isTextElement || this._isSelectMultipleElement) {
4894+
this.unhighlightAll();
48944895
}
48954896
}
48964897
}
@@ -4978,6 +4979,10 @@
49784979
return;
49794980
}
49804981
this._store.dispatch(removeItem$1(item));
4982+
var notice = this._notice;
4983+
if (notice && notice.type === NoticeTypes.noChoices) {
4984+
this._clearNotice();
4985+
}
49814986
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
49824987
};
49834988
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {

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: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ var WrappedSelect = /** @class */ (function (_super) {
865865
score: 0,
866866
rank: 0,
867867
value: option.value,
868-
label: option.innerHTML,
868+
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
869869
element: option,
870870
active: true,
871871
// this returns true if nothing is selected on initial load, which will break placeholder support
@@ -3624,11 +3624,15 @@ var Choices = /** @class */ (function () {
36243624
if (this.dropdown.isActive) {
36253625
return this;
36263626
}
3627+
if (preventInputFocus === undefined) {
3628+
// eslint-disable-next-line no-param-reassign
3629+
preventInputFocus = !this._canSearch;
3630+
}
36273631
requestAnimationFrame(function () {
36283632
_this.dropdown.show();
36293633
var rect = _this.dropdown.element.getBoundingClientRect();
36303634
_this.containerOuter.open(rect.bottom, rect.height);
3631-
if (!preventInputFocus && _this._canSearch) {
3635+
if (!preventInputFocus) {
36323636
_this.input.focus();
36333637
}
36343638
_this.passedElement.triggerEvent(EventType.showDropdown);
@@ -3930,6 +3934,7 @@ var Choices = /** @class */ (function () {
39303934
}
39313935
this.itemList.element.replaceChildren('');
39323936
this.choiceList.element.replaceChildren('');
3937+
this._clearNotice();
39333938
this._store.reset();
39343939
this._lastAddedChoiceId = 0;
39353940
this._lastAddedGroupId = 0;
@@ -4386,6 +4391,7 @@ var Choices = /** @class */ (function () {
43864391
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
43874392
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
43884393
this.choiceList.element.replaceChildren('');
4394+
this._notice = undefined;
43894395
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
43904396
return false;
43914397
}
@@ -4698,6 +4704,7 @@ var Choices = /** @class */ (function () {
46984704
if (hasActiveDropdown) {
46994705
event.stopPropagation();
47004706
this.hideDropdown(true);
4707+
this._stopSearch();
47014708
this.containerOuter.element.focus();
47024709
}
47034710
};
@@ -4874,17 +4881,11 @@ var Choices = /** @class */ (function () {
48744881
var blurWasWithinContainer = target && containerOuter.element.contains(target);
48754882
if (blurWasWithinContainer && !this._isScrollingOnIe) {
48764883
var targetIsInput = target === this.input.element;
4877-
if (this._isTextElement || this._isSelectMultipleElement) {
4878-
if (targetIsInput) {
4879-
containerOuter.removeFocusState();
4880-
this.hideDropdown(true);
4881-
this.unhighlightAll();
4882-
}
4883-
}
4884-
else {
4884+
if (targetIsInput) {
48854885
containerOuter.removeFocusState();
4886-
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
4887-
this.hideDropdown(true);
4886+
this.hideDropdown(true);
4887+
if (this._isTextElement || this._isSelectMultipleElement) {
4888+
this.unhighlightAll();
48884889
}
48894890
}
48904891
}
@@ -4972,6 +4973,10 @@ var Choices = /** @class */ (function () {
49724973
return;
49734974
}
49744975
this._store.dispatch(removeItem$1(item));
4976+
var notice = this._notice;
4977+
if (notice && notice.type === NoticeTypes.noChoices) {
4978+
this._clearNotice();
4979+
}
49754980
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
49764981
};
49774982
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@
871871
score: 0,
872872
rank: 0,
873873
value: option.value,
874-
label: option.innerHTML,
874+
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
875875
element: option,
876876
active: true,
877877
// this returns true if nothing is selected on initial load, which will break placeholder support
@@ -3148,11 +3148,15 @@
31483148
if (this.dropdown.isActive) {
31493149
return this;
31503150
}
3151+
if (preventInputFocus === undefined) {
3152+
// eslint-disable-next-line no-param-reassign
3153+
preventInputFocus = !this._canSearch;
3154+
}
31513155
requestAnimationFrame(function () {
31523156
_this.dropdown.show();
31533157
var rect = _this.dropdown.element.getBoundingClientRect();
31543158
_this.containerOuter.open(rect.bottom, rect.height);
3155-
if (!preventInputFocus && _this._canSearch) {
3159+
if (!preventInputFocus) {
31563160
_this.input.focus();
31573161
}
31583162
_this.passedElement.triggerEvent(EventType.showDropdown);
@@ -3454,6 +3458,7 @@
34543458
}
34553459
this.itemList.element.replaceChildren('');
34563460
this.choiceList.element.replaceChildren('');
3461+
this._clearNotice();
34573462
this._store.reset();
34583463
this._lastAddedChoiceId = 0;
34593464
this._lastAddedGroupId = 0;
@@ -3910,6 +3915,7 @@
39103915
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
39113916
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
39123917
this.choiceList.element.replaceChildren('');
3918+
this._notice = undefined;
39133919
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
39143920
return false;
39153921
}
@@ -4222,6 +4228,7 @@
42224228
if (hasActiveDropdown) {
42234229
event.stopPropagation();
42244230
this.hideDropdown(true);
4231+
this._stopSearch();
42254232
this.containerOuter.element.focus();
42264233
}
42274234
};
@@ -4398,17 +4405,11 @@
43984405
var blurWasWithinContainer = target && containerOuter.element.contains(target);
43994406
if (blurWasWithinContainer && !this._isScrollingOnIe) {
44004407
var targetIsInput = target === this.input.element;
4401-
if (this._isTextElement || this._isSelectMultipleElement) {
4402-
if (targetIsInput) {
4403-
containerOuter.removeFocusState();
4404-
this.hideDropdown(true);
4405-
this.unhighlightAll();
4406-
}
4407-
}
4408-
else {
4408+
if (targetIsInput) {
44094409
containerOuter.removeFocusState();
4410-
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
4411-
this.hideDropdown(true);
4410+
this.hideDropdown(true);
4411+
if (this._isTextElement || this._isSelectMultipleElement) {
4412+
this.unhighlightAll();
44124413
}
44134414
}
44144415
}
@@ -4496,6 +4497,10 @@
44964497
return;
44974498
}
44984499
this._store.dispatch(removeItem$1(item));
4500+
var notice = this._notice;
4501+
if (notice && notice.type === NoticeTypes.noChoices) {
4502+
this._clearNotice();
4503+
}
44994504
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
45004505
};
45014506
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {

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: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ var WrappedSelect = /** @class */ (function (_super) {
865865
score: 0,
866866
rank: 0,
867867
value: option.value,
868-
label: option.innerHTML,
868+
label: option.innerText, // HTML options do not support most html tags, but innerHtml will extract html comments...
869869
element: option,
870870
active: true,
871871
// this returns true if nothing is selected on initial load, which will break placeholder support
@@ -3142,11 +3142,15 @@ var Choices = /** @class */ (function () {
31423142
if (this.dropdown.isActive) {
31433143
return this;
31443144
}
3145+
if (preventInputFocus === undefined) {
3146+
// eslint-disable-next-line no-param-reassign
3147+
preventInputFocus = !this._canSearch;
3148+
}
31453149
requestAnimationFrame(function () {
31463150
_this.dropdown.show();
31473151
var rect = _this.dropdown.element.getBoundingClientRect();
31483152
_this.containerOuter.open(rect.bottom, rect.height);
3149-
if (!preventInputFocus && _this._canSearch) {
3153+
if (!preventInputFocus) {
31503154
_this.input.focus();
31513155
}
31523156
_this.passedElement.triggerEvent(EventType.showDropdown);
@@ -3448,6 +3452,7 @@ var Choices = /** @class */ (function () {
34483452
}
34493453
this.itemList.element.replaceChildren('');
34503454
this.choiceList.element.replaceChildren('');
3455+
this._clearNotice();
34513456
this._store.reset();
34523457
this._lastAddedChoiceId = 0;
34533458
this._lastAddedGroupId = 0;
@@ -3904,6 +3909,7 @@ var Choices = /** @class */ (function () {
39043909
var maxItemCount = config.maxItemCount, maxItemText = config.maxItemText;
39053910
if (!config.singleModeForMultiSelect && maxItemCount > 0 && maxItemCount <= this._store.items.length) {
39063911
this.choiceList.element.replaceChildren('');
3912+
this._notice = undefined;
39073913
this._displayNotice(typeof maxItemText === 'function' ? maxItemText(maxItemCount) : maxItemText, NoticeTypes.addChoice);
39083914
return false;
39093915
}
@@ -4216,6 +4222,7 @@ var Choices = /** @class */ (function () {
42164222
if (hasActiveDropdown) {
42174223
event.stopPropagation();
42184224
this.hideDropdown(true);
4225+
this._stopSearch();
42194226
this.containerOuter.element.focus();
42204227
}
42214228
};
@@ -4392,17 +4399,11 @@ var Choices = /** @class */ (function () {
43924399
var blurWasWithinContainer = target && containerOuter.element.contains(target);
43934400
if (blurWasWithinContainer && !this._isScrollingOnIe) {
43944401
var targetIsInput = target === this.input.element;
4395-
if (this._isTextElement || this._isSelectMultipleElement) {
4396-
if (targetIsInput) {
4397-
containerOuter.removeFocusState();
4398-
this.hideDropdown(true);
4399-
this.unhighlightAll();
4400-
}
4401-
}
4402-
else {
4402+
if (targetIsInput) {
44034403
containerOuter.removeFocusState();
4404-
if (targetIsInput || (target === containerOuter.element && !this._canSearch)) {
4405-
this.hideDropdown(true);
4404+
this.hideDropdown(true);
4405+
if (this._isTextElement || this._isSelectMultipleElement) {
4406+
this.unhighlightAll();
44064407
}
44074408
}
44084409
}
@@ -4490,6 +4491,10 @@ var Choices = /** @class */ (function () {
44904491
return;
44914492
}
44924493
this._store.dispatch(removeItem$1(item));
4494+
var notice = this._notice;
4495+
if (notice && notice.type === NoticeTypes.noChoices) {
4496+
this._clearNotice();
4497+
}
44934498
this.passedElement.triggerEvent(EventType.removeItem, this._getChoiceForOutput(item));
44944499
};
44954500
Choices.prototype._addChoice = function (choice, withEvents, userTriggered) {

0 commit comments

Comments
 (0)