UNPKG

primeng

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primeng.svg)](https://badge.fury.io/js/primeng) [![Build Status](https://travis-ci.org/primefaces/primeng.

2 lines 2.89 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("primeng/captcha",["exports","@angular/core","@angular/common"],e):e(((t=t||self).primeng=t.primeng||{},t.primeng.captcha={}),t.ng.core,t.ng.common)}(this,(function(t,e,n){"use strict";var i=this&&this.__decorate||function(t,e,n,i){var o,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},o=function(){function t(t,n){this.el=t,this._zone=n,this.siteKey=null,this.theme="light",this.type="image",this.size="normal",this.tabindex=0,this.language=null,this.initCallback="initRecaptcha",this.onResponse=new e.EventEmitter,this.onExpire=new e.EventEmitter,this._instance=null}return t.prototype.ngAfterViewInit=function(){var t=this;window.grecaptcha?window.grecaptcha.render?this.init():setTimeout((function(){t.init()}),100):window[this.initCallback]=function(){t.init()}},t.prototype.init=function(){var t=this;this._instance=window.grecaptcha.render(this.el.nativeElement.children[0],{sitekey:this.siteKey,theme:this.theme,type:this.type,size:this.size,tabindex:this.tabindex,hl:this.language,callback:function(e){t._zone.run((function(){return t.recaptchaCallback(e)}))},"expired-callback":function(){t._zone.run((function(){return t.recaptchaExpiredCallback()}))}})},t.prototype.reset=function(){null!==this._instance&&window.grecaptcha.reset(this._instance)},t.prototype.getResponse=function(){return null===this._instance?null:window.grecaptcha.getResponse(this._instance)},t.prototype.recaptchaCallback=function(t){this.onResponse.emit({response:t})},t.prototype.recaptchaExpiredCallback=function(){this.onExpire.emit()},t.prototype.ngOnDestroy=function(){null!=this._instance&&window.grecaptcha.reset(this._instance)},t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone}]},i([e.Input()],t.prototype,"siteKey",void 0),i([e.Input()],t.prototype,"theme",void 0),i([e.Input()],t.prototype,"type",void 0),i([e.Input()],t.prototype,"size",void 0),i([e.Input()],t.prototype,"tabindex",void 0),i([e.Input()],t.prototype,"language",void 0),i([e.Input()],t.prototype,"initCallback",void 0),i([e.Output()],t.prototype,"onResponse",void 0),i([e.Output()],t.prototype,"onExpire",void 0),t=i([e.Component({selector:"p-captcha",template:"<div></div>",changeDetection:e.ChangeDetectionStrategy.Default})],t)}(),r=function(){function t(){}return t=i([e.NgModule({imports:[n.CommonModule],exports:[o],declarations:[o]})],t)}();t.Captcha=o,t.CaptchaModule=r,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-captcha.umd.min.js.map