Skip to content

Commit

Permalink
11.0.0-rc6
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Aug 12, 2024
1 parent cc44ad0 commit e6ebf60
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 63 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [11.0.0-rc6] (2024-08-)
## [11.0.0-rc6] (2024-08-12)

### Features
* Improve performance of search/filtering with large number of choices.
Expand Down
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.0-rc5",
"version": "11.0.0-rc6",
"description": "A vanilla JS customisable text input/select box plugin",
"type": "module",
"main": "./public/assets/scripts/choices.js",
Expand Down
19 changes: 11 additions & 8 deletions public/assets/scripts/choices.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.0-rc5 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.0-rc6 | © 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 @@ -1156,10 +1156,15 @@
choices: init,
};
};
Store.prototype.resetStore = function () {
Store.prototype.reset = function () {
this._store = this.defaultState;
var changes = this.changeSet(true);
this._listeners.forEach(function (l) { return l(changes); });
if (this._txn) {
this._outstandingChanges = changes;
}
else {
this._listeners.forEach(function (l) { return l(changes); });
}
};
Store.prototype.subscribe = function (onChange) {
this._listeners.push(onChange);
Expand Down Expand Up @@ -3886,7 +3891,7 @@
return this;
};
Choices.prototype.clearStore = function () {
this._store.resetStore();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
// @todo integrate with Store
Expand Down Expand Up @@ -4669,13 +4674,12 @@
var target = event.target;
var targetWasRemoveButton = target && target.hasAttribute('data-button');
var addedItem = false;
event.preventDefault();
if (targetWasRemoveButton) {
event.preventDefault();
this._handleButtonAction(items, target);
return;
}
if (!hasActiveDropdown && this._isSelectOneElement) {
event.preventDefault();
this.showDropdown();
return;
}
Expand All @@ -4685,7 +4689,6 @@
if (highlightedChoice) {
addedItem = this._handleChoiceAction(items, highlightedChoice, 13 /* KeyCodeMap.ENTER_KEY */);
if (addedItem) {
event.preventDefault();
this.unhighlightAll();
return;
}
Expand Down Expand Up @@ -5255,7 +5258,7 @@
throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
}
};
Choices.version = '11.0.0-rc5';
Choices.version = '11.0.0-rc6';
return Choices;
}());

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/assets/scripts/choices.min.mjs

Large diffs are not rendered by default.

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

