@shival99/z-ui 2.0.69 → 2.0.70

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.
@@ -5590,9 +5590,12 @@ class ZTableComponent {
5590
5590
  }, ...(ngDevMode ? [{ debugName: "hasServerFiltering" }] : []));
5591
5591
  groupingConfig = computed(() => {
5592
5592
  const { enableGrouping: grouping } = this.zConfig();
5593
- if (!grouping) {
5593
+ if (grouping === false) {
5594
5594
  return { enabled: false, mode: 'local', allowHeaderMenu: true, defaultExpanded: true, showCount: true };
5595
5595
  }
5596
+ if (grouping === undefined) {
5597
+ return { enabled: true, mode: 'local', allowHeaderMenu: true, defaultExpanded: true, showCount: true };
5598
+ }
5596
5599
  if (typeof grouping === 'boolean') {
5597
5600
  return { enabled: grouping, mode: 'local', allowHeaderMenu: true, defaultExpanded: true, showCount: true };
5598
5601
  }
@@ -5654,7 +5657,8 @@ class ZTableComponent {
5654
5657
  if (this._isSpecialColumnId(column.id)) {
5655
5658
  continue;
5656
5659
  }
5657
- result[column.id] = allowedIds ? allowedIds.has(column.id) : true;
5660
+ const columnConfig = this._findColumnConfig(column.id);
5661
+ result[column.id] = columnConfig?.enableGrouping !== false && (allowedIds ? allowedIds.has(column.id) : true);
5658
5662
  }
5659
5663
  return result;
5660
5664
  }, ...(ngDevMode ? [{ debugName: "groupableColumnMap" }] : []));
@@ -5665,8 +5669,7 @@ class ZTableComponent {
5665
5669
  for (const headerGroup of this.orderedHeaderGroups()) {
5666
5670
  for (const header of headerGroup.headers) {
5667
5671
  const isLeafHeader = header.subHeaders.length === 0;
5668
- result[header.id] =
5669
- isLeafHeader && (groupableColumns[header.column.id] || activeColumnId === header.column.id);
5672
+ result[header.id] = isLeafHeader && (groupableColumns[header.column.id] || activeColumnId === header.column.id);
5670
5673
  }
5671
5674
  }
5672
5675
  return result;
@@ -5694,7 +5697,6 @@ class ZTableComponent {
5694
5697
  }
5695
5698
  groups.set(groupId, {
5696
5699
  value,
5697
- label: this._getGroupLabel(value),
5698
5700
  rows: [row],
5699
5701
  });
5700
5702
  }
@@ -5705,7 +5707,7 @@ class ZTableComponent {
5705
5707
  type: 'group',
5706
5708
  id,
5707
5709
  value: group.value,
5708
- label: group.label,
5710
+ label: this._getColumnGroupLabel(columnId, group.value, group.rows),
5709
5711
  columnLabel,
5710
5712
  count: group.rows.length,
5711
5713
  expanded,
@@ -5748,7 +5750,7 @@ class ZTableComponent {
5748
5750
  type: 'group',
5749
5751
  id: groupId,
5750
5752
  value: group.value,
5751
- label: group.label ?? this._getGroupLabel(group.value),
5753
+ label: group.label ?? this._getColumnGroupLabel(columnId, group.value, rows),
5752
5754
  columnLabel,
5753
5755
  count: group.count ?? rows.length,
5754
5756
  expanded,
@@ -8825,6 +8827,9 @@ class ZTableComponent {
8825
8827
  if (this._isSpecialColumnId(columnId)) {
8826
8828
  return false;
8827
8829
  }
8830
+ if (this._findColumnConfig(columnId)?.enableGrouping === false) {
8831
+ return false;
8832
+ }
8828
8833
  if (config.columns?.length) {
8829
8834
  return config.columns.includes(columnId);
8830
8835
  }
@@ -9309,6 +9314,13 @@ class ZTableComponent {
9309
9314
  _getGroupId(columnId, value) {
9310
9315
  return `${columnId}:${this._getGroupLabel(value)}`;
9311
9316
  }
9317
+ _getColumnGroupLabel(columnId, value, rows) {
9318
+ const formatter = this._findColumnConfig(columnId)?.groupLabel;
9319
+ if (formatter) {
9320
+ return formatter({ value, columnId, rows });
9321
+ }
9322
+ return this._getGroupLabel(value);
9323
+ }
9312
9324
  _getGroupLabel(value) {
9313
9325
  if (value === null || value === undefined || value === '') {
9314
9326
  return this._zTranslate.translate('i18n_z_ui_table_group_empty')();