@masterteam/dashboard-builder 0.0.54 → 0.0.56

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.
@@ -724,6 +724,7 @@ class LimitedHttpService {
724
724
  cache = new Map();
725
725
  // In-flight requests (for deduplication)
726
726
  inFlightRequests = new Map();
727
+ inFlightRequestScopes = new Map();
727
728
  // Active requests tracking
728
729
  _activeRequestsCount = signal(0, ...(ngDevMode ? [{ debugName: "_activeRequestsCount" }] : /* istanbul ignore next */ []));
729
730
  reportReadyTimeout = null;
@@ -772,6 +773,7 @@ class LimitedHttpService {
772
773
  */
773
774
  post(url, body, options) {
774
775
  const dashboardId = this.getDashboardIdFromRoute();
776
+ const cacheScopeId = this.readCacheScopeId(options);
775
777
  const finalBody = {
776
778
  ...body,
777
779
  dashboardId,
@@ -780,8 +782,9 @@ class LimitedHttpService {
780
782
  const request = {
781
783
  url,
782
784
  body: finalBody,
783
- options: { ...options },
785
+ options: this.stripInternalOptions(options),
784
786
  dashboardId,
787
+ cacheScopeId,
785
788
  };
786
789
  // Notify pipeline of new request
787
790
  this.requestSubject.next(request);
@@ -798,11 +801,13 @@ class LimitedHttpService {
798
801
  */
799
802
  get(url, options) {
800
803
  const dashboardId = this.getDashboardIdFromRoute();
804
+ const cacheScopeId = this.readCacheScopeId(options);
801
805
  return new Observable((observer) => {
802
806
  const request = {
803
807
  url,
804
- options: { ...options },
808
+ options: this.stripInternalOptions(options),
805
809
  dashboardId,
810
+ cacheScopeId,
806
811
  };
807
812
  this.requestSubject.next(request);
808
813
  this.executeRequest(request).subscribe({
@@ -819,10 +824,30 @@ class LimitedHttpService {
819
824
  this.debounceTimeMs = time;
820
825
  }
821
826
  /**
822
- * Clear all cached responses
827
+ * Clear cached responses. Pass a chart item id to scope the clear to that
828
+ * item's entries only; omit it to clear everything.
823
829
  */
824
- clearCache() {
825
- this.cache.clear();
830
+ clearCache(cacheScopeId) {
831
+ if (cacheScopeId === undefined) {
832
+ this.cache.clear();
833
+ this.inFlightRequests.clear();
834
+ this.inFlightRequestScopes.clear();
835
+ }
836
+ else {
837
+ const target = String(cacheScopeId);
838
+ for (const [key, entry] of this.cache.entries()) {
839
+ if (entry.cacheScopeId !== undefined &&
840
+ String(entry.cacheScopeId) === target) {
841
+ this.cache.delete(key);
842
+ }
843
+ }
844
+ for (const [key, scope] of this.inFlightRequestScopes.entries()) {
845
+ if (scope !== undefined && String(scope) === target) {
846
+ this.inFlightRequests.delete(key);
847
+ this.inFlightRequestScopes.delete(key);
848
+ }
849
+ }
850
+ }
826
851
  if (this.reportReadyTimeout) {
827
852
  clearTimeout(this.reportReadyTimeout);
828
853
  this.reportReadyTimeout = null;
@@ -885,7 +910,7 @@ class LimitedHttpService {
885
910
  params.toString !== Object.prototype.toString
886
911
  ? params.toString()
887
912
  : this.stableStringify(params);
888
- return `${request.url}-${request.dashboardId}-${bodyKey}-${paramsKey}`;
913
+ return `${request.url}-${request.dashboardId}-${request.cacheScopeId ?? ''}-${bodyKey}-${paramsKey}`;
889
914
  }
890
915
  /**
891
916
  * Execute HTTP request with caching and deduplication
@@ -919,10 +944,15 @@ class LimitedHttpService {
919
944
  // Create shared observable with caching
920
945
  const request$ = http$.pipe(retry(2), tap((response) => {
921
946
  // Store in cache
922
- this.cache.set(key, { data: response, timestamp: Date.now() });
947
+ this.cache.set(key, {
948
+ data: response,
949
+ timestamp: Date.now(),
950
+ cacheScopeId: request.cacheScopeId,
951
+ });
923
952
  }), finalize(() => {
924
953
  // Remove from in-flight
925
954
  this.inFlightRequests.delete(key);
955
+ this.inFlightRequestScopes.delete(key);
926
956
  // Decrement active count
927
957
  this._activeRequestsCount.update((count) => Math.max(0, count - 1));
928
958
  // Check if all done
@@ -930,8 +960,18 @@ class LimitedHttpService {
930
960
  }), shareReplay(1));
931
961
  // Store in in-flight map
932
962
  this.inFlightRequests.set(key, request$);
963
+ this.inFlightRequestScopes.set(key, request.cacheScopeId);
933
964
  return request$;
934
965
  }
966
+ readCacheScopeId(options) {
967
+ return options?.cacheScopeId;
968
+ }
969
+ stripInternalOptions(options) {
970
+ if (!options || typeof options !== 'object')
971
+ return options;
972
+ const { cacheScopeId: _cacheScopeId, ...httpOptions } = options;
973
+ return httpOptions;
974
+ }
935
975
  /**
936
976
  * Check if all requests finished and set report ready after delay
937
977
  */
@@ -11464,8 +11504,7 @@ function matchesColorCondition(condition, numericValue) {
11464
11504
  numericValue >= value1) {
11465
11505
  return true;
11466
11506
  }
11467
- if (condition.type === ColorConditionType.LessThan &&
11468
- numericValue < value1) {
11507
+ if (condition.type === ColorConditionType.LessThan && numericValue < value1) {
11469
11508
  return true;
11470
11509
  }
11471
11510
  if (condition.type === ColorConditionType.LessThanOrEqual &&
@@ -19823,7 +19862,6 @@ class ChartDataService {
19823
19862
  */
19824
19863
  buildRequest(config, filters) {
19825
19864
  const serviceConfig = config.serviceConfig;
19826
- const clientConfig = config.clientConfig;
19827
19865
  // requestType is persisted on clientConfig. Legacy/generated configs can
19828
19866
  // omit it, so fall back to the registry capability for data-backed charts.
19829
19867
  const requestType = this.resolveRequestType(config);
@@ -19907,6 +19945,14 @@ class ChartDataService {
19907
19945
  }
19908
19946
  return params;
19909
19947
  }
19948
+ withCacheScope(config, options = {}) {
19949
+ const cacheScopeId = config.serviceConfig?.dashboardId;
19950
+ return cacheScopeId === undefined ||
19951
+ cacheScopeId === null ||
19952
+ cacheScopeId === ''
19953
+ ? options
19954
+ : { ...options, cacheScopeId };
19955
+ }
19910
19956
  /**
19911
19957
  * Fetch level data
19912
19958
  */
@@ -19923,7 +19969,7 @@ class ChartDataService {
19923
19969
  // Add filters
19924
19970
  params = this.buildHttpParams(params, filters);
19925
19971
  return this.http
19926
- .get(endpoint, { params })
19972
+ .get(endpoint, this.withCacheScope(config, { params }))
19927
19973
  .pipe(map$1((res) => res?.data || res));
19928
19974
  }
19929
19975
  /**
@@ -19938,7 +19984,7 @@ class ChartDataService {
19938
19984
  }
19939
19985
  params = this.buildHttpParams(params, filters);
19940
19986
  return this.http
19941
- .get(endpoint, { params })
19987
+ .get(endpoint, this.withCacheScope(config, { params }))
19942
19988
  .pipe(map$1((res) => res?.data || res));
19943
19989
  }
19944
19990
  /**
@@ -19949,7 +19995,7 @@ class ChartDataService {
19949
19995
  const endpoint = serviceConfig?.['endpoint'] || '/dashboards/log';
19950
19996
  const params = this.buildHttpParams(new HttpParams(), filters);
19951
19997
  return this.http
19952
- .get(endpoint, { params })
19998
+ .get(endpoint, this.withCacheScope(config, { params }))
19953
19999
  .pipe(map$1((res) => res?.data || res));
19954
20000
  }
19955
20001
  /**
@@ -19974,7 +20020,7 @@ class ChartDataService {
19974
20020
  : handleFiltersForCustom(svcConfig, filters);
19975
20021
  const body = normalizeBeforeRequest(substituted);
19976
20022
  return this.http
19977
- .post(url, body, { headers })
20023
+ .post(url, body, this.withCacheScope(config, { headers }))
19978
20024
  .pipe(map$1((value) => value?.data));
19979
20025
  });
19980
20026
  return forkJoin(requests$);
@@ -19993,7 +20039,7 @@ class ChartDataService {
19993
20039
  // splitChart→SplitChart), source-link DTO keys, selector backfill.
19994
20040
  const payload = normalizeBeforeRequest(substituted);
19995
20041
  return this.http
19996
- .post(url, payload, { headers })
20042
+ .post(url, payload, this.withCacheScope(config, { headers }))
19997
20043
  .pipe(map$1((res) => res?.data || res));
19998
20044
  }
19999
20045
  /**
@@ -20035,7 +20081,7 @@ class ChartDataService {
20035
20081
  // Build URL exactly like old implementation
20036
20082
  const url = `${this.urlPrefix}dashboards/${this.apiVersion}GetSnapShotInfo/${levelIdSegment?.length ? levelIdSegment + '/' : ''}${timeFrame}?year=${year}`;
20037
20083
  return this.http
20038
- .post(url, { AvgPerPeriod: !!query?.['getAveragePerPeriod'] }, { headers })
20084
+ .post(url, { AvgPerPeriod: !!query?.['getAveragePerPeriod'] }, this.withCacheScope(config, { headers }))
20039
20085
  .pipe(map$1((res) => res?.data || res));
20040
20086
  }
20041
20087
  /**
@@ -20073,7 +20119,7 @@ class ChartDataService {
20073
20119
  })();
20074
20120
  const url = `${this.urlPrefix}Dashboards/${this.apiVersion}GetCards/${moduleIdSegment}`;
20075
20121
  return this.http
20076
- .post(url, {}, { headers, params: cardFilters })
20122
+ .post(url, {}, this.withCacheScope(config, { headers, params: cardFilters }))
20077
20123
  .pipe(map$1((value) => value?.data));
20078
20124
  });
20079
20125
  return forkJoin(requests$);
@@ -20082,11 +20128,11 @@ class ChartDataService {
20082
20128
  * Fetch timeline dependencies
20083
20129
  * URL: ${urlPrefix}dashboards/${apiVersion}ProjectsDependancies
20084
20130
  */
20085
- fetchTimelineDependencies(_config, _filters) {
20131
+ fetchTimelineDependencies(config, _filters) {
20086
20132
  const headers = { noMessage: 'true' };
20087
20133
  const url = `${this.urlPrefix}dashboards/${this.apiVersion}ProjectsDependancies`;
20088
20134
  return this.http
20089
- .get(url, { headers })
20135
+ .get(url, this.withCacheScope(config, { headers }))
20090
20136
  .pipe(map$1((res) => res?.data || res));
20091
20137
  }
20092
20138
  /**
@@ -20100,7 +20146,7 @@ class ChartDataService {
20100
20146
  }
20101
20147
  const params = this.buildHttpParams(new HttpParams(), filters);
20102
20148
  return this.http
20103
- .get(endpoint, { params })
20149
+ .get(endpoint, this.withCacheScope(config, { params }))
20104
20150
  .pipe(map$1((res) => res?.data || res));
20105
20151
  }
20106
20152
  /**
@@ -20115,7 +20161,9 @@ class ChartDataService {
20115
20161
  return of(null);
20116
20162
  }
20117
20163
  const url = `${this.urlPrefix}api/Levels/${levelId}/PhaseGates`;
20118
- return this.http.get(url).pipe(map$1((res) => res?.data || res));
20164
+ return this.http
20165
+ .get(url, this.withCacheScope(config))
20166
+ .pipe(map$1((res) => res?.data || res));
20119
20167
  }
20120
20168
  /**
20121
20169
  * Fetch data from custom API (customApi.customApiUrl)
@@ -20145,11 +20193,11 @@ class ChartDataService {
20145
20193
  : handleFiltersForCustom(baseConfig, filters || {});
20146
20194
  const body = normalizeBeforeRequest(substituted);
20147
20195
  return this.http
20148
- .post(fullUrl, body, { headers })
20196
+ .post(fullUrl, body, this.withCacheScope(config, { headers }))
20149
20197
  .pipe(map$1((res) => res?.data || res));
20150
20198
  }
20151
20199
  return this.http
20152
- .get(fullUrl, { headers })
20200
+ .get(fullUrl, this.withCacheScope(config, { headers }))
20153
20201
  .pipe(map$1((res) => res?.data || res));
20154
20202
  }
20155
20203
  /**
@@ -20186,6 +20234,14 @@ class ChartDataService {
20186
20234
  refreshItem(dashboardId) {
20187
20235
  this.itemStore.updateStoreForItem(dashboardId, { GetData: true });
20188
20236
  }
20237
+ /**
20238
+ * Clear cached chart responses so the next fetchChartData() call hits the
20239
+ * network instead of serving a stale cached response. Pass a dashboardId to
20240
+ * scope the clear to one chart's data source, or omit it to clear everything.
20241
+ */
20242
+ clearCache(dashboardId) {
20243
+ this.http.clearCache(dashboardId);
20244
+ }
20189
20245
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ChartDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
20190
20246
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ChartDataService, providedIn: 'root' });
20191
20247
  }
@@ -20713,7 +20769,7 @@ class ActionService {
20713
20769
  dialogConfig?.clientConfig?.title?.['ar'] ||
20714
20770
  '';
20715
20771
  // Dynamically import DashboardDialogComponent to avoid circular dependency
20716
- import('./masterteam-dashboard-builder-dashboard-dialog.component-Cnv8thTk.mjs').then(({ DashboardDialogComponent }) => {
20772
+ import('./masterteam-dashboard-builder-dashboard-dialog.component-C1N4w9Dz.mjs').then(({ DashboardDialogComponent }) => {
20717
20773
  // Open dialog using ModalService
20718
20774
  this.modalService.openModal(DashboardDialogComponent, 'dialog', {
20719
20775
  header: title,
@@ -21025,11 +21081,11 @@ class CardContentComponent {
21025
21081
  }
21026
21082
  }
21027
21083
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
21028
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CardContentComponent, isStandalone: true, selector: "mt-card-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, headerConfig: { classPropertyName: "headerConfig", publicName: "headerConfig", isSignal: true, isRequired: false, transformFunction: null }, styleConfig: { classPropertyName: "styleConfig", publicName: "styleConfig", isSignal: true, isRequired: false, transformFunction: null }, cardStyleConfig: { classPropertyName: "cardStyleConfig", publicName: "cardStyleConfig", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, headerClickable: { classPropertyName: "headerClickable", publicName: "headerClickable", isSignal: true, isRequired: false, transformFunction: null }, isNoTopEnd: { classPropertyName: "isNoTopEnd", publicName: "isNoTopEnd", isSignal: true, isRequired: false, transformFunction: null }, isChart: { classPropertyName: "isChart", publicName: "isChart", isSignal: true, isRequired: false, transformFunction: null }, titleEditable: { classPropertyName: "titleEditable", publicName: "titleEditable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { headerClick: "headerClick", titleChange: "titleChange" }, ngImport: i0, template: "<div\r\n class=\"db-card-content\"\r\n [class.in-group]=\"inGroup()\"\r\n [class.no-header]=\"!showHeaderState()\"\r\n [attr.data-density]=\"density() || null\"\r\n [ngStyle]=\"cardStyles()\"\r\n [style]=\"borderRadiusStyle()\"\r\n>\r\n <!-- Header -->\r\n @if (showHeaderState()) {\r\n <div\r\n class=\"db-card-header\"\r\n [class.clickable]=\"headerClickableState()\"\r\n [class.center-title]=\"headerConfig()?.isHeaderCentered && isNoTopEnd()\"\r\n [ngStyle]=\"headerRowStyles()\"\r\n (click)=\"onHeaderClick()\"\r\n >\r\n <div\n class=\"db-card-title-section\"\n [class.center-mode]=\"headerConfig()?.isHeaderCentered\"\n [class.force-full-width]=\"isNoTopEnd()\"\n [attr.data-icon-placement]=\"headerConfig()?.iconPlacement || 'start'\"\n >\n @if (headerConfig()?.icon; as cardIcon) {\n @if (headerConfig()?.iconPlacement !== \"end\") {\n <span\n class=\"db-card-icon\"\n [style.color]=\"\n headerConfig()?.iconColor ||\n styleConfig()?.iconColor ||\n 'inherit'\n \"\n [style.background-color]=\"styleConfig()?.iconBgColor\"\n >\n <!-- @masterteam icon names are \"category.name\"; legacy values are\n CSS/font classes (e.g. \"fa fa-x\") rendered on an <i>. -->\n @if (cardIcon.includes(\".\")) {\n <mt-icon [icon]=\"$any(cardIcon)\" />\n } @else {\n <i [class]=\"cardIcon\"></i>\n }\n </span>\n }\n }\n <h3\r\n class=\"db-card-title\"\r\n [style.color]=\"\r\n headerConfig()?.headerColor ||\r\n headerConfig()?.titleColor ||\r\n 'inherit'\r\n \"\r\n [style.font-size]=\"\r\n headerConfig()?.headerFontSize\r\n ? headerConfig()?.headerFontSize + 'px'\r\n : null\r\n \"\r\n [attr.title]=\"title()\"\r\n >\n {{ title() }}\n </h3>\n @if (headerConfig()?.icon; as cardIcon) {\n @if (headerConfig()?.iconPlacement === \"end\") {\n <span\n class=\"db-card-icon\"\n [style.color]=\"\n headerConfig()?.iconColor ||\n styleConfig()?.iconColor ||\n 'inherit'\n \"\n [style.background-color]=\"styleConfig()?.iconBgColor\"\n >\n @if (cardIcon.includes(\".\")) {\n <mt-icon [icon]=\"$any(cardIcon)\" />\n } @else {\n <i [class]=\"cardIcon\"></i>\n }\n </span>\n }\n }\n </div>\n\r\n <div class=\"db-card-top-end\">\r\n <ng-content select=\"[topEnd]\"></ng-content>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Body -->\r\n <div\r\n class=\"db-card-body\"\r\n [class.no-top-end]=\"isNoTopEnd()\"\r\n [class.is-chart]=\"isChart()\"\r\n [style.padding.px]=\"padding() ?? null\"\r\n >\r\n <ng-content select=\"[body]\"></ng-content>\r\n </div>\r\n\r\n <!-- Footer (optional) -->\r\n <div class=\"db-card-footer\">\r\n <ng-content select=\"[footer]\"></ng-content>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%}.db-card-content{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:.5rem;box-shadow:0 1px 3px #0000001a;overflow:hidden}.db-card-content.in-group{box-shadow:none;border-radius:0}.db-card-content.in-group.no-header .db-card-body{padding:0}.db-card-content.in-group .db-card-body.is-chart{overflow:hidden}.db-card-content.no-header .db-card-body{padding-top:1rem}.db-card-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid #f0f0f0;min-height:3rem}.db-card-header.clickable{cursor:pointer;transition:background-color .15s ease}.db-card-header.clickable:hover{background-color:#f9f9f9}.db-card-title-section{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.db-card-title-section[data-icon-placement=end]{flex-direction:row}.db-card-title-section[data-icon-placement=top]{flex-direction:column;align-items:flex-start;gap:.25rem}.db-card-title-section.center-mode{justify-content:center}.db-card-title-section.center-mode[data-icon-placement=top]{align-items:center}.db-card-title-section.force-full-width{width:100%}.db-card-header.center-title{justify-content:center}.db-card-icon{font-size:1.25rem;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:1.5rem;min-height:1.5rem;border-radius:.375rem}.db-card-title{margin:0;font-size:.95rem;font-weight:600;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.db-card-top-end{display:flex;align-items:center;gap:.5rem;flex-shrink:0;max-width:45%}.db-card-body{flex:1;padding:.75rem 1rem;overflow:auto;min-height:0}.db-card-body.is-chart{overflow-y:hidden}.db-card-body.no-top-end{padding-top:1rem}.db-card-footer:empty{display:none}.db-card-footer{padding:.5rem 1rem;border-top:1px solid #f0f0f0}.db-card-content[data-density=compact] .db-card-header{padding:.4rem .6rem;min-height:2.25rem}.db-card-content[data-density=compact] .db-card-body{padding:.4rem .6rem}.db-card-content[data-density=compact] .db-card-title{font-size:.85rem}.db-card-content[data-density=presentation] .db-card-header{padding:1.1rem 1.4rem;min-height:4rem}.db-card-content[data-density=presentation] .db-card-body{padding:1.1rem 1.4rem}.db-card-content[data-density=presentation] .db-card-title{font-size:1.15rem;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
21084
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CardContentComponent, isStandalone: true, selector: "mt-card-content", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, headerConfig: { classPropertyName: "headerConfig", publicName: "headerConfig", isSignal: true, isRequired: false, transformFunction: null }, styleConfig: { classPropertyName: "styleConfig", publicName: "styleConfig", isSignal: true, isRequired: false, transformFunction: null }, cardStyleConfig: { classPropertyName: "cardStyleConfig", publicName: "cardStyleConfig", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, headerClickable: { classPropertyName: "headerClickable", publicName: "headerClickable", isSignal: true, isRequired: false, transformFunction: null }, isNoTopEnd: { classPropertyName: "isNoTopEnd", publicName: "isNoTopEnd", isSignal: true, isRequired: false, transformFunction: null }, isChart: { classPropertyName: "isChart", publicName: "isChart", isSignal: true, isRequired: false, transformFunction: null }, titleEditable: { classPropertyName: "titleEditable", publicName: "titleEditable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { headerClick: "headerClick", titleChange: "titleChange" }, ngImport: i0, template: "<div\r\n class=\"db-card-content\"\r\n [class.in-group]=\"inGroup()\"\r\n [class.no-header]=\"!showHeaderState()\"\r\n [attr.data-density]=\"density() || null\"\r\n [ngStyle]=\"cardStyles()\"\r\n [style]=\"borderRadiusStyle()\"\r\n>\r\n <!-- Header -->\r\n @if (showHeaderState()) {\r\n <div\r\n class=\"db-card-header\"\r\n [class.clickable]=\"headerClickableState()\"\r\n [class.center-title]=\"headerConfig()?.isHeaderCentered && isNoTopEnd()\"\r\n [ngStyle]=\"headerRowStyles()\"\r\n (click)=\"onHeaderClick()\"\r\n >\r\n <div\r\n class=\"db-card-title-section\"\r\n [class.center-mode]=\"headerConfig()?.isHeaderCentered\"\r\n [class.force-full-width]=\"isNoTopEnd()\"\r\n [attr.data-icon-placement]=\"headerConfig()?.iconPlacement || 'start'\"\r\n >\r\n @if (headerConfig()?.icon; as cardIcon) {\r\n @if (headerConfig()?.iconPlacement !== \"end\") {\r\n <span\r\n class=\"db-card-icon\"\r\n [style.color]=\"\r\n headerConfig()?.iconColor ||\r\n styleConfig()?.iconColor ||\r\n 'inherit'\r\n \"\r\n [style.background-color]=\"styleConfig()?.iconBgColor\"\r\n >\r\n <!-- @masterteam icon names are \"category.name\"; legacy values are\r\n CSS/font classes (e.g. \"fa fa-x\") rendered on an <i>. -->\r\n @if (cardIcon.includes(\".\")) {\r\n <mt-icon [icon]=\"$any(cardIcon)\" />\r\n } @else {\r\n <i [class]=\"cardIcon\"></i>\r\n }\r\n </span>\r\n }\r\n }\r\n <h3\r\n class=\"db-card-title\"\r\n [style.color]=\"\r\n headerConfig()?.headerColor ||\r\n headerConfig()?.titleColor ||\r\n 'inherit'\r\n \"\r\n [style.font-size]=\"\r\n headerConfig()?.headerFontSize\r\n ? headerConfig()?.headerFontSize + 'px'\r\n : null\r\n \"\r\n [attr.title]=\"title()\"\r\n >\r\n {{ title() }}\r\n </h3>\r\n @if (headerConfig()?.icon; as cardIcon) {\r\n @if (headerConfig()?.iconPlacement === \"end\") {\r\n <span\r\n class=\"db-card-icon\"\r\n [style.color]=\"\r\n headerConfig()?.iconColor ||\r\n styleConfig()?.iconColor ||\r\n 'inherit'\r\n \"\r\n [style.background-color]=\"styleConfig()?.iconBgColor\"\r\n >\r\n @if (cardIcon.includes(\".\")) {\r\n <mt-icon [icon]=\"$any(cardIcon)\" />\r\n } @else {\r\n <i [class]=\"cardIcon\"></i>\r\n }\r\n </span>\r\n }\r\n }\r\n </div>\r\n\r\n <div class=\"db-card-top-end\">\r\n <ng-content select=\"[topEnd]\"></ng-content>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Body -->\r\n <div\r\n class=\"db-card-body\"\r\n [class.no-top-end]=\"isNoTopEnd()\"\r\n [class.is-chart]=\"isChart()\"\r\n [style.padding.px]=\"padding() ?? null\"\r\n >\r\n <ng-content select=\"[body]\"></ng-content>\r\n </div>\r\n\r\n <!-- Footer (optional) -->\r\n <div class=\"db-card-footer\">\r\n <ng-content select=\"[footer]\"></ng-content>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%}.db-card-content{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:.5rem;box-shadow:0 1px 3px #0000001a;overflow:hidden}.db-card-content.in-group{box-shadow:none;border-radius:0}.db-card-content.in-group.no-header .db-card-body{padding:0}.db-card-content.in-group .db-card-body.is-chart{overflow:hidden}.db-card-content.no-header .db-card-body{padding-top:1rem}.db-card-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid #f0f0f0;min-height:3rem}.db-card-header.clickable{cursor:pointer;transition:background-color .15s ease}.db-card-header.clickable:hover{background-color:#f9f9f9}.db-card-title-section{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.db-card-title-section[data-icon-placement=end]{flex-direction:row}.db-card-title-section[data-icon-placement=top]{flex-direction:column;align-items:flex-start;gap:.25rem}.db-card-title-section.center-mode{justify-content:center}.db-card-title-section.center-mode[data-icon-placement=top]{align-items:center}.db-card-title-section.force-full-width{width:100%}.db-card-header.center-title{justify-content:center}.db-card-icon{font-size:1.25rem;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:1.5rem;min-height:1.5rem;border-radius:.375rem}.db-card-title{margin:0;font-size:.95rem;font-weight:600;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.db-card-top-end{display:flex;align-items:center;gap:.5rem;flex-shrink:0;max-width:45%}.db-card-body{flex:1;padding:.75rem 1rem;overflow:auto;min-height:0}.db-card-body.is-chart{overflow-y:hidden}.db-card-body.no-top-end{padding-top:1rem}.db-card-footer:empty{display:none}.db-card-footer{padding:.5rem 1rem;border-top:1px solid #f0f0f0}.db-card-content[data-density=compact] .db-card-header{padding:.4rem .6rem;min-height:2.25rem}.db-card-content[data-density=compact] .db-card-body{padding:.4rem .6rem}.db-card-content[data-density=compact] .db-card-title{font-size:.85rem}.db-card-content[data-density=presentation] .db-card-header{padding:1.1rem 1.4rem;min-height:4rem}.db-card-content[data-density=presentation] .db-card-body{padding:1.1rem 1.4rem}.db-card-content[data-density=presentation] .db-card-title{font-size:1.15rem;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
21029
21085
  }
21030
21086
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardContentComponent, decorators: [{
21031
21087
  type: Component,
21032
- args: [{ selector: 'mt-card-content', standalone: true, imports: [CommonModule, Icon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"db-card-content\"\r\n [class.in-group]=\"inGroup()\"\r\n [class.no-header]=\"!showHeaderState()\"\r\n [attr.data-density]=\"density() || null\"\r\n [ngStyle]=\"cardStyles()\"\r\n [style]=\"borderRadiusStyle()\"\r\n>\r\n <!-- Header -->\r\n @if (showHeaderState()) {\r\n <div\r\n class=\"db-card-header\"\r\n [class.clickable]=\"headerClickableState()\"\r\n [class.center-title]=\"headerConfig()?.isHeaderCentered && isNoTopEnd()\"\r\n [ngStyle]=\"headerRowStyles()\"\r\n (click)=\"onHeaderClick()\"\r\n >\r\n <div\n class=\"db-card-title-section\"\n [class.center-mode]=\"headerConfig()?.isHeaderCentered\"\n [class.force-full-width]=\"isNoTopEnd()\"\n [attr.data-icon-placement]=\"headerConfig()?.iconPlacement || 'start'\"\n >\n @if (headerConfig()?.icon; as cardIcon) {\n @if (headerConfig()?.iconPlacement !== \"end\") {\n <span\n class=\"db-card-icon\"\n [style.color]=\"\n headerConfig()?.iconColor ||\n styleConfig()?.iconColor ||\n 'inherit'\n \"\n [style.background-color]=\"styleConfig()?.iconBgColor\"\n >\n <!-- @masterteam icon names are \"category.name\"; legacy values are\n CSS/font classes (e.g. \"fa fa-x\") rendered on an <i>. -->\n @if (cardIcon.includes(\".\")) {\n <mt-icon [icon]=\"$any(cardIcon)\" />\n } @else {\n <i [class]=\"cardIcon\"></i>\n }\n </span>\n }\n }\n <h3\r\n class=\"db-card-title\"\r\n [style.color]=\"\r\n headerConfig()?.headerColor ||\r\n headerConfig()?.titleColor ||\r\n 'inherit'\r\n \"\r\n [style.font-size]=\"\r\n headerConfig()?.headerFontSize\r\n ? headerConfig()?.headerFontSize + 'px'\r\n : null\r\n \"\r\n [attr.title]=\"title()\"\r\n >\n {{ title() }}\n </h3>\n @if (headerConfig()?.icon; as cardIcon) {\n @if (headerConfig()?.iconPlacement === \"end\") {\n <span\n class=\"db-card-icon\"\n [style.color]=\"\n headerConfig()?.iconColor ||\n styleConfig()?.iconColor ||\n 'inherit'\n \"\n [style.background-color]=\"styleConfig()?.iconBgColor\"\n >\n @if (cardIcon.includes(\".\")) {\n <mt-icon [icon]=\"$any(cardIcon)\" />\n } @else {\n <i [class]=\"cardIcon\"></i>\n }\n </span>\n }\n }\n </div>\n\r\n <div class=\"db-card-top-end\">\r\n <ng-content select=\"[topEnd]\"></ng-content>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Body -->\r\n <div\r\n class=\"db-card-body\"\r\n [class.no-top-end]=\"isNoTopEnd()\"\r\n [class.is-chart]=\"isChart()\"\r\n [style.padding.px]=\"padding() ?? null\"\r\n >\r\n <ng-content select=\"[body]\"></ng-content>\r\n </div>\r\n\r\n <!-- Footer (optional) -->\r\n <div class=\"db-card-footer\">\r\n <ng-content select=\"[footer]\"></ng-content>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%}.db-card-content{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:.5rem;box-shadow:0 1px 3px #0000001a;overflow:hidden}.db-card-content.in-group{box-shadow:none;border-radius:0}.db-card-content.in-group.no-header .db-card-body{padding:0}.db-card-content.in-group .db-card-body.is-chart{overflow:hidden}.db-card-content.no-header .db-card-body{padding-top:1rem}.db-card-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid #f0f0f0;min-height:3rem}.db-card-header.clickable{cursor:pointer;transition:background-color .15s ease}.db-card-header.clickable:hover{background-color:#f9f9f9}.db-card-title-section{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.db-card-title-section[data-icon-placement=end]{flex-direction:row}.db-card-title-section[data-icon-placement=top]{flex-direction:column;align-items:flex-start;gap:.25rem}.db-card-title-section.center-mode{justify-content:center}.db-card-title-section.center-mode[data-icon-placement=top]{align-items:center}.db-card-title-section.force-full-width{width:100%}.db-card-header.center-title{justify-content:center}.db-card-icon{font-size:1.25rem;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:1.5rem;min-height:1.5rem;border-radius:.375rem}.db-card-title{margin:0;font-size:.95rem;font-weight:600;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.db-card-top-end{display:flex;align-items:center;gap:.5rem;flex-shrink:0;max-width:45%}.db-card-body{flex:1;padding:.75rem 1rem;overflow:auto;min-height:0}.db-card-body.is-chart{overflow-y:hidden}.db-card-body.no-top-end{padding-top:1rem}.db-card-footer:empty{display:none}.db-card-footer{padding:.5rem 1rem;border-top:1px solid #f0f0f0}.db-card-content[data-density=compact] .db-card-header{padding:.4rem .6rem;min-height:2.25rem}.db-card-content[data-density=compact] .db-card-body{padding:.4rem .6rem}.db-card-content[data-density=compact] .db-card-title{font-size:.85rem}.db-card-content[data-density=presentation] .db-card-header{padding:1.1rem 1.4rem;min-height:4rem}.db-card-content[data-density=presentation] .db-card-body{padding:1.1rem 1.4rem}.db-card-content[data-density=presentation] .db-card-title{font-size:1.15rem;font-weight:700}\n"] }]
21088
+ args: [{ selector: 'mt-card-content', standalone: true, imports: [CommonModule, Icon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"db-card-content\"\r\n [class.in-group]=\"inGroup()\"\r\n [class.no-header]=\"!showHeaderState()\"\r\n [attr.data-density]=\"density() || null\"\r\n [ngStyle]=\"cardStyles()\"\r\n [style]=\"borderRadiusStyle()\"\r\n>\r\n <!-- Header -->\r\n @if (showHeaderState()) {\r\n <div\r\n class=\"db-card-header\"\r\n [class.clickable]=\"headerClickableState()\"\r\n [class.center-title]=\"headerConfig()?.isHeaderCentered && isNoTopEnd()\"\r\n [ngStyle]=\"headerRowStyles()\"\r\n (click)=\"onHeaderClick()\"\r\n >\r\n <div\r\n class=\"db-card-title-section\"\r\n [class.center-mode]=\"headerConfig()?.isHeaderCentered\"\r\n [class.force-full-width]=\"isNoTopEnd()\"\r\n [attr.data-icon-placement]=\"headerConfig()?.iconPlacement || 'start'\"\r\n >\r\n @if (headerConfig()?.icon; as cardIcon) {\r\n @if (headerConfig()?.iconPlacement !== \"end\") {\r\n <span\r\n class=\"db-card-icon\"\r\n [style.color]=\"\r\n headerConfig()?.iconColor ||\r\n styleConfig()?.iconColor ||\r\n 'inherit'\r\n \"\r\n [style.background-color]=\"styleConfig()?.iconBgColor\"\r\n >\r\n <!-- @masterteam icon names are \"category.name\"; legacy values are\r\n CSS/font classes (e.g. \"fa fa-x\") rendered on an <i>. -->\r\n @if (cardIcon.includes(\".\")) {\r\n <mt-icon [icon]=\"$any(cardIcon)\" />\r\n } @else {\r\n <i [class]=\"cardIcon\"></i>\r\n }\r\n </span>\r\n }\r\n }\r\n <h3\r\n class=\"db-card-title\"\r\n [style.color]=\"\r\n headerConfig()?.headerColor ||\r\n headerConfig()?.titleColor ||\r\n 'inherit'\r\n \"\r\n [style.font-size]=\"\r\n headerConfig()?.headerFontSize\r\n ? headerConfig()?.headerFontSize + 'px'\r\n : null\r\n \"\r\n [attr.title]=\"title()\"\r\n >\r\n {{ title() }}\r\n </h3>\r\n @if (headerConfig()?.icon; as cardIcon) {\r\n @if (headerConfig()?.iconPlacement === \"end\") {\r\n <span\r\n class=\"db-card-icon\"\r\n [style.color]=\"\r\n headerConfig()?.iconColor ||\r\n styleConfig()?.iconColor ||\r\n 'inherit'\r\n \"\r\n [style.background-color]=\"styleConfig()?.iconBgColor\"\r\n >\r\n @if (cardIcon.includes(\".\")) {\r\n <mt-icon [icon]=\"$any(cardIcon)\" />\r\n } @else {\r\n <i [class]=\"cardIcon\"></i>\r\n }\r\n </span>\r\n }\r\n }\r\n </div>\r\n\r\n <div class=\"db-card-top-end\">\r\n <ng-content select=\"[topEnd]\"></ng-content>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Body -->\r\n <div\r\n class=\"db-card-body\"\r\n [class.no-top-end]=\"isNoTopEnd()\"\r\n [class.is-chart]=\"isChart()\"\r\n [style.padding.px]=\"padding() ?? null\"\r\n >\r\n <ng-content select=\"[body]\"></ng-content>\r\n </div>\r\n\r\n <!-- Footer (optional) -->\r\n <div class=\"db-card-footer\">\r\n <ng-content select=\"[footer]\"></ng-content>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%}.db-card-content{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:.5rem;box-shadow:0 1px 3px #0000001a;overflow:hidden}.db-card-content.in-group{box-shadow:none;border-radius:0}.db-card-content.in-group.no-header .db-card-body{padding:0}.db-card-content.in-group .db-card-body.is-chart{overflow:hidden}.db-card-content.no-header .db-card-body{padding-top:1rem}.db-card-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid #f0f0f0;min-height:3rem}.db-card-header.clickable{cursor:pointer;transition:background-color .15s ease}.db-card-header.clickable:hover{background-color:#f9f9f9}.db-card-title-section{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.db-card-title-section[data-icon-placement=end]{flex-direction:row}.db-card-title-section[data-icon-placement=top]{flex-direction:column;align-items:flex-start;gap:.25rem}.db-card-title-section.center-mode{justify-content:center}.db-card-title-section.center-mode[data-icon-placement=top]{align-items:center}.db-card-title-section.force-full-width{width:100%}.db-card-header.center-title{justify-content:center}.db-card-icon{font-size:1.25rem;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:1.5rem;min-height:1.5rem;border-radius:.375rem}.db-card-title{margin:0;font-size:.95rem;font-weight:600;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.db-card-top-end{display:flex;align-items:center;gap:.5rem;flex-shrink:0;max-width:45%}.db-card-body{flex:1;padding:.75rem 1rem;overflow:auto;min-height:0}.db-card-body.is-chart{overflow-y:hidden}.db-card-body.no-top-end{padding-top:1rem}.db-card-footer:empty{display:none}.db-card-footer{padding:.5rem 1rem;border-top:1px solid #f0f0f0}.db-card-content[data-density=compact] .db-card-header{padding:.4rem .6rem;min-height:2.25rem}.db-card-content[data-density=compact] .db-card-body{padding:.4rem .6rem}.db-card-content[data-density=compact] .db-card-title{font-size:.85rem}.db-card-content[data-density=presentation] .db-card-header{padding:1.1rem 1.4rem;min-height:4rem}.db-card-content[data-density=presentation] .db-card-body{padding:1.1rem 1.4rem}.db-card-content[data-density=presentation] .db-card-title{font-size:1.15rem;font-weight:700}\n"] }]
21033
21089
  }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], headerConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerConfig", required: false }] }], styleConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleConfig", required: false }] }], cardStyleConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardStyleConfig", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], headerClickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerClickable", required: false }] }], isNoTopEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "isNoTopEnd", required: false }] }], isChart: [{ type: i0.Input, args: [{ isSignal: true, alias: "isChart", required: false }] }], headerClick: [{ type: i0.Output, args: ["headerClick"] }], titleEditable: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleEditable", required: false }] }], titleChange: [{ type: i0.Output, args: ["titleChange"] }] } });
21034
21090
 
21035
21091
  /**
@@ -23109,19 +23165,33 @@ class EChartComponent {
23109
23165
  }
23110
23166
  const configuredLegendSide = this.resolveConfiguredLegendSide();
23111
23167
  let legendSide = this.resolveEffectiveLegendSide(configuredLegendSide, this.resolveLegendSide(next.legend));
23112
- if (next.legend && legendSide) {
23113
- next.legend = this.mapLegendConfig(next.legend, configuredLegendSide, legendSide, (legend, side) => this.applyLegendSideCoordinates(legend, side, false));
23168
+ const initialLegendSide = legendSide ?? (this.hasVisibleLegend(next.legend) ? 'bottom' : null);
23169
+ if (next.legend && initialLegendSide) {
23170
+ next.legend = this.mapLegendConfig(next.legend, configuredLegendSide, initialLegendSide, (legend, side) => this.applyLegendSideCoordinates(legend, side, false));
23114
23171
  }
23115
23172
  if (!bounds)
23116
23173
  return next;
23117
23174
  const width = bounds.width || 0;
23118
23175
  const height = bounds.height || 0;
23176
+ if (width <= 0 || height <= 0)
23177
+ return next;
23119
23178
  const compact = width < 420 || height < 260;
23120
23179
  const veryCompact = width < 320 || height < 220;
23121
23180
  legendSide = this.resolveEffectiveLegendSide(configuredLegendSide, this.resolveLegendSide(next.legend));
23122
23181
  const hasVisibleLegend = this.hasVisibleLegend(next.legend);
23123
23182
  const fontFamily = this.resolveChartFontFamily();
23124
23183
  const fontSizes = this.resolveChartFontSizes();
23184
+ if (next.legend) {
23185
+ const legends = Array.isArray(next.legend) ? next.legend : [next.legend];
23186
+ const mappedLegends = legends.map((legend) => this.applyResponsiveLegend(legend, this.resolveEffectiveLegendSide(configuredLegendSide, this.resolveLegendSide(legend)) ??
23187
+ legendSide ??
23188
+ 'bottom', width, height, compact, veryCompact));
23189
+ next.legend = Array.isArray(next.legend)
23190
+ ? mappedLegends
23191
+ : mappedLegends[0];
23192
+ legendSide =
23193
+ this.resolveEffectiveLegendSide(configuredLegendSide, this.resolveLegendSide(next.legend)) ?? (hasVisibleLegend ? 'bottom' : null);
23194
+ }
23125
23195
  if (next.tooltip) {
23126
23196
  next.tooltip = {
23127
23197
  ...next.tooltip,
@@ -23133,16 +23203,7 @@ class EChartComponent {
23133
23203
  };
23134
23204
  }
23135
23205
  if (next.grid || next.xAxis || next.yAxis) {
23136
- next.grid = this.applyResponsiveGrid(Array.isArray(next.grid) ? next.grid[0] : next.grid || {}, hasVisibleLegend ? legendSide : null, compact);
23137
- }
23138
- if (next.legend) {
23139
- const legends = Array.isArray(next.legend) ? next.legend : [next.legend];
23140
- const mappedLegends = legends.map((legend) => this.applyResponsiveLegend(legend, this.resolveEffectiveLegendSide(configuredLegendSide, this.resolveLegendSide(legend)) ??
23141
- legendSide ??
23142
- 'bottom', width, height, compact, veryCompact));
23143
- next.legend = Array.isArray(next.legend)
23144
- ? mappedLegends
23145
- : mappedLegends[0];
23206
+ next.grid = this.applyResponsiveGrid(Array.isArray(next.grid) ? next.grid[0] : next.grid || {}, hasVisibleLegend ? legendSide : null, compact, next.legend, width, height);
23146
23207
  }
23147
23208
  const xAxes = Array.isArray(next.xAxis)
23148
23209
  ? next.xAxis
@@ -23242,13 +23303,13 @@ class EChartComponent {
23242
23303
  }
23243
23304
  return next;
23244
23305
  }
23245
- applyResponsiveGrid(baseGrid, legendSide, compact) {
23306
+ applyResponsiveGrid(baseGrid, legendSide, compact, legendConfig, width, height) {
23246
23307
  const grid = {
23247
23308
  ...(baseGrid || {}),
23248
23309
  containLabel: true,
23249
23310
  };
23250
23311
  const hasBaseGrid = Object.keys(baseGrid || {}).length > 0;
23251
- const offsets = this.getResponsiveGridOffsets(legendSide, compact);
23312
+ const offsets = this.getResponsiveGridOffsets(legendSide, compact, legendConfig, width, height);
23252
23313
  if (!hasBaseGrid) {
23253
23314
  return {
23254
23315
  ...grid,
@@ -23256,26 +23317,22 @@ class EChartComponent {
23256
23317
  };
23257
23318
  }
23258
23319
  if (legendSide) {
23259
- this.ensureGridSide(grid, legendSide, offsets[legendSide]);
23320
+ this.ensureGridSide(grid, legendSide, offsets[legendSide], width, height);
23260
23321
  }
23261
23322
  return grid;
23262
23323
  }
23263
- ensureGridSide(grid, side, minimum) {
23324
+ ensureGridSide(grid, side, minimum, width, height) {
23264
23325
  const value = grid?.[side];
23265
23326
  if (value === undefined || value === null || value === '') {
23266
23327
  grid[side] = minimum;
23267
23328
  return;
23268
23329
  }
23269
- if (typeof value === 'number' && value < minimum) {
23330
+ const measured = this.readDimensionValue(value, side === 'top' || side === 'bottom' ? height : width);
23331
+ if (measured !== null && measured < minimum) {
23270
23332
  grid[side] = minimum;
23271
23333
  return;
23272
23334
  }
23273
23335
  if (typeof value === 'string') {
23274
- const pxMatch = value.trim().match(/^(\d+(?:\.\d+)?)px$/);
23275
- if (pxMatch && Number(pxMatch[1]) < minimum) {
23276
- grid[side] = minimum;
23277
- return;
23278
- }
23279
23336
  const percentMatch = value.trim().match(/^(\d+(?:\.\d+)?)%$/);
23280
23337
  if (percentMatch && Number(percentMatch[1]) < 10) {
23281
23338
  grid[side] = minimum;
@@ -23412,30 +23469,102 @@ class EChartComponent {
23412
23469
  isCenteredLegendCoordinate(value) {
23413
23470
  return value === 'center' || value === 'middle';
23414
23471
  }
23415
- getResponsiveGridOffsets(legendSide, compact) {
23472
+ getLegendReservedSpace(legendConfig, side, compact, width, height) {
23473
+ if (!side || !legendConfig)
23474
+ return null;
23475
+ const legend = this.getLegendForSide(legendConfig, side);
23476
+ if (!legend)
23477
+ return null;
23478
+ const horizontal = side === 'top' || side === 'bottom';
23479
+ const base = horizontal ? height : width;
23480
+ const coordinate = this.readDimensionValue(legend?.[side], base) ?? (compact ? 0 : 4);
23481
+ if (horizontal) {
23482
+ const legendHeight = this.readDimensionValue(legend?.height, height) ??
23483
+ this.getHorizontalLegendHeight(legend, compact, false, height);
23484
+ const lineHeight = this.readDimensionValue(legend?.textStyle?.lineHeight, height) ??
23485
+ (compact ? 13 : 15);
23486
+ const itemHeight = this.readDimensionValue(legend?.itemHeight, height) ??
23487
+ (compact ? 8 : 14);
23488
+ const pageIconSize = this.readDimensionValue(legend?.pageIconSize, height) ??
23489
+ (compact ? 10 : 12);
23490
+ const renderedHeight = Math.max(legendHeight, lineHeight + 8, itemHeight + 12, pageIconSize + 12);
23491
+ return Math.ceil(coordinate + renderedHeight + (compact ? 8 : 12));
23492
+ }
23493
+ const legendWidth = this.readDimensionValue(legend?.width, width) ??
23494
+ this.getResponsiveSideLegendWidth(width, compact);
23495
+ const textWidth = this.readDimensionValue(legend?.textStyle?.width, width) ??
23496
+ (compact ? 96 : 140);
23497
+ const itemWidth = this.readDimensionValue(legend?.itemWidth, width) ?? (compact ? 10 : 14);
23498
+ const itemGap = this.readDimensionValue(legend?.itemGap, width) ?? (compact ? 8 : 12);
23499
+ const renderedWidth = Math.max(legendWidth, textWidth + itemWidth + itemGap + (compact ? 16 : 20));
23500
+ return Math.ceil(coordinate + renderedWidth + (compact ? 8 : 12));
23501
+ }
23502
+ getLegendForSide(legendConfig, side) {
23503
+ const legends = Array.isArray(legendConfig) ? legendConfig : [legendConfig];
23504
+ return (legends.find((legend) => legend &&
23505
+ legend.show !== false &&
23506
+ (this.resolveSingleLegendSide(legend) ?? side) === side) ??
23507
+ legends.find((legend) => legend && legend.show !== false) ??
23508
+ null);
23509
+ }
23510
+ readDimensionValue(value, percentBase) {
23511
+ if (typeof value === 'number') {
23512
+ return Number.isFinite(value) ? Math.max(0, value) : null;
23513
+ }
23514
+ if (typeof value !== 'string')
23515
+ return null;
23516
+ const trimmed = value.trim();
23517
+ if (!trimmed)
23518
+ return null;
23519
+ const pxMatch = trimmed.match(/^(\d+(?:\.\d+)?)px$/);
23520
+ if (pxMatch)
23521
+ return Number(pxMatch[1]);
23522
+ const percentMatch = trimmed.match(/^(\d+(?:\.\d+)?)%$/);
23523
+ if (percentMatch && percentBase && percentBase > 0) {
23524
+ return (Number(percentMatch[1]) / 100) * percentBase;
23525
+ }
23526
+ const numeric = Number(trimmed);
23527
+ return Number.isFinite(numeric) ? Math.max(0, numeric) : null;
23528
+ }
23529
+ getResponsiveSideLegendWidth(width, compact) {
23530
+ const preferred = compact ? 120 : 160;
23531
+ const maxByChart = Math.max(88, Math.floor(width * (compact ? 0.42 : 0.34)));
23532
+ return Math.max(88, Math.min(preferred, maxByChart));
23533
+ }
23534
+ getHorizontalLegendHeight(legend, compact, veryCompact, height) {
23535
+ const configured = this.readDimensionValue(legend?.height, height);
23536
+ const minimum = veryCompact ? 30 : compact ? 34 : 40;
23537
+ return Math.max(minimum, configured ?? 0);
23538
+ }
23539
+ getResponsiveGridOffsets(legendSide, compact, legendConfig, width, height) {
23540
+ const legendReserve = this.getLegendReservedSpace(legendConfig, legendSide, compact, width, height);
23416
23541
  const offsets = {
23417
23542
  top: compact ? 24 : 36,
23418
23543
  right: compact ? 8 : 24,
23419
- bottom: compact ? 44 : 56,
23544
+ bottom: legendSide === 'bottom'
23545
+ ? Math.max(compact ? 44 : 56, legendReserve ?? 0)
23546
+ : compact
23547
+ ? 44
23548
+ : 56,
23420
23549
  left: compact ? 8 : 24,
23421
23550
  };
23422
23551
  switch (legendSide) {
23423
23552
  case 'top':
23424
23553
  return {
23425
23554
  ...offsets,
23426
- top: compact ? 44 : 56,
23555
+ top: Math.max(compact ? 44 : 56, legendReserve ?? 0),
23427
23556
  bottom: compact ? 28 : 36,
23428
23557
  };
23429
23558
  case 'left':
23430
23559
  return {
23431
23560
  ...offsets,
23432
- left: compact ? 64 : 96,
23561
+ left: Math.max(compact ? 96 : 128, legendReserve ?? 0),
23433
23562
  bottom: compact ? 28 : 36,
23434
23563
  };
23435
23564
  case 'right':
23436
23565
  return {
23437
23566
  ...offsets,
23438
- right: compact ? 64 : 96,
23567
+ right: Math.max(compact ? 96 : 128, legendReserve ?? 0),
23439
23568
  bottom: compact ? 28 : 36,
23440
23569
  };
23441
23570
  case 'bottom':
@@ -23445,22 +23574,30 @@ class EChartComponent {
23445
23574
  }
23446
23575
  applyResponsiveLegend(legend, side, width, height, compact, veryCompact) {
23447
23576
  const horizontal = side === 'top' || side === 'bottom';
23448
- const availableWidth = Math.max(160, width - (compact ? 16 : 32));
23577
+ const availableWidth = Math.max(64, width - (compact ? 16 : 32));
23578
+ const sideLegendWidth = this.getResponsiveSideLegendWidth(width, compact);
23579
+ const itemWidth = compact
23580
+ ? 10
23581
+ : (this.readDimensionValue(legend?.itemWidth, width) ?? 14);
23582
+ const itemGap = compact
23583
+ ? 8
23584
+ : (this.readDimensionValue(legend?.itemGap, width) ?? 12);
23585
+ const horizontalHeight = this.getHorizontalLegendHeight(legend, compact, veryCompact, height);
23449
23586
  const verticalHeight = Math.max(120, height - (compact ? 24 : 48));
23450
23587
  const fontFamily = this.resolveChartFontFamily();
23451
23588
  const fontSizes = this.resolveChartFontSizes();
23452
23589
  const next = this.applyLegendSideCoordinates({
23453
23590
  ...legend,
23454
23591
  type: horizontal || compact ? 'scroll' : legend?.type,
23455
- width: horizontal ? availableWidth : legend?.width,
23592
+ width: horizontal ? availableWidth : (legend?.width ?? sideLegendWidth),
23456
23593
  height: horizontal
23457
- ? (legend?.height ?? (compact ? 28 : 36))
23594
+ ? horizontalHeight
23458
23595
  : (legend?.height ?? verticalHeight),
23459
- itemGap: compact ? 8 : (legend?.itemGap ?? 12),
23460
- itemWidth: compact ? 10 : legend?.itemWidth,
23596
+ itemGap,
23597
+ itemWidth,
23461
23598
  itemHeight: compact ? 8 : legend?.itemHeight,
23462
23599
  pageButtonPosition: horizontal ? 'end' : legend?.pageButtonPosition,
23463
- pageIconSize: compact ? 10 : legend?.pageIconSize,
23600
+ pageIconSize: compact ? 10 : (legend?.pageIconSize ?? 12),
23464
23601
  textStyle: {
23465
23602
  ...(legend?.textStyle || {}),
23466
23603
  fontSize: veryCompact
@@ -23474,8 +23611,9 @@ class EChartComponent {
23474
23611
  width: horizontal
23475
23612
  ? undefined
23476
23613
  : compact
23477
- ? 120
23478
- : (legend?.textStyle?.width ?? 140),
23614
+ ? Math.max(72, sideLegendWidth - itemWidth - itemGap - 16)
23615
+ : (legend?.textStyle?.width ??
23616
+ Math.max(96, sideLegendWidth - itemWidth - itemGap - 20)),
23479
23617
  },
23480
23618
  }, side, compact);
23481
23619
  return next;
@@ -31628,7 +31766,9 @@ class StringArrayInput {
31628
31766
  return this.options()
31629
31767
  .map((g) => ({
31630
31768
  ...g,
31631
- [childrenKey]: (g?.[childrenKey] ?? []).filter((item) => !selected.has(item?.[valueKey])).map((item) => this.withResolvedOptionLabel(item)),
31769
+ [childrenKey]: (g?.[childrenKey] ?? [])
31770
+ .filter((item) => !selected.has(item?.[valueKey]))
31771
+ .map((item) => this.withResolvedOptionLabel(item)),
31632
31772
  }))
31633
31773
  .filter((g) => (g?.[childrenKey] ?? []).length > 0);
31634
31774
  }
@@ -31760,7 +31900,7 @@ class StringArrayInput {
31760
31900
  useExisting: forwardRef(() => StringArrayInput),
31761
31901
  multi: true,
31762
31902
  },
31763
- ], ngImport: i0, template: "<div\r\n class=\"mt-string-array-input flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @if (label()) {\r\n <label class=\"text-sm font-medium text-surface-700\">{{ label() }}</label>\r\n }\r\n\r\n <!-- Add picker: selecting an option appends it and resets the field. -->\r\n <mt-select-field\r\n [field]=\"false\"\n [options]=\"availableOptions()\"\n [group]=\"group()\"\n [optionLabel]=\"resolvedOptionLabelKey\"\n [optionValue]=\"optionValue()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [filter]=\"filter()\"\r\n [placeholder]=\"placeholder() || t('addProperty')\"\r\n [readonly]=\"disabled()\"\r\n [ngModel]=\"addSelectValue()\"\r\n (ngModelChange)=\"onAdd($event)\"\r\n />\r\n\r\n <!-- Selected values: inline chips, drag to reorder, \u00D7 to remove. -->\r\n @if (values().length) {\r\n <div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"grid grid-cols-4 gap-2\"\r\n >\r\n @for (key of values(); track key + $index; let i = $index) {\r\n <div\r\n cdkDrag\r\n [cdkDragDisabled]=\"disabled()\"\r\n class=\"mt-sai-chip group flex w-full items-center gap-1.5 rounded-md border border-surface-200 bg-surface-50 py-1 pl-2 pr-1 text-sm\"\r\n [class.cursor-grab]=\"!disabled()\"\r\n [pTooltip]=\"t('dragToReorder')\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"shrink-0 text-sm text-muted-color\"\r\n />\r\n\r\n <span\r\n class=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-surface-200 px-1 text-[10px] font-semibold text-muted-color\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n\r\n <span\r\n class=\"min-w-0 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getLabel(key) }}</span\r\n >\r\n\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-color transition-colors hover:bg-red-100 hover:text-red-600\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"t('remove')\"\r\n (click)=\"remove(i)\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-xs\" />\r\n </button>\r\n\r\n <!-- Lifted chip shown while dragging (matches the real chip). -->\r\n <div\r\n *cdkDragPreview\r\n class=\"inline-flex items-center gap-1.5 rounded-full border border-surface-300 bg-surface-0 py-1 pl-2 pr-3 text-sm font-medium text-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"text-sm text-muted-color\"\r\n />\r\n {{ getLabel(key) }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if (emptyHint()) {\r\n <p class=\"text-xs text-muted-color\">{{ emptyHint() }}</p>\r\n }\r\n</div>\r\n", styles: [".mt-string-array-input .cdk-drag-animating,.cdk-drop-list-dragging .mt-sai-chip{transition:none}.mt-string-array-input .cdk-drag-placeholder{border-style:dashed;border-color:var(--p-primary-400, #818cf8);background:var(--p-primary-50, #eef2ff)}.mt-string-array-input .cdk-drag-placeholder>*{visibility:hidden}.mt-string-array-input .cdk-drag-preview{box-shadow:0 10px 20px -8px #00000040,0 4px 8px -4px #00000026}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
31903
+ ], ngImport: i0, template: "<div\r\n class=\"mt-string-array-input flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @if (label()) {\r\n <label class=\"text-sm font-medium text-surface-700\">{{ label() }}</label>\r\n }\r\n\r\n <!-- Add picker: selecting an option appends it and resets the field. -->\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableOptions()\"\r\n [group]=\"group()\"\r\n [optionLabel]=\"resolvedOptionLabelKey\"\r\n [optionValue]=\"optionValue()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [filter]=\"filter()\"\r\n [placeholder]=\"placeholder() || t('addProperty')\"\r\n [readonly]=\"disabled()\"\r\n [ngModel]=\"addSelectValue()\"\r\n (ngModelChange)=\"onAdd($event)\"\r\n />\r\n\r\n <!-- Selected values: inline chips, drag to reorder, \u00D7 to remove. -->\r\n @if (values().length) {\r\n <div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"grid grid-cols-4 gap-2\"\r\n >\r\n @for (key of values(); track key + $index; let i = $index) {\r\n <div\r\n cdkDrag\r\n [cdkDragDisabled]=\"disabled()\"\r\n class=\"mt-sai-chip group flex w-full items-center gap-1.5 rounded-md border border-surface-200 bg-surface-50 py-1 pl-2 pr-1 text-sm\"\r\n [class.cursor-grab]=\"!disabled()\"\r\n [pTooltip]=\"t('dragToReorder')\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"shrink-0 text-sm text-muted-color\"\r\n />\r\n\r\n <span\r\n class=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-surface-200 px-1 text-[10px] font-semibold text-muted-color\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n\r\n <span\r\n class=\"min-w-0 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getLabel(key) }}</span\r\n >\r\n\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-color transition-colors hover:bg-red-100 hover:text-red-600\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"t('remove')\"\r\n (click)=\"remove(i)\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-xs\" />\r\n </button>\r\n\r\n <!-- Lifted chip shown while dragging (matches the real chip). -->\r\n <div\r\n *cdkDragPreview\r\n class=\"inline-flex items-center gap-1.5 rounded-full border border-surface-300 bg-surface-0 py-1 pl-2 pr-3 text-sm font-medium text-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"text-sm text-muted-color\"\r\n />\r\n {{ getLabel(key) }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if (emptyHint()) {\r\n <p class=\"text-xs text-muted-color\">{{ emptyHint() }}</p>\r\n }\r\n</div>\r\n", styles: [".mt-string-array-input .cdk-drag-animating,.cdk-drop-list-dragging .mt-sai-chip{transition:none}.mt-string-array-input .cdk-drag-placeholder{border-style:dashed;border-color:var(--p-primary-400, #818cf8);background:var(--p-primary-50, #eef2ff)}.mt-string-array-input .cdk-drag-placeholder>*{visibility:hidden}.mt-string-array-input .cdk-drag-preview{box-shadow:0 10px 20px -8px #00000040,0 4px 8px -4px #00000026}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragPreview, selector: "ng-template[cdkDragPreview]", inputs: ["data", "matchSize"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
31764
31904
  }
31765
31905
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StringArrayInput, decorators: [{
31766
31906
  type: Component,
@@ -31779,7 +31919,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
31779
31919
  useExisting: forwardRef(() => StringArrayInput),
31780
31920
  multi: true,
31781
31921
  },
31782
- ], template: "<div\r\n class=\"mt-string-array-input flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @if (label()) {\r\n <label class=\"text-sm font-medium text-surface-700\">{{ label() }}</label>\r\n }\r\n\r\n <!-- Add picker: selecting an option appends it and resets the field. -->\r\n <mt-select-field\r\n [field]=\"false\"\n [options]=\"availableOptions()\"\n [group]=\"group()\"\n [optionLabel]=\"resolvedOptionLabelKey\"\n [optionValue]=\"optionValue()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [filter]=\"filter()\"\r\n [placeholder]=\"placeholder() || t('addProperty')\"\r\n [readonly]=\"disabled()\"\r\n [ngModel]=\"addSelectValue()\"\r\n (ngModelChange)=\"onAdd($event)\"\r\n />\r\n\r\n <!-- Selected values: inline chips, drag to reorder, \u00D7 to remove. -->\r\n @if (values().length) {\r\n <div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"grid grid-cols-4 gap-2\"\r\n >\r\n @for (key of values(); track key + $index; let i = $index) {\r\n <div\r\n cdkDrag\r\n [cdkDragDisabled]=\"disabled()\"\r\n class=\"mt-sai-chip group flex w-full items-center gap-1.5 rounded-md border border-surface-200 bg-surface-50 py-1 pl-2 pr-1 text-sm\"\r\n [class.cursor-grab]=\"!disabled()\"\r\n [pTooltip]=\"t('dragToReorder')\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"shrink-0 text-sm text-muted-color\"\r\n />\r\n\r\n <span\r\n class=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-surface-200 px-1 text-[10px] font-semibold text-muted-color\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n\r\n <span\r\n class=\"min-w-0 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getLabel(key) }}</span\r\n >\r\n\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-color transition-colors hover:bg-red-100 hover:text-red-600\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"t('remove')\"\r\n (click)=\"remove(i)\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-xs\" />\r\n </button>\r\n\r\n <!-- Lifted chip shown while dragging (matches the real chip). -->\r\n <div\r\n *cdkDragPreview\r\n class=\"inline-flex items-center gap-1.5 rounded-full border border-surface-300 bg-surface-0 py-1 pl-2 pr-3 text-sm font-medium text-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"text-sm text-muted-color\"\r\n />\r\n {{ getLabel(key) }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if (emptyHint()) {\r\n <p class=\"text-xs text-muted-color\">{{ emptyHint() }}</p>\r\n }\r\n</div>\r\n", styles: [".mt-string-array-input .cdk-drag-animating,.cdk-drop-list-dragging .mt-sai-chip{transition:none}.mt-string-array-input .cdk-drag-placeholder{border-style:dashed;border-color:var(--p-primary-400, #818cf8);background:var(--p-primary-50, #eef2ff)}.mt-string-array-input .cdk-drag-placeholder>*{visibility:hidden}.mt-string-array-input .cdk-drag-preview{box-shadow:0 10px 20px -8px #00000040,0 4px 8px -4px #00000026}\n"] }]
31922
+ ], template: "<div\r\n class=\"mt-string-array-input flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @if (label()) {\r\n <label class=\"text-sm font-medium text-surface-700\">{{ label() }}</label>\r\n }\r\n\r\n <!-- Add picker: selecting an option appends it and resets the field. -->\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableOptions()\"\r\n [group]=\"group()\"\r\n [optionLabel]=\"resolvedOptionLabelKey\"\r\n [optionValue]=\"optionValue()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [filter]=\"filter()\"\r\n [placeholder]=\"placeholder() || t('addProperty')\"\r\n [readonly]=\"disabled()\"\r\n [ngModel]=\"addSelectValue()\"\r\n (ngModelChange)=\"onAdd($event)\"\r\n />\r\n\r\n <!-- Selected values: inline chips, drag to reorder, \u00D7 to remove. -->\r\n @if (values().length) {\r\n <div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"grid grid-cols-4 gap-2\"\r\n >\r\n @for (key of values(); track key + $index; let i = $index) {\r\n <div\r\n cdkDrag\r\n [cdkDragDisabled]=\"disabled()\"\r\n class=\"mt-sai-chip group flex w-full items-center gap-1.5 rounded-md border border-surface-200 bg-surface-50 py-1 pl-2 pr-1 text-sm\"\r\n [class.cursor-grab]=\"!disabled()\"\r\n [pTooltip]=\"t('dragToReorder')\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"shrink-0 text-sm text-muted-color\"\r\n />\r\n\r\n <span\r\n class=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-surface-200 px-1 text-[10px] font-semibold text-muted-color\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n\r\n <span\r\n class=\"min-w-0 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getLabel(key) }}</span\r\n >\r\n\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-color transition-colors hover:bg-red-100 hover:text-red-600\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"t('remove')\"\r\n (click)=\"remove(i)\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-xs\" />\r\n </button>\r\n\r\n <!-- Lifted chip shown while dragging (matches the real chip). -->\r\n <div\r\n *cdkDragPreview\r\n class=\"inline-flex items-center gap-1.5 rounded-full border border-surface-300 bg-surface-0 py-1 pl-2 pr-3 text-sm font-medium text-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"text-sm text-muted-color\"\r\n />\r\n {{ getLabel(key) }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if (emptyHint()) {\r\n <p class=\"text-xs text-muted-color\">{{ emptyHint() }}</p>\r\n }\r\n</div>\r\n", styles: [".mt-string-array-input .cdk-drag-animating,.cdk-drop-list-dragging .mt-sai-chip{transition:none}.mt-string-array-input .cdk-drag-placeholder{border-style:dashed;border-color:var(--p-primary-400, #818cf8);background:var(--p-primary-50, #eef2ff)}.mt-string-array-input .cdk-drag-placeholder>*{visibility:hidden}.mt-string-array-input .cdk-drag-preview{box-shadow:0 10px 20px -8px #00000040,0 4px 8px -4px #00000026}\n"] }]
31783
31923
  }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionGroupLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupLabel", required: false }] }], optionGroupChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupChildren", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], emptyHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyHint", required: false }] }] } });
31784
31924
 
31785
31925
  /**
@@ -32177,7 +32317,7 @@ class GeneralQuery {
32177
32317
  useExisting: forwardRef(() => GeneralQuery),
32178
32318
  multi: true,
32179
32319
  },
32180
- ], ngImport: i0, template: "<div\n class=\"flex flex-col gap-4\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n [formGroup]=\"queryForm\"\n>\n <!-- Category Property (shown for certain chart types) -->\n @if (shouldShowField(\"categoryProperty\")) {\n <div class=\"mb-2\">\n <mt-select-field\n [label]=\"t('categoryProperty')\"\n formControlName=\"categoryProperty\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectCategoryProperty')\"\n [filter]=\"true\"\n />\n </div>\n }\n\n <!-- Add Series Button -->\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\n <div class=\"flex justify-end\">\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n\n <!-- Series List -->\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\n @for (\n series of seriesArray.controls;\n track trackByIndex(i);\n let i = $index\n ) {\n <div\n class=\"p-4 rounded-lg border transition-all\"\n [class.border-red-500]=\"series.invalid\"\n [class.border-surface-200]=\"!series.invalid\"\n [formGroupName]=\"i\"\n >\n <!-- Series Header -->\n <div class=\"flex items-center justify-between mb-4\">\n <div class=\"flex items-center gap-2\">\n <span\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\n >\n {{ i + 1 }}\n </span>\n <span class=\"text-sm font-medium text-muted-color\">{{\n t(\"series\")\n }}</span>\n </div>\n <div class=\"flex items-center gap-2\">\n <mt-button\n icon=\"general.settings-02\"\n severity=\"secondary\"\n [rounded]=\"true\"\n size=\"small\"\n (onClick)=\"toggleAdvanced(i)\"\n [pTooltip]=\"t('advancedSettings')\"\n />\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"deleteSeries(i)\"\n />\n </div>\n </div>\n\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n <!-- Auto Stack Toggle -->\n @if (shouldShowField(\"autoStack\")) {\n <div class=\"md:col-span-2 lg:col-span-3\">\n <mt-toggle-field\n [label]=\"t('autoStack')\"\n formControlName=\"autoStack\"\n />\n </div>\n }\n\n <!-- Value Property -->\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\n <mt-select-field\n [label]=\"t('valueProperty')\"\n formControlName=\"valueProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectValueProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Aggregate Function -->\n @if (shouldShowField(\"aggregateFunction\")) {\n <mt-select-field\n [label]=\"t('aggregateFunction')\"\n formControlName=\"aggregateFunction\"\n [options]=\"aggregateFunctions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n }\n\n <!-- Color Picker -->\n @if (shouldShowField(\"color\")) {\n <mt-color-picker-field\n [label]=\"t('seriesColor')\"\n formControlName=\"color\"\n />\n }\n\n <!-- Bar Type (for stacked bar charts) -->\n @if (shouldShowField(\"barType\")) {\n <mt-select-field\n [label]=\"t('barType')\"\n formControlName=\"barType\"\n [options]=\"barTypes\"\n optionLabel=\"name\"\n optionValue=\"key\"\n />\n }\n\n <!-- Auto Stack By Property -->\n @if (\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\n ) {\n <mt-select-field\n [label]=\"t('autoStackByProperty')\"\n formControlName=\"autoStackByProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Group By Properties -->\n @if (shouldShowField(\"groupByProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('groupByProperties')\"\n formControlName=\"groupByProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Stack Properties (for stacked charts) -->\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('stackProperties')\"\n formControlName=\"stackProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Extra Properties -->\n @if (shouldShowField(\"extraProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('extraProperties')\"\n formControlName=\"extraProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n </div>\n\n <!-- Advanced Settings (Formula) -->\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\n <div\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\n >\n <div class=\"text-sm font-medium mb-2\">\n {{ t(\"advancedSettings\") }}\n </div>\n <label class=\"mb-2 block text-sm font-medium\">\n {{ t(\"formula\") }}\n </label>\n <mt-formula-builder\n formControlName=\"formula\"\n valueMode=\"expression\"\n [builderOnly]=\"true\"\n [propertiesByPath]=\"formulaPropertiesByPath()\"\n [placeholder]=\"t('enterFormula')\"\n />\n </div>\n }\n\n <!-- Filters Section -->\n @if (shouldShowField(\"filters\")) {\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\n <div class=\"flex items-center justify-between mb-3\">\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\n <mt-button\n icon=\"general.plus\"\n severity=\"secondary\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addFilter(i)\"\n [pTooltip]=\"t('addFilter')\"\n />\n </div>\n\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\n @for (\n filter of getFilters(series).controls;\n track trackByIndex(j);\n let j = $index\n ) {\n <div\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\n [formGroupName]=\"j\"\n >\n <!-- Property Key -->\n <div class=\"col-span-4\">\n <mt-select-field\n [label]=\"j === 0 ? t('property') : ''\"\n formControlName=\"propertyKey\"\n [options]=\"\n useGroupedSelect()\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n </div>\n\n <!-- Operator -->\n <div class=\"col-span-2\">\n <mt-select-field\n [label]=\"j === 0 ? t('operator') : ''\"\n formControlName=\"operator\"\n [options]=\"operators\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n </div>\n\n <!-- Value -->\n <div class=\"col-span-4\">\n <mt-text-field\n [label]=\"j === 0 ? t('value') : ''\"\n formControlName=\"value\"\n [placeholder]=\"t('enterValue')\"\n />\n </div>\n\n <!-- Remove Filter -->\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"removeFilter(i, j)\"\n />\n </div>\n </div>\n }\n\n @if (getFilters(series).length === 0) {\n <div class=\"text-center py-3 text-muted-color text-sm\">\n {{ t(\"noFiltersConfigured\") }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n\n @if (seriesArray.length === 0) {\n <div\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\n >\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n severity=\"secondary\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32320
+ ], ngImport: i0, template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n <mt-button\r\n icon=\"general.settings-02\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n (onClick)=\"toggleAdvanced(i)\"\r\n [pTooltip]=\"t('advancedSettings')\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32181
32321
  }
32182
32322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: GeneralQuery, decorators: [{
32183
32323
  type: Component,
@@ -32205,7 +32345,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
32205
32345
  useExisting: forwardRef(() => GeneralQuery),
32206
32346
  multi: true,
32207
32347
  },
32208
- ], template: "<div\n class=\"flex flex-col gap-4\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n [formGroup]=\"queryForm\"\n>\n <!-- Category Property (shown for certain chart types) -->\n @if (shouldShowField(\"categoryProperty\")) {\n <div class=\"mb-2\">\n <mt-select-field\n [label]=\"t('categoryProperty')\"\n formControlName=\"categoryProperty\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectCategoryProperty')\"\n [filter]=\"true\"\n />\n </div>\n }\n\n <!-- Add Series Button -->\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\n <div class=\"flex justify-end\">\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n\n <!-- Series List -->\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\n @for (\n series of seriesArray.controls;\n track trackByIndex(i);\n let i = $index\n ) {\n <div\n class=\"p-4 rounded-lg border transition-all\"\n [class.border-red-500]=\"series.invalid\"\n [class.border-surface-200]=\"!series.invalid\"\n [formGroupName]=\"i\"\n >\n <!-- Series Header -->\n <div class=\"flex items-center justify-between mb-4\">\n <div class=\"flex items-center gap-2\">\n <span\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\n >\n {{ i + 1 }}\n </span>\n <span class=\"text-sm font-medium text-muted-color\">{{\n t(\"series\")\n }}</span>\n </div>\n <div class=\"flex items-center gap-2\">\n <mt-button\n icon=\"general.settings-02\"\n severity=\"secondary\"\n [rounded]=\"true\"\n size=\"small\"\n (onClick)=\"toggleAdvanced(i)\"\n [pTooltip]=\"t('advancedSettings')\"\n />\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"deleteSeries(i)\"\n />\n </div>\n </div>\n\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n <!-- Auto Stack Toggle -->\n @if (shouldShowField(\"autoStack\")) {\n <div class=\"md:col-span-2 lg:col-span-3\">\n <mt-toggle-field\n [label]=\"t('autoStack')\"\n formControlName=\"autoStack\"\n />\n </div>\n }\n\n <!-- Value Property -->\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\n <mt-select-field\n [label]=\"t('valueProperty')\"\n formControlName=\"valueProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectValueProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Aggregate Function -->\n @if (shouldShowField(\"aggregateFunction\")) {\n <mt-select-field\n [label]=\"t('aggregateFunction')\"\n formControlName=\"aggregateFunction\"\n [options]=\"aggregateFunctions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n }\n\n <!-- Color Picker -->\n @if (shouldShowField(\"color\")) {\n <mt-color-picker-field\n [label]=\"t('seriesColor')\"\n formControlName=\"color\"\n />\n }\n\n <!-- Bar Type (for stacked bar charts) -->\n @if (shouldShowField(\"barType\")) {\n <mt-select-field\n [label]=\"t('barType')\"\n formControlName=\"barType\"\n [options]=\"barTypes\"\n optionLabel=\"name\"\n optionValue=\"key\"\n />\n }\n\n <!-- Auto Stack By Property -->\n @if (\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\n ) {\n <mt-select-field\n [label]=\"t('autoStackByProperty')\"\n formControlName=\"autoStackByProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Group By Properties -->\n @if (shouldShowField(\"groupByProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('groupByProperties')\"\n formControlName=\"groupByProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Stack Properties (for stacked charts) -->\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('stackProperties')\"\n formControlName=\"stackProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Extra Properties -->\n @if (shouldShowField(\"extraProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('extraProperties')\"\n formControlName=\"extraProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n </div>\n\n <!-- Advanced Settings (Formula) -->\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\n <div\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\n >\n <div class=\"text-sm font-medium mb-2\">\n {{ t(\"advancedSettings\") }}\n </div>\n <label class=\"mb-2 block text-sm font-medium\">\n {{ t(\"formula\") }}\n </label>\n <mt-formula-builder\n formControlName=\"formula\"\n valueMode=\"expression\"\n [builderOnly]=\"true\"\n [propertiesByPath]=\"formulaPropertiesByPath()\"\n [placeholder]=\"t('enterFormula')\"\n />\n </div>\n }\n\n <!-- Filters Section -->\n @if (shouldShowField(\"filters\")) {\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\n <div class=\"flex items-center justify-between mb-3\">\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\n <mt-button\n icon=\"general.plus\"\n severity=\"secondary\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addFilter(i)\"\n [pTooltip]=\"t('addFilter')\"\n />\n </div>\n\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\n @for (\n filter of getFilters(series).controls;\n track trackByIndex(j);\n let j = $index\n ) {\n <div\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\n [formGroupName]=\"j\"\n >\n <!-- Property Key -->\n <div class=\"col-span-4\">\n <mt-select-field\n [label]=\"j === 0 ? t('property') : ''\"\n formControlName=\"propertyKey\"\n [options]=\"\n useGroupedSelect()\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n </div>\n\n <!-- Operator -->\n <div class=\"col-span-2\">\n <mt-select-field\n [label]=\"j === 0 ? t('operator') : ''\"\n formControlName=\"operator\"\n [options]=\"operators\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n </div>\n\n <!-- Value -->\n <div class=\"col-span-4\">\n <mt-text-field\n [label]=\"j === 0 ? t('value') : ''\"\n formControlName=\"value\"\n [placeholder]=\"t('enterValue')\"\n />\n </div>\n\n <!-- Remove Filter -->\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"removeFilter(i, j)\"\n />\n </div>\n </div>\n }\n\n @if (getFilters(series).length === 0) {\n <div class=\"text-center py-3 text-muted-color text-sm\">\n {{ t(\"noFiltersConfigured\") }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n\n @if (seriesArray.length === 0) {\n <div\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\n >\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n severity=\"secondary\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n </div>\n</div>\n" }]
32348
+ ], template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n <mt-button\r\n icon=\"general.settings-02\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n (onClick)=\"toggleAdvanced(i)\"\r\n [pTooltip]=\"t('advancedSettings')\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
32209
32349
  }], ctorParameters: () => [], propDecorators: { chartType: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartType", required: false }] }], querySchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "querySchema", required: false }] }], propertiesFlat: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesFlat", required: false }] }], propertiesGrouped: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesGrouped", required: false }] }] } });
32210
32350
 
32211
32351
  /**
@@ -39729,6 +39869,41 @@ class DashboardBuilder {
39729
39869
  },
39730
39870
  });
39731
39871
  }
39872
+ /**
39873
+ * Persist the page-level filters through the dashboard (report) endpoint —
39874
+ * the canonical carrier of `dashboardConfig.filters`. In API-backed mode
39875
+ * `saveDash()` only links charts/dialogs via `linkChartsBulk` and never writes
39876
+ * the page config, so configured filters were lost on reload and never reached
39877
+ * the runtime sidebar (#1141). Standalone mode already emits filters via
39878
+ * `emitDashboardDataChange`, so this no-ops there.
39879
+ */
39880
+ persistPageFilters() {
39881
+ if (this.standalone())
39882
+ return;
39883
+ const id = this.pageId();
39884
+ const report = this.pageConfig();
39885
+ if (!id || !report)
39886
+ return;
39887
+ // Normalize before persisting so an empty/legacy `[{}]` is never written
39888
+ // back to the report (mirrors what the viewer/loader accept as real).
39889
+ const filters = this.normalizeFiltersConfig(this.filtersConfig());
39890
+ const dashboardConfig = { ...(report.dashboardConfig ?? {}), filters };
39891
+ // Keep the in-memory report in sync so later saves/reloads carry the filters.
39892
+ this.pageConfig.set({ ...report, dashboardConfig });
39893
+ this.dashboardService
39894
+ .updateReport({
39895
+ name: report.name,
39896
+ type: report.type,
39897
+ icon: report.icon,
39898
+ url: report.url,
39899
+ showInMenu: report.showInMenu,
39900
+ isActive: report.isActive,
39901
+ dashboardConfig,
39902
+ }, id)
39903
+ .subscribe({
39904
+ error: (err) => console.error('[DashboardBuilder] Failed to persist page filters via updateReport', err),
39905
+ });
39906
+ }
39732
39907
  // ============================================
39733
39908
  // Page Management
39734
39909
  // ============================================
@@ -40676,6 +40851,7 @@ class DashboardBuilder {
40676
40851
  return;
40677
40852
  if (Array.isArray(result)) {
40678
40853
  this.filtersConfig.set(result);
40854
+ this.persistPageFilters();
40679
40855
  this.saveDash({ silent: true });
40680
40856
  return;
40681
40857
  }
@@ -40692,6 +40868,7 @@ class DashboardBuilder {
40692
40868
  if (labels && Object.keys(labels).length) {
40693
40869
  changed = this.applyBulkPropertyTranslations(labels) || changed;
40694
40870
  }
40871
+ this.persistPageFilters();
40695
40872
  this.saveDash({ silent: true });
40696
40873
  if (changed) {
40697
40874
  this.chartsChange.emit(this.charts());
@@ -41428,13 +41605,20 @@ class DashboardBuilder {
41428
41605
  }
41429
41606
  normalizeFiltersConfig(filters) {
41430
41607
  const parsed = this.parseSerializedValue(filters);
41608
+ // Flatten + drop empties: older saves wrapped an already-array filters
41609
+ // value into `[[...]]`, and the BE may return a legacy/default `[{}]`. A
41610
+ // real page filter has a `key` (input) or a `type` (section/separator); an
41611
+ // empty `{}` is truthy so `.filter(Boolean)` would keep it and render a
41612
+ // broken keyless control (mirrors the viewer's normalizeFilters).
41613
+ const isMeaningful = (f) => !!f &&
41614
+ typeof f === 'object' &&
41615
+ !Array.isArray(f) &&
41616
+ (!!f['key'] ||
41617
+ !!f['type']);
41431
41618
  if (Array.isArray(parsed)) {
41432
- // Flatten + drop empties: older saves wrapped an already-array filters
41433
- // value into `[[...]]`, which must not reach the filter config as a
41434
- // nested array (mirrors the viewer's normalizeFilters).
41435
- return parsed.flat(Infinity).filter(Boolean);
41619
+ return parsed.flat(Infinity).filter(isMeaningful);
41436
41620
  }
41437
- return parsed ? [parsed] : [];
41621
+ return isMeaningful(parsed) ? [parsed] : [];
41438
41622
  }
41439
41623
  readSerializedObject(value) {
41440
41624
  const parsed = this.parseSerializedValue(value);
@@ -41912,7 +42096,7 @@ class PageFilterSidebar {
41912
42096
  return String(value);
41913
42097
  }
41914
42098
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PageFilterSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
41915
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: PageFilterSidebar, isStandalone: true, selector: "mt-page-filter-sidebar", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", closeRequested: "closeRequested" }, ngImport: i0, template: "<div\r\n class=\"mt-page-filter-sidebar flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <header class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-3\">\n <mt-icon icon=\"general.filter-funnel-01\" class=\"text-primary-600\" />\n <h4 class=\"min-w-0 flex-1 text-sm font-semibold text-surface-700\">\n {{ t(\"filters\") }}\n </h4>\n <mt-button\n icon=\"general.x-close\"\n variant=\"text\"\n severity=\"secondary\"\n size=\"small\"\n [tooltip]=\"t('close')\"\n (onClick)=\"closeRequested.emit()\"\n />\n </header>\n\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-4 py-4\" [formGroup]=\"form\">\r\n @for (field of filters(); track $index) {\r\n @if (field.type === \"section\") {\r\n <h5 class=\"mt-2 mb-2 text-xs font-semibold uppercase text-muted-color\">\r\n {{ label(field) }}\r\n </h5>\r\n } @else if (field.type === \"separator\") {\r\n <hr class=\"my-3 border-surface-200\" />\r\n } @else if (isInput(field)) {\r\n <div class=\"mb-3\">\r\n @switch (true) {\r\n @case (field.type === \"date\") {\r\n <mt-date-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [showClear]=\"true\"\r\n />\r\n }\r\n @case (field.type === \"user\") {\r\n <mt-user-search-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [apiUrl]=\"userApiUrl\"\r\n [isMultiple]=\"isMulti(field)\"\r\n />\r\n }\r\n @case (isMulti(field)) {\r\n <mt-multi-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n @default {\r\n <mt-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [showClear]=\"!field.configuration?.isRequird\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @if (filters().length === 0) {\r\n <div class=\"py-8 text-center text-sm text-muted-color\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n\r\n <footer\r\n class=\"flex items-center justify-end gap-2 border-t border-surface-200 px-4 py-3\"\r\n >\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n variant=\"outlined\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"clear()\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n icon=\"general.check\"\r\n size=\"small\"\r\n (onClick)=\"apply()\"\r\n />\r\n </footer>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showOnFocus", "showClear", "showTime", "minDate", "maxDate", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "hideUnlinkedHint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "context", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
42099
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: PageFilterSidebar, isStandalone: true, selector: "mt-page-filter-sidebar", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, initialValues: { classPropertyName: "initialValues", publicName: "initialValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filtersApplied: "filtersApplied", closeRequested: "closeRequested" }, ngImport: i0, template: "<div\r\n class=\"mt-page-filter-sidebar flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <header class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-3\">\r\n <mt-icon icon=\"general.filter-funnel-01\" class=\"text-primary-600\" />\r\n <h4 class=\"min-w-0 flex-1 text-sm font-semibold text-surface-700\">\r\n {{ t(\"filters\") }}\r\n </h4>\r\n <mt-button\r\n icon=\"general.x-close\"\r\n variant=\"text\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [tooltip]=\"t('close')\"\r\n (onClick)=\"closeRequested.emit()\"\r\n />\r\n </header>\r\n\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-4 py-4\" [formGroup]=\"form\">\r\n @for (field of filters(); track $index) {\r\n @if (field.type === \"section\") {\r\n <h5 class=\"mt-2 mb-2 text-xs font-semibold uppercase text-muted-color\">\r\n {{ label(field) }}\r\n </h5>\r\n } @else if (field.type === \"separator\") {\r\n <hr class=\"my-3 border-surface-200\" />\r\n } @else if (isInput(field)) {\r\n <div class=\"mb-3\">\r\n @switch (true) {\r\n @case (field.type === \"date\") {\r\n <mt-date-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [showClear]=\"true\"\r\n />\r\n }\r\n @case (field.type === \"user\") {\r\n <mt-user-search-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [apiUrl]=\"userApiUrl\"\r\n [isMultiple]=\"isMulti(field)\"\r\n />\r\n }\r\n @case (isMulti(field)) {\r\n <mt-multi-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n @default {\r\n <mt-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [showClear]=\"!field.configuration?.isRequird\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @if (filters().length === 0) {\r\n <div class=\"py-8 text-center text-sm text-muted-color\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n\r\n <footer\r\n class=\"flex items-center justify-end gap-2 border-t border-surface-200 px-4 py-3\"\r\n >\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n variant=\"outlined\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"clear()\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n icon=\"general.check\"\r\n size=\"small\"\r\n (onClick)=\"apply()\"\r\n />\r\n </footer>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showOnFocus", "showClear", "showTime", "minDate", "maxDate", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "hideUnlinkedHint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "context", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
41916
42100
  }
41917
42101
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PageFilterSidebar, decorators: [{
41918
42102
  type: Component,
@@ -41926,7 +42110,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
41926
42110
  MultiSelectField,
41927
42111
  DateField,
41928
42112
  UserSearchField,
41929
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"mt-page-filter-sidebar flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <header class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-3\">\n <mt-icon icon=\"general.filter-funnel-01\" class=\"text-primary-600\" />\n <h4 class=\"min-w-0 flex-1 text-sm font-semibold text-surface-700\">\n {{ t(\"filters\") }}\n </h4>\n <mt-button\n icon=\"general.x-close\"\n variant=\"text\"\n severity=\"secondary\"\n size=\"small\"\n [tooltip]=\"t('close')\"\n (onClick)=\"closeRequested.emit()\"\n />\n </header>\n\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-4 py-4\" [formGroup]=\"form\">\r\n @for (field of filters(); track $index) {\r\n @if (field.type === \"section\") {\r\n <h5 class=\"mt-2 mb-2 text-xs font-semibold uppercase text-muted-color\">\r\n {{ label(field) }}\r\n </h5>\r\n } @else if (field.type === \"separator\") {\r\n <hr class=\"my-3 border-surface-200\" />\r\n } @else if (isInput(field)) {\r\n <div class=\"mb-3\">\r\n @switch (true) {\r\n @case (field.type === \"date\") {\r\n <mt-date-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [showClear]=\"true\"\r\n />\r\n }\r\n @case (field.type === \"user\") {\r\n <mt-user-search-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [apiUrl]=\"userApiUrl\"\r\n [isMultiple]=\"isMulti(field)\"\r\n />\r\n }\r\n @case (isMulti(field)) {\r\n <mt-multi-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n @default {\r\n <mt-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [showClear]=\"!field.configuration?.isRequird\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @if (filters().length === 0) {\r\n <div class=\"py-8 text-center text-sm text-muted-color\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n\r\n <footer\r\n class=\"flex items-center justify-end gap-2 border-t border-surface-200 px-4 py-3\"\r\n >\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n variant=\"outlined\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"clear()\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n icon=\"general.check\"\r\n size=\"small\"\r\n (onClick)=\"apply()\"\r\n />\r\n </footer>\r\n</div>\r\n" }]
42113
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"mt-page-filter-sidebar flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <header class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-3\">\r\n <mt-icon icon=\"general.filter-funnel-01\" class=\"text-primary-600\" />\r\n <h4 class=\"min-w-0 flex-1 text-sm font-semibold text-surface-700\">\r\n {{ t(\"filters\") }}\r\n </h4>\r\n <mt-button\r\n icon=\"general.x-close\"\r\n variant=\"text\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [tooltip]=\"t('close')\"\r\n (onClick)=\"closeRequested.emit()\"\r\n />\r\n </header>\r\n\r\n <div class=\"min-h-0 flex-1 overflow-y-auto px-4 py-4\" [formGroup]=\"form\">\r\n @for (field of filters(); track $index) {\r\n @if (field.type === \"section\") {\r\n <h5 class=\"mt-2 mb-2 text-xs font-semibold uppercase text-muted-color\">\r\n {{ label(field) }}\r\n </h5>\r\n } @else if (field.type === \"separator\") {\r\n <hr class=\"my-3 border-surface-200\" />\r\n } @else if (isInput(field)) {\r\n <div class=\"mb-3\">\r\n @switch (true) {\r\n @case (field.type === \"date\") {\r\n <mt-date-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [showClear]=\"true\"\r\n />\r\n }\r\n @case (field.type === \"user\") {\r\n <mt-user-search-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [apiUrl]=\"userApiUrl\"\r\n [isMultiple]=\"isMulti(field)\"\r\n />\r\n }\r\n @case (isMulti(field)) {\r\n <mt-multi-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n @default {\r\n <mt-select-field\r\n [label]=\"label(field)\"\r\n [formControlName]=\"field.key\"\r\n [options]=\"optionsFor(field)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"true\"\r\n [showClear]=\"!field.configuration?.isRequird\"\r\n [placeholder]=\"t('selectProperty')\"\r\n />\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @if (filters().length === 0) {\r\n <div class=\"py-8 text-center text-sm text-muted-color\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n\r\n <footer\r\n class=\"flex items-center justify-end gap-2 border-t border-surface-200 px-4 py-3\"\r\n >\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n variant=\"outlined\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"clear()\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n icon=\"general.check\"\r\n size=\"small\"\r\n (onClick)=\"apply()\"\r\n />\r\n </footer>\r\n</div>\r\n" }]
41930
42114
  }], ctorParameters: () => [], propDecorators: { filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], initialValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValues", required: false }] }], filtersApplied: [{ type: i0.Output, args: ["filtersApplied"] }], closeRequested: [{ type: i0.Output, args: ["closeRequested"] }] } });
41931
42115
 
41932
42116
  /**
@@ -42507,10 +42691,19 @@ class DashboardViewer {
42507
42691
  parsed = [];
42508
42692
  }
42509
42693
  }
42694
+ // Drop meaningless/empty filter objects (legacy/default `[{}]` the BE can
42695
+ // return): a real page filter has a `key` (input) or a `type`
42696
+ // (section/separator); an empty `{}` is truthy so `.filter(Boolean)` would
42697
+ // keep it and render a broken keyless control in the sidebar.
42698
+ const isMeaningful = (f) => !!f &&
42699
+ typeof f === 'object' &&
42700
+ !Array.isArray(f) &&
42701
+ (!!f['key'] ||
42702
+ !!f['type']);
42510
42703
  if (Array.isArray(parsed)) {
42511
- return parsed.flat(Infinity).filter(Boolean);
42704
+ return parsed.flat(Infinity).filter(isMeaningful);
42512
42705
  }
42513
- return parsed ? [parsed] : [];
42706
+ return isMeaningful(parsed) ? [parsed] : [];
42514
42707
  }
42515
42708
  applyDashboardData(data) {
42516
42709
  const filters = data.filters ?? data.page?.dashboardConfig?.filters;
@@ -42526,7 +42719,13 @@ class DashboardViewer {
42526
42719
  }
42527
42720
  this.cdr.detectChanges();
42528
42721
  }
42722
+ /**
42723
+ * Public host API for refreshing the current dashboard view after host-owned
42724
+ * mutations. Always clear chart HTTP cache first so every item sends a fresh
42725
+ * backend request; hosts should not need to know dashboard-builder internals.
42726
+ */
42529
42727
  reloadPage() {
42728
+ this.limitedHttp.clearCache();
42530
42729
  this.refreshAllItems();
42531
42730
  this.cdr.detectChanges();
42532
42731
  }
@@ -42655,7 +42854,7 @@ class DashboardViewer {
42655
42854
  });
42656
42855
  }
42657
42856
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardViewer, deps: [], target: i0.ɵɵFactoryTarget.Component });
42658
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardViewer, isStandalone: true, selector: "mt-dashboard-viewer", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, backButton: { classPropertyName: "backButton", publicName: "backButton", isSignal: true, isRequired: false, transformFunction: null }, pageId: { classPropertyName: "pageId", publicName: "pageId", isSignal: true, isRequired: false, transformFunction: null }, dashboardData: { classPropertyName: "dashboardData", publicName: "dashboardData", isSignal: true, isRequired: false, transformFunction: null }, chartsData: { classPropertyName: "chartsData", publicName: "chartsData", isSignal: true, isRequired: false, transformFunction: null }, dialogsData: { classPropertyName: "dialogsData", publicName: "dialogsData", isSignal: true, isRequired: false, transformFunction: null }, filtersData: { classPropertyName: "filtersData", publicName: "filtersData", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageLoaded: "pageLoaded", onBack: "onBack", chartClick: "chartClick" }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('dashboard')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n }\r\n\r\n <!-- Reusable viewer content template -->\r\n <ng-template #viewerContent>\r\n <div class=\"relative h-full min-h-[600px] mt-dashboard-viewer\">\r\n @if (!loading() && hasRenderableContent()) {\r\n <div class=\"dashboard-viewer-layout-wrapper\">\r\n <div\r\n class=\"dashboard-viewer-layout\"\r\n [style.min-height]=\"layoutHeight()\"\r\n >\r\n @for (\r\n item of visibleItems();\r\n track trackByDashboardId($index, item)\r\n ) {\r\n <div\r\n class=\"dashboard-viewer-item\"\r\n [class.dashboard-viewer-item--group]=\"isGroup(item)\"\r\n [class.dashboard-viewer-item--header]=\"isHeader(item)\"\r\n [class.dashboard-viewer-item--topbar]=\"isTopbar(item)\"\r\n [style.grid-column]=\"getGridColumn(item)\"\r\n [style.grid-row]=\"getGridRow(item)\"\r\n >\r\n <!-- Group Container -->\r\n @if (isGroup(item)) {\r\n @if (!item.loading) {\r\n <div\r\n class=\"group-container h-full flex flex-col rounded-lg border border-surface-200 overflow-hidden\"\r\n [style.background-color]=\"\r\n getStyleConfig(item)['background-color'] ||\r\n 'var(--surface-card)'\r\n \"\r\n >\r\n <!-- Group Header with Tabs -->\r\n <div\r\n class=\"group-header flex items-center justify-between px-4 py-2 bg-surface-50 border-b border-surface-200\"\r\n >\r\n <span class=\"font-medium text-sm\">{{\r\n getGroupTitle(item)\r\n }}</span>\r\n <div class=\"group-tabs flex items-center gap-1\">\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let gIndex = $index\r\n ) {\r\n @if (getItemIcon(child); as icon) {\r\n <button\r\n type=\"button\"\r\n class=\"w-8 h-8 flex items-center justify-center rounded transition-colors\"\r\n [class.bg-primary-100]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-primary-600]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-muted-color]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n >\r\n <i class=\"mti mti-{{ icon }}\"></i>\r\n </button>\r\n } @else {\r\n <button\r\n pButton\r\n type=\"button\"\r\n class=\"p-button-text p-button-sm\"\r\n [class.p-button-primary]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.p-button-secondary]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [label]=\"getItemTitle(child)\"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n ></button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Group Body - Selected Child Content -->\r\n <div class=\"group-body flex-1 min-h-0\">\r\n @if (\r\n item.selectedGroupIndex !== null &&\r\n item.selectedGroupIndex !== undefined\r\n ) {\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let cIndex = $index\r\n ) {\r\n @if (\r\n cIndex === item.selectedGroupIndex &&\r\n !child.loading\r\n ) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"child.config\"\r\n [chartTypeId]=\"child.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig\r\n ?.ignoreQueryFilter ?? false\r\n \"\r\n [inGroup]=\"true\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n <!-- Header Item -->\r\n @else if (isHeader(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Topbar Item -->\r\n @else if (isTopbar(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Regular Chart Item -->\r\n @else {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Hidden Dialogs (for modal rendering) -->\r\n @if (dialogs().length > 0) {\r\n <div class=\"hidden\">\r\n @for (\r\n dialog of dialogs();\r\n track dialog.config?.serviceConfig?.dashboardId\r\n ) {\r\n <!-- Dialog placeholder - will be rendered in modal when triggered -->\r\n <div\r\n [attr.data-dialog-id]=\"\r\n dialog.config?.serviceConfig?.dashboardId\r\n \"\r\n ></div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Runtime page-filter sidebar: renders the configured filters and,\r\n on Apply, pushes their values onto the URL so charts reload. -->\r\n @if (showFilters() && hasPageFilters()) {\n @if (!filtersPanelOpen()) {\n <mt-button\n class=\"filters-toggle fixed end-4 top-4 z-50\"\n [label]=\"t('filters')\"\n icon=\"general.filter-funnel-01\"\n size=\"small\"\n [tooltip]=\"t('filters')\"\n (onClick)=\"toggleFiltersPanel()\"\n />\n }\n\n @if (filtersPanelOpen()) {\n <button\n type=\"button\"\n class=\"filters-sidebar-backdrop fixed inset-0 z-30 border-0 bg-black/20 md:hidden\"\n [attr.aria-label]=\"t('close')\"\n (click)=\"closeFiltersPanel()\"\n ></button>\n }\n\n <mt-page-filter-sidebar\n class=\"filters-sidebar fixed end-0 top-0 bottom-0 z-40 w-72 border-s border-surface-200 bg-surface-card shadow-lg\"\n [class.open]=\"filtersPanelOpen()\"\n [filters]=\"filters()\"\n [initialValues]=\"store.getQueryParams()\"\n (filtersApplied)=\"onPageFilterChange($event)\"\n (closeRequested)=\"closeFiltersPanel()\"\n />\n }\n } @else if (loading()) {\r\n <!-- Loading State -->\r\n <div class=\"flex items-center justify-center h-64\">\r\n <div class=\"text-center\">\r\n <i\r\n class=\"mti mti-loader-2 text-4xl text-primary animate-spin mb-2\"\r\n ></i>\r\n <p class=\"text-muted-color\">{{ t(\"loading\") }}</p>\r\n </div>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".mt-dashboard-viewer{width:100%;height:100%}.dashboard-viewer-layout-wrapper{width:100%}.dashboard-viewer-layout{display:grid;grid-template-columns:repeat(36,minmax(0,1fr));grid-auto-rows:60px;gap:10px;width:100%;align-items:stretch}.dashboard-viewer-item{display:flex;min-width:0;min-height:0}.dashboard-viewer-item>*{width:100%;height:100%}.dashboard-viewer-content-item{display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}.dashboard-viewer-item--header{z-index:1;overflow:hidden;border:1px solid var(--p-surface-200, #e5e7eb);border-radius:.5rem;background:var(--p-surface-0, #fff);box-shadow:0 1px 2px #0f172a14}.dashboard-viewer-item--topbar{z-index:2;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}.group-container{background-color:var(--surface-card)}.group-header{flex-shrink:0}.group-tabs{flex-wrap:wrap}.group-body{background-color:var(--surface-0)}.header-item{background-color:transparent}.topbar-item{background-color:var(--surface-50)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.filters-sidebar{max-width:calc(100vw - 1rem);pointer-events:none;transform:translate(100%);transition:transform .3s ease-in-out}.filters-sidebar.open{pointer-events:auto;transform:translate(0)}.filters-toggle{max-width:calc(100vw - 2rem)}[dir=rtl] .filters-sidebar{transform:translate(-100%)}[dir=rtl] .filters-sidebar.open{transform:translate(0)}.table-responsive{max-height:75vh;overflow-y:auto;overflow-x:auto}.modal-content{border:0!important}.custom-donut-chart{display:flex;justify-content:center;height:auto!important}.custom-donut-chart canvas{margin-top:-1.5rem!important}@media(max-width:768px){.dashboard-viewer-layout{display:flex;flex-direction:column;min-height:0!important}.dashboard-viewer-item{min-height:220px}.dashboard-viewer-item--header,.dashboard-viewer-item--topbar{min-height:72px}.dashboard-viewer-item--group{min-height:280px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { kind: "component", type: PageFilterSidebar, selector: "mt-page-filter-sidebar", inputs: ["filters", "initialValues"], outputs: ["filtersApplied", "closeRequested"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
42857
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardViewer, isStandalone: true, selector: "mt-dashboard-viewer", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, backButton: { classPropertyName: "backButton", publicName: "backButton", isSignal: true, isRequired: false, transformFunction: null }, pageId: { classPropertyName: "pageId", publicName: "pageId", isSignal: true, isRequired: false, transformFunction: null }, dashboardData: { classPropertyName: "dashboardData", publicName: "dashboardData", isSignal: true, isRequired: false, transformFunction: null }, chartsData: { classPropertyName: "chartsData", publicName: "chartsData", isSignal: true, isRequired: false, transformFunction: null }, dialogsData: { classPropertyName: "dialogsData", publicName: "dialogsData", isSignal: true, isRequired: false, transformFunction: null }, filtersData: { classPropertyName: "filtersData", publicName: "filtersData", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageLoaded: "pageLoaded", onBack: "onBack", chartClick: "chartClick" }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('dashboard')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n }\r\n\r\n <!-- Reusable viewer content template -->\r\n <ng-template #viewerContent>\r\n <div class=\"relative h-full min-h-[600px] mt-dashboard-viewer\">\r\n @if (!loading() && hasRenderableContent()) {\r\n <div class=\"dashboard-viewer-layout-wrapper\">\r\n <div\r\n class=\"dashboard-viewer-layout\"\r\n [style.min-height]=\"layoutHeight()\"\r\n >\r\n @for (\r\n item of visibleItems();\r\n track trackByDashboardId($index, item)\r\n ) {\r\n <div\r\n class=\"dashboard-viewer-item\"\r\n [class.dashboard-viewer-item--group]=\"isGroup(item)\"\r\n [class.dashboard-viewer-item--header]=\"isHeader(item)\"\r\n [class.dashboard-viewer-item--topbar]=\"isTopbar(item)\"\r\n [style.grid-column]=\"getGridColumn(item)\"\r\n [style.grid-row]=\"getGridRow(item)\"\r\n >\r\n <!-- Group Container -->\r\n @if (isGroup(item)) {\r\n @if (!item.loading) {\r\n <div\r\n class=\"group-container h-full flex flex-col rounded-lg border border-surface-200 overflow-hidden\"\r\n [style.background-color]=\"\r\n getStyleConfig(item)['background-color'] ||\r\n 'var(--surface-card)'\r\n \"\r\n >\r\n <!-- Group Header with Tabs -->\r\n <div\r\n class=\"group-header flex items-center justify-between px-4 py-2 bg-surface-50 border-b border-surface-200\"\r\n >\r\n <span class=\"font-medium text-sm\">{{\r\n getGroupTitle(item)\r\n }}</span>\r\n <div class=\"group-tabs flex items-center gap-1\">\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let gIndex = $index\r\n ) {\r\n @if (getItemIcon(child); as icon) {\r\n <button\r\n type=\"button\"\r\n class=\"w-8 h-8 flex items-center justify-center rounded transition-colors\"\r\n [class.bg-primary-100]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-primary-600]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-muted-color]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n >\r\n <i class=\"mti mti-{{ icon }}\"></i>\r\n </button>\r\n } @else {\r\n <button\r\n pButton\r\n type=\"button\"\r\n class=\"p-button-text p-button-sm\"\r\n [class.p-button-primary]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.p-button-secondary]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [label]=\"getItemTitle(child)\"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n ></button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Group Body - Selected Child Content -->\r\n <div class=\"group-body flex-1 min-h-0\">\r\n @if (\r\n item.selectedGroupIndex !== null &&\r\n item.selectedGroupIndex !== undefined\r\n ) {\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let cIndex = $index\r\n ) {\r\n @if (\r\n cIndex === item.selectedGroupIndex &&\r\n !child.loading\r\n ) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"child.config\"\r\n [chartTypeId]=\"child.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig\r\n ?.ignoreQueryFilter ?? false\r\n \"\r\n [inGroup]=\"true\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n <!-- Header Item -->\r\n @else if (isHeader(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Topbar Item -->\r\n @else if (isTopbar(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Regular Chart Item -->\r\n @else {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Hidden Dialogs (for modal rendering) -->\r\n @if (dialogs().length > 0) {\r\n <div class=\"hidden\">\r\n @for (\r\n dialog of dialogs();\r\n track dialog.config?.serviceConfig?.dashboardId\r\n ) {\r\n <!-- Dialog placeholder - will be rendered in modal when triggered -->\r\n <div\r\n [attr.data-dialog-id]=\"\r\n dialog.config?.serviceConfig?.dashboardId\r\n \"\r\n ></div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Runtime page-filter sidebar: renders the configured filters and,\r\n on Apply, pushes their values onto the URL so charts reload. -->\r\n @if (showFilters() && hasPageFilters()) {\r\n @if (!filtersPanelOpen()) {\r\n <mt-button\r\n class=\"filters-toggle fixed end-4 top-4 z-50\"\r\n [label]=\"t('filters')\"\r\n icon=\"general.filter-funnel-01\"\r\n size=\"small\"\r\n [tooltip]=\"t('filters')\"\r\n (onClick)=\"toggleFiltersPanel()\"\r\n />\r\n }\r\n\r\n @if (filtersPanelOpen()) {\r\n <button\r\n type=\"button\"\r\n class=\"filters-sidebar-backdrop fixed inset-0 z-30 border-0 bg-black/20 md:hidden\"\r\n [attr.aria-label]=\"t('close')\"\r\n (click)=\"closeFiltersPanel()\"\r\n ></button>\r\n }\r\n\r\n <mt-page-filter-sidebar\r\n class=\"filters-sidebar fixed end-0 top-0 bottom-0 z-40 w-72 border-s border-surface-200 bg-surface-card shadow-lg\"\r\n [class.open]=\"filtersPanelOpen()\"\r\n [filters]=\"filters()\"\r\n [initialValues]=\"store.getQueryParams()\"\r\n (filtersApplied)=\"onPageFilterChange($event)\"\r\n (closeRequested)=\"closeFiltersPanel()\"\r\n />\r\n }\r\n } @else if (loading()) {\r\n <!-- Loading State -->\r\n <div class=\"flex items-center justify-center h-64\">\r\n <div class=\"text-center\">\r\n <i\r\n class=\"mti mti-loader-2 text-4xl text-primary animate-spin mb-2\"\r\n ></i>\r\n <p class=\"text-muted-color\">{{ t(\"loading\") }}</p>\r\n </div>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".mt-dashboard-viewer{width:100%;height:100%}.dashboard-viewer-layout-wrapper{width:100%}.dashboard-viewer-layout{display:grid;grid-template-columns:repeat(36,minmax(0,1fr));grid-auto-rows:60px;gap:10px;width:100%;align-items:stretch}.dashboard-viewer-item{display:flex;min-width:0;min-height:0}.dashboard-viewer-item>*{width:100%;height:100%}.dashboard-viewer-content-item{display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}.dashboard-viewer-item--header{z-index:1;overflow:hidden;border:1px solid var(--p-surface-200, #e5e7eb);border-radius:.5rem;background:var(--p-surface-0, #fff);box-shadow:0 1px 2px #0f172a14}.dashboard-viewer-item--topbar{z-index:2;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}.group-container{background-color:var(--surface-card)}.group-header{flex-shrink:0}.group-tabs{flex-wrap:wrap}.group-body{background-color:var(--surface-0)}.header-item{background-color:transparent}.topbar-item{background-color:var(--surface-50)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.filters-sidebar{max-width:calc(100vw - 1rem);pointer-events:none;transform:translate(100%);transition:transform .3s ease-in-out}.filters-sidebar.open{pointer-events:auto;transform:translate(0)}.filters-toggle{max-width:calc(100vw - 2rem)}[dir=rtl] .filters-sidebar{transform:translate(-100%)}[dir=rtl] .filters-sidebar.open{transform:translate(0)}.table-responsive{max-height:75vh;overflow-y:auto;overflow-x:auto}.modal-content{border:0!important}.custom-donut-chart{display:flex;justify-content:center;height:auto!important}.custom-donut-chart canvas{margin-top:-1.5rem!important}@media(max-width:768px){.dashboard-viewer-layout{display:flex;flex-direction:column;min-height:0!important}.dashboard-viewer-item{min-height:220px}.dashboard-viewer-item--header,.dashboard-viewer-item--topbar{min-height:72px}.dashboard-viewer-item--group{min-height:280px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { kind: "component", type: PageFilterSidebar, selector: "mt-page-filter-sidebar", inputs: ["filters", "initialValues"], outputs: ["filtersApplied", "closeRequested"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
42659
42858
  }
42660
42859
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardViewer, decorators: [{
42661
42860
  type: Component,
@@ -42667,7 +42866,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
42667
42866
  DashboardItem,
42668
42867
  Page,
42669
42868
  PageFilterSidebar,
42670
- ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('dashboard')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n }\r\n\r\n <!-- Reusable viewer content template -->\r\n <ng-template #viewerContent>\r\n <div class=\"relative h-full min-h-[600px] mt-dashboard-viewer\">\r\n @if (!loading() && hasRenderableContent()) {\r\n <div class=\"dashboard-viewer-layout-wrapper\">\r\n <div\r\n class=\"dashboard-viewer-layout\"\r\n [style.min-height]=\"layoutHeight()\"\r\n >\r\n @for (\r\n item of visibleItems();\r\n track trackByDashboardId($index, item)\r\n ) {\r\n <div\r\n class=\"dashboard-viewer-item\"\r\n [class.dashboard-viewer-item--group]=\"isGroup(item)\"\r\n [class.dashboard-viewer-item--header]=\"isHeader(item)\"\r\n [class.dashboard-viewer-item--topbar]=\"isTopbar(item)\"\r\n [style.grid-column]=\"getGridColumn(item)\"\r\n [style.grid-row]=\"getGridRow(item)\"\r\n >\r\n <!-- Group Container -->\r\n @if (isGroup(item)) {\r\n @if (!item.loading) {\r\n <div\r\n class=\"group-container h-full flex flex-col rounded-lg border border-surface-200 overflow-hidden\"\r\n [style.background-color]=\"\r\n getStyleConfig(item)['background-color'] ||\r\n 'var(--surface-card)'\r\n \"\r\n >\r\n <!-- Group Header with Tabs -->\r\n <div\r\n class=\"group-header flex items-center justify-between px-4 py-2 bg-surface-50 border-b border-surface-200\"\r\n >\r\n <span class=\"font-medium text-sm\">{{\r\n getGroupTitle(item)\r\n }}</span>\r\n <div class=\"group-tabs flex items-center gap-1\">\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let gIndex = $index\r\n ) {\r\n @if (getItemIcon(child); as icon) {\r\n <button\r\n type=\"button\"\r\n class=\"w-8 h-8 flex items-center justify-center rounded transition-colors\"\r\n [class.bg-primary-100]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-primary-600]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-muted-color]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n >\r\n <i class=\"mti mti-{{ icon }}\"></i>\r\n </button>\r\n } @else {\r\n <button\r\n pButton\r\n type=\"button\"\r\n class=\"p-button-text p-button-sm\"\r\n [class.p-button-primary]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.p-button-secondary]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [label]=\"getItemTitle(child)\"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n ></button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Group Body - Selected Child Content -->\r\n <div class=\"group-body flex-1 min-h-0\">\r\n @if (\r\n item.selectedGroupIndex !== null &&\r\n item.selectedGroupIndex !== undefined\r\n ) {\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let cIndex = $index\r\n ) {\r\n @if (\r\n cIndex === item.selectedGroupIndex &&\r\n !child.loading\r\n ) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"child.config\"\r\n [chartTypeId]=\"child.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig\r\n ?.ignoreQueryFilter ?? false\r\n \"\r\n [inGroup]=\"true\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n <!-- Header Item -->\r\n @else if (isHeader(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Topbar Item -->\r\n @else if (isTopbar(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Regular Chart Item -->\r\n @else {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Hidden Dialogs (for modal rendering) -->\r\n @if (dialogs().length > 0) {\r\n <div class=\"hidden\">\r\n @for (\r\n dialog of dialogs();\r\n track dialog.config?.serviceConfig?.dashboardId\r\n ) {\r\n <!-- Dialog placeholder - will be rendered in modal when triggered -->\r\n <div\r\n [attr.data-dialog-id]=\"\r\n dialog.config?.serviceConfig?.dashboardId\r\n \"\r\n ></div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Runtime page-filter sidebar: renders the configured filters and,\r\n on Apply, pushes their values onto the URL so charts reload. -->\r\n @if (showFilters() && hasPageFilters()) {\n @if (!filtersPanelOpen()) {\n <mt-button\n class=\"filters-toggle fixed end-4 top-4 z-50\"\n [label]=\"t('filters')\"\n icon=\"general.filter-funnel-01\"\n size=\"small\"\n [tooltip]=\"t('filters')\"\n (onClick)=\"toggleFiltersPanel()\"\n />\n }\n\n @if (filtersPanelOpen()) {\n <button\n type=\"button\"\n class=\"filters-sidebar-backdrop fixed inset-0 z-30 border-0 bg-black/20 md:hidden\"\n [attr.aria-label]=\"t('close')\"\n (click)=\"closeFiltersPanel()\"\n ></button>\n }\n\n <mt-page-filter-sidebar\n class=\"filters-sidebar fixed end-0 top-0 bottom-0 z-40 w-72 border-s border-surface-200 bg-surface-card shadow-lg\"\n [class.open]=\"filtersPanelOpen()\"\n [filters]=\"filters()\"\n [initialValues]=\"store.getQueryParams()\"\n (filtersApplied)=\"onPageFilterChange($event)\"\n (closeRequested)=\"closeFiltersPanel()\"\n />\n }\n } @else if (loading()) {\r\n <!-- Loading State -->\r\n <div class=\"flex items-center justify-center h-64\">\r\n <div class=\"text-center\">\r\n <i\r\n class=\"mti mti-loader-2 text-4xl text-primary animate-spin mb-2\"\r\n ></i>\r\n <p class=\"text-muted-color\">{{ t(\"loading\") }}</p>\r\n </div>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".mt-dashboard-viewer{width:100%;height:100%}.dashboard-viewer-layout-wrapper{width:100%}.dashboard-viewer-layout{display:grid;grid-template-columns:repeat(36,minmax(0,1fr));grid-auto-rows:60px;gap:10px;width:100%;align-items:stretch}.dashboard-viewer-item{display:flex;min-width:0;min-height:0}.dashboard-viewer-item>*{width:100%;height:100%}.dashboard-viewer-content-item{display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}.dashboard-viewer-item--header{z-index:1;overflow:hidden;border:1px solid var(--p-surface-200, #e5e7eb);border-radius:.5rem;background:var(--p-surface-0, #fff);box-shadow:0 1px 2px #0f172a14}.dashboard-viewer-item--topbar{z-index:2;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}.group-container{background-color:var(--surface-card)}.group-header{flex-shrink:0}.group-tabs{flex-wrap:wrap}.group-body{background-color:var(--surface-0)}.header-item{background-color:transparent}.topbar-item{background-color:var(--surface-50)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.filters-sidebar{max-width:calc(100vw - 1rem);pointer-events:none;transform:translate(100%);transition:transform .3s ease-in-out}.filters-sidebar.open{pointer-events:auto;transform:translate(0)}.filters-toggle{max-width:calc(100vw - 2rem)}[dir=rtl] .filters-sidebar{transform:translate(-100%)}[dir=rtl] .filters-sidebar.open{transform:translate(0)}.table-responsive{max-height:75vh;overflow-y:auto;overflow-x:auto}.modal-content{border:0!important}.custom-donut-chart{display:flex;justify-content:center;height:auto!important}.custom-donut-chart canvas{margin-top:-1.5rem!important}@media(max-width:768px){.dashboard-viewer-layout{display:flex;flex-direction:column;min-height:0!important}.dashboard-viewer-item{min-height:220px}.dashboard-viewer-item--header,.dashboard-viewer-item--topbar{min-height:72px}.dashboard-viewer-item--group{min-height:280px}}\n"] }]
42869
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('dashboard')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"viewerContent\" />\r\n }\r\n\r\n <!-- Reusable viewer content template -->\r\n <ng-template #viewerContent>\r\n <div class=\"relative h-full min-h-[600px] mt-dashboard-viewer\">\r\n @if (!loading() && hasRenderableContent()) {\r\n <div class=\"dashboard-viewer-layout-wrapper\">\r\n <div\r\n class=\"dashboard-viewer-layout\"\r\n [style.min-height]=\"layoutHeight()\"\r\n >\r\n @for (\r\n item of visibleItems();\r\n track trackByDashboardId($index, item)\r\n ) {\r\n <div\r\n class=\"dashboard-viewer-item\"\r\n [class.dashboard-viewer-item--group]=\"isGroup(item)\"\r\n [class.dashboard-viewer-item--header]=\"isHeader(item)\"\r\n [class.dashboard-viewer-item--topbar]=\"isTopbar(item)\"\r\n [style.grid-column]=\"getGridColumn(item)\"\r\n [style.grid-row]=\"getGridRow(item)\"\r\n >\r\n <!-- Group Container -->\r\n @if (isGroup(item)) {\r\n @if (!item.loading) {\r\n <div\r\n class=\"group-container h-full flex flex-col rounded-lg border border-surface-200 overflow-hidden\"\r\n [style.background-color]=\"\r\n getStyleConfig(item)['background-color'] ||\r\n 'var(--surface-card)'\r\n \"\r\n >\r\n <!-- Group Header with Tabs -->\r\n <div\r\n class=\"group-header flex items-center justify-between px-4 py-2 bg-surface-50 border-b border-surface-200\"\r\n >\r\n <span class=\"font-medium text-sm\">{{\r\n getGroupTitle(item)\r\n }}</span>\r\n <div class=\"group-tabs flex items-center gap-1\">\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let gIndex = $index\r\n ) {\r\n @if (getItemIcon(child); as icon) {\r\n <button\r\n type=\"button\"\r\n class=\"w-8 h-8 flex items-center justify-center rounded transition-colors\"\r\n [class.bg-primary-100]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-primary-600]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.text-muted-color]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n >\r\n <i class=\"mti mti-{{ icon }}\"></i>\r\n </button>\r\n } @else {\r\n <button\r\n pButton\r\n type=\"button\"\r\n class=\"p-button-text p-button-sm\"\r\n [class.p-button-primary]=\"\r\n item.selectedGroupIndex === gIndex\r\n \"\r\n [class.p-button-secondary]=\"\r\n item.selectedGroupIndex !== gIndex\r\n \"\r\n [label]=\"getItemTitle(child)\"\r\n (click)=\"selectGroupChild(item, gIndex)\"\r\n ></button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Group Body - Selected Child Content -->\r\n <div class=\"group-body flex-1 min-h-0\">\r\n @if (\r\n item.selectedGroupIndex !== null &&\r\n item.selectedGroupIndex !== undefined\r\n ) {\r\n @for (\r\n child of getGroupChildren(item);\r\n track child.config?.serviceConfig?.dashboardId;\r\n let cIndex = $index\r\n ) {\r\n @if (\r\n cIndex === item.selectedGroupIndex &&\r\n !child.loading\r\n ) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"child.config\"\r\n [chartTypeId]=\"child.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig\r\n ?.ignoreQueryFilter ?? false\r\n \"\r\n [inGroup]=\"true\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n <!-- Header Item -->\r\n @else if (isHeader(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Topbar Item -->\r\n @else if (isTopbar(item)) {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n <!-- Regular Chart Item -->\r\n @else {\r\n @if (!item.loading) {\r\n <mt-dashboard-item\r\n class=\"dashboard-viewer-content-item\"\r\n [config]=\"item.config\"\r\n [chartTypeId]=\"item.chartTypeId\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n [extraFilters]=\"extraFilters()\"\r\n [ignoreQueryFilter]=\"\r\n pageConfig()?.dashboardConfig?.ignoreQueryFilter ??\r\n false\r\n \"\r\n [inGroup]=\"false\"\r\n >\r\n </mt-dashboard-item>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Hidden Dialogs (for modal rendering) -->\r\n @if (dialogs().length > 0) {\r\n <div class=\"hidden\">\r\n @for (\r\n dialog of dialogs();\r\n track dialog.config?.serviceConfig?.dashboardId\r\n ) {\r\n <!-- Dialog placeholder - will be rendered in modal when triggered -->\r\n <div\r\n [attr.data-dialog-id]=\"\r\n dialog.config?.serviceConfig?.dashboardId\r\n \"\r\n ></div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Runtime page-filter sidebar: renders the configured filters and,\r\n on Apply, pushes their values onto the URL so charts reload. -->\r\n @if (showFilters() && hasPageFilters()) {\r\n @if (!filtersPanelOpen()) {\r\n <mt-button\r\n class=\"filters-toggle fixed end-4 top-4 z-50\"\r\n [label]=\"t('filters')\"\r\n icon=\"general.filter-funnel-01\"\r\n size=\"small\"\r\n [tooltip]=\"t('filters')\"\r\n (onClick)=\"toggleFiltersPanel()\"\r\n />\r\n }\r\n\r\n @if (filtersPanelOpen()) {\r\n <button\r\n type=\"button\"\r\n class=\"filters-sidebar-backdrop fixed inset-0 z-30 border-0 bg-black/20 md:hidden\"\r\n [attr.aria-label]=\"t('close')\"\r\n (click)=\"closeFiltersPanel()\"\r\n ></button>\r\n }\r\n\r\n <mt-page-filter-sidebar\r\n class=\"filters-sidebar fixed end-0 top-0 bottom-0 z-40 w-72 border-s border-surface-200 bg-surface-card shadow-lg\"\r\n [class.open]=\"filtersPanelOpen()\"\r\n [filters]=\"filters()\"\r\n [initialValues]=\"store.getQueryParams()\"\r\n (filtersApplied)=\"onPageFilterChange($event)\"\r\n (closeRequested)=\"closeFiltersPanel()\"\r\n />\r\n }\r\n } @else if (loading()) {\r\n <!-- Loading State -->\r\n <div class=\"flex items-center justify-center h-64\">\r\n <div class=\"text-center\">\r\n <i\r\n class=\"mti mti-loader-2 text-4xl text-primary animate-spin mb-2\"\r\n ></i>\r\n <p class=\"text-muted-color\">{{ t(\"loading\") }}</p>\r\n </div>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [".mt-dashboard-viewer{width:100%;height:100%}.dashboard-viewer-layout-wrapper{width:100%}.dashboard-viewer-layout{display:grid;grid-template-columns:repeat(36,minmax(0,1fr));grid-auto-rows:60px;gap:10px;width:100%;align-items:stretch}.dashboard-viewer-item{display:flex;min-width:0;min-height:0}.dashboard-viewer-item>*{width:100%;height:100%}.dashboard-viewer-content-item{display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}.dashboard-viewer-item--header{z-index:1;overflow:hidden;border:1px solid var(--p-surface-200, #e5e7eb);border-radius:.5rem;background:var(--p-surface-0, #fff);box-shadow:0 1px 2px #0f172a14}.dashboard-viewer-item--topbar{z-index:2;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}.group-container{background-color:var(--surface-card)}.group-header{flex-shrink:0}.group-tabs{flex-wrap:wrap}.group-body{background-color:var(--surface-0)}.header-item{background-color:transparent}.topbar-item{background-color:var(--surface-50)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.filters-sidebar{max-width:calc(100vw - 1rem);pointer-events:none;transform:translate(100%);transition:transform .3s ease-in-out}.filters-sidebar.open{pointer-events:auto;transform:translate(0)}.filters-toggle{max-width:calc(100vw - 2rem)}[dir=rtl] .filters-sidebar{transform:translate(-100%)}[dir=rtl] .filters-sidebar.open{transform:translate(0)}.table-responsive{max-height:75vh;overflow-y:auto;overflow-x:auto}.modal-content{border:0!important}.custom-donut-chart{display:flex;justify-content:center;height:auto!important}.custom-donut-chart canvas{margin-top:-1.5rem!important}@media(max-width:768px){.dashboard-viewer-layout{display:flex;flex-direction:column;min-height:0!important}.dashboard-viewer-item{min-height:220px}.dashboard-viewer-item--header,.dashboard-viewer-item--topbar{min-height:72px}.dashboard-viewer-item--group{min-height:280px}}\n"] }]
42671
42870
  }], propDecorators: { isPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPage", required: false }] }], pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], backButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "backButton", required: false }] }], pageId: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageId", required: false }] }], dashboardData: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardData", required: false }] }], chartsData: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartsData", required: false }] }], dialogsData: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogsData", required: false }] }], filtersData: [{ type: i0.Input, args: [{ isSignal: true, alias: "filtersData", required: false }] }], extraFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraFilters", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], pageLoaded: [{ type: i0.Output, args: ["pageLoaded"] }], onBack: [{ type: i0.Output, args: ["onBack"] }], chartClick: [{ type: i0.Output, args: ["chartClick"] }] } });
