intelica-library-components 1.1.47 → 1.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, Injectable, signal, Pipe, Component, TemplateRef, ContentChild, Input, Directive, EventEmitter, ContentChildren, Output, HostListener, forwardRef, ViewChild, PLATFORM_ID, Inject, output, Optional, Host } from '@angular/core';
3
- import { getCookie, Cookies, setCookie } from 'typescript-cookie';
3
+ import { getCookie, setCookie, Cookies } from 'typescript-cookie';
4
4
  import * as i1$4 from '@angular/common/http';
5
5
  import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
6
6
  import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, delay, tap as tap$1, map, firstValueFrom } from 'rxjs';
@@ -60,6 +60,15 @@ import Aura from '@primeng/themes/aura';
60
60
  import { definePreset } from '@primeng/themes';
61
61
  import * as signalR from '@microsoft/signalr';
62
62
 
63
+ function GetCookieAttributes(environment) {
64
+ const domain = window.location.hostname
65
+ .split(".")
66
+ .slice(environment == "main" ? -2 : -3)
67
+ .join(".");
68
+ const secure = !domain.includes("localhost");
69
+ return { domain: domain, path: "/", secure: secure };
70
+ }
71
+
63
72
  class ConfigService {
64
73
  Http = inject(HttpClient);
65
74
  environment;
@@ -112,33 +121,46 @@ class GlobalTermService {
112
121
  TermsReady = signal(false, ...(ngDevMode ? [{ debugName: "TermsReady" }] : []));
113
122
  PageRoot = "";
114
123
  termService = inject(TermService);
124
+ configService = inject(ConfigService);
125
+ languageEvent = "languagechange";
126
+ languageCookie = "language";
127
+ onBrowserLanguageChange = () => {
128
+ const languageCode = this.getLanguageFromBrowser();
129
+ setCookie(this.languageCookie, languageCode, GetCookieAttributes(this.configService.environment?.environment ?? ""));
130
+ this.refreshTerms(languageCode);
131
+ };
132
+ constructor() {
133
+ window.addEventListener(this.languageEvent, this.onBrowserLanguageChange);
134
+ }
115
135
  Initialize(pageRoot) {
116
- let languageCode = getCookie("language") ?? "EN";
117
136
  this.PageRoot = pageRoot;
137
+ const languageCode = this.getLanguageFromBrowser();
138
+ setCookie(this.languageCookie, languageCode, GetCookieAttributes(this.configService.environment?.environment ?? ""));
118
139
  if (pageRoot == "") {
119
140
  this.TermsReady.set(true);
120
141
  return;
121
142
  }
122
- this.termService.GetTerms(languageCode, pageRoot).subscribe(response => {
123
- this.terms = response;
143
+ this.refreshTerms(languageCode);
144
+ }
145
+ refreshTerms(languageCode) {
146
+ if (this.PageRoot == "") {
124
147
  this.TermsReady.set(true);
125
- this.SetTerms();
148
+ return;
149
+ }
150
+ this.TermsReady.set(false);
151
+ this.termService.GetTerms(languageCode, this.PageRoot).subscribe(response => {
126
152
  this.languageCode = languageCode;
153
+ this.terms = response;
154
+ this.TermsReady.set(true);
127
155
  });
128
156
  }
129
- async SetTerms() {
130
- while (true) {
131
- await sleep$1(10);
132
- if (document.querySelectorAll("[data-term]").length > 1)
133
- break;
134
- }
135
- let textsToChange = document.querySelectorAll("[data-term]");
136
- textsToChange.forEach(async (element) => {
137
- let dataValue = element.getAttribute("data-term");
138
- let newText = this.terms.find(x => x.termName == dataValue)?.termValue ?? "";
139
- element.innerHTML = newText;
140
- element.setAttribute("placeholder", newText);
141
- });
157
+ getLanguageFromBrowser() {
158
+ const browserLanguage = (navigator.language || "en").toLowerCase();
159
+ if (browserLanguage.startsWith("es"))
160
+ return "ES";
161
+ if (browserLanguage.startsWith("en"))
162
+ return "EN";
163
+ return "EN";
142
164
  }
143
165
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalTermService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
144
166
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalTermService, providedIn: "root" });
@@ -146,17 +168,13 @@ class GlobalTermService {
146
168
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalTermService, decorators: [{
147
169
  type: Injectable,
148
170
  args: [{ providedIn: "root" }]
149
- }] });
150
- function sleep$1(ms) {
151
- return new Promise(resolve => setTimeout(resolve, ms));
152
- }
171
+ }], ctorParameters: () => [] });
153
172
 
