nuxeo-development-framework 5.4.9 → 5.5.0

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.
Files changed (48) hide show
  1. package/bundles/nuxeo-development-framework.umd.js +491 -288
  2. package/bundles/nuxeo-development-framework.umd.js.map +1 -1
  3. package/esm2015/lib/components/reports/charts/plugins/data-labels.js +166 -102
  4. package/esm2015/lib/components/reports/charts/utility/colors.js +13 -1
  5. package/esm2015/lib/components/reports/ndf-reports/base/base-chart.js +2 -2
  6. package/esm2015/lib/components/reports/ndf-reports/base/base-custom-report.js +16 -3
  7. package/esm2015/lib/components/reports/ndf-reports/base/base-graph.report.js +10 -22
  8. package/esm2015/lib/components/reports/ndf-reports/base/base-report.js +5 -2
  9. package/esm2015/lib/components/reports/ndf-reports/charts-components/custom-chart/custom-chart.component.js +68 -0
  10. package/esm2015/lib/components/reports/ndf-reports/charts-components/index.js +2 -1
  11. package/esm2015/lib/components/reports/ndf-reports/components/_parts/custom-chart-dialog/custom-chart-dialog.component.js +41 -0
  12. package/esm2015/lib/components/reports/ndf-reports/components/_parts/index.js +2 -1
  13. package/esm2015/lib/components/reports/ndf-reports/components/custom-report/custom-report.component.js +23 -37
  14. package/esm2015/lib/components/reports/ndf-reports/components/dynamic-timeline-report/dynamic-timeline-report.component.js +2 -6
  15. package/esm2015/lib/components/reports/ndf-reports/containers/ndf-report/ndf-report.component.js +4 -3
  16. package/esm2015/lib/components/reports/ndf-reports/containers/ndf-reports/ndf-reports.component.js +2 -2
  17. package/esm2015/lib/components/reports/ndf-reports/models/custom-definition.js +1 -1
  18. package/esm2015/lib/components/reports/ndf-reports/models/dialog-data.js +1 -1
  19. package/esm2015/lib/components/reports/ndf-reports/models/report-config.js +1 -1
  20. package/esm2015/lib/components/reports/ndf-reports/ndf-reports.module.js +5 -3
  21. package/esm2015/lib/components/reports/ndf-reports/public-api.js +2 -1
  22. package/esm2015/lib/components/reports/ndf-reports/services/chart-manager.service.js +15 -9
  23. package/esm2015/lib/components/reports/ndf-reports/services/custom-reports-registry.service.js +1 -1
  24. package/esm2015/lib/components/reports/ndf-reports/services/report-config-mapper.service.js +1 -1
  25. package/esm2015/lib/components/reports/ndf-reports/services/report-transform.service.js +2 -2
  26. package/esm2015/lib/components/reports/ndf-reports/services/reports-dialog.service.js +32 -0
  27. package/fesm2015/nuxeo-development-framework.js +452 -267
  28. package/fesm2015/nuxeo-development-framework.js.map +1 -1
  29. package/lib/components/reports/charts/utility/colors.d.ts +5 -0
  30. package/lib/components/reports/ndf-reports/base/base-chart.d.ts +1 -1
  31. package/lib/components/reports/ndf-reports/base/base-custom-report.d.ts +18 -13
  32. package/lib/components/reports/ndf-reports/base/base-graph.report.d.ts +5 -13
  33. package/lib/components/reports/ndf-reports/base/base-report.d.ts +4 -1
  34. package/lib/components/reports/ndf-reports/charts-components/custom-chart/custom-chart.component.d.ts +15 -0
  35. package/lib/components/reports/ndf-reports/charts-components/index.d.ts +1 -0
  36. package/lib/components/reports/ndf-reports/components/_parts/custom-chart-dialog/custom-chart-dialog.component.d.ts +14 -0
  37. package/lib/components/reports/ndf-reports/components/_parts/index.d.ts +1 -0
  38. package/lib/components/reports/ndf-reports/components/custom-report/custom-report.component.d.ts +8 -10
  39. package/lib/components/reports/ndf-reports/models/custom-definition.d.ts +3 -3
  40. package/lib/components/reports/ndf-reports/models/dialog-data.d.ts +8 -0
  41. package/lib/components/reports/ndf-reports/models/report-config.d.ts +2 -2
  42. package/lib/components/reports/ndf-reports/ndf-reports.module.d.ts +22 -20
  43. package/lib/components/reports/ndf-reports/public-api.d.ts +1 -0
  44. package/lib/components/reports/ndf-reports/services/chart-manager.service.d.ts +2 -2
  45. package/lib/components/reports/ndf-reports/services/custom-reports-registry.service.d.ts +3 -2
  46. package/lib/components/reports/ndf-reports/services/report-config-mapper.service.d.ts +2 -2
  47. package/lib/components/reports/ndf-reports/services/reports-dialog.service.d.ts +21 -0
  48. package/package.json +2 -2
@@ -43376,6 +43376,18 @@
43376
43376
  }
43377
43377
  }
43378
43378
  return variants;
43379
+ }
43380
+ function createConicGradient(chart, colors) {
43381
+ var ctx = chart.ctx, chartArea = chart.chartArea;
43382
+ if (!chartArea || !('createConicGradient' in ctx)) {
43383
+ return null;
43384
+ }
43385
+ var left = chartArea.left, width = chartArea.width, top = chartArea.top, height = chartArea.height;
43386
+ //@ts-ignore
43387
+ var gradient = ctx.createConicGradient(0, left + width / 2, top + height / 2);
43388
+ gradient.addColorStop(0, colors === null || colors === void 0 ? void 0 : colors.startColor);
43389
+ gradient.addColorStop(1, colors === null || colors === void 0 ? void 0 : colors.endColor);
43390
+ return gradient;
43379
43391
  }
43380
43392
 
43381
43393
  function flatArray(data) {
@@ -43528,6 +43540,7 @@
43528
43540
  createTint: createTint,
43529
43541
  createShade: createShade,
43530
43542
  createColorVariants: createColorVariants,
43543
+ createConicGradient: createConicGradient,
43531
43544
  flatArray: flatArray,
43532
43545
  isObject: isObject,
43533
43546
  getCssVariable: getCssVariable,
@@ -44003,147 +44016,211 @@
44003
44016
  }
44004
44017
  };
44005
44018
 
