UNPKG

nitrozen

Version:

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.1.3.

868 lines (834 loc) 103 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/material'), require('@angular/animations'), require('@angular/forms'), require('@angular/common/http')) : typeof define === 'function' && define.amd ? define('nitrozen', ['exports', '@angular/core', '@angular/common', '@angular/material', '@angular/animations', '@angular/forms', '@angular/common/http'], factory) : (global = global || self, factory(global.nitrozen = {}, global.ng.core, global.ng.common, global.ng.material, global.ng.animations, global.ng.forms, global.ng.common.http)); }(this, (function (exports, core, common, material, animations, forms, http) { 'use strict'; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } var ButtonComponent = /** @class */ (function () { function ButtonComponent() { this.clicked = new core.EventEmitter(); } ButtonComponent.prototype.ngOnInit = function () { this.theme = this.theme ? this.theme : 'primary'; }; ButtonComponent.prototype.clickedButton = function (event) { // this.showProgress = true; this.btnWidth = event.currentTarget['offsetWidth'] - 80; this.clicked.emit(event); }; __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "showProgress", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "isContained", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "theme", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "focused", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "large", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "isStroked", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "shouldBeDisabled", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonComponent.prototype, "showIcon", void 0); __decorate([ core.Output(), __metadata("design:type", core.EventEmitter) ], ButtonComponent.prototype, "clicked", void 0); ButtonComponent = __decorate([ core.Component({ selector: 'nitrozen-button', template: "<div [ngClass]=\"{\n 'primary-section': theme === 'primary' ,\n 'secondary-section': theme === 'accent'\n }\">\n<button mat-raised-button class=\"btn-nitrozen\" \n[ngClass]=\"{\n 'mat-stroked-button': isStroked,\n 'mat-flat-button':isContained,\n 'btn-focused':focused,\n 'hover-state':showProgress,\n 'large-btn':large\n }\"\n [disabled]=\"shouldBeDisabled\"\n (click)=\"clickedButton($event)\"\n\n>\n\n<div class=\"btn-icon-show\">\n <div class=\"btn-txt\" \n [ngClass]=\"{\n 'btn-show-icn': showIcon,\n 'btn-stroke-color':isStroked,\n 'btn-contained-color':isContained,\n 'btn-progress': !showProgress,\n 'btn-notprogress' : showProgress\n }\">\n <ng-content></ng-content>\n </div>\n\n\n <div class=\"btn-spin\" [ngClass]=\"{\n 'btn-spin-stroke': isStroked,\n 'btn-spin-contained':isContained,\n 'btn-progress': !showProgress,\n 'btn-notprogress' : showProgress\n }\" *ngIf=\"showIcon\">\n <img src=\"./../../assets/icons/Bag_Icon.svg\">\n</div>\n <div class=\"btn-spin\" [ngStyle]=\"{'width.px': btnWidth}\" [ngClass]=\"{\n 'btn-spin-stroke': isStroked,\n 'btn-spin-contained':isContained,\n 'btn-notprogress': !showProgress,\n 'btn-progress' : showProgress\n }\">\n <img *ngIf=\"isContained\" class=\"btn-spinner\" style=\"width: 50px;\" src=\"../../../assets/icons/loader-white-1.gif\">\n <img *ngIf=\"isStroked && theme === 'primary'\" class=\"btn-spinner\" style=\"width: 50px;\" src=\"../../../assets/icons/loader-green.gif\">\n <img *ngIf=\"isStroked && theme === 'accent'\" class=\"btn-spinner\" style=\"width: 50px;\" src=\"../../../assets/icons/loader-blue.gif\">\n <!-- <mat-progress-spinner\n class=\"btn-spinner\"\n [ngClass]=\"{'c-button__spinner--active': showProgress && !shouldBeDisabled}\"\n diameter=\"21\"\n mode=\"indeterminate\"\n ></mat-progress-spinner> -->\n</div>\n</div>\n</button>\n</div>\n\n", styles: [".btn-nitrozen{height:48px;border-radius:3px;cursor:pointer;padding:0 40px;box-shadow:none}.hover-state{pointer-events:none}.large-btn{height:64px!important;padding:0 65px!important}.btn-notprogress{opacity:0;-webkit-transition:opacity .25s ease-out;transition:opacity .25s ease-out;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.fx-wt{width:66.38px}.primary-section .mat-flat-button.btn-focused{text-decoration:underline;color:#fff;text-underline-position:under}.primary-section .mat-stroked-button.btn-focused{text-decoration:underline;color:#36cc9b;text-underline-position:under}.primary-section .mat-flat-button{background-color:#36cc9b}.primary-section .mat-flat-button:hover:not([disabled]){background-color:#2eb589}.primary-section .mat-flat-button:focus{text-decoration:underline;color:#fff;text-underline-position:under}.primary-section .mat-stroked-button{border:1px solid #36cc9b}.primary-section .mat-stroked-button:hover:not([disabled]){background-color:rgba(54,204,155,.12)}.primary-section .mat-stroked-button:focus{text-decoration:underline;color:#45cc9b;text-underline-position:under}.primary-section .btn-spin-stroke .mat-spinner circle,.primary-section .btn-spin-stroke ::ng-deep .mat-progress-spinner circle{stroke:#fff}.primary-section .btn-spin-contained .mat-spinner circle,.primary-section .btn-spin-contained ::ng-deep .mat-progress-spinner circle{stroke:#fff}.primary-section .mat-flat-button:disabled,.primary-section .mat-flat-button[disabled=disabled]{background-color:rgba(54,204,155,.4)!important}.primary-section .btn-txt{font-family:Poppins;font-size:16px;font-weight:700;line-height:25px;text-align:center}.primary-section .btn-stroke-color{color:#36cc9b}.primary-section .btn-contained-color{color:#fff}.primary-section .btn-spinner{text-align:center}.primary-section .btn-spin{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center}.primary-section .btn-fynd-icon{height:48px;width:190px;border-radius:3px;background-color:#36cc9b}.primary-section .btn-fynd-icon:hover:not([disabled]){background-color:#2eb589}.primary-section .btn-fynd-icon:focus{text-decoration:underline;color:#fff;text-underline-position:under}.primary-section .btn-show-icn{padding-left:10px}.primary-section .btn-icon-show{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse;-webkit-box-pack:center;justify-content:center}.secondary-section .mat-flat-button.btn-focused{text-decoration:underline;color:#fff;text-underline-position:under}.secondary-section .mat-stroked-button.btn-focused{text-decoration:underline;color:#5c6bdd;text-underline-position:under}.secondary-section .mat-flat-button{background-color:#5c6bdd}.secondary-section .mat-flat-button:hover:not([disabled]){background-color:#4f5ecc}.secondary-section .mat-flat-button:focus{text-decoration:underline;color:#fff;text-underline-position:under}.secondary-section .mat-stroked-button{border:1px solid #5c6bdd}.secondary-section .mat-stroked-button:hover:not([disabled]){background-color:rgba(79,94,204,.12)}.secondary-section .mat-stroked-button:focus{text-decoration:underline;color:#5c6bdd;text-underline-position:under}.secondary-section .btn-spin-stroke .mat-spinner circle,.secondary-section .btn-spin-stroke ::ng-deep .mat-progress-spinner circle{stroke:#5c6bdd}.secondary-section .btn-spin-contained .mat-spinner circle,.secondary-section .btn-spin-contained ::ng-deep .mat-progress-spinner circle{stroke:#fff}.secondary-section .mat-flat-button:disabled,.secondary-section .mat-flat-button[disabled=disabled]{background-color:rgba(92,107,221,.4)!important}.secondary-section .btn-txt{font-family:Poppins;font-size:16px;font-weight:700;line-height:25px;text-align:center}.secondary-section .btn-stroke-color{color:#5c6bdd}.secondary-section .btn-contained-color{color:#fff}.secondary-section .btn-spinner{text-align:center}.secondary-section .btn-spin{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center}.secondary-section .btn-fynd-icon{height:48px;width:190px;border-radius:3px;background-color:#5c6bdd}.secondary-section .btn-fynd-icon:hover:not([disabled]){background-color:#2eb589}.secondary-section .btn-fynd-icon:focus{text-decoration:underline;color:#fff;text-underline-position:under}.secondary-section .btn-show-icn{padding-left:10px}.secondary-section .btn-icon-show{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse;-webkit-box-pack:center;justify-content:center}"] }), __metadata("design:paramtypes", []) ], ButtonComponent); return ButtonComponent; }()); var ButtonModule = /** @class */ (function () { function ButtonModule() { } ButtonModule = __decorate([ core.NgModule({ declarations: [ButtonComponent], imports: [ common.CommonModule, material.MatButtonModule, material.MatProgressSpinnerModule ], exports: [ ButtonComponent, material.MatButtonModule, material.MatProgressSpinnerModule ] }) ], ButtonModule); return ButtonModule; }()); var ButtonTextComponent = /** @class */ (function () { function ButtonTextComponent() { this.clicked = new core.EventEmitter(); } ButtonTextComponent.prototype.ngOnInit = function () { // this.type = this.type ? this.type : ''; }; ButtonTextComponent.prototype.clickedButton = function (event) { this.clicked.emit(event); }; __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonTextComponent.prototype, "shouldBeDisabled", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonTextComponent.prototype, "theme", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonTextComponent.prototype, "focused", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonTextComponent.prototype, "prefixIcon", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonTextComponent.prototype, "postfixIcon", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], ButtonTextComponent.prototype, "type", void 0); __decorate([ core.Output(), __metadata("design:type", core.EventEmitter) ], ButtonTextComponent.prototype, "clicked", void 0); ButtonTextComponent = __decorate([ core.Component({ selector: 'nitrozen-button-text', template: "<div [ngClass]=\"{\n 'primary-section': theme === 'primary' ,\n 'secondary-section': theme === 'accent',\n 'warn-section':theme === 'warn'\n }\">\n <div>\n<button [ngClass]=\"{'btn-focused':focused,'btn-warn-thm':theme === 'warn','btn-prim-thm':theme === 'primary'}\" mat-button (click)=\"clickedButton($event)\" [disabled]=\"shouldBeDisabled\">\n\t<div>\n\t\t<span class=\"btn-spin\" *ngIf=\"prefixIcon\">\n <img src=\"./../../assets/icons/arrow-icon.svg\">\n</span>\n\t<span class=\"btn-txt\" [ngClass]=\"{\n 'primary-section': theme === 'primary' ,\n 'secondary-section': theme === 'accent',\n 'warn-section':theme === 'warn'\n }\">\n <ng-content></ng-content>\n </span>\n <span class=\"btn-spin-post\" *ngIf=\"postfixIcon\">\n <img src=\"./../../assets/icons/arrow-icon.svg\">\n</span>\n \n</div>\n</button>\n</div>\n</div>\n", styles: [".btn-txt{color:#4f5ecc;font-family:Poppins;font-size:16px;font-weight:700;text-align:center}button:disabled,button[disabled=disabled]{color:rgba(92,107,221,.5)!important;opacity:.5}.btn-text,.primary-section{color:#36cc9b!important}.btn-prim-thm:focus{text-decoration:underline;color:#36cc9b!important;text-underline-position:under}.warn-section .btn-txt{color:#fb406b!important;font-weight:700}.btn-warn-thm:focus{text-decoration:underline;color:#fb406b!important;text-underline-position:under}.mat-button{height:48px}.mat-button:hover{background-color:transparent!important}.btn-focused,.mat-button:focus{text-decoration:underline;color:#4f5ecc;text-underline-position:under}.btn-spin{padding-right:8px}.btn-spin-post{padding-left:8px}.hover-state{pointer-events:none}img{width:14px;height:12px}"] }), __metadata("design:paramtypes", []) ], ButtonTextComponent); return ButtonTextComponent; }()); var ButtonTextModule = /** @class */ (function () { function ButtonTextModule() { } ButtonTextModule = __decorate([ core.NgModule({ declarations: [ButtonTextComponent], imports: [ common.CommonModule, material.MatButtonModule, material.MatProgressSpinnerModule ], exports: [ ButtonTextComponent, material.MatButtonModule, material.MatProgressSpinnerModule ] }) ], ButtonTextModule); return ButtonTextModule; }()); var CheckboxComponent = /** @class */ (function () { function CheckboxComponent() { /** * Define if the checkbox is disabled */ this.disabled = false; /** * Define if the checkbox should be indeterminate */ this.indeterminate = false; this.change = new core.EventEmitter(); } CheckboxComponent.prototype.ngOnInit = function () { }; CheckboxComponent.prototype.onCheckboxStateChanged = function (e) { console.log(e); this.change.emit(e); }; __decorate([ core.Input(), __metadata("design:type", Boolean) ], CheckboxComponent.prototype, "checked", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], CheckboxComponent.prototype, "disabled", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], CheckboxComponent.prototype, "indeterminate", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], CheckboxComponent.prototype, "change", void 0); CheckboxComponent = __decorate([ core.Component({ selector: 'nitrozen-checkbox', template: "<mat-checkbox \nclass=\"nitro-checkbox\" \n[checked]=\"checked\" \n[indeterminate]=\"indeterminate\"\n[disabled]=\"disabled\"\n(change)=\"onCheckboxStateChanged($event)\">\n\n\n<ng-content></ng-content>\n\n</mat-checkbox>", styles: [""] }), __metadata("design:paramtypes", []) ], CheckboxComponent); return CheckboxComponent; }()); var CheckboxModule = /** @class */ (function () { function CheckboxModule() { } CheckboxModule = __decorate([ core.NgModule({ declarations: [CheckboxComponent], imports: [ common.CommonModule, material.MatCheckboxModule ], exports: [CheckboxComponent, material.MatCheckboxModule] }) ], CheckboxModule); return CheckboxModule; }()); var RadioButtonComponent = /** @class */ (function () { function RadioButtonComponent() { /** * Define if the checkbox is disabled */ this.disabled = false; this.change = new core.EventEmitter(); } RadioButtonComponent.prototype.ngOnInit = function () { }; RadioButtonComponent.prototype.onRadioButtonStateChanged = function (e) { console.log(e); this.change.emit(e); }; __decorate([ core.Input(), __metadata("design:type", Boolean) ], RadioButtonComponent.prototype, "selected", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], RadioButtonComponent.prototype, "disabled", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], RadioButtonComponent.prototype, "change", void 0); RadioButtonComponent = __decorate([ core.Component({ selector: 'nitrozen-radio-button', template: " <mat-radio-button color=\"primary\"\n[disabled]=\"disabled\"\n(change)=\"onRadioButtonStateChanged($event)\">\n\n\n<ng-content></ng-content>\n</mat-radio-button> \n", styles: ["::ng-deep .mat-radio-label-content{padding-left:12px!important;font-family:Poppins!important}"] }), __metadata("design:paramtypes", []) ], RadioButtonComponent); return RadioButtonComponent; }()); var RadioButtonModule = /** @class */ (function () { function RadioButtonModule() { } RadioButtonModule = __decorate([ core.NgModule({ declarations: [RadioButtonComponent], imports: [ common.CommonModule, material.MatRadioModule ], exports: [RadioButtonComponent, material.MatRadioModule] }) ], RadioButtonModule); return RadioButtonModule; }()); var InputTypes; (function (InputTypes) { InputTypes["text"] = "text"; InputTypes["number"] = "number"; InputTypes["password"] = "password"; InputTypes["textarea"] = "textarea"; })(InputTypes || (InputTypes = {})); var nextId = 0; var INPUT_VALUE_ACCESSOR = { provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef(function () { return InputComponent; }), multi: true }; var INPUT_VALIDATORS = { provide: forms.NG_VALIDATORS, useExisting: core.forwardRef(function () { return InputComponent; }), multi: true }; var InputComponent = /** @class */ (function () { function InputComponent(cd) { this.cd = cd; this.label = ''; this.type = InputTypes.text; this.blocked = false; this.placeholder = ''; this.disabled = false; this.search = false; this.showSuccess = false; this.noneditable = false; this.required = false; this.requiredIndicator = '*'; this.tooltip = false; this.passwordToggleEnabled = false; this.passwordTextVisible = false; this.autoSelect = false; this.autofocus = false; this.autocomplete = false; this.autocorrect = false; this.spellcheck = false; this.change = new core.EventEmitter(); this.blur = new core.EventEmitter(); this.focus = new core.EventEmitter(); this.keyup = new core.EventEmitter(); this.click = new core.EventEmitter(); this.getHostCssClasses = 'ngx-input'; this.focused = false; this.onTouchedCallback = function () { // placeholder }; this.onChangeCallback = function () { // placeholder }; } Object.defineProperty(InputComponent.prototype, "value", { get: function () { return this._value; }, set: function (val) { if (val !== this._value) { this._value = val; this.onChangeCallback(this._value); } }, enumerable: true, configurable: true }); Object.defineProperty(InputComponent.prototype, "focusedOrDirty", { get: function () { if (this.focused) { return true; } if (typeof this.value === 'string') { return this.value && this.value.length; } return typeof this.value !== 'undefined' && this.value !== null; }, enumerable: true, configurable: true }); Object.defineProperty(InputComponent.prototype, "isTouched", { get: function () { return this.inputModel ? this.inputModel.touched : false; }, enumerable: true, configurable: true }); Object.defineProperty(InputComponent.prototype, "labelState", { get: function () { if (this.placeholder) return 'outside'; if (this.focusedOrDirty) return 'outside'; return 'inside'; }, enumerable: true, configurable: true }); Object.defineProperty(InputComponent.prototype, "underlineState", { get: function () { if (this.focused) return 'expanded'; return 'collapsed'; }, enumerable: true, configurable: true }); Object.defineProperty(InputComponent.prototype, "requiredIndicatorView", { get: function () { if (!this.requiredIndicator || !this.required) return ''; return this.requiredIndicator; }, enumerable: true, configurable: true }); Object.defineProperty(InputComponent.prototype, "element", { get: function () { if (this.type === InputTypes.textarea) return this.textareaControl; return this.inputControl; }, enumerable: true, configurable: true }); InputComponent.prototype.validate = function (c) { if (this.type !== 'number') { return null; } return __assign({}, forms.Validators.max(this.max)(c), forms.Validators.min(this.min)(c)); }; InputComponent.prototype.ngOnInit = function () { if (!this.value) this.value = ''; }; InputComponent.prototype.ngAfterViewInit = function () { var _this = this; if (this.autofocus) { setTimeout(function () { _this.element.nativeElement.focus(); }); } // sometimes the label doesn't update on load setTimeout(function () { return _this.cd.markForCheck(); }); }; InputComponent.prototype.ngOnChanges = function (changes) { if ('max' in changes || 'min' in changes) { this.onChangeCallback(this._value); } }; InputComponent.prototype.onChange = function (event) { event.stopPropagation(); this.change.emit(this.value); }; InputComponent.prototype.onKeyUp = function (event) { event.stopPropagation(); this.keyup.emit(event); }; InputComponent.prototype.onFocus = function (event) { var _this = this; event.stopPropagation(); if (this.autoSelect) { setTimeout(function () { _this.element.nativeElement.select(); }); } this.focused = true; this.focus.emit(event); this.onTouchedCallback(); }; InputComponent.prototype.onBlur = function (event) { event.stopPropagation(); this.focused = false; this.blur.emit(event); }; InputComponent.prototype.writeValue = function (val) { if (val !== this._value) { this._value = val; } }; InputComponent.prototype.registerOnChange = function (fn) { this.onChangeCallback = fn; }; InputComponent.prototype.registerOnTouched = function (fn) { this.onTouchedCallback = fn; }; InputComponent.prototype.togglePassword = function () { var _this = this; this.passwordTextVisible = !this.passwordTextVisible; setTimeout(function () { if (_this.passwordTextVisible) { _this.passwordControl.nativeElement.focus(); } else { _this.element.nativeElement.focus(); } }); }; InputComponent.prototype.setDisabledState = function (isDisabled) { this.disabled = isDisabled; }; InputComponent.ctorParameters = function () { return [ { type: core.ChangeDetectorRef } ]; }; __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "id", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "name", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "label", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "type", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "hint", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "error", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "blocked", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "success", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "placeholder", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "disabled", void 0); __decorate([ core.Input(), __metadata("design:type", Number) ], InputComponent.prototype, "tabindex", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "search", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "showSuccess", void 0); __decorate([ core.Input(), __metadata("design:type", String) ], InputComponent.prototype, "righttext", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "noneditable", void 0); __decorate([ core.Input(), __metadata("design:type", Number) ], InputComponent.prototype, "min", void 0); __decorate([ core.Input(), __metadata("design:type", Number) ], InputComponent.prototype, "max", void 0); __decorate([ core.Input(), __metadata("design:type", Number) ], InputComponent.prototype, "minlength", void 0); __decorate([ core.Input(), __metadata("design:type", Number) ], InputComponent.prototype, "maxlength", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "required", void 0); __decorate([ core.Input(), __metadata("design:type", Object) ], InputComponent.prototype, "requiredIndicator", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "tooltip", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "passwordToggleEnabled", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "passwordTextVisible", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "autoSelect", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "autofocus", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "autocomplete", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "autocorrect", void 0); __decorate([ core.Input(), __metadata("design:type", Boolean) ], InputComponent.prototype, "spellcheck", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], InputComponent.prototype, "change", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], InputComponent.prototype, "blur", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], InputComponent.prototype, "focus", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], InputComponent.prototype, "keyup", void 0); __decorate([ core.Output(), __metadata("design:type", Object) ], InputComponent.prototype, "click", void 0); __decorate([ core.HostBinding('class'), __metadata("design:type", Object) ], InputComponent.prototype, "getHostCssClasses", void 0); __decorate([ core.HostBinding('class.ng-dirty'), __metadata("design:type", Object), __metadata("design:paramtypes", []) ], InputComponent.prototype, "focusedOrDirty", null); __decorate([ core.HostBinding('class.ng-touched'), __metadata("design:type", Boolean), __metadata("design:paramtypes", []) ], InputComponent.prototype, "isTouched", null); __decorate([ core.ViewChild('inputControl'), __metadata("design:type", core.ElementRef) ], InputComponent.prototype, "inputControl", void 0); __decorate([ core.ViewChild('inputModel'), __metadata("design:type", forms.NgModel) ], InputComponent.prototype, "inputModel", void 0); __decorate([ core.ViewChild('textareaControl'), __metadata("design:type", core.ElementRef) ], InputComponent.prototype, "textareaControl", void 0); __decorate([ core.ViewChild('passwordControl'), __metadata("design:type", core.ElementRef) ], InputComponent.prototype, "passwordControl", void 0); InputComponent = __decorate([ core.Component({ selector: 'nitrozen-input', providers: [INPUT_VALUE_ACCESSOR, INPUT_VALIDATORS], encapsulation: core.ViewEncapsulation.None, animations: [ animations.trigger('labelState', [ animations.state('inside', animations.style({ 'font-size': '1em', top: '0' })), animations.state('outside', animations.style({ 'font-size': '.7rem', top: '-15px' })), animations.transition('inside => outside', animations.animate('150ms ease-out')), animations.transition('outside => inside', animations.animate('150ms ease-out')) ]), animations.trigger('underlineState', [ animations.state('collapsed', animations.style({ width: '0%' })), animations.state('expanded', animations.style({ width: '100%' })), animations.transition('collapsed => expanded', animations.animate('150ms ease-out')), animations.transition('expanded => collapsed', animations.animate('150ms ease-out')) ]) ], template: "<div class=\"nitro-input-wrap\" [ngClass]=\"{'input-noneditable':noneditable}\">\n <div class=\"ngx-input-flex-wrap\">\n \n <div class=\"nitro-input-flex-wrap-inner\">\n <div class=\"nitro-input-box-wrap\">\n <div class=\"prefix-icon\">\n <ng-content select=\"nitrozen-input-prefix\"></ng-content>\n </div>\n <textarea [ngClass]=\"{'search-txt': search }\"\n *ngIf=\"type === 'textarea'\"\n class=\"ngx-input-textarea\"\n rows=\"1\"\n autosize\n [(ngModel)]=\"value\"\n [id]=\"id\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [attr.tabindex]=\"tabindex\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.autocorrect]=\"autocorrect\"\n [attr.spellcheck]=\"spellcheck\"\n [minlength]=\"minlength\"\n [maxlength]=\"maxlength\"\n [required]=\"required\"\n (change)=\"onChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (click)=\"click.emit($event)\"\n #inputModel=\"ngModel\"\n #textareaControl\n >\n </textarea>\n <input [ngClass]=\"{'search-txt': search,'blocked':blocked }\"\n *ngIf=\"type !== 'textarea'\"\n class=\"ngx-input-box\"\n [(ngModel)]=\"value\"\n [hidden]=\"passwordTextVisible\"\n [id]=\"id\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [type]=\"type\"\n [min]=\"'' + min\"\n [max]=\"'' + max\"\n [minlength]=\"minlength\"\n [maxlength]=\"maxlength\"\n [attr.tabindex]=\"tabindex\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.autocorrect]=\"autocorrect\"\n [attr.spellcheck]=\"spellcheck\"\n (change)=\"onChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (click)=\"click.emit($event)\"\n [required]=\"required\"\n #inputModel=\"ngModel\"\n #inputControl\n />\n <input [ngClass]=\"{'search-txt': search }\"\n *ngIf=\"passwordToggleEnabled\"\n [hidden]=\"!passwordTextVisible\"\n type=\"text\"\n class=\"ngx-input-box\"\n type=\"text\"\n [id]=\"id + '-password'\"\n [placeholder]=\"placeholder\"\n [name]=\"name\"\n [disabled]=\"disabled\"\n [minlength]=\"minlength\"\n [maxlength]=\"maxlength\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.autocorrect]=\"autocorrect\"\n [attr.spellcheck]=\"spellcheck\"\n [attr.tabindex]=\"tabindex\"\n [(ngModel)]=\"value\"\n (change)=\"onChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (click)=\"click.emit($event)\"\n [required]=\"required\"\n #inputTextModel=\"ngModel\"\n #passwordControl\n />\n <span\n *ngIf=\"type === 'password' && passwordToggleEnabled\"\n class=\"icon-eye\"\n title=\"Toggle Text Visibility\"\n (click)=\"togglePassword()\"\n >\n </span>\n <div class=\"nitro-input-label\">\n <span [innerHTML]=\"label\"></span> <span [innerHTML]=\"requiredIndicatorView\"></span>\n <span class=\"nitro-tool\" *ngIf=\"tooltip\"> <img src=\"../../../assets/icons/tooltip.svg\"></span>\n </div>\n <div class=\"suffix-icon\">\n <ng-content select=\"nitrozen-input-suffix\"></ng-content>\n </div>\n </div>\n \n </div>\n \n </div>\n <!-- <div class=\"ngx-input-underline\">\n <div class=\"underline-fill\"></div>\n </div> -->\n <div class=\"ngx-input-hint\" *ngIf=\"hint\">\n <!-- <ng-content select=\"ngx-input-hint\"></ng-content> -->\n <span [innerHTML]=\"hint\"></span>\n </div>\n <div class=\"nitro-cmp\">\n <div>\n <div class=\"nitro-input-error\" [ngClass]=\"{'is-focused':focused}\" *ngIf=\"error\">\n <!-- <ng-content select=\"ngx-input-hint\"></ng-content> -->\n <span [innerHTML]=\"error\"></span>\n </div>\n <div class=\"nitro-input-success\" *ngIf=\"success\">\n <!-- <ng-content select=\"ngx-input-hint\"></ng-content> -->\n <div class=\"nito-ss-img\" *ngIf=\"showSuccess\">\n <img src=\"../../../assets/icons/check-circle.svg\">\n </div>\n <div class=\"ss-txt\" *ngIf=\"showSuccess\">\n <span [innerHTML]=\"success\"></span>\n </div>\n </div>\n </div>\n <div class=\"ngx-input-hint\" *ngIf=\"righttext\">\n <span [innerHTML]=\"righttext\"></span>\n </div>\n </div>\n </div>\n\n\n\n", styles: [".nitro-input-label{color:#9b9b9b;font-family:Poppins;font-size:12px;font-weight:500;line-height:21px;padding-bottom:4px}.nitro-tool{width:24px;height:24px;text-align:center;padding-left:4px}.input-noneditable{opacity:.4;pointer-events:none}inpu