ngx-st-tables 18.0.16 → 18.0.17
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/esm2022/lib/components/material-table/material-table-selected-rows/material-table-selected-rows.component.mjs +5 -5
- package/esm2022/lib/components/material-table/material-table.component.mjs +35 -39
- package/fesm2022/ngx-st-tables.mjs +38 -42
- package/fesm2022/ngx-st-tables.mjs.map +1 -1
- package/lib/components/material-table/material-table-selected-rows/material-table-selected-rows.component.d.ts +2 -3
- package/lib/components/material-table/material-table.component.d.ts +3 -2
- package/package.json +1 -1
|
@@ -11,22 +11,22 @@ export class MaterialTableSelectedRowsComponent {
|
|
|
11
11
|
this.stTableTranslations = stTableTranslations;
|
|
12
12
|
this.allowSelectRow = input.required();
|
|
13
13
|
this.selectRowOnlyOne = input.required();
|
|
14
|
-
this.
|
|
14
|
+
this.selectedRows = input.required();
|
|
15
15
|
this.selectionFieldLabel = input.required();
|
|
16
16
|
this.selectRowValueDisplay = input();
|
|
17
17
|
this.removeSelectedRow = output();
|
|
18
18
|
}
|
|
19
19
|
onRemoveSelectedRow(event, row) {
|
|
20
|
-
if (!this.selectRowOnlyOne() && this.
|
|
20
|
+
if (!this.selectRowOnlyOne() && this.selectedRows().length > 1) {
|
|
21
21
|
event.stopPropagation();
|
|
22
22
|
}
|
|
23
23
|
this.removeSelectedRow.emit(row);
|
|
24
24
|
}
|
|
25
25
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MaterialTableSelectedRowsComponent, deps: [{ token: i1.StTablesTranslationsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: MaterialTableSelectedRowsComponent, selector: "st-material-table-selected-rows", inputs: { allowSelectRow: { classPropertyName: "allowSelectRow", publicName: "allowSelectRow", isSignal: true, isRequired: true, transformFunction: null }, selectRowOnlyOne: { classPropertyName: "selectRowOnlyOne", publicName: "selectRowOnlyOne", isSignal: true, isRequired: true, transformFunction: null },
|
|
26
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: MaterialTableSelectedRowsComponent, selector: "st-material-table-selected-rows", inputs: { allowSelectRow: { classPropertyName: "allowSelectRow", publicName: "allowSelectRow", isSignal: true, isRequired: true, transformFunction: null }, selectRowOnlyOne: { classPropertyName: "selectRowOnlyOne", publicName: "selectRowOnlyOne", isSignal: true, isRequired: true, transformFunction: null }, selectedRows: { classPropertyName: "selectedRows", publicName: "selectedRows", isSignal: true, isRequired: true, transformFunction: null }, selectionFieldLabel: { classPropertyName: "selectionFieldLabel", publicName: "selectionFieldLabel", isSignal: true, isRequired: true, transformFunction: null }, selectRowValueDisplay: { classPropertyName: "selectRowValueDisplay", publicName: "selectRowValueDisplay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removeSelectedRow: "removeSelectedRow" }, ngImport: i0, template: "@if (allowSelectRow()) {\r\n <div class=\"st-material-table-selected-rows\">\r\n @if (!selectRowOnlyOne()) {\r\n <button type=\"button\" mat-stroked-button [matMenuTriggerFor]=\"menu\">\r\n {{ selectedRows().length }}\r\n {{ stTableTranslations.getTranslations()().rowSelected }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n @for (row of selectedRows(); track row.id) {\r\n <button\r\n type=\"button\"\r\n mat-menu-item\r\n [disabled]=\"selectedRows().length <= 0\"\r\n (click)=\"onRemoveSelectedRow($event, row)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"selectedFieldLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\r\n />\r\n <mat-icon class=\"delete-icon\">delete</mat-icon>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n @if (selectedRows().length > 0) {\r\n <mat-chip>\r\n <ng-container\r\n [ngTemplateOutlet]=\"selectedFieldLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: selectedRows()[0] }\"\r\n />\r\n <button\r\n matChipRemove\r\n type=\"button\"\r\n aria-label=\"Remove selected item\"\r\n (click)=\"onRemoveSelectedRow($event, selectedRows()[0])\"\r\n >\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n<ng-template #selectedFieldLabel let-row>\r\n @if (selectRowValueDisplay()) {\r\n {{ selectRowValueDisplay()!(row) }}\r\n } @else {\r\n {{ row[selectionFieldLabel()] }}\r\n }\r\n</ng-template>\r\n", styles: [".st-material-table-selected-rows{position:absolute;bottom:12px;left:5px}.st-material-table-selected-rows .delete-icon{margin-right:0;margin-left:10px}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.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: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.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: i6.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: i6.MatChipRemove, selector: "[matChipRemove]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
27
27
|
}
|
|
28
28
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MaterialTableSelectedRowsComponent, decorators: [{
|
|
29
29
|
type: Component,
|
|
30
|
-
args: [{ selector: 'st-material-table-selected-rows', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (allowSelectRow()) {\r\n <div class=\"st-material-table-selected-rows\">\r\n @if (!selectRowOnlyOne()) {\r\n <button type=\"button\" mat-stroked-button [matMenuTriggerFor]=\"menu\">\r\n {{
|
|
30
|
+
args: [{ selector: 'st-material-table-selected-rows', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (allowSelectRow()) {\r\n <div class=\"st-material-table-selected-rows\">\r\n @if (!selectRowOnlyOne()) {\r\n <button type=\"button\" mat-stroked-button [matMenuTriggerFor]=\"menu\">\r\n {{ selectedRows().length }}\r\n {{ stTableTranslations.getTranslations()().rowSelected }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n @for (row of selectedRows(); track row.id) {\r\n <button\r\n type=\"button\"\r\n mat-menu-item\r\n [disabled]=\"selectedRows().length <= 0\"\r\n (click)=\"onRemoveSelectedRow($event, row)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"selectedFieldLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row }\"\r\n />\r\n <mat-icon class=\"delete-icon\">delete</mat-icon>\r\n </button>\r\n }\r\n </mat-menu>\r\n } @else {\r\n @if (selectedRows().length > 0) {\r\n <mat-chip>\r\n <ng-container\r\n [ngTemplateOutlet]=\"selectedFieldLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: selectedRows()[0] }\"\r\n />\r\n <button\r\n matChipRemove\r\n type=\"button\"\r\n aria-label=\"Remove selected item\"\r\n (click)=\"onRemoveSelectedRow($event, selectedRows()[0])\"\r\n >\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n }\r\n </div>\r\n}\r\n\r\n<ng-template #selectedFieldLabel let-row>\r\n @if (selectRowValueDisplay()) {\r\n {{ selectRowValueDisplay()!(row) }}\r\n } @else {\r\n {{ row[selectionFieldLabel()] }}\r\n }\r\n</ng-template>\r\n", styles: [".st-material-table-selected-rows{position:absolute;bottom:12px;left:5px}.st-material-table-selected-rows .delete-icon{margin-right:0;margin-left:10px}\n"] }]
|
|
31
31
|
}], ctorParameters: () => [{ type: i1.StTablesTranslationsService }] });
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0ZXJpYWwtdGFibGUtc2VsZWN0ZWQtcm93cy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc3QtdGFibGVzL3NyYy9saWIvY29tcG9uZW50cy9tYXRlcmlhbC10YWJsZS9tYXRlcmlhbC10YWJsZS1zZWxlY3RlZC1yb3dzL21hdGVyaWFsLXRhYmxlLXNlbGVjdGVkLXJvd3MuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXN0LXRhYmxlcy9zcmMvbGliL2NvbXBvbmVudHMvbWF0ZXJpYWwtdGFibGUvbWF0ZXJpYWwtdGFibGUtc2VsZWN0ZWQtcm93cy9tYXRlcmlhbC10YWJsZS1zZWxlY3RlZC1yb3dzLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRU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lY3RlZFJvd3MoKS5sZW5ndGggPD0gMFwiXHJcbiAgICAgICAgICAgIChjbGljayk9XCJvblJlbW92ZVNlbGVjdGVkUm93KCRldmVudCwgcm93KVwiXHJcbiAgICAgICAgICA+XHJcbiAgICAgICAgICAgIDxuZy1jb250YWluZXJcclxuICAgICAgICAgICAgICBbbmdUZW1wbGF0ZU91dGxldF09XCJzZWxlY3RlZEZpZWxkTGFiZWxcIlxyXG4gICAgICAgICAgICAgIFtuZ1RlbXBsYXRlT3V0bGV0Q29udGV4dF09XCJ7ICRpbXBsaWNpdDogcm93IH1cIlxyXG4gICAgICAgICAgICAvPlxyXG4gICAgICAgICAgICA8bWF0LWljb24gY2xhc3M9XCJkZWxldGUtaWNvblwiPmRlbGV0ZTwvbWF0LWljb24+XHJcbiAgICAgICAgICA8L2J1dHRvbj5cclxuICAgICAgICB9XHJcbiAgICAgIDwvbWF0LW1lbnU+XHJcbiAgICB9IEBlbHNlIHtcclxuICAgICAgQGlmIChzZWxlY3RlZFJvd3MoKS5sZW5ndGggPiAwKSB7XHJcbiAgICAgICAgPG1hdC1jaGlwPlxyXG4gICAgICAgICAgPG5nLWNvbnRhaW5lclxyXG4gICAgICAgICAgICBbbmdUZW1wbGF0ZU91dGxldF09XCJzZWxlY3RlZEZpZWxkTGFiZWxcIlxyXG4gICAgICAgICAgICBbbmdUZW1wbGF0ZU91dGxldENvbnRleHRdPVwieyAkaW1wbGljaXQ6IHNlbGVjdGVkUm93cygpWzBdIH1cIlxyXG4gICAgICAgICAgLz5cclxuICAgICAgICAgIDxidXR0b25cclxuICAgICAgICAgICAgbWF0Q2hpcFJlbW92ZVxyXG4gICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCJcclxuICAgICAgICAgICAgYXJpYS1sYWJlbD1cIlJlbW92ZSBzZWxlY3RlZCBpdGVtXCJcclxuICAgICAgICAgICAgKGNsaWNrKT1cIm9uUmVtb3ZlU2VsZWN0ZWRSb3coJGV2ZW50LCBzZWxlY3RlZFJvd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