@acorex-platform/module-dashboard-management-client 0.0.37 → 0.0.46

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 (41) hide show
  1. package/fesm2022/{acorex-platform-module-dashboard-management-client-acorex-platform-module-dashboard-management-client-BUmHWNqL.mjs → acorex-platform-module-dashboard-management-client-acorex-platform-module-dashboard-management-client-Ey27MqFo.mjs} +976 -2957
  2. package/fesm2022/acorex-platform-module-dashboard-management-client-acorex-platform-module-dashboard-management-client-Ey27MqFo.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-dashboard-management-client-bar-chart-widget.component-5c4X-lEC.mjs +151 -0
  4. package/fesm2022/acorex-platform-module-dashboard-management-client-bar-chart-widget.component-5c4X-lEC.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-card-widget.component-BYdlIBv9.mjs +126 -0
  6. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-card-widget.component-BYdlIBv9.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-configurator-widget-column.component-DxNKy3bB.mjs +76 -0
  8. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-configurator-widget-column.component-DxNKy3bB.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-configurator-widget-edit.component-FhtkU52L.mjs +559 -0
  10. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-configurator-widget-edit.component-FhtkU52L.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-legend.util-C1zqTQEf.mjs +31 -0
  12. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-legend.util-C1zqTQEf.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-widget-data.util-DgCBHS1p.mjs +589 -0
  14. package/fesm2022/acorex-platform-module-dashboard-management-client-chart-widget-data.util-DgCBHS1p.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts-entities-dashboard.mjs +30 -1
  16. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts-entities-dashboard.mjs.map +1 -1
  17. package/fesm2022/{acorex-platform-module-dashboard-management-client-contracts-entity-catalog-acorex-platform-module-dashboard-management-client-contracts-entity-catalog-CPDwiLWC.mjs → acorex-platform-module-dashboard-management-client-contracts-entity-catalog-acorex-platform-module-dashboard-management-client-contracts-entity-catalog-C3ZKIYgQ.mjs} +2 -2
  18. package/fesm2022/{acorex-platform-module-dashboard-management-client-contracts-entity-catalog-acorex-platform-module-dashboard-management-client-contracts-entity-catalog-CPDwiLWC.mjs.map → acorex-platform-module-dashboard-management-client-contracts-entity-catalog-acorex-platform-module-dashboard-management-client-contracts-entity-catalog-C3ZKIYgQ.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-dashboard-management-client-contracts-entity-catalog-dashboard.entity-C1ju-BQM.mjs → acorex-platform-module-dashboard-management-client-contracts-entity-catalog-dashboard.entity-D2uqZMd4.mjs} +32 -3
  20. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts-entity-catalog-dashboard.entity-D2uqZMd4.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts-entity-catalog.mjs +1 -1
  22. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts.mjs +21 -1
  23. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts.mjs.map +1 -1
  24. package/fesm2022/acorex-platform-module-dashboard-management-client-donut-chart-widget.component-DRiIRbhX.mjs +145 -0
  25. package/fesm2022/acorex-platform-module-dashboard-management-client-donut-chart-widget.component-DRiIRbhX.mjs.map +1 -0
  26. package/fesm2022/acorex-platform-module-dashboard-management-client-funnel-chart-widget.component-BPY1NchM.mjs +135 -0
  27. package/fesm2022/acorex-platform-module-dashboard-management-client-funnel-chart-widget.component-BPY1NchM.mjs.map +1 -0
  28. package/fesm2022/acorex-platform-module-dashboard-management-client-gauge-chart-widget.component-Cy6fgife.mjs +138 -0
  29. package/fesm2022/acorex-platform-module-dashboard-management-client-gauge-chart-widget.component-Cy6fgife.mjs.map +1 -0
  30. package/fesm2022/acorex-platform-module-dashboard-management-client-heatmap-chart-widget.component-CTelqGbm.mjs +154 -0
  31. package/fesm2022/acorex-platform-module-dashboard-management-client-heatmap-chart-widget.component-CTelqGbm.mjs.map +1 -0
  32. package/fesm2022/{acorex-platform-module-dashboard-management-client-index-C1Te5cDf.mjs → acorex-platform-module-dashboard-management-client-index-P-PzUrbN.mjs} +3 -3
  33. package/fesm2022/{acorex-platform-module-dashboard-management-client-index-C1Te5cDf.mjs.map → acorex-platform-module-dashboard-management-client-index-P-PzUrbN.mjs.map} +1 -1
  34. package/fesm2022/acorex-platform-module-dashboard-management-client-line-chart-widget.component-B18VZb9t.mjs +158 -0
  35. package/fesm2022/acorex-platform-module-dashboard-management-client-line-chart-widget.component-B18VZb9t.mjs.map +1 -0
  36. package/fesm2022/acorex-platform-module-dashboard-management-client.mjs +1 -1
  37. package/package.json +1 -1
  38. package/types/acorex-platform-module-dashboard-management-client-contracts.d.ts +19 -5
  39. package/types/acorex-platform-module-dashboard-management-client.d.ts +49 -267
  40. package/fesm2022/acorex-platform-module-dashboard-management-client-acorex-platform-module-dashboard-management-client-BUmHWNqL.mjs.map +0 -1
  41. package/fesm2022/acorex-platform-module-dashboard-management-client-contracts-entity-catalog-dashboard.entity-C1ju-BQM.mjs.map +0 -1
