| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/testing"),require("@angular/material/select/testing"),require("@angular/cdk/coercion")):"function"==typeof define&&define.amd?define("@angular/material/paginator/testing",["exports","@angular/cdk/testing","@angular/material/select/testing","@angular/cdk/coercion"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.paginator=t.ng.material.paginator||{},t.ng.material.paginator.testing={}),t.ng.cdk.testing,t.ng.material.select.testing,t.ng.cdk.coercion)}(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 a(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 i(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{c(r.next(t))}catch(t){a(t)}}function u(t){try{c(r.throw(t))}catch(t){a(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(i,u)}c((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function c(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,a=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.goToNextPage=function(){return i(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this._nextButton()];case 1:return[2,t.sent().click()]}}))}))},e.prototype.goToPreviousPage=function(){return i(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this._previousButton()];case 1:return[2,t.sent().click()]}}))}))},e.prototype.goToFirstPage=function(){return i(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return[4,this._firstPageButton()];case 1:if(!(t=e.sent()))throw Error("Could not find first page button inside paginator. Make sure that `showFirstLastButtons` is enabled.");return[2,t.click()]}}))}))},e.prototype.goToLastPage=function(){return i(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return[4,this._lastPageButton()];case 1:if(!(t=e.sent()))throw Error("Could not find last page button inside paginator. Make sure that `showFirstLastButtons` is enabled.");return[2,t.click()]}}))}))},e.prototype.setPageSize=function(t){return i(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:return[4,this._select()];case 1:if(!(e=n.sent()))throw Error("Cannot find page size selector in paginator. Make sure that the `pageSizeOptions` have been configured.");return[2,e.clickOptions({text:""+t})]}}))}))},e.prototype.getPageSize=function(){return i(this,void 0,void 0,(function(){var t,e,n;return u(this,(function(o){switch(o.label){case 0:return[4,this._select()];case 1:return(t=o.sent())?(e=t.getValueText(),[3,4]):[3,2];case 2:return[4,this._pageSizeFallback()];case 3:e=o.sent().text(),o.label=4;case 4:return n=r.coerceNumberProperty,[4,e];case 5:return[2,n.apply(void 0,[o.sent()])]}}))}))},e.prototype.getRangeLabel=function(){return i(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,this._rangeLabel()];case 1:return[2,t.sent().text()]}}))}))},e}(e.ComponentHarness),f=function(t){function r(){var e=t.apply(this,s(arguments))||this;return e._nextButton=e.locatorFor(".mat-paginator-navigation-next"),e._previousButton=e.locatorFor(".mat-paginator-navigation-previous"),e._firstPageButton=e.locatorForOptional(".mat-paginator-navigation-first"),e._lastPageButton=e.locatorForOptional(".mat-paginator-navigation-last"),e._select=e.locatorForOptional(n.MatSelectHarness.with({ancestor:".mat-paginator-page-size"})),e._pageSizeFallback=e.locatorFor(".mat-paginator-page-size-value"),e._rangeLabel=e.locatorFor(".mat-paginator-range-label"),e}return a(r,t),r.with=function(t){return void 0===t&&(t={}),new e.HarnessPredicate(r,t)},r}(l);f.hostSelector=".mat-paginator", |
| t.MatPaginatorHarness=f,t._MatPaginatorHarnessBase=l,Object.defineProperty(t,"__esModule",{value:!0})})); |