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