@meshmakers/shared-ui 3.3.920 → 3.3.940

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshmakers/shared-ui",
3
- "version": "3.3.920",
3
+ "version": "3.3.940",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.2.0",
6
6
  "@angular/core": "^21.2.0",
@@ -87,6 +87,20 @@ interface TableColumn {
87
87
  text: string;
88
88
  value: string;
89
89
  }[];
90
+ /**
91
+ * Optional callback that produces the cell's display string.
92
+ * When set, this overrides the default rendering selected by `dataType`.
93
+ * Filter/sort behaviour still follow `dataType` and the underlying `field` value,
94
+ * so sorting on a numeric column with a currency formatter still sorts numerically.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * { field: 'grossTotal', dataType: 'numeric',
99
+ * formatter: (value) => new Intl.NumberFormat('de-AT', { style: 'currency', currency: 'EUR' })
100
+ * .format(Number(value)) }
101
+ * ```
102
+ */
103
+ formatter?: (value: unknown, item: unknown) => string;
90
104
  }
91
105
  type ColumnDefinition = string | TableColumn;
92
106
  type ContextMenuType = 'contextMenu' | 'actionMenu';
@@ -205,6 +219,12 @@ declare class ListViewComponent extends CommandBaseService implements OnDestroy,
205
219
  protected getDisplayName(column: TableColumn): string;
206
220
  protected getIsDisabled(commandItem: CommandItem, dataItem?: unknown): boolean;
207
221
  protected getValue(element: Record<string, unknown>, column: TableColumn): unknown;
222
+ /**
223
+ * Produces the formatted cell content when a column defines a `formatter` callback.
224
+ * Returns `null` when no formatter is configured so the template can fall back to
225
+ * the dataType-driven rendering.
226
+ */
227
+ protected getFormattedValue(element: Record<string, unknown>, column: TableColumn): string | null;
208
228
  protected getFilterType(column: TableColumn): 'text' | 'numeric' | 'boolean' | 'date';
209
229
  /**
210
230
  * Gets all status field configurations for a statusIcons column.