blob: 923620caac1507bb0642fdc6d016466c9e83ab62 [file] [log] [blame]
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/cdk/clipboard",["exports","@angular/common","@angular/core"],e):e(((t=t||self).ng=t.ng||{},t.ng.cdk=t.ng.cdk||{},t.ng.cdk.clipboard={}),t.ng.common,t.ng.core)}(this,(function(t,e,o){"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var n=function(){function t(t,e){this._document=e;var o=this._textarea=this._document.createElement("textarea"),n=o.style;n.position="fixed",n.top=n.opacity="0",n.left="-999em",o.setAttribute("aria-hidden","true"),o.value=t,this._document.body.appendChild(o)}return t.prototype.copy=function(){var t=this._textarea,e=!1;try{if(t){var o=this._document.activeElement;t.select(),t.setSelectionRange(0,t.value.length),e=this._document.execCommand("copy"),o&&o.focus()}}catch(t){}return e},t.prototype.destroy=function(){var t=this._textarea;t&&(t.parentNode&&t.parentNode.removeChild(t),this._textarea=void 0)},t}(),r=function(){function t(t){this._document=t}return t.prototype.copy=function(t){var e=this.beginCopy(t),o=e.copy();return e.destroy(),o},t.prototype.beginCopy=function(t){return new n(t,this._document)},t}();
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/rprov=o.ɵɵdefineInjectable({factory:function t(){return new r(o.ɵɵinject(e.DOCUMENT))},token:r,providedIn:"root"}),r.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],r.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[e.DOCUMENT]}]}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var i,c=new o.InjectionToken("CDK_COPY_TO_CLIPBOARD_CONFIG"),p=c,a=function(){function t(t,e,n){this._clipboard=t,this._ngZone=e,this.text="",this.attempts=1,this.copied=new o.EventEmitter,this._pending=new Set,n&&null!=n.attempts&&(this.attempts=n.attempts)}return t.prototype.copy=function(t){var e=this;if(void 0===t&&(t=this.attempts),t>1){var o=t,n=this._clipboard.beginCopy(this.text);this._pending.add(n);var r=function(){var t=n.copy();t||!--o||e._destroyed?(e._currentTimeout=null,e._pending.delete(n),n.destroy(),e.copied.emit(t)):e._currentTimeout=e._ngZone.runOutsideAngular((function(){return setTimeout(r,1)}))};r()}else this.copied.emit(this._clipboard.copy(this.text))},t.prototype.ngOnDestroy=function(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach((function(t){return t.destroy()})),this._pending.clear(),this._destroyed=!0},t}();a.decorators=[{type:o.Directive,args:[{selector:"[cdkCopyToClipboard]",host:{"(click)":"copy()"}}]}],a.ctorParameters=function(){return[{type:r},{type:o.NgZone},{type:void 0,decorators:[{type:o.Optional},{type:o.Inject,args:[p]}]}]},a.propDecorators={text:[{type:o.Input,args:["cdkCopyToClipboard"]}],attempts:[{type:o.Input,args:["cdkCopyToClipboardAttempts"]}],copied:[{type:o.Output,args:["cdkCopyToClipboardCopied"]}]},(i=function i(){}).decorators=[{type:o.NgModule,args:[{declarations:[a],exports:[a]}]}],
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
t.CDK_COPY_TO_CLIPBOARD_CONFIG=c,t.CKD_COPY_TO_CLIPBOARD_CONFIG=p,t.CdkCopyToClipboard=a,t.Clipboard=r,t.ClipboardModule=i,t.PendingCopy=n,Object.defineProperty(t,"__esModule",{value:!0})}));