intelica-library-ui 0.1.87 → 0.1.89

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.
@@ -158,13 +158,15 @@ const secure = !domain.includes("localhost");
158
158
  const CookieAttributesGeneral = { domain: domain, path: "/", secure: secure };
159
159
 
160
160
  const Color = {
161
- mastercard: '#ff7f00',
162
- visa: '#17375E',
163
- amex: '#348AD5',
164
- orange: '#ff7f00',
165
- blue: '#17375E',
166
- gray: '#D3D3D3',
167
- gray3: '#a6a5a1',
161
+ mastercard: "#ff7f00",
162
+ visa: "#17375E",
163
+ amex: "#348AD5",
164
+ orange: "#ff7f00",
165
+ orangeDark: "#CC4900",
166
+ blue: "#17375E",
167
+ gray: "#D3D3D3",
168
+ gray3: "#a6a5a1",
169
+ gray5: "#e9e9e9",
168
170
  };
169
171
  const getColor = (name) => {
170
172
  return Color[name];
@@ -2800,8 +2802,8 @@ class HtmlToExcelService {
2800
2802
  const groupedIndices = new Set();
2801
2803
  if (headerGroups.length > 0) {
2802
2804
  for (const group of headerGroups) {
2803
- const startChar = this.getExcelColumnLetter(group.startColumn);
2804
- const endChar = this.getExcelColumnLetter(group.endColumn);
2805
+ const startChar = this.GetExcelColumnLetter(group.startColumn);
2806
+ const endChar = this.GetExcelColumnLetter(group.endColumn);
2805
2807
  const range = `${startChar}${startRow}:${endChar}${startRow}`;
2806
2808
  worksheet.mergeCells(range);
2807
2809
  const cellGroup = `${startChar}${startRow}`;
@@ -2829,7 +2831,7 @@ class HtmlToExcelService {
2829
2831
  }
2830
2832
  }
2831
2833
  for (let i = 0; i < columns.length; i++) {
2832
- const colLetter = this.getExcelColumnLetter(i);
2834
+ const colLetter = this.GetExcelColumnLetter(i);
2833
2835
  const topCell = `${colLetter}${startRow}`;
2834
2836
  const bottomCell = `${colLetter}${startRow + 1}`;
2835
2837
  if (groupedIndices.has(i)) {
@@ -2887,7 +2889,7 @@ class HtmlToExcelService {
2887
2889
  }
2888
2890
  });
2889
2891
  columns.forEach((col, index) => {
2890
- const cellAddress = `${this.getExcelColumnLetter(index)}${startRow}`;
2892
+ const cellAddress = `${this.GetExcelColumnLetter(index)}${startRow}`;
2891
2893
  const cell = worksheet.getCell(cellAddress);
2892
2894
  cell.font = {
2893
2895
  name: "Arial",
@@ -2909,7 +2911,6 @@ class HtmlToExcelService {
2909
2911
  for (let colIndex = 0; colIndex < columns.length; colIndex++) {
2910
2912
  rowValues.push(colIndex === 0 ? `${rowIndex + 1}` : rows[rowIndex][columns[colIndex].columnName] ?? "");
2911
2913
  }
2912
- console.log(rowValues);
2913
2914
  const insertedRow = worksheet.addRow(rowValues);
2914
2915
  insertedRow.eachCell((cell, colNumber) => {
2915
2916
  const col = columns[colNumber - 1];
@@ -2965,7 +2966,7 @@ class HtmlToExcelService {
2965
2966
  });
2966
2967
  //Subtitulos: Se inserta al final para evitar altere el autoajuste de las columnas
2967
2968
  for (let i = 0; i < subtitles.length; i++) {
2968
- const range = `A${6 + i}:${this.getExcelColumnLetter(columns.length - 1)}${6 + i}`;
2969
+ const range = `A${6 + i}:${this.GetExcelColumnLetter(columns.length - 1)}${6 + i}`;
2969
2970
  worksheet.mergeCells(range);
2970
2971
  const cell = worksheet.getCell(`A${6 + i}`);
2971
2972
  cell.value = subtitles[i];
@@ -3032,7 +3033,7 @@ class HtmlToExcelService {
3032
3033
  return;
3033
3034
  if (columns[index] == undefined)
3034
3035
  return;
3035
- let columnWidth = columns[index].width ?? Math.max(...column.values.map(v => (v ? v.toString().length : 0)).filter(v => typeof v === "number"), columns[index].displayColumnName.length) * 1.2;
3036
+ let columnWidth = columns[index].width ?? Math.max(...column.values.map(v => (v ? v.toString().length : 0)).filter(v => typeof v === "number"), columns[index].displayColumnName.length) * 1.4;
3036
3037
  column.width = Math.min(Math.max(columnWidth, 5), 100);
3037
3038
  });
3038
3039
  worksheet.eachRow((row, rowIndex) => {
@@ -3058,7 +3059,7 @@ class HtmlToExcelService {
3058
3059
  worksheet.views = [{ showGridLines: false }];
3059
3060
  const allColumns = orderColumn ? [{ displayColumnName: "N°" }, ...columns] : columns;
3060
3061
  allColumns.forEach((col, index) => {
3061
- const columnLetter = this.getExcelColumnLetter(index);
3062
+ const columnLetter = this.GetExcelColumnLetter(index);
3062
3063
  const headerCell = worksheet.getCell(`${columnLetter}1`);
3063
3064
  headerCell.value = col.displayColumnName;
3064
3065
  headerCell.alignment = { horizontal: "center", vertical: "middle" };
@@ -3092,7 +3093,7 @@ class HtmlToExcelService {
3092
3093
  const buffer = await workbook.xlsx.writeBuffer();
3093
3094
  saveAs(new Blob([buffer]), excelName);
3094
3095
  }
3095
- getExcelColumnLetter(columnNumber) {
3096
+ GetExcelColumnLetter(columnNumber) {
3096
3097
  let letter = "";
3097
3098
  while (columnNumber >= 0) {
3098
3099
  letter = String.fromCharCode(65 + (columnNumber % 26)) + letter;
@@ -3139,13 +3140,13 @@ class EchartService {
3139
3140
  },
3140
3141
  axisLine: {
3141
3142
  show: false,
3142
- lineStyle: { color: getColor('gray'), type: 'dashed' },
3143
+ lineStyle: { color: getColor("gray"), type: "dashed" },
3143
3144
  },
3144
3145
  splitLine: {
3145
3146
  show: showSplitLine,
3146
3147
  lineStyle: {
3147
3148
  color: Color.gray,
3148
- type: 'dashed',
3149
+ type: "dashed",
3149
3150
  width: 1,
3150
3151
  },
3151
3152
  },
@@ -3158,10 +3159,10 @@ class EchartService {
3158
3159
  };
3159
3160
  }
3160
3161
  getCategoryAxisConfiguration(data) {
3161
- return this.getDefultAxisConfiguration('category', data, true);
3162
+ return this.getDefultAxisConfiguration("category", data, true);
3162
3163
  }
3163
3164
  getValueAxisConfiguration(showAxis = false, format = false, showAxisLines = false) {
3164
- let axisConfiguration = this.getDefultAxisConfiguration('value', undefined, showAxis, showAxisLines);
3165
+ let axisConfiguration = this.getDefultAxisConfiguration("value", undefined, showAxis, showAxisLines);
3165
3166
  if (format) {
3166
3167
  axisConfiguration.axisLabel.formatter = (value) => this._sharedService.FormatNumberWithSuffix(value);
3167
3168
  }
@@ -3178,18 +3179,18 @@ class EchartService {
3178
3179
  }
3179
3180
  getGridConfiguration() {
3180
3181
  return {
3181
- left: '10%',
3182
- right: '10%',
3183
- bottom: '10%',
3182
+ left: "0%",
3183
+ right: "0%",
3184
+ //bottom: '0%',
3184
3185
  containLabel: true,
3185
3186
  };
3186
3187
  }
3187
3188
  getLegendConfiguration() {
3188
3189
  return {
3189
- orient: 'horizontal', // 'horizontal | vertical'
3190
- icon: 'circle',
3190
+ orient: "horizontal", // 'horizontal | vertical'
3191
+ icon: "circle",
3191
3192
  bottom: 5,
3192
- align: 'auto',
3193
+ align: "auto",
3193
3194
  itemGap: 20,
3194
3195
  textStyle: { color: Color.blue, fontSize: 14 },
3195
3196
  };
@@ -3202,15 +3203,15 @@ class EchartService {
3202
3203
  yAxis: this.getValueAxisConfiguration(),
3203
3204
  series: [
3204
3205
  ...series.map((item) => ({
3205
- type: 'bar',
3206
+ type: "bar",
3206
3207
  name: item.name,
3207
3208
  itemStyle: { color: item.color },
3208
3209
  data: item.value,
3209
- barWidth: '25%',
3210
- barGap: '0%',
3210
+ barWidth: "25%",
3211
+ barGap: "0%",
3211
3212
  label: {
3212
3213
  show: true,
3213
- position: 'top',
3214
+ position: "top",
3214
3215
  color: Color.blue,
3215
3216
  fontSize: 12,
3216
3217
  formatter: labelConfig,
@@ -3218,8 +3219,8 @@ class EchartService {
3218
3219
  })),
3219
3220
  ],
3220
3221
  tooltip: {
3221
- trigger: 'item',
3222
- backgroundColor: '#FFFFFF',
3222
+ trigger: "item",
3223
+ backgroundColor: "#FFFFFF",
3223
3224
  borderWidth: 2,
3224
3225
  textStyle: { fontSize: 12 },
3225
3226
  formatter: tooltipConfig,
@@ -3231,10 +3232,10 @@ class EchartService {
3231
3232
  getBarChartStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
3232
3233
  let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
3233
3234
  barBase.series.forEach((serie, index) => {
3234
- serie.barWidth = '50%';
3235
- serie.barGap = '0%';
3236
- serie.barCategoryGap = '10%';
3237
- serie.stack = 'total';
3235
+ serie.barWidth = "50%";
3236
+ serie.barGap = "0%";
3237
+ serie.barCategoryGap = "10%";
3238
+ serie.stack = "total";
3238
3239
  if (index < series.length - 1) {
3239
3240
  serie.label = undefined;
3240
3241
  }
@@ -3245,9 +3246,9 @@ class EchartService {
3245
3246
  let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
3246
3247
  barBase.xAxis = this.getValueAxisConfiguration();
3247
3248
  barBase.yAxis = this.getCategoryAxisConfiguration(categories);
3248
- barBase.series.forEach((serie) => {
3249
+ barBase.series.forEach(serie => {
3249
3250
  if (serie.label) {
3250
- serie.label.position = 'right';
3251
+ serie.label.position = "right";
3251
3252
  }
3252
3253
  });
3253
3254
  return barBase;
@@ -3255,12 +3256,12 @@ class EchartService {
3255
3256
  getBarChartHorizontalStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
3256
3257
  let barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend);
3257
3258
  barBase.series.forEach((serie, index) => {
3258
- serie.barWidth = '50%';
3259
- serie.barGap = '0%';
3260
- serie.barCategoryGap = '10%';
3261
- serie.stack = 'total';
3259
+ serie.barWidth = "50%";
3260
+ serie.barGap = "0%";
3261
+ serie.barCategoryGap = "10%";
3262
+ serie.stack = "total";
3262
3263
  if (serie.label) {
3263
- serie.label.position = 'right';
3264
+ serie.label.position = "right";
3264
3265
  }
3265
3266
  if (index < series.length - 1) {
3266
3267
  serie.label = undefined;
@@ -3277,21 +3278,19 @@ class EchartService {
3277
3278
  barBase.yAxis.axisLabel.color = Color.blue;
3278
3279
  barBase.yAxis.axisLabel.fontSize = 12;
3279
3280
  barBase.yAxis.axisLabel.width = categoryWidth;
3280
- barBase.yAxis.axisLabel.overflow = 'break';
3281
- barBase.yAxis.axisLabel.align = 'left';
3282
- barBase.yAxis.axisLabel.verticalAlign =
3283
- 'middle';
3284
- barBase.yAxis.axisLabel.margin =
3285
- categoryWidth + 30;
3281
+ barBase.yAxis.axisLabel.overflow = "break";
3282
+ barBase.yAxis.axisLabel.align = "left";
3283
+ barBase.yAxis.axisLabel.verticalAlign = "middle";
3284
+ barBase.yAxis.axisLabel.margin = categoryWidth + 30;
3286
3285
  barBase.yAxis.axisLabel.lineHeight = 16;
3287
- barBase.grid.top = '0%';
3286
+ barBase.grid.top = "0%";
3288
3287
  barBase.grid.left = -1 * categoryWidth + 60;
3289
3288
  barBase.grid.right = 20;
3290
- barBase.grid.bottom = '0%';
3289
+ barBase.grid.bottom = "0%";
3291
3290
  barBase.grid.containLabel = true;
3292
3291
  }
3293
3292
  barBase.series.forEach((serie, index) => {
3294
- serie.barWidth = '75%';
3293
+ serie.barWidth = "75%";
3295
3294
  });
3296
3295
  return barBase;
3297
3296
  }
@@ -3302,48 +3301,48 @@ class EchartService {
3302
3301
  yAxis: this.getValueAxisConfiguration(true, true, true),
3303
3302
  series: [
3304
3303
  ...series.map((item, seriesIndex) => ({
3305
- type: 'line',
3304
+ type: "line",
3306
3305
  name: item.name,
3307
3306
  data: item.value,
3308
3307
  itemStyle: { color: item.color },
3309
- symbol: 'circle',
3308
+ symbol: "circle",
3310
3309
  symbolSize: 14,
3311
3310
  emphasis: {
3312
3311
  itemStyle: {
3313
3312
  color: item.color,
3314
- borderColor: item.color + '40', // 40 ( hexadecimal ) = .25 ( decimal )
3313
+ borderColor: item.color + "40", // 40 ( hexadecimal ) = .25 ( decimal )
3315
3314
  borderWidth: 16,
3316
3315
  },
3317
3316
  },
3318
3317
  })),
3319
3318
  ],
3320
3319
  tooltip: {
3321
- trigger: 'item',
3322
- backgroundColor: '#FFFFFF',
3320
+ trigger: "item",
3321
+ backgroundColor: "#FFFFFF",
3323
3322
  borderWidth: 2,
3324
3323
  textStyle: { fontSize: 12 },
3325
3324
  formatter: tooltipConfig,
3326
3325
  },
3327
3326
  dataZoom: [
3328
3327
  {
3329
- type: 'inside', // inside | slider
3328
+ type: "inside", // inside | slider
3330
3329
  show: true,
3331
3330
  height: 12,
3332
3331
  bottom: 10,
3333
- backgroundColor: '#ddd',
3334
- borderColor: 'transparent',
3335
- fillerColor: 'rgba(150, 150, 150, 0.5)',
3336
- handleSize: '80%',
3332
+ backgroundColor: "#ddd",
3333
+ borderColor: "transparent",
3334
+ fillerColor: "rgba(150, 150, 150, 0.5)",
3335
+ handleSize: "80%",
3337
3336
  handleStyle: {
3338
- color: '#A0A0A0',
3339
- borderColor: 'transparent',
3337
+ color: "#A0A0A0",
3338
+ borderColor: "transparent",
3340
3339
  shadowBlur: 2,
3341
- shadowColor: 'rgba(0, 0, 0, 0.2)',
3340
+ shadowColor: "rgba(0, 0, 0, 0.2)",
3342
3341
  },
3343
3342
  showDataShadow: false,
3344
3343
  },
3345
3344
  {
3346
- type: 'inside',
3345
+ type: "inside",
3347
3346
  showDataShadow: false,
3348
3347
  },
3349
3348
  ],
@@ -3355,13 +3354,13 @@ class EchartService {
3355
3354
  return {
3356
3355
  series: [
3357
3356
  {
3358
- data: data.map((item) => ({
3357
+ data: data.map(item => ({
3359
3358
  ...item,
3360
3359
  itemStyle: { color: item.color },
3361
3360
  })),
3362
- name: 'Pie Chart',
3363
- type: 'pie',
3364
- radius: ['40%', '70%'],
3361
+ name: "Pie Chart",
3362
+ type: "pie",
3363
+ radius: ["40%", "70%"],
3365
3364
  avoidLabelOverlap: false,
3366
3365
  emphasis: {
3367
3366
  scale: true,
@@ -3373,7 +3372,7 @@ class EchartService {
3373
3372
  },
3374
3373
  label: {
3375
3374
  show: true,
3376
- position: 'outside',
3375
+ position: "outside",
3377
3376
  color: Color.blue,
3378
3377
  fontSize: 14,
3379
3378
  formatter: labelConfig,
@@ -3381,43 +3380,43 @@ class EchartService {
3381
3380
  },
3382
3381
  ],
3383
3382
  tooltip: {
3384
- trigger: 'item',
3383
+ trigger: "item",
3385
3384
  formatter: tooltipConfig,
3386
3385
  // extraCssText: this.chartService.getTooltipCssText(),
3387
3386
  },
3388
3387
  legend: {
3389
- orient: 'horizontal', // 'horizontal | vertical'
3390
- icon: 'circle',
3388
+ orient: "horizontal", // 'horizontal | vertical'
3389
+ icon: "circle",
3391
3390
  bottom: 5,
3392
- align: 'auto',
3391
+ align: "auto",
3393
3392
  itemGap: 20,
3394
3393
  textStyle: { color: Color.blue, fontSize: 14 },
3395
3394
  },
3396
3395
  };
3397
3396
  }
3398
- getRateDoughnutPieOptions(letter, value, color) {
3397
+ getRateDoughnutPieOptions(letter, value, textSize, color) {
3399
3398
  const power = Math.ceil(Math.log10(value));
3400
3399
  const placeholderValue = Math.pow(10, power);
3401
3400
  const data = [
3402
3401
  { name: letter, value: value, itemStyle: { color: color } },
3403
3402
  {
3404
- name: 'placeholder',
3403
+ name: "placeholder",
3405
3404
  value: placeholderValue - value,
3406
- itemStyle: { color: Color.gray },
3405
+ itemStyle: { color: Color.gray5 },
3407
3406
  },
3408
3407
  ];
3409
3408
  return {
3410
3409
  tooltip: {
3411
- trigger: 'none',
3410
+ trigger: "none",
3412
3411
  },
3413
3412
  series: [
3414
3413
  {
3415
- name: 'RateDoughnutPie',
3416
- type: 'pie',
3414
+ name: "RateDoughnutPie",
3415
+ type: "pie",
3417
3416
  tooltip: {
3418
- trigger: 'none',
3417
+ trigger: "none",
3419
3418
  },
3420
- radius: ['70%', '60%'],
3419
+ radius: ["80%", "60%"],
3421
3420
  data: data,
3422
3421
  startAngle: 0,
3423
3422
  selectedMode: false,
@@ -3426,20 +3425,26 @@ class EchartService {
3426
3425
  show: true,
3427
3426
  formatter: letter,
3428
3427
  color: color,
3429
- fontSize: '40',
3430
- position: 'center',
3428
+ position: "center",
3429
+ fontWeight: "bold",
3430
+ fontSize: textSize,
3431
+ fontFamily: "Arial",
3432
+ lineHeight: textSize * -0.22,
3433
+ align: "center",
3434
+ verticalAlign: "middle",
3435
+ backgroundColor: "transparent",
3431
3436
  },
3432
3437
  },
3433
3438
  ],
3434
3439
  };
3435
3440
  }
3436
3441
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3437
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, providedIn: 'root' });
3442
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, providedIn: "root" });
3438
3443
  }
3439
3444
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EchartService, decorators: [{
3440
3445
  type: Injectable,
3441
3446
  args: [{
3442
- providedIn: 'root',
3447
+ providedIn: "root",
3443
3448
  }]
3444
3449
  }] });
3445
3450