@@ -0,0 +1,151 @@
1
+ import { AXBarChartComponent } from '@acorex/charts/bar-chart';
2
+ import { AXChartLegendComponent } from '@acorex/charts/chart-legend';
3
+ import { AXTranslationService } from '@acorex/core/translation';
4
+ import { AXPQueryExecutor } from '@acorex-platform/framework-client/runtime';
5
+ import * as i0 from '@angular/core';
6
+ import { inject, signal, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
7
+ import { e as AXPDashboardWidgetComponent, f as resolveChartQueryTabs, g as AXPChartQueryTabsComponent } from './acorex-platform-module-dashboard-management-client-acorex-platform-module-dashboard-management-client-Ey27MqFo.mjs';
8
+ import { r as resolveChartAxisLabels, l as loadBarChartItems } from './acorex-platform-module-dashboard-management-client-chart-widget-data.util-DgCBHS1p.mjs';
9
+ import { A as AXP_CHART_LEGEND_OPTIONS_SERIES, o as omitChartFixedSize } from './acorex-platform-module-dashboard-management-client-chart-legend.util-C1zqTQEf.mjs';
10
+
11
+ /**
12
+ * Bar Chart Widget Component
13
+ * Renders data as vertical bars with interactive hover effects and animations
14
+ */
15
+ class AXPBarChartWidgetViewComponent extends AXPDashboardWidgetComponent {
16
+ selectQueryTab(index) {
17
+ this.activeTabIndex.set(index);
18
+ }
19
+ //#endregion
20
+ async resolveChartOptionLabel(value) {
21
+ if (value != null && typeof value === 'object' && !Array.isArray(value)) {
22
+ return this.translationService.resolve(value);
23
+ }
24
+ const s = String(value ?? '');
25
+ if (s.startsWith('@')) {
26
+ return this.translationService.translateAsync(s);
27
+ }
28
+ return s;
29
+ }
30
+ /**
31
+ * Resolves bar category labels from plain text, @i18n keys, or multi-language maps.
32
+ */
33
+ async resolveLocalizedChartText(value) {
34
+ if (value == null) {
35
+ return '';
36
+ }
37
+ if (typeof value === 'string') {
38
+ if (value.startsWith('@')) {
39
+ return this.translationService.translateAsync(value);
40
+ }
41
+ return value;
42
+ }
43
+ if (typeof value === 'object' &&
44
+ !Array.isArray(value) &&
45
+ this.translationService.isValidMultiLanguageObject(value)) {
46
+ return this.translationService.resolve(value);
47
+ }
48
+ return String(value);
49
+ }
50
+ //#endregion
51
+ constructor() {
52
+ super();
53
+ //#region ----- Services & Dependencies -----
54
+ this.queryExecutor = inject(AXPQueryExecutor);
55
+ this.translationService = inject(AXTranslationService);
56
+ //#endregion
57
+ //#region ----- Chart state -----
58
+ this.data = signal([], /* @ts-ignore */
59
+ ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
60
+ /** Options for the chart with localized title and axis labels. */
61
+ this.barChartOptions = signal({}, /* @ts-ignore */
62
+ ...(ngDevMode ? [{ debugName: "barChartOptions" }] : /* istanbul ignore next */ []));
63
+ this.legendOptions = AXP_CHART_LEGEND_OPTIONS_SERIES;
64
+ this.labelResolveGeneration = 0;
65
+ //#endregion
66
+ //#region ----- Query tabs -----
67
+ this.queryTabs = computed(() => resolveChartQueryTabs(this.options(), this.entityContext()?.entityId), /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "queryTabs" }] : /* istanbul ignore next */ []));
69
+ this.activeTabIndex = signal(0, /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : /* istanbul ignore next */ []));
71
+ this.activeQuery = computed(() => {
72
+ const tabs = this.queryTabs();
73
+ if (tabs.length === 0) {
74
+ return undefined;
75
+ }
76
+ const index = Math.min(Math.max(this.activeTabIndex(), 0), tabs.length - 1);
77
+ return tabs[index];
78
+ }, /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "activeQuery" }] : /* istanbul ignore next */ []));
80
+ this.resolveChartLabelKeysEffect = effect(() => {
81
+ const raw = this.options();
82
+ const generation = ++this.labelResolveGeneration;
83
+ const axisLabels = resolveChartAxisLabels(raw);
84
+ void Promise.all([
85
+ this.resolveChartOptionLabel(raw['title']),
86
+ this.resolveChartOptionLabel(axisLabels.xAxisLabel),
87
+ this.resolveChartOptionLabel(axisLabels.yAxisLabel),
88
+ ]).then(([title, xAxisLabel, yAxisLabel]) => {
89
+ if (generation !== this.labelResolveGeneration) {
90
+ return;
91
+ }
92
+ const base = omitChartFixedSize(raw);
93
+ this.barChartOptions.set({
94
+ ...base,
95
+ title,
96
+ xAxisLabel,
97
+ yAxisLabel,
98
+ });
99
+ });
100
+ }, /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "resolveChartLabelKeysEffect" }] : /* istanbul ignore next */ []));
102
+ this.clampTabIndexEffect = effect(() => {
103
+ const tabs = this.queryTabs();
104
+ if (this.activeTabIndex() >= tabs.length) {
105
+ this.activeTabIndex.set(0);
106
+ }
107
+ }, /* @ts-ignore */
108
+ ...(ngDevMode ? [{ debugName: "clampTabIndexEffect" }] : /* istanbul ignore next */ []));
109
+ //#region ----- Query loading -----
110
+ this.dataLoadEffect = effect(async () => {
111
+ const opts = this.options();
112
+ const active = this.activeQuery();
113
+ const items = await loadBarChartItems(opts, {
114
+ queryExecutor: this.queryExecutor,
115
+ queryKey: active?.query,
116
+ queryInput: active?.queryInput,
117
+ });
118
+ const resolved = await Promise.all(items.map(async (item) => ({
119
+ ...item,
120
+ label: await this.resolveLocalizedChartText(item.label),
121
+ })));
122
+ this.data.set(resolved);
123
+ }, /* @ts-ignore */
124
+ ...(ngDevMode ? [{ debugName: "dataLoadEffect" }] : /* istanbul ignore next */ []));
125
+ this.setOptions({
126
+ showXAxis: true,
127
+ showYAxis: true,
128
+ barWidth: 80,
129
+ cornerRadius: 4,
130
+ showGrid: true,
131
+ showDataLabels: false,
132
+ showTooltip: true,
133
+ animationEasing: 'cubic-out',
134
+ animationDuration: 800,
135
+ ...omitChartFixedSize(this.options()),
136
+ });
137
+ this.barChartOptions.set(omitChartFixedSize(this.options()));
138
+ }
139
+ handleBarClick(_event) {
140
+ // reserved for future drill-down
141
+ }
142
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPBarChartWidgetViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
143
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPBarChartWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"axp-chart-widget-host\">\n <axp-chart-query-tabs\n [tabs]=\"queryTabs()\"\n [activeIndex]=\"activeTabIndex()\"\n (activeIndexChange)=\"selectQueryTab($event)\"\n />\n <div class=\"axp-chart-widget-host__body axp-chart-widget-host__body--with-legend\">\n <div class=\"axp-chart-widget-host__chart\">\n <ax-bar-chart\n #chart\n [data]=\"data()\"\n [options]=\"barChartOptions()\"\n (barClick)=\"handleBarClick($event)\"\n ></ax-bar-chart>\n </div>\n <!-- ----- Series indicator (legend) ----- -->\n @if (data().length > 0) {\n <div class=\"axp-chart-widget-host__legend\">\n <ax-chart-legend [chart]=\"chart\" [options]=\"legendOptions\"></ax-chart-legend>\n </div>\n }\n </div>\n</div>\n", styles: ["@layer properties;:host{display:block;width:100%;height:100%;min-height:0px;overflow:hidden}:host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;overflow:visible;min-block-size:0}.axp-chart-widget-host{display:flex;height:100%;min-height:0px;width:100%;flex-direction:column;gap:var(--spacing, .25rem)}.axp-chart-widget-host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body{display:flex;min-height:0px;flex:1;flex-direction:column;gap:var(--spacing, .25rem);padding-bottom:calc(var(--spacing, .25rem) * 2)}.axp-chart-widget-host__body:not(.axp-chart-widget-host__body--with-legend)>.axp-chart-widget-host__chart--radial{flex:1 1 auto}.axp-chart-widget-host__body--with-legend{min-height:0px;flex:1;gap:var(--spacing, .25rem);display:grid;grid-template-rows:minmax(0,1fr) auto}.axp-chart-widget-host__chart{position:relative;min-height:calc(var(--spacing, .25rem) * 64);width:100%;overflow:hidden;grid-row:1}.axp-chart-widget-host__chart--radial{position:relative;margin-inline:auto;align-self:center;justify-self:center;overflow:hidden;grid-row:1;flex:0 0 auto;height:auto;width:min(100%,18rem);max-width:100%;min-height:12rem;min-width:8rem;aspect-ratio:1 / 1}.axp-chart-widget-host__chart--funnel{position:relative;width:100%;overflow:hidden;block-size:20rem;flex:0 0 auto;max-block-size:24rem;min-block-size:16rem}.axp-chart-widget-host__chart--funnel ax-funnel-chart,.axp-chart-widget-host__chart--funnel .ax-funnel-chart-container{display:block;block-size:100%;inline-size:100%;min-block-size:0}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--funnel){flex:none}.axp-chart-widget-host__chart--heatmap{position:relative;width:100%;max-width:100%;inline-size:100%;block-size:auto;flex:0 0 auto;overflow:visible;min-height:0!important;min-block-size:0!important;max-block-size:none}.axp-chart-widget-host__chart--heatmap ax-heatmap-chart,.axp-chart-widget-host__chart--heatmap .ax-heatmap-chart-container{display:block;inline-size:100%;max-inline-size:100%;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--heatmap){flex:none;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__legend{width:100%;flex:none;grid-row:2;min-height:0;min-width:0;max-width:100%;display:flex;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:rgb(var(--ax-sys-color-border-lighter-surface)) transparent}:host ::ng-deep ax-chart-legend{display:block!important;height:auto!important;max-height:none;width:max-content;min-width:100%;max-width:none}:host ::ng-deep .ax-chart-legend{--ax-legend-bg: var(--ax-sys-color-lighter-surface);--ax-legend-text: var(--ax-sys-color-on-lighter-surface);--ax-legend-border: var(--ax-sys-color-border-lighter-surface);--ax-legend-radius: .625rem;--ax-legend-padding: .375rem .5rem;--ax-legend-gap: .375rem;--ax-legend-item-height: auto;height:auto;max-height:none;width:100%;overflow:visible;padding:var(--ax-legend-padding);gap:var(--ax-legend-gap);color:rgb(var(--ax-legend-text))}:host ::ng-deep .ax-chart-legend.ax-legend-horizontal{flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;width:max-content;min-width:100%;max-width:none;overflow:visible;border:none;background:transparent;background-color:transparent;padding:.125rem .75rem .7rem;gap:.5rem}:host ::ng-deep .ax-legend-item{align-items:center;flex-shrink:0;gap:.375rem;height:auto;min-height:1.5rem;padding-block:.2rem;padding-inline:.5rem;border-radius:9999px;border:1px solid rgb(var(--ax-sys-color-border-lightest-surface));background-color:rgb(var(--ax-sys-color-lightest-surface));white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease,transform .15s ease}:host ::ng-deep .ax-legend-item:hover{border-color:rgb(var(--ax-sys-color-primary-500));background-color:rgb(var(--ax-sys-color-primary-500));box-shadow:0 1px 2px #0f172a0f}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{border-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 35%,rgb(var(--ax-sys-color-border-lightest-surface)))}}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{background-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 6%,rgb(var(--ax-sys-color-lightest-surface)))}}:host ::ng-deep .ax-legend-item:active{transform:scale(.98)}:host ::ng-deep .ax-legend-item.ax-legend-item-hidden{opacity:.62}:host ::ng-deep .ax-legend-color{width:.625rem;height:.625rem;flex-shrink:0;border-radius:9999px;box-shadow:0 0 0 1px rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-color{box-shadow:0 0 0 1px color-mix(in srgb,rgb(var(--ax-legend-text)) 18%,transparent)}}:host ::ng-deep .ax-legend-name{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);max-width:9rem;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .ax-legend-value{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);margin-inline-start:0;opacity:1;color:rgb(var(--ax-sys-color-on-lightest-surface))}:host ::ng-deep .ax-legend-percentage{margin-inline-start:0;border-radius:9999px;padding-inline:.4rem;padding-block:.125rem;font-size:.6875rem;line-height:1;font-weight:600;font-variant-numeric:tabular-nums;background-color:rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-percentage{background-color:color-mix(in srgb,rgb(var(--ax-legend-text)) 12%,transparent)}}:host ::ng-deep ax-donut-chart,:host ::ng-deep ax-gauge-chart,:host ::ng-deep ax-bar-chart,:host ::ng-deep ax-line-chart,:host ::ng-deep ax-funnel-chart{display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart{display:block!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}:host ::ng-deep ax-donut-chart .ax-donut-chart,:host ::ng-deep ax-gauge-chart .ax-gauge-chart,:host ::ng-deep ax-bar-chart .ax-bar-chart,:host ::ng-deep ax-line-chart .ax-line-chart,:host ::ng-deep ax-funnel-chart .ax-funnel-chart-container{min-height:0!important;height:100%!important;width:100%!important;padding:.25rem!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart .ax-heatmap-chart-container,:host ::ng-deep .axp-chart-widget-host__chart--heatmap .ax-heatmap-chart{min-height:0!important;height:auto!important;width:100%!important;max-width:100%!important;padding:.25rem!important;overflow:visible!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap svg{display:block;width:100%!important;max-width:100%!important;height:auto!important;overflow:visible!important}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXBarChartComponent, selector: "ax-bar-chart", inputs: ["data", "options"], outputs: ["barClick"] }, { kind: "component", type: AXChartLegendComponent, selector: "ax-chart-legend", inputs: ["chart", "options"], outputs: ["itemClick", "itemMouseEnter", "itemMouseLeave"] }, { kind: "component", type: AXPChartQueryTabsComponent, selector: "axp-chart-query-tabs", inputs: ["tabs", "activeIndex"], outputs: ["activeIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
144
+ }
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPBarChartWidgetViewComponent, decorators: [{
146
+ type: Component,
147
+ args: [{ imports: [AXBarChartComponent, AXChartLegendComponent, AXPChartQueryTabsComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"axp-chart-widget-host\">\n <axp-chart-query-tabs\n [tabs]=\"queryTabs()\"\n [activeIndex]=\"activeTabIndex()\"\n (activeIndexChange)=\"selectQueryTab($event)\"\n />\n <div class=\"axp-chart-widget-host__body axp-chart-widget-host__body--with-legend\">\n <div class=\"axp-chart-widget-host__chart\">\n <ax-bar-chart\n #chart\n [data]=\"data()\"\n [options]=\"barChartOptions()\"\n (barClick)=\"handleBarClick($event)\"\n ></ax-bar-chart>\n </div>\n <!-- ----- Series indicator (legend) ----- -->\n @if (data().length > 0) {\n <div class=\"axp-chart-widget-host__legend\">\n <ax-chart-legend [chart]=\"chart\" [options]=\"legendOptions\"></ax-chart-legend>\n </div>\n }\n </div>\n</div>\n", styles: ["@layer properties;:host{display:block;width:100%;height:100%;min-height:0px;overflow:hidden}:host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;overflow:visible;min-block-size:0}.axp-chart-widget-host{display:flex;height:100%;min-height:0px;width:100%;flex-direction:column;gap:var(--spacing, .25rem)}.axp-chart-widget-host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body{display:flex;min-height:0px;flex:1;flex-direction:column;gap:var(--spacing, .25rem);padding-bottom:calc(var(--spacing, .25rem) * 2)}.axp-chart-widget-host__body:not(.axp-chart-widget-host__body--with-legend)>.axp-chart-widget-host__chart--radial{flex:1 1 auto}.axp-chart-widget-host__body--with-legend{min-height:0px;flex:1;gap:var(--spacing, .25rem);display:grid;grid-template-rows:minmax(0,1fr) auto}.axp-chart-widget-host__chart{position:relative;min-height:calc(var(--spacing, .25rem) * 64);width:100%;overflow:hidden;grid-row:1}.axp-chart-widget-host__chart--radial{position:relative;margin-inline:auto;align-self:center;justify-self:center;overflow:hidden;grid-row:1;flex:0 0 auto;height:auto;width:min(100%,18rem);max-width:100%;min-height:12rem;min-width:8rem;aspect-ratio:1 / 1}.axp-chart-widget-host__chart--funnel{position:relative;width:100%;overflow:hidden;block-size:20rem;flex:0 0 auto;max-block-size:24rem;min-block-size:16rem}.axp-chart-widget-host__chart--funnel ax-funnel-chart,.axp-chart-widget-host__chart--funnel .ax-funnel-chart-container{display:block;block-size:100%;inline-size:100%;min-block-size:0}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--funnel){flex:none}.axp-chart-widget-host__chart--heatmap{position:relative;width:100%;max-width:100%;inline-size:100%;block-size:auto;flex:0 0 auto;overflow:visible;min-height:0!important;min-block-size:0!important;max-block-size:none}.axp-chart-widget-host__chart--heatmap ax-heatmap-chart,.axp-chart-widget-host__chart--heatmap .ax-heatmap-chart-container{display:block;inline-size:100%;max-inline-size:100%;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--heatmap){flex:none;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__legend{width:100%;flex:none;grid-row:2;min-height:0;min-width:0;max-width:100%;display:flex;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:rgb(var(--ax-sys-color-border-lighter-surface)) transparent}:host ::ng-deep ax-chart-legend{display:block!important;height:auto!important;max-height:none;width:max-content;min-width:100%;max-width:none}:host ::ng-deep .ax-chart-legend{--ax-legend-bg: var(--ax-sys-color-lighter-surface);--ax-legend-text: var(--ax-sys-color-on-lighter-surface);--ax-legend-border: var(--ax-sys-color-border-lighter-surface);--ax-legend-radius: .625rem;--ax-legend-padding: .375rem .5rem;--ax-legend-gap: .375rem;--ax-legend-item-height: auto;height:auto;max-height:none;width:100%;overflow:visible;padding:var(--ax-legend-padding);gap:var(--ax-legend-gap);color:rgb(var(--ax-legend-text))}:host ::ng-deep .ax-chart-legend.ax-legend-horizontal{flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;width:max-content;min-width:100%;max-width:none;overflow:visible;border:none;background:transparent;background-color:transparent;padding:.125rem .75rem .7rem;gap:.5rem}:host ::ng-deep .ax-legend-item{align-items:center;flex-shrink:0;gap:.375rem;height:auto;min-height:1.5rem;padding-block:.2rem;padding-inline:.5rem;border-radius:9999px;border:1px solid rgb(var(--ax-sys-color-border-lightest-surface));background-color:rgb(var(--ax-sys-color-lightest-surface));white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease,transform .15s ease}:host ::ng-deep .ax-legend-item:hover{border-color:rgb(var(--ax-sys-color-primary-500));background-color:rgb(var(--ax-sys-color-primary-500));box-shadow:0 1px 2px #0f172a0f}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{border-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 35%,rgb(var(--ax-sys-color-border-lightest-surface)))}}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{background-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 6%,rgb(var(--ax-sys-color-lightest-surface)))}}:host ::ng-deep .ax-legend-item:active{transform:scale(.98)}:host ::ng-deep .ax-legend-item.ax-legend-item-hidden{opacity:.62}:host ::ng-deep .ax-legend-color{width:.625rem;height:.625rem;flex-shrink:0;border-radius:9999px;box-shadow:0 0 0 1px rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-color{box-shadow:0 0 0 1px color-mix(in srgb,rgb(var(--ax-legend-text)) 18%,transparent)}}:host ::ng-deep .ax-legend-name{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);max-width:9rem;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .ax-legend-value{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);margin-inline-start:0;opacity:1;color:rgb(var(--ax-sys-color-on-lightest-surface))}:host ::ng-deep .ax-legend-percentage{margin-inline-start:0;border-radius:9999px;padding-inline:.4rem;padding-block:.125rem;font-size:.6875rem;line-height:1;font-weight:600;font-variant-numeric:tabular-nums;background-color:rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-percentage{background-color:color-mix(in srgb,rgb(var(--ax-legend-text)) 12%,transparent)}}:host ::ng-deep ax-donut-chart,:host ::ng-deep ax-gauge-chart,:host ::ng-deep ax-bar-chart,:host ::ng-deep ax-line-chart,:host ::ng-deep ax-funnel-chart{display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart{display:block!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}:host ::ng-deep ax-donut-chart .ax-donut-chart,:host ::ng-deep ax-gauge-chart .ax-gauge-chart,:host ::ng-deep ax-bar-chart .ax-bar-chart,:host ::ng-deep ax-line-chart .ax-line-chart,:host ::ng-deep ax-funnel-chart .ax-funnel-chart-container{min-height:0!important;height:100%!important;width:100%!important;padding:.25rem!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart .ax-heatmap-chart-container,:host ::ng-deep .axp-chart-widget-host__chart--heatmap .ax-heatmap-chart{min-height:0!important;height:auto!important;width:100%!important;max-width:100%!important;padding:.25rem!important;overflow:visible!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap svg{display:block;width:100%!important;max-width:100%!important;height:auto!important;overflow:visible!important}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
148
+ }], ctorParameters: () => [] });
149
+
150
+ export { AXPBarChartWidgetViewComponent };
151
+ //# sourceMappingURL=acorex-platform-module-dashboard-management-client-bar-chart-widget.component-5c4X-lEC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-dashboard-management-client-bar-chart-widget.component-5c4X-lEC.mjs","sources":["../../../../libs/modules/dashboard-management/client/src/lib/features/shared/widgets/chart/bar-chart/bar-chart-widget.component.ts","../../../../libs/modules/dashboard-management/client/src/lib/features/shared/widgets/chart/bar-chart/bar-chart-widget.component.html"],"sourcesContent":["import { AXBarChartComponent, AXBarChartData, AXBarChartOption } from '@acorex/charts/bar-chart';\nimport { AXChartLegendComponent } from '@acorex/charts/chart-legend';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPQueryExecutor } from '@acorex-platform/framework-client/runtime';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\nimport { AXPDashboardWidgetComponent } from '../../dashboard-widget-base';\nimport { resolveChartQueryTabs } from '../chart-query-load.util';\nimport { loadBarChartItems, resolveChartAxisLabels } from '../chart-widget-data.util';\nimport { AXPChartQueryTabsComponent } from '../chart-query-tabs.component';\nimport { AXP_CHART_LEGEND_OPTIONS_SERIES, omitChartFixedSize } from '../chart-legend.util';\n\n/**\n * Bar Chart Widget Component\n * Renders data as vertical bars with interactive hover effects and animations\n */\n@Component({\n templateUrl: './bar-chart-widget.component.html',\n styleUrls: ['./bar-chart-widget.component.css'],\n imports: [AXBarChartComponent, AXChartLegendComponent, AXPChartQueryTabsComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXPBarChartWidgetViewComponent extends AXPDashboardWidgetComponent {\n //#region ----- Services & Dependencies -----\n\n private readonly queryExecutor = inject(AXPQueryExecutor);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Chart state -----\n\n protected data = signal<AXBarChartData[]>([]);\n\n /** Options for the chart with localized title and axis labels. */\n protected barChartOptions = signal<AXBarChartOption & { title: string }>({} as AXBarChartOption & { title: string });\n\n protected readonly legendOptions = AXP_CHART_LEGEND_OPTIONS_SERIES;\n\n private labelResolveGeneration = 0;\n\n //#endregion\n\n //#region ----- Query tabs -----\n\n protected readonly queryTabs = computed(() =>\n resolveChartQueryTabs(this.options() as Record<string, unknown>, this.entityContext()?.entityId),\n );\n\n protected readonly activeTabIndex = signal(0);\n\n private readonly activeQuery = computed(() => {\n const tabs = this.queryTabs();\n if (tabs.length === 0) {\n return undefined;\n }\n const index = Math.min(Math.max(this.activeTabIndex(), 0), tabs.length - 1);\n return tabs[index];\n });\n\n protected selectQueryTab(index: number): void {\n this.activeTabIndex.set(index);\n }\n\n //#endregion\n\n private async resolveChartOptionLabel(value: unknown): Promise<string> {\n if (value != null && typeof value === 'object' && !Array.isArray(value)) {\n return this.translationService.resolve(value as AXPMultiLanguageString);\n }\n const s = String(value ?? '');\n if (s.startsWith('@')) {\n return this.translationService.translateAsync(s);\n }\n return s;\n }\n\n /**\n * Resolves bar category labels from plain text, @i18n keys, or multi-language maps.\n */\n private async resolveLocalizedChartText(value: unknown): Promise<string> {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n if (value.startsWith('@')) {\n return this.translationService.translateAsync(value);\n }\n return value;\n }\n if (\n typeof value === 'object' &&\n !Array.isArray(value) &&\n this.translationService.isValidMultiLanguageObject(value)\n ) {\n return this.translationService.resolve(value as AXPMultiLanguageString);\n }\n return String(value);\n }\n\n private readonly resolveChartLabelKeysEffect = effect(() => {\n const raw = this.options() as Record<string, unknown>;\n const generation = ++this.labelResolveGeneration;\n const axisLabels = resolveChartAxisLabels(raw);\n void Promise.all([\n this.resolveChartOptionLabel(raw['title']),\n this.resolveChartOptionLabel(axisLabels.xAxisLabel),\n this.resolveChartOptionLabel(axisLabels.yAxisLabel),\n ]).then(([title, xAxisLabel, yAxisLabel]) => {\n if (generation !== this.labelResolveGeneration) {\n return;\n }\n const base = omitChartFixedSize(raw) as unknown as AXBarChartOption & { title: string };\n this.barChartOptions.set({\n ...base,\n title,\n xAxisLabel,\n yAxisLabel,\n });\n });\n });\n\n private readonly clampTabIndexEffect = effect(() => {\n const tabs = this.queryTabs();\n if (this.activeTabIndex() >= tabs.length) {\n this.activeTabIndex.set(0);\n }\n });\n\n //#region ----- Query loading -----\n\n private readonly dataLoadEffect = effect(async () => {\n const opts = this.options() as Record<string, unknown>;\n const active = this.activeQuery();\n const items = await loadBarChartItems(opts, {\n queryExecutor: this.queryExecutor,\n queryKey: active?.query,\n queryInput: active?.queryInput,\n });\n const resolved = await Promise.all(\n items.map(async (item) => ({\n ...item,\n label: await this.resolveLocalizedChartText(item.label),\n })),\n );\n this.data.set(resolved as AXBarChartData[]);\n });\n\n //#endregion\n\n constructor() {\n super();\n this.setOptions({\n showXAxis: true,\n showYAxis: true,\n barWidth: 80,\n cornerRadius: 4,\n showGrid: true,\n showDataLabels: false,\n showTooltip: true,\n animationEasing: 'cubic-out',\n animationDuration: 800,\n ...omitChartFixedSize(this.options() as Record<string, unknown>),\n });\n this.barChartOptions.set(\n omitChartFixedSize(this.options() as Record<string, unknown>) as unknown as AXBarChartOption & {\n title: string;\n },\n );\n }\n\n handleBarClick(_event: unknown) {\n // reserved for future drill-down\n }\n}\n","<div class=\"axp-chart-widget-host\">\n <axp-chart-query-tabs\n [tabs]=\"queryTabs()\"\n [activeIndex]=\"activeTabIndex()\"\n (activeIndexChange)=\"selectQueryTab($event)\"\n />\n <div class=\"axp-chart-widget-host__body axp-chart-widget-host__body--with-legend\">\n <div class=\"axp-chart-widget-host__chart\">\n <ax-bar-chart\n #chart\n [data]=\"data()\"\n [options]=\"barChartOptions()\"\n (barClick)=\"handleBarClick($event)\"\n ></ax-bar-chart>\n </div>\n <!-- ----- Series indicator (legend) ----- -->\n @if (data().length > 0) {\n <div class=\"axp-chart-widget-host__legend\">\n <ax-chart-legend [chart]=\"chart\" [options]=\"legendOptions\"></ax-chart-legend>\n </div>\n }\n </div>\n</div>\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;AAGG;AAOG,MAAO,8BAA+B,SAAQ,2BAA2B,CAAA;AAsCnE,IAAA,cAAc,CAAC,KAAa,EAAA;AACpC,QAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC;IAChC;;IAIQ,MAAM,uBAAuB,CAAC,KAAc,EAAA;AAClD,QAAA,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACvE,OAAO,IAAI,CAAC,kBAAkB,CAAC,OA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;2FAGtE,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAN1C,SAAS;8BAGC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,0BAA0B,CAAC,EAAA,eAAA,EACjE,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,gxBAAA,EAAA,MAAA,EAAA,CAAA,w/PAAA,CAAA,EAAA;;;"}
@@ -0,0 +1,126 @@
1
+ import { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';
2
+ import * as i3 from '@acorex-platform/framework-client/layout/widget-core';
3
+ import { AXPWidgetCoreModule } from '@acorex-platform/framework-client/layout/widget-core';
4
+ import { AXTranslationService } from '@acorex/core/translation';
5
+ import * as i1 from '@acorex/components/tabs';
6
+ import { AXTabsModule } from '@acorex/components/tabs';
7
+ import * as i0 from '@angular/core';
8
+ import { inject, computed, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
9
+ import { e as AXPDashboardWidgetComponent, h as asChartTabWidgetNode, i as isChartTabConfigured, j as readChartTabTitle } from './acorex-platform-module-dashboard-management-client-acorex-platform-module-dashboard-management-client-Ey27MqFo.mjs';
10
+
11
+ //#region ----- Imports -----
12
+ //#endregion
13
+ //#region ----- Component -----
14
+ class AXPChartCardWidgetViewComponent extends AXPDashboardWidgetComponent {
15
+ constructor() {
16
+ super(...arguments);
17
+ //#region ----- Services & Dependencies -----
18
+ this.translationService = inject(AXTranslationService);
19
+ //#endregion
20
+ //#region ----- State Signals -----
21
+ this.tabNodes = computed(() => {
22
+ const raw = this.options()['tabs'];
23
+ if (!Array.isArray(raw)) {
24
+ return [];
25
+ }
26
+ return raw.map(asChartTabWidgetNode).filter((node) => node != null);
27
+ }, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "tabNodes" }] : /* istanbul ignore next */ []));
29
+ this.tabStrip = signal([], /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "tabStrip" }] : /* istanbul ignore next */ []));
31
+ this.activeTabIndex = signal(0, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "activeTabIndex" }] : /* istanbul ignore next */ []));
33
+ /** Panes mounted on first visit. Existing entries keep the same node reference. */
34
+ this.renderedPanes = signal([], /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "renderedPanes" }] : /* istanbul ignore next */ []));
36
+ //#endregion
37
+ //#region ----- Lifecycle -----
38
+ this.clampTabIndexEffect = effect(() => {
39
+ const tabs = this.tabNodes();
40
+ const current = this.activeTabIndex();
41
+ const clamped = tabs.length === 0 ? 0 : Math.min(Math.max(current, 0), tabs.length - 1);
42
+ if (clamped !== current) {
43
+ this.activeTabIndex.set(clamped);
44
+ }
45
+ this.renderedPanes.update((panes) => this.reconcileRenderedPanes(panes, tabs, clamped));
46
+ }, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "clampTabIndexEffect" }] : /* istanbul ignore next */ []));
48
+ this.resolveTabLabelsEffect = effect(() => {
49
+ const nodes = this.tabNodes();
50
+ void Promise.all(nodes.map((node) => this.resolveTabLabel(node))).then((labels) => {
51
+ this.tabStrip.set(labels.map((label, index) => ({
52
+ label,
53
+ query: nodes[index]?.type ?? `tab-${index}`,
54
+ queryInput: undefined,
55
+ })));
56
+ });
57
+ }, /* @ts-ignore */
58
+ ...(ngDevMode ? [{ debugName: "resolveTabLabelsEffect" }] : /* istanbul ignore next */ []));
59
+ }
60
+ //#endregion
61
+ //#region ----- Event Handlers -----
62
+ selectQueryTab(index) {
63
+ this.activeTabIndex.set(index);
64
+ this.ensurePaneRendered(index);
65
+ }
66
+ onActiveTabChanged(event) {
67
+ this.selectQueryTab(event.index);
68
+ }
69
+ isTabConfigured(node) {
70
+ return isChartTabConfigured(node);
71
+ }
72
+ tabStripKey(tab, index) {
73
+ return `${tab.query}:${index}`;
74
+ }
75
+ //#endregion
76
+ //#region ----- Localization -----
77
+ async resolveTabLabel(node) {
78
+ const raw = readChartTabTitle(node);
79
+ if (raw != null && typeof raw === 'object' && !Array.isArray(raw)) {
80
+ return this.translationService.resolve(raw);
81
+ }
82
+ const text = String(raw ?? '').trim();
83
+ if (text.startsWith('@')) {
84
+ return this.translationService.translateAsync(text);
85
+ }
86
+ if (text) {
87
+ return text;
88
+ }
89
+ return this.translationService.translateAsync('@dashboard:widgets.chart-card.untitled-tab');
90
+ }
91
+ //#endregion
92
+ //#region ----- Tab panes -----
93
+ paneKey(node, index) {
94
+ const name = typeof node.name === 'string' ? node.name.trim() : '';
95
+ return name || `${node.type}:${index}`;
96
+ }
97
+ ensurePaneRendered(index) {
98
+ const tabs = this.tabNodes();
99
+ this.renderedPanes.update((panes) => this.reconcileRenderedPanes(panes, tabs, index));
100
+ }
101
+ reconcileRenderedPanes(panes, tabs, activateIndex) {
102
+ const kept = panes.filter((pane) => pane.index >= 0 && pane.index < tabs.length);
103
+ if (tabs.length > 0 && !kept.some((pane) => pane.index === activateIndex)) {
104
+ const node = tabs[activateIndex];
105
+ kept.push({
106
+ key: this.paneKey(node, activateIndex),
107
+ index: activateIndex,
108
+ node,
109
+ });
110
+ }
111
+ kept.sort((left, right) => left.index - right.index);
112
+ if (kept.length === panes.length && kept.every((pane, index) => pane === panes[index])) {
113
+ return panes;
114
+ }
115
+ return kept;
116
+ }
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPChartCardWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
118
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPChartCardWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"axp-chart-widget-host\">\n @if (tabNodes().length === 0) {\n <!-- ----- Empty card when no chart tabs are configured ----- -->\n <axp-state-message icon=\"fa-light fa-chart-mixed\" [title]=\"'@dashboard:widgets.chart-card.empty-title'\" [description]=\"'@dashboard:widgets.chart-card.empty-description'\" />\n }\n <!-- ----- Header-only ax-tabs; chart panes live outside the tab items ----- -->\n @else {\n <!--------------------------------------------------------------->\n <!-- ----- Tab strip when more than one chart is configured ----- -->\n @if (tabStrip().length > 1) {\n <ax-tabs class=\"axp-chart-query-tabs\" [look]=\"'with-line'\" [location]=\"'bottom'\" [fitParent]=\"true\" (onActiveTabChanged)=\"onActiveTabChanged($event)\">\n @for (tab of tabStrip(); track tabStripKey(tab, $index)) {\n <ax-tab-item [key]=\"tabStripKey(tab, $index)\" [text]=\"tab.label\" [active]=\"activeTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n }\n <div class=\"axp-chart-widget-host__body\">\n @for (pane of renderedPanes(); track pane.key) {\n <div\n class=\"axp-chart-widget-host__pane\"\n [class.axp-chart-widget-host__pane--inactive]=\"pane.index !== activeTabIndex()\"\n [style.visibility]=\"pane.index === activeTabIndex() ? 'visible' : 'hidden'\"\n [attr.aria-hidden]=\"pane.index !== activeTabIndex()\"\n >\n <!--------------------------------------------------------------->\n <!-- ----- Incomplete tab: type or query is missing ----- -->\n @if (!isTabConfigured(pane.node)) {\n <axp-state-message icon=\"fa-light fa-triangle-exclamation\" [title]=\"'@dashboard:widgets.chart-card.incomplete-title'\" [description]=\"'@dashboard:widgets.chart-card.incomplete-description'\" />\n }\n <!-- ----- Typed chart stays mounted after first visit ----- -->\n @else {\n <ng-container axp-widget-renderer [node]=\"pane.node\" [mode]=\"'view'\"></ng-container>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@layer properties;:host{display:block;width:100%;height:100%;min-height:0px;overflow:hidden}:host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;overflow:visible;min-block-size:0}.axp-chart-widget-host{display:flex;height:100%;min-height:0px;width:100%;flex-direction:column;gap:var(--spacing, .25rem)}.axp-chart-widget-host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body{display:flex;min-height:0px;flex:1;flex-direction:column;gap:var(--spacing, .25rem);padding-bottom:calc(var(--spacing, .25rem) * 2)}.axp-chart-widget-host__body:not(.axp-chart-widget-host__body--with-legend)>.axp-chart-widget-host__chart--radial{flex:1 1 auto}.axp-chart-widget-host__body--with-legend{min-height:0px;flex:1;gap:var(--spacing, .25rem);display:grid;grid-template-rows:minmax(0,1fr) auto}.axp-chart-widget-host__chart{position:relative;min-height:calc(var(--spacing, .25rem) * 64);width:100%;overflow:hidden;grid-row:1}.axp-chart-widget-host__chart--radial{position:relative;margin-inline:auto;align-self:center;justify-self:center;overflow:hidden;grid-row:1;flex:0 0 auto;height:auto;width:min(100%,18rem);max-width:100%;min-height:12rem;min-width:8rem;aspect-ratio:1 / 1}.axp-chart-widget-host__chart--funnel{position:relative;width:100%;overflow:hidden;block-size:20rem;flex:0 0 auto;max-block-size:24rem;min-block-size:16rem}.axp-chart-widget-host__chart--funnel ax-funnel-chart,.axp-chart-widget-host__chart--funnel .ax-funnel-chart-container{display:block;block-size:100%;inline-size:100%;min-block-size:0}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--funnel){flex:none}.axp-chart-widget-host__chart--heatmap{position:relative;width:100%;max-width:100%;inline-size:100%;block-size:auto;flex:0 0 auto;overflow:visible;min-height:0!important;min-block-size:0!important;max-block-size:none}.axp-chart-widget-host__chart--heatmap ax-heatmap-chart,.axp-chart-widget-host__chart--heatmap .ax-heatmap-chart-container{display:block;inline-size:100%;max-inline-size:100%;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--heatmap){flex:none;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__legend{width:100%;flex:none;grid-row:2;min-height:0;min-width:0;max-width:100%;display:flex;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:rgb(var(--ax-sys-color-border-lighter-surface)) transparent}:host ::ng-deep ax-chart-legend{display:block!important;height:auto!important;max-height:none;width:max-content;min-width:100%;max-width:none}:host ::ng-deep .ax-chart-legend{--ax-legend-bg: var(--ax-sys-color-lighter-surface);--ax-legend-text: var(--ax-sys-color-on-lighter-surface);--ax-legend-border: var(--ax-sys-color-border-lighter-surface);--ax-legend-radius: .625rem;--ax-legend-padding: .375rem .5rem;--ax-legend-gap: .375rem;--ax-legend-item-height: auto;height:auto;max-height:none;width:100%;overflow:visible;padding:var(--ax-legend-padding);gap:var(--ax-legend-gap);color:rgb(var(--ax-legend-text))}:host ::ng-deep .ax-chart-legend.ax-legend-horizontal{flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;width:max-content;min-width:100%;max-width:none;overflow:visible;border:none;background:transparent;background-color:transparent;padding:.125rem .75rem .7rem;gap:.5rem}:host ::ng-deep .ax-legend-item{align-items:center;flex-shrink:0;gap:.375rem;height:auto;min-height:1.5rem;padding-block:.2rem;padding-inline:.5rem;border-radius:9999px;border:1px solid rgb(var(--ax-sys-color-border-lightest-surface));background-color:rgb(var(--ax-sys-color-lightest-surface));white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease,transform .15s ease}:host ::ng-deep .ax-legend-item:hover{border-color:rgb(var(--ax-sys-color-primary-500));background-color:rgb(var(--ax-sys-color-primary-500));box-shadow:0 1px 2px #0f172a0f}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{border-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 35%,rgb(var(--ax-sys-color-border-lightest-surface)))}}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{background-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 6%,rgb(var(--ax-sys-color-lightest-surface)))}}:host ::ng-deep .ax-legend-item:active{transform:scale(.98)}:host ::ng-deep .ax-legend-item.ax-legend-item-hidden{opacity:.62}:host ::ng-deep .ax-legend-color{width:.625rem;height:.625rem;flex-shrink:0;border-radius:9999px;box-shadow:0 0 0 1px rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-color{box-shadow:0 0 0 1px color-mix(in srgb,rgb(var(--ax-legend-text)) 18%,transparent)}}:host ::ng-deep .ax-legend-name{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);max-width:9rem;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .ax-legend-value{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);margin-inline-start:0;opacity:1;color:rgb(var(--ax-sys-color-on-lightest-surface))}:host ::ng-deep .ax-legend-percentage{margin-inline-start:0;border-radius:9999px;padding-inline:.4rem;padding-block:.125rem;font-size:.6875rem;line-height:1;font-weight:600;font-variant-numeric:tabular-nums;background-color:rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-percentage{background-color:color-mix(in srgb,rgb(var(--ax-legend-text)) 12%,transparent)}}:host ::ng-deep ax-donut-chart,:host ::ng-deep ax-gauge-chart,:host ::ng-deep ax-bar-chart,:host ::ng-deep ax-line-chart,:host ::ng-deep ax-funnel-chart{display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart{display:block!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}:host ::ng-deep ax-donut-chart .ax-donut-chart,:host ::ng-deep ax-gauge-chart .ax-gauge-chart,:host ::ng-deep ax-bar-chart .ax-bar-chart,:host ::ng-deep ax-line-chart .ax-line-chart,:host ::ng-deep ax-funnel-chart .ax-funnel-chart-container{min-height:0!important;height:100%!important;width:100%!important;padding:.25rem!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart .ax-heatmap-chart-container,:host ::ng-deep .axp-chart-widget-host__chart--heatmap .ax-heatmap-chart{min-height:0!important;height:auto!important;width:100%!important;max-width:100%!important;padding:.25rem!important;overflow:visible!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap svg{display:block;width:100%!important;max-width:100%!important;height:auto!important;overflow:visible!important}.axp-chart-query-tabs{margin-bottom:.25rem}:host ::ng-deep ax-tabs.axp-chart-query-tabs.ax-tabs-fit.ax-bottom>ax-tab-item,:host ::ng-deep ax-tabs.axp-chart-query-tabs.ax-tabs-fit.ax-top>ax-tab-item{min-width:max-content}.axp-chart-widget-host__body{position:relative}.axp-chart-widget-host__pane{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}.axp-chart-widget-host__pane--inactive{position:absolute;inset:0;pointer-events:none}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i1.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "reorderable", "reorderDelay", "renderMode", "stacked", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged", "onTabsReordered"] }, { kind: "component", type: i1.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "directive", type: i3.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged", "onLoad"], exportAs: ["widgetRenderer"] }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "titleParams", "descriptionParams", "look"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
119
+ }
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPChartCardWidgetViewComponent, decorators: [{
121
+ type: Component,
122
+ args: [{ imports: [AXTabsModule, AXPWidgetCoreModule, AXPStateMessageComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"axp-chart-widget-host\">\n @if (tabNodes().length === 0) {\n <!-- ----- Empty card when no chart tabs are configured ----- -->\n <axp-state-message icon=\"fa-light fa-chart-mixed\" [title]=\"'@dashboard:widgets.chart-card.empty-title'\" [description]=\"'@dashboard:widgets.chart-card.empty-description'\" />\n }\n <!-- ----- Header-only ax-tabs; chart panes live outside the tab items ----- -->\n @else {\n <!--------------------------------------------------------------->\n <!-- ----- Tab strip when more than one chart is configured ----- -->\n @if (tabStrip().length > 1) {\n <ax-tabs class=\"axp-chart-query-tabs\" [look]=\"'with-line'\" [location]=\"'bottom'\" [fitParent]=\"true\" (onActiveTabChanged)=\"onActiveTabChanged($event)\">\n @for (tab of tabStrip(); track tabStripKey(tab, $index)) {\n <ax-tab-item [key]=\"tabStripKey(tab, $index)\" [text]=\"tab.label\" [active]=\"activeTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n }\n <div class=\"axp-chart-widget-host__body\">\n @for (pane of renderedPanes(); track pane.key) {\n <div\n class=\"axp-chart-widget-host__pane\"\n [class.axp-chart-widget-host__pane--inactive]=\"pane.index !== activeTabIndex()\"\n [style.visibility]=\"pane.index === activeTabIndex() ? 'visible' : 'hidden'\"\n [attr.aria-hidden]=\"pane.index !== activeTabIndex()\"\n >\n <!--------------------------------------------------------------->\n <!-- ----- Incomplete tab: type or query is missing ----- -->\n @if (!isTabConfigured(pane.node)) {\n <axp-state-message icon=\"fa-light fa-triangle-exclamation\" [title]=\"'@dashboard:widgets.chart-card.incomplete-title'\" [description]=\"'@dashboard:widgets.chart-card.incomplete-description'\" />\n }\n <!-- ----- Typed chart stays mounted after first visit ----- -->\n @else {\n <ng-container axp-widget-renderer [node]=\"pane.node\" [mode]=\"'view'\"></ng-container>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@layer properties;:host{display:block;width:100%;height:100%;min-height:0px;overflow:hidden}:host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;overflow:visible;min-block-size:0}.axp-chart-widget-host{display:flex;height:100%;min-height:0px;width:100%;flex-direction:column;gap:var(--spacing, .25rem)}.axp-chart-widget-host:has(.axp-chart-widget-host__chart--heatmap){block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body{display:flex;min-height:0px;flex:1;flex-direction:column;gap:var(--spacing, .25rem);padding-bottom:calc(var(--spacing, .25rem) * 2)}.axp-chart-widget-host__body:not(.axp-chart-widget-host__body--with-legend)>.axp-chart-widget-host__chart--radial{flex:1 1 auto}.axp-chart-widget-host__body--with-legend{min-height:0px;flex:1;gap:var(--spacing, .25rem);display:grid;grid-template-rows:minmax(0,1fr) auto}.axp-chart-widget-host__chart{position:relative;min-height:calc(var(--spacing, .25rem) * 64);width:100%;overflow:hidden;grid-row:1}.axp-chart-widget-host__chart--radial{position:relative;margin-inline:auto;align-self:center;justify-self:center;overflow:hidden;grid-row:1;flex:0 0 auto;height:auto;width:min(100%,18rem);max-width:100%;min-height:12rem;min-width:8rem;aspect-ratio:1 / 1}.axp-chart-widget-host__chart--funnel{position:relative;width:100%;overflow:hidden;block-size:20rem;flex:0 0 auto;max-block-size:24rem;min-block-size:16rem}.axp-chart-widget-host__chart--funnel ax-funnel-chart,.axp-chart-widget-host__chart--funnel .ax-funnel-chart-container{display:block;block-size:100%;inline-size:100%;min-block-size:0}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--funnel){flex:none}.axp-chart-widget-host__chart--heatmap{position:relative;width:100%;max-width:100%;inline-size:100%;block-size:auto;flex:0 0 auto;overflow:visible;min-height:0!important;min-block-size:0!important;max-block-size:none}.axp-chart-widget-host__chart--heatmap ax-heatmap-chart,.axp-chart-widget-host__chart--heatmap .ax-heatmap-chart-container{display:block;inline-size:100%;max-inline-size:100%;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__body:has(.axp-chart-widget-host__chart--heatmap){flex:none;block-size:auto;min-block-size:0;overflow:visible}.axp-chart-widget-host__legend{width:100%;flex:none;grid-row:2;min-height:0;min-width:0;max-width:100%;display:flex;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:rgb(var(--ax-sys-color-border-lighter-surface)) transparent}:host ::ng-deep ax-chart-legend{display:block!important;height:auto!important;max-height:none;width:max-content;min-width:100%;max-width:none}:host ::ng-deep .ax-chart-legend{--ax-legend-bg: var(--ax-sys-color-lighter-surface);--ax-legend-text: var(--ax-sys-color-on-lighter-surface);--ax-legend-border: var(--ax-sys-color-border-lighter-surface);--ax-legend-radius: .625rem;--ax-legend-padding: .375rem .5rem;--ax-legend-gap: .375rem;--ax-legend-item-height: auto;height:auto;max-height:none;width:100%;overflow:visible;padding:var(--ax-legend-padding);gap:var(--ax-legend-gap);color:rgb(var(--ax-legend-text))}:host ::ng-deep .ax-chart-legend.ax-legend-horizontal{flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;width:max-content;min-width:100%;max-width:none;overflow:visible;border:none;background:transparent;background-color:transparent;padding:.125rem .75rem .7rem;gap:.5rem}:host ::ng-deep .ax-legend-item{align-items:center;flex-shrink:0;gap:.375rem;height:auto;min-height:1.5rem;padding-block:.2rem;padding-inline:.5rem;border-radius:9999px;border:1px solid rgb(var(--ax-sys-color-border-lightest-surface));background-color:rgb(var(--ax-sys-color-lightest-surface));white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease,transform .15s ease}:host ::ng-deep .ax-legend-item:hover{border-color:rgb(var(--ax-sys-color-primary-500));background-color:rgb(var(--ax-sys-color-primary-500));box-shadow:0 1px 2px #0f172a0f}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{border-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 35%,rgb(var(--ax-sys-color-border-lightest-surface)))}}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-item:hover{background-color:color-mix(in srgb,rgb(var(--ax-sys-color-primary-500)) 6%,rgb(var(--ax-sys-color-lightest-surface)))}}:host ::ng-deep .ax-legend-item:active{transform:scale(.98)}:host ::ng-deep .ax-legend-item.ax-legend-item-hidden{opacity:.62}:host ::ng-deep .ax-legend-color{width:.625rem;height:.625rem;flex-shrink:0;border-radius:9999px;box-shadow:0 0 0 1px rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-color{box-shadow:0 0 0 1px color-mix(in srgb,rgb(var(--ax-legend-text)) 18%,transparent)}}:host ::ng-deep .ax-legend-name{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);max-width:9rem;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .ax-legend-value{font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600);--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);margin-inline-start:0;opacity:1;color:rgb(var(--ax-sys-color-on-lightest-surface))}:host ::ng-deep .ax-legend-percentage{margin-inline-start:0;border-radius:9999px;padding-inline:.4rem;padding-block:.125rem;font-size:.6875rem;line-height:1;font-weight:600;font-variant-numeric:tabular-nums;background-color:rgb(var(--ax-legend-text))}@supports (color: color-mix(in lab,red,red)){:host ::ng-deep .ax-legend-percentage{background-color:color-mix(in srgb,rgb(var(--ax-legend-text)) 12%,transparent)}}:host ::ng-deep ax-donut-chart,:host ::ng-deep ax-gauge-chart,:host ::ng-deep ax-bar-chart,:host ::ng-deep ax-line-chart,:host ::ng-deep ax-funnel-chart{display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart{display:block!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}:host ::ng-deep ax-donut-chart .ax-donut-chart,:host ::ng-deep ax-gauge-chart .ax-gauge-chart,:host ::ng-deep ax-bar-chart .ax-bar-chart,:host ::ng-deep ax-line-chart .ax-line-chart,:host ::ng-deep ax-funnel-chart .ax-funnel-chart-container{min-height:0!important;height:100%!important;width:100%!important;padding:.25rem!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap ax-heatmap-chart .ax-heatmap-chart-container,:host ::ng-deep .axp-chart-widget-host__chart--heatmap .ax-heatmap-chart{min-height:0!important;height:auto!important;width:100%!important;max-width:100%!important;padding:.25rem!important;overflow:visible!important}:host ::ng-deep .axp-chart-widget-host__chart--heatmap svg{display:block;width:100%!important;max-width:100%!important;height:auto!important;overflow:visible!important}.axp-chart-query-tabs{margin-bottom:.25rem}:host ::ng-deep ax-tabs.axp-chart-query-tabs.ax-tabs-fit.ax-bottom>ax-tab-item,:host ::ng-deep ax-tabs.axp-chart-query-tabs.ax-tabs-fit.ax-top>ax-tab-item{min-width:max-content}.axp-chart-widget-host__body{position:relative}.axp-chart-widget-host__pane{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}.axp-chart-widget-host__pane--inactive{position:absolute;inset:0;pointer-events:none}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
123
+ }] });
124
+
125
+ export { AXPChartCardWidgetViewComponent };
126
+ //# sourceMappingURL=acorex-platform-module-dashboard-management-client-chart-card-widget.component-BYdlIBv9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-dashboard-management-client-chart-card-widget.component-BYdlIBv9.mjs","sources":["../../../../libs/modules/dashboard-management/client/src/lib/features/shared/widgets/chart/chart-card/chart-card-widget.component.ts","../../../../libs/modules/dashboard-management/client/src/lib/features/shared/widgets/chart/chart-card/chart-card-widget.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';\nimport { AXPWidgetCoreModule } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXTabsModule, type AXTabStripChangedEvent } from '@acorex/components/tabs';\nimport { AXPMultiLanguageString, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\n\nimport { AXPDashboardWidgetComponent } from '../../dashboard-widget-base';\nimport {\n asChartTabWidgetNode,\n isChartTabConfigured,\n readChartTabTitle,\n} from '../chart-tab.util';\nimport type { AXPChartQueryTab } from '../chart-query-load.util';\n\n//#endregion\n\n//#region ----- Types -----\n\ninterface AXPChartCardRenderedPane {\n key: string;\n index: number;\n node: AXPWidgetNode;\n}\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n templateUrl: './chart-card-widget.component.html',\n styleUrls: ['./chart-card-widget.component.css'],\n imports: [AXTabsModule, AXPWidgetCoreModule, AXPStateMessageComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXPChartCardWidgetViewComponent extends AXPDashboardWidgetComponent {\n //#region ----- Services & Dependencies -----\n\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly tabNodes = computed(() => {\n const raw = (this.options() as Record<string, unknown>)['tabs'];\n if (!Array.isArray(raw)) {\n return [] as AXPWidgetNode[];\n }\n return raw.map(asChartTabWidgetNode).filter((node): node is AXPWidgetNode => node != null);\n });\n\n protected readonly tabStrip = signal<AXPChartQueryTab[]>([]);\n\n protected readonly activeTabIndex = signal(0);\n\n /** Panes mounted on first visit. Existing entries keep the same node reference. */\n protected readonly renderedPanes = signal<readonly AXPChartCardRenderedPane[]>([]);\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected selectQueryTab(index: number): void {\n this.activeTabIndex.set(index);\n this.ensurePaneRendered(index);\n }\n\n protected onActiveTabChanged(event: AXTabStripChangedEvent): void {\n this.selectQueryTab(event.index);\n }\n\n protected isTabConfigured(node: AXPWidgetNode): boolean {\n return isChartTabConfigured(node);\n }\n\n protected tabStripKey(tab: AXPChartQueryTab, index: number): string {\n return `${tab.query}:${index}`;\n }\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n private readonly clampTabIndexEffect = effect(() => {\n const tabs = this.tabNodes();\n const current = this.activeTabIndex();\n const clamped = tabs.length === 0 ? 0 : Math.min(Math.max(current, 0), tabs.length - 1);\n if (clamped !== current) {\n this.activeTabIndex.set(clamped);\n }\n this.renderedPanes.update((panes) => this.reconcileRenderedPanes(panes, tabs, clamped));\n });\n\n private readonly resolveTabLabelsEffect = effect(() => {\n const nodes = this.tabNodes();\n void Promise.all(nodes.map((node) => this.resolveTabLabel(node))).then((labels) => {\n this.tabStrip.set(\n labels.map((label, index) => ({\n label,\n query: nodes[index]?.type ?? `tab-${index}`,\n queryInput: undefined,\n })),\n );\n });\n });\n\n //#endregion\n\n //#region ----- Localization -----\n\n private async resolveTabLabel(node: AXPWidgetNode): Promise<string> {\n const raw = readChartTabTitle(node);\n if (raw != null && typeof raw === 'object' && !Array.isArray(raw)) {\n return this.translationService.resolve(raw as AXPMultiLanguageString);\n }\n const text = String(raw ?? '').trim();\n if (text.startsWith('@')) {\n return this.translationService.translateAsync(text);\n }\n if (text) {\n return text;\n }\n return this.translationService.translateAsync('@dashboard:widgets.chart-card.untitled-tab');\n }\n\n //#endregion\n\n //#region ----- Tab panes -----\n\n private paneKey(node: AXPWidgetNode, index: number): string {\n const name = typeof node.name === 'string' ? node.name.trim() : '';\n return name || `${node.type}:${index}`;\n }\n\n private ensurePaneRendered(index: number): void {\n const tabs = this.tabNodes();\n this.renderedPanes.update((panes) => this.reconcileRenderedPanes(panes, tabs, index));\n }\n\n private reconcileRenderedPanes(\n panes: readonly AXPChartCardRenderedPane[],\n tabs: readonly AXPWidgetNode[],\n activateIndex: number,\n ): readonly AXPChartCardRenderedPane[] {\n const kept = panes.filter((pane) => pane.index >= 0 && pane.index < tabs.length);\n if (tabs.length > 0 && !kept.some((pane) => pane.index === activateIndex)) {\n const node = tabs[activateIndex];\n kept.push({\n key: this.paneKey(node, activateIndex),\n index: activateIndex,\n node,\n });\n }\n kept.sort((left, right) => left.index - right.index);\n if (kept.length === panes.length && kept.every((pane, index) => pane === panes[index])) {\n return panes;\n }\n return kept;\n }\n\n //#endregion\n}\n\n//#endregion\n","<div class=\"axp-chart-widget-host\">\n @if (tabNodes().length === 0) {\n <!-- ----- Empty card when no chart tabs are configured ----- -->\n <axp-state-message icon=\"fa-light fa-chart-mixed\" [title]=\"'@dashboard:widgets.chart-card.empty-title'\" [description]=\"'@dashboard:widgets.chart-card.empty-description'\" />\n }\n <!-- ----- Header-only ax-tabs; chart panes live outside the tab items ----- -->\n @else {\n <!--------------------------------------------------------------->\n <!-- ----- Tab strip when more than one chart is configured ----- -->\n @if (tabStrip().length > 1) {\n <ax-tabs class=\"axp-chart-query-tabs\" [look]=\"'with-line'\" [location]=\"'bottom'\" [fitParent]=\"true\" (onActiveTabChanged)=\"onActiveTabChanged($event)\">\n @for (tab of tabStrip(); track tabStripKey(tab, $index)) {\n <ax-tab-item [key]=\"tabStripKey(tab, $index)\" [text]=\"tab.label\" [active]=\"activeTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n }\n <div class=\"axp-chart-widget-host__body\">\n @for (pane of renderedPanes(); track pane.key) {\n <div\n class=\"axp-chart-widget-host__pane\"\n [class.axp-chart-widget-host__pane--inactive]=\"pane.index !== activeTabIndex()\"\n [style.visibility]=\"pane.index === activeTabIndex() ? 'visible' : 'hidden'\"\n [attr.aria-hidden]=\"pane.index !== activeTabIndex()\"\n >\n <!--------------------------------------------------------------->\n <!-- ----- Incomplete tab: type or query is missing ----- -->\n @if (!isTabConfigured(pane.node)) {\n <axp-state-message icon=\"fa-light fa-triangle-exclamation\" [title]=\"'@dashboard:widgets.chart-card.incomplete-title'\" [description]=\"'@dashboard:widgets.chart-card.incomplete-description'\" />\n }\n <!-- ----- Typed chart stays mounted after first visit ----- -->\n @else {\n <ng-container axp-widget-renderer [node]=\"pane.node\" [mode]=\"'view'\"></ng-container>\n }\n </div>\n }\n </div>\n }\n</div>\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AA2BA;AAEA;AAQM,MAAO,+BAAgC,SAAQ,2BAA2B,CAAA;AANhF,IAAA,WAAA,GAAA;;;AASmB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,C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AA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,KAAA,EAAA,gBAAA,EAAA,QAAA,CAAA,EAAA,OAAA,EAAA,CAAA,gBAAA,EAAA,SAAA,EAAA,QAAA,EAAA,SAAA,EAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,mBAAmB,wQAAE,wBAAwB,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,aAAA,EAAA,aAAA,EAAA,mBAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAG1D,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAN3C,SAAS;8BAGC,CAAC,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,CAAC,EAAA,eAAA,EACrD,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,klEAAA,EAAA,MAAA,EAAA,CAAA,m7QAAA,CAAA,EAAA;;;"}
@@ -0,0 +1,76 @@
1
+ import { AXPColumnWidgetComponent, AXPWidgetRegistryService } from '@acorex-platform/framework-client/layout/widget-core';
2
+ import { coerceUnknownToMultiLanguageString, hasMultiLanguageContent } from '@acorex-platform/framework-shared/core';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import * as i3 from '@acorex/core/translation';
6
+ import { AXTranslationModule } from '@acorex/core/translation';
7
+ import { AsyncPipe } from '@angular/common';
8
+
9
+ //#region ----- Imports -----
10
+ //#endregion
11
+ //#region ----- Component -----
12
+ class AXMChartConfiguratorWidgetColumnComponent extends AXPColumnWidgetComponent {
13
+ constructor() {
14
+ super(...arguments);
15
+ //#region ----- Services & Dependencies -----
16
+ this.widgetRegistry = inject(AXPWidgetRegistryService);
17
+ //#endregion
18
+ //#region ----- Computed Properties -----
19
+ this.widget = computed(() => {
20
+ const widgetNode = this.rawValue;
21
+ if (!widgetNode?.type) {
22
+ return undefined;
23
+ }
24
+ try {
25
+ return this.widgetRegistry.resolve(widgetNode.type);
26
+ }
27
+ catch {
28
+ return undefined;
29
+ }
30
+ }, /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "widget" }] : /* istanbul ignore next */ []));
32
+ this.displayTitle = computed(() => {
33
+ const widgetNode = this.rawValue;
34
+ const opts = widgetNode?.options;
35
+ const fromTab = coerceUnknownToMultiLanguageString(opts?.['title'] ?? opts?.['label']);
36
+ if (hasMultiLanguageContent(fromTab)) {
37
+ return fromTab;
38
+ }
39
+ return this.widget()?.title ?? '';
40
+ }, /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "displayTitle" }] : /* istanbul ignore next */ []));
42
+ }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMChartConfiguratorWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
44
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMChartConfiguratorWidgetColumnComponent, isStandalone: true, selector: "axm-chart-configurator-widget-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: `
45
+ @if (widget()) {
46
+ <i [class]="widget()?.icon" class="fa-fw"></i>&nbsp;
47
+ <span [title]="($safeNavigationMigration(displayTitle()) | translate | async) ?? ''" class="text-xs font-medium">
48
+ {{ $safeNavigationMigration(displayTitle()) | translate | async }}
49
+ </span>
50
+ } @else {
51
+ <span class="text-muted">---</span>
52
+ }
53
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
54
+ }
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMChartConfiguratorWidgetColumnComponent, decorators: [{
56
+ type: Component,
57
+ args: [{
58
+ selector: 'axm-chart-configurator-widget-column',
59
+ template: `
60
+ @if (widget()) {
61
+ <i [class]="widget()?.icon" class="fa-fw"></i>&nbsp;
62
+ <span [title]="($safeNavigationMigration(displayTitle()) | translate | async) ?? ''" class="text-xs font-medium">
63
+ {{ $safeNavigationMigration(displayTitle()) | translate | async }}
64
+ </span>
65
+ } @else {
66
+ <span class="text-muted">---</span>
67
+ }
68
+ `,
69
+ changeDetection: ChangeDetectionStrategy.OnPush,
70
+ imports: [AXTranslationModule, AsyncPipe],
71
+ inputs: ['rawValue', 'rowData'],
72
+ }]
73
+ }] });
74
+
75
+ export { AXMChartConfiguratorWidgetColumnComponent };
76
+ //# sourceMappingURL=acorex-platform-module-dashboard-management-client-chart-configurator-widget-column.component-DxNKy3bB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-dashboard-management-client-chart-configurator-widget-column.component-DxNKy3bB.mjs","sources":["../../../../libs/modules/dashboard-management/client/src/lib/features/shared/widgets/chart/chart-configurator/chart-configurator-widget-column.component.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPColumnWidgetComponent, AXPWidgetRegistryService } from '@acorex-platform/framework-client/layout/widget-core';\nimport {\n coerceUnknownToMultiLanguageString,\n hasMultiLanguageContent,\n type AXPMultiLanguageString,\n type AXPWidgetNode,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPWidgetConfig } from '@acorex-platform/framework-shared/widget-core';\nimport { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AsyncPipe } from '@angular/common';\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-chart-configurator-widget-column',\n template: `\n @if (widget()) {\n <i [class]=\"widget()?.icon\" class=\"fa-fw\"></i>&nbsp;\n <span [title]=\"($safeNavigationMigration(displayTitle()) | translate | async) ?? ''\" class=\"text-xs font-medium\">\n {{ $safeNavigationMigration(displayTitle()) | translate | async }}\n </span>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXTranslationModule, AsyncPipe],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMChartConfiguratorWidgetColumnComponent extends AXPColumnWidgetComponent<AXPWidgetNode> {\n //#region ----- Services & Dependencies -----\n\n private readonly widgetRegistry = inject(AXPWidgetRegistryService);\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n protected readonly widget = computed<AXPWidgetConfig | undefined>(() => {\n const widgetNode = this.rawValue as AXPWidgetNode | undefined;\n if (!widgetNode?.type) {\n return undefined;\n }\n\n try {\n return this.widgetRegistry.resolve(widgetNode.type);\n } catch {\n return undefined;\n }\n });\n\n protected readonly displayTitle = computed((): AXPMultiLanguageString => {\n const widgetNode = this.rawValue as AXPWidgetNode | undefined;\n const opts = widgetNode?.options as Record<string, unknown> | undefined;\n const fromTab = coerceUnknownToMultiLanguageString(opts?.['title'] ?? opts?.['label']);\n if (hasMultiLanguageContent(fromTab)) {\n return fromTab;\n }\n return this.widget()?.title ?? '';\n });\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAAA;AAcA;AAEA;AAkBM,MAAO,yCAA0C,SAAQ,wBAAuC,CAAA;AAhBtG,IAAA,WAAA,GAAA;;;AAmBmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,wBAAwB,CAAC;;;AAM/C,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAA8B,MAAK;AACrE,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,QAAqC;AAC7D,YAAA,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE;AACrB,gBA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