/******************************************************************************
Copyright (c) Microsoft Corporation.
Expand Down Expand Up @@ -1150,10 +1150,15 @@ var Store = /** @class */ (function () {
choices: init,
};
};
Store.prototype.resetStore = function () {
Store.prototype.reset = function () {
this._store = this.defaultState;
var changes = this.changeSet(true);
this._listeners.forEach(function (l) { return l(changes); });
if (this._txn) {
this._outstandingChanges = changes;
}
else {
this._listeners.forEach(function (l) { return l(changes); });
}
};
Store.prototype.subscribe = function (onChange) {
this._listeners.push(onChange);
Expand Down Expand Up @@ -3880,7 +3885,7 @@ var Choices = /** @class */ (function () {
return this;
};
Choices.prototype.clearStore = function () {
this._store.resetStore();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
// @todo integrate with Store
Expand Down Expand Up @@ -4663,13 +4668,12 @@ var Choices = /** @class */ (function () {
var target = event.target;
var targetWasRemoveButton = target && target.hasAttribute('data-button');
var addedItem = false;
event.preventDefault();
if (targetWasRemoveButton) {
event.preventDefault();
this._handleButtonAction(items, target);
return;
}
if (!hasActiveDropdown && this._isSelectOneElement) {
event.preventDefault();
this.showDropdown();
return;
}
Expand All @@ -4679,7 +4683,6 @@ var Choices = /** @class */ (function () {
if (highlightedChoice) {
addedItem = this._handleChoiceAction(items, highlightedChoice, 13 /* KeyCodeMap.ENTER_KEY */);
if (addedItem) {
event.preventDefault();
this.unhighlightAll();
return;
}
Expand Down Expand Up @@ -5249,7 +5252,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.0-rc5';
Choices.version = '11.0.0-rc6';
return Choices;
}());

Expand Down
19 changes: 11 additions & 8 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.0-rc5 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.0-rc6 | © 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 @@ -1156,10 +1156,15 @@
choices: init,
};
};
Store.prototype.resetStore = function () {
Store.prototype.reset = function () {
this._store = this.defaultState;
var changes = this.changeSet(true);
this._listeners.forEach(function (l) { return l(changes); });
if (this._txn) {
this._outstandingChanges = changes;
}
else {
this._listeners.forEach(function (l) { return l(changes); });
}
};
Store.prototype.subscribe = function (onChange) {
this._listeners.push(onChange);
Expand Down Expand Up @@ -3404,7 +3409,7 @@
return this;
};
Choices.prototype.clearStore = function () {
this._store.resetStore();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
// @todo integrate with Store
Expand Down Expand Up @@ -4187,13 +4192,12 @@
var target = event.target;
var targetWasRemoveButton = target && target.hasAttribute('data-button');
var addedItem = false;
event.preventDefault();
if (targetWasRemoveButton) {
event.preventDefault();
this._handleButtonAction(items, target);
return;
}
if (!hasActiveDropdown && this._isSelectOneElement) {
event.preventDefault();
this.showDropdown();
return;
}
Expand All @@ -4203,7 +4207,6 @@
if (highlightedChoice) {
addedItem = this._handleChoiceAction(items, highlightedChoice, 13 /* KeyCodeMap.ENTER_KEY */);
if (addedItem) {
event.preventDefault();
this.unhighlightAll();
return;
}
Expand Down Expand Up @@ -4773,7 +4776,7 @@
throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
}
};
Choices.version = '11.0.0-rc5';
Choices.version = '11.0.0-rc6';
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.

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

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions public/assets/scripts/choices.search-basic.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.0-rc5 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.0-rc6 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */

/******************************************************************************
Copyright (c) Microsoft Corporation.
Expand Down Expand Up @@ -1150,10 +1150,15 @@ var Store = /** @class */ (function () {
choices: init,
};
};
Store.prototype.resetStore = function () {
Store.prototype.reset = function () {
this._store = this.defaultState;
var changes = this.changeSet(true);
this._listeners.forEach(function (l) { return l(changes); });
if (this._txn) {
this._outstandingChanges = changes;
}
else {
this._listeners.forEach(function (l) { return l(changes); });
}
};
Store.prototype.subscribe = function (onChange) {
this._listeners.push(onChange);
Expand Down Expand Up @@ -3398,7 +3403,7 @@ var Choices = /** @class */ (function () {
return this;
};
Choices.prototype.clearStore = function () {
this._store.resetStore();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
// @todo integrate with Store
Expand Down Expand Up @@ -4181,13 +4186,12 @@ var Choices = /** @class */ (function () {
var target = event.target;
var targetWasRemoveButton = target && target.hasAttribute('data-button');
var addedItem = false;
event.preventDefault();
if (targetWasRemoveButton) {
event.preventDefault();
this._handleButtonAction(items, target);
return;
}
if (!hasActiveDropdown && this._isSelectOneElement) {
event.preventDefault();
this.showDropdown();
return;
}
Expand All @@ -4197,7 +4201,6 @@ var Choices = /** @class */ (function () {
if (highlightedChoice) {
addedItem = this._handleChoiceAction(items, highlightedChoice, 13 /* KeyCodeMap.ENTER_KEY */);
if (addedItem) {
event.preventDefault();
this.unhighlightAll();
return;
}
Expand Down Expand Up @@ -4767,7 +4770,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.0-rc5';
Choices.version = '11.0.0-rc6';
return Choices;
}());

Expand Down
19 changes: 11 additions & 8 deletions public/assets/scripts/choices.search-prefix.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! choices.js v11.0.0-rc5 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
/*! choices.js v11.0.0-rc6 | © 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 @@ -1156,10 +1156,15 @@
choices: init,
};
};
Store.prototype.resetStore = function () {
Store.prototype.reset = function () {
this._store = this.defaultState;
var changes = this.changeSet(true);
this._listeners.forEach(function (l) { return l(changes); });
if (this._txn) {
this._outstandingChanges = changes;
}
else {
this._listeners.forEach(function (l) { return l(changes); });
}
};
Store.prototype.subscribe = function (onChange) {
this._listeners.push(onChange);
Expand Down Expand Up @@ -2260,7 +2265,7 @@
return this;
};
Choices.prototype.clearStore = function () {
this._store.resetStore();
this._store.reset();
this._lastAddedChoiceId = 0;
this._lastAddedGroupId = 0;
// @todo integrate with Store
Expand Down Expand Up @@ -3043,13 +3048,12 @@
var target = event.target;
var targetWasRemoveButton = target && target.hasAttribute('data-button');
var addedItem = false;
event.preventDefault();
if (targetWasRemoveButton) {
event.preventDefault();
this._handleButtonAction(items, target);
return;
}
if (!hasActiveDropdown && this._isSelectOneElement) {
event.preventDefault();
this.showDropdown();
return;
}
Expand All @@ -3059,7 +3063,6 @@
if (highlightedChoice) {
addedItem = this._handleChoiceAction(items, highlightedChoice, 13 /* KeyCodeMap.ENTER_KEY */);
if (addedItem) {
event.preventDefault();
this.unhighlightAll();
return;
}
Expand Down Expand Up @@ -3629,7 +3632,7 @@
throw new TypeError("".concat(caller, " called for an element which has multiple instances of Choices initialised on it"));
}
};
Choices.version = '11.0.0-rc5';
Choices.version = '11.0.0-rc6';
return Choices;
}());

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/assets/scripts/choices.search-prefix.min.mjs

Large diffs are not rendered by default.

Loading

0 comments on commit e6ebf60

Please sign in to comment.