sf-crud 13.1.21 → 13.1.22
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/sf-crud.mjs
CHANGED
|
@@ -72,129 +72,6 @@ import { SfPdfsignModule } from 'sf-pdfsign';
|
|
|
72
72
|
import * as i2$1 from '@angular/platform-browser';
|
|
73
73
|
import * as i4 from 'sf-ado';
|
|
74
74
|
|
|
75
|
-
class CrudConfig {
|
|
76
|
-
idEntidad = '';
|
|
77
|
-
uiEsquemas = [];
|
|
78
|
-
esquemas = [];
|
|
79
|
-
registros = [];
|
|
80
|
-
tablero;
|
|
81
|
-
}
|
|
82
|
-
class ConfigTablero {
|
|
83
|
-
columns = [];
|
|
84
|
-
endpoint = '';
|
|
85
|
-
method = '';
|
|
86
|
-
server = '';
|
|
87
|
-
filters = [];
|
|
88
|
-
keys = [];
|
|
89
|
-
createButton;
|
|
90
|
-
dialog;
|
|
91
|
-
dataKey;
|
|
92
|
-
selectionMode;
|
|
93
|
-
redirect;
|
|
94
|
-
customPaginator;
|
|
95
|
-
}
|
|
96
|
-
class ConfigRegistro {
|
|
97
|
-
operations = [];
|
|
98
|
-
btnBack = '';
|
|
99
|
-
label;
|
|
100
|
-
canBack = false;
|
|
101
|
-
constructionId;
|
|
102
|
-
keys;
|
|
103
|
-
conditions = [];
|
|
104
|
-
backWhenSubmit = false;
|
|
105
|
-
}
|
|
106
|
-
class Operation {
|
|
107
|
-
type;
|
|
108
|
-
server;
|
|
109
|
-
endpoint;
|
|
110
|
-
method = '';
|
|
111
|
-
validations;
|
|
112
|
-
url;
|
|
113
|
-
changeTrx = [];
|
|
114
|
-
errorChecking;
|
|
115
|
-
answerChecking;
|
|
116
|
-
keysEsquema;
|
|
117
|
-
keys;
|
|
118
|
-
}
|
|
119
|
-
class ConstructionId {
|
|
120
|
-
indexStep;
|
|
121
|
-
path;
|
|
122
|
-
keys;
|
|
123
|
-
}
|
|
124
|
-
class Validations {
|
|
125
|
-
type = '';
|
|
126
|
-
required = [];
|
|
127
|
-
equals = [];
|
|
128
|
-
different = [];
|
|
129
|
-
server = '';
|
|
130
|
-
endpoint = '';
|
|
131
|
-
operations;
|
|
132
|
-
}
|
|
133
|
-
class ValidationRequired {
|
|
134
|
-
field;
|
|
135
|
-
message;
|
|
136
|
-
conditions;
|
|
137
|
-
validation;
|
|
138
|
-
}
|
|
139
|
-
class ValidationEqual extends ValidationRequired {
|
|
140
|
-
value;
|
|
141
|
-
constructor(value) {
|
|
142
|
-
super();
|
|
143
|
-
this.value = value;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
class ValidationDifferent extends ValidationRequired {
|
|
147
|
-
value;
|
|
148
|
-
constructor(value) {
|
|
149
|
-
super();
|
|
150
|
-
this.value = value;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
class RequestChecking {
|
|
154
|
-
dynamics;
|
|
155
|
-
statics;
|
|
156
|
-
useSwal;
|
|
157
|
-
redirect;
|
|
158
|
-
cancelRedirect;
|
|
159
|
-
allowContinue;
|
|
160
|
-
parse;
|
|
161
|
-
constructor(dynamics, statics, useSwal, redirect, cancelRedirect, allowContinue, parse) {
|
|
162
|
-
this.dynamics = dynamics;
|
|
163
|
-
this.statics = statics;
|
|
164
|
-
this.useSwal = useSwal;
|
|
165
|
-
this.redirect = redirect;
|
|
166
|
-
this.cancelRedirect = cancelRedirect;
|
|
167
|
-
this.allowContinue = allowContinue;
|
|
168
|
-
this.parse = parse;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
class Key {
|
|
172
|
-
key;
|
|
173
|
-
scope;
|
|
174
|
-
indexAnswer;
|
|
175
|
-
indexData;
|
|
176
|
-
indexId;
|
|
177
|
-
data;
|
|
178
|
-
overrideControl;
|
|
179
|
-
}
|
|
180
|
-
class OverrideConfig {
|
|
181
|
-
property;
|
|
182
|
-
value;
|
|
183
|
-
elseValue;
|
|
184
|
-
conditions;
|
|
185
|
-
newPropertyValue;
|
|
186
|
-
elseNewPropertyValue;
|
|
187
|
-
}
|
|
188
|
-
class keyEsquema {
|
|
189
|
-
key;
|
|
190
|
-
scope;
|
|
191
|
-
indexData;
|
|
192
|
-
indexId;
|
|
193
|
-
isArray;
|
|
194
|
-
indexKey;
|
|
195
|
-
canBeValueUndefined;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
75
|
const GENERAL_CRUD_SERVICE = new InjectionToken('GENERAL_CRUD_SERVICE');
|
|
199
76
|
|
|
200
77
|
class GeneralService {
|
|
@@ -1070,11 +947,12 @@ class TableroComponent {
|
|
|
1070
947
|
user;
|
|
1071
948
|
dataExt;
|
|
1072
949
|
showCreateButton = false;
|
|
950
|
+
customConfig = false;
|
|
951
|
+
table;
|
|
1073
952
|
onSelectAction = new EventEmitter();
|
|
1074
953
|
color2;
|
|
1075
954
|
colorButtons;
|
|
1076
955
|
items = [];
|
|
1077
|
-
crudConfig = new CrudConfig();
|
|
1078
956
|
data = [];
|
|
1079
957
|
initialData = [];
|
|
1080
958
|
btn = { create: undefined, read: undefined, update: undefined, delete: undefined };
|
|
@@ -1113,7 +991,7 @@ class TableroComponent {
|
|
|
1113
991
|
this.environment = JSON.parse(sessionStorage.getItem('ConfigJSON') || '{}');
|
|
1114
992
|
}
|
|
1115
993
|
this.generalService.environment = this.environment;
|
|
1116
|
-
this.
|
|
994
|
+
this.VerifyConfigExist();
|
|
1117
995
|
}
|
|
1118
996
|
ngOnChanges(changes) {
|
|
1119
997
|
if (changes['dataExt'] && !changes['dataExt'].firstChange) {
|
|
@@ -1126,6 +1004,21 @@ class TableroComponent {
|
|
|
1126
1004
|
if (!this.customFilters)
|
|
1127
1005
|
this.initFilterOptions();
|
|
1128
1006
|
}
|
|
1007
|
+
if (changes['table'] && !changes['table'].firstChange) {
|
|
1008
|
+
this.VerifyConfigExist();
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
VerifyConfigExist() {
|
|
1012
|
+
if (this.customConfig && this.table) {
|
|
1013
|
+
console.log(this.table);
|
|
1014
|
+
this.getInfoTablero();
|
|
1015
|
+
this.loadOptions();
|
|
1016
|
+
if (!this.customFilters)
|
|
1017
|
+
this.initFilterOptions();
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
this.loadConfigCrud();
|
|
1021
|
+
}
|
|
1129
1022
|
}
|
|
1130
1023
|
loadConfigCrud() {
|
|
1131
1024
|
this.loading.inProgress = true;
|
|
@@ -1135,7 +1028,7 @@ class TableroComponent {
|
|
|
1135
1028
|
if (res) {
|
|
1136
1029
|
if (res.data)
|
|
1137
1030
|
res = res.data;
|
|
1138
|
-
this.
|
|
1031
|
+
this.table = res.tablero || undefined;
|
|
1139
1032
|
this.getInfoTablero();
|
|
1140
1033
|
this.loadOptions();
|
|
1141
1034
|
if (!this.customFilters)
|
|
@@ -1196,8 +1089,8 @@ class TableroComponent {
|
|
|
1196
1089
|
this.initialData = [];
|
|
1197
1090
|
this.totalRecords = 0;
|
|
1198
1091
|
}
|
|
1199
|
-
let url = this.aplyKeys(this.
|
|
1200
|
-
this.generalService.genericRequest(this.
|
|
1092
|
+
let url = this.aplyKeys(this.table.keys, `${this.generalService.jsonConfig[this.table.server]}${this.table.endpoint}`, this.dataExt);
|
|
1093
|
+
this.generalService.genericRequest(this.table.method, url, this.dataExt)
|
|
1201
1094
|
.then((res) => {
|
|
1202
1095
|
let aux;
|
|
1203
1096
|
if (!Array.isArray(res))
|
|
@@ -1220,13 +1113,13 @@ class TableroComponent {
|
|
|
1220
1113
|
this.totalRecords = 0;
|
|
1221
1114
|
data.forEach((item) => {
|
|
1222
1115
|
let newItem = {};
|
|
1223
|
-
this.
|
|
1116
|
+
this.table.columns.forEach(col => {
|
|
1224
1117
|
newItem[col.col] = this.getValue(col.col, item);
|
|
1225
1118
|
});
|
|
1226
|
-
if (this.
|
|
1227
|
-
newItem[this.
|
|
1119
|
+
if (this.table?.dataKey && !newItem[this.table.dataKey]) {
|
|
1120
|
+
newItem[this.table.dataKey] = item[this.table.dataKey];
|
|
1228
1121
|
}
|
|
1229
|
-
if (this.
|
|
1122
|
+
if (this.table?.customPaginator && this.totalRecords === 0 && item['TotalRecords'] !== undefined) {
|
|
1230
1123
|
this.totalRecords = item['TotalRecords'] || data.length;
|
|
1231
1124
|
}
|
|
1232
1125
|
const missingKeys = Object.keys(item).filter(key => !(key in newItem));
|
|
@@ -1243,15 +1136,15 @@ class TableroComponent {
|
|
|
1243
1136
|
this.sfCrudService.formLoading = this.loading;
|
|
1244
1137
|
}
|
|
1245
1138
|
initFilterOptions() {
|
|
1246
|
-
this.
|
|
1139
|
+
this.table?.columns.filter(col => col.filter?.config).forEach(col => this.generateFilterOptions(col));
|
|
1247
1140
|
}
|
|
1248
1141
|
verifyCreateButton() {
|
|
1249
|
-
if (this.
|
|
1250
|
-
this.showCreateButton = this.optionsMap.get(this.
|
|
1142
|
+
if (this.table?.createButton && this.table?.createButton?.verify === 'filterList') {
|
|
1143
|
+
this.showCreateButton = this.optionsMap.get(this.table.createButton.column)?.length > 0;
|
|
1251
1144
|
}
|
|
1252
1145
|
}
|
|
1253
1146
|
generateFilterOptions(col) {
|
|
1254
|
-
const url = this.aplyKeys(this.
|
|
1147
|
+
const url = this.aplyKeys(this.table.keys, `${this.generalService.jsonConfig[col.filter.config.server]}${col.filter.config.endpoint}`, this.dataExt);
|
|
1255
1148
|
this.generalService.genericRequest(col.filter.config.method, url, this.dataExt)
|
|
1256
1149
|
.then((res) => {
|
|
1257
1150
|
if (!Array.isArray(res) && res.data)
|
|
@@ -1286,13 +1179,13 @@ class TableroComponent {
|
|
|
1286
1179
|
this.router.navigateByUrl(this.btn.create?.valor?.redirect || '');
|
|
1287
1180
|
break;
|
|
1288
1181
|
case 'read':
|
|
1289
|
-
this.router.navigateByUrl(this.aplyKeys(this.
|
|
1182
|
+
this.router.navigateByUrl(this.aplyKeys(this.table.keys, this.btn.read.valor.redirect, data));
|
|
1290
1183
|
break;
|
|
1291
1184
|
case 'update':
|
|
1292
|
-
this.router.navigateByUrl(this.aplyKeys(this.
|
|
1185
|
+
this.router.navigateByUrl(this.aplyKeys(this.table.keys, this.btn.update.valor.redirect, data));
|
|
1293
1186
|
break;
|
|
1294
1187
|
case 'delete':
|
|
1295
|
-
this.router.navigateByUrl(this.aplyKeys(this.
|
|
1188
|
+
this.router.navigateByUrl(this.aplyKeys(this.table.keys, this.btn.delete.valor.redirect, data));
|
|
1296
1189
|
break;
|
|
1297
1190
|
default:
|
|
1298
1191
|
break;
|
|
@@ -1330,7 +1223,7 @@ class TableroComponent {
|
|
|
1330
1223
|
execAction(params) {
|
|
1331
1224
|
switch (params.action) {
|
|
1332
1225
|
case 'redirect':
|
|
1333
|
-
this.router.navigateByUrl(this.aplyKeys(this.
|
|
1226
|
+
this.router.navigateByUrl(this.aplyKeys(this.table.keys, params.link, this.itemSelected)).then(() => {
|
|
1334
1227
|
if (params.reload)
|
|
1335
1228
|
window.location.reload();
|
|
1336
1229
|
});
|
|
@@ -1346,20 +1239,20 @@ class TableroComponent {
|
|
|
1346
1239
|
}
|
|
1347
1240
|
showAddDialog() {
|
|
1348
1241
|
this.verifyCreateButton();
|
|
1349
|
-
if (!this.showCreateButton && this.
|
|
1350
|
-
this.dialogService.showDialog('create', this.
|
|
1242
|
+
if (!this.showCreateButton && this.table?.dialog) {
|
|
1243
|
+
this.dialogService.showDialog('create', this.table.dialog);
|
|
1351
1244
|
}
|
|
1352
1245
|
else {
|
|
1353
1246
|
this.redirect('create');
|
|
1354
1247
|
}
|
|
1355
1248
|
}
|
|
1356
1249
|
goToDetail(row) {
|
|
1357
|
-
if (this.
|
|
1358
|
-
this.router.navigateByUrl(this.aplyKeys(this.
|
|
1250
|
+
if (this.table?.redirect) {
|
|
1251
|
+
this.router.navigateByUrl(this.aplyKeys(this.table.keys, this.table.redirect, row.data));
|
|
1359
1252
|
}
|
|
1360
1253
|
}
|
|
1361
1254
|
pageChange(event) {
|
|
1362
|
-
if (this.
|
|
1255
|
+
if (this.table?.customPaginator) {
|
|
1363
1256
|
if (!this.initialLoadDone) {
|
|
1364
1257
|
return;
|
|
1365
1258
|
}
|
|
@@ -1387,12 +1280,12 @@ class TableroComponent {
|
|
|
1387
1280
|
}, 400);
|
|
1388
1281
|
}
|
|
1389
1282
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableroComponent, deps: [{ token: GeneralService }, { token: i2.Router }, { token: SfCrudService }, { token: StepService }, { token: CrudDialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1390
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TableroComponent, isStandalone: true, selector: "sf-crudtablero", inputs: { opciones: "opciones", idEntidad: "idEntidad", idKatios: "idKatios", environment: "environment", user: "user", dataExt: "dataExt", showCreateButton: "showCreateButton", optionsMap: "optionsMap", customFilters: "customFilters" }, outputs: { onSelectAction: "onSelectAction" }, host: { properties: { "style.--secondary-color": "this.color2", "style.--button-color": "this.colorButtons" } }, usesOnChanges: true, ngImport: i0, template: "<p-toolbar styleClass=\"mb-4 gap-2\" *ngIf=\"btn.create\">\r\n <ng-template #start>\r\n <button pButton pRipple [label]=\"btn.create.label\" [icon]=\"btn.create.icon\" class=\"p-button-success mr-2\"\r\n (click)=\"showAddDialog()\"></button>\r\n </ng-template>\r\n</p-toolbar>\r\n<p-table *ngIf=\"crudConfig?.tablero?.columns && initialLoadDone\" #dt [columns]=\"crudConfig.tablero.columns\" [value]=\"displayData\"\r\n [rowHover]=\"true\" [rows]=\"rowsPerPage\" [paginator]=\"true\" [totalRecords]=\"totalRecords\"\r\n [lazy]=\"crudConfig.tablero?.customPaginator || false\" [first]=\"(currentPage - 1) * rowsPerPage\"\r\n [globalFilterFields]=\"crudConfig.tablero?.filters || []\" [tableStyle]=\"{'min-width': '75rem'}\"\r\n currentPageReportTemplate=\"Registro {first} al {last} de {totalRecords}\" [showCurrentPageReport]=\"true\"\r\n [selectionMode]=\"crudConfig.tablero?.selectionMode || null\" [(selection)]=\"itemSelected\"\r\n [dataKey]=\"crudConfig.tablero?.dataKey\" (onRowSelect)=\"goToDetail($event)\" (onLazyLoad)=\"pageChange($event)\"\r\n (onPage)=\"pageChange($event)\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex flex-column justify-content-between md:flex-row md:align-items-center\">\r\n <h5 class=\"m-0\">{{crudConfig.tablero?.label || idEntidad}}</h5>\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input pInputText type=\"text\"\r\n (input)=\"crudConfig?.tablero?.customSearch ? onGlobalSearch($event) : dt.filterGlobal($event.target.value, 'contains')\"\r\n placeholder=\"Buscar...\" class=\"w-full\" [(ngModel)]=\"searchValue\" />\r\n </p-iconfield>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n <div class=\"flex align-items-center justify-between\">\r\n {{col.label}}\r\n <ng-container *ngIf=\"col.filter\" [ngSwitch]=\"col.filter.type\">\r\n <p-columnFilter *ngSwitchCase=\"'text'\" type=\"text\" [field]=\"col.filter.field\"\r\n [display]=\"col.filter.display\" [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\" />\r\n <p-columnFilter *ngSwitchCase=\"'list'\" [field]=\"col.filter.field\" [display]=\"col.filter.display\"\r\n [matchMode]=\"col.filter.matchMode || 'equals'\"\r\n [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\">\r\n <ng-template #filter let-value let-filter=\"filterCallback\">\r\n <p-select [(ngModel)]=\"value\" [options]=\"optionsMap.get(col.col) ?? []\"\r\n (onChange)=\"filter($event.value)\" placeholder=\"Seleccione\" class=\"w-full\"\r\n [optionLabel]=\"col.filter?.config?.optionLabel\"\r\n [optionValue]=\"col.filter?.config?.optionValue\" />\r\n </ng-template>\r\n </p-columnFilter>\r\n <p-columnFilter *ngSwitchCase=\"'multiselect'\" [field]=\"col.filter.field\"\r\n [display]=\"col.filter.display\" [matchMode]=\"col.filter.matchMode || 'equals'\"\r\n [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\">\r\n <ng-template #filter let-value let-filter=\"filterCallback\">\r\n <p-multiselect [(ngModel)]=\"value\" [options]=\"optionsMap.get(col.col) ?? []\"\r\n (onChange)=\"filter($event.value)\" placeholder=\"Seleccione\" class=\"w-full\"\r\n [optionLabel]=\"col.filter?.config?.optionLabel\"\r\n [optionValue]=\"col.filter?.config?.optionValue\"\r\n [panelStyle]=\"{ minWidth: '16rem' }\">\r\n </p-multiselect>\r\n </ng-template>\r\n </p-columnFilter>\r\n </ng-container>\r\n </div>\r\n </th>\r\n <th *ngIf=\"crudConfig?.tablero?.showActions\">Acci\u00F3n</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-index=\"rowIndex\">\r\n <!-- Skeleton cuando est\u00E1 cargando paginaci\u00F3n -->\r\n <tr *ngIf=\"isLoadingData\">\r\n <td *ngFor=\"let col of columns\">\r\n <p-skeleton [width]=\"col.type === 'tag' ? '6rem' : '100%'\" height=\"1.5rem\"></p-skeleton>\r\n </td>\r\n <td *ngIf=\"crudConfig?.tablero?.showActions\">\r\n <p-skeleton width=\"3rem\" height=\"2rem\" borderRadius=\"4px\"></p-skeleton>\r\n </td>\r\n </tr>\r\n <!-- Datos reales -->\r\n <tr *ngIf=\"!isLoadingData\" [pSelectableRow]=\"rowData\">\r\n <ng-container *ngFor=\"let col of columns\" [ngSwitch]=\"col.type\">\r\n <td *ngSwitchCase=\"'text'\">{{rowData[col.col]}}</td>\r\n <td *ngSwitchCase=\"'date:yyyy-mm-dd'\">{{rowData[col.col] | date: 'yyyy-MM-dd'}}</td>\r\n <td *ngSwitchCase=\"'currency:USD'\">{{rowData[col.col] | currency: 'USD'}}</td>\r\n <td *ngSwitchCase=\"'tag'\">\r\n <p-tag [value]=\"rowData[col.col]\" [ngClass]=\"rowData[col.col] ? (col.class || '') : 'hidden'\" />\r\n </td>\r\n </ng-container>\r\n <td *ngIf=\"crudConfig?.tablero?.showActions\">\r\n <p-splitButton *ngIf=\"items.length > 1\" icon=\"pi pi-align-justify\" [model]=\"items\" appendTo=\"body\"\r\n (onDropdownClick)=\"itemSelected = rowData\"></p-splitButton>\r\n <div *ngIf=\"items.length <= 1\">\r\n <button *ngFor=\"let item of items\" pButton pRipple [icon]=\"item.icon\" class=\"mr-2\"\r\n (click)=\"itemSelected = rowData; item.command()\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" *ngIf=\"!loading.inProgress\">\r\n <tr>\r\n <td [attr.colspan]=\"(crudConfig.tablero?.columns?.length || 0) + 1\" class=\"text-center\">\r\n <div class=\"text-center text-gray-500 py-5\">\r\n <p-avatar icon=\"pi pi-info\" class=\"mr-2 surface-100 text-primary\" size=\"xlarge\" shape=\"circle\" />\r\n <p>{{crudConfig.tablero?.emptyMessage || 'No se encontraron registros.'}}</p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n</p-table>\r\n", styles: ["::ng-deep .p-datatable table{min-width:100%}button:not(.p-button-success){background:var(--secondary-color)!important;border:var(--secondary-color)!important;color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i5.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i5.DatePipe, name: "date" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i8.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "component", type: i8.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i10.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: ToolbarModule }, { kind: "component", type: i12.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass", "ariaLabelledBy"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: CardModule }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i13.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i14.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i15.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i16.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: SplitButtonModule }, { kind: "component", type: i17.SplitButton, selector: "p-splitbutton, p-splitButton, p-split-button", inputs: ["model", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "icon", "iconPos", "label", "tooltip", "tooltipOptions", "style", "styleClass", "menuStyle", "menuStyleClass", "dropdownIcon", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions", "buttonProps", "menuButtonProps", "autofocus", "disabled", "tabindex", "menuButtonDisabled", "buttonDisabled"], outputs: ["onClick", "onMenuHide", "onMenuShow", "onDropdownClick"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i18.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i19.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i20.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
1283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TableroComponent, isStandalone: true, selector: "sf-crudtablero", inputs: { opciones: "opciones", idEntidad: "idEntidad", idKatios: "idKatios", environment: "environment", user: "user", dataExt: "dataExt", showCreateButton: "showCreateButton", customConfig: "customConfig", table: "table", optionsMap: "optionsMap", customFilters: "customFilters" }, outputs: { onSelectAction: "onSelectAction" }, host: { properties: { "style.--secondary-color": "this.color2", "style.--button-color": "this.colorButtons" } }, usesOnChanges: true, ngImport: i0, template: "<p-toolbar styleClass=\"mb-4 gap-2\" *ngIf=\"btn.create\">\r\n <ng-template #start>\r\n <button pButton pRipple [label]=\"btn.create.label\" [icon]=\"btn.create.icon\" class=\"p-button-success mr-2\"\r\n (click)=\"showAddDialog()\"></button>\r\n </ng-template>\r\n</p-toolbar>\r\n<p-table *ngIf=\"table?.columns && initialLoadDone\" #dt [columns]=\"table.columns\" [value]=\"displayData\"\r\n [rowHover]=\"true\" [rows]=\"rowsPerPage\" [paginator]=\"true\" [totalRecords]=\"totalRecords\"\r\n [lazy]=\"table?.customPaginator || false\" [first]=\"(currentPage - 1) * rowsPerPage\"\r\n [globalFilterFields]=\"table?.filters || []\" [tableStyle]=\"{'min-width': '75rem'}\"\r\n currentPageReportTemplate=\"Registro {first} al {last} de {totalRecords}\" [showCurrentPageReport]=\"true\"\r\n [selectionMode]=\"table?.selectionMode || null\" [(selection)]=\"itemSelected\"\r\n [dataKey]=\"table?.dataKey\" (onRowSelect)=\"goToDetail($event)\" (onLazyLoad)=\"pageChange($event)\"\r\n (onPage)=\"pageChange($event)\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex flex-column justify-content-between md:flex-row md:align-items-center\">\r\n <h5 class=\"m-0\">{{table?.label || idEntidad}}</h5>\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input pInputText type=\"text\"\r\n (input)=\"table?.customSearch ? onGlobalSearch($event) : dt.filterGlobal($event.target.value, 'contains')\"\r\n placeholder=\"Buscar...\" class=\"w-full\" [(ngModel)]=\"searchValue\" />\r\n </p-iconfield>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n <div class=\"flex align-items-center justify-between\">\r\n {{col.label}}\r\n <ng-container *ngIf=\"col.filter\" [ngSwitch]=\"col.filter.type\">\r\n <p-columnFilter *ngSwitchCase=\"'text'\" type=\"text\" [field]=\"col.filter.field\"\r\n [display]=\"col.filter.display\" [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\" />\r\n <p-columnFilter *ngSwitchCase=\"'list'\" [field]=\"col.filter.field\" [display]=\"col.filter.display\"\r\n [matchMode]=\"col.filter.matchMode || 'equals'\"\r\n [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\">\r\n <ng-template #filter let-value let-filter=\"filterCallback\">\r\n <p-select [(ngModel)]=\"value\" [options]=\"optionsMap.get(col.col) ?? []\"\r\n (onChange)=\"filter($event.value)\" placeholder=\"Seleccione\" class=\"w-full\"\r\n [optionLabel]=\"col.filter?.config?.optionLabel\"\r\n [optionValue]=\"col.filter?.config?.optionValue\" />\r\n </ng-template>\r\n </p-columnFilter>\r\n <p-columnFilter *ngSwitchCase=\"'multiselect'\" [field]=\"col.filter.field\"\r\n [display]=\"col.filter.display\" [matchMode]=\"col.filter.matchMode || 'equals'\"\r\n [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\">\r\n <ng-template #filter let-value let-filter=\"filterCallback\">\r\n <p-multiselect [(ngModel)]=\"value\" [options]=\"optionsMap.get(col.col) ?? []\"\r\n (onChange)=\"filter($event.value)\" placeholder=\"Seleccione\" class=\"w-full\"\r\n [optionLabel]=\"col.filter?.config?.optionLabel\"\r\n [optionValue]=\"col.filter?.config?.optionValue\"\r\n [panelStyle]=\"{ minWidth: '16rem' }\">\r\n </p-multiselect>\r\n </ng-template>\r\n </p-columnFilter>\r\n </ng-container>\r\n </div>\r\n </th>\r\n <th *ngIf=\"table?.showActions\">Acci\u00F3n</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-index=\"rowIndex\">\r\n <!-- Skeleton cuando est\u00E1 cargando paginaci\u00F3n -->\r\n <tr *ngIf=\"isLoadingData\">\r\n <td *ngFor=\"let col of columns\">\r\n <p-skeleton [width]=\"col.type === 'tag' ? '6rem' : '100%'\" height=\"1.5rem\"></p-skeleton>\r\n </td>\r\n <td *ngIf=\"table?.showActions\">\r\n <p-skeleton width=\"3rem\" height=\"2rem\" borderRadius=\"4px\"></p-skeleton>\r\n </td>\r\n </tr>\r\n <!-- Datos reales -->\r\n <tr *ngIf=\"!isLoadingData\" [pSelectableRow]=\"rowData\">\r\n <ng-container *ngFor=\"let col of columns\">\r\n <td>\r\n @switch (col.type) {\r\n @case('date:yyyy-mm-dd'){\r\n {{rowData[col.col] | date: 'yyyy-MM-dd'}}\r\n }\r\n @case('currency:USD'){\r\n {{rowData[col.col] | currency: 'USD'}}\r\n }\r\n @case('tag'){\r\n <p-tag [value]=\"rowData[col.col]\" [ngClass]=\"rowData[col.col] ? (col.class || '') : 'hidden'\" />\r\n }\r\n @case('icon'){\r\n <i class=\"pi\" [ngClass]=\"col.col && col.classCondition ? col.classCondition[rowData[col.col]] : col.icon ? col.icon : ''\"></i>\r\n }\r\n @default{\r\n {{rowData[col.col]}}\r\n }\r\n }\r\n </td>\r\n <!-- <td *ngSwitchCase=\"'date:yyyy-mm-dd'\">{{rowData[col.col] | date: 'yyyy-MM-dd'}}</td>\r\n <td *ngSwitchCase=\"'currency:USD'\">{{rowData[col.col] | currency: 'USD'}}</td>\r\n <td *ngSwitchCase=\"'tag'\">\r\n <p-tag [value]=\"rowData[col.col]\" [ngClass]=\"rowData[col.col] ? (col.class || '') : 'hidden'\" />\r\n </td>\r\n <td *ngSwitchCase=\"'icon'\">\r\n <i class=\"pi\" [ngClass]=\"col.col && col.classConditions ? col.classConditions[rowData[col.col]] : col.icon ? col.icon : ''\"></i>\r\n </td>\r\n <td *ngSwitchDefault>{{rowData[col.col]}}</td> -->\r\n </ng-container>\r\n <td *ngIf=\"table?.showActions\">\r\n <p-splitButton *ngIf=\"items.length > 1\" icon=\"pi pi-align-justify\" [model]=\"items\" appendTo=\"body\"\r\n (onDropdownClick)=\"itemSelected = rowData\"></p-splitButton>\r\n <div *ngIf=\"items.length <= 1\">\r\n <button *ngFor=\"let item of items\" pButton pRipple [icon]=\"item.icon\" class=\"mr-2\"\r\n (click)=\"itemSelected = rowData; item.command()\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" *ngIf=\"!loading.inProgress\">\r\n <tr>\r\n <td [attr.colspan]=\"(table?.columns?.length || 0) + 1\" class=\"text-center\">\r\n <div class=\"text-center text-gray-500 py-5\">\r\n <p-avatar icon=\"pi pi-info\" class=\"mr-2 surface-100 text-primary\" size=\"xlarge\" shape=\"circle\" />\r\n <p>{{table?.emptyMessage || 'No se encontraron registros.'}}</p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n</p-table>\r\n", styles: ["::ng-deep .p-datatable table{min-width:100%}button:not(.p-button-success){background:var(--secondary-color)!important;border:var(--secondary-color)!important;color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i5.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i5.DatePipe, name: "date" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i8.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "component", type: i8.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i10.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: ToolbarModule }, { kind: "component", type: i12.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass", "ariaLabelledBy"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: CardModule }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i13.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i14.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i15.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i16.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: SplitButtonModule }, { kind: "component", type: i17.SplitButton, selector: "p-splitbutton, p-splitButton, p-split-button", inputs: ["model", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "icon", "iconPos", "label", "tooltip", "tooltipOptions", "style", "styleClass", "menuStyle", "menuStyleClass", "dropdownIcon", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions", "buttonProps", "menuButtonProps", "autofocus", "disabled", "tabindex", "menuButtonDisabled", "buttonDisabled"], outputs: ["onClick", "onMenuHide", "onMenuShow", "onDropdownClick"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i18.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i19.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i20.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
1391
1284
|
}
|
|
1392
1285
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableroComponent, decorators: [{
|
|
1393
1286
|
type: Component,
|
|
1394
1287
|
args: [{ selector: 'sf-crudtablero', imports: [CommonModule, FormsModule, TableModule, ButtonModule, DropdownModule, InputTextModule, ToolbarModule, TooltipModule, DialogModule, CardModule, IconFieldModule, InputIconModule,
|
|
1395
|
-
SelectModule, MultiSelectModule, SplitButtonModule, TagModule, AvatarModule, SkeletonModule], standalone: true, template: "<p-toolbar styleClass=\"mb-4 gap-2\" *ngIf=\"btn.create\">\r\n <ng-template #start>\r\n <button pButton pRipple [label]=\"btn.create.label\" [icon]=\"btn.create.icon\" class=\"p-button-success mr-2\"\r\n (click)=\"showAddDialog()\"></button>\r\n </ng-template>\r\n</p-toolbar>\r\n<p-table *ngIf=\"
|
|
1288
|
+
SelectModule, MultiSelectModule, SplitButtonModule, TagModule, AvatarModule, SkeletonModule], standalone: true, template: "<p-toolbar styleClass=\"mb-4 gap-2\" *ngIf=\"btn.create\">\r\n <ng-template #start>\r\n <button pButton pRipple [label]=\"btn.create.label\" [icon]=\"btn.create.icon\" class=\"p-button-success mr-2\"\r\n (click)=\"showAddDialog()\"></button>\r\n </ng-template>\r\n</p-toolbar>\r\n<p-table *ngIf=\"table?.columns && initialLoadDone\" #dt [columns]=\"table.columns\" [value]=\"displayData\"\r\n [rowHover]=\"true\" [rows]=\"rowsPerPage\" [paginator]=\"true\" [totalRecords]=\"totalRecords\"\r\n [lazy]=\"table?.customPaginator || false\" [first]=\"(currentPage - 1) * rowsPerPage\"\r\n [globalFilterFields]=\"table?.filters || []\" [tableStyle]=\"{'min-width': '75rem'}\"\r\n currentPageReportTemplate=\"Registro {first} al {last} de {totalRecords}\" [showCurrentPageReport]=\"true\"\r\n [selectionMode]=\"table?.selectionMode || null\" [(selection)]=\"itemSelected\"\r\n [dataKey]=\"table?.dataKey\" (onRowSelect)=\"goToDetail($event)\" (onLazyLoad)=\"pageChange($event)\"\r\n (onPage)=\"pageChange($event)\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex flex-column justify-content-between md:flex-row md:align-items-center\">\r\n <h5 class=\"m-0\">{{table?.label || idEntidad}}</h5>\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input pInputText type=\"text\"\r\n (input)=\"table?.customSearch ? onGlobalSearch($event) : dt.filterGlobal($event.target.value, 'contains')\"\r\n placeholder=\"Buscar...\" class=\"w-full\" [(ngModel)]=\"searchValue\" />\r\n </p-iconfield>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n <div class=\"flex align-items-center justify-between\">\r\n {{col.label}}\r\n <ng-container *ngIf=\"col.filter\" [ngSwitch]=\"col.filter.type\">\r\n <p-columnFilter *ngSwitchCase=\"'text'\" type=\"text\" [field]=\"col.filter.field\"\r\n [display]=\"col.filter.display\" [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\" />\r\n <p-columnFilter *ngSwitchCase=\"'list'\" [field]=\"col.filter.field\" [display]=\"col.filter.display\"\r\n [matchMode]=\"col.filter.matchMode || 'equals'\"\r\n [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\">\r\n <ng-template #filter let-value let-filter=\"filterCallback\">\r\n <p-select [(ngModel)]=\"value\" [options]=\"optionsMap.get(col.col) ?? []\"\r\n (onChange)=\"filter($event.value)\" placeholder=\"Seleccione\" class=\"w-full\"\r\n [optionLabel]=\"col.filter?.config?.optionLabel\"\r\n [optionValue]=\"col.filter?.config?.optionValue\" />\r\n </ng-template>\r\n </p-columnFilter>\r\n <p-columnFilter *ngSwitchCase=\"'multiselect'\" [field]=\"col.filter.field\"\r\n [display]=\"col.filter.display\" [matchMode]=\"col.filter.matchMode || 'equals'\"\r\n [showMatchModes]=\"col.filter.showMatchModes || false\"\r\n [showOperator]=\"col.filter.showOperator || false\"\r\n [showAddButton]=\"col.filter.showAddButton || false\">\r\n <ng-template #filter let-value let-filter=\"filterCallback\">\r\n <p-multiselect [(ngModel)]=\"value\" [options]=\"optionsMap.get(col.col) ?? []\"\r\n (onChange)=\"filter($event.value)\" placeholder=\"Seleccione\" class=\"w-full\"\r\n [optionLabel]=\"col.filter?.config?.optionLabel\"\r\n [optionValue]=\"col.filter?.config?.optionValue\"\r\n [panelStyle]=\"{ minWidth: '16rem' }\">\r\n </p-multiselect>\r\n </ng-template>\r\n </p-columnFilter>\r\n </ng-container>\r\n </div>\r\n </th>\r\n <th *ngIf=\"table?.showActions\">Acci\u00F3n</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-index=\"rowIndex\">\r\n <!-- Skeleton cuando est\u00E1 cargando paginaci\u00F3n -->\r\n <tr *ngIf=\"isLoadingData\">\r\n <td *ngFor=\"let col of columns\">\r\n <p-skeleton [width]=\"col.type === 'tag' ? '6rem' : '100%'\" height=\"1.5rem\"></p-skeleton>\r\n </td>\r\n <td *ngIf=\"table?.showActions\">\r\n <p-skeleton width=\"3rem\" height=\"2rem\" borderRadius=\"4px\"></p-skeleton>\r\n </td>\r\n </tr>\r\n <!-- Datos reales -->\r\n <tr *ngIf=\"!isLoadingData\" [pSelectableRow]=\"rowData\">\r\n <ng-container *ngFor=\"let col of columns\">\r\n <td>\r\n @switch (col.type) {\r\n @case('date:yyyy-mm-dd'){\r\n {{rowData[col.col] | date: 'yyyy-MM-dd'}}\r\n }\r\n @case('currency:USD'){\r\n {{rowData[col.col] | currency: 'USD'}}\r\n }\r\n @case('tag'){\r\n <p-tag [value]=\"rowData[col.col]\" [ngClass]=\"rowData[col.col] ? (col.class || '') : 'hidden'\" />\r\n }\r\n @case('icon'){\r\n <i class=\"pi\" [ngClass]=\"col.col && col.classCondition ? col.classCondition[rowData[col.col]] : col.icon ? col.icon : ''\"></i>\r\n }\r\n @default{\r\n {{rowData[col.col]}}\r\n }\r\n }\r\n </td>\r\n <!-- <td *ngSwitchCase=\"'date:yyyy-mm-dd'\">{{rowData[col.col] | date: 'yyyy-MM-dd'}}</td>\r\n <td *ngSwitchCase=\"'currency:USD'\">{{rowData[col.col] | currency: 'USD'}}</td>\r\n <td *ngSwitchCase=\"'tag'\">\r\n <p-tag [value]=\"rowData[col.col]\" [ngClass]=\"rowData[col.col] ? (col.class || '') : 'hidden'\" />\r\n </td>\r\n <td *ngSwitchCase=\"'icon'\">\r\n <i class=\"pi\" [ngClass]=\"col.col && col.classConditions ? col.classConditions[rowData[col.col]] : col.icon ? col.icon : ''\"></i>\r\n </td>\r\n <td *ngSwitchDefault>{{rowData[col.col]}}</td> -->\r\n </ng-container>\r\n <td *ngIf=\"table?.showActions\">\r\n <p-splitButton *ngIf=\"items.length > 1\" icon=\"pi pi-align-justify\" [model]=\"items\" appendTo=\"body\"\r\n (onDropdownClick)=\"itemSelected = rowData\"></p-splitButton>\r\n <div *ngIf=\"items.length <= 1\">\r\n <button *ngFor=\"let item of items\" pButton pRipple [icon]=\"item.icon\" class=\"mr-2\"\r\n (click)=\"itemSelected = rowData; item.command()\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\" *ngIf=\"!loading.inProgress\">\r\n <tr>\r\n <td [attr.colspan]=\"(table?.columns?.length || 0) + 1\" class=\"text-center\">\r\n <div class=\"text-center text-gray-500 py-5\">\r\n <p-avatar icon=\"pi pi-info\" class=\"mr-2 surface-100 text-primary\" size=\"xlarge\" shape=\"circle\" />\r\n <p>{{table?.emptyMessage || 'No se encontraron registros.'}}</p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n</p-table>\r\n", styles: ["::ng-deep .p-datatable table{min-width:100%}button:not(.p-button-success){background:var(--secondary-color)!important;border:var(--secondary-color)!important;color:#fff}\n"] }]
|
|
1396
1289
|
}], ctorParameters: () => [{ type: GeneralService }, { type: i2.Router }, { type: SfCrudService }, { type: StepService }, { type: CrudDialogService }], propDecorators: { opciones: [{
|
|
1397
1290
|
type: Input
|
|
1398
1291
|
}], idEntidad: [{
|
|
@@ -1407,6 +1300,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
1407
1300
|
type: Input
|
|
1408
1301
|
}], showCreateButton: [{
|
|
1409
1302
|
type: Input
|
|
1303
|
+
}], customConfig: [{
|
|
1304
|
+
type: Input
|
|
1305
|
+
}], table: [{
|
|
1306
|
+
type: Input
|
|
1410
1307
|
}], onSelectAction: [{
|
|
1411
1308
|
type: Output
|
|
1412
1309
|
}], color2: [{
|
|
@@ -1421,6 +1318,129 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
1421
1318
|
type: Input
|
|
1422
1319
|
}] } });
|
|
1423
1320
|
|
|
1321
|
+
class CrudConfig {
|
|
1322
|
+
idEntidad = '';
|
|
1323
|
+
uiEsquemas = [];
|
|
1324
|
+
esquemas = [];
|
|
1325
|
+
registros = [];
|
|
1326
|
+
tablero;
|
|
1327
|
+
}
|
|
1328
|
+
class ConfigTablero {
|
|
1329
|
+
columns = [];
|
|
1330
|
+
endpoint = '';
|
|
1331
|
+
method = '';
|
|
1332
|
+
server = '';
|
|
1333
|
+
filters = [];
|
|
1334
|
+
keys = [];
|
|
1335
|
+
createButton;
|
|
1336
|
+
dialog;
|
|
1337
|
+
dataKey;
|
|
1338
|
+
selectionMode;
|
|
1339
|
+
redirect;
|
|
1340
|
+
customPaginator;
|
|
1341
|
+
}
|
|
1342
|
+
class ConfigRegistro {
|
|
1343
|
+
operations = [];
|
|
1344
|
+
btnBack = '';
|
|
1345
|
+
label;
|
|
1346
|
+
canBack = false;
|
|
1347
|
+
constructionId;
|
|
1348
|
+
keys;
|
|
1349
|
+
conditions = [];
|
|
1350
|
+
backWhenSubmit = false;
|
|
1351
|
+
}
|
|
1352
|
+
class Operation {
|
|
1353
|
+
type;
|
|
1354
|
+
server;
|
|
1355
|
+
endpoint;
|
|
1356
|
+
method = '';
|
|
1357
|
+
validations;
|
|
1358
|
+
url;
|
|
1359
|
+
changeTrx = [];
|
|
1360
|
+
errorChecking;
|
|
1361
|
+
answerChecking;
|
|
1362
|
+
keysEsquema;
|
|
1363
|
+
keys;
|
|
1364
|
+
}
|
|
1365
|
+
class ConstructionId {
|
|
1366
|
+
indexStep;
|
|
1367
|
+
path;
|
|
1368
|
+
keys;
|
|
1369
|
+
}
|
|
1370
|
+
class Validations {
|
|
1371
|
+
type = '';
|
|
1372
|
+
required = [];
|
|
1373
|
+
equals = [];
|
|
1374
|
+
different = [];
|
|
1375
|
+
server = '';
|
|
1376
|
+
endpoint = '';
|
|
1377
|
+
operations;
|
|
1378
|
+
}
|
|
1379
|
+
class ValidationRequired {
|
|
1380
|
+
field;
|
|
1381
|
+
message;
|
|
1382
|
+
conditions;
|
|
1383
|
+
validation;
|
|
1384
|
+
}
|
|
1385
|
+
class ValidationEqual extends ValidationRequired {
|
|
1386
|
+
value;
|
|
1387
|
+
constructor(value) {
|
|
1388
|
+
super();
|
|
1389
|
+
this.value = value;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
class ValidationDifferent extends ValidationRequired {
|
|
1393
|
+
value;
|
|
1394
|
+
constructor(value) {
|
|
1395
|
+
super();
|
|
1396
|
+
this.value = value;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
class RequestChecking {
|
|
1400
|
+
dynamics;
|
|
1401
|
+
statics;
|
|
1402
|
+
useSwal;
|
|
1403
|
+
redirect;
|
|
1404
|
+
cancelRedirect;
|
|
1405
|
+
allowContinue;
|
|
1406
|
+
parse;
|
|
1407
|
+
constructor(dynamics, statics, useSwal, redirect, cancelRedirect, allowContinue, parse) {
|
|
1408
|
+
this.dynamics = dynamics;
|
|
1409
|
+
this.statics = statics;
|
|
1410
|
+
this.useSwal = useSwal;
|
|
1411
|
+
this.redirect = redirect;
|
|
1412
|
+
this.cancelRedirect = cancelRedirect;
|
|
1413
|
+
this.allowContinue = allowContinue;
|
|
1414
|
+
this.parse = parse;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
class Key {
|
|
1418
|
+
key;
|
|
1419
|
+
scope;
|
|
1420
|
+
indexAnswer;
|
|
1421
|
+
indexData;
|
|
1422
|
+
indexId;
|
|
1423
|
+
data;
|
|
1424
|
+
overrideControl;
|
|
1425
|
+
}
|
|
1426
|
+
class OverrideConfig {
|
|
1427
|
+
property;
|
|
1428
|
+
value;
|
|
1429
|
+
elseValue;
|
|
1430
|
+
conditions;
|
|
1431
|
+
newPropertyValue;
|
|
1432
|
+
elseNewPropertyValue;
|
|
1433
|
+
}
|
|
1434
|
+
class keyEsquema {
|
|
1435
|
+
key;
|
|
1436
|
+
scope;
|
|
1437
|
+
indexData;
|
|
1438
|
+
indexId;
|
|
1439
|
+
isArray;
|
|
1440
|
+
indexKey;
|
|
1441
|
+
canBeValueUndefined;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1424
1444
|
class StepComponent {
|
|
1425
1445
|
router;
|
|
1426
1446
|
stepService;
|