@messaia/cdk 22.0.0 → 22.0.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/messaia-cdk.mjs +425 -340
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/package.json +1 -1
- package/types/messaia-cdk.d.ts +97 -68
package/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -12853,15 +12853,16 @@ function getEndpoint(origin) {
|
|
|
12853
12853
|
/* Retrieve and return the endpoint metadata associated with the given class */
|
|
12854
12854
|
return Reflect.getMetadata(endpointMetadataKey, origin);
|
|
12855
12855
|
}
|
|
12856
|
+
|
|
12856
12857
|
/**
|
|
12857
|
-
*
|
|
12858
|
-
*
|
|
12859
|
-
* @param
|
|
12860
|
-
* @
|
|
12858
|
+
* Retrieves the display name for a given property of an instance using metadata.
|
|
12859
|
+
* @template T - The type of the instance.
|
|
12860
|
+
* @param {T} instance - The instance from which to retrieve the display name.
|
|
12861
|
+
* @param {string | symbol} propertyKey - The property key for which to retrieve the display name.
|
|
12862
|
+
* @returns {string | undefined} - The display name if found; otherwise, undefined.
|
|
12861
12863
|
*/
|
|
12862
|
-
function getDisplay(
|
|
12863
|
-
|
|
12864
|
-
return Reflect.getMetadata(headerMetadataKey, origin);
|
|
12864
|
+
function getDisplay(instance, propertyKey) {
|
|
12865
|
+
return Reflect.getMetadata(headerMetadataKey, instance, propertyKey);
|
|
12865
12866
|
}
|
|
12866
12867
|
|
|
12867
12868
|
/**
|
|
@@ -12978,6 +12979,9 @@ class AppEvent {
|
|
|
12978
12979
|
}
|
|
12979
12980
|
}
|
|
12980
12981
|
|
|
12982
|
+
const TABLE_DEFINITION_METADATA_KEY = Symbol('msa-ng-cdk:table-definition');
|
|
12983
|
+
const TABLE_COLUMNS_METADATA_KEY = Symbol('msa-ng-cdk:table-columns');
|
|
12984
|
+
|
|
12981
12985
|
var Grid;
|
|
12982
12986
|
(function (Grid) {
|
|
12983
12987
|
Grid[Grid["All"] = 0] = "All";
|
|
@@ -12990,9 +12994,6 @@ var Grid;
|
|
|
12990
12994
|
Grid[Grid["None"] = 7] = "None";
|
|
12991
12995
|
})(Grid || (Grid = {}));
|
|
12992
12996
|
|
|
12993
|
-
const tableDefinitionMetadataKey = 'custom:vdTableDefinition';
|
|
12994
|
-
const tableColumnsMetadataKey = 'custom:vdTableColumns';
|
|
12995
|
-
|
|
12996
12997
|
var TableColumnType;
|
|
12997
12998
|
(function (TableColumnType) {
|
|
12998
12999
|
TableColumnType[TableColumnType["None"] = 0] = "None";
|
|
@@ -13056,6 +13057,11 @@ class TableColumn {
|
|
|
13056
13057
|
* @property
|
|
13057
13058
|
*/
|
|
13058
13059
|
display;
|
|
13060
|
+
/**
|
|
13061
|
+
* Cached classes for responsive display visibility.
|
|
13062
|
+
* @property
|
|
13063
|
+
*/
|
|
13064
|
+
displayNgClass;
|
|
13059
13065
|
/**
|
|
13060
13066
|
* Endpoint for additional data retrieval.
|
|
13061
13067
|
* @property
|
|
@@ -13287,303 +13293,116 @@ class TableColumn {
|
|
|
13287
13293
|
}
|
|
13288
13294
|
|
|
13289
13295
|
/**
|
|
13290
|
-
*
|
|
13291
|
-
* It
|
|
13292
|
-
* and callbacks for rows and data handling.
|
|
13293
|
-
*
|
|
13296
|
+
* Manual creator function to define a column in a table programmatically.
|
|
13297
|
+
* It sets various properties and behaviors for the column without using decorators.
|
|
13294
13298
|
* @template T - The type of data represented in the table rows.
|
|
13299
|
+
* @param {string} propertyKey - The property key to bind the column to.
|
|
13300
|
+
* @param {Partial<TableColumn<T>>} [args] - Partial configuration for the table column.
|
|
13301
|
+
* @param {string} [propertyType] - Optional explicit type (e.g., 'string', 'number', 'date', 'boolean', 'array') to drive defaults.
|
|
13302
|
+
* @param {any} [target] - Optional target prototype object for custom display text extraction.
|
|
13303
|
+
* @returns {TableColumn<T>} - The fully constructed and initialized TableColumn instance.
|
|
13295
13304
|
*/
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
|
|
13308
|
-
|
|
13309
|
-
|
|
13310
|
-
|
|
13311
|
-
|
|
13312
|
-
|
|
13313
|
-
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
|
|
13325
|
-
|
|
13326
|
-
|
|
13327
|
-
|
|
13328
|
-
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
|
|
13340
|
-
|
|
13341
|
-
|
|
13342
|
-
|
|
13343
|
-
|
|
13344
|
-
|
|
13345
|
-
|
|
13346
|
-
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
exportable = true;
|
|
13368
|
-
/**
|
|
13369
|
-
* @property exportFileName
|
|
13370
|
-
* @description The name of the file to export.
|
|
13371
|
-
* @type {string}
|
|
13372
|
-
*/
|
|
13373
|
-
exportFileName;
|
|
13374
|
-
/**
|
|
13375
|
-
* @property sticky
|
|
13376
|
-
* @description Flag to indicate whether the table headers or columns should stick
|
|
13377
|
-
* to the viewport during scrolling. Defaults to `false`.
|
|
13378
|
-
* @type {boolean}
|
|
13379
|
-
*/
|
|
13380
|
-
sticky = false;
|
|
13381
|
-
/**
|
|
13382
|
-
* @property columns
|
|
13383
|
-
* @description Array of table columns that define the structure and data types
|
|
13384
|
-
* of each column in the table.
|
|
13385
|
-
* @type {TableColumn<T>[]}
|
|
13386
|
-
*/
|
|
13387
|
-
columns = [];
|
|
13388
|
-
/**
|
|
13389
|
-
* @property hideColumns
|
|
13390
|
-
* @description Optional array of column keys that should be hidden from view.
|
|
13391
|
-
* @type {string[]}
|
|
13392
|
-
*/
|
|
13393
|
-
hideColumns;
|
|
13394
|
-
/**
|
|
13395
|
-
* @property rowNgClass
|
|
13396
|
-
* @description Function to dynamically assign CSS classes to rows based on the row data
|
|
13397
|
-
* and context. Can be used for conditional row styling.
|
|
13398
|
-
* @type {(x?: T, ctx?: IGenericListComponent<T>) => any}
|
|
13399
|
-
*/
|
|
13400
|
-
rowNgClass;
|
|
13401
|
-
/**
|
|
13402
|
-
* @property rowClick
|
|
13403
|
-
* @description Callback function for handling row click events.
|
|
13404
|
-
* Invoked when a row is clicked.
|
|
13405
|
-
* @type {(x?: T, ctx?: IGenericListComponent<T>) => any}
|
|
13406
|
-
*/
|
|
13407
|
-
rowClick;
|
|
13408
|
-
/**
|
|
13409
|
-
* @property onEdit
|
|
13410
|
-
* @description Callback function for handling edit actions.
|
|
13411
|
-
* Invoked when the edit button is clicked for a row.
|
|
13412
|
-
* @type {(x?: T, ctx?: IGenericListComponent<T>) => any}
|
|
13413
|
-
*/
|
|
13414
|
-
onEdit;
|
|
13415
|
-
/**
|
|
13416
|
-
* @property detailsTemplate
|
|
13417
|
-
* @description Name of the template to use for displaying additional row details.
|
|
13418
|
-
* @type {string}
|
|
13419
|
-
*/
|
|
13420
|
-
detailsTemplate;
|
|
13421
|
-
/**
|
|
13422
|
-
* @property actions
|
|
13423
|
-
* @description Array of action items (e.g., custom buttons) available for each row in the table.
|
|
13424
|
-
* Actions can be context-sensitive based on the row data and table context.
|
|
13425
|
-
* @type {ActionItem<T, IGenericListComponent<T>>[]}
|
|
13426
|
-
*/
|
|
13427
|
-
actions = [];
|
|
13428
|
-
/**
|
|
13429
|
-
* @property columnSets
|
|
13430
|
-
* @description Used to display specific columns in the table.
|
|
13431
|
-
* This array defines sets of columns that can be shown
|
|
13432
|
-
* based on the active configuration, allowing for dynamic table
|
|
13433
|
-
* column customization.
|
|
13434
|
-
* @type {string[]}
|
|
13435
|
-
*/
|
|
13436
|
-
columnSets = [];
|
|
13437
|
-
/**
|
|
13438
|
-
* Constructor for initializing the table definition with optional values.
|
|
13439
|
-
* Merges the provided initialization object with default properties.
|
|
13440
|
-
*
|
|
13441
|
-
* @param init - Optional partial table definition to initialize values.
|
|
13442
|
-
*/
|
|
13443
|
-
constructor(init) {
|
|
13444
|
-
Object.assign(this, init);
|
|
13445
|
-
}
|
|
13446
|
-
}
|
|
13447
|
-
|
|
13448
|
-
/**
|
|
13449
|
-
* Gets classes decoarated with @Table
|
|
13450
|
-
* @param origin
|
|
13451
|
-
* @returns
|
|
13452
|
-
*/
|
|
13453
|
-
function getTableDefinition(origin) {
|
|
13454
|
-
/* Save the table defintion in the metadata */
|
|
13455
|
-
var tableDefinition = Reflect.getMetadata(tableDefinitionMetadataKey, origin) ?? new TableDefinition({});
|
|
13456
|
-
if (tableDefinition) {
|
|
13457
|
-
/* Set column in the table definition */
|
|
13458
|
-
tableDefinition.columns = Reflect.getMetadata(tableColumnsMetadataKey, Reflect.construct(origin, []))
|
|
13459
|
-
?.filter((x) => !x.hidden && !tableDefinition.hideColumns?.some(y => y.trim() == x.name.trim()));
|
|
13460
|
-
/* Sort the columns by index */
|
|
13461
|
-
Utils.sortArray(tableDefinition.columns || [], 'index');
|
|
13462
|
-
/* Set endpoint from the decorator @Api, if any */
|
|
13463
|
-
var endpoint = Reflect.getMetadata(endpointMetadataKey, origin);
|
|
13464
|
-
if (endpoint) {
|
|
13465
|
-
tableDefinition.endpoint = endpoint;
|
|
13305
|
+
function buildColumn(propertyKey, args, propertyType, target) {
|
|
13306
|
+
/* Create a new instance of TableColumn with the provided arguments */
|
|
13307
|
+
let tableColumn = new TableColumn(args);
|
|
13308
|
+
/* Set default values for the table column properties */
|
|
13309
|
+
tableColumn.name ||= propertyKey;
|
|
13310
|
+
tableColumn.header ||= (target ? getDisplay(target, propertyKey) : null) || tableColumn.name;
|
|
13311
|
+
tableColumn.filter ||= tableColumn.name;
|
|
13312
|
+
tableColumn.sortBy ||= tableColumn.name;
|
|
13313
|
+
tableColumn.content ||= (row) => {
|
|
13314
|
+
/* Get content using property name */
|
|
13315
|
+
var content = Utils.getPropertyValue(row, tableColumn.name);
|
|
13316
|
+
/* Truncate the text if content length is specified */
|
|
13317
|
+
if ((tableColumn?.contentLength ?? 0) > 0) {
|
|
13318
|
+
return Utils.truncateText(content, tableColumn.contentLength);
|
|
13319
|
+
}
|
|
13320
|
+
return content;
|
|
13321
|
+
};
|
|
13322
|
+
tableColumn.configurable = args?.configurable === undefined ? true : args.configurable;
|
|
13323
|
+
tableColumn.display ||= Grid.All;
|
|
13324
|
+
/* Set type to 'Menu' if menu is specified */
|
|
13325
|
+
if (tableColumn.menu) {
|
|
13326
|
+
tableColumn.type ||= TableColumnType.Menu;
|
|
13327
|
+
}
|
|
13328
|
+
/* Set type to 'Icon' if icon is specified */
|
|
13329
|
+
else if (tableColumn.icon) {
|
|
13330
|
+
tableColumn.type ||= TableColumnType.Icon;
|
|
13331
|
+
}
|
|
13332
|
+
/* Set type to 'IconButton' if iconButton is specified */
|
|
13333
|
+
else if (tableColumn.iconButton) {
|
|
13334
|
+
tableColumn.type ||= TableColumnType.IconButton;
|
|
13335
|
+
}
|
|
13336
|
+
/* Set type to enum, if enum type is specified */
|
|
13337
|
+
else if (tableColumn.enumType) {
|
|
13338
|
+
tableColumn.type ||= TableColumnType.Enum;
|
|
13339
|
+
tableColumn.multiple = propertyType?.trim()?.toLowerCase() == 'array';
|
|
13340
|
+
}
|
|
13341
|
+
/* Otherwise, set type depending on property type */
|
|
13342
|
+
else {
|
|
13343
|
+
switch (propertyType?.toLowerCase()) {
|
|
13344
|
+
case 'number':
|
|
13345
|
+
tableColumn.inputType ||= 'number';
|
|
13346
|
+
tableColumn.type ||= TableColumnType.Number;
|
|
13347
|
+
tableColumn.filterOperator = tableColumn.filterOperator != undefined
|
|
13348
|
+
? tableColumn.filterOperator
|
|
13349
|
+
: FilterOperator.Contains;
|
|
13350
|
+
break;
|
|
13351
|
+
case 'date':
|
|
13352
|
+
tableColumn.inputType ||= 'date';
|
|
13353
|
+
tableColumn.type ||= TableColumnType.Date;
|
|
13354
|
+
tableColumn.maxWidth ||= 115;
|
|
13355
|
+
tableColumn.arrowBefore = tableColumn.arrowBefore !== undefined ? tableColumn.arrowBefore : true;
|
|
13356
|
+
break;
|
|
13357
|
+
case 'boolean':
|
|
13358
|
+
tableColumn.type ||= TableColumnType.Toggle;
|
|
13359
|
+
tableColumn.options ||= [{ id: false, name: $localize `:@@no:No` }, { id: true, name: $localize `:@@yes:Yes` }];
|
|
13360
|
+
tableColumn.maxWidth ||= 70;
|
|
13361
|
+
if (tableColumn.type == TableColumnType.Text) {
|
|
13362
|
+
tableColumn.content = (row) => {
|
|
13363
|
+
/* Get content using property name */
|
|
13364
|
+
var content = Utils.getPropertyValue(row, tableColumn.name);
|
|
13365
|
+
if (content != null) {
|
|
13366
|
+
return content ? $localize `:@@yes:Yes` : $localize `:@@no:No`;
|
|
13367
|
+
}
|
|
13368
|
+
return null;
|
|
13369
|
+
};
|
|
13370
|
+
}
|
|
13371
|
+
break;
|
|
13372
|
+
/* Default to text type for all other property types */
|
|
13373
|
+
default:
|
|
13374
|
+
tableColumn.type ||= TableColumnType.Text;
|
|
13375
|
+
break;
|
|
13466
13376
|
}
|
|
13467
13377
|
}
|
|
13468
|
-
|
|
13378
|
+
if (tableColumn.maxWidth) {
|
|
13379
|
+
tableColumn.width ||= tableColumn.maxWidth;
|
|
13380
|
+
}
|
|
13381
|
+
/* Set width to minWidth if width is not specified */
|
|
13382
|
+
return tableColumn;
|
|
13469
13383
|
}
|
|
13470
13384
|
|
|
13471
13385
|
/**
|
|
13472
|
-
*
|
|
13473
|
-
*
|
|
13474
|
-
*
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
if (tableDefinition?.columns) {
|
|
13479
|
-
/* Add action menus from table definition, if any */
|
|
13480
|
-
var actionColmun = tableDefinition.columns?.find(x => x.name == 'action');
|
|
13481
|
-
if (!actionColmun) {
|
|
13482
|
-
actionColmun = new TableColumn({
|
|
13483
|
-
index: 2000,
|
|
13484
|
-
name: 'action',
|
|
13485
|
-
columnSets: ['action', 'common'],
|
|
13486
|
-
type: TableColumnType.Action,
|
|
13487
|
-
disabled: true,
|
|
13488
|
-
rowMenuItems: actions,
|
|
13489
|
-
configurable: false,
|
|
13490
|
-
stickyEnd: true
|
|
13491
|
-
});
|
|
13492
|
-
/* Add the action column into the table columns */
|
|
13493
|
-
tableDefinition.columns.push(actionColmun);
|
|
13494
|
-
}
|
|
13495
|
-
/* Get custom action, if any */
|
|
13496
|
-
var actions = tableDefinition?.actions;
|
|
13497
|
-
if (actions != null && actionColmun != null) {
|
|
13498
|
-
actionColmun.rowMenuItems ??= [];
|
|
13499
|
-
actions.forEach(y => actionColmun.rowMenuItems.push(y));
|
|
13500
|
-
}
|
|
13501
|
-
}
|
|
13502
|
-
/* Save the table defintion in the metadata */
|
|
13503
|
-
Reflect.defineMetadata(tableDefinitionMetadataKey, tableDefinition, target);
|
|
13504
|
-
};
|
|
13505
|
-
}
|
|
13506
|
-
/**
|
|
13507
|
-
* Property decorator to create table columns
|
|
13508
|
-
* @param args
|
|
13509
|
-
* @returns
|
|
13386
|
+
* Property decorator to define a column in a table.
|
|
13387
|
+
* It sets various properties and behaviors for the column,
|
|
13388
|
+
* including its name, type, display settings, and associated actions.
|
|
13389
|
+
* @template T - The type of data represented in the table rows.
|
|
13390
|
+
* @param {Partial<TableColumn<T>>} args - Partial configuration for the table column.
|
|
13391
|
+
* @returns {Function} - A decorator function that modifies the target property.
|
|
13510
13392
|
*/
|
|
13511
13393
|
function Column(args) {
|
|
13512
13394
|
return function (target, propertyKey) {
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
tableColumn.header ||= Reflect.getMetadata(headerMetadataKey, target, propertyKey) || tableColumn.name;
|
|
13516
|
-
tableColumn.filter ||= tableColumn.name;
|
|
13517
|
-
tableColumn.sortBy ||= tableColumn.name;
|
|
13518
|
-
tableColumn.content ||= (row) => {
|
|
13519
|
-
/* Get content using property name */
|
|
13520
|
-
var content = Utils.getPropertyValue(row, tableColumn.name);
|
|
13521
|
-
/* Truncate the text if content length is specified */
|
|
13522
|
-
if ((tableColumn?.contentLength ?? 0) > 0) {
|
|
13523
|
-
return Utils.truncateText(content, tableColumn.contentLength);
|
|
13524
|
-
}
|
|
13525
|
-
return content;
|
|
13526
|
-
};
|
|
13527
|
-
tableColumn.configurable = args?.configurable === undefined ? true : args.configurable;
|
|
13528
|
-
tableColumn.display ||= Grid.All;
|
|
13529
|
-
/* Set type to 'Menu' if menu is specified */
|
|
13530
|
-
if (tableColumn.menu) {
|
|
13531
|
-
tableColumn.type ||= TableColumnType.Menu;
|
|
13532
|
-
}
|
|
13533
|
-
/* Set type to 'Icon' if icon is specified */
|
|
13534
|
-
else if (tableColumn.icon) {
|
|
13535
|
-
tableColumn.type ||= TableColumnType.Icon;
|
|
13536
|
-
}
|
|
13537
|
-
/* Set type to 'IconButton' if iconButton is specified */
|
|
13538
|
-
else if (tableColumn.iconButton) {
|
|
13539
|
-
tableColumn.type ||= TableColumnType.IconButton;
|
|
13540
|
-
}
|
|
13541
|
-
/* Set type to enum, if enum type is specified */
|
|
13542
|
-
else if (tableColumn.enumType) {
|
|
13543
|
-
tableColumn.type ||= TableColumnType.Enum;
|
|
13544
|
-
tableColumn.multiple = Reflect.getMetadata("design:type", target, propertyKey)?.name?.trim()?.toLowerCase() == 'array';
|
|
13545
|
-
}
|
|
13546
|
-
/* Otherwiese, set type depending on property type */
|
|
13547
|
-
else {
|
|
13548
|
-
/* Get property type */
|
|
13549
|
-
var propertyType = Reflect.getMetadata("design:type", target, propertyKey)?.name;
|
|
13550
|
-
switch (propertyType?.toLowerCase()) {
|
|
13551
|
-
case 'number':
|
|
13552
|
-
tableColumn.inputType ||= 'number';
|
|
13553
|
-
tableColumn.type ||= TableColumnType.Number;
|
|
13554
|
-
tableColumn.filterOperator = tableColumn.filterOperator != undefined ? tableColumn.filterOperator : FilterOperator.Contains;
|
|
13555
|
-
break;
|
|
13556
|
-
case 'date':
|
|
13557
|
-
tableColumn.inputType ||= 'date';
|
|
13558
|
-
tableColumn.type ||= TableColumnType.Date;
|
|
13559
|
-
tableColumn.maxWidth ||= 115;
|
|
13560
|
-
tableColumn.arrowBefore = tableColumn.arrowBefore !== undefined ? tableColumn.arrowBefore : true;
|
|
13561
|
-
break;
|
|
13562
|
-
case 'boolean':
|
|
13563
|
-
tableColumn.type ||= TableColumnType.Toggle;
|
|
13564
|
-
tableColumn.options ||= [{ id: false, name: $localize `:@@no:No` }, { id: true, name: $localize `:@@yes:Yes` }];
|
|
13565
|
-
tableColumn.maxWidth ||= 70;
|
|
13566
|
-
if (tableColumn.type == TableColumnType.Text) {
|
|
13567
|
-
tableColumn.content = (row) => {
|
|
13568
|
-
/* Get content using property name */
|
|
13569
|
-
var content = Utils.getPropertyValue(row, tableColumn.name);
|
|
13570
|
-
if (content != null) {
|
|
13571
|
-
return content ? $localize `:@@yes:Yes` : $localize `:@@no:No`;
|
|
13572
|
-
}
|
|
13573
|
-
return null;
|
|
13574
|
-
};
|
|
13575
|
-
}
|
|
13576
|
-
break;
|
|
13577
|
-
default:
|
|
13578
|
-
tableColumn.type ||= TableColumnType.Text;
|
|
13579
|
-
break;
|
|
13580
|
-
}
|
|
13581
|
-
}
|
|
13582
|
-
if (tableColumn.maxWidth) {
|
|
13583
|
-
tableColumn.width ||= tableColumn.maxWidth;
|
|
13584
|
-
}
|
|
13395
|
+
/* Resolve the design:type metadata from the decorator target */
|
|
13396
|
+
const designType = Reflect.getMetadata("design:type", target, propertyKey)?.name;
|
|
13585
13397
|
/* Get old table columns */
|
|
13586
|
-
let previousTableColumns = Reflect.getMetadata(
|
|
13398
|
+
let previousTableColumns = Reflect.getMetadata(TABLE_COLUMNS_METADATA_KEY, target);
|
|
13399
|
+
/* Override the field with the args, if exists */
|
|
13400
|
+
const previousTableColumn = previousTableColumns?.find(x => x.name == propertyKey);
|
|
13401
|
+
const tableColumnArgs = previousTableColumn
|
|
13402
|
+
? Object.assign({}, previousTableColumn, args)
|
|
13403
|
+
: args;
|
|
13404
|
+
/* Build the structural column using the factory method */
|
|
13405
|
+
let tableColumn = buildColumn(propertyKey, tableColumnArgs, designType, target);
|
|
13587
13406
|
/* Override the field, if exists */
|
|
13588
13407
|
previousTableColumns = previousTableColumns?.filter(x => x.name != tableColumn.name);
|
|
13589
13408
|
/* Create a copy of the result */
|
|
@@ -13592,33 +13411,8 @@ function Column(args) {
|
|
|
13592
13411
|
tableColumns.forEach((x, i) => x.index ??= i);
|
|
13593
13412
|
/* Sort the columns by index */
|
|
13594
13413
|
Utils.sortArray(tableColumns, 'index');
|
|
13595
|
-
/* Override the result in the metadata */
|
|
13596
|
-
Reflect.defineMetadata(
|
|
13597
|
-
};
|
|
13598
|
-
}
|
|
13599
|
-
/**
|
|
13600
|
-
* Decorator function to define columns for a table object.
|
|
13601
|
-
* @param type The constructor function of the table object.
|
|
13602
|
-
* @returns A decorator function.
|
|
13603
|
-
*/
|
|
13604
|
-
function ColumnObject(type) {
|
|
13605
|
-
return function (target, propertyKey) {
|
|
13606
|
-
/* Retrieve table definition */
|
|
13607
|
-
var tableDef = getTableDefinition(type);
|
|
13608
|
-
/* Retrieve columns from the table definition */
|
|
13609
|
-
var columns = tableDef.columns;
|
|
13610
|
-
/* Update column names with property key prefix */
|
|
13611
|
-
columns?.forEach(x => x.name = `${propertyKey}.${x.name}`);
|
|
13612
|
-
/* Get existing table columns from metadata */
|
|
13613
|
-
let previousTableColumns = Reflect.getMetadata(tableColumnsMetadataKey, target);
|
|
13614
|
-
/* Create a copy of the existing columns array and append new columns */
|
|
13615
|
-
let tableColumns = previousTableColumns ? previousTableColumns.concat(columns ?? []) : [];
|
|
13616
|
-
/* Set column index if not already set */
|
|
13617
|
-
tableColumns.forEach((x, i) => x.index ??= i);
|
|
13618
|
-
/* Sort the columns by index */
|
|
13619
|
-
Utils.sortArray(tableColumns, 'index');
|
|
13620
|
-
/* Override the table columns in the metadata */
|
|
13621
|
-
Reflect.defineMetadata(tableColumnsMetadataKey, tableColumns, target);
|
|
13414
|
+
/* Override the result in the metadata */
|
|
13415
|
+
Reflect.defineMetadata(TABLE_COLUMNS_METADATA_KEY, tableColumns, target);
|
|
13622
13416
|
};
|
|
13623
13417
|
}
|
|
13624
13418
|
|
|
@@ -17402,6 +17196,188 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
17402
17196
|
type: Input
|
|
17403
17197
|
}] } });
|
|
17404
17198
|
|
|
17199
|
+
/**
|
|
17200
|
+
* Class representing the structure and behavior of a table definition.
|
|
17201
|
+
* It defines various configurations such as column settings, actions,
|
|
17202
|
+
* and callbacks for rows and data handling.
|
|
17203
|
+
*
|
|
17204
|
+
* @template T - The type of data represented in the table rows.
|
|
17205
|
+
*/
|
|
17206
|
+
class TableDefinition {
|
|
17207
|
+
/**
|
|
17208
|
+
* @property endpoint
|
|
17209
|
+
* @description API endpoint from which table data will be fetched.
|
|
17210
|
+
* @type {string}
|
|
17211
|
+
*/
|
|
17212
|
+
endpoint = '';
|
|
17213
|
+
/**
|
|
17214
|
+
* @property projection
|
|
17215
|
+
* @description Optional projection for specifying which fields should be included
|
|
17216
|
+
* in the fetched data. Can be a single string or an array of field names.
|
|
17217
|
+
* @type {string | string[]}
|
|
17218
|
+
*/
|
|
17219
|
+
projection;
|
|
17220
|
+
/**
|
|
17221
|
+
* @property includes
|
|
17222
|
+
* @description Optional array of related data entities (includes) to be retrieved along
|
|
17223
|
+
* with the main data set.
|
|
17224
|
+
* @type {string[]}
|
|
17225
|
+
*/
|
|
17226
|
+
includes;
|
|
17227
|
+
/**
|
|
17228
|
+
* @property showAction
|
|
17229
|
+
* @description Flag to indicate if action columns (e.g., edit, delete buttons)
|
|
17230
|
+
* should be displayed in the table. Defaults to `true`.
|
|
17231
|
+
* @type {boolean}
|
|
17232
|
+
*/
|
|
17233
|
+
showAction = true;
|
|
17234
|
+
/**
|
|
17235
|
+
* @property selectable
|
|
17236
|
+
* @description Flag to indicate if rows can be selected (e.g., with checkboxes).
|
|
17237
|
+
* Defaults to `true`.
|
|
17238
|
+
* @type {boolean}
|
|
17239
|
+
*/
|
|
17240
|
+
selectable = true;
|
|
17241
|
+
/**
|
|
17242
|
+
* @property addable
|
|
17243
|
+
* @description Flag to indicate if new items can be added to the table.
|
|
17244
|
+
* Defaults to `true`.
|
|
17245
|
+
* @type {boolean}
|
|
17246
|
+
*/
|
|
17247
|
+
addable = true;
|
|
17248
|
+
/**
|
|
17249
|
+
* @property editable
|
|
17250
|
+
* @description Flag to indicate if rows can be edited. Defaults to `true`.
|
|
17251
|
+
* @type {boolean}
|
|
17252
|
+
*/
|
|
17253
|
+
editable = true;
|
|
17254
|
+
/**
|
|
17255
|
+
* @property deletable
|
|
17256
|
+
* @description Flag to indicate if rows can be deleted. Defaults to `true`.
|
|
17257
|
+
* @type {boolean}
|
|
17258
|
+
*/
|
|
17259
|
+
deletable = true;
|
|
17260
|
+
/**
|
|
17261
|
+
* @property downloadable
|
|
17262
|
+
* @description Flag to indicate if table data can be downloaded (e.g., as CSV or Excel).
|
|
17263
|
+
* @type {boolean}
|
|
17264
|
+
*/
|
|
17265
|
+
downloadable;
|
|
17266
|
+
/**
|
|
17267
|
+
* @property duplicable
|
|
17268
|
+
* @description Flag to indicate if rows can be duplicated.
|
|
17269
|
+
* @type {boolean}
|
|
17270
|
+
*/
|
|
17271
|
+
duplicable;
|
|
17272
|
+
/**
|
|
17273
|
+
* @property exportable
|
|
17274
|
+
* @description Determines if the table is exportable.
|
|
17275
|
+
* @type {boolean}
|
|
17276
|
+
*/
|
|
17277
|
+
exportable = true;
|
|
17278
|
+
/**
|
|
17279
|
+
* @property exportFileName
|
|
17280
|
+
* @description The name of the file to export.
|
|
17281
|
+
* @type {string}
|
|
17282
|
+
*/
|
|
17283
|
+
exportFileName;
|
|
17284
|
+
/**
|
|
17285
|
+
* @property sticky
|
|
17286
|
+
* @description Flag to indicate whether the table headers or columns should stick
|
|
17287
|
+
* to the viewport during scrolling. Defaults to `false`.
|
|
17288
|
+
* @type {boolean}
|
|
17289
|
+
*/
|
|
17290
|
+
sticky = false;
|
|
17291
|
+
/**
|
|
17292
|
+
* @property columns
|
|
17293
|
+
* @description Array of table columns that define the structure and data types
|
|
17294
|
+
* of each column in the table.
|
|
17295
|
+
* @type {TableColumn<T>[]}
|
|
17296
|
+
*/
|
|
17297
|
+
columns = [];
|
|
17298
|
+
/**
|
|
17299
|
+
* @property hideColumns
|
|
17300
|
+
* @description Optional array of column keys that should be hidden from view.
|
|
17301
|
+
* @type {string[]}
|
|
17302
|
+
*/
|
|
17303
|
+
hideColumns;
|
|
17304
|
+
/**
|
|
17305
|
+
* @property rowNgClass
|
|
17306
|
+
* @description Function to dynamically assign CSS classes to rows based on the row data
|
|
17307
|
+
* and context. Can be used for conditional row styling.
|
|
17308
|
+
* @type {(x?: T, ctx?: IGenericListComponent<T>) => any}
|
|
17309
|
+
*/
|
|
17310
|
+
rowNgClass;
|
|
17311
|
+
/**
|
|
17312
|
+
* @property rowClick
|
|
17313
|
+
* @description Callback function for handling row click events.
|
|
17314
|
+
* Invoked when a row is clicked.
|
|
17315
|
+
* @type {(x?: T, ctx?: IGenericListComponent<T>) => any}
|
|
17316
|
+
*/
|
|
17317
|
+
rowClick;
|
|
17318
|
+
/**
|
|
17319
|
+
* @property onEdit
|
|
17320
|
+
* @description Callback function for handling edit actions.
|
|
17321
|
+
* Invoked when the edit button is clicked for a row.
|
|
17322
|
+
* @type {(x?: T, ctx?: IGenericListComponent<T>) => any}
|
|
17323
|
+
*/
|
|
17324
|
+
onEdit;
|
|
17325
|
+
/**
|
|
17326
|
+
* @property detailsTemplate
|
|
17327
|
+
* @description Name of the template to use for displaying additional row details.
|
|
17328
|
+
* @type {string}
|
|
17329
|
+
*/
|
|
17330
|
+
detailsTemplate;
|
|
17331
|
+
/**
|
|
17332
|
+
* @property actions
|
|
17333
|
+
* @description Array of action items (e.g., custom buttons) available for each row in the table.
|
|
17334
|
+
* Actions can be context-sensitive based on the row data and table context.
|
|
17335
|
+
* @type {ActionItem<T, IGenericListComponent<T>>[]}
|
|
17336
|
+
*/
|
|
17337
|
+
actions = [];
|
|
17338
|
+
/**
|
|
17339
|
+
* @property columnSets
|
|
17340
|
+
* @description Used to display specific columns in the table.
|
|
17341
|
+
* This array defines sets of columns that can be shown
|
|
17342
|
+
* based on the active configuration, allowing for dynamic table
|
|
17343
|
+
* column customization.
|
|
17344
|
+
* @type {string[]}
|
|
17345
|
+
*/
|
|
17346
|
+
columnSets = [];
|
|
17347
|
+
/**
|
|
17348
|
+
* Constructor for initializing the table definition with optional values.
|
|
17349
|
+
* Merges the provided initialization object with default properties.
|
|
17350
|
+
*
|
|
17351
|
+
* @param init - Optional partial table definition to initialize values.
|
|
17352
|
+
*/
|
|
17353
|
+
constructor(init) {
|
|
17354
|
+
Object.assign(this, init);
|
|
17355
|
+
}
|
|
17356
|
+
}
|
|
17357
|
+
|
|
17358
|
+
/**
|
|
17359
|
+
* Gets classes decoarated with @Table
|
|
17360
|
+
* @param origin
|
|
17361
|
+
* @returns
|
|
17362
|
+
*/
|
|
17363
|
+
function getTableDefinition(origin) {
|
|
17364
|
+
/* Save the table defintion in the metadata */
|
|
17365
|
+
var tableDefinition = Reflect.getMetadata(TABLE_DEFINITION_METADATA_KEY, origin) ?? new TableDefinition({});
|
|
17366
|
+
if (tableDefinition) {
|
|
17367
|
+
/* Set column in the table definition */
|
|
17368
|
+
tableDefinition.columns = Reflect.getMetadata(TABLE_COLUMNS_METADATA_KEY, Reflect.construct(origin, []))
|
|
17369
|
+
?.filter((x) => !x.hidden && !tableDefinition.hideColumns?.some(y => y.trim() == x.name.trim()));
|
|
17370
|
+
/* Sort the columns by index */
|
|
17371
|
+
Utils.sortArray(tableDefinition.columns || [], 'index');
|
|
17372
|
+
/* Set endpoint from the decorator @Api, if any */
|
|
17373
|
+
var endpoint = Reflect.getMetadata(endpointMetadataKey, origin);
|
|
17374
|
+
if (endpoint) {
|
|
17375
|
+
tableDefinition.endpoint = endpoint;
|
|
17376
|
+
}
|
|
17377
|
+
}
|
|
17378
|
+
return tableDefinition;
|
|
17379
|
+
}
|
|
17380
|
+
|
|
17405
17381
|
/**
|
|
17406
17382
|
* A generic datasource class for working with data-tables in Angular Material.
|
|
17407
17383
|
* This class extends MatTableDataSource to provide additional functionality like
|
|
@@ -18791,6 +18767,10 @@ class VdDynamicTableComponent {
|
|
|
18791
18767
|
updateColumns() {
|
|
18792
18768
|
/* Sort the columns by index */
|
|
18793
18769
|
Utils.sortArray(this.columns || [], 'index');
|
|
18770
|
+
/* Cache responsive display classes once per column */
|
|
18771
|
+
this.columns?.forEach(column => {
|
|
18772
|
+
column.displayNgClass = this.getDisplayClasses(column);
|
|
18773
|
+
});
|
|
18794
18774
|
/* Trigger changes */
|
|
18795
18775
|
this.columnsSubject.next(this.columns);
|
|
18796
18776
|
}
|
|
@@ -18946,20 +18926,47 @@ class VdDynamicTableComponent {
|
|
|
18946
18926
|
keys.slice(0, -1).reduce((acc, key) => acc && acc[key], row)[keys[keys.length - 1]] = value;
|
|
18947
18927
|
}
|
|
18948
18928
|
/**
|
|
18949
|
-
*
|
|
18950
|
-
*
|
|
18951
|
-
* @param
|
|
18952
|
-
* @returns
|
|
18929
|
+
* Retrieves the display setting for a given column, which can be either a static value or a function.
|
|
18930
|
+
* If the display property is a function, it will be invoked with the current column sets and context.
|
|
18931
|
+
* @param column - The TableColumn object for which to retrieve the display setting.
|
|
18932
|
+
* @returns The display setting for the column, which can be a Grid value or undefined.
|
|
18933
|
+
*/
|
|
18934
|
+
getColumnDisplay(column) {
|
|
18935
|
+
/* If the display property is a function, invoke it with the current column sets and context */
|
|
18936
|
+
if (typeof column.display === 'function') {
|
|
18937
|
+
return column.display(this.columnSets || [], this.context);
|
|
18938
|
+
}
|
|
18939
|
+
return column.display;
|
|
18940
|
+
}
|
|
18941
|
+
/**
|
|
18942
|
+
* Computes the CSS classes for a column based on its display setting.
|
|
18943
|
+
* It maps the display value to corresponding CSS classes that control visibility and layout.
|
|
18944
|
+
* @param column - The TableColumn object for which to compute the display classes.
|
|
18945
|
+
* @returns An object containing CSS class names as keys and boolean values indicating whether the class should be applied.
|
|
18946
|
+
*/
|
|
18947
|
+
getDisplayClasses(column) {
|
|
18948
|
+
/* Retrieve the display setting for the column, which may be a static value or computed dynamically. */
|
|
18949
|
+
const display = this.getColumnDisplay(column);
|
|
18950
|
+
/* Return an object mapping display values to CSS classes, allowing for responsive visibility control. */
|
|
18951
|
+
return {
|
|
18952
|
+
'gt-xs': display == Grid.Xs,
|
|
18953
|
+
'gt-sm': display == Grid.Sm,
|
|
18954
|
+
'gt-md': display == Grid.Md,
|
|
18955
|
+
'gt-lg': display == Grid.Lg,
|
|
18956
|
+
'gt-xl': display == Grid.Xl,
|
|
18957
|
+
'gt-xxl': display == Grid.Xxl,
|
|
18958
|
+
'hidden': display == Grid.None,
|
|
18959
|
+
};
|
|
18960
|
+
}
|
|
18961
|
+
/**
|
|
18962
|
+
* Computes the CSS classes for a specific row based on the column's display settings and any additional classes defined.
|
|
18963
|
+
* It combines the column's display classes, any custom classes defined in `cellNgClass`, and a 'text-right' class if `arrowBefore` is true.
|
|
18964
|
+
* @param column - The TableColumn object for which to compute the row classes.
|
|
18965
|
+
* @param row - The data object representing the current row.
|
|
18966
|
+
* @returns An object containing CSS class names as keys and boolean values indicating whether the class should be applied.
|
|
18953
18967
|
*/
|
|
18954
18968
|
getRowClasses(column, row) {
|
|
18955
|
-
return Object.assign({
|
|
18956
|
-
'gt-xs': column.display == Grid.Xs,
|
|
18957
|
-
'gt-sm': column.display == Grid.Sm,
|
|
18958
|
-
'gt-md': column.display == Grid.Md,
|
|
18959
|
-
'gt-lg': column.display == Grid.Lg,
|
|
18960
|
-
'gt-xl': column.display == Grid.Xl,
|
|
18961
|
-
'gt-xxl': column.display == Grid.Xxl,
|
|
18962
|
-
'hidden': column.display == Grid.None,
|
|
18969
|
+
return Object.assign({}, column.displayNgClass || this.getDisplayClasses(column), {
|
|
18963
18970
|
'text-right': column.arrowBefore
|
|
18964
18971
|
}, column.cellNgClass ? column.cellNgClass(row, this.context) : {});
|
|
18965
18972
|
}
|
|
@@ -19004,7 +19011,7 @@ class VdDynamicTableComponent {
|
|
|
19004
19011
|
this.changeDetector.detectChanges();
|
|
19005
19012
|
}
|
|
19006
19013
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: VdDynamicTableComponent, deps: [{ token: DynamicBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
19007
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: VdDynamicTableComponent, isStandalone: true, selector: "vd-dynamic-table", inputs: { dataSource: "dataSource", data: "data", parentControl: "parentControl", entityObject: "entityObject", formArray: "formArray", debugValue: "debugValue", classType: "classType", context: "context", dataSourceFilter: "dataSourceFilter", static: "static", filterable: "filterable", sticky: "sticky", tableWidth: "tableWidth", useFilterOperator: "useFilterOperator", paginable: "paginable", selectable: "selectable", sortActive: "sortActive", sortDirection: "sortDirection", stickyHeader: "stickyHeader", stickyFilter: "stickyFilter", columnSets: "columnSets", rowNgClass: "rowNgClass", detailsTemplate: "detailsTemplate", readonly: "readonly", selectAllFilter: "selectAllFilter", paginatorRef: "paginatorRef", columns: "columns", rowMenuItems: "rowMenuItems", rowAction: "rowAction", excludedColumns: "excludedColumns", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions" }, outputs: { rowClick: "rowClick" }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "table", first: true, predicate: ["table"], descendants: true }, { propertyName: "matSort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true, static: true }, { propertyName: "detailsTemplateRef", predicate: ["detailsTemplate"], descendants: true, read: ViewContainerRef }, { propertyName: "rowContextMenuTriggers", predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: "@if (!static) {\r\n <div class=\"loading-progress\">\r\n @if (dataSource?.isLoading) {\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n }\r\n </div>\r\n}\r\n\r\n<!-- #region Data table -->\r\n<div class=\"mat-table-container scrollbar-secondary\" [ngClass]=\"{'mat-table-sticky': sticky}\" #scrollContainer>\r\n <table mat-table #table [dataSource]=\"dataSource\" [dataSourceFilter]=\"dataSourceFilter\" [ngClass]=\"{'table-fixed': !sticky && !detailsTemplate && !templateRef, 'table-stick': sticky}\" [trackBy]=\"trackBy\" matSort matSortDisableClear [matSortActive]=\"sortActive||'id'\" [matSortDirection]=\"sortDirection\" multiTemplateDataRows>\r\n @for (column of columns$ | async; track columnsTrackBy($index, column)) {\r\n <!-- #region Column def -->\r\n <ng-container [cdkColumnDef]=\"column.name\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <ng-template #header [ngTemplateOutlet]=\"header\" let-headerText=\"headerText\" [ngTemplateOutletContext]=\"{headerText: column.header | func:context}\">\r\n <th mat-header-cell *cdkHeaderCellDef [mat-sort-header]=\"column.sortBy || column.name\" [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [disabled]=\"column.type == ColumnType.Checkbox || column.disabled\" [ngClass]=\"{'gt-xs': column.display == Grid.Xs, 'gt-sm': column.display == Grid.Sm, 'gt-md': column.display == Grid.Md, 'gt-lg': column.display == Grid.Lg, 'gt-xl': column.display == Grid.Xl, 'gt-xxl': column.display == Grid.Xxl, 'hidden': column.display == Grid.None}\" [arrowPosition]=\"column.arrowBefore?'before':'after'\">\r\n @if (column.type == ColumnType.Checkbox) {\r\n <mat-checkbox (change)=\"$event ? dataSource.toggleSelect($event, selectAllFilter) : null\" [disabled]=\"!dataSource.paginator?.length\" [checked]=\"dataSource.selectionModel.hasValue() && dataSource.isAllSelected()\" [indeterminate]=\"dataSource.selectionModel.hasValue() && !dataSource.isAllSelected()\"></mat-checkbox>\r\n } @if (column.type != ColumnType.Checkbox) {\r\n <span [matTooltip]=\"headerText\">{{headerText}}</span>\r\n }\r\n </th>\r\n </ng-template>\r\n <td mat-cell *cdkCellDef=\"let row; let rowIndex = dataIndex\" [matTooltip]=\"column.tooltip?column.tooltip(row, undefined, context):null\" [matTooltipClass]=\"column.tooltipClass??''\" [hidden]=\"column.hidden\" [ngClass]=\"getRowClasses(column, row)\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\">\r\n <ng-template #rowVal [ngTemplateOutlet]=\"rowVal\" let-rowValue [ngTemplateOutletContext]=\"{$implicit: column?.content && column?.content(row, undefined, context)}\">\r\n @switch (column.type) {\r\n <!-- #region Checkbox column -->\r\n @case (ColumnType.Checkbox) {\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? dataSource.selectionModel.toggle(row) : null\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [checked]=\"dataSource.selectionModel.isSelected(row)\"></mat-checkbox>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Enum column -->\r\n @case (ColumnType.Enum) {\r\n <span>\r\n @if (column.enumMetadata) {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index) {\r\n @if (i < 2) {\r\n <ng-template let-displayValue=\"displayValue\" [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ displayValue: column.enumMetadata[item].display }\"></ng-template>\r\n }\r\n @if (i === 1 && rowValue?.length > 2) {\r\n <small [matTooltip]=\"(rowValue | slice:2 | map:column.enumMetadata | map:'display') | join:'\\n'\" matTooltipClass=\"mat-tooltip-multiline\">...</small>\r\n }\r\n }\r\n <ng-template #template let-displayValue=\"displayValue\">\r\n <mat-chip-row disableRipple=\"true\" selectable=\"false\" [matTooltip]=\"displayValue\">\r\n <span>{{ displayValue }}</span>\r\n </mat-chip-row>\r\n </ng-template>\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <span class=\"na\" [ngStyle]=\"{ color: ((column.enumMetadata[rowValue] || {}).textColor || 'inherit') }\" [innerHtml]=\"(column.enumMetadata[rowValue]||{}).display\"></span>\r\n }\r\n }\r\n } @else {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index; let last = $last) {\r\n <div>\r\n @if (i<2) {\r\n <small>\r\n <msa-enum-display [value]=\"item\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n </small>\r\n } @if (i==1 && rowValue?.length > 2) {\r\n <small>, ...</small>\r\n }\r\n </div>\r\n }\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <msa-enum-display [value]=\"rowValue\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n }\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n @if (!formArray) {\r\n <mat-slide-toggle [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);handleModelChange(column, row, undefined);\" (click)=\"$event.stopPropagation();\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" color=\"accent\"></mat-slide-toggle>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date column -->\r\n @case (ColumnType.Date) {\r\n <span>{{rowValue | date:column.shortDate?'dd.MM.yyyy':'dd.MM.yyyy HH:mm:ss'}}</span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <input matInput type=\"{{column.inputType}}\" autocomplete=\"none\" name=\"{{column.name}}{{rowIndex}}\" [ngModel]=\"row | property:column.name\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [min]=\"column.inputMin?column.inputMin(row, undefined, context):null\" [max]=\"column.inputMax?column.inputMax(row, undefined, context):null\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);(column.change?column.change(row, undefined, context):patch(row, [column.name], $event, column.patchIncludes));\" [ngModelOptions]=\"{updateOn: 'blur'}\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <vd-select name=\"{{column.name}}{{rowIndex}}\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"$safeNavigationMigration(column?.enumFilter) | func:row:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" (change)=\"column.change?column.change(row, undefined, context):patch(row, [column.name], $event.value, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action -->\r\n @case (ColumnType.Action) {\r\n @if (column.menu) {\r\n @if (menu?.matMenu && !row.locked && hasVisibleRowMenuItems(row, column)) {\r\n <div id=\"menu-{{row.id}}\" style=\"visibility: hidden; position: fixed\" #contextMenuTrigger=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu.matMenu!\"></div>\r\n }\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\" #menu></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Menu -->\r\n @case (ColumnType.Menu) {\r\n @if (column.menu) {\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\"></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon -->\r\n @case (ColumnType.Icon) {\r\n <span layout=\"row\" layout-align=\"start center\">\r\n @if(column && column.icon){\r\n @if ( column.icon.matIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\">{{handleExpression($safeNavigationMigration(column.icon.matIcon)!, row)}}</mat-icon>\r\n }\r\n @if (column.icon.svgIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [svgIcon]=\"handleExpression($safeNavigationMigration(column.icon.svgIcon)!, row)!\"></mat-icon>\r\n }\r\n @if (column.icon.fontIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [fontIcon]=\"handleExpression($safeNavigationMigration(column.icon.fontIcon)!, row)!\"></mat-icon>\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon button -->\r\n @case (ColumnType.IconButton) {\r\n <a mat-icon-button (click)=\"$event.stopPropagation();column.iconButton?.event?column.iconButton.event(row, context):null\">\r\n <mat-icon fontSet=\"{{column.iconButton?.iconFontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.iconButton?.iconClass??'', row)\">{{handleExpression(column.iconButton?.icon??'radio_button_checked', row) || 'radio_button_checked'}}</mat-icon>\r\n </a>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Other column types -->\r\n @default {\r\n <span [innerHtml]=\"rowValue??''\"></span>\r\n }\r\n <!-- #endregion -->\r\n }\r\n <ng-template #recursiveContainer let-columnNameSegments=\"segments\" let-formGroup=\"formGroup\" let-parentFormGroup=\"parentFormGroup\">\r\n @if (formGroup) {\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- If the columnNameSegments array is empty, we're at the leaf node -->\r\n @if (!columnNameSegments.length) {\r\n @switch (column.type) {\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n <mat-slide-toggle [formControl]=\"formGroup\" (click)=\"$event.stopPropagation();\" (change)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):handleModelChange(column, parentFormGroup.value, parentFormGroup)\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" color=\"accent\"></mat-slide-toggle>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <input matInput [formControl]=\"formGroup\" type=\"{{column.inputType}}\" autocomplete=\"none\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" [min]=\"column.inputMin?column.inputMin(parentFormGroup.value, parentFormGroup, context):null\" [max]=\"column.inputMax?column.inputMax(parentFormGroup.value, parentFormGroup, context):null\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <vd-select [formControl]=\"formGroup\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:parentFormGroup.value:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" (selectionChange)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):patch(parentFormGroup.value, [column.name], rowValue, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n }\r\n } @else {\r\n <!-- If not the last segment, create a nested form group -->\r\n <ng-container [formGroupName]=\"columnNameSegments[0]\">\r\n <!-- Recursive call to handle nested segments -->\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: columnNameSegments.slice(1), parentFormGroup:formGroup, formGroup: formGroup.get(columnNameSegments[0])}\"></ng-container>\r\n </ng-container>\r\n }\r\n </ng-container>\r\n }\r\n </ng-template>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n }\r\n\r\n <!-- #region Filter row -->\r\n @if (dataSource && filterable) {\r\n @for (column of columns$ | async; track column) {\r\n <ng-container cdkColumnDef=\"filter.{{column.filter || column.name}}\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <th mat-header-cell *cdkHeaderCellDef [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [ngClass]=\"{'gt-xs': column.display == Grid.Xs, 'gt-sm': column.display == Grid.Sm, 'gt-md': column.display == Grid.Md, 'gt-lg': column.display == Grid.Lg, 'gt-xl': column.display == Grid.Xl, 'gt-xxl': column.display == Grid.Xxl, 'hidden': column.display == Grid.None}\">\r\n <!-- #region Select filter -->\r\n @if(column.endpoint || column.enumType || column.options){\r\n <span filter-select [endpoint]=\"column.endpoint\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:{}:context\" [options]=\"column.options\" [text]=\"column.filterOptionText || 'name'\"></span>\r\n }\r\n <!-- #region Text filter -->\r\n @else if(column.type == ColumnType.Text || column.type == ColumnType.TextInput || column.type == ColumnType.Number) {\r\n <span filter-input [onlyNumber]=\"column.filterInputNumber??false\" [matTooltip]=\"column.filterTooltip ? column.filterTooltip(context):null\" [matTooltipClass]=\"column.filterTooltipClass??''\" [operator]=\"!useFilterOperator ? undefined : column.filterOperator\"></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date filter -->\r\n @else if (column.type == ColumnType.Date) {\r\n <span filter-date></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action filter (clear) -->\r\n @else if (column.type == ColumnType.Action) {\r\n <span filter-clear></span>\r\n }\r\n <!-- #endregion -->\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n\r\n <!-- #region Details column -->\r\n <ng-container cdkColumnDef=\"expandedDetail\">\r\n <td mat-cell *matCellDef=\"let row; let index = index\" [attr.colspan]=\"(displayedColumns$ | async)?.length\">\r\n <div class=\"row-detail\" [@detailExpand]=\"row == expandedRow ? 'expanded' : 'collapsed'\" #detailsTemplate>\r\n @if (templateRef && row === expandedRow) {\r\n <ng-container *ngTemplateOutlet=\"templateRef; context:{row: row, index: index, context: context}\"></ng-container>\r\n }\r\n </div>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n\r\n <!-- #region Filter header -->\r\n @if (filterable) {\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedFilterColumns$ | async\"></tr>\r\n }\r\n <!-- #endregion -->\r\n\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedColumns$ | async; sticky: stickyFilter\"></tr>\r\n <tr mat-row *cdkRowDef=\"let row; columns: displayedColumns$ | async; let index = dataIndex\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\" [class.expanded-row]=\"expandedRow === row\" (click)=\"handleRowClick(index, row)\" (contextmenu)=\"handleRowRightClick($event, row)\"></tr>\r\n\r\n <!-- #region Detrails row -->\r\n @if (detailsTemplate || templateRef) {\r\n <tr mat-row *cdkRowDef=\"let row; columns: ['expandedDetail']\" class=\"detail-row\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\"></tr>\r\n }\r\n <!-- #endregion -->\r\n </table>\r\n\r\n <!-- #region Modern No Results Message -->\r\n @if (dataSource?.filteredData?.length <= 0 && dataSource?.total <= 0) {\r\n <div class=\"no-results-overlay\">\r\n <mat-icon class=\"no-results-icon\">search_off</mat-icon>\r\n <div class=\"no-results-text mat-body-1\">\r\n <h3 i18n=\"@@noResultsFound\">No results found</h3>\r\n <p i18n=\"@@tryAdjustFilters\">\r\n Try adjusting your filters or search criteria.\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n <!-- #endregion -->\r\n</div>\r\n<!-- #endregion -->\r\n\r\n<!-- #region Debug value -->\r\n@if (debugValue) {\r\n <code>\r\n <pre>{{formValue | json}}</pre>\r\n</code>\r\n}\r\n<!-- #endregion -->\r\n\r\n<div class=\"table-footer\" layout=\"row\">\r\n <ng-content select=\"[table-footer]\"></ng-content>\r\n <span flex></span>\r\n @if (paginable) {\r\n <mat-paginator [pageSize]=\"pageSize\" [pageSizeOptions]=\"pageSizeOptions\" showFirstLastButtons=\"true\"></mat-paginator>\r\n }\r\n</div>", styles: ["::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-form-field .mat-form-field-wrapper{width:100%}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip{height:24px;margin-top:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip .mdc-evolution-chip__action--primary{padding-left:9px;padding-right:9px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip:last-child{margin-bottom:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip *{font-size:.8rem}@media(max-width:389px){::ng-deep .mat-mdc-table [gt-xs],::ng-deep .mat-mdc-table .gt-xs{display:none}::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:599px){::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:959px){::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1279px){::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1919px){::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1979px){::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}.mat-table-container{width:100%;max-width:100%;overflow:auto}.mat-table-container .mat-mdc-header-cell,.mat-table-container .mat-mdc-footer-cell,.mat-table-container .mat-mdc-cell{min-width:80px;box-sizing:border-box}.mat-table-container .mat-mdc-header-row,.mat-table-container .mat-mdc-footer-row,.mat-table-container .mat-mdc-row{min-width:1920px}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-right{box-shadow:-3px 0 5px #0000001a}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-left{box-shadow:3px 0 5px #0000001a}\n"], dependencies: [{ kind: "ngmodule", type: CdkTableModule }, { kind: "directive", type: i2$3.CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "directive", type: i2$3.CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: i2$3.CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: i2$3.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: i2$3.CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i10.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i12.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i12.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i16.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type:
|
|
19014
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: VdDynamicTableComponent, isStandalone: true, selector: "vd-dynamic-table", inputs: { dataSource: "dataSource", data: "data", parentControl: "parentControl", entityObject: "entityObject", formArray: "formArray", debugValue: "debugValue", classType: "classType", context: "context", dataSourceFilter: "dataSourceFilter", static: "static", filterable: "filterable", sticky: "sticky", tableWidth: "tableWidth", useFilterOperator: "useFilterOperator", paginable: "paginable", selectable: "selectable", sortActive: "sortActive", sortDirection: "sortDirection", stickyHeader: "stickyHeader", stickyFilter: "stickyFilter", columnSets: "columnSets", rowNgClass: "rowNgClass", detailsTemplate: "detailsTemplate", readonly: "readonly", selectAllFilter: "selectAllFilter", paginatorRef: "paginatorRef", columns: "columns", rowMenuItems: "rowMenuItems", rowAction: "rowAction", excludedColumns: "excludedColumns", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions" }, outputs: { rowClick: "rowClick" }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "table", first: true, predicate: ["table"], descendants: true }, { propertyName: "matSort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true, static: true }, { propertyName: "detailsTemplateRef", predicate: ["detailsTemplate"], descendants: true, read: ViewContainerRef }, { propertyName: "rowContextMenuTriggers", predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: "@if (!static) {\r\n <div class=\"loading-progress\">\r\n @if (dataSource?.isLoading) {\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n }\r\n </div>\r\n}\r\n<!-- #region Data table -->\r\n<div class=\"mat-table-container scrollbar-secondary\" [ngClass]=\"{'mat-table-sticky': sticky}\" #scrollContainer>\r\n <table mat-table #table [dataSource]=\"dataSource\" [dataSourceFilter]=\"dataSourceFilter\" [ngClass]=\"{'table-fixed': !sticky && !detailsTemplate && !templateRef, 'table-stick': sticky}\" [trackBy]=\"trackBy\" matSort matSortDisableClear [matSortActive]=\"sortActive||'id'\" [matSortDirection]=\"sortDirection\" multiTemplateDataRows>\r\n @for (column of columns$ | async; track columnsTrackBy($index, column)) {\r\n <!-- #region Column def -->\r\n <ng-container [cdkColumnDef]=\"column.name\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <ng-template #header [ngTemplateOutlet]=\"header\" let-headerText=\"headerText\" [ngTemplateOutletContext]=\"{headerText: column.header | func:context}\">\r\n <th mat-header-cell *cdkHeaderCellDef [mat-sort-header]=\"column.sortBy || column.name\" [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [disabled]=\"column.type == ColumnType.Checkbox || column.disabled\" [ngClass]=\"column.displayNgClass\" [arrowPosition]=\"column.arrowBefore?'before':'after'\">\r\n @if (column.type == ColumnType.Checkbox) {\r\n <mat-checkbox (change)=\"$event ? dataSource.toggleSelect($event, selectAllFilter) : null\" [disabled]=\"!dataSource.paginator?.length\" [checked]=\"dataSource.selectionModel.hasValue() && dataSource.isAllSelected()\" [indeterminate]=\"dataSource.selectionModel.hasValue() && !dataSource.isAllSelected()\"></mat-checkbox>\r\n } @if (column.type != ColumnType.Checkbox) {\r\n <span [matTooltip]=\"headerText\">{{headerText}}</span>\r\n }\r\n </th>\r\n </ng-template>\r\n <td mat-cell *cdkCellDef=\"let row; let rowIndex = dataIndex\" [matTooltip]=\"column.tooltip?column.tooltip(row, undefined, context):null\" [matTooltipClass]=\"column.tooltipClass??''\" [hidden]=\"column.hidden\" [ngClass]=\"getRowClasses(column, row)\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\">\r\n <ng-template #rowVal [ngTemplateOutlet]=\"rowVal\" let-rowValue [ngTemplateOutletContext]=\"{$implicit: column?.content && column?.content(row, undefined, context)}\">\r\n @switch (column.type) {\r\n <!-- #region Checkbox column -->\r\n @case (ColumnType.Checkbox) {\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? dataSource.selectionModel.toggle(row) : null\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [checked]=\"dataSource.selectionModel.isSelected(row)\"></mat-checkbox>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Enum column -->\r\n @case (ColumnType.Enum) {\r\n <span>\r\n @if (column.enumMetadata) {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index) {\r\n @if (i < 2) {\r\n <ng-template let-displayValue=\"displayValue\" [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ displayValue: column.enumMetadata[item].display }\"></ng-template>\r\n }\r\n @if (i === 1 && rowValue?.length > 2) {\r\n <small [matTooltip]=\"(rowValue | slice:2 | map:column.enumMetadata | map:'display') | join:'\\n'\" matTooltipClass=\"mat-tooltip-multiline\">...</small>\r\n }\r\n }\r\n <ng-template #template let-displayValue=\"displayValue\">\r\n <mat-chip-row disableRipple=\"true\" selectable=\"false\" [matTooltip]=\"displayValue\">\r\n <span>{{ displayValue }}</span>\r\n </mat-chip-row>\r\n </ng-template>\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <span class=\"na\" [ngStyle]=\"{ color: ((column.enumMetadata[rowValue] || {}).textColor || 'inherit') }\" [innerHtml]=\"(column.enumMetadata[rowValue]||{}).display\"></span>\r\n }\r\n }\r\n } @else {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index; let last = $last) {\r\n <div>\r\n @if (i<2) {\r\n <small>\r\n <msa-enum-display [value]=\"item\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n </small>\r\n } @if (i==1 && rowValue?.length > 2) {\r\n <small>, ...</small>\r\n }\r\n </div>\r\n }\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <msa-enum-display [value]=\"rowValue\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n }\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n @if (!formArray) {\r\n <mat-slide-toggle [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);handleModelChange(column, row, undefined);\" (click)=\"$event.stopPropagation();\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" color=\"accent\"></mat-slide-toggle>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date column -->\r\n @case (ColumnType.Date) {\r\n <span>{{rowValue | date:column.shortDate?'dd.MM.yyyy':'dd.MM.yyyy HH:mm:ss'}}</span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <input matInput type=\"{{column.inputType}}\" autocomplete=\"none\" name=\"{{column.name}}{{rowIndex}}\" [ngModel]=\"row | property:column.name\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [min]=\"column.inputMin?column.inputMin(row, undefined, context):null\" [max]=\"column.inputMax?column.inputMax(row, undefined, context):null\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);(column.change?column.change(row, undefined, context):patch(row, [column.name], $event, column.patchIncludes));\" [ngModelOptions]=\"{updateOn: 'blur'}\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <vd-select name=\"{{column.name}}{{rowIndex}}\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"$safeNavigationMigration(column?.enumFilter) | func:row:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" (change)=\"column.change?column.change(row, undefined, context):patch(row, [column.name], $event.value, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action -->\r\n @case (ColumnType.Action) {\r\n @if (column.menu) {\r\n @if (menu?.matMenu && !row.locked && hasVisibleRowMenuItems(row, column)) {\r\n <div id=\"menu-{{row.id}}\" style=\"visibility: hidden; position: fixed\" #contextMenuTrigger=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu.matMenu!\"></div>\r\n }\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\" #menu></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Menu -->\r\n @case (ColumnType.Menu) {\r\n @if (column.menu) {\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\"></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon -->\r\n @case (ColumnType.Icon) {\r\n <span layout=\"row\" layout-align=\"start center\">\r\n @if(column && column.icon){\r\n @if ( column.icon.matIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\">{{handleExpression($safeNavigationMigration(column.icon.matIcon)!, row)}}</mat-icon>\r\n }\r\n @if (column.icon.svgIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [svgIcon]=\"handleExpression($safeNavigationMigration(column.icon.svgIcon)!, row)!\"></mat-icon>\r\n }\r\n @if (column.icon.fontIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [fontIcon]=\"handleExpression($safeNavigationMigration(column.icon.fontIcon)!, row)!\"></mat-icon>\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon button -->\r\n @case (ColumnType.IconButton) {\r\n <a mat-icon-button (click)=\"$event.stopPropagation();column.iconButton?.event?column.iconButton.event(row, context):null\">\r\n <mat-icon fontSet=\"{{column.iconButton?.iconFontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.iconButton?.iconClass??'', row)\">{{handleExpression(column.iconButton?.icon??'radio_button_checked', row) || 'radio_button_checked'}}</mat-icon>\r\n </a>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Other column types -->\r\n @default {\r\n <span [innerHtml]=\"rowValue??''\"></span>\r\n }\r\n <!-- #endregion -->\r\n }\r\n <ng-template #recursiveContainer let-columnNameSegments=\"segments\" let-formGroup=\"formGroup\" let-parentFormGroup=\"parentFormGroup\">\r\n @if (formGroup) {\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- If the columnNameSegments array is empty, we're at the leaf node -->\r\n @if (!columnNameSegments.length) {\r\n @switch (column.type) {\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n <mat-slide-toggle [formControl]=\"formGroup\" (click)=\"$event.stopPropagation();\" (change)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):handleModelChange(column, parentFormGroup.value, parentFormGroup)\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" color=\"accent\"></mat-slide-toggle>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <input matInput [formControl]=\"formGroup\" type=\"{{column.inputType}}\" autocomplete=\"none\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" [min]=\"column.inputMin?column.inputMin(parentFormGroup.value, parentFormGroup, context):null\" [max]=\"column.inputMax?column.inputMax(parentFormGroup.value, parentFormGroup, context):null\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <vd-select [formControl]=\"formGroup\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:parentFormGroup.value:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" (selectionChange)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):patch(parentFormGroup.value, [column.name], rowValue, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n }\r\n } @else {\r\n <!-- If not the last segment, create a nested form group -->\r\n <ng-container [formGroupName]=\"columnNameSegments[0]\">\r\n <!-- Recursive call to handle nested segments -->\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: columnNameSegments.slice(1), parentFormGroup:formGroup, formGroup: formGroup.get(columnNameSegments[0])}\"></ng-container>\r\n </ng-container>\r\n }\r\n </ng-container>\r\n }\r\n </ng-template>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n }\r\n <!-- #region Filter row -->\r\n @if (dataSource && filterable) {\r\n @for (column of columns$ | async; track column) {\r\n <ng-container cdkColumnDef=\"filter.{{column.filter || column.name}}\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <th mat-header-cell *cdkHeaderCellDef [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [ngClass]=\"column.displayNgClass\">\r\n <!-- #region Select filter -->\r\n @if(column.endpoint || column.enumType || column.options){\r\n <span filter-select [endpoint]=\"column.endpoint\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:{}:context\" [options]=\"column.options\" [text]=\"column.filterOptionText || 'name'\"></span>\r\n }\r\n <!-- #region Text filter -->\r\n @else if(column.type == ColumnType.Text || column.type == ColumnType.TextInput || column.type == ColumnType.Number) {\r\n <span filter-input [onlyNumber]=\"column.filterInputNumber??false\" [matTooltip]=\"column.filterTooltip ? column.filterTooltip(context):null\" [matTooltipClass]=\"column.filterTooltipClass??''\" [operator]=\"!useFilterOperator ? undefined : column.filterOperator\"></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date filter -->\r\n @else if (column.type == ColumnType.Date) {\r\n <span filter-date></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action filter (clear) -->\r\n @else if (column.type == ColumnType.Action) {\r\n <span filter-clear></span>\r\n }\r\n <!-- #endregion -->\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Details column -->\r\n <ng-container cdkColumnDef=\"expandedDetail\">\r\n <td mat-cell *matCellDef=\"let row; let index = index\" [attr.colspan]=\"(displayedColumns$ | async)?.length\">\r\n <div class=\"row-detail\" [@detailExpand]=\"row == expandedRow ? 'expanded' : 'collapsed'\" #detailsTemplate>\r\n @if (templateRef && row === expandedRow) {\r\n <ng-container *ngTemplateOutlet=\"templateRef; context:{row: row, index: index, context: context}\"></ng-container>\r\n }\r\n </div>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n <!-- #region Filter header -->\r\n @if (filterable) {\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedFilterColumns$ | async\"></tr>\r\n }\r\n <!-- #endregion -->\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedColumns$ | async; sticky: stickyFilter\"></tr>\r\n <tr mat-row *cdkRowDef=\"let row; columns: displayedColumns$ | async; let index = dataIndex\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\" [class.expanded-row]=\"expandedRow === row\" (click)=\"handleRowClick(index, row)\" (contextmenu)=\"handleRowRightClick($event, row)\"></tr>\r\n <!-- #region Detrails row -->\r\n @if (detailsTemplate || templateRef) {\r\n <tr mat-row *cdkRowDef=\"let row; columns: ['expandedDetail']\" class=\"detail-row\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\"></tr>\r\n }\r\n <!-- #endregion -->\r\n </table>\r\n <!-- #region Modern No Results Message -->\r\n @if (dataSource?.filteredData?.length <= 0 && dataSource?.total <= 0) {\r\n <div class=\"no-results-overlay\">\r\n <mat-icon class=\"no-results-icon\">search_off</mat-icon>\r\n <div class=\"no-results-text mat-body-1\">\r\n <h3 i18n=\"@@noResultsFound\">No results found</h3>\r\n <p i18n=\"@@tryAdjustFilters\"> Try adjusting your filters or search criteria. </p>\r\n </div>\r\n </div>\r\n }\r\n <!-- #endregion -->\r\n</div>\r\n<!-- #endregion -->\r\n<!-- #region Debug value -->\r\n@if (debugValue) {\r\n <code>\r\n <pre>{{formValue | json}}</pre>\r\n</code>\r\n}\r\n<!-- #endregion -->\r\n<div class=\"table-footer\" layout=\"row\">\r\n <ng-content select=\"[table-footer]\"></ng-content>\r\n <span flex></span>\r\n @if (paginable) {\r\n <mat-paginator [pageSize]=\"pageSize\" [pageSizeOptions]=\"pageSizeOptions\" showFirstLastButtons=\"true\"></mat-paginator>\r\n }\r\n</div>", styles: ["::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-form-field .mat-form-field-wrapper{width:100%}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip{height:24px;margin-top:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip .mdc-evolution-chip__action--primary{padding-left:9px;padding-right:9px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip:last-child{margin-bottom:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip *{font-size:.8rem}@media(max-width:389px){::ng-deep .mat-mdc-table [gt-xs],::ng-deep .mat-mdc-table .gt-xs{display:none}::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:599px){::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:959px){::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1279px){::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1919px){::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1979px){::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}.mat-table-container{width:100%;max-width:100%;overflow:auto}.mat-table-container .mat-mdc-header-cell,.mat-table-container .mat-mdc-footer-cell,.mat-table-container .mat-mdc-cell{min-width:80px;box-sizing:border-box}.mat-table-container .mat-mdc-header-row,.mat-table-container .mat-mdc-footer-row,.mat-table-container .mat-mdc-row{min-width:1920px}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-right{box-shadow:-3px 0 5px #0000001a}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-left{box-shadow:3px 0 5px #0000001a}\n"], dependencies: [{ kind: "ngmodule", type: CdkTableModule }, { kind: "directive", type: i2$3.CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "directive", type: i2$3.CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: i2$3.CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: i2$3.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: i2$3.CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i10.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i12.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i12.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i16.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type:
|
|
19008
19015
|
//----------------------
|
|
19009
19016
|
DataSourceFilterDirective, selector: "[dataSourceFilter]", inputs: ["dataSource", "dataSourceFilter"] }, { kind: "directive", type: DisableControlDirective, selector: "[disableControl]", inputs: ["disableControl"] }, { kind: "component", type: FilterDateComponent, selector: "mat-header-cell[filter-date], [mat-header-cell][filter-date], [filter-date]", inputs: ["field", "debounce", "placeholder"] }, { kind: "component", type: FilterInputComponent, selector: "mat-header-cell[filter-input], [mat-header-cell][filter-input], [filter-input]", inputs: ["field", "operator", "onlyNumber", "debounce", "placeholder"] }, { kind: "component", type: FilterSelectComponent, selector: "mat-header-cell[filter-select], [mat-header-cell][filter-select], [filter-select]", inputs: ["endpoint", "params", "projection", "sortBy", "sorted", "enumFilter", "enum", "enumMetadata", "key", "text", "prefix", "multiple", "options", "filteredOptions", "filterable", "field", "placeholder", "cache"] }, { kind: "component", type: FilterClearComponent, selector: "mat-header-cell[filter-clear], [mat-header-cell][filter-clear], [filter-clear]" }, { kind: "component", type: VdDynamicMenuComponent, selector: "vd-dynamic-menu", inputs: ["items", "data", "index", "context", "contextMenu"] }, { kind: "component", type: VdSelectComponent, selector: "vd-select", inputs: ["triggerCssClass"] }, { kind: "component", type: MsaEnumDisplayComponent, selector: "msa-enum-display", inputs: ["value", "enumType", "metadata", "showIcon", "entity", "context"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }, { kind: "pipe", type: i1$2.SlicePipe, name: "slice" }, { kind: "pipe", type: i1$2.DatePipe, name: "date" }, { kind: "pipe", type:
|
|
19010
19017
|
//----------------------
|
|
@@ -19058,7 +19065,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
19058
19065
|
state('expanded', style({ height: AUTO_STYLE })),
|
|
19059
19066
|
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
|
19060
19067
|
]),
|
|
19061
|
-
], template: "@if (!static) {\r\n <div class=\"loading-progress\">\r\n @if (dataSource?.isLoading) {\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n }\r\n </div>\r\n}\r\n\r\n<!-- #region Data table -->\r\n<div class=\"mat-table-container scrollbar-secondary\" [ngClass]=\"{'mat-table-sticky': sticky}\" #scrollContainer>\r\n <table mat-table #table [dataSource]=\"dataSource\" [dataSourceFilter]=\"dataSourceFilter\" [ngClass]=\"{'table-fixed': !sticky && !detailsTemplate && !templateRef, 'table-stick': sticky}\" [trackBy]=\"trackBy\" matSort matSortDisableClear [matSortActive]=\"sortActive||'id'\" [matSortDirection]=\"sortDirection\" multiTemplateDataRows>\r\n @for (column of columns$ | async; track columnsTrackBy($index, column)) {\r\n <!-- #region Column def -->\r\n <ng-container [cdkColumnDef]=\"column.name\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <ng-template #header [ngTemplateOutlet]=\"header\" let-headerText=\"headerText\" [ngTemplateOutletContext]=\"{headerText: column.header | func:context}\">\r\n <th mat-header-cell *cdkHeaderCellDef [mat-sort-header]=\"column.sortBy || column.name\" [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [disabled]=\"column.type == ColumnType.Checkbox || column.disabled\" [ngClass]=\"{'gt-xs': column.display == Grid.Xs, 'gt-sm': column.display == Grid.Sm, 'gt-md': column.display == Grid.Md, 'gt-lg': column.display == Grid.Lg, 'gt-xl': column.display == Grid.Xl, 'gt-xxl': column.display == Grid.Xxl, 'hidden': column.display == Grid.None}\" [arrowPosition]=\"column.arrowBefore?'before':'after'\">\r\n @if (column.type == ColumnType.Checkbox) {\r\n <mat-checkbox (change)=\"$event ? dataSource.toggleSelect($event, selectAllFilter) : null\" [disabled]=\"!dataSource.paginator?.length\" [checked]=\"dataSource.selectionModel.hasValue() && dataSource.isAllSelected()\" [indeterminate]=\"dataSource.selectionModel.hasValue() && !dataSource.isAllSelected()\"></mat-checkbox>\r\n } @if (column.type != ColumnType.Checkbox) {\r\n <span [matTooltip]=\"headerText\">{{headerText}}</span>\r\n }\r\n </th>\r\n </ng-template>\r\n <td mat-cell *cdkCellDef=\"let row; let rowIndex = dataIndex\" [matTooltip]=\"column.tooltip?column.tooltip(row, undefined, context):null\" [matTooltipClass]=\"column.tooltipClass??''\" [hidden]=\"column.hidden\" [ngClass]=\"getRowClasses(column, row)\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\">\r\n <ng-template #rowVal [ngTemplateOutlet]=\"rowVal\" let-rowValue [ngTemplateOutletContext]=\"{$implicit: column?.content && column?.content(row, undefined, context)}\">\r\n @switch (column.type) {\r\n <!-- #region Checkbox column -->\r\n @case (ColumnType.Checkbox) {\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? dataSource.selectionModel.toggle(row) : null\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [checked]=\"dataSource.selectionModel.isSelected(row)\"></mat-checkbox>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Enum column -->\r\n @case (ColumnType.Enum) {\r\n <span>\r\n @if (column.enumMetadata) {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index) {\r\n @if (i < 2) {\r\n <ng-template let-displayValue=\"displayValue\" [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ displayValue: column.enumMetadata[item].display }\"></ng-template>\r\n }\r\n @if (i === 1 && rowValue?.length > 2) {\r\n <small [matTooltip]=\"(rowValue | slice:2 | map:column.enumMetadata | map:'display') | join:'\\n'\" matTooltipClass=\"mat-tooltip-multiline\">...</small>\r\n }\r\n }\r\n <ng-template #template let-displayValue=\"displayValue\">\r\n <mat-chip-row disableRipple=\"true\" selectable=\"false\" [matTooltip]=\"displayValue\">\r\n <span>{{ displayValue }}</span>\r\n </mat-chip-row>\r\n </ng-template>\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <span class=\"na\" [ngStyle]=\"{ color: ((column.enumMetadata[rowValue] || {}).textColor || 'inherit') }\" [innerHtml]=\"(column.enumMetadata[rowValue]||{}).display\"></span>\r\n }\r\n }\r\n } @else {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index; let last = $last) {\r\n <div>\r\n @if (i<2) {\r\n <small>\r\n <msa-enum-display [value]=\"item\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n </small>\r\n } @if (i==1 && rowValue?.length > 2) {\r\n <small>, ...</small>\r\n }\r\n </div>\r\n }\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <msa-enum-display [value]=\"rowValue\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n }\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n @if (!formArray) {\r\n <mat-slide-toggle [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);handleModelChange(column, row, undefined);\" (click)=\"$event.stopPropagation();\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" color=\"accent\"></mat-slide-toggle>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date column -->\r\n @case (ColumnType.Date) {\r\n <span>{{rowValue | date:column.shortDate?'dd.MM.yyyy':'dd.MM.yyyy HH:mm:ss'}}</span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <input matInput type=\"{{column.inputType}}\" autocomplete=\"none\" name=\"{{column.name}}{{rowIndex}}\" [ngModel]=\"row | property:column.name\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [min]=\"column.inputMin?column.inputMin(row, undefined, context):null\" [max]=\"column.inputMax?column.inputMax(row, undefined, context):null\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);(column.change?column.change(row, undefined, context):patch(row, [column.name], $event, column.patchIncludes));\" [ngModelOptions]=\"{updateOn: 'blur'}\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <vd-select name=\"{{column.name}}{{rowIndex}}\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"$safeNavigationMigration(column?.enumFilter) | func:row:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" (change)=\"column.change?column.change(row, undefined, context):patch(row, [column.name], $event.value, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action -->\r\n @case (ColumnType.Action) {\r\n @if (column.menu) {\r\n @if (menu?.matMenu && !row.locked && hasVisibleRowMenuItems(row, column)) {\r\n <div id=\"menu-{{row.id}}\" style=\"visibility: hidden; position: fixed\" #contextMenuTrigger=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu.matMenu!\"></div>\r\n }\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\" #menu></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Menu -->\r\n @case (ColumnType.Menu) {\r\n @if (column.menu) {\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\"></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon -->\r\n @case (ColumnType.Icon) {\r\n <span layout=\"row\" layout-align=\"start center\">\r\n @if(column && column.icon){\r\n @if ( column.icon.matIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\">{{handleExpression($safeNavigationMigration(column.icon.matIcon)!, row)}}</mat-icon>\r\n }\r\n @if (column.icon.svgIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [svgIcon]=\"handleExpression($safeNavigationMigration(column.icon.svgIcon)!, row)!\"></mat-icon>\r\n }\r\n @if (column.icon.fontIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [fontIcon]=\"handleExpression($safeNavigationMigration(column.icon.fontIcon)!, row)!\"></mat-icon>\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon button -->\r\n @case (ColumnType.IconButton) {\r\n <a mat-icon-button (click)=\"$event.stopPropagation();column.iconButton?.event?column.iconButton.event(row, context):null\">\r\n <mat-icon fontSet=\"{{column.iconButton?.iconFontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.iconButton?.iconClass??'', row)\">{{handleExpression(column.iconButton?.icon??'radio_button_checked', row) || 'radio_button_checked'}}</mat-icon>\r\n </a>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Other column types -->\r\n @default {\r\n <span [innerHtml]=\"rowValue??''\"></span>\r\n }\r\n <!-- #endregion -->\r\n }\r\n <ng-template #recursiveContainer let-columnNameSegments=\"segments\" let-formGroup=\"formGroup\" let-parentFormGroup=\"parentFormGroup\">\r\n @if (formGroup) {\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- If the columnNameSegments array is empty, we're at the leaf node -->\r\n @if (!columnNameSegments.length) {\r\n @switch (column.type) {\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n <mat-slide-toggle [formControl]=\"formGroup\" (click)=\"$event.stopPropagation();\" (change)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):handleModelChange(column, parentFormGroup.value, parentFormGroup)\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" color=\"accent\"></mat-slide-toggle>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <input matInput [formControl]=\"formGroup\" type=\"{{column.inputType}}\" autocomplete=\"none\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" [min]=\"column.inputMin?column.inputMin(parentFormGroup.value, parentFormGroup, context):null\" [max]=\"column.inputMax?column.inputMax(parentFormGroup.value, parentFormGroup, context):null\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <vd-select [formControl]=\"formGroup\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:parentFormGroup.value:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" (selectionChange)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):patch(parentFormGroup.value, [column.name], rowValue, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n }\r\n } @else {\r\n <!-- If not the last segment, create a nested form group -->\r\n <ng-container [formGroupName]=\"columnNameSegments[0]\">\r\n <!-- Recursive call to handle nested segments -->\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: columnNameSegments.slice(1), parentFormGroup:formGroup, formGroup: formGroup.get(columnNameSegments[0])}\"></ng-container>\r\n </ng-container>\r\n }\r\n </ng-container>\r\n }\r\n </ng-template>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n }\r\n\r\n <!-- #region Filter row -->\r\n @if (dataSource && filterable) {\r\n @for (column of columns$ | async; track column) {\r\n <ng-container cdkColumnDef=\"filter.{{column.filter || column.name}}\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <th mat-header-cell *cdkHeaderCellDef [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [ngClass]=\"{'gt-xs': column.display == Grid.Xs, 'gt-sm': column.display == Grid.Sm, 'gt-md': column.display == Grid.Md, 'gt-lg': column.display == Grid.Lg, 'gt-xl': column.display == Grid.Xl, 'gt-xxl': column.display == Grid.Xxl, 'hidden': column.display == Grid.None}\">\r\n <!-- #region Select filter -->\r\n @if(column.endpoint || column.enumType || column.options){\r\n <span filter-select [endpoint]=\"column.endpoint\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:{}:context\" [options]=\"column.options\" [text]=\"column.filterOptionText || 'name'\"></span>\r\n }\r\n <!-- #region Text filter -->\r\n @else if(column.type == ColumnType.Text || column.type == ColumnType.TextInput || column.type == ColumnType.Number) {\r\n <span filter-input [onlyNumber]=\"column.filterInputNumber??false\" [matTooltip]=\"column.filterTooltip ? column.filterTooltip(context):null\" [matTooltipClass]=\"column.filterTooltipClass??''\" [operator]=\"!useFilterOperator ? undefined : column.filterOperator\"></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date filter -->\r\n @else if (column.type == ColumnType.Date) {\r\n <span filter-date></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action filter (clear) -->\r\n @else if (column.type == ColumnType.Action) {\r\n <span filter-clear></span>\r\n }\r\n <!-- #endregion -->\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n\r\n <!-- #region Details column -->\r\n <ng-container cdkColumnDef=\"expandedDetail\">\r\n <td mat-cell *matCellDef=\"let row; let index = index\" [attr.colspan]=\"(displayedColumns$ | async)?.length\">\r\n <div class=\"row-detail\" [@detailExpand]=\"row == expandedRow ? 'expanded' : 'collapsed'\" #detailsTemplate>\r\n @if (templateRef && row === expandedRow) {\r\n <ng-container *ngTemplateOutlet=\"templateRef; context:{row: row, index: index, context: context}\"></ng-container>\r\n }\r\n </div>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n\r\n <!-- #region Filter header -->\r\n @if (filterable) {\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedFilterColumns$ | async\"></tr>\r\n }\r\n <!-- #endregion -->\r\n\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedColumns$ | async; sticky: stickyFilter\"></tr>\r\n <tr mat-row *cdkRowDef=\"let row; columns: displayedColumns$ | async; let index = dataIndex\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\" [class.expanded-row]=\"expandedRow === row\" (click)=\"handleRowClick(index, row)\" (contextmenu)=\"handleRowRightClick($event, row)\"></tr>\r\n\r\n <!-- #region Detrails row -->\r\n @if (detailsTemplate || templateRef) {\r\n <tr mat-row *cdkRowDef=\"let row; columns: ['expandedDetail']\" class=\"detail-row\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\"></tr>\r\n }\r\n <!-- #endregion -->\r\n </table>\r\n\r\n <!-- #region Modern No Results Message -->\r\n @if (dataSource?.filteredData?.length <= 0 && dataSource?.total <= 0) {\r\n <div class=\"no-results-overlay\">\r\n <mat-icon class=\"no-results-icon\">search_off</mat-icon>\r\n <div class=\"no-results-text mat-body-1\">\r\n <h3 i18n=\"@@noResultsFound\">No results found</h3>\r\n <p i18n=\"@@tryAdjustFilters\">\r\n Try adjusting your filters or search criteria.\r\n </p>\r\n </div>\r\n </div>\r\n }\r\n <!-- #endregion -->\r\n</div>\r\n<!-- #endregion -->\r\n\r\n<!-- #region Debug value -->\r\n@if (debugValue) {\r\n <code>\r\n <pre>{{formValue | json}}</pre>\r\n</code>\r\n}\r\n<!-- #endregion -->\r\n\r\n<div class=\"table-footer\" layout=\"row\">\r\n <ng-content select=\"[table-footer]\"></ng-content>\r\n <span flex></span>\r\n @if (paginable) {\r\n <mat-paginator [pageSize]=\"pageSize\" [pageSizeOptions]=\"pageSizeOptions\" showFirstLastButtons=\"true\"></mat-paginator>\r\n }\r\n</div>", styles: ["::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-form-field .mat-form-field-wrapper{width:100%}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip{height:24px;margin-top:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip .mdc-evolution-chip__action--primary{padding-left:9px;padding-right:9px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip:last-child{margin-bottom:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip *{font-size:.8rem}@media(max-width:389px){::ng-deep .mat-mdc-table [gt-xs],::ng-deep .mat-mdc-table .gt-xs{display:none}::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:599px){::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:959px){::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1279px){::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1919px){::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1979px){::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}.mat-table-container{width:100%;max-width:100%;overflow:auto}.mat-table-container .mat-mdc-header-cell,.mat-table-container .mat-mdc-footer-cell,.mat-table-container .mat-mdc-cell{min-width:80px;box-sizing:border-box}.mat-table-container .mat-mdc-header-row,.mat-table-container .mat-mdc-footer-row,.mat-table-container .mat-mdc-row{min-width:1920px}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-right{box-shadow:-3px 0 5px #0000001a}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-left{box-shadow:3px 0 5px #0000001a}\n"] }]
|
|
19068
|
+
], template: "@if (!static) {\r\n <div class=\"loading-progress\">\r\n @if (dataSource?.isLoading) {\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n }\r\n </div>\r\n}\r\n<!-- #region Data table -->\r\n<div class=\"mat-table-container scrollbar-secondary\" [ngClass]=\"{'mat-table-sticky': sticky}\" #scrollContainer>\r\n <table mat-table #table [dataSource]=\"dataSource\" [dataSourceFilter]=\"dataSourceFilter\" [ngClass]=\"{'table-fixed': !sticky && !detailsTemplate && !templateRef, 'table-stick': sticky}\" [trackBy]=\"trackBy\" matSort matSortDisableClear [matSortActive]=\"sortActive||'id'\" [matSortDirection]=\"sortDirection\" multiTemplateDataRows>\r\n @for (column of columns$ | async; track columnsTrackBy($index, column)) {\r\n <!-- #region Column def -->\r\n <ng-container [cdkColumnDef]=\"column.name\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <ng-template #header [ngTemplateOutlet]=\"header\" let-headerText=\"headerText\" [ngTemplateOutletContext]=\"{headerText: column.header | func:context}\">\r\n <th mat-header-cell *cdkHeaderCellDef [mat-sort-header]=\"column.sortBy || column.name\" [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [disabled]=\"column.type == ColumnType.Checkbox || column.disabled\" [ngClass]=\"column.displayNgClass\" [arrowPosition]=\"column.arrowBefore?'before':'after'\">\r\n @if (column.type == ColumnType.Checkbox) {\r\n <mat-checkbox (change)=\"$event ? dataSource.toggleSelect($event, selectAllFilter) : null\" [disabled]=\"!dataSource.paginator?.length\" [checked]=\"dataSource.selectionModel.hasValue() && dataSource.isAllSelected()\" [indeterminate]=\"dataSource.selectionModel.hasValue() && !dataSource.isAllSelected()\"></mat-checkbox>\r\n } @if (column.type != ColumnType.Checkbox) {\r\n <span [matTooltip]=\"headerText\">{{headerText}}</span>\r\n }\r\n </th>\r\n </ng-template>\r\n <td mat-cell *cdkCellDef=\"let row; let rowIndex = dataIndex\" [matTooltip]=\"column.tooltip?column.tooltip(row, undefined, context):null\" [matTooltipClass]=\"column.tooltipClass??''\" [hidden]=\"column.hidden\" [ngClass]=\"getRowClasses(column, row)\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\">\r\n <ng-template #rowVal [ngTemplateOutlet]=\"rowVal\" let-rowValue [ngTemplateOutletContext]=\"{$implicit: column?.content && column?.content(row, undefined, context)}\">\r\n @switch (column.type) {\r\n <!-- #region Checkbox column -->\r\n @case (ColumnType.Checkbox) {\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? dataSource.selectionModel.toggle(row) : null\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [checked]=\"dataSource.selectionModel.isSelected(row)\"></mat-checkbox>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Enum column -->\r\n @case (ColumnType.Enum) {\r\n <span>\r\n @if (column.enumMetadata) {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index) {\r\n @if (i < 2) {\r\n <ng-template let-displayValue=\"displayValue\" [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ displayValue: column.enumMetadata[item].display }\"></ng-template>\r\n }\r\n @if (i === 1 && rowValue?.length > 2) {\r\n <small [matTooltip]=\"(rowValue | slice:2 | map:column.enumMetadata | map:'display') | join:'\\n'\" matTooltipClass=\"mat-tooltip-multiline\">...</small>\r\n }\r\n }\r\n <ng-template #template let-displayValue=\"displayValue\">\r\n <mat-chip-row disableRipple=\"true\" selectable=\"false\" [matTooltip]=\"displayValue\">\r\n <span>{{ displayValue }}</span>\r\n </mat-chip-row>\r\n </ng-template>\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <span class=\"na\" [ngStyle]=\"{ color: ((column.enumMetadata[rowValue] || {}).textColor || 'inherit') }\" [innerHtml]=\"(column.enumMetadata[rowValue]||{}).display\"></span>\r\n }\r\n }\r\n } @else {\r\n @if (column.multiple) {\r\n @for (item of rowValue; track item; let i = $index; let last = $last) {\r\n <div>\r\n @if (i<2) {\r\n <small>\r\n <msa-enum-display [value]=\"item\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n </small>\r\n } @if (i==1 && rowValue?.length > 2) {\r\n <small>, ...</small>\r\n }\r\n </div>\r\n }\r\n } @else {\r\n @if (rowValue >= 0) {\r\n <msa-enum-display [value]=\"rowValue\" [enumType]=\"column.enumType\" [metadata]=\"column.enumMetadata\"></msa-enum-display>\r\n }\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n @if (!formArray) {\r\n <mat-slide-toggle [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);handleModelChange(column, row, undefined);\" (click)=\"$event.stopPropagation();\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" color=\"accent\"></mat-slide-toggle>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date column -->\r\n @case (ColumnType.Date) {\r\n <span>{{rowValue | date:column.shortDate?'dd.MM.yyyy':'dd.MM.yyyy HH:mm:ss'}}</span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <input matInput type=\"{{column.inputType}}\" autocomplete=\"none\" name=\"{{column.name}}{{rowIndex}}\" [ngModel]=\"row | property:column.name\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" [min]=\"column.inputMin?column.inputMin(row, undefined, context):null\" [max]=\"column.inputMax?column.inputMax(row, undefined, context):null\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);(column.change?column.change(row, undefined, context):patch(row, [column.name], $event, column.patchIncludes));\" [ngModelOptions]=\"{updateOn: 'blur'}\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n @if (!formArray) {\r\n <mat-form-field appearance=\"outline\" layout=\"column\" layout-align=\"center start\" subscriptSizing=\"dynamic\" dense-3 (click)=\"$event.stopPropagation();\">\r\n @if (!formArray) {\r\n <vd-select name=\"{{column.name}}{{rowIndex}}\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"$safeNavigationMigration(column?.enumFilter) | func:row:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [ngModel]=\"row | property:column.name\" (ngModelChange)=\"setNestedProperty(row, column.name, $event);\" [disabled]=\"readonly || (column.disabled || (column.disable && column.disable(row, undefined, context)))\" (change)=\"column.change?column.change(row, undefined, context):patch(row, [column.name], $event.value, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n }\r\n </mat-form-field>\r\n } @if (formArray) {\r\n <ng-container [formGroup]=\"$any(formArray.controls)[rowIndex] | formGroup\">\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: column.name.split('.'), formGroup: formArray.controls[rowIndex]}\"></ng-container>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action -->\r\n @case (ColumnType.Action) {\r\n @if (column.menu) {\r\n @if (menu?.matMenu && !row.locked && hasVisibleRowMenuItems(row, column)) {\r\n <div id=\"menu-{{row.id}}\" style=\"visibility: hidden; position: fixed\" #contextMenuTrigger=\"matMenuTrigger\" [matMenuTriggerFor]=\"menu.matMenu!\"></div>\r\n }\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\" #menu></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Menu -->\r\n @case (ColumnType.Menu) {\r\n @if (column.menu) {\r\n <vd-dynamic-menu [items]=\"[column.menu]\" [data]=\"row\" [context]=\"context\"></vd-dynamic-menu>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon -->\r\n @case (ColumnType.Icon) {\r\n <span layout=\"row\" layout-align=\"start center\">\r\n @if(column && column.icon){\r\n @if ( column.icon.matIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\">{{handleExpression($safeNavigationMigration(column.icon.matIcon)!, row)}}</mat-icon>\r\n }\r\n @if (column.icon.svgIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [svgIcon]=\"handleExpression($safeNavigationMigration(column.icon.svgIcon)!, row)!\"></mat-icon>\r\n }\r\n @if (column.icon.fontIcon) {\r\n <mat-icon fontSet=\"{{column.icon.fontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.icon.cssClass??'', row)\" [fontIcon]=\"handleExpression($safeNavigationMigration(column.icon.fontIcon)!, row)!\"></mat-icon>\r\n }\r\n }\r\n </span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region icon button -->\r\n @case (ColumnType.IconButton) {\r\n <a mat-icon-button (click)=\"$event.stopPropagation();column.iconButton?.event?column.iconButton.event(row, context):null\">\r\n <mat-icon fontSet=\"{{column.iconButton?.iconFontSet || 'material-symbols-outlined'}}\" [class]=\"handleExpression(column.iconButton?.iconClass??'', row)\">{{handleExpression(column.iconButton?.icon??'radio_button_checked', row) || 'radio_button_checked'}}</mat-icon>\r\n </a>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Other column types -->\r\n @default {\r\n <span [innerHtml]=\"rowValue??''\"></span>\r\n }\r\n <!-- #endregion -->\r\n }\r\n <ng-template #recursiveContainer let-columnNameSegments=\"segments\" let-formGroup=\"formGroup\" let-parentFormGroup=\"parentFormGroup\">\r\n @if (formGroup) {\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- If the columnNameSegments array is empty, we're at the leaf node -->\r\n @if (!columnNameSegments.length) {\r\n @switch (column.type) {\r\n <!-- #region Toggle column -->\r\n @case (ColumnType.Toggle) {\r\n <mat-slide-toggle [formControl]=\"formGroup\" (click)=\"$event.stopPropagation();\" (change)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):handleModelChange(column, parentFormGroup.value, parentFormGroup)\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" color=\"accent\"></mat-slide-toggle>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Text Input column -->\r\n @case (ColumnType.TextInput) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <input matInput [formControl]=\"formGroup\" type=\"{{column.inputType}}\" autocomplete=\"none\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" [min]=\"column.inputMin?column.inputMin(parentFormGroup.value, parentFormGroup, context):null\" [max]=\"column.inputMax?column.inputMax(parentFormGroup.value, parentFormGroup, context):null\" (keydown.enter)=\"handleKeydownEnter($event)\" />\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region VD-Select column -->\r\n @case (ColumnType.Select) {\r\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\" dense-3 layout=\"column\" layout-align=\"center start\" (click)=\"$event.stopPropagation();\">\r\n <vd-select [formControl]=\"formGroup\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:parentFormGroup.value:context\" [options]=\"column.options\" [defaultOption]=\"column.defaultOption??true\" [disableControl]=\"readonly || (column.disabled || (column.disable && column.disable(parentFormGroup.value, parentFormGroup, context)))\" (selectionChange)=\"column.change?column.change(parentFormGroup.value, parentFormGroup, context):patch(parentFormGroup.value, [column.name], rowValue, column.patchIncludes)\" (keydown.enter)=\"handleKeydownEnter($event)\"></vd-select>\r\n </mat-form-field>\r\n }\r\n <!-- #endregion -->\r\n }\r\n } @else {\r\n <!-- If not the last segment, create a nested form group -->\r\n <ng-container [formGroupName]=\"columnNameSegments[0]\">\r\n <!-- Recursive call to handle nested segments -->\r\n <ng-container [ngTemplateOutlet]=\"recursiveContainer\" [ngTemplateOutletContext]=\"{segments: columnNameSegments.slice(1), parentFormGroup:formGroup, formGroup: formGroup.get(columnNameSegments[0])}\"></ng-container>\r\n </ng-container>\r\n }\r\n </ng-container>\r\n }\r\n </ng-template>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n }\r\n <!-- #region Filter row -->\r\n @if (dataSource && filterable) {\r\n @for (column of columns$ | async; track column) {\r\n <ng-container cdkColumnDef=\"filter.{{column.filter || column.name}}\" [sticky]=\"column.sticky\" [stickyEnd]=\"column.stickyEnd\">\r\n <th mat-header-cell *cdkHeaderCellDef [hidden]=\"column.hidden\" [ngStyle]=\"{maxWidth:column.maxWidth?(column.maxWidth+(column.maxWidthUnit || 'px')):null,minWidth:column.minWidth?(column.minWidth+(column.minWidthUnit || 'px')):null,width:column.width?(column.width+(column.widthUnit || 'px')):null}\" [ngClass]=\"column.displayNgClass\">\r\n <!-- #region Select filter -->\r\n @if(column.endpoint || column.enumType || column.options){\r\n <span filter-select [endpoint]=\"column.endpoint\" [enum]=\"column.enumType\" [enumMetadata]=\"column.enumMetadata\" [enumFilter]=\"column.enumFilter | func:{}:context\" [options]=\"column.options\" [text]=\"column.filterOptionText || 'name'\"></span>\r\n }\r\n <!-- #region Text filter -->\r\n @else if(column.type == ColumnType.Text || column.type == ColumnType.TextInput || column.type == ColumnType.Number) {\r\n <span filter-input [onlyNumber]=\"column.filterInputNumber??false\" [matTooltip]=\"column.filterTooltip ? column.filterTooltip(context):null\" [matTooltipClass]=\"column.filterTooltipClass??''\" [operator]=\"!useFilterOperator ? undefined : column.filterOperator\"></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Date filter -->\r\n @else if (column.type == ColumnType.Date) {\r\n <span filter-date></span>\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Action filter (clear) -->\r\n @else if (column.type == ColumnType.Action) {\r\n <span filter-clear></span>\r\n }\r\n <!-- #endregion -->\r\n </th>\r\n </ng-container>\r\n }\r\n }\r\n <!-- #endregion -->\r\n <!-- #region Details column -->\r\n <ng-container cdkColumnDef=\"expandedDetail\">\r\n <td mat-cell *matCellDef=\"let row; let index = index\" [attr.colspan]=\"(displayedColumns$ | async)?.length\">\r\n <div class=\"row-detail\" [@detailExpand]=\"row == expandedRow ? 'expanded' : 'collapsed'\" #detailsTemplate>\r\n @if (templateRef && row === expandedRow) {\r\n <ng-container *ngTemplateOutlet=\"templateRef; context:{row: row, index: index, context: context}\"></ng-container>\r\n }\r\n </div>\r\n </td>\r\n </ng-container>\r\n <!-- #endregion -->\r\n <!-- #region Filter header -->\r\n @if (filterable) {\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedFilterColumns$ | async\"></tr>\r\n }\r\n <!-- #endregion -->\r\n <tr mat-header-row *cdkHeaderRowDef=\"displayedColumns$ | async; sticky: stickyFilter\"></tr>\r\n <tr mat-row *cdkRowDef=\"let row; columns: displayedColumns$ | async; let index = dataIndex\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\" [class.expanded-row]=\"expandedRow === row\" (click)=\"handleRowClick(index, row)\" (contextmenu)=\"handleRowRightClick($event, row)\"></tr>\r\n <!-- #region Detrails row -->\r\n @if (detailsTemplate || templateRef) {\r\n <tr mat-row *cdkRowDef=\"let row; columns: ['expandedDetail']\" class=\"detail-row\" [ngClass]=\"rowNgClass?rowNgClass(row, context):null\"></tr>\r\n }\r\n <!-- #endregion -->\r\n </table>\r\n <!-- #region Modern No Results Message -->\r\n @if (dataSource?.filteredData?.length <= 0 && dataSource?.total <= 0) {\r\n <div class=\"no-results-overlay\">\r\n <mat-icon class=\"no-results-icon\">search_off</mat-icon>\r\n <div class=\"no-results-text mat-body-1\">\r\n <h3 i18n=\"@@noResultsFound\">No results found</h3>\r\n <p i18n=\"@@tryAdjustFilters\"> Try adjusting your filters or search criteria. </p>\r\n </div>\r\n </div>\r\n }\r\n <!-- #endregion -->\r\n</div>\r\n<!-- #endregion -->\r\n<!-- #region Debug value -->\r\n@if (debugValue) {\r\n <code>\r\n <pre>{{formValue | json}}</pre>\r\n</code>\r\n}\r\n<!-- #endregion -->\r\n<div class=\"table-footer\" layout=\"row\">\r\n <ng-content select=\"[table-footer]\"></ng-content>\r\n <span flex></span>\r\n @if (paginable) {\r\n <mat-paginator [pageSize]=\"pageSize\" [pageSizeOptions]=\"pageSizeOptions\" showFirstLastButtons=\"true\"></mat-paginator>\r\n }\r\n</div>", styles: ["::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-form-field .mat-form-field-wrapper{width:100%}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip{height:24px;margin-top:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip .mdc-evolution-chip__action--primary{padding-left:9px;padding-right:9px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip:last-child{margin-bottom:2px}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .mat-mdc-table .mat-mdc-row .mat-mdc-cell .mat-mdc-chip *{font-size:.8rem}@media(max-width:389px){::ng-deep .mat-mdc-table [gt-xs],::ng-deep .mat-mdc-table .gt-xs{display:none}::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:599px){::ng-deep .mat-mdc-table [gt-sm],::ng-deep .mat-mdc-table .gt-sm{display:none}::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:959px){::ng-deep .mat-mdc-table [gt-md],::ng-deep .mat-mdc-table .gt-md{display:none}::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1279px){::ng-deep .mat-mdc-table [gt-lg],::ng-deep .mat-mdc-table .gt-lg{display:none}::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1919px){::ng-deep .mat-mdc-table [gt-xl],::ng-deep .mat-mdc-table .gt-xl{display:none}::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}@media(max-width:1979px){::ng-deep .mat-mdc-table [gt-xxl],::ng-deep .mat-mdc-table .gt-xxl{display:none}}.mat-table-container{width:100%;max-width:100%;overflow:auto}.mat-table-container .mat-mdc-header-cell,.mat-table-container .mat-mdc-footer-cell,.mat-table-container .mat-mdc-cell{min-width:80px;box-sizing:border-box}.mat-table-container .mat-mdc-header-row,.mat-table-container .mat-mdc-footer-row,.mat-table-container .mat-mdc-row{min-width:1920px}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-right{box-shadow:-3px 0 5px #0000001a}.mat-table-container.mat-table-sticky .mat-mdc-table-sticky-border-elem-left{box-shadow:3px 0 5px #0000001a}\n"] }]
|
|
19062
19069
|
}], ctorParameters: () => [{ type: DynamicBuilder }, { type: i0.ChangeDetectorRef }], propDecorators: { table: [{
|
|
19063
19070
|
type: ViewChild,
|
|
19064
19071
|
args: ['table']
|
|
@@ -19201,6 +19208,7 @@ __decorate([
|
|
|
19201
19208
|
__decorate([
|
|
19202
19209
|
Column({
|
|
19203
19210
|
type: TableColumnType.TextInput,
|
|
19211
|
+
width: 80,
|
|
19204
19212
|
maxWidth: 80,
|
|
19205
19213
|
change: (_, __, ctx) => ctx?.updateColumns()
|
|
19206
19214
|
}),
|
|
@@ -19215,13 +19223,14 @@ __decorate([
|
|
|
19215
19223
|
defaultOption: false
|
|
19216
19224
|
}),
|
|
19217
19225
|
Display($localize `:@@display:Display`),
|
|
19218
|
-
__metadata("design:type",
|
|
19226
|
+
__metadata("design:type", Object)
|
|
19219
19227
|
], TableColumnConfig.prototype, "display", void 0);
|
|
19220
19228
|
__decorate([
|
|
19221
19229
|
Column({
|
|
19222
19230
|
type: TableColumnType.TextInput,
|
|
19223
19231
|
inputMin: () => 0,
|
|
19224
19232
|
inputMax: () => 2000,
|
|
19233
|
+
width: 80,
|
|
19225
19234
|
maxWidth: 80,
|
|
19226
19235
|
display: Grid.Md,
|
|
19227
19236
|
change: (_, __, ctx) => ctx?.updateColumns()
|
|
@@ -19234,6 +19243,7 @@ __decorate([
|
|
|
19234
19243
|
type: TableColumnType.TextInput,
|
|
19235
19244
|
inputMin: () => 0,
|
|
19236
19245
|
inputMax: () => 2000,
|
|
19246
|
+
width: 80,
|
|
19237
19247
|
maxWidth: 80,
|
|
19238
19248
|
display: Grid.Md
|
|
19239
19249
|
}),
|
|
@@ -19245,6 +19255,7 @@ __decorate([
|
|
|
19245
19255
|
type: TableColumnType.TextInput,
|
|
19246
19256
|
inputMin: () => 0,
|
|
19247
19257
|
inputMax: () => 2000,
|
|
19258
|
+
width: 80,
|
|
19248
19259
|
maxWidth: 80,
|
|
19249
19260
|
display: Grid.Md,
|
|
19250
19261
|
change: (x) => x ? (x.width ??= x.maxWidth) : null
|
|
@@ -19386,7 +19397,19 @@ class VdDynamicTableConfigDialogComponent extends BaseComponent {
|
|
|
19386
19397
|
this.configForm.controls["sticky"].valueChanges.subscribe(value => genericList.dynamicTable.sticky = value);
|
|
19387
19398
|
}
|
|
19388
19399
|
/* Filter columns that are configurable from the provided dynamic table configuration */
|
|
19389
|
-
|
|
19400
|
+
const activeColumnSets = genericList?.dynamicTable?.columnSets || [];
|
|
19401
|
+
/* Filter the columns based on their configurability and active column sets */
|
|
19402
|
+
this.columns = genericList?.dynamicTable?.columns
|
|
19403
|
+
?.filter((x) => x.configurable)
|
|
19404
|
+
?.filter((x) => {
|
|
19405
|
+
const columnSets = x.columnSets || [];
|
|
19406
|
+
/* If either side has no set constraints, keep the column visible in config */
|
|
19407
|
+
if (!activeColumnSets.length || !columnSets.length) {
|
|
19408
|
+
return true;
|
|
19409
|
+
}
|
|
19410
|
+
/* Otherwise require at least one matching set */
|
|
19411
|
+
return columnSets.some(cs => activeColumnSets.includes(cs));
|
|
19412
|
+
});
|
|
19390
19413
|
}
|
|
19391
19414
|
/**
|
|
19392
19415
|
* Saves the current column configuration and closes the dialog.
|
|
@@ -28295,6 +28318,42 @@ var MenuScope;
|
|
|
28295
28318
|
MenuScope[MenuScope["Admin"] = 1] = "Admin";
|
|
28296
28319
|
})(MenuScope || (MenuScope = {}));
|
|
28297
28320
|
|
|
28321
|
+
/**
|
|
28322
|
+
* Class decorator to define a table with its configuration.
|
|
28323
|
+
* @param tableDefinition Optional partial table definition to customize the table's behavior and appearance.
|
|
28324
|
+
* @returns A function that takes the target class and applies the table definition metadata.
|
|
28325
|
+
*/
|
|
28326
|
+
function Table(tableDefinition) {
|
|
28327
|
+
return function (target) {
|
|
28328
|
+
if (tableDefinition?.columns) {
|
|
28329
|
+
/* Add action menus from table definition, if any */
|
|
28330
|
+
var actionColmun = tableDefinition.columns?.find(x => x.name == 'action');
|
|
28331
|
+
if (!actionColmun) {
|
|
28332
|
+
actionColmun = new TableColumn({
|
|
28333
|
+
index: 2000,
|
|
28334
|
+
name: 'action',
|
|
28335
|
+
columnSets: ['action', 'common'],
|
|
28336
|
+
type: TableColumnType.Action,
|
|
28337
|
+
disabled: true,
|
|
28338
|
+
rowMenuItems: actions,
|
|
28339
|
+
configurable: false,
|
|
28340
|
+
stickyEnd: true
|
|
28341
|
+
});
|
|
28342
|
+
/* Add the action column into the table columns */
|
|
28343
|
+
tableDefinition.columns.push(actionColmun);
|
|
28344
|
+
}
|
|
28345
|
+
/* Get custom action, if any */
|
|
28346
|
+
var actions = tableDefinition?.actions;
|
|
28347
|
+
if (actions != null && actionColmun != null) {
|
|
28348
|
+
actionColmun.rowMenuItems ??= [];
|
|
28349
|
+
actions.forEach(y => actionColmun.rowMenuItems.push(y));
|
|
28350
|
+
}
|
|
28351
|
+
}
|
|
28352
|
+
/* Save the table defintion in the metadata */
|
|
28353
|
+
Reflect.defineMetadata(TABLE_DEFINITION_METADATA_KEY, tableDefinition, target);
|
|
28354
|
+
};
|
|
28355
|
+
}
|
|
28356
|
+
|
|
28298
28357
|
/**
|
|
28299
28358
|
* @class
|
|
28300
28359
|
*/
|
|
@@ -31047,6 +31106,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
31047
31106
|
args: ['mediaStyles']
|
|
31048
31107
|
}] } });
|
|
31049
31108
|
|
|
31109
|
+
/**
|
|
31110
|
+
* Decorator function to define columns for a table object.
|
|
31111
|
+
* @param type The constructor function of the table object.
|
|
31112
|
+
* @returns A decorator function.
|
|
31113
|
+
*/
|
|
31114
|
+
function ColumnObject(type) {
|
|
31115
|
+
return function (target, propertyKey) {
|
|
31116
|
+
/* Retrieve table definition */
|
|
31117
|
+
var tableDef = getTableDefinition(type);
|
|
31118
|
+
/* Retrieve columns from the table definition */
|
|
31119
|
+
var columns = tableDef.columns;
|
|
31120
|
+
/* Update column names with property key prefix */
|
|
31121
|
+
columns?.forEach(x => x.name = `${propertyKey}.${x.name}`);
|
|
31122
|
+
/* Get existing table columns from metadata */
|
|
31123
|
+
let previousTableColumns = Reflect.getMetadata(TABLE_COLUMNS_METADATA_KEY, target);
|
|
31124
|
+
/* Create a copy of the existing columns array and append new columns */
|
|
31125
|
+
let tableColumns = previousTableColumns ? previousTableColumns.concat(columns ?? []) : [];
|
|
31126
|
+
/* Set column index if not already set */
|
|
31127
|
+
tableColumns.forEach((x, i) => x.index ??= i);
|
|
31128
|
+
/* Sort the columns by index */
|
|
31129
|
+
Utils.sortArray(tableColumns, 'index');
|
|
31130
|
+
/* Override the table columns in the metadata */
|
|
31131
|
+
Reflect.defineMetadata(TABLE_COLUMNS_METADATA_KEY, tableColumns, target);
|
|
31132
|
+
};
|
|
31133
|
+
}
|
|
31134
|
+
|
|
31050
31135
|
/**
|
|
31051
31136
|
* VdTableFieldDirective class
|
|
31052
31137
|
*/
|
|
@@ -31232,5 +31317,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
31232
31317
|
* Generated bundle index. Do not edit.
|
|
31233
31318
|
*/
|
|
31234
31319
|
|
|
31235
|
-
export { AbstractMatFormField, AbstractSelectFormField, ActionItem, Api, ApiResponse, AppEvent, AppEventType, AppSetting, AppStorage, AsyncValidationDirective, AuditEntity, AuditUser, AuthHelper, AuthUser, AutofocusDirective, BaseComponent, BaseDirective, BaseEntity, BaseInterceptor, BaseService, BindPipe, CachingInterceptor, Column, ColumnObject, Common, CommonError, CommonHandlerContext, ConfirmExitGuard, ContextHelper, DIALOG_PROVIDER, DIALOG_PROVIDER_FACTORY, DataSourceFilterDirective, DataSourcePipe, DatePickerHeaderComponent, DisableControlDirective, Display, DisplayNameNumberProjection, DisplayNameProjection, DynamicBuilder, DynamicComponentCompiler, EXPORT_DIALOG_COMPONENT, EmptyStringResetDirective, EnumMetadata, EnumPipe, EnumService, EqualValidator, ErrorMessageBindingStrategy, EventQueueService, Facet, FacetValue, FieldFuncPipe, FileControlDirective, FileService, FileSizePipe, FilterClearComponent, FilterDateComponent, FilterGlue, FilterInputComponent, FilterOperator, FilterPipe, FilterSelectComponent, FirstLetterPipe, Form, FormArrayPipe, FormBuilderConfiguration, FormControlPipe, FormDefinition, FormField, FormFieldDefinition, FormFieldGroup, FormFieldGroupDefinition, FormFieldType, FormGroupPipe, FuncPipe, GenericEmbeddedListComponent, GenericFormBaseComponent, GenericFormComponent, GenericListComponent, GenericReactiveFormComponent, GenericService, GlobalRoles, Grid, GroupFilterPipe, HtmlControlTemplateDirective, IAbstractControl, Icon, ImageFileControlDirective, IpVersion, KeyValue, KeysPipe, LayoutToggle, LoadingScreenInterceptor, LoadingScreenService, MEDIA_PROVIDER, MEDIA_PROVIDER_FACTORY, MatFormFieldEditorDirective, MatFormFieldRadioDirective, MatFormFieldReadonlyDirective, MatInputRequiredDirective, MatSelectRequiredDirective, Menu, MenuClient, MenuDepartment, MenuFormIncludesResolve, MenuItem, MenuItemClient, MenuItemDepartment, MenuItemFormIncludesResolve, MenuItemService, MenuItemTarget, MenuListProjectionResolve, MenuResolve, MenuScope, MenuSettings, MenuSettingsResolve, MessageType, ModifiableEntity, MonthNamePipe, MsaEditFormActionsComponent, MsaEnumDisplayComponent, MsaSelectRequiredDirective, NameNumberProjection, NameProjection, NativeElementInjectorDirective, NumericValueType, OnlyNumberDirective, OrderPipe, Pagination, PaginatorIntl, ParseDecimalDirective, Permission, PlaceholderPipe, PrefixDirective, PrintService, PropertyJoinPipe, ReactiveFormConfig, ReactiveTypedFormsModule, RemoveWhitespaceDirective, ResetFormType, RxFormArray, RxFormBuilder, RxFormControl, RxFormControlDirective, RxFormGroup, RxReactiveFormsModule, RxwebFormDirective, RxwebValidators, SafeHtmlPipe, Salutation, SaveAction, SplitPipe, SubMenuResolve, SuffixButton, Table, TableColumn, TableColumnConfig, TableColumnType, TableConfig, TableDataSource, TableDefinition, TableQueryConfig, TableStaticDataSource, TaskDialogData, Templates, TimePipe, TitleCase, TitleProjection, TruncatePipe, TypedForm, TypedFormBuilder, UniqueValidatorDirective, UrlValidationType, Utils, ValidationAlphabetLocale, ValueAccessorBase, ValuesPipe, VdAlertDialogComponent, VdChipsComponent, VdCodeDirective, VdConfirmDialogComponent, VdCustomDirective, VdDelayedHoverDirective, VdDialogActionsDirective, VdDialogComponent, VdDialogContentDirective, VdDialogHeaderActionsComponent, VdDialogHeaderComponent, VdDialogMaximizeDirective, VdDialogService, VdDialogTitleDirective, VdDynamicMenuComponent, VdDynamicTableComponent, VdDynamicTableConfigDialogComponent, VdEditorDirective, VdFileDirective, VdFileInputComponent, VdFileModule, VdFilterOptionDirective, VdGenericFormComponent, VdGenericFormCustomFieldDirective, VdLayoutCardOverComponent, VdLayoutCloseDirective, VdLayoutCompactComponent, VdLayoutComponent, VdLayoutFooterComponent, VdLayoutManageListCloseDirective, VdLayoutManageListComponent, VdLayoutManageListOpenDirective, VdLayoutManageListToggleDirective, VdLayoutNavComponent, VdLayoutNavListCloseDirective, VdLayoutNavListComponent, VdLayoutNavListOpenDirective, VdLayoutNavListToggleDirective, VdLayoutOpenDirective, VdLayoutToggleDirective, VdListOptionDirective, VdListToolbarComponent, VdMediaService, VdMediaToggleDirective, VdMenuComponent, VdNavigationDrawerComponent, VdNavigationDrawerMenuDirective, VdNavigationDrawerToolbarDirective, VdPromptDialogComponent, VdSelectComponent, VdSelectOptionDirective, VdSelectTriggerDirective, VdTableFieldDirective, VdTaskDialogComponent, allOf, allOfAsync, alpha, alphaAsync, alphaNumeric, alphaNumericAsync, and, ascii, async, blacklist, choice, choiceAsync, compare, compose, contains, containsAsync, creditCard, creditCardAsync, cusip, custom, customAsync, dataUri, date, dateAsync, different, digit, disable, elementClass, email, endpointMetadataKey, endsWith, endsWithAsync, error, escape, even, extension, extensionAsync, factor, factorAsync, file, fileAsync, fileSize, fileSizeAsync, formDefinitionMetadataKey, formFieldGroupsMetadataKey, formFieldsMetadataKey, getDisplay, getEndpoint, getFormDefinition, getFormGroups, getTableDefinition, graphql, greaterThan, greaterThanAsync, greaterThanEqualTo, greaterThanEqualToAsync, grid, hasRequiredValidator, headerMetadataKey, hexColor, iban, ibanAsync, image, imageAsync, json, latLong, latitude, leapYear, lessThan, lessThanAsync, lessThanEqualTo, lessThanEqualToAsync, longitude, lowerCase, ltrim, mac, mask, maxDate, maxDateAsync, maxLength, maxLengthAsync, maxNumber, maxNumberAsync, maxTime, maxTimeAsync, minDate, minDateAsync, minLength, minLengthAsync, minNumber, minNumberAsync, minTime, minTimeAsync, mixinDisableRipple, mixinDisabled, model, noneOf, noneOfAsync, not, notEmpty, numeric, numericAsync, odd, oneOf, oneOfAsync, or, parseProjectionArray, parseProjectionString, password, passwordAsync, pattern, patternAsync, port, prefix, primeNumber, prop, propArray, propObject, range, rangeAsync, required, requiredTrue, rtrim, rule, sanitize, startsWith, startsWithAsync, stripLow, suffix,
|
|
31320
|
+
export { AbstractMatFormField, AbstractSelectFormField, ActionItem, Api, ApiResponse, AppEvent, AppEventType, AppSetting, AppStorage, AsyncValidationDirective, AuditEntity, AuditUser, AuthHelper, AuthUser, AutofocusDirective, BaseComponent, BaseDirective, BaseEntity, BaseInterceptor, BaseService, BindPipe, CachingInterceptor, Column, ColumnObject, Common, CommonError, CommonHandlerContext, ConfirmExitGuard, ContextHelper, DIALOG_PROVIDER, DIALOG_PROVIDER_FACTORY, DataSourceFilterDirective, DataSourcePipe, DatePickerHeaderComponent, DisableControlDirective, Display, DisplayNameNumberProjection, DisplayNameProjection, DynamicBuilder, DynamicComponentCompiler, EXPORT_DIALOG_COMPONENT, EmptyStringResetDirective, EnumMetadata, EnumPipe, EnumService, EqualValidator, ErrorMessageBindingStrategy, EventQueueService, Facet, FacetValue, FieldFuncPipe, FileControlDirective, FileService, FileSizePipe, FilterClearComponent, FilterDateComponent, FilterGlue, FilterInputComponent, FilterOperator, FilterPipe, FilterSelectComponent, FirstLetterPipe, Form, FormArrayPipe, FormBuilderConfiguration, FormControlPipe, FormDefinition, FormField, FormFieldDefinition, FormFieldGroup, FormFieldGroupDefinition, FormFieldType, FormGroupPipe, FuncPipe, GenericEmbeddedListComponent, GenericFormBaseComponent, GenericFormComponent, GenericListComponent, GenericReactiveFormComponent, GenericService, GlobalRoles, Grid, GroupFilterPipe, HtmlControlTemplateDirective, IAbstractControl, Icon, ImageFileControlDirective, IpVersion, KeyValue, KeysPipe, LayoutToggle, LoadingScreenInterceptor, LoadingScreenService, MEDIA_PROVIDER, MEDIA_PROVIDER_FACTORY, MatFormFieldEditorDirective, MatFormFieldRadioDirective, MatFormFieldReadonlyDirective, MatInputRequiredDirective, MatSelectRequiredDirective, Menu, MenuClient, MenuDepartment, MenuFormIncludesResolve, MenuItem, MenuItemClient, MenuItemDepartment, MenuItemFormIncludesResolve, MenuItemService, MenuItemTarget, MenuListProjectionResolve, MenuResolve, MenuScope, MenuSettings, MenuSettingsResolve, MessageType, ModifiableEntity, MonthNamePipe, MsaEditFormActionsComponent, MsaEnumDisplayComponent, MsaSelectRequiredDirective, NameNumberProjection, NameProjection, NativeElementInjectorDirective, NumericValueType, OnlyNumberDirective, OrderPipe, Pagination, PaginatorIntl, ParseDecimalDirective, Permission, PlaceholderPipe, PrefixDirective, PrintService, PropertyJoinPipe, ReactiveFormConfig, ReactiveTypedFormsModule, RemoveWhitespaceDirective, ResetFormType, RxFormArray, RxFormBuilder, RxFormControl, RxFormControlDirective, RxFormGroup, RxReactiveFormsModule, RxwebFormDirective, RxwebValidators, SafeHtmlPipe, Salutation, SaveAction, SplitPipe, SubMenuResolve, SuffixButton, TABLE_COLUMNS_METADATA_KEY, TABLE_DEFINITION_METADATA_KEY, Table, TableColumn, TableColumnConfig, TableColumnType, TableConfig, TableDataSource, TableDefinition, TableQueryConfig, TableStaticDataSource, TaskDialogData, Templates, TimePipe, TitleCase, TitleProjection, TruncatePipe, TypedForm, TypedFormBuilder, UniqueValidatorDirective, UrlValidationType, Utils, ValidationAlphabetLocale, ValueAccessorBase, ValuesPipe, VdAlertDialogComponent, VdChipsComponent, VdCodeDirective, VdConfirmDialogComponent, VdCustomDirective, VdDelayedHoverDirective, VdDialogActionsDirective, VdDialogComponent, VdDialogContentDirective, VdDialogHeaderActionsComponent, VdDialogHeaderComponent, VdDialogMaximizeDirective, VdDialogService, VdDialogTitleDirective, VdDynamicMenuComponent, VdDynamicTableComponent, VdDynamicTableConfigDialogComponent, VdEditorDirective, VdFileDirective, VdFileInputComponent, VdFileModule, VdFilterOptionDirective, VdGenericFormComponent, VdGenericFormCustomFieldDirective, VdLayoutCardOverComponent, VdLayoutCloseDirective, VdLayoutCompactComponent, VdLayoutComponent, VdLayoutFooterComponent, VdLayoutManageListCloseDirective, VdLayoutManageListComponent, VdLayoutManageListOpenDirective, VdLayoutManageListToggleDirective, VdLayoutNavComponent, VdLayoutNavListCloseDirective, VdLayoutNavListComponent, VdLayoutNavListOpenDirective, VdLayoutNavListToggleDirective, VdLayoutOpenDirective, VdLayoutToggleDirective, VdListOptionDirective, VdListToolbarComponent, VdMediaService, VdMediaToggleDirective, VdMenuComponent, VdNavigationDrawerComponent, VdNavigationDrawerMenuDirective, VdNavigationDrawerToolbarDirective, VdPromptDialogComponent, VdSelectComponent, VdSelectOptionDirective, VdSelectTriggerDirective, VdTableFieldDirective, VdTaskDialogComponent, allOf, allOfAsync, alpha, alphaAsync, alphaNumeric, alphaNumericAsync, and, ascii, async, blacklist, choice, choiceAsync, compare, compose, contains, containsAsync, creditCard, creditCardAsync, cusip, custom, customAsync, dataUri, date, dateAsync, different, digit, disable, elementClass, email, endpointMetadataKey, endsWith, endsWithAsync, error, escape, even, extension, extensionAsync, factor, factorAsync, file, fileAsync, fileSize, fileSizeAsync, formDefinitionMetadataKey, formFieldGroupsMetadataKey, formFieldsMetadataKey, getDisplay, getEndpoint, getFormDefinition, getFormGroups, getTableDefinition, graphql, greaterThan, greaterThanAsync, greaterThanEqualTo, greaterThanEqualToAsync, grid, hasRequiredValidator, headerMetadataKey, hexColor, iban, ibanAsync, image, imageAsync, json, latLong, latitude, leapYear, lessThan, lessThanAsync, lessThanEqualTo, lessThanEqualToAsync, longitude, lowerCase, ltrim, mac, mask, maxDate, maxDateAsync, maxLength, maxLengthAsync, maxNumber, maxNumberAsync, maxTime, maxTimeAsync, minDate, minDateAsync, minLength, minLengthAsync, minNumber, minNumberAsync, minTime, minTimeAsync, mixinDisableRipple, mixinDisabled, model, noneOf, noneOfAsync, not, notEmpty, numeric, numericAsync, odd, oneOf, oneOfAsync, or, parseProjectionArray, parseProjectionString, password, passwordAsync, pattern, patternAsync, port, prefix, primeNumber, prop, propArray, propObject, range, rangeAsync, required, requiredTrue, rtrim, rule, sanitize, startsWith, startsWithAsync, stripLow, suffix, time, timeAsync, toBoolean, toDate, toDouble, toFloat, toInt, toString, trim, unique, updateOn, upperCase, url, urlAsync, whitelist };
|
|
31236
31321
|
//# sourceMappingURL=messaia-cdk.mjs.map
|