@masterteam/dashboard-builder 0.0.21 → 0.0.22

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.
@@ -439,8 +439,7 @@ class DashboardStoreService {
439
439
  /** Dynamic key-value store */
440
440
  dynamicStore = signal({}, ...(ngDevMode ? [{ debugName: "dynamicStore" }] : /* istanbul ignore next */ []));
441
441
  /** Language code */
442
- languageCode = signal(document.dir == 'ltr' ? 'ar' :
443
- 'en', ...(ngDevMode ? [{ debugName: "languageCode" }] : /* istanbul ignore next */ []));
442
+ languageCode = signal(document.dir == 'ltr' ? 'ar' : 'en', ...(ngDevMode ? [{ debugName: "languageCode" }] : /* istanbul ignore next */ []));
444
443
  /** Direction */
445
444
  direction = signal(document.dir || 'ltr', ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
446
445
  /** Inside Report Viewer flag - controls text truncation in charts */
@@ -7749,16 +7748,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
7749
7748
  *
7750
7749
  * Number, currency, and date formatting utilities.
7751
7750
  */
7752
- /**
7753
- * Get current language code from localStorage
7754
- */
7755
- function getLanguageCode() {
7756
- return localStorage.getItem('langCode') || 'en';
7757
- }
7758
7751
  /**
7759
7752
  * Format large numbers with suffixes (K, M, B, T)
7760
7753
  */
7761
- function formatCurrency(value, config) {
7754
+ function formatCurrency(value, config, langCode = 'en') {
7762
7755
  if (value === null || value === undefined) {
7763
7756
  return '_';
7764
7757
  }
@@ -7766,7 +7759,6 @@ function formatCurrency(value, config) {
7766
7759
  if (isNaN(numValue)) {
7767
7760
  return String(value);
7768
7761
  }
7769
- const langCode = getLanguageCode();
7770
7762
  const decimals = config?.decimals ?? 1;
7771
7763
  const arabicSuffixes = {
7772
7764
  thousand: ' ألف',
@@ -7830,7 +7822,7 @@ function formatPercentage(value, decimals = 1) {
7830
7822
  /**
7831
7823
  * Format number with locale
7832
7824
  */
7833
- function formatNumber(value, options) {
7825
+ function formatNumber(value, options, langCode = 'en') {
7834
7826
  if (value === null || value === undefined) {
7835
7827
  return '_';
7836
7828
  }
@@ -7838,14 +7830,13 @@ function formatNumber(value, options) {
7838
7830
  if (isNaN(numValue)) {
7839
7831
  return String(value);
7840
7832
  }
7841
- const langCode = getLanguageCode();
7842
7833
  const locale = langCode === 'ar' ? 'ar-SA' : 'en-US';
7843
7834
  return new Intl.NumberFormat(locale, options).format(numValue);
7844
7835
  }
7845
7836
  /**
7846
7837
  * Format date
7847
7838
  */
7848
- function formatDate(value, format) {
7839
+ function formatDate(value, format, langCode = 'en') {
7849
7840
  if (!value) {
7850
7841
  return '_';
7851
7842
  }
@@ -7853,7 +7844,6 @@ function formatDate(value, format) {
7853
7844
  if (isNaN(date.getTime())) {
7854
7845
  return String(value);
7855
7846
  }
7856
- const langCode = getLanguageCode();
7857
7847
  const locale = langCode === 'ar' ? 'ar-SA' : 'en-US';
7858
7848
  const formatOptions = {
7859
7849
  short: { day: 'numeric', month: 'numeric', year: '2-digit' },
@@ -7880,15 +7870,15 @@ function createAxisFormatter(config) {
7880
7870
  /**
7881
7871
  * Formatter for ECharts tooltip values
7882
7872
  */
7883
- function createTooltipFormatter(config) {
7873
+ function createTooltipFormatter(config, langCode = 'en') {
7884
7874
  return (value) => {
7885
7875
  switch (config?.type) {
7886
7876
  case 'currency':
7887
- return formatCurrency(value, { handleLang: true });
7877
+ return formatCurrency(value, { handleLang: true }, langCode);
7888
7878
  case 'percentage':
7889
7879
  return formatPercentage(value);
7890
7880
  default:
7891
- return formatNumber(value);
7881
+ return formatNumber(value, undefined, langCode);
7892
7882
  }
7893
7883
  };
7894
7884
  }
@@ -7945,13 +7935,13 @@ function formatWordsUnderBar(text, maxCharsPerLine = 10, insideReport = false) {
7945
7935
  /**
7946
7936
  * Format date to month name
7947
7937
  */
7948
- function formatDateToMonth(dateValue, shortFormat = false) {
7938
+ function formatDateToMonth(dateValue, shortFormat = false, langCode = 'en') {
7949
7939
  try {
7950
7940
  const date = dateValue instanceof Date ? dateValue : new Date(dateValue);
7951
7941
  if (isNaN(date.getTime())) {
7952
7942
  return String(dateValue);
7953
7943
  }
7954
- return date.toLocaleString('default', {
7944
+ return date.toLocaleString(langCode === 'ar' ? 'ar-SA' : 'en-US', {
7955
7945
  month: shortFormat ? 'short' : 'long',
7956
7946
  });
7957
7947
  }
@@ -7965,21 +7955,20 @@ function formatDateToMonth(dateValue, shortFormat = false) {
7965
7955
  * @param value - The X-axis category value (typically a date string)
7966
7956
  * @param configFormat - Configuration object with type and format options
7967
7957
  */
7968
- function formatXAxis(value, configFormat) {
7958
+ function formatXAxis(value, configFormat, langCode = 'en') {
7969
7959
  if (!configFormat || !configFormat.type) {
7970
7960
  return String(value);
7971
7961
  }
7972
7962
  switch (configFormat.type) {
7973
7963
  case 'dateToMonth':
7974
7964
  case 'month':
7975
- return formatDateToMonth(value, configFormat.shortFormate);
7965
+ return formatDateToMonth(value, configFormat.shortFormate, langCode);
7976
7966
  case 'date':
7977
7967
  try {
7978
7968
  const date = value instanceof Date ? value : new Date(value);
7979
7969
  if (isNaN(date.getTime())) {
7980
7970
  return String(value);
7981
7971
  }
7982
- const langCode = getLanguageCode();
7983
7972
  const locale = langCode === 'ar' ? 'ar-SA' : 'en-US';
7984
7973
  // Use Intl.DateTimeFormat for custom formatting
7985
7974
  if (configFormat.customDateFormat) {
@@ -8028,9 +8017,9 @@ const generalConfiguration = {
8028
8017
  /**
8029
8018
  * Format value based on config format (matches old Formater function)
8030
8019
  */
8031
- function formatValue(value, configFormat) {
8020
+ function formatValue(value, configFormat, langCode = 'en') {
8032
8021
  if (configFormat?.type === 'currency') {
8033
- return formatCurrency(value, configFormat);
8022
+ return formatCurrency(value, configFormat, langCode);
8034
8023
  }
8035
8024
  else if (configFormat?.type === 'percentage') {
8036
8025
  return ((value ? Number(value.toFixed(2)) : value) || 0) + '%';
@@ -8048,7 +8037,7 @@ function formatValue(value, configFormat) {
8048
8037
  return value;
8049
8038
  }
8050
8039
  const shortMonth = configFormat?.shortFormate !== false;
8051
- return date.toLocaleString('default', {
8040
+ return date.toLocaleString(langCode === 'ar' ? 'ar-SA' : 'en-US', {
8052
8041
  month: shortMonth ? 'short' : 'long',
8053
8042
  });
8054
8043
  }
@@ -8236,12 +8225,11 @@ function sortDataTableView(data, sortConfig) {
8236
8225
  /**
8237
8226
  * Get localized title from object
8238
8227
  */
8239
- function getLocalizedTitle(titleObj) {
8228
+ function getLocalizedTitle(titleObj, langCode = 'en') {
8240
8229
  if (!titleObj)
8241
8230
  return '';
8242
8231
  if (typeof titleObj === 'string')
8243
8232
  return titleObj;
8244
- const langCode = getLanguageCode();
8245
8233
  return titleObj[langCode] || titleObj.en || '';
8246
8234
  }
8247
8235
  /**
@@ -8985,7 +8973,7 @@ class BarChartHandler {
8985
8973
  * Returns ECharts option directly (exactly like old BarChartService.handleBarChart)
8986
8974
  */
8987
8975
  handleBarChart(dataResponse, config) {
8988
- const languageCode = getLanguageCode();
8976
+ const languageCode = this.storeService.languageCode();
8989
8977
  const insideReportViewer = this.storeService.insideReportViewer();
8990
8978
  const clientConfig = config.clientConfig || {};
8991
8979
  const configAsType = clientConfig.configAsType || {};
@@ -9148,7 +9136,9 @@ class BarChartHandler {
9148
9136
  fontSize: generalConfiguration?.fontConfig?.fontSizeConfig?.label,
9149
9137
  formatter: (params) => {
9150
9138
  const total = params.value;
9151
- return total ? formatNumber(total, clientConfig?.['format']) : '';
9139
+ return total
9140
+ ? formatNumber(total, clientConfig?.['format'], languageCode)
9141
+ : '';
9152
9142
  },
9153
9143
  },
9154
9144
  showBackground: configAsType?.['Background']?.show,
@@ -9163,7 +9153,7 @@ class BarChartHandler {
9163
9153
  formatter: (params) => {
9164
9154
  return params
9165
9155
  .map((param) => {
9166
- const value = formatNumber(param.value, clientConfig?.['format']);
9156
+ const value = formatNumber(param.value, clientConfig?.['format'], languageCode);
9167
9157
  const showValueOnlyInTooltip = barOverride?.showValueOnlyInTooltip;
9168
9158
  if (showValueOnlyInTooltip) {
9169
9159
  return value;
@@ -9271,7 +9261,7 @@ class BarChartHandler {
9271
9261
  * Format X axis value using the formatXAxis utility
9272
9262
  */
9273
9263
  formatXAxisValue(value, formatConfig) {
9274
- return formatXAxis(value, formatConfig);
9264
+ return formatXAxis(value, formatConfig, this.storeService.languageCode());
9275
9265
  }
9276
9266
  /**
9277
9267
  * Resolve bar corner radius with backward-compatible values:
@@ -9336,7 +9326,7 @@ class BarChartHandler {
9336
9326
  type: 'currency',
9337
9327
  showCurrency: barOverride.showCurrency || false,
9338
9328
  handleLang: true,
9339
- });
9329
+ }, this.storeService.languageCode());
9340
9330
  case 'percentage':
9341
9331
  return ((value ? Math.round(value) : value) || 0) + '%';
9342
9332
  case 'number':
@@ -9509,7 +9499,7 @@ class BarChartHandler {
9509
9499
  * Transforms bar chart data into entity preview format (flat array of properties)
9510
9500
  */
9511
9501
  handleEntityPreviewWithFormula(dataResponse, config) {
9512
- const languageCode = getLanguageCode();
9502
+ const languageCode = this.storeService.languageCode();
9513
9503
  const clientConfig = config.clientConfig || {};
9514
9504
  const configAsType = clientConfig.configAsType || {};
9515
9505
  const defaultColor = configAsType?.['defaultColors']?.[0] || '#4caf50';
@@ -9548,7 +9538,7 @@ class BarChartHandler {
9548
9538
  label = labelMap.get(key?.toLowerCase());
9549
9539
  }
9550
9540
  // Format the value using the configured format
9551
- const formattedValue = formatValue(bar.value, clientConfig?.['format']);
9541
+ const formattedValue = formatValue(bar.value, clientConfig?.['format'], languageCode);
9552
9542
  // Get color from barTypes array or defaultColors
9553
9543
  const barColor = bar.color ||
9554
9544
  colorMap.get(key?.toLowerCase()) ||
@@ -9585,12 +9575,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
9585
9575
  * Exactly matches old DountChartService.handleDonutChart implementation.
9586
9576
  */
9587
9577
  class PieChartHandler {
9578
+ storeService = inject(DashboardStoreService);
9588
9579
  /**
9589
9580
  * handleDonutChart - matches functionName from CHART_TYPES
9590
9581
  * Returns ECharts option directly (exactly like old DountChartService.handleDonutChart)
9591
9582
  */
9592
9583
  handleDonutChart(dataResponse, config) {
9593
- const languageCode = getLanguageCode();
9584
+ const languageCode = this.storeService.languageCode();
9594
9585
  const clientConfig = config.clientConfig || {};
9595
9586
  const configAsType = clientConfig.configAsType || {};
9596
9587
  const pieOverride = clientConfig.pieConfigOverried;
@@ -9661,7 +9652,7 @@ class PieChartHandler {
9661
9652
  // Calculate total and remaining value
9662
9653
  const actualTotal = seriesData.reduce((sum, item) => (item.isStaticProperty === true ? sum : sum + item.value), 0);
9663
9654
  const remainingValue = actualTotal;
9664
- const formattedTotal = formatNumber(remainingValue, clientConfig?.['format']);
9655
+ const formattedTotal = formatNumber(remainingValue, clientConfig?.['format'], languageCode);
9665
9656
  // Apply color and label overrides based on conditions for all slices (before building legends)
9666
9657
  seriesData.forEach((item, index) => {
9667
9658
  if (item.isStaticProperty)
@@ -9711,7 +9702,7 @@ class PieChartHandler {
9711
9702
  if (params.data?.isStaticProperty === true && isPercentage) {
9712
9703
  return ''; // Hide label for remaining area
9713
9704
  }
9714
- return formatNumber(params.value, clientConfig?.['format']);
9705
+ return formatNumber(params.value, clientConfig?.['format'], languageCode);
9715
9706
  }),
9716
9707
  };
9717
9708
  // Build legends
@@ -9784,7 +9775,7 @@ class PieChartHandler {
9784
9775
  if (params.data?.isStaticProperty === true && isPercentage) {
9785
9776
  return ''; // Hide tooltip for remaining area
9786
9777
  }
9787
- const value = formatNumber(params.value, clientConfig?.['format']);
9778
+ const value = formatNumber(params.value, clientConfig?.['format'], languageCode);
9788
9779
  return `${params.name}: ${value} (${params.percent}%)`;
9789
9780
  },
9790
9781
  backgroundColor: '#fff',
@@ -10164,7 +10155,7 @@ class StackBarChartHandler {
10164
10155
  * handleStackBarChart - matches functionName from CHART_TYPES
10165
10156
  */
10166
10157
  handleStackBarChart(dataResponse, config) {
10167
- const languageCode = getLanguageCode();
10158
+ const languageCode = this.storeService.languageCode();
10168
10159
  const isNormalization = config.clientConfig?.configAsType?.['isNormalization'];
10169
10160
  const valuesArray = dataResponse.values || [];
10170
10161
  const isSingleDefault = valuesArray?.some((value) => value.category === 'Default');
@@ -10464,7 +10455,7 @@ class StackBarChartHandler {
10464
10455
  const rawValue = params.data.originalValue;
10465
10456
  if (rawValue === 0)
10466
10457
  return '';
10467
- return formatNumber(rawValue, clientConfig?.['format']);
10458
+ return formatNumber(rawValue, clientConfig?.['format'], languageCode);
10468
10459
  },
10469
10460
  fontFamily: generalConfiguration?.fontConfig?.fontFamily,
10470
10461
  fontSize: generalConfiguration?.fontConfig?.fontSizeConfig?.label,
@@ -10521,7 +10512,7 @@ class StackBarChartHandler {
10521
10512
  show: configAsType?.['label']?.['showTotalInTop'],
10522
10513
  position: isHorizontal ? 'right' : 'top',
10523
10514
  formatter: (params) => {
10524
- return formatNumber(params.data.originalTotal, clientConfig?.['format']);
10515
+ return formatNumber(params.data.originalTotal, clientConfig?.['format'], languageCode);
10525
10516
  },
10526
10517
  fontFamily: generalConfiguration?.fontConfig?.fontFamily,
10527
10518
  fontSize: generalConfiguration?.fontConfig?.fontSizeConfig?.label,
@@ -10562,7 +10553,7 @@ class StackBarChartHandler {
10562
10553
  return;
10563
10554
  const series = allSeriesData[param.seriesIndex];
10564
10555
  const rawValue = param.data?.originalValue ?? param.value;
10565
- const formattedValue = formatNumber(rawValue, clientConfig?.['format']);
10556
+ const formattedValue = formatNumber(rawValue, clientConfig?.['format'], languageCode);
10566
10557
  if (series?.barType === 'lineAccumulated') {
10567
10558
  tooltipHtml +=
10568
10559
  languageCode === 'ar'
@@ -10622,7 +10613,7 @@ class StackBarChartHandler {
10622
10613
  formatter: (value) => {
10623
10614
  const yAxisFormat = clientConfig?.['stackBarConfigOverride']?.['yAxisFormat'];
10624
10615
  if (yAxisFormat) {
10625
- return formatNumber(value, yAxisFormat);
10616
+ return formatNumber(value, yAxisFormat, languageCode);
10626
10617
  }
10627
10618
  return value;
10628
10619
  },
@@ -10790,7 +10781,7 @@ class StackBarChartHandler {
10790
10781
  yAxis.axisLabel.formatter = (value) => {
10791
10782
  const yAxisFormat = stackBarOverride?.yAxisFormat;
10792
10783
  if (yAxisFormat) {
10793
- return formatNumber(value, yAxisFormat);
10784
+ return formatNumber(value, yAxisFormat, languageCode);
10794
10785
  }
10795
10786
  return value;
10796
10787
  };
@@ -11070,12 +11061,13 @@ function groupDatesByYearAndMonth(data, valueAggregator = (values) => values.red
11070
11061
  * Matches exactly the old GaugeChartService behavior.
11071
11062
  */
11072
11063
  class GaugeChartHandler {
11064
+ storeService = inject(DashboardStoreService);
11073
11065
  /**
11074
11066
  * handleGaugeChart - matches functionName from CHART_TYPES
11075
11067
  * Returns ECharts config directly (exactly like old GaugeChartService)
11076
11068
  */
11077
11069
  handleGaugeChart(dataResponse, config) {
11078
- const languageCode = getLanguageCode();
11070
+ const languageCode = this.storeService.languageCode();
11079
11071
  const clientConfig = config.clientConfig || {};
11080
11072
  const configAsType = clientConfig.configAsType || {};
11081
11073
  const overrideLabels = configAsType?.['overrideLabels'];
@@ -11127,7 +11119,7 @@ class GaugeChartHandler {
11127
11119
  labelFontSize: 11,
11128
11120
  totalValueFontSize: 30,
11129
11121
  labelFormatter: (params) => {
11130
- return formatNumber(params.value, clientConfig?.['format']);
11122
+ return formatNumber(params.value, clientConfig?.['format'], languageCode);
11131
11123
  },
11132
11124
  };
11133
11125
  const noData = seriesData.length === 0;
@@ -11184,6 +11176,7 @@ const generalConfig = {
11184
11176
  },
11185
11177
  };
11186
11178
  class TableViewHandler {
11179
+ storeService = inject(DashboardStoreService);
11187
11180
  /**
11188
11181
  * handleTableView - matches functionName from CHART_TYPES
11189
11182
  * Returns data directly (not wrapped in { type, data, config })
@@ -11203,7 +11196,7 @@ class TableViewHandler {
11203
11196
  * Returns eCharts bar chart config directly (like old HandleProjectsByExecutionPeriod)
11204
11197
  */
11205
11198
  handleProjectsByExecutionPeriod(dataResponse, config) {
11206
- const languageCode = getLanguageCode();
11199
+ const languageCode = this.storeService.languageCode();
11207
11200
  const projects = dataResponse.values || [];
11208
11201
  const ONE_DAY = 1000 * 3600 * 24;
11209
11202
  const today = new Date();
@@ -11341,7 +11334,7 @@ class TableViewHandler {
11341
11334
  fontFamily: generalConfig?.fontConfig?.fontFamily,
11342
11335
  fontSize: generalConfig?.fontConfig?.fontSizeConfig?.label,
11343
11336
  formatter: (params) => {
11344
- return formatNumber(params.value, format);
11337
+ return formatNumber(params.value, format, languageCode);
11345
11338
  },
11346
11339
  },
11347
11340
  startDateForPeriod: item?.startDateForPeriod,
@@ -11358,7 +11351,7 @@ class TableViewHandler {
11358
11351
  axisPointer: { type: 'shadow' },
11359
11352
  formatter: (params) => {
11360
11353
  const groupData = groupedProjects[params[0].dataIndex];
11361
- let tooltip = `${params[0].marker} ${groupData.label?.[languageCode]}: ${formatNumber(params[0].value, format)}<br/>`;
11354
+ let tooltip = `${params[0].marker} ${groupData.label?.[languageCode]}: ${formatNumber(params[0].value, format, languageCode)}<br/>`;
11362
11355
  if (groupData.projects.length > 0) {
11363
11356
  tooltip +=
11364
11357
  languageCode === 'ar' ? ' المشاريع <br/>' : 'Projects:<br/>';
@@ -11396,12 +11389,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
11396
11389
  * Returns EXACT same format as old OverviewCardService.
11397
11390
  */
11398
11391
  class OverviewCardHandler {
11392
+ storeService = inject(DashboardStoreService);
11399
11393
  /**
11400
11394
  * handleOverviewCard - matches functionName from CHART_TYPES
11401
11395
  * Returns EXACT same format as old OverviewCardService
11402
11396
  */
11403
11397
  handleOverviewCard(data, config) {
11404
- const languageCode = getLanguageCode();
11398
+ const languageCode = this.storeService.languageCode();
11405
11399
  const clientConfig = config.clientConfig || {};
11406
11400
  const configAsType = clientConfig.configAsType || {};
11407
11401
  const format = clientConfig?.['format'];
@@ -11464,7 +11458,7 @@ class OverviewCardHandler {
11464
11458
  const resultObj = getConfig(clientConfig.title?.[languageCode] || '', configAsType?.['subTitle']?.[languageCode] || '', value, isClickable, value);
11465
11459
  // Format the value
11466
11460
  if (value !== null && value !== undefined) {
11467
- resultObj.value = formatNumber(value, format);
11461
+ resultObj.value = formatNumber(value, format, languageCode);
11468
11462
  }
11469
11463
  // Handle currency tooltip (same as old)
11470
11464
  if (format?.type === 'currency' && format?.showCurrencyTooltip) {
@@ -12053,12 +12047,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
12053
12047
  * Returns ECharts config directly (not wrapped in { type, data, chartOptions }).
12054
12048
  */
12055
12049
  class LineChartHandler {
12050
+ storeService = inject(DashboardStoreService);
12056
12051
  /**
12057
12052
  * handleLineChart - matches functionName from CHART_TYPES
12058
12053
  * Returns ECharts config directly with noData, width, divClass properties
12059
12054
  */
12060
12055
  handleLineChart(dataResponse, config) {
12061
- const languageCode = getLanguageCode();
12056
+ const languageCode = this.storeService.languageCode();
12062
12057
  const clientConfig = config.clientConfig || {};
12063
12058
  const configAsType = clientConfig.configAsType || {};
12064
12059
  const format = clientConfig?.['format'];
@@ -12109,7 +12104,9 @@ class LineChartHandler {
12109
12104
  show: configAsType?.['label']?.show,
12110
12105
  position: 'top',
12111
12106
  formatter: (params) => {
12112
- return params.value ? formatNumber(params.value, format) : '';
12107
+ return params.value
12108
+ ? formatNumber(params.value, format, languageCode)
12109
+ : '';
12113
12110
  },
12114
12111
  },
12115
12112
  };
@@ -12183,7 +12180,7 @@ class LineChartHandler {
12183
12180
  fontSize: 11,
12184
12181
  fontFamily: 'inherit',
12185
12182
  color: '#666',
12186
- formatter: (value) => formatNumber(value, format),
12183
+ formatter: (value) => formatNumber(value, format, languageCode),
12187
12184
  },
12188
12185
  splitLine: {
12189
12186
  lineStyle: {
@@ -12207,7 +12204,7 @@ class LineChartHandler {
12207
12204
  params.forEach((param) => {
12208
12205
  result += `<div style="display: flex; align-items: center; gap: 6px">`;
12209
12206
  result += `<span style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: ${param.color}"></span>`;
12210
- result += `<span>${param.seriesName}: ${formatNumber(param.value, format)}</span>`;
12207
+ result += `<span>${param.seriesName}: ${formatNumber(param.value, format, languageCode)}</span>`;
12211
12208
  result += `</div>`;
12212
12209
  });
12213
12210
  return result;
@@ -12293,6 +12290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
12293
12290
  * Returns ECharts options directly (matching old SnapShotService format).
12294
12291
  */
12295
12292
  class SnapshotHandler {
12293
+ storeService = inject(DashboardStoreService);
12296
12294
  /**
12297
12295
  * handleSnapShot - matches functionName from CHART_TYPES
12298
12296
  * Returns ECharts option directly (same as old SnapShotService)
@@ -12314,7 +12312,7 @@ class SnapshotHandler {
12314
12312
  handleSnapShotLineChart(data, config) {
12315
12313
  const propsForView = config.serviceConfig?.query?.['selectedProperties'] || [];
12316
12314
  const xAxisLabels = data.map((item) => item.timeFrame?.key || '');
12317
- const languageCode = getLanguageCode();
12315
+ const languageCode = this.storeService.languageCode();
12318
12316
  const clientConfig = config.clientConfig || {};
12319
12317
  const configAsType = clientConfig['configAsType'] || {};
12320
12318
  const overrideLabels = configAsType['overrideLabels'];
@@ -12347,7 +12345,9 @@ class SnapshotHandler {
12347
12345
  position: 'top',
12348
12346
  formatter: (params) => {
12349
12347
  const value = params.value;
12350
- return value ? formatValue(value, clientConfig['format']) : '';
12348
+ return value
12349
+ ? formatValue(value, clientConfig['format'], languageCode)
12350
+ : '';
12351
12351
  },
12352
12352
  },
12353
12353
  };
@@ -12394,7 +12394,7 @@ class SnapshotHandler {
12394
12394
  formatter: function (params) {
12395
12395
  let tooltipHtml = `${params[0].name}<br/>`;
12396
12396
  params.forEach((param) => {
12397
- const value = formatValue(param?.value, clientConfig['format']);
12397
+ const value = formatValue(param?.value, clientConfig['format'], languageCode);
12398
12398
  tooltipHtml +=
12399
12399
  languageCode === 'ar'
12400
12400
  ? `${param.marker} ${param.seriesName}&nbsp;&nbsp;${value}<br/>`
@@ -12491,7 +12491,7 @@ class SnapshotHandler {
12491
12491
  const configAsType = clientConfig['configAsType'] || {};
12492
12492
  const propsForView = configAsType['propsForView'] || [];
12493
12493
  const xAxisLabels = data.map((item) => item.timeFrame?.key || '');
12494
- const languageCode = getLanguageCode();
12494
+ const languageCode = this.storeService.languageCode();
12495
12495
  const seriesData = propsForView.map((prop) => {
12496
12496
  const dataValues = data.map((item) => item[prop?.key]?.rawValue);
12497
12497
  return {
@@ -12539,7 +12539,7 @@ class SnapshotHandler {
12539
12539
  formatter: function (params) {
12540
12540
  let tooltipHtml = `${params[0].name}<br/>`;
12541
12541
  params.forEach((param) => {
12542
- const value = formatValue(param?.value, clientConfig['format']);
12542
+ const value = formatValue(param?.value, clientConfig['format'], languageCode);
12543
12543
  tooltipHtml +=
12544
12544
  languageCode === 'ar'
12545
12545
  ? `${param.marker} ${param.seriesName}&nbsp;&nbsp;${value}<br/>`
@@ -12644,13 +12644,14 @@ function convertDateToString(date) {
12644
12644
  return `${year}-${month}-${day}`;
12645
12645
  }
12646
12646
  class ComparisonChartHandler {
12647
+ storeService = inject(DashboardStoreService);
12647
12648
  /**
12648
12649
  * Main handler for comparison charts
12649
12650
  * Returns ECharts config directly with noData, width, divClass properties
12650
12651
  * (matches old ComparisonChartService.handleComparisonChart format)
12651
12652
  */
12652
12653
  handle(dataResponse, config) {
12653
- const languageCode = getLanguageCode();
12654
+ const languageCode = this.storeService.languageCode();
12654
12655
  const labels = dataResponse?.labels || [];
12655
12656
  const values = dataResponse?.values || [];
12656
12657
  const noData = values?.length === 0;
@@ -12691,7 +12692,7 @@ class ComparisonChartHandler {
12691
12692
  fontFamily: generalConfiguration?.fontConfig?.fontFamily,
12692
12693
  fontSize: generalConfiguration?.fontConfig?.fontSizeConfig?.label,
12693
12694
  formatter: (params) => {
12694
- return formatValue(params.value, config.clientConfig?.['format']);
12695
+ return formatValue(params.value, config.clientConfig?.['format'], languageCode);
12695
12696
  },
12696
12697
  },
12697
12698
  });
@@ -12766,8 +12767,8 @@ class ComparisonChartHandler {
12766
12767
  params.forEach((param) => {
12767
12768
  tooltipHtml +=
12768
12769
  languageCode === 'ar'
12769
- ? `${param.marker} ${param.seriesName}&nbsp;&nbsp;${formatValue(param.value, config.clientConfig?.['format'])}<br/>`
12770
- : `${param.marker} ${param.seriesName} ${formatValue(param.value, config.clientConfig?.['format'])}<br/>`;
12770
+ ? `${param.marker} ${param.seriesName}&nbsp;&nbsp;${formatValue(param.value, config.clientConfig?.['format'], languageCode)}<br/>`
12771
+ : `${param.marker} ${param.seriesName} ${formatValue(param.value, config.clientConfig?.['format'], languageCode)}<br/>`;
12771
12772
  });
12772
12773
  return tooltipHtml;
12773
12774
  },
@@ -12883,7 +12884,7 @@ class ComparisonChartHandler {
12883
12884
  */
12884
12885
  parseComparisonData(dataResponse, config) {
12885
12886
  const items = [];
12886
- const languageCode = getLanguageCode();
12887
+ const languageCode = this.storeService.languageCode();
12887
12888
  const _configAsType = config.clientConfig?.configAsType || {};
12888
12889
  if (Array.isArray(dataResponse?.categories)) {
12889
12890
  dataResponse.categories.forEach((cat, index) => {
@@ -12926,7 +12927,6 @@ class ComparisonChartHandler {
12926
12927
  */
12927
12928
  parseYoYData(dataResponse, _config) {
12928
12929
  const items = [];
12929
- const _languageCode = getLanguageCode();
12930
12930
  if (dataResponse?.years) {
12931
12931
  Object.entries(dataResponse.years).forEach(([year, data]) => {
12932
12932
  if (Array.isArray(data)) {
@@ -12955,7 +12955,6 @@ class ComparisonChartHandler {
12955
12955
  */
12956
12956
  parsePlannedActualData(dataResponse, config) {
12957
12957
  const items = [];
12958
- const _languageCode = getLanguageCode();
12959
12958
  const configAsType = config.clientConfig?.configAsType || {};
12960
12959
  const plannedKey = configAsType['plannedKey'] || 'planned';
12961
12960
  const actualKey = configAsType['actualKey'] || 'actual';
@@ -12982,7 +12981,7 @@ class ComparisonChartHandler {
12982
12981
  * Build comparison bar chart
12983
12982
  */
12984
12983
  buildComparisonChart(items, config) {
12985
- const languageCode = getLanguageCode();
12984
+ const languageCode = this.storeService.languageCode();
12986
12985
  const isRTL = languageCode === 'ar';
12987
12986
  const configAsType = config.clientConfig?.configAsType || {};
12988
12987
  const colors = configAsType['defaultColors'] || [
@@ -13013,14 +13012,14 @@ class ComparisonChartHandler {
13013
13012
  return '';
13014
13013
  let result = `<div style="font-weight:bold;margin-bottom:4px">${params[0].axisValue}</div>`;
13015
13014
  params.forEach((p) => {
13016
- result += `<div>${p.marker} ${p.seriesName}: ${formatNumber(p.value)}</div>`;
13015
+ result += `<div>${p.marker} ${p.seriesName}: ${formatNumber(p.value, undefined, languageCode)}</div>`;
13017
13016
  });
13018
13017
  // Add variance if available
13019
13018
  const item = items.find((i) => i.category === params[0].axisValue);
13020
13019
  if (item?.variance !== undefined) {
13021
13020
  const sign = item.variance >= 0 ? '+' : '';
13022
13021
  const color = item.variance >= 0 ? '#4caf50' : '#f44336';
13023
- result += `<div style="margin-top:4px;color:${color}">Variance: ${sign}${formatNumber(item.variance)} (${sign}${item.variancePercent?.toFixed(1)}%)</div>`;
13022
+ result += `<div style="margin-top:4px;color:${color}">Variance: ${sign}${formatNumber(item.variance, undefined, languageCode)} (${sign}${item.variancePercent?.toFixed(1)}%)</div>`;
13024
13023
  }
13025
13024
  return result;
13026
13025
  },
@@ -13048,7 +13047,7 @@ class ComparisonChartHandler {
13048
13047
  yAxis: {
13049
13048
  type: 'value',
13050
13049
  axisLabel: {
13051
- formatter: (value) => formatNumber(value),
13050
+ formatter: (value) => formatNumber(value, undefined, languageCode),
13052
13051
  fontFamily: '"Cairo", sans-serif',
13053
13052
  },
13054
13053
  },
@@ -13084,7 +13083,7 @@ class ComparisonChartHandler {
13084
13083
  return '';
13085
13084
  let result = `<div style="font-weight:bold">${params[0].axisValue}</div>`;
13086
13085
  params.forEach((p) => {
13087
- result += `<div>${p.marker} ${p.seriesName}: ${formatNumber(p.value)}</div>`;
13086
+ result += `<div>${p.marker} ${p.seriesName}: ${formatNumber(p.value, undefined, this.storeService.languageCode())}</div>`;
13088
13087
  });
13089
13088
  return result;
13090
13089
  },
@@ -13110,7 +13109,7 @@ class ComparisonChartHandler {
13110
13109
  yAxis: {
13111
13110
  type: 'value',
13112
13111
  axisLabel: {
13113
- formatter: (value) => formatNumber(value),
13112
+ formatter: (value) => formatNumber(value, undefined, this.storeService.languageCode()),
13114
13113
  fontFamily: '"Cairo", sans-serif',
13115
13114
  },
13116
13115
  },
@@ -13121,7 +13120,7 @@ class ComparisonChartHandler {
13121
13120
  * Build Planned vs Actual chart with variance indicators
13122
13121
  */
13123
13122
  buildPlannedActualChart(items, config) {
13124
- const languageCode = getLanguageCode();
13123
+ const languageCode = this.storeService.languageCode();
13125
13124
  const isRTL = languageCode === 'ar';
13126
13125
  const configAsType = config.clientConfig?.configAsType || {};
13127
13126
  const plannedColor = configAsType['plannedColor'] || '#2196f3';
@@ -13137,13 +13136,13 @@ class ComparisonChartHandler {
13137
13136
  const item = items.find((i) => i.category === params[0].axisValue);
13138
13137
  let result = `<div style="font-weight:bold;margin-bottom:4px">${params[0].axisValue}</div>`;
13139
13138
  params.forEach((p) => {
13140
- result += `<div>${p.marker} ${p.seriesName}: ${formatNumber(p.value)}</div>`;
13139
+ result += `<div>${p.marker} ${p.seriesName}: ${formatNumber(p.value, undefined, languageCode)}</div>`;
13141
13140
  });
13142
13141
  if (item?.variance !== undefined) {
13143
13142
  const sign = item.variance >= 0 ? '+' : '';
13144
13143
  const color = item.variance >= 0 ? '#4caf50' : '#f44336';
13145
13144
  result += `<div style="margin-top:4px;padding-top:4px;border-top:1px solid #eee;color:${color}">`;
13146
- result += `Variance: ${sign}${formatNumber(item.variance)} (${sign}${item.variancePercent?.toFixed(1)}%)`;
13145
+ result += `Variance: ${sign}${formatNumber(item.variance, undefined, languageCode)} (${sign}${item.variancePercent?.toFixed(1)}%)`;
13147
13146
  result += `</div>`;
13148
13147
  }
13149
13148
  return result;
@@ -13176,7 +13175,7 @@ class ComparisonChartHandler {
13176
13175
  yAxis: {
13177
13176
  type: 'value',
13178
13177
  axisLabel: {
13179
- formatter: (value) => formatNumber(value),
13178
+ formatter: (value) => formatNumber(value, undefined, languageCode),
13180
13179
  fontFamily: '"Cairo", sans-serif',
13181
13180
  },
13182
13181
  },
@@ -13278,6 +13277,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
13278
13277
  * Used for listOfLevelCards, levelCardsWithFilter components.
13279
13278
  */
13280
13279
  class LevelCardHandler {
13280
+ storeService = inject(DashboardStoreService);
13281
13281
  /**
13282
13282
  * handlelevelCards - matches functionName from CHART_TYPES
13283
13283
  * Returns data directly like old LevelCardService:
@@ -13377,7 +13377,7 @@ class LevelCardHandler {
13377
13377
  * Parse level cards with filter (values array format)
13378
13378
  */
13379
13379
  parseLevelCardsWithFilter(dataResponse, _config) {
13380
- const languageCode = getLanguageCode();
13380
+ const languageCode = this.storeService.languageCode();
13381
13381
  const cards = [];
13382
13382
  if (dataResponse?.values && Array.isArray(dataResponse.values)) {
13383
13383
  dataResponse.values.forEach((value, index) => {
@@ -13412,7 +13412,7 @@ class LevelCardHandler {
13412
13412
  * Parse a single card detail
13413
13413
  */
13414
13414
  parseCardDetail(detail, _config, index) {
13415
- const languageCode = getLanguageCode();
13415
+ const languageCode = this.storeService.languageCode();
13416
13416
  if (!detail)
13417
13417
  return null;
13418
13418
  // Extract level info
@@ -13780,13 +13780,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
13780
13780
  * Returns ECharts options directly (matching old RingGaugeChartService format).
13781
13781
  */
13782
13782
  class RingGaugeChartHandler {
13783
+ storeService = inject(DashboardStoreService);
13783
13784
  colorByPropMap = null;
13784
13785
  /**
13785
13786
  * handleRingGaugeChart - matches functionName from CHART_TYPES
13786
13787
  * Returns ECharts option directly (same as old RingGaugeChartService)
13787
13788
  */
13788
13789
  handleRingGaugeChart(dataResponse, config) {
13789
- const languageCode = getLanguageCode();
13790
+ const languageCode = this.storeService.languageCode();
13790
13791
  const clientConfig = config.clientConfig || {};
13791
13792
  const configAsType = clientConfig['configAsType'] || {};
13792
13793
  const showLegend = configAsType['legend']?.show;
@@ -13906,7 +13907,7 @@ class RingGaugeChartHandler {
13906
13907
  color: 'inherit',
13907
13908
  fontSize: 14,
13908
13909
  formatter: (value) => {
13909
- return formatValue(value, clientConfig['format']);
13910
+ return formatValue(value, clientConfig['format'], languageCode);
13910
13911
  },
13911
13912
  },
13912
13913
  radius: [`${innerRadius}%`, `${outerRadius}%`],
@@ -13938,7 +13939,7 @@ class RingGaugeChartHandler {
13938
13939
  </div>`;
13939
13940
  });
13940
13941
  if (centerValue !== null && centerProperty) {
13941
- const formattedCenterValue = formatValue(centerValue, clientConfig['format']);
13942
+ const formattedCenterValue = formatValue(centerValue, clientConfig['format'], languageCode);
13942
13943
  tooltipContent += `<div style="margin: 5px 0; margin-top: 10px; border-top: 1px solid #ddd; padding-top: 5px;">
13943
13944
  <span style="display:inline-block;width:10px;height:10px;background-color:${statusColor};border-radius:50%;margin-right:8px;"></span>
13944
13945
  <span>${centerLabel}: ${formattedCenterValue}</span>
@@ -13995,7 +13996,7 @@ class RingGaugeChartHandler {
13995
13996
  };
13996
13997
  // Add center value graphic if centerProperty exists
13997
13998
  if (centerValue !== null && centerProperty) {
13998
- const formattedCenterValue = formatValue(centerValue, clientConfig['format']);
13999
+ const formattedCenterValue = formatValue(centerValue, clientConfig['format'], languageCode);
13999
14000
  const itemSpacing = 15;
14000
14001
  const totalItems = visibleIndex + 1;
14001
14002
  const totalSpacing = (totalItems - 1) * itemSpacing;
@@ -14211,6 +14212,7 @@ function lowercaseFirstLetter(str) {
14211
14212
  return str.charAt(0).toLowerCase() + str.slice(1);
14212
14213
  }
14213
14214
  class SPlusChartHandler {
14215
+ storeService = inject(DashboardStoreService);
14214
14216
  generalService = inject(GeneralService);
14215
14217
  /**
14216
14218
  * Handle S+ Gauge Chart - returns ECharts option directly
@@ -14441,7 +14443,7 @@ class SPlusChartHandler {
14441
14443
  * Parse progress data
14442
14444
  */
14443
14445
  parseProgressData(dataResponse, _config) {
14444
- const languageCode = getLanguageCode();
14446
+ const languageCode = this.storeService.languageCode();
14445
14447
  const items = [];
14446
14448
  const dataArray = Array.isArray(dataResponse)
14447
14449
  ? dataResponse
@@ -14475,7 +14477,7 @@ class SPlusChartHandler {
14475
14477
  * Parse KPI data
14476
14478
  */
14477
14479
  parseKPIData(dataResponse, _config) {
14478
- const languageCode = getLanguageCode();
14480
+ const languageCode = this.storeService.languageCode();
14479
14481
  const kpis = [];
14480
14482
  const dataArray = Array.isArray(dataResponse)
14481
14483
  ? dataResponse
@@ -14510,7 +14512,7 @@ class SPlusChartHandler {
14510
14512
  * Parse milestone data
14511
14513
  */
14512
14514
  parseMilestoneData(dataResponse, _config) {
14513
- const languageCode = getLanguageCode();
14515
+ const languageCode = this.storeService.languageCode();
14514
14516
  const milestones = [];
14515
14517
  const dataArray = Array.isArray(dataResponse)
14516
14518
  ? dataResponse
@@ -14531,7 +14533,7 @@ class SPlusChartHandler {
14531
14533
  * Build progress bar chart
14532
14534
  */
14533
14535
  buildProgressChart(items, config) {
14534
- const languageCode = getLanguageCode();
14536
+ const languageCode = this.storeService.languageCode();
14535
14537
  const isRTL = languageCode === 'ar';
14536
14538
  const configAsType = config.clientConfig?.configAsType || {};
14537
14539
  const plannedColor = configAsType['plannedColor'] || '#90caf9';
@@ -14624,7 +14626,7 @@ class SPlusChartHandler {
14624
14626
  * Build weighted progress chart with summary gauge
14625
14627
  */
14626
14628
  buildWeightedProgressChart(items, weightedPlanned, weightedActual, _config) {
14627
- const languageCode = getLanguageCode();
14629
+ const languageCode = this.storeService.languageCode();
14628
14630
  const variance = weightedActual - weightedPlanned;
14629
14631
  const gaugeColor = variance >= 0 ? '#4caf50' : variance >= -10 ? '#ff9800' : '#f44336';
14630
14632
  return {
@@ -14767,6 +14769,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
14767
14769
  * Shows current phase, completed phases, and upcoming phases.
14768
14770
  */
14769
14771
  class PhaseGateStepperHandler {
14772
+ storeService = inject(DashboardStoreService);
14770
14773
  /**
14771
14774
  * handlePhaseGateStepperCard - matches functionName from CHART_TYPES
14772
14775
  * Returns data directly matching old PhaseGateStepperService format
@@ -14804,7 +14807,7 @@ class PhaseGateStepperHandler {
14804
14807
  * Parse phase gate data from API response
14805
14808
  */
14806
14809
  parsePhaseGateData(dataResponse, _config) {
14807
- const languageCode = getLanguageCode();
14810
+ const languageCode = this.storeService.languageCode();
14808
14811
  const steps = [];
14809
14812
  // Handle array format
14810
14813
  const dataArray = Array.isArray(dataResponse)
@@ -14960,7 +14963,7 @@ class PhaseGateStepperHandler {
14960
14963
  * Build table columns from steps
14961
14964
  */
14962
14965
  buildTableColumns(steps, _config) {
14963
- const languageCode = getLanguageCode();
14966
+ const languageCode = this.storeService.languageCode();
14964
14967
  const columns = [
14965
14968
  {
14966
14969
  key: 'property',
@@ -14984,7 +14987,7 @@ class PhaseGateStepperHandler {
14984
14987
  * Build table rows from steps
14985
14988
  */
14986
14989
  buildTableRows(steps) {
14987
- const languageCode = getLanguageCode();
14990
+ const languageCode = this.storeService.languageCode();
14988
14991
  const rows = [];
14989
14992
  // Collect all unique property keys
14990
14993
  const allProperties = new Set();
@@ -15075,7 +15078,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
15075
15078
  */
15076
15079
  class ChartDataService {
15077
15080
  http = inject(LimitedHttpService);
15078
- transloco = inject(TranslocoService);
15079
15081
  itemStore = inject(DashboardItemStoreService);
15080
15082
  // URL Configuration from localStorage
15081
15083
  urlPrefix = '';
@@ -15471,12 +15473,6 @@ class ChartDataService {
15471
15473
  console.warn(`Unknown handler function: ${handlerKey}`);
15472
15474
  return this.createPassthroughResult(data, config);
15473
15475
  }
15474
- /**
15475
- * Get language code
15476
- */
15477
- getLanguageCode() {
15478
- return (this.transloco.getActiveLang() || localStorage.getItem('langCode') || 'en');
15479
- }
15480
15476
  /**
15481
15477
  * Trigger refresh for a specific item
15482
15478
  */
@@ -18791,8 +18787,8 @@ function isMobilePlatform() {
18791
18787
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
18792
18788
  }
18793
18789
  class EntityPreviewCardComponent {
18794
- storeService = inject(DashboardItemStoreService);
18795
- transloco = inject(TranslocoService);
18790
+ itemStoreService = inject(DashboardItemStoreService);
18791
+ dashboardStoreService = inject(DashboardStoreService);
18796
18792
  subscription = new Subscription();
18797
18793
  /** Dashboard ID for this card */
18798
18794
  dashboardId = input.required(...(ngDevMode ? [{ debugName: "dashboardId" }] : /* istanbul ignore next */ []));
@@ -18802,7 +18798,7 @@ class EntityPreviewCardComponent {
18802
18798
  props = signal([], ...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
18803
18799
  /** Card title */
18804
18800
  title = computed(() => {
18805
- const languageCode = this.getLanguageCode();
18801
+ const languageCode = this.dashboardStoreService.languageCode();
18806
18802
  return this.configurationItem()?.clientConfig?.title?.[languageCode] || '';
18807
18803
  }, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
18808
18804
  ngOnInit() {
@@ -18816,13 +18812,13 @@ class EntityPreviewCardComponent {
18816
18812
  */
18817
18813
  subscribeToStore(dashboardId) {
18818
18814
  // Subscribe to ConfigurationItem
18819
- this.subscription.add(this.storeService
18815
+ this.subscription.add(this.itemStoreService
18820
18816
  .selectItemProperty$(dashboardId, 'ConfigurationItem')
18821
18817
  .subscribe((config) => {
18822
18818
  this.configurationItem.set(config || null);
18823
18819
  }));
18824
18820
  // Subscribe to DataHandled
18825
- this.subscription.add(this.storeService
18821
+ this.subscription.add(this.itemStoreService
18826
18822
  .selectItemProperty$(dashboardId, 'DataHandled')
18827
18823
  .subscribe((data) => {
18828
18824
  const values = data?.values;
@@ -18857,12 +18853,6 @@ class EntityPreviewCardComponent {
18857
18853
  this.props.set(processedProps);
18858
18854
  }));
18859
18855
  }
18860
- /**
18861
- * Get current language code
18862
- */
18863
- getLanguageCode() {
18864
- return (this.transloco.getActiveLang() || localStorage.getItem('langCode') || 'en');
18865
- }
18866
18856
  normalizeEntityProperty(prop) {
18867
18857
  const resolvedName = this.resolveEntityName(prop);
18868
18858
  if (!resolvedName) {
@@ -18892,7 +18882,7 @@ class EntityPreviewCardComponent {
18892
18882
  }
18893
18883
  if (value && typeof value === 'object') {
18894
18884
  const localized = value;
18895
- const languageCode = this.getLanguageCode();
18885
+ const languageCode = this.dashboardStoreService.languageCode();
18896
18886
  const candidate = localized[languageCode] ?? localized['en'] ?? localized['ar'];
18897
18887
  if (typeof candidate === 'string') {
18898
18888
  return candidate.trim();
@@ -21509,5 +21499,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
21509
21499
  * Generated bundle index. Do not edit.
21510
21500
  */
21511
21501
 
21512
- export { ActionsSettings, BarChartHandler, BarControlUi, CHART_TYPES, CardContentComponent, CardFilterComponent, CardInfoComponent, ChartCardComponent, ChartDataService, ChartSettingsDrawer, ChartViewer, ComparisonChartHandler, DashboardBuilder, DashboardBuilderService, DashboardItem, DashboardItemStoreService, DashboardList, DashboardStoreService, DashboardViewer, DataSourceSettings, DefaultControlUi, DisplaySettings, DynamicFiltersComponent, DynamicFiltersConfig, EChartComponent, PropertiesCardComponent as EntitiesPreviewCardComponent, EntityInfoComponent, EntityPreviewCardComponent, FilterByGroupPipe, GaugeChartHandler, GeneralSettings, GetChartActionsPipe, HTTPMethod, HeaderCardComponent, LevelCardHandler, LineChartHandler, ListStatisticCardComponent, ManageBreadcrumb, ManageFilterOnPage, ManageItem, ManageItemService, ManagePages, MapChartHandler, OverviewCardHandler, PhaseGateStepperHandler, PieChartHandler, PieControlUi, PropertiesCardComponent, RingGaugeChartHandler, SPlusChartHandler, SkeletonCardComponent, SnapshotHandler, SplitterChartHandler, StackBarChartHandler, StackBarControlUi, StaticFiltersComponent, StatisticCardComponent, TableCardComponent, TableViewHandler, TimelineHandler, TopbarCardComponent, addCommasToNumber, axisFormatters, cloneDeep$1 as cloneDeep, createAxisFormatter, createTooltipFormatter, dynamicReorder, dynamicTextReplace, formatCurrency, formatDate, formatNumber, formatPercentage, formatValue, formatWordsUnderBar, formatXAxis, generalConfiguration, getColorFromConditions, getLanguageCode, getLocalizedTitle, getNestedData, groupDatesByYearAndMonth, handleFilterForCard, handleFilterForSnapshot, handleFiltersForCustom, isMobilePlatform$1 as isMobilePlatform, sortChartData, sortDataTableView, switchAllKeysSmall$1 as switchAllKeysSmall, switchAllKeysToLower };
21502
+ export { ActionsSettings, BarChartHandler, BarControlUi, CHART_TYPES, CardContentComponent, CardFilterComponent, CardInfoComponent, ChartCardComponent, ChartDataService, ChartSettingsDrawer, ChartViewer, ComparisonChartHandler, DashboardBuilder, DashboardBuilderService, DashboardItem, DashboardItemStoreService, DashboardList, DashboardStoreService, DashboardViewer, DataSourceSettings, DefaultControlUi, DisplaySettings, DynamicFiltersComponent, DynamicFiltersConfig, EChartComponent, PropertiesCardComponent as EntitiesPreviewCardComponent, EntityInfoComponent, EntityPreviewCardComponent, FilterByGroupPipe, GaugeChartHandler, GeneralSettings, GetChartActionsPipe, HTTPMethod, HeaderCardComponent, LevelCardHandler, LineChartHandler, ListStatisticCardComponent, ManageBreadcrumb, ManageFilterOnPage, ManageItem, ManageItemService, ManagePages, MapChartHandler, OverviewCardHandler, PhaseGateStepperHandler, PieChartHandler, PieControlUi, PropertiesCardComponent, RingGaugeChartHandler, SPlusChartHandler, SkeletonCardComponent, SnapshotHandler, SplitterChartHandler, StackBarChartHandler, StackBarControlUi, StaticFiltersComponent, StatisticCardComponent, TableCardComponent, TableViewHandler, TimelineHandler, TopbarCardComponent, addCommasToNumber, axisFormatters, cloneDeep$1 as cloneDeep, createAxisFormatter, createTooltipFormatter, dynamicReorder, dynamicTextReplace, formatCurrency, formatDate, formatNumber, formatPercentage, formatValue, formatWordsUnderBar, formatXAxis, generalConfiguration, getColorFromConditions, getLocalizedTitle, getNestedData, groupDatesByYearAndMonth, handleFilterForCard, handleFilterForSnapshot, handleFiltersForCustom, isMobilePlatform$1 as isMobilePlatform, sortChartData, sortDataTableView, switchAllKeysSmall$1 as switchAllKeysSmall, switchAllKeysToLower };
21513
21503
  //# sourceMappingURL=masterteam-dashboard-builder.mjs.map