@masterteam/dashboard-builder 0.0.51 → 0.0.52
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.
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-7V8LtcNN.mjs → masterteam-dashboard-builder-dashboard-dialog.component-B_g_lLDx.mjs} +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-7V8LtcNN.mjs.map → masterteam-dashboard-builder-dashboard-dialog.component-B_g_lLDx.mjs.map} +1 -1
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-BPYkRRH5.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-BlBnHwDv.mjs} +46 -10
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-BlBnHwDv.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +2 -2
- package/types/masterteam-dashboard-builder.d.ts +2 -0
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-BPYkRRH5.mjs.map +0 -1
|
@@ -4,7 +4,7 @@ import { CommonModule } from '@angular/common';
|
|
|
4
4
|
import { TranslocoService, TranslocoDirective } from '@jsverse/transloco';
|
|
5
5
|
import { ModalService } from '@masterteam/components/modal';
|
|
6
6
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
7
|
-
import { D as DashboardItemStoreService, F as FilterUtilsService, a as DashboardItem } from './masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
7
|
+
import { D as DashboardItemStoreService, F as FilterUtilsService, a as DashboardItem } from './masterteam-dashboard-builder-masterteam-dashboard-builder-BlBnHwDv.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Dashboard Dialog Component
|
|
@@ -120,4 +120,4 @@ function openDashboardDialog(modalService, config, params, options) {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export { DashboardDialogComponent, openDashboardDialog };
|
|
123
|
-
//# sourceMappingURL=masterteam-dashboard-builder-dashboard-dialog.component-
|
|
123
|
+
//# sourceMappingURL=masterteam-dashboard-builder-dashboard-dialog.component-B_g_lLDx.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-dashboard-builder-dashboard-dialog.component-7V8LtcNN.mjs","sources":["../../../../packages/masterteam/dashboard-builder/src/lib/dashboard-item/components/dashboard-dialog/dashboard-dialog.component.ts","../../../../packages/masterteam/dashboard-builder/src/lib/dashboard-item/components/dashboard-dialog/dashboard-dialog.component.html"],"sourcesContent":["/**\r\n * Dashboard Dialog Component\r\n *\r\n * A flexible dialog wrapper that renders a DashboardItem inside.\r\n * Uses the same ItemConfig structure - maximum code reuse.\r\n *\r\n * The dialog simply wraps DashboardItem, so any chart/table/card\r\n * that works inline will work in a dialog too.\r\n */\r\n\r\nimport {\r\n Component,\r\n inject,\r\n input,\r\n signal,\r\n computed,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { TranslocoDirective, TranslocoService } from '@jsverse/transloco';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ItemConfig } from '../../../models/dashboard.model';\r\nimport { DashboardItemStoreService } from '../../services/item-store.service';\r\nimport { FilterUtilsService } from '../../services/filter-utils.service';\r\nimport { DashboardItem } from '../../dashboard-item';\r\n\r\n/**\r\n * Dashboard Dialog Component\r\n *\r\n * Opened via ModalService, renders a DashboardItem inside.\r\n * Usage:\r\n * this.modalService.open(DashboardDialogComponent, {\r\n * data: { config: itemConfig, params: queryParams }\r\n * });\r\n */\r\n@Component({\r\n selector: 'mt-dashboard-dialog',\r\n standalone: true,\r\n imports: [CommonModule, TranslocoDirective, DashboardItem],\r\n templateUrl: './dashboard-dialog.component.html',\r\n})\r\nexport class DashboardDialogComponent implements OnInit {\r\n private readonly itemStore = inject(DashboardItemStoreService);\r\n private readonly filterUtils = inject(FilterUtilsService);\r\n private readonly transloco = inject(TranslocoService);\r\n readonly modal = inject(ModalService);\r\n private readonly ref = inject(ModalRef);\r\n\r\n // Inputs from modal data\r\n readonly config = input<ItemConfig | null>(null);\r\n readonly params = input<Record<string, any>>({});\r\n readonly title = input<string | null>(null);\r\n\r\n // State\r\n readonly dialogConfig = signal<ItemConfig | null>(null);\r\n readonly actionParams = signal<Record<string, any>>({});\r\n\r\n // Computed\r\n readonly mergedParams = computed(() => ({\r\n ...this.params(),\r\n ...this.actionParams(),\r\n }));\r\n\r\n readonly processedConfig = computed(() => {\r\n const config = this.dialogConfig();\r\n if (!config) return null;\r\n\r\n // Deep clone and process filters\r\n const cloned = JSON.parse(JSON.stringify(config)) as ItemConfig;\r\n\r\n // Apply filter processing if service config exists\r\n if (cloned.serviceConfig) {\r\n const processed = this.filterUtils.handleFiltersForCustom(\r\n cloned.serviceConfig,\r\n this.mergedParams(),\r\n );\r\n cloned.serviceConfig = processed;\r\n }\r\n return cloned;\r\n });\r\n\r\n ngOnInit(): void {\r\n // Set config from input\r\n const config = this.config();\r\n if (config) {\r\n this.dialogConfig.set(config);\r\n }\r\n\r\n // Set params from input\r\n const params = this.params();\r\n if (params) {\r\n this.actionParams.set(params);\r\n }\r\n }\r\n\r\n /**\r\n * Close dialog\r\n */\r\n close(result?: any): void {\r\n this.ref.close(result);\r\n }\r\n\r\n /**\r\n * Handle actions from the inner DashboardItem\r\n */\r\n onItemAction(event: any): void {\r\n // If it's a close action, close the dialog\r\n if (event?.type === 'closeDialog') {\r\n this.close(event?.data);\r\n return;\r\n }\r\n\r\n // For navigation actions, close dialog and let parent handle\r\n if (event?.type === 'navigate' || event?.type === 'navigateTo') {\r\n this.close(event);\r\n return;\r\n }\r\n\r\n // For other action types, the inner mt-dashboard-item already\r\n // dispatches via ActionService — nothing more to do at the dialog host.\r\n }\r\n}\r\n\r\n/**\r\n * Helper service for opening dashboard dialogs\r\n */\r\nexport function openDashboardDialog(\r\n modalService: ModalService,\r\n config: ItemConfig,\r\n params?: Record<string, any>,\r\n options?: {\r\n title?: string;\r\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\r\n },\r\n): ModalRef {\r\n const sizeClass = {\r\n sm: 'max-w-md',\r\n md: 'max-w-2xl',\r\n lg: 'max-w-4xl',\r\n xl: 'max-w-6xl',\r\n full: 'max-w-[95vw]',\r\n }[options?.size || 'lg'];\r\n\r\n return modalService.openModal(DashboardDialogComponent, 'dialog', {\r\n header: options?.title || '',\r\n styleClass: sizeClass,\r\n data: {\r\n config,\r\n params: params || {},\r\n title: options?.title,\r\n },\r\n });\r\n}\r\n","<!--\r\n Inline height is intentional: the global `.mt-dialog .p-dialog-content\r\n .mt-modal-content { height:100% }` rule (common.css, unlayered) overrides any\r\n `h-[80vh]` class, and `.p-dialog` itself has no definite height, so a\r\n class-based height collapses to content. An inline style beats the unlayered\r\n rule, and `80vh` is viewport-relative (definite regardless of ancestors),\r\n giving the inner item -> table the bounded height it needs to scroll.\r\n padding-bottom is zeroed (the global 5rem reserves space for a footer this\r\n dialog does not render).\r\n-->\r\n<div\r\n [class]=\"modal.contentClass + ' flex min-h-[300px] flex-col p-0'\"\r\n style=\"height: 80vh; padding-bottom: 0\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <!-- Dashboard Item renders whatever the config specifies. A definite height\r\n lets the inner table own its scroll (its virtual window depends on the\r\n scroll container, not the outer dialog). -->\r\n @if (processedConfig()) {\r\n <mt-dashboard-item\r\n class=\"block min-h-0 flex-1\"\r\n [config]=\"processedConfig()!\"\r\n [queryParams]=\"mergedParams()\"\r\n [isDialog]=\"true\"\r\n (actionTriggered)=\"onItemAction($event)\"\r\n />\r\n } @else if (config()) {\r\n <!-- Config provided but still being processed -->\r\n <div class=\"flex flex-1 items-center justify-center\">\r\n <i class=\"pi pi-spin pi-spinner text-4xl text-primary\"></i>\r\n </div>\r\n } @else {\r\n <!-- No dialog config could be resolved (linked dialog deleted or failed to\r\n load). Show an explicit unavailable state instead of silently\r\n rendering the wrong widget. -->\r\n <div\r\n class=\"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center\"\r\n >\r\n <i class=\"pi pi-exclamation-triangle text-4xl text-surface-400\"></i>\r\n <p class=\"text-surface-600 dark:text-surface-300\">\r\n {{ t(\"dialogUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n</div>\r\n<!--\r\n<div [class]=\"modal.footerClass\" *transloco=\"let t; prefix: 'dashboard'\">\r\n <mt-button [label]=\"t('close')\" severity=\"secondary\" (onClick)=\"close()\" />\r\n</div> -->\r\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;AAQG;AAmBH;;;;;;;;AAQG;MAOU,wBAAwB,CAAA;AAClB,IAAA,SAAS,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAC7C,IAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACxC,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC5C,IAAA,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;AACpB,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAG9B,IAAA,MAAM,GAAG,KAAK,CAAoB,IAAI,6EAAC;AACvC,IAAA,MAAM,GAAG,KAAK,CAAsB,EAAE,6EAAC;AACvC,IAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;;AAGlC,IAAA,YAAY,GAAG,MAAM,CAAoB,IAAI,mFAAC;AAC9C,IAAA,YAAY,GAAG,MAAM,CAAsB,EAAE,mFAAC;;AAG9C,IAAA,YAAY,GAAG,QAAQ,CAAC,OAAO;QACtC,GAAG,IAAI,CAAC,MAAM,EAAE;QAChB,GAAG,IAAI,CAAC,YAAY,EAAE;AACvB,KAAA,CAAC,mFAAC;AAEM,IAAA,eAAe,GAAG,QAAQ,CAAC,MAAK;AACvC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE;AAClC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,IAAI;;A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I,EAAE;YACJ,MAAM;YACN,MAAM,EAAE,MAAM,IAAI,EAAE;YACpB,KAAK,EAAE,OAAO,EAAE,KAAK;AACtB,SAAA;AACF,KAAA,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-dashboard-builder-dashboard-dialog.component-B_g_lLDx.mjs","sources":["../../../../packages/masterteam/dashboard-builder/src/lib/dashboard-item/components/dashboard-dialog/dashboard-dialog.component.ts","../../../../packages/masterteam/dashboard-builder/src/lib/dashboard-item/components/dashboard-dialog/dashboard-dialog.component.html"],"sourcesContent":["/**\r\n * Dashboard Dialog Component\r\n *\r\n * A flexible dialog wrapper that renders a DashboardItem inside.\r\n * Uses the same ItemConfig structure - maximum code reuse.\r\n *\r\n * The dialog simply wraps DashboardItem, so any chart/table/card\r\n * that works inline will work in a dialog too.\r\n */\r\n\r\nimport {\r\n Component,\r\n inject,\r\n input,\r\n signal,\r\n computed,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { TranslocoDirective, TranslocoService } from '@jsverse/transloco';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ItemConfig } from '../../../models/dashboard.model';\r\nimport { DashboardItemStoreService } from '../../services/item-store.service';\r\nimport { FilterUtilsService } from '../../services/filter-utils.service';\r\nimport { DashboardItem } from '../../dashboard-item';\r\n\r\n/**\r\n * Dashboard Dialog Component\r\n *\r\n * Opened via ModalService, renders a DashboardItem inside.\r\n * Usage:\r\n * this.modalService.open(DashboardDialogComponent, {\r\n * data: { config: itemConfig, params: queryParams }\r\n * });\r\n */\r\n@Component({\r\n selector: 'mt-dashboard-dialog',\r\n standalone: true,\r\n imports: [CommonModule, TranslocoDirective, DashboardItem],\r\n templateUrl: './dashboard-dialog.component.html',\r\n})\r\nexport class DashboardDialogComponent implements OnInit {\r\n private readonly itemStore = inject(DashboardItemStoreService);\r\n private readonly filterUtils = inject(FilterUtilsService);\r\n private readonly transloco = inject(TranslocoService);\r\n readonly modal = inject(ModalService);\r\n private readonly ref = inject(ModalRef);\r\n\r\n // Inputs from modal data\r\n readonly config = input<ItemConfig | null>(null);\r\n readonly params = input<Record<string, any>>({});\r\n readonly title = input<string | null>(null);\r\n\r\n // State\r\n readonly dialogConfig = signal<ItemConfig | null>(null);\r\n readonly actionParams = signal<Record<string, any>>({});\r\n\r\n // Computed\r\n readonly mergedParams = computed(() => ({\r\n ...this.params(),\r\n ...this.actionParams(),\r\n }));\r\n\r\n readonly processedConfig = computed(() => {\r\n const config = this.dialogConfig();\r\n if (!config) return null;\r\n\r\n // Deep clone and process filters\r\n const cloned = JSON.parse(JSON.stringify(config)) as ItemConfig;\r\n\r\n // Apply filter processing if service config exists\r\n if (cloned.serviceConfig) {\r\n const processed = this.filterUtils.handleFiltersForCustom(\r\n cloned.serviceConfig,\r\n this.mergedParams(),\r\n );\r\n cloned.serviceConfig = processed;\r\n }\r\n return cloned;\r\n });\r\n\r\n ngOnInit(): void {\r\n // Set config from input\r\n const config = this.config();\r\n if (config) {\r\n this.dialogConfig.set(config);\r\n }\r\n\r\n // Set params from input\r\n const params = this.params();\r\n if (params) {\r\n this.actionParams.set(params);\r\n }\r\n }\r\n\r\n /**\r\n * Close dialog\r\n */\r\n close(result?: any): void {\r\n this.ref.close(result);\r\n }\r\n\r\n /**\r\n * Handle actions from the inner DashboardItem\r\n */\r\n onItemAction(event: any): void {\r\n // If it's a close action, close the dialog\r\n if (event?.type === 'closeDialog') {\r\n this.close(event?.data);\r\n return;\r\n }\r\n\r\n // For navigation actions, close dialog and let parent handle\r\n if (event?.type === 'navigate' || event?.type === 'navigateTo') {\r\n this.close(event);\r\n return;\r\n }\r\n\r\n // For other action types, the inner mt-dashboard-item already\r\n // dispatches via ActionService — nothing more to do at the dialog host.\r\n }\r\n}\r\n\r\n/**\r\n * Helper service for opening dashboard dialogs\r\n */\r\nexport function openDashboardDialog(\r\n modalService: ModalService,\r\n config: ItemConfig,\r\n params?: Record<string, any>,\r\n options?: {\r\n title?: string;\r\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\r\n },\r\n): ModalRef {\r\n const sizeClass = {\r\n sm: 'max-w-md',\r\n md: 'max-w-2xl',\r\n lg: 'max-w-4xl',\r\n xl: 'max-w-6xl',\r\n full: 'max-w-[95vw]',\r\n }[options?.size || 'lg'];\r\n\r\n return modalService.openModal(DashboardDialogComponent, 'dialog', {\r\n header: options?.title || '',\r\n styleClass: sizeClass,\r\n data: {\r\n config,\r\n params: params || {},\r\n title: options?.title,\r\n },\r\n });\r\n}\r\n","<!--\r\n Inline height is intentional: the global `.mt-dialog .p-dialog-content\r\n .mt-modal-content { height:100% }` rule (common.css, unlayered) overrides any\r\n `h-[80vh]` class, and `.p-dialog` itself has no definite height, so a\r\n class-based height collapses to content. An inline style beats the unlayered\r\n rule, and `80vh` is viewport-relative (definite regardless of ancestors),\r\n giving the inner item -> table the bounded height it needs to scroll.\r\n padding-bottom is zeroed (the global 5rem reserves space for a footer this\r\n dialog does not render).\r\n-->\r\n<div\r\n [class]=\"modal.contentClass + ' flex min-h-[300px] flex-col p-0'\"\r\n style=\"height: 80vh; padding-bottom: 0\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <!-- Dashboard Item renders whatever the config specifies. A definite height\r\n lets the inner table own its scroll (its virtual window depends on the\r\n scroll container, not the outer dialog). -->\r\n @if (processedConfig()) {\r\n <mt-dashboard-item\r\n class=\"block min-h-0 flex-1\"\r\n [config]=\"processedConfig()!\"\r\n [queryParams]=\"mergedParams()\"\r\n [isDialog]=\"true\"\r\n (actionTriggered)=\"onItemAction($event)\"\r\n />\r\n } @else if (config()) {\r\n <!-- Config provided but still being processed -->\r\n <div class=\"flex flex-1 items-center justify-center\">\r\n <i class=\"pi pi-spin pi-spinner text-4xl text-primary\"></i>\r\n </div>\r\n } @else {\r\n <!-- No dialog config could be resolved (linked dialog deleted or failed to\r\n load). Show an explicit unavailable state instead of silently\r\n rendering the wrong widget. -->\r\n <div\r\n class=\"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center\"\r\n >\r\n <i class=\"pi pi-exclamation-triangle text-4xl text-surface-400\"></i>\r\n <p class=\"text-surface-600 dark:text-surface-300\">\r\n {{ t(\"dialogUnavailable\") }}\r\n </p>\r\n </div>\r\n }\r\n</div>\r\n<!--\r\n<div [class]=\"modal.footerClass\" *transloco=\"let t; prefix: 'dashboard'\">\r\n <mt-button [label]=\"t('close')\" severity=\"secondary\" (onClick)=\"close()\" />\r\n</div> -->\r\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;AAQG;AAmBH;;;;;;;;AAQG;MAOU,wBAAwB,CAAA;AAClB,IAAA,SAAS,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAC7C,IAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACxC,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC5C,IAAA,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;AACpB,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAG9B,IAAA,MAAM,GAAG,KAAK,CAAoB,IAAI,6EAAC;AACvC,IAAA,MAAM,GAAG,KAAK,CAAsB,EAAE,6EAAC;AACvC,IAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;;AAGlC,IAAA,YAAY,GAAG,MAAM,CAAoB,IAAI,mFAAC;AAC9C,IAAA,YAAY,GAAG,MAAM,CAAsB,EAAE,mFAAC;;AAG9C,IAAA,YAAY,GAAG,QAAQ,CAAC,OAAO;QACtC,GAAG,IAAI,CAAC,MAAM,EAAE;QAChB,GAAG,IAAI,CAAC,YAAY,EAAE;AACvB,KAAA,CAAC,mFAAC;AAEM,IAAA,eAAe,GAAG,QAAQ,CAAC,MAAK;AACvC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE;AAClC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,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AAA,IAAI,EAAE;YACJ,MAAM;YACN,MAAM,EAAE,MAAM,IAAI,EAAE;YACpB,KAAK,EAAE,OAAO,EAAE,KAAK;AACtB,SAAA;AACF,KAAA,CAAC;AACJ;;;;"}
|
|
@@ -17226,20 +17226,31 @@ class LevelCardHandler {
|
|
|
17226
17226
|
* [[{ data: levelProps }]]
|
|
17227
17227
|
*/
|
|
17228
17228
|
handlelevelCardsWithFilter(result, _config) {
|
|
17229
|
+
const languageCode = this.storeService.languageCode();
|
|
17229
17230
|
const levelProps = result?.values?.map((value) => {
|
|
17230
17231
|
const arrayProps = Object.values(value);
|
|
17231
|
-
const
|
|
17232
|
-
const
|
|
17232
|
+
const normalizedProps = arrayProps.map((prop) => this.normalizeLevelCardProperty(prop, languageCode));
|
|
17233
|
+
const title = normalizedProps.find((item) => item?.normalizedKey?.toLowerCase() == 'name')?.value;
|
|
17234
|
+
const id = normalizedProps.find((item) => item?.normalizedKey?.toLowerCase() == 'id')?.value;
|
|
17233
17235
|
const levelBody = {
|
|
17234
17236
|
name: title,
|
|
17235
17237
|
id: id,
|
|
17236
|
-
props:
|
|
17238
|
+
props: normalizedProps,
|
|
17237
17239
|
ignoreCheckVisable: true,
|
|
17238
17240
|
};
|
|
17239
17241
|
return levelBody;
|
|
17240
17242
|
});
|
|
17241
17243
|
return [[{ data: levelProps }]];
|
|
17242
17244
|
}
|
|
17245
|
+
normalizeLevelCardProperty(prop, languageCode) {
|
|
17246
|
+
const displayValue = this.getDisplayValue(prop, languageCode);
|
|
17247
|
+
const shouldRenderDisplayValue = this.shouldRenderLevelCardDisplayValue(prop);
|
|
17248
|
+
return {
|
|
17249
|
+
...prop,
|
|
17250
|
+
displayValue,
|
|
17251
|
+
value: shouldRenderDisplayValue ? displayValue : prop?.value,
|
|
17252
|
+
};
|
|
17253
|
+
}
|
|
17243
17254
|
/**
|
|
17244
17255
|
* Handle grouped level cards (multiple selections)
|
|
17245
17256
|
* Returns data directly
|
|
@@ -17318,7 +17329,7 @@ class LevelCardHandler {
|
|
|
17318
17329
|
normalizedKey: prop.normalizedKey || prop.key || '',
|
|
17319
17330
|
label: prop.label?.[languageCode] || prop.label || prop.key || '',
|
|
17320
17331
|
value: prop.value,
|
|
17321
|
-
displayValue: this.getDisplayValue(prop),
|
|
17332
|
+
displayValue: this.getDisplayValue(prop, languageCode),
|
|
17322
17333
|
viewType: prop.viewType,
|
|
17323
17334
|
color: prop.value?.details?.color || prop.value?.color,
|
|
17324
17335
|
}));
|
|
@@ -17357,7 +17368,7 @@ class LevelCardHandler {
|
|
|
17357
17368
|
normalizedKey: prop.normalizedKey || prop.key || '',
|
|
17358
17369
|
label: prop.label?.[languageCode] || prop.label || prop.key || '',
|
|
17359
17370
|
value: prop.value,
|
|
17360
|
-
displayValue: this.getDisplayValue(prop),
|
|
17371
|
+
displayValue: this.getDisplayValue(prop, languageCode),
|
|
17361
17372
|
viewType: prop.viewType,
|
|
17362
17373
|
color: prop.value?.details?.color || prop.value?.color,
|
|
17363
17374
|
icon: prop.icon,
|
|
@@ -17372,7 +17383,7 @@ class LevelCardHandler {
|
|
|
17372
17383
|
normalizedKey: key,
|
|
17373
17384
|
label: key,
|
|
17374
17385
|
value,
|
|
17375
|
-
displayValue: this.getDisplayValue({ value, viewType: typeof value }),
|
|
17386
|
+
displayValue: this.getDisplayValue({ value, viewType: typeof value }, languageCode),
|
|
17376
17387
|
viewType: typeof value === 'number' ? 'Number' : 'Text',
|
|
17377
17388
|
});
|
|
17378
17389
|
});
|
|
@@ -17406,7 +17417,7 @@ class LevelCardHandler {
|
|
|
17406
17417
|
/**
|
|
17407
17418
|
* Get display value from property
|
|
17408
17419
|
*/
|
|
17409
|
-
getDisplayValue(prop) {
|
|
17420
|
+
getDisplayValue(prop, languageCode = 'en') {
|
|
17410
17421
|
const value = prop?.value;
|
|
17411
17422
|
if (value === null || value === undefined) {
|
|
17412
17423
|
return '-';
|
|
@@ -17441,14 +17452,39 @@ class LevelCardHandler {
|
|
|
17441
17452
|
return value?.display || value?.displayName || String(value);
|
|
17442
17453
|
default:
|
|
17443
17454
|
if (typeof value === 'object') {
|
|
17455
|
+
// Common shape for multilingual text fields, e.g. { en, ar }.
|
|
17456
|
+
const localized = value?.[languageCode] || value?.['en'] || value?.['ar'];
|
|
17444
17457
|
return (value?.displayValue ||
|
|
17445
17458
|
value?.displayName ||
|
|
17446
17459
|
value?.name ||
|
|
17447
|
-
|
|
17460
|
+
localized ||
|
|
17461
|
+
'-');
|
|
17448
17462
|
}
|
|
17449
17463
|
return String(value);
|
|
17450
17464
|
}
|
|
17451
17465
|
}
|
|
17466
|
+
shouldRenderLevelCardDisplayValue(prop) {
|
|
17467
|
+
const value = prop?.value;
|
|
17468
|
+
if (value === null || value === undefined) {
|
|
17469
|
+
return true;
|
|
17470
|
+
}
|
|
17471
|
+
if (typeof value !== 'object') {
|
|
17472
|
+
return false;
|
|
17473
|
+
}
|
|
17474
|
+
const viewType = String(prop?.viewType ?? '').toLowerCase();
|
|
17475
|
+
return ![
|
|
17476
|
+
'attachment',
|
|
17477
|
+
'connection',
|
|
17478
|
+
'leafdetails',
|
|
17479
|
+
'location',
|
|
17480
|
+
'lookup',
|
|
17481
|
+
'lookupmatrix',
|
|
17482
|
+
'lookupmodulechecklist',
|
|
17483
|
+
'scheduleitemselector',
|
|
17484
|
+
'status',
|
|
17485
|
+
'user',
|
|
17486
|
+
].includes(viewType);
|
|
17487
|
+
}
|
|
17452
17488
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LevelCardHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17453
17489
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LevelCardHandler, providedIn: 'root' });
|
|
17454
17490
|
}
|
|
@@ -20499,7 +20535,7 @@ class ActionService {
|
|
|
20499
20535
|
dialogConfig?.clientConfig?.title?.['ar'] ||
|
|
20500
20536
|
'';
|
|
20501
20537
|
// Dynamically import DashboardDialogComponent to avoid circular dependency
|
|
20502
|
-
import('./masterteam-dashboard-builder-dashboard-dialog.component-
|
|
20538
|
+
import('./masterteam-dashboard-builder-dashboard-dialog.component-B_g_lLDx.mjs').then(({ DashboardDialogComponent }) => {
|
|
20503
20539
|
// Open dialog using ModalService
|
|
20504
20540
|
this.modalService.openModal(DashboardDialogComponent, 'dialog', {
|
|
20505
20541
|
header: title,
|
|
@@ -45342,4 +45378,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
45342
45378
|
*/
|
|
45343
45379
|
|
|
45344
45380
|
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 };
|
|
45345
|
-
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
45381
|
+
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-BlBnHwDv.mjs.map
|