44019
+ // Configuration constants
44020
+ var LABEL_CONFIG = {
44021
+ minFontSize: 10,
44022
+ maxFontSize: 16,
44023
+ defaultFontSize: 12,
44024
+ textPadding: 8,
44025
+ minAngleForPieLabel: 0.3,
44026
+ arcRadiusMultiplier: {
44027
+ pie: 0.7,
44028
+ doughnut: 0.8
44029
+ },
44030
+ fontSizeCalculation: {
44031
+ percentageDivisor: 3,
44032
+ maxPercentageForFontSize: 20
44033
+ }
44034
+ };
44035
+ // Main plugin
44006
44036
  var chartDataLabels = {
44007
44037
  id: 'chartDataLabels',
44008
44038
  afterDatasetsDraw: function (chart, args, plugins) {
44009
44039
  var _a;
44010
44040
  var ctx = chart.ctx;
44011
44041
  ctx.save();
44012
- switch ((_a = chart.config) === null || _a === void 0 ? void 0 : _a.type) {
44013
- case 'bar':
44014
- barChartLabels(chart);
44015
- break;
44016
- case 'pie':
44017
- pieChartLabels(chart);
44018
- break;
44019
- case 'doughnut':
44020
- doughnutChartLabels(chart);
44021
- break;
44042
+ var chartType = (_a = chart.config) === null || _a === void 0 ? void 0 : _a.type;
44043
+ var renderer = getChartRenderer(chartType);
44044
+ if (renderer) {
44045
+ renderer(chart);
44022
44046
  }
44023
44047
  ctx.restore();
44024
44048
  }
44025
44049
  };
44050
+ // Chart type router
44051
+ function getChartRenderer(chartType) {
44052
+ var renderers = {
44053
+ bar: barChartLabels,
44054
+ pie: pieChartLabels,
44055
+ doughnut: doughnutChartLabels
44056
+ };
44057
+ return renderers[chartType];
44058
+ }
44059
+ // Core utility functions
44060
+ function calculatePercentage(value, total) {
44061
+ return total > 0 ? (value / total) * 100 : 0;
44062
+ }
44063
+ function calculateFontSize(percentage) {
44064
+ var _c = LABEL_CONFIG.fontSizeCalculation, percentageDivisor = _c.percentageDivisor, maxPercentageForFontSize = _c.maxPercentageForFontSize;
44065
+ var calculatedSize = Math.min(percentage / percentageDivisor, maxPercentageForFontSize);
44066
+ return Math.max(LABEL_CONFIG.minFontSize, Math.min(calculatedSize, LABEL_CONFIG.maxFontSize));
44067
+ }
44068
+ function getTextMetrics(ctx, text, fontSize) {
44069
+ ctx.font = "normal " + fontSize + "px sans-serif";
44070
+ var metrics = ctx.measureText(text);
44071
+ var height = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent || LABEL_CONFIG.defaultFontSize;
44072
+ return {
44073
+ width: metrics.width,
44074
+ height: height
44075
+ };
44076
+ }
44077
+ function prepareCanvasForText(ctx, fontSize, color) {
44078
+ ctx.font = "bold " + fontSize + "px sans-serif";
44079
+ ctx.textAlign = 'center';
44080
+ ctx.textBaseline = 'middle';
44081
+ ctx.fillStyle = color;
44082
+ }
44083
+ function extractLabelData(dataset, index, totalSum, chart) {
44084
+ var value = dataset.data[index];
44085
+ var percentage = calculatePercentage(value, totalSum);
44086
+ var isVisible = chart.getDataVisibility(index);
44087
+ if (!percentage || !isVisible) {
44088
+ return null;
44089
+ }
44090
+ return {
44091
+ text: percentage.toFixed(1) + "%",
44092
+ percentage: percentage,
44093
+ backgroundColor: Array.isArray(dataset.backgroundColor) ? dataset.backgroundColor[index] : dataset.backgroundColor,
44094
+ isVisible: isVisible
44095
+ };
44096
+ }
44097
+ // Bar chart implementation
44026
44098
  function barChartLabels(chart) {
44027
44099
  var _a;
44028
- var ctx = chart.ctx, data = chart.data;
44100
+ var ctx = chart.ctx;
44029
44101
  var isHorizontalChart = ((_a = chart.options) === null || _a === void 0 ? void 0 : _a.indexAxis) === 'y';
44030
- var isHorizontalReversed = isBarChartReversed(chart).isHorizontalReversed;
44102
+ var isHorizontalReversed = getBarChartOrientation(chart).isHorizontalReversed;
44031
44103
  chart.data.datasets.forEach(function (dataset, datasetIndex) {
44032
44104
  var meta = chart.getDatasetMeta(datasetIndex);
44033
- var totalSum = dataset.data.reduce(function (sum, currentValue) { return sum + currentValue; }, 0);
44105
+ var totalSum = dataset.data.reduce(function (sum, value) { return sum + value; }, 0);
44034
44106
  meta.data.forEach(function (dataPoint, index) {
44035
44107
  if (!dataPoint)
44036
44108
  return;
44037
- var percentage = (dataset.data[index] / totalSum) * 100;
44038
- var isVisible = chart.getDataVisibility(index);
44039
- if (!percentage || !isVisible) {
44109
+ var labelData = extractLabelData(dataset, index, totalSum, chart);
44110
+ if (!labelData)
44040
44111
  return;
44041
- }
44042
- var bgColor = dataset.backgroundColor[index];
44043
- var textColor = getTextColor(bgColor);
44044
- var fontSize = Math.max(12, Math.min(percentage / 2, 14));
44045
- ctx.textAlign = 'center';
44046
- ctx.textBaseline = 'middle';
44047
- ctx.font = "normal " + fontSize + "px sans-serif";
44048
- ctx.fillStyle = textColor;
44049
- var text = percentage.toFixed() + "%";
44050
- var _c = getTextMetrics(ctx, text), width = _c.width, height = _c.height;
44051
- var textHeight = height || 12;
44052
- var textWidth = width || 30;
44053
- if (isHorizontalChart) {
44054
- if ((dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.width) > 0) {
44055
- var textPadding = 20;
44056
- var offset = textPadding + textWidth <= dataPoint.width ? textWidth : textWidth >= dataPoint.width ? 0 : 10;
44057
- var x = dataPoint.x + (isHorizontalReversed ? offset : -offset);
44058
- ctx.fillStyle = dataPoint.width <= textWidth ? getColor('--chart-value-default-color', '#000') : textColor;
44059
- if (percentage) {
44060
- ctx.fillText(text, x, dataPoint.y);
44061
- }
44062
- }
44063
- }
44064
- else {
44065
- if ((dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.height) > 0) {
44066
- var y = textHeight >= dataPoint.height ? dataPoint.y - 10 : dataPoint.y + 10;
44067
- ctx.fillStyle = textHeight >= dataPoint.height ? getColor('--chart-value-default-color', '#000') : textColor;
44068
- if (!percentage) {
44069
- return;
44070
- }
44071
- ctx.fillText(text, dataPoint.x, y);
44072
- }
44112
+ var fontSize = calculateFontSize(labelData.percentage);
44113
+ var textMetrics = getTextMetrics(ctx, labelData.text, fontSize);
44114
+ var position = calculateBarLabelPosition(dataPoint, textMetrics, isHorizontalChart, isHorizontalReversed, labelData.backgroundColor);
44115
+ if (position) {
44116
+ prepareCanvasForText(ctx, fontSize, position.color);
44117
+ ctx.fillText(labelData.text, position.x, position.y);
44073
44118
  }
44074
44119
  });
44075
44120
  });
44076
44121
  }
44077
- function doughnutChartLabels(chart) {
44078
- var ctx = chart.ctx, data = chart.data;
44079
- chart.data.datasets.forEach(function (dataset, datasetIndex) {
44080
- var meta = chart.getDatasetMeta(datasetIndex);
44081
- var totalSum = dataset.data.reduce(function (sum, currentValue) { return sum + currentValue; }, 0);
44082
- meta.data.forEach(function (arc, index) {
44083
- if (!arc)
44084
- return;
44085
- var percentage = (dataset.data[index] / totalSum) * 100;
44086
- var isVisible = chart.getDataVisibility(index);
44087
- if (!percentage || !isVisible) {
44088
- return;
44089
- }
44090
- var midAngle = (arc.startAngle + arc.endAngle) / 2;
44091
- var x = arc.x + Math.cos(midAngle) * (arc.outerRadius / 1.2);
44092
- var y = arc.y + Math.sin(midAngle) * (arc.outerRadius / 1.2);
44093
- var fontSize = Math.max(12, Math.min(percentage / 2, 14));
44094
- var bgColor = dataset.backgroundColor[index] || '#00000';
44095
- prepareText(ctx, fontSize, bgColor);
44096
- ctx.fillText(percentage.toFixed() + "%", x, y);
44097
- });
44098
- });
44122
+ function calculateBarLabelPosition(dataPoint, textMetrics, isHorizontal, isReversed, backgroundColor) {
44123
+ var textPadding = LABEL_CONFIG.textPadding;
44124
+ if (isHorizontal) {
44125
+ var fitsInside = textMetrics.width + textPadding * 2 <= dataPoint.width;
44126
+ if (fitsInside) {
44127
+ return {
44128
+ x: dataPoint.x + (isReversed ? textMetrics.width / 2 : -textMetrics.width / 2),
44129
+ y: dataPoint.y,
44130
+ color: getTextColor(backgroundColor)
44131
+ };
44132
+ }
44133
+ else {
44134
+ return {
44135
+ x: dataPoint.x + (isReversed ? -textMetrics.width / 2 - textPadding : textMetrics.width / 2 + textPadding),
44136
+ y: dataPoint.y,
44137
+ color: getColor('--chart-value-default-color', '#000')
44138
+ };
44139
+ }
44140
+ }
44141
+ else {
44142
+ var fitsInside = textMetrics.height + textPadding * 2 <= dataPoint.height;
44143
+ if (fitsInside) {
44144
+ return {
44145
+ x: dataPoint.x,
44146
+ y: dataPoint.y,
44147
+ color: getTextColor(backgroundColor)
44148
+ };
44149
+ }
44150
+ else {
44151
+ return {
44152
+ x: dataPoint.x,
44153
+ y: dataPoint.y - textMetrics.height / 2 - textPadding,
44154
+ color: getColor('--chart-value-default-color', '#000')
44155
+ };
44156
+ }
44157
+ }
44099
44158
  }
44159
+ // Pie chart implementation
44100
44160
  function pieChartLabels(chart) {
44101
- var ctx = chart.ctx, data = chart.data;
44161
+ renderArcLabels(chart, 'pie');
44162
+ }
44163
+ // Doughnut chart implementation
44164
+ function doughnutChartLabels(chart) {
44165
+ renderArcLabels(chart, 'doughnut');
44166
+ }
44167
+ function renderArcLabels(chart, chartType) {
44168
+ var ctx = chart.ctx;
44102
44169
  chart.data.datasets.forEach(function (dataset, datasetIndex) {
44103
44170
  var meta = chart.getDatasetMeta(datasetIndex);
44104
- var totalSum = dataset.data.reduce(function (sum, currentValue) { return sum + currentValue; }, 0);
44171
+ var totalSum = dataset.data.reduce(function (sum, value) { return sum + value; }, 0);
44105
44172
  meta.data.forEach(function (arc, index) {
44106
44173
  if (!arc)
44107
44174
  return;
44108
- var percentage = (dataset.data[index] / totalSum) * 100;
44109
- var isVisible = chart.getDataVisibility(index);
44110
- if (!percentage || !isVisible) {
44175
+ var labelData = extractLabelData(dataset, index, totalSum, chart);
44176
+ if (!labelData)
44111
44177
  return;
44178
+ if (shouldShowArcLabel(arc, labelData.text, chartType)) {
44179
+ var position = calculateArcLabelPosition(arc, chartType);
44180
+ var fontSize = calculateFontSize(labelData.percentage);
44181
+ var textColor = getTextColor(labelData.backgroundColor || '#000000');
44182
+ prepareCanvasForText(ctx, fontSize, textColor);
44183
+ ctx.fillText(labelData.text, position.x, position.y);
44112
44184
  }
44113
- var midAngle = (arc.startAngle + arc.endAngle) / 2;
44114
- var x = arc.x + Math.cos(midAngle) * (arc.outerRadius / 1.5);
44115
- var y = arc.y + Math.sin(midAngle) * (arc.outerRadius / 1.5);
44116
- var fontSize = Math.max(12, Math.min(percentage / 2, 14));
44117
- var bgColor = dataset.backgroundColor[index] || '#00000';
44118
- prepareText(ctx, fontSize, bgColor);
44119
- ctx.fillText(percentage.toFixed() + "%", x, y);
44120
44185
  });
44121
44186
  });
44122
44187
  }
44123
- function isBarChartReversed(chart) {
44124
- var _a, _b;
44125
- var scales = chart.options.scales;
44126
- var isVerticalReversed = ((_a = scales === null || scales === void 0 ? void 0 : scales.y) === null || _a === void 0 ? void 0 : _a.reverse) === true;
44127
- var isHorizontalReversed = ((_b = scales === null || scales === void 0 ? void 0 : scales.x) === null || _b === void 0 ? void 0 : _b.reverse) === true;
44188
+ function shouldShowArcLabel(arc, text, chartType) {
44189
+ var arcAngle = Math.abs(arc.endAngle - arc.startAngle);
44190
+ // Don't show labels for very small slices
44191
+ if (arcAngle < LABEL_CONFIG.minAngleForPieLabel) {
44192
+ return false;
44193
+ }
44194
+ // For doughnut charts, also check if there's enough radial space
44195
+ if (chartType === 'doughnut') {
44196
+ var radialSpace = arc.outerRadius - arc.innerRadius;
44197
+ return radialSpace >= LABEL_CONFIG.defaultFontSize * 1.5;
44198
+ }
44199
+ return true;
44200
+ }
44201
+ function calculateArcLabelPosition(arc, chartType) {
44202
+ var midAngle = (arc.startAngle + arc.endAngle) / 2;
44203
+ var radiusMultiplier = LABEL_CONFIG.arcRadiusMultiplier[chartType];
44204
+ var radius;
44205
+ if (chartType === 'doughnut') {
44206
+ radius = (arc.outerRadius + arc.innerRadius) / 2;
44207
+ }
44208
+ else {
44209
+ radius = arc.outerRadius * radiusMultiplier;
44210
+ }
44128
44211
  return {
44129
- isVerticalReversed: isVerticalReversed,
44130
- isHorizontalReversed: isHorizontalReversed
44212
+ x: arc.x + Math.cos(midAngle) * radius,
44213
+ y: arc.y + Math.sin(midAngle) * radius
44131
44214
  };
44132
44215
  }
44133
- function getTextMetrics(ctx, text) {
44134
- var metrics = ctx.measureText(text);
44135
- var textHeight = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent;
44216
+ // Utility functions
44217
+ function getBarChartOrientation(chart) {
44218
+ var _a, _b;
44219
+ var scales = chart.options.scales;
44136
44220
  return {
44137
- height: textHeight,
44138
- width: metrics.width
44221
+ isVerticalReversed: ((_a = scales === null || scales === void 0 ? void 0 : scales.y) === null || _a === void 0 ? void 0 : _a.reverse) === true,
44222
+ isHorizontalReversed: ((_b = scales === null || scales === void 0 ? void 0 : scales.x) === null || _b === void 0 ? void 0 : _b.reverse) === true
44139
44223
  };
44140
- }
44141
- function prepareText(ctx, fontSize, bgColor) {
44142
- var textColor = getTextColor(bgColor || getColor('--chart-value-default-color', '#000'));
44143
- ctx.font = "bold " + fontSize + "px sans-serif";
44144
- ctx.textAlign = 'center';
44145
- ctx.textBaseline = 'middle';
44146
- ctx.fillStyle = textColor;
44147
44224
  }
44148
44225
 
44149
44226
  var index = /*#__PURE__*/Object.freeze({
@@ -44162,9 +44239,9 @@
44162
44239
  _this.injector = injector;
44163
44240
  _this._translateService = _this.injector.get(i1.TranslateService);
44164
44241
  _this._rebuildTriggerSub = new rxjs.BehaviorSubject(false);
44165
- _this._dataSub = new rxjs.ReplaySubject(null);
44166
44242
  _this._configSub = new rxjs.ReplaySubject(null);
44167
44243
  _this._isInitialized = false;
44244
+ _this._dataSub = new rxjs.ReplaySubject(null);
44168
44245
  _this.onReady = new i0.EventEmitter();
44169
44246
  _this._subscribeToLanguage();
44170
44247
  return _this;
@@ -44385,7 +44462,9 @@
44385
44462
  });
44386
44463
  this._charts.clear();
44387
44464
  };
44388
- ChartManagerService.prototype.printChart = function (id, label) {
44465
+ ChartManagerService.prototype.printChart = function (id, label, options, plugins) {
44466
+ if (options === void 0) { options = {}; }
44467
+ if (plugins === void 0) { plugins = []; }
44389
44468
  return __awaiter(this, void 0, void 0, function () {
44390
44469
  var _chart, _b, chart, destroyTempChart, imageLink, date;
44391
44470
  return __generator(this, function (_c) {
@@ -44395,7 +44474,7 @@
44395
44474
  if (!_chart) {
44396
44475
  return [2 /*return*/];
44397
44476
  }
44398
- return [4 /*yield*/, this._createHiddenCanvasForExport(_chart, label)];
44477
+ return [4 /*yield*/, this._createHiddenCanvasForExport(_chart, label, options, plugins)];
44399
44478
  case 1:
44400
44479
  _b = _c.sent(), chart = _b.chart, destroyTempChart = _b.destroy;
44401
44480
  if (!chart) {
@@ -44412,8 +44491,10 @@
44412
44491
  });
44413
44492
  });
44414
44493
  };
44415
- ChartManagerService.prototype._createHiddenCanvasForExport = function (chart, label) {
44494
+ ChartManagerService.prototype._createHiddenCanvasForExport = function (chart, label, options, plugins) {
44416
44495
  var _this = this;
44496
+ if (options === void 0) { options = {}; }
44497
+ if (plugins === void 0) { plugins = []; }
44417
44498
  var currentLang = this._translateService.currentLang;
44418
44499
  return new Promise(function (resolve) {
44419
44500
  var _a;
@@ -44429,9 +44510,13 @@
44429
44510
  var hiddenChart = new Chart.Chart(hiddenCanvas, {
44430
44511
  type: (_a = chart.config) === null || _a === void 0 ? void 0 : _a.type,
44431
44512
  data: chart.config.data,
44432
- options: Object.assign(Object.assign({}, chart.config.options), { animation: false, responsive: false, layout: {
44513
+ options: ___default["default"].merge({}, chart.config.options, {
44514
+ animation: false,
44515
+ responsive: false,
44516
+ layout: {
44433
44517
  padding: padding
44434
- }, plugins: Object.assign(Object.assign({}, chart.config.options.plugins), { title: {
44518
+ },
44519
+ plugins: Object.assign(Object.assign({}, chart.config.options.plugins), { title: {
44435
44520
  display: true,
44436
44521
  text: label,
44437
44522
  padding: {
@@ -44442,8 +44527,9 @@
44442
44527
  display: true,
44443
44528
  rtl: currentLang == 'ar',
44444
44529
  position: currentLang == 'ar' ? 'right' : 'left'
44445
- } }) }),
44446
- plugins: [
44530
+ } })
44531
+ }, options),
44532
+ plugins: ___default["default"].merge([], [
44447
44533
  chartDataLabels,
44448
44534
  {
44449
44535
  id: 'canvasBackgroundColor',
@@ -44468,7 +44554,7 @@
44468
44554
  });
44469
44555
  }
44470
44556
  }
44471
- ]
44557
+ ], plugins)
44472
44558
  });
44473
44559
  hiddenChart.render();
44474
44560
  });
@@ -44495,7 +44581,7 @@
44495
44581
  }
44496
44582
  ReportTransformService.prototype._extractDataFormats = function (data) {
44497
44583
  var extractedData = ___default["default"].flatMap(data, function (item) {
44498
- if (Array.isArray(item === null || item === void 0 ? void 0 : item.datasource)) {
44584
+ if ('datasource' in item && Array.isArray(item === null || item === void 0 ? void 0 : item.datasource)) {
44499
44585
  return ___default["default"].filter(item.datasource, function (source) { return source.dataFormat; });
44500
44586
  }
44501
44587
  return [];
@@ -45543,6 +45629,8 @@
45543
45629
  function BaseReport(injector) {
45544
45630
  var _this = _super.call(this) || this;
45545
45631
  _this.injector = injector;
45632
+ _this._translateService = _this.injector.get(i1.TranslateService);
45633
+ _this._cdr = _this.injector.get(i0.ChangeDetectorRef);
45546
45634
  _this._configMapperService = _this.injector.get(ReportConfigMapperService);
45547
45635
  _this._configSub = new rxjs.BehaviorSubject(null);
45548
45636
  _this.config$ = _this._configSub.asObservable();
@@ -45616,6 +45704,203 @@
45616
45704
  type: i0.Output
45617
45705
  }] } });
45618
45706
 
45707
+ var ReportsDialogService = /** @class */ (function () {
45708
+ function ReportsDialogService(injector) {
45709
+ this.injector = injector;
45710
+ this._translateService = this.injector.get(i1.TranslateService);
45711
+ this._dialog = this.injector.get(i1$4.MatDialog);
45712
+ }
45713
+ ReportsDialogService.prototype.open = function (component, options) {
45714
+ var config = options.config, data = options.data, criteria = options.criteria, direction = options.direction;
45715
+ var _a = (config === null || config === void 0 ? void 0 : config.dialog) || {}, active = _a.active, width = _a.width, height = _a.height, maxWidth = _a.maxWidth, resetOptions = __rest(_a, ["active", "width", "height", "maxWidth"]);
45716
+ this._dialog.open(component, Object.assign(Object.assign({}, resetOptions), { width: width || '100%', height: height || '100%', maxWidth: maxWidth || '100%', direction: direction, data: {
45717
+ config: config,
45718
+ data: data,
45719
+ title: config.label,
45720
+ direction: direction,
45721
+ criteria: criteria
45722
+ } }));
45723
+ };
45724
+ return ReportsDialogService;
45725
+ }());
45726
+ ReportsDialogService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ReportsDialogService, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
45727
+ ReportsDialogService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ReportsDialogService, providedIn: 'root' });
45728
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ReportsDialogService, decorators: [{
45729
+ type: i0.Injectable,
45730
+ args: [{
45731
+ providedIn: 'root'
45732
+ }]
45733
+ }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; } });
45734
+
45735
+ var BaseGraphReport = /** @class */ (function (_super) {
45736
+ __extends(BaseGraphReport, _super);
45737
+ function BaseGraphReport() {
45738
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
45739
+ _this._dialog = _this.injector.get(ReportsDialogService);
45740
+ return _this;
45741
+ }
45742
+ BaseGraphReport.prototype.openGraphDialog = function (component) {
45743
+ if (component === void 0) { component = GraphChartComponent; }
45744
+ this._dialog.open(component, {
45745
+ config: this.config,
45746
+ data: this.data,
45747
+ criteria: this.criteria,
45748
+ direction: this.direction
45749
+ });
45750
+ };
45751
+ return BaseGraphReport;
45752
+ }(BaseReport));
45753
+ BaseGraphReport.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseGraphReport, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
45754
+ BaseGraphReport.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: BaseGraphReport, usesInheritance: true, ngImport: i0__namespace });
45755
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseGraphReport, decorators: [{
45756
+ type: i0.Directive
45757
+ }] });
45758
+
45759
+ var BaseCustomReport = /** @class */ (function (_super) {
45760
+ __extends(BaseCustomReport, _super);
45761
+ function BaseCustomReport(injector) {
45762
+ var _this = _super.call(this) || this;
45763
+ _this.injector = injector;
45764
+ _this._chartHelperService = _this.injector.get(ChartManagerService);
45765
+ _this.direction = 'rtl';
45766
+ _this._dataSub = new rxjs.ReplaySubject(null);
45767
+ _this._criteriaSub = new rxjs.ReplaySubject(null);
45768
+ _this.criteria$ = _this._criteriaSub.asObservable();
45769
+ _this._configSub = new rxjs.BehaviorSubject(null);
45770
+ _this.config$ = _this._configSub.asObservable();
45771
+ return _this;
45772
+ }
45773
+ Object.defineProperty(BaseCustomReport.prototype, "data", {
45774
+ get: function () {
45775
+ return this._data;
45776
+ },
45777
+ set: function (data) {
45778
+ this._data = data;
45779
+ this._dataSub.next(data);
45780
+ },
45781
+ enumerable: false,
45782
+ configurable: true
45783
+ });
45784
+ Object.defineProperty(BaseCustomReport.prototype, "criteria", {
45785
+ get: function () {
45786
+ return this._criteria;
45787
+ },
45788
+ set: function (value) {
45789
+ this._criteria = ___default["default"].cloneDeep(value);
45790
+ this._criteriaSub.next(this._criteria);
45791
+ },
45792
+ enumerable: false,
45793
+ configurable: true
45794
+ });
45795
+ Object.defineProperty(BaseCustomReport.prototype, "config", {
45796
+ get: function () {
45797
+ return this._configSub.getValue();
45798
+ },
45799
+ set: function (obj) {
45800
+ if (obj) {
45801
+ this._configSub.next(obj);
45802
+ }
45803
+ },
45804
+ enumerable: false,
45805
+ configurable: true
45806
+ });
45807
+ BaseCustomReport.prototype.chartReady = function (chart) {
45808
+ var _this = this;
45809
+ this.chart = chart;
45810
+ this._chartHelperService.setChart(chart);
45811
+ this._printListener = function (event) {
45812
+ _this.chart.resize();
45813
+ };
45814
+ window.addEventListener('beforeprint', this._printListener);
45815
+ queueMicrotask(function () {
45816
+ _this.chart.resize();
45817
+ });
45818
+ };
45819
+ return BaseCustomReport;
45820
+ }(DestroySubject));
45821
+ BaseCustomReport.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseCustomReport, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Directive });
45822
+ BaseCustomReport.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: BaseCustomReport, inputs: { direction: "direction", definition: "definition", data: "data", criteria: "criteria", config: "config" }, usesInheritance: true, ngImport: i0__namespace });
45823
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseCustomReport, decorators: [{
45824
+ type: i0.Directive
45825
+ }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; }, propDecorators: { direction: [{
45826
+ type: i0.Input
45827
+ }], definition: [{
45828
+ type: i0.Input
45829
+ }], data: [{
45830
+ type: i0.Input
45831
+ }], criteria: [{
45832
+ type: i0.Input
45833
+ }], config: [{
45834
+ type: i0.Input
45835
+ }] } });
45836
+
45837
+ var CustomChartComponent = /** @class */ (function (_super) {
45838
+ __extends(CustomChartComponent, _super);
45839
+ function CustomChartComponent() {
45840
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
45841
+ _this._registeredComponents = _this.injector.get(CustomReportsRegistry);
45842
+ return _this;
45843
+ }
45844
+ CustomChartComponent.prototype.ngOnInit = function () {
45845
+ var _this = this;
45846
+ var _a, _b;
45847
+ var componentType = this._registeredComponents.getComponent((_a = this.config) === null || _a === void 0 ? void 0 : _a.type);
45848
+ if (!componentType) {
45849
+ console.warn("No component registered for type: " + ((_b = this.config) === null || _b === void 0 ? void 0 : _b.type));
45850
+ return;
45851
+ }
45852
+ this._componentRef = this._registeredComponents.renderComponent(componentType.type, this.container);
45853
+ rxjs.combineLatest([this._dataSub.asObservable(), this._configSub.asObservable(), this._criteriaSub.asObservable()])
45854
+ .pipe(operators.takeUntil(this.destroy$))
45855
+ .subscribe(function (res) {
45856
+ _this._prepareComponent();
45857
+ });
45858
+ };
45859
+ CustomChartComponent.prototype.ngOnChanges = function (changes) {
45860
+ var _this = this;
45861
+ if (!this._componentRef) {
45862
+ return;
45863
+ }
45864
+ Object.keys(changes).forEach(function (key) {
45865
+ _this._componentRef.instance[key] = changes[key].currentValue;
45866
+ });
45867
+ this._componentRef.changeDetectorRef.detectChanges();
45868
+ };
45869
+ CustomChartComponent.prototype.ngOnDestroy = function () {
45870
+ if (this._componentRef) {
45871
+ this._componentRef.destroy();
45872
+ }
45873
+ };
45874
+ CustomChartComponent.prototype._prepareComponent = function () {
45875
+ var instance = this._componentRef.instance;
45876
+ instance.config = this.config;
45877
+ instance.criteria = this.criteria;
45878
+ instance.data = this.data;
45879
+ instance.direction = this.direction;
45880
+ this._componentRef.changeDetectorRef.detectChanges();
45881
+ };
45882
+ CustomChartComponent.prototype.print = function () {
45883
+ var instance = this._componentRef.instance;
45884
+ if (instance) {
45885
+ instance.print();
45886
+ }
45887
+ };
45888
+ return CustomChartComponent;
45889
+ }(BaseCustomReport));
45890
+ CustomChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomChartComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
45891
+ CustomChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomChartComponent, selector: "app-custom-chart", viewQueries: [{ propertyName: "container", first: true, predicate: ["dynamicContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: '<ng-container #dynamicContainer></ng-container>', isInline: true, styles: [""] });
45892
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomChartComponent, decorators: [{
45893
+ type: i0.Component,
45894
+ args: [{
45895
+ selector: 'app-custom-chart',
45896
+ template: '<ng-container #dynamicContainer></ng-container>',
45897
+ styleUrls: ['./custom-chart.component.scss']
45898
+ }]
45899
+ }], propDecorators: { container: [{
45900
+ type: i0.ViewChild,
45901
+ args: ['dynamicContainer', { read: i0.ViewContainerRef, static: true }]
45902
+ }] } });
45903
+
45619
45904
  var ChartPanel = /** @class */ (function () {
45620
45905
  function ChartPanel() {
45621
45906
  }
@@ -45841,6 +46126,58 @@
45841
46126
  type: i0.Output
45842
46127
  }] } });