42672
42871
 
42673
42872
  /**
@@ -45860,4 +46059,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
45860
46059
  */
45861
46060
 
45862
46061
  export { SPlusChartHandler as $, TopbarCardComponent as A, ChartDataService as B, CardContentComponent as C, DashboardItemStoreService as D, EChartComponent as E, FilterUtilsService as F, BarChartHandler as G, HeaderCardComponent as H, PieChartHandler as I, StackBarChartHandler as J, axisFormatters as K, LastHistoryLevelCardComponent as L, groupDatesByYearAndMonth as M, GaugeChartHandler as N, TableViewHandler as O, PropertiesCardComponent as P, OverviewCardHandler as Q, TimelineHandler as R, StaticFiltersComponent as S, TableCardComponent as T, LineChartHandler as U, SnapshotHandler as V, ComparisonChartHandler as W, SplitterChartHandler as X, LevelCardHandler as Y, MapChartHandler as Z, RingGaugeChartHandler as _, DashboardItem as a, moduleIdFromSelector as a$, PhaseGateStepperHandler as a0, formatCurrency as a1, getCurrencySuffix as a2, formatPercentage as a3, formatNumber as a4, formatDate as a5, createAxisFormatter as a6, createTooltipFormatter as a7, formatWordsUnderBar as a8, formatXAxis as a9, expandResetPatches as aA, StyleField as aB, SegmentedField as aC, ColorListField as aD, ArrayBuilderField as aE, KeyValueMapField as aF, LegendOrderField as aG, ItemCardMenuComponent as aH, ChartFilterDrawer as aI, ItemContextToolbarComponent as aJ, ItemConfigPopoverComponent as aK, GuidedConfigDialogComponent as aL, FilterChipsBarComponent as aM, FilterBuilderComponent as aN, DatasourcePanelComponent as aO, SchemaControlRendererComponent as aP, FilterByGroupPipe as aQ, GetChartActionsPipe as aR, CHART_CAPABILITIES as aS, getCapabilityById as aT, resolveCapability as aU, toBackendChartType as aV, normalizeChartTypeForRequest as aW, normalizeFilterOperation as aX, normalizeAggregateFunction as aY, normalizeFilters as aZ, selectorFromLegacy as a_, handleFiltersForCustom as aa, handleFilterForCard as ab, handleFilterForSnapshot as ac, DashboardList as ad, HTTPMethod as ae, DashboardBuilderService as af, DashboardStoreService as ag, ManagePages as ah, ManageBreadcrumb as ai, ManageFilterOnPage as aj, DynamicFiltersConfig as ak, ChartSettingsDrawer as al, DisplaySettings as am, DefaultControlUi as an, PieControlUi as ao, BarControlUi as ap, StackBarControlUi as aq, ManageItem as ar, CHART_TYPES as as, ManageItemService as at, GeneralSettings as au, DataSourceSettings as av, ActionsSettings as aw, ChartViewer as ax, StyleStudioDrawer as ay, StyleSettingsRenderer as az, DashboardBuilder as b, toBackendSourceLink as b0, toFormSourceLink as b1, normalizeOnLoad as b2, normalizeBeforeSave as b3, normalizeBeforeRequest as b4, CONFIG_DOMAINS as b5, domainsForCapability as b6, findDomain as b7, POPOVER_TABS as b8, POPOVER_TAB_SPECS as b9, setByPath as bA, applyControlPatchToPersisted as bB, applyControlPatchesToPersisted as bC, getControlSchema as bD, listControlSchemaIds as bE, listControlSchemas as bF, getFallbackControlSchema as bG, flattenSchema as bH, resolveDisplayFields as bI, buildDisplayFieldPredicate as bJ, bindingKey as bK, getBinding as bL, listBindings as bM, listBindingsForChart as bN, readBoundValue as bO, ITEM_GUIDANCE_REGISTRY as bP, describeGuidance as bQ, ItemGuidanceService as bR, titleToUi as ba, applyTitleToPersisted as bb, datasourceToUi as bc, fieldsToUi as bd, filtersToUi as be, styleToUi as bf, applyStyleToPersisted as bg, layoutToUi as bh, applyLayoutToPersisted as bi, labelLegendFormatToUi as bj, applyLabelLegendFormatToPersisted as bk, behaviorToUi as bl, applyBehaviorToPersisted as bm, applyFilterChipsToPersisted as bn, persistedToUi as bo, buildAssembly as bp, STYLE_PRESETS as bq, presetsForCapability as br, findPreset as bs, validate as bt, hasBlockingIssues as bu, groupIssuesByDomain as bv, parseAdvancedJson as bw, deepMerge$1 as bx, formatForEditor as by, readByPath$1 as bz, cloneDeep$1 as c, DashboardViewer as d, switchAllKeysSmall$1 as e, dynamicTextReplace as f, getNestedData as g, dynamicReorder as h, generalConfiguration as i, formatValue as j, getLocalizedTitle as k, sortChartData as l, addCommasToNumber as m, sortDataTableView as n, isMobilePlatform$1 as o, getColorFromConditions as p, CardFilterComponent as q, DynamicFiltersComponent as r, switchAllKeysToLower as s, CardInfoComponent as t, ChartCardComponent as u, EntityInfoComponent as v, EntityPreviewCardComponent as w, ListStatisticCardComponent as x, SkeletonCardComponent as y, StatisticCardComponent as z };
45863
- //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-RFHndI8h.mjs.map
46062
+ //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-DMDAO3cb.mjs.map