sf-crud 12.0.1-beta4 → 12.0.1-beta41
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 +804 -105
- package/bundles/sf-crud.umd.js.map +1 -1
- package/esm2015/lib/components/control/control.component.js +104 -9
- package/esm2015/lib/components/registro/registro.component.js +238 -32
- package/esm2015/lib/components/registro-child/registro-child.component.js +232 -0
- package/esm2015/lib/components/tablero/tablero.component.js +81 -19
- package/esm2015/lib/sf-crud.module.js +32 -20
- package/esm2015/lib/sf-crud.service.js +16 -2
- package/esm2015/lib/shared/models/crud-config.model.js +43 -0
- package/esm2015/lib/shared/models/data-temp-crud.model.js +6 -0
- package/esm2015/lib/shared/models/shema.model.js +7 -0
- package/esm2015/lib/shared/services/general.service.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/sf-crud.js +679 -79
- package/fesm2015/sf-crud.js.map +1 -1
- package/lib/components/control/control.component.d.ts +15 -2
- package/lib/components/registro/registro.component.d.ts +33 -9
- package/lib/components/registro-child/registro-child.component.d.ts +36 -0
- package/lib/components/tablero/tablero.component.d.ts +17 -4
- package/lib/sf-crud.module.d.ts +75 -73
- package/lib/sf-crud.service.d.ts +4 -0
- package/lib/shared/{services/models → models}/crud-config.model.d.ts +8 -2
- package/lib/shared/models/data-temp-crud.model.d.ts +4 -0
- package/lib/shared/{services/models → models}/shema.model.d.ts +1 -0
- package/lib/shared/services/general.service.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/esm2015/lib/shared/services/models/crud-config.model.js +0 -43
- package/esm2015/lib/shared/services/models/shema.model.js +0 -7
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/
|
|
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/
|
|
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.
|
|
5
|
-
})(this, (function (exports, i0, i1, i2, i3, i4, i5, i7, i3$1,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('lodash'), require('jsonpath'), require('@angular/common/http'), require('@angular/router'), require('primeng/blockui'), require('primeng/toolbar'), require('primeng/table'), require('primeng/splitbutton'), require('@angular/common'), require('primeng/api'), require('primeng/button'), require('primeng/ripple'), require('primeng/inputtext'), require('primeng/dynamicdialog'), require('moment'), require('primeng/toast'), require('primeng/inputmask'), require('primeng/dropdown'), require('primeng/autocomplete'), require('primeng/calendar'), require('primeng/inputnumber'), require('primeng/fileupload'), require('primeng/inputswitch'), 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/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/inputtextarea'), require('primeng/knob'), 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/tooltip'), require('primeng/tree')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('sf-crud', ['exports', '@angular/core', 'lodash', 'jsonpath', '@angular/common/http', '@angular/router', 'primeng/blockui', 'primeng/toolbar', 'primeng/table', 'primeng/splitbutton', '@angular/common', 'primeng/api', 'primeng/button', 'primeng/ripple', 'primeng/inputtext', 'primeng/dynamicdialog', 'moment', 'primeng/toast', 'primeng/inputmask', 'primeng/dropdown', 'primeng/autocomplete', 'primeng/calendar', 'primeng/inputnumber', 'primeng/fileupload', 'primeng/inputswitch', '@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/colorpicker', 'primeng/confirmdialog', 'primeng/confirmpopup', 'primeng/contextmenu', 'primeng/dialog', 'primeng/divider', 'primeng/fieldset', 'primeng/galleria', 'primeng/inplace', 'primeng/inputtextarea', 'primeng/knob', '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/tooltip', 'primeng/tree'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["sf-crud"] = {}, global.ng.core, global._, global.jsonpath, global.ng.common.http, global.ng.router, global.i3, global.i4, global.i5, global.i6, global.ng.common, global.i3$1, global.i9, global.i10, global.i11, global.i1$1, global.moment, global.i3$3, global.i2$1, global.i3$2, global.i4$1, global.i5$1, global.i6$1, global.i7$1, global.i8, 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.colorpicker, global.confirmdialog, global.confirmpopup, global.contextmenu, global.dialog, global.divider, global.fieldset, global.galleria, global.inplace, global.inputtextarea, global.knob, 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.tooltip, global.tree));
|
|
5
|
+
})(this, (function (exports, i0, _, jsonpath, i1, i2, i3, i4, i5, i6, i7, i3$1, i9, i10, i11, i1$1, moment, i3$3, i2$1, i3$2, i4$1, i5$1, i6$1, i7$1, i8, i10$1, accordion, avatargroup, avatar, badge, breadcrumb, card, carousel, cascadeselect, checkbox, chip, chips, colorpicker, confirmdialog, confirmpopup, contextmenu, dialog, divider, fieldset, galleria, inplace, inputtextarea, knob, 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, tooltip, tree) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -23,23 +23,30 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
+
var ___namespace = /*#__PURE__*/_interopNamespace(_);
|
|
27
|
+
var jsonpath__namespace = /*#__PURE__*/_interopNamespace(jsonpath);
|
|
26
28
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
27
29
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
28
30
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
29
31
|
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
30
32
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
33
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
31
34
|
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
32
35
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
33
|
-
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
34
36
|
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
35
37
|
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
36
38
|
var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
40
|
+
var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
|
|
41
|
+
var i3__namespace$3 = /*#__PURE__*/_interopNamespace(i3$3);
|
|
39
42
|
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
40
43
|
var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
|
|
41
44
|
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
42
|
-
var
|
|
45
|
+
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
46
|
+
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
47
|
+
var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
|
|
48
|
+
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
49
|
+
var i10__namespace$1 = /*#__PURE__*/_interopNamespace(i10$1);
|
|
43
50
|
|
|
44
51
|
var Shema = /** @class */ (function () {
|
|
45
52
|
function Shema() {
|
|
@@ -64,8 +71,8 @@
|
|
|
64
71
|
this.endpoint = '';
|
|
65
72
|
this.method = '';
|
|
66
73
|
this.server = '';
|
|
67
|
-
this.key = '';
|
|
68
74
|
this.filters = [];
|
|
75
|
+
this.keys = [];
|
|
69
76
|
}
|
|
70
77
|
return ConfigTablero;
|
|
71
78
|
}());
|
|
@@ -163,6 +170,64 @@
|
|
|
163
170
|
function __param(paramIndex, decorator) {
|
|
164
171
|
return function (target, key) { decorator(target, key, paramIndex); };
|
|
165
172
|
}
|
|
173
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
174
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
175
|
+
throw new TypeError("Function expected"); return f; }
|
|
176
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
177
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
178
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
179
|
+
var _, done = false;
|
|
180
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
181
|
+
var context = {};
|
|
182
|
+
for (var p in contextIn)
|
|
183
|
+
context[p] = p === "access" ? {} : contextIn[p];
|
|
184
|
+
for (var p in contextIn.access)
|
|
185
|
+
context.access[p] = contextIn.access[p];
|
|
186
|
+
context.addInitializer = function (f) { if (done)
|
|
187
|
+
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
188
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
189
|
+
if (kind === "accessor") {
|
|
190
|
+
if (result === void 0)
|
|
191
|
+
continue;
|
|
192
|
+
if (result === null || typeof result !== "object")
|
|
193
|
+
throw new TypeError("Object expected");
|
|
194
|
+
if (_ = accept(result.get))
|
|
195
|
+
descriptor.get = _;
|
|
196
|
+
if (_ = accept(result.set))
|
|
197
|
+
descriptor.set = _;
|
|
198
|
+
if (_ = accept(result.init))
|
|
199
|
+
initializers.unshift(_);
|
|
200
|
+
}
|
|
201
|
+
else if (_ = accept(result)) {
|
|
202
|
+
if (kind === "field")
|
|
203
|
+
initializers.unshift(_);
|
|
204
|
+
else
|
|
205
|
+
descriptor[key] = _;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (target)
|
|
209
|
+
Object.defineProperty(target, contextIn.name, descriptor);
|
|
210
|
+
done = true;
|
|
211
|
+
}
|
|
212
|
+
;
|
|
213
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
214
|
+
var useValue = arguments.length > 2;
|
|
215
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
216
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
217
|
+
}
|
|
218
|
+
return useValue ? value : void 0;
|
|
219
|
+
}
|
|
220
|
+
;
|
|
221
|
+
function __propKey(x) {
|
|
222
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
223
|
+
}
|
|
224
|
+
;
|
|
225
|
+
function __setFunctionName(f, name, prefix) {
|
|
226
|
+
if (typeof name === "symbol")
|
|
227
|
+
name = name.description ? "[".concat(name.description, "]") : "";
|
|
228
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
229
|
+
}
|
|
230
|
+
;
|
|
166
231
|
function __metadata(metadataKey, metadataValue) {
|
|
167
232
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
168
233
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -194,7 +259,7 @@
|
|
|
194
259
|
function step(op) {
|
|
195
260
|
if (f)
|
|
196
261
|
throw new TypeError("Generator is already executing.");
|
|
197
|
-
while (_)
|
|
262
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
198
263
|
try {
|
|
199
264
|
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)
|
|
200
265
|
return t;
|
|
@@ -362,7 +427,7 @@
|
|
|
362
427
|
function __asyncDelegator(o) {
|
|
363
428
|
var i, p;
|
|
364
429
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
365
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
430
|
+
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; }
|
|
366
431
|
}
|
|
367
432
|
function __asyncValues(o) {
|
|
368
433
|
if (!Symbol.asyncIterator)
|
|
@@ -421,7 +486,34 @@
|
|
|
421
486
|
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
422
487
|
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
423
488
|
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
424
|
-
}
|
|
489
|
+
}
|
|
490
|
+
var tslib_es6 = {
|
|
491
|
+
__extends: __extends,
|
|
492
|
+
__assign: __assign,
|
|
493
|
+
__rest: __rest,
|
|
494
|
+
__decorate: __decorate,
|
|
495
|
+
__param: __param,
|
|
496
|
+
__metadata: __metadata,
|
|
497
|
+
__awaiter: __awaiter,
|
|
498
|
+
__generator: __generator,
|
|
499
|
+
__createBinding: __createBinding,
|
|
500
|
+
__exportStar: __exportStar,
|
|
501
|
+
__values: __values,
|
|
502
|
+
__read: __read,
|
|
503
|
+
__spread: __spread,
|
|
504
|
+
__spreadArrays: __spreadArrays,
|
|
505
|
+
__spreadArray: __spreadArray,
|
|
506
|
+
__await: __await,
|
|
507
|
+
__asyncGenerator: __asyncGenerator,
|
|
508
|
+
__asyncDelegator: __asyncDelegator,
|
|
509
|
+
__asyncValues: __asyncValues,
|
|
510
|
+
__makeTemplateObject: __makeTemplateObject,
|
|
511
|
+
__importStar: __importStar,
|
|
512
|
+
__importDefault: __importDefault,
|
|
513
|
+
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
514
|
+
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
515
|
+
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
516
|
+
};
|
|
425
517
|
|
|
426
518
|
var GeneralService = /** @class */ (function () {
|
|
427
519
|
function GeneralService(http) {
|
|
@@ -482,6 +574,8 @@
|
|
|
482
574
|
this.opciones = [];
|
|
483
575
|
this.idEntidad = '';
|
|
484
576
|
this.idKatios = '';
|
|
577
|
+
this.onSelectAction = new i0.EventEmitter();
|
|
578
|
+
this.items = [];
|
|
485
579
|
this.crudConfig = new CrudConfig();
|
|
486
580
|
this.enProceso = false;
|
|
487
581
|
this.data = [];
|
|
@@ -497,7 +591,6 @@
|
|
|
497
591
|
.then(function (res) {
|
|
498
592
|
_this.crudConfig = res;
|
|
499
593
|
_this.getInfoTablero(_this.crudConfig.tablero);
|
|
500
|
-
_this.loadOptions();
|
|
501
594
|
})
|
|
502
595
|
.catch(function (err) {
|
|
503
596
|
console.log(err);
|
|
@@ -506,9 +599,15 @@
|
|
|
506
599
|
};
|
|
507
600
|
TableroComponent.prototype.getInfoTablero = function (configTablero) {
|
|
508
601
|
var _this = this;
|
|
509
|
-
this.generalService.genericRequest(configTablero.method, configTablero.server, configTablero.endpoint)
|
|
602
|
+
this.generalService.genericRequest(configTablero.method, configTablero.server, this.aplyKeys(configTablero.keys, configTablero.endpoint, this.dataExt))
|
|
510
603
|
.then(function (res) {
|
|
511
|
-
|
|
604
|
+
var aux;
|
|
605
|
+
if (!Array.isArray(res))
|
|
606
|
+
aux = res.data;
|
|
607
|
+
else
|
|
608
|
+
aux = res;
|
|
609
|
+
_this.generateData(aux);
|
|
610
|
+
_this.loadOptions();
|
|
512
611
|
_this.enProceso = false;
|
|
513
612
|
})
|
|
514
613
|
.catch(function (err) {
|
|
@@ -516,11 +615,29 @@
|
|
|
516
615
|
_this.enProceso = false;
|
|
517
616
|
});
|
|
518
617
|
};
|
|
618
|
+
TableroComponent.prototype.generateData = function (data) {
|
|
619
|
+
var _this = this;
|
|
620
|
+
data.forEach(function (item) {
|
|
621
|
+
var newItem = {};
|
|
622
|
+
_this.crudConfig.tablero.columns.forEach(function (col) {
|
|
623
|
+
newItem[col.col] = _this.getValue(col.col, item);
|
|
624
|
+
});
|
|
625
|
+
_this.data.push(newItem);
|
|
626
|
+
});
|
|
627
|
+
console.log(this.data);
|
|
628
|
+
};
|
|
629
|
+
TableroComponent.prototype.getValue = function (path, item) {
|
|
630
|
+
if (path.includes("."))
|
|
631
|
+
return jsonpath__namespace.query(item, path)[0];
|
|
632
|
+
return item[path];
|
|
633
|
+
};
|
|
519
634
|
TableroComponent.prototype.loadOptions = function () {
|
|
635
|
+
var _this = this;
|
|
636
|
+
this.items = [];
|
|
520
637
|
this.btn.create = this.opciones.find(function (x) { return x.label == 'Crear'; });
|
|
521
|
-
this.
|
|
522
|
-
|
|
523
|
-
|
|
638
|
+
this.opciones.filter(function (opc) { return opc.valor.action; }).forEach(function (opc) {
|
|
639
|
+
_this.items.push({ label: opc.label, icon: opc.icon, command: function () { return _this.execAction(opc.valor); } });
|
|
640
|
+
});
|
|
524
641
|
};
|
|
525
642
|
TableroComponent.prototype.redirect = function (accion, data) {
|
|
526
643
|
var _a, _b;
|
|
@@ -529,22 +646,54 @@
|
|
|
529
646
|
this.router.navigateByUrl(((_b = (_a = this.btn.create) === null || _a === void 0 ? void 0 : _a.valor) === null || _b === void 0 ? void 0 : _b.redirect) || '');
|
|
530
647
|
break;
|
|
531
648
|
case 'read':
|
|
532
|
-
this.router.navigateByUrl(this.btn.read.valor.redirect
|
|
649
|
+
this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, this.btn.read.valor.redirect, data));
|
|
533
650
|
break;
|
|
534
651
|
case 'update':
|
|
535
|
-
this.router.navigateByUrl(this.btn.update.valor.redirect
|
|
652
|
+
this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, this.btn.update.valor.redirect, data));
|
|
536
653
|
break;
|
|
537
654
|
case 'delete':
|
|
538
|
-
this.router.navigateByUrl(this.btn.delete.valor.redirect
|
|
655
|
+
this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, this.btn.delete.valor.redirect, data));
|
|
656
|
+
break;
|
|
657
|
+
default:
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
TableroComponent.prototype.aplyKeys = function (keys, endpoint, data) {
|
|
662
|
+
var _this = this;
|
|
663
|
+
keys.forEach(function (key) {
|
|
664
|
+
var _a, _b, _c, _d;
|
|
665
|
+
switch (key.key) {
|
|
666
|
+
case '@ndoc':
|
|
667
|
+
endpoint = endpoint.replace(key.key, ((_b = (_a = _this.user) === null || _a === void 0 ? void 0 : _a.UsuarioSistema) === null || _b === void 0 ? void 0 : _b.NDOC) || '');
|
|
668
|
+
break;
|
|
669
|
+
case '@tdoc':
|
|
670
|
+
endpoint = endpoint.replace(key.key, ((_d = (_c = _this.user) === null || _c === void 0 ? void 0 : _c.UsuarioSistema) === null || _d === void 0 ? void 0 : _d.TDOC) || '');
|
|
671
|
+
break;
|
|
672
|
+
case '@idKatios':
|
|
673
|
+
endpoint = endpoint.replace(key.key, _this.idKatios);
|
|
674
|
+
break;
|
|
675
|
+
default:
|
|
676
|
+
if (endpoint.includes(key.key) && data)
|
|
677
|
+
endpoint = endpoint.replace(key.key, jsonpath__namespace.query(data, (key === null || key === void 0 ? void 0 : key.scope) || '')[0]);
|
|
678
|
+
break;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
return endpoint;
|
|
682
|
+
};
|
|
683
|
+
TableroComponent.prototype.execAction = function (params) {
|
|
684
|
+
switch (params.action) {
|
|
685
|
+
case 'redirect':
|
|
686
|
+
this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, params.link, this.itemSelected));
|
|
539
687
|
break;
|
|
540
688
|
default:
|
|
689
|
+
this.onSelectAction.emit({ data: ___namespace.cloneDeep(this.itemSelected), params: params });
|
|
541
690
|
break;
|
|
542
691
|
}
|
|
543
692
|
};
|
|
544
693
|
return TableroComponent;
|
|
545
694
|
}());
|
|
546
695
|
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 });
|
|
547
|
-
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}
|
|
696
|
+
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", user: "user", dataExt: "dataExt" }, outputs: { onSelectAction: "onSelectAction" }, 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}\" [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\">{{crudConfig.tablero?.label || 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 <td>\r\n <p-splitButton icon=\"pi pi-align-justify\" [model]=\"items\" appendTo=\"body\"\r\n (onDropdownClick)=\"itemSelected = rowData\"></p-splitButton>\r\n </td>\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"] }, { type: i6__namespace.SplitButton, selector: "p-splitButton", inputs: ["model", "icon", "iconPos", "label", "style", "styleClass", "menuStyle", "menuStyleClass", "disabled", "tabindex", "appendTo", "dir", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onClick", "onDropdownClick"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__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]" }, { type: i11__namespace.InputText, selector: "[pInputText]" }, { 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"] }], pipes: { "date": i7__namespace.DatePipe, "currency": i7__namespace.CurrencyPipe } });
|
|
548
697
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TableroComponent, decorators: [{
|
|
549
698
|
type: i0.Component,
|
|
550
699
|
args: [{
|
|
@@ -557,6 +706,12 @@
|
|
|
557
706
|
type: i0.Input
|
|
558
707
|
}], idKatios: [{
|
|
559
708
|
type: i0.Input
|
|
709
|
+
}], user: [{
|
|
710
|
+
type: i0.Input
|
|
711
|
+
}], dataExt: [{
|
|
712
|
+
type: i0.Input
|
|
713
|
+
}], onSelectAction: [{
|
|
714
|
+
type: i0.Output
|
|
560
715
|
}] } });
|
|
561
716
|
|
|
562
717
|
var ControlComponent = /** @class */ (function () {
|
|
@@ -565,20 +720,55 @@
|
|
|
565
720
|
this.control = new Shema();
|
|
566
721
|
this.label = '';
|
|
567
722
|
this.setValue = new i0.EventEmitter();
|
|
723
|
+
this.sendNotification = new i0.EventEmitter();
|
|
724
|
+
this.sendObject = new i0.EventEmitter();
|
|
568
725
|
this.isLoading = false;
|
|
569
726
|
this.dataFromService = [];
|
|
727
|
+
this.uploadedFiles = [];
|
|
728
|
+
this.displayAdd = false;
|
|
729
|
+
this.tempValue = {};
|
|
570
730
|
}
|
|
571
731
|
ControlComponent.prototype.ngOnInit = function () {
|
|
572
732
|
var _a;
|
|
573
733
|
if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.config) && this.control.subtype == 'dropdown')
|
|
574
734
|
this.loadDataFromService();
|
|
735
|
+
if (this.value && this.control.subtype == 'autocomplete')
|
|
736
|
+
this.setDefaultValue();
|
|
575
737
|
};
|
|
576
738
|
ControlComponent.prototype.sendValue = function () {
|
|
577
739
|
this.setValue.emit(this.value);
|
|
578
740
|
};
|
|
741
|
+
ControlComponent.prototype.sendValueFromObject = function (event) {
|
|
742
|
+
switch (typeof (this.control.config.optionValue)) {
|
|
743
|
+
case 'object':
|
|
744
|
+
this.control.config.optionValue.forEach(function (op) { return op['value'] = event[op.key]; });
|
|
745
|
+
this.setValue.emit(this.control.config.optionValue);
|
|
746
|
+
break;
|
|
747
|
+
default:
|
|
748
|
+
this.setValue.emit(event[this.control.config.optionValue]);
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
ControlComponent.prototype.validateValue = function (type) {
|
|
753
|
+
switch (type) {
|
|
754
|
+
case 'email':
|
|
755
|
+
var regex = new RegExp(/([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/igm);
|
|
756
|
+
if (regex.test(this.value))
|
|
757
|
+
this.sendValue();
|
|
758
|
+
else {
|
|
759
|
+
this.value = null;
|
|
760
|
+
this.sendValue();
|
|
761
|
+
this.sendNotification.emit({ severity: 'warn', detail: 'El correo no es válido' });
|
|
762
|
+
}
|
|
763
|
+
break;
|
|
764
|
+
default:
|
|
765
|
+
break;
|
|
766
|
+
}
|
|
767
|
+
};
|
|
579
768
|
ControlComponent.prototype.loadDataFromService = function () {
|
|
580
769
|
var _this = this;
|
|
581
770
|
this.isLoading = true;
|
|
771
|
+
this.dataFromService = [];
|
|
582
772
|
this.generalService.genericRequest(this.control.config.method, this.control.config.server, this.control.config.endpoint)
|
|
583
773
|
.then(function (res) {
|
|
584
774
|
_this.dataFromService = res.data;
|
|
@@ -594,10 +784,60 @@
|
|
|
594
784
|
_this.isLoading = false;
|
|
595
785
|
});
|
|
596
786
|
};
|
|
787
|
+
ControlComponent.prototype.onUpload = function (event) {
|
|
788
|
+
var _this = this;
|
|
789
|
+
var file = event.files[0];
|
|
790
|
+
var formData = new FormData();
|
|
791
|
+
var path = 'Imagenes/CRUD/temp';
|
|
792
|
+
formData.append('uploadFile', file);
|
|
793
|
+
formData.append('Ruta', "/" + path);
|
|
794
|
+
this.isLoading = true;
|
|
795
|
+
this.generalService.genericRequest(this.control.config.method, this.control.config.server, this.control.config.endpoint, formData)
|
|
796
|
+
.then(function () {
|
|
797
|
+
_this.sendNotification.emit({ severity: 'info', detail: "Archivo cargado correctamente!" });
|
|
798
|
+
_this.uploadedFiles.push(file);
|
|
799
|
+
_this.isLoading = false;
|
|
800
|
+
_this.value = "" + _this.generalService.jsonConfig.Server + path + "/" + file.name;
|
|
801
|
+
_this.sendValue();
|
|
802
|
+
})
|
|
803
|
+
.catch(function (err) {
|
|
804
|
+
console.log(err);
|
|
805
|
+
_this.isLoading = false;
|
|
806
|
+
_this.sendNotification.emit({ severity: 'error', detail: "Error al cargar el archivo!" });
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
ControlComponent.prototype.refresData = function () {
|
|
810
|
+
var _a, _b;
|
|
811
|
+
if ((_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.endpointtemp)
|
|
812
|
+
this.loadDataFromService();
|
|
813
|
+
};
|
|
814
|
+
ControlComponent.prototype.setDefaultValue = function () {
|
|
815
|
+
var _a;
|
|
816
|
+
Object.defineProperty(this.tempValue, (_a = this.control.config) === null || _a === void 0 ? void 0 : _a.optionLabel, { value: this.value, writable: true, enumerable: true, configurable: true });
|
|
817
|
+
};
|
|
818
|
+
ControlComponent.prototype.searchValue = function (value) {
|
|
819
|
+
var _this = this;
|
|
820
|
+
var endpoint = this.control.config.endpoint.replace('@id', value);
|
|
821
|
+
this.generalService.genericRequest(this.control.config.method, this.control.config.server, endpoint)
|
|
822
|
+
.then(function (res) {
|
|
823
|
+
var _a;
|
|
824
|
+
if (((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
825
|
+
_this.sendObject.emit({ data: res.data[0], optionValue: _this.control.config.optionValue });
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
_this.sendNotification.emit({ severity: 'warn', detail: "Valor no encontrado." });
|
|
829
|
+
_this.sendObject.emit({ data: null, optionValue: _this.control.config.optionValue });
|
|
830
|
+
}
|
|
831
|
+
})
|
|
832
|
+
.catch(function (err) {
|
|
833
|
+
console.log(err);
|
|
834
|
+
_this.sendNotification.emit({ severity: 'error', detail: "Error al consumir el servicio." });
|
|
835
|
+
});
|
|
836
|
+
};
|
|
597
837
|
return ControlComponent;
|
|
598
838
|
}());
|
|
599
839
|
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 });
|
|
600
|
-
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 <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=\"email\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'phone'\">\r\n <input pInputText type=\"tel\" [(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 *ngSwitchCase=\"'autocomplete'\">\r\n <p-autoComplete [(ngModel)]=\"value\" [suggestions]=\"dataFromService\" [minlength]=\"3\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [forceSelection]=\"true\" (onSelect)=\"sendValue()\"\r\n [field]=\"control.field\"></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()\" [format]=\"control?.format || 'yy-mm-dd'\"></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\"\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\"\r\n [minFractionDigits]=\"control?.minFractionDigits || 0\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'percentage'\">\r\n <p-inputNumber [(ngModel)]=\"value\" suffix=\" %\"\r\n [minFractionDigits]=\"control?.minFractionDigits || 2\"></p-inputNumber>\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"] }, { type: i3__namespace$2.Calendar, selector: "p-calendar", inputs: ["dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "icon", "shortYearCutoff", "hourFormat", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "dataType", "selectionMode", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "keepInvalid", "hideOnDateTimeSelect", "numberOfMonths", "view", "timeSeparator", "focusTrap", "firstDayOfWeek", "showTransitionOptions", "hideTransitionOptions", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "locale", "disabled", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "selectOtherMonths", "showIcon", "appendTo", "readonlyInput", "monthNavigator", "yearNavigator", "timeOnly", "required", "maxDateCount", "showButtonBar", "panelStyleClass", "panelStyle", "touchUI", "tabindex"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i4__namespace$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "incrementButtonIcon", "decrementButtonIcon", "step", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "disabled", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "inputStyle", "inputStyleClass"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }], directives: [{ type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6__namespace.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: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }] });
|
|
840
|
+
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", sendObject: "sendObject" }, ngImport: i0__namespace, template: "<ng-container [ngSwitch]=\"control.type\" #cc>\r\n <label [for]=\"label\" style=\"width: -webkit-fill-available;\">{{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 [disabled]=\"control?.disabled || false\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (focusout)=\"sendValue()\"\r\n [disabled]=\"control?.disabled || false\">\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')\" [disabled]=\"control?.disabled || false\">\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()\" [disabled]=\"control?.disabled || false\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" appendTo=\"body\"\r\n placeholder=\"Seleccione una opci\u00F3n\" [disabled]=\"control?.disabled || false\"></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\"\r\n [optionValue]=\"control?.field || control.config.optionValue\" (onClick)=\"refresData()\"\r\n appendTo=\"body\" placeholder=\"Seleccione una opci\u00F3n\"\r\n [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'dropdown:replace'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\"\r\n (onChange)=\"sendValueFromObject($event.value)\" [optionLabel]=\"control.config.optionLabel\"\r\n (onClick)=\"refresData()\" appendTo=\"body\" placeholder=\"Seleccione una opci\u00F3n\"\r\n [disabled]=\"control?.disabled || false\"></p-dropdown>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'autocomplete'\">\r\n <p-autoComplete [showEmptyMessage]=\"true\" [suggestions]=\"dataFromService\" appendTo=\"body\"\r\n (completeMethod)=\"loadDataFromControlBusquedaService($event)\" [field]=\"control.field\"\r\n [minLength]=\"1\" (onSelect)=\"sendValueFromObject($event)\" [(ngModel)]=\"tempValue\"\r\n [disabled]=\"control?.disabled || false\"></p-autoComplete>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'input:search'\">\r\n <div class=\"p-inputgroup\">\r\n <input type=\"text\" pInputText [(ngModel)]=\"value\" (focusout)=\"sendValue()\" />\r\n <button type=\"button\" pButton icon=\"pi pi-search\" (click)=\"searchValue(value)\"></button>\r\n </div>\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()\" (onBlur)=\"sendValue()\" [monthNavigator]=\"true\"\r\n [yearNavigator]=\"true\" yearRange=\"1900:2035\" [dateFormat]=\"control?.format || 'yy-mm-dd'\"\r\n appendTo=\"body\" [disabled]=\"control?.disabled || false\" [showOnFocus]=\"!control?.hide\"\r\n [placeholder]=\"control?.placeholder || 'aaaa-mm-dd'\" [touchUI]=\"control?.touchUI || false\"\r\n [showIcon]=\"control?.showIcon || false\"></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'\" [disabled]=\"control?.disabled || false\"></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\"\r\n [disabled]=\"control?.disabled || false\"></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\"\r\n [disabled]=\"control?.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal:search'\">\r\n <div class=\"p-inputgroup\">\r\n <input type=\"number\" pInputText [(ngModel)]=\"value\" (focusout)=\"sendValue()\" />\r\n <button type=\"button\" pButton icon=\"pi pi-search\" (click)=\"searchValue(value)\"></button>\r\n </div>\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 *ngSwitchCase=\"'boolean'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'switch'\">\r\n <p-inputSwitch [(ngModel)]=\"value\" (onChange)=\"sendValue()\" [id]=\"label\"></p-inputSwitch>\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$1.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"] }, { type: i8__namespace.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "ariaLabelledBy"], outputs: ["onChange"] }], directives: [{ type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i10__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: i11__namespace.InputText, selector: "[pInputText]" }, { type: i10__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
601
841
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, decorators: [{
|
|
602
842
|
type: i0.Component,
|
|
603
843
|
args: [{
|
|
@@ -610,40 +850,305 @@
|
|
|
610
850
|
type: i0.Input
|
|
611
851
|
}], value: [{
|
|
612
852
|
type: i0.Input
|
|
853
|
+
}], appendTo: [{
|
|
854
|
+
type: i0.Input
|
|
613
855
|
}], setValue: [{
|
|
614
856
|
type: i0.Output
|
|
857
|
+
}], sendNotification: [{
|
|
858
|
+
type: i0.Output
|
|
859
|
+
}], sendObject: [{
|
|
860
|
+
type: i0.Output
|
|
615
861
|
}] } });
|
|
616
862
|
|
|
863
|
+
var RegistroChildComponent = /** @class */ (function () {
|
|
864
|
+
function RegistroChildComponent(ref, config, messageService) {
|
|
865
|
+
this.ref = ref;
|
|
866
|
+
this.config = config;
|
|
867
|
+
this.messageService = messageService;
|
|
868
|
+
this.esquema = new Shema();
|
|
869
|
+
}
|
|
870
|
+
RegistroChildComponent.prototype.ngOnInit = function () {
|
|
871
|
+
var _a;
|
|
872
|
+
this.uiEsquema = this.config.data.uiEsquema[0];
|
|
873
|
+
this.esquema = this.config.data.esquema;
|
|
874
|
+
this.data = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.data;
|
|
875
|
+
if (!this.data) {
|
|
876
|
+
this.data = this.createObject(this.esquema);
|
|
877
|
+
jsonpath__namespace.value(this.data, '$..id', this.config.data.id);
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
RegistroChildComponent.prototype.getControl = function (scope) {
|
|
881
|
+
return jsonpath__namespace.query(this.esquema, scope)[0];
|
|
882
|
+
};
|
|
883
|
+
RegistroChildComponent.prototype.getValue = function (scope) {
|
|
884
|
+
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
885
|
+
};
|
|
886
|
+
RegistroChildComponent.prototype.setValue = function (value, scope) {
|
|
887
|
+
var _this = this;
|
|
888
|
+
switch (typeof (value)) {
|
|
889
|
+
case 'object':
|
|
890
|
+
if (Array.isArray(value))
|
|
891
|
+
value.forEach(function (val) { return jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value); });
|
|
892
|
+
else
|
|
893
|
+
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
894
|
+
break;
|
|
895
|
+
default:
|
|
896
|
+
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
this.applyValuesOnEvent('onChange', this.esquema, scope.replace('$..properties.', ''));
|
|
900
|
+
};
|
|
901
|
+
RegistroChildComponent.prototype.createObject = function (esquema) {
|
|
902
|
+
var object = {};
|
|
903
|
+
switch (esquema.type) {
|
|
904
|
+
case 'numeric':
|
|
905
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
906
|
+
case 'string':
|
|
907
|
+
case 'date':
|
|
908
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
909
|
+
case 'boolean':
|
|
910
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
911
|
+
case 'file':
|
|
912
|
+
return null;
|
|
913
|
+
case 'array':
|
|
914
|
+
case 'object':
|
|
915
|
+
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
916
|
+
Object.defineProperty(object, key, { value: this.createObject(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
917
|
+
}
|
|
918
|
+
break;
|
|
919
|
+
default:
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
return object;
|
|
923
|
+
};
|
|
924
|
+
RegistroChildComponent.prototype.setDefaultValue = function (value) {
|
|
925
|
+
var data = null;
|
|
926
|
+
var uactivo;
|
|
927
|
+
switch (value) {
|
|
928
|
+
case '@uactivo':
|
|
929
|
+
uactivo = JSON.parse(localStorage.getItem('oSessionTFM') || '{}');
|
|
930
|
+
if (!uactivo)
|
|
931
|
+
console.log('Validar configuracion de sesion');
|
|
932
|
+
else
|
|
933
|
+
data = uactivo.UsuarioSistema.TDOC + "-" + uactivo.UsuarioSistema.NDOC;
|
|
934
|
+
break;
|
|
935
|
+
case '@tdocactivo':
|
|
936
|
+
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
937
|
+
if (!uactivo)
|
|
938
|
+
console.log('Validar configuracion de sesion');
|
|
939
|
+
else
|
|
940
|
+
data = uactivo.UsuarioSistema.TDOC;
|
|
941
|
+
break;
|
|
942
|
+
case '@ndocactivo':
|
|
943
|
+
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
944
|
+
if (!uactivo)
|
|
945
|
+
console.log('Validar configuracion de sesion');
|
|
946
|
+
else
|
|
947
|
+
data = uactivo.UsuarioSistema.NDOC;
|
|
948
|
+
break;
|
|
949
|
+
case '@hoy':
|
|
950
|
+
data = new Date();
|
|
951
|
+
break;
|
|
952
|
+
default:
|
|
953
|
+
data = value;
|
|
954
|
+
break;
|
|
955
|
+
}
|
|
956
|
+
return data;
|
|
957
|
+
};
|
|
958
|
+
RegistroChildComponent.prototype.submit = function () {
|
|
959
|
+
this.applyValuesOnEvent('onSubmit', this.esquema);
|
|
960
|
+
if (!this.validateData())
|
|
961
|
+
return;
|
|
962
|
+
this.ref.close(this.data);
|
|
963
|
+
};
|
|
964
|
+
RegistroChildComponent.prototype.cancel = function () {
|
|
965
|
+
this.applyValuesOnEvent('onCancel', this.esquema);
|
|
966
|
+
this.ref.close();
|
|
967
|
+
};
|
|
968
|
+
RegistroChildComponent.prototype.validateData = function () {
|
|
969
|
+
if (this.esquema.validations.type == 'local')
|
|
970
|
+
return this.validateDataLocal();
|
|
971
|
+
return true;
|
|
972
|
+
};
|
|
973
|
+
RegistroChildComponent.prototype.validateDataLocal = function () {
|
|
974
|
+
var _this = this;
|
|
975
|
+
var err = [];
|
|
976
|
+
this.esquema.validations.required.forEach(function (x) {
|
|
977
|
+
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
978
|
+
err.push(x.message);
|
|
979
|
+
});
|
|
980
|
+
if (err.length != 0)
|
|
981
|
+
this.messageService.add({ severity: 'warn', detail: err.join('. ') });
|
|
982
|
+
return err.length == 0;
|
|
983
|
+
};
|
|
984
|
+
RegistroChildComponent.prototype.applyValuesOnEvent = function (event, esquema, scope) {
|
|
985
|
+
var _this = this;
|
|
986
|
+
if (scope) {
|
|
987
|
+
if (esquema.properties[scope][event]) {
|
|
988
|
+
esquema.properties[scope][event].forEach(function (value) {
|
|
989
|
+
_this.setValueEvent(_this.data, value);
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
else {
|
|
994
|
+
for (var key in esquema.properties) {
|
|
995
|
+
if (esquema.properties[key][event]) {
|
|
996
|
+
esquema.properties[key][event].forEach(function (value) {
|
|
997
|
+
_this.setValueEvent(_this.data, value);
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
RegistroChildComponent.prototype.setValueEvent = function (data, params) {
|
|
1004
|
+
var _a;
|
|
1005
|
+
var value;
|
|
1006
|
+
var date = moment__namespace(new Date());
|
|
1007
|
+
switch (params.op) {
|
|
1008
|
+
case 'sum':
|
|
1009
|
+
value = jsonpath__namespace.query(data, params === null || params === void 0 ? void 0 : params.scope[0]).reduce(function (acc, cur) { return acc += (params === null || params === void 0 ? void 0 : params.key) ? cur[params.key] : cur; }, 0);
|
|
1010
|
+
break;
|
|
1011
|
+
case 'concat':
|
|
1012
|
+
var array_1 = [];
|
|
1013
|
+
(_a = params === null || params === void 0 ? void 0 : params.key) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, cur) {
|
|
1014
|
+
array_1.push(jsonpath__namespace.query(data, cur)[0]);
|
|
1015
|
+
}, []);
|
|
1016
|
+
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
1017
|
+
jsonpath__namespace.value(data, params.scope[0], array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' '));
|
|
1018
|
+
break;
|
|
1019
|
+
case 'enable':
|
|
1020
|
+
jsonpath__namespace.value(this.esquema, params.scope[0], false);
|
|
1021
|
+
break;
|
|
1022
|
+
case 'disabled':
|
|
1023
|
+
jsonpath__namespace.value(this.esquema, params.scope[0], true);
|
|
1024
|
+
break;
|
|
1025
|
+
case 'replace:endpoint':
|
|
1026
|
+
jsonpath__namespace.value(this.esquema, params.scope[0], jsonpath__namespace.query(this.esquema, params.scope[1])[0].replace(params.scope[2], jsonpath__namespace.query(data, "$.." + params.key)));
|
|
1027
|
+
break;
|
|
1028
|
+
case 'setNull':
|
|
1029
|
+
jsonpath__namespace.value(this.data, "$." + params.key, null);
|
|
1030
|
+
break;
|
|
1031
|
+
case 'datediff:years':
|
|
1032
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'years'));
|
|
1033
|
+
break;
|
|
1034
|
+
case 'datediff:months':
|
|
1035
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'months'));
|
|
1036
|
+
break;
|
|
1037
|
+
case 'datediff:weeks':
|
|
1038
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'weeks'));
|
|
1039
|
+
break;
|
|
1040
|
+
case 'datediff:days':
|
|
1041
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'days'));
|
|
1042
|
+
break;
|
|
1043
|
+
default:
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
return value;
|
|
1047
|
+
};
|
|
1048
|
+
RegistroChildComponent.prototype.sendNotification = function (message) {
|
|
1049
|
+
this.messageService.add(message);
|
|
1050
|
+
};
|
|
1051
|
+
RegistroChildComponent.prototype.applyValuesFromObject = function (event) {
|
|
1052
|
+
var _this = this;
|
|
1053
|
+
if (event.data)
|
|
1054
|
+
event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), _this.aplyFormatValue(value.scope, event.data[value.key])); });
|
|
1055
|
+
else
|
|
1056
|
+
event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), null); });
|
|
1057
|
+
};
|
|
1058
|
+
RegistroChildComponent.prototype.aplyFormatValue = function (scope, value) {
|
|
1059
|
+
var control = jsonpath__namespace.query(this.esquema, scope)[0];
|
|
1060
|
+
var resp;
|
|
1061
|
+
switch (control.type) {
|
|
1062
|
+
case 'date':
|
|
1063
|
+
resp = new Date("" + value);
|
|
1064
|
+
break;
|
|
1065
|
+
case 'numeric':
|
|
1066
|
+
resp = +value;
|
|
1067
|
+
break;
|
|
1068
|
+
default:
|
|
1069
|
+
resp = value;
|
|
1070
|
+
break;
|
|
1071
|
+
}
|
|
1072
|
+
return resp;
|
|
1073
|
+
};
|
|
1074
|
+
return RegistroChildComponent;
|
|
1075
|
+
}());
|
|
1076
|
+
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 });
|
|
1077
|
+
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>\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>", 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", "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]" }] });
|
|
1078
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, decorators: [{
|
|
1079
|
+
type: i0.Component,
|
|
1080
|
+
args: [{
|
|
1081
|
+
selector: 'lib-registro-child',
|
|
1082
|
+
templateUrl: './registro-child.component.html',
|
|
1083
|
+
providers: [i3$1.MessageService]
|
|
1084
|
+
}]
|
|
1085
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.DynamicDialogRef }, { type: i1__namespace$1.DynamicDialogConfig }, { type: i3__namespace$1.MessageService }]; } });
|
|
1086
|
+
|
|
1087
|
+
var SfCrudService = /** @class */ (function () {
|
|
1088
|
+
function SfCrudService() {
|
|
1089
|
+
this._dataTemp = [];
|
|
1090
|
+
}
|
|
1091
|
+
SfCrudService.prototype.saveDataTemp = function (scope, value) {
|
|
1092
|
+
this._dataTemp.push({ scope: scope, value: value });
|
|
1093
|
+
sessionStorage.setItem('dataTemp', JSON.stringify(this._dataTemp));
|
|
1094
|
+
};
|
|
1095
|
+
SfCrudService.prototype.getDataTemp = function () {
|
|
1096
|
+
var dataTemp = sessionStorage.getItem('dataTemp');
|
|
1097
|
+
sessionStorage.removeItem('dataTemp');
|
|
1098
|
+
return dataTemp ? JSON.parse(dataTemp) : [];
|
|
1099
|
+
};
|
|
1100
|
+
SfCrudService.prototype.cleanDataTemp = function () {
|
|
1101
|
+
sessionStorage.removeItem('dataTemp');
|
|
1102
|
+
};
|
|
1103
|
+
return SfCrudService;
|
|
1104
|
+
}());
|
|
1105
|
+
SfCrudService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1106
|
+
SfCrudService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, providedIn: 'root' });
|
|
1107
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, decorators: [{
|
|
1108
|
+
type: i0.Injectable,
|
|
1109
|
+
args: [{
|
|
1110
|
+
providedIn: 'root'
|
|
1111
|
+
}]
|
|
1112
|
+
}], ctorParameters: function () { return []; } });
|
|
1113
|
+
|
|
617
1114
|
var RegistroComponent = /** @class */ (function () {
|
|
618
|
-
function RegistroComponent(generalService, router, messageSerice) {
|
|
1115
|
+
function RegistroComponent(generalService, router, messageSerice, dialogService, sfCrudService) {
|
|
619
1116
|
this.generalService = generalService;
|
|
620
1117
|
this.router = router;
|
|
621
1118
|
this.messageSerice = messageSerice;
|
|
1119
|
+
this.dialogService = dialogService;
|
|
1120
|
+
this.sfCrudService = sfCrudService;
|
|
622
1121
|
this.idKatios = '';
|
|
623
1122
|
this.idEntidad = '';
|
|
624
1123
|
this.trx = '';
|
|
625
1124
|
this.id = '';
|
|
626
|
-
this.
|
|
1125
|
+
this.sendData = new i0.EventEmitter();
|
|
1126
|
+
this.onSubmit = new i0.EventEmitter();
|
|
1127
|
+
this.dataTemp = [];
|
|
627
1128
|
this.crudConfig = new CrudConfig();
|
|
1129
|
+
this.enProceso = false;
|
|
628
1130
|
this.configOperation = new Operations();
|
|
1131
|
+
this.isLocal = false;
|
|
1132
|
+
this.dataTemp = this.sfCrudService.getDataTemp();
|
|
629
1133
|
}
|
|
630
1134
|
RegistroComponent.prototype.ngOnInit = function () {
|
|
631
1135
|
this.loadConfigCrud();
|
|
632
|
-
this.setLabelSumbit();
|
|
633
1136
|
};
|
|
634
1137
|
RegistroComponent.prototype.loadConfigCrud = function () {
|
|
635
1138
|
var _this = this;
|
|
636
1139
|
this.enProceso = true;
|
|
637
1140
|
this.generalService.getCrudByEntidad(this.idKatios, this.idEntidad)
|
|
638
1141
|
.then(function (res) {
|
|
1142
|
+
_this.setDataTemp(res.esquema, _this.dataTemp);
|
|
639
1143
|
_this.crudConfig = res;
|
|
640
|
-
if (_this.trx
|
|
641
|
-
_this.getInfoRegistro(_this.crudConfig.registro);
|
|
642
|
-
else {
|
|
1144
|
+
if (_this.trx == 'c') {
|
|
643
1145
|
_this.data = _this.createObject(_this.crudConfig.esquema);
|
|
1146
|
+
_this.setLabelSumbit();
|
|
644
1147
|
_this.enProceso = false;
|
|
1148
|
+
_this.configOperation = _this.crudConfig.registro.operations.find(function (x) { return x.type.startsWith(_this.trx); }) || new Operations();
|
|
645
1149
|
}
|
|
646
|
-
|
|
1150
|
+
else
|
|
1151
|
+
_this.getInfoRegistro(_this.crudConfig.registro);
|
|
647
1152
|
})
|
|
648
1153
|
.catch(function (err) {
|
|
649
1154
|
console.log(err);
|
|
@@ -665,11 +1170,25 @@
|
|
|
665
1170
|
var op = configRegistro.operations.find(function (x) { return x.type == 'read'; });
|
|
666
1171
|
var endpoint = (op === null || op === void 0 ? void 0 : op.endpoint) || '';
|
|
667
1172
|
endpoint = endpoint.replace('@idKatios', this.idKatios);
|
|
1173
|
+
endpoint = endpoint.replace('@ndocactivo', this.user.UsuarioSistema.NDOC);
|
|
668
1174
|
endpoint = endpoint.replace('@id', this.id);
|
|
669
1175
|
this.generalService.genericRequest((op === null || op === void 0 ? void 0 : op.method) || '', (op === null || op === void 0 ? void 0 : op.server) || '', endpoint)
|
|
670
1176
|
.then(function (res) {
|
|
671
|
-
|
|
1177
|
+
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
1178
|
+
if (Array.isArray(res.data))
|
|
1179
|
+
_this.data = res.data[0];
|
|
1180
|
+
else
|
|
1181
|
+
_this.data = res.data;
|
|
1182
|
+
_this.trx = 'u';
|
|
1183
|
+
}
|
|
1184
|
+
else {
|
|
1185
|
+
_this.trx = 'c';
|
|
1186
|
+
_this.data = _this.createObject(_this.crudConfig.esquema);
|
|
1187
|
+
console.log(_this.data);
|
|
1188
|
+
}
|
|
672
1189
|
_this.enProceso = false;
|
|
1190
|
+
_this.configOperation = _this.crudConfig.registro.operations.find(function (x) { return x.type.startsWith(_this.trx); }) || new Operations();
|
|
1191
|
+
_this.setLabelSumbit();
|
|
673
1192
|
})
|
|
674
1193
|
.catch(function (err) {
|
|
675
1194
|
console.log(err);
|
|
@@ -686,19 +1205,34 @@
|
|
|
686
1205
|
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
687
1206
|
};
|
|
688
1207
|
RegistroComponent.prototype.setValue = function (value, scope) {
|
|
689
|
-
|
|
1208
|
+
var _this = this;
|
|
1209
|
+
switch (typeof (value)) {
|
|
1210
|
+
case 'object':
|
|
1211
|
+
if (Array.isArray(value))
|
|
1212
|
+
value.forEach(function (val) { return jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value); });
|
|
1213
|
+
else
|
|
1214
|
+
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1215
|
+
break;
|
|
1216
|
+
default:
|
|
1217
|
+
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
690
1221
|
};
|
|
691
1222
|
RegistroComponent.prototype.createObject = function (esquema) {
|
|
692
1223
|
var object = {};
|
|
693
1224
|
switch (esquema.type) {
|
|
1225
|
+
case 'numeric':
|
|
1226
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
694
1227
|
case 'string':
|
|
695
|
-
case 'number':
|
|
696
1228
|
case 'date':
|
|
697
1229
|
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
698
1230
|
case 'boolean':
|
|
699
1231
|
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
700
1232
|
case 'array':
|
|
701
1233
|
return [];
|
|
1234
|
+
case 'file':
|
|
1235
|
+
return null;
|
|
702
1236
|
case 'object':
|
|
703
1237
|
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
704
1238
|
Object.defineProperty(object, key, { value: this.createObject(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
@@ -711,8 +1245,10 @@
|
|
|
711
1245
|
};
|
|
712
1246
|
RegistroComponent.prototype.submit = function () {
|
|
713
1247
|
var _this = this;
|
|
1248
|
+
console.log(this.data);
|
|
714
1249
|
if (!this.validateData())
|
|
715
1250
|
return;
|
|
1251
|
+
this.applyValuesOnEvent('onSubmit', this.crudConfig.esquema);
|
|
716
1252
|
this.enProceso = true;
|
|
717
1253
|
var endpoint = this.configOperation.endpoint;
|
|
718
1254
|
endpoint = endpoint.replace('@idKatios', this.idKatios);
|
|
@@ -720,9 +1256,13 @@
|
|
|
720
1256
|
this.generalService.genericRequest(this.configOperation.method, this.configOperation.server, endpoint, this.data)
|
|
721
1257
|
.then(function () {
|
|
722
1258
|
_this.messageSerice.add({ severity: 'success', detail: "Proceso exitoso!" });
|
|
1259
|
+
_this.enProceso = false;
|
|
723
1260
|
setTimeout(function () {
|
|
724
|
-
|
|
725
|
-
_this.
|
|
1261
|
+
var _a, _b;
|
|
1262
|
+
if ((_a = _this.configOperation) === null || _a === void 0 ? void 0 : _a.redirect)
|
|
1263
|
+
_this.router.navigate([(_b = _this.configOperation) === null || _b === void 0 ? void 0 : _b.redirect]);
|
|
1264
|
+
else
|
|
1265
|
+
_this.onSubmit.emit(_this.data);
|
|
726
1266
|
}, 2000);
|
|
727
1267
|
})
|
|
728
1268
|
.catch(function (err) {
|
|
@@ -738,11 +1278,24 @@
|
|
|
738
1278
|
};
|
|
739
1279
|
RegistroComponent.prototype.validateDataLocal = function () {
|
|
740
1280
|
var _this = this;
|
|
1281
|
+
var _a, _b, _c, _d;
|
|
741
1282
|
var err = [];
|
|
742
|
-
this.configOperation.validations.required.forEach(function (x) {
|
|
1283
|
+
(_b = (_a = this.configOperation.validations) === null || _a === void 0 ? void 0 : _a.required) === null || _b === void 0 ? void 0 : _b.forEach(function (x) {
|
|
743
1284
|
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
744
1285
|
err.push(x.message);
|
|
745
1286
|
});
|
|
1287
|
+
(_d = (_c = this.configOperation.validations) === null || _c === void 0 ? void 0 : _c.operations) === null || _d === void 0 ? void 0 : _d.forEach(function (op) {
|
|
1288
|
+
switch (op.action) {
|
|
1289
|
+
case 'sumArray':
|
|
1290
|
+
var var1 = jsonpath__namespace.query(_this.data, op.scope[0]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1291
|
+
var var2 = jsonpath__namespace.query(_this.data, op.scope[1]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1292
|
+
if (var1 != var2)
|
|
1293
|
+
err.push(op.message);
|
|
1294
|
+
break;
|
|
1295
|
+
default:
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
746
1299
|
if (err.length != 0)
|
|
747
1300
|
this.messageSerice.add({ severity: 'warn', detail: err.join('. ') });
|
|
748
1301
|
return err.length == 0;
|
|
@@ -751,11 +1304,13 @@
|
|
|
751
1304
|
var data = null;
|
|
752
1305
|
switch (value) {
|
|
753
1306
|
case '@uactivo':
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
1307
|
+
data = this.user.UsuarioSistema.TDOC + "-" + this.user.UsuarioSistema.NDOC;
|
|
1308
|
+
break;
|
|
1309
|
+
case '@tdocactivo':
|
|
1310
|
+
data = this.user.UsuarioSistema.TDOC;
|
|
1311
|
+
break;
|
|
1312
|
+
case '@ndocactivo':
|
|
1313
|
+
data = this.user.UsuarioSistema.NDOC;
|
|
759
1314
|
break;
|
|
760
1315
|
case '@hoy':
|
|
761
1316
|
data = new Date();
|
|
@@ -766,18 +1321,159 @@
|
|
|
766
1321
|
}
|
|
767
1322
|
return data;
|
|
768
1323
|
};
|
|
1324
|
+
RegistroComponent.prototype.sendNotification = function (message) {
|
|
1325
|
+
this.messageSerice.add(message);
|
|
1326
|
+
};
|
|
1327
|
+
RegistroComponent.prototype.addObjectArray = function (element) {
|
|
1328
|
+
var _this = this;
|
|
1329
|
+
this.dialogRef = this.dialogService.open(RegistroChildComponent, {
|
|
1330
|
+
header: "Detalle",
|
|
1331
|
+
width: '70%',
|
|
1332
|
+
modal: true,
|
|
1333
|
+
closable: false,
|
|
1334
|
+
data: {
|
|
1335
|
+
uiEsquema: Object.assign({}, element.elements),
|
|
1336
|
+
esquema: this.getControl(element.scope),
|
|
1337
|
+
id: this.getValue(element.scope).length + 1
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
this.dialogRef.onClose.subscribe(function (data) {
|
|
1341
|
+
if (data)
|
|
1342
|
+
_this.data[element.scope.replace('$..properties.', '')].push(data);
|
|
1343
|
+
_this.applyValuesOnEvent('onChange', _this.crudConfig.esquema, element.scope.replace('$..properties.', ''));
|
|
1344
|
+
});
|
|
1345
|
+
};
|
|
1346
|
+
RegistroComponent.prototype.editRow = function (element, data, index) {
|
|
1347
|
+
var _this = this;
|
|
1348
|
+
this.dialogRef = this.dialogService.open(RegistroChildComponent, {
|
|
1349
|
+
header: "Detalle",
|
|
1350
|
+
width: '70%',
|
|
1351
|
+
modal: true,
|
|
1352
|
+
closable: false,
|
|
1353
|
+
data: {
|
|
1354
|
+
uiEsquema: Object.assign({}, element.elements),
|
|
1355
|
+
esquema: this.getControl(element.scope),
|
|
1356
|
+
data: Object.assign({}, data)
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
this.dialogRef.onClose.subscribe(function (data) {
|
|
1360
|
+
if (data)
|
|
1361
|
+
_this.data[element.scope.replace('$..properties.', '')][index] = data;
|
|
1362
|
+
_this.applyValuesOnEvent('onChange', _this.crudConfig.esquema, element.scope.replace('$..properties.', ''));
|
|
1363
|
+
});
|
|
1364
|
+
};
|
|
1365
|
+
RegistroComponent.prototype.deleteRow = function (element, index) {
|
|
1366
|
+
this.data[element.scope.replace('$..properties.', '')].splice(index, 1);
|
|
1367
|
+
index = 1;
|
|
1368
|
+
this.data[element.scope.replace('$..properties.', '')].forEach(function (el) {
|
|
1369
|
+
el.id = index;
|
|
1370
|
+
index++;
|
|
1371
|
+
});
|
|
1372
|
+
this.applyValuesOnEvent('onChange', this.crudConfig.esquema, element.scope.replace('$..properties.', ''));
|
|
1373
|
+
};
|
|
1374
|
+
RegistroComponent.prototype.applyValuesOnEvent = function (event, esquema, key) {
|
|
1375
|
+
var _this = this;
|
|
1376
|
+
if (key) {
|
|
1377
|
+
if (esquema.properties[key][event]) {
|
|
1378
|
+
esquema.properties[key][event].forEach(function (value) {
|
|
1379
|
+
_this.setValueEvent(_this.data, value);
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
else {
|
|
1384
|
+
for (var key_1 in esquema.properties) {
|
|
1385
|
+
if (esquema.properties[key_1][event]) {
|
|
1386
|
+
esquema.properties[key_1][event].forEach(function (value) {
|
|
1387
|
+
_this.setValueEvent(_this.data, value);
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
RegistroComponent.prototype.setValueEvent = function (data, params) {
|
|
1394
|
+
var _a;
|
|
1395
|
+
var date = moment__namespace(new Date());
|
|
1396
|
+
switch (params.op) {
|
|
1397
|
+
case 'sum':
|
|
1398
|
+
jsonpath__namespace.value(data, params.scope[1], jsonpath__namespace.query(data, params.scope[0]).reduce(function (acc, cur) { return acc += (params === null || params === void 0 ? void 0 : params.key) ? cur[params.key] : cur; }, 0));
|
|
1399
|
+
break;
|
|
1400
|
+
case 'concat':
|
|
1401
|
+
var array_1 = [];
|
|
1402
|
+
(_a = params === null || params === void 0 ? void 0 : params.key) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, cur) {
|
|
1403
|
+
array_1.push(jsonpath__namespace.query(data, cur)[0]);
|
|
1404
|
+
}, []);
|
|
1405
|
+
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
1406
|
+
jsonpath__namespace.value(data, params.scope[0], array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' '));
|
|
1407
|
+
break;
|
|
1408
|
+
case 'enable':
|
|
1409
|
+
jsonpath__namespace.value(this.crudConfig.esquema, params.scope[0], false);
|
|
1410
|
+
break;
|
|
1411
|
+
case 'disabled':
|
|
1412
|
+
jsonpath__namespace.value(this.crudConfig.esquema, params.scope[0], true);
|
|
1413
|
+
break;
|
|
1414
|
+
case 'replace:endpoint':
|
|
1415
|
+
jsonpath__namespace.value(this.crudConfig.esquema, params.scope[0], this.crudConfig.esquema.config.endpointtemp.replace(params.scope[1], jsonpath__namespace.query(data, "$.." + params.key)));
|
|
1416
|
+
break;
|
|
1417
|
+
case 'setNull':
|
|
1418
|
+
jsonpath__namespace.value(this.data, "$." + params.key, null);
|
|
1419
|
+
break;
|
|
1420
|
+
case 'datediff:years':
|
|
1421
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'years'));
|
|
1422
|
+
break;
|
|
1423
|
+
case 'datediff:months':
|
|
1424
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'months'));
|
|
1425
|
+
break;
|
|
1426
|
+
case 'datediff:weeks':
|
|
1427
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'weeks'));
|
|
1428
|
+
break;
|
|
1429
|
+
case 'datediff:days':
|
|
1430
|
+
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'days'));
|
|
1431
|
+
break;
|
|
1432
|
+
default:
|
|
1433
|
+
break;
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
RegistroComponent.prototype.setDataTemp = function (esquema, dataTemp) {
|
|
1437
|
+
dataTemp.forEach(function (data) {
|
|
1438
|
+
jsonpath__namespace.value(esquema, data.scope, data.value);
|
|
1439
|
+
});
|
|
1440
|
+
};
|
|
1441
|
+
RegistroComponent.prototype.applyValuesFromObject = function (event) {
|
|
1442
|
+
var _this = this;
|
|
1443
|
+
if (event.data)
|
|
1444
|
+
event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), _this.aplyFormatValue(value.scope, event.data[value.key])); });
|
|
1445
|
+
else
|
|
1446
|
+
event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), null); });
|
|
1447
|
+
};
|
|
1448
|
+
RegistroComponent.prototype.aplyFormatValue = function (scope, value) {
|
|
1449
|
+
var control = jsonpath__namespace.query(this.crudConfig.esquema, scope)[0];
|
|
1450
|
+
var resp;
|
|
1451
|
+
switch (control.type) {
|
|
1452
|
+
case 'date':
|
|
1453
|
+
resp = new Date("" + value);
|
|
1454
|
+
break;
|
|
1455
|
+
case 'numeric':
|
|
1456
|
+
resp = +value;
|
|
1457
|
+
break;
|
|
1458
|
+
default:
|
|
1459
|
+
resp = value;
|
|
1460
|
+
break;
|
|
1461
|
+
}
|
|
1462
|
+
return resp;
|
|
1463
|
+
};
|
|
769
1464
|
return RegistroComponent;
|
|
770
1465
|
}());
|
|
771
|
-
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 });
|
|
772
|
-
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\" >\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\" [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <div *ngSwitchCase=\"'Control'\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"card-footer\" *ngIf=\"btnSubmit\">\r\n <button pButton pRipple type=\"button\" [icon]=\"btnSubmit.icon\" [label]=\"btnSubmit.label\" (click)=\"submit()\"></button>\r\n </div>\r\n</div>", components: [{ type: i3__namespace.BlockUI, selector: "p-blockUI", inputs: ["autoZIndex", "baseZIndex", "blocked", "target", "styleClass"] }, { type: i5__namespace$1.Toast, selector: "p-toast", inputs: ["autoZIndex", "baseZIndex", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "key", "style", "styleClass", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value"], outputs: ["setValue"] }], directives: [{ type: i7__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: 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"] }] });
|
|
1466
|
+
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 }, { token: SfCrudService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1467
|
+
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: [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 *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$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", "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: i3__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "currency": i7__namespace.CurrencyPipe, "date": i7__namespace.DatePipe } });
|
|
773
1468
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, decorators: [{
|
|
774
1469
|
type: i0.Component,
|
|
775
1470
|
args: [{
|
|
776
1471
|
selector: 'sf-registro',
|
|
777
1472
|
templateUrl: './registro.component.html',
|
|
778
|
-
providers: [i3$1.MessageService]
|
|
1473
|
+
providers: [i3$1.MessageService, i1$1.DialogService, i1$1.DynamicDialogConfig, i1$1.DynamicDialogRef],
|
|
1474
|
+
entryComponents: [RegistroComponent]
|
|
779
1475
|
}]
|
|
780
|
-
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }, { type: i3__namespace$1.MessageService }]; }, propDecorators: { idKatios: [{
|
|
1476
|
+
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }, { type: i3__namespace$1.MessageService }, { type: i1__namespace$1.DialogService }, { type: SfCrudService }]; }, propDecorators: { idKatios: [{
|
|
781
1477
|
type: i0.Input
|
|
782
1478
|
}], idEntidad: [{
|
|
783
1479
|
type: i0.Input
|
|
@@ -785,6 +1481,12 @@
|
|
|
785
1481
|
type: i0.Input
|
|
786
1482
|
}], id: [{
|
|
787
1483
|
type: i0.Input
|
|
1484
|
+
}], user: [{
|
|
1485
|
+
type: i0.Input
|
|
1486
|
+
}], sendData: [{
|
|
1487
|
+
type: i0.Output
|
|
1488
|
+
}], onSubmit: [{
|
|
1489
|
+
type: i0.Output
|
|
788
1490
|
}] } });
|
|
789
1491
|
|
|
790
1492
|
var SfCrudComponent = /** @class */ (function () {
|
|
@@ -814,41 +1516,42 @@
|
|
|
814
1516
|
SfCrudModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, declarations: [SfCrudComponent,
|
|
815
1517
|
TableroComponent,
|
|
816
1518
|
RegistroComponent,
|
|
817
|
-
ControlComponent
|
|
1519
|
+
ControlComponent,
|
|
1520
|
+
RegistroChildComponent], imports: [accordion.AccordionModule,
|
|
1521
|
+
i4$1.AutoCompleteModule,
|
|
818
1522
|
avatargroup.AvatarGroupModule,
|
|
819
1523
|
avatar.AvatarModule,
|
|
820
1524
|
badge.BadgeModule,
|
|
821
1525
|
i3.BlockUIModule,
|
|
822
1526
|
breadcrumb.BreadcrumbModule,
|
|
823
|
-
|
|
824
|
-
|
|
1527
|
+
i9.ButtonModule,
|
|
1528
|
+
i5$1.CalendarModule,
|
|
825
1529
|
card.CardModule,
|
|
826
1530
|
carousel.CarouselModule,
|
|
827
1531
|
cascadeselect.CascadeSelectModule,
|
|
828
1532
|
checkbox.CheckboxModule,
|
|
829
1533
|
chip.ChipModule,
|
|
830
1534
|
chips.ChipsModule,
|
|
831
|
-
codehighlighter.CodeHighlighterModule,
|
|
832
1535
|
colorpicker.ColorPickerModule,
|
|
833
1536
|
confirmdialog.ConfirmDialogModule,
|
|
834
1537
|
confirmpopup.ConfirmPopupModule,
|
|
835
1538
|
contextmenu.ContextMenuModule,
|
|
836
1539
|
dialog.DialogModule,
|
|
837
1540
|
divider.DividerModule,
|
|
838
|
-
|
|
1541
|
+
i3$2.DropdownModule,
|
|
1542
|
+
i1$1.DynamicDialogModule,
|
|
839
1543
|
fieldset.FieldsetModule,
|
|
840
|
-
|
|
841
|
-
|
|
1544
|
+
i7$1.FileUploadModule,
|
|
1545
|
+
i10$1.FormsModule,
|
|
842
1546
|
galleria.GalleriaModule,
|
|
843
1547
|
i1.HttpClientModule,
|
|
844
1548
|
inplace.InplaceModule,
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1549
|
+
i2$1.InputMaskModule,
|
|
1550
|
+
i6$1.InputNumberModule,
|
|
1551
|
+
i8.InputSwitchModule,
|
|
848
1552
|
inputtextarea.InputTextareaModule,
|
|
849
|
-
|
|
1553
|
+
i11.InputTextModule,
|
|
850
1554
|
knob.KnobModule,
|
|
851
|
-
lightbox.LightboxModule,
|
|
852
1555
|
listbox.ListboxModule,
|
|
853
1556
|
megamenu.MegaMenuModule,
|
|
854
1557
|
menubar.MenubarModule,
|
|
@@ -864,7 +1567,7 @@
|
|
|
864
1567
|
progressbar.ProgressBarModule,
|
|
865
1568
|
radiobutton.RadioButtonModule,
|
|
866
1569
|
rating.RatingModule,
|
|
867
|
-
|
|
1570
|
+
i10.RippleModule,
|
|
868
1571
|
scrollpanel.ScrollPanelModule,
|
|
869
1572
|
scrolltop.ScrollTopModule,
|
|
870
1573
|
selectbutton.SelectButtonModule,
|
|
@@ -872,6 +1575,7 @@
|
|
|
872
1575
|
skeleton.SkeletonModule,
|
|
873
1576
|
slidemenu.SlideMenuModule,
|
|
874
1577
|
slider.SliderModule,
|
|
1578
|
+
i6.SplitButtonModule,
|
|
875
1579
|
splitter.SplitterModule,
|
|
876
1580
|
steps.StepsModule,
|
|
877
1581
|
i5.TableModule,
|
|
@@ -881,49 +1585,50 @@
|
|
|
881
1585
|
terminal.TerminalModule,
|
|
882
1586
|
tieredmenu.TieredMenuModule,
|
|
883
1587
|
timeline.TimelineModule,
|
|
884
|
-
|
|
1588
|
+
i3$3.ToastModule,
|
|
885
1589
|
togglebutton.ToggleButtonModule,
|
|
886
1590
|
i4.ToolbarModule,
|
|
887
|
-
|
|
1591
|
+
tooltip.TooltipModule,
|
|
888
1592
|
tree.TreeModule], exports: [SfCrudComponent,
|
|
889
1593
|
TableroComponent,
|
|
890
|
-
RegistroComponent
|
|
1594
|
+
RegistroComponent,
|
|
1595
|
+
ControlComponent] });
|
|
891
1596
|
SfCrudModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, imports: [[
|
|
892
1597
|
accordion.AccordionModule,
|
|
1598
|
+
i4$1.AutoCompleteModule,
|
|
893
1599
|
avatargroup.AvatarGroupModule,
|
|
894
1600
|
avatar.AvatarModule,
|
|
895
1601
|
badge.BadgeModule,
|
|
896
1602
|
i3.BlockUIModule,
|
|
897
1603
|
breadcrumb.BreadcrumbModule,
|
|
898
|
-
|
|
899
|
-
|
|
1604
|
+
i9.ButtonModule,
|
|
1605
|
+
i5$1.CalendarModule,
|
|
900
1606
|
card.CardModule,
|
|
901
1607
|
carousel.CarouselModule,
|
|
902
1608
|
cascadeselect.CascadeSelectModule,
|
|
903
1609
|
checkbox.CheckboxModule,
|
|
904
1610
|
chip.ChipModule,
|
|
905
1611
|
chips.ChipsModule,
|
|
906
|
-
codehighlighter.CodeHighlighterModule,
|
|
907
1612
|
colorpicker.ColorPickerModule,
|
|
908
1613
|
confirmdialog.ConfirmDialogModule,
|
|
909
1614
|
confirmpopup.ConfirmPopupModule,
|
|
910
1615
|
contextmenu.ContextMenuModule,
|
|
911
1616
|
dialog.DialogModule,
|
|
912
1617
|
divider.DividerModule,
|
|
913
|
-
|
|
1618
|
+
i3$2.DropdownModule,
|
|
1619
|
+
i1$1.DynamicDialogModule,
|
|
914
1620
|
fieldset.FieldsetModule,
|
|
915
|
-
|
|
916
|
-
|
|
1621
|
+
i7$1.FileUploadModule,
|
|
1622
|
+
i10$1.FormsModule,
|
|
917
1623
|
galleria.GalleriaModule,
|
|
918
1624
|
i1.HttpClientModule,
|
|
919
1625
|
inplace.InplaceModule,
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1626
|
+
i2$1.InputMaskModule,
|
|
1627
|
+
i6$1.InputNumberModule,
|
|
1628
|
+
i8.InputSwitchModule,
|
|
923
1629
|
inputtextarea.InputTextareaModule,
|
|
924
|
-
|
|
1630
|
+
i11.InputTextModule,
|
|
925
1631
|
knob.KnobModule,
|
|
926
|
-
lightbox.LightboxModule,
|
|
927
1632
|
listbox.ListboxModule,
|
|
928
1633
|
megamenu.MegaMenuModule,
|
|
929
1634
|
menubar.MenubarModule,
|
|
@@ -939,7 +1644,7 @@
|
|
|
939
1644
|
progressbar.ProgressBarModule,
|
|
940
1645
|
radiobutton.RadioButtonModule,
|
|
941
1646
|
rating.RatingModule,
|
|
942
|
-
|
|
1647
|
+
i10.RippleModule,
|
|
943
1648
|
scrollpanel.ScrollPanelModule,
|
|
944
1649
|
scrolltop.ScrollTopModule,
|
|
945
1650
|
selectbutton.SelectButtonModule,
|
|
@@ -947,6 +1652,7 @@
|
|
|
947
1652
|
skeleton.SkeletonModule,
|
|
948
1653
|
slidemenu.SlideMenuModule,
|
|
949
1654
|
slider.SliderModule,
|
|
1655
|
+
i6.SplitButtonModule,
|
|
950
1656
|
splitter.SplitterModule,
|
|
951
1657
|
steps.StepsModule,
|
|
952
1658
|
i5.TableModule,
|
|
@@ -956,10 +1662,10 @@
|
|
|
956
1662
|
terminal.TerminalModule,
|
|
957
1663
|
tieredmenu.TieredMenuModule,
|
|
958
1664
|
timeline.TimelineModule,
|
|
959
|
-
|
|
1665
|
+
i3$3.ToastModule,
|
|
960
1666
|
togglebutton.ToggleButtonModule,
|
|
961
1667
|
i4.ToolbarModule,
|
|
962
|
-
|
|
1668
|
+
tooltip.TooltipModule,
|
|
963
1669
|
tree.TreeModule,
|
|
964
1670
|
]] });
|
|
965
1671
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, decorators: [{
|
|
@@ -969,44 +1675,45 @@
|
|
|
969
1675
|
SfCrudComponent,
|
|
970
1676
|
TableroComponent,
|
|
971
1677
|
RegistroComponent,
|
|
972
|
-
ControlComponent
|
|
1678
|
+
ControlComponent,
|
|
1679
|
+
RegistroChildComponent
|
|
973
1680
|
],
|
|
974
1681
|
imports: [
|
|
975
1682
|
accordion.AccordionModule,
|
|
1683
|
+
i4$1.AutoCompleteModule,
|
|
976
1684
|
avatargroup.AvatarGroupModule,
|
|
977
1685
|
avatar.AvatarModule,
|
|
978
1686
|
badge.BadgeModule,
|
|
979
1687
|
i3.BlockUIModule,
|
|
980
1688
|
breadcrumb.BreadcrumbModule,
|
|
981
|
-
|
|
982
|
-
|
|
1689
|
+
i9.ButtonModule,
|
|
1690
|
+
i5$1.CalendarModule,
|
|
983
1691
|
card.CardModule,
|
|
984
1692
|
carousel.CarouselModule,
|
|
985
1693
|
cascadeselect.CascadeSelectModule,
|
|
986
1694
|
checkbox.CheckboxModule,
|
|
987
1695
|
chip.ChipModule,
|
|
988
1696
|
chips.ChipsModule,
|
|
989
|
-
codehighlighter.CodeHighlighterModule,
|
|
990
1697
|
colorpicker.ColorPickerModule,
|
|
991
1698
|
confirmdialog.ConfirmDialogModule,
|
|
992
1699
|
confirmpopup.ConfirmPopupModule,
|
|
993
1700
|
contextmenu.ContextMenuModule,
|
|
994
1701
|
dialog.DialogModule,
|
|
995
1702
|
divider.DividerModule,
|
|
996
|
-
|
|
1703
|
+
i3$2.DropdownModule,
|
|
1704
|
+
i1$1.DynamicDialogModule,
|
|
997
1705
|
fieldset.FieldsetModule,
|
|
998
|
-
|
|
999
|
-
|
|
1706
|
+
i7$1.FileUploadModule,
|
|
1707
|
+
i10$1.FormsModule,
|
|
1000
1708
|
galleria.GalleriaModule,
|
|
1001
1709
|
i1.HttpClientModule,
|
|
1002
1710
|
inplace.InplaceModule,
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1711
|
+
i2$1.InputMaskModule,
|
|
1712
|
+
i6$1.InputNumberModule,
|
|
1713
|
+
i8.InputSwitchModule,
|
|
1006
1714
|
inputtextarea.InputTextareaModule,
|
|
1007
|
-
|
|
1715
|
+
i11.InputTextModule,
|
|
1008
1716
|
knob.KnobModule,
|
|
1009
|
-
lightbox.LightboxModule,
|
|
1010
1717
|
listbox.ListboxModule,
|
|
1011
1718
|
megamenu.MegaMenuModule,
|
|
1012
1719
|
menubar.MenubarModule,
|
|
@@ -1022,7 +1729,7 @@
|
|
|
1022
1729
|
progressbar.ProgressBarModule,
|
|
1023
1730
|
radiobutton.RadioButtonModule,
|
|
1024
1731
|
rating.RatingModule,
|
|
1025
|
-
|
|
1732
|
+
i10.RippleModule,
|
|
1026
1733
|
scrollpanel.ScrollPanelModule,
|
|
1027
1734
|
scrolltop.ScrollTopModule,
|
|
1028
1735
|
selectbutton.SelectButtonModule,
|
|
@@ -1030,6 +1737,7 @@
|
|
|
1030
1737
|
skeleton.SkeletonModule,
|
|
1031
1738
|
slidemenu.SlideMenuModule,
|
|
1032
1739
|
slider.SliderModule,
|
|
1740
|
+
i6.SplitButtonModule,
|
|
1033
1741
|
splitter.SplitterModule,
|
|
1034
1742
|
steps.StepsModule,
|
|
1035
1743
|
i5.TableModule,
|
|
@@ -1039,34 +1747,24 @@
|
|
|
1039
1747
|
terminal.TerminalModule,
|
|
1040
1748
|
tieredmenu.TieredMenuModule,
|
|
1041
1749
|
timeline.TimelineModule,
|
|
1042
|
-
|
|
1750
|
+
i3$3.ToastModule,
|
|
1043
1751
|
togglebutton.ToggleButtonModule,
|
|
1044
1752
|
i4.ToolbarModule,
|
|
1045
|
-
|
|
1753
|
+
tooltip.TooltipModule,
|
|
1046
1754
|
tree.TreeModule,
|
|
1047
1755
|
],
|
|
1048
1756
|
exports: [
|
|
1049
1757
|
SfCrudComponent,
|
|
1050
1758
|
TableroComponent,
|
|
1051
|
-
RegistroComponent
|
|
1759
|
+
RegistroComponent,
|
|
1760
|
+
ControlComponent
|
|
1761
|
+
],
|
|
1762
|
+
entryComponents: [
|
|
1763
|
+
RegistroChildComponent
|
|
1052
1764
|
]
|
|
1053
1765
|
}]
|
|
1054
1766
|
}] });
|
|
1055
1767
|
|
|
1056
|
-
var SfCrudService = /** @class */ (function () {
|
|
1057
|
-
function SfCrudService() {
|
|
1058
|
-
}
|
|
1059
|
-
return SfCrudService;
|
|
1060
|
-
}());
|
|
1061
|
-
SfCrudService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1062
|
-
SfCrudService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, providedIn: 'root' });
|
|
1063
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, decorators: [{
|
|
1064
|
-
type: i0.Injectable,
|
|
1065
|
-
args: [{
|
|
1066
|
-
providedIn: 'root'
|
|
1067
|
-
}]
|
|
1068
|
-
}], ctorParameters: function () { return []; } });
|
|
1069
|
-
|
|
1070
1768
|
/*
|
|
1071
1769
|
* Public API Surface of sf-crud
|
|
1072
1770
|
*/
|
|
@@ -1075,6 +1773,7 @@
|
|
|
1075
1773
|
* Generated bundle index. Do not edit.
|
|
1076
1774
|
*/
|
|
1077
1775
|
|
|
1776
|
+
exports.ControlComponent = ControlComponent;
|
|
1078
1777
|
exports.RegistroComponent = RegistroComponent;
|
|
1079
1778
|
exports.SfCrudComponent = SfCrudComponent;
|
|
1080
1779
|
exports.SfCrudModule = SfCrudModule;
|