intelica-library-components 1.1.12 → 1.1.13

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,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, signal, Pipe, Component, HostListener, Directive, EventEmitter, Output, Input, forwardRef, TemplateRef, ContentChild, ContentChildren, ViewChild, PLATFORM_ID, Inject, Optional, Host } from '@angular/core';
2
+ import { inject, Injectable, signal, Pipe, Component, HostListener, Directive, EventEmitter, Output, Input, forwardRef, TemplateRef, ContentChild, ContentChildren, ViewChild, PLATFORM_ID, Inject, output, Optional, Host } from '@angular/core';
3
3
  import { getCookie, Cookies, setCookie } from 'typescript-cookie';
4
4
  import { HttpClient, HttpHeaders } from '@angular/common/http';
5
- import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, tap, map } from 'rxjs';
5
+ import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, delay, tap, map } from 'rxjs';
6
6
  import Swal from 'sweetalert2';
7
7
  import * as i1 from '@angular/common';
8
- import { CommonModule, DatePipe, isPlatformBrowser } from '@angular/common';
8
+ import { CommonModule, DatePipe, isPlatformBrowser, NgClass } from '@angular/common';
9
9
  import * as i1$1 from '@angular/forms';
10
10
  import { FormsModule, FormBuilder, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
11
11
  import { BadgeModule } from 'primeng/badge';
@@ -18,7 +18,7 @@ import { TooltipModule } from 'primeng/tooltip';
18
18
  import moment from 'moment';
19
19
  import * as _ from 'lodash';
20
20
  import * as i2 from 'primeng/button';
21
- import { ButtonModule } from 'primeng/button';
21
+ import { ButtonModule, Button } from 'primeng/button';
22
22
  import * as i3 from 'primeng/radiobutton';
23
23
  import { RadioButtonModule } from 'primeng/radiobutton';
24
24
  import * as i1$2 from 'primeng/popover';
@@ -167,13 +167,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
167
167
  }] });
168
168
 
