From 6705eafc7ffc2fa600c8d20c0460aecb818ff6ab Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Wed, 6 Nov 2019 10:32:02 -0800 Subject: [PATCH] fix incorrect dropdown behavior when multi+openOnFocus and selection is made via mouse --- control/src/multi-select.tsx | 77 +++++++++++++++++++++++------------- dist/select25.js | 8 ++-- dist/select25.js.map | 2 +- 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/control/src/multi-select.tsx b/control/src/multi-select.tsx index 0cd5789a..1685a30b 100644 --- a/control/src/multi-select.tsx +++ b/control/src/multi-select.tsx @@ -297,23 +297,6 @@ export class MultiSelect extends AbstractSelect { this.selectSearchResult(index); }; - public selectActiveResult = () => { - this.selectResult(this.getSelectedSearchResult()); - }; - - public selectResult = (result: any) => { - const { values, onChange } = this.props; - const next = values.slice(); - next.push(result); - - this.close(); - - const label = this.getItemLabel(result); - announce.politely(this.dictionary.valueAdded(label)); - - onChange(next); - }; - public toggleValue = (index: number) => { const { values: { selected } @@ -358,8 +341,7 @@ export class MultiSelect extends AbstractSelect { if (this.hasSearchResults) { switch (event.key) { case Key.Enter: - this.selectActiveResult(); - event.preventDefault(); + this.onActiveResultSelectedViaKeypress(event); break; case Key.Escape: if (open) { @@ -412,12 +394,15 @@ export class MultiSelect extends AbstractSelect { } } - public close = () => { - this.updateState({ - open: false, - results: { results: undefined }, - search: '' - }); + public close = (callback?: () => void) => { + this.updateState( + { + open: false, + results: { results: undefined }, + search: '' + }, + callback + ); }; public onValuesBlur = (event: Event) => { @@ -487,9 +472,47 @@ export class MultiSelect extends AbstractSelect { }; public onResultClicked = (result: any, event: MouseEvent) => { - this.selectResult(result); - this.searchRef.current!.focus(); + const { openOnFocus } = this.props; + const values = this.selectResult(result); + + const focusSearchLater = () => { + window.setTimeout(() => { + this.searchRef.current!.focus(); + }, 0); + }; + + if (openOnFocus) { + this.search('', values, {}, focusSearchLater); + } else { + this.close(focusSearchLater); + } + event.preventDefault(); event.stopPropagation(); }; + + public onActiveResultSelectedViaKeypress = (event: KeyboardEvent) => { + const { openOnFocus } = this.props; + const result = this.getSelectedSearchResult(); + const values = this.selectResult(result); + if (openOnFocus) { + this.search('', values, { open: true }); + } else { + this.close(); + } + + event.preventDefault(); + }; + + public selectResult = (result: any) => { + const { values, onChange } = this.props; + const next = values.slice(); + next.push(result); + + const label = this.getItemLabel(result); + announce.politely(this.dictionary.valueAdded(label)); + + onChange(next); + return next; + }; } diff --git a/dist/select25.js b/dist/select25.js index 295a0414..7dba4d3b 100644 --- a/dist/select25.js +++ b/dist/select25.js @@ -15,14 +15,14 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Bundle of select2 - * Generated: 2019-08-13 + * Generated: 2019-11-06 * Version: 5.0.0-snapshot * Dependencies: * - * tslib -- 1.9.3 - * * preact -- 10.0.0-beta.3 + * + * tslib -- 1.9.3 */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).select25={})}(this,function(e){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var D=function(){return(D=Object.assign||function(e){for(var t,n=1,o=arguments.length;na[0]&&t[1]=o),p=c?W():void 0,d=f;f.updateState([e,{loading:c,results:{active:-1,page:0,results:void 0,showLoadMoreResults:!1,showMinimumCharactersError:!c,showNoSearchResultsFound:!1,token:p},search:r}],function(){if(t&&t(),c){var e=function(){return h(f,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,u(r,0,p)];case 1:return(t=e.sent()).token!==d.state.results.token?[2]:(n=t.values||[],!i&&0=l.top&&u.bottom>l.bottom&&(c=u.bottom-l.bottom,s.scrollTop=s.scrollTop+c)}}},pe);function pe(e){var n=ue.call(this,e)||this;return n.onResultClicked=function(t){return function(e){n.props.onResultClicked(t,e)}},n.onMouseMove=function(t){return function(e){n.lastMouseClientX===e.clientX&&n.lastMouseClientY===e.clientY||(n.lastMouseClientX=e.clientX,n.lastMouseClientY=e.clientY,n.props.onMouseMove(t,e))}},n.onScroll=function(){if(n.props.showLoadMoreResults){var e=n.loadMore.current;"hidden"!==function(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return o.bottomn.bottom?"hidden":o.top=n.top&&o.bottom>n.bottom?"partial-bottom":"visible"}(n.container.current,e)&&n.props.onLoadMore()}},n.container={},n.loadMore={},n}var de,fe=B({},G,{values:[]}),he=(t(ve,de=$),ve.prototype.componentWillMount=function(){m()},ve.prototype.render=function(e,t){var n,o,u=this,r=e.values,s=e.tabIndex,a=e.minimumCharacters,i=e.valuesLabel,l=e.comboboxLabel,c=e.placeholder,p=t.open,d=t.loading,f=t.focused,h=t.search,v=t.values,m=v.active,g=v.selected,y=t.results,_=this.dictionary,b=!r||0===r.length,w=q(ie.control,ie.multi,((n={})[ie.open]=p,n),((o={})[ie.focused]=f,o));e.containerClass&&0a[0]&&t[1]=o),p=c?W():void 0,d=f;f.updateState([e,{loading:c,results:{active:-1,page:0,results:void 0,showLoadMoreResults:!1,showMinimumCharactersError:!c,showNoSearchResultsFound:!1,token:p},search:r}],function(){if(t&&t(),c){var e=function(){return h(f,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,u(r,0,p)];case 1:return(t=e.sent()).token!==d.state.results.token?[2]:(n=t.values||[],!i&&0=l.top&&u.bottom>l.bottom&&(c=u.bottom-l.bottom,s.scrollTop=s.scrollTop+c)}}},pe);function pe(e){var n=ue.call(this,e)||this;return n.onResultClicked=function(t){return function(e){n.props.onResultClicked(t,e)}},n.onMouseMove=function(t){return function(e){n.lastMouseClientX===e.clientX&&n.lastMouseClientY===e.clientY||(n.lastMouseClientX=e.clientX,n.lastMouseClientY=e.clientY,n.props.onMouseMove(t,e))}},n.onScroll=function(){if(n.props.showLoadMoreResults){var e=n.loadMore.current;"hidden"!==function(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return o.bottomn.bottom?"hidden":o.top=n.top&&o.bottom>n.bottom?"partial-bottom":"visible"}(n.container.current,e)&&n.props.onLoadMore()}},n.container={},n.loadMore={},n}var de,fe=B({},G,{values:[]}),he=(t(ve,de=$),ve.prototype.componentWillMount=function(){m()},ve.prototype.render=function(e,t){var n,o,u=this,r=e.values,s=e.tabIndex,a=e.minimumCharacters,i=e.valuesLabel,l=e.comboboxLabel,c=e.placeholder,p=t.open,d=t.loading,f=t.focused,h=t.search,v=t.values,m=v.active,g=v.selected,y=t.results,_=this.dictionary,b=!r||0===r.length,w=K(ie.control,ie.multi,((n={})[ie.open]=p,n),((o={})[ie.focused]=f,o));e.containerClass&&0= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var n,l,u,t,i,r,f={},e=[],o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i;function c(n,l){for(var u in l)n[u]=l[u];return n}function s(n){var l=n.parentNode;l&&l.removeChild(n)}function a(n,l,u){var t,i,r,f,e=arguments;if(l=c({},l),arguments.length>3)for(u=[u],t=3;t2&&(l.children=e.slice.call(arguments,2)),h(n.type,l,l.key||n.key,l.ref||n.ref)}function L(n){var l={},u={__c:\"__cC\"+r++,__p:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,i=this;return this.getChildContext||(t=[],this.getChildContext=function(){return l[u.__c]=i,l},this.shouldComponentUpdate=function(n){t.some(function(l){l.__P&&(l.context=n.value,b(l))})},this.sub=function(n){t.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t.splice(t.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Consumer.contextType=u,u}n={},d.prototype.setState=function(n,l){var u=this.__s!==this.state&&this.__s||(this.__s=c({},this.state));(\"function\"!=typeof n||(n=n(u,this.props)))&&c(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b(this))},d.prototype.forceUpdate=function(n){var l,u,t,i=this.__v,r=this.__v.__e,f=this.__P;f&&(l=!1!==n,u=[],t=N(f,i,c({},i),this.__n,void 0!==f.ownerSVGElement,null,u,l,null==r?m(i):r),$(u,i),t!=r&&w(i)),n&&n()},d.prototype.render=p,l=[],u=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,t=/[A-Z]/g,i=\"http://www.w3.org/1999/xlink\",r=0;export{D as render,H as hydrate,a as createElement,a as h,p as Fragment,v as createRef,d as Component,I as cloneElement,L as createContext,_ as toChildArray,O as _unmount,n as options};\n//# sourceMappingURL=preact.module.js.map\n","export function initialize() {\n if (document.getElementById('s25-live')) {\n return;\n }\n\n const live = document.createElement('div');\n live.setAttribute('id', 's25-live');\n live.setAttribute('class', 's25-offscreen s25-live');\n document.body.appendChild(live);\n\n const assertive = document.createElement('div');\n assertive.setAttribute('id', 's25-live-assertive');\n assertive.setAttribute('role', 'log');\n assertive.setAttribute('aria-live', 'assertive');\n assertive.setAttribute('aria-relevant', 'additions');\n live.appendChild(assertive);\n\n const polite = document.createElement('div');\n polite.setAttribute('id', 's25-live-polite');\n polite.setAttribute('role', 'log');\n polite.setAttribute('aria-live', 'polite');\n polite.setAttribute('aria-relevant', 'additions');\n live.appendChild(polite);\n}\n\nexport function assertively(message: string) {\n add(message, document.getElementById('s25-live-assertive')!);\n}\n\nexport function politely(message: string) {\n add(message, document.getElementById('s25-live-polite')!);\n}\n\nfunction add(message: string, container: HTMLElement) {\n const node = document.createElement('div');\n node.appendChild(document.createTextNode(message));\n container.appendChild(node);\n\n // clean up old nodes\n\n let collection = document.getElementById('s25-live-assertive')!;\n while (collection.firstChild && collection.firstChild !== node) {\n collection.removeChild(collection.firstChild);\n }\n collection = document.getElementById('s25-live-polite')!;\n while (collection.firstChild && collection.firstChild !== node) {\n collection.removeChild(collection.firstChild);\n }\n}\n","// TODO make it so keys can be strings in addition to functions\nexport interface Dictionary {\n valueAdded(itemLabel: string): string;\n noSearchResults(): string;\n searchResultsLoading(): string;\n removeButtonTitle(): string;\n clearButtonTitle(): string;\n minimumCharactersMessage(len: number, min: number): string;\n multiSelectInstructions(): string;\n expandButtonTitle(): string;\n}\n\nconst EN_US: Dictionary = {\n noSearchResults() {\n return 'No results available';\n },\n\n searchResultsLoading() {\n return 'Loading...';\n },\n\n removeButtonTitle() {\n return 'Remove selected values';\n },\n\n clearButtonTitle() {\n return 'Clear selection';\n },\n\n valueAdded(itemLabel: string) {\n return itemLabel + ' added';\n },\n\n minimumCharactersMessage(len: number, min: number) {\n const delta = min - len;\n return 'Please enter ' + delta + ' more character' + (delta > 1 ? 's' : '');\n },\n\n multiSelectInstructions(): string {\n return \"Items can be removed from this list box by selecting them and activating 'Remove selected values' button. Items can be added by selecting them in the adjacent combobox.\";\n },\n\n expandButtonTitle(): string {\n return 'Expand';\n }\n};\n\nconst dictionaries = new Map();\ndictionaries.set('en_us', EN_US);\n\nexport function getDictionary(dict?: string | undefined): Dictionary {\n const fallback: Dictionary = dictionaries.get('en_us') as Dictionary;\n\n if (!dict) {\n return fallback;\n }\n\n if (typeof dict === 'string') {\n const instance = dictionaries.get(dict);\n return instance ? instance : fallback;\n } else {\n return dict;\n }\n}\n","import { ComponentChild } from 'preact';\n\nexport function extend(...params: object[]) {\n for (let i = 1; i < arguments.length; i++) {\n for (const key in arguments[i]) {\n if (arguments[i].hasOwnProperty(key)) {\n if (typeof arguments[0][key] === 'object' && typeof arguments[i][key] === 'object') {\n extend(arguments[0][key], arguments[i][key]);\n } else {\n arguments[0][key] = arguments[i][key];\n }\n }\n }\n }\n return arguments[0];\n}\n\nexport type DeepPartial = {\n [P in keyof T]?: T[P] extends Array\n ? Array>\n : T[P] extends ReadonlyArray\n ? ReadonlyArray>\n : DeepPartial\n};\n\nexport const merge = (target: T, sources: Array>): T => {\n if (!sources.length) {\n return target;\n }\n const source = sources.shift();\n if (source === undefined) {\n return merge(target, sources);\n }\n\n if (isMergebleObject(target) && isMergebleObject(source)) {\n Object.keys(source).forEach((key: string) => {\n if (isMergebleObject(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n merge(target[key], [source[key]]);\n } else {\n target[key] = source[key];\n }\n });\n }\n\n return merge(target, sources);\n};\n\nconst isObject = (item: any): boolean => {\n return item !== null && typeof item === 'object';\n};\n\nconst isMergebleObject = (item): boolean => {\n return isObject(item) && !Array.isArray(item);\n};\n\nexport function cn(...values: any) {\n const classes: string[] = [];\n const hasOwnProperty = {}.hasOwnProperty;\n\n for (const value of values) {\n if (typeof value === 'string') {\n classes.push(value);\n } else if (typeof value === 'object') {\n for (const key in value as object) {\n if (hasOwnProperty.call(value, key) && value[key]) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n}\n\nexport enum Key {\n // https://www.w3.org/TR/uievents-key/#named-key-attribute-values\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n ArrowLeft = 'ArrowLeft',\n ArrowRight = 'ArrowRight',\n Space = ' ',\n Enter = 'Enter',\n Tab = 'Tab',\n Home = 'Home',\n End = 'End',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n Backspace = 'Backspace',\n Delete = 'Delete',\n Clear = 'Clear',\n Escape = 'Escape',\n // IE 11\n Down = 'Down',\n Up = 'Up',\n Spacebar = 'Spacebar',\n Left = 'Left',\n Right = 'Right'\n}\n\nexport const uuid = (() => {\n let counter = 0;\n return () => 's25-' + counter++;\n})();\n\nexport function throttle(delay: number, callback: () => void): () => void {\n let timeout: number | undefined;\n return () => {\n if (timeout !== undefined) {\n window.clearTimeout(timeout);\n timeout = undefined;\n } else {\n timeout = window.setTimeout(() => {\n callback();\n timeout = undefined;\n }, delay);\n }\n };\n}\n\n// @ts-ignore\nexport function debounce(quiet: number, delegate: (...args: any[]) => void, that: object) {\n const args = Array.from(arguments);\n if (quiet <= 0) {\n return () => {\n delegate.apply(that, args);\n };\n } else {\n let timeout: number | undefined;\n return () => {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n timeout = window.setTimeout(() => {\n timeout = undefined;\n delegate.apply(that, args);\n }, quiet);\n };\n }\n}\n\nexport function getScrollParents(el: HTMLElement): EventTarget[] {\n const style = window.getComputedStyle(el);\n const elementPosition = style.position;\n if (elementPosition === 'fixed') {\n return [el];\n }\n\n const parents: Array = [];\n let parent = el.parentElement;\n\n while (parent && parent.nodeType === 1) {\n const css = window.getComputedStyle(parent);\n if (/(overlay|scroll|auto)/.test(css.overflow + ' ' + css.overflowX + ' ' + css.overflowY)) {\n if (elementPosition !== 'absolute' || ['relative', 'fixed', 'absolute'].indexOf(css.position || '') >= 0) {\n parents.push(parent);\n }\n }\n parent = parent.parentElement;\n }\n\n if (el.ownerDocument) {\n parents.push(el.ownerDocument.body);\n }\n\n // iframe\n if (el.ownerDocument !== document && el.ownerDocument && el.ownerDocument.defaultView) {\n parents.push(el.ownerDocument.defaultView);\n }\n\n parents.push(window);\n return parents;\n}\n\nexport function calculateVerticalVisibility(\n container: HTMLElement,\n element: HTMLElement\n): 'hidden' | 'partial-top' | 'partial-bottom' | 'visible' {\n const c = container.getBoundingClientRect();\n const e = element.getBoundingClientRect();\n\n if (e.bottom < c.top) {\n // above the fold\n return 'hidden';\n }\n\n if (e.top > c.bottom) {\n // below the fold\n return 'hidden';\n }\n\n if (e.top < c.top && e.bottom <= c.bottom) {\n return 'partial-top';\n }\n\n if (e.top >= c.top && e.bottom > c.bottom) {\n return 'partial-bottom';\n }\n\n return 'visible';\n}\n\nexport type MouseEventListener = (event: MouseEvent) => void;\nexport type KeyboardEventListener = (event: KeyboardEvent) => void;\nexport type EventListener = (event: Event) => void;\nexport type FocusEventListener = (event: FocusEvent) => void;\n\n/** helper that makes it easier to declare a scope inside a jsx block */\nexport function scope(delegate: () => ComponentChild) {\n return delegate();\n}\n","import { Component, ComponentChild, h, h as createElement } from 'preact';\nimport * as announce from './announce';\nimport { Dictionary, getDictionary } from './dictionary';\nimport { DeepPartial, Key, merge, uuid } from './util';\nconst forceImportOfH = h;\n\ntype ToString = (item: any) => string;\n\nexport type DataItemRenderer = (string) | ((item: any, h: typeof createElement) => ComponentChild);\n\nexport type QueryFunction = (search: string, page: number, token: string) => Promise;\n\nexport interface DataItem {\n id: any;\n text: string;\n}\n\nexport interface QueryResult {\n values: DataItem[];\n more: boolean;\n token: string;\n}\n\nexport interface ResultListState {\n results: any[];\n token: string;\n active: number;\n page: number;\n\n showMinimumCharactersError: boolean;\n showNoSearchResultsFound: boolean;\n showLoadMoreResults: boolean;\n}\nexport interface State {\n search: string;\n results: ResultListState;\n loading: boolean;\n open: boolean;\n focused: boolean;\n}\n\nexport interface Props {\n containerStyle?: string;\n containerClass?: string;\n tabIndex?: number;\n valueContent?: DataItemRenderer;\n resultContent?: DataItemRenderer;\n\n query: QueryFunction;\n quiet?: number;\n allowDuplicates?: boolean;\n minimumCharacters?: number;\n openOnFocus?: boolean;\n dictionary?: string | Dictionary;\n}\n\nfunction MarkupRenderer({ markup }) {\n return
;\n}\n\nexport const DEFAULT_PROPS: Partial = {\n allowDuplicates: false,\n minimumCharacters: 0,\n quiet: 50,\n tabIndex: 0\n};\n\nexport abstract class AbstractSelect

extends Component {\n private searchTimeout: number | undefined;\n protected namespace: string;\n\n constructor(props: P) {\n super(props);\n this.searchTimeout = undefined;\n this.namespace = uuid();\n // @ts-ignore\n this.state = {\n focused: false,\n loading: false,\n open: false,\n results: {\n active: -1,\n page: 0,\n results: undefined, // TODO rename to values\n token: null,\n\n showLoadMoreResults: false,\n showMinimumCharactersError: false,\n showNoSearchResultsFound: false\n },\n search: ''\n };\n }\n\n public getItemId = (item: DataItem): string => {\n return item.id;\n };\n\n public getItemLabel = (item: DataItem): string => {\n const label = item.text;\n return item.text;\n };\n\n public renderValue = (item: DataItem): ComponentChild => {\n return this.renderItem(item, 'valueContent');\n };\n\n public renderResult = (item: DataItem): ComponentChild => {\n return this.renderItem(item, 'resultContent');\n };\n\n private renderItem = (item: DataItem, rendererName: (keyof Props) & DataItemRenderer): ComponentChild => {\n const renderer = this.props[rendererName] as DataItemRenderer;\n if (renderer) {\n if (typeof renderer === 'function') {\n const render = renderer(item, createElement);\n if (typeof render === 'string') {\n return ;\n } else {\n return render;\n }\n } else {\n return ;\n }\n } else {\n return ;\n }\n };\n\n get dictionary(): Dictionary {\n const dict = this.props.dictionary;\n if (dict) {\n if (typeof dict === 'string') {\n return getDictionary(dict);\n } else {\n return dict as Dictionary;\n }\n } else {\n return getDictionary();\n }\n }\n\n protected updateState(update: DeepPartial | Array>, callback?: () => void) {\n const state = merge(this.state, Array.isArray(update) ? update : [update]);\n this.setState(state, callback);\n }\n\n public search = (query, selectedValues, start?: DeepPartial, callback?: () => void) => {\n const dictionary = this.dictionary;\n const { minimumCharacters, allowDuplicates, quiet, query: queryFunc } = this.props;\n\n const current = this.state.results;\n\n const minimumCharactersReached = query.length >= minimumCharacters;\n const token = minimumCharactersReached ? uuid() : undefined;\n\n const control = this;\n\n this.updateState(\n // @ts-ignore\n [\n start,\n {\n loading: minimumCharactersReached,\n results: {\n active: -1,\n page: 0,\n results: undefined,\n showLoadMoreResults: false,\n showMinimumCharactersError: !minimumCharactersReached,\n showNoSearchResultsFound: false,\n token\n },\n search: query\n }\n ],\n () => {\n if (callback) {\n callback();\n }\n\n if (!minimumCharactersReached) {\n // todo - throttle this announcement?\n announce.politely(dictionary.minimumCharactersMessage(query.length, minimumCharacters!));\n return;\n }\n\n // todo - throttle this announcement?\n // announce.politely(dictionary.searchResultsLoading());\n\n const execute = async () => {\n try {\n const result = await queryFunc(query, 0, token!);\n if (result.token !== control.state.results.token) {\n // this is a stale result, ignore\n return;\n }\n\n let values = result.values || [];\n if (!allowDuplicates && values.length > 0 && selectedValues.length > 0) {\n const ids = new Set();\n selectedValues.forEach(v => ids.add(control.getItemId(v)));\n values = values.filter(v => !ids.has(control.getItemId(v)));\n }\n\n if (values.length < 1) {\n announce.politely(dictionary.noSearchResults());\n }\n\n // @ts-ignore\n control.updateState({\n loading: false,\n results: {\n active: values.length > 0 ? 0 : -1,\n page: 0,\n results: values,\n showLoadMoreResults: result.more,\n showNoSearchResultsFound: values.length < 1\n }\n });\n } catch (e) {\n // @ts-ignore\n control.updateState({ loading: false });\n }\n };\n\n if (quiet && quiet > 0) {\n if (control.searchTimeout) {\n window.clearTimeout(control.searchTimeout);\n }\n control.searchTimeout = window.setTimeout(execute, quiet);\n } else {\n execute();\n }\n }\n );\n };\n\n public loadMore() {\n const {\n loading,\n search: query,\n results: { page }\n } = this.state;\n const dict = this.dictionary;\n const { query: queryFunc } = this.props;\n const control = this;\n\n if (loading) {\n return;\n }\n\n const token = uuid();\n const nextPage = page + 1;\n\n this.updateState(\n // @ts-ignore\n {\n loading: true,\n results: {\n token\n }\n },\n async () => {\n // TODO throttle?\n // announce.politely(dict.searchResultsLoading());\n\n try {\n const result = await queryFunc(query, nextPage, token);\n\n const current = control.state.results;\n\n if (result.token !== current.token) {\n // this is a stale result, ignore\n return;\n }\n\n if (result.values && result.values.length > 0) {\n // @ts-ignore\n control.updateState({\n loading: false,\n results: {\n page: nextPage,\n results: current.results.concat(result.values),\n showLoadMoreResults: result.more\n }\n });\n } else {\n announce.politely(dict.noSearchResults());\n // @ts-ignore\n control.updateState({\n loading: false,\n results: {\n showLoadMoreResults: false\n }\n });\n }\n } catch (e) {\n // @ts-ignore\n control.updateState({ loading: false });\n }\n }\n );\n }\n\n protected handleResultNavigationKeyDown(event: KeyboardEvent): boolean {\n switch (event.key) {\n case Key.ArrowUp:\n case Key.Up:\n this.selectPreviousSearchResult();\n event.preventDefault();\n return true;\n case Key.ArrowDown:\n case Key.Down:\n this.selectNextSearchResult();\n event.preventDefault();\n return true;\n }\n return false;\n }\n\n protected selectNextSearchResult() {\n const { active, results } = this.state.results;\n if (results && active < results.length - 1) {\n // @ts-ignore\n this.updateState({ results: { active: active + 1 } });\n }\n }\n\n protected selectPreviousSearchResult() {\n const { active } = this.state.results;\n if (active > 0) {\n // @ts-ignore\n this.updateState({ results: { active: active - 1 } });\n }\n }\n\n protected getSelectedSearchResult() {\n const { results, active } = this.state.results;\n return results[active];\n }\n\n protected selectSearchResult(index: number) {\n const { active } = this.state.results;\n if (active !== index) {\n // @ts-ignore\n this.updateState({ results: { active: index } });\n }\n }\n\n protected hasSearchResults() {\n const results = this.state.results.results;\n return results && results.length > 0;\n }\n}\n","import { Component, ComponentChild, Fragment, h, RefObject, render } from 'preact';\nimport { getScrollParents, MouseEventListener, throttle } from './util';\n\nclass ContextProvider extends Component<{ context: any }> {\n public getChildContext() {\n return this.props.context;\n }\n public render() {\n return this.props.children;\n }\n}\n\nfunction Portal({ vnode, container }): null {\n // @ts-ignore\n const wrap = {vnode};\n render(wrap, container);\n return null;\n}\n\nfunction createPortal(vnode, container): ComponentChild {\n return h(Portal, { vnode, container });\n}\n\ninterface Props {\n controlRef: RefObject;\n dropdownRef: RefObject;\n class?: string;\n onClick?: MouseEventListener;\n onMouseDown?: MouseEventListener;\n onFocusOut?: EventListener;\n}\n\nexport class Dropdown extends Component {\n private container?: HTMLElement;\n private scrollParents?: EventTarget[];\n private throttledPosition;\n\n constructor(props) {\n super(props);\n this.throttledPosition = throttle(50, this.position.bind(this));\n }\n\n public componentWillMount() {\n this.container = document.createElement('div');\n if (this.props.class) {\n this.container.className = this.props.class;\n }\n\n /*\n this container needs to be able to receive focus so we can tell\n it is not leaving the control - we consider dropdown part of the control\n */\n this.container.tabIndex = -1;\n if (this.props.onClick) {\n this.container.addEventListener('click', this.props.onClick);\n }\n if (this.props.onMouseDown) {\n this.container.addEventListener('mousedown', this.props.onMouseDown);\n }\n if (this.props.onFocusOut) {\n this.container.addEventListener('focusout', this.props.onFocusOut);\n }\n document.body.appendChild(this.container);\n }\n\n public componentDidMount() {\n this.props.dropdownRef.current = this.container;\n this.scrollParents = getScrollParents(this.props.controlRef.current!);\n this.scrollParents.forEach(parent => {\n ['resize', 'scroll', 'touchmove'].forEach(event => {\n parent.addEventListener(event, this.throttledPosition);\n });\n });\n this.position();\n }\n\n public componentWillUnmount() {\n if (this.scrollParents) {\n this.scrollParents.forEach(parent => {\n ['resize', 'scroll', 'touchmove'].forEach(event => {\n parent.removeEventListener(event, this.throttledPosition);\n });\n });\n delete this.scrollParents;\n this.scrollParents = undefined;\n }\n\n this.props.dropdownRef.current = undefined;\n this.container!.parentElement!.removeChild(this.container!);\n }\n\n public componentDidUpdate() {\n this.position();\n }\n\n public render(props) {\n return createPortal({this.props.children}, this.container!);\n }\n\n private position() {\n const control = this.props.controlRef.current!;\n const rect = control.getBoundingClientRect();\n const style = `top: ${rect.top + rect.height + window.pageYOffset}px;\n left: ${rect.left + window.pageXOffset}px;\n width: ${rect.width}px;`;\n this.container!.setAttribute('style', style);\n }\n}\n","import { FunctionComponent, h } from 'preact';\n\nconst forceImportOfH = h;\n\ninterface Props {\n width: number;\n height: number;\n}\n\nexport const Toggle: FunctionComponent = ({ height, width }) => {\n const viewBox = '0 0 ' + width + ' ' + height;\n return (\n \n \n \n );\n};\nToggle.displayName = 'Toggle';\n\nexport const Remove: FunctionComponent = ({ width, height }) => {\n const viewBox = '0 0 ' + width + ' ' + height;\n return (\n \n \n \n );\n};\nRemove.displayName = 'Remove';\n","export const enum style {\n control = 's25-control',\n content = 's25-content',\n single = 's25-single',\n multi = 's25-multi',\n body = 's25-body',\n focused = 's25-focused',\n active = 's25-active',\n live = 's25-live',\n multiValues = 's25-multi-values',\n value = 's25-value',\n item = 's25-item',\n selected = 's25-selected',\n toggle = 's25-toggle',\n remove = 's25-remove',\n open = 's25-open',\n label = 's25-label',\n search = 's25-search',\n offscreen = 's25-offscreen',\n searchContainer = 's25-search-container',\n dropdown = 's25-dropdown',\n searchResults = 's25-search-results',\n options = 's25-options',\n noSearchResults = 's25-no-search-results',\n searchResultsMessage = 's25-search-results-message',\n searchResultsLoading = 's25-search-results-loading',\n searchResultsMinimumError = 's25-search-results-minimum-error',\n hiddenAccessible = 's25-hidden-accessible',\n hidden = 's25-hidden',\n placeholder = 's25-placeholder',\n scroll = 's25-scroll'\n}\n","import { Component, ComponentChild, createRef, h, RefObject } from 'preact';\nimport { Dictionary } from './dictionary';\nimport { style } from './style';\nimport { calculateVerticalVisibility, cn } from './util';\n\nconst forceImportOfH = h;\n\n// TODO if upon render loading is visible signal loadmore\n\ninterface Props {\n // TODO consistenly call search a query\n namespace: string;\n search: string;\n listboxDomId?: string;\n results: any[];\n token: string;\n active: number;\n page: number;\n loading: boolean;\n\n itemLabel: (item: any) => string;\n renderItem: (item: any) => ComponentChild;\n\n dictionary: Dictionary;\n minimumCharacters: number;\n\n showMinimumCharactersError: boolean;\n showNoSearchResultsFound: boolean;\n showLoadMoreResults: boolean;\n\n onResultClicked: (result: any, event: MouseEvent) => void;\n onMouseMove: (index: any, event: MouseEvent) => void;\n onLoadMore: () => void;\n}\n\nexport class ResultList extends Component {\n private container: RefObject;\n private lastMouseClientX?: number;\n private lastMouseClientY?: number;\n private loadMore: RefObject;\n constructor(props) {\n super(props);\n this.container = createRef();\n this.loadMore = createRef();\n }\n\n private getResultDomId(index: number) {\n return this.props.namespace + index;\n }\n\n public render(props, state, context) {\n const { dictionary, minimumCharacters, showLoadMoreResults, results } = props;\n const query = this.props.search;\n\n return (\n

\n \n {props.loading && (\n
\n {dictionary.searchResultsLoading()}\n
\n )}\n {props.showNoSearchResultsFound && (\n
\n {dictionary.noSearchResults()}\n
\n )}\n {props.showMinimumCharactersError && (\n
\n {dictionary.minimumCharactersMessage(query.length, minimumCharacters)}\n
\n )}\n {results && results.length > 0 && (\n = 0 ? this.getResultDomId(props.active) : undefined}\n >\n {results.map((result, index) => {\n const label = props.itemLabel(result);\n const render = props.renderItem(result);\n const active = props.active === index;\n const css = cn(style.item, {\n [style.active]: active\n });\n const id = this.getResultDomId(index);\n return (\n \n
{render}
\n
\n );\n })}\n \n )}\n {props.showLoadMoreResults && (\n \n {dictionary.searchResultsLoading()}\n \n )}\n \n \n );\n }\n\n private onResultClicked = (result: any) => (event: MouseEvent) => {\n this.props.onResultClicked(result, event);\n };\n\n private onMouseMove = (index: number) => (event: MouseEvent) => {\n if (this.lastMouseClientX === event.clientX && this.lastMouseClientY === event.clientY) {\n // the mouse did not move, the dropdown was scrolled instead, we do not change selected element because\n // it will be scrolled into view and mess with the scrolling of the results in the dropdown\n return;\n }\n this.lastMouseClientX = event.clientX;\n this.lastMouseClientY = event.clientY;\n\n this.props.onMouseMove(index, event);\n };\n\n private onScroll = (event: Event) => {\n if (!this.props.showLoadMoreResults) {\n return;\n }\n const more = this.loadMore.current!;\n const drop = this.container.current!;\n\n const visibility = calculateVerticalVisibility(drop, more);\n if (visibility !== 'hidden') {\n this.props.onLoadMore();\n }\n };\n\n public componentDidUpdate(prevProps: Props, prevState: Props) {\n const { active, results, showLoadMoreResults } = this.props;\n const { active: prevActive } = prevProps;\n\n if (active !== prevActive) {\n if (active >= 0 && results && results.length > 0 && active === results.length - 1 && showLoadMoreResults) {\n // last result is selected and load more is shown, make sure it is scrolled into view\n\n const drop = this.container.current!;\n const el = this.loadMore.current!;\n\n drop.scrollTop = el.offsetTop + el.offsetHeight - drop.clientHeight;\n\n // console.log(\"scrolling to see load more\");//, setting scrolltop\", drop, el, el.offsetTop - drop.clientHeight);\n } else if (active >= 0) {\n // make sure it is scrolled into view\n const id = this.getResultDomId(active);\n const el = document.getElementById(id);\n if (el != null) {\n const drop = this.container!.current!;\n const c = drop.getBoundingClientRect();\n const e = el.getBoundingClientRect();\n\n if (e.top < c.top && e.bottom <= c.bottom) {\n const delta = c.top - e.top;\n drop.scrollTop = drop.scrollTop - delta;\n }\n\n if (e.top >= c.top && e.bottom > c.bottom) {\n const delta = e.bottom - c.bottom;\n drop.scrollTop = drop.scrollTop + delta;\n }\n }\n }\n }\n }\n}\n","import { createRef, Fragment, h, RefObject } from 'preact';\nimport {\n AbstractSelect,\n DataItem,\n DEFAULT_PROPS as ABSTRACT_DEFAULT_PROPS,\n Props as SearchControllerProps,\n State as AbstractSelectState\n} from './abstract-select';\nimport * as announce from './announce';\nimport { Dropdown } from './dropdown';\nimport { Remove, Toggle } from './icons';\nimport { ResultList } from './result-list';\nimport { style } from './style';\nimport { cn, extend, Key, scope } from './util';\n\nconst forceImportOfH = h;\n\nexport interface Props extends SearchControllerProps {\n valuesLabel: string;\n comboboxLabel: string;\n values: DataItem[];\n onChange: (values: DataItem[]) => void;\n}\n\ninterface ValueListState {\n active: number;\n selected: boolean[];\n}\n\ninterface State extends AbstractSelectState {\n values: ValueListState;\n}\n\nconst DEFAULT_PROPS = extend({}, ABSTRACT_DEFAULT_PROPS, { values: [] });\n\nexport class MultiSelect extends AbstractSelect {\n private containerRef: RefObject;\n private dropdownRef: RefObject;\n private bodyRef: RefObject;\n private valuesRef: RefObject;\n private searchRef: RefObject;\n\n public static defaultProps = DEFAULT_PROPS;\n\n constructor(props) {\n super(props);\n const { values } = props;\n\n this.valuesRef = createRef();\n this.searchRef = createRef();\n this.bodyRef = createRef();\n this.containerRef = createRef();\n this.dropdownRef = createRef();\n\n this.state = extend(this.state, {\n values: {\n active: -1,\n selected: values.map(v => false)\n }\n });\n }\n\n public componentWillMount() {\n announce.initialize();\n }\n\n public render(props, state) {\n const { values, tabIndex, minimumCharacters, valuesLabel, comboboxLabel, placeholder } = props;\n const {\n open,\n loading,\n focused,\n search,\n values: { active, selected },\n results\n } = state;\n const dictionary = this.dictionary;\n\n const showPlaceholder = !values || values.length === 0;\n\n let classes = cn(style.control, style.multi, { [style.open]: open }, { [style.focused]: focused });\n if (props.containerClass && props.containerClass.length > 0) {\n classes += ' ' + props.containerClass;\n }\n\n const instructionsDomId = this.namespace + '-instructions';\n const resultsDomId = this.namespace + '-results';\n const resultsNamespace = this.namespace + '-res-';\n return (\n \n \n
\n
\n {dictionary.multiSelectInstructions()}\n
\n {scope(() => {\n const activeDescendant = active >= 0 ? this.namespace + '-vl-' + active : undefined;\n if (values && values.length > 0) {\n return (\n \n {values.map((value: DataItem, index: number) => {\n const isSelected = selected[index];\n const isActive = active === index;\n const css = cn(style.item, {\n [style.selected]: isSelected,\n [style.active]: isActive\n });\n const id = this.namespace + '-vl-' + index;\n const label = this.getItemLabel(value);\n const render = this.renderValue(value);\n return (\n e.stopPropagation()}\n onClick={this.onValueClick(index)}\n >\n
{render}
\n
\n );\n })}\n \n );\n } else {\n return null;\n }\n })}\n {scope(() => {\n const disabled = !selected.find(x => x === true);\n const className = cn(style.remove, {\n [style.offscreen]: values.length < 1\n });\n return (\n \n \n \n \n \n );\n })}\n \n = 0 ? resultsNamespace + results.active : undefined}\n aria-busy={loading}\n onInput={this.onSearchInput}\n onKeyDown={this.onSearchKeyDown}\n onFocus={this.onSearchFocus}\n placeholder={showPlaceholder ? placeholder : undefined}\n />\n \n \n \n \n \n {open && (\n \n \n \n )}\n
\n );\n }\n\n public componentDidMount() {\n const css = this.props.containerStyle;\n if (css && css.length > 0) {\n this.containerRef.current!.setAttribute('style', css);\n }\n }\n\n private onLoadMoreResults = () => {\n this.loadMore();\n };\n\n private focusSearchAndStopPropagation = (event: Event) => {\n this.searchRef.current!.focus();\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onToggleClick = (event: MouseEvent) => {\n const { open } = this.state;\n if (open) {\n this.close();\n this.searchRef.current!.focus();\n } else {\n this.search(this.state.search, this.props.values, { open: true });\n this.searchRef.current!.focus();\n }\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onBodyClick = (event: MouseEvent) => {\n if (event.target === this.bodyRef.current) {\n // if the element itself was clicked, (white space inside the body)\n this.searchRef.current!.focus();\n }\n };\n\n public onFocusIn = (event: FocusEvent) => {\n this.updateState({ focused: true });\n };\n\n public onFocusOut = (event: FocusEvent) => {\n const receiver = event.relatedTarget as Node;\n const container = this.containerRef.current!;\n const dropdown = this.dropdownRef.current!;\n const focused =\n container.contains(receiver) || (dropdown && (dropdown === receiver || dropdown.contains(receiver)));\n\n this.updateState({\n focused\n });\n if (!focused) {\n this.closeIfOpen();\n }\n };\n\n public onSearchFocus = (event: FocusEvent) => {\n const { openOnFocus } = this.props;\n const { open } = this.state;\n if (!open && openOnFocus) {\n this.search(this.searchRef.current!.value, this.props.values, { open: true });\n }\n };\n\n public onResultMouseMove = (index: number, event: MouseEvent) => {\n this.selectSearchResult(index);\n };\n\n public selectActiveResult = () => {\n this.selectResult(this.getSelectedSearchResult());\n };\n\n public selectResult = (result: any) => {\n const { values, onChange } = this.props;\n const next = values.slice();\n next.push(result);\n\n this.close();\n\n const label = this.getItemLabel(result);\n announce.politely(this.dictionary.valueAdded(label));\n\n onChange(next);\n };\n\n public toggleValue = (index: number) => {\n const {\n values: { selected }\n } = this.state;\n const next = selected.slice();\n next[index] = !next[index];\n this.updateState({ values: { selected: next, active: index } });\n };\n\n public onRemoveSelectedFocus = (event: FocusEvent) => {\n this.closeIfOpen();\n };\n\n public onRemoveSelectedClick = (event: Event) => {\n const {\n values: { selected }\n } = this.state;\n const { values, onChange } = this.props;\n const next = values.slice().filter((value, index) => !selected[index]);\n this.updateState({\n values: {\n selected: next.map(v => false)\n }\n });\n onChange(next);\n\n this.searchRef.current!.focus();\n };\n\n public onSearchInput = (event: Event) => {\n const value = (event.target as HTMLInputElement).value;\n this.search(value, this.props.values, { open: true });\n };\n\n public onSearchKeyDown = (event: KeyboardEvent) => {\n const { open } = this.state;\n\n if (open) {\n if (this.handleResultNavigationKeyDown(event)) {\n return;\n }\n if (this.hasSearchResults) {\n switch (event.key) {\n case Key.Enter:\n this.selectActiveResult();\n event.preventDefault();\n break;\n case Key.Escape:\n if (open) {\n this.close();\n }\n event.preventDefault();\n break;\n }\n }\n } else {\n switch (event.key) {\n case Key.ArrowDown:\n case Key.Down:\n case Key.Enter:\n this.search('', this.props.values, { open: true });\n break;\n }\n }\n };\n\n public onValueClick = (index: number) => (event: MouseEvent) => {\n this.toggleValue(index);\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onValuesFocus = (event: Event) => {\n const {\n values: { active, selected }\n } = this.state;\n const { values } = this.props;\n\n // highlight the first selected value\n if (active < 0 && values.length > 0) {\n let index = 0;\n for (let i = 0; i < selected.length; i++) {\n if (selected[i]) {\n index = i;\n break;\n }\n }\n this.updateState({ values: { active: index } });\n }\n this.closeIfOpen();\n };\n\n public closeIfOpen() {\n if (this.state.open) {\n this.close();\n }\n }\n\n public close = () => {\n this.updateState({\n open: false,\n results: { results: undefined },\n search: ''\n });\n };\n\n public onValuesBlur = (event: Event) => {\n this.updateState({ values: { active: -1 } });\n };\n\n public onValuesKeyDown = (event: KeyboardEvent) => {\n const active = this.state.values.active;\n const { values } = this.props;\n\n switch (event.key) {\n case Key.ArrowLeft:\n case Key.ArrowUp:\n case Key.Up:\n case Key.Left: {\n if (active > 0) {\n this.updateState({ values: { active: active - 1 } });\n }\n event.preventDefault();\n break;\n }\n case Key.ArrowRight:\n case Key.Right:\n case Key.ArrowDown:\n case Key.Down: {\n if (active < values.length - 1) {\n this.updateState({ values: { active: active + 1 } });\n }\n event.preventDefault();\n break;\n }\n case Key.PageDown: {\n // TODO\n event.preventDefault();\n break;\n }\n case Key.PageUp: {\n // TODO\n event.preventDefault();\n break;\n }\n case Key.Home: {\n this.updateState({ values: { active: 0 } });\n event.preventDefault();\n break;\n }\n case Key.End: {\n this.updateState({ values: { active: values.length - 1 } });\n event.preventDefault();\n break;\n }\n case Key.Space:\n case Key.Spacebar: {\n this.toggleValue(active);\n event.preventDefault();\n break;\n }\n }\n };\n\n public onDropdownClick = (event: MouseEvent) => {\n // result clicks do not make it this far because they do not propagate\n // so this click is on something other than result\n event.preventDefault();\n event.stopPropagation();\n this.searchRef.current!.focus();\n };\n\n public onResultClicked = (result: any, event: MouseEvent) => {\n this.selectResult(result);\n this.searchRef.current!.focus();\n event.preventDefault();\n event.stopPropagation();\n };\n}\n","import { createRef, Fragment, h, RefObject } from 'preact';\nimport {\n AbstractSelect,\n DEFAULT_PROPS as ABSTRACT_DEFAULT_PROPS,\n Props as AbstractSelectProps,\n State as AbstractSelectState\n} from './abstract-select';\nimport * as announce from './announce';\nimport { Dropdown } from './dropdown';\nimport { Remove, Toggle } from './icons';\nimport { ResultList } from './result-list';\nimport { style } from './style';\nimport { cn, DeepPartial, extend, Key, scope } from './util';\n\nconst forceImportOfH = h;\n\nexport interface Props extends AbstractSelectProps {\n value: any;\n label: string;\n comboboxLabel: string;\n onChange: (value: any) => void;\n allowClear?: boolean;\n placeholder?: string;\n}\n\ninterface State extends AbstractSelectState {\n value: any;\n}\n\nconst DEFAULT_PROPS = extend({}, ABSTRACT_DEFAULT_PROPS, { allowClear: false });\n\nexport class SingleSelect extends AbstractSelect {\n private containerRef: RefObject;\n private dropdownRef: RefObject;\n private bodyRef: RefObject;\n private searchRef: RefObject;\n private valueRef: RefObject;\n\n public static defaultProps = DEFAULT_PROPS;\n\n constructor(props) {\n super(props);\n\n this.searchRef = createRef();\n this.bodyRef = createRef();\n this.containerRef = createRef();\n this.dropdownRef = createRef();\n this.valueRef = createRef();\n\n this.state = extend(this.state, { value: this.props.value });\n }\n\n public componentWillMount() {\n announce.initialize();\n }\n\n public render(props, state) {\n const { minimumCharacters, tabIndex, label, allowClear, placeholder } = props;\n const { value, open, loading, focused, search, results } = state;\n\n let classes = cn(style.control, style.single, { [style.open]: open }, { [style.focused]: focused });\n if (props.containerClass && props.containerClass.length > 0) {\n classes += ' ' + props.containerClass;\n }\n const resultsDomId = this.namespace + '-results';\n const optionDomId = this.namespace + '-val';\n const resultsNamespace = this.namespace + '-res-';\n const dictionary = this.dictionary;\n const showPlaceholder = !value && placeholder && placeholder.length > 0;\n const placeholderDomId = this.namespace + '-placeholder';\n return (\n \n \n
\n
\n )}\n {showPlaceholder && (\n
\n {placeholder}\n
\n )}\n \n {scope(() => {\n const disabled = !value;\n const clazz = cn(style.remove, { [style.offscreen]: !allowClear });\n return (\n \n \n \n \n \n );\n })}\n
\n \n
\n \n \n {open && (\n \n
\n = 0 ? resultsNamespace + results.active : undefined\n }\n aria-busy={loading}\n onInput={this.onSearchInput}\n onKeyDown={this.onSearchKeyDown}\n onFocus={this.onSearchFocus}\n />\n \n
\n \n )}\n
\n );\n }\n\n public componentDidMount() {\n const css = this.props.containerStyle;\n if (css && css.length > 0) {\n this.containerRef.current!.setAttribute('style', css);\n }\n }\n\n private onLoadMoreResults = () => {\n this.loadMore();\n };\n\n public onFocusIn = (event: FocusEvent) => {\n this.updateState({ focused: true });\n\n const { openOnFocus } = this.props;\n const { open } = this.state;\n if (!open && openOnFocus && this.searchRef.current !== document.activeElement) {\n this.open();\n }\n };\n\n public onFocusOut = (event: FocusEvent) => {\n const receiver = event.relatedTarget as Node;\n const container = this.containerRef.current;\n const dropdown = this.dropdownRef.current;\n const search = this.searchRef.current;\n\n const focused =\n container.contains(receiver) ||\n (dropdown && (dropdown === receiver || dropdown.contains(receiver))) ||\n receiver === search;\n\n if (this.state.focused !== focused) {\n this.updateState({\n focused\n });\n }\n if (!focused) {\n this.closeIfOpen();\n }\n };\n\n public closeIfOpen() {\n if (this.state.open) {\n this.close();\n }\n }\n\n public close = (state?: DeepPartial) => {\n const control = this;\n control.valueRef.current!.focus();\n this.updateState([\n state,\n {\n open: false,\n results: { results: null },\n search: ''\n }\n ]);\n };\n\n private getValueAsArray() {\n return this.state.value ? [this.state.value] : [];\n }\n\n private onContainerMouseDown = (event: MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n if (this.state.open) {\n this.close();\n } else {\n this.open();\n }\n };\n\n private open(query: string = '') {\n this.search(query, this.getValueAsArray(), { open: true }, () => {\n this.searchRef.current.focus();\n });\n }\n\n private onSearchFocus = (event: FocusEvent) => {\n this.updateState({ focused: true });\n };\n\n private onSearchInput = (event: Event) => {\n const value = (event.target as HTMLInputElement).value;\n this.search(value, this.getValueAsArray());\n };\n\n private onClearFocus = (event: FocusEvent) => {\n this.closeIfOpen();\n };\n\n private onClearClick = (event: Event) => {\n this.selectResult(undefined);\n event.preventDefault();\n event.stopPropagation();\n };\n\n private onClearMouseDown = (event: Event) => {\n event.stopPropagation();\n event.preventDefault();\n };\n\n public onSearchKeyDown = (event: KeyboardEvent) => {\n if (this.handleResultNavigationKeyDown(event)) {\n return;\n }\n\n const { open } = this.state;\n\n if (open && this.hasSearchResults) {\n switch (event.key) {\n case Key.Enter:\n this.selectActiveResult();\n event.preventDefault();\n event.stopPropagation();\n break;\n case Key.Escape:\n this.close();\n event.preventDefault();\n event.stopPropagation();\n break;\n case Key.Tab:\n // TODO select on tab?\n this.close();\n event.preventDefault();\n event.stopPropagation();\n }\n }\n };\n\n public selectActiveResult = () => {\n const { active } = this.state.results;\n if (active >= 0) {\n this.selectResult(this.getSelectedSearchResult());\n }\n };\n\n public selectResult = (result: any) => {\n const { onChange } = this.props;\n\n this.close({ value: result });\n\n // TODO announce?\n // const label = this.getItemLabel(result);\n\n onChange(result);\n };\n\n private onValueKeyDown = (event: KeyboardEvent) => {\n switch (event.key) {\n case Key.Space:\n case Key.ArrowDown:\n case Key.Down:\n this.open();\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (event.key.length === 1) {\n // focus on search which will put the printable character into the field\n this.open();\n }\n };\n\n private onDropdownMouseDown = (event: MouseEvent) => {\n this.searchRef.current.focus();\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onResultMouseMove = (index: number, event: MouseEvent) => {\n this.selectSearchResult(index);\n };\n\n public onResultClicked = (result: any, event: MouseEvent) => {\n this.selectResult(result);\n event.preventDefault();\n event.stopPropagation();\n };\n}\n","export class Store {\n private static stores = new WeakMap();\n\n private store = new Map();\n\n public get(key: string): any {\n return this.store.get(key);\n }\n public set(key: string, value: any) {\n this.store.set(key, value);\n }\n\n public static getStore(key: any): Store {\n let store = Store.stores.get(key);\n if (!store) {\n store = new Store();\n Store.stores.set(key, store);\n }\n return store;\n }\n\n public static hasStore(key: any) {\n return Store.stores.has(key);\n }\n\n public static removeStore(key: any) {\n Store.stores.delete(key);\n }\n}\n","/** jsx:pragma h */\nimport { Component, h, render } from 'preact';\nimport { DataItem, DataItemRenderer, QueryFunction } from '../../control/src/abstract-select';\nimport { Dictionary } from '../../control/src/dictionary';\nimport { MultiSelect } from '../../control/src/multi-select';\nimport '../../control/src/select25.scss';\nimport { SingleSelect } from '../../control/src/single-select';\nimport { extend } from '../../control/src/util';\nimport { Ajax, createQueryFromAjax } from './ajax';\nimport { createQueryFromData, DataFunction } from './data';\nimport { Store } from './store';\n\nconst forceImportOfH = h;\n\nenum StoreKeys {\n targetElement = 'te'\n}\n\ninterface BaseSelectOptions {\n containerStyle?: string;\n containerClass?: string;\n placeholder?: string;\n tabIndex?: number;\n valueContent?: DataItemRenderer;\n resultContent?: DataItemRenderer;\n query?: QueryFunction;\n data?: DataFunction;\n ajax?: Ajax;\n quiet?: number;\n minimumCharacters?: number;\n openOnFocus?: boolean;\n dictionary?: string | Dictionary;\n}\n\ninterface MultiSelectOptions extends BaseSelectOptions {\n hiddenValue?: (values: DataItem[], options: MultiSelectOptions) => string;\n valuesLabel?: string;\n comboboxLabel?: string;\n allowDuplicates: boolean;\n values: DataItem[];\n}\n\ninterface SingleSelectOptions extends BaseSelectOptions {\n hiddenValue?: (value: DataItem, options: SingleSelectOptions) => string;\n label?: string;\n value: DataItem;\n allowClear?: boolean;\n}\n\nconst BASE_DEFAULT_OPTIONS = {\n dictionary: 'en_us',\n minimumCharacters: 0,\n openOnFocus: false\n};\n\nconst DEFAULT_MULTI_SELECT_OPTIONS = extend({}, BASE_DEFAULT_OPTIONS, {\n hiddenValue: (values: DataItem[], options: MultiSelectOptions) => {\n if (values && values.length > 0) {\n return values.map(item => item.id).join(',');\n } else {\n return '';\n }\n }\n});\n\nconst DEFAULT_SINGLE_SELECT_OPTIONS = extend({}, BASE_DEFAULT_OPTIONS, {\n allowClear: false,\n hiddenValue: (value: DataItem, options: SingleSelectOptions) => {\n if (value) {\n return value.id;\n } else {\n return '';\n }\n }\n});\n\nfunction triggerOnChange(element: HTMLElement, data: any) {\n const event = document.createEvent('HTMLEvents');\n event.initEvent('change', false, true);\n event[data] = data;\n element.dispatchEvent(event);\n}\n\nclass MultiSelectWrapper extends Component<\n {\n element: HTMLInputElement;\n options: MultiSelectOptions;\n },\n { values?: DataItem[] }\n> {\n constructor(props) {\n super(props);\n this.state = { values: props.options.values || [] };\n }\n\n public componentDidUpdate() {\n this.setHiddenValue(this.state.values);\n }\n\n public componentDidMount() {\n this.setHiddenValue(this.state.values);\n }\n\n public render(props, state, context) {\n const opts = this.props.options;\n return (\n \n );\n }\n\n public onChange = (values: any[]) => {\n this.setState({ values });\n this.setHiddenValue(values);\n triggerOnChange(this.props.element, values);\n };\n\n private setHiddenValue(values: any) {\n const { element, options } = this.props;\n element.value = options.hiddenValue(values, options);\n }\n}\n\nclass SingleSelectWrapper extends Component<\n {\n options: SingleSelectOptions;\n element: HTMLInputElement;\n },\n { value?: DataItem }\n> {\n constructor(props) {\n super(props);\n this.state = { value: props.options.value };\n }\n\n public componentDidMount() {\n this.setHiddenValue(this.state.value);\n }\n\n public componentDidUpdate() {\n this.setHiddenValue(this.state.value);\n }\n\n public render(props, state, context) {\n const opts = this.props.options;\n return (\n \n );\n }\n\n public onChange = (value: DataItem) => {\n this.setState({ value });\n this.setHiddenValue(value);\n triggerOnChange(this.props.element, value);\n };\n\n private setHiddenValue(value: DataItem) {\n const { element, options } = this.props;\n element.value = options.hiddenValue(value, options);\n }\n}\n\nfunction createSingleSelect(element: HTMLInputElement, options: SingleSelectOptions) {\n options = extend({}, DEFAULT_SINGLE_SELECT_OPTIONS, options);\n fillBaseOptions(element, options);\n\n const store = Store.getStore(element);\n\n // create placeholder element into which the control will be rendered\n const parentElement = element.parentElement;\n const targetElement = document.createElement('div');\n parentElement.insertBefore(targetElement, element);\n store.set(StoreKeys.targetElement, targetElement);\n\n render(, parentElement, targetElement);\n}\n\nfunction createMultiSelect(element: HTMLInputElement, options: SingleSelectOptions) {\n options = extend({}, DEFAULT_MULTI_SELECT_OPTIONS, options);\n fillBaseOptions(element, options);\n\n const store = Store.getStore(element);\n\n // create placeholder element into which the control will be rendered\n const parentElement = element.parentElement;\n const targetElement = document.createElement('div');\n parentElement.insertBefore(targetElement, element);\n store.set(StoreKeys.targetElement, targetElement);\n\n render(, parentElement, targetElement);\n}\n\nfunction fillBaseOptions(element: HTMLInputElement, options: BaseSelectOptions) {\n if (!options.query) {\n if (options.ajax) {\n options.query = createQueryFromAjax(options.ajax);\n } else if (options.data) {\n options.query = createQueryFromData(options.data);\n }\n }\n\n if (!options.tabIndex && element.tabIndex) {\n options.tabIndex = element.tabIndex;\n }\n\n if (element.getAttribute('data-s25-container-style')) {\n let style = options.containerStyle || '';\n if (style.length > 0) {\n style += ';';\n }\n style += element.getAttribute('data-s25-container-style');\n options.containerStyle = style;\n }\n\n if (element.getAttribute('data-s25-container-class')) {\n let clazz = options.containerClass || '';\n if (clazz.length > 0) {\n clazz += ' ';\n }\n clazz += element.getAttribute('data-s25-container-class');\n options.containerClass = clazz;\n }\n}\n\nfunction destroy(element: HTMLElement) {\n if (!Store.hasStore(element)) {\n return;\n }\n const store = Store.getStore(element);\n const targetElement = store.get(StoreKeys.targetElement);\n const parentElement = element.parentElement;\n render(null, parentElement, targetElement);\n parentElement.removeChild(targetElement);\n Store.removeStore(element);\n}\n\nconst select25 = {\n createMultiSelect,\n createSingleSelect,\n destroy\n};\n\nexport { select25 };\n\ndeclare global {\n interface Window {\n select25: typeof select25;\n }\n}\n\nwindow.select25 = select25;\n","import { QueryFunction, QueryResult } from '../../control/src/abstract-select';\nimport { extend } from '../../control/src/util';\n\nexport interface Ajax {\n url: string;\n params: (term: string, page: number) => object;\n process: (data: string) => QueryResult;\n}\n\nexport function createQueryFromAjax(ajax: Ajax): QueryFunction {\n ajax = extend({}, ajax, {\n params(term: string, page: number) {\n return { term, page };\n },\n process(data: string) {\n const json = JSON.parse(data);\n return {\n more: json.more,\n values: json.values\n };\n }\n });\n\n return (term: string, page: number, token: string) => {\n return new Promise((resolve, reject) => {\n let url = ajax.url;\n const params = ajax.params(term, page);\n if (params) {\n let separator = url.indexOf('?') >= 0 ? '&' : '?';\n Object.entries(params).forEach(([key, value]) => {\n url += separator;\n separator = '&';\n url += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n });\n }\n\n const request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.onload = () => {\n if (request.status >= 200 && request.status < 400) {\n const data = ajax.process(request.responseText);\n resolve({ values: data.values, more: data.more, token });\n } else {\n reject();\n }\n };\n request.onerror = reject;\n request.send();\n });\n };\n}\n","import { QueryFunction, QueryResult } from '../../control/src/abstract-select';\n\nexport interface DataParam {\n term: string;\n page: number;\n selected: any[];\n}\n\nexport interface DataResult {\n values: any[];\n more: boolean;\n}\n\nexport type DataFunction = (param: DataParam) => QueryResult;\n\nexport function createQueryFromData(callback: DataFunction): QueryFunction {\n return (term: string, page: number, token: string) => {\n return new Promise((resolve, reject) => {\n const data = callback({ term, page, selected: [] });\n resolve({ values: data.values, more: data.more, token });\n });\n };\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","l","u","o","c","parentNode","removeChild","a","r","children","defaultProps","key","ref","h","type","props","__k","__p","__b","__e","__c","vnode","context","__d","debounceRendering","k","sort","__v","forceUpdate","m","w","x","N","appendChild","nextSibling","insertBefore","O","A","isArray","C","style","setProperty","replace","test","toLowerCase","slice","addEventListener","removeEventListener","options","selected","removeAttributeNS","setAttributeNS","removeAttribute","setAttribute","event","contextType","__E","render","T","sub","state","__n","__h","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","__r","__P","getChildContext","getSnapshotBeforeUpdate","base","componentDidUpdate","nodeType","localName","document","createTextNode","createElementNS","createElement","data","childNodes","dangerouslySetInnerHTML","__html","innerHTML","multiple","keys","j","diffed","z","$","current","unmount","componentWillUnmount","getDerivedStateFromError","setState","componentDidCatch","D","ownerSVGElement","initialize","getElementById","live","assertive","polite","politely","message","container","node","collection","firstChild","add","indexOf","bind","setTimeout","dictionaries","Map","getDictionary","dict","fallback","get","instance","extend","_i","params","set","noSearchResults","searchResultsLoading","removeButtonTitle","clearButtonTitle","valueAdded","itemLabel","minimumCharactersMessage","len","min","delta","multiSelectInstructions","expandButtonTitle","Key","merge","target","sources","source","shift","undefined","isMergebleObject","forEach","item","isObject","cn","values","classes","values_1","_a","join","counter","uuid","scope","delegate","MarkupRenderer","DEFAULT_PROPS","allowDuplicates","minimumCharacters","quiet","tabIndex","tslib_1.__extends","Component","AbstractSelect","dictionary","update","callback","loading","query","page","queryFunc","control","token","nextPage","updateState","results","concat","showLoadMoreResults","more","announce.politely","ArrowUp","Up","selectPreviousSearchResult","preventDefault","ArrowDown","Down","selectNextSearchResult","active","index","_super","_this","id","text","renderItem","rendererName","renderer","markup","getItemLabel","selectedValues","start","minimumCharactersReached","showMinimumCharactersError","showNoSearchResultsFound","search","execute","ids_1","Set","getItemId","filter","has","searchTimeout","window","clearTimeout","namespace","focused","open","ContextProvider","Portal","Dropdown","class","className","onClick","onMouseDown","onFocusOut","dropdownRef","scrollParents","el","elementPosition","getComputedStyle","position","parents","parent","parentElement","css","overflow","overflowX","overflowY","ownerDocument","defaultView","getScrollParents","controlRef","throttledPosition","createPortal","Fragment","rect","getBoundingClientRect","top","height","pageYOffset","left","pageXOffset","width","delay","timeout","throttle","Toggle","viewBox","focusable","displayName","Remove","ResultList","onScroll","searchResults","searchResultsMessage","searchResultsMinimumError","role","listboxDomId","getResultDomId","map","onResultClicked","onMouseMove","content","loadMore","prevProps","drop","scrollTop","offsetTop","offsetHeight","clientHeight","bottom","lastMouseClientX","clientX","lastMouseClientY","clientY","element","calculateVerticalVisibility","onLoadMore","ABSTRACT_DEFAULT_PROPS","MultiSelect","announce.initialize","valuesLabel","comboboxLabel","placeholder","_c","showPlaceholder","multi","containerClass","instructionsDomId","resultsDomId","resultsNamespace","containerRef","onFocusCapture","onFocusIn","onBlurCapture","focusSearchAndStopPropagation","bodyRef","onBodyClick","offscreen","display","activeDescendant","valuesRef","multiValues","onFocus","onValuesFocus","onBlur","onValuesBlur","onKeyDown","onValuesKeyDown","isSelected","isActive","renderValue","stopPropagation","onValueClick","disabled","find","remove","onRemoveSelectedClick","onRemoveSelectedFocus","title","htmlFor","searchRef","onInput","onSearchInput","onSearchKeyDown","onSearchFocus","toggle","onToggleClick","dropdown","onDropdownClick","renderResult","onResultMouseMove","onLoadMoreResults","containerStyle","close","focus","receiver","relatedTarget","contains","closeIfOpen","openOnFocus","selectSearchResult","selectResult","getSelectedSearchResult","onChange","handleResultNavigationKeyDown","hasSearchResults","Enter","selectActiveResult","Escape","toggleValue","ArrowLeft","Left","ArrowRight","Right","PageDown","PageUp","Home","End","Space","Spacebar","allowClear","SingleSelect","single","optionDomId","placeholderDomId","onContainerMouseDown","valueRef","onValueKeyDown","onClearClick","onClearFocus","onClearMouseDown","onDropdownMouseDown","getValueAsArray","activeElement","Tab","StoreKeys","Store","store","stores","delete","WeakMap","BASE_DEFAULT_OPTIONS","DEFAULT_MULTI_SELECT_OPTIONS","hiddenValue","DEFAULT_SINGLE_SELECT_OPTIONS","triggerOnChange","createEvent","initEvent","dispatchEvent","MultiSelectWrapper","setHiddenValue","opts","valueContent","resultContent","SingleSelectWrapper","fillBaseOptions","ajax","term","process","json","JSON","parse","url","separator_1","entries","encodeURIComponent","request","XMLHttpRequest","onload","status","responseText","onerror","send","createQueryFromAjax","createQueryFromData","getAttribute","clazz","select25","createMultiSelect","getStore","targetElement","createSingleSelect","destroy","hasStore","removeStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;qMAgBA,IAAIA,EAAgB,SA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,SAAWA"} \ No newline at end of file +{"version":3,"file":"select25.js","sources":["../node_modules/tslib/tslib.es6.js","../node_modules/preact/dist/preact.module.js","../control/src/announce.ts","../control/src/dictionary.ts","../control/src/util.ts","../control/src/abstract-select.tsx","../control/src/dropdown.tsx","../control/src/icons.tsx","../control/src/style.ts","../control/src/result-list.tsx","../control/src/multi-select.tsx","../control/src/single-select.tsx","../bridge/src/store.ts","../bridge/src/select25.tsx","../bridge/src/ajax.ts","../bridge/src/data.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var n,l,u,t,i,r,f={},e=[],o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i;function c(n,l){for(var u in l)n[u]=l[u];return n}function s(n){var l=n.parentNode;l&&l.removeChild(n)}function a(n,l,u){var t,i,r,f,e=arguments;if(l=c({},l),arguments.length>3)for(u=[u],t=3;t2&&(l.children=e.slice.call(arguments,2)),h(n.type,l,l.key||n.key,l.ref||n.ref)}function L(n){var l={},u={__c:\"__cC\"+r++,__p:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,i=this;return this.getChildContext||(t=[],this.getChildContext=function(){return l[u.__c]=i,l},this.shouldComponentUpdate=function(n){t.some(function(l){l.__P&&(l.context=n.value,b(l))})},this.sub=function(n){t.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t.splice(t.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Consumer.contextType=u,u}n={},d.prototype.setState=function(n,l){var u=this.__s!==this.state&&this.__s||(this.__s=c({},this.state));(\"function\"!=typeof n||(n=n(u,this.props)))&&c(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b(this))},d.prototype.forceUpdate=function(n){var l,u,t,i=this.__v,r=this.__v.__e,f=this.__P;f&&(l=!1!==n,u=[],t=N(f,i,c({},i),this.__n,void 0!==f.ownerSVGElement,null,u,l,null==r?m(i):r),$(u,i),t!=r&&w(i)),n&&n()},d.prototype.render=p,l=[],u=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,t=/[A-Z]/g,i=\"http://www.w3.org/1999/xlink\",r=0;export{D as render,H as hydrate,a as createElement,a as h,p as Fragment,v as createRef,d as Component,I as cloneElement,L as createContext,_ as toChildArray,O as _unmount,n as options};\n//# sourceMappingURL=preact.module.js.map\n","export function initialize() {\n if (document.getElementById('s25-live')) {\n return;\n }\n\n const live = document.createElement('div');\n live.setAttribute('id', 's25-live');\n live.setAttribute('class', 's25-offscreen s25-live');\n document.body.appendChild(live);\n\n const assertive = document.createElement('div');\n assertive.setAttribute('id', 's25-live-assertive');\n assertive.setAttribute('role', 'log');\n assertive.setAttribute('aria-live', 'assertive');\n assertive.setAttribute('aria-relevant', 'additions');\n live.appendChild(assertive);\n\n const polite = document.createElement('div');\n polite.setAttribute('id', 's25-live-polite');\n polite.setAttribute('role', 'log');\n polite.setAttribute('aria-live', 'polite');\n polite.setAttribute('aria-relevant', 'additions');\n live.appendChild(polite);\n}\n\nexport function assertively(message: string) {\n add(message, document.getElementById('s25-live-assertive')!);\n}\n\nexport function politely(message: string) {\n add(message, document.getElementById('s25-live-polite')!);\n}\n\nfunction add(message: string, container: HTMLElement) {\n const node = document.createElement('div');\n node.appendChild(document.createTextNode(message));\n container.appendChild(node);\n\n // clean up old nodes\n\n let collection = document.getElementById('s25-live-assertive')!;\n while (collection.firstChild && collection.firstChild !== node) {\n collection.removeChild(collection.firstChild);\n }\n collection = document.getElementById('s25-live-polite')!;\n while (collection.firstChild && collection.firstChild !== node) {\n collection.removeChild(collection.firstChild);\n }\n}\n","// TODO make it so keys can be strings in addition to functions\nexport interface Dictionary {\n valueAdded(itemLabel: string): string;\n noSearchResults(): string;\n searchResultsLoading(): string;\n removeButtonTitle(): string;\n clearButtonTitle(): string;\n minimumCharactersMessage(len: number, min: number): string;\n multiSelectInstructions(): string;\n expandButtonTitle(): string;\n}\n\nconst EN_US: Dictionary = {\n noSearchResults() {\n return 'No results available';\n },\n\n searchResultsLoading() {\n return 'Loading...';\n },\n\n removeButtonTitle() {\n return 'Remove selected values';\n },\n\n clearButtonTitle() {\n return 'Clear selection';\n },\n\n valueAdded(itemLabel: string) {\n return itemLabel + ' added';\n },\n\n minimumCharactersMessage(len: number, min: number) {\n const delta = min - len;\n return 'Please enter ' + delta + ' more character' + (delta > 1 ? 's' : '');\n },\n\n multiSelectInstructions(): string {\n return \"Items can be removed from this list box by selecting them and activating 'Remove selected values' button. Items can be added by selecting them in the adjacent combobox.\";\n },\n\n expandButtonTitle(): string {\n return 'Expand';\n }\n};\n\nconst dictionaries = new Map();\ndictionaries.set('en_us', EN_US);\n\nexport function getDictionary(dict?: string | undefined): Dictionary {\n const fallback: Dictionary = dictionaries.get('en_us') as Dictionary;\n\n if (!dict) {\n return fallback;\n }\n\n if (typeof dict === 'string') {\n const instance = dictionaries.get(dict);\n return instance ? instance : fallback;\n } else {\n return dict;\n }\n}\n","import { ComponentChild } from 'preact';\n\nexport function extend(...params: object[]) {\n for (let i = 1; i < arguments.length; i++) {\n for (const key in arguments[i]) {\n if (arguments[i].hasOwnProperty(key)) {\n if (typeof arguments[0][key] === 'object' && typeof arguments[i][key] === 'object') {\n extend(arguments[0][key], arguments[i][key]);\n } else {\n arguments[0][key] = arguments[i][key];\n }\n }\n }\n }\n return arguments[0];\n}\n\nexport type DeepPartial = {\n [P in keyof T]?: T[P] extends Array\n ? Array>\n : T[P] extends ReadonlyArray\n ? ReadonlyArray>\n : DeepPartial\n};\n\nexport const merge = (target: T, sources: Array>): T => {\n if (!sources.length) {\n return target;\n }\n const source = sources.shift();\n if (source === undefined) {\n return merge(target, sources);\n }\n\n if (isMergebleObject(target) && isMergebleObject(source)) {\n Object.keys(source).forEach((key: string) => {\n if (isMergebleObject(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n merge(target[key], [source[key]]);\n } else {\n target[key] = source[key];\n }\n });\n }\n\n return merge(target, sources);\n};\n\nconst isObject = (item: any): boolean => {\n return item !== null && typeof item === 'object';\n};\n\nconst isMergebleObject = (item): boolean => {\n return isObject(item) && !Array.isArray(item);\n};\n\nexport function cn(...values: any) {\n const classes: string[] = [];\n const hasOwnProperty = {}.hasOwnProperty;\n\n for (const value of values) {\n if (typeof value === 'string') {\n classes.push(value);\n } else if (typeof value === 'object') {\n for (const key in value as object) {\n if (hasOwnProperty.call(value, key) && value[key]) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n}\n\nexport enum Key {\n // https://www.w3.org/TR/uievents-key/#named-key-attribute-values\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n ArrowLeft = 'ArrowLeft',\n ArrowRight = 'ArrowRight',\n Space = ' ',\n Enter = 'Enter',\n Tab = 'Tab',\n Home = 'Home',\n End = 'End',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n Backspace = 'Backspace',\n Delete = 'Delete',\n Clear = 'Clear',\n Escape = 'Escape',\n // IE 11\n Down = 'Down',\n Up = 'Up',\n Spacebar = 'Spacebar',\n Left = 'Left',\n Right = 'Right'\n}\n\nexport const uuid = (() => {\n let counter = 0;\n return () => 's25-' + counter++;\n})();\n\nexport function throttle(delay: number, callback: () => void): () => void {\n let timeout: number | undefined;\n return () => {\n if (timeout !== undefined) {\n window.clearTimeout(timeout);\n timeout = undefined;\n } else {\n timeout = window.setTimeout(() => {\n callback();\n timeout = undefined;\n }, delay);\n }\n };\n}\n\n// @ts-ignore\nexport function debounce(quiet: number, delegate: (...args: any[]) => void, that: object) {\n const args = Array.from(arguments);\n if (quiet <= 0) {\n return () => {\n delegate.apply(that, args);\n };\n } else {\n let timeout: number | undefined;\n return () => {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n timeout = window.setTimeout(() => {\n timeout = undefined;\n delegate.apply(that, args);\n }, quiet);\n };\n }\n}\n\nexport function getScrollParents(el: HTMLElement): EventTarget[] {\n const style = window.getComputedStyle(el);\n const elementPosition = style.position;\n if (elementPosition === 'fixed') {\n return [el];\n }\n\n const parents: Array = [];\n let parent = el.parentElement;\n\n while (parent && parent.nodeType === 1) {\n const css = window.getComputedStyle(parent);\n if (/(overlay|scroll|auto)/.test(css.overflow + ' ' + css.overflowX + ' ' + css.overflowY)) {\n if (elementPosition !== 'absolute' || ['relative', 'fixed', 'absolute'].indexOf(css.position || '') >= 0) {\n parents.push(parent);\n }\n }\n parent = parent.parentElement;\n }\n\n if (el.ownerDocument) {\n parents.push(el.ownerDocument.body);\n }\n\n // iframe\n if (el.ownerDocument !== document && el.ownerDocument && el.ownerDocument.defaultView) {\n parents.push(el.ownerDocument.defaultView);\n }\n\n parents.push(window);\n return parents;\n}\n\nexport function calculateVerticalVisibility(\n container: HTMLElement,\n element: HTMLElement\n): 'hidden' | 'partial-top' | 'partial-bottom' | 'visible' {\n const c = container.getBoundingClientRect();\n const e = element.getBoundingClientRect();\n\n if (e.bottom < c.top) {\n // above the fold\n return 'hidden';\n }\n\n if (e.top > c.bottom) {\n // below the fold\n return 'hidden';\n }\n\n if (e.top < c.top && e.bottom <= c.bottom) {\n return 'partial-top';\n }\n\n if (e.top >= c.top && e.bottom > c.bottom) {\n return 'partial-bottom';\n }\n\n return 'visible';\n}\n\nexport type MouseEventListener = (event: MouseEvent) => void;\nexport type KeyboardEventListener = (event: KeyboardEvent) => void;\nexport type EventListener = (event: Event) => void;\nexport type FocusEventListener = (event: FocusEvent) => void;\n\n/** helper that makes it easier to declare a scope inside a jsx block */\nexport function scope(delegate: () => ComponentChild) {\n return delegate();\n}\n","import { Component, ComponentChild, h, h as createElement } from 'preact';\nimport * as announce from './announce';\nimport { Dictionary, getDictionary } from './dictionary';\nimport { DeepPartial, Key, merge, uuid } from './util';\nconst forceImportOfH = h;\n\ntype ToString = (item: any) => string;\n\nexport type DataItemRenderer = (string) | ((item: any, h: typeof createElement) => ComponentChild);\n\nexport type QueryFunction = (search: string, page: number, token: string) => Promise;\n\nexport interface DataItem {\n id: any;\n text: string;\n}\n\nexport interface QueryResult {\n values: DataItem[];\n more: boolean;\n token: string;\n}\n\nexport interface ResultListState {\n results: any[];\n token: string;\n active: number;\n page: number;\n\n showMinimumCharactersError: boolean;\n showNoSearchResultsFound: boolean;\n showLoadMoreResults: boolean;\n}\nexport interface State {\n search: string;\n results: ResultListState;\n loading: boolean;\n open: boolean;\n focused: boolean;\n}\n\nexport interface Props {\n containerStyle?: string;\n containerClass?: string;\n tabIndex?: number;\n valueContent?: DataItemRenderer;\n resultContent?: DataItemRenderer;\n\n query: QueryFunction;\n quiet?: number;\n allowDuplicates?: boolean;\n minimumCharacters?: number;\n openOnFocus?: boolean;\n dictionary?: string | Dictionary;\n}\n\nfunction MarkupRenderer({ markup }) {\n return
;\n}\n\nexport const DEFAULT_PROPS: Partial = {\n allowDuplicates: false,\n minimumCharacters: 0,\n quiet: 50,\n tabIndex: 0\n};\n\nexport abstract class AbstractSelect

extends Component {\n private searchTimeout: number | undefined;\n protected namespace: string;\n\n constructor(props: P) {\n super(props);\n this.searchTimeout = undefined;\n this.namespace = uuid();\n // @ts-ignore\n this.state = {\n focused: false,\n loading: false,\n open: false,\n results: {\n active: -1,\n page: 0,\n results: undefined, // TODO rename to values\n token: null,\n\n showLoadMoreResults: false,\n showMinimumCharactersError: false,\n showNoSearchResultsFound: false\n },\n search: ''\n };\n }\n\n public getItemId = (item: DataItem): string => {\n return item.id;\n };\n\n public getItemLabel = (item: DataItem): string => {\n const label = item.text;\n return item.text;\n };\n\n public renderValue = (item: DataItem): ComponentChild => {\n return this.renderItem(item, 'valueContent');\n };\n\n public renderResult = (item: DataItem): ComponentChild => {\n return this.renderItem(item, 'resultContent');\n };\n\n private renderItem = (item: DataItem, rendererName: (keyof Props) & DataItemRenderer): ComponentChild => {\n const renderer = this.props[rendererName] as DataItemRenderer;\n if (renderer) {\n if (typeof renderer === 'function') {\n const render = renderer(item, createElement);\n if (typeof render === 'string') {\n return ;\n } else {\n return render;\n }\n } else {\n return ;\n }\n } else {\n return ;\n }\n };\n\n get dictionary(): Dictionary {\n const dict = this.props.dictionary;\n if (dict) {\n if (typeof dict === 'string') {\n return getDictionary(dict);\n } else {\n return dict as Dictionary;\n }\n } else {\n return getDictionary();\n }\n }\n\n protected updateState(update: DeepPartial | Array>, callback?: () => void) {\n const state = merge(this.state, Array.isArray(update) ? update : [update]);\n this.setState(state, callback);\n }\n\n public search = (query, selectedValues, start?: DeepPartial, callback?: () => void) => {\n const dictionary = this.dictionary;\n const { minimumCharacters, allowDuplicates, quiet, query: queryFunc } = this.props;\n\n const current = this.state.results;\n\n const minimumCharactersReached = query.length >= minimumCharacters;\n const token = minimumCharactersReached ? uuid() : undefined;\n\n const control = this;\n\n this.updateState(\n // @ts-ignore\n [\n start,\n {\n loading: minimumCharactersReached,\n results: {\n active: -1,\n page: 0,\n results: undefined,\n showLoadMoreResults: false,\n showMinimumCharactersError: !minimumCharactersReached,\n showNoSearchResultsFound: false,\n token\n },\n search: query\n }\n ],\n () => {\n if (callback) {\n callback();\n }\n\n if (!minimumCharactersReached) {\n // todo - throttle this announcement?\n announce.politely(dictionary.minimumCharactersMessage(query.length, minimumCharacters!));\n return;\n }\n\n // todo - throttle this announcement?\n // announce.politely(dictionary.searchResultsLoading());\n\n const execute = async () => {\n try {\n const result = await queryFunc(query, 0, token!);\n if (result.token !== control.state.results.token) {\n // this is a stale result, ignore\n return;\n }\n\n let values = result.values || [];\n if (!allowDuplicates && values.length > 0 && selectedValues.length > 0) {\n const ids = new Set();\n selectedValues.forEach(v => ids.add(control.getItemId(v)));\n values = values.filter(v => !ids.has(control.getItemId(v)));\n }\n\n if (values.length < 1) {\n announce.politely(dictionary.noSearchResults());\n }\n\n // @ts-ignore\n control.updateState({\n loading: false,\n results: {\n active: values.length > 0 ? 0 : -1,\n page: 0,\n results: values,\n showLoadMoreResults: result.more,\n showNoSearchResultsFound: values.length < 1\n }\n });\n } catch (e) {\n // @ts-ignore\n control.updateState({ loading: false });\n }\n };\n\n if (quiet && quiet > 0) {\n if (control.searchTimeout) {\n window.clearTimeout(control.searchTimeout);\n }\n control.searchTimeout = window.setTimeout(execute, quiet);\n } else {\n execute();\n }\n }\n );\n };\n\n public loadMore() {\n const {\n loading,\n search: query,\n results: { page }\n } = this.state;\n const dict = this.dictionary;\n const { query: queryFunc } = this.props;\n const control = this;\n\n if (loading) {\n return;\n }\n\n const token = uuid();\n const nextPage = page + 1;\n\n this.updateState(\n // @ts-ignore\n {\n loading: true,\n results: {\n token\n }\n },\n async () => {\n // TODO throttle?\n // announce.politely(dict.searchResultsLoading());\n\n try {\n const result = await queryFunc(query, nextPage, token);\n\n const current = control.state.results;\n\n if (result.token !== current.token) {\n // this is a stale result, ignore\n return;\n }\n\n if (result.values && result.values.length > 0) {\n // @ts-ignore\n control.updateState({\n loading: false,\n results: {\n page: nextPage,\n results: current.results.concat(result.values),\n showLoadMoreResults: result.more\n }\n });\n } else {\n announce.politely(dict.noSearchResults());\n // @ts-ignore\n control.updateState({\n loading: false,\n results: {\n showLoadMoreResults: false\n }\n });\n }\n } catch (e) {\n // @ts-ignore\n control.updateState({ loading: false });\n }\n }\n );\n }\n\n protected handleResultNavigationKeyDown(event: KeyboardEvent): boolean {\n switch (event.key) {\n case Key.ArrowUp:\n case Key.Up:\n this.selectPreviousSearchResult();\n event.preventDefault();\n return true;\n case Key.ArrowDown:\n case Key.Down:\n this.selectNextSearchResult();\n event.preventDefault();\n return true;\n }\n return false;\n }\n\n protected selectNextSearchResult() {\n const { active, results } = this.state.results;\n if (results && active < results.length - 1) {\n // @ts-ignore\n this.updateState({ results: { active: active + 1 } });\n }\n }\n\n protected selectPreviousSearchResult() {\n const { active } = this.state.results;\n if (active > 0) {\n // @ts-ignore\n this.updateState({ results: { active: active - 1 } });\n }\n }\n\n protected getSelectedSearchResult() {\n const { results, active } = this.state.results;\n return results[active];\n }\n\n protected selectSearchResult(index: number) {\n const { active } = this.state.results;\n if (active !== index) {\n // @ts-ignore\n this.updateState({ results: { active: index } });\n }\n }\n\n protected hasSearchResults() {\n const results = this.state.results.results;\n return results && results.length > 0;\n }\n}\n","import { Component, ComponentChild, Fragment, h, RefObject, render } from 'preact';\nimport { getScrollParents, MouseEventListener, throttle } from './util';\n\nclass ContextProvider extends Component<{ context: any }> {\n public getChildContext() {\n return this.props.context;\n }\n public render() {\n return this.props.children;\n }\n}\n\nfunction Portal({ vnode, container }): null {\n // @ts-ignore\n const wrap = {vnode};\n render(wrap, container);\n return null;\n}\n\nfunction createPortal(vnode, container): ComponentChild {\n return h(Portal, { vnode, container });\n}\n\ninterface Props {\n controlRef: RefObject;\n dropdownRef: RefObject;\n class?: string;\n onClick?: MouseEventListener;\n onMouseDown?: MouseEventListener;\n onFocusOut?: EventListener;\n}\n\nexport class Dropdown extends Component {\n private container?: HTMLElement;\n private scrollParents?: EventTarget[];\n private throttledPosition;\n\n constructor(props) {\n super(props);\n this.throttledPosition = throttle(50, this.position.bind(this));\n }\n\n public componentWillMount() {\n this.container = document.createElement('div');\n if (this.props.class) {\n this.container.className = this.props.class;\n }\n\n /*\n this container needs to be able to receive focus so we can tell\n it is not leaving the control - we consider dropdown part of the control\n */\n this.container.tabIndex = -1;\n if (this.props.onClick) {\n this.container.addEventListener('click', this.props.onClick);\n }\n if (this.props.onMouseDown) {\n this.container.addEventListener('mousedown', this.props.onMouseDown);\n }\n if (this.props.onFocusOut) {\n this.container.addEventListener('focusout', this.props.onFocusOut);\n }\n document.body.appendChild(this.container);\n }\n\n public componentDidMount() {\n this.props.dropdownRef.current = this.container;\n this.scrollParents = getScrollParents(this.props.controlRef.current!);\n this.scrollParents.forEach(parent => {\n ['resize', 'scroll', 'touchmove'].forEach(event => {\n parent.addEventListener(event, this.throttledPosition);\n });\n });\n this.position();\n }\n\n public componentWillUnmount() {\n if (this.scrollParents) {\n this.scrollParents.forEach(parent => {\n ['resize', 'scroll', 'touchmove'].forEach(event => {\n parent.removeEventListener(event, this.throttledPosition);\n });\n });\n delete this.scrollParents;\n this.scrollParents = undefined;\n }\n\n this.props.dropdownRef.current = undefined;\n this.container!.parentElement!.removeChild(this.container!);\n }\n\n public componentDidUpdate() {\n this.position();\n }\n\n public render(props) {\n return createPortal({this.props.children}, this.container!);\n }\n\n private position() {\n const control = this.props.controlRef.current!;\n const rect = control.getBoundingClientRect();\n const style = `top: ${rect.top + rect.height + window.pageYOffset}px;\n left: ${rect.left + window.pageXOffset}px;\n width: ${rect.width}px;`;\n this.container!.setAttribute('style', style);\n }\n}\n","import { FunctionComponent, h } from 'preact';\n\nconst forceImportOfH = h;\n\ninterface Props {\n width: number;\n height: number;\n}\n\nexport const Toggle: FunctionComponent = ({ height, width }) => {\n const viewBox = '0 0 ' + width + ' ' + height;\n return (\n \n \n \n );\n};\nToggle.displayName = 'Toggle';\n\nexport const Remove: FunctionComponent = ({ width, height }) => {\n const viewBox = '0 0 ' + width + ' ' + height;\n return (\n \n \n \n );\n};\nRemove.displayName = 'Remove';\n","export const enum style {\n control = 's25-control',\n content = 's25-content',\n single = 's25-single',\n multi = 's25-multi',\n body = 's25-body',\n focused = 's25-focused',\n active = 's25-active',\n live = 's25-live',\n multiValues = 's25-multi-values',\n value = 's25-value',\n item = 's25-item',\n selected = 's25-selected',\n toggle = 's25-toggle',\n remove = 's25-remove',\n open = 's25-open',\n label = 's25-label',\n search = 's25-search',\n offscreen = 's25-offscreen',\n searchContainer = 's25-search-container',\n dropdown = 's25-dropdown',\n searchResults = 's25-search-results',\n options = 's25-options',\n noSearchResults = 's25-no-search-results',\n searchResultsMessage = 's25-search-results-message',\n searchResultsLoading = 's25-search-results-loading',\n searchResultsMinimumError = 's25-search-results-minimum-error',\n hiddenAccessible = 's25-hidden-accessible',\n hidden = 's25-hidden',\n placeholder = 's25-placeholder',\n scroll = 's25-scroll'\n}\n","import { Component, ComponentChild, createRef, h, RefObject } from 'preact';\nimport { Dictionary } from './dictionary';\nimport { style } from './style';\nimport { calculateVerticalVisibility, cn } from './util';\n\nconst forceImportOfH = h;\n\n// TODO if upon render loading is visible signal loadmore\n\ninterface Props {\n // TODO consistenly call search a query\n namespace: string;\n search: string;\n listboxDomId?: string;\n results: any[];\n token: string;\n active: number;\n page: number;\n loading: boolean;\n\n itemLabel: (item: any) => string;\n renderItem: (item: any) => ComponentChild;\n\n dictionary: Dictionary;\n minimumCharacters: number;\n\n showMinimumCharactersError: boolean;\n showNoSearchResultsFound: boolean;\n showLoadMoreResults: boolean;\n\n onResultClicked: (result: any, event: MouseEvent) => void;\n onMouseMove: (index: any, event: MouseEvent) => void;\n onLoadMore: () => void;\n}\n\nexport class ResultList extends Component {\n private container: RefObject;\n private lastMouseClientX?: number;\n private lastMouseClientY?: number;\n private loadMore: RefObject;\n constructor(props) {\n super(props);\n this.container = createRef();\n this.loadMore = createRef();\n }\n\n private getResultDomId(index: number) {\n return this.props.namespace + index;\n }\n\n public render(props, state, context) {\n const { dictionary, minimumCharacters, showLoadMoreResults, results } = props;\n const query = this.props.search;\n\n return (\n

\n \n {props.loading && (\n
\n {dictionary.searchResultsLoading()}\n
\n )}\n {props.showNoSearchResultsFound && (\n
\n {dictionary.noSearchResults()}\n
\n )}\n {props.showMinimumCharactersError && (\n
\n {dictionary.minimumCharactersMessage(query.length, minimumCharacters)}\n
\n )}\n {results && results.length > 0 && (\n = 0 ? this.getResultDomId(props.active) : undefined}\n >\n {results.map((result, index) => {\n const label = props.itemLabel(result);\n const render = props.renderItem(result);\n const active = props.active === index;\n const css = cn(style.item, {\n [style.active]: active\n });\n const id = this.getResultDomId(index);\n return (\n \n
{render}
\n
\n );\n })}\n \n )}\n {props.showLoadMoreResults && (\n \n {dictionary.searchResultsLoading()}\n \n )}\n \n \n );\n }\n\n private onResultClicked = (result: any) => (event: MouseEvent) => {\n this.props.onResultClicked(result, event);\n };\n\n private onMouseMove = (index: number) => (event: MouseEvent) => {\n if (this.lastMouseClientX === event.clientX && this.lastMouseClientY === event.clientY) {\n // the mouse did not move, the dropdown was scrolled instead, we do not change selected element because\n // it will be scrolled into view and mess with the scrolling of the results in the dropdown\n return;\n }\n this.lastMouseClientX = event.clientX;\n this.lastMouseClientY = event.clientY;\n\n this.props.onMouseMove(index, event);\n };\n\n private onScroll = (event: Event) => {\n if (!this.props.showLoadMoreResults) {\n return;\n }\n const more = this.loadMore.current!;\n const drop = this.container.current!;\n\n const visibility = calculateVerticalVisibility(drop, more);\n if (visibility !== 'hidden') {\n this.props.onLoadMore();\n }\n };\n\n public componentDidUpdate(prevProps: Props, prevState: Props) {\n const { active, results, showLoadMoreResults } = this.props;\n const { active: prevActive } = prevProps;\n\n if (active !== prevActive) {\n if (active >= 0 && results && results.length > 0 && active === results.length - 1 && showLoadMoreResults) {\n // last result is selected and load more is shown, make sure it is scrolled into view\n\n const drop = this.container.current!;\n const el = this.loadMore.current!;\n\n drop.scrollTop = el.offsetTop + el.offsetHeight - drop.clientHeight;\n\n // console.log(\"scrolling to see load more\");//, setting scrolltop\", drop, el, el.offsetTop - drop.clientHeight);\n } else if (active >= 0) {\n // make sure it is scrolled into view\n const id = this.getResultDomId(active);\n const el = document.getElementById(id);\n if (el != null) {\n const drop = this.container!.current!;\n const c = drop.getBoundingClientRect();\n const e = el.getBoundingClientRect();\n\n if (e.top < c.top && e.bottom <= c.bottom) {\n const delta = c.top - e.top;\n drop.scrollTop = drop.scrollTop - delta;\n }\n\n if (e.top >= c.top && e.bottom > c.bottom) {\n const delta = e.bottom - c.bottom;\n drop.scrollTop = drop.scrollTop + delta;\n }\n }\n }\n }\n }\n}\n","import { createRef, Fragment, h, RefObject } from 'preact';\nimport {\n AbstractSelect,\n DataItem,\n DEFAULT_PROPS as ABSTRACT_DEFAULT_PROPS,\n Props as SearchControllerProps,\n State as AbstractSelectState\n} from './abstract-select';\nimport * as announce from './announce';\nimport { Dropdown } from './dropdown';\nimport { Remove, Toggle } from './icons';\nimport { ResultList } from './result-list';\nimport { style } from './style';\nimport { cn, extend, Key, scope } from './util';\n\nconst forceImportOfH = h;\n\nexport interface Props extends SearchControllerProps {\n valuesLabel: string;\n comboboxLabel: string;\n values: DataItem[];\n onChange: (values: DataItem[]) => void;\n}\n\ninterface ValueListState {\n active: number;\n selected: boolean[];\n}\n\ninterface State extends AbstractSelectState {\n values: ValueListState;\n}\n\nconst DEFAULT_PROPS = extend({}, ABSTRACT_DEFAULT_PROPS, { values: [] });\n\nexport class MultiSelect extends AbstractSelect {\n private containerRef: RefObject;\n private dropdownRef: RefObject;\n private bodyRef: RefObject;\n private valuesRef: RefObject;\n private searchRef: RefObject;\n\n public static defaultProps = DEFAULT_PROPS;\n\n constructor(props) {\n super(props);\n const { values } = props;\n\n this.valuesRef = createRef();\n this.searchRef = createRef();\n this.bodyRef = createRef();\n this.containerRef = createRef();\n this.dropdownRef = createRef();\n\n this.state = extend(this.state, {\n values: {\n active: -1,\n selected: values.map(v => false)\n }\n });\n }\n\n public componentWillMount() {\n announce.initialize();\n }\n\n public render(props, state) {\n const { values, tabIndex, minimumCharacters, valuesLabel, comboboxLabel, placeholder } = props;\n const {\n open,\n loading,\n focused,\n search,\n values: { active, selected },\n results\n } = state;\n const dictionary = this.dictionary;\n\n const showPlaceholder = !values || values.length === 0;\n\n let classes = cn(style.control, style.multi, { [style.open]: open }, { [style.focused]: focused });\n if (props.containerClass && props.containerClass.length > 0) {\n classes += ' ' + props.containerClass;\n }\n\n const instructionsDomId = this.namespace + '-instructions';\n const resultsDomId = this.namespace + '-results';\n const resultsNamespace = this.namespace + '-res-';\n return (\n \n \n
\n
\n {dictionary.multiSelectInstructions()}\n
\n {scope(() => {\n const activeDescendant = active >= 0 ? this.namespace + '-vl-' + active : undefined;\n if (values && values.length > 0) {\n return (\n \n {values.map((value: DataItem, index: number) => {\n const isSelected = selected[index];\n const isActive = active === index;\n const css = cn(style.item, {\n [style.selected]: isSelected,\n [style.active]: isActive\n });\n const id = this.namespace + '-vl-' + index;\n const label = this.getItemLabel(value);\n const render = this.renderValue(value);\n return (\n e.stopPropagation()}\n onClick={this.onValueClick(index)}\n >\n
{render}
\n
\n );\n })}\n \n );\n } else {\n return null;\n }\n })}\n {scope(() => {\n const disabled = !selected.find(x => x === true);\n const className = cn(style.remove, {\n [style.offscreen]: values.length < 1\n });\n return (\n \n \n \n \n \n );\n })}\n \n = 0 ? resultsNamespace + results.active : undefined}\n aria-busy={loading}\n onInput={this.onSearchInput}\n onKeyDown={this.onSearchKeyDown}\n onFocus={this.onSearchFocus}\n placeholder={showPlaceholder ? placeholder : undefined}\n />\n \n \n \n \n \n {open && (\n \n \n \n )}\n
\n );\n }\n\n public componentDidMount() {\n const css = this.props.containerStyle;\n if (css && css.length > 0) {\n this.containerRef.current!.setAttribute('style', css);\n }\n }\n\n private onLoadMoreResults = () => {\n this.loadMore();\n };\n\n private focusSearchAndStopPropagation = (event: Event) => {\n this.searchRef.current!.focus();\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onToggleClick = (event: MouseEvent) => {\n const { open } = this.state;\n if (open) {\n this.close();\n this.searchRef.current!.focus();\n } else {\n this.search(this.state.search, this.props.values, { open: true });\n this.searchRef.current!.focus();\n }\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onBodyClick = (event: MouseEvent) => {\n if (event.target === this.bodyRef.current) {\n // if the element itself was clicked, (white space inside the body)\n this.searchRef.current!.focus();\n }\n };\n\n public onFocusIn = (event: FocusEvent) => {\n this.updateState({ focused: true });\n };\n\n public onFocusOut = (event: FocusEvent) => {\n const receiver = event.relatedTarget as Node;\n const container = this.containerRef.current!;\n const dropdown = this.dropdownRef.current!;\n const focused =\n container.contains(receiver) || (dropdown && (dropdown === receiver || dropdown.contains(receiver)));\n\n this.updateState({\n focused\n });\n if (!focused) {\n this.closeIfOpen();\n }\n };\n\n public onSearchFocus = (event: FocusEvent) => {\n const { openOnFocus } = this.props;\n const { open } = this.state;\n if (!open && openOnFocus) {\n this.search(this.searchRef.current!.value, this.props.values, { open: true });\n }\n };\n\n public onResultMouseMove = (index: number, event: MouseEvent) => {\n this.selectSearchResult(index);\n };\n\n public toggleValue = (index: number) => {\n const {\n values: { selected }\n } = this.state;\n const next = selected.slice();\n next[index] = !next[index];\n this.updateState({ values: { selected: next, active: index } });\n };\n\n public onRemoveSelectedFocus = (event: FocusEvent) => {\n this.closeIfOpen();\n };\n\n public onRemoveSelectedClick = (event: Event) => {\n const {\n values: { selected }\n } = this.state;\n const { values, onChange } = this.props;\n const next = values.slice().filter((value, index) => !selected[index]);\n this.updateState({\n values: {\n selected: next.map(v => false)\n }\n });\n onChange(next);\n\n this.searchRef.current!.focus();\n };\n\n public onSearchInput = (event: Event) => {\n const value = (event.target as HTMLInputElement).value;\n this.search(value, this.props.values, { open: true });\n };\n\n public onSearchKeyDown = (event: KeyboardEvent) => {\n const { open } = this.state;\n\n if (open) {\n if (this.handleResultNavigationKeyDown(event)) {\n return;\n }\n if (this.hasSearchResults) {\n switch (event.key) {\n case Key.Enter:\n this.onActiveResultSelectedViaKeypress(event);\n break;\n case Key.Escape:\n if (open) {\n this.close();\n }\n event.preventDefault();\n break;\n }\n }\n } else {\n switch (event.key) {\n case Key.ArrowDown:\n case Key.Down:\n case Key.Enter:\n this.search('', this.props.values, { open: true });\n break;\n }\n }\n };\n\n public onValueClick = (index: number) => (event: MouseEvent) => {\n this.toggleValue(index);\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onValuesFocus = (event: Event) => {\n const {\n values: { active, selected }\n } = this.state;\n const { values } = this.props;\n\n // highlight the first selected value\n if (active < 0 && values.length > 0) {\n let index = 0;\n for (let i = 0; i < selected.length; i++) {\n if (selected[i]) {\n index = i;\n break;\n }\n }\n this.updateState({ values: { active: index } });\n }\n this.closeIfOpen();\n };\n\n public closeIfOpen() {\n if (this.state.open) {\n this.close();\n }\n }\n\n public close = (callback?: () => void) => {\n this.updateState(\n {\n open: false,\n results: { results: undefined },\n search: ''\n },\n callback\n );\n };\n\n public onValuesBlur = (event: Event) => {\n this.updateState({ values: { active: -1 } });\n };\n\n public onValuesKeyDown = (event: KeyboardEvent) => {\n const active = this.state.values.active;\n const { values } = this.props;\n\n switch (event.key) {\n case Key.ArrowLeft:\n case Key.ArrowUp:\n case Key.Up:\n case Key.Left: {\n if (active > 0) {\n this.updateState({ values: { active: active - 1 } });\n }\n event.preventDefault();\n break;\n }\n case Key.ArrowRight:\n case Key.Right:\n case Key.ArrowDown:\n case Key.Down: {\n if (active < values.length - 1) {\n this.updateState({ values: { active: active + 1 } });\n }\n event.preventDefault();\n break;\n }\n case Key.PageDown: {\n // TODO\n event.preventDefault();\n break;\n }\n case Key.PageUp: {\n // TODO\n event.preventDefault();\n break;\n }\n case Key.Home: {\n this.updateState({ values: { active: 0 } });\n event.preventDefault();\n break;\n }\n case Key.End: {\n this.updateState({ values: { active: values.length - 1 } });\n event.preventDefault();\n break;\n }\n case Key.Space:\n case Key.Spacebar: {\n this.toggleValue(active);\n event.preventDefault();\n break;\n }\n }\n };\n\n public onDropdownClick = (event: MouseEvent) => {\n // result clicks do not make it this far because they do not propagate\n // so this click is on something other than result\n event.preventDefault();\n event.stopPropagation();\n this.searchRef.current!.focus();\n };\n\n public onResultClicked = (result: any, event: MouseEvent) => {\n const { openOnFocus } = this.props;\n const values = this.selectResult(result);\n\n const focusSearchLater = () => {\n window.setTimeout(() => {\n this.searchRef.current!.focus();\n }, 0);\n };\n\n if (openOnFocus) {\n this.search('', values, {}, focusSearchLater);\n } else {\n this.close(focusSearchLater);\n }\n\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onActiveResultSelectedViaKeypress = (event: KeyboardEvent) => {\n const { openOnFocus } = this.props;\n const result = this.getSelectedSearchResult();\n const values = this.selectResult(result);\n if (openOnFocus) {\n this.search('', values, { open: true });\n } else {\n this.close();\n }\n\n event.preventDefault();\n };\n\n public selectResult = (result: any) => {\n const { values, onChange } = this.props;\n const next = values.slice();\n next.push(result);\n\n const label = this.getItemLabel(result);\n announce.politely(this.dictionary.valueAdded(label));\n\n onChange(next);\n return next;\n };\n}\n","import { createRef, Fragment, h, RefObject } from 'preact';\nimport {\n AbstractSelect,\n DEFAULT_PROPS as ABSTRACT_DEFAULT_PROPS,\n Props as AbstractSelectProps,\n State as AbstractSelectState\n} from './abstract-select';\nimport * as announce from './announce';\nimport { Dropdown } from './dropdown';\nimport { Remove, Toggle } from './icons';\nimport { ResultList } from './result-list';\nimport { style } from './style';\nimport { cn, DeepPartial, extend, Key, scope } from './util';\n\nconst forceImportOfH = h;\n\nexport interface Props extends AbstractSelectProps {\n value: any;\n label: string;\n comboboxLabel: string;\n onChange: (value: any) => void;\n allowClear?: boolean;\n placeholder?: string;\n}\n\ninterface State extends AbstractSelectState {\n value: any;\n}\n\nconst DEFAULT_PROPS = extend({}, ABSTRACT_DEFAULT_PROPS, { allowClear: false });\n\nexport class SingleSelect extends AbstractSelect {\n private containerRef: RefObject;\n private dropdownRef: RefObject;\n private bodyRef: RefObject;\n private searchRef: RefObject;\n private valueRef: RefObject;\n\n public static defaultProps = DEFAULT_PROPS;\n\n constructor(props) {\n super(props);\n\n this.searchRef = createRef();\n this.bodyRef = createRef();\n this.containerRef = createRef();\n this.dropdownRef = createRef();\n this.valueRef = createRef();\n\n this.state = extend(this.state, { value: this.props.value });\n }\n\n public componentWillMount() {\n announce.initialize();\n }\n\n public render(props, state) {\n const { minimumCharacters, tabIndex, label, allowClear, placeholder } = props;\n const { value, open, loading, focused, search, results } = state;\n\n let classes = cn(style.control, style.single, { [style.open]: open }, { [style.focused]: focused });\n if (props.containerClass && props.containerClass.length > 0) {\n classes += ' ' + props.containerClass;\n }\n const resultsDomId = this.namespace + '-results';\n const optionDomId = this.namespace + '-val';\n const resultsNamespace = this.namespace + '-res-';\n const dictionary = this.dictionary;\n const showPlaceholder = !value && placeholder && placeholder.length > 0;\n const placeholderDomId = this.namespace + '-placeholder';\n return (\n \n \n
\n
\n )}\n {showPlaceholder && (\n
\n {placeholder}\n
\n )}\n \n {scope(() => {\n const disabled = !value;\n const clazz = cn(style.remove, { [style.offscreen]: !allowClear });\n return (\n \n \n \n \n \n );\n })}\n
\n \n
\n \n \n {open && (\n \n
\n = 0 ? resultsNamespace + results.active : undefined\n }\n aria-busy={loading}\n onInput={this.onSearchInput}\n onKeyDown={this.onSearchKeyDown}\n onFocus={this.onSearchFocus}\n />\n \n
\n \n )}\n
\n );\n }\n\n public componentDidMount() {\n const css = this.props.containerStyle;\n if (css && css.length > 0) {\n this.containerRef.current!.setAttribute('style', css);\n }\n }\n\n private onLoadMoreResults = () => {\n this.loadMore();\n };\n\n public onFocusIn = (event: FocusEvent) => {\n this.updateState({ focused: true });\n\n const { openOnFocus } = this.props;\n const { open } = this.state;\n if (!open && openOnFocus && this.searchRef.current !== document.activeElement) {\n this.open();\n }\n };\n\n public onFocusOut = (event: FocusEvent) => {\n const receiver = event.relatedTarget as Node;\n const container = this.containerRef.current;\n const dropdown = this.dropdownRef.current;\n const search = this.searchRef.current;\n\n const focused =\n container.contains(receiver) ||\n (dropdown && (dropdown === receiver || dropdown.contains(receiver))) ||\n receiver === search;\n\n if (this.state.focused !== focused) {\n this.updateState({\n focused\n });\n }\n if (!focused) {\n this.closeIfOpen();\n }\n };\n\n public closeIfOpen() {\n if (this.state.open) {\n this.close();\n }\n }\n\n public close = (state?: DeepPartial) => {\n const control = this;\n control.valueRef.current!.focus();\n this.updateState([\n state,\n {\n open: false,\n results: { results: null },\n search: ''\n }\n ]);\n };\n\n private getValueAsArray() {\n return this.state.value ? [this.state.value] : [];\n }\n\n private onContainerMouseDown = (event: MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n if (this.state.open) {\n this.close();\n } else {\n this.open();\n }\n };\n\n private open(query: string = '') {\n this.search(query, this.getValueAsArray(), { open: true }, () => {\n this.searchRef.current.focus();\n });\n }\n\n private onSearchFocus = (event: FocusEvent) => {\n this.updateState({ focused: true });\n };\n\n private onSearchInput = (event: Event) => {\n const value = (event.target as HTMLInputElement).value;\n this.search(value, this.getValueAsArray());\n };\n\n private onClearFocus = (event: FocusEvent) => {\n this.closeIfOpen();\n };\n\n private onClearClick = (event: Event) => {\n this.selectResult(undefined);\n event.preventDefault();\n event.stopPropagation();\n };\n\n private onClearMouseDown = (event: Event) => {\n event.stopPropagation();\n event.preventDefault();\n };\n\n public onSearchKeyDown = (event: KeyboardEvent) => {\n if (this.handleResultNavigationKeyDown(event)) {\n return;\n }\n\n const { open } = this.state;\n\n if (open && this.hasSearchResults) {\n switch (event.key) {\n case Key.Enter:\n this.selectActiveResult();\n event.preventDefault();\n event.stopPropagation();\n break;\n case Key.Escape:\n this.close();\n event.preventDefault();\n event.stopPropagation();\n break;\n case Key.Tab:\n // TODO select on tab?\n this.close();\n event.preventDefault();\n event.stopPropagation();\n }\n }\n };\n\n public selectActiveResult = () => {\n const { active } = this.state.results;\n if (active >= 0) {\n this.selectResult(this.getSelectedSearchResult());\n }\n };\n\n public selectResult = (result: any) => {\n const { onChange } = this.props;\n\n this.close({ value: result });\n\n // TODO announce?\n // const label = this.getItemLabel(result);\n\n onChange(result);\n };\n\n private onValueKeyDown = (event: KeyboardEvent) => {\n switch (event.key) {\n case Key.Space:\n case Key.ArrowDown:\n case Key.Down:\n this.open();\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n if (event.key.length === 1) {\n // focus on search which will put the printable character into the field\n this.open();\n }\n };\n\n private onDropdownMouseDown = (event: MouseEvent) => {\n this.searchRef.current.focus();\n event.preventDefault();\n event.stopPropagation();\n };\n\n public onResultMouseMove = (index: number, event: MouseEvent) => {\n this.selectSearchResult(index);\n };\n\n public onResultClicked = (result: any, event: MouseEvent) => {\n this.selectResult(result);\n event.preventDefault();\n event.stopPropagation();\n };\n}\n","export class Store {\n private static stores = new WeakMap();\n\n private store = new Map();\n\n public get(key: string): any {\n return this.store.get(key);\n }\n public set(key: string, value: any) {\n this.store.set(key, value);\n }\n\n public static getStore(key: any): Store {\n let store = Store.stores.get(key);\n if (!store) {\n store = new Store();\n Store.stores.set(key, store);\n }\n return store;\n }\n\n public static hasStore(key: any) {\n return Store.stores.has(key);\n }\n\n public static removeStore(key: any) {\n Store.stores.delete(key);\n }\n}\n","/** jsx:pragma h */\nimport { Component, h, render } from 'preact';\nimport { DataItem, DataItemRenderer, QueryFunction } from '../../control/src/abstract-select';\nimport { Dictionary } from '../../control/src/dictionary';\nimport { MultiSelect } from '../../control/src/multi-select';\nimport '../../control/src/select25.scss';\nimport { SingleSelect } from '../../control/src/single-select';\nimport { extend } from '../../control/src/util';\nimport { Ajax, createQueryFromAjax } from './ajax';\nimport { createQueryFromData, DataFunction } from './data';\nimport { Store } from './store';\n\nconst forceImportOfH = h;\n\nenum StoreKeys {\n targetElement = 'te'\n}\n\ninterface BaseSelectOptions {\n containerStyle?: string;\n containerClass?: string;\n placeholder?: string;\n tabIndex?: number;\n valueContent?: DataItemRenderer;\n resultContent?: DataItemRenderer;\n query?: QueryFunction;\n data?: DataFunction;\n ajax?: Ajax;\n quiet?: number;\n minimumCharacters?: number;\n openOnFocus?: boolean;\n dictionary?: string | Dictionary;\n}\n\ninterface MultiSelectOptions extends BaseSelectOptions {\n hiddenValue?: (values: DataItem[], options: MultiSelectOptions) => string;\n valuesLabel?: string;\n comboboxLabel?: string;\n allowDuplicates: boolean;\n values: DataItem[];\n}\n\ninterface SingleSelectOptions extends BaseSelectOptions {\n hiddenValue?: (value: DataItem, options: SingleSelectOptions) => string;\n label?: string;\n value: DataItem;\n allowClear?: boolean;\n}\n\nconst BASE_DEFAULT_OPTIONS = {\n dictionary: 'en_us',\n minimumCharacters: 0,\n openOnFocus: false\n};\n\nconst DEFAULT_MULTI_SELECT_OPTIONS = extend({}, BASE_DEFAULT_OPTIONS, {\n hiddenValue: (values: DataItem[], options: MultiSelectOptions) => {\n if (values && values.length > 0) {\n return values.map(item => item.id).join(',');\n } else {\n return '';\n }\n }\n});\n\nconst DEFAULT_SINGLE_SELECT_OPTIONS = extend({}, BASE_DEFAULT_OPTIONS, {\n allowClear: false,\n hiddenValue: (value: DataItem, options: SingleSelectOptions) => {\n if (value) {\n return value.id;\n } else {\n return '';\n }\n }\n});\n\nfunction triggerOnChange(element: HTMLElement, data: any) {\n const event = document.createEvent('HTMLEvents');\n event.initEvent('change', false, true);\n event[data] = data;\n element.dispatchEvent(event);\n}\n\nclass MultiSelectWrapper extends Component<\n {\n element: HTMLInputElement;\n options: MultiSelectOptions;\n },\n { values?: DataItem[] }\n> {\n constructor(props) {\n super(props);\n this.state = { values: props.options.values || [] };\n }\n\n public componentDidUpdate() {\n this.setHiddenValue(this.state.values);\n }\n\n public componentDidMount() {\n this.setHiddenValue(this.state.values);\n }\n\n public render(props, state, context) {\n const opts = this.props.options;\n return (\n \n );\n }\n\n public onChange = (values: any[]) => {\n this.setState({ values });\n this.setHiddenValue(values);\n triggerOnChange(this.props.element, values);\n };\n\n private setHiddenValue(values: any) {\n const { element, options } = this.props;\n element.value = options.hiddenValue(values, options);\n }\n}\n\nclass SingleSelectWrapper extends Component<\n {\n options: SingleSelectOptions;\n element: HTMLInputElement;\n },\n { value?: DataItem }\n> {\n constructor(props) {\n super(props);\n this.state = { value: props.options.value };\n }\n\n public componentDidMount() {\n this.setHiddenValue(this.state.value);\n }\n\n public componentDidUpdate() {\n this.setHiddenValue(this.state.value);\n }\n\n public render(props, state, context) {\n const opts = this.props.options;\n return (\n \n );\n }\n\n public onChange = (value: DataItem) => {\n this.setState({ value });\n this.setHiddenValue(value);\n triggerOnChange(this.props.element, value);\n };\n\n private setHiddenValue(value: DataItem) {\n const { element, options } = this.props;\n element.value = options.hiddenValue(value, options);\n }\n}\n\nfunction createSingleSelect(element: HTMLInputElement, options: SingleSelectOptions) {\n options = extend({}, DEFAULT_SINGLE_SELECT_OPTIONS, options);\n fillBaseOptions(element, options);\n\n const store = Store.getStore(element);\n\n // create placeholder element into which the control will be rendered\n const parentElement = element.parentElement;\n const targetElement = document.createElement('div');\n parentElement.insertBefore(targetElement, element);\n store.set(StoreKeys.targetElement, targetElement);\n\n render(, parentElement, targetElement);\n}\n\nfunction createMultiSelect(element: HTMLInputElement, options: SingleSelectOptions) {\n options = extend({}, DEFAULT_MULTI_SELECT_OPTIONS, options);\n fillBaseOptions(element, options);\n\n const store = Store.getStore(element);\n\n // create placeholder element into which the control will be rendered\n const parentElement = element.parentElement;\n const targetElement = document.createElement('div');\n parentElement.insertBefore(targetElement, element);\n store.set(StoreKeys.targetElement, targetElement);\n\n render(, parentElement, targetElement);\n}\n\nfunction fillBaseOptions(element: HTMLInputElement, options: BaseSelectOptions) {\n if (!options.query) {\n if (options.ajax) {\n options.query = createQueryFromAjax(options.ajax);\n } else if (options.data) {\n options.query = createQueryFromData(options.data);\n }\n }\n\n if (!options.tabIndex && element.tabIndex) {\n options.tabIndex = element.tabIndex;\n }\n\n if (element.getAttribute('data-s25-container-style')) {\n let style = options.containerStyle || '';\n if (style.length > 0) {\n style += ';';\n }\n style += element.getAttribute('data-s25-container-style');\n options.containerStyle = style;\n }\n\n if (element.getAttribute('data-s25-container-class')) {\n let clazz = options.containerClass || '';\n if (clazz.length > 0) {\n clazz += ' ';\n }\n clazz += element.getAttribute('data-s25-container-class');\n options.containerClass = clazz;\n }\n}\n\nfunction destroy(element: HTMLElement) {\n if (!Store.hasStore(element)) {\n return;\n }\n const store = Store.getStore(element);\n const targetElement = store.get(StoreKeys.targetElement);\n const parentElement = element.parentElement;\n render(null, parentElement, targetElement);\n parentElement.removeChild(targetElement);\n Store.removeStore(element);\n}\n\nconst select25 = {\n createMultiSelect,\n createSingleSelect,\n destroy\n};\n\nexport { select25 };\n\ndeclare global {\n interface Window {\n select25: typeof select25;\n }\n}\n\nwindow.select25 = select25;\n","import { QueryFunction, QueryResult } from '../../control/src/abstract-select';\nimport { extend } from '../../control/src/util';\n\nexport interface Ajax {\n url: string;\n params: (term: string, page: number) => object;\n process: (data: string) => QueryResult;\n}\n\nexport function createQueryFromAjax(ajax: Ajax): QueryFunction {\n ajax = extend({}, ajax, {\n params(term: string, page: number) {\n return { term, page };\n },\n process(data: string) {\n const json = JSON.parse(data);\n return {\n more: json.more,\n values: json.values\n };\n }\n });\n\n return (term: string, page: number, token: string) => {\n return new Promise((resolve, reject) => {\n let url = ajax.url;\n const params = ajax.params(term, page);\n if (params) {\n let separator = url.indexOf('?') >= 0 ? '&' : '?';\n Object.entries(params).forEach(([key, value]) => {\n url += separator;\n separator = '&';\n url += encodeURIComponent(key) + '=' + encodeURIComponent(value);\n });\n }\n\n const request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.onload = () => {\n if (request.status >= 200 && request.status < 400) {\n const data = ajax.process(request.responseText);\n resolve({ values: data.values, more: data.more, token });\n } else {\n reject();\n }\n };\n request.onerror = reject;\n request.send();\n });\n };\n}\n","import { QueryFunction, QueryResult } from '../../control/src/abstract-select';\n\nexport interface DataParam {\n term: string;\n page: number;\n selected: any[];\n}\n\nexport interface DataResult {\n values: any[];\n more: boolean;\n}\n\nexport type DataFunction = (param: DataParam) => QueryResult;\n\nexport function createQueryFromData(callback: DataFunction): QueryFunction {\n return (term: string, page: number, token: string) => {\n return new Promise((resolve, reject) => {\n const data = callback({ term, page, selected: [] });\n resolve({ values: data.values, more: data.more, token });\n });\n };\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","l","u","o","c","parentNode","removeChild","a","r","children","defaultProps","key","ref","h","type","props","__k","__p","__b","__e","__c","vnode","context","__d","debounceRendering","k","sort","__v","forceUpdate","m","w","x","N","appendChild","nextSibling","insertBefore","O","A","isArray","C","style","setProperty","replace","test","toLowerCase","slice","addEventListener","removeEventListener","options","selected","removeAttributeNS","setAttributeNS","removeAttribute","setAttribute","event","contextType","__E","render","T","sub","state","__n","__h","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","__r","__P","getChildContext","getSnapshotBeforeUpdate","base","componentDidUpdate","nodeType","localName","document","createTextNode","createElementNS","createElement","data","childNodes","dangerouslySetInnerHTML","__html","innerHTML","multiple","keys","j","diffed","z","$","current","unmount","componentWillUnmount","getDerivedStateFromError","setState","componentDidCatch","D","ownerSVGElement","initialize","getElementById","live","assertive","polite","politely","message","container","node","collection","firstChild","add","indexOf","bind","setTimeout","dictionaries","Map","getDictionary","dict","fallback","get","instance","extend","_i","params","set","noSearchResults","searchResultsLoading","removeButtonTitle","clearButtonTitle","valueAdded","itemLabel","minimumCharactersMessage","len","min","delta","multiSelectInstructions","expandButtonTitle","Key","merge","target","sources","source","shift","undefined","isMergebleObject","forEach","item","isObject","cn","values","classes","values_1","_a","join","counter","uuid","scope","delegate","MarkupRenderer","DEFAULT_PROPS","allowDuplicates","minimumCharacters","quiet","tabIndex","tslib_1.__extends","Component","AbstractSelect","dictionary","update","callback","loading","query","page","queryFunc","control","token","nextPage","updateState","results","concat","showLoadMoreResults","more","announce.politely","ArrowUp","Up","selectPreviousSearchResult","preventDefault","ArrowDown","Down","selectNextSearchResult","active","index","_super","_this","id","text","renderItem","rendererName","renderer","markup","getItemLabel","selectedValues","start","minimumCharactersReached","showMinimumCharactersError","showNoSearchResultsFound","search","execute","ids_1","Set","getItemId","filter","has","searchTimeout","window","clearTimeout","namespace","focused","open","ContextProvider","Portal","Dropdown","class","className","onClick","onMouseDown","onFocusOut","dropdownRef","scrollParents","el","elementPosition","getComputedStyle","position","parents","parent","parentElement","css","overflow","overflowX","overflowY","ownerDocument","defaultView","getScrollParents","controlRef","throttledPosition","createPortal","Fragment","rect","getBoundingClientRect","top","height","pageYOffset","left","pageXOffset","width","delay","timeout","throttle","Toggle","viewBox","focusable","displayName","Remove","ResultList","onScroll","searchResults","searchResultsMessage","searchResultsMinimumError","role","listboxDomId","getResultDomId","map","onResultClicked","onMouseMove","content","loadMore","prevProps","drop","scrollTop","offsetTop","offsetHeight","clientHeight","bottom","lastMouseClientX","clientX","lastMouseClientY","clientY","element","calculateVerticalVisibility","onLoadMore","ABSTRACT_DEFAULT_PROPS","MultiSelect","announce.initialize","valuesLabel","comboboxLabel","placeholder","_c","showPlaceholder","multi","containerClass","instructionsDomId","resultsDomId","resultsNamespace","containerRef","onFocusCapture","onFocusIn","onBlurCapture","focusSearchAndStopPropagation","bodyRef","onBodyClick","offscreen","display","activeDescendant","valuesRef","multiValues","onFocus","onValuesFocus","onBlur","onValuesBlur","onKeyDown","onValuesKeyDown","isSelected","isActive","renderValue","stopPropagation","onValueClick","disabled","find","remove","onRemoveSelectedClick","onRemoveSelectedFocus","title","htmlFor","searchRef","onInput","onSearchInput","onSearchKeyDown","onSearchFocus","toggle","onToggleClick","dropdown","onDropdownClick","renderResult","onResultMouseMove","onLoadMoreResults","containerStyle","close","focus","receiver","relatedTarget","contains","closeIfOpen","openOnFocus","selectSearchResult","onChange","handleResultNavigationKeyDown","hasSearchResults","Enter","onActiveResultSelectedViaKeypress","Escape","toggleValue","ArrowLeft","Left","ArrowRight","Right","PageDown","PageUp","Home","End","Space","Spacebar","focusSearchLater","selectResult","getSelectedSearchResult","allowClear","SingleSelect","single","optionDomId","placeholderDomId","onContainerMouseDown","valueRef","onValueKeyDown","onClearClick","onClearFocus","onClearMouseDown","onDropdownMouseDown","getValueAsArray","activeElement","selectActiveResult","Tab","StoreKeys","Store","store","stores","delete","WeakMap","BASE_DEFAULT_OPTIONS","DEFAULT_MULTI_SELECT_OPTIONS","hiddenValue","DEFAULT_SINGLE_SELECT_OPTIONS","triggerOnChange","createEvent","initEvent","dispatchEvent","MultiSelectWrapper","setHiddenValue","opts","valueContent","resultContent","SingleSelectWrapper","fillBaseOptions","ajax","term","process","json","JSON","parse","url","separator_1","entries","encodeURIComponent","request","XMLHttpRequest","onload","status","responseText","onerror","send","createQueryFromAjax","createQueryFromData","getAttribute","clazz","select25","createMultiSelect","getStore","targetElement","createSingleSelect","destroy","hasStore","removeStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;qMAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,GAG5E,IAAIK,EAAW,WAQlB,OAPAA,EAAWZ,OAAOa,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIZ,KADTW,EAAIG,UAAUF,GACOhB,OAAOU,UAAUL,eAAee,KAAKL,EAAGX,KAAIU,EAAEV,GAAKW,EAAEX,IAE9E,OAAOU,IAEKO,MAAMb,KAAMU,YA4BzB,SAASI,EAAUC,EAASC,EAAYC,EAAGC,GAC9C,OAAO,IAAKD,IAAMA,EAAIE,UAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,IACpF,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,IAAW,MAAOG,GAAKL,EAAOK,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOL,OAAS,IA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