ngx-st-tables 18.0.23 → 18.0.24
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/README.md +178 -6
- package/esm2022/lib/components/material-table/material-table-row-cell/material-table-row-cell.component.mjs +1 -1
- package/esm2022/lib/components/material-table/material-table.component.mjs +41 -3
- package/fesm2022/ngx-st-tables.mjs +41 -3
- package/fesm2022/ngx-st-tables.mjs.map +1 -1
- package/lib/components/material-table/material-table.component.d.ts +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -144,6 +144,37 @@ The `ngx-st-material-table` component is a powerful Angular Material table with
|
|
|
144
144
|
[extraCustomFilter]="customFilters"
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
### `initFilterMethod`
|
|
148
|
+
- **Type:** `(row: any) => boolean`
|
|
149
|
+
- **Default:** `undefined`
|
|
150
|
+
- **Description:** Custom filter function that is applied to every row in the table. The function receives a row object and should return `true` to include the row or `false` to exclude it. This filter is automatically applied whenever table data changes and works in combination with other filters (global search, column filters).
|
|
151
|
+
- **Use Cases:**
|
|
152
|
+
- Filter rows based on complex business logic
|
|
153
|
+
- Show only rows matching specific conditions
|
|
154
|
+
- Dynamically filter based on external state changes
|
|
155
|
+
- **Note:** Only works with local data (when `lazyLoading` is `false`). For server-side filtering, handle filtering in your backend.
|
|
156
|
+
- **Examples:**
|
|
157
|
+
```typescript
|
|
158
|
+
// Show only active users
|
|
159
|
+
[initFilterMethod]="(row) => row.status === 'active'"
|
|
160
|
+
|
|
161
|
+
// Show users with quantity greater than 10
|
|
162
|
+
[initFilterMethod]="(row) => row.quantity > 10"
|
|
163
|
+
|
|
164
|
+
// Complex filtering with multiple conditions
|
|
165
|
+
[initFilterMethod]="filterRows.bind(this)"
|
|
166
|
+
|
|
167
|
+
filterRows(row: any): boolean {
|
|
168
|
+
return row.isActive && row.amount > 0 && row.department === this.selectedDepartment;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Dynamic filtering based on date range
|
|
172
|
+
[initFilterMethod]="(row) => {
|
|
173
|
+
const rowDate = new Date(row.createdAt);
|
|
174
|
+
return rowDate >= this.startDate && rowDate <= this.endDate;
|
|
175
|
+
}"
|
|
176
|
+
```
|
|
177
|
+
|
|
147
178
|
---
|
|
148
179
|
|
|
149
180
|
## Data Management Inputs
|
|
@@ -550,10 +581,33 @@ Columns are configured via the `initColumns` input using the `StMaterialTableCol
|
|
|
550
581
|
|
|
551
582
|
##### `rowEditType`
|
|
552
583
|
- **Type:** `StMaterialRowEditType`
|
|
553
|
-
- **Options:** `'string'` | `'number'` | `'boolean'` | `'date'` | `'custom'` | `'custom-dynamic-select'`
|
|
584
|
+
- **Options:** `'string'` | `'number'` | `'boolean'` | `'date'` | `'custom'` | `'custom-dynamic-select'` | `'number-qty-input'`
|
|
554
585
|
- **Default:** Auto-detected from `type`
|
|
555
586
|
- **Description:** Type of input to show when editing this column.
|
|
587
|
+
- `'string'`: Text input field
|
|
588
|
+
- `'number'`: Standard HTML number input
|
|
589
|
+
- `'boolean'`: Toggle/checkbox control
|
|
590
|
+
- `'date'`: Date picker
|
|
591
|
+
- `'custom'`: Dropdown with static options
|
|
592
|
+
- `'custom-dynamic-select'`: Dropdown with row-dependent options
|
|
593
|
+
- `'number-qty-input'`: Quantity input component with increment/decrement buttons
|
|
556
594
|
- **Example:** `rowEditType: 'number'`
|
|
595
|
+
- **Qty Input Example:**
|
|
596
|
+
```typescript
|
|
597
|
+
{
|
|
598
|
+
field: 'quantity',
|
|
599
|
+
header: 'Quantity',
|
|
600
|
+
type: 'number',
|
|
601
|
+
allowEditColumn: true,
|
|
602
|
+
rowEditType: 'number-qty-input',
|
|
603
|
+
customEditRowValidator: (oldValue, newValue, row) => {
|
|
604
|
+
if (newValue < 0) {
|
|
605
|
+
return { isValid: false, errorMessage: 'Quantity cannot be negative' };
|
|
606
|
+
}
|
|
607
|
+
return { isValid: true, errorMessage: '' };
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
```
|
|
557
611
|
|
|
558
612
|
##### `customRowEditOptions`
|
|
559
613
|
- **Type:** `{ value: any; label: string }[]`
|
|
@@ -996,7 +1050,93 @@ onFieldChanged(event: { row: any; field: string; value: any; index: number }): v
|
|
|
996
1050
|
</ngx-st-material-table>
|
|
997
1051
|
```
|
|
998
1052
|
|
|
999
|
-
### Example 5:
|
|
1053
|
+
### Example 5: Quantity Input in Table (Auto-Save)
|
|
1054
|
+
|
|
1055
|
+
```typescript
|
|
1056
|
+
// Component - Using the dedicated qty-input component for quantity columns
|
|
1057
|
+
columns: StMaterialTableColumnModel[] = [
|
|
1058
|
+
{ field: 'product', header: 'Product', width: '200px' },
|
|
1059
|
+
{
|
|
1060
|
+
field: 'quantity',
|
|
1061
|
+
header: 'Quantity',
|
|
1062
|
+
type: 'number',
|
|
1063
|
+
width: '120px',
|
|
1064
|
+
allowEditColumn: true,
|
|
1065
|
+
rowEditType: 'number-qty-input', // Uses qty-input component
|
|
1066
|
+
customEditRowValidator: (oldValue, newValue, row) => {
|
|
1067
|
+
if (newValue < 0) {
|
|
1068
|
+
return { isValid: false, errorMessage: 'Quantity cannot be negative' };
|
|
1069
|
+
}
|
|
1070
|
+
if (newValue > row.maxStock) {
|
|
1071
|
+
return { isValid: false, errorMessage: `Maximum available: ${row.maxStock}` };
|
|
1072
|
+
}
|
|
1073
|
+
return { isValid: true, errorMessage: '' };
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
field: 'price',
|
|
1078
|
+
header: 'Unit Price',
|
|
1079
|
+
type: 'number',
|
|
1080
|
+
customValueDisplay: (row) => `$${row.price.toFixed(2)}`
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
field: 'total',
|
|
1084
|
+
header: 'Total',
|
|
1085
|
+
type: 'number',
|
|
1086
|
+
sort: false,
|
|
1087
|
+
filter: false,
|
|
1088
|
+
customValueDisplay: (row) => `$${(row.quantity * row.price).toFixed(2)}`
|
|
1089
|
+
}
|
|
1090
|
+
];
|
|
1091
|
+
|
|
1092
|
+
items = [
|
|
1093
|
+
{ id: 1, product: 'Widget A', quantity: 5, price: 10.00, maxStock: 100 },
|
|
1094
|
+
{ id: 2, product: 'Widget B', quantity: 3, price: 15.50, maxStock: 50 },
|
|
1095
|
+
{ id: 3, product: 'Widget C', quantity: 2, price: 25.00, maxStock: 75 }
|
|
1096
|
+
];
|
|
1097
|
+
|
|
1098
|
+
onFieldChanged(event: { row: any; field: string; value: any; index: number }): void {
|
|
1099
|
+
// Update local data immediately
|
|
1100
|
+
this.items[event.index][event.field] = event.value;
|
|
1101
|
+
|
|
1102
|
+
// Persist to server if needed
|
|
1103
|
+
this.itemService.updateItem(event.row).subscribe(
|
|
1104
|
+
(updatedItem) => {
|
|
1105
|
+
this.items[event.index] = updatedItem;
|
|
1106
|
+
},
|
|
1107
|
+
(error) => {
|
|
1108
|
+
console.error('Failed to update item', error);
|
|
1109
|
+
// You might want to rollback the change
|
|
1110
|
+
}
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
```html
|
|
1116
|
+
<!-- Template -->
|
|
1117
|
+
<ngx-st-material-table
|
|
1118
|
+
tableTitle="Order Items"
|
|
1119
|
+
[pageSize]="25"
|
|
1120
|
+
[data]="items"
|
|
1121
|
+
[initColumns]="columns"
|
|
1122
|
+
[allowEditRow]="true"
|
|
1123
|
+
[autoSaveOnChange]="true"
|
|
1124
|
+
[setNewDataWithoutRefresh]="true"
|
|
1125
|
+
[showGlobalSearch]="true"
|
|
1126
|
+
localStorageName="order-items-table"
|
|
1127
|
+
(fieldValueChanged)="onFieldChanged($event)">
|
|
1128
|
+
</ngx-st-material-table>
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
**Benefits of using `number-qty-input` rowEditType:**
|
|
1132
|
+
- Dedicated increment/decrement buttons for easy quantity adjustments
|
|
1133
|
+
- Cleaner UI compared to standard number inputs (hidden spinner arrows)
|
|
1134
|
+
- Customizable input width to fit your layout
|
|
1135
|
+
- Integrated validation support
|
|
1136
|
+
- Immediate auto-save when used with `autoSaveOnChange`
|
|
1137
|
+
- Better user experience for quantity-centric tables
|
|
1138
|
+
|
|
1139
|
+
### Example 6: Selection Table
|
|
1000
1140
|
|
|
1001
1141
|
```typescript
|
|
1002
1142
|
// Component
|
|
@@ -1029,7 +1169,7 @@ formatSelectedUser(row: any): string {
|
|
|
1029
1169
|
</ngx-st-material-table>
|
|
1030
1170
|
```
|
|
1031
1171
|
|
|
1032
|
-
### Example
|
|
1172
|
+
### Example 7: Expandable Rows
|
|
1033
1173
|
|
|
1034
1174
|
```html
|
|
1035
1175
|
<!-- Template -->
|
|
@@ -1050,7 +1190,7 @@ formatSelectedUser(row: any): string {
|
|
|
1050
1190
|
</ngx-st-material-table>
|
|
1051
1191
|
```
|
|
1052
1192
|
|
|
1053
|
-
### Example
|
|
1193
|
+
### Example 8: Custom Column Template
|
|
1054
1194
|
|
|
1055
1195
|
```html
|
|
1056
1196
|
<!-- Template -->
|
|
@@ -1082,7 +1222,7 @@ ngAfterViewInit() {
|
|
|
1082
1222
|
}
|
|
1083
1223
|
```
|
|
1084
1224
|
|
|
1085
|
-
### Example
|
|
1225
|
+
### Example 9: Actions Column
|
|
1086
1226
|
|
|
1087
1227
|
```typescript
|
|
1088
1228
|
// Component
|
|
@@ -1133,7 +1273,7 @@ deleteUser(row: any, index: number): void {
|
|
|
1133
1273
|
}
|
|
1134
1274
|
```
|
|
1135
1275
|
|
|
1136
|
-
### Example
|
|
1276
|
+
### Example 10: Dynamic Select Options Based on Row
|
|
1137
1277
|
|
|
1138
1278
|
```typescript
|
|
1139
1279
|
// Component
|
|
@@ -1207,6 +1347,38 @@ Combine `allowEditRow`, `allowCreateRow`, and action handlers for full CRUD oper
|
|
|
1207
1347
|
### Pattern 5: Filtered Report
|
|
1208
1348
|
Use `showGlobalSearch`, column filters, and `localStorageName` for a searchable report with saved preferences.
|
|
1209
1349
|
|
|
1350
|
+
### Pattern 6: Dynamic Custom Filtering
|
|
1351
|
+
Use `initFilterMethod` for programmatic filtering based on external state or complex business logic.
|
|
1352
|
+
|
|
1353
|
+
```typescript
|
|
1354
|
+
export class MyComponent {
|
|
1355
|
+
minAmount = 100;
|
|
1356
|
+
selectedDepartment = 'Sales';
|
|
1357
|
+
|
|
1358
|
+
filterMethod = (row: any): boolean => {
|
|
1359
|
+
return row.amount >= this.minAmount &&
|
|
1360
|
+
row.department === this.selectedDepartment;
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
// When minAmount or selectedDepartment changes,
|
|
1364
|
+
// update the filter method to trigger refiltering
|
|
1365
|
+
updateFilters() {
|
|
1366
|
+
this.filterMethod = (row: any): boolean => {
|
|
1367
|
+
return row.amount >= this.minAmount &&
|
|
1368
|
+
row.department === this.selectedDepartment;
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
```
|
|
1373
|
+
|
|
1374
|
+
```html
|
|
1375
|
+
<ngx-st-material-table
|
|
1376
|
+
[data]="salesData"
|
|
1377
|
+
[initColumns]="columns"
|
|
1378
|
+
[initFilterMethod]="filterMethod">
|
|
1379
|
+
</ngx-st-material-table>
|
|
1380
|
+
```
|
|
1381
|
+
|
|
1210
1382
|
---
|
|
1211
1383
|
|
|
1212
1384
|
## Troubleshooting
|
|
@@ -161,7 +161,7 @@ export class MaterialTableRowCellComponent {
|
|
|
161
161
|
this.changeDetectorRef.detectChanges();
|
|
162
162
|
}
|
|
163
163
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MaterialTableRowCellComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
164
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: MaterialTableRowCellComponent, selector: "st-material-table-row-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: true, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: true, transformFunction: null }, rowDataCopy: { classPropertyName: "rowDataCopy", publicName: "rowDataCopy", isSignal: true, isRequired: false, transformFunction: null }, canEditRowValidator: { classPropertyName: "canEditRowValidator", publicName: "canEditRowValidator", isSignal: true, isRequired: false, transformFunction: null }, canDeleteRowValidator: { classPropertyName: "canDeleteRowValidator", publicName: "canDeleteRowValidator", isSignal: true, isRequired: false, transformFunction: null }, selectRowOnlyOne: { classPropertyName: "selectRowOnlyOne", publicName: "selectRowOnlyOne", isSignal: true, isRequired: false, transformFunction: null }, isFirstEditableColumn: { classPropertyName: "isFirstEditableColumn", publicName: "isFirstEditableColumn", isSignal: true, isRequired: false, transformFunction: null }, autoSaveOnChange: { classPropertyName: "autoSaveOnChange", publicName: "autoSaveOnChange", isSignal: true, isRequired: false, transformFunction: null }, rowIsSelected: { classPropertyName: "rowIsSelected", publicName: "rowIsSelected", isSignal: true, isRequired: false, transformFunction: null }, rowIsExpanded: { classPropertyName: "rowIsExpanded", publicName: "rowIsExpanded", isSignal: true, isRequired: false, transformFunction: null }, rowEditing: { classPropertyName: "rowEditing", publicName: "rowEditing", isSignal: true, isRequired: false, transformFunction: null }, allowDeleteInEditRow: { classPropertyName: "allowDeleteInEditRow", publicName: "allowDeleteInEditRow", isSignal: true, isRequired: false, transformFunction: null }, allowEditInEditRow: { classPropertyName: "allowEditInEditRow", publicName: "allowEditInEditRow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { saveEditRowEmitter: "saveEditRowEmitter", cancelEditRowEmitter: "cancelEditRowEmitter", editRowEmitter: "editRowEmitter", deleteRowEmitter: "deleteRowEmitter", selectRowChange: "selectRowChange", fieldValueChanged: "fieldValueChanged" }, viewQueries: [{ propertyName: "matInput", first: true, predicate: MatInput, descendants: true }, { propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true }], ngImport: i0, template: "@switch (column().type || 'string') {\r\n @case ('custom-template') {\r\n @if (rowEditing() && column().allowEditColumn) {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n } @else {\r\n <ng-container\r\n [ngTemplateOutlet]=\"column().customTemplate!\"\r\n [ngTemplateOutletContext]=\"{ data: rowData(), rowIndex: rowIndex() }\"\r\n ></ng-container>\r\n }\r\n }\r\n\r\n @case ('actions') {\r\n @if (column().actions) {\r\n @if (\r\n (!column().actionsInMenu && !mobileView()) ||\r\n (mobileView() && column().actions!.length <= 1)\r\n ) {\r\n <div [ngStyle]=\"{ float: column().flexRight ? 'right' : 'none' }\">\r\n @for (action of column().actions; track action) {\r\n @if ((action.show && action.show(rowData())) || !action.show) {\r\n @if (!action.url && action.action) {\r\n <button\r\n class=\"action-icon-button\"\r\n type=\"button\"\r\n mat-icon-button\r\n [color]=\"\r\n actionIconColorDef[action.iconName]\r\n ? actionIconColorDef[action.iconName]\r\n : action.iconColor\r\n \"\r\n [matTooltip]=\"action.tooltipName || ''\"\r\n [matTooltipDisabled]=\"!action.tooltipName\"\r\n (click)=\"\r\n $event.stopPropagation();\r\n action.action!(rowData(), rowIndex())\r\n \"\r\n >\r\n <mat-icon>{{ action.iconName }}</mat-icon>\r\n </button>\r\n }\r\n @if (action.url) {\r\n <a [routerLink]=\"action.url\">\r\n <button\r\n class=\"action-icon-button\"\r\n type=\"button\"\r\n mat-icon-button\r\n [color]=\"\r\n actionIconColorDef[action.iconName]\r\n ? actionIconColorDef[action.iconName]\r\n : action.iconColor\r\n \"\r\n [matTooltip]=\"action.tooltipName || ''\"\r\n [matTooltipDisabled]=\"!action.tooltipName\"\r\n >\r\n <mat-icon>{{ action.iconName }}</mat-icon>\r\n </button>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n @if (\r\n column().actionsInMenu || (mobileView() && column().actions!.length > 1)\r\n ) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n @for (action of column().actions; track action) {\r\n @if ((action.show && action.show(rowData())) || !action.show) {\r\n @if (!action.url && action.action) {\r\n <button\r\n type=\"button\"\r\n mat-menu-item\r\n (click)=\"$event.stopPropagation(); action.action!(rowData())\"\r\n >\r\n {{ action.tooltipName }}\r\n </button>\r\n }\r\n @if (action.url) {\r\n <a [routerLink]=\"action.url\">\r\n <button type=\"button\" mat-menu-item>\r\n {{ action.tooltipName }}\r\n </button>\r\n </a>\r\n }\r\n }\r\n }\r\n </mat-menu>\r\n }\r\n }\r\n }\r\n\r\n @case ('string') {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n }\r\n\r\n @case ('number') {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n }\r\n\r\n @case ('boolean') {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n }\r\n\r\n @case ('date') {\r\n @if (rowEditing() && column().allowEditColumn) {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n } @else {\r\n {{ rowData()[column().field] | stDateFormatPipe }}\r\n }\r\n }\r\n\r\n @case ('actions-row-editing') {\r\n <div class=\"row justify-content-end\">\r\n @if (rowEditing()) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"$event.stopPropagation(); saveRow()\"\r\n [matTooltip]=\"'Save row'\"\r\n >\r\n <mat-icon>done</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"$event.stopPropagation(); cancelRow()\"\r\n [matTooltip]=\"'Cancel row'\"\r\n >\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n } @else {\r\n\r\n @if (allowEditInEditRow()) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"$event.stopPropagation(); editRow()\"\r\n [matTooltip]=\"'Edit row'\"\r\n [disabled]=\"\r\n canEditRowValidator() ? !canEditRowValidator()(rowData()) : false\r\n \"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (allowDeleteInEditRow()) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"$event.stopPropagation(); deleteRow()\"\r\n [matTooltip]=\"'Delete row'\"\r\n [disabled]=\"\r\n canDeleteRowValidator()\r\n ? !canDeleteRowValidator()(rowData())\r\n : false\r\n \"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @case ('actions-row-selecting') {\r\n <!-- @if (selectRowOnlyOne()) {-->\r\n <!-- <mat-radio-button-->\r\n <!-- color=\"primary\"-->\r\n <!-- (click)=\"$event.stopPropagation()\"-->\r\n <!-- (change)=\"selectRow({ checked: true })\"-->\r\n <!-- [checked]=\"rowIsSelected()\"-->\r\n <!-- ></mat-radio-button>-->\r\n <!-- } @else {-->\r\n <mat-checkbox\r\n color=\"primary\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"selectRow($event)\"\r\n [checked]=\"rowIsSelected()\"\r\n ></mat-checkbox>\r\n <!-- }-->\r\n }\r\n\r\n @case ('actions-row-extending') {\r\n @if (rowIsExpanded()) {\r\n <mat-icon>keyboard_arrow_up</mat-icon>\r\n } @else {\r\n <mat-icon>keyboard_arrow_down</mat-icon>\r\n }\r\n }\r\n}\r\n\r\n<ng-template #baseFieldCell let-column>\r\n @if ((rowEditing() || autoSaveOnChange()) && column.allowEditColumn) {\r\n @if (column.rowEditType === 'string') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <input\r\n matInput\r\n type=\"text\"\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n (keydown.enter)=\"!autoSaveOnChange() && saveRow()\"\r\n [required]=\"column.editColumnRequired\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n (click)=\"$event.stopPropagation()\"\r\n />\r\n </mat-form-field>\r\n }\r\n @if (column.rowEditType === 'number') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <input\r\n matInput\r\n type=\"number\"\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"onNumberFieldChange(column.field, $event)\"\r\n (keydown.enter)=\"!autoSaveOnChange() && saveRow()\"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n />\r\n </mat-form-field>\r\n }\r\n @if (column.rowEditType === 'date') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <input\r\n matInput\r\n [matDatepicker]=\"picker1\"\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n (keydown.enter)=\"!autoSaveOnChange() && saveRow()\"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n />\r\n <mat-datepicker-toggle\r\n matIconSuffix\r\n [for]=\"picker1\"\r\n ></mat-datepicker-toggle>\r\n <mat-datepicker #picker1></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n @if (column.rowEditType === 'boolean') {\r\n <mat-checkbox\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"column.disableEdit ? column.disableEdit(rowData()) : false\"\r\n ></mat-checkbox>\r\n }\r\n\r\n @if (column.rowEditType === 'custom') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <mat-select\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n >\r\n <mat-option value=\"\"></mat-option>\r\n @for (option of column.customRowEditOptions; track option) {\r\n <mat-option [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.rowEditType === 'number-qty-input') {\r\n <ngx-st-qty-input\r\n appearance=\"outline\"\r\n [qtyModel]=\"getFieldValue(column.field)\"\r\n (newValueEmitter)=\"setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\"\r\n ></ngx-st-qty-input>\r\n }\r\n\r\n @if (column.rowEditType === 'custom-dynamic-select') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <mat-select\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n >\r\n @if (!column.editColumnRequired) {\r\n <mat-option value=\"\"></mat-option>\r\n }\r\n\r\n @for (option of dynamicSelectOptions(); track option) {\r\n <mat-option [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n }\r\n } @else {\r\n <div>\r\n @if (column.translateValue) {\r\n {{ column.translateValue![rowData()[column.field]] || '' }}\r\n }\r\n @if (column.customValueDisplay) {\r\n {{ column.customValueDisplay(rowData()[column.field]) }}\r\n }\r\n @if (!column.translateValue && !column.customValueDisplay) {\r\n {{ rowData()[column.field] }}\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: ["mat-form-field{padding:0 2px}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i9.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i10.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i13.QtyInputComponent, selector: "ngx-st-qty-input", inputs: ["qtyModel", "allowNegative", "disabled", "showError", "appearance"], outputs: ["qtyModelChange", "newValueEmitter"] }, { kind: "component", type: i14.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i14.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i14.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "pipe", type: i15.DateFormatPipe, name: "stDateFormatPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
164
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: MaterialTableRowCellComponent, selector: "st-material-table-row-cell", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, rowData: { classPropertyName: "rowData", publicName: "rowData", isSignal: true, isRequired: true, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: true, transformFunction: null }, rowDataCopy: { classPropertyName: "rowDataCopy", publicName: "rowDataCopy", isSignal: true, isRequired: false, transformFunction: null }, canEditRowValidator: { classPropertyName: "canEditRowValidator", publicName: "canEditRowValidator", isSignal: true, isRequired: false, transformFunction: null }, canDeleteRowValidator: { classPropertyName: "canDeleteRowValidator", publicName: "canDeleteRowValidator", isSignal: true, isRequired: false, transformFunction: null }, selectRowOnlyOne: { classPropertyName: "selectRowOnlyOne", publicName: "selectRowOnlyOne", isSignal: true, isRequired: false, transformFunction: null }, isFirstEditableColumn: { classPropertyName: "isFirstEditableColumn", publicName: "isFirstEditableColumn", isSignal: true, isRequired: false, transformFunction: null }, autoSaveOnChange: { classPropertyName: "autoSaveOnChange", publicName: "autoSaveOnChange", isSignal: true, isRequired: false, transformFunction: null }, rowIsSelected: { classPropertyName: "rowIsSelected", publicName: "rowIsSelected", isSignal: true, isRequired: false, transformFunction: null }, rowIsExpanded: { classPropertyName: "rowIsExpanded", publicName: "rowIsExpanded", isSignal: true, isRequired: false, transformFunction: null }, rowEditing: { classPropertyName: "rowEditing", publicName: "rowEditing", isSignal: true, isRequired: false, transformFunction: null }, allowDeleteInEditRow: { classPropertyName: "allowDeleteInEditRow", publicName: "allowDeleteInEditRow", isSignal: true, isRequired: false, transformFunction: null }, allowEditInEditRow: { classPropertyName: "allowEditInEditRow", publicName: "allowEditInEditRow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { saveEditRowEmitter: "saveEditRowEmitter", cancelEditRowEmitter: "cancelEditRowEmitter", editRowEmitter: "editRowEmitter", deleteRowEmitter: "deleteRowEmitter", selectRowChange: "selectRowChange", fieldValueChanged: "fieldValueChanged" }, viewQueries: [{ propertyName: "matInput", first: true, predicate: MatInput, descendants: true }, { propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true }], ngImport: i0, template: "@switch (column().type || 'string') {\r\n @case ('custom-template') {\r\n @if (rowEditing() && column().allowEditColumn) {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n } @else {\r\n <ng-container\r\n [ngTemplateOutlet]=\"column().customTemplate!\"\r\n [ngTemplateOutletContext]=\"{ data: rowData(), rowIndex: rowIndex() }\"\r\n ></ng-container>\r\n }\r\n }\r\n\r\n @case ('actions') {\r\n @if (column().actions) {\r\n @if (\r\n (!column().actionsInMenu && !mobileView()) ||\r\n (mobileView() && column().actions!.length <= 1)\r\n ) {\r\n <div [ngStyle]=\"{ float: column().flexRight ? 'right' : 'none' }\">\r\n @for (action of column().actions; track action) {\r\n @if ((action.show && action.show(rowData())) || !action.show) {\r\n @if (!action.url && action.action) {\r\n <button\r\n class=\"action-icon-button\"\r\n type=\"button\"\r\n mat-icon-button\r\n [color]=\"\r\n actionIconColorDef[action.iconName]\r\n ? actionIconColorDef[action.iconName]\r\n : action.iconColor\r\n \"\r\n [matTooltip]=\"action.tooltipName || ''\"\r\n [matTooltipDisabled]=\"!action.tooltipName\"\r\n (click)=\"\r\n $event.stopPropagation();\r\n action.action!(rowData(), rowIndex())\r\n \"\r\n >\r\n <mat-icon>{{ action.iconName }}</mat-icon>\r\n </button>\r\n }\r\n @if (action.url) {\r\n <a [routerLink]=\"action.url\">\r\n <button\r\n class=\"action-icon-button\"\r\n type=\"button\"\r\n mat-icon-button\r\n [color]=\"\r\n actionIconColorDef[action.iconName]\r\n ? actionIconColorDef[action.iconName]\r\n : action.iconColor\r\n \"\r\n [matTooltip]=\"action.tooltipName || ''\"\r\n [matTooltipDisabled]=\"!action.tooltipName\"\r\n >\r\n <mat-icon>{{ action.iconName }}</mat-icon>\r\n </button>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n @if (\r\n column().actionsInMenu || (mobileView() && column().actions!.length > 1)\r\n ) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n @for (action of column().actions; track action) {\r\n @if ((action.show && action.show(rowData())) || !action.show) {\r\n @if (!action.url && action.action) {\r\n <button\r\n type=\"button\"\r\n mat-menu-item\r\n (click)=\"$event.stopPropagation(); action.action!(rowData())\"\r\n >\r\n {{ action.tooltipName }}\r\n </button>\r\n }\r\n @if (action.url) {\r\n <a [routerLink]=\"action.url\">\r\n <button type=\"button\" mat-menu-item>\r\n {{ action.tooltipName }}\r\n </button>\r\n </a>\r\n }\r\n }\r\n }\r\n </mat-menu>\r\n }\r\n }\r\n }\r\n\r\n @case ('string') {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n }\r\n\r\n @case ('number') {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n }\r\n\r\n @case ('boolean') {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n }\r\n\r\n @case ('date') {\r\n @if (rowEditing() && column().allowEditColumn) {\r\n <ng-container\r\n *ngTemplateOutlet=\"baseFieldCell; context: { $implicit: column() }\"\r\n ></ng-container>\r\n } @else {\r\n {{ rowData()[column().field] | stDateFormatPipe }}\r\n }\r\n }\r\n\r\n @case ('actions-row-editing') {\r\n <div class=\"row justify-content-end\">\r\n @if (rowEditing()) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"accent\"\r\n (click)=\"$event.stopPropagation(); saveRow()\"\r\n [matTooltip]=\"'Save row'\"\r\n >\r\n <mat-icon>done</mat-icon>\r\n </button>\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"$event.stopPropagation(); cancelRow()\"\r\n [matTooltip]=\"'Cancel row'\"\r\n >\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n } @else {\r\n\r\n @if (allowEditInEditRow()) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"$event.stopPropagation(); editRow()\"\r\n [matTooltip]=\"'Edit row'\"\r\n [disabled]=\"\r\n canEditRowValidator() ? !canEditRowValidator()(rowData()) : false\r\n \"\r\n >\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (allowDeleteInEditRow()) {\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"$event.stopPropagation(); deleteRow()\"\r\n [matTooltip]=\"'Delete row'\"\r\n [disabled]=\"\r\n canDeleteRowValidator()\r\n ? !canDeleteRowValidator()(rowData())\r\n : false\r\n \"\r\n >\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n @case ('actions-row-selecting') {\r\n <!-- @if (selectRowOnlyOne()) {-->\r\n <!-- <mat-radio-button-->\r\n <!-- color=\"primary\"-->\r\n <!-- (click)=\"$event.stopPropagation()\"-->\r\n <!-- (change)=\"selectRow({ checked: true })\"-->\r\n <!-- [checked]=\"rowIsSelected()\"-->\r\n <!-- ></mat-radio-button>-->\r\n <!-- } @else {-->\r\n <mat-checkbox\r\n color=\"primary\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"selectRow($event)\"\r\n [checked]=\"rowIsSelected()\"\r\n ></mat-checkbox>\r\n <!-- }-->\r\n }\r\n\r\n @case ('actions-row-extending') {\r\n @if (rowIsExpanded()) {\r\n <mat-icon>keyboard_arrow_up</mat-icon>\r\n } @else {\r\n <mat-icon>keyboard_arrow_down</mat-icon>\r\n }\r\n }\r\n}\r\n\r\n<ng-template #baseFieldCell let-column>\r\n @if ((rowEditing() || autoSaveOnChange()) && column.allowEditColumn) {\r\n @if (column.rowEditType === 'string') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <input\r\n matInput\r\n type=\"text\"\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n (keydown.enter)=\"!autoSaveOnChange() && saveRow()\"\r\n [required]=\"column.editColumnRequired\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n (click)=\"$event.stopPropagation()\"\r\n />\r\n </mat-form-field>\r\n }\r\n @if (column.rowEditType === 'number') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <input\r\n matInput\r\n type=\"number\"\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"onNumberFieldChange(column.field, $event)\"\r\n (keydown.enter)=\"!autoSaveOnChange() && saveRow()\"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n />\r\n </mat-form-field>\r\n }\r\n @if (column.rowEditType === 'date') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <input\r\n matInput\r\n [matDatepicker]=\"picker1\"\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n (keydown.enter)=\"!autoSaveOnChange() && saveRow()\"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n />\r\n <mat-datepicker-toggle\r\n matIconSuffix\r\n [for]=\"picker1\"\r\n ></mat-datepicker-toggle>\r\n <mat-datepicker #picker1></mat-datepicker>\r\n </mat-form-field>\r\n }\r\n @if (column.rowEditType === 'boolean') {\r\n <mat-checkbox\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"column.disableEdit ? column.disableEdit(rowData()) : false\"\r\n ></mat-checkbox>\r\n }\r\n\r\n @if (column.rowEditType === 'custom') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <mat-select\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n >\r\n <mat-option value=\"\"></mat-option>\r\n @for (option of column.customRowEditOptions; track option) {\r\n <mat-option [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n }\r\n\r\n @if (column.rowEditType === 'number-qty-input') {\r\n <ngx-st-qty-input\r\n appearance=\"outline\"\r\n [qtyModel]=\"getFieldValue(column.field)\"\r\n (newValueEmitter)=\"setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\"\r\n ></ngx-st-qty-input>\r\n }\r\n\r\n @if (column.rowEditType === 'custom-dynamic-select') {\r\n <mat-form-field\r\n appearance=\"outline\"\r\n [ngStyle]=\"{ width: column.width || 'auto' }\"\r\n >\r\n <mat-select\r\n [ngModel]=\"getFieldValue(column.field)\"\r\n (ngModelChange)=\"\r\n setFieldValue(column.field, $event);\r\n autoSaveOnChange() && onFieldChange(column.field, $event)\r\n \"\r\n [required]=\"column.editColumnRequired\"\r\n (click)=\"$event.stopPropagation()\"\r\n [disabled]=\"\r\n column.disableEdit ? column.disableEdit(rowData()) : false\r\n \"\r\n >\r\n @if (!column.editColumnRequired) {\r\n <mat-option value=\"\"></mat-option>\r\n }\r\n\r\n @for (option of dynamicSelectOptions(); track option) {\r\n <mat-option [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n }\r\n } @else {\r\n <div>\r\n @if (column.translateValue) {\r\n {{ column.translateValue![rowData()[column.field]] || '' }}\r\n }\r\n @if (column.customValueDisplay) {\r\n {{ column.customValueDisplay(rowData()[column.field]) }}\r\n }\r\n @if (!column.translateValue && !column.customValueDisplay) {\r\n {{ rowData()[column.field] }}\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n", styles: ["mat-form-field{padding:0 2px}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i8.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i9.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i10.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i13.QtyInputComponent, selector: "ngx-st-qty-input", inputs: ["qtyModel", "allowNegative", "disabled", "showError", "appearance", "inputWidth"], outputs: ["qtyModelChange", "newValueEmitter"] }, { kind: "component", type: i14.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i14.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i14.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "pipe", type: i15.DateFormatPipe, name: "stDateFormatPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
165
165
|
}
|
|
166
166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MaterialTableRowCellComponent, decorators: [{
|
|
167
167
|
type: Component,
|