From a8862e78becf43d0d58c5bc05051a14bf1dbfcbc Mon Sep 17 00:00:00 2001 From: Matt Triff Date: Sun, 26 Dec 2021 16:38:09 -0500 Subject: [PATCH] Add typings and declaration maps --- public/assets/scripts/choices.js | 38 +- public/assets/scripts/choices.min.js | 2 +- .../integration/select-multiple.spec.d.ts | 1 + .../integration/select-multiple.spec.d.ts.map | 1 + .../cypress/integration/select-one.spec.d.ts | 1 + .../integration/select-one.spec.d.ts.map | 1 + .../types/cypress/integration/text.spec.d.ts | 1 + .../cypress/integration/text.spec.d.ts.map | 1 + public/types/src/index.d.ts | 6 + public/types/src/index.d.ts.map | 1 + public/types/src/scripts/actions/choices.d.ts | 44 ++ .../src/scripts/actions/choices.d.ts.map | 1 + .../src/scripts/actions/choices.test.d.ts | 2 + .../src/scripts/actions/choices.test.d.ts.map | 1 + public/types/src/scripts/actions/groups.d.ts | 15 + .../types/src/scripts/actions/groups.d.ts.map | 1 + .../src/scripts/actions/groups.test.d.ts | 2 + .../src/scripts/actions/groups.test.d.ts.map | 1 + public/types/src/scripts/actions/items.d.ts | 35 ++ .../types/src/scripts/actions/items.d.ts.map | 1 + .../types/src/scripts/actions/items.test.d.ts | 2 + .../src/scripts/actions/items.test.d.ts.map | 1 + public/types/src/scripts/actions/misc.d.ts | 17 + .../types/src/scripts/actions/misc.d.ts.map | 1 + .../types/src/scripts/actions/misc.test.d.ts | 2 + .../src/scripts/actions/misc.test.d.ts.map | 1 + public/types/src/scripts/choices.d.ts | 218 +++++++++ public/types/src/scripts/choices.d.ts.map | 1 + public/types/src/scripts/choices.test.d.ts | 2 + .../types/src/scripts/choices.test.d.ts.map | 1 + .../src/scripts/components/container.d.ts | 43 ++ .../src/scripts/components/container.d.ts.map | 1 + .../scripts/components/container.test.d.ts | 2 + .../components/container.test.d.ts.map | 1 + .../src/scripts/components/dropdown.d.ts | 27 + .../src/scripts/components/dropdown.d.ts.map | 1 + .../src/scripts/components/dropdown.test.d.ts | 2 + .../scripts/components/dropdown.test.d.ts.map | 1 + .../types/src/scripts/components/index.d.ts | 8 + .../src/scripts/components/index.d.ts.map | 1 + .../types/src/scripts/components/input.d.ts | 38 ++ .../src/scripts/components/input.d.ts.map | 1 + .../src/scripts/components/input.test.d.ts | 2 + .../scripts/components/input.test.d.ts.map | 1 + public/types/src/scripts/components/list.d.ts | 18 + .../src/scripts/components/list.d.ts.map | 1 + .../src/scripts/components/list.test.d.ts | 2 + .../src/scripts/components/list.test.d.ts.map | 1 + .../scripts/components/wrapped-element.d.ts | 21 + .../components/wrapped-element.d.ts.map | 1 + .../components/wrapped-element.test.d.ts | 2 + .../components/wrapped-element.test.d.ts.map | 1 + .../src/scripts/components/wrapped-input.d.ts | 14 + .../scripts/components/wrapped-input.d.ts.map | 1 + .../components/wrapped-input.test.d.ts | 2 + .../components/wrapped-input.test.d.ts.map | 1 + .../scripts/components/wrapped-select.d.ts | 19 + .../components/wrapped-select.d.ts.map | 1 + .../components/wrapped-select.test.d.ts | 2 + .../components/wrapped-select.test.d.ts.map | 1 + public/types/src/scripts/constants.d.ts | 11 + public/types/src/scripts/constants.d.ts.map | 1 + public/types/src/scripts/constants.test.d.ts | 2 + .../types/src/scripts/constants.test.d.ts.map | 1 + public/types/src/scripts/defaults.d.ts | 5 + public/types/src/scripts/defaults.d.ts.map | 1 + .../src/scripts/interfaces/action-type.d.ts | 2 + .../scripts/interfaces/action-type.d.ts.map | 1 + .../types/src/scripts/interfaces/choice.d.ts | 16 + .../src/scripts/interfaces/choice.d.ts.map | 1 + .../types/src/scripts/interfaces/choices.d.ts | 46 ++ .../src/scripts/interfaces/choices.d.ts.map | 1 + .../src/scripts/interfaces/class-names.d.ts | 56 +++ .../scripts/interfaces/class-names.d.ts.map | 1 + .../src/scripts/interfaces/event-type.d.ts | 2 + .../scripts/interfaces/event-type.d.ts.map | 1 + .../types/src/scripts/interfaces/group.d.ts | 7 + .../src/scripts/interfaces/group.d.ts.map | 1 + public/types/src/scripts/interfaces/item.d.ts | 6 + .../src/scripts/interfaces/item.d.ts.map | 1 + .../src/scripts/interfaces/keycode-map.d.ts | 12 + .../scripts/interfaces/keycode-map.d.ts.map | 1 + .../types/src/scripts/interfaces/notice.d.ts | 5 + .../src/scripts/interfaces/notice.d.ts.map | 1 + .../types/src/scripts/interfaces/options.d.ts | 460 ++++++++++++++++++ .../src/scripts/interfaces/options.d.ts.map | 1 + .../interfaces/passed-element-type.d.ts | 2 + .../interfaces/passed-element-type.d.ts.map | 1 + .../scripts/interfaces/passed-element.d.ts | 129 +++++ .../interfaces/passed-element.d.ts.map | 1 + .../interfaces/position-options-type.d.ts | 2 + .../interfaces/position-options-type.d.ts.map | 1 + .../types/src/scripts/interfaces/state.d.ts | 10 + .../src/scripts/interfaces/state.d.ts.map | 1 + .../types/src/scripts/interfaces/types.d.ts | 9 + .../src/scripts/interfaces/types.d.ts.map | 1 + public/types/src/scripts/lib/utils.d.ts | 27 + public/types/src/scripts/lib/utils.d.ts.map | 1 + public/types/src/scripts/lib/utils.test.d.ts | 2 + .../types/src/scripts/lib/utils.test.d.ts.map | 1 + .../types/src/scripts/reducers/choices.d.ts | 8 + .../src/scripts/reducers/choices.d.ts.map | 1 + .../src/scripts/reducers/choices.test.d.ts | 2 + .../scripts/reducers/choices.test.d.ts.map | 1 + public/types/src/scripts/reducers/groups.d.ts | 9 + .../src/scripts/reducers/groups.d.ts.map | 1 + .../src/scripts/reducers/groups.test.d.ts | 2 + .../src/scripts/reducers/groups.test.d.ts.map | 1 + public/types/src/scripts/reducers/index.d.ts | 9 + .../types/src/scripts/reducers/index.d.ts.map | 1 + .../src/scripts/reducers/index.test.d.ts | 2 + .../src/scripts/reducers/index.test.d.ts.map | 1 + public/types/src/scripts/reducers/items.d.ts | 8 + .../types/src/scripts/reducers/items.d.ts.map | 1 + .../src/scripts/reducers/items.test.d.ts | 2 + .../src/scripts/reducers/items.test.d.ts.map | 1 + .../types/src/scripts/reducers/loading.d.ts | 7 + .../src/scripts/reducers/loading.d.ts.map | 1 + .../src/scripts/reducers/loading.test.d.ts | 2 + .../scripts/reducers/loading.test.d.ts.map | 1 + public/types/src/scripts/store/store.d.ts | 74 +++ public/types/src/scripts/store/store.d.ts.map | 1 + .../types/src/scripts/store/store.test.d.ts | 2 + .../src/scripts/store/store.test.d.ts.map | 1 + public/types/src/scripts/templates.d.ts | 25 + public/types/src/scripts/templates.d.ts.map | 1 + public/types/src/scripts/templates.test.d.ts | 2 + .../types/src/scripts/templates.test.d.ts.map | 1 + 128 files changed, 1610 insertions(+), 8 deletions(-) create mode 100644 public/types/cypress/integration/select-multiple.spec.d.ts create mode 100644 public/types/cypress/integration/select-multiple.spec.d.ts.map create mode 100644 public/types/cypress/integration/select-one.spec.d.ts create mode 100644 public/types/cypress/integration/select-one.spec.d.ts.map create mode 100644 public/types/cypress/integration/text.spec.d.ts create mode 100644 public/types/cypress/integration/text.spec.d.ts.map create mode 100644 public/types/src/index.d.ts create mode 100644 public/types/src/index.d.ts.map create mode 100644 public/types/src/scripts/actions/choices.d.ts create mode 100644 public/types/src/scripts/actions/choices.d.ts.map create mode 100644 public/types/src/scripts/actions/choices.test.d.ts create mode 100644 public/types/src/scripts/actions/choices.test.d.ts.map create mode 100644 public/types/src/scripts/actions/groups.d.ts create mode 100644 public/types/src/scripts/actions/groups.d.ts.map create mode 100644 public/types/src/scripts/actions/groups.test.d.ts create mode 100644 public/types/src/scripts/actions/groups.test.d.ts.map create mode 100644 public/types/src/scripts/actions/items.d.ts create mode 100644 public/types/src/scripts/actions/items.d.ts.map create mode 100644 public/types/src/scripts/actions/items.test.d.ts create mode 100644 public/types/src/scripts/actions/items.test.d.ts.map create mode 100644 public/types/src/scripts/actions/misc.d.ts create mode 100644 public/types/src/scripts/actions/misc.d.ts.map create mode 100644 public/types/src/scripts/actions/misc.test.d.ts create mode 100644 public/types/src/scripts/actions/misc.test.d.ts.map create mode 100644 public/types/src/scripts/choices.d.ts create mode 100644 public/types/src/scripts/choices.d.ts.map create mode 100644 public/types/src/scripts/choices.test.d.ts create mode 100644 public/types/src/scripts/choices.test.d.ts.map create mode 100644 public/types/src/scripts/components/container.d.ts create mode 100644 public/types/src/scripts/components/container.d.ts.map create mode 100644 public/types/src/scripts/components/container.test.d.ts create mode 100644 public/types/src/scripts/components/container.test.d.ts.map create mode 100644 public/types/src/scripts/components/dropdown.d.ts create mode 100644 public/types/src/scripts/components/dropdown.d.ts.map create mode 100644 public/types/src/scripts/components/dropdown.test.d.ts create mode 100644 public/types/src/scripts/components/dropdown.test.d.ts.map create mode 100644 public/types/src/scripts/components/index.d.ts create mode 100644 public/types/src/scripts/components/index.d.ts.map create mode 100644 public/types/src/scripts/components/input.d.ts create mode 100644 public/types/src/scripts/components/input.d.ts.map create mode 100644 public/types/src/scripts/components/input.test.d.ts create mode 100644 public/types/src/scripts/components/input.test.d.ts.map create mode 100644 public/types/src/scripts/components/list.d.ts create mode 100644 public/types/src/scripts/components/list.d.ts.map create mode 100644 public/types/src/scripts/components/list.test.d.ts create mode 100644 public/types/src/scripts/components/list.test.d.ts.map create mode 100644 public/types/src/scripts/components/wrapped-element.d.ts create mode 100644 public/types/src/scripts/components/wrapped-element.d.ts.map create mode 100644 public/types/src/scripts/components/wrapped-element.test.d.ts create mode 100644 public/types/src/scripts/components/wrapped-element.test.d.ts.map create mode 100644 public/types/src/scripts/components/wrapped-input.d.ts create mode 100644 public/types/src/scripts/components/wrapped-input.d.ts.map create mode 100644 public/types/src/scripts/components/wrapped-input.test.d.ts create mode 100644 public/types/src/scripts/components/wrapped-input.test.d.ts.map create mode 100644 public/types/src/scripts/components/wrapped-select.d.ts create mode 100644 public/types/src/scripts/components/wrapped-select.d.ts.map create mode 100644 public/types/src/scripts/components/wrapped-select.test.d.ts create mode 100644 public/types/src/scripts/components/wrapped-select.test.d.ts.map create mode 100644 public/types/src/scripts/constants.d.ts create mode 100644 public/types/src/scripts/constants.d.ts.map create mode 100644 public/types/src/scripts/constants.test.d.ts create mode 100644 public/types/src/scripts/constants.test.d.ts.map create mode 100644 public/types/src/scripts/defaults.d.ts create mode 100644 public/types/src/scripts/defaults.d.ts.map create mode 100644 public/types/src/scripts/interfaces/action-type.d.ts create mode 100644 public/types/src/scripts/interfaces/action-type.d.ts.map create mode 100644 public/types/src/scripts/interfaces/choice.d.ts create mode 100644 public/types/src/scripts/interfaces/choice.d.ts.map create mode 100644 public/types/src/scripts/interfaces/choices.d.ts create mode 100644 public/types/src/scripts/interfaces/choices.d.ts.map create mode 100644 public/types/src/scripts/interfaces/class-names.d.ts create mode 100644 public/types/src/scripts/interfaces/class-names.d.ts.map create mode 100644 public/types/src/scripts/interfaces/event-type.d.ts create mode 100644 public/types/src/scripts/interfaces/event-type.d.ts.map create mode 100644 public/types/src/scripts/interfaces/group.d.ts create mode 100644 public/types/src/scripts/interfaces/group.d.ts.map create mode 100644 public/types/src/scripts/interfaces/item.d.ts create mode 100644 public/types/src/scripts/interfaces/item.d.ts.map create mode 100644 public/types/src/scripts/interfaces/keycode-map.d.ts create mode 100644 public/types/src/scripts/interfaces/keycode-map.d.ts.map create mode 100644 public/types/src/scripts/interfaces/notice.d.ts create mode 100644 public/types/src/scripts/interfaces/notice.d.ts.map create mode 100644 public/types/src/scripts/interfaces/options.d.ts create mode 100644 public/types/src/scripts/interfaces/options.d.ts.map create mode 100644 public/types/src/scripts/interfaces/passed-element-type.d.ts create mode 100644 public/types/src/scripts/interfaces/passed-element-type.d.ts.map create mode 100644 public/types/src/scripts/interfaces/passed-element.d.ts create mode 100644 public/types/src/scripts/interfaces/passed-element.d.ts.map create mode 100644 public/types/src/scripts/interfaces/position-options-type.d.ts create mode 100644 public/types/src/scripts/interfaces/position-options-type.d.ts.map create mode 100644 public/types/src/scripts/interfaces/state.d.ts create mode 100644 public/types/src/scripts/interfaces/state.d.ts.map create mode 100644 public/types/src/scripts/interfaces/types.d.ts create mode 100644 public/types/src/scripts/interfaces/types.d.ts.map create mode 100644 public/types/src/scripts/lib/utils.d.ts create mode 100644 public/types/src/scripts/lib/utils.d.ts.map create mode 100644 public/types/src/scripts/lib/utils.test.d.ts create mode 100644 public/types/src/scripts/lib/utils.test.d.ts.map create mode 100644 public/types/src/scripts/reducers/choices.d.ts create mode 100644 public/types/src/scripts/reducers/choices.d.ts.map create mode 100644 public/types/src/scripts/reducers/choices.test.d.ts create mode 100644 public/types/src/scripts/reducers/choices.test.d.ts.map create mode 100644 public/types/src/scripts/reducers/groups.d.ts create mode 100644 public/types/src/scripts/reducers/groups.d.ts.map create mode 100644 public/types/src/scripts/reducers/groups.test.d.ts create mode 100644 public/types/src/scripts/reducers/groups.test.d.ts.map create mode 100644 public/types/src/scripts/reducers/index.d.ts create mode 100644 public/types/src/scripts/reducers/index.d.ts.map create mode 100644 public/types/src/scripts/reducers/index.test.d.ts create mode 100644 public/types/src/scripts/reducers/index.test.d.ts.map create mode 100644 public/types/src/scripts/reducers/items.d.ts create mode 100644 public/types/src/scripts/reducers/items.d.ts.map create mode 100644 public/types/src/scripts/reducers/items.test.d.ts create mode 100644 public/types/src/scripts/reducers/items.test.d.ts.map create mode 100644 public/types/src/scripts/reducers/loading.d.ts create mode 100644 public/types/src/scripts/reducers/loading.d.ts.map create mode 100644 public/types/src/scripts/reducers/loading.test.d.ts create mode 100644 public/types/src/scripts/reducers/loading.test.d.ts.map create mode 100644 public/types/src/scripts/store/store.d.ts create mode 100644 public/types/src/scripts/store/store.d.ts.map create mode 100644 public/types/src/scripts/store/store.test.d.ts create mode 100644 public/types/src/scripts/store/store.test.d.ts.map create mode 100644 public/types/src/scripts/templates.d.ts create mode 100644 public/types/src/scripts/templates.d.ts.map create mode 100644 public/types/src/scripts/templates.test.d.ts create mode 100644 public/types/src/scripts/templates.test.d.ts.map diff --git a/public/assets/scripts/choices.js b/public/assets/scripts/choices.js index 59054ab..82eadc2 100644 --- a/public/assets/scripts/choices.js +++ b/public/assets/scripts/choices.js @@ -5571,6 +5571,18 @@ if (false) {} /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ /******/ /* webpack/runtime/define property getters */ /******/ !function() { /******/ // define getter functions for harmony exports @@ -5600,13 +5612,25 @@ if (false) {} /******/ }(); /******/ /************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__(373); -/******/ __webpack_exports__ = __webpack_exports__["default"]; -/******/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +!function() { +"use strict"; +/* harmony import */ var _scripts_choices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(373); +/* harmony import */ var _scripts_choices__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_scripts_choices__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _scripts_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(883); +/* harmony import */ var _scripts_defaults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(789); +/* harmony import */ var _scripts_templates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(686); + + + + + + +/* harmony default export */ __webpack_exports__["default"] = ((_scripts_choices__WEBPACK_IMPORTED_MODULE_0___default())); + +}(); +__webpack_exports__ = __webpack_exports__["default"]; /******/ return __webpack_exports__; /******/ })() ; diff --git a/public/assets/scripts/choices.min.js b/public/assets/scripts/choices.min.js index 3bf27ce..eb2f3bd 100644 --- a/public/assets/scripts/choices.min.js +++ b/public/assets/scripts/choices.min.js @@ -1,2 +1,2 @@ /*! For license information please see choices.min.js.LICENSE.txt */ -!function(){var e={282:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.addChoice=void 0;var n=i(883);t.addChoice=function(e){var t=e.value,i=e.label,o=e.id,r=e.groupId,s=e.disabled,a=e.elementId,c=e.customProperties,l=e.placeholder,h=e.keyCode;return{type:n.ACTION_TYPES.ADD_CHOICE,value:t,label:i,id:o,groupId:r,disabled:s,elementId:a,customProperties:c,placeholder:l,keyCode:h}},t.filterChoices=function(e){return{type:n.ACTION_TYPES.FILTER_CHOICES,results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:n.ACTION_TYPES.ACTIVATE_CHOICES,active:e}},t.clearChoices=function(){return{type:n.ACTION_TYPES.CLEAR_CHOICES}}},783:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0;var n=i(883);t.addGroup=function(e){var t=e.value,i=e.id,o=e.active,r=e.disabled;return{type:n.ACTION_TYPES.ADD_GROUP,value:t,id:i,active:o,disabled:r}}},464:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var n=i(883);t.addItem=function(e){var t=e.value,i=e.label,o=e.id,r=e.choiceId,s=e.groupId,a=e.customProperties,c=e.placeholder,l=e.keyCode;return{type:n.ACTION_TYPES.ADD_ITEM,value:t,label:i,id:o,choiceId:r,groupId:s,customProperties:a,placeholder:c,keyCode:l}},t.removeItem=function(e,t){return{type:n.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}},t.highlightItem=function(e,t){return{type:n.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},137:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.resetTo=t.clearAll=void 0;var n=i(883);t.clearAll=function(){return{type:n.ACTION_TYPES.CLEAR_ALL}},t.resetTo=function(e){return{type:n.ACTION_TYPES.RESET_TO,state:e}},t.setIsLoading=function(e){return{type:n.ACTION_TYPES.SET_IS_LOADING,isLoading:e}}},373:function(e,t,i){"use strict";var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,o=0,r=t.length;o=0?this._store.getGroupById(o):null;return this._store.dispatch((0,l.highlightItem)(i,!0)),t&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:i,value:s,label:c,groupValue:h&&h.value?h.value:null}),this},e.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,i=e.groupId,n=void 0===i?-1:i,o=e.value,r=void 0===o?"":o,s=e.label,a=void 0===s?"":s,c=n>=0?this._store.getGroupById(n):null;return this._store.dispatch((0,l.highlightItem)(t,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:t,value:r,label:a,groupValue:c&&c.value?c.value:null}),this},e.prototype.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},e.prototype.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,i){var n=e?i.value:i;return t.push(n),t}),[]);return this._isSelectOneElement?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},e.prototype.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},e.prototype.setChoices=function(e,t,i,n){var o=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof e){var r=e(this);if("function"==typeof Promise&&r instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return o._handleLoadingState(!0)})).then((function(){return r})).then((function(e){return o.setChoices(e,t,i,n)})).catch((function(e){o.config.silent||console.error(e)})).then((function(){return o._handleLoadingState(!1)})).then((function(){return o}));if(!Array.isArray(r))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof r));return this.setChoices(r,t,i,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){if(e.choices)o._addGroup({id:e.id?parseInt("".concat(e.id),10):null,group:e,valueKey:t,labelKey:i});else{var n=e;o._addChoice({value:n[t],label:n[i],isSelected:!!n.selected,isDisabled:!!n.disabled,placeholder:!!n.placeholder,customProperties:n.customProperties})}})),this._stopLoading(),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,a.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,h.clearAll)()),this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,i=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,o=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var r=n.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));r.length>=1&&(o=this._createChoicesFragment(r,o)),o=this._createGroupsFragment(i,n,o)}else n.length>=1&&(o=this._createChoicesFragment(n,o));if(o.childNodes&&o.childNodes.length>0){var s=this._store.activeItems,a=this._canAddItem(s,this.input.value);if(a.response)this.choiceList.append(o),this._highlightChoice();else{var c=this._getTemplate("notice",a.notice);this.choiceList.append(c)}}else{var l=void 0;c=void 0,this._isSearching?(c="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,l=this._getTemplate("notice",c,"no-results")):(c="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,l=this._getTemplate("notice",c,"no-choices")),this.choiceList.append(l)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,i){var n=this;return void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var o=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(o.length>=1){var r=n._getTemplate("choiceGroup",e);i.appendChild(r),n._createChoicesFragment(o,i,!0)}})),i},e.prototype._createChoicesFragment=function(e,t,i){var o=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var r=this.config,s=r.renderSelectedChoices,a=r.searchResultLimit,c=r.renderChoiceLimit,l=this._isSearching?f.sortByScore:this.config.sorter,h=function(e){if("auto"!==s||o._isSelectOneElement||!e.selected){var i=o._getTemplate("choice",e,o.config.itemSelectText);t.appendChild(i)}},u=e;"auto"!==s||this._isSelectOneElement||(u=e.filter((function(e){return!e.selected})));var d=u.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),p=d.placeholderChoices,m=d.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(l);var v=u.length,_=this._isSelectOneElement?n(n([],p,!0),m,!0):m;this._isSearching?v=a:c&&c>0&&!i&&(v=c);for(var g=0;g=n){var s=o?this._searchChoices(e):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:e,resultCount:s})}else r&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0)))}},e.prototype._canAddItem=function(e,t){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var o=(0,f.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&o&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:i,notice:n}},e.prototype._searchChoices=function(e){var t="string"==typeof e?e.trim():e,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(i," "))return 0;var o=this._store.searchableChoices,r=t,c=n([],this.config.searchFields,!0),l=Object.assign(this.config.fuseOptions,{keys:c,includeMatches:!0}),h=new s.default(o,l).search(r);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,a.filterChoices)(h)),h.length},e.prototype._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this._store.activeItems,n=this.input.isFocussed,o=this.dropdown.isActive,r=this.itemList.hasChildren(),s=String.fromCharCode(t),a=/[a-zA-Z0-9-_ ]/.test(s),c=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY,h=d.KEY_CODES.ENTER_KEY,u=d.KEY_CODES.A_KEY,p=d.KEY_CODES.ESC_KEY,f=d.KEY_CODES.UP_KEY,m=d.KEY_CODES.DOWN_KEY,v=d.KEY_CODES.PAGE_UP_KEY,_=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||o||!a||(this.showDropdown(),this.input.isFocussed||(this.input.value+=s.toLowerCase())),t){case u:return this._onSelectKey(e,r);case h:return this._onEnterKey(e,i,o);case p:return this._onEscapeKey(o);case f:case v:case m:case _:return this._onDirectionKey(e,o);case l:case c:return this._onDeleteKey(e,i,n)}},e.prototype._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,o=this._store.activeItems,r=this._canAddItem(o,n),s=d.KEY_CODES.BACK_KEY,c=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(r.notice&&n){var l=this._getTemplate("notice",r.notice);this.dropdown.element.innerHTML=l.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var h=(i===s||i===c)&&t&&!t.value,u=!this._isTextElement&&this._isSearching,p=this._canSearch&&r.response;h&&u?(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))):p&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var i=e.ctrlKey,n=e.metaKey;(i||n)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t,i){var n=e.target,o=d.KEY_CODES.ENTER_KEY,r=n&&n.hasAttribute("data-button");if(this._isTextElement&&n&&n.value){var s=this.input.value;this._canAddItem(t,s).response&&(this.hideDropdown(!0),this._addItem({value:s}),this._triggerChange(s),this.clearInput())}if(r&&(this._handleButtonAction(t,n),e.preventDefault()),i){var a=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));a&&(t[0]&&(t[0].keyCode=o),this._handleChoiceAction(t,a)),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},e.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode,n=e.metaKey,o=d.KEY_CODES.DOWN_KEY,r=d.KEY_CODES.PAGE_UP_KEY,s=d.KEY_CODES.PAGE_DOWN_KEY;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=i===o||i===s?1:-1,c="[data-choice-selectable]",l=void 0;if(n||i===s||i===r)l=a>0?this.dropdown.element.querySelector("".concat(c,":last-of-type")):this.dropdown.element.querySelector(c);else{var h=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));l=h?(0,f.getAdjacentEl)(h,c,a):this.dropdown.element.querySelector(c)}l&&((0,f.isScrolledIntoView)(l,this.choiceList.element,a)||this.choiceList.scrollToChildElement(l,a),this._highlightChoice(l)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){var n=e.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(g&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,i=this,n=e.target;n&&this.containerOuter.element.contains(n)&&((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},e.prototype._onBlur=function(e){var t,i=this,n=e.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var o=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),o&&i.unhighlightAll(),i.hideDropdown(!0))},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),o&&i.unhighlightAll())},t)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){this._store.dispatch((0,h.resetTo)(this._initialState))},e.prototype._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=e;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},e.prototype._addItem=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,o=e.choiceId,r=void 0===o?-1:o,s=e.groupId,a=void 0===s?-1:s,c=e.customProperties,h=void 0===c?{}:c,u=e.placeholder,p=void 0!==u&&u,f=e.keyCode,m=void 0===f?-1:f,v="string"==typeof t?t.trim():t,_=this._store.items,g=n||v,y=r||-1,E=a>=0?this._store.getGroupById(a):null,b=_?_.length+1:1;this.config.prependValue&&(v=this.config.prependValue+v.toString()),this.config.appendValue&&(v+=this.config.appendValue.toString()),this._store.dispatch((0,l.addItem)({value:v,label:g,id:b,choiceId:y,groupId:a,customProperties:h,placeholder:p,keyCode:m})),this._isSelectOneElement&&this.removeActiveItems(b),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:b,value:v,label:g,customProperties:h,groupValue:E&&E.value?E.value:null,keyCode:m})},e.prototype._removeItem=function(e){var t=e.id,i=e.value,n=e.label,o=e.customProperties,r=e.choiceId,s=e.groupId,a=s&&s>=0?this._store.getGroupById(s):null;t&&r&&(this._store.dispatch((0,l.removeItem)(t,r)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:t,value:i,label:n,customProperties:o,groupValue:a&&a.value?a.value:null}))},e.prototype._addChoice=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,o=e.isSelected,r=void 0!==o&&o,s=e.isDisabled,c=void 0!==s&&s,l=e.groupId,h=void 0===l?-1:l,u=e.customProperties,d=void 0===u?{}:u,p=e.placeholder,f=void 0!==p&&p,m=e.keyCode,v=void 0===m?-1:m;if(null!=t){var _=this._store.choices,g=n||t,y=_?_.length+1:1,E="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(y);this._store.dispatch((0,a.addChoice)({id:y,groupId:h,elementId:E,value:t,label:g,disabled:c,customProperties:d,placeholder:f,keyCode:v})),r&&this._addItem({value:t,label:g,choiceId:y,customProperties:d,placeholder:f,keyCode:v})}},e.prototype._addGroup=function(e){var t=this,i=e.group,n=e.id,o=e.valueKey,r=void 0===o?"value":o,s=e.labelKey,a=void 0===s?"label":s,l=(0,f.isType)("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),h=n||Math.floor((new Date).valueOf()*Math.random()),u=!!i.disabled&&i.disabled;l?(this._store.dispatch((0,c.addGroup)({value:i.label,id:h,active:!0,disabled:u})),l.forEach((function(e){var i=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[r],label:(0,f.isType)("Object",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:i,groupId:h,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch((0,c.addGroup)({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},e.prototype._getTemplate=function(e){for(var t,i=[],o=1;o0?this.element.scrollTop+s-o:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,o=n>1?n:1;this.element.scrollTop=e+o},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,o=n>1?n:1;this.element.scrollTop=e-o},e.prototype._animateScroll=function(e,t){var i=this,o=n.SCROLLING_SPEED,r=this.element.scrollTop,s=!1;t>0?(this._scrollDown(r,o,e),re&&(s=!0)),s&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();t.default=o},730:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(799),o=function(){function e(e){var t=e.element,i=e.classNames;if(this.element=t,this.classNames=i,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,n.dispatchEvent)(this.element,e,t)},e}();t.default=o},541:function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var i=t.element,n=t.classNames,o=t.delimiter,r=e.call(this,{element:i,classNames:n})||this;return r.delimiter=o,r}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(r(i(730)).default);t.default=s},982:function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var i=t.element,n=t.classNames,o=t.template,r=e.call(this,{element:i,classNames:n})||this;return r.template=o,r}return o(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){return n=e,o=t.template(n),void i.appendChild(o);var n,o})),this.appendDocFragment(i)},enumerable:!1,configurable:!0}),t.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},t}(r(i(730)).default);t.default=s},883:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=void 0,t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},t.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},789:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var n=i(799);t.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat((0,n.sanitise)(e),'"')},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES}},799:function(e,t){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.diff=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.strToEl=t.sanitise=t.isScrolledIntoView=t.getAdjacentEl=t.wrap=t.isType=t.getType=t.generateId=t.generateChars=t.getRandomNumber=void 0,t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,i){var n=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),"".concat(i,"-").concat(n)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,i){return null!=i&&(0,t.getType)(i)===e},t.wrap=function(e,t){return void 0===t&&(t=document.createElement("div")),e.parentNode&&(e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)),t.appendChild(e)},t.getAdjacentEl=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),o=e[n];o;){if(o.matches(t))return o;o=o[n]}return o},t.isScrolledIntoView=function(e,t,i){return void 0===i&&(i=1),!!e&&(i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&").replace(/>/g,">").replace(/-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(s.choiceId),10)&&(t.selected=!0),t})):e;case"REMOVE_ITEM":var a=n;return a.choiceId&&a.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!1),t})):e;case"FILTER_CHOICES":var c=n;return e.map((function(e){var t=e;return t.active=c.results.some((function(e){var i=e.item,n=e.score;return i.id===t.id&&(t.score=n,!0)})),t}));case"ACTIVATE_CHOICES":var l=n;return e.map((function(e){var t=e;return t.active=l.active,t}));case"CLEAR_CHOICES":return t.defaultState;default:return e}}},871:function(e,t){"use strict";var i=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,o=0,r=t.length;o0?"treeitem":"option"),Object.assign(E.dataset,{choice:"",id:d,value:p,selectText:i}),_?(E.classList.add(h),E.dataset.choiceDisabled="",E.setAttribute("aria-disabled","true")):(E.classList.add(c),E.dataset.choiceSelectable=""),E},input:function(e,t){var i=e.classNames,n=i.input,o=i.inputCloned,r=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(n," ").concat(o),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return r.setAttribute("role","textbox"),r.setAttribute("aria-autocomplete","list"),r.setAttribute("aria-label",t),r},dropdown:function(e){var t=e.classNames,i=t.list,n=t.listDropdown,o=document.createElement("div");return o.classList.add(i,n),o.setAttribute("aria-expanded","false"),o},notice:function(e,t,i){var n,o=e.allowHTML,r=e.classNames,s=r.item,a=r.itemChoice,c=r.noResults,l=r.noChoices;void 0===i&&(i="");var h=[s,a];return"no-choices"===i?h.push(l):"no-results"===i&&h.push(c),Object.assign(document.createElement("div"),((n={})[o?"innerHTML":"innerText"]=t,n.className=h.join(" "),n))},option:function(e){var t=e.label,i=e.value,n=e.customProperties,o=e.active,r=e.disabled,s=new Option(t,i,!1,o);return n&&(s.dataset.customProperties="".concat(n)),s.disabled=!!r,s}};t.default=i},996:function(e){"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function o(e,t,i){return e.concat(t).map((function(e){return n(e,i)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,i,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=n;var l=Array.isArray(i);return l===Array.isArray(e)?l?c.arrayMerge(e,i,c):function(e,t,i){var o={};return i.isMergeableObject(e)&&r(e).forEach((function(t){o[t]=n(e[t],i)})),r(t).forEach((function(r){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(s(e,r)&&i.isMergeableObject(t[r])?o[r]=function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a}(r,i)(e[r],t[r],i):o[r]=n(t[r],i))})),o}(e,i,c):n(i,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return a(e,i,t)}),{})};var c=a;e.exports=c},70:function(e){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t){e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,i){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var i=this._prepareSearchers(e),n=i.tokenSearchers,o=i.fullSearcher,r=this._search(n,o),s=r.weights,a=r.results;return this._computeScore(s,a),this.options.shouldSort&&this._sort(a),t.limit&&"number"==typeof t.limit&&(a=a.slice(0,t.limit)),this._format(a)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var i=e.split(this.options.tokenSeparator),n=0,o=i.length;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=this.list,n={},o=[];if("string"==typeof i[0]){for(var r=0,s=i.length;r1)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(h,p),record:h,index:c},{resultMap:n,results:o,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:o}}},{key:"_analyze",value:function(e,t){var i=e.key,n=e.arrayIndex,o=void 0===n?-1:n,r=e.value,s=e.record,c=e.index,l=t.tokenSearchers,h=void 0===l?[]:l,u=t.fullSearcher,d=void 0===u?[]:u,p=t.resultMap,f=void 0===p?{}:p,m=t.results,v=void 0===m?[]:m;if(null!=r){var _=!1,g=-1,y=0;if("string"==typeof r){this._log("\nKey: ".concat(""===i?"-":i));var E=d.search(r);if(this._log('Full text: "'.concat(r,'", score: ').concat(E.score)),this.options.tokenize){for(var b=r.split(this.options.tokenSeparator),S=[],I=0;I-1&&(N=(N+g)/2),this._log("Score average:",N);var M=!this.options.tokenize||!this.options.matchAllTokens||y>=h.length;if(this._log("\nCheck Matches: ".concat(M)),(_||E.isMatch)&&M){var x=f[c];x?x.output.push({key:i,arrayIndex:o,value:r,score:N,matchedIndices:E.matchedIndices}):(f[c]={item:s,output:[{key:i,arrayIndex:o,value:r,score:N,matchedIndices:E.matchedIndices}]},v.push(f[c]))}}else if(a(r))for(var j=0,F=r.length;j-1&&(s.arrayIndex=r.arrayIndex),t.matches.push(s)}}})),this.options.includeScore&&o.push((function(e,t){t.score=e.score}));for(var r=0,s=e.length;ri)return o(e,this.pattern,n);var s=this.options,a=s.location,c=s.distance,l=s.threshold,h=s.findAllMatches,u=s.minMatchCharLength;return r(e,this.pattern,this.patternAlphabet,{location:a,distance:c,threshold:l,findAllMatches:h,minMatchCharLength:u})}}])&&n(t.prototype,i),e}();e.exports=a},function(e,t){var i=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(i,"\\$&").replace(n,"|")),r=e.match(o),s=!!r,a=[];if(s)for(var c=0,l=r.length;c=N;j-=1){var F=j-1,k=i[e.charAt(F)];if(k&&(b[F]=1),x[j]=(x[j+1]<<1|1)&k,0!==w&&(x[j]|=(T[j+1]|T[j])<<1|1|T[j+1]),x[j]&L&&(C=n(t,{errors:w,currentLocation:F,expectedLocation:v,distance:l}))<=g){if(g=C,(y=F)<=v)break;N=Math.max(1,2*v-y)}}if(n(t,{errors:w+1,currentLocation:v,expectedLocation:v,distance:l})>g)break;T=x}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:o(b,m)}}},function(e,t){e.exports=function(e,t){var i=t.errors,n=void 0===i?0:i,o=t.currentLocation,r=void 0===o?0:o,s=t.expectedLocation,a=void 0===s?0:s,c=t.distance,l=void 0===c?100:c,h=n/e.length,u=Math.abs(a-r);return l?h+u/l:u?1:h}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[],n=-1,o=-1,r=0,s=e.length;r=t&&i.push([n,o]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}},function(e,t){e.exports=function(e){for(var t={},i=e.length,n=0;n=0?this._store.getGroupById(o):null;return this._store.dispatch((0,l.highlightItem)(i,!0)),t&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:i,value:s,label:c,groupValue:u&&u.value?u.value:null}),this},e.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,i=e.groupId,n=void 0===i?-1:i,o=e.value,r=void 0===o?"":o,s=e.label,a=void 0===s?"":s,c=n>=0?this._store.getGroupById(n):null;return this._store.dispatch((0,l.highlightItem)(t,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:t,value:r,label:a,groupValue:c&&c.value?c.value:null}),this},e.prototype.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},e.prototype.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,i){var n=e?i.value:i;return t.push(n),t}),[]);return this._isSelectOneElement?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},e.prototype.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},e.prototype.setChoices=function(e,t,i,n){var o=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof e){var r=e(this);if("function"==typeof Promise&&r instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return o._handleLoadingState(!0)})).then((function(){return r})).then((function(e){return o.setChoices(e,t,i,n)})).catch((function(e){o.config.silent||console.error(e)})).then((function(){return o._handleLoadingState(!1)})).then((function(){return o}));if(!Array.isArray(r))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof r));return this.setChoices(r,t,i,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){if(e.choices)o._addGroup({id:e.id?parseInt("".concat(e.id),10):null,group:e,valueKey:t,labelKey:i});else{var n=e;o._addChoice({value:n[t],label:n[i],isSelected:!!n.selected,isDisabled:!!n.disabled,placeholder:!!n.placeholder,customProperties:n.customProperties})}})),this._stopLoading(),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,a.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,u.clearAll)()),this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,i=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,o=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var r=n.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));r.length>=1&&(o=this._createChoicesFragment(r,o)),o=this._createGroupsFragment(i,n,o)}else n.length>=1&&(o=this._createChoicesFragment(n,o));if(o.childNodes&&o.childNodes.length>0){var s=this._store.activeItems,a=this._canAddItem(s,this.input.value);if(a.response)this.choiceList.append(o),this._highlightChoice();else{var c=this._getTemplate("notice",a.notice);this.choiceList.append(c)}}else{var l=void 0;c=void 0,this._isSearching?(c="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,l=this._getTemplate("notice",c,"no-results")):(c="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,l=this._getTemplate("notice",c,"no-choices")),this.choiceList.append(l)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,i){var n=this;return void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var o=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(o.length>=1){var r=n._getTemplate("choiceGroup",e);i.appendChild(r),n._createChoicesFragment(o,i,!0)}})),i},e.prototype._createChoicesFragment=function(e,t,i){var o=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var r=this.config,s=r.renderSelectedChoices,a=r.searchResultLimit,c=r.renderChoiceLimit,l=this._isSearching?f.sortByScore:this.config.sorter,u=function(e){if("auto"!==s||o._isSelectOneElement||!e.selected){var i=o._getTemplate("choice",e,o.config.itemSelectText);t.appendChild(i)}},h=e;"auto"!==s||this._isSelectOneElement||(h=e.filter((function(e){return!e.selected})));var d=h.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),p=d.placeholderChoices,m=d.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(l);var v=h.length,_=this._isSelectOneElement?n(n([],p,!0),m,!0):m;this._isSearching?v=a:c&&c>0&&!i&&(v=c);for(var g=0;g=n){var s=o?this._searchChoices(e):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:e,resultCount:s})}else r&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0)))}},e.prototype._canAddItem=function(e,t){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var o=(0,f.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&o&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:i,notice:n}},e.prototype._searchChoices=function(e){var t="string"==typeof e?e.trim():e,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(i," "))return 0;var o=this._store.searchableChoices,r=t,c=n([],this.config.searchFields,!0),l=Object.assign(this.config.fuseOptions,{keys:c,includeMatches:!0}),u=new s.default(o,l).search(r);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,a.filterChoices)(u)),u.length},e.prototype._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this._store.activeItems,n=this.input.isFocussed,o=this.dropdown.isActive,r=this.itemList.hasChildren(),s=String.fromCharCode(t),a=/[a-zA-Z0-9-_ ]/.test(s),c=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY,u=d.KEY_CODES.ENTER_KEY,h=d.KEY_CODES.A_KEY,p=d.KEY_CODES.ESC_KEY,f=d.KEY_CODES.UP_KEY,m=d.KEY_CODES.DOWN_KEY,v=d.KEY_CODES.PAGE_UP_KEY,_=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||o||!a||(this.showDropdown(),this.input.isFocussed||(this.input.value+=s.toLowerCase())),t){case h:return this._onSelectKey(e,r);case u:return this._onEnterKey(e,i,o);case p:return this._onEscapeKey(o);case f:case v:case m:case _:return this._onDirectionKey(e,o);case l:case c:return this._onDeleteKey(e,i,n)}},e.prototype._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,o=this._store.activeItems,r=this._canAddItem(o,n),s=d.KEY_CODES.BACK_KEY,c=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(r.notice&&n){var l=this._getTemplate("notice",r.notice);this.dropdown.element.innerHTML=l.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var u=(i===s||i===c)&&t&&!t.value,h=!this._isTextElement&&this._isSearching,p=this._canSearch&&r.response;u&&h?(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))):p&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var i=e.ctrlKey,n=e.metaKey;(i||n)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t,i){var n=e.target,o=d.KEY_CODES.ENTER_KEY,r=n&&n.hasAttribute("data-button");if(this._isTextElement&&n&&n.value){var s=this.input.value;this._canAddItem(t,s).response&&(this.hideDropdown(!0),this._addItem({value:s}),this._triggerChange(s),this.clearInput())}if(r&&(this._handleButtonAction(t,n),e.preventDefault()),i){var a=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));a&&(t[0]&&(t[0].keyCode=o),this._handleChoiceAction(t,a)),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},e.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode,n=e.metaKey,o=d.KEY_CODES.DOWN_KEY,r=d.KEY_CODES.PAGE_UP_KEY,s=d.KEY_CODES.PAGE_DOWN_KEY;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=i===o||i===s?1:-1,c="[data-choice-selectable]",l=void 0;if(n||i===s||i===r)l=a>0?this.dropdown.element.querySelector("".concat(c,":last-of-type")):this.dropdown.element.querySelector(c);else{var u=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));l=u?(0,f.getAdjacentEl)(u,c,a):this.dropdown.element.querySelector(c)}l&&((0,f.isScrolledIntoView)(l,this.choiceList.element,a)||this.choiceList.scrollToChildElement(l,a),this._highlightChoice(l)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){var n=e.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(g&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,i=this,n=e.target;n&&this.containerOuter.element.contains(n)&&((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},e.prototype._onBlur=function(e){var t,i=this,n=e.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var o=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),o&&i.unhighlightAll(),i.hideDropdown(!0))},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),o&&i.unhighlightAll())},t)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){this._store.dispatch((0,u.resetTo)(this._initialState))},e.prototype._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=e;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},e.prototype._addItem=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,o=e.choiceId,r=void 0===o?-1:o,s=e.groupId,a=void 0===s?-1:s,c=e.customProperties,u=void 0===c?{}:c,h=e.placeholder,p=void 0!==h&&h,f=e.keyCode,m=void 0===f?-1:f,v="string"==typeof t?t.trim():t,_=this._store.items,g=n||v,y=r||-1,E=a>=0?this._store.getGroupById(a):null,b=_?_.length+1:1;this.config.prependValue&&(v=this.config.prependValue+v.toString()),this.config.appendValue&&(v+=this.config.appendValue.toString()),this._store.dispatch((0,l.addItem)({value:v,label:g,id:b,choiceId:y,groupId:a,customProperties:u,placeholder:p,keyCode:m})),this._isSelectOneElement&&this.removeActiveItems(b),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:b,value:v,label:g,customProperties:u,groupValue:E&&E.value?E.value:null,keyCode:m})},e.prototype._removeItem=function(e){var t=e.id,i=e.value,n=e.label,o=e.customProperties,r=e.choiceId,s=e.groupId,a=s&&s>=0?this._store.getGroupById(s):null;t&&r&&(this._store.dispatch((0,l.removeItem)(t,r)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:t,value:i,label:n,customProperties:o,groupValue:a&&a.value?a.value:null}))},e.prototype._addChoice=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,o=e.isSelected,r=void 0!==o&&o,s=e.isDisabled,c=void 0!==s&&s,l=e.groupId,u=void 0===l?-1:l,h=e.customProperties,d=void 0===h?{}:h,p=e.placeholder,f=void 0!==p&&p,m=e.keyCode,v=void 0===m?-1:m;if(null!=t){var _=this._store.choices,g=n||t,y=_?_.length+1:1,E="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(y);this._store.dispatch((0,a.addChoice)({id:y,groupId:u,elementId:E,value:t,label:g,disabled:c,customProperties:d,placeholder:f,keyCode:v})),r&&this._addItem({value:t,label:g,choiceId:y,customProperties:d,placeholder:f,keyCode:v})}},e.prototype._addGroup=function(e){var t=this,i=e.group,n=e.id,o=e.valueKey,r=void 0===o?"value":o,s=e.labelKey,a=void 0===s?"label":s,l=(0,f.isType)("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),u=n||Math.floor((new Date).valueOf()*Math.random()),h=!!i.disabled&&i.disabled;l?(this._store.dispatch((0,c.addGroup)({value:i.label,id:u,active:!0,disabled:h})),l.forEach((function(e){var i=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[r],label:(0,f.isType)("Object",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:i,groupId:u,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch((0,c.addGroup)({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},e.prototype._getTemplate=function(e){for(var t,i=[],o=1;o0?this.element.scrollTop+s-o:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,o=n>1?n:1;this.element.scrollTop=e+o},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,o=n>1?n:1;this.element.scrollTop=e-o},e.prototype._animateScroll=function(e,t){var i=this,o=n.SCROLLING_SPEED,r=this.element.scrollTop,s=!1;t>0?(this._scrollDown(r,o,e),re&&(s=!0)),s&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();t.default=o},730:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(799),o=function(){function e(e){var t=e.element,i=e.classNames;if(this.element=t,this.classNames=i,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,n.dispatchEvent)(this.element,e,t)},e}();t.default=o},541:function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var i=t.element,n=t.classNames,o=t.delimiter,r=e.call(this,{element:i,classNames:n})||this;return r.delimiter=o,r}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(r(i(730)).default);t.default=s},982:function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(t){var i=t.element,n=t.classNames,o=t.template,r=e.call(this,{element:i,classNames:n})||this;return r.template=o,r}return o(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){return n=e,o=t.template(n),void i.appendChild(o);var n,o})),this.appendDocFragment(i)},enumerable:!1,configurable:!0}),t.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},t}(r(i(730)).default);t.default=s},883:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=void 0,t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},t.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},789:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var n=i(799);t.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat((0,n.sanitise)(e),'"')},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES}},799:function(e,t){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.diff=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.strToEl=t.sanitise=t.isScrolledIntoView=t.getAdjacentEl=t.wrap=t.isType=t.getType=t.generateId=t.generateChars=t.getRandomNumber=void 0,t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,i){var n=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),"".concat(i,"-").concat(n)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,i){return null!=i&&(0,t.getType)(i)===e},t.wrap=function(e,t){return void 0===t&&(t=document.createElement("div")),e.parentNode&&(e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)),t.appendChild(e)},t.getAdjacentEl=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),o=e[n];o;){if(o.matches(t))return o;o=o[n]}return o},t.isScrolledIntoView=function(e,t,i){return void 0===i&&(i=1),!!e&&(i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&").replace(/>/g,">").replace(/-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(s.choiceId),10)&&(t.selected=!0),t})):e;case"REMOVE_ITEM":var a=n;return a.choiceId&&a.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!1),t})):e;case"FILTER_CHOICES":var c=n;return e.map((function(e){var t=e;return t.active=c.results.some((function(e){var i=e.item,n=e.score;return i.id===t.id&&(t.score=n,!0)})),t}));case"ACTIVATE_CHOICES":var l=n;return e.map((function(e){var t=e;return t.active=l.active,t}));case"CLEAR_CHOICES":return t.defaultState;default:return e}}},871:function(e,t){"use strict";var i=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,o=0,r=t.length;o0?"treeitem":"option"),Object.assign(E.dataset,{choice:"",id:d,value:p,selectText:i}),_?(E.classList.add(u),E.dataset.choiceDisabled="",E.setAttribute("aria-disabled","true")):(E.classList.add(c),E.dataset.choiceSelectable=""),E},input:function(e,t){var i=e.classNames,n=i.input,o=i.inputCloned,r=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(n," ").concat(o),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return r.setAttribute("role","textbox"),r.setAttribute("aria-autocomplete","list"),r.setAttribute("aria-label",t),r},dropdown:function(e){var t=e.classNames,i=t.list,n=t.listDropdown,o=document.createElement("div");return o.classList.add(i,n),o.setAttribute("aria-expanded","false"),o},notice:function(e,t,i){var n,o=e.allowHTML,r=e.classNames,s=r.item,a=r.itemChoice,c=r.noResults,l=r.noChoices;void 0===i&&(i="");var u=[s,a];return"no-choices"===i?u.push(l):"no-results"===i&&u.push(c),Object.assign(document.createElement("div"),((n={})[o?"innerHTML":"innerText"]=t,n.className=u.join(" "),n))},option:function(e){var t=e.label,i=e.value,n=e.customProperties,o=e.active,r=e.disabled,s=new Option(t,i,!1,o);return n&&(s.dataset.customProperties="".concat(n)),s.disabled=!!r,s}};t.default=i},996:function(e){"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function o(e,t,i){return e.concat(t).map((function(e){return n(e,i)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,i,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=n;var l=Array.isArray(i);return l===Array.isArray(e)?l?c.arrayMerge(e,i,c):function(e,t,i){var o={};return i.isMergeableObject(e)&&r(e).forEach((function(t){o[t]=n(e[t],i)})),r(t).forEach((function(r){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(s(e,r)&&i.isMergeableObject(t[r])?o[r]=function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a}(r,i)(e[r],t[r],i):o[r]=n(t[r],i))})),o}(e,i,c):n(i,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return a(e,i,t)}),{})};var c=a;e.exports=c},70:function(e){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t){e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,i){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var i=this._prepareSearchers(e),n=i.tokenSearchers,o=i.fullSearcher,r=this._search(n,o),s=r.weights,a=r.results;return this._computeScore(s,a),this.options.shouldSort&&this._sort(a),t.limit&&"number"==typeof t.limit&&(a=a.slice(0,t.limit)),this._format(a)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var i=e.split(this.options.tokenSeparator),n=0,o=i.length;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=this.list,n={},o=[];if("string"==typeof i[0]){for(var r=0,s=i.length;r1)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:c},{resultMap:n,results:o,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:o}}},{key:"_analyze",value:function(e,t){var i=e.key,n=e.arrayIndex,o=void 0===n?-1:n,r=e.value,s=e.record,c=e.index,l=t.tokenSearchers,u=void 0===l?[]:l,h=t.fullSearcher,d=void 0===h?[]:h,p=t.resultMap,f=void 0===p?{}:p,m=t.results,v=void 0===m?[]:m;if(null!=r){var _=!1,g=-1,y=0;if("string"==typeof r){this._log("\nKey: ".concat(""===i?"-":i));var E=d.search(r);if(this._log('Full text: "'.concat(r,'", score: ').concat(E.score)),this.options.tokenize){for(var b=r.split(this.options.tokenSeparator),S=[],I=0;I-1&&(N=(N+g)/2),this._log("Score average:",N);var M=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: ".concat(M)),(_||E.isMatch)&&M){var x=f[c];x?x.output.push({key:i,arrayIndex:o,value:r,score:N,matchedIndices:E.matchedIndices}):(f[c]={item:s,output:[{key:i,arrayIndex:o,value:r,score:N,matchedIndices:E.matchedIndices}]},v.push(f[c]))}}else if(a(r))for(var j=0,F=r.length;j-1&&(s.arrayIndex=r.arrayIndex),t.matches.push(s)}}})),this.options.includeScore&&o.push((function(e,t){t.score=e.score}));for(var r=0,s=e.length;ri)return o(e,this.pattern,n);var s=this.options,a=s.location,c=s.distance,l=s.threshold,u=s.findAllMatches,h=s.minMatchCharLength;return r(e,this.pattern,this.patternAlphabet,{location:a,distance:c,threshold:l,findAllMatches:u,minMatchCharLength:h})}}])&&n(t.prototype,i),e}();e.exports=a},function(e,t){var i=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(i,"\\$&").replace(n,"|")),r=e.match(o),s=!!r,a=[];if(s)for(var c=0,l=r.length;c=N;j-=1){var F=j-1,k=i[e.charAt(F)];if(k&&(b[F]=1),x[j]=(x[j+1]<<1|1)&k,0!==w&&(x[j]|=(T[j+1]|T[j])<<1|1|T[j+1]),x[j]&L&&(C=n(t,{errors:w,currentLocation:F,expectedLocation:v,distance:l}))<=g){if(g=C,(y=F)<=v)break;N=Math.max(1,2*v-y)}}if(n(t,{errors:w+1,currentLocation:v,expectedLocation:v,distance:l})>g)break;T=x}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:o(b,m)}}},function(e,t){e.exports=function(e,t){var i=t.errors,n=void 0===i?0:i,o=t.currentLocation,r=void 0===o?0:o,s=t.expectedLocation,a=void 0===s?0:s,c=t.distance,l=void 0===c?100:c,u=n/e.length,h=Math.abs(a-r);return l?u+h/l:h?1:u}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[],n=-1,o=-1,r=0,s=e.length;r=t&&i.push([n,o]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}},function(e,t){e.exports=function(e){for(var t={},i=e.length,n=0;n { + item: T; + score: number; +} +export interface FilterChoicesAction { + type: typeof ACTION_TYPES.FILTER_CHOICES; + results: Result[]; +} +export interface ActivateChoicesAction { + type: typeof ACTION_TYPES.ACTIVATE_CHOICES; + active: boolean; +} +export interface ClearChoicesAction { + type: typeof ACTION_TYPES.CLEAR_CHOICES; +} +export declare const addChoice: ({ value, label, id, groupId, disabled, elementId, customProperties, placeholder, keyCode, }: { + value: any; + label: any; + id: any; + groupId: any; + disabled: any; + elementId: any; + customProperties: any; + placeholder: any; + keyCode: any; +}) => AddChoiceAction; +export declare const filterChoices: (results: Result[]) => FilterChoicesAction; +export declare const activateChoices: (active?: boolean) => ActivateChoicesAction; +export declare const clearChoices: () => ClearChoicesAction; +//# sourceMappingURL=choices.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/choices.d.ts.map b/public/types/src/scripts/actions/choices.d.ts.map new file mode 100644 index 0000000..2e69e60 --- /dev/null +++ b/public/types/src/scripts/actions/choices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,YAAY,CAAC,UAAU,CAAC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,YAAY,CAAC,cAAc,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,YAAY,CAAC,gBAAgB,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,YAAY,CAAC,aAAa,CAAC;CACzC;AAED,eAAO,MAAM,SAAS;;;;;;;;;;MAUlB,eAWF,CAAC;AAEH,eAAO,MAAM,aAAa,YACf,OAAO,MAAM,CAAC,EAAE,KACxB,mBAGD,CAAC;AAEH,eAAO,MAAM,eAAe,wBAAoB,qBAG9C,CAAC;AAEH,eAAO,MAAM,YAAY,QAAO,kBAE9B,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/actions/choices.test.d.ts b/public/types/src/scripts/actions/choices.test.d.ts new file mode 100644 index 0000000..1b34de1 --- /dev/null +++ b/public/types/src/scripts/actions/choices.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=choices.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/choices.test.d.ts.map b/public/types/src/scripts/actions/choices.test.d.ts.map new file mode 100644 index 0000000..0f1c3a5 --- /dev/null +++ b/public/types/src/scripts/actions/choices.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/choices.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/actions/groups.d.ts b/public/types/src/scripts/actions/groups.d.ts new file mode 100644 index 0000000..ad7a8b7 --- /dev/null +++ b/public/types/src/scripts/actions/groups.d.ts @@ -0,0 +1,15 @@ +import { ACTION_TYPES } from '../constants'; +export interface AddGroupAction { + type: typeof ACTION_TYPES.ADD_GROUP; + id: number; + value: string; + active: boolean; + disabled: boolean; +} +export declare const addGroup: ({ value, id, active, disabled, }: { + id: number; + value: string; + active: boolean; + disabled: boolean; +}) => AddGroupAction; +//# sourceMappingURL=groups.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/groups.d.ts.map b/public/types/src/scripts/actions/groups.d.ts.map new file mode 100644 index 0000000..4fd7516 --- /dev/null +++ b/public/types/src/scripts/actions/groups.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,YAAY,CAAC,SAAS,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ;QAMf,MAAM;WACH,MAAM;YACL,OAAO;cACL,OAAO;MACf,cAMF,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/actions/groups.test.d.ts b/public/types/src/scripts/actions/groups.test.d.ts new file mode 100644 index 0000000..8d44d56 --- /dev/null +++ b/public/types/src/scripts/actions/groups.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=groups.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/groups.test.d.ts.map b/public/types/src/scripts/actions/groups.test.d.ts.map new file mode 100644 index 0000000..80ca388 --- /dev/null +++ b/public/types/src/scripts/actions/groups.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"groups.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/groups.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/actions/items.d.ts b/public/types/src/scripts/actions/items.d.ts new file mode 100644 index 0000000..96b0b2a --- /dev/null +++ b/public/types/src/scripts/actions/items.d.ts @@ -0,0 +1,35 @@ +import { ACTION_TYPES } from '../constants'; +export interface AddItemAction { + type: typeof ACTION_TYPES.ADD_ITEM; + id: number; + value: string; + label: string; + choiceId: number; + groupId: number; + customProperties: object; + placeholder: boolean; + keyCode: number; +} +export interface RemoveItemAction { + type: typeof ACTION_TYPES.REMOVE_ITEM; + id: number; + choiceId: number; +} +export interface HighlightItemAction { + type: typeof ACTION_TYPES.HIGHLIGHT_ITEM; + id: number; + highlighted: boolean; +} +export declare const addItem: ({ value, label, id, choiceId, groupId, customProperties, placeholder, keyCode, }: { + id: number; + value: string; + label: string; + choiceId: number; + groupId: number; + customProperties: object; + placeholder: boolean; + keyCode: number; +}) => AddItemAction; +export declare const removeItem: (id: number, choiceId: number) => RemoveItemAction; +export declare const highlightItem: (id: number, highlighted: boolean) => HighlightItemAction; +//# sourceMappingURL=items.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/items.d.ts.map b/public/types/src/scripts/actions/items.d.ts.map new file mode 100644 index 0000000..2ad2590 --- /dev/null +++ b/public/types/src/scripts/actions/items.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,YAAY,CAAC,QAAQ,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,YAAY,CAAC,WAAW,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,YAAY,CAAC,cAAc,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,OAAO;QAUd,MAAM;WACH,MAAM;WACN,MAAM;cACH,MAAM;aACP,MAAM;sBACG,MAAM;iBACX,OAAO;aACX,MAAM;MACb,aAUF,CAAC;AAEH,eAAO,MAAM,UAAU,OAAQ,MAAM,YAAY,MAAM,KAAG,gBAIxD,CAAC;AAEH,eAAO,MAAM,aAAa,OACpB,MAAM,eACG,OAAO,KACnB,mBAID,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/actions/items.test.d.ts b/public/types/src/scripts/actions/items.test.d.ts new file mode 100644 index 0000000..e81d58b --- /dev/null +++ b/public/types/src/scripts/actions/items.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=items.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/items.test.d.ts.map b/public/types/src/scripts/actions/items.test.d.ts.map new file mode 100644 index 0000000..77773c2 --- /dev/null +++ b/public/types/src/scripts/actions/items.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"items.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/items.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/actions/misc.d.ts b/public/types/src/scripts/actions/misc.d.ts new file mode 100644 index 0000000..65e1faf --- /dev/null +++ b/public/types/src/scripts/actions/misc.d.ts @@ -0,0 +1,17 @@ +import { ACTION_TYPES } from '../constants'; +import { State } from '../interfaces/state'; +export interface ClearAllAction { + type: typeof ACTION_TYPES.CLEAR_ALL; +} +export interface ResetToAction { + type: typeof ACTION_TYPES.RESET_TO; + state: State; +} +export interface SetIsLoadingAction { + type: typeof ACTION_TYPES.SET_IS_LOADING; + isLoading: boolean; +} +export declare const clearAll: () => ClearAllAction; +export declare const resetTo: (state: State) => ResetToAction; +export declare const setIsLoading: (isLoading: boolean) => SetIsLoadingAction; +//# sourceMappingURL=misc.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/misc.d.ts.map b/public/types/src/scripts/actions/misc.d.ts.map new file mode 100644 index 0000000..0e77eb2 --- /dev/null +++ b/public/types/src/scripts/actions/misc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,YAAY,CAAC,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,YAAY,CAAC,QAAQ,CAAC;IACnC,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,YAAY,CAAC,cAAc,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,QAAO,cAE1B,CAAC;AAEH,eAAO,MAAM,OAAO,UAAW,KAAK,KAAG,aAGrC,CAAC;AAEH,eAAO,MAAM,YAAY,cAAe,OAAO,KAAG,kBAGhD,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/actions/misc.test.d.ts b/public/types/src/scripts/actions/misc.test.d.ts new file mode 100644 index 0000000..c81b2cc --- /dev/null +++ b/public/types/src/scripts/actions/misc.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=misc.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/actions/misc.test.d.ts.map b/public/types/src/scripts/actions/misc.test.d.ts.map new file mode 100644 index 0000000..912fa18 --- /dev/null +++ b/public/types/src/scripts/actions/misc.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"misc.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/actions/misc.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/choices.d.ts b/public/types/src/scripts/choices.d.ts new file mode 100644 index 0000000..9ea386b --- /dev/null +++ b/public/types/src/scripts/choices.d.ts @@ -0,0 +1,218 @@ +import { Container, Dropdown, Input, List, WrappedInput, WrappedSelect } from './components'; +import { Choice } from './interfaces/choice'; +import { Group } from './interfaces/group'; +import { Item } from './interfaces/item'; +import { Notice } from './interfaces/notice'; +import { Options } from './interfaces/options'; +import { State } from './interfaces/state'; +import Store from './store/store'; +import templates from './templates'; +/** + * Choices + * @author Josh Johnson + */ +declare class Choices implements Choices { + static get defaults(): { + options: Partial; + templates: typeof templates; + }; + initialised: boolean; + config: Options; + passedElement: WrappedInput | WrappedSelect; + containerOuter: Container; + containerInner: Container; + choiceList: List; + itemList: List; + input: Input; + dropdown: Dropdown; + _isTextElement: boolean; + _isSelectOneElement: boolean; + _isSelectMultipleElement: boolean; + _isSelectElement: boolean; + _store: Store; + _templates: typeof templates; + _initialState: State; + _currentState: State; + _prevState: State; + _currentValue: string; + _canSearch: boolean; + _isScrollingOnIe: boolean; + _highlightPosition: number; + _wasTap: boolean; + _isSearching: boolean; + _placeholderValue: string | null; + _baseId: string; + _direction: HTMLElement['dir']; + _idNames: { + itemChoice: string; + }; + _presetGroups: Group[] | HTMLOptGroupElement[] | Element[]; + _presetOptions: Item[] | HTMLOptionElement[]; + _presetChoices: Partial[]; + _presetItems: Item[] | string[]; + constructor(element?: string | Element | HTMLInputElement | HTMLSelectElement, userConfig?: Partial); + init(): void; + destroy(): void; + enable(): this; + disable(): this; + highlightItem(item: Item, runEvent?: boolean): this; + unhighlightItem(item: Item): this; + highlightAll(): this; + unhighlightAll(): this; + removeActiveItemsByValue(value: string): this; + removeActiveItems(excludedId: number): this; + removeHighlightedItems(runEvent?: boolean): this; + showDropdown(preventInputFocus?: boolean): this; + hideDropdown(preventInputBlur?: boolean): this; + getValue(valueOnly?: boolean): string[] | Item[] | Item | string; + setValue(items: string[] | Item[]): this; + setChoiceByValue(value: string): this; + /** + * Set choices of select input via an array of objects (or function that returns array of object or promise of it), + * a value field name and a label field name. + * This behaves the same as passing items via the choices option but can be called after initialising Choices. + * This can also be used to add groups of choices (see example 2); Optionally pass a true `replaceChoices` value to remove any existing choices. + * Optionally pass a `customProperties` object to add additional data to your choices (useful when searching/filtering etc). + * + * **Input types affected:** select-one, select-multiple + * + * @example + * ```js + * const example = new Choices(element); + * + * example.setChoices([ + * {value: 'One', label: 'Label One', disabled: true}, + * {value: 'Two', label: 'Label Two', selected: true}, + * {value: 'Three', label: 'Label Three'}, + * ], 'value', 'label', false); + * ``` + * + * @example + * ```js + * const example = new Choices(element); + * + * example.setChoices(async () => { + * try { + * const items = await fetch('/items'); + * return items.json() + * } catch(err) { + * console.error(err) + * } + * }); + * ``` + * + * @example + * ```js + * const example = new Choices(element); + * + * example.setChoices([{ + * label: 'Group one', + * id: 1, + * disabled: false, + * choices: [ + * {value: 'Child One', label: 'Child One', selected: true}, + * {value: 'Child Two', label: 'Child Two', disabled: true}, + * {value: 'Child Three', label: 'Child Three'}, + * ] + * }, + * { + * label: 'Group two', + * id: 2, + * disabled: false, + * choices: [ + * {value: 'Child Four', label: 'Child Four', disabled: true}, + * {value: 'Child Five', label: 'Child Five'}, + * {value: 'Child Six', label: 'Child Six', customProperties: { + * description: 'Custom description about child six', + * random: 'Another random custom property' + * }}, + * ] + * }], 'value', 'label', false); + * ``` + */ + setChoices(choicesArrayOrFetcher?: Choice[] | Group[] | ((instance: Choices) => Choice[] | Promise), value?: string, label?: string, replaceChoices?: boolean): this | Promise; + clearChoices(): this; + clearStore(): this; + clearInput(): this; + _render(): void; + _renderChoices(): void; + _renderItems(): void; + _createGroupsFragment(groups: Group[], choices: Choice[], fragment?: DocumentFragment): DocumentFragment; + _createChoicesFragment(choices: Choice[], fragment?: DocumentFragment, withinGroup?: boolean): DocumentFragment; + _createItemsFragment(items: Item[], fragment?: DocumentFragment): DocumentFragment; + _triggerChange(value: any): void; + _selectPlaceholderChoice(placeholderChoice: Choice): void; + _handleButtonAction(activeItems?: Item[], element?: HTMLElement): void; + _handleItemAction(activeItems?: Item[], element?: HTMLElement, hasShiftKey?: boolean): void; + _handleChoiceAction(activeItems?: Item[], element?: HTMLElement): void; + _handleBackspace(activeItems?: Item[]): void; + _startLoading(): void; + _stopLoading(): void; + _handleLoadingState(setLoading?: boolean): void; + _handleSearch(value: string): void; + _canAddItem(activeItems: Item[], value: string): Notice; + _searchChoices(value: string): number; + _addEventListeners(): void; + _removeEventListeners(): void; + _onKeyDown(event: KeyboardEvent): void; + _onKeyUp({ target, keyCode, }: Pick): void; + _onSelectKey(event: KeyboardEvent, hasItems: boolean): void; + _onEnterKey(event: KeyboardEvent, activeItems: Item[], hasActiveDropdown: boolean): void; + _onEscapeKey(hasActiveDropdown: boolean): void; + _onDirectionKey(event: KeyboardEvent, hasActiveDropdown: boolean): void; + _onDeleteKey(event: KeyboardEvent, activeItems: Item[], hasFocusedInput: boolean): void; + _onTouchMove(): void; + _onTouchEnd(event: TouchEvent): void; + /** + * Handles mousedown event in capture mode for containetOuter.element + */ + _onMouseDown(event: MouseEvent): void; + /** + * Handles mouseover event over this.dropdown + * @param {MouseEvent} event + */ + _onMouseOver({ target }: Pick): void; + _onClick({ target }: Pick): void; + _onFocus({ target }: Pick): void; + _onBlur({ target }: Pick): void; + _onFormReset(): void; + _highlightChoice(el?: HTMLElement | null): void; + _addItem({ value, label, choiceId, groupId, customProperties, placeholder, keyCode, }: { + value: string; + label?: string | null; + choiceId?: number; + groupId?: number; + customProperties?: object; + placeholder?: boolean; + keyCode?: number; + }): void; + _removeItem(item: Item): void; + _addChoice({ value, label, isSelected, isDisabled, groupId, customProperties, placeholder, keyCode, }: { + value: string; + label?: string | null; + isSelected?: boolean; + isDisabled?: boolean; + groupId?: number; + customProperties?: Record; + placeholder?: boolean; + keyCode?: number; + }): void; + _addGroup({ group, id, valueKey, labelKey }: { + group: any; + id: any; + valueKey?: string | undefined; + labelKey?: string | undefined; + }): void; + _getTemplate(template: string, ...args: any): any; + _createTemplates(): void; + _createElements(): void; + _createStructure(): void; + _addPredefinedGroups(groups: Group[] | HTMLOptGroupElement[] | Element[]): void; + _addPredefinedChoices(choices: Partial[]): void; + _addPredefinedItems(items: Item[] | string[]): void; + _setChoiceOrItem(item: any): void; + _findAndSelectChoiceByValue(value: string): void; + _generatePlaceholderValue(): string | null; +} +export default Choices; +//# sourceMappingURL=choices.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/choices.d.ts.map b/public/types/src/scripts/choices.d.ts.map new file mode 100644 index 0000000..ec7e984 --- /dev/null +++ b/public/types/src/scripts/choices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../src/scripts/choices.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/public/types/src/scripts/choices.test.d.ts b/public/types/src/scripts/choices.test.d.ts new file mode 100644 index 0000000..1b34de1 --- /dev/null +++ b/public/types/src/scripts/choices.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=choices.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/choices.test.d.ts.map b/public/types/src/scripts/choices.test.d.ts.map new file mode 100644 index 0000000..13f8b43 --- /dev/null +++ b/public/types/src/scripts/choices.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.test.d.ts","sourceRoot":"","sources":["../../../../src/scripts/choices.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/container.d.ts b/public/types/src/scripts/components/container.d.ts new file mode 100644 index 0000000..ad8ac4e --- /dev/null +++ b/public/types/src/scripts/components/container.d.ts @@ -0,0 +1,43 @@ +import { ClassNames } from '../interfaces/class-names'; +import { PositionOptionsType } from '../interfaces/position-options-type'; +import { PassedElementType } from '../interfaces/passed-element-type'; +export default class Container { + element: HTMLElement; + type: PassedElementType; + classNames: ClassNames; + position: PositionOptionsType; + isOpen: boolean; + isFlipped: boolean; + isFocussed: boolean; + isDisabled: boolean; + isLoading: boolean; + constructor({ element, type, classNames, position, }: { + element: HTMLElement; + type: PassedElementType; + classNames: ClassNames; + position: PositionOptionsType; + }); + addEventListeners(): void; + removeEventListeners(): void; + /** + * Determine whether container should be flipped based on passed + * dropdown position + */ + shouldFlip(dropdownPos: number): boolean; + setActiveDescendant(activeDescendantID: string): void; + removeActiveDescendant(): void; + open(dropdownPos: number): void; + close(): void; + focus(): void; + addFocusState(): void; + removeFocusState(): void; + enable(): void; + disable(): void; + wrap(element: HTMLSelectElement | HTMLInputElement | HTMLElement): void; + unwrap(element: HTMLElement): void; + addLoadingState(): void; + removeLoadingState(): void; + _onFocus(): void; + _onBlur(): void; +} +//# sourceMappingURL=container.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/container.d.ts.map b/public/types/src/scripts/components/container.d.ts.map new file mode 100644 index 0000000..e253b2f --- /dev/null +++ b/public/types/src/scripts/components/container.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/container.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,OAAO,EAAE,WAAW,CAAC;IAErB,IAAI,EAAE,iBAAiB,CAAC;IAExB,UAAU,EAAE,UAAU,CAAC;IAEvB,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,MAAM,EAAE,OAAO,CAAC;IAEhB,SAAS,EAAE,OAAO,CAAC;IAEnB,UAAU,EAAE,OAAO,CAAC;IAEpB,UAAU,EAAE,OAAO,CAAC;IAEpB,SAAS,EAAE,OAAO,CAAC;gBAEP,EACV,OAAO,EACP,IAAI,EACJ,UAAU,EACV,QAAQ,GACT,EAAE;QACD,OAAO,EAAE,WAAW,CAAC;QACrB,IAAI,EAAE,iBAAiB,CAAC;QACxB,UAAU,EAAE,UAAU,CAAC;QACvB,QAAQ,EAAE,mBAAmB,CAAC;KAC/B;IAcD,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAK5B;;;OAGG;IACH,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAkBxC,mBAAmB,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI;IAIrD,sBAAsB,IAAI,IAAI;IAI9B,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAW/B,KAAK,IAAI,IAAI;IAab,KAAK,IAAI,IAAI;IAMb,aAAa,IAAI,IAAI;IAIrB,gBAAgB,IAAI,IAAI;IAIxB,MAAM,IAAI,IAAI;IASd,OAAO,IAAI,IAAI;IASf,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,WAAW,GAAG,IAAI;IAIvE,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IASlC,eAAe,IAAI,IAAI;IAMvB,kBAAkB,IAAI,IAAI;IAM1B,QAAQ,IAAI,IAAI;IAIhB,OAAO,IAAI,IAAI;CAGhB"} \ No newline at end of file diff --git a/public/types/src/scripts/components/container.test.d.ts b/public/types/src/scripts/components/container.test.d.ts new file mode 100644 index 0000000..1628d9d --- /dev/null +++ b/public/types/src/scripts/components/container.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=container.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/container.test.d.ts.map b/public/types/src/scripts/components/container.test.d.ts.map new file mode 100644 index 0000000..85b9faa --- /dev/null +++ b/public/types/src/scripts/components/container.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"container.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/container.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/dropdown.d.ts b/public/types/src/scripts/components/dropdown.d.ts new file mode 100644 index 0000000..a6f5742 --- /dev/null +++ b/public/types/src/scripts/components/dropdown.d.ts @@ -0,0 +1,27 @@ +import { ClassNames } from '../interfaces/class-names'; +import { PassedElementType } from '../interfaces/passed-element-type'; +export default class Dropdown { + element: HTMLElement; + type: PassedElementType; + classNames: ClassNames; + isActive: boolean; + constructor({ element, type, classNames, }: { + element: HTMLElement; + type: PassedElementType; + classNames: ClassNames; + }); + /** + * Bottom position of dropdown in viewport coordinates + */ + get distanceFromTopWindow(): number; + getChild(selector: string): HTMLElement | null; + /** + * Show dropdown to user by adding active state class + */ + show(): this; + /** + * Hide dropdown from user + */ + hide(): this; +} +//# sourceMappingURL=dropdown.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/dropdown.d.ts.map b/public/types/src/scripts/components/dropdown.d.ts.map new file mode 100644 index 0000000..129ec11 --- /dev/null +++ b/public/types/src/scripts/components/dropdown.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,EAAE,WAAW,CAAC;IAErB,IAAI,EAAE,iBAAiB,CAAC;IAExB,UAAU,EAAE,UAAU,CAAC;IAEvB,QAAQ,EAAE,OAAO,CAAC;gBAEN,EACV,OAAO,EACP,IAAI,EACJ,UAAU,GACX,EAAE;QACD,OAAO,EAAE,WAAW,CAAC;QACrB,IAAI,EAAE,iBAAiB,CAAC;QACxB,UAAU,EAAE,UAAU,CAAC;KACxB;IAOD;;OAEG;IACH,IAAI,qBAAqB,IAAI,MAAM,CAElC;IAED,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAI9C;;OAEG;IACH,IAAI,IAAI,IAAI;IAQZ;;OAEG;IACH,IAAI,IAAI,IAAI;CAOb"} \ No newline at end of file diff --git a/public/types/src/scripts/components/dropdown.test.d.ts b/public/types/src/scripts/components/dropdown.test.d.ts new file mode 100644 index 0000000..2dff0fa --- /dev/null +++ b/public/types/src/scripts/components/dropdown.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=dropdown.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/dropdown.test.d.ts.map b/public/types/src/scripts/components/dropdown.test.d.ts.map new file mode 100644 index 0000000..4c26ccd --- /dev/null +++ b/public/types/src/scripts/components/dropdown.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dropdown.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/dropdown.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/index.d.ts b/public/types/src/scripts/components/index.d.ts new file mode 100644 index 0000000..b37addf --- /dev/null +++ b/public/types/src/scripts/components/index.d.ts @@ -0,0 +1,8 @@ +import Dropdown from './dropdown'; +import Container from './container'; +import Input from './input'; +import List from './list'; +import WrappedInput from './wrapped-input'; +import WrappedSelect from './wrapped-select'; +export { Dropdown, Container, Input, List, WrappedInput, WrappedSelect }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/index.d.ts.map b/public/types/src/scripts/components/index.d.ts.map new file mode 100644 index 0000000..4e478ab --- /dev/null +++ b/public/types/src/scripts/components/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/components/input.d.ts b/public/types/src/scripts/components/input.d.ts new file mode 100644 index 0000000..bacd5a4 --- /dev/null +++ b/public/types/src/scripts/components/input.d.ts @@ -0,0 +1,38 @@ +import { ClassNames } from '../interfaces/class-names'; +import { PassedElementType } from '../interfaces/passed-element-type'; +export default class Input { + element: HTMLInputElement; + type: PassedElementType; + classNames: ClassNames; + preventPaste: boolean; + isFocussed: boolean; + isDisabled: boolean; + constructor({ element, type, classNames, preventPaste, }: { + element: HTMLInputElement; + type: PassedElementType; + classNames: ClassNames; + preventPaste: boolean; + }); + set placeholder(placeholder: string); + get value(): string; + set value(value: string); + addEventListeners(): void; + removeEventListeners(): void; + enable(): void; + disable(): void; + focus(): void; + blur(): void; + clear(setWidth?: boolean): this; + /** + * Set the correct input width based on placeholder + * value or input value + */ + setWidth(): void; + setActiveDescendant(activeDescendantID: string): void; + removeActiveDescendant(): void; + _onInput(): void; + _onPaste(event: ClipboardEvent): void; + _onFocus(): void; + _onBlur(): void; +} +//# sourceMappingURL=input.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/input.d.ts.map b/public/types/src/scripts/components/input.d.ts.map new file mode 100644 index 0000000..eff8d30 --- /dev/null +++ b/public/types/src/scripts/components/input.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/input.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB,OAAO,EAAE,gBAAgB,CAAC;IAE1B,IAAI,EAAE,iBAAiB,CAAC;IAExB,UAAU,EAAE,UAAU,CAAC;IAEvB,YAAY,EAAE,OAAO,CAAC;IAEtB,UAAU,EAAE,OAAO,CAAC;IAEpB,UAAU,EAAE,OAAO,CAAC;gBAER,EACV,OAAO,EACP,IAAI,EACJ,UAAU,EACV,YAAY,GACb,EAAE;QACD,OAAO,EAAE,gBAAgB,CAAC;QAC1B,IAAI,EAAE,iBAAiB,CAAC;QACxB,UAAU,EAAE,UAAU,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;KACvB;IAcD,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,EAElC;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAEtB;IAED,iBAAiB,IAAI,IAAI;IAazB,oBAAoB,IAAI,IAAI;IAO5B,MAAM,IAAI,IAAI;IAKd,OAAO,IAAI,IAAI;IAKf,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAMZ,KAAK,CAAC,QAAQ,UAAO,GAAG,IAAI;IAY5B;;;OAGG;IACH,QAAQ,IAAI,IAAI;IAOhB,mBAAmB,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI;IAIrD,sBAAsB,IAAI,IAAI;IAI9B,QAAQ,IAAI,IAAI;IAMhB,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAMrC,QAAQ,IAAI,IAAI;IAIhB,OAAO,IAAI,IAAI;CAGhB"} \ No newline at end of file diff --git a/public/types/src/scripts/components/input.test.d.ts b/public/types/src/scripts/components/input.test.d.ts new file mode 100644 index 0000000..f6118e4 --- /dev/null +++ b/public/types/src/scripts/components/input.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=input.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/input.test.d.ts.map b/public/types/src/scripts/components/input.test.d.ts.map new file mode 100644 index 0000000..be43368 --- /dev/null +++ b/public/types/src/scripts/components/input.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"input.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/input.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/list.d.ts b/public/types/src/scripts/components/list.d.ts new file mode 100644 index 0000000..51a0868 --- /dev/null +++ b/public/types/src/scripts/components/list.d.ts @@ -0,0 +1,18 @@ +export default class List { + element: HTMLElement; + scrollPos: number; + height: number; + constructor({ element }: { + element: HTMLElement; + }); + clear(): void; + append(node: Element | DocumentFragment): void; + getChild(selector: string): HTMLElement | null; + hasChildren(): boolean; + scrollToTop(): void; + scrollToChildElement(element: HTMLElement, direction: 1 | -1): void; + _scrollDown(scrollPos: number, strength: number, destination: number): void; + _scrollUp(scrollPos: number, strength: number, destination: number): void; + _animateScroll(destination: number, direction: number): void; +} +//# sourceMappingURL=list.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/list.d.ts.map b/public/types/src/scripts/components/list.d.ts.map new file mode 100644 index 0000000..8b9068f --- /dev/null +++ b/public/types/src/scripts/components/list.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/list.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,OAAO,EAAE,WAAW,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,MAAM,CAAC;gBAEH,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE;IAMjD,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI;IAI9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAI9C,WAAW,IAAI,OAAO;IAItB,WAAW,IAAI,IAAI;IAInB,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;IAwBnE,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAO3E,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAOzE,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAyB7D"} \ No newline at end of file diff --git a/public/types/src/scripts/components/list.test.d.ts b/public/types/src/scripts/components/list.test.d.ts new file mode 100644 index 0000000..ce43e8d --- /dev/null +++ b/public/types/src/scripts/components/list.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=list.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/list.test.d.ts.map b/public/types/src/scripts/components/list.test.d.ts.map new file mode 100644 index 0000000..ad13168 --- /dev/null +++ b/public/types/src/scripts/components/list.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"list.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/list.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-element.d.ts b/public/types/src/scripts/components/wrapped-element.d.ts new file mode 100644 index 0000000..ae18b82 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-element.d.ts @@ -0,0 +1,21 @@ +import { ClassNames } from '../interfaces/class-names'; +import { EventType } from '../interfaces/event-type'; +export default class WrappedElement { + element: HTMLInputElement | HTMLSelectElement; + classNames: ClassNames; + isDisabled: boolean; + constructor({ element, classNames }: { + element: any; + classNames: any; + }); + get isActive(): boolean; + get dir(): string; + get value(): string; + set value(value: string); + conceal(): void; + reveal(): void; + enable(): void; + disable(): void; + triggerEvent(eventType: EventType, data?: object): void; +} +//# sourceMappingURL=wrapped-element.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-element.d.ts.map b/public/types/src/scripts/components/wrapped-element.d.ts.map new file mode 100644 index 0000000..2df95bf --- /dev/null +++ b/public/types/src/scripts/components/wrapped-element.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapped-element.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/wrapped-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IAE9C,UAAU,EAAE,UAAU,CAAC;IAEvB,UAAU,EAAE,OAAO,CAAC;gBAER,EAAE,OAAO,EAAE,UAAU,EAAE;;;KAAA;IAcnC,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;IAED,OAAO,IAAI,IAAI;IAkBf,MAAM,IAAI,IAAI;IAsBd,MAAM,IAAI,IAAI;IAMd,OAAO,IAAI,IAAI;IAMf,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;CAGxD"} \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-element.test.d.ts b/public/types/src/scripts/components/wrapped-element.test.d.ts new file mode 100644 index 0000000..a9838b8 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-element.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=wrapped-element.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-element.test.d.ts.map b/public/types/src/scripts/components/wrapped-element.test.d.ts.map new file mode 100644 index 0000000..fb26915 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-element.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapped-element.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/wrapped-element.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-input.d.ts b/public/types/src/scripts/components/wrapped-input.d.ts new file mode 100644 index 0000000..c4c3524 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-input.d.ts @@ -0,0 +1,14 @@ +import { ClassNames } from '../interfaces/class-names'; +import WrappedElement from './wrapped-element'; +export default class WrappedInput extends WrappedElement { + element: HTMLInputElement; + delimiter: string; + constructor({ element, classNames, delimiter, }: { + element: HTMLInputElement; + classNames: ClassNames; + delimiter: string; + }); + get value(): string; + set value(value: string); +} +//# sourceMappingURL=wrapped-input.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-input.d.ts.map b/public/types/src/scripts/components/wrapped-input.d.ts.map new file mode 100644 index 0000000..224197b --- /dev/null +++ b/public/types/src/scripts/components/wrapped-input.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapped-input.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/wrapped-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,OAAO,EAAE,gBAAgB,CAAC;IAE1B,SAAS,EAAE,MAAM,CAAC;gBAEN,EACV,OAAO,EACP,UAAU,EACV,SAAS,GACV,EAAE;QACD,OAAO,EAAE,gBAAgB,CAAC;QAC1B,UAAU,EAAE,UAAU,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;KACnB;IAKD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAGtB;CACF"} \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-input.test.d.ts b/public/types/src/scripts/components/wrapped-input.test.d.ts new file mode 100644 index 0000000..5b23346 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-input.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=wrapped-input.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-input.test.d.ts.map b/public/types/src/scripts/components/wrapped-input.test.d.ts.map new file mode 100644 index 0000000..28ba6ce --- /dev/null +++ b/public/types/src/scripts/components/wrapped-input.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapped-input.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/wrapped-input.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-select.d.ts b/public/types/src/scripts/components/wrapped-select.d.ts new file mode 100644 index 0000000..5b4f647 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-select.d.ts @@ -0,0 +1,19 @@ +import { ClassNames } from '../interfaces/class-names'; +import { Item } from '../interfaces/item'; +import WrappedElement from './wrapped-element'; +export default class WrappedSelect extends WrappedElement { + element: HTMLSelectElement; + classNames: ClassNames; + template: (data: object) => HTMLOptionElement; + constructor({ element, classNames, template, }: { + element: HTMLSelectElement; + classNames: ClassNames; + template: (data: object) => HTMLOptionElement; + }); + get placeholderOption(): HTMLOptionElement | null; + get optionGroups(): Element[]; + get options(): Item[] | HTMLOptionElement[]; + set options(options: Item[] | HTMLOptionElement[]); + appendDocFragment(fragment: DocumentFragment): void; +} +//# sourceMappingURL=wrapped-select.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-select.d.ts.map b/public/types/src/scripts/components/wrapped-select.d.ts.map new file mode 100644 index 0000000..47ebbf7 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-select.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapped-select.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/wrapped-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,cAAc;IACvD,OAAO,EAAE,iBAAiB,CAAC;IAE3B,UAAU,EAAE,UAAU,CAAC;IAEvB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,CAAC;gBAElC,EACV,OAAO,EACP,UAAU,EACV,QAAQ,GACT,EAAE;QACD,OAAO,EAAE,iBAAiB,CAAC;QAC3B,UAAU,EAAE,UAAU,CAAC;QACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,CAAC;KAC/C;IAKD,IAAI,iBAAiB,IAAI,iBAAiB,GAAG,IAAI,CAMhD;IAED,IAAI,YAAY,IAAI,OAAO,EAAE,CAE5B;IAED,IAAI,OAAO,IAAI,IAAI,EAAE,GAAG,iBAAiB,EAAE,CAE1C;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,iBAAiB,EAAE,EAahD;IAED,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;CAIpD"} \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-select.test.d.ts b/public/types/src/scripts/components/wrapped-select.test.d.ts new file mode 100644 index 0000000..414d615 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-select.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=wrapped-select.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/components/wrapped-select.test.d.ts.map b/public/types/src/scripts/components/wrapped-select.test.d.ts.map new file mode 100644 index 0000000..e974095 --- /dev/null +++ b/public/types/src/scripts/components/wrapped-select.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapped-select.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/components/wrapped-select.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/constants.d.ts b/public/types/src/scripts/constants.d.ts new file mode 100644 index 0000000..1891ccc --- /dev/null +++ b/public/types/src/scripts/constants.d.ts @@ -0,0 +1,11 @@ +import { ActionType } from './interfaces/action-type'; +import { EventType } from './interfaces/event-type'; +import { KeyCodeMap } from './interfaces/keycode-map'; +export declare const EVENTS: Record; +export declare const ACTION_TYPES: Record; +export declare const KEY_CODES: KeyCodeMap; +export declare const TEXT_TYPE: HTMLInputElement['type']; +export declare const SELECT_ONE_TYPE: HTMLSelectElement['type']; +export declare const SELECT_MULTIPLE_TYPE: HTMLSelectElement['type']; +export declare const SCROLLING_SPEED = 4; +//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/constants.d.ts.map b/public/types/src/scripts/constants.d.ts.map new file mode 100644 index 0000000..1a564df --- /dev/null +++ b/public/types/src/scripts/constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/scripts/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,CAW/C,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAYvD,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,UAUvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAU,CAAC;AAC1D,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,MAAM,CAAgB,CAAC;AACvE,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,MAAM,CACxC,CAAC;AAEpB,eAAO,MAAM,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/constants.test.d.ts b/public/types/src/scripts/constants.test.d.ts new file mode 100644 index 0000000..bc2a88b --- /dev/null +++ b/public/types/src/scripts/constants.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=constants.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/constants.test.d.ts.map b/public/types/src/scripts/constants.test.d.ts.map new file mode 100644 index 0000000..20f7799 --- /dev/null +++ b/public/types/src/scripts/constants.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.test.d.ts","sourceRoot":"","sources":["../../../../src/scripts/constants.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/defaults.d.ts b/public/types/src/scripts/defaults.d.ts new file mode 100644 index 0000000..db8a9a9 --- /dev/null +++ b/public/types/src/scripts/defaults.d.ts @@ -0,0 +1,5 @@ +import { ClassNames } from './interfaces/class-names'; +import { Options } from './interfaces/options'; +export declare const DEFAULT_CLASSNAMES: ClassNames; +export declare const DEFAULT_CONFIG: Options; +//# sourceMappingURL=defaults.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/defaults.d.ts.map b/public/types/src/scripts/defaults.d.ts.map new file mode 100644 index 0000000..79c157f --- /dev/null +++ b/public/types/src/scripts/defaults.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/scripts/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,eAAO,MAAM,kBAAkB,EAAE,UA2BhC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OA8C5B,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/action-type.d.ts b/public/types/src/scripts/interfaces/action-type.d.ts new file mode 100644 index 0000000..e7ce714 --- /dev/null +++ b/public/types/src/scripts/interfaces/action-type.d.ts @@ -0,0 +1,2 @@ +export declare type ActionType = 'ADD_CHOICE' | 'FILTER_CHOICES' | 'ACTIVATE_CHOICES' | 'CLEAR_CHOICES' | 'ADD_GROUP' | 'ADD_ITEM' | 'REMOVE_ITEM' | 'HIGHLIGHT_ITEM' | 'CLEAR_ALL' | 'RESET_TO' | 'SET_IS_LOADING'; +//# sourceMappingURL=action-type.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/action-type.d.ts.map b/public/types/src/scripts/interfaces/action-type.d.ts.map new file mode 100644 index 0000000..6080889 --- /dev/null +++ b/public/types/src/scripts/interfaces/action-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"action-type.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/action-type.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAClB,YAAY,GACZ,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,WAAW,GACX,UAAU,GACV,aAAa,GACb,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,gBAAgB,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/choice.d.ts b/public/types/src/scripts/interfaces/choice.d.ts new file mode 100644 index 0000000..6f381c6 --- /dev/null +++ b/public/types/src/scripts/interfaces/choice.d.ts @@ -0,0 +1,16 @@ +export interface Choice { + id?: number; + customProperties?: Record; + disabled?: boolean; + active?: boolean; + elementId?: number; + groupId?: number; + keyCode?: number; + label: string; + placeholder?: boolean; + selected?: boolean; + value: string; + score?: number; + choices?: Choice[]; +} +//# sourceMappingURL=choice.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/choice.d.ts.map b/public/types/src/scripts/interfaces/choice.d.ts.map new file mode 100644 index 0000000..8563229 --- /dev/null +++ b/public/types/src/scripts/interfaces/choice.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/choice.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/choices.d.ts b/public/types/src/scripts/interfaces/choices.d.ts new file mode 100644 index 0000000..613a2ab --- /dev/null +++ b/public/types/src/scripts/interfaces/choices.d.ts @@ -0,0 +1,46 @@ +import { Options } from 'deepmerge'; +import { Store } from 'redux'; +import { WrappedInput, WrappedSelect, Container, List, Input, Dropdown } from '../components'; +import { Choice } from './choice'; +import { Group } from './group'; +import { Item } from './item'; +import { State } from './state'; +import templates from '../templates'; +export interface Choices { + initialised: boolean; + config: Options; + passedElement: WrappedInput | WrappedSelect; + containerOuter: Container; + containerInner: Container; + choiceList: List; + itemList: List; + input: Input; + dropdown: Dropdown; + _isTextElement: boolean; + _isSelectOneElement: boolean; + _isSelectMultipleElement: boolean; + _isSelectElement: boolean; + _store: Store; + _templates: typeof templates; + _initialState: State; + _currentState: State; + _prevState: State; + _currentValue: string; + _canSearch: boolean; + _isScrollingOnIe: boolean; + _highlightPosition: number; + _wasTap: boolean; + _isSearching: boolean; + _placeholderValue: string | null; + _baseId: string; + _direction: HTMLElement['dir']; + _idNames: { + itemChoice: string; + }; + _presetGroups: Group[] | HTMLOptGroupElement[] | Element[]; + _presetOptions: Item[] | HTMLOptionElement[]; + _presetChoices: Partial[]; + _presetItems: Item[] | string[]; + new (element: string | Element | HTMLInputElement | HTMLSelectElement, userConfig: Partial): any; +} +//# sourceMappingURL=choices.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/choices.d.ts.map b/public/types/src/scripts/interfaces/choices.d.ts.map new file mode 100644 index 0000000..acb6e08 --- /dev/null +++ b/public/types/src/scripts/interfaces/choices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EACT,IAAI,EACJ,KAAK,EACL,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAEhB,aAAa,EAAE,YAAY,GAAG,aAAa,CAAC;IAE5C,cAAc,EAAE,SAAS,CAAC;IAE1B,cAAc,EAAE,SAAS,CAAC;IAE1B,UAAU,EAAE,IAAI,CAAC;IAEjB,QAAQ,EAAE,IAAI,CAAC;IAEf,KAAK,EAAE,KAAK,CAAC;IAEb,QAAQ,EAAE,QAAQ,CAAC;IAEnB,cAAc,EAAE,OAAO,CAAC;IAExB,mBAAmB,EAAE,OAAO,CAAC;IAE7B,wBAAwB,EAAE,OAAO,CAAC;IAElC,gBAAgB,EAAE,OAAO,CAAC;IAE1B,MAAM,EAAE,KAAK,CAAC;IAEd,UAAU,EAAE,OAAO,SAAS,CAAC;IAE7B,aAAa,EAAE,KAAK,CAAC;IAErB,aAAa,EAAE,KAAK,CAAC;IAErB,UAAU,EAAE,KAAK,CAAC;IAElB,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,OAAO,CAAC;IAEpB,gBAAgB,EAAE,OAAO,CAAC;IAE1B,kBAAkB,EAAE,MAAM,CAAC;IAE3B,OAAO,EAAE,OAAO,CAAC;IAEjB,YAAY,EAAE,OAAO,CAAC;IAEtB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAE/B,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,aAAa,EAAE,KAAK,EAAE,GAAG,mBAAmB,EAAE,GAAG,OAAO,EAAE,CAAC;IAE3D,cAAc,EAAE,IAAI,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAE7C,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAElC,YAAY,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAEhC,KACE,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,gBAAgB,GAAG,iBAAiB,EAChE,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,OAC5B;CACH"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/class-names.d.ts b/public/types/src/scripts/interfaces/class-names.d.ts new file mode 100644 index 0000000..09818ef --- /dev/null +++ b/public/types/src/scripts/interfaces/class-names.d.ts @@ -0,0 +1,56 @@ +/** Classes added to HTML generated by By default classnames follow the BEM notation. */ +export interface ClassNames { + /** @default 'choices' */ + containerOuter: string; + /** @default 'choices__inner' */ + containerInner: string; + /** @default 'choices__input' */ + input: string; + /** @default 'choices__input--cloned' */ + inputCloned: string; + /** @default 'choices__list' */ + list: string; + /** @default 'choices__list--multiple' */ + listItems: string; + /** @default 'choices__list--single' */ + listSingle: string; + /** @default 'choices__list--dropdown' */ + listDropdown: string; + /** @default 'choices__item' */ + item: string; + /** @default 'choices__item--selectable' */ + itemSelectable: string; + /** @default 'choices__item--disabled' */ + itemDisabled: string; + /** @default 'choices__item--choice' */ + itemChoice: string; + /** @default 'choices__placeholder' */ + placeholder: string; + /** @default 'choices__group' */ + group: string; + /** @default 'choices__heading' */ + groupHeading: string; + /** @default 'choices__button' */ + button: string; + /** @default 'is-active' */ + activeState: string; + /** @default 'is-focused' */ + focusState: string; + /** @default 'is-open' */ + openState: string; + /** @default 'is-disabled' */ + disabledState: string; + /** @default 'is-highlighted' */ + highlightedState: string; + /** @default 'is-selected' */ + selectedState: string; + /** @default 'is-flipped' */ + flippedState: string; + /** @default 'is-loading' */ + loadingState: string; + /** @default 'has-no-results' */ + noResults: string; + /** @default 'has-no-choices' */ + noChoices: string; +} +//# sourceMappingURL=class-names.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/class-names.d.ts.map b/public/types/src/scripts/interfaces/class-names.d.ts.map new file mode 100644 index 0000000..b5c6068 --- /dev/null +++ b/public/types/src/scripts/interfaces/class-names.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"class-names.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/class-names.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/event-type.d.ts b/public/types/src/scripts/interfaces/event-type.d.ts new file mode 100644 index 0000000..5a88a96 --- /dev/null +++ b/public/types/src/scripts/interfaces/event-type.d.ts @@ -0,0 +1,2 @@ +export declare type EventType = 'addItem' | 'removeItem' | 'highlightItem' | 'unhighlightItem' | 'choice' | 'change' | 'search' | 'showDropdown' | 'hideDropdown' | 'highlightChoice'; +//# sourceMappingURL=event-type.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/event-type.d.ts.map b/public/types/src/scripts/interfaces/event-type.d.ts.map new file mode 100644 index 0000000..12a34e3 --- /dev/null +++ b/public/types/src/scripts/interfaces/event-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"event-type.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/event-type.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,GACjB,SAAS,GACT,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,cAAc,GACd,iBAAiB,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/group.d.ts b/public/types/src/scripts/interfaces/group.d.ts new file mode 100644 index 0000000..3fa395a --- /dev/null +++ b/public/types/src/scripts/interfaces/group.d.ts @@ -0,0 +1,7 @@ +export interface Group { + id?: number; + active?: boolean; + disabled?: boolean; + value: any; +} +//# sourceMappingURL=group.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/group.d.ts.map b/public/types/src/scripts/interfaces/group.d.ts.map new file mode 100644 index 0000000..bff19fb --- /dev/null +++ b/public/types/src/scripts/interfaces/group.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/group.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,GAAG,CAAC;CACZ"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/item.d.ts b/public/types/src/scripts/interfaces/item.d.ts new file mode 100644 index 0000000..1d58b80 --- /dev/null +++ b/public/types/src/scripts/interfaces/item.d.ts @@ -0,0 +1,6 @@ +import { Choice } from './choice'; +export interface Item extends Choice { + choiceId?: number; + highlighted?: boolean; +} +//# sourceMappingURL=item.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/item.d.ts.map b/public/types/src/scripts/interfaces/item.d.ts.map new file mode 100644 index 0000000..15f89f1 --- /dev/null +++ b/public/types/src/scripts/interfaces/item.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,IAAK,SAAQ,MAAM;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/keycode-map.d.ts b/public/types/src/scripts/interfaces/keycode-map.d.ts new file mode 100644 index 0000000..f7ece2b --- /dev/null +++ b/public/types/src/scripts/interfaces/keycode-map.d.ts @@ -0,0 +1,12 @@ +export interface KeyCodeMap { + BACK_KEY: 46; + DELETE_KEY: 8; + ENTER_KEY: 13; + A_KEY: 65; + ESC_KEY: 27; + UP_KEY: 38; + DOWN_KEY: 40; + PAGE_UP_KEY: 33; + PAGE_DOWN_KEY: 34; +} +//# sourceMappingURL=keycode-map.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/keycode-map.d.ts.map b/public/types/src/scripts/interfaces/keycode-map.d.ts.map new file mode 100644 index 0000000..0458006 --- /dev/null +++ b/public/types/src/scripts/interfaces/keycode-map.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"keycode-map.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/keycode-map.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,EAAE,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;IACd,SAAS,EAAE,EAAE,CAAC;IACd,KAAK,EAAE,EAAE,CAAC;IACV,OAAO,EAAE,EAAE,CAAC;IACZ,MAAM,EAAE,EAAE,CAAC;IACX,QAAQ,EAAE,EAAE,CAAC;IACb,WAAW,EAAE,EAAE,CAAC;IAChB,aAAa,EAAE,EAAE,CAAC;CACnB"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/notice.d.ts b/public/types/src/scripts/interfaces/notice.d.ts new file mode 100644 index 0000000..071f8d4 --- /dev/null +++ b/public/types/src/scripts/interfaces/notice.d.ts @@ -0,0 +1,5 @@ +export interface Notice { + response: boolean; + notice: string; +} +//# sourceMappingURL=notice.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/notice.d.ts.map b/public/types/src/scripts/interfaces/notice.d.ts.map new file mode 100644 index 0000000..f2983f3 --- /dev/null +++ b/public/types/src/scripts/interfaces/notice.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/notice.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/options.d.ts b/public/types/src/scripts/interfaces/options.d.ts new file mode 100644 index 0000000..2fb5026 --- /dev/null +++ b/public/types/src/scripts/interfaces/options.d.ts @@ -0,0 +1,460 @@ +import { FuseOptions } from 'fuse.js'; +import { Choices } from './choices'; +import { Choice } from './choice'; +import { ClassNames } from './class-names'; +import { PositionOptionsType } from './position-options-type'; +import { Types } from './types'; +/** + * Choices options interface + * + * **Terminology** + * + * - **Choice:** A choice is a value a user can select. A choice would be equivalent to the `` element within a select input. + * - **Group:** A group is a collection of choices. A group should be seen as equivalent to a `` element within a select input. + * - **Item:** An item is an inputted value **_(text input)_** or a selected choice **_(select element)_**. In the context of a select element, an item is equivelent to a selected option element: `` whereas in the context of a text input an item is equivelant to `` + */ +export interface Options { + /** + * Optionally suppress console errors and warnings. + * + * **Input types affected:** text, select-single, select-multiple + * + * @default false + */ + silent: boolean; + /** + * Add pre-selected items (see terminology) to text input. + * + * **Input types affected:** text + * + * @example + * ``` + * ['value 1', 'value 2', 'value 3'] + * ``` + * + * @example + * ``` + * [{ + * value: 'Value 1', + * label: 'Label 1', + * id: 1 + * }, + * { + * value: 'Value 2', + * label: 'Label 2', + * id: 2, + * customProperties: { + * random: 'I am a custom property' + * } + * }] + * ``` + * + * @default [] + */ + items: string[] | Choice[]; + /** + * Add choices (see terminology) to select input. + * + * **Input types affected:** select-one, select-multiple + * + * @example + * ``` + * [{ + * value: 'Option 1', + * label: 'Option 1', + * selected: true, + * disabled: false, + * }, + * { + * value: 'Option 2', + * label: 'Option 2', + * selected: false, + * disabled: true, + * customProperties: { + * description: 'Custom description about Option 2', + * random: 'Another random custom property' + * }, + * }] + * ``` + * + * @default [] + */ + choices: Choice[]; + /** + * The amount of choices to be rendered within the dropdown list `("-1" indicates no limit)`. This is useful if you have a lot of choices where it is easier for a user to use the search area to find a choice. + * + * **Input types affected:** select-one, select-multiple + * + * @default -1 + */ + renderChoiceLimit: number; + /** + * The amount of items a user can input/select `("-1" indicates no limit)`. + * + * **Input types affected:** text, select-multiple + * + * @default -1 + */ + maxItemCount: number; + /** + * Whether a user can add items. + * + * **Input types affected:** text + * + * @default true + */ + addItems: boolean; + /** + * A filter that will need to pass for a user to successfully add an item. + * + * **Input types affected:** text + * + * @default null + */ + addItemFilter: string | RegExp | Types.FilterFunction | null; + /** + * The text that is shown when a user has inputted a new item but has not pressed the enter key. To access the current input value, pass a function with a `value` argument (see the **default config** [https://github.com/jshjohnson/Choices#setup] for an example), otherwise pass a string. + * + * **Input types affected:** text + * + * @default + * ``` + * (value) => `Press Enter to add "${value}"`; + * ``` + */ + addItemText: string | Types.NoticeStringFunction; + /** + * Whether a user can remove items. + * + * **Input types affected:** text, select-multiple + * + * @default true + */ + removeItems: boolean; + /** + * Whether each item should have a remove button. + * + * **Input types affected:** text, select-one, select-multiple + * + * @default false + */ + removeItemButton: boolean; + /** + * Whether a user can edit items. An item's value can be edited by pressing the backspace. + * + * **Input types affected:** text + * + * @default false + */ + editItems: boolean; + /** + * Whether HTML should be rendered in all Choices elements. + * If `false`, all elements (placeholder, items, etc.) will be treated as plain text. + * If `true`, this can be used to perform XSS scripting attacks if you load choices from a remote source. + * + * **Deprecation Warning:** This will default to `false` in a future release. + * + * **Input types affected:** text, select-one, select-multiple + * + * @default true + */ + allowHTML: boolean; + /** + * Whether each inputted/chosen item should be unique. + * + * **Input types affected:** text, select-multiple + * + * @default true + */ + duplicateItemsAllowed: boolean; + /** + * What divides each value. The default delimiter separates each value with a comma: `"Value 1, Value 2, Value 3"`. + * + * **Input types affected:** text + * + * @default ',' + */ + delimiter: string; + /** + * Whether a user can paste into the input. + * + * **Input types affected:** text, select-multiple + * + * @default true + */ + paste: boolean; + /** + * Whether a search area should be shown. + * + * @note Multiple select boxes will always show search areas. + * + * **Input types affected:** select-one + * + * @default true + */ + searchEnabled: boolean; + /** + * Whether choices should be filtered by input or not. If `false`, the search event will still emit, but choices will not be filtered. + * + * **Input types affected:** select-one + * + * @default true + */ + searchChoices: boolean; + /** + * The minimum length a search value should be before choices are searched. + * + * **Input types affected:** select-one, select-multiple + * + * @default 1 + */ + searchFloor: number; + /** + * The maximum amount of search results to show. + * + * **Input types affected:** select-one, select-multiple + * + * @default 4 + */ + searchResultLimit: number; + /** + * Specify which fields should be used when a user is searching. If you have added custom properties to your choices, you can add these values thus: `['label', 'value', 'customProperties.example']`. + * + * Input types affected:select-one, select-multiple + * + * @default ['label', 'value'] + */ + searchFields: string[]; + /** + * Whether the dropdown should appear above `(top)` or below `(bottom)` the input. By default, if there is not enough space within the window the dropdown will appear above the input, otherwise below it. + * + * **Input types affected:** select-one, select-multiple + * + * @default 'auto' + */ + position: PositionOptionsType; + /** + * Whether the scroll position should reset after adding an item. + * + * **Input types affected:** select-multiple + * + * @default true + */ + resetScrollPosition: boolean; + /** + * Whether choices and groups should be sorted. If false, choices/groups will appear in the order they were given. + * + * **Input types affected:** select-one, select-multiple + * + * @default true + */ + shouldSort: boolean; + /** + * Whether items should be sorted. If false, items will appear in the order they were selected. + * + * **Input types affected:** text, select-multiple + * + * @default false + */ + shouldSortItems: boolean; + /** + * The function that will sort choices and items before they are displayed (unless a user is searching). By default choices and items are sorted by alphabetical order. + * + * **Input types affected:** select-one, select-multiple + * + * @example + * ``` + * // Sorting via length of label from largest to smallest + * const example = new Choices(element, { + * sorter: function(a, b) { + * return b.label.length - a.label.length; + * }, + * }; + * ``` + * + * @default sortByAlpha + */ + sorter: (current: Choice, next: Choice) => number; + /** + * Whether the input should show a placeholder. Used in conjunction with `placeholderValue`. If `placeholder` is set to true and no value is passed to `placeholderValue`, the passed input's placeholder attribute will be used as the placeholder value. + * + * **Input types affected:** text, select-multiple + * + * @note For single select boxes, the recommended way of adding a placeholder is as follows: + * ``` + * + * ``` + * + * @default true + */ + placeholder: boolean; + /** + * The value of the inputs placeholder. + * + * **Input types affected:** text, select-multiple + * + * @default null + */ + placeholderValue: string | null; + /** + * The value of the search inputs placeholder. + * + * **Input types affected:** select-one + * + * @default null + */ + searchPlaceholderValue: string | null; + /** + * Prepend a value to each item added/selected. + * + * **Input types affected:** text, select-one, select-multiple + * + * @default null + */ + prependValue: string | null; + /** + * Append a value to each item added/selected. + * + * **Input types affected:** text, select-one, select-multiple + * + * @default null + */ + appendValue: string | null; + /** + * Whether selected choices should be removed from the list. By default choices are removed when they are selected in multiple select box. To always render choices pass `always`. + * + * **Input types affected:** select-one, select-multiple + * + * @default 'auto'; + */ + renderSelectedChoices: 'auto' | 'always'; + /** + * The text that is shown whilst choices are being populated via AJAX. + * + * **Input types affected:** select-one, select-multiple + * + * @default 'Loading...' + */ + loadingText: string; + /** + * The text that is shown when a user's search has returned no results. Optionally pass a function returning a string. + * + * **Input types affected:** select-one, select-multiple + * + * @default 'No results found' + */ + noResultsText: string | Types.StringFunction; + /** + * The text that is shown when a user has selected all possible choices. Optionally pass a function returning a string. + * + * **Input types affected:** select-multiple + * + * @default 'No choices to choose from' + */ + noChoicesText: string | Types.StringFunction; + /** + * The text that is shown when a user hovers over a selectable choice. + * + * **Input types affected:** select-multiple, select-one + * + * @default 'Press to select' + */ + itemSelectText: string; + /** + * The text that is shown when a user has focus on the input but has already reached the **max item count** [https://github.com/jshjohnson/Choices#maxitemcount]. To access the max item count, pass a function with a `maxItemCount` argument (see the **default config** [https://github.com/jshjohnson/Choices#setup] for an example), otherwise pass a string. + * + * **Input types affected:** text + * + * @default + * ``` + * (maxItemCount) => `Only ${maxItemCount} values can be added.`; + * ``` + */ + maxItemText: string | Types.NoticeLimitFunction; + /** + * If no duplicates are allowed, and the value already exists in the array. + * + * @default 'Only unique values can be added' + */ + uniqueItemText: string | Types.NoticeStringFunction; + /** + * The text that is shown when addItemFilter is passed and it returns false + * + * **Input types affected:** text + * + * @default 'Only values matching specific conditions can be added' + */ + customAddItemText: string | Types.NoticeStringFunction; + /** + * Compare choice and value in appropriate way (e.g. deep equality for objects). To compare choice and value, pass a function with a `valueComparer` argument (see the [default config](https://github.com/jshjohnson/Choices#setup) for an example). + * + * **Input types affected:** select-one, select-multiple + * + * @default + * ``` + * (choice, item) => choice === item; + * ``` + */ + valueComparer: Types.ValueCompareFunction; + /** + * Classes added to HTML generated by By default classnames follow the BEM notation. + * + * **Input types affected:** text, select-one, select-multiple + */ + classNames: ClassNames; + /** + * Choices uses the great Fuse library for searching. You can find more options here: https://github.com/krisk/Fuse#options + */ + fuseOptions: FuseOptions; + /** + * Function to run once Choices initialises. + * + * **Input types affected:** text, select-one, select-multiple + * + * @note For each callback, this refers to the current instance of This can be useful if you need access to methods `(this.disable())` or the config object `(this.config)`. + * + * @default null + */ + callbackOnInit: ((this: Choices) => void) | null; + /** + * Function to run on template creation. Through this callback it is possible to provide custom templates for the various components of Choices (see terminology). For Choices to work with custom templates, it is important you maintain the various data attributes defined here [https://github.com/jshjohnson/Choices/blob/67f29c286aa21d88847adfcd6304dc7d068dc01f/assets/scripts/src/choices.js#L1993-L2067]. + * + * **Input types affected:** text, select-one, select-multiple + * + * @note For each callback, this refers to the current instance of This can be useful if you need access to methods `(this.disable())` or the config object `(this.config)`. + * + * @example + * ``` + * const example = new Choices(element, { + * callbackOnCreateTemplates: function (template) { + * var classNames = this.config.classNames; + * return { + * item: (data) => { + * return template(` + *
+ * ${data.label} + *
+ * `); + * }, + * choice: (data) => { + * return template(` + *
0 ? 'role="treeitem"' : 'role="option"'}> + * ${data.label} + *
+ * `); + * }, + * }; + * } + * }); + * ``` + * + * @default null + */ + callbackOnCreateTemplates: ((template: Types.StrToEl) => void) | null; +} +//# sourceMappingURL=options.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/options.d.ts.map b/public/types/src/scripts/interfaces/options.d.ts.map new file mode 100644 index 0000000..8c02107 --- /dev/null +++ b/public/types/src/scripts/interfaces/options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/options.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/passed-element-type.d.ts b/public/types/src/scripts/interfaces/passed-element-type.d.ts new file mode 100644 index 0000000..ba9e99d --- /dev/null +++ b/public/types/src/scripts/interfaces/passed-element-type.d.ts @@ -0,0 +1,2 @@ +export declare type PassedElementType = 'text' | 'select-one' | 'select-multiple'; +//# sourceMappingURL=passed-element-type.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/passed-element-type.d.ts.map b/public/types/src/scripts/interfaces/passed-element-type.d.ts.map new file mode 100644 index 0000000..86e4161 --- /dev/null +++ b/public/types/src/scripts/interfaces/passed-element-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"passed-element-type.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/passed-element-type.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,GAAG,MAAM,GAAG,YAAY,GAAG,iBAAiB,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/passed-element.d.ts b/public/types/src/scripts/interfaces/passed-element.d.ts new file mode 100644 index 0000000..54172d7 --- /dev/null +++ b/public/types/src/scripts/interfaces/passed-element.d.ts @@ -0,0 +1,129 @@ +import { Choices } from './choices'; +import { Choice } from './choice'; +import { ClassNames } from './class-names'; +import { EventType } from './event-type'; +import { PassedElementType } from './passed-element-type'; +export interface PassedElement extends HTMLElement { + classNames: ClassNames; + element: (HTMLInputElement | HTMLSelectElement) & { + addEventListener(type: K, listener: (this: HTMLInputElement | HTMLSelectElement, ev: EventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; + }; + type: PassedElementType; + isDisabled: boolean; + parentInstance: Choices; +} +/** + * Events fired by Choices behave the same as standard events. Each event is triggered on the element passed to Choices (accessible via `this.passedElement`. Arguments are accessible within the `event.detail` object. + */ +export interface EventMap { + /** + * Triggered each time an item is added (programmatically or by the user). + * + * **Input types affected:** text, select-one, select-multiple + * + * Arguments: id, value, label, groupValue, keyCode + */ + addItem: CustomEvent<{ + id: number; + value: string; + label: string; + groupValue: string; + keyCode: number; + }>; + /** + * Triggered each time an item is removed (programmatically or by the user). + * + * **Input types affected:** text, select-one, select-multiple + * + * Arguments: id, value, label, groupValue + */ + removeItem: CustomEvent<{ + id: number; + value: string; + label: string; + groupValue: string; + }>; + /** + * Triggered each time an item is highlighted. + * + * **Input types affected:** text, select-multiple + * + * Arguments: id, value, label, groupValue + */ + highlightItem: CustomEvent<{ + id: number; + value: string; + label: string; + groupValue: string; + }>; + /** + * Triggered each time an item is unhighlighted. + * + * **Input types affected:** text, select-multiple + * + * Arguments: id, value, label, groupValue + */ + unhighlightItem: CustomEvent<{ + id: number; + value: string; + label: string; + groupValue: string; + }>; + /** + * Triggered each time a choice is selected **by a user**, regardless if it changes the value of the input. + * + * **Input types affected:** select-one, select-multiple + * + * Arguments: choice: Choice + */ + choice: CustomEvent<{ + choice: Choice; + }>; + /** + * Triggered each time an item is added/removed **by a user**. + * + * **Input types affected:** text, select-one, select-multiple + * + * Arguments: value + */ + change: CustomEvent<{ + value: string; + }>; + /** + * Triggered when a user types into an input to search choices. + * + * **Input types affected:** select-one, select-multiple + * + * Arguments: value, resultCount + */ + search: CustomEvent<{ + value: string; + resultCount: number; + }>; + /** + * Triggered when the dropdown is shown. + * + * **Input types affected:** select-one, select-multiple + * + * Arguments: - + */ + showDropdown: CustomEvent; + /** + * Triggered when the dropdown is hidden. + * + * **Input types affected:** select-one, select-multiple + * + * Arguments: - + */ + hideDropdown: CustomEvent; + /** + * Triggered when a choice from the dropdown is highlighted. + * + * Input types affected: select-one, select-multiple + * Arguments: el is the choice.passedElement that was affected. + */ + highlightChoice: CustomEvent<{ + el: PassedElement; + }>; +} +//# sourceMappingURL=passed-element.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/passed-element.d.ts.map b/public/types/src/scripts/interfaces/passed-element.d.ts.map new file mode 100644 index 0000000..4798e53 --- /dev/null +++ b/public/types/src/scripts/interfaces/passed-element.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"passed-element.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/passed-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,GAAG;QAEhD,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAClC,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CACR,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,EAC1C,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,KACZ,IAAI,EACT,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAC;KACT,CAAC;IACF,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;OAMG;IACH,OAAO,EAAE,WAAW,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,UAAU,EAAE,WAAW,CAAC;QACtB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,aAAa,EAAE,WAAW,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,eAAe,EAAE,WAAW,CAAC;QAC3B,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,MAAM,EAAE,WAAW,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,MAAM,EAAE,WAAW,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEvC;;;;;;OAMG;IACH,MAAM,EAAE,WAAW,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE5D;;;;;;OAMG;IACH,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAErC;;;;;OAKG;IACH,eAAe,EAAE,WAAW,CAAC;QAAE,EAAE,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;CACrD"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/position-options-type.d.ts b/public/types/src/scripts/interfaces/position-options-type.d.ts new file mode 100644 index 0000000..a66abd6 --- /dev/null +++ b/public/types/src/scripts/interfaces/position-options-type.d.ts @@ -0,0 +1,2 @@ +export declare type PositionOptionsType = 'auto' | 'top' | 'bottom'; +//# sourceMappingURL=position-options-type.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/position-options-type.d.ts.map b/public/types/src/scripts/interfaces/position-options-type.d.ts.map new file mode 100644 index 0000000..a810b70 --- /dev/null +++ b/public/types/src/scripts/interfaces/position-options-type.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"position-options-type.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/position-options-type.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/state.d.ts b/public/types/src/scripts/interfaces/state.d.ts new file mode 100644 index 0000000..a713d05 --- /dev/null +++ b/public/types/src/scripts/interfaces/state.d.ts @@ -0,0 +1,10 @@ +import { Choice } from './choice'; +import { Group } from './group'; +import { Item } from './item'; +export interface State { + choices: Choice[]; + groups: Group[]; + items: Item[]; + loading: boolean; +} +//# sourceMappingURL=state.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/state.d.ts.map b/public/types/src/scripts/interfaces/state.d.ts.map new file mode 100644 index 0000000..0907396 --- /dev/null +++ b/public/types/src/scripts/interfaces/state.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB"} \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/types.d.ts b/public/types/src/scripts/interfaces/types.d.ts new file mode 100644 index 0000000..5a2cf64 --- /dev/null +++ b/public/types/src/scripts/interfaces/types.d.ts @@ -0,0 +1,9 @@ +export declare namespace Types { + type StrToEl = (str: string) => HTMLElement | HTMLInputElement | HTMLOptionElement; + type StringFunction = () => string; + type NoticeStringFunction = (value: string) => string; + type NoticeLimitFunction = (maxItemCount: number) => string; + type FilterFunction = (value: string) => boolean; + type ValueCompareFunction = (value1: string, value2: string) => boolean; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/interfaces/types.d.ts.map b/public/types/src/scripts/interfaces/types.d.ts.map new file mode 100644 index 0000000..4c44c1d --- /dev/null +++ b/public/types/src/scripts/interfaces/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/interfaces/types.ts"],"names":[],"mappings":"AAAA,yBAAiB,KAAK,CAAC;IACrB,KAAY,OAAO,GAAG,CACpB,GAAG,EAAE,MAAM,KACR,WAAW,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;IACxD,KAAY,cAAc,GAAG,MAAM,MAAM,CAAC;IAC1C,KAAY,oBAAoB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7D,KAAY,mBAAmB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;IACnE,KAAY,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACxD,KAAY,oBAAoB,GAAG,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,KACX,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/public/types/src/scripts/lib/utils.d.ts b/public/types/src/scripts/lib/utils.d.ts new file mode 100644 index 0000000..15fd587 --- /dev/null +++ b/public/types/src/scripts/lib/utils.d.ts @@ -0,0 +1,27 @@ +import { Choice } from '../interfaces/choice'; +import { EventType } from '../interfaces/event-type'; +export declare const getRandomNumber: (min: number, max: number) => number; +export declare const generateChars: (length: number) => string; +export declare const generateId: (element: HTMLInputElement | HTMLSelectElement, prefix: string) => string; +export declare const getType: (obj: any) => string; +export declare const isType: (type: string, obj: any) => boolean; +export declare const wrap: (element: HTMLElement, wrapper?: HTMLElement) => HTMLElement; +export declare const getAdjacentEl: (startEl: Element, selector: string, direction?: number) => Element; +export declare const isScrolledIntoView: (element: HTMLElement, parent: HTMLElement, direction?: number) => boolean; +export declare const sanitise: (value: string | T) => string | T; +export declare const strToEl: (str: string) => Element; +interface RecordToCompare { + value: string; + label?: string; +} +export declare const sortByAlpha: ({ value, label }: RecordToCompare, { value: value2, label: label2 }: RecordToCompare) => number; +export declare const sortByScore: (a: Pick, b: Pick) => number; +export declare const dispatchEvent: (element: HTMLElement, type: EventType, customArgs?: object | null) => boolean; +export declare const existsInArray: (array: any[], value: string, key?: string) => boolean; +export declare const cloneObject: (obj: object) => object; +/** + * Returns an array of keys present on the first but missing on the second object + */ +export declare const diff: (a: Record, b: Record) => string[]; +export {}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/lib/utils.d.ts.map b/public/types/src/scripts/lib/utils.d.ts.map new file mode 100644 index 0000000..560f2ff --- /dev/null +++ b/public/types/src/scripts/lib/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/lib/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,eAAO,MAAM,eAAe,QAAS,MAAM,OAAO,MAAM,KAAG,MACZ,CAAC;AAEhD,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAC6B,CAAC;AAE7E,eAAO,MAAM,UAAU,YACZ,gBAAgB,GAAG,iBAAiB,UACrC,MAAM,KACb,MASF,CAAC;AAEF,eAAO,MAAM,OAAO,QAAS,GAAG,KAAG,MACe,CAAC;AAEnD,eAAO,MAAM,MAAM,SAAU,MAAM,OAAO,GAAG,KAAG,OACY,CAAC;AAE7D,eAAO,MAAM,IAAI,YACN,WAAW,YACX,WAAW,KACnB,WAUF,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,OAAO,YACN,MAAM,yBAEf,OAYF,CAAC;AAEF,eAAO,MAAM,kBAAkB,YACpB,WAAW,UACZ,WAAW,yBAElB,OAkBF,CAAC;AAEF,eAAO,MAAM,QAAQ,sCAUpB,CAAC;AAEF,eAAO,MAAM,OAAO,QAAe,MAAM,KAAK,OAc1C,CAAC;AAEL,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,eAAO,MAAM,WAAW,qBACI,eAAe,oCACE,eAAe,KACzD,MAKC,CAAC;AAEL,eAAO,MAAM,WAAW,MACnB,KAAK,MAAM,EAAE,OAAO,CAAC,KACrB,KAAK,MAAM,EAAE,OAAO,CAAC,KACvB,MAKF,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,WAAW,QACd,SAAS,eACH,MAAM,GAAG,IAAI,KACxB,OAQF,CAAC;AAEF,eAAO,MAAM,aAAa,UACjB,GAAG,EAAE,SACL,MAAM,mBAEZ,OAOC,CAAC;AAEL,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,MACT,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,IAAI,MACZ,OAAO,MAAM,EAAE,GAAG,CAAC,KACnB,OAAO,MAAM,EAAE,GAAG,CAAC,KACrB,MAAM,EAKR,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/lib/utils.test.d.ts b/public/types/src/scripts/lib/utils.test.d.ts new file mode 100644 index 0000000..c727c85 --- /dev/null +++ b/public/types/src/scripts/lib/utils.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=utils.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/lib/utils.test.d.ts.map b/public/types/src/scripts/lib/utils.test.d.ts.map new file mode 100644 index 0000000..58a4177 --- /dev/null +++ b/public/types/src/scripts/lib/utils.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/lib/utils.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/choices.d.ts b/public/types/src/scripts/reducers/choices.d.ts new file mode 100644 index 0000000..e94ae64 --- /dev/null +++ b/public/types/src/scripts/reducers/choices.d.ts @@ -0,0 +1,8 @@ +import { AddChoiceAction, FilterChoicesAction, ActivateChoicesAction, ClearChoicesAction } from '../actions/choices'; +import { AddItemAction, RemoveItemAction } from '../actions/items'; +import { Choice } from '../interfaces/choice'; +export declare const defaultState: never[]; +declare type ActionTypes = AddChoiceAction | FilterChoicesAction | ActivateChoicesAction | ClearChoicesAction | AddItemAction | RemoveItemAction | Record; +export default function choices(state?: Choice[], action?: ActionTypes): Choice[]; +export {}; +//# sourceMappingURL=choices.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/choices.d.ts.map b/public/types/src/scripts/reducers/choices.d.ts.map new file mode 100644 index 0000000..02f73cd --- /dev/null +++ b/public/types/src/scripts/reducers/choices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,eAAO,MAAM,YAAY,SAAK,CAAC;AAE/B,aAAK,WAAW,GACZ,eAAe,GACf,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,GAClB,aAAa,GACb,gBAAgB,GAChB,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,KAAK,GAAE,MAAM,EAAiB,EAC9B,MAAM,GAAE,WAAgB,GACvB,MAAM,EAAE,CAwGV"} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/choices.test.d.ts b/public/types/src/scripts/reducers/choices.test.d.ts new file mode 100644 index 0000000..1b34de1 --- /dev/null +++ b/public/types/src/scripts/reducers/choices.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=choices.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/choices.test.d.ts.map b/public/types/src/scripts/reducers/choices.test.d.ts.map new file mode 100644 index 0000000..abcc18f --- /dev/null +++ b/public/types/src/scripts/reducers/choices.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"choices.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/choices.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/groups.d.ts b/public/types/src/scripts/reducers/groups.d.ts new file mode 100644 index 0000000..ba4d669 --- /dev/null +++ b/public/types/src/scripts/reducers/groups.d.ts @@ -0,0 +1,9 @@ +import { AddGroupAction } from '../actions/groups'; +import { ClearChoicesAction } from '../actions/choices'; +import { Group } from '../interfaces/group'; +import { State } from '../interfaces/state'; +export declare const defaultState: never[]; +declare type ActionTypes = AddGroupAction | ClearChoicesAction | Record; +export default function groups(state?: Group[], action?: ActionTypes): State['groups']; +export {}; +//# sourceMappingURL=groups.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/groups.d.ts.map b/public/types/src/scripts/reducers/groups.d.ts.map new file mode 100644 index 0000000..0aff081 --- /dev/null +++ b/public/types/src/scripts/reducers/groups.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,eAAO,MAAM,YAAY,SAAK,CAAC;AAE/B,aAAK,WAAW,GAAG,cAAc,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/E,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,KAAK,GAAE,KAAK,EAAiB,EAC7B,MAAM,GAAE,WAAgB,GACvB,KAAK,CAAC,QAAQ,CAAC,CAwBjB"} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/groups.test.d.ts b/public/types/src/scripts/reducers/groups.test.d.ts new file mode 100644 index 0000000..8d44d56 --- /dev/null +++ b/public/types/src/scripts/reducers/groups.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=groups.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/groups.test.d.ts.map b/public/types/src/scripts/reducers/groups.test.d.ts.map new file mode 100644 index 0000000..ea6a989 --- /dev/null +++ b/public/types/src/scripts/reducers/groups.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"groups.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/groups.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/index.d.ts b/public/types/src/scripts/reducers/index.d.ts new file mode 100644 index 0000000..212bcc1 --- /dev/null +++ b/public/types/src/scripts/reducers/index.d.ts @@ -0,0 +1,9 @@ +export declare const defaultState: { + groups: never[]; + items: never[]; + choices: never[]; + loading: boolean; +}; +declare const rootReducer: (passedState: any, action: any) => object; +export default rootReducer; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/index.d.ts.map b/public/types/src/scripts/reducers/index.d.ts.map new file mode 100644 index 0000000..d95e352 --- /dev/null +++ b/public/types/src/scripts/reducers/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;;;CAKxB,CAAC;AASF,QAAA,MAAM,WAAW,qCAA0B,MAa1C,CAAC;AAEF,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/index.test.d.ts b/public/types/src/scripts/reducers/index.test.d.ts new file mode 100644 index 0000000..121d59b --- /dev/null +++ b/public/types/src/scripts/reducers/index.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/index.test.d.ts.map b/public/types/src/scripts/reducers/index.test.d.ts.map new file mode 100644 index 0000000..c182b40 --- /dev/null +++ b/public/types/src/scripts/reducers/index.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/items.d.ts b/public/types/src/scripts/reducers/items.d.ts new file mode 100644 index 0000000..0f8bc00 --- /dev/null +++ b/public/types/src/scripts/reducers/items.d.ts @@ -0,0 +1,8 @@ +import { AddItemAction, RemoveItemAction, HighlightItemAction } from '../actions/items'; +import { Item } from '../interfaces/item'; +import { State } from '../interfaces/state'; +export declare const defaultState: never[]; +declare type ActionTypes = AddItemAction | RemoveItemAction | HighlightItemAction | Record; +export default function items(state?: Item[], action?: ActionTypes): State['items']; +export {}; +//# sourceMappingURL=items.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/items.d.ts.map b/public/types/src/scripts/reducers/items.d.ts.map new file mode 100644 index 0000000..a057d64 --- /dev/null +++ b/public/types/src/scripts/reducers/items.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/items.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,eAAO,MAAM,YAAY,SAAK,CAAC;AAE/B,aAAK,WAAW,GACZ,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,KAAK,CAC3B,KAAK,GAAE,IAAI,EAAiB,EAC5B,MAAM,GAAE,WAAgB,GACvB,KAAK,CAAC,OAAO,CAAC,CA0DhB"} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/items.test.d.ts b/public/types/src/scripts/reducers/items.test.d.ts new file mode 100644 index 0000000..e81d58b --- /dev/null +++ b/public/types/src/scripts/reducers/items.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=items.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/items.test.d.ts.map b/public/types/src/scripts/reducers/items.test.d.ts.map new file mode 100644 index 0000000..6419257 --- /dev/null +++ b/public/types/src/scripts/reducers/items.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"items.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/items.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/loading.d.ts b/public/types/src/scripts/reducers/loading.d.ts new file mode 100644 index 0000000..0e32bf9 --- /dev/null +++ b/public/types/src/scripts/reducers/loading.d.ts @@ -0,0 +1,7 @@ +import { SetIsLoadingAction } from '../actions/misc'; +import { State } from '../interfaces/state'; +export declare const defaultState = false; +declare type ActionTypes = SetIsLoadingAction | Record; +declare const general: (state?: boolean, action?: ActionTypes) => State['loading']; +export default general; +//# sourceMappingURL=loading.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/loading.d.ts.map b/public/types/src/scripts/reducers/loading.d.ts.map new file mode 100644 index 0000000..e877cf9 --- /dev/null +++ b/public/types/src/scripts/reducers/loading.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,aAAK,WAAW,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE9D,QAAA,MAAM,OAAO,6BAEH,WAAW,KAClB,KAAK,CAAC,SAAS,CAUjB,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/reducers/loading.test.d.ts b/public/types/src/scripts/reducers/loading.test.d.ts new file mode 100644 index 0000000..b1d0de1 --- /dev/null +++ b/public/types/src/scripts/reducers/loading.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=loading.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/reducers/loading.test.d.ts.map b/public/types/src/scripts/reducers/loading.test.d.ts.map new file mode 100644 index 0000000..1f2efe5 --- /dev/null +++ b/public/types/src/scripts/reducers/loading.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"loading.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/reducers/loading.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/store/store.d.ts b/public/types/src/scripts/store/store.d.ts new file mode 100644 index 0000000..b6ff412 --- /dev/null +++ b/public/types/src/scripts/store/store.d.ts @@ -0,0 +1,74 @@ +import { Store as IStore, AnyAction } from 'redux'; +import { Choice } from '../interfaces/choice'; +import { Group } from '../interfaces/group'; +import { Item } from '../interfaces/item'; +import { State } from '../interfaces/state'; +export default class Store { + _store: IStore; + constructor(); + /** + * Subscribe store to function call (wrapped Redux method) + */ + subscribe(onChange: () => void): void; + /** + * Dispatch event to store (wrapped Redux method) + */ + dispatch(action: AnyAction): void; + /** + * Get store object (wrapping Redux method) + */ + get state(): State; + /** + * Get items from store + */ + get items(): Item[]; + /** + * Get active items from store + */ + get activeItems(): Item[]; + /** + * Get highlighted items from store + */ + get highlightedActiveItems(): Item[]; + /** + * Get choices from store + */ + get choices(): Choice[]; + /** + * Get active choices from store + */ + get activeChoices(): Choice[]; + /** + * Get selectable choices from store + */ + get selectableChoices(): Choice[]; + /** + * Get choices that can be searched (excluding placeholders) + */ + get searchableChoices(): Choice[]; + /** + * Get placeholder choice from store + */ + get placeholderChoice(): Choice | undefined; + /** + * Get groups from store + */ + get groups(): Group[]; + /** + * Get active groups from store + */ + get activeGroups(): Group[]; + /** + * Get loading state from store + */ + isLoading(): boolean; + /** + * Get single choice by it's ID + */ + getChoiceById(id: string): Choice | undefined; + /** + * Get group by group id + */ + getGroupById(id: number): Group | undefined; +} +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/store/store.d.ts.map b/public/types/src/scripts/store/store.d.ts.map new file mode 100644 index 0000000..32a519e --- /dev/null +++ b/public/types/src/scripts/store/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/store/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,IAAI,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB,MAAM,EAAE,MAAM,CAAC;;IAUf;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIrC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIjC;;OAEG;IACH,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,IAAI,EAAE,CAElB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,IAAI,EAAE,CAExB;IAED;;OAEG;IACH,IAAI,sBAAsB,IAAI,IAAI,EAAE,CAEnC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,EAAE,CAE5B;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAEhC;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,EAAE,CAIhC;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAI1C;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,KAAK,EAAE,CAEpB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,KAAK,EAAE,CAW1B;IAED;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI7C;;OAEG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS;CAG5C"} \ No newline at end of file diff --git a/public/types/src/scripts/store/store.test.d.ts b/public/types/src/scripts/store/store.test.d.ts new file mode 100644 index 0000000..6ffd6f9 --- /dev/null +++ b/public/types/src/scripts/store/store.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=store.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/store/store.test.d.ts.map b/public/types/src/scripts/store/store.test.d.ts.map new file mode 100644 index 0000000..fa49f4c --- /dev/null +++ b/public/types/src/scripts/store/store.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.test.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/store/store.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/public/types/src/scripts/templates.d.ts b/public/types/src/scripts/templates.d.ts new file mode 100644 index 0000000..b1b3f02 --- /dev/null +++ b/public/types/src/scripts/templates.d.ts @@ -0,0 +1,25 @@ +/** + * Helpers to create HTML elements used by Choices + * Can be overridden by providing `callbackOnCreateTemplates` option + */ +import { Choice } from './interfaces/choice'; +import { Group } from './interfaces/group'; +import { Item } from './interfaces/item'; +import { PassedElementType } from './interfaces/passed-element-type'; +declare type TemplateOptions = Record<'classNames' | 'allowHTML', any>; +declare const templates: { + containerOuter({ classNames: { containerOuter } }: TemplateOptions, dir: HTMLElement['dir'], isSelectElement: boolean, isSelectOneElement: boolean, searchEnabled: boolean, passedElementType: PassedElementType): HTMLDivElement; + containerInner({ classNames: { containerInner }, }: TemplateOptions): HTMLDivElement; + itemList({ classNames: { list, listSingle, listItems } }: TemplateOptions, isSelectOneElement: boolean): HTMLDivElement; + placeholder({ allowHTML, classNames: { placeholder } }: TemplateOptions, value: string): HTMLDivElement; + item({ allowHTML, classNames: { item, button, highlightedState, itemSelectable, placeholder, }, }: TemplateOptions, { id, value, label, customProperties, active, disabled, highlighted, placeholder: isPlaceholder, }: Item, removeItemButton: boolean): HTMLDivElement; + choiceList({ classNames: { list } }: TemplateOptions, isSelectOneElement: boolean): HTMLDivElement; + choiceGroup({ allowHTML, classNames: { group, groupHeading, itemDisabled }, }: TemplateOptions, { id, value, disabled }: Group): HTMLDivElement; + choice({ allowHTML, classNames: { item, itemChoice, itemSelectable, selectedState, itemDisabled, placeholder, }, }: TemplateOptions, { id, value, label, groupId, elementId, disabled: isDisabled, selected: isSelected, placeholder: isPlaceholder, }: Choice, selectText: string): HTMLDivElement; + input({ classNames: { input, inputCloned } }: TemplateOptions, placeholderValue: string): HTMLInputElement; + dropdown({ classNames: { list, listDropdown }, }: TemplateOptions): HTMLDivElement; + notice({ allowHTML, classNames: { item, itemChoice, noResults, noChoices }, }: TemplateOptions, innerText: string, type?: 'no-choices' | 'no-results' | ''): HTMLDivElement; + option({ label, value, customProperties, active, disabled, }: Item): HTMLOptionElement; +}; +export default templates; +//# sourceMappingURL=templates.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/templates.d.ts.map b/public/types/src/scripts/templates.d.ts.map new file mode 100644 index 0000000..8252dcf --- /dev/null +++ b/public/types/src/scripts/templates.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../src/scripts/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,aAAK,eAAe,GAAG,MAAM,CAAC,YAAY,GAAG,WAAW,EAAE,GAAG,CAAC,CAAC;AAE/D,QAAA,MAAM,SAAS;uDAEyB,eAAe,OAC9C,WAAW,CAAC,KAAK,CAAC,mBACN,OAAO,sBACJ,OAAO,iBACZ,OAAO,qBACH,iBAAiB,GACnC,cAAc;wDA8Bd,eAAe,GAAG,cAAc;8DAOgB,eAAe,sBAC5C,OAAO,GAC1B,cAAc;4DAO6B,eAAe,SACpD,MAAM,GACZ,cAAc;uGAiBZ,eAAe,sGAUf,IAAI,oBACW,OAAO,GACxB,cAAc;yCAmDW,eAAe,sBACrB,OAAO,GAC1B,cAAc;mFAiBZ,eAAe,2BACO,KAAK,GAC7B,cAAc;wHAsCZ,eAAe,qHAUf,MAAM,cACG,MAAM,GACjB,cAAc;kDAqCyB,eAAe,oBACrC,MAAM,GACvB,gBAAgB;sDAmBhB,eAAe,GAAG,cAAc;mFAa9B,eAAe,aACP,MAAM,SACX,YAAY,GAAG,YAAY,GAAG,EAAE,GACrC,cAAc;kEAqBd,IAAI,GAAG,iBAAiB;CAW5B,CAAC;AAEF,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/public/types/src/scripts/templates.test.d.ts b/public/types/src/scripts/templates.test.d.ts new file mode 100644 index 0000000..ba2e643 --- /dev/null +++ b/public/types/src/scripts/templates.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=templates.test.d.ts.map \ No newline at end of file diff --git a/public/types/src/scripts/templates.test.d.ts.map b/public/types/src/scripts/templates.test.d.ts.map new file mode 100644 index 0000000..d7d77ed --- /dev/null +++ b/public/types/src/scripts/templates.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"templates.test.d.ts","sourceRoot":"","sources":["../../../../src/scripts/templates.test.ts"],"names":[],"mappings":""} \ No newline at end of file