ngx-whatsapp-button
Version:
Library to display a whastapp floating contact button on the user page
90 lines (83 loc) • 4.13 kB
JavaScript
import { faWhatsapp } from '@fortawesome/free-brands-svg-icons';
import { Injectable, Component, Input, NgModule, defineInjectable } from '@angular/core';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxWhastappButtonService = /** @class */ (function () {
function NgxWhastappButtonService() {
}
NgxWhastappButtonService.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
];
NgxWhastappButtonService.ctorParameters = function () { return []; };
/** @nocollapse */ NgxWhastappButtonService.ngInjectableDef = defineInjectable({ factory: function NgxWhastappButtonService_Factory() { return new NgxWhastappButtonService(); }, token: NgxWhastappButtonService, providedIn: "root" });
return NgxWhastappButtonService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxWhastappButtonComponent = /** @class */ (function () {
function NgxWhastappButtonComponent() {
this.ngx_whatsapp_url = 'https://api.whatsapp.com/send';
}
/**
* @return {?}
*/
NgxWhastappButtonComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
// we set the icon
this.ngx_whatsapp_icon = faWhatsapp;
//verify if we had a number
this.ngx_whatsapp_phone = (this.ngx_whatsapp_phone !== undefined) ? this.ngx_whatsapp_phone : '';
this.ngx_whatsapp_text = (this.ngx_whatsapp_text !== undefined) ? this.ngx_whatsapp_text : '';
this.ngx_whatsapp_url = this.ngx_whatsapp_url + "?phone=" + this.ngx_whatsapp_phone + "&text=" + this.ngx_whatsapp_text;
};
NgxWhastappButtonComponent.decorators = [
{ type: Component, args: [{
selector: 'jjva-ngx-whatsapp-button',
template: "<a target=\"_blank\" [href]=\"ngx_whatsapp_url\" class=\"ngx-whatsapp-button-float\">\n <div style=\"margin-top:20%;\"><fa-icon class=\" fa-2x ngx-whatsapp-button-my-float\" [icon]=\"ngx_whatsapp_icon\"></fa-icon></div>\n</a>\n",
styles: [".ngx-whatsapp-button-float{position:fixed;width:60px;height:60px;bottom:40px;right:40px;background-color:#25d366;color:#fff;border-radius:50px;text-align:center;box-shadow:2px 2px 3px #999}.ngx-whatsapp-button-my-float{margin-top:22px}"]
}] }
];
NgxWhastappButtonComponent.ctorParameters = function () { return []; };
NgxWhastappButtonComponent.propDecorators = {
ngx_whatsapp_phone: [{ type: Input, args: ['ngx_whatsapp_phone',] }],
ngx_whatsapp_text: [{ type: Input, args: ['ngx_whatsapp_text',] }]
};
return NgxWhastappButtonComponent;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxWhastappButtonModule = /** @class */ (function () {
function NgxWhastappButtonModule() {
}
NgxWhastappButtonModule.decorators = [
{ type: NgModule, args: [{
imports: [
FontAwesomeModule
],
declarations: [NgxWhastappButtonComponent],
exports: [NgxWhastappButtonComponent]
},] }
];
return NgxWhastappButtonModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { NgxWhastappButtonService, NgxWhastappButtonComponent, NgxWhastappButtonModule };
//# sourceMappingURL=ngx-whatsapp-button.js.map