169
169
  class FormatAmountPipe {
170
- transform(value, shortFormat = false, decimalPlaces = 2) {
171
- if (value === null || value === undefined) {
172
- return "0";
170
+ transform(value, shortFormat = false, decimalPlaces = 2, validNegative = false) {
171
+ if (value === null || value === undefined || value == 0) {
172
+ return "-";
173
173
  }
174
- const numericValue = typeof value === "string" ? parseFloat(value) : value;
175
- if (isNaN(numericValue)) {
176
- return "0";
174
+ const numericValue = typeof value === "string" ? Number.parseFloat(value) : value;
175
+ if (Number.isNaN(numericValue)) {
176
+ return "-";
177
177
  }
178
178
  let formattedValue;
179
179
  if (shortFormat) {
@@ -182,6 +182,11 @@ class FormatAmountPipe {
182
182
  else {
183
183
  formattedValue = this.formatWithThousandSeparators(numericValue, decimalPlaces);
184
184
  }
185
+ if (validNegative) {
186
+ if (numericValue < 0) {
187
+ formattedValue = `(${formattedValue})`;
188
+ }
189
+ }
185
190
  return formattedValue;
186
191
  }
187
192
  getShortFormat(value, decimalPlaces) {
@@ -194,16 +199,17 @@ class FormatAmountPipe {
194
199
  ];
195
200
  for (const { limit, suffix } of suffixes) {
196
201
  if (absValue >= limit) {
197
- return (value / limit).toFixed(decimalPlaces) + suffix;
202
+ return (absValue / limit).toFixed(decimalPlaces) + suffix;
198
203
  }
199
204
  }
200
- return value.toFixed(decimalPlaces);
205
+ return absValue.toFixed(decimalPlaces);
201
206
  }
202
207
  formatWithThousandSeparators(value, decimalPlaces) {
208
+ const absValue = Math.abs(value);
203
209
  return new Intl.NumberFormat("en-US", {
204
210
  minimumFractionDigits: decimalPlaces,
205
211
  maximumFractionDigits: decimalPlaces,
206
- }).format(value);
212
+ }).format(absValue);
207
213
  }
208
214
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: FormatAmountPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
209
215
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: FormatAmountPipe, isStandalone: true, name: "amount" });
@@ -254,9 +260,10 @@ const Color = {
254
260
  amex: "#348AD5",
255
261
  orange: "#ff7f00",
256
262
  orangeDark: "#CC4900",
263
+ skyBlue: "#7490E2",
257
264
  blue: "#17375E",
258
- gray: "#D3D3D3",
259
- gray3: "#a6a5a1",
265
+ gray: "#BABECF",
266
+ gray3: "#4E546F",
260
267
  gray5: "#e9e9e9",
261
268
  };
262
269
  const getColor = (name) => {
@@ -5838,6 +5845,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
5838
5845
  args: [{ selector: "intelica-alert", standalone: true, imports: [CommonModule, ConfirmDialogModule, ButtonModule], template: "<p-confirmDialog key=\"intelica-alert-dialog\" [style]=\"{width: 'auto', 'max-width': '90cw'}\" [closable]=\"false\"\r\n [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 [style]=\"message.data.dialogStyle\"\r\n style=\"background: white; display: flex; flex-direction: column; align-items: center; padding: 2rem; position: relative; text-align: center;\">\r\n\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <button type=\"button\"\r\n style=\"position: absolute; top: 0.75rem; right: 0.75rem; background: transparent; border: none; cursor: pointer; padding: 0.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s;\"\r\n (click)=\"onReject()\" aria-label=\"Cerrar\">\r\n <i class=\"pi pi-times\" style=\"font-size: 1.25rem; color: #6c757d;\"></i>\r\n </button>\r\n }\r\n\r\n <!-- Icon -->\r\n <div [style.backgroundColor]=\"message.data.iconBackgroundColor\"\r\n style=\"width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem;\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\" style=\"width: 60px; height: 60px; object-fit: contain;\"\r\n alt=\"Alert icon\" />\r\n } @else {\r\n <i [class]=\"message.data.iconClass\" [style.color]=\"message.data.iconColor\"\r\n style=\"font-size: 2.5rem;\"></i>\r\n }\r\n </div>\r\n\r\n <!-- Title -->\r\n <h2 [style.color]=\"message.data.titleColor\"\r\n style=\"margin: 0 0 0.75rem 0; font-size: 1.5rem; font-weight: 600;\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <p [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"\r\n style=\"margin: 0 0 1.5rem 0; font-size: 1rem; line-height: 1.5;\">{{ message.message }}</p>\r\n }\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <div [innerHTML]=\"message.data.config.htmlContent\"\r\n [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"\r\n style=\"margin-bottom: 1.5rem; width: 100%;\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div style=\"display: flex; gap: 0.75rem; justify-content: center; width: 100%; margin-top: 0.5rem;\">\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button [label]=\"message.data.cancelText\" [style]=\"message.data.cancelButtonStyle\"\r\n severity=\"secondary\" [outlined]=\"true\" (onClick)=\"onReject()\" />\r\n }\r\n <!-- Confirm Button -->\r\n <p-button [label]=\"message.data.confirmText\" [style]=\"message.data.confirmButtonStyle\"\r\n (onClick)=\"onAccept()\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>\r\n" }]
5839
5846
  }] });
5840
5847
 
