ngx-whatsapp-button
Version:
Library to display a whastapp floating contact button on the user page
98 lines (89 loc) • 5.13 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fortawesome/free-brands-svg-icons'), require('@angular/core'), require('@fortawesome/angular-fontawesome')) :
typeof define === 'function' && define.amd ? define('ngx-whatsapp-button', ['exports', '@fortawesome/free-brands-svg-icons', '@angular/core', '@fortawesome/angular-fontawesome'], factory) :
(factory((global['ngx-whatsapp-button'] = {}),global.freeBrandsSvgIcons,global.ng.core,global.angularFontawesome));
}(this, (function (exports,freeBrandsSvgIcons,i0,angularFontawesome) { 'use strict';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NgxWhastappButtonService = /** @class */ (function () {
function NgxWhastappButtonService() {
}
NgxWhastappButtonService.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] }
];
NgxWhastappButtonService.ctorParameters = function () { return []; };
/** @nocollapse */ NgxWhastappButtonService.ngInjectableDef = i0.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 = freeBrandsSvgIcons.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: i0.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: i0.Input, args: ['ngx_whatsapp_phone',] }],
ngx_whatsapp_text: [{ type: i0.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: i0.NgModule, args: [{
imports: [
angularFontawesome.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
*/
exports.NgxWhastappButtonService = NgxWhastappButtonService;
exports.NgxWhastappButtonComponent = NgxWhastappButtonComponent;
exports.NgxWhastappButtonModule = NgxWhastappButtonModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ngx-whatsapp-button.umd.js.map