154
173
  // import GlobalTermService from "../services/globalTerm.service";
155
174
  class TermPipe {
156
175
  globalTermService = inject(GlobalTermService);
157
176
  transform(termName, language, mode = 1) {
158
- let term = this.globalTermService.terms.find((x) => x.termName == termName)
159
- ?.termValue ?? "-";
177
+ let term = this.globalTermService.terms.find(x => x.termName == termName)?.termValue ?? "-";
160
178
  if (mode == 2)
161
179
  term = term.substring(0, 1);
162
180
  if (mode == 3)
@@ -468,15 +486,6 @@ const ErrorInterceptor = (req, next) => {
468
486
  }
469
487
  };
470
488
 
471
- function GetCookieAttributes(environment) {
472
- const domain = window.location.hostname
473
- .split(".")
474
- .slice(environment == "main" ? -2 : -3)
475
- .join(".");
476
- const secure = !domain.includes("localhost");
477
- return { domain: domain, path: "/", secure: secure };
478
- }
479
-
480
489
  const RefreshTokenInterceptor = (req, next) => {
481
490
  const skip = req.headers.has("Skip-Interceptor");
482
491
  if (skip) {
@@ -6010,11 +6019,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
6010
6019
 
6011
6020
  class IntelicaAlertComponent {
6012
6021
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IntelicaAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6013
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: IntelicaAlertComponent, isStandalone: true, selector: "intelica-alert", ngImport: i0, template: "<!-- \r\n Clases Modificadoras para estados:\r\n prConfirmDialog--warning\r\n prConfirmDialog--danger\r\n prConfirmDialog--error\r\n prConfirmDialog--success\r\n prConfirmDialog--default\r\n-->\r\n<p-confirmDialog styleClass=\"prConfirmDialog\" key=\"intelica-alert-dialog\" [closable]=\"false\" [visible]=\"undefined\">\r\n <!-- \r\n We use the headless template. \r\n 'message' contains the confirmation object.\r\n 'message.data' contains our custom 'presentationData' object from AlertService.\r\n -->\r\n <ng-template pTemplate=\"headless\" let-message let-onAccept=\"onAccept\" let-onReject=\"onReject\">\r\n <div class=\"prConfirmDialog__content\">\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <div class=\"prConfirmDialog__close\">\r\n <p-button icon=\"pi pi-times\" class=\"prButton\" [rounded]=\"false\" [text]=\"true\" (onClick)=\"onReject()\"\r\n ariaLabel=\"Cerrar\"></p-button>\r\n </div>\r\n }\r\n\r\n <!-- Icon -->\r\n <div class=\"prConfirmDialog__icon\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\"\r\n alt=\"Alert icon\" />\r\n } @else {\r\n <!-- <i [class]=\"message.data.iconClass\" [style.color]=\"message.data.iconColor\"></i> -->\r\n <i [class]=\"message.data.iconClass\"></i>\r\n }\r\n </div>\r\n <div class=\"prConfirmDialog__details\">\r\n <!-- Title -->\r\n <!-- <h2 class=\"prConfirmDialog__title\" [style.color]=\"message.data.titleColor\">{{ message.header }}</h2> -->\r\n <h2 class=\"prConfirmDialog__title\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <!-- <p class=\"prConfirmDialog__subtitle\" [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\">{{ message.message }}</p> -->\r\n <p class=\"prConfirmDialog__subtitle\">{{ message.message }}</p>\r\n }\r\n </div>\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <!-- <div class=\"prConfirmDialog__details\" [innerHTML]=\"message.data.config.htmlContent\"\r\n [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"></div> -->\r\n <div class=\"prConfirmDialog__text\" [innerHTML]=\"message.data.config.htmlContent\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div class=\"prConfirmDialog__footer\">\r\n <!-- Confirm Button -->\r\n <p-button class=\"prButton\" [label]=\"message.data.confirmText\" (onClick)=\"onAccept()\" />\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button class=\"prButton\" [label]=\"message.data.cancelText\" severity=\"secondary\" [outlined]=\"true\"\r\n (onClick)=\"onReject()\" />\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i1$3.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }] });
6022
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: IntelicaAlertComponent, isStandalone: true, selector: "intelica-alert", ngImport: i0, template: "<!-- \r\n Clases Modificadoras para estados:\r\n prConfirmDialog--warning\r\n prConfirmDialog--danger\r\n prConfirmDialog--error\r\n prConfirmDialog--success\r\n prConfirmDialog--default\r\n-->\r\n<p-confirmDialog #cd\r\n [styleClass]=\"'prConfirmDialog ' + ($any(cd.confirmation)?.data?.config?.type ? ' prConfirmDialog--' + $any(cd.confirmation).data.config.type : ' prConfirmDialog--default')\"\r\n key=\"intelica-alert-dialog\" [closable]=\"false\" [visible]=\"undefined\">\r\n <!-- \r\n We use the headless template. \r\n 'message' contains the confirmation object.\r\n 'message.data' contains our custom 'presentationData' object from AlertService.\r\n -->\r\n <ng-template pTemplate=\"headless\" let-message let-onAccept=\"onAccept\" let-onReject=\"onReject\">\r\n <div class=\"prConfirmDialog__content\">\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <div class=\"prConfirmDialog__close\">\r\n <p-button icon=\"pi pi-times\" class=\"prButton\" [rounded]=\"false\" [text]=\"true\" (onClick)=\"onReject()\"\r\n ariaLabel=\"Cerrar\"></p-button>\r\n </div>\r\n }\r\n\r\n <!-- Icon -->\r\n <div class=\"prConfirmDialog__icon\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\" alt=\"Alert icon\" />\r\n } @else {\r\n <i [class]=\"$any(message).data.iconClass\"></i>\r\n }\r\n </div>\r\n <div class=\"prConfirmDialog__details\">\r\n <!-- Title -->\r\n <h2 class=\"prConfirmDialog__title\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <p class=\"prConfirmDialog__subtitle\"\r\n [style.color]=\"$any(message).data.config.styles?.subtitleColor ?? '#555'\">{{ message.message }}</p>\r\n }\r\n </div>\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <div class=\"prConfirmDialog__text\" [innerHTML]=\"$any(message).data.config.htmlContent\"\r\n [style.color]=\"$any(message).data.config.styles?.subtitleColor ?? '#555'\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div class=\"prConfirmDialog__footer\">\r\n <!-- Confirm Button -->\r\n <p-button class=\"prButton\" [label]=\"message.data.confirmText\" (onClick)=\"onAccept()\" />\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button class=\"prButton\" [label]=\"message.data.cancelText\" severity=\"secondary\" [outlined]=\"true\"\r\n (onClick)=\"onReject()\" />\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i1$3.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "modal", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }] });
6014
6023
  }
6015
6024
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: IntelicaAlertComponent, decorators: [{
6016
6025
  type: Component,
6017
- args: [{ selector: "intelica-alert", standalone: true, imports: [CommonModule, ConfirmDialogModule, ButtonModule], template: "<!-- \r\n Clases Modificadoras para estados:\r\n prConfirmDialog--warning\r\n prConfirmDialog--danger\r\n prConfirmDialog--error\r\n prConfirmDialog--success\r\n prConfirmDialog--default\r\n-->\r\n<p-confirmDialog styleClass=\"prConfirmDialog\" key=\"intelica-alert-dialog\" [closable]=\"false\" [visible]=\"undefined\">\r\n <!-- \r\n We use the headless template. \r\n 'message' contains the confirmation object.\r\n 'message.data' contains our custom 'presentationData' object from AlertService.\r\n -->\r\n <ng-template pTemplate=\"headless\" let-message let-onAccept=\"onAccept\" let-onReject=\"onReject\">\r\n <div class=\"prConfirmDialog__content\">\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <div class=\"prConfirmDialog__close\">\r\n <p-button icon=\"pi pi-times\" class=\"prButton\" [rounded]=\"false\" [text]=\"true\" (onClick)=\"onReject()\"\r\n ariaLabel=\"Cerrar\"></p-button>\r\n </div>\r\n }\r\n\r\n <!-- Icon -->\r\n <div class=\"prConfirmDialog__icon\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\"\r\n alt=\"Alert icon\" />\r\n } @else {\r\n <!-- <i [class]=\"message.data.iconClass\" [style.color]=\"message.data.iconColor\"></i> -->\r\n <i [class]=\"message.data.iconClass\"></i>\r\n }\r\n </div>\r\n <div class=\"prConfirmDialog__details\">\r\n <!-- Title -->\r\n <!-- <h2 class=\"prConfirmDialog__title\" [style.color]=\"message.data.titleColor\">{{ message.header }}</h2> -->\r\n <h2 class=\"prConfirmDialog__title\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <!-- <p class=\"prConfirmDialog__subtitle\" [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\">{{ message.message }}</p> -->\r\n <p class=\"prConfirmDialog__subtitle\">{{ message.message }}</p>\r\n }\r\n </div>\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <!-- <div class=\"prConfirmDialog__details\" [innerHTML]=\"message.data.config.htmlContent\"\r\n [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"></div> -->\r\n <div class=\"prConfirmDialog__text\" [innerHTML]=\"message.data.config.htmlContent\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div class=\"prConfirmDialog__footer\">\r\n <!-- Confirm Button -->\r\n <p-button class=\"prButton\" [label]=\"message.data.confirmText\" (onClick)=\"onAccept()\" />\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button class=\"prButton\" [label]=\"message.data.cancelText\" severity=\"secondary\" [outlined]=\"true\"\r\n (onClick)=\"onReject()\" />\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>" }]
6026
+ args: [{ selector: "intelica-alert", standalone: true, imports: [CommonModule, ConfirmDialogModule, ButtonModule], template: "<!-- \r\n Clases Modificadoras para estados:\r\n prConfirmDialog--warning\r\n prConfirmDialog--danger\r\n prConfirmDialog--error\r\n prConfirmDialog--success\r\n prConfirmDialog--default\r\n-->\r\n<p-confirmDialog #cd\r\n [styleClass]=\"'prConfirmDialog ' + ($any(cd.confirmation)?.data?.config?.type ? ' prConfirmDialog--' + $any(cd.confirmation).data.config.type : ' prConfirmDialog--default')\"\r\n key=\"intelica-alert-dialog\" [closable]=\"false\" [visible]=\"undefined\">\r\n <!-- \r\n We use the headless template. \r\n 'message' contains the confirmation object.\r\n 'message.data' contains our custom 'presentationData' object from AlertService.\r\n -->\r\n <ng-template pTemplate=\"headless\" let-message let-onAccept=\"onAccept\" let-onReject=\"onReject\">\r\n <div class=\"prConfirmDialog__content\">\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <div class=\"prConfirmDialog__close\">\r\n <p-button icon=\"pi pi-times\" class=\"prButton\" [rounded]=\"false\" [text]=\"true\" (onClick)=\"onReject()\"\r\n ariaLabel=\"Cerrar\"></p-button>\r\n </div>\r\n }\r\n\r\n <!-- Icon -->\r\n <div class=\"prConfirmDialog__icon\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\" alt=\"Alert icon\" />\r\n } @else {\r\n <i [class]=\"$any(message).data.iconClass\"></i>\r\n }\r\n </div>\r\n <div class=\"prConfirmDialog__details\">\r\n <!-- Title -->\r\n <h2 class=\"prConfirmDialog__title\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <p class=\"prConfirmDialog__subtitle\"\r\n [style.color]=\"$any(message).data.config.styles?.subtitleColor ?? '#555'\">{{ message.message }}</p>\r\n }\r\n </div>\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <div class=\"prConfirmDialog__text\" [innerHTML]=\"$any(message).data.config.htmlContent\"\r\n [style.color]=\"$any(message).data.config.styles?.subtitleColor ?? '#555'\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div class=\"prConfirmDialog__footer\">\r\n <!-- Confirm Button -->\r\n <p-button class=\"prButton\" [label]=\"message.data.confirmText\" (onClick)=\"onAccept()\" />\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button class=\"prButton\" [label]=\"message.data.cancelText\" severity=\"secondary\" [outlined]=\"true\"\r\n (onClick)=\"onReject()\" />\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>" }]
6018
6027
  }] });
6019
6028
 
6020
6029
  class AddFavoritesService {
@@ -8127,6 +8136,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
8127
8136
  }]
