sf-crud 12.0.1-beta2 → 12.0.1-beta21
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 +423 -47
- package/bundles/sf-crud.umd.js.map +1 -1
- package/esm2015/lib/components/control/control.component.js +76 -7
- package/esm2015/lib/components/registro/registro.component.js +125 -19
- package/esm2015/lib/components/registro-child/registro-child.component.js +137 -0
- package/esm2015/lib/components/tablero/tablero.component.js +3 -3
- package/esm2015/lib/sf-crud.module.js +28 -12
- package/esm2015/lib/shared/services/models/crud-config.model.js +1 -1
- package/esm2015/lib/shared/services/models/shema.model.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/sf-crud.js +343 -32
- package/fesm2015/sf-crud.js.map +1 -1
- package/lib/components/control/control.component.d.ts +10 -1
- package/lib/components/registro/registro.component.d.ts +17 -7
- package/lib/components/registro-child/registro-child.component.d.ts +26 -0
- package/lib/components/tablero/tablero.component.d.ts +1 -1
- package/lib/sf-crud.module.d.ts +76 -73
- package/lib/shared/services/models/crud-config.model.d.ts +2 -0
- package/lib/shared/services/models/shema.model.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/bundles/sf-crud.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/router'), require('primeng/blockui'), require('primeng/toolbar'), require('primeng/table'), require('@angular/common'), require('primeng/api'), require('primeng/button'), require('primeng/ripple'), require('primeng/inputtext'), require('primeng/tooltip'), require('jsonpath'), require('primeng/toast'), require('primeng/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('sf-crud', ['exports', '@angular/core', '@angular/common/http', '@angular/router', 'primeng/blockui', 'primeng/toolbar', 'primeng/table', '@angular/common', 'primeng/api', 'primeng/button', 'primeng/ripple', 'primeng/inputtext', 'primeng/tooltip', 'jsonpath', 'primeng/toast', 'primeng/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["sf-crud"] = {}, global.ng.core, global.ng.common.http, global.ng.router, global.i3, global.i4, global.i5, global.ng.common, global.i3$1, global.i8, global.i9, global.i10, global.i11, global.jsonpath, global.i5$1, global.
|
|
5
|
-
})(this, (function (exports, i0, i1, i2, i3, i4, i5,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/router'), require('primeng/blockui'), require('primeng/toolbar'), require('primeng/table'), require('@angular/common'), require('primeng/api'), require('primeng/button'), require('primeng/ripple'), require('primeng/inputtext'), require('primeng/tooltip'), require('primeng/dynamicdialog'), require('jsonpath'), require('primeng/toast'), require('primeng/inputmask'), require('primeng/dropdown'), require('primeng/autocomplete'), require('primeng/calendar'), require('primeng/inputnumber'), require('primeng/fileupload'), require('@angular/forms'), require('primeng/accordion'), require('primeng/avatargroup'), require('primeng/avatar'), require('primeng/badge'), require('primeng/breadcrumb'), require('primeng/card'), require('primeng/carousel'), require('primeng/cascadeselect'), require('primeng/checkbox'), require('primeng/chip'), require('primeng/chips'), require('primeng/codehighlighter'), require('primeng/colorpicker'), require('primeng/confirmdialog'), require('primeng/confirmpopup'), require('primeng/contextmenu'), require('primeng/dialog'), require('primeng/divider'), require('primeng/fieldset'), require('primeng/galleria'), require('primeng/inplace'), require('primeng/inputswitch'), require('primeng/inputtextarea'), require('primeng/knob'), require('primeng/lightbox'), require('primeng/listbox'), require('primeng/megamenu'), require('primeng/menubar'), require('primeng/menu'), require('primeng/message'), require('primeng/messages'), require('primeng/multiselect'), require('primeng/organizationchart'), require('primeng/overlaypanel'), require('primeng/panelmenu'), require('primeng/panel'), require('primeng/password'), require('primeng/progressbar'), require('primeng/radiobutton'), require('primeng/rating'), require('primeng/scrollpanel'), require('primeng/scrolltop'), require('primeng/selectbutton'), require('primeng/sidebar'), require('primeng/skeleton'), require('primeng/slidemenu'), require('primeng/slider'), require('primeng/splitter'), require('primeng/steps'), require('primeng/tabmenu'), require('primeng/tabview'), require('primeng/tag'), require('primeng/terminal'), require('primeng/tieredmenu'), require('primeng/timeline'), require('primeng/togglebutton'), require('primeng/tree')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('sf-crud', ['exports', '@angular/core', '@angular/common/http', '@angular/router', 'primeng/blockui', 'primeng/toolbar', 'primeng/table', '@angular/common', 'primeng/api', 'primeng/button', 'primeng/ripple', 'primeng/inputtext', 'primeng/tooltip', 'primeng/dynamicdialog', 'jsonpath', 'primeng/toast', 'primeng/inputmask', 'primeng/dropdown', 'primeng/autocomplete', 'primeng/calendar', 'primeng/inputnumber', 'primeng/fileupload', '@angular/forms', 'primeng/accordion', 'primeng/avatargroup', 'primeng/avatar', 'primeng/badge', 'primeng/breadcrumb', 'primeng/card', 'primeng/carousel', 'primeng/cascadeselect', 'primeng/checkbox', 'primeng/chip', 'primeng/chips', 'primeng/codehighlighter', 'primeng/colorpicker', 'primeng/confirmdialog', 'primeng/confirmpopup', 'primeng/contextmenu', 'primeng/dialog', 'primeng/divider', 'primeng/fieldset', 'primeng/galleria', 'primeng/inplace', 'primeng/inputswitch', 'primeng/inputtextarea', 'primeng/knob', 'primeng/lightbox', 'primeng/listbox', 'primeng/megamenu', 'primeng/menubar', 'primeng/menu', 'primeng/message', 'primeng/messages', 'primeng/multiselect', 'primeng/organizationchart', 'primeng/overlaypanel', 'primeng/panelmenu', 'primeng/panel', 'primeng/password', 'primeng/progressbar', 'primeng/radiobutton', 'primeng/rating', 'primeng/scrollpanel', 'primeng/scrolltop', 'primeng/selectbutton', 'primeng/sidebar', 'primeng/skeleton', 'primeng/slidemenu', 'primeng/slider', 'primeng/splitter', 'primeng/steps', 'primeng/tabmenu', 'primeng/tabview', 'primeng/tag', 'primeng/terminal', 'primeng/tieredmenu', 'primeng/timeline', 'primeng/togglebutton', 'primeng/tree'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["sf-crud"] = {}, global.ng.core, global.ng.common.http, global.ng.router, global.i3, global.i4, global.i5, global.ng.common, global.i3$1, global.i8, global.i9, global.i10, global.i11, global.i1$1, global.jsonpath, global.i3$3, global.i2$1, global.i3$2, global.i4$1, global.i5$1, global.i6$1, global.i7, global.ng.forms, global.accordion, global.avatargroup, global.avatar, global.badge, global.breadcrumb, global.card, global.carousel, global.cascadeselect, global.checkbox, global.chip, global.chips, global.codehighlighter, global.colorpicker, global.confirmdialog, global.confirmpopup, global.contextmenu, global.dialog, global.divider, global.fieldset, global.galleria, global.inplace, global.inputswitch, global.inputtextarea, global.knob, global.lightbox, global.listbox, global.megamenu, global.menubar, global.menu, global.message, global.messages, global.multiselect, global.organizationchart, global.overlaypanel, global.panelmenu, global.panel, global.password, global.progressbar, global.radiobutton, global.rating, global.scrollpanel, global.scrolltop, global.selectbutton, global.sidebar, global.skeleton, global.slidemenu, global.slider, global.splitter, global.steps, global.tabmenu, global.tabview, global.tag, global.terminal, global.tieredmenu, global.timeline, global.togglebutton, global.tree));
|
|
5
|
+
})(this, (function (exports, i0, i1, i2, i3, i4, i5, i6, i3$1, i8, i9, i10, i11, i1$1, jsonpath, i3$3, i2$1, i3$2, i4$1, i5$1, i6$1, i7, i9$1, accordion, avatargroup, avatar, badge, breadcrumb, card, carousel, cascadeselect, checkbox, chip, chips, codehighlighter, colorpicker, confirmdialog, confirmpopup, contextmenu, dialog, divider, fieldset, galleria, inplace, inputswitch, inputtextarea, knob, lightbox, listbox, megamenu, menubar, menu, message, messages, multiselect, organizationchart, overlaypanel, panelmenu, panel, password, progressbar, radiobutton, rating, scrollpanel, scrolltop, selectbutton, sidebar, skeleton, slidemenu, slider, splitter, steps, tabmenu, tabview, tag, terminal, tieredmenu, timeline, togglebutton, tree) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -28,16 +28,22 @@
|
|
|
28
28
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
29
29
|
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
30
30
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
31
|
-
var
|
|
31
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
32
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
33
33
|
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
34
34
|
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
35
35
|
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
36
36
|
var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
|
|
37
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
37
38
|
var jsonpath__namespace = /*#__PURE__*/_interopNamespace(jsonpath);
|
|
38
|
-
var
|
|
39
|
+
var i3__namespace$3 = /*#__PURE__*/_interopNamespace(i3$3);
|
|
39
40
|
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
41
|
+
var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
|
|
40
42
|
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
43
|
+
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
44
|
+
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
45
|
+
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
46
|
+
var i9__namespace$1 = /*#__PURE__*/_interopNamespace(i9$1);
|
|
41
47
|
|
|
42
48
|
var Shema = /** @class */ (function () {
|
|
43
49
|
function Shema() {
|
|
@@ -161,6 +167,64 @@
|
|
|
161
167
|
function __param(paramIndex, decorator) {
|
|
162
168
|
return function (target, key) { decorator(target, key, paramIndex); };
|
|
163
169
|
}
|
|
170
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
171
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
172
|
+
throw new TypeError("Function expected"); return f; }
|
|
173
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
174
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
175
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
176
|
+
var _, done = false;
|
|
177
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
178
|
+
var context = {};
|
|
179
|
+
for (var p in contextIn)
|
|
180
|
+
context[p] = p === "access" ? {} : contextIn[p];
|
|
181
|
+
for (var p in contextIn.access)
|
|
182
|
+
context.access[p] = contextIn.access[p];
|
|
183
|
+
context.addInitializer = function (f) { if (done)
|
|
184
|
+
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
185
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
186
|
+
if (kind === "accessor") {
|
|
187
|
+
if (result === void 0)
|
|
188
|
+
continue;
|
|
189
|
+
if (result === null || typeof result !== "object")
|
|
190
|
+
throw new TypeError("Object expected");
|
|
191
|
+
if (_ = accept(result.get))
|
|
192
|
+
descriptor.get = _;
|
|
193
|
+
if (_ = accept(result.set))
|
|
194
|
+
descriptor.set = _;
|
|
195
|
+
if (_ = accept(result.init))
|
|
196
|
+
initializers.push(_);
|
|
197
|
+
}
|
|
198
|
+
else if (_ = accept(result)) {
|
|
199
|
+
if (kind === "field")
|
|
200
|
+
initializers.push(_);
|
|
201
|
+
else
|
|
202
|
+
descriptor[key] = _;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (target)
|
|
206
|
+
Object.defineProperty(target, contextIn.name, descriptor);
|
|
207
|
+
done = true;
|
|
208
|
+
}
|
|
209
|
+
;
|
|
210
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
211
|
+
var useValue = arguments.length > 2;
|
|
212
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
213
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
214
|
+
}
|
|
215
|
+
return useValue ? value : void 0;
|
|
216
|
+
}
|
|
217
|
+
;
|
|
218
|
+
function __propKey(x) {
|
|
219
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
220
|
+
}
|
|
221
|
+
;
|
|
222
|
+
function __setFunctionName(f, name, prefix) {
|
|
223
|
+
if (typeof name === "symbol")
|
|
224
|
+
name = name.description ? "[".concat(name.description, "]") : "";
|
|
225
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
226
|
+
}
|
|
227
|
+
;
|
|
164
228
|
function __metadata(metadataKey, metadataValue) {
|
|
165
229
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
166
230
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -192,7 +256,7 @@
|
|
|
192
256
|
function step(op) {
|
|
193
257
|
if (f)
|
|
194
258
|
throw new TypeError("Generator is already executing.");
|
|
195
|
-
while (_)
|
|
259
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
196
260
|
try {
|
|
197
261
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
198
262
|
return t;
|
|
@@ -360,7 +424,7 @@
|
|
|
360
424
|
function __asyncDelegator(o) {
|
|
361
425
|
var i, p;
|
|
362
426
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
363
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
427
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
364
428
|
}
|
|
365
429
|
function __asyncValues(o) {
|
|
366
430
|
if (!Symbol.asyncIterator)
|
|
@@ -520,7 +584,7 @@
|
|
|
520
584
|
this.btn.update = this.opciones.find(function (x) { return x.label == 'Editar'; });
|
|
521
585
|
this.btn.delete = this.opciones.find(function (x) { return x.label == 'Eliminar'; });
|
|
522
586
|
};
|
|
523
|
-
TableroComponent.prototype.redirect = function (
|
|
587
|
+
TableroComponent.prototype.redirect = function (accion, data) {
|
|
524
588
|
var _a, _b;
|
|
525
589
|
switch (accion) {
|
|
526
590
|
case 'create':
|
|
@@ -542,7 +606,7 @@
|
|
|
542
606
|
return TableroComponent;
|
|
543
607
|
}());
|
|
544
608
|
TableroComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TableroComponent, deps: [{ token: GeneralService }, { token: i2__namespace.Router }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
545
|
-
TableroComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TableroComponent, selector: "sf-crudtablero", inputs: { opciones: "opciones", idEntidad: "idEntidad", idKatios: "idKatios" }, 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<div class=\"card\" *ngIf=\"!enProceso\">\r\n <p-toolbar styleClass=\"mb-4 gap-2\">\r\n <ng-template pTemplate=\"left\">\r\n <button *ngIf=\"btn.create\" pButton pRipple [label]=\"btn.create.label\" [icon]=\"btn.create.icon\"\r\n class=\"p-button-success mr-2\" (click)=\"redirect(
|
|
609
|
+
TableroComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TableroComponent, selector: "sf-crudtablero", inputs: { opciones: "opciones", idEntidad: "idEntidad", idKatios: "idKatios" }, 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<div class=\"card\" *ngIf=\"!enProceso\">\r\n <p-toolbar styleClass=\"mb-4 gap-2\">\r\n <ng-template pTemplate=\"left\">\r\n <button *ngIf=\"btn.create\" pButton pRipple [label]=\"btn.create.label\" [icon]=\"btn.create.icon\"\r\n class=\"p-button-success mr-2\" (click)=\"redirect('create')\"></button>\r\n </ng-template>\r\n </p-toolbar>\r\n <p-table #dt [columns]=\"crudConfig.tablero.columns\" [value]=\"data\" [rowHover]=\"true\" [rows]=\"10\" [paginator]=\"true\"\r\n [globalFilterFields]=\"crudConfig.tablero?.filters || []\" [tableStyle]=\"{'min-width': '75rem'}\"\r\n currentPageReportTemplate=\"Registro {first} al {last} de {totalRecords} {{idEntidad}}\"\r\n [showCurrentPageReport]=\"true\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <h5 class=\"m-0\">{{idEntidad}}</h5>\r\n <span class=\"p-input-icon-left\">\r\n <i class=\"pi pi-search\"></i>\r\n <input pInputText type=\"text\" (input)=\"dt.filterGlobal($event.target.value, 'contains')\"\r\n placeholder=\"Buscar...\" />\r\n </span>\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 <th>Acci\u00F3n</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\r\n <tr>\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 </ng-container>\r\n <th>\r\n <button *ngIf=\"btn.read\" pButton pRipple [pTooltip]=\"btn.read.label\" [icon]=\"btn.read.icon\"\r\n class=\"p-button-rounded p-button-info mr-2\" (click)=\"redirect('read', rowData)\"></button>\r\n <button *ngIf=\"btn.update\" pButton pRipple [pTooltip]=\"btn.update.label\" [icon]=\"btn.update.icon\"\r\n class=\"p-button-rounded p-button-warning mr-2\" (click)=\"redirect('update', rowData)\"></button>\r\n <button *ngIf=\"btn.delete\" pButton pRipple [pTooltip]=\"btn.delete.label\" [icon]=\"btn.delete.icon\"\r\n class=\"p-button-rounded p-button-danger mr-2\" (click)=\"redirect('delete', rowData)\"></button>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>", components: [{ type: i3__namespace.BlockUI, selector: "p-blockUI", inputs: ["target", "autoZIndex", "baseZIndex", "styleClass", "blocked"] }, { type: i4__namespace.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { 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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i8__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9__namespace.Ripple, selector: "[pRipple]" }, { type: i10__namespace.InputText, selector: "[pInputText]" }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i11__namespace.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "date": i6__namespace.DatePipe, "currency": i6__namespace.CurrencyPipe } });
|
|
546
610
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TableroComponent, decorators: [{
|
|
547
611
|
type: i0.Component,
|
|
548
612
|
args: [{
|
|
@@ -563,17 +627,47 @@
|
|
|
563
627
|
this.control = new Shema();
|
|
564
628
|
this.label = '';
|
|
565
629
|
this.setValue = new i0.EventEmitter();
|
|
630
|
+
this.sendNotification = new i0.EventEmitter();
|
|
566
631
|
this.isLoading = false;
|
|
567
632
|
this.dataFromService = [];
|
|
633
|
+
this.uploadedFiles = [];
|
|
634
|
+
this.displayAdd = false;
|
|
568
635
|
}
|
|
569
636
|
ControlComponent.prototype.ngOnInit = function () {
|
|
570
637
|
var _a;
|
|
571
|
-
if ((_a = this.control) === null || _a === void 0 ? void 0 : _a.config)
|
|
638
|
+
if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.config) && this.control.subtype == 'dropdown')
|
|
572
639
|
this.loadDataFromService();
|
|
573
640
|
};
|
|
574
641
|
ControlComponent.prototype.sendValue = function () {
|
|
575
642
|
this.setValue.emit(this.value);
|
|
576
643
|
};
|
|
644
|
+
ControlComponent.prototype.sendValueFromObject = function (event) {
|
|
645
|
+
switch (typeof (this.control.config.optionValue)) {
|
|
646
|
+
case 'object':
|
|
647
|
+
this.control.config.optionValue.forEach(function (op) { return op['value'] = event[op.key]; });
|
|
648
|
+
this.setValue.emit(this.control.config.optionValue);
|
|
649
|
+
break;
|
|
650
|
+
default:
|
|
651
|
+
this.setValue.emit(event[this.control.config.optionValue]);
|
|
652
|
+
break;
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
ControlComponent.prototype.validateValue = function (type) {
|
|
656
|
+
switch (type) {
|
|
657
|
+
case 'email':
|
|
658
|
+
var regex = new RegExp(/([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/igm);
|
|
659
|
+
if (regex.test(this.value))
|
|
660
|
+
this.sendValue();
|
|
661
|
+
else {
|
|
662
|
+
this.value = null;
|
|
663
|
+
this.sendValue();
|
|
664
|
+
this.sendNotification.emit({ severity: 'warn', detail: 'El correo no es válido' });
|
|
665
|
+
}
|
|
666
|
+
break;
|
|
667
|
+
default:
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
};
|
|
577
671
|
ControlComponent.prototype.loadDataFromService = function () {
|
|
578
672
|
var _this = this;
|
|
579
673
|
this.isLoading = true;
|
|
@@ -583,10 +677,41 @@
|
|
|
583
677
|
_this.isLoading = false;
|
|
584
678
|
});
|
|
585
679
|
};
|
|
680
|
+
ControlComponent.prototype.loadDataFromControlBusquedaService = function (event) {
|
|
681
|
+
var _this = this;
|
|
682
|
+
this.isLoading = true;
|
|
683
|
+
this.generalService.genericRequest(this.control.config.method, this.control.config.server, this.control.config.endpoint.replace('@query', (event === null || event === void 0 ? void 0 : event.query) || ''))
|
|
684
|
+
.then(function (res) {
|
|
685
|
+
_this.dataFromService = res.data;
|
|
686
|
+
_this.isLoading = false;
|
|
687
|
+
});
|
|
688
|
+
};
|
|
689
|
+
ControlComponent.prototype.onUpload = function (event) {
|
|
690
|
+
var _this = this;
|
|
691
|
+
var file = event.files[0];
|
|
692
|
+
var formData = new FormData();
|
|
693
|
+
var path = 'Imagenes/CRUD/temp';
|
|
694
|
+
formData.append('uploadFile', file);
|
|
695
|
+
formData.append('Ruta', "/" + path);
|
|
696
|
+
this.isLoading = true;
|
|
697
|
+
this.generalService.genericRequest(this.control.config.method, this.control.config.server, this.control.config.endpoint, formData)
|
|
698
|
+
.then(function () {
|
|
699
|
+
_this.sendNotification.emit({ severity: 'info', detail: "Archivo cargado correctamente!" });
|
|
700
|
+
_this.uploadedFiles.push(file);
|
|
701
|
+
_this.isLoading = false;
|
|
702
|
+
_this.value = "" + _this.generalService.jsonConfig.Server + path + "/" + file.name;
|
|
703
|
+
_this.sendValue();
|
|
704
|
+
})
|
|
705
|
+
.catch(function (err) {
|
|
706
|
+
console.log(err);
|
|
707
|
+
_this.isLoading = false;
|
|
708
|
+
_this.sendNotification.emit({ severity: 'error', detail: "Error al cargar el archivo!" });
|
|
709
|
+
});
|
|
710
|
+
};
|
|
586
711
|
return ControlComponent;
|
|
587
712
|
}());
|
|
588
713
|
ControlComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, deps: [{ token: GeneralService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
589
|
-
ControlComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ControlComponent, selector: "sf-control", inputs: { control: "control", label: "label", value: "value" }, outputs: { setValue: "setValue" }, ngImport: i0__namespace, template: "<ng-container [ngSwitch]=\"control.type\">\r\n <ng-container *ngSwitchCase=\"'string'\">\r\n <label>{{label}}</label>\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'input'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\"\r\n placeholder=\"Seleccione una opci\u00F3n\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\"\r\n [optionLabel]=\"control.config.optionLabel\" [optionValue]=\"control.config.optionValue\"\r\n placeholder=\"Seleccione una opci\u00F3n\"></p-dropdown>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>", components: [{ type: i2__namespace$1.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "resetFilterOnHide", "dropdownIcon", "optionGroupChildren", "autoDisplayFirst", "emptyFilterMessage", "emptyMessage", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "autofocusFilter", "disabled", "options", "filterValue", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "group", "showClear", "virtualScroll", "itemSize", "ariaFilterLabel", "ariaLabelledBy", "maxlength", "tooltipStyleClass"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide"] }], directives: [{ type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4__namespace$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]" }, { type: i10__namespace.InputText, selector: "[pInputText]" }, { type: i4__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
714
|
+
ControlComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ControlComponent, selector: "sf-control", inputs: { control: "control", label: "label", value: "value", appendTo: "appendTo" }, outputs: { setValue: "setValue", sendNotification: "sendNotification" }, ngImport: i0__namespace, template: "<!-- <p-blockUI [blocked]=\"isLoading\" [target]=\"cc\">\r\n <i class=\"pi pi-cog pi-spin\" style=\"font-size: 50px\"></i>\r\n</p-blockUI> -->\r\n\r\n<ng-container [ngSwitch]=\"control.type\">\r\n <label>{{label}}</label>\r\n <ng-container *ngSwitchCase=\"'string'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'input'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'email'\">\r\n <input pInputText type=\"text\" [(ngModel)]=\"value\" placeholder=\"email@example.com\"\r\n (focusout)=\"validateValue('email')\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'phone'\">\r\n <p-inputMask mask=\"(999) 999-9999\" [(ngModel)]=\"value\" placeholder=\"(999) 999-9999\"\r\n (focusout)=\"sendValue()\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" [appendTo]=\"appendTo\"\r\n placeholder=\"Seleccione una opci\u00F3n\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\"\r\n [optionLabel]=\"control.config.optionLabel\" [optionValue]=\"control.config.optionValue\"\r\n [appendTo]=\"appendTo\" placeholder=\"Seleccione una opci\u00F3n\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'autocomplete'\">\r\n <p-autoComplete [showEmptyMessage]=\"true\" [suggestions]=\"dataFromService\" [appendTo]=\"appendTo\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [field]=\"control.field\"\r\n [minLength]=\"1\" (onSelect)=\"sendValueFromObject($event)\"></p-autoComplete>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'calendar'\">\r\n <p-calendar [(ngModel)]=\"value\" (onSelect)=\"sendValue()\" [monthNavigator]=\"true\" [yearNavigator]=\"true\"\r\n yearRange=\"1900:2035\" [dateFormat]=\"control?.format || 'yy-mm-dd'\" [appendTo]=\"appendTo\"></p-calendar>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'numeric'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <p-inputNumber [(ngModel)]=\"value\" mode=\"currency\" [minFractionDigits]=\"control?.minFractionDigits || 0\"\r\n [min]=\"control?.min || null\" [max]=\"control?.max || null\" (focusout)=\"sendValue()\"\r\n [currency]=\"control?.currency || 'USD'\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal'\">\r\n <p-inputNumber [(ngModel)]=\"value\" mode=\"decimal\" (focusout)=\"sendValue()\" [min]=\"control?.min || null\"\r\n [max]=\"control?.max || null\" [minFractionDigits]=\"control?.minFractionDigits || 0\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'percentage'\">\r\n <p-inputNumber [(ngModel)]=\"value\" suffix=\" %\" (focusout)=\"sendValue()\" [min]=\"control?.min || null\"\r\n [max]=\"control?.max || null\" [minFractionDigits]=\"control?.minFractionDigits || 2\"></p-inputNumber>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'file'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'filetmp'\">\r\n <p-fileUpload [accept]=\"control.config.accept\" [customUpload]=\"true\" (uploadHandler)=\"onUpload($event)\"\r\n [maxFileSize]=\"control.config?.maxFileSize || null\" fileLimit=\"1\">\r\n <ng-template pTemplate=\"content\">\r\n <ul *ngIf=\"uploadedFiles.length\">\r\n <li *ngFor=\"let file of uploadedFiles\">{{file.name}} - {{file.size}} bytes</li>\r\n </ul>\r\n </ng-template>\r\n </p-fileUpload>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>", components: [{ type: i2__namespace$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }, { type: i3__namespace$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide"] }, { type: i4__namespace$1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "virtualScroll", "itemSize", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "field", "scrollHeight", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide"] }, { type: i5__namespace$1.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "numberOfMonths", "view", "touchUI", "timeSeparator", "focusTrap", "firstDayOfWeek", "showTransitionOptions", "hideTransitionOptions", "tabindex", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6__namespace$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "step", "inputStyle", "inputStyleClass", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i7__namespace.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler"] }], directives: [{ type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__namespace$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]" }, { type: i10__namespace.InputText, selector: "[pInputText]" }, { type: i9__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
590
715
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, decorators: [{
|
|
591
716
|
type: i0.Component,
|
|
592
717
|
args: [{
|
|
@@ -599,22 +724,157 @@
|
|
|
599
724
|
type: i0.Input
|
|
600
725
|
}], value: [{
|
|
601
726
|
type: i0.Input
|
|
727
|
+
}], appendTo: [{
|
|
728
|
+
type: i0.Input
|
|
602
729
|
}], setValue: [{
|
|
603
730
|
type: i0.Output
|
|
731
|
+
}], sendNotification: [{
|
|
732
|
+
type: i0.Output
|
|
604
733
|
}] } });
|
|
605
734
|
|
|
735
|
+
var RegistroChildComponent = /** @class */ (function () {
|
|
736
|
+
function RegistroChildComponent(ref, config, messageService) {
|
|
737
|
+
this.ref = ref;
|
|
738
|
+
this.config = config;
|
|
739
|
+
this.messageService = messageService;
|
|
740
|
+
this.esquema = new Shema();
|
|
741
|
+
}
|
|
742
|
+
RegistroChildComponent.prototype.ngOnInit = function () {
|
|
743
|
+
var _a;
|
|
744
|
+
this.uiEsquema = this.config.data.uiEsquema[0];
|
|
745
|
+
this.esquema = this.config.data.esquema;
|
|
746
|
+
this.data = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.data;
|
|
747
|
+
if (!this.data) {
|
|
748
|
+
this.data = this.createObject(this.esquema);
|
|
749
|
+
this.setValue(this.config.data.id, '$..id');
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
RegistroChildComponent.prototype.getControl = function (scope) {
|
|
753
|
+
return jsonpath__namespace.query(this.esquema, scope)[0];
|
|
754
|
+
};
|
|
755
|
+
RegistroChildComponent.prototype.getValue = function (scope) {
|
|
756
|
+
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
757
|
+
};
|
|
758
|
+
RegistroChildComponent.prototype.setValue = function (value, scope) {
|
|
759
|
+
var _this = this;
|
|
760
|
+
switch (typeof (value)) {
|
|
761
|
+
case 'object':
|
|
762
|
+
value.forEach(function (val) { return jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value); });
|
|
763
|
+
break;
|
|
764
|
+
default:
|
|
765
|
+
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
RegistroChildComponent.prototype.createObject = function (esquema) {
|
|
770
|
+
var object = {};
|
|
771
|
+
switch (esquema.type) {
|
|
772
|
+
case 'numeric':
|
|
773
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
774
|
+
case 'string':
|
|
775
|
+
case 'date':
|
|
776
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
777
|
+
case 'boolean':
|
|
778
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
779
|
+
case 'file':
|
|
780
|
+
return null;
|
|
781
|
+
case 'array':
|
|
782
|
+
case 'object':
|
|
783
|
+
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
784
|
+
Object.defineProperty(object, key, { value: this.createObject(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
785
|
+
}
|
|
786
|
+
break;
|
|
787
|
+
default:
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
return object;
|
|
791
|
+
};
|
|
792
|
+
RegistroChildComponent.prototype.setDefaultValue = function (value) {
|
|
793
|
+
var data = null;
|
|
794
|
+
var uactivo;
|
|
795
|
+
switch (value) {
|
|
796
|
+
case '@uactivo':
|
|
797
|
+
uactivo = JSON.parse(localStorage.getItem('oSessionTFM') || '{}');
|
|
798
|
+
if (!uactivo)
|
|
799
|
+
console.log('Validar configuracion de sesion');
|
|
800
|
+
else
|
|
801
|
+
data = uactivo.UsuarioSistema.TDOC + "-" + uactivo.UsuarioSistema.NDOC;
|
|
802
|
+
break;
|
|
803
|
+
case '@tdocactivo':
|
|
804
|
+
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
805
|
+
if (!uactivo)
|
|
806
|
+
console.log('Validar configuracion de sesion');
|
|
807
|
+
else
|
|
808
|
+
data = uactivo.UsuarioSistema.TDOC;
|
|
809
|
+
break;
|
|
810
|
+
case '@ndocactivo':
|
|
811
|
+
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
812
|
+
if (!uactivo)
|
|
813
|
+
console.log('Validar configuracion de sesion');
|
|
814
|
+
else
|
|
815
|
+
data = uactivo.UsuarioSistema.NDOC;
|
|
816
|
+
break;
|
|
817
|
+
case '@hoy':
|
|
818
|
+
data = new Date();
|
|
819
|
+
break;
|
|
820
|
+
default:
|
|
821
|
+
data = value;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
return data;
|
|
825
|
+
};
|
|
826
|
+
RegistroChildComponent.prototype.submit = function () {
|
|
827
|
+
if (!this.validateData())
|
|
828
|
+
return;
|
|
829
|
+
this.ref.close(this.data);
|
|
830
|
+
};
|
|
831
|
+
RegistroChildComponent.prototype.cancel = function () {
|
|
832
|
+
this.ref.close();
|
|
833
|
+
};
|
|
834
|
+
RegistroChildComponent.prototype.validateData = function () {
|
|
835
|
+
if (this.esquema.validations.type == 'local')
|
|
836
|
+
return this.validateDataLocal();
|
|
837
|
+
return true;
|
|
838
|
+
};
|
|
839
|
+
RegistroChildComponent.prototype.validateDataLocal = function () {
|
|
840
|
+
var _this = this;
|
|
841
|
+
var err = [];
|
|
842
|
+
this.esquema.validations.required.forEach(function (x) {
|
|
843
|
+
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
844
|
+
err.push(x.message);
|
|
845
|
+
});
|
|
846
|
+
if (err.length != 0)
|
|
847
|
+
this.messageService.add({ severity: 'warn', detail: err.join('. ') });
|
|
848
|
+
return err.length == 0;
|
|
849
|
+
};
|
|
850
|
+
return RegistroChildComponent;
|
|
851
|
+
}());
|
|
852
|
+
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: i3__namespace$1.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
853
|
+
RegistroChildComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroChildComponent, selector: "lib-registro-child", providers: [i3$1.MessageService], ngImport: i0__namespace, template: "<p-toast></p-toast>\n<div *ngFor=\"let element of uiEsquema.elements\" [class]=\"element?.class\">\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\" #a>\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)\"></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\" #b>\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\" [appendTo]=\"b\"\n (sendNotification)=\"sendNotification($event)\"></sf-control>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Control'\" #c>\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\" [appendTo]=\"c\"></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>", components: [{ type: i3__namespace$3.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"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i8__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9__namespace.Ripple, selector: "[pRipple]" }] });
|
|
854
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, decorators: [{
|
|
855
|
+
type: i0.Component,
|
|
856
|
+
args: [{
|
|
857
|
+
selector: 'lib-registro-child',
|
|
858
|
+
templateUrl: './registro-child.component.html',
|
|
859
|
+
providers: [i3$1.MessageService]
|
|
860
|
+
}]
|
|
861
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.DynamicDialogRef }, { type: i1__namespace$1.DynamicDialogConfig }, { type: i3__namespace$1.MessageService }]; } });
|
|
862
|
+
|
|
606
863
|
var RegistroComponent = /** @class */ (function () {
|
|
607
|
-
function RegistroComponent(generalService, router, messageSerice) {
|
|
864
|
+
function RegistroComponent(generalService, router, messageSerice, dialogService) {
|
|
608
865
|
this.generalService = generalService;
|
|
609
866
|
this.router = router;
|
|
610
867
|
this.messageSerice = messageSerice;
|
|
868
|
+
this.dialogService = dialogService;
|
|
611
869
|
this.idKatios = '';
|
|
612
870
|
this.idEntidad = '';
|
|
613
871
|
this.trx = '';
|
|
614
872
|
this.id = '';
|
|
615
|
-
this.
|
|
873
|
+
this.sendData = new i0.EventEmitter();
|
|
616
874
|
this.crudConfig = new CrudConfig();
|
|
875
|
+
this.enProceso = false;
|
|
617
876
|
this.configOperation = new Operations();
|
|
877
|
+
this.isLocal = false;
|
|
618
878
|
}
|
|
619
879
|
RegistroComponent.prototype.ngOnInit = function () {
|
|
620
880
|
this.loadConfigCrud();
|
|
@@ -626,6 +886,7 @@
|
|
|
626
886
|
this.generalService.getCrudByEntidad(this.idKatios, this.idEntidad)
|
|
627
887
|
.then(function (res) {
|
|
628
888
|
_this.crudConfig = res;
|
|
889
|
+
console.log(_this.crudConfig);
|
|
629
890
|
if (_this.trx != 'c')
|
|
630
891
|
_this.getInfoRegistro(_this.crudConfig.registro);
|
|
631
892
|
else {
|
|
@@ -675,16 +936,30 @@
|
|
|
675
936
|
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
676
937
|
};
|
|
677
938
|
RegistroComponent.prototype.setValue = function (value, scope) {
|
|
678
|
-
|
|
939
|
+
var _this = this;
|
|
940
|
+
switch (typeof (value)) {
|
|
941
|
+
case 'object':
|
|
942
|
+
value.forEach(function (val) { return jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value); });
|
|
943
|
+
break;
|
|
944
|
+
default:
|
|
945
|
+
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
679
948
|
};
|
|
680
949
|
RegistroComponent.prototype.createObject = function (esquema) {
|
|
681
950
|
var object = {};
|
|
682
951
|
switch (esquema.type) {
|
|
952
|
+
case 'numeric':
|
|
953
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
683
954
|
case 'string':
|
|
684
|
-
case '
|
|
685
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default)
|
|
955
|
+
case 'date':
|
|
956
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
686
957
|
case 'boolean':
|
|
687
958
|
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
959
|
+
case 'array':
|
|
960
|
+
return [];
|
|
961
|
+
case 'file':
|
|
962
|
+
return null;
|
|
688
963
|
case 'object':
|
|
689
964
|
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
690
965
|
Object.defineProperty(object, key, { value: this.createObject(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
@@ -697,6 +972,7 @@
|
|
|
697
972
|
};
|
|
698
973
|
RegistroComponent.prototype.submit = function () {
|
|
699
974
|
var _this = this;
|
|
975
|
+
console.log(this.data);
|
|
700
976
|
if (!this.validateData())
|
|
701
977
|
return;
|
|
702
978
|
this.enProceso = true;
|
|
@@ -724,27 +1000,111 @@
|
|
|
724
1000
|
};
|
|
725
1001
|
RegistroComponent.prototype.validateDataLocal = function () {
|
|
726
1002
|
var _this = this;
|
|
1003
|
+
var _a, _b;
|
|
727
1004
|
var err = [];
|
|
728
|
-
this.configOperation.validations.required.forEach(function (x) {
|
|
1005
|
+
(_a = this.configOperation.validations) === null || _a === void 0 ? void 0 : _a.required.forEach(function (x) {
|
|
729
1006
|
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
730
1007
|
err.push(x.message);
|
|
731
1008
|
});
|
|
1009
|
+
(_b = this.configOperation.validations) === null || _b === void 0 ? void 0 : _b.operations.forEach();
|
|
732
1010
|
if (err.length != 0)
|
|
733
1011
|
this.messageSerice.add({ severity: 'warn', detail: err.join('. ') });
|
|
734
1012
|
return err.length == 0;
|
|
735
1013
|
};
|
|
1014
|
+
RegistroComponent.prototype.setDefaultValue = function (value) {
|
|
1015
|
+
var data = null;
|
|
1016
|
+
var uactivo;
|
|
1017
|
+
switch (value) {
|
|
1018
|
+
case '@uactivo':
|
|
1019
|
+
uactivo = JSON.parse(localStorage.getItem('oSessionTFM') || '{}');
|
|
1020
|
+
if (!uactivo)
|
|
1021
|
+
console.log('Validar configuracion de sesion');
|
|
1022
|
+
else
|
|
1023
|
+
data = uactivo.UsuarioSistema.TDOC + "-" + uactivo.UsuarioSistema.NDOC;
|
|
1024
|
+
break;
|
|
1025
|
+
case '@tdocactivo':
|
|
1026
|
+
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
1027
|
+
if (!uactivo)
|
|
1028
|
+
console.log('Validar configuracion de sesion');
|
|
1029
|
+
else
|
|
1030
|
+
data = uactivo.UsuarioSistema.TDOC;
|
|
1031
|
+
break;
|
|
1032
|
+
case '@ndocactivo':
|
|
1033
|
+
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
1034
|
+
if (!uactivo)
|
|
1035
|
+
console.log('Validar configuracion de sesion');
|
|
1036
|
+
else
|
|
1037
|
+
data = uactivo.UsuarioSistema.NDOC;
|
|
1038
|
+
break;
|
|
1039
|
+
case '@hoy':
|
|
1040
|
+
data = new Date();
|
|
1041
|
+
break;
|
|
1042
|
+
default:
|
|
1043
|
+
data = value;
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
return data;
|
|
1047
|
+
};
|
|
1048
|
+
RegistroComponent.prototype.sendNotification = function (message) {
|
|
1049
|
+
this.messageSerice.add(message);
|
|
1050
|
+
};
|
|
1051
|
+
RegistroComponent.prototype.addObjectArray = function (element) {
|
|
1052
|
+
var _this = this;
|
|
1053
|
+
this.dialogRef = this.dialogService.open(RegistroChildComponent, {
|
|
1054
|
+
header: "Detalle",
|
|
1055
|
+
width: '70%',
|
|
1056
|
+
modal: true,
|
|
1057
|
+
closable: false,
|
|
1058
|
+
data: {
|
|
1059
|
+
uiEsquema: Object.assign({}, element.elements),
|
|
1060
|
+
esquema: this.getControl(element.scope),
|
|
1061
|
+
id: this.getValue(element.scope).length + 1
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
this.dialogRef.onClose.subscribe(function (data) {
|
|
1065
|
+
if (data)
|
|
1066
|
+
_this.data[element.scope.replace('$..properties.', '')].push(data);
|
|
1067
|
+
});
|
|
1068
|
+
};
|
|
1069
|
+
RegistroComponent.prototype.editRow = function (element, data) {
|
|
1070
|
+
var _this = this;
|
|
1071
|
+
this.dialogRef = this.dialogService.open(RegistroChildComponent, {
|
|
1072
|
+
header: "Detalle",
|
|
1073
|
+
width: '70%',
|
|
1074
|
+
modal: true,
|
|
1075
|
+
closable: false,
|
|
1076
|
+
data: {
|
|
1077
|
+
uiEsquema: Object.assign({}, element.elements),
|
|
1078
|
+
esquema: this.getControl(element.scope),
|
|
1079
|
+
data: Object.assign({}, data)
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
this.dialogRef.onClose.subscribe(function (data) {
|
|
1083
|
+
if (data)
|
|
1084
|
+
_this.data[element.scope.replace('$..properties.', '')][data.id - 1] = data;
|
|
1085
|
+
});
|
|
1086
|
+
};
|
|
1087
|
+
RegistroComponent.prototype.deleteRow = function (element, index) {
|
|
1088
|
+
this.data[element.scope.replace('$..properties.', '')].splice(index - 1, 1);
|
|
1089
|
+
index = 1;
|
|
1090
|
+
this.data[element.scope.replace('$..properties.', '')].forEach(function (el) {
|
|
1091
|
+
el.id = index;
|
|
1092
|
+
index++;
|
|
1093
|
+
});
|
|
1094
|
+
};
|
|
736
1095
|
return RegistroComponent;
|
|
737
1096
|
}());
|
|
738
|
-
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: i3__namespace$1.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
739
|
-
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" }, providers: [i3$1.MessageService], 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>{{idEntidad}} {{id != '' ? '-' + id : ''}}</span>\r\n <button 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\"
|
|
1097
|
+
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: i3__namespace$1.MessageService }, { token: i1__namespace$1.DialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1098
|
+
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" }, outputs: { sendData: "sendData" }, providers: [i3$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 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)\"></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)\"></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>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <td>\r\n <!-- <button pButton pRipple type=\"button\" (click)=\"editRow(el, rowData)\" 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$3.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"] }, { 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: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i9__namespace.Ripple, selector: "[pRipple]" }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "currency": i6__namespace.CurrencyPipe } });
|
|
740
1099
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, decorators: [{
|
|
741
1100
|
type: i0.Component,
|
|
742
1101
|
args: [{
|
|
743
1102
|
selector: 'sf-registro',
|
|
744
1103
|
templateUrl: './registro.component.html',
|
|
745
|
-
providers: [i3$1.MessageService]
|
|
1104
|
+
providers: [i3$1.MessageService, i1$1.DialogService, i1$1.DynamicDialogConfig, i1$1.DynamicDialogRef],
|
|
1105
|
+
entryComponents: [RegistroComponent]
|
|
746
1106
|
}]
|
|
747
|
-
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }, { type: i3__namespace$1.MessageService }]; }, propDecorators: { idKatios: [{
|
|
1107
|
+
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }, { type: i3__namespace$1.MessageService }, { type: i1__namespace$1.DialogService }]; }, propDecorators: { idKatios: [{
|
|
748
1108
|
type: i0.Input
|
|
749
1109
|
}], idEntidad: [{
|
|
750
1110
|
type: i0.Input
|
|
@@ -752,6 +1112,8 @@
|
|
|
752
1112
|
type: i0.Input
|
|
753
1113
|
}], id: [{
|
|
754
1114
|
type: i0.Input
|
|
1115
|
+
}], sendData: [{
|
|
1116
|
+
type: i0.Output
|
|
755
1117
|
}] } });
|
|
756
1118
|
|
|
757
1119
|
var SfCrudComponent = /** @class */ (function () {
|
|
@@ -781,14 +1143,16 @@
|
|
|
781
1143
|
SfCrudModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, declarations: [SfCrudComponent,
|
|
782
1144
|
TableroComponent,
|
|
783
1145
|
RegistroComponent,
|
|
784
|
-
ControlComponent
|
|
1146
|
+
ControlComponent,
|
|
1147
|
+
RegistroChildComponent], imports: [accordion.AccordionModule,
|
|
1148
|
+
i4$1.AutoCompleteModule,
|
|
785
1149
|
avatargroup.AvatarGroupModule,
|
|
786
1150
|
avatar.AvatarModule,
|
|
787
1151
|
badge.BadgeModule,
|
|
788
1152
|
i3.BlockUIModule,
|
|
789
1153
|
breadcrumb.BreadcrumbModule,
|
|
790
1154
|
i8.ButtonModule,
|
|
791
|
-
|
|
1155
|
+
i5$1.CalendarModule,
|
|
792
1156
|
card.CardModule,
|
|
793
1157
|
carousel.CarouselModule,
|
|
794
1158
|
cascadeselect.CascadeSelectModule,
|
|
@@ -802,15 +1166,16 @@
|
|
|
802
1166
|
contextmenu.ContextMenuModule,
|
|
803
1167
|
dialog.DialogModule,
|
|
804
1168
|
divider.DividerModule,
|
|
805
|
-
|
|
1169
|
+
i3$2.DropdownModule,
|
|
1170
|
+
i1$1.DynamicDialogModule,
|
|
806
1171
|
fieldset.FieldsetModule,
|
|
807
|
-
|
|
808
|
-
|
|
1172
|
+
i7.FileUploadModule,
|
|
1173
|
+
i9$1.FormsModule,
|
|
809
1174
|
galleria.GalleriaModule,
|
|
810
1175
|
i1.HttpClientModule,
|
|
811
1176
|
inplace.InplaceModule,
|
|
812
|
-
|
|
813
|
-
|
|
1177
|
+
i2$1.InputMaskModule,
|
|
1178
|
+
i6$1.InputNumberModule,
|
|
814
1179
|
inputswitch.InputSwitchModule,
|
|
815
1180
|
inputtextarea.InputTextareaModule,
|
|
816
1181
|
i10.InputTextModule,
|
|
@@ -848,22 +1213,24 @@
|
|
|
848
1213
|
terminal.TerminalModule,
|
|
849
1214
|
tieredmenu.TieredMenuModule,
|
|
850
1215
|
timeline.TimelineModule,
|
|
851
|
-
|
|
1216
|
+
i3$3.ToastModule,
|
|
852
1217
|
togglebutton.ToggleButtonModule,
|
|
853
1218
|
i4.ToolbarModule,
|
|
854
1219
|
i11.TooltipModule,
|
|
855
1220
|
tree.TreeModule], exports: [SfCrudComponent,
|
|
856
1221
|
TableroComponent,
|
|
857
|
-
RegistroComponent
|
|
1222
|
+
RegistroComponent,
|
|
1223
|
+
ControlComponent] });
|
|
858
1224
|
SfCrudModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, imports: [[
|
|
859
1225
|
accordion.AccordionModule,
|
|
1226
|
+
i4$1.AutoCompleteModule,
|
|
860
1227
|
avatargroup.AvatarGroupModule,
|
|
861
1228
|
avatar.AvatarModule,
|
|
862
1229
|
badge.BadgeModule,
|
|
863
1230
|
i3.BlockUIModule,
|
|
864
1231
|
breadcrumb.BreadcrumbModule,
|
|
865
1232
|
i8.ButtonModule,
|
|
866
|
-
|
|
1233
|
+
i5$1.CalendarModule,
|
|
867
1234
|
card.CardModule,
|
|
868
1235
|
carousel.CarouselModule,
|
|
869
1236
|
cascadeselect.CascadeSelectModule,
|
|
@@ -877,15 +1244,16 @@
|
|
|
877
1244
|
contextmenu.ContextMenuModule,
|
|
878
1245
|
dialog.DialogModule,
|
|
879
1246
|
divider.DividerModule,
|
|
880
|
-
|
|
1247
|
+
i3$2.DropdownModule,
|
|
1248
|
+
i1$1.DynamicDialogModule,
|
|
881
1249
|
fieldset.FieldsetModule,
|
|
882
|
-
|
|
883
|
-
|
|
1250
|
+
i7.FileUploadModule,
|
|
1251
|
+
i9$1.FormsModule,
|
|
884
1252
|
galleria.GalleriaModule,
|
|
885
1253
|
i1.HttpClientModule,
|
|
886
1254
|
inplace.InplaceModule,
|
|
887
|
-
|
|
888
|
-
|
|
1255
|
+
i2$1.InputMaskModule,
|
|
1256
|
+
i6$1.InputNumberModule,
|
|
889
1257
|
inputswitch.InputSwitchModule,
|
|
890
1258
|
inputtextarea.InputTextareaModule,
|
|
891
1259
|
i10.InputTextModule,
|
|
@@ -923,7 +1291,7 @@
|
|
|
923
1291
|
terminal.TerminalModule,
|
|
924
1292
|
tieredmenu.TieredMenuModule,
|
|
925
1293
|
timeline.TimelineModule,
|
|
926
|
-
|
|
1294
|
+
i3$3.ToastModule,
|
|
927
1295
|
togglebutton.ToggleButtonModule,
|
|
928
1296
|
i4.ToolbarModule,
|
|
929
1297
|
i11.TooltipModule,
|
|
@@ -936,17 +1304,19 @@
|
|
|
936
1304
|
SfCrudComponent,
|
|
937
1305
|
TableroComponent,
|
|
938
1306
|
RegistroComponent,
|
|
939
|
-
ControlComponent
|
|
1307
|
+
ControlComponent,
|
|
1308
|
+
RegistroChildComponent
|
|
940
1309
|
],
|
|
941
1310
|
imports: [
|
|
942
1311
|
accordion.AccordionModule,
|
|
1312
|
+
i4$1.AutoCompleteModule,
|
|
943
1313
|
avatargroup.AvatarGroupModule,
|
|
944
1314
|
avatar.AvatarModule,
|
|
945
1315
|
badge.BadgeModule,
|
|
946
1316
|
i3.BlockUIModule,
|
|
947
1317
|
breadcrumb.BreadcrumbModule,
|
|
948
1318
|
i8.ButtonModule,
|
|
949
|
-
|
|
1319
|
+
i5$1.CalendarModule,
|
|
950
1320
|
card.CardModule,
|
|
951
1321
|
carousel.CarouselModule,
|
|
952
1322
|
cascadeselect.CascadeSelectModule,
|
|
@@ -960,15 +1330,16 @@
|
|
|
960
1330
|
contextmenu.ContextMenuModule,
|
|
961
1331
|
dialog.DialogModule,
|
|
962
1332
|
divider.DividerModule,
|
|
963
|
-
|
|
1333
|
+
i3$2.DropdownModule,
|
|
1334
|
+
i1$1.DynamicDialogModule,
|
|
964
1335
|
fieldset.FieldsetModule,
|
|
965
|
-
|
|
966
|
-
|
|
1336
|
+
i7.FileUploadModule,
|
|
1337
|
+
i9$1.FormsModule,
|
|
967
1338
|
galleria.GalleriaModule,
|
|
968
1339
|
i1.HttpClientModule,
|
|
969
1340
|
inplace.InplaceModule,
|
|
970
|
-
|
|
971
|
-
|
|
1341
|
+
i2$1.InputMaskModule,
|
|
1342
|
+
i6$1.InputNumberModule,
|
|
972
1343
|
inputswitch.InputSwitchModule,
|
|
973
1344
|
inputtextarea.InputTextareaModule,
|
|
974
1345
|
i10.InputTextModule,
|
|
@@ -1006,7 +1377,7 @@
|
|
|
1006
1377
|
terminal.TerminalModule,
|
|
1007
1378
|
tieredmenu.TieredMenuModule,
|
|
1008
1379
|
timeline.TimelineModule,
|
|
1009
|
-
|
|
1380
|
+
i3$3.ToastModule,
|
|
1010
1381
|
togglebutton.ToggleButtonModule,
|
|
1011
1382
|
i4.ToolbarModule,
|
|
1012
1383
|
i11.TooltipModule,
|
|
@@ -1015,7 +1386,11 @@
|
|
|
1015
1386
|
exports: [
|
|
1016
1387
|
SfCrudComponent,
|
|
1017
1388
|
TableroComponent,
|
|
1018
|
-
RegistroComponent
|
|
1389
|
+
RegistroComponent,
|
|
1390
|
+
ControlComponent
|
|
1391
|
+
],
|
|
1392
|
+
entryComponents: [
|
|
1393
|
+
RegistroChildComponent
|
|
1019
1394
|
]
|
|
1020
1395
|
}]
|
|
1021
1396
|
}] });
|
|
@@ -1042,6 +1417,7 @@
|
|
|
1042
1417
|
* Generated bundle index. Do not edit.
|
|
1043
1418
|
*/
|
|
1044
1419
|
|
|
1420
|
+
exports.ControlComponent = ControlComponent;
|
|
1045
1421
|
exports.RegistroComponent = RegistroComponent;
|
|
1046
1422
|
exports.SfCrudComponent = SfCrudComponent;
|
|
1047
1423
|
exports.SfCrudModule = SfCrudModule;
|