| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/coercion"),require("@angular/cdk/testing"),require("@angular/material/core/testing")):"function"==typeof define&&define.amd?define("@angular/material/autocomplete/testing",["exports","@angular/cdk/coercion","@angular/cdk/testing","@angular/material/core/testing"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.autocomplete=t.ng.material.autocomplete||{},t.ng.material.autocomplete.testing={}),t.ng.cdk.coercion,t.ng.cdk.testing,t.ng.material.core.testing)}(this,(function(t,e,n,r){"use strict"; |
| ***************************************************************************** */var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):function e(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function c(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}var l=function(t){function n(){var e=t.apply(this,u(arguments))||this;return e._documentRootLocator=e.documentRootLocatorFactory(),e}return i(n,t),n.prototype.getValue=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().getProperty("value")]}}))}))},n.prototype.isDisabled=function(){return a(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this.host()];case 1:return t=r.sent().getAttribute("disabled"),n=e.coerceBooleanProperty,[4,t];case 2:return[2,n.apply(void 0,[r.sent()])]}}))}))},n.prototype.focus=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().focus()]}}))}))},n.prototype.blur=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().blur()]}}))}))},n.prototype.isFocused=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().isFocused()]}}))}))},n.prototype.enterText=function(t){return a(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.host()];case 1:return[2,e.sent().sendKeys(t)]}}))}))},n.prototype.getOptions=function(t){return a(this,void 0,void 0,(function(){var e,n,r,o,i,a,c,u;return s(this,(function(s){switch(s.label){case 0:return n=(e=this._documentRootLocator).locatorForAll,o=(r=this._optionClass).with,a=(i=Object).assign,c=[Object.assign({},t||{})],u={},[4,this._getPanelSelector()];case 1:return[2,n.apply(e,[o.apply(r,[a.apply(i,c.concat([(u.ancestor=s.sent(),u)]))])])()]}}))}))},n.prototype.getOptionGroups=function(t){return a(this,void 0,void 0,(function(){var e,n,r,o,i,a,c,u;return s(this,(function(s){switch(s.label){case 0:return n=(e=this._documentRootLocator).locatorForAll,o=(r=this._optionGroupClass).with,a=(i=Object).assign,c=[Object.assign({},t||{})],u={},[4,this._getPanelSelector()];case 1:return[2,n.apply(e,[o.apply(r,[a.apply(i,c.concat([(u.ancestor=s.sent(),u)]))])])()]}}))}))},n.prototype.selectOption=function(t){return a(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,this.focus()];case 1:return n.sent(),[4,this.getOptions(t)];case 2:if(!(e=n.sent()).length)throw Error("Could not find a mat-option matching "+JSON.stringify(t));return[4,e[0].click()];case 3:return n.sent(),[2]}}))}))},n.prototype.isOpen=function(){return a(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this._getPanel()];case 1:return t=n.sent(),(e=!!t)?[4,t.hasClass(this._prefix+"-autocomplete-visible")]:[3,3];case 2:e=n.sent(),n.label=3;case 3:return[2,e]}}))}))},n.prototype._getPanel=function(){return a(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return e=(t=this._documentRootLocator).locatorForOptional,[4,this._getPanelSelector()];case 1:return[2,e.apply(t,[n.sent()])()]}}))}))},n.prototype._getPanelSelector=function(){return a(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return t="#",[4,this.host()];case 1:return[4,e.sent().getAttribute("aria-owns")];case 2:return[2,t+e.sent()]}}))}))},n}(n.ComponentHarness),p=function(t){function e(){var e=t.apply(this,u(arguments))||this;return e._prefix="mat",e._optionClass=r.MatOptionHarness,e._optionGroupClass=r.MatOptgroupHarness,e}return i(e,t),e.with=function(t){return void 0===t&&(t={}),new n.HarnessPredicate(e,t).addOption("value",t.value,(function(t,e){return n.HarnessPredicate.stringMatches(t.getValue(),e)}))},e}(l);p.hostSelector=".mat-autocomplete-trigger", |