8128
8137
  }], ctorParameters: () => [] });
8129
8138
 
8139
+ class GlobalMenuService {
8140
+ _isMenuVisible = signal(true, ...(ngDevMode ? [{ debugName: "_isMenuVisible" }] : []));
8141
+ _selectedProduct = signal("", ...(ngDevMode ? [{ debugName: "_selectedProduct" }] : []));
8142
+ isMenuVisible = this._isMenuVisible.asReadonly();
8143
+ selectedProduct = this._selectedProduct.asReadonly();
8144
+ eventMenu = "MenuBarEvent";
8145
+ eventProducts = "SelectedProductMenuEvent";
8146
+ initialize() {
8147
+ this.listenMenuEvents();
8148
+ }
8149
+ setMenuVisibility(isVisible) {
8150
+ this.emitMenuEvent(isVisible);
8151
+ }
8152
+ setSelectedProduct(product) {
8153
+ this.emitSelectedProductEvent(product);
8154
+ }
8155
+ listenMenuEvents() {
8156
+ window.addEventListener(this.eventMenu, this.onMenuEvent);
8157
+ window.addEventListener(this.eventProducts, this.onSelectedProductEvent);
8158
+ }
8159
+ onMenuEvent = (event) => {
8160
+ const { menuIsVisible } = event.detail ?? {};
8161
+ if (typeof menuIsVisible === "boolean")
8162
+ this._isMenuVisible.set(menuIsVisible);
8163
+ };
8164
+ onSelectedProductEvent = (event) => {
8165
+ const { selectedProduct } = event.detail ?? {};
8166
+ if (typeof selectedProduct === "string")
8167
+ this._selectedProduct.set(selectedProduct);
8168
+ };
8169
+ emitMenuEvent(isVisible) {
8170
+ const event = new CustomEvent(this.eventMenu, {
8171
+ detail: { menuIsVisible: isVisible },
8172
+ });
8173
+ window.dispatchEvent(event);
8174
+ }
8175
+ emitSelectedProductEvent(product) {
8176
+ const event = new CustomEvent(this.eventProducts, {
8177
+ detail: { selectedProduct: product },
8178
+ });
8179
+ window.dispatchEvent(event);
8180
+ }
8181
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
8182
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalMenuService, providedIn: "root" });
8183
+ }
8184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalMenuService, decorators: [{
8185
+ type: Injectable,
8186
+ args: [{ providedIn: "root" }]
8187
+ }] });
8188
+
8130
8189
  /**
8131
8190
  * Función de comparación genérica para ordenar objetos por un campo específico.
8132
8191
  *
@@ -11086,5 +11145,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
11086
11145
  * Generated bundle index. Do not edit.
11087
11146
  */
11088
11147
 
11089
- export { ALERT_DEFAULTS, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, ErrorNewInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageInformation, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, ResponseHeadersInterceptor, RouteGuard, RouteNewGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
11148
+ export { ALERT_DEFAULTS, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, ErrorNewInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalMenuService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageInformation, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, ResponseHeadersInterceptor, RouteGuard, RouteNewGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
11090
11149
  //# sourceMappingURL=intelica-library-components.mjs.map