@maro-tech/card 0.2.11 → 0.2.12
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.
|
@@ -674,11 +674,13 @@ class TableComponent {
|
|
|
674
674
|
headerActionsSignal = signal([], ...(ngDevMode ? [{ debugName: "headerActionsSignal" }] : /* istanbul ignore next */ []));
|
|
675
675
|
loadingSignal = signal(false, ...(ngDevMode ? [{ debugName: "loadingSignal" }] : /* istanbul ignore next */ []));
|
|
676
676
|
errorSignal = signal('', ...(ngDevMode ? [{ debugName: "errorSignal" }] : /* istanbul ignore next */ []));
|
|
677
|
+
summarySignal = signal('', ...(ngDevMode ? [{ debugName: "summarySignal" }] : /* istanbul ignore next */ []));
|
|
677
678
|
columns = this.columnsSignal.asReadonly();
|
|
678
679
|
rows = this.rowsSignal.asReadonly();
|
|
679
680
|
headerActions = this.headerActionsSignal.asReadonly();
|
|
680
681
|
isLoading = this.loadingSignal.asReadonly();
|
|
681
682
|
error = this.errorSignal.asReadonly();
|
|
683
|
+
summary = this.summarySignal.asReadonly();
|
|
682
684
|
tableData = computed(() => ({
|
|
683
685
|
items: this.rowsSignal(),
|
|
684
686
|
pagination: this.paginationSignal(),
|
|
@@ -782,6 +784,7 @@ class TableComponent {
|
|
|
782
784
|
.filter(([id, action]) => !['create', 'edit', 'delete'].includes(id) && action && typeof action === 'object')
|
|
783
785
|
.map(([id, action]) => ({ id, ...action })));
|
|
784
786
|
this.rowsSignal.set(this.rowsFrom(view, sourceColumns));
|
|
787
|
+
this.summarySignal.set(this.rowsSignal().length > 0 ? String(view.summary?.text || '').trim() : '');
|
|
785
788
|
if (view.pagination?.sizes?.length)
|
|
786
789
|
this.pageSizeOptionsSignal.set(view.pagination.sizes);
|
|
787
790
|
this.page = view.pagination?.page ?? this.page;
|
|
@@ -797,6 +800,7 @@ class TableComponent {
|
|
|
797
800
|
this.rowsSignal.set([]);
|
|
798
801
|
this.columnsSignal.set([]);
|
|
799
802
|
this.headerActionsSignal.set([]);
|
|
803
|
+
this.summarySignal.set('');
|
|
800
804
|
this.errorSignal.set(error?.error?.message || 'Не вдалося завантажити таблицю');
|
|
801
805
|
this.loadingSignal.set(false);
|
|
802
806
|
},
|
|
@@ -933,11 +937,11 @@ class TableComponent {
|
|
|
933
937
|
return String(resolveTemplateValue(value, row, { interpolate: true }));
|
|
934
938
|
}
|
|
935
939
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
936
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: TableComponent, isStandalone: true, selector: "app-card-table", inputs: { config: "config", data: "data" }, usesOnChanges: true, ngImport: i0, template: "<section class=\"space-y-4\">\n @if (headerActions().length) {\n <div class=\"flex justify-end gap-2\">\n @for (action of headerActions(); track action.id) {\n <button type=\"button\" class=\"rounded-lg border border-slate-200 px-3 py-1.5 text-sm\" (click)=\"onHeaderAction(action)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <app-ui-table\n class=\"flex min-h-0 max-h-[80dvh] flex-col overflow-hidden\"\n [data]=\"tableData()\"\n [columns]=\"columns()\"\n [actionsPosition]=\"actionsPositionSignal()\"\n [pageSizeOptions]=\"pageSizeOptionsSignal()\"\n [isLoading]=\"isLoading()\"\n [disablePaging]=\"disablePaging\"\n (pageChange)=\"onPageChange($event)\"\n (actionClick)=\"onAction($event)\"\n (cellChange)=\"onCellChange($event)\"\n ></app-ui-table>\n</section>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: UiTableComponent, selector: "app-ui-table", inputs: ["pageSizeOptions", "actionsPosition", "columns", "isLoading", "data", "disablePaging", "rowClickable", "imageResolver"], outputs: ["pageChange", "rowClick", "actionClick", "cellChange"] }] });
|
|
940
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: TableComponent, isStandalone: true, selector: "app-card-table", inputs: { config: "config", data: "data" }, usesOnChanges: true, ngImport: i0, template: "<section class=\"space-y-4\">\n @if (headerActions().length) {\n <div class=\"flex justify-end gap-2\">\n @for (action of headerActions(); track action.id) {\n <button type=\"button\" class=\"rounded-lg border border-slate-200 px-3 py-1.5 text-sm\" (click)=\"onHeaderAction(action)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <app-ui-table\n class=\"flex min-h-0 max-h-[80dvh] flex-col overflow-hidden\"\n [data]=\"tableData()\"\n [columns]=\"columns()\"\n [actionsPosition]=\"actionsPositionSignal()\"\n [pageSizeOptions]=\"pageSizeOptionsSignal()\"\n [isLoading]=\"isLoading()\"\n [disablePaging]=\"disablePaging\"\n [summary]=\"summary()\"\n (pageChange)=\"onPageChange($event)\"\n (actionClick)=\"onAction($event)\"\n (cellChange)=\"onCellChange($event)\"\n ></app-ui-table>\n</section>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: UiTableComponent, selector: "app-ui-table", inputs: ["pageSizeOptions", "actionsPosition", "summary", "columns", "isLoading", "data", "disablePaging", "rowClickable", "imageResolver"], outputs: ["pageChange", "rowClick", "actionClick", "cellChange"] }] });
|
|
937
941
|
}
|
|
938
942
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: TableComponent, decorators: [{
|
|
939
943
|
type: Component,
|
|
940
|
-
args: [{ selector: 'app-card-table', standalone: true, imports: [CommonModule, UiTableComponent], template: "<section class=\"space-y-4\">\n @if (headerActions().length) {\n <div class=\"flex justify-end gap-2\">\n @for (action of headerActions(); track action.id) {\n <button type=\"button\" class=\"rounded-lg border border-slate-200 px-3 py-1.5 text-sm\" (click)=\"onHeaderAction(action)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <app-ui-table\n class=\"flex min-h-0 max-h-[80dvh] flex-col overflow-hidden\"\n [data]=\"tableData()\"\n [columns]=\"columns()\"\n [actionsPosition]=\"actionsPositionSignal()\"\n [pageSizeOptions]=\"pageSizeOptionsSignal()\"\n [isLoading]=\"isLoading()\"\n [disablePaging]=\"disablePaging\"\n (pageChange)=\"onPageChange($event)\"\n (actionClick)=\"onAction($event)\"\n (cellChange)=\"onCellChange($event)\"\n ></app-ui-table>\n</section>\n" }]
|
|
944
|
+
args: [{ selector: 'app-card-table', standalone: true, imports: [CommonModule, UiTableComponent], template: "<section class=\"space-y-4\">\n @if (headerActions().length) {\n <div class=\"flex justify-end gap-2\">\n @for (action of headerActions(); track action.id) {\n <button type=\"button\" class=\"rounded-lg border border-slate-200 px-3 py-1.5 text-sm\" (click)=\"onHeaderAction(action)\">\n {{ action.label }}\n </button>\n }\n </div>\n }\n\n <app-ui-table\n class=\"flex min-h-0 max-h-[80dvh] flex-col overflow-hidden\"\n [data]=\"tableData()\"\n [columns]=\"columns()\"\n [actionsPosition]=\"actionsPositionSignal()\"\n [pageSizeOptions]=\"pageSizeOptionsSignal()\"\n [isLoading]=\"isLoading()\"\n [disablePaging]=\"disablePaging\"\n [summary]=\"summary()\"\n (pageChange)=\"onPageChange($event)\"\n (actionClick)=\"onAction($event)\"\n (cellChange)=\"onCellChange($event)\"\n ></app-ui-table>\n</section>\n" }]
|
|
941
945
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
942
946
|
type: Input,
|
|
943
947
|
args: [{ required: true }]
|
|
@@ -949,6 +953,7 @@ function normalizeTableResponse(response) {
|
|
|
949
953
|
const source = (raw['config'] || raw);
|
|
950
954
|
return {
|
|
951
955
|
...source,
|
|
956
|
+
summary: raw['summary'] ?? source.summary,
|
|
952
957
|
rows: raw['rows'] ?? raw['items'] ?? source.rows ?? [],
|
|
953
958
|
pagination: {
|
|
954
959
|
page: raw['page'] ?? source.pagination?.page,
|