sf-crud 12.0.1-beta45 → 12.0.1-beta46
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/bundles/sf-crud.umd.js +49 -5
- package/bundles/sf-crud.umd.js.map +1 -1
- package/esm2015/lib/components/registro/registro.component.js +25 -3
- package/esm2015/lib/components/registro-child/registro-child.component.js +23 -3
- package/esm2015/lib/components/registro-detalle/registro-detalle.component.js +2 -2
- package/esm2015/lib/sf-crud.module.js +1 -1
- package/fesm2015/sf-crud.js +47 -5
- package/fesm2015/sf-crud.js.map +1 -1
- package/lib/components/registro/registro.component.d.ts +5 -1
- package/lib/components/registro-child/registro-child.component.d.ts +5 -1
- package/package.json +1 -1
package/bundles/sf-crud.umd.js
CHANGED
|
@@ -1085,7 +1085,7 @@
|
|
|
1085
1085
|
return RegistroDetalleComponent;
|
|
1086
1086
|
}());
|
|
1087
1087
|
RegistroDetalleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroDetalleComponent, deps: [{ token: i1__namespace$1.DynamicDialogRef }, { token: i1__namespace$1.DynamicDialogConfig }, { token: i2__namespace$1.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1088
|
-
RegistroDetalleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroDetalleComponent, selector: "lib-registro-detalle", ngImport: i0__namespace, template: "<p-toast></p-toast>\n<div *ngFor=\"let element of uiEsquema.elements\" [class]=\"element?.class\" #a>\n <ng-container [ngSwitch]=\"element.type\">\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\n {{element?.label}}\n </div>\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\n <ng-container [ngSwitch]=\"el.type\">\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\n <ng-container [ngSwitch]=\"el.type\">\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Control'\">\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\n </ng-container>\n </ng-container>\n</div>\n<div class=\"card-footer mt-2\">\n <button pButton pRipple type=\"button\" label=\"Guardar\" (click)=\"submit()\" class=\"mr-2\"></button>\n <button pButton pRipple type=\"button\" label=\"Cancelar\" (click)=\"cancel()\" class=\"p-button-danger\"></button>\n</div>", styles: [""], components: [{ type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }], directives: [{ type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }] });
|
|
1088
|
+
RegistroDetalleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroDetalleComponent, selector: "lib-registro-detalle", ngImport: i0__namespace, template: "<p-toast></p-toast>\r\n<div *ngFor=\"let element of uiEsquema.elements\" [class]=\"element?.class\" #a>\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\r\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\r\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n<div class=\"card-footer mt-2\">\r\n <button pButton pRipple type=\"button\" label=\"Guardar\" (click)=\"submit()\" class=\"mr-2\"></button>\r\n <button pButton pRipple type=\"button\" label=\"Cancelar\" (click)=\"cancel()\" class=\"p-button-danger\"></button>\r\n</div>", styles: [""], components: [{ type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }], directives: [{ type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }] });
|
|
1089
1089
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroDetalleComponent, decorators: [{
|
|
1090
1090
|
type: i0.Component,
|
|
1091
1091
|
args: [{
|
|
@@ -1103,6 +1103,7 @@
|
|
|
1103
1103
|
this.dialogService = dialogService;
|
|
1104
1104
|
this.esquema = new Shema();
|
|
1105
1105
|
this.trx = 'c';
|
|
1106
|
+
this.controlsLoaded = false;
|
|
1106
1107
|
}
|
|
1107
1108
|
RegistroChildComponent.prototype.ngOnInit = function () {
|
|
1108
1109
|
var _a;
|
|
@@ -1113,6 +1114,25 @@
|
|
|
1113
1114
|
this.data = this.createObject(this.esquema);
|
|
1114
1115
|
jsonpath__namespace.value(this.data, '$..id', this.config.data.id);
|
|
1115
1116
|
}
|
|
1117
|
+
this.buildControls();
|
|
1118
|
+
};
|
|
1119
|
+
RegistroChildComponent.prototype.buildControls = function () {
|
|
1120
|
+
var _this = this;
|
|
1121
|
+
this.controlsLoaded = false;
|
|
1122
|
+
this.controls = [];
|
|
1123
|
+
this.values = [];
|
|
1124
|
+
this.uiEsquema.elements.forEach(function (layout, i) {
|
|
1125
|
+
var _a;
|
|
1126
|
+
_this.controls.push([]);
|
|
1127
|
+
_this.values.push([]);
|
|
1128
|
+
(_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element) {
|
|
1129
|
+
if (!element.scope)
|
|
1130
|
+
console.log("CONFIGURAR BIEN " + element);
|
|
1131
|
+
_this.controls[i].push(_this.getControl(element.scope));
|
|
1132
|
+
_this.values[i].push(_this.getValue(element.scope));
|
|
1133
|
+
});
|
|
1134
|
+
});
|
|
1135
|
+
this.controlsLoaded = true;
|
|
1116
1136
|
};
|
|
1117
1137
|
RegistroChildComponent.prototype.getControl = function (scope) {
|
|
1118
1138
|
return jsonpath__namespace.query(this.esquema, scope)[0];
|
|
@@ -1120,7 +1140,7 @@
|
|
|
1120
1140
|
RegistroChildComponent.prototype.getValue = function (scope) {
|
|
1121
1141
|
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
1122
1142
|
};
|
|
1123
|
-
RegistroChildComponent.prototype.setValue = function (value, scope) {
|
|
1143
|
+
RegistroChildComponent.prototype.setValue = function (value, scope, i, j) {
|
|
1124
1144
|
var _this = this;
|
|
1125
1145
|
switch (typeof (value)) {
|
|
1126
1146
|
case 'object':
|
|
@@ -1130,6 +1150,7 @@
|
|
|
1130
1150
|
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1131
1151
|
break;
|
|
1132
1152
|
default:
|
|
1153
|
+
this.values[i][j] = value;
|
|
1133
1154
|
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1134
1155
|
break;
|
|
1135
1156
|
}
|
|
@@ -1384,7 +1405,7 @@
|
|
|
1384
1405
|
return RegistroChildComponent;
|
|
1385
1406
|
}());
|
|
1386
1407
|
RegistroChildComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, deps: [{ token: i1__namespace$1.DynamicDialogRef }, { token: i1__namespace$1.DynamicDialogConfig }, { token: i2__namespace$1.MessageService }, { token: i1__namespace$1.DialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1387
|
-
RegistroChildComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroChildComponent, selector: "lib-registro-child", providers: [i2$1.MessageService, i1$1.DialogService], ngImport: i0__namespace, template: "<p-toast></p-toast>\r\n<div *ngFor=\"let element of uiEsquema.elements\" [class]=\"element?.class\" #a>\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"
|
|
1408
|
+
RegistroChildComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroChildComponent, selector: "lib-registro-child", providers: [i2$1.MessageService, i1$1.DialogService], ngImport: i0__namespace, template: "<p-toast></p-toast>\r\n<div *ngIf=\"controlsLoaded\">\r\n<div *ngFor=\"let element of uiEsquema.elements; let i = index\" [class]=\"element?.class\" #a>\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements; let j =index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\" [value]=\"values[i][j]\"\r\n (setValue)=\"setValue($event, el.scope, i, j)\" (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements; let k =index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][k]\" [label]=\"el.label\"\r\n [value]=\"values[i][k]\" (setValue)=\"setValue($event, el.scope, i, k)\"\r\n (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n <ng-container *ngSwitchCase=\"'Table'\">\r\n <p-table [value]=\"getValue(el.scope)\" [columns]=\"getControl(el.scope).config.columns\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <button pButton pRipple icon=\"pi pi-plus\" (click)=\"addObjectArray(el)\"\r\n class=\"p-button-success\"></button>\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 {{col.label}}\r\n </th>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <th></th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <ng-container *ngFor=\"let col of columns\" [ngSwitch]=\"col.type\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <td>{{rowData[col.col]}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency:USD'\">\r\n <td>{{rowData[col.col] | currency: 'USD'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:yyyy-mm-dd'\">\r\n <td>{{rowData[col.col] | date: 'yyyy-mm-dd'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:dd/mm/yyyy'\">\r\n <td>{{rowData[col.col] | date: 'dd/MM/yyyy'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <td>\r\n <i *ngIf=\"rowData[col.col]\" class=\"pi pi-check\"></i>\r\n <i *ngIf=\"!rowData[col.col]\" class=\"pi pi-times\"></i>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <td>\r\n <button pButton pRipple type=\"button\"\r\n (click)=\"editRow(el, rowData, rowIndex)\" icon=\"pi pi-pencil\"\r\n class=\"p-button-rounded p-button-info mr-1\"></button>\r\n <button pButton pRipple type=\"button\" (click)=\"deleteRow(el, rowIndex)\"\r\n icon=\"pi pi-trash\" class=\"p-button-rounded p-button-danger\"></button>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n<div class=\"card-footer mt-2\">\r\n <button pButton pRipple type=\"button\" label=\"Guardar\" (click)=\"submit()\" class=\"mr-2\"></button>\r\n <button pButton pRipple type=\"button\" label=\"Cancelar\" (click)=\"cancel()\" class=\"p-button-danger\"></button>\r\n</div>\r\n</div>\r\n", components: [{ type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }, { type: i5__namespace.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection"], outputs: ["selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }], pipes: { "currency": i7__namespace.CurrencyPipe, "date": i7__namespace.DatePipe } });
|
|
1388
1409
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, decorators: [{
|
|
1389
1410
|
type: i0.Component,
|
|
1390
1411
|
args: [{
|
|
@@ -1439,6 +1460,7 @@
|
|
|
1439
1460
|
this.enProceso = false;
|
|
1440
1461
|
this.configOperation = new Operations();
|
|
1441
1462
|
this.isLocal = false;
|
|
1463
|
+
this.controlsLoaded = false;
|
|
1442
1464
|
this.dataTemp = this.sfCrudService.getDataTemp();
|
|
1443
1465
|
}
|
|
1444
1466
|
RegistroComponent.prototype.ngOnInit = function () {
|
|
@@ -1449,6 +1471,7 @@
|
|
|
1449
1471
|
this.enProceso = true;
|
|
1450
1472
|
this.generalService.getCrudByEntidad(this.idKatios, this.idEntidad)
|
|
1451
1473
|
.then(function (res) {
|
|
1474
|
+
debugger;
|
|
1452
1475
|
_this.setDataTemp(res.esquema, _this.dataTemp);
|
|
1453
1476
|
_this.crudConfig = res;
|
|
1454
1477
|
if (_this.trx == 'c') {
|
|
@@ -1456,6 +1479,7 @@
|
|
|
1456
1479
|
_this.setLabelSumbit();
|
|
1457
1480
|
_this.enProceso = false;
|
|
1458
1481
|
_this.configOperation = _this.crudConfig.registro.operations.find(function (x) { return x.type.startsWith(_this.trx); }) || new Operations();
|
|
1482
|
+
_this.buildControls();
|
|
1459
1483
|
}
|
|
1460
1484
|
else
|
|
1461
1485
|
_this.getInfoRegistro(_this.crudConfig.registro);
|
|
@@ -1465,6 +1489,24 @@
|
|
|
1465
1489
|
_this.enProceso = false;
|
|
1466
1490
|
});
|
|
1467
1491
|
};
|
|
1492
|
+
RegistroComponent.prototype.buildControls = function () {
|
|
1493
|
+
var _this = this;
|
|
1494
|
+
this.controlsLoaded = false;
|
|
1495
|
+
this.controls = [];
|
|
1496
|
+
this.values = [];
|
|
1497
|
+
this.crudConfig.uiEsquema.elements.forEach(function (layout, i) {
|
|
1498
|
+
var _a;
|
|
1499
|
+
_this.controls.push([]);
|
|
1500
|
+
_this.values.push([]);
|
|
1501
|
+
(_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element) {
|
|
1502
|
+
if (!element.scope)
|
|
1503
|
+
console.log("CONFIGURAR BIEN " + element);
|
|
1504
|
+
_this.controls[i].push(_this.getControl(element.scope));
|
|
1505
|
+
_this.values[i].push(_this.getValue(element.scope));
|
|
1506
|
+
});
|
|
1507
|
+
});
|
|
1508
|
+
this.controlsLoaded = true;
|
|
1509
|
+
};
|
|
1468
1510
|
RegistroComponent.prototype.setLabelSumbit = function () {
|
|
1469
1511
|
if (this.trx == 'c')
|
|
1470
1512
|
this.btnSubmit = { label: 'Guardar', icon: 'pi pi-save' };
|
|
@@ -1496,6 +1538,7 @@
|
|
|
1496
1538
|
_this.data = _this.createObject(_this.crudConfig.esquema);
|
|
1497
1539
|
console.log(_this.data);
|
|
1498
1540
|
}
|
|
1541
|
+
_this.buildControls();
|
|
1499
1542
|
_this.enProceso = false;
|
|
1500
1543
|
_this.configOperation = _this.crudConfig.registro.operations.find(function (x) { return x.type.startsWith(_this.trx); }) || new Operations();
|
|
1501
1544
|
_this.setLabelSumbit();
|
|
@@ -1514,7 +1557,7 @@
|
|
|
1514
1557
|
RegistroComponent.prototype.getValue = function (scope) {
|
|
1515
1558
|
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
1516
1559
|
};
|
|
1517
|
-
RegistroComponent.prototype.setValue = function (value, scope) {
|
|
1560
|
+
RegistroComponent.prototype.setValue = function (value, scope, i, j) {
|
|
1518
1561
|
var _this = this;
|
|
1519
1562
|
switch (typeof (value)) {
|
|
1520
1563
|
case 'object':
|
|
@@ -1524,6 +1567,7 @@
|
|
|
1524
1567
|
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1525
1568
|
break;
|
|
1526
1569
|
default:
|
|
1570
|
+
this.values[i][j] = value;
|
|
1527
1571
|
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1528
1572
|
break;
|
|
1529
1573
|
}
|
|
@@ -1774,7 +1818,7 @@
|
|
|
1774
1818
|
return RegistroComponent;
|
|
1775
1819
|
}());
|
|
1776
1820
|
RegistroComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, deps: [{ token: GeneralService }, { token: i2__namespace.Router }, { token: i2__namespace$1.MessageService }, { token: i1__namespace$1.DialogService }, { token: SfCrudService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1777
|
-
RegistroComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroComponent, selector: "sf-registro", inputs: { idKatios: "idKatios", idEntidad: "idEntidad", trx: "trx", id: "id", user: "user" }, outputs: { sendData: "sendData", onSubmit: "onSubmit" }, providers: [i2$1.MessageService, i1$1.DialogService, i1$1.DynamicDialogConfig, i1$1.DynamicDialogRef], ngImport: i0__namespace, template: "<p-blockUI [blocked]=\"enProceso\">\r\n <i class=\"pi pi-cog pi-spin\" style=\"font-size: 50px\"></i>\r\n</p-blockUI>\r\n\r\n<p-toast></p-toast>\r\n\r\n<div class=\"card\" *ngIf=\"!enProceso\">\r\n <h5 class=\"card-header mb-2\" style=\"display: flex; justify-content: space-between;align-items: center;\">\r\n <span>{{crudConfig.registro?.label || idEntidad}} {{id != '' ? '-' + id : ''}}</span>\r\n <button *ngIf=\"crudConfig.registro?.canBack\" pButton pRipple type=\"button\" icon=\"pi pi-arrow-left\" (click)=\"back()\"></button>\r\n </h5>\r\n <div *ngFor=\"let element of crudConfig.uiEsquema.elements\" [class]=\"element?.class\">\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\r\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\r\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n <ng-container *ngSwitchCase=\"'Table'\">\r\n <p-table [value]=\"getValue(el.scope)\" [columns]=\"getControl(el.scope).config.columns\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <button pButton pRipple icon=\"pi pi-plus\" (click)=\"addObjectArray(el)\"\r\n class=\"p-button-success\"></button>\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 {{col.label}}\r\n </th>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <th></th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <ng-container *ngFor=\"let col of columns\" [ngSwitch]=\"col.type\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <td>{{rowData[col.col]}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency:USD'\">\r\n <td>{{rowData[col.col] | currency: 'USD'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:yyyy-mm-dd'\">\r\n <td>{{rowData[col.col] | date: 'yyyy-mm-dd'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:dd/mm/yyyy'\">\r\n <td>{{rowData[col.col] | date: 'dd/MM/yyyy'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <td>\r\n <i *ngIf=\"rowData[col.col]\" class=\"pi pi-check\"></i>\r\n <i *ngIf=\"!rowData[col.col]\" class=\"pi pi-times\"></i>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <td>\r\n <button pButton pRipple type=\"button\" (click)=\"editRow(el, rowData, rowIndex)\" icon=\"pi pi-pencil\" class=\"p-button-rounded p-button-info mr-1\"></button>\r\n <button pButton pRipple type=\"button\" (click)=\"deleteRow(el, rowIndex)\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-danger\"></button>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <div class=\"card-footer mt-2\" *ngIf=\"btnSubmit\">\r\n <button pButton pRipple type=\"button\" [icon]=\"btnSubmit.icon\" [label]=\"btnSubmit.label\"\r\n (click)=\"submit()\"></button>\r\n </div>\r\n</div>\r\n", components: [{ type: i3__namespace.BlockUI, selector: "p-blockUI", inputs: ["target", "autoZIndex", "baseZIndex", "styleClass", "blocked"] }, { type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }, { type: i5__namespace.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection"], outputs: ["selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "currency": i7__namespace.CurrencyPipe, "date": i7__namespace.DatePipe } });
|
|
1821
|
+
RegistroComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroComponent, selector: "sf-registro", inputs: { idKatios: "idKatios", idEntidad: "idEntidad", trx: "trx", id: "id", user: "user" }, outputs: { sendData: "sendData", onSubmit: "onSubmit" }, providers: [i2$1.MessageService, i1$1.DialogService, i1$1.DynamicDialogConfig, i1$1.DynamicDialogRef], ngImport: i0__namespace, template: "<p-blockUI [blocked]=\"enProceso\">\r\n <i class=\"pi pi-cog pi-spin\" style=\"font-size: 50px\"></i>\r\n</p-blockUI>\r\n\r\n<p-toast></p-toast>\r\n\r\n<div class=\"card\" *ngIf=\"!enProceso && controlsLoaded\">\r\n <h5 class=\"card-header mb-2\" style=\"display: flex; justify-content: space-between;align-items: center;\">\r\n <span>{{crudConfig.registro?.label || idEntidad}} {{id != '' ? '-' + id : ''}}</span>\r\n <button *ngIf=\"crudConfig.registro?.canBack\" pButton pRipple type=\"button\" icon=\"pi pi-arrow-left\" (click)=\"back()\"></button>\r\n </h5>\r\n <div *ngFor=\"let element of crudConfig.uiEsquema.elements; let i = index\" [class]=\"element?.class\">\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements;let j = index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\"\r\n [value]=\"values[i][j]\" (setValue)=\"setValue($event, el.scope, i, j)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements;let j = index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\"\r\n [value]=\"values[i][j]\" (setValue)=\"setValue($event, el.scope, i, j)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n <ng-container *ngSwitchCase=\"'Table'\">\r\n <p-table [value]=\"getValue(el.scope)\" [columns]=\"getControl(el.scope).config.columns\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <button pButton pRipple icon=\"pi pi-plus\" (click)=\"addObjectArray(el)\"\r\n class=\"p-button-success\"></button>\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 {{col.label}}\r\n </th>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <th></th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <ng-container *ngFor=\"let col of columns\" [ngSwitch]=\"col.type\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <td>{{rowData[col.col]}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency:USD'\">\r\n <td>{{rowData[col.col] | currency: 'USD'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:yyyy-mm-dd'\">\r\n <td>{{rowData[col.col] | date: 'yyyy-mm-dd'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:dd/mm/yyyy'\">\r\n <td>{{rowData[col.col] | date: 'dd/MM/yyyy'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <td>\r\n <i *ngIf=\"rowData[col.col]\" class=\"pi pi-check\"></i>\r\n <i *ngIf=\"!rowData[col.col]\" class=\"pi pi-times\"></i>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <td>\r\n <button pButton pRipple type=\"button\" (click)=\"editRow(el, rowData, rowIndex)\" icon=\"pi pi-pencil\" class=\"p-button-rounded p-button-info mr-1\"></button>\r\n <button pButton pRipple type=\"button\" (click)=\"deleteRow(el, rowIndex)\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-danger\"></button>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <div class=\"card-footer mt-2\" *ngIf=\"btnSubmit\">\r\n <button pButton pRipple type=\"button\" [icon]=\"btnSubmit.icon\" [label]=\"btnSubmit.label\"\r\n (click)=\"submit()\"></button>\r\n </div>\r\n</div>\r\n", components: [{ type: i3__namespace.BlockUI, selector: "p-blockUI", inputs: ["target", "autoZIndex", "baseZIndex", "styleClass", "blocked"] }, { type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }, { type: i5__namespace.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection"], outputs: ["selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "currency": i7__namespace.CurrencyPipe, "date": i7__namespace.DatePipe } });
|
|
1778
1822
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, decorators: [{
|
|
1779
1823
|
type: i0.Component,
|
|
1780
1824
|
args: [{
|