45843
46128
 
46129
+ var GraphReportComponent = /** @class */ (function (_super) {
46130
+ __extends(GraphReportComponent, _super);
46131
+ function GraphReportComponent() {
46132
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
46133
+ _this.chartType$ = _this.config$.pipe(operators.map(function (config) {
46134
+ var _a, _b;
46135
+ if (config.chart.type !== 'bar') {
46136
+ return config.chart.type;
46137
+ }
46138
+ return ((_b = (_a = config.chart) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.indexAxis) == 'y' ? CHARTS_TYPES.horizontalBar : CHARTS_TYPES.verticalBar;
46139
+ }));
46140
+ return _this;
46141
+ }
46142
+ GraphReportComponent.prototype.changeChartType = function (type) {
46143
+ var _d;
46144
+ var _a, _b;
46145
+ var _c = this._configSub.getValue(), chart = _c.chart, config = __rest(_c, ["chart"]);
46146
+ var options = chart.options, chartConfig = __rest(chart, ["options"]);
46147
+ if (config.mode !== REPORT_MODE.graph) {
46148
+ return;
46149
+ }
46150
+ var barTypes = (_d = {},
46151
+ _d[CHARTS_TYPES.horizontalBar] = 'bar',
46152
+ _d[CHARTS_TYPES.verticalBar] = 'bar',
46153
+ _d);
46154
+ var chartType = (_a = barTypes[type]) !== null && _a !== void 0 ? _a : type;
46155
+ this._configSub.next(Object.assign(Object.assign({}, config), { chart: Object.assign(Object.assign({}, chartConfig), { type: chartType, options: (_b = chart.overrides) === null || _b === void 0 ? void 0 : _b[type] }) }));
46156
+ };
46157
+ GraphReportComponent.prototype.printChart = function () {
46158
+ if (this.graphChartComponent) {
46159
+ this.graphChartComponent.printChart();
46160
+ }
46161
+ };
46162
+ return GraphReportComponent;
46163
+ }(BaseGraphReport));
46164
+ GraphReportComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GraphReportComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
46165
+ GraphReportComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: GraphReportComponent, selector: "app-graph-report", host: { classAttribute: "graph-report flex flex-col flex-grow" }, viewQueries: [{ propertyName: "graphChartComponent", first: true, predicate: ["graphChart"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<chart-panel *ngIf=\"config$ | async as config\" class=\"ndf-report chart-report\">\r\n\t<chart-panel-header class=\"ndf-report__header mb-3\">\r\n\t\t<span>\r\n\t\t\t{{ config.label | translate }}\r\n\t\t</span>\r\n\t\t<button\r\n\t\t\t*ngIf=\"config?.dialog?.active\"\r\n\t\t\tclass=\"dialog-button print:hidden\"\r\n\t\t\t(click)=\"openGraphDialog()\"\r\n\t\t\t[matTooltip]=\"'REPORTS.fullscreen' | translate\"\r\n\t\t>\r\n\t\t\t<mat-icon>fullscreen</mat-icon>\r\n\t\t</button>\r\n\t</chart-panel-header>\r\n\r\n\t<app-graph-chart\r\n\t\t#graphChart\r\n\t\tclass=\"ndf-report__content graph-chart\"\r\n\t\t[config]=\"config\"\r\n\t\t[data]=\"data\"\r\n\t></app-graph-chart>\r\n\r\n\t<chart-panel-footer class=\"ndf-report__footer flex-wrap\">\r\n\t\t<app-report-actions\r\n\t\t\t[config]=\"config\"\r\n\t\t\t(print)=\"printChart()\"\r\n\t\t\t(navigate)=\"navigate()\"\r\n\t\t\t(open)=\"onOpen.emit(null)\"\r\n\t\t></app-report-actions>\r\n\r\n\t\t<chart-type-selector\r\n [config]=\"config?.typeConfig\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t[type]=\"chartType$ | async\"\r\n\t\t\t(typeChange)=\"changeChartType($event)\"\r\n\t\t></chart-type-selector>\r\n\t</chart-panel-footer>\r\n</chart-panel>\r\n", styles: [".ndf-report{display:flex;flex-direction:column;min-width:0;max-width:100%;flex-grow:1}.ndf-report__content{position:relative;padding-block:.5rem;flex-grow:1;min-width:0;max-width:100%}.chart-actions{border:var(--chart-actions-border, 1px solid var(--border-color))}.chart-actions__item{background:var(--chart-actions-background, transparent);color:var(--chart-actions-color, currentColor);box-shadow:var(--chart-actions-shadow, unset);width:var(--chart-actions-width, 35px);height:var(--chart-actions-height, 35px);border-radius:var(--chart-actions-border-radius, 4px);flex-grow:1;display:grid;place-items:center}.chart-actions__item .mat-icon{color:var(--main-color, currentColor)}.chart-actions__item:hover{--chart-actions-shadow: var(--chart-actions-hover-shadow, 0 0 0 1px var(--main-color))}.chart-actions__item.selected{--chart-actions-background: var(--chart-actions-active-background, var(--main-color));--chart-actions-color: var(--chart-actions-active-color, var(--main-hover))}.chart-actions__item.selected .mat-icon{color:currentColor!important}@media print{.chart-actions{display:none}}:host{min-width:0;max-width:100%}\n"], components: [{ type: ChartPanel, selector: "chart-panel" }, { type: ChartPanelHeaderComponent, selector: "chart-panel-header" }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: GraphChartComponent, selector: "app-graph-chart" }, { type: ChartPanelFooterComponent, selector: "chart-panel-footer" }, { type: ReportActionsComponent, selector: "app-report-actions", inputs: ["config"], outputs: ["navigate", "open", "print"] }, { type: ChartTypeSelectorComponent, selector: "chart-type-selector", inputs: ["direction", "config", "type"], outputs: ["typeChange"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
46166
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GraphReportComponent, decorators: [{
46167
+ type: i0.Component,
46168
+ args: [{
46169
+ selector: 'app-graph-report',
46170
+ templateUrl: './graph-report.component.html',
46171
+ styleUrls: ['./graph-report.component.scss'],
46172
+ host: {
46173
+ class: 'graph-report flex flex-col flex-grow'
46174
+ }
46175
+ }]
46176
+ }], propDecorators: { graphChartComponent: [{
46177
+ type: i0.ViewChild,
46178
+ args: ['graphChart']
46179
+ }] } });
46180
+
45844
46181
  var TimeGroupSelectorComponent = /** @class */ (function () {
45845
46182
  function TimeGroupSelectorComponent() {
45846
46183
  this.groups = this._prepareGroups();
@@ -45995,89 +46332,38 @@
45995
46332
  args: ['graphChart']
45996
46333
  }] } });
45997
46334
 
45998
- var BaseGraphReport = /** @class */ (function (_super) {
45999
- __extends(BaseGraphReport, _super);
46000
- function BaseGraphReport() {
46001
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
46002
- _this._translateService = _this.injector.get(i1.TranslateService);
46003
- _this._cdr = _this.injector.get(i0.ChangeDetectorRef);
46004
- _this._dialog = _this.injector.get(i1$4.MatDialog);
46005
- return _this;
46006
- }
46007
- BaseGraphReport.prototype.openGraphDialog = function (_options) {
46008
- var _a;
46009
- var _c = _options || {
46010
- config: this.config,
46011
- data: this.data,
46012
- component: GraphDialogComponent
46013
- }, config = _c.config, data = _c.data, component = _c.component, criteria = _c.criteria;
46014
- var _b = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.dialog) || {}, active = _b.active, width = _b.width, height = _b.height, maxWidth = _b.maxWidth, options = __rest(_b, ["active", "width", "height", "maxWidth"]);
46015
- this._dialog.open(component, Object.assign(Object.assign({}, options), { width: width || '100%', height: height || '100%', maxWidth: maxWidth || '100%', direction: this.direction, data: {
46016
- config: config,
46017
- data: data,
46018
- title: config.label,
46019
- direction: this.direction,
46020
- criteria: criteria
46021
- } }));
46022
- };
46023
- return BaseGraphReport;
46024
- }(BaseReport));
46025
- BaseGraphReport.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseGraphReport, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
46026
- BaseGraphReport.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: BaseGraphReport, usesInheritance: true, ngImport: i0__namespace });
46027
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseGraphReport, decorators: [{
46028
- type: i0.Directive
46029
- }] });
46030
-
46031
- var GraphReportComponent = /** @class */ (function (_super) {
46032
- __extends(GraphReportComponent, _super);
46033
- function GraphReportComponent() {
46034
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
46035
- _this.chartType$ = _this.config$.pipe(operators.map(function (config) {
46036
- var _a, _b;
46037
- if (config.chart.type !== 'bar') {
46038
- return config.chart.type;
46039
- }
46040
- return ((_b = (_a = config.chart) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.indexAxis) == 'y' ? CHARTS_TYPES.horizontalBar : CHARTS_TYPES.verticalBar;
46041
- }));
46042
- return _this;
46335
+ var CustomChartDialogComponent = /** @class */ (function () {
46336
+ function CustomChartDialogComponent(dialogRef, chart) {
46337
+ this.dialogRef = dialogRef;
46338
+ this.chart = chart;
46043
46339
  }
46044
- GraphReportComponent.prototype.changeChartType = function (type) {
46045
- var _d;
46046
- var _a, _b;
46047
- var _c = this._configSub.getValue(), chart = _c.chart, config = __rest(_c, ["chart"]);
46048
- var options = chart.options, chartConfig = __rest(chart, ["options"]);
46049
- if (config.mode !== REPORT_MODE.graph) {
46050
- return;
46051
- }
46052
- var barTypes = (_d = {},
46053
- _d[CHARTS_TYPES.horizontalBar] = 'bar',
46054
- _d[CHARTS_TYPES.verticalBar] = 'bar',
46055
- _d);
46056
- var chartType = (_a = barTypes[type]) !== null && _a !== void 0 ? _a : type;
46057
- this._configSub.next(Object.assign(Object.assign({}, config), { chart: Object.assign(Object.assign({}, chartConfig), { type: chartType, options: (_b = chart.overrides) === null || _b === void 0 ? void 0 : _b[type] }) }));
46340
+ CustomChartDialogComponent.prototype.close = function () {
46341
+ this.dialogRef.close();
46058
46342
  };
46059
- GraphReportComponent.prototype.printChart = function () {
46060
- if (this.graphChartComponent) {
46061
- this.graphChartComponent.printChart();
46343
+ CustomChartDialogComponent.prototype.printChart = function () {
46344
+ if (this.customChartComponent) {
46345
+ this.customChartComponent.print();
46062
46346
  }
46063
46347
  };
46064
- return GraphReportComponent;
46065
- }(BaseGraphReport));
46066
- GraphReportComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GraphReportComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
46067
- GraphReportComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: GraphReportComponent, selector: "app-graph-report", host: { classAttribute: "graph-report flex flex-col flex-grow" }, viewQueries: [{ propertyName: "graphChartComponent", first: true, predicate: ["graphChart"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<chart-panel *ngIf=\"config$ | async as config\" class=\"ndf-report chart-report\">\r\n\t<chart-panel-header class=\"ndf-report__header mb-3\">\r\n\t\t<span>\r\n\t\t\t{{ config.label | translate }}\r\n\t\t</span>\r\n\t\t<button\r\n\t\t\t*ngIf=\"config?.dialog?.active\"\r\n\t\t\tclass=\"dialog-button print:hidden\"\r\n\t\t\t(click)=\"openGraphDialog()\"\r\n\t\t\t[matTooltip]=\"'REPORTS.fullscreen' | translate\"\r\n\t\t>\r\n\t\t\t<mat-icon>fullscreen</mat-icon>\r\n\t\t</button>\r\n\t</chart-panel-header>\r\n\r\n\t<app-graph-chart\r\n\t\t#graphChart\r\n\t\tclass=\"ndf-report__content graph-chart\"\r\n\t\t[config]=\"config\"\r\n\t\t[data]=\"data\"\r\n\t></app-graph-chart>\r\n\r\n\t<chart-panel-footer class=\"ndf-report__footer flex-wrap\">\r\n\t\t<app-report-actions\r\n\t\t\t[config]=\"config\"\r\n\t\t\t(print)=\"printChart()\"\r\n\t\t\t(navigate)=\"navigate()\"\r\n\t\t\t(open)=\"onOpen.emit(null)\"\r\n\t\t></app-report-actions>\r\n\r\n\t\t<chart-type-selector\r\n [config]=\"config?.typeConfig\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t[type]=\"chartType$ | async\"\r\n\t\t\t(typeChange)=\"changeChartType($event)\"\r\n\t\t></chart-type-selector>\r\n\t</chart-panel-footer>\r\n</chart-panel>\r\n", styles: [".ndf-report{display:flex;flex-direction:column;min-width:0;max-width:100%;flex-grow:1}.ndf-report__content{position:relative;padding-block:.5rem;flex-grow:1;min-width:0;max-width:100%}.chart-actions{border:var(--chart-actions-border, 1px solid var(--border-color))}.chart-actions__item{background:var(--chart-actions-background, transparent);color:var(--chart-actions-color, currentColor);box-shadow:var(--chart-actions-shadow, unset);width:var(--chart-actions-width, 35px);height:var(--chart-actions-height, 35px);border-radius:var(--chart-actions-border-radius, 4px);flex-grow:1;display:grid;place-items:center}.chart-actions__item .mat-icon{color:var(--main-color, currentColor)}.chart-actions__item:hover{--chart-actions-shadow: var(--chart-actions-hover-shadow, 0 0 0 1px var(--main-color))}.chart-actions__item.selected{--chart-actions-background: var(--chart-actions-active-background, var(--main-color));--chart-actions-color: var(--chart-actions-active-color, var(--main-hover))}.chart-actions__item.selected .mat-icon{color:currentColor!important}@media print{.chart-actions{display:none}}:host{min-width:0;max-width:100%}\n"], components: [{ type: ChartPanel, selector: "chart-panel" }, { type: ChartPanelHeaderComponent, selector: "chart-panel-header" }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: GraphChartComponent, selector: "app-graph-chart" }, { type: ChartPanelFooterComponent, selector: "chart-panel-footer" }, { type: ReportActionsComponent, selector: "app-report-actions", inputs: ["config"], outputs: ["navigate", "open", "print"] }, { type: ChartTypeSelectorComponent, selector: "chart-type-selector", inputs: ["direction", "config", "type"], outputs: ["typeChange"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
46068
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GraphReportComponent, decorators: [{
46348
+ return CustomChartDialogComponent;
46349
+ }());
46350
+ CustomChartDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomChartDialogComponent, deps: [{ token: i1__namespace$3.MatDialogRef }, { token: i1$4.MAT_DIALOG_DATA }], target: i0__namespace.ɵɵFactoryTarget.Component });
46351
+ CustomChartDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomChartDialogComponent, selector: "app-custom-chart-dialog", viewQueries: [{ propertyName: "customChartComponent", first: true, predicate: ["customChart"], descendants: true }], ngImport: i0__namespace, template: "<ndf-nuxeo-dialog dialogTitle=\"{{ chart?.title | translate }}\">\r\n\t<ng-template #contentTemplate>\r\n\t\t<app-custom-chart\r\n\t\t\t#customChart\r\n\t\t\tclass=\"ndf-report__content graph-chart\"\r\n\t\t\t[config]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n\t\t\t[criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t></app-custom-chart>\r\n\t</ng-template>\r\n\t<ng-template #footerTemplate>\r\n\t\t<div class=\"flex gap-x-4\">\r\n\t\t\t<div class=\"chart-actions flex items-center rounded-lg gap-2 p-1\">\r\n\t\t\t\t<button\r\n\t\t\t\t\tclass=\"print-button chart-actions__item rounded\"\r\n\t\t\t\t\t(click)=\"printChart()\"\r\n\t\t\t\t\t[matTooltip]=\"'REPORTS.print' | translate\"\r\n\t\t\t\t\t*ngIf=\"chart.config?.print\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<mat-icon>print</mat-icon>\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</ng-template>\r\n</ndf-nuxeo-dialog>\r\n", styles: [""], components: [{ type: NdfNuxeoDialog, selector: "ndf-nuxeo-dialog", inputs: ["dialogTitle", "subTitle", "panelClass", "loaderMode"] }, { type: CustomChartComponent, selector: "app-custom-chart" }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
46352
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomChartDialogComponent, decorators: [{
46069
46353
  type: i0.Component,
46070
46354
  args: [{
46071
- selector: 'app-graph-report',
46072
- templateUrl: './graph-report.component.html',
46073
- styleUrls: ['./graph-report.component.scss'],
46074
- host: {
46075
- class: 'graph-report flex flex-col flex-grow'
46076
- }
46355
+ selector: 'app-custom-chart-dialog',
46356
+ templateUrl: './custom-chart-dialog.component.html',
46357
+ styleUrls: ['./custom-chart-dialog.component.scss']
46077
46358
  }]
46078
- }], propDecorators: { graphChartComponent: [{
46359
+ }], ctorParameters: function () {
46360
+ return [{ type: i1__namespace$3.MatDialogRef }, { type: undefined, decorators: [{
46361
+ type: i0.Inject,
46362
+ args: [i1$4.MAT_DIALOG_DATA]
46363
+ }] }];
46364
+ }, propDecorators: { customChartComponent: [{
46079
46365
  type: i0.ViewChild,
46080
- args: ['graphChart']
46366
+ args: ['customChart']
46081
46367
  }] } });
46082
46368
 
46083
46369
  var DynamicTimelineReportComponent = /** @class */ (function (_super) {
@@ -46113,11 +46399,7 @@
46113
46399
  this._timelineService.changeGroup(group);
46114
46400
  };
46115
46401
  DynamicTimelineReportComponent.prototype.openTimelineDialog = function () {
46116
- this.openGraphDialog({
46117
- config: this.config,
46118
- data: this.data,
46119
- component: TimelineDialogComponent
46120
- });
46402
+ this.openGraphDialog(TimelineDialogComponent);
46121
46403
  };
46122
46404
  DynamicTimelineReportComponent.prototype.openDetails = function () {
46123
46405
  this.onOpen.emit(this._timelineService.payload);
@@ -46143,110 +46425,30 @@
46143
46425
  args: ['graphChart']
46144
46426
  }] } });
46145
46427
 
46146
- var BaseCustomReport = /** @class */ (function (_super) {
46147
- __extends(BaseCustomReport, _super);
46148
- function BaseCustomReport(injector) {
46149
- var _this = _super.call(this) || this;
46150
- _this.injector = injector;
46151
- _this._chartHelperService = _this.injector.get(ChartManagerService);
46152
- _this.direction = 'rtl';
46153
- _this._criteriaSub = new rxjs.ReplaySubject(null);
46154
- _this.criteria$ = _this._criteriaSub.asObservable();
46155
- _this._configSub = new rxjs.BehaviorSubject(null);
46156
- _this.config$ = _this._configSub.asObservable();
46157
- return _this;
46158
- }
46159
- Object.defineProperty(BaseCustomReport.prototype, "criteria", {
46160
- set: function (value) {
46161
- this._criteria = ___default["default"].cloneDeep(value);
46162
- this._criteriaSub.next(this._criteria);
46163
- },
46164
- enumerable: false,
46165
- configurable: true
46166
- });
46167
- Object.defineProperty(BaseCustomReport.prototype, "config", {
46168
- get: function () {
46169
- return this._configSub.getValue();
46170
- },
46171
- set: function (obj) {
46172
- if (obj) {
46173
- this._configSub.next(obj);
46174
- }
46175
- },
46176
- enumerable: false,
46177
- configurable: true
46178
- });
46179
- BaseCustomReport.prototype.chartReady = function (chart) {
46180
- var _this = this;
46181
- this.chart = chart;
46182
- this._chartHelperService.setChart(chart);
46183
- this._printListener = function (event) {
46184
- _this.chart.resize();
46185
- };
46186
- window.addEventListener('beforeprint', this._printListener);
46187
- queueMicrotask(function () {
46188
- _this.chart.resize();
46189
- });
46190
- };
46191
- return BaseCustomReport;
46192
- }(DestroySubject));
46193
- BaseCustomReport.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseCustomReport, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Directive });
46194
- BaseCustomReport.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: BaseCustomReport, inputs: { direction: "direction", data: "data", criteria: "criteria", config: "config" }, usesInheritance: true, ngImport: i0__namespace });
46195
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: BaseCustomReport, decorators: [{
46196
- type: i0.Directive
46197
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; }, propDecorators: { direction: [{
46198
- type: i0.Input
46199
- }], data: [{
46200
- type: i0.Input
46201
- }], criteria: [{
46202
- type: i0.Input
46203
- }], config: [{
46204
- type: i0.Input
46205
- }] } });
46206
-
46207
46428
  var CustomReportComponent = /** @class */ (function (_super) {
46208
46429
  __extends(CustomReportComponent, _super);
46209
46430
  function CustomReportComponent() {
46210
46431
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
46211
- _this._registeredComponents = _this.injector.get(CustomReportsRegistry);
46432
+ _this._dialog = _this.injector.get(ReportsDialogService);
46212
46433
  return _this;
46213
46434
  }
46214
- CustomReportComponent.prototype.ngOnInit = function () {
46215
- var _a, _b;
46216
- var componentType = this._registeredComponents.getComponent((_a = this.config) === null || _a === void 0 ? void 0 : _a.type);
46217
- if (!componentType) {
46218
- console.warn("No component registered for type: " + ((_b = this.config) === null || _b === void 0 ? void 0 : _b.type));
46219
- return;
46435
+ CustomReportComponent.prototype.printChart = function () {
46436
+ if (this.customChartComponent) {
46437
+ this.customChartComponent.print();
46220
46438
  }
46221
- this._componentRef = this._registeredComponents.renderComponent(componentType.type, this.container);
46222
- this._prepareComponent();
46223
46439
  };
46224
- CustomReportComponent.prototype.ngOnChanges = function (changes) {
46225
- var _this = this;
46226
- if (!this._componentRef) {
46227
- return;
46228
- }
46229
- Object.keys(changes).forEach(function (key) {
46230
- _this._componentRef.instance[key] = changes[key].currentValue;
46440
+ CustomReportComponent.prototype.openDialog = function () {
46441
+ this._dialog.open(CustomChartDialogComponent, {
46442
+ config: this.config,
46443
+ data: this.data,
46444
+ criteria: this.criteria,
46445
+ direction: this.direction
46231
46446
  });
46232
- this._componentRef.changeDetectorRef.markForCheck();
46233
- };
46234
- CustomReportComponent.prototype.ngOnDestroy = function () {
46235
- if (this._componentRef) {
46236
- this._componentRef.destroy();
46237
- }
46238
- };
46239
- CustomReportComponent.prototype._prepareComponent = function () {
46240
- var instance = this._componentRef.instance;
46241
- instance.config = this.config;
46242
- instance.criteria = this.criteria;
46243
- instance.data = this.data;
46244
- instance.direction = this.direction;
46245
46447
  };
46246
46448
  return CustomReportComponent;
46247
46449
  }(BaseReport));
46248
46450
  CustomReportComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomReportComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
46249
- CustomReportComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomReportComponent, selector: "app-custom-report", host: { classAttribute: "custom-report flex flex-col flex-grow" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["dynamicContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<chart-panel *ngIf=\"config$ | async as config\" class=\"ndf-report chart-report\">\r\n\t<chart-panel-header class=\"ndf-report__header mb-3\">\r\n\t\t<span>\r\n\t\t\t{{ config.label | translate }}\r\n\t\t</span>\r\n\t\t<!--<button\r\n *ngIf=\"config?.dialog?.active\"\r\n class=\"dialog-button print:hidden\"\r\n (click)=\"openGraphDialog()\"\r\n [matTooltip]=\"'REPORTS.fullscreen' | translate\"\r\n >\r\n <mat-icon>fullscreen</mat-icon>\r\n </button>-->\r\n\t</chart-panel-header>\r\n\r\n\t<ng-container #dynamicContainer></ng-container>\r\n\r\n\t<chart-panel-footer class=\"ndf-report__footer flex-wrap\">\r\n\t\t<app-report-actions\r\n\t\t\t[config]=\"config\"\r\n\t\t\t(print)=\"printChart()\"\r\n\t\t\t(navigate)=\"navigate()\"\r\n\t\t\t(open)=\"onOpen.emit(null)\"\r\n\t\t></app-report-actions>\r\n\t</chart-panel-footer>\r\n</chart-panel>\r\n", styles: [""], components: [{ type: ChartPanel, selector: "chart-panel" }, { type: ChartPanelHeaderComponent, selector: "chart-panel-header" }, { type: ChartPanelFooterComponent, selector: "chart-panel-footer" }, { type: ReportActionsComponent, selector: "app-report-actions", inputs: ["config"], outputs: ["navigate", "open", "print"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
46451
+ CustomReportComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomReportComponent, selector: "app-custom-report", host: { classAttribute: "custom-report flex flex-col flex-grow" }, viewQueries: [{ propertyName: "customChartComponent", first: true, predicate: ["customChart"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<chart-panel *ngIf=\"config$ | async as config\" class=\"ndf-report chart-report\">\r\n\t<chart-panel-header class=\"ndf-report__header mb-3\">\r\n\t\t<span>\r\n\t\t\t{{ config?.label | translate }}\r\n\t\t</span>\r\n\t\t<button\r\n\t\t\t*ngIf=\"config?.dialog?.active\"\r\n\t\t\tclass=\"dialog-button print:hidden\"\r\n\t\t\t(click)=\"openDialog()\"\r\n\t\t\t[matTooltip]=\"'REPORTS.fullscreen' | translate\"\r\n\t\t>\r\n\t\t\t<mat-icon>fullscreen</mat-icon>\r\n\t\t</button>\r\n\t</chart-panel-header>\r\n\r\n\t<app-custom-chart\r\n\t\t#customChart\r\n\t\tclass=\"ndf-report__content graph-chart\"\r\n\t\t[config]=\"config\"\r\n\t\t[data]=\"data\"\r\n\t\t[criteria]=\"criteria\"\r\n\t\t[direction]=\"direction\"\r\n\t></app-custom-chart>\r\n\r\n\t<chart-panel-footer class=\"ndf-report__footer flex-wrap\">\r\n\t\t<app-report-actions\r\n\t\t\t[config]=\"config\"\r\n\t\t\t(print)=\"printChart()\"\r\n\t\t\t(navigate)=\"navigate()\"\r\n\t\t\t(open)=\"onOpen.emit(null)\"\r\n\t\t></app-report-actions>\r\n\t</chart-panel-footer>\r\n</chart-panel>\r\n", styles: [""], components: [{ type: ChartPanel, selector: "chart-panel" }, { type: ChartPanelHeaderComponent, selector: "chart-panel-header" }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: CustomChartComponent, selector: "app-custom-chart" }, { type: ChartPanelFooterComponent, selector: "chart-panel-footer" }, { type: ReportActionsComponent, selector: "app-report-actions", inputs: ["config"], outputs: ["navigate", "open", "print"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
46250
46452
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomReportComponent, decorators: [{
46251
46453
  type: i0.Component,
46252
46454
  args: [{
@@ -46257,9 +46459,9 @@
46257
46459
  class: 'custom-report flex flex-col flex-grow'
46258
46460
  }
46259
46461
  }]
46260
- }], propDecorators: { container: [{
46462
+ }], propDecorators: { customChartComponent: [{
46261
46463
  type: i0.ViewChild,
46262
- args: ['dynamicContainer', { read: i0.ViewContainerRef, static: true }]
46464
+ args: ['customChart']
46263
46465
  }] } });
46264
46466
 
46265
46467
  function mapToNdfTableConfig(report, details) {
@@ -46319,7 +46521,7 @@
46319
46521
  return NdfReportComponent;
46320
46522
  }(DestroySubject));
46321
46523
  NdfReportComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NdfReportComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
46322
- NdfReportComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfReportComponent, selector: "app-ndf-report", inputs: { config: "config", direction: "direction", data: "data", criteria: "criteria" }, outputs: { onNavigate: "onNavigate", onOpen: "onOpen" }, usesInheritance: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"config\">\r\n\t<ng-container [ngSwitch]=\"config.mode\">\r\n\t\t<app-graph-report\r\n\t\t\t*ngSwitchCase=\"reportModes.graph\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n [criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t(onNavigate)=\"onNavigate.emit($event)\"\r\n\t\t\t(onOpen)=\"onOpen.emit($event)\"\r\n\t\t></app-graph-report>\r\n\t\t<app-dynamic-timeline-report\r\n\t\t\t*ngSwitchCase=\"reportModes.dynamicLine\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n [criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n (onOpen)=\"onOpen.emit($event)\"\r\n\t\t></app-dynamic-timeline-report>\r\n\t\t<app-digit-report\r\n\t\t\t*ngSwitchCase=\"reportModes.digit\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n [criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n (onOpen)=\"onOpen.emit($event)\"\r\n\t\t></app-digit-report>\r\n\t</ng-container>\r\n</ng-container>\r\n", styles: [".ndf-report{display:flex;flex-direction:column;min-width:0;max-width:100%;flex-grow:1}.ndf-report__content{position:relative;padding-block:.5rem;flex-grow:1;min-width:0;max-width:100%}.chart-actions{border:var(--chart-actions-border, 1px solid var(--border-color))}.chart-actions__item{background:var(--chart-actions-background, transparent);color:var(--chart-actions-color, currentColor);box-shadow:var(--chart-actions-shadow, unset);width:var(--chart-actions-width, 35px);height:var(--chart-actions-height, 35px);border-radius:var(--chart-actions-border-radius, 4px);flex-grow:1;display:grid;place-items:center}.chart-actions__item .mat-icon{color:var(--main-color, currentColor)}.chart-actions__item:hover{--chart-actions-shadow: var(--chart-actions-hover-shadow, 0 0 0 1px var(--main-color))}.chart-actions__item.selected{--chart-actions-background: var(--chart-actions-active-background, var(--main-color));--chart-actions-color: var(--chart-actions-active-color, var(--main-hover))}.chart-actions__item.selected .mat-icon{color:currentColor!important}@media print{.chart-actions{display:none}}\n"], components: [{ type: GraphReportComponent, selector: "app-graph-report" }, { type: DynamicTimelineReportComponent, selector: "app-dynamic-timeline-report" }, { type: DigitReportComponent, selector: "app-digit-report" }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4__namespace$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
46524
+ NdfReportComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfReportComponent, selector: "app-ndf-report", inputs: { config: "config", direction: "direction", data: "data", criteria: "criteria" }, outputs: { onNavigate: "onNavigate", onOpen: "onOpen" }, usesInheritance: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"config\">\r\n\t<ng-container [ngSwitch]=\"config.mode\">\r\n\r\n\t\t<app-graph-report\r\n\t\t\t*ngSwitchCase=\"reportModes.graph\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n\t\t\t[criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t(onNavigate)=\"onNavigate.emit($event)\"\r\n\t\t\t(onOpen)=\"onOpen.emit($event)\"\r\n\t\t></app-graph-report>\r\n\r\n\t\t<app-dynamic-timeline-report\r\n\t\t\t*ngSwitchCase=\"reportModes.dynamicLine\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n\t\t\t[criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t(onOpen)=\"onOpen.emit($event)\"\r\n\t\t></app-dynamic-timeline-report>\r\n\r\n\t\t<app-digit-report\r\n\t\t\t*ngSwitchCase=\"reportModes.digit\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n\t\t\t[criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t(onOpen)=\"onOpen.emit($event)\"\r\n\t\t></app-digit-report>\r\n\r\n\t\t<app-custom-report\r\n\t\t\t*ngSwitchCase=\"reportModes.custom\"\r\n\t\t\t[definition]=\"config\"\r\n\t\t\t[data]=\"data\"\r\n\t\t\t[criteria]=\"criteria\"\r\n\t\t\t[direction]=\"direction\"\r\n\t\t\t(onOpen)=\"onOpen.emit($event)\"\r\n\t\t>\r\n\t\t</app-custom-report>\r\n\t</ng-container>\r\n</ng-container>\r\n", styles: [".ndf-report{display:flex;flex-direction:column;min-width:0;max-width:100%;flex-grow:1}.ndf-report__content{position:relative;padding-block:.5rem;flex-grow:1;min-width:0;max-width:100%}.chart-actions{border:var(--chart-actions-border, 1px solid var(--border-color))}.chart-actions__item{background:var(--chart-actions-background, transparent);color:var(--chart-actions-color, currentColor);box-shadow:var(--chart-actions-shadow, unset);width:var(--chart-actions-width, 35px);height:var(--chart-actions-height, 35px);border-radius:var(--chart-actions-border-radius, 4px);flex-grow:1;display:grid;place-items:center}.chart-actions__item .mat-icon{color:var(--main-color, currentColor)}.chart-actions__item:hover{--chart-actions-shadow: var(--chart-actions-hover-shadow, 0 0 0 1px var(--main-color))}.chart-actions__item.selected{--chart-actions-background: var(--chart-actions-active-background, var(--main-color));--chart-actions-color: var(--chart-actions-active-color, var(--main-hover))}.chart-actions__item.selected .mat-icon{color:currentColor!important}@media print{.chart-actions{display:none}}\n"], components: [{ type: GraphReportComponent, selector: "app-graph-report" }, { type: DynamicTimelineReportComponent, selector: "app-dynamic-timeline-report" }, { type: DigitReportComponent, selector: "app-digit-report" }, { type: CustomReportComponent, selector: "app-custom-report" }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4__namespace$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
46323
46525
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NdfReportComponent, decorators: [{
46324
46526
  type: i0.Component,
46325
46527
  args: [{
@@ -46626,7 +46828,7 @@
46626
46828
  return NdfReportsComponent;
46627
46829
  }(DestroySubject));
46628
46830
  NdfReportsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NdfReportsComponent, deps: [{ token: i1__namespace.TranslateService }, { token: FiltersMapperService }, { token: NdfReportsService }, { token: ChartManagerService }, { token: ReportTransformService }, { token: i0__namespace.ChangeDetectorRef }, { token: FilterQueryService }, { token: ReportsStateService }, { token: i1__namespace$5.Router }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
46629
- NdfReportsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfReportsComponent, selector: "app-ndf-reports", inputs: { jsonEditorEnabled: "jsonEditorEnabled", reportsKey: "reportsKey", navigateRoute: "navigateRoute", config: "config" }, outputs: { onQueryChange: "onQueryChange" }, host: { properties: { "dir": "direction" }, classAttribute: "ndf-reports" }, viewQueries: [{ propertyName: "fluidDirective", first: true, predicate: FluidHeightDirective, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<div\r\n\t*ngIf=\"reportsData$ | async as reports\"\r\n\tclass=\"ndf-reports__container\"\r\n\t[class.panel-opened]=\"isPanelOpened && filtersConfig\"\r\n\t[dir]=\"direction\"\r\n\tndfFluidHeight\r\n>\r\n\t<div class=\"ndf-reports__panel print:hidden\" *ngIf=\"!!filtersConfig?.fields?.length\">\r\n\t\t<app-filters-panel\r\n\t\t\t[fields]=\"filtersConfig?.fields\"\r\n\t\t\t[aggregations]=\"aggregations\"\r\n\t\t\t(filterChanged)=\"filterChanged($event)\"\r\n\t\t\t[activeQuery]=\"activeFiltersQuery$ | async\"\r\n\t\t\tclass=\"ndf-reports__filters\"\r\n\t\t></app-filters-panel>\r\n\t</div>\r\n\r\n\t<div class=\"ndf-reports__content\" (scrolled)=\"onContentScroll($event)\">\r\n\t\t<div class=\"ndf-reports__header flex pt-4 print:hidden\">\r\n\t\t\t<button mat-stroked-button class=\"toggle-button\" (click)=\"togglePanel()\">\r\n\t\t\t\t<mat-icon> filter_alt</mat-icon>\r\n\t\t\t</button>\r\n\t\t\t<app-editor-button\r\n\t\t\t\t*ngIf=\"jsonEditorEnabled && reportsKey\"\r\n\t\t\t\t[key]=\"reportsKey\"\r\n\t\t\t\t[type]=\"editorType\"\r\n\t\t\t></app-editor-button>\r\n\t\t\t<button mat-stroked-button *ngIf=\"config?.options?.print\" class=\"print-button\" (click)=\"printAll()\">\r\n\t\t\t\t<mat-icon> print</mat-icon>\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t\t<mat-spinner *ngIf=\"isLoadingResult\" class=\"mt-5 mx-auto\" [diameter]=\"48\"></mat-spinner>\r\n\r\n\t\t<div class=\"reports-grid\" *ngIf=\"!isLoadingResult\">\r\n\t\t\t<app-ndf-report\r\n\t\t\t\t*ngFor=\"let config of reportConfig.items; trackBy: trackByFn\"\r\n\t\t\t\t[config]=\"config\"\r\n\t\t\t\t[data]=\"reports?.response\"\r\n\t\t\t\t[criteria]=\"filtersParams$ | async\"\r\n\t\t\t\t[direction]=\"direction\"\r\n\t\t\t\t[attr.data-width]=\"config?.layout?.width || 4\"\r\n\t\t\t\t[attr.data-height]=\"config?.layout?.height || 'auto'\"\r\n\t\t\t\t[attr.data-start-column]=\"config?.layout?.columnPosition || 'auto'\"\r\n\t\t\t\t[attr.data-start-row]=\"config?.layout?.rowPosition || 'auto'\"\r\n\t\t\t\t[class.wide]=\"config?.layout?.width >= 6\"\r\n\t\t\t\tclass=\"reports-grid__item {{ config?.layout?.styleClass }} \"\r\n\t\t\t\t(onNavigate)=\"onNavigate($event)\"\r\n\t\t\t\t(onOpen)=\"openReportDetails($event, config)\"\r\n\t\t\t></app-ndf-report>\r\n\t\t</div>\r\n\t</div>\r\n\t<div\r\n\t\tclass=\"ndf-reports__details print:hidden\"\r\n\t\t[class.opened]=\"showDetails\"\r\n\t\t[@slideInOut]=\"showDetails ? 'open' : 'closed'\"\r\n\t\t(@slideInOut.done)=\"onDetailsAnimationEnd($event)\"\r\n\t>\r\n\t\t<app-ndf-table\r\n\t\t\t*ngIf=\"reportDetails$ | async as report\"\r\n\t\t\t[config]=\"report.config\"\r\n\t\t\t[activeQuery]=\"activeFiltersQuery$ | async\"\r\n\t\t\t[customCriteria]=\"filtersParams$ | async\"\r\n\t\t>\r\n\t\t\t<ng-template searchTableTemplate>\r\n\t\t\t\t<div class=\"ndf-reports__details__header flex gap-2\">\r\n\t\t\t\t\t<button mat-stroked-button class=\"toggle-button\" (click)=\"togglePanel()\">\r\n\t\t\t\t\t\t<mat-icon> filter_alt</mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t\t<button mat-stroked-button class=\"close-button\" (click)=\"closeDetailsPanel()\">\r\n\t\t\t\t\t\t<mat-icon> close</mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t\t<h3>\r\n\t\t\t\t\t{{ report.label | translate }}\r\n\t\t\t\t</h3>\r\n\t\t\t</ng-template>\r\n\t\t</app-ndf-table>\r\n\t</div>\r\n</div>\r\n", styles: [":host{padding-inline:var(--ndf-reports-inline-padding, 0);padding-block:var(--ndf-reports-block-padding, .5rem 0);height:100%;position:relative;display:flex;flex-direction:column;background-color:var(--ndf-reports-background, #fff);box-sizing:border-box;max-width:100%;flex:0 0 100%}:host:before,:host:after{box-sizing:border-box}:host[dir=ltr]{--ndf-reports-panel-translateX: -100%;--ndf-reports-details-translateX: 100%}.ndf-reports__header{background-color:var(--ndf-reports-background, #fff);flex-direction:var(--ndf-reports-header-direction, row);justify-content:var(--ndf-reports-header-justify, space-between);align-items:var(--ndf-reports-header-items, center);padding-inline:var(--ndf-reports-header-padding-inline, .5rem);padding-block:var(--ndf-reports-header-padding-block, 0 .5rem);position:var(--ndf-reports-header-position, sticky);top:0;z-index:1}.ndf-reports__header__actions{justify-content:var(--ndf-reports-actions-justify, flex-end)}.ndf-reports__header__custom-actions .toggle-button{min-width:0;padding:0 10px}.ndf-reports__container{--panel-width: var(--ndf-reports-panel-width, 18rem);position:relative;overflow:var(--ndf-reports-container-overflow, hidden);display:grid;transition:all .2s;max-width:100%;width:100%;height:var(--ndf-reports-height, calc(var(--ndf-fluid-height) - calc(var(--ndf-reports-block-padding, 1rem) * 2.5)));flex-grow:1;grid-gap:var(--ndf-table-container-gap, .5rem);gap:var(--ndf-table-container-gap, .5rem)}.ndf-reports__container.panel-opened{--ndf-details-margin: var(--panel-width);--ndf-reports-panel-translateX: 0;--ndf-reports-content-margin: var(--panel-width)}@media print{.ndf-reports__container{--ndf-reports-container-overflow: visible;height:100%}}.ndf-reports__panel,.ndf-reports__content .ndf-reports__details{overflow:auto;transition:all .2s}.ndf-reports__panel{position:absolute;width:var(--panel-width);height:100%;transform:translate(var(--ndf-reports-panel-translateX, 100%));padding-inline:var(--ndf-reports-panel-inline-padding, .5rem);padding-block:var(--ndf-reports-panel-block-padding, .5rem);background:var(--ndf-reports-panel-background, #fff);z-index:1}.ndf-reports__content{flex-grow:1;padding-inline-start:var(--ndf-reports-content-margin, 1rem);padding-inline-end:var(--ndf-reports-content-pie, 1rem);padding-block:var(--ndf-reports-content-pb, 0 1rem);overflow-y:var(--ndf-reports-content-overflow-y, auto);position:relative;display:flex;flex-direction:column}@media print{.ndf-reports__content{--ndf-reports-content-overflow-y: visible}}.ndf-reports__details{position:absolute;inset-inline-end:0;width:calc(100% - var(--ndf-details-margin, 0px));height:100%;transform:translate(var(--ndf-reports-details-translateX, -100%));padding-inline:var(--ndf-reports-details-inline-padding, 0rem);flex-grow:1;padding-block:var(--ndf-reports-details-block-padding, 0rem);background:var(--ndf-reports-details-background, #fff);z-index:1;transition:all .2s}.reports-grid{--grid-columns: 12;--column-width: calc(100% / var(--grid-columns));display:grid;grid-gap:var(--reports-grid-gap, 1.5rem);gap:var(--reports-grid-gap, 1.5rem);grid-template-columns:var(--rg-columns, repeat(var(--grid-columns), 1fr));margin-block:var(--reports-grid-margin-block, 1.25rem 0);padding-inline:var(--reports-grid-padding-inline, .5rem)}.reports-grid__item{background:#f5f5f5;display:grid;grid-gap:.3rem;gap:.3rem;min-width:0;text-align:center;vertical-align:middle}.reports-grid__item[data-width=\"1\"]{--col-span: span 1}.reports-grid__item[data-start-column=\"1\"]{--col-start: 1}.reports-grid__item[data-start-row=\"1\"]{--row-start: 1}.reports-grid__item[data-height=\"1\"]{--row-span: 1}.reports-grid__item[data-width=\"2\"]{--col-span: span 2}.reports-grid__item[data-start-column=\"2\"]{--col-start: 2}.reports-grid__item[data-start-row=\"2\"]{--row-start: 2}.reports-grid__item[data-height=\"2\"]{--row-span: 2}.reports-grid__item[data-width=\"3\"]{--col-span: span 3}.reports-grid__item[data-start-column=\"3\"]{--col-start: 3}.reports-grid__item[data-start-row=\"3\"]{--row-start: 3}.reports-grid__item[data-height=\"3\"]{--row-span: 3}.reports-grid__item[data-width=\"4\"]{--col-span: span 4}.reports-grid__item[data-start-column=\"4\"]{--col-start: 4}.reports-grid__item[data-start-row=\"4\"]{--row-start: 4}.reports-grid__item[data-height=\"4\"]{--row-span: 4}.reports-grid__item[data-width=\"5\"]{--col-span: span 5}.reports-grid__item[data-start-column=\"5\"]{--col-start: 5}.reports-grid__item[data-start-row=\"5\"]{--row-start: 5}.reports-grid__item[data-height=\"5\"]{--row-span: 5}.reports-grid__item[data-width=\"6\"]{--col-span: span 6}.reports-grid__item[data-start-column=\"6\"]{--col-start: 6}.reports-grid__item[data-start-row=\"6\"]{--row-start: 6}.reports-grid__item[data-height=\"6\"]{--row-span: 6}.reports-grid__item[data-width=\"7\"]{--col-span: span 7}.reports-grid__item[data-start-column=\"7\"]{--col-start: 7}.reports-grid__item[data-start-row=\"7\"]{--row-start: 7}.reports-grid__item[data-height=\"7\"]{--row-span: 7}.reports-grid__item[data-width=\"8\"]{--col-span: span 8}.reports-grid__item[data-start-column=\"8\"]{--col-start: 8}.reports-grid__item[data-start-row=\"8\"]{--row-start: 8}.reports-grid__item[data-height=\"8\"]{--row-span: 8}.reports-grid__item[data-width=\"9\"]{--col-span: span 9}.reports-grid__item[data-start-column=\"9\"]{--col-start: 9}.reports-grid__item[data-start-row=\"9\"]{--row-start: 9}.reports-grid__item[data-height=\"9\"]{--row-span: 9}.reports-grid__item[data-width=\"10\"]{--col-span: span 10}.reports-grid__item[data-start-column=\"10\"]{--col-start: 10}.reports-grid__item[data-start-row=\"10\"]{--row-start: 10}.reports-grid__item[data-height=\"10\"]{--row-span: 10}.reports-grid__item[data-width=\"11\"]{--col-span: span 11}.reports-grid__item[data-start-column=\"11\"]{--col-start: 11}.reports-grid__item[data-start-row=\"11\"]{--row-start: 11}.reports-grid__item[data-height=\"11\"]{--row-span: 11}.reports-grid__item[data-width=\"12\"]{--col-span: span 12}.reports-grid__item[data-start-column=\"12\"]{--col-start: 12}.reports-grid__item[data-start-row=\"12\"]{--row-start: 12}.reports-grid__item[data-height=\"12\"]{--row-span: 12}@media screen{.reports-grid__item{grid-column:var(--col-start, auto)/var(--col-span, span var(--grid-column, 2));grid-row:var(--row-start, auto)/span var(--row-span, 1);grid-template-rows:subgrid}}@media print{.reports-grid{--reports-grid-gap: 11mm;--reports-grid-margin-top: 9mm;--rg-columns: repeat(2, 1fr)}.reports-grid__item{--col-start: auto;--col-span: span 1;border:1px solid #f5f5f5;border-radius:var(--cp-radius, 1rem);page-break-inside:avoid;break-inside:avoid-page}}@media screen and (max-width: 1199px){.reports-grid__item[data-width=\"1\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"2\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"3\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"4\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"5\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"6\"]{--col-start: auto;--col-span: span 6}.reports-grid__item.wide{--col-start: 1;--col-span: -1}}@media screen and (max-width: 767px){.reports-grid__item[data-width]{--col-start: 1;--col-span: -1}}\n"], components: [{ type: FiltersPanelComponent, selector: "app-filters-panel", inputs: ["aggregations", "fields", "activeQuery"], outputs: ["filterChanged"] }, { type: i1__namespace$c.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorButtonComponent, selector: "app-editor-button", inputs: ["type", "key"] }, { type: i3__namespace$1.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: NdfReportComponent, selector: "app-ndf-report", inputs: ["config", "direction", "data", "criteria"], outputs: ["onNavigate", "onOpen"] }, { type: NdfTableComponent, selector: "app-ndf-table", inputs: ["rows", "totalRecords", "autoCalculateHeight", "emptyMessage", "activeQuery", "configPath", "configTransformer", "tableKey", "jsonEditorEnabled", "config", "customCriteria", "searchTerm"], outputs: ["onRowSelected", "onRowIndexSelected", "actionOnRow", "onGettingData", "onMultiRowSelected", "onLoading", "onPage", "onInitialized", "onLoaded", "onQueryChange", "onSort"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FluidHeightDirective, selector: "[ndfFluidHeight]", inputs: ["minHeight", "ndfFluidHeight", "subtractItems", "decrease", "delay", "cssVar", "calculate", "inlineStyle"], exportAs: ["ndfFluidHeight"] }, { type: i4__namespace.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { type: ScrollableDivDirective, selector: "[scrolled]", inputs: ["scrollTop"], outputs: ["scrolled"] }, { type: i4__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: SearchTableTemplateDirective, selector: "[searchTableTemplate]" }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe }, animations: [slideAnimation] });
46831
+ NdfReportsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfReportsComponent, selector: "app-ndf-reports", inputs: { jsonEditorEnabled: "jsonEditorEnabled", reportsKey: "reportsKey", navigateRoute: "navigateRoute", config: "config" }, outputs: { onQueryChange: "onQueryChange" }, host: { properties: { "dir": "direction" }, classAttribute: "ndf-reports" }, viewQueries: [{ propertyName: "fluidDirective", first: true, predicate: FluidHeightDirective, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<div\r\n\t*ngIf=\"reportsData$ | async as reports\"\r\n\tclass=\"ndf-reports__container\"\r\n\t[class.panel-opened]=\"isPanelOpened && filtersConfig\"\r\n\t[dir]=\"direction\"\r\n\tndfFluidHeight\r\n>\r\n\t<div class=\"ndf-reports__panel print:hidden\" *ngIf=\"!!filtersConfig?.fields?.length\">\r\n\t\t<app-filters-panel\r\n\t\t\t[fields]=\"filtersConfig?.fields\"\r\n\t\t\t[aggregations]=\"aggregations\"\r\n\t\t\t(filterChanged)=\"filterChanged($event)\"\r\n\t\t\t[activeQuery]=\"activeFiltersQuery$ | async\"\r\n\t\t\tclass=\"ndf-reports__filters\"\r\n\t\t></app-filters-panel>\r\n\t</div>\r\n\r\n\t<div class=\"ndf-reports__content\" (scrolled)=\"onContentScroll($event)\">\r\n\t\t<div class=\"ndf-reports__header flex pt-4 print:hidden\">\r\n\t\t\t<button mat-stroked-button class=\"toggle-button\" (click)=\"togglePanel()\">\r\n\t\t\t\t<mat-icon> filter_alt</mat-icon>\r\n\t\t\t</button>\r\n\t\t\t<app-editor-button\r\n\t\t\t\t*ngIf=\"jsonEditorEnabled && reportsKey\"\r\n\t\t\t\t[key]=\"reportsKey\"\r\n\t\t\t\t[type]=\"editorType\"\r\n\t\t\t></app-editor-button>\r\n\t\t\t<button mat-stroked-button *ngIf=\"config?.options?.print\" class=\"print-button\" (click)=\"printAll()\">\r\n\t\t\t\t<mat-icon> print</mat-icon>\r\n\t\t\t</button>\r\n\t\t</div>\r\n\t\t<mat-spinner *ngIf=\"isLoadingResult\" class=\"mt-5 mx-auto\" [diameter]=\"48\"></mat-spinner>\r\n\r\n\t\t<div class=\"reports-grid\" *ngIf=\"!isLoadingResult\">\r\n\t\t\t<app-ndf-report\r\n\t\t\t\t*ngFor=\"let config of reportConfig.items; trackBy: trackByFn\"\r\n\t\t\t\t[config]=\"config\"\r\n\t\t\t\t[data]=\"reports?.response\"\r\n\t\t\t\t[criteria]=\"filtersParams$ | async\"\r\n\t\t\t\t[direction]=\"direction\"\r\n\t\t\t\t[attr.data-width]=\"config?.layout?.width || 4\"\r\n\t\t\t\t[attr.data-height]=\"config?.layout?.height || 'auto'\"\r\n\t\t\t\t[attr.data-start-column]=\"config?.layout?.columnPosition || 'auto'\"\r\n\t\t\t\t[attr.data-start-row]=\"config?.layout?.rowPosition || 'auto'\"\r\n\t\t\t\t[class.wide]=\"config?.layout?.width >= 6\"\r\n\t\t\t\tclass=\"reports-grid__item {{ config?.layout?.styleClass }} \"\r\n\t\t\t\t(onNavigate)=\"onNavigate($event)\"\r\n\t\t\t\t(onOpen)=\"openReportDetails($event, config)\"\r\n\t\t\t></app-ndf-report>\r\n\t\t</div>\r\n\t</div>\r\n\t<div\r\n\t\tclass=\"ndf-reports__details print:hidden\"\r\n\t\t[class.opened]=\"showDetails\"\r\n\t\t[@slideInOut]=\"showDetails ? 'open' : 'closed'\"\r\n\t\t(@slideInOut.done)=\"onDetailsAnimationEnd($event)\"\r\n\t>\r\n\t\t<app-ndf-table\r\n\t\t\t*ngIf=\"reportDetails$ | async as report\"\r\n\t\t\t[config]=\"report.config\"\r\n\t\t\t[activeQuery]=\"activeFiltersQuery$ | async\"\r\n\t\t\t[customCriteria]=\"filtersParams$ | async\"\r\n\t\t>\r\n\t\t\t<ng-template searchTableTemplate>\r\n\t\t\t\t<div class=\"ndf-reports__details__header flex gap-2\">\r\n\t\t\t\t\t<button mat-stroked-button class=\"toggle-button\" (click)=\"togglePanel()\">\r\n\t\t\t\t\t\t<mat-icon> filter_alt</mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t\t<button mat-stroked-button class=\"close-button\" (click)=\"closeDetailsPanel()\">\r\n\t\t\t\t\t\t<mat-icon> close</mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t\t<h3>\r\n\t\t\t\t\t{{ report.label | translate }}\r\n\t\t\t\t</h3>\r\n\t\t\t</ng-template>\r\n\t\t</app-ndf-table>\r\n\t</div>\r\n</div>\r\n", styles: [":host{padding-inline:var(--ndf-reports-inline-padding, 0);padding-block:var(--ndf-reports-block-padding, .5rem 0);height:100%;position:relative;display:flex;flex-direction:column;background-color:var(--ndf-reports-background, #fff);box-sizing:border-box;max-width:100%;flex:0 0 100%}:host:before,:host:after{box-sizing:border-box}:host[dir=ltr]{--ndf-reports-panel-translateX: -100%;--ndf-reports-details-translateX: 100%}.ndf-reports__header{background-color:var(--ndf-reports-background, #fff);flex-direction:var(--ndf-reports-header-direction, row);justify-content:var(--ndf-reports-header-justify, space-between);align-items:var(--ndf-reports-header-items, center);padding-inline:var(--ndf-reports-header-padding-inline, .5rem);padding-block:var(--ndf-reports-header-padding-block, 0 .5rem);position:var(--ndf-reports-header-position, sticky);top:0;z-index:1}.ndf-reports__header__actions{justify-content:var(--ndf-reports-actions-justify, flex-end)}.ndf-reports__header__custom-actions .toggle-button{min-width:0;padding:0 10px}.ndf-reports__container{--panel-width: var(--ndf-reports-panel-width, 18rem);position:relative;overflow:var(--ndf-reports-container-overflow, hidden);display:grid;transition:all .2s;max-width:100%;width:100%;height:var(--ndf-reports-height, calc(var(--ndf-fluid-height) - calc(var(--ndf-reports-block-padding, 1rem) * 2.5)));flex-grow:1;grid-gap:var(--ndf-table-container-gap, .5rem);gap:var(--ndf-table-container-gap, .5rem)}.ndf-reports__container.panel-opened{--ndf-details-margin: var(--panel-width);--ndf-reports-panel-translateX: 0;--ndf-reports-content-margin: var(--panel-width)}@media print{.ndf-reports__container{--ndf-reports-container-overflow: visible;height:100%}}.ndf-reports__panel,.ndf-reports__content .ndf-reports__details{overflow:auto;transition:all .2s}.ndf-reports__panel{position:absolute;width:var(--panel-width);height:100%;transform:translate(var(--ndf-reports-panel-translateX, 100%));padding-inline:var(--ndf-reports-panel-inline-padding, .5rem);padding-block:var(--ndf-reports-panel-block-padding, .5rem);background:var(--ndf-reports-panel-background, #fff);z-index:1}.ndf-reports__content{flex-grow:1;padding-inline-start:var(--ndf-reports-content-margin, 1rem);padding-inline-end:var(--ndf-reports-content-pie, 1rem);padding-block:var(--ndf-reports-content-pb, 0 1rem);overflow-y:var(--ndf-reports-content-overflow-y, auto);position:relative;display:flex;flex-direction:column}@media print{.ndf-reports__content{--ndf-reports-content-overflow-y: visible}}.ndf-reports__details{position:absolute;inset-inline-end:0;width:calc(100% - var(--ndf-details-margin, 0px));height:100%;transform:translate(var(--ndf-reports-details-translateX, -100%));padding-inline:var(--ndf-reports-details-inline-padding, 0rem);flex-grow:1;padding-block:var(--ndf-reports-details-block-padding, 0rem);background:var(--ndf-reports-details-background, #fff);z-index:1;transition:all .2s}.reports-grid{--grid-columns: 12;--column-width: calc(100% / var(--grid-columns));display:grid;grid-gap:var(--reports-grid-gap, 1.5rem);gap:var(--reports-grid-gap, 1.5rem);grid-template-columns:var(--rg-columns, repeat(var(--grid-columns), 1fr));margin-block:var(--reports-grid-margin-block, 1.25rem 0);padding-inline:var(--reports-grid-padding-inline, .5rem)}.reports-grid__item{display:grid;grid-gap:.3rem;gap:.3rem;min-width:0;text-align:center;vertical-align:middle}.reports-grid__item[data-width=\"1\"]{--col-span: span 1}.reports-grid__item[data-start-column=\"1\"]{--col-start: 1}.reports-grid__item[data-start-row=\"1\"]{--row-start: 1}.reports-grid__item[data-height=\"1\"]{--row-span: 1}.reports-grid__item[data-width=\"2\"]{--col-span: span 2}.reports-grid__item[data-start-column=\"2\"]{--col-start: 2}.reports-grid__item[data-start-row=\"2\"]{--row-start: 2}.reports-grid__item[data-height=\"2\"]{--row-span: 2}.reports-grid__item[data-width=\"3\"]{--col-span: span 3}.reports-grid__item[data-start-column=\"3\"]{--col-start: 3}.reports-grid__item[data-start-row=\"3\"]{--row-start: 3}.reports-grid__item[data-height=\"3\"]{--row-span: 3}.reports-grid__item[data-width=\"4\"]{--col-span: span 4}.reports-grid__item[data-start-column=\"4\"]{--col-start: 4}.reports-grid__item[data-start-row=\"4\"]{--row-start: 4}.reports-grid__item[data-height=\"4\"]{--row-span: 4}.reports-grid__item[data-width=\"5\"]{--col-span: span 5}.reports-grid__item[data-start-column=\"5\"]{--col-start: 5}.reports-grid__item[data-start-row=\"5\"]{--row-start: 5}.reports-grid__item[data-height=\"5\"]{--row-span: 5}.reports-grid__item[data-width=\"6\"]{--col-span: span 6}.reports-grid__item[data-start-column=\"6\"]{--col-start: 6}.reports-grid__item[data-start-row=\"6\"]{--row-start: 6}.reports-grid__item[data-height=\"6\"]{--row-span: 6}.reports-grid__item[data-width=\"7\"]{--col-span: span 7}.reports-grid__item[data-start-column=\"7\"]{--col-start: 7}.reports-grid__item[data-start-row=\"7\"]{--row-start: 7}.reports-grid__item[data-height=\"7\"]{--row-span: 7}.reports-grid__item[data-width=\"8\"]{--col-span: span 8}.reports-grid__item[data-start-column=\"8\"]{--col-start: 8}.reports-grid__item[data-start-row=\"8\"]{--row-start: 8}.reports-grid__item[data-height=\"8\"]{--row-span: 8}.reports-grid__item[data-width=\"9\"]{--col-span: span 9}.reports-grid__item[data-start-column=\"9\"]{--col-start: 9}.reports-grid__item[data-start-row=\"9\"]{--row-start: 9}.reports-grid__item[data-height=\"9\"]{--row-span: 9}.reports-grid__item[data-width=\"10\"]{--col-span: span 10}.reports-grid__item[data-start-column=\"10\"]{--col-start: 10}.reports-grid__item[data-start-row=\"10\"]{--row-start: 10}.reports-grid__item[data-height=\"10\"]{--row-span: 10}.reports-grid__item[data-width=\"11\"]{--col-span: span 11}.reports-grid__item[data-start-column=\"11\"]{--col-start: 11}.reports-grid__item[data-start-row=\"11\"]{--row-start: 11}.reports-grid__item[data-height=\"11\"]{--row-span: 11}.reports-grid__item[data-width=\"12\"]{--col-span: span 12}.reports-grid__item[data-start-column=\"12\"]{--col-start: 12}.reports-grid__item[data-start-row=\"12\"]{--row-start: 12}.reports-grid__item[data-height=\"12\"]{--row-span: 12}@media screen{.reports-grid__item{grid-column:var(--col-start, auto)/var(--col-span, span var(--grid-column, 2));grid-row:var(--row-start, auto)/span var(--row-span, 1);grid-template-rows:subgrid}}@media print{.reports-grid{--reports-grid-gap: 11mm;--reports-grid-margin-top: 9mm;--rg-columns: repeat(2, 1fr)}.reports-grid__item{--col-start: auto;--col-span: span 1;border:1px solid #f5f5f5;border-radius:var(--cp-radius, 1rem);page-break-inside:avoid;break-inside:avoid-page}}@media screen and (max-width: 1199px){.reports-grid__item[data-width=\"1\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"2\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"3\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"4\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"5\"]{--col-start: auto;--col-span: span 6}.reports-grid__item[data-width=\"6\"]{--col-start: auto;--col-span: span 6}.reports-grid__item.wide{--col-start: 1;--col-span: -1}}@media screen and (max-width: 767px){.reports-grid__item[data-width]{--col-start: 1;--col-span: -1}}\n"], components: [{ type: FiltersPanelComponent, selector: "app-filters-panel", inputs: ["aggregations", "fields", "activeQuery"], outputs: ["filterChanged"] }, { type: i1__namespace$c.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2__namespace$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorButtonComponent, selector: "app-editor-button", inputs: ["type", "key"] }, { type: i3__namespace$1.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: NdfReportComponent, selector: "app-ndf-report", inputs: ["config", "direction", "data", "criteria"], outputs: ["onNavigate", "onOpen"] }, { type: NdfTableComponent, selector: "app-ndf-table", inputs: ["rows", "totalRecords", "autoCalculateHeight", "emptyMessage", "activeQuery", "configPath", "configTransformer", "tableKey", "jsonEditorEnabled", "config", "customCriteria", "searchTerm"], outputs: ["onRowSelected", "onRowIndexSelected", "actionOnRow", "onGettingData", "onMultiRowSelected", "onLoading", "onPage", "onInitialized", "onLoaded", "onQueryChange", "onSort"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FluidHeightDirective, selector: "[ndfFluidHeight]", inputs: ["minHeight", "ndfFluidHeight", "subtractItems", "decrease", "delay", "cssVar", "calculate", "inlineStyle"], exportAs: ["ndfFluidHeight"] }, { type: i4__namespace.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { type: ScrollableDivDirective, selector: "[scrolled]", inputs: ["scrollTop"], outputs: ["scrolled"] }, { type: i4__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: SearchTableTemplateDirective, selector: "[searchTableTemplate]" }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe }, animations: [slideAnimation] });
46630
46832
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NdfReportsComponent, decorators: [{
46631
46833
  type: i0.Component,
46632
46834
  args: [{
@@ -46678,7 +46880,7 @@
46678
46880
  DynamicTimelineReportComponent,
46679
46881
  TimeGroupSelectorComponent,
46680
46882
  GraphDialogComponent,
46681
- TimelineDialogComponent, ScrollableDivDirective, GraphChartComponent, DigitChartComponent, ReportActionsComponent, CustomReportComponent], imports: [i4.CommonModule,
46883
+ TimelineDialogComponent, ScrollableDivDirective, GraphChartComponent, DigitChartComponent, ReportActionsComponent, CustomReportComponent, CustomChartComponent, CustomChartDialogComponent], imports: [i4.CommonModule,
46682
46884
  i1.TranslateModule,
46683
46885
  i3$2.MatMenuModule,
46684
46886
  i2$2.MatIconModule,
@@ -46723,7 +46925,7 @@
46723
46925
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NdfReportsModule, decorators: [{
46724
46926
  type: i0.NgModule,
46725
46927
  args: [{
46726
- declarations: [CONTAINERS, COMPONENTS, DIRECTIVES, CHARTS, ReportActionsComponent, CustomReportComponent],
46928
+ declarations: [CONTAINERS, COMPONENTS, DIRECTIVES, CHARTS, ReportActionsComponent, CustomReportComponent, CustomChartComponent, CustomChartDialogComponent],
46727
46929
  imports: [
46728
46930
  i4.CommonModule,
46729
46931
  i1.TranslateModule,
@@ -48866,6 +49068,7 @@
48866
49068
  exports.BaseChartComponent = BaseChartComponent;
48867
49069
  exports.BaseColumnComponent = BaseColumnComponent;
48868
49070
  exports.BaseComponent = BaseComponent;
49071
+ exports.BaseCustomReport = BaseCustomReport;
48869
49072
  exports.BaseDatePicker = BaseDatePicker;
48870
49073
  exports.BaseDateValueAccessor = BaseDateValueAccessor;
48871
49074
  exports.BaseDialogComponent = BaseDialogComponent;