@den4ik92/ng2-smart-table 19.4.3 → 19.4.5
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, Component, ChangeDetectionStrategy,
|
|
2
|
+
import { input, computed, Component, ChangeDetectionStrategy, signal, effect, inject, ElementRef, Directive, ViewContainerRef, ViewChild, output } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { distinctUntilChanged, debounceTime, takeUntil, switchMap, take } from 'rxjs/operators';
|
|
@@ -29,7 +29,7 @@ class BaseFilterComponent {
|
|
|
29
29
|
this.inputClass = input('');
|
|
30
30
|
this.source = input.required();
|
|
31
31
|
this.column = input.required();
|
|
32
|
-
this.
|
|
32
|
+
this.filterEmitter = input.required();
|
|
33
33
|
this.inputControl = new UntypedFormControl();
|
|
34
34
|
}
|
|
35
35
|
ngOnDestroy() {
|
|
@@ -50,10 +50,10 @@ class BaseFilterComponent {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
setFilter(query) {
|
|
53
|
-
this.
|
|
53
|
+
this.filterEmitter().emit(query);
|
|
54
54
|
}
|
|
55
55
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: BaseFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.3", type: BaseFilterComponent, isStandalone: true, selector: "ng2-base-filter-component", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }
|
|
56
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.3", type: BaseFilterComponent, isStandalone: true, selector: "ng2-base-filter-component", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, filterEmitter: { classPropertyName: "filterEmitter", publicName: "filterEmitter", isSignal: true, isRequired: true, transformFunction: null } }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
57
57
|
}
|
|
58
58
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: BaseFilterComponent, decorators: [{
|
|
59
59
|
type: Component,
|
|
@@ -1255,11 +1255,11 @@ class RowActionsComponent {
|
|
|
1255
1255
|
this.deleteEmitter.emit();
|
|
1256
1256
|
}
|
|
1257
1257
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: RowActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1258
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: RowActionsComponent, isStandalone: true, selector: "ng2-row-actions", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { editEmitter: "editEmitter", deleteEmitter: "deleteEmitter", customActionEmitter: "customActionEmitter" }, ngImport: i0, template: "@if (!row().pending()) {\n @if (isActionEditActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-edit-button'\"\n class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent()\"\n (click)=\"onEdit($event)\"></a>\n }\n @if (isActionDeleteActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-delete-button'\"\n class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent()\"\n (click)=\"onDelete($event)\"></a>\n }\n @for (action of customActions(); track action.name) {\n <a\n [id]=\"'row-' + row().index + '_action-' + action.name + '-button'\"\n href=\"#\"\n class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n [innerHTML]=\"action.title\"\n (click)=\"$event.stopPropagation(); $event.preventDefault(); onCustom(action)\"></a>\n }\n} @else {\n @for (item of allActionsCountArray(); track $index) {\n <ng-container [ngTemplateOutlet]=\"spinner\"></ng-container>\n }\n}\n\n<ng-template #spinner>\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n</ng-template>\n", styles: ["a~a{margin-left:.5rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1258
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: RowActionsComponent, isStandalone: true, selector: "ng2-row-actions", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { editEmitter: "editEmitter", deleteEmitter: "deleteEmitter", customActionEmitter: "customActionEmitter" }, ngImport: i0, template: "@if (!row().pending()) {\n @if (isActionEditActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-edit-button'\"\n class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent()\"\n (click)=\"$event.stopPropagation(); $event.preventDefault();onEdit($event)\"></a>\n }\n @if (isActionDeleteActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-delete-button'\"\n class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent()\"\n (click)=\"$event.stopPropagation(); $event.preventDefault();onDelete($event)\"></a>\n }\n @for (action of customActions(); track action.name) {\n <a\n [id]=\"'row-' + row().index + '_action-' + action.name + '-button'\"\n href=\"#\"\n class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n [innerHTML]=\"action.title\"\n (click)=\"$event.stopPropagation(); $event.preventDefault(); onCustom(action)\"></a>\n }\n} @else {\n @for (item of allActionsCountArray(); track $index) {\n <ng-container [ngTemplateOutlet]=\"spinner\"></ng-container>\n }\n}\n\n<ng-template #spinner>\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n</ng-template>\n", styles: ["a~a{margin-left:.5rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1259
1259
|
}
|
|
1260
1260
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: RowActionsComponent, decorators: [{
|
|
1261
1261
|
type: Component,
|
|
1262
|
-
args: [{ selector: 'ng2-row-actions', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!row().pending()) {\n @if (isActionEditActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-edit-button'\"\n class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent()\"\n (click)=\"onEdit($event)\"></a>\n }\n @if (isActionDeleteActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-delete-button'\"\n class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent()\"\n (click)=\"onDelete($event)\"></a>\n }\n @for (action of customActions(); track action.name) {\n <a\n [id]=\"'row-' + row().index + '_action-' + action.name + '-button'\"\n href=\"#\"\n class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n [innerHTML]=\"action.title\"\n (click)=\"$event.stopPropagation(); $event.preventDefault(); onCustom(action)\"></a>\n }\n} @else {\n @for (item of allActionsCountArray(); track $index) {\n <ng-container [ngTemplateOutlet]=\"spinner\"></ng-container>\n }\n}\n\n<ng-template #spinner>\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n</ng-template>\n", styles: ["a~a{margin-left:.5rem}\n"] }]
|
|
1262
|
+
args: [{ selector: 'ng2-row-actions', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!row().pending()) {\n @if (isActionEditActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-edit-button'\"\n class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent()\"\n (click)=\"$event.stopPropagation(); $event.preventDefault();onEdit($event)\"></a>\n }\n @if (isActionDeleteActive()) {\n <a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-delete-button'\"\n class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent()\"\n (click)=\"$event.stopPropagation(); $event.preventDefault();onDelete($event)\"></a>\n }\n @for (action of customActions(); track action.name) {\n <a\n [id]=\"'row-' + row().index + '_action-' + action.name + '-button'\"\n href=\"#\"\n class=\"ng2-smart-action ng2-smart-action-custom-custom\"\n [innerHTML]=\"action.title\"\n (click)=\"$event.stopPropagation(); $event.preventDefault(); onCustom(action)\"></a>\n }\n} @else {\n @for (item of allActionsCountArray(); track $index) {\n <ng-container [ngTemplateOutlet]=\"spinner\"></ng-container>\n }\n}\n\n<ng-template #spinner>\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n</ng-template>\n", styles: ["a~a{margin-left:.5rem}\n"] }]
|
|
1263
1263
|
}] });
|
|
1264
1264
|
|
|
1265
1265
|
class TrowComponent {
|
|
@@ -1386,7 +1386,9 @@ class CheckboxFilterComponent extends BaseFilterComponent {
|
|
|
1386
1386
|
[class]="inputClass()"
|
|
1387
1387
|
class="form-control" />
|
|
1388
1388
|
@if (filterIsActive()) {
|
|
1389
|
-
<a href="#" (click)="resetFilter($event)">{{
|
|
1389
|
+
<a href="#" (click)="$event.preventDefault(); resetFilter($event)">{{
|
|
1390
|
+
column().getFilterConfig()?.resetText || 'reset'
|
|
1391
|
+
}}</a>
|
|
1390
1392
|
}
|
|
1391
1393
|
</div>
|
|
1392
1394
|
`, isInline: true, styles: [".checkbox-filter-wrapper{display:flex;align-items:center;justify-content:flex-start;gap:.5rem}.checkbox-filter-wrapper input{width:auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -1403,7 +1405,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1403
1405
|
[class]="inputClass()"
|
|
1404
1406
|
class="form-control" />
|
|
1405
1407
|
@if (filterIsActive()) {
|
|
1406
|
-
<a href="#" (click)="resetFilter($event)">{{
|
|
1408
|
+
<a href="#" (click)="$event.preventDefault(); resetFilter($event)">{{
|
|
1409
|
+
column().getFilterConfig()?.resetText || 'reset'
|
|
1410
|
+
}}</a>
|
|
1407
1411
|
}
|
|
1408
1412
|
</div>
|
|
1409
1413
|
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, ReactiveFormsModule], styles: [".checkbox-filter-wrapper{display:flex;align-items:center;justify-content:flex-start;gap:.5rem}.checkbox-filter-wrapper input{width:auto}\n"] }]
|
|
@@ -1441,7 +1445,7 @@ class SelectFilterComponent extends BaseFilterComponent {
|
|
|
1441
1445
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: SelectFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1442
1446
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: SelectFilterComponent, isStandalone: true, selector: "ng2-select-filter", usesInheritance: true, ngImport: i0, template: `
|
|
1443
1447
|
<select [class]="inputClass()" class="form-control" [formControl]="inputControl">
|
|
1444
|
-
<option value="
|
|
1448
|
+
<option value="">{{ column().getFilterConfig().selectText || 'all' }}</option>
|
|
1445
1449
|
@for (option of column().getFilterConfig().list; track $index) {
|
|
1446
1450
|
<option [value]="option.value">
|
|
1447
1451
|
{{ option.title }}
|
|
@@ -1456,7 +1460,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1456
1460
|
selector: 'ng2-select-filter',
|
|
1457
1461
|
template: `
|
|
1458
1462
|
<select [class]="inputClass()" class="form-control" [formControl]="inputControl">
|
|
1459
|
-
<option value="
|
|
1463
|
+
<option value="">{{ column().getFilterConfig().selectText || 'all' }}</option>
|
|
1460
1464
|
@for (option of column().getFilterConfig().list; track $index) {
|
|
1461
1465
|
<option [value]="option.value">
|
|
1462
1466
|
{{ option.title }}
|
|
@@ -1486,7 +1490,7 @@ class BuildInFilterComponent {
|
|
|
1486
1490
|
[class]="inputClass()"
|
|
1487
1491
|
[source]="source()"
|
|
1488
1492
|
[column]="column()"
|
|
1489
|
-
|
|
1493
|
+
[filterEmitter]="filter">
|
|
1490
1494
|
</ng2-select-filter>
|
|
1491
1495
|
}
|
|
1492
1496
|
@case ('checkbox') {
|
|
@@ -1495,7 +1499,7 @@ class BuildInFilterComponent {
|
|
|
1495
1499
|
[source]="source()"
|
|
1496
1500
|
[class]="inputClass()"
|
|
1497
1501
|
[column]="column()"
|
|
1498
|
-
|
|
1502
|
+
[filterEmitter]="filter">
|
|
1499
1503
|
</ng2-checkbox-filter>
|
|
1500
1504
|
}
|
|
1501
1505
|
@default {
|
|
@@ -1504,7 +1508,7 @@ class BuildInFilterComponent {
|
|
|
1504
1508
|
[source]="source()"
|
|
1505
1509
|
[class]="inputClass()"
|
|
1506
1510
|
[column]="column()"
|
|
1507
|
-
|
|
1511
|
+
[filterEmitter]="filter">
|
|
1508
1512
|
</ng2-input-filter>
|
|
1509
1513
|
}
|
|
1510
1514
|
}
|
|
@@ -1522,7 +1526,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1522
1526
|
[class]="inputClass()"
|
|
1523
1527
|
[source]="source()"
|
|
1524
1528
|
[column]="column()"
|
|
1525
|
-
|
|
1529
|
+
[filterEmitter]="filter">
|
|
1526
1530
|
</ng2-select-filter>
|
|
1527
1531
|
}
|
|
1528
1532
|
@case ('checkbox') {
|
|
@@ -1531,7 +1535,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1531
1535
|
[source]="source()"
|
|
1532
1536
|
[class]="inputClass()"
|
|
1533
1537
|
[column]="column()"
|
|
1534
|
-
|
|
1538
|
+
[filterEmitter]="filter">
|
|
1535
1539
|
</ng2-checkbox-filter>
|
|
1536
1540
|
}
|
|
1537
1541
|
@default {
|
|
@@ -1540,7 +1544,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1540
1544
|
[source]="source()"
|
|
1541
1545
|
[class]="inputClass()"
|
|
1542
1546
|
[column]="column()"
|
|
1543
|
-
|
|
1547
|
+
[filterEmitter]="filter">
|
|
1544
1548
|
</ng2-input-filter>
|
|
1545
1549
|
}
|
|
1546
1550
|
}
|
|
@@ -1552,58 +1556,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1552
1556
|
|
|
1553
1557
|
class CustomFilterComponent {
|
|
1554
1558
|
constructor() {
|
|
1559
|
+
this.customFilterComponent = computed(() => {
|
|
1560
|
+
const columnFilter = this.column().filter;
|
|
1561
|
+
if (!columnFilter || columnFilter.type !== 'custom') {
|
|
1562
|
+
return null;
|
|
1563
|
+
}
|
|
1564
|
+
return columnFilter.component;
|
|
1565
|
+
});
|
|
1555
1566
|
this.query = input('');
|
|
1556
1567
|
this.inputClass = input('');
|
|
1557
1568
|
this.source = input.required();
|
|
1558
1569
|
this.column = input.required();
|
|
1559
1570
|
this.filter = output();
|
|
1560
1571
|
}
|
|
1561
|
-
ngOnChanges(changes) {
|
|
1562
|
-
if (this.customComponent) {
|
|
1563
|
-
if (this.customComponent?.instance && 'ngOnChanges' in this.customComponent.instance) {
|
|
1564
|
-
try {
|
|
1565
|
-
const onChanges = this.customComponent.instance.ngOnChanges;
|
|
1566
|
-
onChanges(changes);
|
|
1567
|
-
}
|
|
1568
|
-
catch {
|
|
1569
|
-
// do nothing
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
return;
|
|
1573
|
-
}
|
|
1574
|
-
const columnFilter = this.column().filter;
|
|
1575
|
-
if (columnFilter && columnFilter.type === 'custom') {
|
|
1576
|
-
this.customComponent = this.dynamicTarget?.createComponent(columnFilter?.component);
|
|
1577
|
-
// set @Inputs and @Outputs of custom component
|
|
1578
|
-
this.customComponent?.setInput('query', this.query());
|
|
1579
|
-
this.customComponent?.setInput('column', this.column());
|
|
1580
|
-
this.customComponent?.setInput('source', this.source());
|
|
1581
|
-
this.customComponent?.setInput('inputClass', this.inputClass());
|
|
1582
|
-
this.filterSubscription = this.customComponent?.instance.filter.subscribe((event) => this.filter.emit(event));
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
ngOnDestroy() {
|
|
1586
|
-
if (this.customComponent) {
|
|
1587
|
-
this.customComponent.destroy();
|
|
1588
|
-
}
|
|
1589
|
-
if (this.filterSubscription) {
|
|
1590
|
-
this.filterSubscription.unsubscribe();
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
1572
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CustomFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1594
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1573
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: CustomFilterComponent, isStandalone: true, selector: "ng2-custom-table-filter", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { filter: "filter" }, ngImport: i0, template: `
|
|
1574
|
+
@if (customFilterComponent(); as component) {
|
|
1575
|
+
<ng-template
|
|
1576
|
+
*ngComponentOutlet="
|
|
1577
|
+
component;
|
|
1578
|
+
inputs: {
|
|
1579
|
+
query: query(),
|
|
1580
|
+
inputClass: inputClass(),
|
|
1581
|
+
source: source(),
|
|
1582
|
+
column: column(),
|
|
1583
|
+
filterEmitter: filter,
|
|
1584
|
+
}
|
|
1585
|
+
"></ng-template>
|
|
1586
|
+
}
|
|
1587
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1595
1588
|
}
|
|
1596
1589
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CustomFilterComponent, decorators: [{
|
|
1597
1590
|
type: Component,
|
|
1598
1591
|
args: [{
|
|
1599
1592
|
selector: 'ng2-custom-table-filter',
|
|
1600
|
-
|
|
1593
|
+
imports: [NgComponentOutlet],
|
|
1594
|
+
template: `
|
|
1595
|
+
@if (customFilterComponent(); as component) {
|
|
1596
|
+
<ng-template
|
|
1597
|
+
*ngComponentOutlet="
|
|
1598
|
+
component;
|
|
1599
|
+
inputs: {
|
|
1600
|
+
query: query(),
|
|
1601
|
+
inputClass: inputClass(),
|
|
1602
|
+
source: source(),
|
|
1603
|
+
column: column(),
|
|
1604
|
+
filterEmitter: filter,
|
|
1605
|
+
}
|
|
1606
|
+
"></ng-template>
|
|
1607
|
+
}
|
|
1608
|
+
`,
|
|
1601
1609
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1602
1610
|
}]
|
|
1603
|
-
}]
|
|
1604
|
-
type: ViewChild,
|
|
1605
|
-
args: ['dynamicTarget', { read: ViewContainerRef, static: true }]
|
|
1606
|
-
}] } });
|
|
1611
|
+
}] });
|
|
1607
1612
|
|
|
1608
1613
|
class FilterComponent {
|
|
1609
1614
|
constructor() {
|
|
@@ -1713,7 +1718,7 @@ class AddButtonComponent {
|
|
|
1713
1718
|
href="#"
|
|
1714
1719
|
class="ng2-smart-action ng2-smart-action-add-add"
|
|
1715
1720
|
[innerHTML]="addNewButtonContent()"
|
|
1716
|
-
(click)="onAdd($event)"></a>
|
|
1721
|
+
(click)="$event.preventDefault(); onAdd($event)"></a>
|
|
1717
1722
|
}
|
|
1718
1723
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1719
1724
|
}
|
|
@@ -1727,7 +1732,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
1727
1732
|
href="#"
|
|
1728
1733
|
class="ng2-smart-action ng2-smart-action-add-add"
|
|
1729
1734
|
[innerHTML]="addNewButtonContent()"
|
|
1730
|
-
(click)="onAdd($event)"></a>
|
|
1735
|
+
(click)="$event.preventDefault(); onAdd($event)"></a>
|
|
1731
1736
|
}
|
|
1732
1737
|
`,
|
|
1733
1738
|
host: {
|