5848
+ class AddFavoritesService {
5849
+ configService = inject(ConfigService);
5850
+ addPageToFavorites() {
5851
+ return of(void 0).pipe(delay(200), tap(() => console.log("Test: Added current page to favorites")));
5852
+ }
5853
+ isPageFavorite() {
5854
+ return of(false).pipe(delay(200), tap(() => console.log("Test: Checked if current page is favorite")));
5855
+ }
5856
+ simulateToggle() {
5857
+ return of(void 0).pipe(delay(200), tap(() => console.log("Test: Toggle favorite request")));
5858
+ }
5859
+ removeFromFavorites() {
5860
+ return of(void 0).pipe(delay(200), tap(() => console.log("Test: removed from favorites")));
5861
+ }
5862
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5863
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesService, providedIn: "root" });
5864
+ }
5865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesService, decorators: [{
5866
+ type: Injectable,
5867
+ args: [{
5868
+ providedIn: "root",
5869
+ }]
5870
+ }] });
5871
+
5872
+ const ICON_ON = "icon-favorites-on";
5873
+ const ICON_OFF = "icon-favorites-off";
5874
+ class AddFavoritesComponent {
5875
+ termService = inject(GlobalTermService);
5876
+ favoritesMock = inject(AddFavoritesService);
5877
+ favoriteChanged = output();
5878
+ isFavorite = false;
5879
+ iconClass = ICON_OFF;
5880
+ ngOnInit() {
5881
+ this.loadInitialState();
5882
+ }
5883
+ toggleFavorite() {
5884
+ const action$ = this.isFavorite ? this.favoritesMock.removeFromFavorites() : this.favoritesMock.addPageToFavorites();
5885
+ action$.subscribe({
5886
+ next: () => {
5887
+ this.isFavorite = !this.isFavorite;
5888
+ this.updateIcon();
5889
+ this.favoriteChanged.emit(this.isFavorite);
5890
+ },
5891
+ });
5892
+ }
5893
+ loadInitialState() {
5894
+ this.favoritesMock.isPageFavorite().subscribe({
5895
+ next: isFavorite => {
5896
+ this.isFavorite = isFavorite;
5897
+ this.updateIcon();
5898
+ },
5899
+ });
5900
+ }
5901
+ updateIcon() {
5902
+ this.iconClass = this.isFavorite ? ICON_ON : ICON_OFF;
5903
+ }
5904
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5905
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: AddFavoritesComponent, isStandalone: true, selector: "intelica-add-favorites", outputs: { favoriteChanged: "favoriteChanged" }, ngImport: i0, template: "<p-button class=\"prButton\" severity=\"secondary\" (onClick)=\"toggleFavorite()\">\r\n\t<i class=\"icon p-button-icon-left\" [ngClass]=\"iconClass\" pButtonIcon></i>\r\n\t<span pButtonLabel>{{ \"ADD_TO_FAVORITES\" | term : termService.languageCode }}</span>\r\n</p-button>\r\n", dependencies: [{ kind: "component", type: Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TermPipe, name: "term" }] });
5906
+ }
5907
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesComponent, decorators: [{
5908
+ type: Component,
5909
+ args: [{ selector: "intelica-add-favorites", imports: [Button, TermPipe, NgClass], template: "<p-button class=\"prButton\" severity=\"secondary\" (onClick)=\"toggleFavorite()\">\r\n\t<i class=\"icon p-button-icon-left\" [ngClass]=\"iconClass\" pButtonIcon></i>\r\n\t<span pButtonLabel>{{ \"ADD_TO_FAVORITES\" | term : termService.languageCode }}</span>\r\n</p-button>\r\n" }]
5910
+ }] });
5911
+
5841
5912
  class CheckboxFilterDirective extends FilterDirective {
5842
5913
  constructor() {
5843
5914
  super(FilterTypeEnum.Checkbox);
@@ -7027,14 +7098,17 @@ class EchartService {
7027
7098
  },
7028
7099
  splitLine: {
7029
7100
  show: showSplitLine,
7030
- lineStyle: {
7031
- color: Color.gray,
7032
- type: "dashed",
7033
- width: 1,
7034
- },
7101
+ // lineStyle: {
7102
+ // color: Color.gray,
7103
+ // type: "dashed",
7104
+ // width: 1,
7105
+ // },
7106
+ lineStyle: { width: 1, color: Color.gray, type: [5, 5], cap: "round" },
7035
7107
  },
7036
7108
  axisLabel: {
7037
- show: showAxis,
7109
+ fontFamily: "Lato, sans-serif",
7110
+ show: true,
7111
+ // show: showAxis,
7038
7112
  color: Color.gray3,
7039
7113
  fontSize: 14,
7040
7114
  padding: 10,
@@ -7044,7 +7118,7 @@ class EchartService {
7044
7118
  getCategoryAxisConfiguration(data) {
7045
7119
  return this.getDefultAxisConfiguration("category", data, true);
7046
7120
  }
7047
- getValueAxisConfiguration(showAxis = false, format = false, showAxisLines = false) {
7121
+ getValueAxisConfiguration(showAxis = true, format = true, showAxisLines = true) {
7048
7122
  let axisConfiguration = this.getDefultAxisConfiguration("value", undefined, showAxis, showAxisLines);
7049
7123
  if (format) {
7050
7124
  axisConfiguration.axisLabel.formatter = (value) => this._sharedService.FormatNumberWithSuffix(value);
@@ -7053,20 +7127,37 @@ class EchartService {
7053
7127
  }
7054
7128
  getGridConfiguration() {
7055
7129
  return {
7056
- left: "0%",
7057
- right: "0%",
7058
- //bottom: '0%',
7130
+ // left: "0%",
7131
+ // right: "0%",
7132
+ // //bottom: '0%',
7133
+ // containLabel: true,
7134
+ left: 0,
7135
+ right: 0,
7136
+ top: 20,
7137
+ bottom: 40,
7059
7138
  containLabel: true,
7060
7139
  };
7061
7140
  }
7062
7141
  getLegendConfiguration() {
7063
7142
  return {
7064
- orient: "horizontal", // 'horizontal | vertical'
7065
- icon: "circle",
7066
- bottom: 5,
7067
- align: "auto",
7068
- itemGap: 20,
7069
- textStyle: { color: Color.blue, fontSize: 14 },
7143
+ // orient: "horizontal", // 'horizontal | vertical'
7144
+ // icon: "circle",
7145
+ // bottom: 5,
7146
+ // align: "auto",
7147
+ // itemGap: 20,
7148
+ // textStyle: { color: Color.blue, fontSize: 14 },
7149
+ data: [{ name: "Expenses", icon: "circle" }],
7150
+ bottom: 0,
7151
+ textStyle: {
7152
+ color: "#4E546F",
7153
+ fontFamily: "Lato, sans-serif",
7154
+ fontSize: 12,
7155
+ lineHeight: 12,
7156
+ },
7157
+ itemWidth: 10,
7158
+ itemHeight: 10,
7159
+ itemGap: 25,
7160
+ align: "left",
7070
7161
  };
7071
7162
  }
7072
7163
  /**
@@ -7102,15 +7193,16 @@ class EchartService {
7102
7193
  */
7103
7194
  getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
7104
7195
  return {
7196
+ textStyle: { fontFamily: "Lato, sans-serif" },
7105
7197
  xAxis: this.getCategoryAxisConfiguration(categories),
7106
7198
  yAxis: this.getValueAxisConfiguration(),
7107
7199
  series: [
7108
7200
  ...series.map((item) => ({
7109
7201
  type: "bar",
7110
7202
  name: item.name,
7111
- itemStyle: { color: item.color },
7203
+ itemStyle: { color: item.color, borderRadius: 8 },
7112
7204
  data: item.value,
7113
- // barWidth: "33%",
7205
+ barWidth: "33%",
7114
7206
  barGap: "0%",
7115
7207
  label: {
7116
7208
  show: true,
@@ -7127,6 +7219,7 @@ class EchartService {
7127
7219
  borderWidth: 2,
7128
7220
  textStyle: { fontSize: 12 },
7129
7221
  formatter: tooltipConfig,
7222
+ appendTo: "body",
7130
7223
  },
7131
7224
  grid: this.getGridConfiguration(),
7132
7225
  legend: showLegend ? this.getLegendConfiguration() : undefined,
@@ -7166,22 +7259,20 @@ class EchartService {
7166
7259
  getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend = false, enableSelectStyle = false // 👈 nuevo
7167
7260
  ) {
7168
7261
  let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
7169
- barBase.xAxis = this.getValueAxisConfiguration();
7262
+ barBase.xAxis = this.getValueAxisConfiguration(false, true, false);
7170
7263
  barBase.yAxis = this.getCategoryAxisConfiguration(categories);
7171
7264
  barBase.series.forEach((serie, idx) => {
7172
7265
  if (serie.label) {
7173
7266
  serie.label.position = "right";
7174
7267
  }
7175
- const baseColor = serie.itemStyle?.color ??
7176
- (series[idx] && series[idx].color) ??
7177
- '#FF8A00';
7268
+ const baseColor = serie.itemStyle?.color ?? (series[idx] && series[idx].color) ?? "#FF8A00";
7178
7269
  serie.itemStyle = {
7179
7270
  ...(serie.itemStyle || {}),
7180
7271
  color: baseColor,
7181
7272
  borderWidth: 0,
7182
7273
  };
7183
7274
  if (enableSelectStyle) {
7184
- serie.selectedMode = 'single';
7275
+ serie.selectedMode = "single";
7185
7276
  const selectedColor = darkenColor(String(baseColor), 0.38);
7186
7277
  serie.select = {
7187
7278
  itemStyle: {
@@ -7245,9 +7336,9 @@ class EchartService {
7245
7336
  const y = barBase.yAxis;
7246
7337
  const gr = barBase.grid;
7247
7338
  const defaultCategoryFormatter = (value, index) => {
7248
- const sangriaBase = '\u2008\u2008\u2008\u2008\u2008\u2008\u2009';
7339
+ const sangriaBase = "\u2008\u2008\u2008\u2008\u2008\u2008\u2009";
7249
7340
  const lineLength = 35;
7250
- const text = String(value ?? '');
7341
+ const text = String(value ?? "");
7251
7342
  const prefix = `${index + 1} - `;
7252
7343
  const digitCount = String(index + 1).length;
7253
7344
  let extraRepeat = 0;
@@ -7255,10 +7346,10 @@ class EchartService {
7255
7346
  extraRepeat = 2;
7256
7347
  else if (digitCount === 3)
7257
7348
  extraRepeat = 5;
7258
- const sangria = sangriaBase + '\u2008'.repeat(extraRepeat);
7259
- const words = text.split(' ');
7349
+ const sangria = sangriaBase + "\u2008".repeat(extraRepeat);
7350
+ const words = text.split(" ");
7260
7351
  const lines = [];
7261
- let current = '';
7352
+ let current = "";
7262
7353
  for (const w of words) {
7263
7354
  const test = current ? `${current} ${w}` : w;
7264
7355
  if (test.length <= lineLength)
@@ -7271,7 +7362,7 @@ class EchartService {
7271
7362
  }
7272
7363
  if (current)
7273
7364
  lines.push(current);
7274
- return prefix + lines.map((ln, i) => (i === 0 ? ln : `${sangria}${ln}`)).join('\n');
7365
+ return prefix + lines.map((ln, i) => (i === 0 ? ln : `${sangria}${ln}`)).join("\n");
7275
7366
  };
7276
7367
  // y.inverse = true;
7277
7368
  // y.axisLabel = {
@@ -7292,7 +7383,7 @@ class EchartService {
7292
7383
  gr.bottom = "0%";
7293
7384
  gr.containLabel = true;
7294
7385
  }
7295
- barBase.series.forEach((serie) => {
7386
+ barBase.series.forEach(serie => {
7296
7387
  serie.label = {
7297
7388
  ...(serie.label || {}),
7298
7389
  formatter: labelConfig,
@@ -7337,6 +7428,7 @@ class EchartService {
7337
7428
  borderWidth: 2,
7338
7429
  textStyle: { fontSize: 12 },
7339
7430
  formatter: tooltipConfig,
7431
+ appendTo: "body ",
7340
7432
  },
7341
7433
  dataZoom: [
7342
7434
  {
@@ -7404,6 +7496,7 @@ class EchartService {
7404
7496
  tooltip: {
7405
7497
  trigger: "item",
7406
7498
  formatter: tooltipConfig,
7499
+ appendTo: "body",
7407
7500
  // extraCssText: this.chartService.getTooltipCssText(),
7408
7501
  },
7409
7502
  legend: {
@@ -7437,6 +7530,7 @@ class EchartService {
7437
7530
  return {
7438
7531
  tooltip: {
7439
7532
  trigger: "none",
7533
+ appendTo: "body",
7440
7534
  },
7441
7535
  series: [
7442
7536
  {
@@ -7467,6 +7561,118 @@ class EchartService {
7467
7561
  ],
7468
7562
  };
7469
7563
  }
7564
+ /**
7565
+ * Semi doughnut gauge (half circle) with:
7566
+ * - Progress arc
7567
+ * - End dot
7568
+ * - Center letter
7569
+ *
7570
+ * @param letter - Text to show in the center
7571
+ * @param value - Current value
7572
+ * @param textSize - Center letter font size
7573
+ * @param color - Progress and end dot color
7574
+ * @param total - Max value (default 100)
7575
+ */
7576
+ getRateSemiDoughnutOptions(letter, value, textSize, color, total = 100) {
7577
+ const safeTotal = total > 0 ? total : 100;
7578
+ const safeValue = Math.max(0, Math.min(value, safeTotal));
7579
+ const START_ANGLE = 210;
7580
+ const END_ANGLE = -30;
7581
+ const THICKNESS = 22;
7582
+ const BACKGROUND_COLOR = "#D9D9E3";
7583
+ const TEXT_COLOR = "#4F5470";
7584
+ const MIN_LABEL = "0";
7585
+ const MAX_LABEL = String(safeTotal);
7586
+ const MIN_MAX_FONT_SIZE = 15;
7587
+ return {
7588
+ tooltip: { trigger: "none", appendTo: "body" },
7589
+ series: [
7590
+ /* ================= GAUGE 1: PROGRESS ================= */
7591
+ {
7592
+ type: "gauge",
7593
+ startAngle: START_ANGLE,
7594
+ endAngle: END_ANGLE,
7595
+ min: 0,
7596
+ max: safeTotal,
7597
+ pointer: { show: false },
7598
+ progress: {
7599
+ show: true,
7600
+ roundCap: true,
7601
+ width: THICKNESS,
7602
+ itemStyle: { color },
7603
+ },
7604
+ axisLine: {
7605
+ roundCap: true,
7606
+ lineStyle: {
7607
+ width: THICKNESS,
7608
+ color: [[1, BACKGROUND_COLOR]],
7609
+ },
7610
+ },
7611
+ axisTick: { show: false },
7612
+ splitLine: { show: false },
7613
+ axisLabel: { show: false },
7614
+ detail: {
7615
+ show: true,
7616
+ offsetCenter: [0, "0%"],
7617
+ fontSize: textSize,
7618
+ fontWeight: 700,
7619
+ color: TEXT_COLOR,
7620
+ formatter: () => letter,
7621
+ },
7622
+ data: [
7623
+ {
7624
+ value: safeValue,
7625
+ name: "0",
7626
+ title: {
7627
+ show: true,
7628
+ formatter: () => MIN_LABEL,
7629
+ offsetCenter: ["-80%", "66%"],
7630
+ fontSize: MIN_MAX_FONT_SIZE,
7631
+ color: TEXT_COLOR,
7632
+ },
7633
+ },
7634
+ {
7635
+ value: safeValue,
7636
+ name: "100",
7637
+ title: {
7638
+ show: true,
7639
+ formatter: () => MAX_LABEL,
7640
+ offsetCenter: ["80%", "66%"],
7641
+ fontSize: MIN_MAX_FONT_SIZE,
7642
+ color: TEXT_COLOR,
7643
+ },
7644
+ },
7645
+ ],
7646
+ },
7647
+ /* ================= GAUGE 2: END DOT ================= */
7648
+ {
7649
+ type: "gauge",
7650
+ startAngle: START_ANGLE,
7651
+ endAngle: END_ANGLE,
7652
+ min: 0,
7653
+ max: safeTotal,
7654
+ axisLine: { show: false },
7655
+ progress: { show: false },
7656
+ splitLine: { show: false },
7657
+ axisTick: { show: false },
7658
+ axisLabel: { show: false },
7659
+ detail: { show: false },
7660
+ pointer: {
7661
+ show: true,
7662
+ length: "183%",
7663
+ width: 38,
7664
+ icon: "circle",
7665
+ itemStyle: {
7666
+ color,
7667
+ borderColor: BACKGROUND_COLOR,
7668
+ borderWidth: 4,
7669
+ },
7670
+ },
7671
+ data: [{ value: safeValue }],
7672
+ },
7673
+ ],
7674
+ };
7675
+ }
7470
7676
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EchartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
7471
7677
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EchartService, providedIn: "root" });
7472
7678
  }
@@ -9957,5 +10163,5 @@ const IntelicaTheme = definePreset(Aura, {
9957
10163
  * Generated bundle index. Do not edit.
9958
10164
  */
9959
10165
 
9960
- export { ALERT_DEFAULTS, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AlertButtonMode, AlertService, AlertType, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, 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 };
10166
+ 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, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, 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 };
9961
10167
  //# sourceMappingURL=intelica-library-components.mjs.map