1 line
139 KiB
Plaintext
1 line
139 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"],"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","export 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}\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\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 ItemRenderer = (string) | ((item: any, h: typeof createElement) => ComponentChild);\n\nexport type QueryFunction = (search: string, page: number, token: string) => Promise<QueryResult>;\n\nexport interface QueryResult {\n values: any[];\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 itemId: ToString | string;\n itemLabel: ToString | string;\n valueContent?: ItemRenderer;\n resultContent?: ItemRenderer;\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: any): string => {\n const id = this.props.itemId;\n if (typeof id === 'function') {\n return (id as ToString)(item);\n } else {\n return '' + item[id];\n }\n };\n\n public getItemLabel = (item: any): string => {\n const label = this.props.itemLabel;\n if (typeof label === 'function') {\n return (label as ToString)(item);\n } else {\n return '' + item[label];\n }\n };\n\n public renderValue = (item: any): ComponentChild => {\n return this.renderItem(item, 'valueContent');\n };\n\n public renderResult = (item: any): ComponentChild => {\n return this.renderItem(item, 'resultContent');\n };\n\n private renderItem = (item: any, rendererName: keyof Props): ComponentChild => {\n const renderer = this.props[rendererName] as ItemRenderer;\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}\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 style={{ maxHeight: '175px' }}\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}\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 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: any[];\n onChange: (values: any[]) => 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, {});\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 } = 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: any, 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 {props.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 />\n <div className={cn(style.toggle)} aria-hidden={true} tabIndex={-1} onClick={this.onToggleClick}>\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 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 break;\n case Key.Escape:\n if (open) {\n this.close();\n }\n event.preventDefault();\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}>\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 { ItemRenderer, 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 { Store } from './store';\n\nconst forceImportOfH = h;\n\nenum StoreKeys {\n targetElement = 'te'\n}\n\nexport interface Options {\n multiple: boolean;\n containerStyle?: string;\n containerClass?: string;\n hiddenValue?: (values: any, options: Options) => string;\n tabIndex?: number;\n itemId: ((item: any) => string) | string;\n itemLabel: ((item: any) => string) | string;\n valueContent?: ItemRenderer;\n resultContent?: ItemRenderer;\n query?: QueryFunction;\n ajax?: Ajax;\n quiet?: number;\n minimumCharacters?: number;\n openOnFocus?: boolean;\n dictionary?: string | Dictionary;\n\n value: any;\n values: any[];\n allowClear?: boolean;\n placeholder?: string;\n\n /** Single Select Label */\n label?: string;\n\n /** Multi Select Selected Values Listbox Label */\n valuesLabel?: string;\n /** Multi Select Add Value Combobox Label */\n comboboxLabel?: string;\n\n allowDuplicates: boolean;\n}\n\nconst DEFAULT_OPTIONS = {\n allowClear: false,\n dictionary: 'en_us',\n hiddenValue: (values: any, options: Options) => {\n const id = (item: any) => {\n if (typeof options.itemId === 'function') {\n return options.itemId(item);\n } else {\n return '' + item[options.itemId];\n }\n };\n\n if (values) {\n if (Array.isArray(values)) {\n if (values.length > 0) {\n return values.map(id).join(',');\n } else {\n return '';\n }\n } else {\n return id(values);\n }\n } else {\n return '';\n }\n },\n minimumCharacters: 0,\n multiple: false,\n openOnFocus: false\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: Options;\n },\n { values: any }\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 valuesLabel={opts.valuesLabel}\n comboboxLabel={opts.comboboxLabel}\n itemId={opts.itemId}\n itemLabel={opts.itemLabel}\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: Options;\n element: HTMLInputElement;\n },\n { value: any }\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 comboboxLabel={opts.comboboxLabel}\n containerClass={opts.containerClass}\n containerStyle={opts.containerStyle}\n allowClear={opts.allowClear}\n placeholder={opts.placeholder}\n itemId={opts.itemId}\n itemLabel={opts.itemLabel}\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 allowDuplicates={opts.allowDuplicates}\n value={this.state.value}\n onChange={this.onChange}\n />\n );\n }\n\n public onChange = (value: any) => {\n this.setState({ value });\n this.setHiddenValue(value);\n triggerOnChange(this.props.element, value);\n };\n\n private setHiddenValue(value: any) {\n const { element, options } = this.props;\n element.value = options.hiddenValue(value, options);\n }\n}\n\nfunction create<T>(element: HTMLInputElement, options: Options) {\n // TODO make sure we are attached to hidden input\n\n const store = Store.getStore(element);\n\n options = extend({}, DEFAULT_OPTIONS, options);\n if (!options.query && options.ajax) {\n options.query = createQueryFromAjax(options.ajax);\n }\n\n if (!options.tabIndex && element.tabIndex) {\n options.tabIndex = element.tabIndex;\n }\n\n if (element.getAttribute('s25-style')) {\n let style = options.containerStyle || '';\n if (style.length > 0) {\n style += ';';\n }\n style += element.getAttribute('s25-style');\n options.containerStyle = style;\n }\n\n if (element.getAttribute('s25-class')) {\n let clazz = options.containerClass || '';\n if (clazz.length > 0) {\n clazz += ' ';\n }\n clazz += element.getAttribute('s25-class');\n options.containerClass = clazz;\n }\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\n store.set(StoreKeys.targetElement, targetElement);\n\n // render the replacement\n if (options.multiple) {\n render(<MultiSelectWrapper element={element} options={options} />, parentElement, targetElement);\n } else {\n render(<SingleSelectWrapper element={element} options={options} />, parentElement, targetElement);\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 create,\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/search-controller';\nimport { extend } from '../../control/src/util';\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"],"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","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","itemId","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","maxHeight","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","_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","comboboxLabel","searchRef","onInput","onSearchInput","onSearchKeyDown","onSearchFocus","toggle","onToggleClick","dropdown","onDropdownClick","renderResult","onResultMouseMove","onLoadMoreResults","containerStyle","close","focus","receiver","relatedTarget","contains","openOnFocus","selectSearchResult","selectResult","getSelectedSearchResult","onChange","closeIfOpen","handleResultNavigationKeyDown","hasSearchResults","Enter","selectActiveResult","Escape","toggleValue","ArrowLeft","Left","ArrowRight","Right","PageDown","PageUp","Home","End","Space","Spacebar","allowClear","SingleSelect","placeholder","single","optionDomId","showPlaceholder","placeholderDomId","onContainerMouseDown","valueRef","onValueKeyDown","onClearClick","onClearFocus","onClearMouseDown","onDropdownMouseDown","getValueAsArray","activeElement","Tab","StoreKeys","Store","store","stores","delete","WeakMap","DEFAULT_OPTIONS","hiddenValue","triggerOnChange","createEvent","initEvent","dispatchEvent","MultiSelectWrapper","setHiddenValue","opts","valueContent","resultContent","SingleSelectWrapper","select25","getStore","ajax","term","process","json","JSON","parse","url","separator_1","entries","encodeURIComponent","request","XMLHttpRequest","onload","status","responseText","onerror","send","createQueryFromAjax","getAttribute","clazz","targetElement","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,EAAO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