1 line
142 KiB
Plaintext
1 line
142 KiB
Plaintext
{"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;t<arguments.length;t++)u.push(e[t]);if(null!=u&&(l.children=u),null!=n&&null!=n.defaultProps)for(i in n.defaultProps)void 0===l[i]&&(l[i]=n.defaultProps[i]);return f=l.key,null!=(r=l.ref)&&delete l.ref,null!=f&&delete l.key,h(n,l,f,r)}function h(l,u,t,i){var r={type:l,props:u,key:t,ref:i,__k:null,__p:null,__b:0,__e:null,l:null,__c:null,constructor:void 0};return n.vnode&&n.vnode(r),r}function v(){return{}}function p(n){return n.children}function y(n){if(null==n||\"boolean\"==typeof n)return null;if(\"string\"==typeof n||\"number\"==typeof n)return h(null,n,null,null);if(null!=n.__e||null!=n.__c){var l=h(n.type,n.props,n.key,null);return l.__e=n.__e,l}return n}function d(n,l){this.props=n,this.context=l}function m(n,l){if(null==l)return n.__p?m(n.__p,n.__p.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l]))return\"function\"!=typeof u.type?u.__e:m(u,0);return\"function\"==typeof n.type?m(n):null}function w(n){var l,u;if(null!=(n=n.__p)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return w(n)}}function b(t){!t.__d&&(t.__d=!0)&&1===l.push(t)&&(n.debounceRendering||u)(k)}function k(){var n;for(l.sort(function(n,l){return l.__v.__b-n.__v.__b});n=l.pop();)n.__d&&n.forceUpdate(!1)}function g(n,l,u,t,i,r,o,c){var a,h,v,p,d,m,w,b,k=l.__k||_(l.props.children,l.__k=[],y,!0),g=u&&u.__k||e,x=g.length;if(c==f)if(c=null,null!=r)c=r[0];else for(h=0;!c&&h<x;h++)c=g[h]&&g[h].__e;for(h=0;h<k.length;h++)if(null!=(a=k[h]=y(k[h]))){if(a.__p=l,a.__b=l.__b+1,null===(p=g[h])||p&&a.key==p.key&&a.type===p.type)g[h]=void 0;else for(v=0;v<x;v++){if((p=g[v])&&a.key==p.key&&a.type===p.type){g[v]=void 0;break}p=null}if(d=N(n,a,p=p||f,t,i,r,o,null,c),(v=a.ref)&&p.ref!=v&&(b||(b=[])).push(v,a.__c||d),null!=d){if(null==w&&(w=d),null!=a.l)d=a.l,a.l=null;else if(r==p||d!=c||null==d.parentNode)n:if(null==c||c.parentNode!==n)n.appendChild(d);else{for(m=c,v=0;(m=m.nextSibling)&&v<x;v+=2)if(m==d)break n;n.insertBefore(d,c)}c=d.nextSibling,\"function\"==typeof l.type&&(l.l=d)}}if(l.__e=w,null!=r&&\"function\"!=typeof l.type)for(h=r.length;h--;)null!=r[h]&&s(r[h]);for(h=x;h--;)null!=g[h]&&O(g[h],l);if(b)for(h=0;h<b.length;h++)A(b[h],b[++h],l)}function _(n,l,u,t){if(null==l&&(l=[]),null==n||\"boolean\"==typeof n)t&&l.push(null);else if(Array.isArray(n))for(var i=0;i<n.length;i++)_(n[i],l,u,t);else l.push(u?u(n):n);return l}function x(n,l,u,t){var i,r,f=Object.keys(l).sort();for(i=0;i<f.length;i++)\"children\"===(r=f[i])||\"key\"===r||u&&(\"value\"===r||\"checked\"===r?n:u)[r]===l[r]||C(n,r,l[r],u[r],t);for(i in u)\"children\"===i||\"key\"===i||i in l||C(n,i,null,u[i],t)}function C(n,l,u,r,e){var s,a,h,v;if(\"style\"===(l=e?\"className\"===l?\"class\":l:\"class\"===l?\"className\":l))for(a in s=c(c({},r),u))(u||f)[a]!==(r||f)[a]&&n.style.setProperty(\"-\"===a[0]&&\"-\"===a[1]?a:a.replace(t,\"-$&\"),u&&a in u?\"number\"==typeof s[a]&&!1===o.test(a)?s[a]+\"px\":s[a]:\"\");else if(\"o\"===l[0]&&\"n\"===l[1])h=l!==(l=l.replace(/Capture$/,\"\")),v=l.toLowerCase(),l=(v in n?v:l).slice(2),u?(r||n.addEventListener(l,P,h),(n.u||(n.u={}))[l]=u):n.removeEventListener(l,P,h);else if(\"list\"!==l&&\"tagName\"!==l&&!e&&l in n)if(n.length&&\"value\"==l)for(l=n.length;l--;)n.options[l].selected=n.options[l].value==u;else n[l]=null==u?\"\":u;else\"function\"!=typeof u&&\"dangerouslySetInnerHTML\"!==l&&(l!==(l=l.replace(/^xlink:?/,\"\"))?null==u||!1===u?n.removeAttributeNS(i,l.toLowerCase()):n.setAttributeNS(i,l.toLowerCase(),u):null==u||!1===u?n.removeAttribute(l):n.setAttribute(l,u))}function P(l){return this.u[l.type](n.event?n.event(l):l)}function N(l,u,t,i,r,f,e,o,s){var a,h,v,m,w,b,k,x,C,P,N=u.type;if(void 0!==u.constructor)return null;(a=n.__b)&&a(u);try{n:if(\"function\"==typeof N){if(x=u.props,C=(a=N.contextType)&&i[a.__c],P=a?C?C.props.value:a.__p:i,t.__c?k=(h=u.__c=t.__c).__p=h.__E:(N.prototype&&N.prototype.render?u.__c=h=new N(x,P):(u.__c=h=new d(x,P),h.constructor=N,h.render=T),C&&C.sub(h),h.props=x,h.state||(h.state={}),h.context=P,h.__n=i,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=N.getDerivedStateFromProps&&c(h.__s==h.state?h.__s=c({},h.__s):h.__s,N.getDerivedStateFromProps(x,h.__s)),v)null==N.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&e.push(h);else{if(null==N.getDerivedStateFromProps&&null==o&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(x,P),!o&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(x,h.__s,P)){h.props=x,h.state=h.__s,h.__d=!1,h.__v=u,u.__e=t.__e,u.__k=t.__k;break n}null!=h.componentWillUpdate&&h.componentWillUpdate(x,h.__s,P)}m=h.props,w=h.state,h.context=P,h.props=x,h.state=h.__s,(a=n.__r)&&a(u),h.__d=!1,h.__v=u,h.__P=l;try{_(null!=(a=h.render(h.props,h.state,h.context))&&a.type==p&&null==a.key?a.props.children:a,u.__k=[],y,!0)}catch(l){if((a=n.__E)&&a(l,u,t))break n;throw l}for(null!=h.getChildContext&&(i=c(c({},i),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(b=h.getSnapshotBeforeUpdate(m,w)),g(l,u,t,i,r,f,e,s),h.base=u.__e;a=h.__h.pop();)a.call(h);v||null==m||null==h.componentDidUpdate||h.componentDidUpdate(m,w,b),k&&(h.__E=h.__p=null)}else u.__e=j(t.__e,u,t,i,r,f,e);(a=n.diffed)&&a(u)}catch(n){z(n,u.__p)}return u.__e}function $(l,u){for(var t;t=l.pop();)try{t.componentDidMount()}catch(n){z(n,t.__v.__p)}n.__c&&n.__c(u)}function j(n,l,u,t,i,r,o){var c,s,a,h,v=u.props,p=l.props;if(i=\"svg\"===l.type||i,null==n&&null!=r)for(c=0;c<r.length;c++)if(null!=(s=r[c])&&(null===l.type?3===s.nodeType:s.localName===l.type)){n=s,r[c]=null;break}if(null==n){if(null===l.type)return document.createTextNode(p);n=i?document.createElementNS(\"http://www.w3.org/2000/svg\",l.type):document.createElement(l.type),r=null}return null===l.type?v!==p&&(n.data=p):l!==u&&(null!=r&&(r=e.slice.call(n.childNodes)),a=(v=u.props||f).dangerouslySetInnerHTML,((h=p.dangerouslySetInnerHTML)||a)&&null==r&&(h&&a&&h.__html==a.__html||(n.innerHTML=h&&h.__html||\"\")),p.multiple&&(n.multiple=p.multiple),g(n,l,u,t,\"foreignObject\"!==l.type&&i,r,o,f),x(n,p,v,i)),n}function A(n,l,u){try{\"function\"==typeof n?n(l):n.current=l}catch(n){z(n,u)}}function O(l,u,t){var i,r,f;if(n.unmount&&n.unmount(l),(i=l.ref)&&A(i,null,u),t||\"function\"==typeof l.type||(t=null!=(r=l.__e)),l.__e=l.l=null,null!=(i=l.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){z(n,u)}i.base=i.__P=null}if(i=l.__k)for(f=0;f<i.length;f++)i[f]&&O(i[f],u,t);null!=r&&s(r)}function T(n,l,u){return this.constructor(n,u)}function z(l,u){var t;for(n.__e&&n.__e(l,u);u;u=u.__p)if((t=u.__c)&&!t.__p)try{if(t.constructor&&null!=t.constructor.getDerivedStateFromError)t.setState(t.constructor.getDerivedStateFromError(l));else{if(null==t.componentDidCatch)continue;t.componentDidCatch(l)}return b(t.__E=t)}catch(n){l=n}throw l}function D(l,u,t){var i,r;n.__p&&n.__p(l,u),i=u.__k,l=a(p,null,[l]),r=[],N(u,t?l:u.__k=l,i||f,f,void 0!==u.ownerSVGElement,t?[t]:i?null:e.slice.call(u.childNodes),r,!1,t||f),$(r,l)}function H(n,l){l.__k=null,D(n,l)}function I(n,l){return l=c(c({},n.props),l),arguments.length>2&&(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<string, Dictionary>();\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<T> = {\n [P in keyof T]?: T[P] extends Array<infer U>\n ? Array<DeepPartial<U>>\n : T[P] extends ReadonlyArray<infer V>\n ? ReadonlyArray<DeepPartial<V>>\n : DeepPartial<T[P]>\n};\n\nexport const merge = <T>(target: T, sources: Array<DeepPartial<T>>): 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<HTMLElement | Window> = [];\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<QueryResult>;\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 <div dangerouslySetInnerHTML={{ __html: markup }}> </div>;\n}\n\nexport const DEFAULT_PROPS: Partial<Props> = {\n allowDuplicates: false,\n minimumCharacters: 0,\n quiet: 50,\n tabIndex: 0\n};\n\nexport abstract class AbstractSelect<P extends Props, S extends State> extends Component<P, S> {\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 <MarkupRenderer markup={render} />;\n } else {\n return render;\n }\n } else {\n return <MarkupRenderer markup={item[renderer]} />;\n }\n } else {\n return <MarkupRenderer markup={this.getItemLabel(item)} />;\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<S> | Array<DeepPartial<S>>, 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<S>, 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<string>();\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 = <ContextProvider context={this.context}>{vnode}</ContextProvider>;\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<HTMLElement>;\n dropdownRef: RefObject<HTMLElement>;\n class?: string;\n onClick?: MouseEventListener;\n onMouseDown?: MouseEventListener;\n onFocusOut?: EventListener;\n}\n\nexport class Dropdown extends Component<Props> {\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(<Fragment>{this.props.children}</Fragment>, 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<Props> = ({ height, width }) => {\n const viewBox = '0 0 ' + width + ' ' + height;\n return (\n <svg height={height} width={width} viewBox={viewBox} tabIndex={-1} focusable='false'>\n <path d='M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z' />\n </svg>\n );\n};\nToggle.displayName = 'Toggle';\n\nexport const Remove: FunctionComponent<Props> = ({ width, height }) => {\n const viewBox = '0 0 ' + width + ' ' + height;\n return (\n <svg height={height} width={width} viewBox={viewBox} tabIndex={-1} focusable='false'>\n <path d='M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z' />\n </svg>\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<Props> {\n private container: RefObject<HTMLElement>;\n private lastMouseClientX?: number;\n private lastMouseClientY?: number;\n private loadMore: RefObject<HTMLElement>;\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 <div class={style.body}>\n <div\n ref={this.container}\n onScroll={this.onScroll}\n class={style.searchResults}\n aria-busy={props.loading}\n >\n {props.loading && (\n <div class={cn(style.searchResultsLoading, style.searchResultsMessage)}>\n {dictionary.searchResultsLoading()}\n </div>\n )}\n {props.showNoSearchResultsFound && (\n <div class={cn(style.noSearchResults, style.searchResultsMessage)}>\n {dictionary.noSearchResults()}\n </div>\n )}\n {props.showMinimumCharactersError && (\n <div class={cn(style.searchResultsMinimumError, style.searchResultsMessage)}>\n {dictionary.minimumCharactersMessage(query.length, minimumCharacters)}\n </div>\n )}\n {results && results.length > 0 && (\n <div\n class={style.options}\n role='listbox'\n id={props.listboxDomId}\n aria-activedescendant={props.active >= 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 <div\n id={id}\n class={css}\n role='option'\n onClick={this.onResultClicked(result)}\n onMouseMove={this.onMouseMove(index)}\n aria-posinset={index + 1}\n aria-setsize={showLoadMoreResults ? results.length + 1 : results.length}\n aria-selected={active}\n aria-label={label}\n >\n <div class={style.content}>{render}</div>\n </div>\n );\n })}\n </div>\n )}\n {props.showLoadMoreResults && (\n <div\n ref={this.loadMore}\n class={cn(style.searchResultsMinimumError, style.searchResultsMessage)}\n >\n {dictionary.searchResultsLoading()}\n </div>\n )}\n </div>\n </div>\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<Props, State> {\n private containerRef: RefObject<HTMLDivElement>;\n private dropdownRef: RefObject<HTMLElement>;\n private bodyRef: RefObject<HTMLDivElement>;\n private valuesRef: RefObject<HTMLDivElement>;\n private searchRef: RefObject<HTMLInputElement>;\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 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 <Fragment>\n <div\n class={classes}\n ref={this.containerRef}\n onFocusCapture={this.onFocusIn}\n onBlurCapture={this.onFocusOut}\n tabIndex={-1}\n onMouseDown={this.focusSearchAndStopPropagation}\n >\n <div class={cn(style.body)} ref={this.bodyRef} onClick={this.onBodyClick}>\n <div id={instructionsDomId} class={cn(style.offscreen)} style={{ display: 'none' }}>\n {dictionary.multiSelectInstructions()}\n </div>\n {scope(() => {\n const activeDescendant = active >= 0 ? this.namespace + '-vl-' + active : undefined;\n if (values && values.length > 0) {\n return (\n <div\n ref={this.valuesRef}\n class={cn(style.multiValues)}\n tabIndex={tabIndex}\n role='listbox'\n aria-orientation='vertical'\n aria-multiselectable='true'\n aria-activedescendant={activeDescendant}\n aria-label={valuesLabel}\n aria-describedby={instructionsDomId}\n onFocus={this.onValuesFocus}\n onBlur={this.onValuesBlur}\n onKeyDown={this.onValuesKeyDown}\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 <div\n id={id}\n class={css}\n role='option'\n aria-selected={isSelected}\n aria-label={label}\n onMouseDown={(e: Event) => e.stopPropagation()}\n onClick={this.onValueClick(index)}\n >\n <div class={style.content}>{render}</div>\n </div>\n );\n })}\n </div>\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 <button\n className={className}\n onClick={this.onRemoveSelectedClick}\n onFocus={this.onRemoveSelectedFocus}\n disabled={disabled}\n aria-disabled={disabled}\n title={dictionary.removeButtonTitle()}\n >\n <span>\n <Remove width={20} height={20} />\n </span>\n </button>\n );\n })}\n <label htmlFor={undefined} className={style.offscreen}>\n {comboboxLabel}\n </label>\n <input\n type='text'\n ref={this.searchRef}\n value={search}\n class={cn(style.search)}\n role='combobox'\n aria-label={props.comboboxLabel}\n aria-autocomplete='list'\n aria-haspopup='true'\n aria-owns={resultsDomId}\n aria-controls={resultsDomId}\n aria-expanded={open ? 'true' : 'false'}\n aria-activedescendant={results.active >= 0 ? resultsNamespace + results.active : undefined}\n aria-busy={loading}\n onInput={this.onSearchInput}\n onKeyDown={this.onSearchKeyDown}\n onFocus={this.onSearchFocus}\n placeholder={placeholder}\n />\n <div\n className={cn(style.toggle)}\n aria-hidden={true}\n tabIndex={-1}\n onClick={this.onToggleClick}\n title={dictionary.expandButtonTitle()}\n >\n <Toggle height={20} width={20} />\n </div>\n </div>\n </div>\n {open && (\n <Dropdown\n class={cn(style.dropdown, style.multi)}\n onClick={this.onDropdownClick}\n controlRef={this.containerRef}\n dropdownRef={this.dropdownRef}\n >\n <ResultList\n namespace={resultsNamespace}\n minimumCharacters={minimumCharacters}\n dictionary={this.dictionary}\n itemLabel={this.getItemLabel}\n renderItem={this.renderResult}\n listboxDomId={resultsDomId}\n search={search}\n {...this.state.results}\n loading={loading}\n onResultClicked={this.onResultClicked}\n onMouseMove={this.onResultMouseMove}\n onLoadMore={this.onLoadMoreResults}\n />\n </Dropdown>\n )}\n </Fragment>\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<Props, State> {\n private containerRef: RefObject<HTMLElement>;\n private dropdownRef: RefObject<HTMLElement>;\n private bodyRef: RefObject<HTMLElement>;\n private searchRef: RefObject<HTMLInputElement>;\n private valueRef: RefObject<HTMLElement>;\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 <Fragment>\n <div\n class={classes}\n ref={this.containerRef}\n onFocusCapture={this.onFocusIn}\n onBlurCapture={this.onFocusOut}\n tabIndex={-1}\n onMouseDown={this.onContainerMouseDown}\n >\n <div class={cn(style.body)} ref={this.bodyRef}>\n <div\n aria-label={label}\n role='listbox'\n aria-activedescendant={optionDomId}\n aria-expanded='false'\n class={cn(style.value)}\n tabIndex={tabIndex}\n ref={this.valueRef}\n onKeyDown={this.onValueKeyDown}\n aria-describedby={showPlaceholder ? placeholderDomId : undefined}\n >\n {value && (\n <div\n class={style.item}\n role='option'\n aria-selected='true'\n aria-label={this.getItemLabel(value)}\n aria-setsize={-1}\n aria-posinset={-1}\n id={optionDomId}\n >\n <div class={style.content}>{this.renderValue(value)}</div>\n </div>\n )}\n {showPlaceholder && (\n <div class={cn(style.placeholder)} id={placeholderDomId}>\n {placeholder}\n </div>\n )}\n </div>\n {scope(() => {\n const disabled = !value;\n const clazz = cn(style.remove, { [style.offscreen]: !allowClear });\n return (\n <button\n class={clazz}\n onClick={this.onClearClick}\n onFocus={this.onClearFocus}\n onMouseDown={this.onClearMouseDown}\n disabled={disabled}\n aria-disabled={disabled}\n title={dictionary.clearButtonTitle()}\n >\n <span>\n <Remove width={20} height={20} />\n </span>\n </button>\n );\n })}\n <div className={style.toggle} aria-hidden={true} title={dictionary.expandButtonTitle()}>\n <Toggle height={20} width={20} />\n </div>\n </div>\n </div>\n {open && (\n <Dropdown\n class={cn(style.dropdown, style.single)}\n onMouseDown={this.onDropdownMouseDown}\n controlRef={this.containerRef}\n dropdownRef={this.dropdownRef}\n onFocusOut={this.onFocusOut}\n >\n <div>\n <input\n type='text'\n ref={this.searchRef}\n value={search}\n class={cn(style.search)}\n role='combobox'\n aria-autocomplete='list'\n aria-haspopup='true'\n aria-owns={resultsDomId}\n aria-controls={resultsDomId}\n aria-expanded={open ? 'true' : 'false'}\n aria-activedescendant={\n results.active >= 0 ? resultsNamespace + results.active : undefined\n }\n aria-busy={loading}\n onInput={this.onSearchInput}\n onKeyDown={this.onSearchKeyDown}\n onFocus={this.onSearchFocus}\n />\n <ResultList\n namespace={resultsNamespace}\n minimumCharacters={minimumCharacters}\n dictionary={this.dictionary}\n itemLabel={this.getItemLabel}\n renderItem={this.renderResult}\n listboxDomId={resultsDomId}\n search={search}\n {...this.state.results}\n loading={loading}\n onResultClicked={this.onResultClicked}\n onMouseMove={this.onResultMouseMove}\n onLoadMore={this.onLoadMoreResults}\n />\n </div>\n </Dropdown>\n )}\n </Fragment>\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<State>) => {\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 <MultiSelect\n containerClass={opts.containerClass}\n containerStyle={opts.containerStyle}\n placeholder={opts.placeholder}\n valuesLabel={opts.valuesLabel}\n comboboxLabel={opts.comboboxLabel}\n valueContent={opts.valueContent}\n resultContent={opts.resultContent}\n query={opts.query}\n quiet={opts.quiet}\n minimumCharacters={opts.minimumCharacters}\n openOnFocus={opts.openOnFocus}\n dictionary={opts.dictionary}\n tabIndex={opts.tabIndex}\n allowDuplicates={opts.allowDuplicates}\n values={this.state.values}\n onChange={this.onChange}\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 <SingleSelect\n label={opts.label}\n containerClass={opts.containerClass}\n containerStyle={opts.containerStyle}\n allowClear={opts.allowClear}\n placeholder={opts.placeholder}\n valueContent={opts.valueContent}\n resultContent={opts.resultContent}\n query={opts.query}\n quiet={opts.quiet}\n minimumCharacters={opts.minimumCharacters}\n openOnFocus={opts.openOnFocus} // TODO\n dictionary={opts.dictionary}\n tabIndex={opts.tabIndex}\n value={this.state.value}\n onChange={this.onChange}\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(<SingleSelectWrapper element={element} options={options} />, 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(<MultiSelectWrapper element={element} options={options} />, 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","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","showPlaceholder","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","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