From 86000cdb2c6074f9f7b49149498476b3c9b1dc2b Mon Sep 17 00:00:00 2001 From: CostlyDeveloper <55545296+CostlyDeveloper@users.noreply.github.com> Date: Sun, 2 May 2021 22:22:19 +0200 Subject: [PATCH] Added - toast features --- .../costlydeveloper-ngx-awesome-popup.umd.js | 732 +++++++++++------ ...stlydeveloper-ngx-awesome-popup.umd.js.map | 2 +- ...stlydeveloper-ngx-awesome-popup.umd.min.js | 4 +- ...developer-ngx-awesome-popup.umd.min.js.map | 2 +- dist/costlydeveloper-ngx-awesome-popup.d.ts | 24 +- ...ydeveloper-ngx-awesome-popup.metadata.json | 2 +- .../costlydeveloper-ngx-awesome-popup.js | 20 +- .../core/global-config.service.js | 141 ++-- dist/esm2015/ngx-awesome-popup/core/global.js | 86 +- .../ngx-awesome-popup.module.js | 9 +- .../confirm-box-wrapper.component.js | 13 +- .../dialog-wrapper.component.js | 2 +- .../types/toast-notification/core/model.js | 47 +- .../core/toast-notification-config.service.js | 29 +- .../core/toast-notification.service.js | 87 +- .../core/wrapper-abstraction.js | 103 +++ ...t-notification-simple-wrapper.component.js | 32 + .../toast-notification-wrapper.component.js | 89 +-- dist/esm2015/public_api.js | 40 +- .../costlydeveloper-ngx-awesome-popup.js | 703 ++++++++++------ .../costlydeveloper-ngx-awesome-popup.js.map | 2 +- .../core/global-config.service.d.ts | 10 +- dist/ngx-awesome-popup/core/global.d.ts | 22 +- .../types/toast-notification/core/model.d.ts | 40 +- .../toast-notification-config.service.d.ts | 2 + .../core/toast-notification.service.d.ts | 11 +- .../core/wrapper-abstraction.d.ts | 27 + ...notification-simple-wrapper.component.d.ts | 11 + .../toast-notification-wrapper.component.d.ts | 27 +- dist/package.json | 15 +- dist/public_api.d.ts | 38 +- .../core/global-config.service.ts | 331 ++++---- ngx-awesome-popup/core/global.ts | 756 ++++++++++-------- ngx-awesome-popup/ngx-awesome-popup.module.ts | 25 +- ngx-awesome-popup/styles/style.scss | 7 +- .../confirm-box-wrapper.component.ts | 30 +- .../types/toast-notification/core/model.ts | 574 ++++++------- .../core/toast-notification-config.service.ts | 86 +- .../core/toast-notification.service.ts | 341 +++++--- .../core/wrapper-abstraction.ts | 121 +++ ...notification-simple-wrapper.component.html | 135 ++++ ...notification-simple-wrapper.component.scss | 156 ++++ ...t-notification-simple-wrapper.component.ts | 28 + .../toast-notification-wrapper.component.html | 40 +- .../toast-notification-wrapper.component.scss | 61 +- .../toast-notification-wrapper.component.ts | 132 +-- public_api.ts | 42 +- 47 files changed, 3431 insertions(+), 1806 deletions(-) create mode 100644 dist/esm2015/ngx-awesome-popup/types/toast-notification/core/wrapper-abstraction.js create mode 100644 dist/esm2015/ngx-awesome-popup/types/toast-notification/toast-notification-simple-wrapper/toast-notification-simple-wrapper.component.js create mode 100644 dist/ngx-awesome-popup/types/toast-notification/core/wrapper-abstraction.d.ts create mode 100644 dist/ngx-awesome-popup/types/toast-notification/toast-notification-simple-wrapper/toast-notification-simple-wrapper.component.d.ts create mode 100644 ngx-awesome-popup/types/toast-notification/core/wrapper-abstraction.ts create mode 100644 ngx-awesome-popup/types/toast-notification/toast-notification-simple-wrapper/toast-notification-simple-wrapper.component.html create mode 100644 ngx-awesome-popup/types/toast-notification/toast-notification-simple-wrapper/toast-notification-simple-wrapper.component.scss create mode 100644 ngx-awesome-popup/types/toast-notification/toast-notification-simple-wrapper/toast-notification-simple-wrapper.component.ts 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