diff --git a/dist/bundles/costlydeveloper-ngx-awesome-popup.umd.js b/dist/bundles/costlydeveloper-ngx-awesome-popup.umd.js index f417cbb..ef1721f 100644 --- a/dist/bundles/costlydeveloper-ngx-awesome-popup.umd.js +++ b/dist/bundles/costlydeveloper-ngx-awesome-popup.umd.js @@ -1,8 +1,8 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/animations'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/platform-browser/animations')) : - typeof define === 'function' && define.amd ? define('@costlydeveloper/ngx-awesome-popup', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/animations', '@angular/common', '@angular/platform-browser', '@angular/platform-browser/animations'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.costlydeveloper = global.costlydeveloper || {}, global.costlydeveloper['ngx-awesome-popup'] = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.animations, global.ng.common, global.ng.platformBrowser, global.ng.platformBrowser.animations)); -}(this, (function (exports, rxjs, operators, i0, animations, common, platformBrowser, animations$1) { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/platform-browser/animations')) : + typeof define === 'function' && define.amd ? define('@costlydeveloper/ngx-awesome-popup', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/animations', '@angular/common', '@angular/platform-browser', '@angular/platform-browser/animations'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.costlydeveloper = global.costlydeveloper || {}, global.costlydeveloper['ngx-awesome-popup'] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.animations, global.ng.common, global.ng.platformBrowser, global.ng.platformBrowser.animations)); +}(this, (function (exports, i0, rxjs, operators, animations, common, platformBrowser, animations$1) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) return e; @@ -338,6 +338,13 @@ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } + // @dynamic + var ServiceLocator = /** @class */ (function () { + function ServiceLocator() { + } + return ServiceLocator; + }()); + exports.DialogLayoutDisplay = void 0; (function (DialogLayoutDisplay) { DialogLayoutDisplay[DialogLayoutDisplay["NONE"] = 0] = "NONE"; @@ -371,6 +378,141 @@ ColorVariance[ColorVariance["SECONDARY"] = 8] = "SECONDARY"; })(ColorVariance || (ColorVariance = {})); + var GlobalConfigService = /** @class */ (function () { + function GlobalConfigService(userGlobalConfig) { + this.userGlobalConfig = userGlobalConfig; + this.productionGlobalConfig = new GlobalClass.GlobalConfig(); + this.authorGlobalConfig = new GlobalClass.GlobalConfig(); + this.userGeneratedConfig = new GlobalClass.GlobalUserConfig(userGlobalConfig); + // region *** author global config values (if there is no user input) *** + this.authorGlobalConfig.DisplayColor.Primary = null; // new GlobalClass.ColorProvider('#ff9e00'); + this.authorGlobalConfig.DisplayColor.Secondary = null; // new GlobalClass.ColorProvider('#989ea5'); + this.authorGlobalConfig.DisplayColor.Success = null; // new GlobalClass.ColorProvider('#3caea3'); + this.authorGlobalConfig.DisplayColor.Info = null; // new GlobalClass.ColorProvider('#2f8ee5'); + this.authorGlobalConfig.DisplayColor.Warning = null; // new GlobalClass.ColorProvider('#ffc107'); + this.authorGlobalConfig.DisplayColor.Danger = null; // new GlobalClass.ColorProvider('#e46464'); + this.authorGlobalConfig.DisplayColor.Light = null; // new GlobalClass.ColorProvider('#f8f9fa'); + this.authorGlobalConfig.DisplayColor.Dark = null; // new GlobalClass.ColorProvider('#343a40'); + // endregion + this.productionGlobalConfig.DisplayColor = this.authorGlobalConfig.DisplayColor; + // region *** global userConfig (user input app-module) *** + this.setUserColors(this.userGeneratedConfig.ColorList); + // endregion + this.setNodeStyles(this.productionGlobalConfig.DisplayColor); + } + GlobalConfigService.prototype.resetStyles = function () { + this.setUserColors(this.userGeneratedConfig.ColorList); + this.setNodeStyles(this.productionGlobalConfig.DisplayColor, true); + }; + GlobalConfigService.prototype.setNodeStyles = function (_ProductionColorTypes, _Reset) { + var _this = this; + if (_Reset === void 0) { _Reset = false; } + if (_Reset) { + var evolveDialogStyleNode = document.getElementById('ngx-awesome-popup-glob-styles'); + if (evolveDialogStyleNode) { + evolveDialogStyleNode.remove(); + } + } + this.setToastStyles(); + Object.keys(_ProductionColorTypes).forEach(function (key) { + if (_ProductionColorTypes[key]) { + _this.setButtonStyling(key, _ProductionColorTypes[key]); + _this.setIconStyling(key, _ProductionColorTypes[key]); + _this.setToastStyling(key, _ProductionColorTypes[key]); + _this.setDialogFrame(key, _ProductionColorTypes[key]); + if (ColorVariance[key.toUpperCase()] === ColorVariance.PRIMARY) { + _this.getSheet('ngx-awesome-popup-styles').addRule('.ngx-awesome-popup-overlay', "background: " + _ProductionColorTypes[key].TransparentDarkenVariance + "!important;"); + } + } + }); + }; + GlobalConfigService.prototype.setUserColors = function (_UserColorTypes) { + var _this = this; + if (typeof _UserColorTypes !== 'object') { + return; + } + var userKeys = Object.keys(_UserColorTypes); + var productionObjectKeys = Object.keys(this.productionGlobalConfig.DisplayColor); + userKeys.forEach(function (key) { + if (productionObjectKeys.find(function (tKey) { return tKey === key; })) { + if (_UserColorTypes[key]) { + var baseColorProvider = new GlobalClass.ColorProvider(_UserColorTypes[key]); + if (baseColorProvider.Base) { + _this.productionGlobalConfig.DisplayColor[key] = baseColorProvider; + } + } + else { + _this.productionGlobalConfig.DisplayColor[key] = null; + } + } + }); + }; + GlobalConfigService.prototype.getSheet = function (_StyleID) { + // Create the