sf-crud 12.0.5 → 12.1.1
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 +2566 -1306
- package/bundles/sf-crud.umd.js.map +1 -1
- package/esm2015/lib/components/control/control.component.js +285 -73
- package/esm2015/lib/components/file-upload/file-upload.component.js +143 -0
- package/esm2015/lib/components/form/form.component.js +267 -0
- package/esm2015/lib/components/registro/registro.component.js +507 -407
- package/esm2015/lib/components/step/step.component.js +79 -0
- package/esm2015/lib/components/tablero/tablero.component.js +91 -28
- package/esm2015/lib/sf-crud.module.js +27 -15
- package/esm2015/lib/sf-crud.routing.module.js +23 -0
- package/esm2015/lib/sf-crud.service.js +486 -12
- package/esm2015/lib/shared/models/Conditions.model.js +81 -0
- package/esm2015/lib/shared/models/Empresa.model.js +2 -0
- package/esm2015/lib/shared/models/Reason.model.js +7 -0
- package/esm2015/lib/shared/models/crud-config.model.js +36 -13
- package/esm2015/lib/shared/models/shema.model.js +5 -1
- package/esm2015/lib/shared/services/general.service.js +41 -17
- package/esm2015/lib/shared/services/notification.service.js +83 -0
- package/esm2015/lib/shared/services/step.service.js +65 -0
- package/esm2015/public-api.js +7 -1
- package/fesm2015/sf-crud.js +2197 -1151
- package/fesm2015/sf-crud.js.map +1 -1
- package/lib/components/control/control.component.d.ts +39 -10
- package/lib/components/file-upload/file-upload.component.d.ts +34 -0
- package/lib/components/form/form.component.d.ts +58 -0
- package/lib/components/registro/registro.component.d.ts +81 -54
- package/lib/components/step/step.component.d.ts +27 -0
- package/lib/components/tablero/tablero.component.d.ts +15 -5
- package/lib/sf-crud.module.d.ts +80 -76
- package/lib/sf-crud.routing.module.d.ts +7 -0
- package/lib/sf-crud.service.d.ts +115 -5
- package/lib/shared/models/Conditions.model.d.ts +32 -0
- package/lib/shared/models/Empresa.model.d.ts +11 -0
- package/lib/shared/models/Reason.model.d.ts +5 -0
- package/lib/shared/models/crud-config.model.d.ts +76 -24
- package/lib/shared/models/shema.model.d.ts +27 -0
- package/lib/shared/services/general.service.d.ts +8 -1
- package/lib/shared/services/notification.service.d.ts +27 -0
- package/lib/shared/services/step.service.d.ts +27 -0
- package/package.json +9 -2
- package/public-api.d.ts +6 -0
- package/esm2015/lib/components/registro-child/registro-child.component.js +0 -348
- package/esm2015/lib/components/registro-detalle/registro-detalle.component.js +0 -232
- package/esm2015/lib/shared/models/data-temp-crud.model.js +0 -6
- package/lib/components/registro-child/registro-child.component.d.ts +0 -48
- package/lib/components/registro-detalle/registro-detalle.component.d.ts +0 -36
- package/lib/shared/models/data-temp-crud.model.d.ts +0 -4
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('lodash'), require('jsonpath'), require('@angular/common/http'), require('@angular/router'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('sf-crud', ['exports', '@angular/core', 'lodash', 'jsonpath', '@angular/common/http', '@angular/router', '
|
|
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.
|
|
5
|
-
})(this, (function (exports, i0, _, jsonpath, i1, i2,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('lodash'), require('jsonpath'), require('@angular/common/http'), require('@angular/router'), require('rxjs'), require('moment'), 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('sweetalert2'), require('sf-pdfsign'), require('sf-simulador'), require('primeng/steps'), require('primeng/tooltip'), require('@angular/platform-browser'), require('sf-ado'), require('primeng/inputmask'), require('primeng/dropdown'), require('primeng/autocomplete'), require('primeng/calendar'), require('primeng/inputnumber'), require('primeng/multiselect'), require('primeng/inputswitch'), require('@angular/forms'), require('primeng/inputtextarea'), require('primeng/toast'), require('primeng/dialog'), require('primeng/accordion'), require('primeng/avatargroup'), require('primeng/avatar'), require('primeng/badge'), require('primeng/blockui'), 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/divider'), require('primeng/dynamicdialog'), require('primeng/fieldset'), require('primeng/fileupload'), require('primeng/galleria'), require('primeng/inplace'), require('primeng/knob'), require('primeng/listbox'), require('primeng/megamenu'), require('primeng/menubar'), require('primeng/menu'), require('primeng/message'), 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/tabmenu'), require('primeng/tabview'), require('primeng/tag'), require('primeng/terminal'), require('primeng/tieredmenu'), require('primeng/timeline'), require('primeng/togglebutton'), require('primeng/tree')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('sf-crud', ['exports', '@angular/core', 'lodash', 'jsonpath', '@angular/common/http', '@angular/router', 'rxjs', 'moment', 'primeng/toolbar', 'primeng/table', 'primeng/splitbutton', '@angular/common', 'primeng/api', 'primeng/button', 'primeng/ripple', 'primeng/inputtext', 'sweetalert2', 'sf-pdfsign', 'sf-simulador', 'primeng/steps', 'primeng/tooltip', '@angular/platform-browser', 'sf-ado', 'primeng/inputmask', 'primeng/dropdown', 'primeng/autocomplete', 'primeng/calendar', 'primeng/inputnumber', 'primeng/multiselect', 'primeng/inputswitch', '@angular/forms', 'primeng/inputtextarea', 'primeng/toast', 'primeng/dialog', 'primeng/accordion', 'primeng/avatargroup', 'primeng/avatar', 'primeng/badge', 'primeng/blockui', 'primeng/breadcrumb', 'primeng/card', 'primeng/carousel', 'primeng/cascadeselect', 'primeng/checkbox', 'primeng/chip', 'primeng/chips', 'primeng/colorpicker', 'primeng/confirmdialog', 'primeng/confirmpopup', 'primeng/contextmenu', 'primeng/divider', 'primeng/dynamicdialog', 'primeng/fieldset', 'primeng/fileupload', 'primeng/galleria', 'primeng/inplace', 'primeng/knob', 'primeng/listbox', 'primeng/megamenu', 'primeng/menubar', 'primeng/menu', 'primeng/message', '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/tabmenu', 'primeng/tabview', 'primeng/tag', 'primeng/terminal', 'primeng/tieredmenu', 'primeng/timeline', 'primeng/togglebutton', 'primeng/tree'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["sf-crud"] = {}, global.ng.core, global._, global.jsonpath, global.ng.common.http, global.ng.router, global.rxjs, global.moment, global.i5, global.i6, global.i7, global.ng.common, global.i1$1, global.i9, global.i11, global.i12$1, global.Swal, global.i6$2, global.i7$1, global.i3, global.i13, global.ng.platformBrowser, global.i5$2, global.i4, global.i5$1, global.i6$1, global.i8, global.i9$1, global.i10, global.i11$1, global.ng.forms, global.i16, global.i11$2, global.i11$3, global.accordion, global.avatargroup, global.avatar, global.badge, global.blockui, global.breadcrumb, global.card, global.carousel, global.cascadeselect, global.checkbox, global.chip, global.chips, global.colorpicker, global.confirmdialog, global.confirmpopup, global.contextmenu, global.divider, global.dynamicdialog, global.fieldset, global.fileupload, global.galleria, global.inplace, global.knob, global.listbox, global.megamenu, global.menubar, global.menu, global.message, 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.tabmenu, global.tabview, global.tag, global.terminal, global.tieredmenu, global.timeline, global.togglebutton, global.tree));
|
|
5
|
+
})(this, (function (exports, i0, _, jsonpath, i1, i2, rxjs, moment, i5, i6, i7, i12, i1$1, i9, i11, i12$1, Swal, i6$2, i7$1, i3, i13, i3$1, i5$2, i4, i5$1, i6$1, i8, i9$1, i10, i11$1, i14, i16, i11$2, i11$3, accordion, avatargroup, avatar, badge, blockui, breadcrumb, card, carousel, cascadeselect, checkbox, chip, chips, colorpicker, confirmdialog, confirmpopup, contextmenu, divider, dynamicdialog, fieldset, fileupload, galleria, inplace, knob, listbox, megamenu, menubar, menu, message, organizationchart, overlaypanel, panelmenu, panel, password, progressbar, radiobutton, rating, scrollpanel, scrolltop, selectbutton, sidebar, skeleton, slidemenu, slider, splitter, tabmenu, tabview, tag, terminal, tieredmenu, timeline, togglebutton, tree) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -29,97 +29,33 @@
|
|
|
29
29
|
var jsonpath__namespace = /*#__PURE__*/_interopNamespace(jsonpath);
|
|
30
30
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
31
31
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
32
|
-
var
|
|
33
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
32
|
+
var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
|
|
34
33
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
35
34
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
36
35
|
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
37
|
-
var
|
|
36
|
+
var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
|
|
37
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
38
38
|
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
39
|
-
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
40
39
|
var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
40
|
+
var i12__namespace$1 = /*#__PURE__*/_interopNamespace(i12$1);
|
|
41
|
+
var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
|
|
42
|
+
var i6__namespace$2 = /*#__PURE__*/_interopNamespace(i6$2);
|
|
43
|
+
var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
|
|
44
|
+
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
45
|
+
var i13__namespace = /*#__PURE__*/_interopNamespace(i13);
|
|
45
46
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
46
|
-
var
|
|
47
|
+
var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
|
|
48
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
47
49
|
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
48
50
|
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
49
|
-
var i7__namespace$1 = /*#__PURE__*/_interopNamespace(i7$1);
|
|
50
51
|
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.subtype = '';
|
|
59
|
-
}
|
|
60
|
-
return Shema;
|
|
61
|
-
}());
|
|
62
|
-
|
|
63
|
-
var CrudConfig = /** @class */ (function () {
|
|
64
|
-
function CrudConfig() {
|
|
65
|
-
this.idEntidad = '';
|
|
66
|
-
this.tablero = new ConfigTablero();
|
|
67
|
-
this.esquema = new Shema();
|
|
68
|
-
this.registro = new ConfigRegistro();
|
|
69
|
-
}
|
|
70
|
-
return CrudConfig;
|
|
71
|
-
}());
|
|
72
|
-
var ConfigTablero = /** @class */ (function () {
|
|
73
|
-
function ConfigTablero() {
|
|
74
|
-
this.columns = [];
|
|
75
|
-
this.endpoint = '';
|
|
76
|
-
this.method = '';
|
|
77
|
-
this.server = '';
|
|
78
|
-
this.filters = [];
|
|
79
|
-
this.keys = [];
|
|
80
|
-
}
|
|
81
|
-
return ConfigTablero;
|
|
82
|
-
}());
|
|
83
|
-
var ConfigRegistro = /** @class */ (function () {
|
|
84
|
-
function ConfigRegistro() {
|
|
85
|
-
this.operations = [];
|
|
86
|
-
this.btnBack = '';
|
|
87
|
-
}
|
|
88
|
-
return ConfigRegistro;
|
|
89
|
-
}());
|
|
90
|
-
var Operations = /** @class */ (function () {
|
|
91
|
-
function Operations() {
|
|
92
|
-
this.type = '';
|
|
93
|
-
this.server = '';
|
|
94
|
-
this.endpoint = '';
|
|
95
|
-
this.method = '';
|
|
96
|
-
this.validations = new Validations();
|
|
97
|
-
}
|
|
98
|
-
return Operations;
|
|
99
|
-
}());
|
|
100
|
-
var Key = /** @class */ (function () {
|
|
101
|
-
function Key() {
|
|
102
|
-
}
|
|
103
|
-
return Key;
|
|
104
|
-
}());
|
|
105
|
-
var Validations = /** @class */ (function () {
|
|
106
|
-
function Validations() {
|
|
107
|
-
this.type = '';
|
|
108
|
-
this.required = [];
|
|
109
|
-
this.server = '';
|
|
110
|
-
this.endpoint = '';
|
|
111
|
-
}
|
|
112
|
-
return Validations;
|
|
113
|
-
}());
|
|
114
|
-
var RequestChecking = /** @class */ (function () {
|
|
115
|
-
function RequestChecking(dynamics, statics, swal, redirect) {
|
|
116
|
-
this.dynamics = dynamics;
|
|
117
|
-
this.statics = statics;
|
|
118
|
-
this.swal = swal;
|
|
119
|
-
this.redirect = redirect;
|
|
120
|
-
}
|
|
121
|
-
return RequestChecking;
|
|
122
|
-
}());
|
|
52
|
+
var i9__namespace$1 = /*#__PURE__*/_interopNamespace(i9$1);
|
|
53
|
+
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
54
|
+
var i11__namespace$1 = /*#__PURE__*/_interopNamespace(i11$1);
|
|
55
|
+
var i14__namespace = /*#__PURE__*/_interopNamespace(i14);
|
|
56
|
+
var i16__namespace = /*#__PURE__*/_interopNamespace(i16);
|
|
57
|
+
var i11__namespace$2 = /*#__PURE__*/_interopNamespace(i11$2);
|
|
58
|
+
var i11__namespace$3 = /*#__PURE__*/_interopNamespace(i11$3);
|
|
123
59
|
|
|
124
60
|
/******************************************************************************
|
|
125
61
|
Copyright (c) Microsoft Corporation.
|
|
@@ -533,42 +469,189 @@
|
|
|
533
469
|
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
534
470
|
};
|
|
535
471
|
|
|
472
|
+
var CrudConfig = /** @class */ (function () {
|
|
473
|
+
function CrudConfig() {
|
|
474
|
+
this.idEntidad = '';
|
|
475
|
+
this.uiEsquemas = [];
|
|
476
|
+
this.esquemas = [];
|
|
477
|
+
this.registros = [];
|
|
478
|
+
}
|
|
479
|
+
return CrudConfig;
|
|
480
|
+
}());
|
|
481
|
+
var ConfigTablero = /** @class */ (function () {
|
|
482
|
+
function ConfigTablero() {
|
|
483
|
+
this.columns = [];
|
|
484
|
+
this.endpoint = '';
|
|
485
|
+
this.method = '';
|
|
486
|
+
this.server = '';
|
|
487
|
+
this.filters = [];
|
|
488
|
+
this.keys = [];
|
|
489
|
+
}
|
|
490
|
+
return ConfigTablero;
|
|
491
|
+
}());
|
|
492
|
+
var ConfigRegistro = /** @class */ (function () {
|
|
493
|
+
function ConfigRegistro() {
|
|
494
|
+
this.operations = [];
|
|
495
|
+
this.btnBack = '';
|
|
496
|
+
this.canBack = false;
|
|
497
|
+
this.conditions = [];
|
|
498
|
+
}
|
|
499
|
+
return ConfigRegistro;
|
|
500
|
+
}());
|
|
501
|
+
var Operation = /** @class */ (function () {
|
|
502
|
+
function Operation() {
|
|
503
|
+
this.method = '';
|
|
504
|
+
this.changeTrx = [];
|
|
505
|
+
}
|
|
506
|
+
return Operation;
|
|
507
|
+
}());
|
|
508
|
+
var ConstructionId = /** @class */ (function () {
|
|
509
|
+
function ConstructionId() {
|
|
510
|
+
}
|
|
511
|
+
return ConstructionId;
|
|
512
|
+
}());
|
|
513
|
+
var Validations = /** @class */ (function () {
|
|
514
|
+
function Validations() {
|
|
515
|
+
this.type = '';
|
|
516
|
+
this.required = [];
|
|
517
|
+
this.equals = [];
|
|
518
|
+
this.different = [];
|
|
519
|
+
this.server = '';
|
|
520
|
+
this.endpoint = '';
|
|
521
|
+
}
|
|
522
|
+
return Validations;
|
|
523
|
+
}());
|
|
524
|
+
var ValidationRequired = /** @class */ (function () {
|
|
525
|
+
function ValidationRequired() {
|
|
526
|
+
}
|
|
527
|
+
return ValidationRequired;
|
|
528
|
+
}());
|
|
529
|
+
var ValidationEqual = /** @class */ (function (_super) {
|
|
530
|
+
__extends(ValidationEqual, _super);
|
|
531
|
+
function ValidationEqual(value) {
|
|
532
|
+
var _this = _super.call(this) || this;
|
|
533
|
+
_this.value = value;
|
|
534
|
+
return _this;
|
|
535
|
+
}
|
|
536
|
+
return ValidationEqual;
|
|
537
|
+
}(ValidationRequired));
|
|
538
|
+
var ValidationDifferent = /** @class */ (function (_super) {
|
|
539
|
+
__extends(ValidationDifferent, _super);
|
|
540
|
+
function ValidationDifferent(value) {
|
|
541
|
+
var _this = _super.call(this) || this;
|
|
542
|
+
_this.value = value;
|
|
543
|
+
return _this;
|
|
544
|
+
}
|
|
545
|
+
return ValidationDifferent;
|
|
546
|
+
}(ValidationRequired));
|
|
547
|
+
var RequestChecking = /** @class */ (function () {
|
|
548
|
+
function RequestChecking(dynamics, statics, useSwal, redirect, cancelRedirect, allowContinue, parse) {
|
|
549
|
+
this.dynamics = dynamics;
|
|
550
|
+
this.statics = statics;
|
|
551
|
+
this.useSwal = useSwal;
|
|
552
|
+
this.redirect = redirect;
|
|
553
|
+
this.cancelRedirect = cancelRedirect;
|
|
554
|
+
this.allowContinue = allowContinue;
|
|
555
|
+
this.parse = parse;
|
|
556
|
+
}
|
|
557
|
+
return RequestChecking;
|
|
558
|
+
}());
|
|
559
|
+
var Key = /** @class */ (function () {
|
|
560
|
+
function Key() {
|
|
561
|
+
}
|
|
562
|
+
return Key;
|
|
563
|
+
}());
|
|
564
|
+
var OverrideConfig = /** @class */ (function () {
|
|
565
|
+
function OverrideConfig() {
|
|
566
|
+
}
|
|
567
|
+
return OverrideConfig;
|
|
568
|
+
}());
|
|
569
|
+
var keyEsquema = /** @class */ (function () {
|
|
570
|
+
function keyEsquema() {
|
|
571
|
+
}
|
|
572
|
+
return keyEsquema;
|
|
573
|
+
}());
|
|
574
|
+
|
|
536
575
|
var GeneralService = /** @class */ (function () {
|
|
537
576
|
function GeneralService(http) {
|
|
538
|
-
var _a;
|
|
539
577
|
this.http = http;
|
|
540
578
|
this.generales = '';
|
|
541
|
-
this.jsonConfig = JSON.parse(sessionStorage.getItem('ConfigJSON') || '{}');
|
|
542
|
-
this.generales = (_a = this.jsonConfig) === null || _a === void 0 ? void 0 : _a.ServidorGenerales;
|
|
543
579
|
}
|
|
580
|
+
Object.defineProperty(GeneralService.prototype, "environment", {
|
|
581
|
+
get: function () {
|
|
582
|
+
if (!this.jsonConfig)
|
|
583
|
+
this.environment = JSON.parse(sessionStorage.getItem('ConfigJSON') || '{}');
|
|
584
|
+
return this.jsonConfig;
|
|
585
|
+
},
|
|
586
|
+
set: function (val) {
|
|
587
|
+
var _a;
|
|
588
|
+
this.jsonConfig = val;
|
|
589
|
+
this.generales = (_a = this.jsonConfig) === null || _a === void 0 ? void 0 : _a.ServidorGenerales;
|
|
590
|
+
},
|
|
591
|
+
enumerable: false,
|
|
592
|
+
configurable: true
|
|
593
|
+
});
|
|
594
|
+
Object.defineProperty(GeneralService.prototype, "idKatios", {
|
|
595
|
+
get: function () {
|
|
596
|
+
return this._idKatios;
|
|
597
|
+
},
|
|
598
|
+
set: function (value) {
|
|
599
|
+
this._idKatios = value;
|
|
600
|
+
},
|
|
601
|
+
enumerable: false,
|
|
602
|
+
configurable: true
|
|
603
|
+
});
|
|
544
604
|
GeneralService.prototype.getCrudByEntidad = function (idKatios, idEntidad) {
|
|
545
605
|
return __awaiter(this, void 0, void 0, function () {
|
|
546
606
|
return __generator(this, function (_b) {
|
|
547
|
-
return [2 /*return*/, this.http.get(this.generales + "crud/" + idKatios + "/" + idEntidad)
|
|
548
|
-
.
|
|
549
|
-
|
|
550
|
-
|
|
607
|
+
return [2 /*return*/, this.http.get(this.generales + "crud/forms/" + idKatios + "/" + idEntidad).toPromise()
|
|
608
|
+
.then(function (res) { return res; })];
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
GeneralService.prototype.getFiles = function (urls, names) {
|
|
613
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
614
|
+
var _this = this;
|
|
615
|
+
return __generator(this, function (_b) {
|
|
616
|
+
return [2 /*return*/, Promise.all(urls.map(function (url, i) { return __awaiter(_this, void 0, void 0, function () {
|
|
617
|
+
var response, arrayBuffer, tipo;
|
|
618
|
+
return __generator(this, function (_b) {
|
|
619
|
+
switch (_b.label) {
|
|
620
|
+
case 0: return [4 /*yield*/, this.http.get(url, { responseType: 'blob' }).toPromise()];
|
|
621
|
+
case 1:
|
|
622
|
+
response = _b.sent();
|
|
623
|
+
return [4 /*yield*/, response.arrayBuffer()];
|
|
624
|
+
case 2:
|
|
625
|
+
arrayBuffer = _b.sent();
|
|
626
|
+
tipo = names[i].includes(".pdf") ? 'application/pdf' : "image/" + this.getExt(names[i]);
|
|
627
|
+
return [2 /*return*/, new File([new Uint8Array(arrayBuffer)], names[i], { type: tipo })];
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
}); }))];
|
|
551
631
|
});
|
|
552
632
|
});
|
|
553
633
|
};
|
|
554
|
-
GeneralService.prototype.
|
|
634
|
+
GeneralService.prototype.getExt = function (name) {
|
|
635
|
+
var ext = undefined;
|
|
636
|
+
var aux = name.split('.');
|
|
637
|
+
if (aux.length > 0)
|
|
638
|
+
ext = aux[aux.length - 1];
|
|
639
|
+
return ext;
|
|
640
|
+
};
|
|
641
|
+
GeneralService.prototype.genericRequest = function (method, url, data) {
|
|
555
642
|
return __awaiter(this, void 0, void 0, function () {
|
|
556
643
|
return __generator(this, function (_b) {
|
|
557
644
|
switch (method) {
|
|
558
645
|
case 'GET':
|
|
559
|
-
return [2 /*return*/, this.http.get(
|
|
560
|
-
.toPromise()];
|
|
646
|
+
return [2 /*return*/, this.http.get(url).toPromise()];
|
|
561
647
|
case 'POST':
|
|
562
|
-
return [2 /*return*/, this.http.post(
|
|
563
|
-
.toPromise()];
|
|
648
|
+
return [2 /*return*/, this.http.post(url, data).toPromise()];
|
|
564
649
|
case 'PUT':
|
|
565
|
-
return [2 /*return*/, this.http.put(
|
|
566
|
-
.toPromise()];
|
|
650
|
+
return [2 /*return*/, this.http.put(url, data).toPromise()];
|
|
567
651
|
case 'DELETE':
|
|
568
|
-
return [2 /*return*/, this.http.delete(
|
|
569
|
-
.toPromise()];
|
|
652
|
+
return [2 /*return*/, this.http.delete(url, data).toPromise()];
|
|
570
653
|
default:
|
|
571
|
-
|
|
654
|
+
throw new Error("Invalid method");
|
|
572
655
|
}
|
|
573
656
|
return [2 /*return*/];
|
|
574
657
|
});
|
|
@@ -585,81 +668,913 @@
|
|
|
585
668
|
}]
|
|
586
669
|
}], ctorParameters: function () { return [{ type: i1__namespace.HttpClient }]; } });
|
|
587
670
|
|
|
588
|
-
var
|
|
589
|
-
function
|
|
590
|
-
this.
|
|
591
|
-
this.
|
|
592
|
-
this.
|
|
593
|
-
this.idEntidad = '';
|
|
594
|
-
this.idKatios = '';
|
|
595
|
-
this.onSelectAction = new i0.EventEmitter();
|
|
596
|
-
this.items = [];
|
|
597
|
-
this.crudConfig = new CrudConfig();
|
|
598
|
-
this.enProceso = false;
|
|
599
|
-
this.data = [];
|
|
600
|
-
this.btn = { create: undefined, read: undefined, update: undefined, delete: undefined };
|
|
671
|
+
var Condition = /** @class */ (function () {
|
|
672
|
+
function Condition(type, attrs, indexData) {
|
|
673
|
+
this.type = type;
|
|
674
|
+
this.attrs = attrs;
|
|
675
|
+
this.indexData = indexData;
|
|
601
676
|
}
|
|
602
|
-
|
|
603
|
-
this.loadConfigCrud();
|
|
604
|
-
};
|
|
605
|
-
TableroComponent.prototype.loadConfigCrud = function () {
|
|
677
|
+
Condition.instanceContidion = function (index, allConditions) {
|
|
606
678
|
var _this = this;
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
679
|
+
var c;
|
|
680
|
+
switch (allConditions[index].type) {
|
|
681
|
+
case "different":
|
|
682
|
+
c = new ConditionDifferent(allConditions[index].attrs.field, allConditions[index].attrs.value, allConditions[index].attrs.grado || 2, allConditions[index].indexData);
|
|
683
|
+
break;
|
|
684
|
+
case "or":
|
|
685
|
+
var subconditions = allConditions[index].attrs.conditions.map(function (i) { return _this.instanceContidion(i, allConditions); });
|
|
686
|
+
c = new ConditionOr(subconditions, allConditions[index].indexData);
|
|
687
|
+
break;
|
|
688
|
+
case "and":
|
|
689
|
+
var subconditions2 = allConditions[index].attrs.conditions.map(function (i) { return _this.instanceContidion(i, allConditions); });
|
|
690
|
+
c = new ConditionAnd(subconditions2, allConditions[index].indexData);
|
|
691
|
+
break;
|
|
692
|
+
case "equal":
|
|
693
|
+
c = new ConditionEqual(allConditions[index].attrs.field, allConditions[index].attrs.value, allConditions[index].attrs.grado || 2, allConditions[index].indexData);
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
696
|
+
return c;
|
|
697
|
+
};
|
|
698
|
+
return Condition;
|
|
699
|
+
}());
|
|
700
|
+
var ConditionEqual = /** @class */ (function (_super) {
|
|
701
|
+
__extends(ConditionEqual, _super);
|
|
702
|
+
function ConditionEqual(field, value, grado, indexData) {
|
|
703
|
+
var _this = _super.call(this, "equal", {}, indexData) || this;
|
|
704
|
+
_this.field = field;
|
|
705
|
+
_this.value = value;
|
|
706
|
+
_this.grado = grado;
|
|
707
|
+
return _this;
|
|
708
|
+
}
|
|
709
|
+
ConditionEqual.prototype.isValid = function (data) {
|
|
710
|
+
var cumple = true;
|
|
711
|
+
var res = jsonpath__namespace.query(data, this.field);
|
|
712
|
+
if (res.length > 0 && this.grado == 2)
|
|
713
|
+
cumple = this.value == res[0];
|
|
714
|
+
else if (res.length > 0 && this.grado == 3)
|
|
715
|
+
cumple = this.value === res[0];
|
|
716
|
+
return cumple;
|
|
717
|
+
};
|
|
718
|
+
return ConditionEqual;
|
|
719
|
+
}(Condition));
|
|
720
|
+
var ConditionDifferent = /** @class */ (function (_super) {
|
|
721
|
+
__extends(ConditionDifferent, _super);
|
|
722
|
+
function ConditionDifferent(field, value, grado, indexData) {
|
|
723
|
+
var _this = _super.call(this, "different", {}, indexData) || this;
|
|
724
|
+
_this.field = field;
|
|
725
|
+
_this.value = value;
|
|
726
|
+
_this.grado = grado;
|
|
727
|
+
return _this;
|
|
728
|
+
}
|
|
729
|
+
ConditionDifferent.prototype.isValid = function (data) {
|
|
730
|
+
var cumple = true;
|
|
731
|
+
var res = jsonpath__namespace.query(data, this.field);
|
|
732
|
+
if (res.length > 0 && this.grado == 2)
|
|
733
|
+
cumple = this.value != res[0];
|
|
734
|
+
else if (res.length > 0 && this.grado == 3)
|
|
735
|
+
cumple = this.value !== res[0];
|
|
736
|
+
return cumple;
|
|
737
|
+
};
|
|
738
|
+
return ConditionDifferent;
|
|
739
|
+
}(Condition));
|
|
740
|
+
var ConditionOr = /** @class */ (function (_super) {
|
|
741
|
+
__extends(ConditionOr, _super);
|
|
742
|
+
function ConditionOr(conditions, indexData) {
|
|
743
|
+
var _this = _super.call(this, "or", {}, indexData) || this;
|
|
744
|
+
_this.conditions = conditions;
|
|
745
|
+
return _this;
|
|
746
|
+
}
|
|
747
|
+
ConditionOr.prototype.isValid = function (data) {
|
|
748
|
+
return this.conditions.some(function (c) { return c.isValid(data); });
|
|
749
|
+
};
|
|
750
|
+
return ConditionOr;
|
|
751
|
+
}(Condition));
|
|
752
|
+
var ConditionAnd = /** @class */ (function (_super) {
|
|
753
|
+
__extends(ConditionAnd, _super);
|
|
754
|
+
function ConditionAnd(conditions, indexData) {
|
|
755
|
+
var _this = _super.call(this, "and", {}, indexData) || this;
|
|
756
|
+
_this.conditions = conditions;
|
|
757
|
+
return _this;
|
|
758
|
+
}
|
|
759
|
+
ConditionAnd.prototype.isValid = function (data) {
|
|
760
|
+
return this.conditions.every(function (c) { return c.isValid(data); });
|
|
761
|
+
};
|
|
762
|
+
return ConditionAnd;
|
|
763
|
+
}(Condition));
|
|
764
|
+
|
|
765
|
+
var SfCrudService = /** @class */ (function () {
|
|
766
|
+
function SfCrudService() {
|
|
767
|
+
this._esquemas = [];
|
|
768
|
+
this._uiEsquemas = [];
|
|
769
|
+
this._registros = [];
|
|
770
|
+
this._answers = [];
|
|
771
|
+
this._dataSet = [];
|
|
772
|
+
this._ids = [];
|
|
773
|
+
this.__index = 0;
|
|
774
|
+
this._configEmpresa = undefined;
|
|
775
|
+
this._trx = [];
|
|
776
|
+
this._changeData = new rxjs.BehaviorSubject(undefined);
|
|
777
|
+
this.__formLoading = new rxjs.BehaviorSubject({ inProgress: false, target: undefined });
|
|
778
|
+
this._crudLoaded = new rxjs.BehaviorSubject(false);
|
|
779
|
+
}
|
|
780
|
+
Object.defineProperty(SfCrudService.prototype, "user", {
|
|
781
|
+
get: function () {
|
|
782
|
+
if (!this._tfmUser)
|
|
783
|
+
this._tfmUser = JSON.parse(localStorage.getItem("oSessionTFM"));
|
|
784
|
+
return this._tfmUser;
|
|
785
|
+
},
|
|
786
|
+
enumerable: false,
|
|
787
|
+
configurable: true
|
|
788
|
+
});
|
|
789
|
+
Object.defineProperty(SfCrudService.prototype, "currentOperation", {
|
|
790
|
+
get: function () {
|
|
791
|
+
var _this = this;
|
|
792
|
+
return this.registros[this.index].operations.find(function (x) { return x.type.startsWith(_this._trx[_this.index]); });
|
|
793
|
+
},
|
|
794
|
+
enumerable: false,
|
|
795
|
+
configurable: true
|
|
796
|
+
});
|
|
797
|
+
Object.defineProperty(SfCrudService.prototype, "environment", {
|
|
798
|
+
get: function () {
|
|
799
|
+
return this.jsonConfig;
|
|
800
|
+
},
|
|
801
|
+
set: function (val) {
|
|
802
|
+
this.jsonConfig = val;
|
|
803
|
+
},
|
|
804
|
+
enumerable: false,
|
|
805
|
+
configurable: true
|
|
806
|
+
});
|
|
807
|
+
Object.defineProperty(SfCrudService.prototype, "onCrudLoaded$", {
|
|
808
|
+
get: function () {
|
|
809
|
+
return this._crudLoaded.asObservable();
|
|
810
|
+
},
|
|
811
|
+
enumerable: false,
|
|
812
|
+
configurable: true
|
|
813
|
+
});
|
|
814
|
+
Object.defineProperty(SfCrudService.prototype, "crudLoaded", {
|
|
815
|
+
set: function (value) {
|
|
816
|
+
this._crudLoaded.next(value);
|
|
817
|
+
},
|
|
818
|
+
enumerable: false,
|
|
819
|
+
configurable: true
|
|
820
|
+
});
|
|
821
|
+
Object.defineProperty(SfCrudService.prototype, "dataExt", {
|
|
822
|
+
get: function () {
|
|
823
|
+
return this._dataExt;
|
|
824
|
+
},
|
|
825
|
+
set: function (val) {
|
|
826
|
+
this._dataExt = val;
|
|
827
|
+
},
|
|
828
|
+
enumerable: false,
|
|
829
|
+
configurable: true
|
|
830
|
+
});
|
|
831
|
+
Object.defineProperty(SfCrudService.prototype, "index", {
|
|
832
|
+
get: function () {
|
|
833
|
+
return this.__index;
|
|
834
|
+
},
|
|
835
|
+
set: function (value) {
|
|
836
|
+
this.__index = value;
|
|
837
|
+
},
|
|
838
|
+
enumerable: false,
|
|
839
|
+
configurable: true
|
|
840
|
+
});
|
|
841
|
+
Object.defineProperty(SfCrudService.prototype, "idKatios", {
|
|
842
|
+
get: function () {
|
|
843
|
+
return this._idKatios;
|
|
844
|
+
},
|
|
845
|
+
set: function (value) {
|
|
846
|
+
var _a;
|
|
847
|
+
this._idKatios = (_a = value === null || value === void 0 ? void 0 : value.trim()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
848
|
+
},
|
|
849
|
+
enumerable: false,
|
|
850
|
+
configurable: true
|
|
851
|
+
});
|
|
852
|
+
Object.defineProperty(SfCrudService.prototype, "configEmpresa", {
|
|
853
|
+
get: function () {
|
|
854
|
+
return this._configEmpresa;
|
|
855
|
+
},
|
|
856
|
+
set: function (value) {
|
|
857
|
+
this._configEmpresa = value;
|
|
858
|
+
},
|
|
859
|
+
enumerable: false,
|
|
860
|
+
configurable: true
|
|
861
|
+
});
|
|
862
|
+
SfCrudService.prototype.getURL = function (operation, index, id) {
|
|
863
|
+
if (index === void 0) { index = undefined; }
|
|
864
|
+
if (id === void 0) { id = undefined; }
|
|
865
|
+
var url = operation.url || "" + this.jsonConfig[operation.server] + operation.endpoint;
|
|
866
|
+
url = url.replace('@idKatios', this.idKatios);
|
|
867
|
+
if (id)
|
|
868
|
+
url = url.replace('@id', id);
|
|
869
|
+
url = this.applyStringKeys(url, index);
|
|
870
|
+
return url;
|
|
871
|
+
};
|
|
872
|
+
SfCrudService.prototype.getRegistro = function (index) {
|
|
873
|
+
return this._registros[index];
|
|
874
|
+
};
|
|
875
|
+
SfCrudService.prototype.getId = function (index) {
|
|
876
|
+
return this._ids.length == 1 ? this._ids[0] : this._ids[index];
|
|
877
|
+
};
|
|
878
|
+
Object.defineProperty(SfCrudService.prototype, "dataset", {
|
|
879
|
+
get: function () {
|
|
880
|
+
return this._dataSet;
|
|
881
|
+
},
|
|
882
|
+
enumerable: false,
|
|
883
|
+
configurable: true
|
|
884
|
+
});
|
|
885
|
+
SfCrudService.prototype.getData = function (index) {
|
|
886
|
+
return this._dataSet.length == 1 ? this._dataSet[0] : this._dataSet[index];
|
|
887
|
+
};
|
|
888
|
+
SfCrudService.prototype.getTrx = function (index) {
|
|
889
|
+
return this._trx[index];
|
|
890
|
+
};
|
|
891
|
+
Object.defineProperty(SfCrudService.prototype, "totalData", {
|
|
892
|
+
get: function () {
|
|
893
|
+
return this._dataSet.length;
|
|
894
|
+
},
|
|
895
|
+
enumerable: false,
|
|
896
|
+
configurable: true
|
|
897
|
+
});
|
|
898
|
+
Object.defineProperty(SfCrudService.prototype, "totalRegistros", {
|
|
899
|
+
get: function () {
|
|
900
|
+
return this._registros.length;
|
|
901
|
+
},
|
|
902
|
+
enumerable: false,
|
|
903
|
+
configurable: true
|
|
904
|
+
});
|
|
905
|
+
Object.defineProperty(SfCrudService.prototype, "uiEsquemas", {
|
|
906
|
+
get: function () {
|
|
907
|
+
return this._uiEsquemas;
|
|
908
|
+
},
|
|
909
|
+
set: function (uiEsquemas) {
|
|
910
|
+
this._uiEsquemas = uiEsquemas;
|
|
911
|
+
},
|
|
912
|
+
enumerable: false,
|
|
913
|
+
configurable: true
|
|
914
|
+
});
|
|
915
|
+
SfCrudService.prototype.getEsquema = function (index) {
|
|
916
|
+
return this._esquemas.length == 1 ? this._esquemas[0] : this._esquemas[index];
|
|
917
|
+
};
|
|
918
|
+
SfCrudService.prototype.reset = function () {
|
|
919
|
+
this._ids = [];
|
|
920
|
+
this._dataSet = [];
|
|
921
|
+
};
|
|
922
|
+
SfCrudService.prototype.getURLRedirect = function (initialURL) {
|
|
923
|
+
var finalUrl = this.applyStringKeys(initialURL, undefined);
|
|
924
|
+
finalUrl = finalUrl.replace("@URLBASE", window.location.href.split('?')[0]);
|
|
925
|
+
return finalUrl;
|
|
926
|
+
};
|
|
927
|
+
SfCrudService.prototype.getUIEsquema = function (index) {
|
|
928
|
+
return this._uiEsquemas[index];
|
|
929
|
+
};
|
|
930
|
+
/**
|
|
931
|
+
* using data, apply each keyEsquema over each dataset indicated on indexData of each key
|
|
932
|
+
* @param data
|
|
933
|
+
* @param content
|
|
934
|
+
* @returns
|
|
935
|
+
*/
|
|
936
|
+
SfCrudService.prototype.applyObjectKeys = function (data, keysEsquema, registro) {
|
|
937
|
+
var _a;
|
|
938
|
+
for (var i = 0; i < keysEsquema.length; i++) {
|
|
939
|
+
var opt = keysEsquema[i];
|
|
940
|
+
var value = undefined;
|
|
941
|
+
if (opt.indexKey) {
|
|
942
|
+
var keyFound = ((_a = registro.keys) !== null && _a !== void 0 ? _a : [undefined])[opt.indexKey];
|
|
943
|
+
this.applyKey(keyFound, registro, data);
|
|
944
|
+
}
|
|
945
|
+
else if (opt.indexData !== undefined) {
|
|
946
|
+
if (opt.isArray) {
|
|
947
|
+
value = jsonpath__namespace.query(data, opt.scope);
|
|
948
|
+
}
|
|
949
|
+
else {
|
|
950
|
+
value = jsonpath__namespace.query(data, opt.scope)[0];
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (opt.key == "$")
|
|
954
|
+
Object.assign(this._dataSet[opt.indexData], value);
|
|
955
|
+
else if (opt.key && ((value !== undefined && value !== null) || (opt.canBeValueUndefined === undefined || opt.canBeValueUndefined === true)))
|
|
956
|
+
jsonpath__namespace.value(this._dataSet[opt.indexData], opt.key, value);
|
|
957
|
+
}
|
|
958
|
+
return data;
|
|
959
|
+
};
|
|
960
|
+
SfCrudService.prototype.applyKey = function (key, registro, data) {
|
|
961
|
+
var _a, _b, _c, _d;
|
|
962
|
+
if (key === null || key === void 0 ? void 0 : key.overrideControl) {
|
|
963
|
+
var newVal = undefined;
|
|
964
|
+
var esquemaToSet = this.getControl(key.scope, this.esquemas[(_a = key.indexData) !== null && _a !== void 0 ? _a : this.index]);
|
|
965
|
+
if (!esquemaToSet) {
|
|
966
|
+
console.error({ message: "la key esta mal configurada", data: key });
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
var completed = this.isConditionsCompleted((_b = key.overrideControl.conditions) !== null && _b !== void 0 ? _b : [], registro.conditions || [], data);
|
|
970
|
+
if ((_c = key.overrideControl) === null || _c === void 0 ? void 0 : _c.property)
|
|
971
|
+
jsonpath__namespace.value(esquemaToSet, key.overrideControl.property, completed ? key.overrideControl.value : key.overrideControl.elseValue);
|
|
972
|
+
if (completed && key.overrideControl.newPropertyValue !== undefined) {
|
|
973
|
+
if (key.overrideControl.newPropertyValue == 'RESETOBJECT')
|
|
974
|
+
newVal = this.createObject(esquemaToSet, this.currentOperation);
|
|
975
|
+
else
|
|
976
|
+
newVal = key.overrideControl.newPropertyValue;
|
|
977
|
+
}
|
|
978
|
+
else if (!completed && key.overrideControl.elseNewPropertyValue !== undefined) {
|
|
979
|
+
if (key.overrideControl.elseNewPropertyValue == 'RESETOBJECT')
|
|
980
|
+
newVal = this.createObject(esquemaToSet, this.currentOperation);
|
|
981
|
+
else
|
|
982
|
+
newVal = key.overrideControl.elseNewPropertyValue;
|
|
983
|
+
}
|
|
984
|
+
if (newVal !== undefined)
|
|
985
|
+
jsonpath__namespace.value(this._dataSet[(_d = key.indexData) !== null && _d !== void 0 ? _d : this.index], key.scope.replaceAll('..properties', ''), newVal);
|
|
986
|
+
}
|
|
617
987
|
};
|
|
618
|
-
|
|
988
|
+
/**
|
|
989
|
+
* Validate conditions on datas
|
|
990
|
+
* @param conditions
|
|
991
|
+
* @param index
|
|
992
|
+
*/
|
|
993
|
+
SfCrudService.prototype.isConditionsCompleted = function (iConditions, conditions, data) {
|
|
619
994
|
var _this = this;
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
aux = res;
|
|
627
|
-
_this.generateData(aux);
|
|
628
|
-
_this.loadOptions();
|
|
629
|
-
_this.enProceso = false;
|
|
630
|
-
})
|
|
631
|
-
.catch(function (err) {
|
|
632
|
-
console.log(err);
|
|
633
|
-
_this.enProceso = false;
|
|
995
|
+
var cumple = true;
|
|
996
|
+
iConditions.forEach(function (iCond) {
|
|
997
|
+
var c = Condition.instanceContidion(iCond, conditions);
|
|
998
|
+
var dataToEvaluate = c.indexData !== undefined ? _this._dataSet[c.indexData] : data;
|
|
999
|
+
if (!c.isValid(dataToEvaluate))
|
|
1000
|
+
cumple = false;
|
|
634
1001
|
});
|
|
1002
|
+
return cumple;
|
|
635
1003
|
};
|
|
636
|
-
|
|
1004
|
+
/**
|
|
1005
|
+
* Apply each key from register over string content
|
|
1006
|
+
* @param indexRegistro
|
|
1007
|
+
* @param content
|
|
1008
|
+
* @returns
|
|
1009
|
+
*/
|
|
1010
|
+
SfCrudService.prototype.applyStringKeys = function (content, index) {
|
|
637
1011
|
var _this = this;
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
_this.
|
|
1012
|
+
if (index === void 0) { index = undefined; }
|
|
1013
|
+
var _a;
|
|
1014
|
+
var indexRegistro = index || this.__index;
|
|
1015
|
+
(_a = this._registros[indexRegistro].keys) === null || _a === void 0 ? void 0 : _a.forEach(function (opt) {
|
|
1016
|
+
var value;
|
|
1017
|
+
if (opt.indexId !== undefined && opt.indexId < _this._ids.length)
|
|
1018
|
+
value = _this._ids[opt.indexId];
|
|
1019
|
+
else if (opt.indexAnswer !== undefined && opt.indexAnswer < _this._answers.length)
|
|
1020
|
+
value = jsonpath__namespace.query(_this._answers[opt.indexAnswer], opt.scope)[0];
|
|
1021
|
+
else if (opt.indexData !== undefined)
|
|
1022
|
+
value = jsonpath__namespace.query(_this._dataSet[opt.indexData], opt.scope)[0];
|
|
1023
|
+
if (value === null)
|
|
1024
|
+
value = '';
|
|
1025
|
+
content = content.replace(opt.key, value);
|
|
644
1026
|
});
|
|
645
|
-
|
|
1027
|
+
return content;
|
|
646
1028
|
};
|
|
647
|
-
|
|
648
|
-
if (path.includes("."))
|
|
649
|
-
return jsonpath__namespace.query(item, path)[0];
|
|
650
|
-
return item[path];
|
|
651
|
-
};
|
|
652
|
-
TableroComponent.prototype.loadOptions = function () {
|
|
1029
|
+
SfCrudService.prototype.validateDataLocal = function (operation, data, conditions) {
|
|
653
1030
|
var _this = this;
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
1031
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1032
|
+
var err = [];
|
|
1033
|
+
//Solo si se cumple la condicion, se valida
|
|
1034
|
+
(_b = (_a = operation.validations) === null || _a === void 0 ? void 0 : _a.required) === null || _b === void 0 ? void 0 : _b.forEach(function (x) {
|
|
1035
|
+
var cumpleCond = x.conditions ? _this.isConditionsCompleted(x.conditions, conditions, data) : true;
|
|
1036
|
+
if (cumpleCond && (!jsonpath__namespace.query(data, x.field)[0] ||
|
|
1037
|
+
(Array.isArray(jsonpath__namespace.query(data, x.field)[0]) && jsonpath__namespace.query(data, x.field)[0].length == 0)))
|
|
1038
|
+
err.push(x.message);
|
|
658
1039
|
});
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
1040
|
+
(_d = (_c = operation.validations) === null || _c === void 0 ? void 0 : _c.different) === null || _d === void 0 ? void 0 : _d.forEach(function (x) {
|
|
1041
|
+
var cumpleCond = x.conditions ? _this.isConditionsCompleted(x.conditions, conditions, data) : true;
|
|
1042
|
+
if (cumpleCond && jsonpath__namespace.query(data, x.field)[0] === x.value)
|
|
1043
|
+
err.push(x.message);
|
|
1044
|
+
});
|
|
1045
|
+
(_f = (_e = operation.validations) === null || _e === void 0 ? void 0 : _e.equals) === null || _f === void 0 ? void 0 : _f.forEach(function (x) {
|
|
1046
|
+
var cumpleCond = x.conditions ? _this.isConditionsCompleted(x.conditions, conditions, data) : true;
|
|
1047
|
+
if (cumpleCond && jsonpath__namespace.query(data, x.field)[0] != x.value)
|
|
1048
|
+
err.push(x.message);
|
|
1049
|
+
});
|
|
1050
|
+
(_h = (_g = operation.validations) === null || _g === void 0 ? void 0 : _g.operations) === null || _h === void 0 ? void 0 : _h.forEach(function (op) {
|
|
1051
|
+
switch (op.action) {
|
|
1052
|
+
case 'sumArray':
|
|
1053
|
+
var var1 = jsonpath__namespace.query(data, op.scope[0]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1054
|
+
var var2 = jsonpath__namespace.query(data, op.scope[1]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1055
|
+
if (var1 != var2)
|
|
1056
|
+
err.push(op.message);
|
|
1057
|
+
break;
|
|
1058
|
+
default:
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
return err;
|
|
1063
|
+
};
|
|
1064
|
+
Object.defineProperty(SfCrudService.prototype, "esquemas", {
|
|
1065
|
+
get: function () {
|
|
1066
|
+
return this._esquemas;
|
|
1067
|
+
},
|
|
1068
|
+
set: function (esquemas) {
|
|
1069
|
+
this._esquemas = esquemas;
|
|
1070
|
+
},
|
|
1071
|
+
enumerable: false,
|
|
1072
|
+
configurable: true
|
|
1073
|
+
});
|
|
1074
|
+
Object.defineProperty(SfCrudService.prototype, "ids", {
|
|
1075
|
+
set: function (ids) {
|
|
1076
|
+
this._ids = ids;
|
|
1077
|
+
},
|
|
1078
|
+
enumerable: false,
|
|
1079
|
+
configurable: true
|
|
1080
|
+
});
|
|
1081
|
+
Object.defineProperty(SfCrudService.prototype, "registros", {
|
|
1082
|
+
get: function () {
|
|
1083
|
+
return this._registros;
|
|
1084
|
+
},
|
|
1085
|
+
set: function (registros) {
|
|
1086
|
+
this._registros = registros;
|
|
1087
|
+
},
|
|
1088
|
+
enumerable: false,
|
|
1089
|
+
configurable: true
|
|
1090
|
+
});
|
|
1091
|
+
SfCrudService.prototype.setDataSet = function (data, index) {
|
|
1092
|
+
if (index === void 0) { index = undefined; }
|
|
1093
|
+
index = index ? index : this.__index;
|
|
1094
|
+
if (index >= this.totalData) {
|
|
1095
|
+
this._dataSet.push(data);
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
SfCrudService.prototype.setTrx = function (trx, index) {
|
|
1099
|
+
if (Array.isArray(trx))
|
|
1100
|
+
this._trx = trx;
|
|
1101
|
+
else if (index >= this._trx.length)
|
|
1102
|
+
this._trx.push(trx);
|
|
1103
|
+
else
|
|
1104
|
+
this._trx[index] = trx;
|
|
1105
|
+
};
|
|
1106
|
+
SfCrudService.prototype.setAnswers = function (answer, index) {
|
|
1107
|
+
if (Array.isArray(answer))
|
|
1108
|
+
this._answers = answer;
|
|
1109
|
+
else {
|
|
1110
|
+
if (index >= this._answers.length)
|
|
1111
|
+
this._answers.push(answer);
|
|
1112
|
+
else
|
|
1113
|
+
this._answers[index] = answer;
|
|
1114
|
+
}
|
|
1115
|
+
};
|
|
1116
|
+
SfCrudService.prototype.getControl = function (scope, esquema) {
|
|
1117
|
+
return jsonpath__namespace.query(esquema, scope)[0];
|
|
1118
|
+
};
|
|
1119
|
+
SfCrudService.prototype.getValue = function (scope, data) {
|
|
1120
|
+
return jsonpath__namespace.query(data, scope.replaceAll('.properties', ''))[0];
|
|
1121
|
+
};
|
|
1122
|
+
SfCrudService.prototype.createObject = function (esquema, operation) {
|
|
1123
|
+
var _this = this;
|
|
1124
|
+
var _a;
|
|
1125
|
+
var object = {};
|
|
1126
|
+
switch (esquema.type) {
|
|
1127
|
+
case 'numeric':
|
|
1128
|
+
case 'string':
|
|
1129
|
+
case 'date':
|
|
1130
|
+
if (esquema.default && operation) {
|
|
1131
|
+
return this.setDefaultValue(esquema.default, operation);
|
|
1132
|
+
}
|
|
1133
|
+
else
|
|
1134
|
+
return (_a = esquema.default) !== null && _a !== void 0 ? _a : null;
|
|
1135
|
+
case 'boolean':
|
|
1136
|
+
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
1137
|
+
case 'array':
|
|
1138
|
+
return [];
|
|
1139
|
+
case 'file':
|
|
1140
|
+
return null;
|
|
1141
|
+
case 'object':
|
|
1142
|
+
Object.getOwnPropertyNames(esquema === null || esquema === void 0 ? void 0 : esquema.properties).forEach(function (key) {
|
|
1143
|
+
var aux = esquema === null || esquema === void 0 ? void 0 : esquema.properties[key];
|
|
1144
|
+
if (aux)
|
|
1145
|
+
object[key] = _this.createObject(aux, operation);
|
|
1146
|
+
});
|
|
1147
|
+
return object;
|
|
1148
|
+
default:
|
|
1149
|
+
return null;
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
SfCrudService.prototype.getValueKey = function (key) {
|
|
1153
|
+
var data;
|
|
1154
|
+
switch ((key === null || key === void 0 ? void 0 : key.data) || 'externa') {
|
|
1155
|
+
case "user":
|
|
1156
|
+
data = this.user;
|
|
1157
|
+
break;
|
|
1158
|
+
default:
|
|
1159
|
+
data = this.dataExt;
|
|
1160
|
+
break;
|
|
1161
|
+
}
|
|
1162
|
+
if (data && key) {
|
|
1163
|
+
var aux = jsonpath__namespace.query(data, key.scope);
|
|
1164
|
+
if (aux.length == 0)
|
|
1165
|
+
return undefined;
|
|
1166
|
+
if (aux.length == 1)
|
|
1167
|
+
return aux[0];
|
|
1168
|
+
else
|
|
1169
|
+
return aux;
|
|
1170
|
+
}
|
|
1171
|
+
return undefined;
|
|
1172
|
+
};
|
|
1173
|
+
SfCrudService.prototype.setDefaultValue = function (value, operation) {
|
|
1174
|
+
var data = null;
|
|
1175
|
+
if (value.key && operation.keys) {
|
|
1176
|
+
data = this.getValueKey(operation.keys.find(function (k) { return k.key == value.key; }));
|
|
1177
|
+
value = data;
|
|
1178
|
+
}
|
|
1179
|
+
switch (value) {
|
|
1180
|
+
case '@uactivo':
|
|
1181
|
+
data = this.user.UsuarioSistema.TDOC + "-" + this.user.UsuarioSistema.NDOC;
|
|
1182
|
+
break;
|
|
1183
|
+
case '@tdocactivo':
|
|
1184
|
+
data = this.user.UsuarioSistema.TDOC;
|
|
1185
|
+
break;
|
|
1186
|
+
case '@ndocactivo':
|
|
1187
|
+
data = this.user.UsuarioSistema.NDOC;
|
|
1188
|
+
break;
|
|
1189
|
+
case '@hoy':
|
|
1190
|
+
data = new Date();
|
|
1191
|
+
break;
|
|
1192
|
+
default:
|
|
1193
|
+
data = value;
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
return data;
|
|
1197
|
+
};
|
|
1198
|
+
/**
|
|
1199
|
+
* Validate if schema has pdfsign and it's signed, else return false
|
|
1200
|
+
* @param index
|
|
1201
|
+
* @returns
|
|
1202
|
+
*/
|
|
1203
|
+
SfCrudService.prototype.isSignedPDF = function (index) {
|
|
1204
|
+
return this._dataSet[index].signed;
|
|
1205
|
+
};
|
|
1206
|
+
Object.defineProperty(SfCrudService.prototype, "changeData$", {
|
|
1207
|
+
get: function () {
|
|
1208
|
+
return this._changeData.asObservable();
|
|
1209
|
+
},
|
|
1210
|
+
enumerable: false,
|
|
1211
|
+
configurable: true
|
|
1212
|
+
});
|
|
1213
|
+
Object.defineProperty(SfCrudService.prototype, "changeData", {
|
|
1214
|
+
set: function (value) {
|
|
1215
|
+
this._changeData.next(value);
|
|
1216
|
+
},
|
|
1217
|
+
enumerable: false,
|
|
1218
|
+
configurable: true
|
|
1219
|
+
});
|
|
1220
|
+
Object.defineProperty(SfCrudService.prototype, "formLoading$", {
|
|
1221
|
+
get: function () {
|
|
1222
|
+
return this.__formLoading.asObservable();
|
|
1223
|
+
},
|
|
1224
|
+
enumerable: false,
|
|
1225
|
+
configurable: true
|
|
1226
|
+
});
|
|
1227
|
+
Object.defineProperty(SfCrudService.prototype, "formLoading", {
|
|
1228
|
+
set: function (value) {
|
|
1229
|
+
this.__formLoading.next(value);
|
|
1230
|
+
},
|
|
1231
|
+
enumerable: false,
|
|
1232
|
+
configurable: true
|
|
1233
|
+
});
|
|
1234
|
+
SfCrudService.prototype.loadSession = function () {
|
|
1235
|
+
var existSession = localStorage.getItem("esquemas") !== null;
|
|
1236
|
+
if (existSession) {
|
|
1237
|
+
this._esquemas = JSON.parse(localStorage.getItem("esquemas"));
|
|
1238
|
+
this._uiEsquemas = JSON.parse(localStorage.getItem("uiEsquemas"));
|
|
1239
|
+
this._registros = JSON.parse(localStorage.getItem("registros"));
|
|
1240
|
+
this._dataSet = JSON.parse(localStorage.getItem("dataSet"));
|
|
1241
|
+
this._answers = JSON.parse(localStorage.getItem("answers"));
|
|
1242
|
+
this._trx = JSON.parse(localStorage.getItem("trx"));
|
|
1243
|
+
this.__index = +localStorage.getItem("index");
|
|
1244
|
+
localStorage.clear();
|
|
1245
|
+
}
|
|
1246
|
+
return existSession;
|
|
1247
|
+
};
|
|
1248
|
+
Object.defineProperty(SfCrudService.prototype, "reasons", {
|
|
1249
|
+
get: function () {
|
|
1250
|
+
var reasonsStorage = localStorage.getItem("reasons");
|
|
1251
|
+
if (reasonsStorage)
|
|
1252
|
+
return JSON.parse(reasonsStorage);
|
|
1253
|
+
return [];
|
|
1254
|
+
},
|
|
1255
|
+
enumerable: false,
|
|
1256
|
+
configurable: true
|
|
1257
|
+
});
|
|
1258
|
+
SfCrudService.prototype.saveProgress = function (reasons) {
|
|
1259
|
+
localStorage.setItem("reasons", JSON.stringify(reasons));
|
|
1260
|
+
localStorage.setItem("esquemas", JSON.stringify(this._esquemas));
|
|
1261
|
+
localStorage.setItem("trx", JSON.stringify(this._trx));
|
|
1262
|
+
localStorage.setItem("uiEsquemas", JSON.stringify(this._uiEsquemas));
|
|
1263
|
+
localStorage.setItem("registros", JSON.stringify(this._registros));
|
|
1264
|
+
localStorage.setItem("dataSet", JSON.stringify(this._dataSet));
|
|
1265
|
+
localStorage.setItem("answers", JSON.stringify(this._answers));
|
|
1266
|
+
localStorage.setItem("index", this.__index.toString());
|
|
1267
|
+
};
|
|
1268
|
+
SfCrudService.prototype.redirectToInicio = function () {
|
|
1269
|
+
window.location.href = window.location.href.split('?')[0];
|
|
1270
|
+
window.location.reload();
|
|
1271
|
+
};
|
|
1272
|
+
SfCrudService.prototype.applyValuesOnEvent = function (event, esquema, key, data) {
|
|
1273
|
+
var _this = this;
|
|
1274
|
+
if (key) {
|
|
1275
|
+
if (esquema.properties[key][event]) {
|
|
1276
|
+
esquema.properties[key][event].forEach(function (value) {
|
|
1277
|
+
_this.setValueEvent(data, value, esquema);
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
else {
|
|
1282
|
+
for (var key_1 in esquema.properties) {
|
|
1283
|
+
if (esquema.properties[key_1][event]) {
|
|
1284
|
+
esquema.properties[key_1][event].forEach(function (value) {
|
|
1285
|
+
_this.setValueEvent(data, value, esquema);
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
SfCrudService.prototype.setValueEvent = function (data, params, esquema) {
|
|
1292
|
+
var _a;
|
|
1293
|
+
var date = moment__namespace(new Date());
|
|
1294
|
+
switch (params.op) {
|
|
1295
|
+
case 'sum':
|
|
1296
|
+
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));
|
|
1297
|
+
break;
|
|
1298
|
+
case 'concat':
|
|
1299
|
+
var array_1 = [];
|
|
1300
|
+
(_a = params === null || params === void 0 ? void 0 : params.key) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, cur) {
|
|
1301
|
+
array_1.push(jsonpath__namespace.query(data, cur)[0]);
|
|
1302
|
+
}, []);
|
|
1303
|
+
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
1304
|
+
jsonpath__namespace.value(data, params.scope[0], array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' '));
|
|
1305
|
+
break;
|
|
1306
|
+
case 'enable':
|
|
1307
|
+
jsonpath__namespace.value(esquema, params.scope[0], false);
|
|
1308
|
+
break;
|
|
1309
|
+
case 'disabled':
|
|
1310
|
+
jsonpath__namespace.value(esquema, params.scope[0], true);
|
|
1311
|
+
break;
|
|
1312
|
+
case 'replace:endpoint':
|
|
1313
|
+
jsonpath__namespace.value(esquema, params.scope[0], esquema.config.endpointtemp.replace(params.scope[1], jsonpath__namespace.query(data, "$.." + params.key)));
|
|
1314
|
+
break;
|
|
1315
|
+
case 'setNull':
|
|
1316
|
+
jsonpath__namespace.value(data, "$." + params.key, null);
|
|
1317
|
+
break;
|
|
1318
|
+
case 'datediff:years':
|
|
1319
|
+
jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'years'));
|
|
1320
|
+
break;
|
|
1321
|
+
case 'datediff:months':
|
|
1322
|
+
jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'months'));
|
|
1323
|
+
break;
|
|
1324
|
+
case 'datediff:weeks':
|
|
1325
|
+
jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'weeks'));
|
|
1326
|
+
break;
|
|
1327
|
+
case 'datediff:days':
|
|
1328
|
+
jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'days'));
|
|
1329
|
+
break;
|
|
1330
|
+
default:
|
|
1331
|
+
break;
|
|
1332
|
+
}
|
|
1333
|
+
console.log('setValueEvent sale:');
|
|
1334
|
+
console.log(data);
|
|
1335
|
+
console.log(esquema);
|
|
1336
|
+
console.log(params);
|
|
1337
|
+
};
|
|
1338
|
+
return SfCrudService;
|
|
1339
|
+
}());
|
|
1340
|
+
SfCrudService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1341
|
+
SfCrudService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, providedIn: 'root' });
|
|
1342
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, decorators: [{
|
|
1343
|
+
type: i0.Injectable,
|
|
1344
|
+
args: [{
|
|
1345
|
+
providedIn: 'root'
|
|
1346
|
+
}]
|
|
1347
|
+
}] });
|
|
1348
|
+
var ChangeData = /** @class */ (function () {
|
|
1349
|
+
function ChangeData(value, scope, index) {
|
|
1350
|
+
this.value = value;
|
|
1351
|
+
this.scope = scope;
|
|
1352
|
+
this.index = index;
|
|
1353
|
+
}
|
|
1354
|
+
return ChangeData;
|
|
1355
|
+
}());
|
|
1356
|
+
|
|
1357
|
+
var StepService = /** @class */ (function () {
|
|
1358
|
+
function StepService() {
|
|
1359
|
+
this._requestApproval = new rxjs.Subject();
|
|
1360
|
+
this._customChildrenEvents = new rxjs.Subject();
|
|
1361
|
+
this._currentPosition = new rxjs.BehaviorSubject(0);
|
|
1362
|
+
this._requestApproved = new rxjs.BehaviorSubject(true);
|
|
1363
|
+
}
|
|
1364
|
+
Object.defineProperty(StepService.prototype, "currentIndex", {
|
|
1365
|
+
get: function () {
|
|
1366
|
+
return this._currentPosition.getValue();
|
|
1367
|
+
},
|
|
1368
|
+
set: function (value) {
|
|
1369
|
+
this._currentPosition.next(value);
|
|
1370
|
+
},
|
|
1371
|
+
enumerable: false,
|
|
1372
|
+
configurable: true
|
|
1373
|
+
});
|
|
1374
|
+
Object.defineProperty(StepService.prototype, "currentIndex$", {
|
|
1375
|
+
get: function () {
|
|
1376
|
+
return this._currentPosition.asObservable();
|
|
1377
|
+
},
|
|
1378
|
+
enumerable: false,
|
|
1379
|
+
configurable: true
|
|
1380
|
+
});
|
|
1381
|
+
Object.defineProperty(StepService.prototype, "requestApproval", {
|
|
1382
|
+
/*
|
|
1383
|
+
Envia una peticion para que se envie el formulario
|
|
1384
|
+
*/
|
|
1385
|
+
set: function (newPos) {
|
|
1386
|
+
this._desiredIndex = newPos;
|
|
1387
|
+
this._requestApproval.next({ current: this.currentIndex, desired: newPos });
|
|
1388
|
+
},
|
|
1389
|
+
enumerable: false,
|
|
1390
|
+
configurable: true
|
|
1391
|
+
});
|
|
1392
|
+
Object.defineProperty(StepService.prototype, "requestApproval$", {
|
|
1393
|
+
get: function () {
|
|
1394
|
+
return this._requestApproval.asObservable();
|
|
1395
|
+
},
|
|
1396
|
+
enumerable: false,
|
|
1397
|
+
configurable: true
|
|
1398
|
+
});
|
|
1399
|
+
Object.defineProperty(StepService.prototype, "requestApproved$", {
|
|
1400
|
+
get: function () {
|
|
1401
|
+
return this._requestApproved.asObservable();
|
|
1402
|
+
},
|
|
1403
|
+
enumerable: false,
|
|
1404
|
+
configurable: true
|
|
1405
|
+
});
|
|
1406
|
+
Object.defineProperty(StepService.prototype, "requestApproved", {
|
|
1407
|
+
/**
|
|
1408
|
+
* Useful to deny or approve request made by requestAprroval
|
|
1409
|
+
*/
|
|
1410
|
+
set: function (approved) {
|
|
1411
|
+
if (this._desiredIndex === undefined)
|
|
1412
|
+
throw new Error('desiredIndex is not defined');
|
|
1413
|
+
if (approved)
|
|
1414
|
+
this._currentPosition.next(this._desiredIndex);
|
|
1415
|
+
this._requestApproved.next(approved);
|
|
1416
|
+
},
|
|
1417
|
+
enumerable: false,
|
|
1418
|
+
configurable: true
|
|
1419
|
+
});
|
|
1420
|
+
Object.defineProperty(StepService.prototype, "desiredIndex", {
|
|
1421
|
+
set: function (index) {
|
|
1422
|
+
this._desiredIndex = index;
|
|
1423
|
+
},
|
|
1424
|
+
enumerable: false,
|
|
1425
|
+
configurable: true
|
|
1426
|
+
});
|
|
1427
|
+
StepService.prototype.addCustomChildrenEvent = function (name, data) {
|
|
1428
|
+
this._customChildrenEvents.next({ name: name, data: data });
|
|
1429
|
+
};
|
|
1430
|
+
StepService.prototype.reset = function () {
|
|
1431
|
+
//this._requestApproval = new BehaviorSubject({current:0, desired: undefined});
|
|
1432
|
+
//this._customChildrenEvents = new BehaviorSubject(undefined);
|
|
1433
|
+
};
|
|
1434
|
+
Object.defineProperty(StepService.prototype, "customChildrenEvents$", {
|
|
1435
|
+
get: function () {
|
|
1436
|
+
return this._customChildrenEvents.asObservable();
|
|
1437
|
+
},
|
|
1438
|
+
enumerable: false,
|
|
1439
|
+
configurable: true
|
|
1440
|
+
});
|
|
1441
|
+
return StepService;
|
|
1442
|
+
}());
|
|
1443
|
+
StepService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1444
|
+
StepService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepService, providedIn: 'root' });
|
|
1445
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepService, decorators: [{
|
|
1446
|
+
type: i0.Injectable,
|
|
1447
|
+
args: [{
|
|
1448
|
+
providedIn: 'root'
|
|
1449
|
+
}]
|
|
1450
|
+
}] });
|
|
1451
|
+
|
|
1452
|
+
var TableroComponent = /** @class */ (function () {
|
|
1453
|
+
function TableroComponent(generalService, router, sfCrudService, stepService) {
|
|
1454
|
+
this.generalService = generalService;
|
|
1455
|
+
this.router = router;
|
|
1456
|
+
this.sfCrudService = sfCrudService;
|
|
1457
|
+
this.stepService = stepService;
|
|
1458
|
+
this.opciones = [];
|
|
1459
|
+
this.idEntidad = '';
|
|
1460
|
+
this.idKatios = '';
|
|
1461
|
+
this.onSelectAction = new i0.EventEmitter();
|
|
1462
|
+
this.items = [];
|
|
1463
|
+
this.crudConfig = new CrudConfig();
|
|
1464
|
+
this.data = [];
|
|
1465
|
+
this.initialData = [];
|
|
1466
|
+
this.btn = { create: undefined, read: undefined, update: undefined, delete: undefined };
|
|
1467
|
+
this.loading = { inProgress: false, target: undefined };
|
|
1468
|
+
}
|
|
1469
|
+
TableroComponent.prototype.ngOnInit = function () {
|
|
1470
|
+
this.generalService.environment = this.environment;
|
|
1471
|
+
this.loadConfigCrud();
|
|
1472
|
+
};
|
|
1473
|
+
TableroComponent.prototype.loadConfigCrud = function () {
|
|
1474
|
+
var _this = this;
|
|
1475
|
+
this.loading.inProgress = true;
|
|
1476
|
+
this.sfCrudService.formLoading = this.loading;
|
|
1477
|
+
this.generalService.getCrudByEntidad(this.idKatios, this.idEntidad)
|
|
1478
|
+
.then(function (res) {
|
|
1479
|
+
_this.crudConfig = res;
|
|
1480
|
+
_this.getInfoTablero();
|
|
1481
|
+
})
|
|
1482
|
+
.catch(function (err) {
|
|
1483
|
+
console.log(err);
|
|
1484
|
+
_this.loading.inProgress = false;
|
|
1485
|
+
_this.sfCrudService.formLoading = _this.loading;
|
|
1486
|
+
});
|
|
1487
|
+
};
|
|
1488
|
+
TableroComponent.prototype.customizeCompany = function (uiEsquemas) {
|
|
1489
|
+
var _a, _b, _c;
|
|
1490
|
+
this.sfCrudService.configEmpresa = (_a = uiEsquemas.find(function (ui) { return ui.general; })) === null || _a === void 0 ? void 0 : _a.general;
|
|
1491
|
+
if (this.sfCrudService.configEmpresa) {
|
|
1492
|
+
if ((_b = this.sfCrudService.configEmpresa.colors) === null || _b === void 0 ? void 0 : _b.secondary)
|
|
1493
|
+
this.color2 = this.sfCrudService.configEmpresa.colors.secondary;
|
|
1494
|
+
if ((_c = this.sfCrudService.configEmpresa.colors) === null || _c === void 0 ? void 0 : _c.button)
|
|
1495
|
+
this.colorButtons = this.sfCrudService.configEmpresa.colors.secondary;
|
|
1496
|
+
}
|
|
1497
|
+
if (!this.color2)
|
|
1498
|
+
this.color2 = this.colorButtons = "blue";
|
|
1499
|
+
};
|
|
1500
|
+
// submit(index: number) {
|
|
1501
|
+
// let registro = this.sfCrudService.getRegistro(index)
|
|
1502
|
+
// let operation = registro.operations.find(op => op.type.startsWith(this.sfCrudService.getTrx(0)))!
|
|
1503
|
+
// console.log(operation)
|
|
1504
|
+
// let url = this.sfCrudService.getURL(operation, index)
|
|
1505
|
+
// return this.generalService.genericRequest(operation.method, url, this.sfCrudService.getData(index))
|
|
1506
|
+
// .then((res) => {
|
|
1507
|
+
// if (res === null) res = {}
|
|
1508
|
+
// res = this.sfCrudService.applyObjectKeys(res, operation.keysEsquema || [], registro)
|
|
1509
|
+
// console.log(res)
|
|
1510
|
+
// this.sfCrudService.setAnswers(res, 0)
|
|
1511
|
+
// if (operation.changeTrx) operation.changeTrx.forEach(x => this.sfCrudService.setTrx(x.trx, x.index))
|
|
1512
|
+
// // this.notificationService.generateMessage(this.notificationService.genDefaultMessage("success", undefined, "Información subida correctamente", operation.answerChecking), res, operation.answerChecking)
|
|
1513
|
+
// // return res;
|
|
1514
|
+
// })
|
|
1515
|
+
// .catch(err => {
|
|
1516
|
+
// // const operation = this.sfCrudService.getRegistro(this.indexCrud).operations.find(op => op.type.startsWith(this.sfCrudService.getTrx(index)))!
|
|
1517
|
+
// // this.notificationService.generateMessage(this.notificationService.genDefaultMessage("error", "Error no controlado", "Por favor comunicarse con el admin",operation.errorChecking), err.error, operation.errorChecking)
|
|
1518
|
+
// // throw new Error(err)
|
|
1519
|
+
// })
|
|
1520
|
+
// }
|
|
1521
|
+
TableroComponent.prototype.getInfoTablero = function () {
|
|
1522
|
+
var _this = this;
|
|
1523
|
+
//this.submit(0)
|
|
1524
|
+
this.data = [];
|
|
1525
|
+
this.initialData = [];
|
|
1526
|
+
this.loading.inProgress = true;
|
|
1527
|
+
this.sfCrudService.formLoading = this.loading;
|
|
1528
|
+
var url = this.aplyKeys(this.crudConfig.tablero.keys, "" + this.generalService.jsonConfig[this.crudConfig.tablero.server] + this.crudConfig.tablero.endpoint, this.dataExt);
|
|
1529
|
+
this.generalService.genericRequest(this.crudConfig.tablero.method, url, this.dataExt)
|
|
1530
|
+
.then(function (res) {
|
|
1531
|
+
var aux;
|
|
1532
|
+
if (!Array.isArray(res))
|
|
1533
|
+
aux = res.data;
|
|
1534
|
+
else
|
|
1535
|
+
aux = res;
|
|
1536
|
+
_this.initialData = ___namespace.cloneDeep(aux);
|
|
1537
|
+
_this.generateData(aux);
|
|
1538
|
+
_this.loadOptions();
|
|
1539
|
+
})
|
|
1540
|
+
.finally(function () {
|
|
1541
|
+
_this.loading.inProgress = false;
|
|
1542
|
+
_this.sfCrudService.formLoading = _this.loading;
|
|
1543
|
+
});
|
|
1544
|
+
};
|
|
1545
|
+
TableroComponent.prototype.generateData = function (data) {
|
|
1546
|
+
var _this = this;
|
|
1547
|
+
data.forEach(function (item) {
|
|
1548
|
+
var newItem = {};
|
|
1549
|
+
_this.crudConfig.tablero.columns.forEach(function (col) {
|
|
1550
|
+
newItem[col.col] = _this.getValue(col.col, item);
|
|
1551
|
+
});
|
|
1552
|
+
_this.data.push(newItem);
|
|
1553
|
+
});
|
|
1554
|
+
console.log(this.data);
|
|
1555
|
+
};
|
|
1556
|
+
TableroComponent.prototype.getValue = function (path, item) {
|
|
1557
|
+
if (path.includes("."))
|
|
1558
|
+
return jsonpath__namespace.query(item, path)[0];
|
|
1559
|
+
return item[path];
|
|
1560
|
+
};
|
|
1561
|
+
TableroComponent.prototype.externalLinkAction = function () {
|
|
1562
|
+
var _this = this;
|
|
1563
|
+
this.opciones.filter(function (opc) { return opc.valor.action; }).forEach(function (opc) { return _this.execAction(opc.valor); });
|
|
1564
|
+
};
|
|
1565
|
+
TableroComponent.prototype.loadOptions = function () {
|
|
1566
|
+
var _this = this;
|
|
1567
|
+
this.items = [];
|
|
1568
|
+
this.btn.create = this.opciones.find(function (x) { return x.label == 'Crear'; });
|
|
1569
|
+
this.opciones.filter(function (opc) { return opc.valor.action; }).forEach(function (opc) {
|
|
1570
|
+
_this.items.push({ label: opc.label, icon: opc.icon, command: function () { return _this.execAction(opc.valor); } });
|
|
1571
|
+
});
|
|
1572
|
+
};
|
|
1573
|
+
TableroComponent.prototype.redirect = function (accion, data) {
|
|
1574
|
+
var _a, _b;
|
|
1575
|
+
this.stepService.reset();
|
|
1576
|
+
this.sfCrudService.reset();
|
|
1577
|
+
switch (accion) {
|
|
663
1578
|
case 'create':
|
|
664
1579
|
this.router.navigateByUrl(((_b = (_a = this.btn.create) === null || _a === void 0 ? void 0 : _a.valor) === null || _b === void 0 ? void 0 : _b.redirect) || '');
|
|
665
1580
|
break;
|
|
@@ -701,7 +1616,10 @@
|
|
|
701
1616
|
TableroComponent.prototype.execAction = function (params) {
|
|
702
1617
|
switch (params.action) {
|
|
703
1618
|
case 'redirect':
|
|
704
|
-
this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, params.link, this.itemSelected))
|
|
1619
|
+
this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, params.link, this.itemSelected)).then(function () {
|
|
1620
|
+
if (params.reload)
|
|
1621
|
+
window.location.reload();
|
|
1622
|
+
});
|
|
705
1623
|
break;
|
|
706
1624
|
default:
|
|
707
1625
|
this.onSelectAction.emit({ data: ___namespace.cloneDeep(this.itemSelected), params: params });
|
|
@@ -710,54 +1628,499 @@
|
|
|
710
1628
|
};
|
|
711
1629
|
return TableroComponent;
|
|
712
1630
|
}());
|
|
713
|
-
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 });
|
|
714
|
-
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" },
|
|
1631
|
+
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 }, { token: SfCrudService }, { token: StepService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1632
|
+
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", environment: "environment", user: "user", dataExt: "dataExt" }, outputs: { onSelectAction: "onSelectAction" }, host: { properties: { "style.--secondary-color": "this.color2", "style.--button-color": "this.colorButtons" } }, ngImport: i0__namespace, template: "<div class=\"card\">\r\n <p-toolbar styleClass=\"mb-4 gap-2\" *ngIf=\"btn.create\">\r\n <ng-template pTemplate=\"left\">\r\n <button 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 *ngIf=\"crudConfig?.tablero?.columns\" #dt [columns]=\"crudConfig.tablero.columns\" [value]=\"data\" [rowHover]=\"true\" [rows]=\"10\" [paginator]=\"true\"\r\n [totalRecords]=\"data.length\" [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\" let-index=\"rowIndex\">\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 *ngIf=\"items.length > 1\" icon=\"pi pi-align-justify\" [model]=\"items\" appendTo=\"body\"\r\n (onDropdownClick)=\"itemSelected = rowData\"></p-splitButton>\r\n <div *ngIf=\"items.length <= 1\">\r\n <button *ngFor=\"let item of items\" pButton pRipple [icon]=\"item.icon\" class=\"mr-2\"\r\n (click)=\"itemSelected = initialData[index]; item.command()\"></button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n", styles: ["::ng-deep .p-datatable table{min-width:100%}button:not(.p-button-success){background:var(--secondary-color)!important;border:var(--secondary-color)!important;color:#fff}\n"], components: [{ type: i5__namespace.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: i6__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: i7__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: i12__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i11__namespace.Ripple, selector: "[pRipple]" }, { type: i12__namespace$1.InputText, selector: "[pInputText]" }, { type: i12__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i12__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i12__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "date": i12__namespace.DatePipe, "currency": i12__namespace.CurrencyPipe } });
|
|
715
1633
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TableroComponent, decorators: [{
|
|
716
1634
|
type: i0.Component,
|
|
717
1635
|
args: [{
|
|
718
1636
|
selector: 'sf-crudtablero',
|
|
719
|
-
templateUrl: './tablero.component.html'
|
|
1637
|
+
templateUrl: './tablero.component.html',
|
|
1638
|
+
styleUrls: ['./tablero.component.css']
|
|
720
1639
|
}]
|
|
721
|
-
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }]; }, propDecorators: { opciones: [{
|
|
1640
|
+
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }, { type: SfCrudService }, { type: StepService }]; }, propDecorators: { opciones: [{
|
|
722
1641
|
type: i0.Input
|
|
723
1642
|
}], idEntidad: [{
|
|
724
1643
|
type: i0.Input
|
|
725
1644
|
}], idKatios: [{
|
|
726
1645
|
type: i0.Input
|
|
1646
|
+
}], environment: [{
|
|
1647
|
+
type: i0.Input
|
|
727
1648
|
}], user: [{
|
|
728
1649
|
type: i0.Input
|
|
729
1650
|
}], dataExt: [{
|
|
730
1651
|
type: i0.Input
|
|
731
1652
|
}], onSelectAction: [{
|
|
732
1653
|
type: i0.Output
|
|
1654
|
+
}], color2: [{
|
|
1655
|
+
type: i0.HostBinding,
|
|
1656
|
+
args: ["style.--secondary-color"]
|
|
1657
|
+
}], colorButtons: [{
|
|
1658
|
+
type: i0.HostBinding,
|
|
1659
|
+
args: ["style.--button-color"]
|
|
733
1660
|
}] } });
|
|
734
1661
|
|
|
735
|
-
var
|
|
736
|
-
function
|
|
737
|
-
this.
|
|
738
|
-
this.
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
this.
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
this.
|
|
745
|
-
|
|
1662
|
+
var NotificationService = /** @class */ (function () {
|
|
1663
|
+
function NotificationService(sfCrudService) {
|
|
1664
|
+
this.sfCrudService = sfCrudService;
|
|
1665
|
+
this._notificationAdded = new rxjs.BehaviorSubject(undefined);
|
|
1666
|
+
}
|
|
1667
|
+
NotificationService.prototype.addNotification = function (msg, requestChecking) {
|
|
1668
|
+
this._notificationAdded.next({ msg: msg, requestChecking: requestChecking });
|
|
1669
|
+
};
|
|
1670
|
+
NotificationService.prototype.notificationAdded$ = function () {
|
|
1671
|
+
return this._notificationAdded.asObservable();
|
|
1672
|
+
};
|
|
1673
|
+
/**
|
|
1674
|
+
* Generates message using answerchecking
|
|
1675
|
+
* @param currentMsg Default message: Message | SweetAlertOptions
|
|
1676
|
+
* @param rta Resquest's response
|
|
1677
|
+
* @param answerChecking
|
|
1678
|
+
*/
|
|
1679
|
+
NotificationService.prototype.generateMessage = function (currentMsg, rta, requestChecking) {
|
|
1680
|
+
if (requestChecking) {
|
|
1681
|
+
if (requestChecking.statics)
|
|
1682
|
+
Object.assign(currentMsg, requestChecking.statics);
|
|
1683
|
+
//mapear los dinamicos
|
|
1684
|
+
if (requestChecking.dynamics) {
|
|
1685
|
+
var dynamics = requestChecking.dynamics;
|
|
1686
|
+
try {
|
|
1687
|
+
if (dynamics && typeof (rta) == "string")
|
|
1688
|
+
rta = JSON.parse(rta);
|
|
1689
|
+
if (requestChecking.parse) {
|
|
1690
|
+
var valueParsed = JSON.parse(jsonpath__namespace.query(rta, requestChecking.parse)[0]);
|
|
1691
|
+
jsonpath__namespace.value(rta, requestChecking.parse, valueParsed);
|
|
1692
|
+
}
|
|
1693
|
+
if (dynamics) {
|
|
1694
|
+
for (var property in dynamics) {
|
|
1695
|
+
currentMsg[property] = jsonpath__namespace.query(rta, dynamics[property])[0];
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
catch (error) { //es una respuesta sin JSON
|
|
1700
|
+
if (dynamics)
|
|
1701
|
+
currentMsg.detail = rta;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
return currentMsg;
|
|
1706
|
+
};
|
|
1707
|
+
NotificationService.prototype.genDefaultMessage = function (severity, title, detail, requestChecking) {
|
|
1708
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1709
|
+
var obj = { title: title, text: detail, icon: severity,
|
|
1710
|
+
confirmButtonColor: ((_a = this.sfCrudService.configEmpresa) === null || _a === void 0 ? void 0 : _a.colors) ? (_c = (_b = this.sfCrudService.configEmpresa) === null || _b === void 0 ? void 0 : _b.colors) === null || _c === void 0 ? void 0 : _c.button : "#3085d6",
|
|
1711
|
+
cancelButtonColor: ((_d = this.sfCrudService.configEmpresa) === null || _d === void 0 ? void 0 : _d.colors) ? (_f = (_e = this.sfCrudService.configEmpresa) === null || _e === void 0 ? void 0 : _e.colors) === null || _f === void 0 ? void 0 : _f.button : "#d33" };
|
|
1712
|
+
if (requestChecking && requestChecking.useSwal && severity == "error") {
|
|
1713
|
+
obj.showCancelButton = true;
|
|
1714
|
+
obj.confirmButtonText = '<i class="pi pi-check"></i> Continuar';
|
|
1715
|
+
obj.cancelButtonText = '<i class="pi pi-times"></i> Terminar';
|
|
1716
|
+
}
|
|
1717
|
+
if (!requestChecking || !requestChecking.useSwal) {
|
|
1718
|
+
obj.severity = severity;
|
|
1719
|
+
obj.summary = title;
|
|
1720
|
+
obj.detail = detail;
|
|
1721
|
+
}
|
|
1722
|
+
return obj;
|
|
1723
|
+
};
|
|
1724
|
+
return NotificationService;
|
|
1725
|
+
}());
|
|
1726
|
+
NotificationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NotificationService, deps: [{ token: SfCrudService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1727
|
+
NotificationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NotificationService, providedIn: 'root' });
|
|
1728
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NotificationService, decorators: [{
|
|
1729
|
+
type: i0.Injectable,
|
|
1730
|
+
args: [{
|
|
1731
|
+
providedIn: 'root'
|
|
1732
|
+
}]
|
|
1733
|
+
}], ctorParameters: function () { return [{ type: SfCrudService }]; } });
|
|
1734
|
+
var Notification = /** @class */ (function () {
|
|
1735
|
+
function Notification(msg, requestChecking) {
|
|
1736
|
+
this.msg = msg;
|
|
1737
|
+
this.requestChecking = requestChecking;
|
|
1738
|
+
}
|
|
1739
|
+
return Notification;
|
|
1740
|
+
}());
|
|
1741
|
+
|
|
1742
|
+
var StepComponent = /** @class */ (function () {
|
|
1743
|
+
function StepComponent(router, stepService, activatedRoute) {
|
|
1744
|
+
this.router = router;
|
|
1745
|
+
this.stepService = stepService;
|
|
1746
|
+
this.activatedRoute = activatedRoute;
|
|
1747
|
+
this.activeIndex = 0;
|
|
1748
|
+
this.loading = false;
|
|
1749
|
+
this.nextMovement = 0;
|
|
1750
|
+
}
|
|
1751
|
+
StepComponent.prototype.ngOnInit = function () {
|
|
1752
|
+
var _this = this;
|
|
1753
|
+
this.stepService.currentIndex$.subscribe(function (result) {
|
|
1754
|
+
_this.nextMovement = result;
|
|
1755
|
+
_this.router.navigate([_this.items[result].routerLink], { relativeTo: _this.activatedRoute, queryParamsHandling: "preserve" });
|
|
1756
|
+
_this.moveScroll(_this.nextMovement);
|
|
1757
|
+
_this.activeIndex = result;
|
|
1758
|
+
});
|
|
1759
|
+
};
|
|
1760
|
+
StepComponent.prototype.ngAfterViewInit = function () {
|
|
1761
|
+
var _this = this;
|
|
1762
|
+
this.stepService.requestApproved$.subscribe(function (result) {
|
|
1763
|
+
if (result) {
|
|
1764
|
+
_this.navigate();
|
|
1765
|
+
}
|
|
1766
|
+
_this.loading = false;
|
|
1767
|
+
});
|
|
1768
|
+
this.moveScroll(this.nextMovement);
|
|
1769
|
+
};
|
|
1770
|
+
StepComponent.prototype.onactiveIndexChange = function ($event) {
|
|
1771
|
+
this.requestNaviagtion($event - this.activeIndex);
|
|
1772
|
+
};
|
|
1773
|
+
/**
|
|
1774
|
+
* Button solicitates permissions to change tab.
|
|
1775
|
+
* @param add steps to advance. If negative will go back
|
|
1776
|
+
*/
|
|
1777
|
+
StepComponent.prototype.requestNaviagtion = function (add) {
|
|
1778
|
+
this.loading = true;
|
|
1779
|
+
this.nextMovement = this.activeIndex + add;
|
|
1780
|
+
this.stepService.requestApproval = this.nextMovement;
|
|
1781
|
+
};
|
|
1782
|
+
StepComponent.prototype.navigate = function () {
|
|
1783
|
+
if (this.nextMovement < this.items.length) {
|
|
1784
|
+
this.activeIndex = this.nextMovement;
|
|
1785
|
+
this.router.navigate([this.items[this.nextMovement].routerLink], { relativeTo: this.activatedRoute, queryParamsHandling: "preserve" });
|
|
1786
|
+
}
|
|
1787
|
+
};
|
|
1788
|
+
StepComponent.prototype.moveScroll = function (nextIndex) {
|
|
1789
|
+
var miDiv = document.getElementById("step-container");
|
|
1790
|
+
var steps = document.querySelector(".p-steps ul[role='tablist']");
|
|
1791
|
+
if (steps !== null) {
|
|
1792
|
+
var i = 0;
|
|
1793
|
+
var value = 0;
|
|
1794
|
+
while (i < nextIndex) {
|
|
1795
|
+
var child = steps.children[i];
|
|
1796
|
+
value += child.clientWidth;
|
|
1797
|
+
i++;
|
|
1798
|
+
}
|
|
1799
|
+
miDiv.scrollLeft = value;
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
return StepComponent;
|
|
1803
|
+
}());
|
|
1804
|
+
StepComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepComponent, deps: [{ token: i2__namespace.Router }, { token: StepService }, { token: i2__namespace.ActivatedRoute }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1805
|
+
StepComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StepComponent, selector: "app-step", inputs: { items: "items" }, ngImport: i0__namespace, template: "<div>\r\n <div id=\"step-container\">\r\n <p-steps #stepsComponent [model]=\"items\" [readonly]=\"false\" [activeIndex]=\"activeIndex\" (activeIndexChange)=\"onactiveIndexChange($event)\"></p-steps>\r\n </div>\r\n\r\n <div class=\"content\">\r\n <router-outlet></router-outlet>\r\n </div>\r\n <div class=\"buttons-step\">\r\n <div >\r\n <button pButton *ngIf=\"activeIndex != 0\" icon=\"pi pi-arrow-left\" [disabled]=\"loading\"\r\n (click)=\"requestNaviagtion(-1)\"></button>\r\n </div>\r\n <span >\r\n <button pButton *ngIf=\"!(activeIndex + 1 >= items.length)\" icon=\"pi pi-arrow-right\" [disabled]=\"loading\"\r\n (click)=\"requestNaviagtion(1)\"></button>\r\n </span>\r\n <button pButton *ngIf=\"activeIndex >= items.length - 1\" label=\"Finalizar\" [disabled]=\"loading\" (click)=\"requestNaviagtion(0)\"\r\n [style]=\"{'margin-left': '10px'}\"></button>\r\n </div>\r\n</div>\r\n", styles: ["::ng-deep .p-steps-number{background-color:var(--secondary-color)!important}::ng-deep .p-button{border-radius:6px}::ng-deep .p-steps-item .p-menuitem-link{margin-inline:15vw}::ng-deep .p-steps .p-steps-item.p-highlight .p-steps-number{color:#fff;font-family:sans-serif}::ng-deep .p-steps .p-steps-item.p-highlight .p-steps-title{color:#4b5563;font-family:inherit}::ng-deep{& ul[role=tablist]{padding-bottom:10px}& .p-steps-number{color:#fff!important}}.buttons-step{margin-bottom:1.5rem}.buttons-step button{height:3.5rem}.buttons-step ::ng-deep .p-button{background-color:var(--button-color);border-color:var(--button-color)}.buttons-step .p-button-icon-only{width:3.5rem}#step-container{overflow-x:scroll;scrollbar-width:20px;padding-bottom:5px}.buttons-step{display:flex;justify-content:space-evenly}.content{margin-block:30px}@media screen and (max-width: 765px){::ng-deep{& .p-steps-title{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;width:inherit;text-align:center}}::ng-deep .p-steps-item a.p-menuitem-link{margin-inline:0!important;width:90vw}}\n"], components: [{ type: i3__namespace.Steps, selector: "p-steps", inputs: ["activeIndex", "model", "readonly", "style", "styleClass"], outputs: ["activeIndexChange"] }], directives: [{ type: i2__namespace.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }, { type: i12__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
|
|
1806
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepComponent, decorators: [{
|
|
1807
|
+
type: i0.Component,
|
|
1808
|
+
args: [{
|
|
1809
|
+
selector: 'app-step',
|
|
1810
|
+
templateUrl: './step.component.html',
|
|
1811
|
+
styleUrls: ['./step.component.css']
|
|
1812
|
+
}]
|
|
1813
|
+
}], ctorParameters: function () { return [{ type: i2__namespace.Router }, { type: StepService }, { type: i2__namespace.ActivatedRoute }]; }, propDecorators: { items: [{
|
|
1814
|
+
type: i0.Input
|
|
1815
|
+
}] } });
|
|
1816
|
+
|
|
1817
|
+
var Shema = /** @class */ (function () {
|
|
1818
|
+
function Shema() {
|
|
1819
|
+
this.type = '';
|
|
1820
|
+
this.subtype = '';
|
|
1821
|
+
this.configuration = new ShemaConfig();
|
|
1822
|
+
this.allowCustomOption = false;
|
|
1823
|
+
}
|
|
1824
|
+
return Shema;
|
|
1825
|
+
}());
|
|
1826
|
+
var ShemaConfig = /** @class */ (function () {
|
|
1827
|
+
function ShemaConfig() {
|
|
1828
|
+
}
|
|
1829
|
+
return ShemaConfig;
|
|
1830
|
+
}());
|
|
1831
|
+
|
|
1832
|
+
var FileUploadComponent = /** @class */ (function () {
|
|
1833
|
+
function FileUploadComponent(messageSerice) {
|
|
1834
|
+
var _this = this;
|
|
1835
|
+
this.messageSerice = messageSerice;
|
|
1836
|
+
this.files = [];
|
|
1837
|
+
this.loading = false;
|
|
1838
|
+
this.accept = "image/*,application/pdf";
|
|
1839
|
+
this.onUpload = new i0.EventEmitter();
|
|
1840
|
+
this.onDeleteFile = new i0.EventEmitter();
|
|
1841
|
+
this.newFiles = [];
|
|
1842
|
+
window.addEventListener("paste", function (e) {
|
|
1843
|
+
var _a;
|
|
1844
|
+
if (((_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.files) && e.clipboardData.files.length > 0) {
|
|
1845
|
+
_this.appendFile(e.clipboardData.files[0]);
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
FileUploadComponent.prototype.ngOnChanges = function (changes) {
|
|
1850
|
+
};
|
|
1851
|
+
FileUploadComponent.prototype.ngOnInit = function () {
|
|
1852
|
+
};
|
|
1853
|
+
FileUploadComponent.prototype.appendFile = function (file) {
|
|
1854
|
+
var allowedTypes = this.accept.split(",");
|
|
1855
|
+
var allowedFile = allowedTypes.some(function (pattern) {
|
|
1856
|
+
var regexObj = new RegExp(pattern);
|
|
1857
|
+
var match = regexObj.exec(file.type);
|
|
1858
|
+
return match ? (match === null || match === void 0 ? void 0 : match.length) > 0 : false;
|
|
1859
|
+
});
|
|
1860
|
+
if (allowedFile) {
|
|
1861
|
+
var newFile = new File([file], this.getName(file), { type: file.type });
|
|
1862
|
+
if (this.limit == 1) {
|
|
1863
|
+
this.newFiles = [newFile];
|
|
1864
|
+
}
|
|
1865
|
+
else
|
|
1866
|
+
this.newFiles.push(newFile);
|
|
1867
|
+
this.files.push({ name: newFile.name, url: window.URL.createObjectURL(newFile) });
|
|
1868
|
+
}
|
|
1869
|
+
else {
|
|
1870
|
+
this.messageSerice.add({ severity: "warn", detail: "Tipo de archivo no válido" });
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
FileUploadComponent.prototype.emitFiles = function () {
|
|
1874
|
+
this.loading = true;
|
|
1875
|
+
this.onUpload.emit(this.newFiles);
|
|
1876
|
+
};
|
|
1877
|
+
FileUploadComponent.prototype.getName = function (file) {
|
|
1878
|
+
var sName = "";
|
|
1879
|
+
var date = new Date();
|
|
1880
|
+
if (this.configName !== undefined) {
|
|
1881
|
+
var name = this.configName.split('|');
|
|
1882
|
+
name.forEach(function (item) {
|
|
1883
|
+
if (item.indexOf("DATE@") != -1)
|
|
1884
|
+
sName += (moment__namespace(date)).format(item.split('@')[1]);
|
|
1885
|
+
else if (item.indexOf("@") == -1)
|
|
1886
|
+
sName += item;
|
|
1887
|
+
});
|
|
1888
|
+
var ext = this.getExt(file);
|
|
1889
|
+
sName += ext ? "." + ext : "";
|
|
1890
|
+
}
|
|
1891
|
+
else
|
|
1892
|
+
sName = file.name;
|
|
1893
|
+
return sName;
|
|
1894
|
+
};
|
|
1895
|
+
FileUploadComponent.prototype.getExt = function (file) {
|
|
1896
|
+
var ext = undefined;
|
|
1897
|
+
var aux = file.name.split('.');
|
|
1898
|
+
if (aux.length > 0)
|
|
1899
|
+
ext = aux[aux.length - 1];
|
|
1900
|
+
return ext;
|
|
1901
|
+
};
|
|
1902
|
+
FileUploadComponent.prototype.appendFiles = function ($event) {
|
|
1903
|
+
if ($event.target.files.length > 0) {
|
|
1904
|
+
this.appendFile($event.target.files[0]);
|
|
1905
|
+
}
|
|
1906
|
+
if (this.limit == this.files.length) {
|
|
1907
|
+
this.stopAnimation();
|
|
1908
|
+
this.emitFiles();
|
|
1909
|
+
}
|
|
1910
|
+
else
|
|
1911
|
+
this.startAnimation();
|
|
1912
|
+
this.fileUploader.nativeElement.value = "";
|
|
1913
|
+
};
|
|
1914
|
+
FileUploadComponent.prototype.dropFile = function (archivo) {
|
|
1915
|
+
var _this = this;
|
|
1916
|
+
this.files.forEach(function (f, index) {
|
|
1917
|
+
if (f == archivo) {
|
|
1918
|
+
_this.files.splice(index, 1);
|
|
1919
|
+
_this.onDeleteFile.emit(index);
|
|
1920
|
+
}
|
|
1921
|
+
});
|
|
1922
|
+
};
|
|
1923
|
+
FileUploadComponent.prototype.openFile = function (archivo) {
|
|
1924
|
+
window.open(archivo.url, '_blank');
|
|
1925
|
+
window.addEventListener('focus', function () { return URL.revokeObjectURL(archivo.url); });
|
|
1926
|
+
};
|
|
1927
|
+
FileUploadComponent.prototype.startAnimation = function () {
|
|
1928
|
+
var button = document.querySelector('.button-upload');
|
|
1929
|
+
if (button) {
|
|
1930
|
+
button.classList.add('animate-pulse');
|
|
1931
|
+
}
|
|
1932
|
+
};
|
|
1933
|
+
FileUploadComponent.prototype.stopAnimation = function () {
|
|
1934
|
+
var button = document.querySelector('.button-upload');
|
|
1935
|
+
if (button) {
|
|
1936
|
+
button.classList.remove('animate-pulse');
|
|
1937
|
+
}
|
|
1938
|
+
};
|
|
1939
|
+
return FileUploadComponent;
|
|
1940
|
+
}());
|
|
1941
|
+
FileUploadComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FileUploadComponent, deps: [{ token: i1__namespace$1.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1942
|
+
FileUploadComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FileUploadComponent, selector: "sf-file-upload", inputs: { limit: "limit", files: "files", loading: "loading", configName: "configName", accept: "accept" }, outputs: { onUpload: "onUpload", onDeleteFile: "onDeleteFile" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUpload"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div id=\"screen\" #screen>\r\n <div class=\"fileUp\">\r\n <div class=\"botones\">\r\n <input type=\"file\" (change)=\"appendFiles($event)\" class=\"file-input\" #fileUpload multiple>\r\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" class=\"p-button-info\" (click)=\"fileUpload.click()\"\r\n [disabled]=\"limit == files.length\" [loading]=\"loading\"></button>\r\n <button *ngIf=\"limit != 1\" pButton pRipple type=\"button\" icon=\"pi pi-upload\" class=\"button-upload p-button-info\"\r\n (click)=\"emitFiles()\" [disabled]=\"files.length == 0 || loading\" [loading]=\"loading\"></button>\r\n </div>\r\n\r\n <hr>\r\n <div class=\"imgs\">\r\n <ul>\r\n <li *ngFor=\"let file of files; let i = index\" [ngSwitch]=\"file.type\">\r\n <p>{{i+1}}. {{files[i].name}}</p>\r\n <div>\r\n <button pButton pRipple type=\"button\" icon=\"pi pi-external-link\" class=\"p-button-rounded\"\r\n (click)=\"openFile(file)\"></button>\r\n <button pButton pRipple type=\"button\" icon=\"pi pi-times\" class=\"p-button-rounded p-button-danger\"\r\n (click)=\"dropFile(file)\"></button>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#screen{container-type:inline-size}iframe{width:100%;padding:10px;text-align:center}.fileUp{border:1.5px solid gray;border-radius:5px;text-align:center}.fileUp .imgs{min-height:40px;margin-block:7px;max-height:135px;overflow-y:scroll}.fileUp hr{color:gray;margin:0}.fileUp .imgs ul li{text-decoration:none;display:flex;margin-block:5px;padding-inline:5px}.fileUp .imgs ul{padding-inline-start:30px}.fileUp .imgs ul li div{text-decoration:none;display:grid;grid-template-columns:50% 50%;margin-block:5px;margin-right:5px}.fileUp .botones *{margin-block:7px;margin-inline:10px}.fileUp .imgs ul li p{text-align:left;white-space:nowrap;width:100%;overflow:hidden;text-overflow:ellipsis}.fileUp .imgs ul li p,.fileUp .imgs ul li button{margin-block:auto;margin-inline:5px;text-align:left}.fileUp .imgs ul li img,.fileUp .imgs ul li iframe{text-align:center;width:80%;padding-inline:10%}.file-input{display:none}::ng-deep .p-button.p-button-info,.p-buttonset.p-button-info>.p-button,.p-splitbutton.p-button-info>.p-button{background:var(--secondary-color)!important;border:var(--secondary-color)!important;color:#fff}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}.animate-pulse{animation:pulse 1.5s infinite}@container (width < 768px){.fileUp .imgs ul li {display: grid; grid-template-columns: 60% 40%;} .fileUp .imgs ul li img,.fileUp .imgs ul li iframe {display: none;}}\n"], directives: [{ type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i11__namespace.Ripple, selector: "[pRipple]" }, { type: i12__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i12__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }] });
|
|
1943
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FileUploadComponent, decorators: [{
|
|
1944
|
+
type: i0.Component,
|
|
1945
|
+
args: [{
|
|
1946
|
+
selector: 'sf-file-upload',
|
|
1947
|
+
templateUrl: './file-upload.component.html',
|
|
1948
|
+
styleUrls: ['./file-upload.component.css']
|
|
1949
|
+
}]
|
|
1950
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.MessageService }]; }, propDecorators: { limit: [{
|
|
1951
|
+
type: i0.Input
|
|
1952
|
+
}], files: [{
|
|
1953
|
+
type: i0.Input
|
|
1954
|
+
}], loading: [{
|
|
1955
|
+
type: i0.Input
|
|
1956
|
+
}], configName: [{
|
|
1957
|
+
type: i0.Input
|
|
1958
|
+
}], accept: [{
|
|
1959
|
+
type: i0.Input
|
|
1960
|
+
}], onUpload: [{
|
|
1961
|
+
type: i0.Output
|
|
1962
|
+
}], onDeleteFile: [{
|
|
1963
|
+
type: i0.Output
|
|
1964
|
+
}], fileUploader: [{
|
|
1965
|
+
type: i0.ViewChild,
|
|
1966
|
+
args: ['fileUpload']
|
|
1967
|
+
}] } });
|
|
1968
|
+
var Archivo = /** @class */ (function () {
|
|
1969
|
+
function Archivo() {
|
|
1970
|
+
}
|
|
1971
|
+
return Archivo;
|
|
1972
|
+
}());
|
|
1973
|
+
|
|
1974
|
+
var ControlComponent = /** @class */ (function () {
|
|
1975
|
+
function ControlComponent(generalService, crudService, cdr, notificationService) {
|
|
1976
|
+
this.generalService = generalService;
|
|
1977
|
+
this.crudService = crudService;
|
|
1978
|
+
this.cdr = cdr;
|
|
1979
|
+
this.notificationService = notificationService;
|
|
1980
|
+
this.showTempValue = false;
|
|
1981
|
+
this.control = new Shema();
|
|
1982
|
+
this.label = '';
|
|
1983
|
+
this.setValue = new i0.EventEmitter();
|
|
1984
|
+
this.sendObject = new i0.EventEmitter();
|
|
1985
|
+
this.isLoading = false;
|
|
1986
|
+
this.dataFromService = [];
|
|
1987
|
+
this.uploadedFiles = [];
|
|
746
1988
|
this.displayAdd = false;
|
|
747
|
-
this.
|
|
1989
|
+
this.uploadingFiles = false;
|
|
748
1990
|
}
|
|
1991
|
+
ControlComponent.prototype.ngOnChanges = function (changes) {
|
|
1992
|
+
};
|
|
749
1993
|
ControlComponent.prototype.ngOnInit = function () {
|
|
750
|
-
var
|
|
751
|
-
|
|
1994
|
+
var _this = this;
|
|
1995
|
+
var _a, _b;
|
|
1996
|
+
this.loadDefaultValues();
|
|
1997
|
+
if ((_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.depends) {
|
|
1998
|
+
this.crudService.changeData$.subscribe(function (res) {
|
|
1999
|
+
var _a, _b;
|
|
2000
|
+
if (res) {
|
|
2001
|
+
var registro = _this.crudService.getRegistro(_this.crudService.index);
|
|
2002
|
+
var keyFound = (_a = registro.keys) === null || _a === void 0 ? void 0 : _a.find(function (k) { return k.scope === res.scope
|
|
2003
|
+
&& _this.control.config.depends.includes(k.key) &&
|
|
2004
|
+
(res.index === k.indexData || res.index === k.indexAnswer); });
|
|
2005
|
+
if (keyFound === null || keyFound === void 0 ? void 0 : keyFound.overrideControl) {
|
|
2006
|
+
var override = keyFound.overrideControl;
|
|
2007
|
+
var completed = _this.crudService.isConditionsCompleted((_b = override.conditions) !== null && _b !== void 0 ? _b : [], registro.conditions || [], _this.crudService.getData(_this.crudService.index));
|
|
2008
|
+
jsonpath__namespace.value(_this.control, override.property, completed ? override.value : override.elseValue);
|
|
2009
|
+
_this.value = _this.getNewValue(override, completed);
|
|
2010
|
+
_this.tempValue = null;
|
|
2011
|
+
_this.sendValue();
|
|
2012
|
+
if (_this.control.subtype == 'dropdown' || _this.control.subtype == 'multiselect')
|
|
2013
|
+
_this.loadDataFromService();
|
|
2014
|
+
//this.cdr.detectChanges()
|
|
2015
|
+
}
|
|
2016
|
+
else if (keyFound) {
|
|
2017
|
+
_this.value = null;
|
|
2018
|
+
_this.sendValue();
|
|
2019
|
+
_this.loadDefaultValues();
|
|
2020
|
+
//this.cdr.detectChanges()
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
ControlComponent.prototype.getNewValue = function (override, completed) {
|
|
2027
|
+
var newValue = completed ? override.newPropertyValue : override.elseNewPropertyValue;
|
|
2028
|
+
if (newValue && typeof (newValue) == "string") {
|
|
2029
|
+
if (!newValue.startsWith('$') && !newValue.startsWith('@')) {
|
|
2030
|
+
return newValue;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return null;
|
|
2034
|
+
};
|
|
2035
|
+
ControlComponent.prototype.loadDefaultValues = function () {
|
|
2036
|
+
var _a, _b, _c, _d, _e;
|
|
2037
|
+
if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.config) && this.control.subtype == 'dropdown' || this.control.subtype == 'multiselect')
|
|
752
2038
|
this.loadDataFromService();
|
|
753
|
-
if (
|
|
754
|
-
this.
|
|
2039
|
+
if (((_b = this.control) === null || _b === void 0 ? void 0 : _b.subtype) == 'autocomplete')
|
|
2040
|
+
this.extracValueFromControlBusqueda();
|
|
755
2041
|
if (this.value && this.control.type == 'date')
|
|
756
|
-
this.
|
|
2042
|
+
this.instanceDate();
|
|
2043
|
+
if (((_c = this.control) === null || _c === void 0 ? void 0 : _c.subtype) == "file") {
|
|
2044
|
+
this.loadFiles();
|
|
2045
|
+
}
|
|
2046
|
+
if (((_d = this.control) === null || _d === void 0 ? void 0 : _d.type) == 'string')
|
|
2047
|
+
this.lenghtWord = this.value ? this.value.length : 0;
|
|
2048
|
+
if (((_e = this.control) === null || _e === void 0 ? void 0 : _e.subtype) == 'switch')
|
|
2049
|
+
this.instanceBoolField();
|
|
2050
|
+
};
|
|
2051
|
+
ControlComponent.prototype.instanceBoolField = function () {
|
|
2052
|
+
this.tempValue = this.value;
|
|
2053
|
+
if (this.value == true && this.control.trueValue !== undefined) {
|
|
2054
|
+
this.value = this.control.trueValue;
|
|
2055
|
+
this.sendValue();
|
|
2056
|
+
}
|
|
2057
|
+
else if (this.value == false && this.control.falseValue !== undefined) {
|
|
2058
|
+
this.value = this.control.falseValue;
|
|
2059
|
+
this.sendValue();
|
|
2060
|
+
}
|
|
2061
|
+
};
|
|
2062
|
+
ControlComponent.prototype.onChangeSwitch = function () {
|
|
2063
|
+
this.value = this.tempValue;
|
|
2064
|
+
this.sendValue();
|
|
2065
|
+
};
|
|
2066
|
+
ControlComponent.prototype.loadFiles = function () {
|
|
2067
|
+
var _this = this;
|
|
2068
|
+
this.isLoading = true;
|
|
2069
|
+
this.uploadedFiles = [];
|
|
2070
|
+
if (!this.value) {
|
|
2071
|
+
this.isLoading = false;
|
|
2072
|
+
this.cdr.detectChanges();
|
|
2073
|
+
}
|
|
2074
|
+
else if (this.control.config.namePattern && this.control.type == "string") {
|
|
2075
|
+
var urls = this.control.config.separator ? this.value.split(",") : [this.value];
|
|
2076
|
+
urls.forEach(function (url) { return _this.uploadedFiles.push({ url: url, name: _this.getNameFile(_this.control.config.namePattern, url) }); });
|
|
2077
|
+
this.isLoading = false;
|
|
2078
|
+
this.cdr.detectChanges();
|
|
2079
|
+
}
|
|
2080
|
+
else if (this.control.config.namePattern && this.control.type == "array") {
|
|
2081
|
+
this.value.forEach(function (url) { return _this.uploadedFiles.push({ url: url, name: _this.getNameFile(_this.control.config.namePattern, url) }); });
|
|
2082
|
+
this.isLoading = false;
|
|
2083
|
+
this.cdr.detectChanges();
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
ControlComponent.prototype.onDeleteFile = function (index) {
|
|
2087
|
+
var _a, _b;
|
|
2088
|
+
if ((!((_a = this.control.config) === null || _a === void 0 ? void 0 : _a.limit) || ((_b = this.control.config) === null || _b === void 0 ? void 0 : _b.limit) == 1) && this.control.type == "string")
|
|
2089
|
+
this.value = null;
|
|
2090
|
+
else if (this.control.type == "array")
|
|
2091
|
+
this.value.splice(index, 1);
|
|
2092
|
+
};
|
|
2093
|
+
ControlComponent.prototype.getNameFile = function (namePattern, url) {
|
|
2094
|
+
var regexObj = new RegExp(namePattern);
|
|
2095
|
+
var match = regexObj.exec(url);
|
|
2096
|
+
if (!match)
|
|
2097
|
+
throw new Error("El pattern no coincide con la url. " + url);
|
|
2098
|
+
return match[0];
|
|
757
2099
|
};
|
|
758
2100
|
ControlComponent.prototype.sendValue = function () {
|
|
2101
|
+
var _a;
|
|
2102
|
+
if (this.control.type == "string" && this.value == "" && ((_a = this.control.config) === null || _a === void 0 ? void 0 : _a.allowEmpty) == false)
|
|
2103
|
+
this.value = null;
|
|
759
2104
|
this.setValue.emit(this.value);
|
|
760
2105
|
};
|
|
2106
|
+
ControlComponent.prototype.sendNumberValue = function ($event) {
|
|
2107
|
+
this.value = $event.value;
|
|
2108
|
+
this.sendValue();
|
|
2109
|
+
};
|
|
2110
|
+
ControlComponent.prototype.onInputEmail = function (force) {
|
|
2111
|
+
var aux = Math.abs(this.lenghtWord - this.value.length);
|
|
2112
|
+
this.lenghtWord = this.value.length;
|
|
2113
|
+
if (aux > 1 || force) {
|
|
2114
|
+
var regex = new RegExp(/([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/igm);
|
|
2115
|
+
if (regex.test(this.value))
|
|
2116
|
+
this.sendValue();
|
|
2117
|
+
else {
|
|
2118
|
+
this.value = null;
|
|
2119
|
+
this.sendValue();
|
|
2120
|
+
this.notificationService.addNotification({ severity: 'warn', detail: 'El correo no es válido' }, this.primeChecking());
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
};
|
|
761
2124
|
ControlComponent.prototype.sendValueFromObject = function (event) {
|
|
762
2125
|
switch (typeof (this.control.config.optionValue)) {
|
|
763
2126
|
case 'object':
|
|
@@ -769,62 +2132,90 @@
|
|
|
769
2132
|
break;
|
|
770
2133
|
}
|
|
771
2134
|
};
|
|
772
|
-
ControlComponent.prototype.validateValue = function (type) {
|
|
773
|
-
switch (type) {
|
|
774
|
-
case 'email':
|
|
775
|
-
var regex = new RegExp(/([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/igm);
|
|
776
|
-
if (regex.test(this.value))
|
|
777
|
-
this.sendValue();
|
|
778
|
-
else {
|
|
779
|
-
this.value = null;
|
|
780
|
-
this.sendValue();
|
|
781
|
-
this.sendNotification.emit({ severity: 'warn', detail: 'El correo no es válido' });
|
|
782
|
-
}
|
|
783
|
-
break;
|
|
784
|
-
default:
|
|
785
|
-
break;
|
|
786
|
-
}
|
|
787
|
-
};
|
|
788
2135
|
ControlComponent.prototype.loadDataFromService = function () {
|
|
789
2136
|
var _this = this;
|
|
790
2137
|
this.isLoading = true;
|
|
791
2138
|
this.dataFromService = [];
|
|
792
|
-
|
|
2139
|
+
var op = this.control.config;
|
|
2140
|
+
var url = this.crudService.getURL(op, undefined, undefined);
|
|
2141
|
+
this.generalService.genericRequest(this.control.config.method, url)
|
|
793
2142
|
.then(function (res) {
|
|
794
2143
|
_this.dataFromService = res.data;
|
|
2144
|
+
}).finally(function () {
|
|
795
2145
|
_this.isLoading = false;
|
|
2146
|
+
_this.cdr.detectChanges();
|
|
796
2147
|
});
|
|
797
2148
|
};
|
|
798
2149
|
ControlComponent.prototype.loadDataFromControlBusquedaService = function (event) {
|
|
799
2150
|
var _this = this;
|
|
800
2151
|
this.isLoading = true;
|
|
801
|
-
|
|
2152
|
+
var op = this.control.config;
|
|
2153
|
+
var url = this.crudService.getURL(op);
|
|
2154
|
+
url = url.replace('@query', (event === null || event === void 0 ? void 0 : event.query) || '');
|
|
2155
|
+
this.generalService.genericRequest(this.control.config.method, url)
|
|
802
2156
|
.then(function (res) {
|
|
2157
|
+
var _a;
|
|
803
2158
|
_this.dataFromService = res.data;
|
|
2159
|
+
if (((_a = _this.dataFromService) === null || _a === void 0 ? void 0 : _a.length) == 0 && _this.control.allowCustomOption) {
|
|
2160
|
+
//agregar un campo que el usuario haya digitado
|
|
2161
|
+
var newItem = {};
|
|
2162
|
+
newItem[_this.control.field] = _this.tempValue;
|
|
2163
|
+
newItem[_this.control.config.optionValue] = _this.tempValue;
|
|
2164
|
+
_this.dataFromService.push(newItem);
|
|
2165
|
+
}
|
|
2166
|
+
}).finally(function () {
|
|
804
2167
|
_this.isLoading = false;
|
|
2168
|
+
_this.cdr.detectChanges();
|
|
2169
|
+
});
|
|
2170
|
+
};
|
|
2171
|
+
ControlComponent.prototype.extracValueFromControlBusqueda = function () {
|
|
2172
|
+
var _this = this;
|
|
2173
|
+
var op = this.control.config;
|
|
2174
|
+
var url = this.crudService.getURL(op);
|
|
2175
|
+
url = url.replace('@query', this.value);
|
|
2176
|
+
this.generalService.genericRequest(this.control.config.method, url)
|
|
2177
|
+
.then(function (res) {
|
|
2178
|
+
var _a;
|
|
2179
|
+
if (((_a = res.data) === null || _a === void 0 ? void 0 : _a.length) == 1 && res.data[0][_this.control.field]) {
|
|
2180
|
+
_this.tempValue = res.data[0];
|
|
2181
|
+
_this.value = res.data[0][_this.control.field];
|
|
2182
|
+
}
|
|
2183
|
+
else
|
|
2184
|
+
_this.setDefaultValue();
|
|
2185
|
+
}).finally(function () {
|
|
2186
|
+
_this.cdr.detectChanges();
|
|
2187
|
+
}).catch(function () {
|
|
2188
|
+
_this.setDefaultValue();
|
|
805
2189
|
});
|
|
806
2190
|
};
|
|
807
2191
|
ControlComponent.prototype.onUpload = function (event) {
|
|
808
2192
|
var _this = this;
|
|
809
|
-
|
|
2193
|
+
this.uploadingFiles = true;
|
|
810
2194
|
var formData = new FormData();
|
|
811
|
-
var path = 'Imagenes/CRUD/temp';
|
|
812
|
-
formData.append('uploadFile', file);
|
|
2195
|
+
var path = this.control.config.path || 'Imagenes/CRUD/temp';
|
|
813
2196
|
formData.append('Ruta', "/" + path);
|
|
814
|
-
|
|
815
|
-
|
|
2197
|
+
for (var i = 0; i < event.length; i++)
|
|
2198
|
+
formData.append("uploadFile_" + i, event[i]);
|
|
2199
|
+
var op = this.control.config;
|
|
2200
|
+
var url = this.crudService.getURL(op);
|
|
2201
|
+
this.generalService.genericRequest(this.control.config.method, url, formData)
|
|
816
2202
|
.then(function () {
|
|
817
|
-
|
|
818
|
-
_this.
|
|
819
|
-
|
|
820
|
-
|
|
2203
|
+
var _a;
|
|
2204
|
+
var separator = ((_a = _this.control.config) === null || _a === void 0 ? void 0 : _a.separator) || ",";
|
|
2205
|
+
//se asume que viene namePattern
|
|
2206
|
+
if (_this.control.type == "string")
|
|
2207
|
+
_this.value = event.map(function (f) { return "" + _this.generalService.jsonConfig.Server + path + "/" + f.name; }).join(separator);
|
|
2208
|
+
else if (_this.control.type == "array")
|
|
2209
|
+
_this.value = event.map(function (f) { return "" + _this.generalService.jsonConfig.Server + path + "/" + f.name; });
|
|
2210
|
+
// SI NO TRAE namePattern, debe retornar un objeto con el nombre y href
|
|
2211
|
+
//else if (this.control.config.namePattern && this.control.type == "array") this.value = event.map(x => x.name)
|
|
2212
|
+
//else if (!this.control.config.namePattern && this.control.type == "array") this.value = event.map(f => `${this.generalService.jsonConfig.Server}${path}/${f.name}`)
|
|
821
2213
|
_this.sendValue();
|
|
2214
|
+
var msg = !_this.control.config.limit || _this.control.config.limit == 1 ? "Archivo cargado correctamente!" : "Archivos cargados correctamente!";
|
|
2215
|
+
_this.notificationService.addNotification({ severity: 'info', detail: msg }, _this.primeChecking());
|
|
822
2216
|
})
|
|
823
|
-
.catch(function (
|
|
824
|
-
|
|
825
|
-
_this.isLoading = false;
|
|
826
|
-
_this.sendNotification.emit({ severity: 'error', detail: "Error al cargar el archivo!" });
|
|
827
|
-
});
|
|
2217
|
+
.catch(function () { return _this.notificationService.addNotification({ severity: 'error', detail: "Error al cargar el archivo!" }, _this.primeChecking()); })
|
|
2218
|
+
.finally(function () { return _this.uploadingFiles = false; });
|
|
828
2219
|
};
|
|
829
2220
|
ControlComponent.prototype.refresData = function () {
|
|
830
2221
|
var _a, _b;
|
|
@@ -832,46 +2223,102 @@
|
|
|
832
2223
|
this.loadDataFromService();
|
|
833
2224
|
};
|
|
834
2225
|
ControlComponent.prototype.setDefaultValue = function () {
|
|
835
|
-
|
|
836
|
-
|
|
2226
|
+
this.tempValue = {};
|
|
2227
|
+
if (!this.control.config.optionLabel)
|
|
2228
|
+
console.error("No esta bien configurado el control ", this.control);
|
|
2229
|
+
else
|
|
2230
|
+
this.tempValue[this.control.config.optionLabel] = this.value ? this.value : "";
|
|
837
2231
|
};
|
|
838
2232
|
ControlComponent.prototype.searchValue = function (value) {
|
|
839
2233
|
var _this = this;
|
|
840
|
-
var
|
|
841
|
-
this.
|
|
2234
|
+
var op = this.control.config;
|
|
2235
|
+
var url = this.crudService.getURL(op, undefined, undefined);
|
|
2236
|
+
url = url.replace('@id', value);
|
|
2237
|
+
this.generalService.genericRequest(this.control.config.method, url)
|
|
842
2238
|
.then(function (res) {
|
|
843
2239
|
var _a;
|
|
844
2240
|
if (((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
845
2241
|
_this.sendObject.emit({ data: res.data[0], optionValue: _this.control.config.optionValue });
|
|
846
2242
|
}
|
|
847
2243
|
else {
|
|
848
|
-
_this.
|
|
2244
|
+
_this.notificationService.addNotification({ severity: 'warn', detail: "Valor no encontrado." }, _this.primeChecking());
|
|
849
2245
|
_this.sendObject.emit({ data: null, optionValue: _this.control.config.optionValue });
|
|
850
2246
|
}
|
|
851
2247
|
})
|
|
852
2248
|
.catch(function (err) {
|
|
853
|
-
|
|
854
|
-
_this.sendNotification.emit({ severity: 'error', detail: "Error al consumir el servicio." });
|
|
2249
|
+
_this.notificationService.addNotification({ severity: 'error', detail: "Error al consumir el servicio." }, _this.primeChecking());
|
|
855
2250
|
});
|
|
856
2251
|
};
|
|
857
|
-
ControlComponent.prototype.
|
|
2252
|
+
ControlComponent.prototype.primeChecking = function () {
|
|
2253
|
+
return new RequestChecking(undefined, undefined, false, undefined, undefined, false, undefined);
|
|
2254
|
+
};
|
|
2255
|
+
ControlComponent.prototype.instanceDate = function () {
|
|
858
2256
|
var format = this.control.formatMoment;
|
|
859
|
-
if (
|
|
860
|
-
this.value
|
|
2257
|
+
if (this.value) {
|
|
2258
|
+
if (typeof (this.value) == "string" && this.value.includes("T"))
|
|
2259
|
+
this.value = new Date(this.value);
|
|
2260
|
+
else if (typeof (this.value) == "string")
|
|
2261
|
+
this.value = moment__namespace(this.value, format).toDate();
|
|
2262
|
+
this.tempValue = moment__namespace(this.value).format("DD/MM/YYYY");
|
|
2263
|
+
}
|
|
2264
|
+
else {
|
|
2265
|
+
this.tempValue = null;
|
|
2266
|
+
this.value = null;
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2269
|
+
/**
|
|
2270
|
+
* Cast tempValue to date
|
|
2271
|
+
*/
|
|
2272
|
+
ControlComponent.prototype.onChangeSDate = function () {
|
|
2273
|
+
var aux = moment__namespace(this.tempValue, "DD/MM/YYYY");
|
|
2274
|
+
if (aux.isValid()) {
|
|
2275
|
+
this.value = aux.toDate();
|
|
861
2276
|
this.sendValue();
|
|
862
2277
|
}
|
|
2278
|
+
else {
|
|
2279
|
+
this.tempValue = null;
|
|
2280
|
+
this.notificationService.addNotification({ severity: 'warn', detail: 'La fecha no es válida' }, this.primeChecking());
|
|
2281
|
+
}
|
|
2282
|
+
};
|
|
2283
|
+
ControlComponent.prototype.onChangeDate = function () {
|
|
2284
|
+
this.tempValue = moment__namespace(this.value).format("DD/MM/YYYY");
|
|
2285
|
+
this.sendValue();
|
|
2286
|
+
};
|
|
2287
|
+
ControlComponent.prototype.onTouchDescription = function () {
|
|
2288
|
+
var _a;
|
|
2289
|
+
try {
|
|
2290
|
+
(_a = this.tooltips.get(0)) === null || _a === void 0 ? void 0 : _a.activate();
|
|
2291
|
+
}
|
|
2292
|
+
catch (ex) { }
|
|
2293
|
+
};
|
|
2294
|
+
ControlComponent.prototype.onUnTouchDescription = function () {
|
|
2295
|
+
var _a;
|
|
2296
|
+
try {
|
|
2297
|
+
(_a = this.tooltips.get(0)) === null || _a === void 0 ? void 0 : _a.deactivate();
|
|
2298
|
+
}
|
|
2299
|
+
catch (ex) { }
|
|
2300
|
+
};
|
|
2301
|
+
ControlComponent.prototype.doFocusOut = function () {
|
|
2302
|
+
if (document.activeElement) {
|
|
2303
|
+
document.activeElement.blur();
|
|
2304
|
+
}
|
|
2305
|
+
this.cdr.detectChanges();
|
|
863
2306
|
};
|
|
864
2307
|
return ControlComponent;
|
|
865
2308
|
}());
|
|
866
|
-
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 });
|
|
867
|
-
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=\"'textarea'\">\r\n <textarea [rows]=\"control?.rows ? control.rows : 4\" \r\n [(ngModel)]=\"value\" (focusout)=\"sendValue()\" pInputTextarea \r\n [disabled]=\"control?.disabled || false\" [autoResize]=\"control?.autoresize || false\"></textarea>\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\" [unmask]=\"control.unmask || 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)\" [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()\" [locale]=\"control?.locale || undefined\"\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\" [locale]=\"control?.locale || undefined\"\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\" [locale]=\"control?.locale || undefined\"\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$2.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$1.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: i12__namespace.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { 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: i2__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"] }] });
|
|
2309
|
+
ControlComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, deps: [{ token: GeneralService }, { token: SfCrudService }, { token: i0__namespace.ChangeDetectorRef }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2310
|
+
ControlComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ControlComponent, selector: "sf-control", inputs: { showTempValue: "showTempValue", control: "control", label: "label", value: "value", appendTo: "appendTo" }, outputs: { setValue: "setValue", sendObject: "sendObject" }, viewQueries: [{ propertyName: "tooltips", predicate: i13.Tooltip, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<p *ngIf=\"showTempValue && tempValue\">{{tempValue[control.field]}}</p>\r\n\r\n<div *ngIf=\"!showTempValue\" [ngSwitch]=\"control.type\" #cc class=\"control-container\">\r\n <div class=\"label-container\">\r\n <label [for]=\"label\">{{label}}</label>\r\n <i #tooltip *ngIf=\"control.tooltip\" class=\"pi pi-question-circle\"\r\n [tooltipPosition]=\"control.tooltipPosition || 'top'\" [pTooltip]=\"control.tooltip\"\r\n (touchstart)=\"onTouchDescription()\" (touchend)=\"onUnTouchDescription()\"></i>\r\n </div>\r\n\r\n <ng-container *ngSwitchCase=\"'string'\" >\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'input'\">\r\n <input pInputText [name]=\"label\" type=\"text\" [(ngModel)]=\"value\" (input)=\"sendValue()\"\r\n [disabled]=\"control.disabled || false\" [autocomplete]=\"control.autocomplete || 'off'\">\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'textarea'\">\r\n <textarea [rows]=\"control.config?.rows ? control.config.rows : 4\" [(ngModel)]=\"value\"\r\n (input)=\"sendValue()\" pInputTextarea [disabled]=\"control.config?.disabled || false\"\r\n [autoResize]=\"control.config?.autoresize || false\"></textarea>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'password'\">\r\n <input pInputText type=\"password\" [(ngModel)]=\"value\" (input)=\"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 [disabled]=\"control.disabled || false\" autocomplete=\"email\" (input)=\"onInputEmail(false)\"\r\n (focusout)=\"onInputEmail(true)\" (keyup.enter)=\"doFocusOut()\">\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 [disabled]=\"control.disabled || false\" autocomplete=\"tel-national\"\r\n [unmask]=\"control.unmask || false\" (onComplete)=\"sendValue()\"></p-inputMask>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'enum'\">\r\n <p-dropdown [options]=\"control.enum\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\" appendTo=\"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\" 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:replace'\">\r\n <p-dropdown [lazy]=\"isLoading\" [options]=\"dataFromService\"\r\n (onChange)=\"sendValueFromObject($event)\" [optionLabel]=\"control.config.optionLabel\"\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=\"'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 (keyup.enter)=\"doFocusOut()\" />\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 *ngSwitchCase=\"'file'\">\r\n <sf-file-upload *ngIf=\"!isLoading\" [accept]=\"control.config?.accept || 'image/*,application/pdf'\"\r\n [loading]=\"uploadingFiles\" [files]=\"uploadedFiles\" [configName]=\"control.config?.configName\"\r\n [limit]=\"control.config?.limit || 1\" (onUpload)=\"onUpload($event)\"\r\n (onDeleteFile)=\"onDeleteFile($event)\"></sf-file-upload>\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 <div class=\"p-col-12\">\r\n <div class=\"p-inputgroup\">\r\n <p-inputMask [(ngModel)]=\"tempValue\" mask=\"99/99/9999\" [placeholder]=\"control.placeholder\"\r\n (onComplete)=\"onChangeSDate()\" [disabled]=\"control.disabled || false\"></p-inputMask>\r\n <p-calendar [(ngModel)]=\"value\" class=\"only-icon\" [monthNavigator]=\"true\" [yearNavigator]=\"true\" yearRange=\"1900:2035\"\r\n [dateFormat]=\"control.format || 'yy-mm-dd'\" appendTo=\"body\" [disabled]=\"control.disabled || false\"\r\n [showOnFocus]=\"!control.hide\" [placeholder]=\"control.placeholder || 'aaaa-mm-dd'\"\r\n [touchUI]=\"control.touchUI || false\" [showIcon]=\"control.showIcon || false\" (onSelect)=\"onChangeDate()\"\r\n (onBlur)=\"onChangeDate()\"></p-calendar>\r\n </div>\r\n </div>\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\" (ngModelChange)=\"value = $event; sendValue()\" mode=\"decimal\" [minFractionDigits]=\"control.minFractionDigits || 0\"\r\n [min]=\"control.min || null\" [max]=\"control.max || null\" (onInput)=\"sendNumberValue($event)\"\r\n [prefix]=\"control.currency || '$ '\" [disabled]=\"control.disabled || false\"></p-inputNumber>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'decimal'\">\r\n <p-inputNumber [ngModel]=\"value\" mode=\"decimal\" (ngModelChange)=\"value = $event; sendValue()\" [min]=\"control.min || null\"\r\n [max]=\"control.max || null\" [minFractionDigits]=\"control.minFractionDigits || 0\"\r\n [locale]=\"control.locale || undefined\" [useGrouping]=\"control.useGrouping || false\"\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=\" %\" (ngModelChange)=\"value = $event; sendValue()\" (onInput)=\"sendValue()\" [min]=\"control.min || null\"\r\n [max]=\"control.max || null\" [minFractionDigits]=\"control.minFractionDigits || 2\"\r\n [locale]=\"control.locale || undefined\" [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 (keyup.enter)=\"doFocusOut()\" />\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=\"'array'\">\r\n <ng-container [ngSwitch]=\"control.subtype\">\r\n <ng-container *ngSwitchCase=\"'file'\">\r\n <sf-file-upload *ngIf=\"!isLoading\" [loading]=\"uploadingFiles\" [files]=\"uploadedFiles\"\r\n [configName]=\"control.config?.configName\" [limit]=\"control.config?.limit || 1\"\r\n [accept]=\"control.config?.accept || 'image/*,application/pdf'\" (onUpload)=\"onUpload($event)\"\r\n (onDeleteFile)=\"onDeleteFile($event)\"></sf-file-upload>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'multiselect'\">\r\n <p-multiSelect [options]=\"dataFromService\" [(ngModel)]=\"value\" (onChange)=\"sendValue()\"\r\n [optionLabel]=\"control.config?.optionLabel\" [optionValue]=\"control.config?.optionValue\"\r\n [placeholder]=\"control.config?.placeholder\"\r\n [display]=\"control.config?.display || 'chip'\"></p-multiSelect>\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)]=\"tempValue\" (onChange)=\"onChangeSwitch()\" [id]=\"label\"\r\n [trueValue]=\"control?.trueValue !== undefined ? control?.trueValue: null\"\r\n [falseValue]=\"control?.falseValue !== undefined ? control?.falseValue: null\"></p-inputSwitch>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n", styles: ["::ng-deep .label-container{& label{margin-right:10px;color:#55585b;font-size:17px}& i{font-size:1.1rem}}::ng-deep .p-tooltip{max-width:15rem;font-size:.85rem;text-align:center}.control-container ::ng-deep .p-button:hover{background:var(--secondary-color)!important;border-color:var(--secondary-color)!important;filter:brightness(85%)}.control-container ::ng-deep .p-component,.control-container ::ng-deep .p-component *{border-radius:6px}.control-container ::ng-deep .p-inputtext{font-size:17px;border:1px solid #d1d5db;border-radius:6px}.control-container ::ng-deep .p-inputtext:focus,.control-container ::ng-deep .p-inputtext:active,.control-container ::ng-deep .p-inputwrapper:focus,.control-container ::ng-deep .p-inputwrapper:active{border-color:var(--button-color)}.control-container ::ng-deep .p-inputtext:enabled:focus{border-color:var(--secondary-color)!important;box-shadow:inset 0 0 0 1px #fff}.control-container ::ng-deep input.p-inputtext::placeholder{color:#6b7280;font-family:sans-serif;font-size:18px}.control-container ::ng-deep .p-dropdown{background:#ffffff;border:1px solid #d1d5db;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s;border-radius:6px}.control-container ::ng-deep .p-dropdown:not(.p-disabled):hover{border-color:var(--secondary-color)!important}.control-container ::ng-deep .p-dropdown:not(.p-disabled).p-focus{border-color:var(--secondary-color)!important;box-shadow:inset 0 0 0 1px #fff}.control-container ::ng-deep .p-dropdown .p-inputtext{border:none}.control-container ::ng-deep .p-dropdown .p-dropdown-label.p-placeholder{font-family:sans-serif;color:#6b7280}.control-container ::ng-deep .p-button.p-button-danger,.control-container ::ng-deep .p-buttonset.p-button-danger>.p-button,.control-container ::ng-deep .p-splitbutton.p-button-danger>.p-button{border-color:var(--secondary-color)!important;background:var(--secondary-color)!important}.control-container ::ng-deep .p-inputgroup button:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.control-container ::ng-deep .p-inputgroup input:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.control-container ::ng-deep .p-inputgroup input:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.control-container ::ng-deep .p-datepicker-touch-ui .p-datepicker-title{padding:3px}.control-container ::ng-deep .p-datepicker-month,.control-container ::ng-deep .p-datepicker-month:focus,.control-container ::ng-deep .p-datepicker-year:focus,.control-container ::ng-deep .p-datepicker-year{border:none}.p-inputgroup{& p-calendar{display:contents;& input{display:none}& .p-button-icon-only{border-top-left-radius:0;border-bottom-left-radius:0}}& p-inputMask{display:contents;& ::ng-deep input{border-top-right-radius:0;border-bottom-right-radius:0}}}@media (max-width <=768px){:host{font-size:14px}}\n"], components: [{ type: i4__namespace.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: i5__namespace$1.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: i6__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: FileUploadComponent, selector: "sf-file-upload", inputs: ["limit", "files", "loading", "configName", "accept"], outputs: ["onUpload", "onDeleteFile"] }, { type: i8__namespace.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: i9__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: i10__namespace.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "virtualScroll", "itemSize", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "scrollHeight", "defaultLabel", "placeholder", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onPanelShow", "onPanelHide"] }, { type: i11__namespace$1.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "ariaLabelledBy"], outputs: ["onChange"] }], directives: [{ type: i12__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13__namespace.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i12__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i14__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: i12__namespace$1.InputText, selector: "[pInputText]" }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i16__namespace.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i14__namespace.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
868
2311
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, decorators: [{
|
|
869
2312
|
type: i0.Component,
|
|
870
2313
|
args: [{
|
|
871
2314
|
selector: 'sf-control',
|
|
872
|
-
templateUrl: './control.component.html'
|
|
2315
|
+
templateUrl: './control.component.html',
|
|
2316
|
+
styleUrls: ['./control.component.css'],
|
|
2317
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
873
2318
|
}]
|
|
874
|
-
}], ctorParameters: function () { return [{ type: GeneralService }]; }, propDecorators: {
|
|
2319
|
+
}], ctorParameters: function () { return [{ type: GeneralService }, { type: SfCrudService }, { type: i0__namespace.ChangeDetectorRef }, { type: NotificationService }]; }, propDecorators: { showTempValue: [{
|
|
2320
|
+
type: i0.Input
|
|
2321
|
+
}], control: [{
|
|
875
2322
|
type: i0.Input
|
|
876
2323
|
}], label: [{
|
|
877
2324
|
type: i0.Input
|
|
@@ -881,1025 +2328,157 @@
|
|
|
881
2328
|
type: i0.Input
|
|
882
2329
|
}], setValue: [{
|
|
883
2330
|
type: i0.Output
|
|
884
|
-
}], sendNotification: [{
|
|
885
|
-
type: i0.Output
|
|
886
2331
|
}], sendObject: [{
|
|
887
2332
|
type: i0.Output
|
|
2333
|
+
}], tooltips: [{
|
|
2334
|
+
type: i0.ViewChildren,
|
|
2335
|
+
args: [i13.Tooltip]
|
|
888
2336
|
}] } });
|
|
889
2337
|
|
|
890
|
-
var
|
|
891
|
-
function
|
|
892
|
-
|
|
893
|
-
this.config = config;
|
|
2338
|
+
var FormComponent = /** @class */ (function () {
|
|
2339
|
+
function FormComponent(messageService, crudService, domSanitizer, stepService, adoService, jwtService) {
|
|
2340
|
+
var _this = this;
|
|
894
2341
|
this.messageService = messageService;
|
|
895
|
-
this.
|
|
2342
|
+
this.crudService = crudService;
|
|
2343
|
+
this.domSanitizer = domSanitizer;
|
|
2344
|
+
this.stepService = stepService;
|
|
2345
|
+
this.adoService = adoService;
|
|
2346
|
+
this.jwtService = jwtService;
|
|
2347
|
+
this.isDialog = false;
|
|
2348
|
+
this.controlsLoaded = false;
|
|
2349
|
+
this.isMobile = false;
|
|
2350
|
+
this.loading = { inProgress: true, target: undefined };
|
|
2351
|
+
if (window.innerWidth <= 768)
|
|
2352
|
+
this.isMobile = true;
|
|
2353
|
+
window.addEventListener('resize', function () {
|
|
2354
|
+
if (window.innerWidth <= 768)
|
|
2355
|
+
_this.isMobile = true;
|
|
2356
|
+
});
|
|
896
2357
|
}
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
this.uiEsquema = this.config.data.uiEsquema[0];
|
|
900
|
-
this.esquema = this.config.data.esquema;
|
|
901
|
-
this.data = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.data;
|
|
902
|
-
if (!this.data) {
|
|
903
|
-
this.data = this.createObject(this.esquema);
|
|
904
|
-
jsonpath__namespace.value(this.data, '$..id', this.config.data.id);
|
|
905
|
-
}
|
|
906
|
-
};
|
|
907
|
-
RegistroDetalleComponent.prototype.getControl = function (scope) {
|
|
908
|
-
return jsonpath__namespace.query(this.esquema, scope)[0];
|
|
909
|
-
};
|
|
910
|
-
RegistroDetalleComponent.prototype.getValue = function (scope) {
|
|
911
|
-
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
2358
|
+
FormComponent.prototype.ngOnChanges = function (changes) {
|
|
2359
|
+
this.buildControls();
|
|
912
2360
|
};
|
|
913
|
-
|
|
2361
|
+
FormComponent.prototype.ngOnInit = function () {
|
|
914
2362
|
var _this = this;
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
};
|
|
928
|
-
RegistroDetalleComponent.prototype.createObject = function (esquema) {
|
|
929
|
-
var object = {};
|
|
930
|
-
var resultArray = [];
|
|
931
|
-
switch (esquema.type) {
|
|
932
|
-
case 'numeric':
|
|
933
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
934
|
-
case 'string':
|
|
935
|
-
case 'date':
|
|
936
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
937
|
-
case 'boolean':
|
|
938
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
939
|
-
case 'file':
|
|
940
|
-
return null;
|
|
941
|
-
case 'array':
|
|
942
|
-
case 'object':
|
|
943
|
-
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
944
|
-
Object.defineProperty(object, key, { value: this.createObject(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
2363
|
+
try {
|
|
2364
|
+
this.jwtService.idKatios = this.crudService.idKatios;
|
|
2365
|
+
this.jwtService.servidorIntegraciones = this.crudService.environment.ServidorIntegraciones;
|
|
2366
|
+
this.adoService.servidorIntegraciones = this.crudService.environment.ServidorIntegraciones;
|
|
2367
|
+
this.idKatios = this.crudService.idKatios;
|
|
2368
|
+
this.stepService.requestApproved$.subscribe(function (approved) {
|
|
2369
|
+
if (!_this.isDialog && approved) {
|
|
2370
|
+
_this.uiEsquema = _this.crudService.getUIEsquema(_this.stepService.currentIndex);
|
|
2371
|
+
_this.esquema = _this.crudService.getEsquema(_this.stepService.currentIndex);
|
|
2372
|
+
_this.data = _this.crudService.getData(_this.stepService.currentIndex);
|
|
2373
|
+
_this.registro = _this.crudService.getRegistro(_this.stepService.currentIndex);
|
|
2374
|
+
_this.buildControls();
|
|
945
2375
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2378
|
+
catch (error) {
|
|
2379
|
+
console.error(error);
|
|
949
2380
|
}
|
|
950
|
-
return object;
|
|
951
2381
|
};
|
|
952
|
-
|
|
953
|
-
var data = null;
|
|
954
|
-
var uactivo;
|
|
955
|
-
switch (value) {
|
|
956
|
-
case '@uactivo':
|
|
957
|
-
uactivo = JSON.parse(localStorage.getItem('oSessionTFM') || '{}');
|
|
958
|
-
if (!uactivo)
|
|
959
|
-
console.log('Validar configuracion de sesion');
|
|
960
|
-
else
|
|
961
|
-
data = uactivo.UsuarioSistema.TDOC + "-" + uactivo.UsuarioSistema.NDOC;
|
|
962
|
-
break;
|
|
963
|
-
case '@tdocactivo':
|
|
964
|
-
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
965
|
-
if (!uactivo)
|
|
966
|
-
console.log('Validar configuracion de sesion');
|
|
967
|
-
else
|
|
968
|
-
data = uactivo.UsuarioSistema.TDOC;
|
|
969
|
-
break;
|
|
970
|
-
case '@ndocactivo':
|
|
971
|
-
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
972
|
-
if (!uactivo)
|
|
973
|
-
console.log('Validar configuracion de sesion');
|
|
974
|
-
else
|
|
975
|
-
data = uactivo.UsuarioSistema.NDOC;
|
|
976
|
-
break;
|
|
977
|
-
case '@hoy':
|
|
978
|
-
data = new Date();
|
|
979
|
-
break;
|
|
980
|
-
default:
|
|
981
|
-
data = value;
|
|
982
|
-
break;
|
|
983
|
-
}
|
|
984
|
-
return data;
|
|
985
|
-
};
|
|
986
|
-
RegistroDetalleComponent.prototype.submit = function () {
|
|
987
|
-
this.applyValuesOnEvent('onSubmit', this.esquema);
|
|
988
|
-
if (!this.validateData())
|
|
989
|
-
return;
|
|
990
|
-
this.ref.close(this.data);
|
|
991
|
-
};
|
|
992
|
-
RegistroDetalleComponent.prototype.cancel = function () {
|
|
993
|
-
this.applyValuesOnEvent('onCancel', this.esquema);
|
|
994
|
-
this.ref.close();
|
|
995
|
-
};
|
|
996
|
-
RegistroDetalleComponent.prototype.validateData = function () {
|
|
997
|
-
if (this.esquema.validations.type == 'local')
|
|
998
|
-
return this.validateDataLocal();
|
|
999
|
-
return true;
|
|
1000
|
-
};
|
|
1001
|
-
RegistroDetalleComponent.prototype.validateDataLocal = function () {
|
|
2382
|
+
FormComponent.prototype.emitLoadingForm = function ($event) {
|
|
1002
2383
|
var _this = this;
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
1006
|
-
err.push(x.message);
|
|
1007
|
-
});
|
|
1008
|
-
if (err.length != 0)
|
|
1009
|
-
this.messageService.add({ severity: 'warn', detail: err.join('. ') });
|
|
1010
|
-
return err.length == 0;
|
|
2384
|
+
this.loading.inProgress = $event;
|
|
2385
|
+
Promise.resolve().then(function () { return _this.crudService.formLoading = _this.loading; }); //si no se usa asi el enproceso totea con el simulador
|
|
1011
2386
|
};
|
|
1012
|
-
|
|
1013
|
-
var _this = this;
|
|
1014
|
-
if (scope) {
|
|
1015
|
-
if (esquema.properties[scope][event]) {
|
|
1016
|
-
esquema.properties[scope][event].forEach(function (value) {
|
|
1017
|
-
_this.setValueEvent(_this.data, value);
|
|
1018
|
-
});
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
else {
|
|
1022
|
-
for (var key in esquema.properties) {
|
|
1023
|
-
if (esquema.properties[key][event]) {
|
|
1024
|
-
esquema.properties[key][event].forEach(function (value) {
|
|
1025
|
-
_this.setValueEvent(_this.data, value);
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
};
|
|
1031
|
-
RegistroDetalleComponent.prototype.setValueEvent = function (data, params) {
|
|
1032
|
-
var _a;
|
|
1033
|
-
var value;
|
|
1034
|
-
var date = moment__namespace(new Date());
|
|
1035
|
-
switch (params.op) {
|
|
1036
|
-
case 'sum':
|
|
1037
|
-
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);
|
|
1038
|
-
break;
|
|
1039
|
-
case 'concat':
|
|
1040
|
-
var array_1 = [];
|
|
1041
|
-
(_a = params === null || params === void 0 ? void 0 : params.key) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, cur) {
|
|
1042
|
-
array_1.push(jsonpath__namespace.query(data, cur)[0]);
|
|
1043
|
-
}, []);
|
|
1044
|
-
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
1045
|
-
jsonpath__namespace.value(data, params.scope[0], array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' '));
|
|
1046
|
-
break;
|
|
1047
|
-
case 'enable':
|
|
1048
|
-
jsonpath__namespace.value(this.esquema, params.scope[0], false);
|
|
1049
|
-
break;
|
|
1050
|
-
case 'disabled':
|
|
1051
|
-
jsonpath__namespace.value(this.esquema, params.scope[0], true);
|
|
1052
|
-
break;
|
|
1053
|
-
case 'replace:endpoint':
|
|
1054
|
-
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)));
|
|
1055
|
-
break;
|
|
1056
|
-
case 'setNull':
|
|
1057
|
-
jsonpath__namespace.value(this.data, "$." + params.key, null);
|
|
1058
|
-
break;
|
|
1059
|
-
case 'datediff:years':
|
|
1060
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'years'));
|
|
1061
|
-
break;
|
|
1062
|
-
case 'datediff:months':
|
|
1063
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'months'));
|
|
1064
|
-
break;
|
|
1065
|
-
case 'datediff:weeks':
|
|
1066
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'weeks'));
|
|
1067
|
-
break;
|
|
1068
|
-
case 'datediff:days':
|
|
1069
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'days'));
|
|
1070
|
-
break;
|
|
1071
|
-
default:
|
|
1072
|
-
break;
|
|
1073
|
-
}
|
|
1074
|
-
return value;
|
|
1075
|
-
};
|
|
1076
|
-
RegistroDetalleComponent.prototype.sendNotification = function (message) {
|
|
1077
|
-
this.messageService.add(message);
|
|
1078
|
-
};
|
|
1079
|
-
RegistroDetalleComponent.prototype.applyValuesFromObject = function (event) {
|
|
1080
|
-
var _this = this;
|
|
1081
|
-
if (event.data)
|
|
1082
|
-
event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), _this.aplyFormatValue(value.scope, event.data[value.key])); });
|
|
1083
|
-
else
|
|
1084
|
-
event.optionValue.forEach(function (value) { return jsonpath__namespace.value(_this.data, value.scope.replace('.properties', ''), null); });
|
|
1085
|
-
};
|
|
1086
|
-
RegistroDetalleComponent.prototype.aplyFormatValue = function (scope, value) {
|
|
1087
|
-
var control = jsonpath__namespace.query(this.esquema, scope)[0];
|
|
1088
|
-
var resp;
|
|
1089
|
-
switch (control.type) {
|
|
1090
|
-
case 'date':
|
|
1091
|
-
resp = new Date("" + value);
|
|
1092
|
-
break;
|
|
1093
|
-
case 'numeric':
|
|
1094
|
-
resp = +value;
|
|
1095
|
-
break;
|
|
1096
|
-
default:
|
|
1097
|
-
resp = value;
|
|
1098
|
-
break;
|
|
1099
|
-
}
|
|
1100
|
-
return resp;
|
|
1101
|
-
};
|
|
1102
|
-
return RegistroDetalleComponent;
|
|
1103
|
-
}());
|
|
1104
|
-
RegistroDetalleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroDetalleComponent, deps: [{ token: i1__namespace$1.DynamicDialogRef }, { token: i1__namespace$1.DynamicDialogConfig }, { token: i2__namespace$1.MessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1105
|
-
RegistroDetalleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroDetalleComponent, selector: "lib-registro-detalle", ngImport: i0__namespace, template: "<p-toast></p-toast>\r\n<div *ngFor=\"let element of uiEsquema.elements\" [class]=\"element?.class\" #a>\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\r\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"getControl(el.scope)\" [label]=\"el.label\"\r\n [value]=\"getValue(el.scope)\" (setValue)=\"setValue($event, el.scope)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n<div class=\"card-footer mt-2\">\r\n <button pButton pRipple type=\"button\" label=\"Guardar\" (click)=\"submit()\" class=\"mr-2\"></button>\r\n <button pButton pRipple type=\"button\" label=\"Cancelar\" (click)=\"cancel()\" class=\"p-button-danger\"></button>\r\n</div>", styles: [""], components: [{ type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }], directives: [{ type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }] });
|
|
1106
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroDetalleComponent, decorators: [{
|
|
1107
|
-
type: i0.Component,
|
|
1108
|
-
args: [{
|
|
1109
|
-
selector: 'lib-registro-detalle',
|
|
1110
|
-
templateUrl: './registro-detalle.component.html',
|
|
1111
|
-
styleUrls: ['./registro-detalle.component.css']
|
|
1112
|
-
}]
|
|
1113
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.DynamicDialogRef }, { type: i1__namespace$1.DynamicDialogConfig }, { type: i2__namespace$1.MessageService }]; } });
|
|
1114
|
-
|
|
1115
|
-
var RegistroChildComponent = /** @class */ (function () {
|
|
1116
|
-
function RegistroChildComponent(ref, config, messageService, dialogService) {
|
|
1117
|
-
this.ref = ref;
|
|
1118
|
-
this.config = config;
|
|
1119
|
-
this.messageService = messageService;
|
|
1120
|
-
this.dialogService = dialogService;
|
|
1121
|
-
this.esquema = new Shema();
|
|
1122
|
-
this.trx = 'c';
|
|
1123
|
-
this.controlsLoaded = false;
|
|
1124
|
-
}
|
|
1125
|
-
RegistroChildComponent.prototype.ngOnInit = function () {
|
|
1126
|
-
var _a;
|
|
1127
|
-
this.uiEsquema = this.config.data.uiEsquema[0];
|
|
1128
|
-
this.esquema = this.config.data.esquema;
|
|
1129
|
-
this.data = (_a = this.config.data) === null || _a === void 0 ? void 0 : _a.data;
|
|
1130
|
-
if (!this.data) {
|
|
1131
|
-
this.data = this.createObject(this.esquema);
|
|
1132
|
-
jsonpath__namespace.value(this.data, '$..id', this.config.data.id);
|
|
1133
|
-
}
|
|
1134
|
-
this.buildControls();
|
|
1135
|
-
};
|
|
1136
|
-
RegistroChildComponent.prototype.buildControls = function () {
|
|
2387
|
+
FormComponent.prototype.buildControls = function () {
|
|
1137
2388
|
var _this = this;
|
|
2389
|
+
var _a, _b, _c;
|
|
2390
|
+
this.visible = [];
|
|
1138
2391
|
this.controlsLoaded = false;
|
|
1139
2392
|
this.controls = [];
|
|
1140
2393
|
this.values = [];
|
|
1141
2394
|
this.uiEsquema.elements.forEach(function (layout, i) {
|
|
1142
2395
|
var _a;
|
|
2396
|
+
var isVisible = layout.conditions ? _this.crudService.isConditionsCompleted(layout.conditions, _this.registro.conditions || [], _this.data) : true;
|
|
2397
|
+
_this.visible.push(layout.elements ? layout.elements.map(function () { return isVisible; }) : [isVisible]);
|
|
1143
2398
|
_this.controls.push([]);
|
|
1144
2399
|
_this.values.push([]);
|
|
1145
2400
|
(_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, j) {
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
};
|
|
1155
|
-
RegistroChildComponent.prototype.getControl = function (scope) {
|
|
1156
|
-
return jsonpath__namespace.query(this.esquema, scope)[0];
|
|
1157
|
-
};
|
|
1158
|
-
RegistroChildComponent.prototype.getValue = function (scope) {
|
|
1159
|
-
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
1160
|
-
};
|
|
1161
|
-
RegistroChildComponent.prototype.setValue = function (value, scope, i, j) {
|
|
1162
|
-
var _this = this;
|
|
1163
|
-
switch (typeof (value)) {
|
|
1164
|
-
case 'object':
|
|
1165
|
-
if (Array.isArray(value))
|
|
1166
|
-
value.forEach(function (val) {
|
|
1167
|
-
_this.setValueByScope(val.scope, val.value);
|
|
1168
|
-
jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value);
|
|
1169
|
-
});
|
|
1170
|
-
else {
|
|
1171
|
-
this.values[i][j] = value;
|
|
1172
|
-
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1173
|
-
}
|
|
1174
|
-
break;
|
|
1175
|
-
default:
|
|
1176
|
-
this.values[i][j] = value;
|
|
1177
|
-
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1178
|
-
break;
|
|
1179
|
-
}
|
|
1180
|
-
this.applyValuesOnEvent('onChange', this.esquema, scope.replace('$..properties.', ''));
|
|
1181
|
-
};
|
|
1182
|
-
RegistroChildComponent.prototype.createObject = function (esquema) {
|
|
1183
|
-
var object = {};
|
|
1184
|
-
var resultArray = [];
|
|
1185
|
-
switch (esquema.type) {
|
|
1186
|
-
case 'numeric':
|
|
1187
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
1188
|
-
case 'string':
|
|
1189
|
-
case 'date':
|
|
1190
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
1191
|
-
case 'boolean':
|
|
1192
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
1193
|
-
case 'file':
|
|
1194
|
-
return null;
|
|
1195
|
-
case 'array':
|
|
1196
|
-
case 'object':
|
|
1197
|
-
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
1198
|
-
Object.defineProperty(object, key, { value: this.createObjectChild(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
1199
|
-
}
|
|
1200
|
-
break;
|
|
1201
|
-
default:
|
|
1202
|
-
break;
|
|
1203
|
-
}
|
|
1204
|
-
return object;
|
|
1205
|
-
};
|
|
1206
|
-
RegistroChildComponent.prototype.createObjectChild = function (esquema) {
|
|
1207
|
-
var object = {};
|
|
1208
|
-
var resultArray = [];
|
|
1209
|
-
switch (esquema.type) {
|
|
1210
|
-
case 'numeric':
|
|
1211
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
1212
|
-
case 'string':
|
|
1213
|
-
case 'date':
|
|
1214
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
1215
|
-
case 'boolean':
|
|
1216
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
1217
|
-
case 'file':
|
|
1218
|
-
return null;
|
|
1219
|
-
case 'array':
|
|
1220
|
-
return [];
|
|
1221
|
-
case 'object':
|
|
1222
|
-
for (var key in esquema === null || esquema === void 0 ? void 0 : esquema.properties) {
|
|
1223
|
-
Object.defineProperty(object, key, { value: this.createObject(esquema === null || esquema === void 0 ? void 0 : esquema.properties[key]), writable: true, enumerable: true, configurable: true });
|
|
1224
|
-
}
|
|
1225
|
-
break;
|
|
1226
|
-
default:
|
|
1227
|
-
break;
|
|
1228
|
-
}
|
|
1229
|
-
return object;
|
|
1230
|
-
};
|
|
1231
|
-
RegistroChildComponent.prototype.setDefaultValue = function (value) {
|
|
1232
|
-
var data = null;
|
|
1233
|
-
var uactivo;
|
|
1234
|
-
switch (value) {
|
|
1235
|
-
case '@uactivo':
|
|
1236
|
-
uactivo = JSON.parse(localStorage.getItem('oSessionTFM') || '{}');
|
|
1237
|
-
if (!uactivo)
|
|
1238
|
-
console.log('Validar configuracion de sesion');
|
|
1239
|
-
else
|
|
1240
|
-
data = uactivo.UsuarioSistema.TDOC + "-" + uactivo.UsuarioSistema.NDOC;
|
|
1241
|
-
break;
|
|
1242
|
-
case '@tdocactivo':
|
|
1243
|
-
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
1244
|
-
if (!uactivo)
|
|
1245
|
-
console.log('Validar configuracion de sesion');
|
|
1246
|
-
else
|
|
1247
|
-
data = uactivo.UsuarioSistema.TDOC;
|
|
1248
|
-
break;
|
|
1249
|
-
case '@ndocactivo':
|
|
1250
|
-
uactivo = JSON.parse(sessionStorage.getItem('usrSesion') || '{}');
|
|
1251
|
-
if (!uactivo)
|
|
1252
|
-
console.log('Validar configuracion de sesion');
|
|
1253
|
-
else
|
|
1254
|
-
data = uactivo.UsuarioSistema.NDOC;
|
|
1255
|
-
break;
|
|
1256
|
-
case '@hoy':
|
|
1257
|
-
data = new Date();
|
|
1258
|
-
break;
|
|
1259
|
-
default:
|
|
1260
|
-
data = value;
|
|
1261
|
-
break;
|
|
1262
|
-
}
|
|
1263
|
-
return data;
|
|
1264
|
-
};
|
|
1265
|
-
RegistroChildComponent.prototype.submit = function () {
|
|
1266
|
-
this.applyValuesOnEvent('onSubmit', this.esquema);
|
|
1267
|
-
if (!this.validateData())
|
|
1268
|
-
return;
|
|
1269
|
-
this.ref.close(this.data);
|
|
1270
|
-
};
|
|
1271
|
-
RegistroChildComponent.prototype.cancel = function () {
|
|
1272
|
-
this.applyValuesOnEvent('onCancel', this.esquema);
|
|
1273
|
-
this.ref.close();
|
|
1274
|
-
};
|
|
1275
|
-
RegistroChildComponent.prototype.validateData = function () {
|
|
1276
|
-
if (this.esquema.validations.type == 'local')
|
|
1277
|
-
return this.validateDataLocal();
|
|
1278
|
-
return true;
|
|
1279
|
-
};
|
|
1280
|
-
RegistroChildComponent.prototype.validateDataLocal = function () {
|
|
1281
|
-
var _this = this;
|
|
1282
|
-
var err = [];
|
|
1283
|
-
this.esquema.validations.required.forEach(function (x) {
|
|
1284
|
-
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
1285
|
-
err.push(x.message);
|
|
1286
|
-
});
|
|
1287
|
-
if (err.length != 0)
|
|
1288
|
-
this.messageService.add({ severity: 'warn', detail: err.join('. ') });
|
|
1289
|
-
return err.length == 0;
|
|
1290
|
-
};
|
|
1291
|
-
RegistroChildComponent.prototype.applyValuesOnEvent = function (event, esquema, scope) {
|
|
1292
|
-
var _this = this;
|
|
1293
|
-
if (scope) {
|
|
1294
|
-
if (esquema.properties[scope][event]) {
|
|
1295
|
-
esquema.properties[scope][event].forEach(function (value) {
|
|
1296
|
-
_this.setValueEvent(_this.data, value);
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
else {
|
|
1301
|
-
for (var key in esquema.properties) {
|
|
1302
|
-
if (esquema.properties[key][event]) {
|
|
1303
|
-
esquema.properties[key][event].forEach(function (value) {
|
|
1304
|
-
_this.setValueEvent(_this.data, value);
|
|
1305
|
-
});
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
};
|
|
1310
|
-
RegistroChildComponent.prototype.setValueEvent = function (data, params) {
|
|
1311
|
-
var _a;
|
|
1312
|
-
var value;
|
|
1313
|
-
var date = moment__namespace(new Date());
|
|
1314
|
-
switch (params.op) {
|
|
1315
|
-
case 'sum':
|
|
1316
|
-
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);
|
|
1317
|
-
break;
|
|
1318
|
-
case 'concat':
|
|
1319
|
-
var array_1 = [];
|
|
1320
|
-
(_a = params === null || params === void 0 ? void 0 : params.key) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, cur) {
|
|
1321
|
-
array_1.push(jsonpath__namespace.query(data, cur)[0]);
|
|
1322
|
-
}, []);
|
|
1323
|
-
if (params === null || params === void 0 ? void 0 : params.separator)
|
|
1324
|
-
jsonpath__namespace.value(data, params.scope[0], array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' '));
|
|
1325
|
-
break;
|
|
1326
|
-
case 'enable':
|
|
1327
|
-
jsonpath__namespace.value(this.esquema, params.scope[0], false);
|
|
1328
|
-
break;
|
|
1329
|
-
case 'disabled':
|
|
1330
|
-
jsonpath__namespace.value(this.esquema, params.scope[0], true);
|
|
1331
|
-
break;
|
|
1332
|
-
case 'replace:endpoint':
|
|
1333
|
-
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)));
|
|
1334
|
-
break;
|
|
1335
|
-
case 'setNull':
|
|
1336
|
-
jsonpath__namespace.value(this.data, "$." + params.key, null);
|
|
1337
|
-
break;
|
|
1338
|
-
case 'datediff:years':
|
|
1339
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'years'));
|
|
1340
|
-
break;
|
|
1341
|
-
case 'datediff:months':
|
|
1342
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'months'));
|
|
1343
|
-
break;
|
|
1344
|
-
case 'datediff:weeks':
|
|
1345
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'weeks'));
|
|
1346
|
-
break;
|
|
1347
|
-
case 'datediff:days':
|
|
1348
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'days'));
|
|
1349
|
-
break;
|
|
1350
|
-
default:
|
|
1351
|
-
break;
|
|
1352
|
-
}
|
|
1353
|
-
return value;
|
|
1354
|
-
};
|
|
1355
|
-
RegistroChildComponent.prototype.sendNotification = function (message) {
|
|
1356
|
-
this.messageService.add(message);
|
|
1357
|
-
};
|
|
1358
|
-
RegistroChildComponent.prototype.addObjectArray = function (element) {
|
|
1359
|
-
var _this = this;
|
|
1360
|
-
this.dialogRef = this.dialogService.open(RegistroDetalleComponent, {
|
|
1361
|
-
header: element.label ? element.label : 'Detalle',
|
|
1362
|
-
width: '70%',
|
|
1363
|
-
modal: true,
|
|
1364
|
-
closable: false,
|
|
1365
|
-
data: {
|
|
1366
|
-
uiEsquema: Object.assign({}, element.elements),
|
|
1367
|
-
esquema: this.getControl(element.scope),
|
|
1368
|
-
id: this.getValue(element.scope).length + 1
|
|
1369
|
-
}
|
|
1370
|
-
});
|
|
1371
|
-
this.dialogRef.onClose.subscribe(function (data) {
|
|
1372
|
-
if (data)
|
|
1373
|
-
_this.data[element.scope.replace('$..properties.', '')].push(data);
|
|
1374
|
-
_this.applyValuesOnEvent('onChange', _this.esquema, element.scope.replace('$..properties.', ''));
|
|
1375
|
-
});
|
|
1376
|
-
};
|
|
1377
|
-
RegistroChildComponent.prototype.editRow = function (element, data, index) {
|
|
1378
|
-
var _this = this;
|
|
1379
|
-
this.dialogRef = this.dialogService.open(RegistroDetalleComponent, {
|
|
1380
|
-
header: element.label ? element.label : 'Detalle',
|
|
1381
|
-
width: '70%',
|
|
1382
|
-
modal: true,
|
|
1383
|
-
closable: false,
|
|
1384
|
-
data: {
|
|
1385
|
-
uiEsquema: Object.assign({}, element.elements),
|
|
1386
|
-
esquema: this.getControl(element.scope),
|
|
1387
|
-
data: Object.assign({}, data)
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
this.dialogRef.onClose.subscribe(function (data) {
|
|
1391
|
-
if (data)
|
|
1392
|
-
_this.data[element.scope.replace('$..properties.', '')][index] = data;
|
|
1393
|
-
_this.applyValuesOnEvent('onChange', _this.esquema, element.scope.replace('$..properties.', ''));
|
|
1394
|
-
});
|
|
1395
|
-
};
|
|
1396
|
-
RegistroChildComponent.prototype.deleteRow = function (element, index) {
|
|
1397
|
-
this.data[element.scope.replace('$..properties.', '')].splice(index, 1);
|
|
1398
|
-
index = 1;
|
|
1399
|
-
this.data[element.scope.replace('$..properties.', '')].forEach(function (el) {
|
|
1400
|
-
el.id = index;
|
|
1401
|
-
index++;
|
|
1402
|
-
});
|
|
1403
|
-
this.applyValuesOnEvent('onChange', this.esquema, element.scope.replace('$..properties.', ''));
|
|
1404
|
-
};
|
|
1405
|
-
RegistroChildComponent.prototype.setValueByScope = function (scope, newVal) {
|
|
1406
|
-
var _this = this;
|
|
1407
|
-
var _loop_1 = function (i) {
|
|
1408
|
-
var row = this_1.controls[i];
|
|
1409
|
-
row.forEach(function (el, j) {
|
|
1410
|
-
if (el.scope && el.scope.replace('.properties', '') == scope.replace('.properties', '')) {
|
|
1411
|
-
_this.values[i][j] = newVal;
|
|
1412
|
-
}
|
|
1413
|
-
});
|
|
1414
|
-
};
|
|
1415
|
-
var this_1 = this;
|
|
1416
|
-
for (var i = 0; i < this.controls.length; i++) {
|
|
1417
|
-
_loop_1(i);
|
|
1418
|
-
}
|
|
1419
|
-
};
|
|
1420
|
-
RegistroChildComponent.prototype.applyValuesFromObject = function (event) {
|
|
1421
|
-
if (event.optionValue) {
|
|
1422
|
-
for (var i = 0; i < event.optionValue.length; i++) {
|
|
1423
|
-
var optionVal = event.optionValue[i];
|
|
1424
|
-
var newVal = event.data ? this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]) : null;
|
|
1425
|
-
jsonpath__namespace.value(this.data, optionVal.scope.replace('.properties', ''), this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]));
|
|
1426
|
-
this.setValueByScope(optionVal.scope, newVal);
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
};
|
|
1430
|
-
RegistroChildComponent.prototype.aplyFormatValue = function (scope, value) {
|
|
1431
|
-
var control = jsonpath__namespace.query(this.esquema, scope)[0];
|
|
1432
|
-
var resp;
|
|
1433
|
-
switch (control.type) {
|
|
1434
|
-
case 'date':
|
|
1435
|
-
resp = new Date("" + value);
|
|
1436
|
-
break;
|
|
1437
|
-
case 'numeric':
|
|
1438
|
-
resp = +value;
|
|
1439
|
-
break;
|
|
1440
|
-
default:
|
|
1441
|
-
resp = value;
|
|
1442
|
-
break;
|
|
1443
|
-
}
|
|
1444
|
-
return resp;
|
|
1445
|
-
};
|
|
1446
|
-
return RegistroChildComponent;
|
|
1447
|
-
}());
|
|
1448
|
-
RegistroChildComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, deps: [{ token: i1__namespace$1.DynamicDialogRef }, { token: i1__namespace$1.DynamicDialogConfig }, { token: i2__namespace$1.MessageService }, { token: i1__namespace$1.DialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1449
|
-
RegistroChildComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroChildComponent, selector: "lib-registro-child", providers: [i2$1.MessageService, i1$1.DialogService], ngImport: i0__namespace, template: "<p-toast></p-toast>\r\n<div *ngIf=\"controlsLoaded\">\r\n<div *ngFor=\"let element of uiEsquema.elements; let i = index\" [class]=\"element?.class\" #a>\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements; let j =index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\" [value]=\"values[i][j]\"\r\n (setValue)=\"setValue($event, el.scope, i, j)\" (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements; let k =index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][k]\" [label]=\"el.label\"\r\n [value]=\"values[i][k]\" (setValue)=\"setValue($event, el.scope, i, k)\"\r\n (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n <ng-container *ngSwitchCase=\"'Table'\">\r\n <p-table [value]=\"getValue(el.scope)\" [columns]=\"getControl(el.scope).config.columns\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <button pButton pRipple icon=\"pi pi-plus\" (click)=\"addObjectArray(el)\"\r\n class=\"p-button-success\"></button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n {{col.label}}\r\n </th>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <th></th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <ng-container *ngFor=\"let col of columns\" [ngSwitch]=\"col.type\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <td>{{rowData[col.col]}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency:USD'\">\r\n <td>{{rowData[col.col] | currency: 'USD'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:yyyy-mm-dd'\">\r\n <td>{{rowData[col.col] | date: 'yyyy-mm-dd'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:dd/mm/yyyy'\">\r\n <td>{{rowData[col.col] | date: 'dd/MM/yyyy'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <td>\r\n <i *ngIf=\"rowData[col.col]\" class=\"pi pi-check\"></i>\r\n <i *ngIf=\"!rowData[col.col]\" class=\"pi pi-times\"></i>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <td>\r\n <button pButton pRipple type=\"button\"\r\n (click)=\"editRow(el, rowData, rowIndex)\" icon=\"pi pi-pencil\"\r\n class=\"p-button-rounded p-button-info mr-1\"></button>\r\n <button pButton pRipple type=\"button\" (click)=\"deleteRow(el, rowIndex)\"\r\n icon=\"pi pi-trash\" class=\"p-button-rounded p-button-danger\"></button>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n<div class=\"card-footer mt-2\">\r\n <button pButton pRipple type=\"button\" label=\"Guardar\" (click)=\"submit()\" class=\"mr-2\"></button>\r\n <button pButton pRipple type=\"button\" label=\"Cancelar\" (click)=\"cancel()\" class=\"p-button-danger\"></button>\r\n</div>\r\n</div>\r\n", components: [{ type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }, { type: i5__namespace.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection"], outputs: ["selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }], pipes: { "currency": i7__namespace.CurrencyPipe, "date": i7__namespace.DatePipe } });
|
|
1450
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroChildComponent, decorators: [{
|
|
1451
|
-
type: i0.Component,
|
|
1452
|
-
args: [{
|
|
1453
|
-
selector: 'lib-registro-child',
|
|
1454
|
-
templateUrl: './registro-child.component.html',
|
|
1455
|
-
providers: [i2$1.MessageService, i1$1.DialogService]
|
|
1456
|
-
}]
|
|
1457
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.DynamicDialogRef }, { type: i1__namespace$1.DynamicDialogConfig }, { type: i2__namespace$1.MessageService }, { type: i1__namespace$1.DialogService }]; } });
|
|
1458
|
-
|
|
1459
|
-
var SfCrudService = /** @class */ (function () {
|
|
1460
|
-
function SfCrudService() {
|
|
1461
|
-
this._dataTemp = [];
|
|
1462
|
-
}
|
|
1463
|
-
SfCrudService.prototype.saveDataTemp = function (scope, value) {
|
|
1464
|
-
this._dataTemp.push({ scope: scope, value: value });
|
|
1465
|
-
sessionStorage.setItem('dataTemp', JSON.stringify(this._dataTemp));
|
|
1466
|
-
};
|
|
1467
|
-
SfCrudService.prototype.getDataTemp = function () {
|
|
1468
|
-
var dataTemp = sessionStorage.getItem('dataTemp');
|
|
1469
|
-
sessionStorage.removeItem('dataTemp');
|
|
1470
|
-
return dataTemp ? JSON.parse(dataTemp) : [];
|
|
1471
|
-
};
|
|
1472
|
-
SfCrudService.prototype.cleanDataTemp = function () {
|
|
1473
|
-
sessionStorage.removeItem('dataTemp');
|
|
1474
|
-
};
|
|
1475
|
-
return SfCrudService;
|
|
1476
|
-
}());
|
|
1477
|
-
SfCrudService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1478
|
-
SfCrudService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, providedIn: 'root' });
|
|
1479
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, decorators: [{
|
|
1480
|
-
type: i0.Injectable,
|
|
1481
|
-
args: [{
|
|
1482
|
-
providedIn: 'root'
|
|
1483
|
-
}]
|
|
1484
|
-
}], ctorParameters: function () { return []; } });
|
|
1485
|
-
|
|
1486
|
-
var RegistroComponent = /** @class */ (function () {
|
|
1487
|
-
function RegistroComponent(generalService, router, messageSerice, dialogService, sfCrudService) {
|
|
1488
|
-
this.generalService = generalService;
|
|
1489
|
-
this.router = router;
|
|
1490
|
-
this.messageSerice = messageSerice;
|
|
1491
|
-
this.dialogService = dialogService;
|
|
1492
|
-
this.sfCrudService = sfCrudService;
|
|
1493
|
-
this.idKatios = '';
|
|
1494
|
-
this.idEntidad = '';
|
|
1495
|
-
this.trx = '';
|
|
1496
|
-
this.id = '';
|
|
1497
|
-
this.sendData = new i0.EventEmitter();
|
|
1498
|
-
this.onSubmit = new i0.EventEmitter();
|
|
1499
|
-
this.dataTemp = [];
|
|
1500
|
-
this.crudConfig = new CrudConfig();
|
|
1501
|
-
this.enProceso = false;
|
|
1502
|
-
this.configOperation = new Operations();
|
|
1503
|
-
this.isLocal = false;
|
|
1504
|
-
this.controlsLoaded = false;
|
|
1505
|
-
this.dataTemp = this.sfCrudService.getDataTemp();
|
|
1506
|
-
}
|
|
1507
|
-
RegistroComponent.prototype.ngOnInit = function () {
|
|
1508
|
-
this.loadConfigCrud();
|
|
1509
|
-
};
|
|
1510
|
-
RegistroComponent.prototype.loadConfigCrud = function () {
|
|
1511
|
-
var _this = this;
|
|
1512
|
-
this.enProceso = true;
|
|
1513
|
-
this.generalService.getCrudByEntidad(this.idKatios, this.idEntidad)
|
|
1514
|
-
.then(function (res) {
|
|
1515
|
-
_this.setDataTemp(res.esquema, _this.dataTemp);
|
|
1516
|
-
_this.crudConfig = res;
|
|
1517
|
-
if (_this.trx == 'c') {
|
|
1518
|
-
_this.configOperation = _this.crudConfig.registro.operations.find(function (x) { return x.type.startsWith(_this.trx); }) || new Operations();
|
|
1519
|
-
_this.data = _this.createObject(_this.crudConfig.esquema);
|
|
1520
|
-
console.log(_this.data);
|
|
1521
|
-
_this.setLabelSumbit();
|
|
1522
|
-
_this.enProceso = false;
|
|
1523
|
-
_this.buildControls();
|
|
1524
|
-
}
|
|
1525
|
-
else
|
|
1526
|
-
_this.getInfoRegistro(_this.crudConfig.registro);
|
|
1527
|
-
})
|
|
1528
|
-
.catch(function (err) {
|
|
1529
|
-
console.log(err);
|
|
1530
|
-
_this.enProceso = false;
|
|
1531
|
-
});
|
|
1532
|
-
};
|
|
1533
|
-
RegistroComponent.prototype.buildControls = function () {
|
|
1534
|
-
var _this = this;
|
|
1535
|
-
this.controlsLoaded = false;
|
|
1536
|
-
this.controls = [];
|
|
1537
|
-
this.values = [];
|
|
1538
|
-
this.crudConfig.uiEsquema.elements.forEach(function (layout, i) {
|
|
1539
|
-
var _a;
|
|
1540
|
-
_this.controls.push([]);
|
|
1541
|
-
_this.values.push([]);
|
|
1542
|
-
(_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, j) {
|
|
1543
|
-
_this.controls[i].push(_this.getControl(element.scope));
|
|
1544
|
-
_this.controls[i][j].scope = element.scope;
|
|
1545
|
-
_this.values[i].push(_this.getValue(element.scope));
|
|
1546
|
-
});
|
|
1547
|
-
});
|
|
1548
|
-
this.controlsLoaded = true;
|
|
1549
|
-
};
|
|
1550
|
-
RegistroComponent.prototype.setLabelSumbit = function () {
|
|
1551
|
-
if (this.trx == 'c')
|
|
1552
|
-
this.btnSubmit = { label: 'Guardar', icon: 'pi pi-save' };
|
|
1553
|
-
else if (this.trx == 'r')
|
|
1554
|
-
this.btnSubmit = undefined;
|
|
1555
|
-
else if (this.trx == 'u')
|
|
1556
|
-
this.btnSubmit = { label: 'Actualizar', icon: 'pi pi-sync' };
|
|
1557
|
-
else if (this.trx == 'd')
|
|
1558
|
-
this.btnSubmit = { label: 'Eliminar', icon: 'pi pi-trash' };
|
|
1559
|
-
};
|
|
1560
|
-
RegistroComponent.prototype.getInfoRegistro = function (configRegistro) {
|
|
1561
|
-
var _this = this;
|
|
1562
|
-
var op = configRegistro.operations.find(function (x) { return x.type == 'read'; });
|
|
1563
|
-
var endpoint = (op === null || op === void 0 ? void 0 : op.endpoint) || '';
|
|
1564
|
-
endpoint = endpoint.replace('@idKatios', this.idKatios);
|
|
1565
|
-
endpoint = endpoint.replace('@ndocactivo', this.user.UsuarioSistema.NDOC);
|
|
1566
|
-
endpoint = endpoint.replace('@id', this.id);
|
|
1567
|
-
this.generalService.genericRequest((op === null || op === void 0 ? void 0 : op.method) || '', (op === null || op === void 0 ? void 0 : op.server) || '', endpoint)
|
|
1568
|
-
.then(function (res) {
|
|
1569
|
-
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
1570
|
-
if (Array.isArray(res.data))
|
|
1571
|
-
_this.data = res.data[0];
|
|
1572
|
-
else
|
|
1573
|
-
_this.data = res.data;
|
|
1574
|
-
_this.trx = 'u';
|
|
1575
|
-
}
|
|
1576
|
-
else {
|
|
1577
|
-
_this.trx = 'c';
|
|
1578
|
-
_this.data = _this.createObject(_this.crudConfig.esquema);
|
|
1579
|
-
}
|
|
1580
|
-
_this.buildControls();
|
|
1581
|
-
_this.enProceso = false;
|
|
1582
|
-
_this.configOperation = _this.crudConfig.registro.operations.find(function (x) { return x.type.startsWith(_this.trx); }) || new Operations();
|
|
1583
|
-
_this.setLabelSumbit();
|
|
1584
|
-
})
|
|
1585
|
-
.catch(function (err) {
|
|
1586
|
-
console.log(err);
|
|
1587
|
-
_this.enProceso = false;
|
|
1588
|
-
});
|
|
1589
|
-
};
|
|
1590
|
-
RegistroComponent.prototype.back = function () {
|
|
1591
|
-
this.router.navigateByUrl(this.crudConfig.registro.btnBack);
|
|
1592
|
-
};
|
|
1593
|
-
RegistroComponent.prototype.getControl = function (scope) {
|
|
1594
|
-
return jsonpath__namespace.query(this.crudConfig.esquema, scope)[0];
|
|
1595
|
-
};
|
|
1596
|
-
RegistroComponent.prototype.getValue = function (scope) {
|
|
1597
|
-
return jsonpath__namespace.query(this.data, scope.replace('.properties', ''))[0];
|
|
1598
|
-
};
|
|
1599
|
-
RegistroComponent.prototype.setValue = function (value, scope, i, j) {
|
|
1600
|
-
var _this = this;
|
|
1601
|
-
switch (typeof (value)) {
|
|
1602
|
-
case 'object':
|
|
1603
|
-
if (Array.isArray(value))
|
|
1604
|
-
value.forEach(function (val) {
|
|
1605
|
-
_this.setValueByScope(val.scope, val.value);
|
|
1606
|
-
jsonpath__namespace.value(_this.data, val.scope.replace('.properties', ''), val.value);
|
|
1607
|
-
});
|
|
1608
|
-
else {
|
|
1609
|
-
this.values[i][j] = value;
|
|
1610
|
-
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1611
|
-
}
|
|
1612
|
-
break;
|
|
1613
|
-
default:
|
|
1614
|
-
this.values[i][j] = value;
|
|
1615
|
-
jsonpath__namespace.value(this.data, scope.replace('.properties', ''), value);
|
|
1616
|
-
break;
|
|
1617
|
-
}
|
|
1618
|
-
this.applyValuesOnEvent('onChange', this.crudConfig.esquema);
|
|
1619
|
-
};
|
|
1620
|
-
RegistroComponent.prototype.createObject = function (esquema) {
|
|
1621
|
-
var _this = this;
|
|
1622
|
-
var object = {};
|
|
1623
|
-
switch (esquema.type) {
|
|
1624
|
-
case 'numeric':
|
|
1625
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || 0;
|
|
1626
|
-
case 'string':
|
|
1627
|
-
case 'date':
|
|
1628
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) ? this.setDefaultValue(esquema.default) : null;
|
|
1629
|
-
case 'boolean':
|
|
1630
|
-
return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
|
|
1631
|
-
case 'array':
|
|
1632
|
-
return [];
|
|
1633
|
-
case 'file':
|
|
1634
|
-
return null;
|
|
1635
|
-
case 'object':
|
|
1636
|
-
Object.getOwnPropertyNames(esquema === null || esquema === void 0 ? void 0 : esquema.properties).forEach(function (key) {
|
|
1637
|
-
var aux = esquema === null || esquema === void 0 ? void 0 : esquema.properties[key];
|
|
1638
|
-
if (aux)
|
|
1639
|
-
object[key] = _this.createObject(aux);
|
|
1640
|
-
});
|
|
1641
|
-
return object;
|
|
1642
|
-
default:
|
|
1643
|
-
return null;
|
|
1644
|
-
}
|
|
1645
|
-
};
|
|
1646
|
-
RegistroComponent.prototype.submit = function () {
|
|
1647
|
-
var _this = this;
|
|
1648
|
-
console.log(this.data);
|
|
1649
|
-
if (!this.validateData())
|
|
1650
|
-
return;
|
|
1651
|
-
this.applyValuesOnEvent('onSubmit', this.crudConfig.esquema);
|
|
1652
|
-
this.enProceso = true;
|
|
1653
|
-
var endpoint = this.configOperation.endpoint;
|
|
1654
|
-
endpoint = endpoint.replace('@idKatios', this.idKatios);
|
|
1655
|
-
endpoint = endpoint.replace('@id', this.id);
|
|
1656
|
-
this.generalService.genericRequest(this.configOperation.method, this.configOperation.server, endpoint, this.data)
|
|
1657
|
-
.then(function (res) {
|
|
1658
|
-
_this.generateMessage({ severity: 'success', detail: "Proceso exitoso!" }, res, _this.configOperation.answerChecking);
|
|
1659
|
-
_this.enProceso = false;
|
|
1660
|
-
setTimeout(function () {
|
|
1661
|
-
var _a, _b;
|
|
1662
|
-
if ((_a = _this.configOperation) === null || _a === void 0 ? void 0 : _a.redirect)
|
|
1663
|
-
_this.router.navigate([(_b = _this.configOperation) === null || _b === void 0 ? void 0 : _b.redirect]);
|
|
1664
|
-
else
|
|
1665
|
-
_this.onSubmit.emit(_this.data);
|
|
1666
|
-
}, 2000);
|
|
1667
|
-
})
|
|
1668
|
-
.catch(function (err) {
|
|
1669
|
-
var operation = _this.crudConfig.registro.operations.find(function (op) { return op.type.startsWith(_this.trx); });
|
|
1670
|
-
_this.generateMessage({ severity: "error", detail: "Por favor comunicarse con el admin", summary: "Error no controlado" }, err.error, operation.errorChecking);
|
|
1671
|
-
_this.enProceso = false;
|
|
1672
|
-
});
|
|
1673
|
-
};
|
|
1674
|
-
/**
|
|
1675
|
-
* Generates message using answerchecking
|
|
1676
|
-
* @param currentMsg Default message: Message
|
|
1677
|
-
* @param rta Resquest's response
|
|
1678
|
-
* @param answerChecking
|
|
1679
|
-
*/
|
|
1680
|
-
RegistroComponent.prototype.generateMessage = function (currentMsg, rta, requestChecking) {
|
|
1681
|
-
if (requestChecking) {
|
|
1682
|
-
if (requestChecking.statics)
|
|
1683
|
-
Object.assign(currentMsg, requestChecking.statics);
|
|
1684
|
-
//mapear los dinamicos
|
|
1685
|
-
if (requestChecking.dynamics) {
|
|
1686
|
-
var dynamics = requestChecking.dynamics;
|
|
1687
|
-
try {
|
|
1688
|
-
if (dynamics && typeof (rta) == "string")
|
|
1689
|
-
rta = JSON.parse(rta);
|
|
1690
|
-
if (dynamics) {
|
|
1691
|
-
for (var property in dynamics) {
|
|
1692
|
-
currentMsg[property] = jsonpath__namespace.query(rta, dynamics[property])[0];
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
2401
|
+
if (element.conditions)
|
|
2402
|
+
_this.visible[i][j] = _this.crudService.isConditionsCompleted(element.conditions, _this.registro.conditions || [], _this.data);
|
|
2403
|
+
if (element.ngStyle && typeof (element.ngStyle) == "string")
|
|
2404
|
+
element.ngStyle = JSON.parse(element.ngStyle);
|
|
2405
|
+
if (element.url) {
|
|
2406
|
+
_this.controls[i].push(undefined);
|
|
2407
|
+
var url = _this.crudService.applyStringKeys(element.url);
|
|
2408
|
+
_this.values[i].push(_this.domSanitizer.bypassSecurityTrustResourceUrl(url));
|
|
1695
2409
|
}
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
2410
|
+
else if (!element.scope) {
|
|
2411
|
+
_this.controls[i].push(undefined);
|
|
2412
|
+
_this.values[i].push(undefined);
|
|
1699
2413
|
}
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
});
|
|
1707
|
-
else
|
|
1708
|
-
this.messageSerice.add(currentMsg);
|
|
1709
|
-
};
|
|
1710
|
-
RegistroComponent.prototype.validateData = function () {
|
|
1711
|
-
if (this.configOperation.validations.type == 'local')
|
|
1712
|
-
return this.validateDataLocal();
|
|
1713
|
-
return true;
|
|
1714
|
-
};
|
|
1715
|
-
RegistroComponent.prototype.validateDataLocal = function () {
|
|
1716
|
-
var _this = this;
|
|
1717
|
-
var _a, _b, _c, _d;
|
|
1718
|
-
var err = [];
|
|
1719
|
-
(_b = (_a = this.configOperation.validations) === null || _a === void 0 ? void 0 : _a.required) === null || _b === void 0 ? void 0 : _b.forEach(function (x) {
|
|
1720
|
-
if (!jsonpath__namespace.query(_this.data, x.field)[0])
|
|
1721
|
-
err.push(x.message);
|
|
1722
|
-
});
|
|
1723
|
-
(_d = (_c = this.configOperation.validations) === null || _c === void 0 ? void 0 : _c.operations) === null || _d === void 0 ? void 0 : _d.forEach(function (op) {
|
|
1724
|
-
switch (op.action) {
|
|
1725
|
-
case 'sumArray':
|
|
1726
|
-
var var1 = jsonpath__namespace.query(_this.data, op.scope[0]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1727
|
-
var var2 = jsonpath__namespace.query(_this.data, op.scope[1]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
|
|
1728
|
-
if (var1 != var2)
|
|
1729
|
-
err.push(op.message);
|
|
1730
|
-
break;
|
|
1731
|
-
default:
|
|
1732
|
-
break;
|
|
1733
|
-
}
|
|
1734
|
-
});
|
|
1735
|
-
if (err.length != 0)
|
|
1736
|
-
this.messageSerice.add({ severity: 'warn', detail: err.join('. ') });
|
|
1737
|
-
return err.length == 0;
|
|
1738
|
-
};
|
|
1739
|
-
RegistroComponent.prototype.setDefaultValue = function (value) {
|
|
1740
|
-
var data = null;
|
|
1741
|
-
if (value.key && this.configOperation.keys) {
|
|
1742
|
-
data = this.getValueKey(this.configOperation.keys.find(function (k) { return k.key == value.key; }));
|
|
1743
|
-
value = data;
|
|
1744
|
-
}
|
|
1745
|
-
switch (value) {
|
|
1746
|
-
case '@uactivo':
|
|
1747
|
-
data = this.user.UsuarioSistema.TDOC + "-" + this.user.UsuarioSistema.NDOC;
|
|
1748
|
-
break;
|
|
1749
|
-
case '@tdocactivo':
|
|
1750
|
-
data = this.user.UsuarioSistema.TDOC;
|
|
1751
|
-
break;
|
|
1752
|
-
case '@ndocactivo':
|
|
1753
|
-
data = this.user.UsuarioSistema.NDOC;
|
|
1754
|
-
break;
|
|
1755
|
-
case '@hoy':
|
|
1756
|
-
data = new Date();
|
|
1757
|
-
break;
|
|
1758
|
-
default:
|
|
1759
|
-
data = value;
|
|
1760
|
-
break;
|
|
1761
|
-
}
|
|
1762
|
-
return data;
|
|
1763
|
-
};
|
|
1764
|
-
RegistroComponent.prototype.getValueKey = function (key) {
|
|
1765
|
-
var data;
|
|
1766
|
-
switch (key.data || 'externa') {
|
|
1767
|
-
case "user":
|
|
1768
|
-
data = this.user;
|
|
1769
|
-
break;
|
|
1770
|
-
default:
|
|
1771
|
-
data = this.dataExt;
|
|
1772
|
-
break;
|
|
1773
|
-
}
|
|
1774
|
-
if (data) {
|
|
1775
|
-
var aux = jsonpath__namespace.query(data, key.scope);
|
|
1776
|
-
if (aux.length == 0)
|
|
1777
|
-
return undefined;
|
|
1778
|
-
if (aux.length == 1)
|
|
1779
|
-
return aux[0];
|
|
1780
|
-
else
|
|
1781
|
-
return aux;
|
|
1782
|
-
}
|
|
1783
|
-
return undefined;
|
|
1784
|
-
};
|
|
1785
|
-
RegistroComponent.prototype.sendNotification = function (message) {
|
|
1786
|
-
this.messageSerice.add(message);
|
|
1787
|
-
};
|
|
1788
|
-
RegistroComponent.prototype.addObjectArray = function (element) {
|
|
1789
|
-
var _this = this;
|
|
1790
|
-
this.dialogRef = this.dialogService.open(RegistroChildComponent, {
|
|
1791
|
-
header: element.label ? element.label : 'Detalle',
|
|
1792
|
-
width: '70%',
|
|
1793
|
-
modal: true,
|
|
1794
|
-
closable: true,
|
|
1795
|
-
data: {
|
|
1796
|
-
uiEsquema: Object.assign({}, element.elements),
|
|
1797
|
-
esquema: this.getControl(element.scope),
|
|
1798
|
-
id: this.getValue(element.scope).length + 1
|
|
1799
|
-
}
|
|
1800
|
-
});
|
|
1801
|
-
this.dialogRef.onClose.subscribe(function (data) {
|
|
1802
|
-
if (data)
|
|
1803
|
-
_this.data[element.scope.replace('$..properties.', '')].push(data);
|
|
1804
|
-
_this.applyValuesOnEvent('onChange', _this.crudConfig.esquema, element.scope.replace('$..properties.', ''));
|
|
1805
|
-
});
|
|
1806
|
-
};
|
|
1807
|
-
RegistroComponent.prototype.editRow = function (element, data, index) {
|
|
1808
|
-
var _this = this;
|
|
1809
|
-
this.dialogRef = this.dialogService.open(RegistroChildComponent, {
|
|
1810
|
-
header: element.label ? element.label : 'Detalle',
|
|
1811
|
-
width: '70%',
|
|
1812
|
-
modal: true,
|
|
1813
|
-
closable: true,
|
|
1814
|
-
data: {
|
|
1815
|
-
uiEsquema: Object.assign({}, element.elements),
|
|
1816
|
-
esquema: this.getControl(element.scope),
|
|
1817
|
-
data: Object.assign({}, data)
|
|
1818
|
-
}
|
|
1819
|
-
});
|
|
1820
|
-
this.dialogRef.onClose.subscribe(function (data) {
|
|
1821
|
-
if (data)
|
|
1822
|
-
_this.data[element.scope.replace('$..properties.', '')][index] = data;
|
|
1823
|
-
_this.applyValuesOnEvent('onChange', _this.crudConfig.esquema, element.scope.replace('$..properties.', ''));
|
|
1824
|
-
});
|
|
1825
|
-
};
|
|
1826
|
-
RegistroComponent.prototype.deleteRow = function (element, index) {
|
|
1827
|
-
this.data[element.scope.replace('$..properties.', '')].splice(index, 1);
|
|
1828
|
-
index = 1;
|
|
1829
|
-
this.data[element.scope.replace('$..properties.', '')].forEach(function (el) {
|
|
1830
|
-
el.id = index;
|
|
1831
|
-
index++;
|
|
2414
|
+
else {
|
|
2415
|
+
_this.controls[i].push(_this.crudService.getControl(element.scope, _this.esquema));
|
|
2416
|
+
_this.controls[i][j].scope = element.scope;
|
|
2417
|
+
_this.values[i].push(_this.crudService.getValue(element.scope, _this.data));
|
|
2418
|
+
}
|
|
2419
|
+
});
|
|
1832
2420
|
});
|
|
1833
|
-
this.
|
|
2421
|
+
this.controlsLoaded = true;
|
|
2422
|
+
var idProceso = (_b = (_a = this.data.ADO) === null || _a === void 0 ? void 0 : _a.dataProceso) === null || _b === void 0 ? void 0 : _b.idProceso;
|
|
2423
|
+
if (idProceso && ((_c = this.proceso) === null || _c === void 0 ? void 0 : _c.id) != idProceso)
|
|
2424
|
+
this.refreshIntegracion(idProceso);
|
|
1834
2425
|
};
|
|
1835
|
-
|
|
2426
|
+
FormComponent.prototype.refreshIntegracion = function (idProceso) {
|
|
1836
2427
|
var _this = this;
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
2428
|
+
this.emitLoadingForm(true);
|
|
2429
|
+
return Promise.all([
|
|
2430
|
+
this.adoService.getProceso(idProceso).then(function (proceso) {
|
|
2431
|
+
_this.proceso = proceso;
|
|
2432
|
+
_this.data.ADO.proceso = _this.proceso;
|
|
2433
|
+
})
|
|
2434
|
+
])
|
|
2435
|
+
.finally(function () { return _this.emitLoadingForm(false); });
|
|
2436
|
+
};
|
|
2437
|
+
FormComponent.prototype.extracControlFromTableElements = function (i, j, col) {
|
|
2438
|
+
var property = this.controls[i][j].properties[col.col];
|
|
2439
|
+
return property;
|
|
2440
|
+
};
|
|
2441
|
+
FormComponent.prototype.extracValueFromTableElements = function (i, j, k, col) {
|
|
2442
|
+
var value = this.values[i][j][k][col.col];
|
|
2443
|
+
return value;
|
|
1853
2444
|
};
|
|
1854
|
-
|
|
2445
|
+
FormComponent.prototype.setValue = function (value, scope, i, j) {
|
|
2446
|
+
var _this = this;
|
|
1855
2447
|
var _a;
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
break;
|
|
1884
|
-
case 'datediff:months':
|
|
1885
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'months'));
|
|
1886
|
-
break;
|
|
1887
|
-
case 'datediff:weeks':
|
|
1888
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'weeks'));
|
|
1889
|
-
break;
|
|
1890
|
-
case 'datediff:days':
|
|
1891
|
-
jsonpath__namespace.value(this.data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(this.data, params.scope[1])[0]), 'days'));
|
|
1892
|
-
break;
|
|
1893
|
-
default:
|
|
1894
|
-
break;
|
|
2448
|
+
scope = scope.replaceAll('..properties', '');
|
|
2449
|
+
if (scope) {
|
|
2450
|
+
var control = this.controls[i][j];
|
|
2451
|
+
this.values[i][j] = value;
|
|
2452
|
+
jsonpath__namespace.value(this.data, scope, value);
|
|
2453
|
+
this.crudService.changeData = new ChangeData(value, scope, this.crudService.index);
|
|
2454
|
+
this.uiEsquema.elements.forEach(function (layout, iLayout) {
|
|
2455
|
+
var _a;
|
|
2456
|
+
if (layout.conditions) {
|
|
2457
|
+
var isVisible_1 = _this.crudService.isConditionsCompleted(layout.conditions, _this.crudService.getRegistro(_this.crudService.index).conditions || [], _this.data);
|
|
2458
|
+
if (layout.elements)
|
|
2459
|
+
_this.visible[iLayout] = layout.elements.map(function () { return isVisible_1; });
|
|
2460
|
+
else
|
|
2461
|
+
_this.visible[iLayout][0] = isVisible_1;
|
|
2462
|
+
}
|
|
2463
|
+
(_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, indexEl) {
|
|
2464
|
+
if (element.conditions) {
|
|
2465
|
+
_this.visible[iLayout][indexEl] = _this.crudService.isConditionsCompleted(element.conditions, _this.registro.conditions || [], _this.data);
|
|
2466
|
+
}
|
|
2467
|
+
});
|
|
2468
|
+
});
|
|
2469
|
+
(_a = control.applyKeys) === null || _a === void 0 ? void 0 : _a.forEach(function (i) {
|
|
2470
|
+
var key = _this.registro.keys ? _this.registro.keys[i] : undefined;
|
|
2471
|
+
if (key)
|
|
2472
|
+
_this.crudService.applyKey(key, _this.registro, key.indexData ? _this.crudService.getData(key.indexData) : _this.data);
|
|
2473
|
+
});
|
|
2474
|
+
this.buildControls();
|
|
1895
2475
|
}
|
|
2476
|
+
this.crudService.applyValuesOnEvent('onChange', this.esquema, undefined, this.data);
|
|
1896
2477
|
};
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
jsonpath__namespace.value(esquema, data.scope, data.value);
|
|
1900
|
-
});
|
|
2478
|
+
FormComponent.prototype.sendNotification = function (message) {
|
|
2479
|
+
this.messageService.add(message);
|
|
1901
2480
|
};
|
|
1902
|
-
|
|
2481
|
+
FormComponent.prototype.applyValuesFromObject = function (event) {
|
|
1903
2482
|
if (event.optionValue) {
|
|
1904
2483
|
for (var i = 0; i < event.optionValue.length; i++) {
|
|
1905
2484
|
var optionVal = event.optionValue[i];
|
|
@@ -1909,7 +2488,7 @@
|
|
|
1909
2488
|
}
|
|
1910
2489
|
}
|
|
1911
2490
|
};
|
|
1912
|
-
|
|
2491
|
+
FormComponent.prototype.setValueByScope = function (scope, newVal) {
|
|
1913
2492
|
var _this = this;
|
|
1914
2493
|
var _loop_1 = function (i) {
|
|
1915
2494
|
var row = this_1.controls[i];
|
|
@@ -1924,8 +2503,8 @@
|
|
|
1924
2503
|
_loop_1(i);
|
|
1925
2504
|
}
|
|
1926
2505
|
};
|
|
1927
|
-
|
|
1928
|
-
var control = jsonpath__namespace.query(this.
|
|
2506
|
+
FormComponent.prototype.aplyFormatValue = function (scope, value) {
|
|
2507
|
+
var control = jsonpath__namespace.query(this.esquema, scope)[0];
|
|
1929
2508
|
var resp;
|
|
1930
2509
|
switch (control.type) {
|
|
1931
2510
|
case 'date':
|
|
@@ -1940,21 +2519,649 @@
|
|
|
1940
2519
|
}
|
|
1941
2520
|
return resp;
|
|
1942
2521
|
};
|
|
2522
|
+
FormComponent.prototype.editRow = function (element, data, index) {
|
|
2523
|
+
this.stepService.addCustomChildrenEvent("onClickedEditButton", { element: element, data: data, index: index });
|
|
2524
|
+
};
|
|
2525
|
+
FormComponent.prototype.deleteRow = function (element, index) {
|
|
2526
|
+
this.stepService.addCustomChildrenEvent("onClickedDeleteButton", { element: element, index: index });
|
|
2527
|
+
};
|
|
2528
|
+
FormComponent.prototype.addObjectArray = function (element) {
|
|
2529
|
+
this.stepService.addCustomChildrenEvent("onClickedAddButton", { element: element });
|
|
2530
|
+
};
|
|
2531
|
+
FormComponent.prototype.onStateDocument = function (state) {
|
|
2532
|
+
this.data.pdf.signed = state.toUpperCase() == "FIRMADO";
|
|
2533
|
+
};
|
|
2534
|
+
FormComponent.prototype.onSimuladorChange = function ($event) {
|
|
2535
|
+
var _this = this;
|
|
2536
|
+
Promise.resolve().then(function () { return Object.assign(_this.data, $event); });
|
|
2537
|
+
};
|
|
2538
|
+
FormComponent.prototype.goToADO = function () {
|
|
2539
|
+
var _a;
|
|
2540
|
+
var url = window.location.href;
|
|
2541
|
+
var callback = url.split('?')[0] + ("?id=" + this.data.idForm);
|
|
2542
|
+
var idProceso = (_a = this.data.ADO.dataProceso) === null || _a === void 0 ? void 0 : _a.idProceso;
|
|
2543
|
+
var dataProceso = this.data.ADO.dataProceso;
|
|
2544
|
+
dataProceso.ctivo = this.data.idForm;
|
|
2545
|
+
//this.data.ADO.idTransaction = null
|
|
2546
|
+
//this.data.ADO.idProceso = null
|
|
2547
|
+
if (idProceso) {
|
|
2548
|
+
window.location.href = this.crudService.environment.WebUtilities + "GWV/ADO/" + this.crudService.idKatios + "?id=" + idProceso;
|
|
2549
|
+
window.location.reload();
|
|
2550
|
+
}
|
|
2551
|
+
else if (dataProceso) {
|
|
2552
|
+
window.location.href = this.crudService.environment.WebUtilities + "GWV/ADO/" + this.crudService.idKatios + "?dataProceso=" + btoa(JSON.stringify(dataProceso)) + "&callback=" + encodeURIComponent(callback);
|
|
2553
|
+
window.location.reload();
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
FormComponent.prototype.onTouchDescription = function (id, alignRight) {
|
|
2557
|
+
if (alignRight === void 0) { alignRight = true; }
|
|
2558
|
+
var foundTooltip = this.tooltips.find(function (tooltip) { return tooltip.el.nativeElement.id === id; });
|
|
2559
|
+
try {
|
|
2560
|
+
foundTooltip.activate();
|
|
2561
|
+
alignRight ? foundTooltip.alignRight() : foundTooltip.alignTop();
|
|
2562
|
+
}
|
|
2563
|
+
catch (ex) { }
|
|
2564
|
+
};
|
|
2565
|
+
FormComponent.prototype.onUnTouchDescription = function (descripcion) {
|
|
2566
|
+
var foundTooltip = this.tooltips.find(function (tooltip) { return tooltip.el.nativeElement.id === descripcion; });
|
|
2567
|
+
try {
|
|
2568
|
+
foundTooltip.deactivate();
|
|
2569
|
+
}
|
|
2570
|
+
catch (ex) { }
|
|
2571
|
+
};
|
|
2572
|
+
FormComponent.prototype.copyToClipboard = function (idProceso) {
|
|
2573
|
+
var url = this.crudService.environment.WebUtilities + "GWV/ADO/" + this.crudService.idKatios + "?id=" + idProceso;
|
|
2574
|
+
navigator.clipboard.writeText(url);
|
|
2575
|
+
};
|
|
2576
|
+
return FormComponent;
|
|
2577
|
+
}());
|
|
2578
|
+
FormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FormComponent, deps: [{ token: i1__namespace$1.MessageService }, { token: SfCrudService }, { token: i3__namespace$1.DomSanitizer }, { token: StepService }, { token: i5__namespace$2.AdoService }, { token: i5__namespace$2.JWTService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2579
|
+
FormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FormComponent, selector: "app-form", inputs: { uiEsquema: "uiEsquema", esquema: "esquema", data: "data", isDialog: "isDialog" }, viewQueries: [{ propertyName: "tooltips", predicate: i13.Tooltip, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div *ngIf=\"controlsLoaded\" class=\"frm-container\">\r\n <div *ngFor=\"let element of uiEsquema.elements; let i = index\" [class]=\"element?.class\" #a>\r\n <ng-container [ngSwitch]=\"element.type\" *ngIf=\"visible[i][0]\">\r\n <div class=\"label\" *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements; let j =index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\" *ngIf=\"visible[i][j]\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\"\r\n [value]=\"values[i][j]\" (setValue)=\"setValue($event, el.scope, i, j)\"\r\n (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements; let j =index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\" *ngIf=\"visible[i][j]\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\"\r\n [value]=\"values[i][j]\" (setValue)=\"setValue($event, el.scope, i, j)\"\r\n (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n <div *ngSwitchCase=\"'PDF'\" class=\"pdf\">\r\n <iframe [src]=\"values[i][j]\" frameborder=\"0\" allow=\"geolocation *; camera *;\"></iframe>\r\n </div>\r\n <div *ngSwitchCase=\"'PDF-SIGN'\">\r\n <sf-sign [allowDownload]=\"true\" [idkatios]=\"idKatios\" [tdoc]=\"data.pdf.tdoc\" [ndoc]=\"data.pdf.ndoc\"\r\n [idDocument]=\"data.pdf.id\" [typeDocument]=\"data.pdf.idDoc\"\r\n (stateDocument)=\"onStateDocument($event)\"></sf-sign>\r\n </div>\r\n <ng-container *ngSwitchCase=\"'SIMULADOR'\">\r\n <sf-simulador [simulador]=\"data\" [otherToolTips]=\"data.otherTooltips\"\r\n (simuladorChange)=\"onSimuladorChange($event)\" (enProceso)=\"emitLoadingForm($event)\"></sf-simulador>\r\n </ng-container>\r\n\r\n <div *ngSwitchCase=\"'ADO'\" class=\"buttons\">\r\n <p-button *ngIf=\"!data?.ADO?.dataProceso?.idProceso\" [ngStyle]=\"el?.ngStyle\" (click)=\"goToADO()\" label=\"Validar identidad\"></p-button>\r\n </div>\r\n <div *ngSwitchCase=\"'ADO'\">\r\n <div *ngIf=\"data?.ADO?.dataProceso?.idProceso\">\r\n <div class=\"data-ado-container\">\r\n <ng-container *ngIf=\"proceso\">\r\n <i *ngIf=\"proceso?.respuestaProceso?.EsExitoso === true\" pTooltip=\"Validado\" tooltipPosition=\"top\" id=\"Validado\" class=\"pi pi-user\" style=\"color: green\"\r\n (touchstart)=\"onTouchDescription('Validado', false)\" (touchend)=\"onUnTouchDescription('Validado')\"></i>\r\n <i *ngIf=\"proceso?.respuestaProceso?.EsExitoso === false\" pTooltip=\"No validado\" tooltipPosition=\"top\" id=\"No-Validado\" class=\"pi pi-user\" style=\"color: red\"\r\n (touchstart)=\"onTouchDescription('No-Validado', false)\" (touchend)=\"onUnTouchDescription('No-Validado')\"></i>\r\n <i *ngIf=\"!proceso?.respuestaProceso\" pTooltip=\"Sin validar\" tooltipPosition=\"top\" class=\"pi pi-user\" id=\"Sin-Validar\" style=\"color: gray\"\r\n (touchstart)=\"onTouchDescription('Sin-Validar', false)\" (touchend)=\"onUnTouchDescription('Sin-Validar')\"></i>\r\n </ng-container>\r\n <div class=\"buttons\">\r\n <button pButton icon=\"pi pi-external-link\" (click)=\"goToADO()\" pTooltip=\"Abrir\" [disabled]=\"!proceso\"></button>\r\n <button pButton icon=\"pi pi-copy\" (click)=\"copyToClipboard(proceso.id)\" pTooltip=\"Copiar\" [disabled]=\"!proceso\"></button>\r\n <button pButton icon=\"pi pi-refresh\" (click)=\"refreshIntegracion(proceso.id)\" pTooltip=\"Refrescar\" [disabled]=\"!proceso\"></button>\r\n </div>\r\n </div>\r\n <p class=\"result-ado\" *ngIf=\"proceso && !proceso.respuestaProceso && proceso.estado == 'PROCESANDO'\">Procesando</p>\r\n <p class=\"result-ado\" *ngIf=\"proceso && proceso.respuestaProceso && proceso.estado == 'TERMINADO'\">{{proceso.respuestaProceso.Detalle ?? proceso.respuestaProceso.Mensaje}}</p>\r\n </div>\r\n </div>\r\n <ng-container *ngSwitchCase=\"'Table'\">\r\n <p-table [value]=\"values[i][j]\" [columns]=\"controls[i][j].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\" [disabled]=\"controls[i][j].disabled === true\"></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>\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=\"'control'\">\r\n <sf-control [control]=\"extracControlFromTableElements(i, j, col)\" [label]=\"\"\r\n [value]=\"extracValueFromTableElements(i, j, rowIndex, col)\"\r\n (sendNotification)=\"sendNotification($event)\"\r\n (sendObject)=\"applyValuesFromObject($event)\"\r\n (setValue)=\"setValue($event, extracValueFromTableElements(i, j, rowIndex, col).scope, i, j)\"\r\n [showTempValue]=\"true\"\r\n >\r\n </sf-control>\r\n </ng-container>\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>\r\n <td>\r\n <button pButton pRipple type=\"button\"\r\n (click)=\"editRow(el, rowData, rowIndex)\" icon=\"pi pi-pencil\"\r\n class=\"p-button-rounded p-button-info mr-1\"></button>\r\n <button pButton pRipple type=\"button\" (click)=\"deleteRow(el, rowIndex)\" [disabled]=\"controls[i][j].disabled === true\"\r\n icon=\"pi pi-trash\" class=\"p-button-rounded p-button-danger\"></button>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n\r\n<p-toast *ngIf=\"isDialog\"></p-toast>", styles: [":not(.col-12) .label{display:flex;justify-content:center;align-items:center;padding-inline:.5rem;margin-bottom:15px;margin-top:20px;border-radius:13px;font-size:18px;font-size:inherit;background-color:var(--primary-color);text-align:center;color:var(--normal-text-color)}.pdf{display:flex;width:100%;height:80vh;& iframe{width:80%;margin-inline:10%}}.data-ado-container{display:flex;margin-inline:auto;align-items:center;width:-moz-fit-content;width:fit-content;&>*{margin-inline:4px}&>div{display:flex;align-items:center;&>*{margin-inline:4px}}}i.pi-user{font-size:2rem}.result-ado{min-height:1rem;text-align:center}sf-simulador{display:flow-root;width:80%;margin-inline:auto;margin-bottom:35px}sf-sign{display:block;margin-inline:auto;width:80%;& pdf-viewer{min-height:130vh!important;max-height:130vh!important}}.buttons{display:flex;justify-content:space-evenly}.buttons ::ng-deep .p-button.p-component{border-radius:35px}::ng-deep *{box-shadow:none}.frm-container ::ng-deep .p-inputtext:focus,.frm-container ::ng-deep .p-inputtext:active,.frm-container ::ng-deep .p-inputwrapper:focus,.frm-container ::ng-deep .p-inputwrapper:active{border-color:var(--button-color)}.frm-container ::ng-deep .p-button{background-color:var(--button-color);border-color:var(--button-color)}.frm-container ::ng-deep .p-button:hover{background-color:var(--button-color);filter:brightness(85%)}.frm-container ::ng-deep :not(:disabled):active,.frm-container ::ng-deep :not(.p-disabled) .p-inputtext:hover,.frm-container ::ng-deep :not(.p-disabled) .p-inputwrapper:hover,.frm-container ::ng-deep :not(.p-disabled) .p-inputwrapper-focus,.frm-container ::ng-deep .p-radiobutton-box .p-highlight,.frm-container ::ng-deep .p-radiobutton .p-radiobutton-box:not(.p-disabled):hover{border-color:var(--button-color)}.frm-container ::ng-deep .p-radiobutton .p-radiobutton-box.p-highlight{background:var(--button-color);border-color:var(--button-color)!important}.frm-container ::ng-deep .p-button.p-button-success,.p-buttonset.p-button-success>.p-button,.p-splitbutton.p-button-success>.p-button{background:var(--button-color);border-color:var(--button-color)!important}@media screen and (max-width:765px){:not(.col-12) .label{height:-moz-fit-content;height:fit-content}.field{margin-bottom:.5rem}.pdf>iframe{width:100%;margin-inline:0}sf-sign{width:100%;& pdf-viewer{min-height:60vh!important;max-height:120vh!important}}sf-simulador{display:block;width:100%;margin-inline:auto}.data-ado-container{text-align:center;& .buttons{max-width:80vw;flex-direction:row}}.buttons{flex-direction:column;align-items:center}}.frm-container ::ng-deep .p-radiobutton .p-radiobutton-box:not(.p-disabled):not(.p-highlight):hover{border-color:var(--secondary-color)!important}.frm-container ::ng-deep .p-button.p-button-success:enabled:focus,.p-buttonset.p-button-success>.p-button:enabled:focus,.p-splitbutton.p-button-success>.p-button:enabled:focus{box-shadow:inset 0 0 #fff}.frm-container ::ng-deep .p-radiobutton .p-radiobutton-box.p-highlight:not(.p-disabled):hover{color:var(--secondary-color)!important}.frm-container ::ng-deep .p-radiobutton .p-radiobutton-box:not(.p-disabled).p-focus{box-shadow:inset 0 0 0 1px var(--secondary-color)!important}.frm-container ::ng-deep .p-radiobutton .p-radiobutton-box .p-radiobutton-icon{background-color:#fff}.frm-container ::ng-deep .p-slider:not(.p-disabled):hover{background-color:#e5e7eb}.frm-container ::ng-deep .p-slider{background-color:#e5e7eb}.frm-container ::ng-deep .p-slider:not(.p-disabled):hover .p-slider-range{background-color:var(--primary-color)!important}.frm-container ::ng-deep .p-button:enabled:active{background:var(--secondary-color)!important;border-color:var(--secondary-color)!important}.frm-container ::ng-deep .p-slider:not(.p-disabled):hover .p-slider-handle{border-color:var(--primary-color)!important}.frm-container ::ng-deep .p-button:focus{box-shadow:inset 0 0 0 1px var(--secondary-color)!important}.frm-container ::ng-deep .p-button:enabled:hover{background:var(--secondary-color)!important;border-color:var(--secondary-color)!important}.frm-container ::ng-deep .p-button.p-button-info,.p-buttonset.p-button-info>.p-button,.p-splitbutton.p-button-info>.p-button{background:var(--secondary-color)!important;border:1px solid var(--secondary-color)!important}\n"], components: [{ type: ControlComponent, selector: "sf-control", inputs: ["showTempValue", "control", "label", "value", "appendTo"], outputs: ["setValue", "sendObject"] }, { type: i6__namespace$2.SignComponent, selector: "sf-sign", inputs: ["idkatios", "tdoc", "ndoc", "idDocument", "typeDocument", "allowDownload"], outputs: ["stateDocument", "loading"] }, { type: i7__namespace$1.SfSimuladorComponent, selector: "sf-simulador", inputs: ["simulador", "otherToolTips", "labels"], outputs: ["simuladorChange", "enProceso"] }, { type: i9__namespace.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i6__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: i11__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }], directives: [{ type: i12__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i12__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i12__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i12__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i13__namespace.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i1__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i11__namespace.Ripple, selector: "[pRipple]" }], pipes: { "currency": i12__namespace.CurrencyPipe, "date": i12__namespace.DatePipe } });
|
|
2580
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FormComponent, decorators: [{
|
|
2581
|
+
type: i0.Component,
|
|
2582
|
+
args: [{
|
|
2583
|
+
selector: 'app-form',
|
|
2584
|
+
templateUrl: './form.component.html',
|
|
2585
|
+
styleUrls: ['./form.component.css']
|
|
2586
|
+
}]
|
|
2587
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.MessageService }, { type: SfCrudService }, { type: i3__namespace$1.DomSanitizer }, { type: StepService }, { type: i5__namespace$2.AdoService }, { type: i5__namespace$2.JWTService }]; }, propDecorators: { uiEsquema: [{
|
|
2588
|
+
type: i0.Input
|
|
2589
|
+
}], esquema: [{
|
|
2590
|
+
type: i0.Input
|
|
2591
|
+
}], data: [{
|
|
2592
|
+
type: i0.Input
|
|
2593
|
+
}], isDialog: [{
|
|
2594
|
+
type: i0.Input
|
|
2595
|
+
}], tooltips: [{
|
|
2596
|
+
type: i0.ViewChildren,
|
|
2597
|
+
args: [i13.Tooltip]
|
|
2598
|
+
}] } });
|
|
2599
|
+
|
|
2600
|
+
var RegistroComponent = /** @class */ (function () {
|
|
2601
|
+
function RegistroComponent(generalService, activeRoute, messageService, sfCrudService, stepService, sfPdfSignService, sfSimuladorService, notificationService, router) {
|
|
2602
|
+
this.generalService = generalService;
|
|
2603
|
+
this.activeRoute = activeRoute;
|
|
2604
|
+
this.messageService = messageService;
|
|
2605
|
+
this.sfCrudService = sfCrudService;
|
|
2606
|
+
this.stepService = stepService;
|
|
2607
|
+
this.sfPdfSignService = sfPdfSignService;
|
|
2608
|
+
this.sfSimuladorService = sfSimuladorService;
|
|
2609
|
+
this.notificationService = notificationService;
|
|
2610
|
+
this.router = router;
|
|
2611
|
+
this.idKatios = '';
|
|
2612
|
+
this.trx = '';
|
|
2613
|
+
this.id = '';
|
|
2614
|
+
this.ids = [];
|
|
2615
|
+
this.sendData = new i0.EventEmitter();
|
|
2616
|
+
this.onSubmit = new i0.EventEmitter();
|
|
2617
|
+
this.subsToKillOnDestroy = [];
|
|
2618
|
+
this.isLocal = false;
|
|
2619
|
+
this.displays = [];
|
|
2620
|
+
this.firstLoad = true;
|
|
2621
|
+
this.dialogElements = [];
|
|
2622
|
+
this.items = [];
|
|
2623
|
+
this.loading = { inProgress: true, target: undefined };
|
|
2624
|
+
}
|
|
2625
|
+
Object.defineProperty(RegistroComponent.prototype, "idEntidad", {
|
|
2626
|
+
set: function (value) {
|
|
2627
|
+
this.idForm = value;
|
|
2628
|
+
},
|
|
2629
|
+
enumerable: false,
|
|
2630
|
+
configurable: true
|
|
2631
|
+
});
|
|
2632
|
+
RegistroComponent.prototype.ngOnChanges = function (changes) {
|
|
2633
|
+
if (this.idKatios && this.idForm && this.environment && (changes["idKatios"] || changes["idEntidad"])) {
|
|
2634
|
+
this.sfCrudService.ids = this.ids;
|
|
2635
|
+
this.sfCrudService.idKatios = this.idKatios;
|
|
2636
|
+
this.sfCrudService.environment = this.environment;
|
|
2637
|
+
this.generalService.idKatios = this.idKatios;
|
|
2638
|
+
this.generalService.environment = this.environment;
|
|
2639
|
+
this.sfPdfSignService.setEnviroments(this.environment);
|
|
2640
|
+
this.sfSimuladorService.environments = this.environment;
|
|
2641
|
+
this.sfSimuladorService.idKatios = this.idKatios;
|
|
2642
|
+
this.loadConfigCrud();
|
|
2643
|
+
}
|
|
2644
|
+
};
|
|
2645
|
+
RegistroComponent.prototype.ngOnInit = function () {
|
|
2646
|
+
var _this = this;
|
|
2647
|
+
this.instanceSubsStepService();
|
|
2648
|
+
this.notificationSubscription = this.notificationService.notificationAdded$().subscribe(function (notification) {
|
|
2649
|
+
var _a, _b;
|
|
2650
|
+
if ((_a = notification === null || notification === void 0 ? void 0 : notification.requestChecking) === null || _a === void 0 ? void 0 : _a.useSwal) {
|
|
2651
|
+
Swal__default["default"].fire(notification.msg).then(function (res) {
|
|
2652
|
+
var _a, _b;
|
|
2653
|
+
if (notification.msg.showCancelButton && res.isDismissed && ((_a = notification.requestChecking) === null || _a === void 0 ? void 0 : _a.cancelRedirect)) {
|
|
2654
|
+
if (notification.requestChecking.cancelRedirect.toUpperCase() == "INICIO")
|
|
2655
|
+
_this.sfCrudService.redirectToInicio();
|
|
2656
|
+
else
|
|
2657
|
+
window.location.href = notification.requestChecking.cancelRedirect;
|
|
2658
|
+
}
|
|
2659
|
+
else if (res.isConfirmed && ((_b = notification.requestChecking) === null || _b === void 0 ? void 0 : _b.redirect)) {
|
|
2660
|
+
if (notification.requestChecking.redirect.toUpperCase() == "INICIO")
|
|
2661
|
+
_this.sfCrudService.redirectToInicio();
|
|
2662
|
+
else
|
|
2663
|
+
window.location.href = notification.requestChecking.redirect;
|
|
2664
|
+
}
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
else if ((notification === null || notification === void 0 ? void 0 : notification.msg) && ((_b = notification.requestChecking) === null || _b === void 0 ? void 0 : _b.redirect)) {
|
|
2668
|
+
_this.messageService.add(notification.msg);
|
|
2669
|
+
if (notification.requestChecking.redirect.toUpperCase() == "INICIO")
|
|
2670
|
+
_this.sfCrudService.redirectToInicio();
|
|
2671
|
+
else {
|
|
2672
|
+
var newURL = _this.sfCrudService.getURLRedirect(notification.requestChecking.redirect);
|
|
2673
|
+
window.location.href = newURL;
|
|
2674
|
+
window.location.reload();
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
else if (notification === null || notification === void 0 ? void 0 : notification.msg) {
|
|
2678
|
+
_this.messageService.add(notification.msg);
|
|
2679
|
+
}
|
|
2680
|
+
});
|
|
2681
|
+
};
|
|
2682
|
+
RegistroComponent.prototype.ngOnDestroy = function () {
|
|
2683
|
+
if (this.notificationSubscription) {
|
|
2684
|
+
this.notificationSubscription.unsubscribe();
|
|
2685
|
+
}
|
|
2686
|
+
this.subsToKillOnDestroy.forEach(function (sub) { return sub.unsubscribe(); });
|
|
2687
|
+
this.stepService.reset();
|
|
2688
|
+
this.sfCrudService.reset();
|
|
2689
|
+
console.log("destroy");
|
|
2690
|
+
};
|
|
2691
|
+
RegistroComponent.prototype.instanceSubsStepService = function () {
|
|
2692
|
+
var _this = this;
|
|
2693
|
+
this.subsToKillOnDestroy.push(this.stepService.customChildrenEvents$.subscribe(function (event) {
|
|
2694
|
+
if (!event)
|
|
2695
|
+
return;
|
|
2696
|
+
switch (event.name.toUpperCase()) {
|
|
2697
|
+
case "ONCLICKEDEDITBUTTON":
|
|
2698
|
+
_this.onClickedEditButton(event.data.element, event.data.data, event.data.index);
|
|
2699
|
+
break;
|
|
2700
|
+
case "ONCLICKEDDELETEBUTTON":
|
|
2701
|
+
_this.deleteRow(event.data.element, event.data.index);
|
|
2702
|
+
break;
|
|
2703
|
+
case "ONCLICKEDADDBUTTON":
|
|
2704
|
+
_this.onClickedAddButton(event.data.element);
|
|
2705
|
+
break;
|
|
2706
|
+
}
|
|
2707
|
+
}));
|
|
2708
|
+
this.subsToKillOnDestroy.push(this.stepService.requestApproval$.subscribe(function (value) {
|
|
2709
|
+
console.log(value);
|
|
2710
|
+
if ((value === null || value === void 0 ? void 0 : value.desired) != undefined) {
|
|
2711
|
+
if (value.desired < value.current) {
|
|
2712
|
+
_this.stepService.requestApproved = true;
|
|
2713
|
+
_this.sfCrudService.index = _this.stepService.currentIndex;
|
|
2714
|
+
_this.scrollTop();
|
|
2715
|
+
}
|
|
2716
|
+
else {
|
|
2717
|
+
var operation = _this.sfCrudService.getRegistro(_this.indexCrud).operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
|
|
2718
|
+
if (!_this.validateData(operation, _this.sfCrudService.getData(_this.indexCrud), _this.sfCrudService.getRegistro(_this.indexCrud).conditions || []))
|
|
2719
|
+
_this.stepService.requestApproved = false;
|
|
2720
|
+
else if (operation.method != null)
|
|
2721
|
+
_this.uploadInfoStep(value);
|
|
2722
|
+
else if (operation.answerChecking) { //no tiene request, solo un mensaje
|
|
2723
|
+
_this.stepService.requestApproved = true;
|
|
2724
|
+
_this.loading.inProgress = false;
|
|
2725
|
+
_this.sfCrudService.formLoading = _this.loading;
|
|
2726
|
+
_this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("success", undefined, "Información subida correctamente", operation.answerChecking), {}, operation.answerChecking), operation.answerChecking);
|
|
2727
|
+
_this.sfCrudService.index = _this.stepService.currentIndex;
|
|
2728
|
+
_this.scrollTop();
|
|
2729
|
+
}
|
|
2730
|
+
else { //no tiene nada configurado
|
|
2731
|
+
_this.stepService.requestApproved = true;
|
|
2732
|
+
_this.sfCrudService.index = _this.stepService.currentIndex;
|
|
2733
|
+
_this.scrollTop();
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
}));
|
|
2738
|
+
console.log("subs step service terminadas");
|
|
2739
|
+
};
|
|
2740
|
+
RegistroComponent.prototype.uploadInfoStep = function (position) {
|
|
2741
|
+
var _this = this;
|
|
2742
|
+
this.loading.inProgress = true;
|
|
2743
|
+
this.sfCrudService.formLoading = this.loading;
|
|
2744
|
+
this.submit(position.current).then(function () {
|
|
2745
|
+
var _a, _b, _c;
|
|
2746
|
+
var tieneRedirect = ((_a = _this.sfCrudService.currentOperation) === null || _a === void 0 ? void 0 : _a.answerChecking) !== undefined && ((_c = (_b = _this.sfCrudService.currentOperation) === null || _b === void 0 ? void 0 : _b.answerChecking) === null || _c === void 0 ? void 0 : _c.redirect) !== undefined;
|
|
2747
|
+
console.log(_this.items.length);
|
|
2748
|
+
if (_this.items.length == 1) {
|
|
2749
|
+
_this.stepService.requestApproved = false;
|
|
2750
|
+
//this.stepService.desiredIndex = undefined
|
|
2751
|
+
_this.sfCrudService.index = _this.stepService.currentIndex;
|
|
2752
|
+
}
|
|
2753
|
+
else if (!tieneRedirect) {
|
|
2754
|
+
_this.advance(position.current, position.desired, false);
|
|
2755
|
+
}
|
|
2756
|
+
_this.scrollTop();
|
|
2757
|
+
})
|
|
2758
|
+
.catch(function () {
|
|
2759
|
+
_this.stepService.requestApproved = false;
|
|
2760
|
+
}).finally(function () {
|
|
2761
|
+
_this.loading.inProgress = false;
|
|
2762
|
+
_this.sfCrudService.formLoading = _this.loading;
|
|
2763
|
+
});
|
|
2764
|
+
};
|
|
2765
|
+
RegistroComponent.prototype.onClickBtnSubmit = function () {
|
|
2766
|
+
this.stepService.requestApproval = this.indexCrud;
|
|
2767
|
+
};
|
|
2768
|
+
RegistroComponent.prototype.loadConfigCrud = function () {
|
|
2769
|
+
var _this = this;
|
|
2770
|
+
this.loading.inProgress = true;
|
|
2771
|
+
this.sfCrudService.formLoading = this.loading;
|
|
2772
|
+
this.sfCrudService.dataExt = this.dataExt;
|
|
2773
|
+
this.sfCrudService.crudLoaded = false;
|
|
2774
|
+
if (this.loadSession()) {
|
|
2775
|
+
this.sfCrudService.crudLoaded = true;
|
|
2776
|
+
return;
|
|
2777
|
+
}
|
|
2778
|
+
this.generalService.getCrudByEntidad(this.idKatios, this.idForm)
|
|
2779
|
+
.then(function (res) {
|
|
2780
|
+
console.log("crud cargado");
|
|
2781
|
+
_this.sfCrudService.uiEsquemas = res.uiEsquemas;
|
|
2782
|
+
_this.sfCrudService.esquemas = res.esquemas;
|
|
2783
|
+
_this.sfCrudService.registros = res.registros;
|
|
2784
|
+
_this.customizeCompany(res.uiEsquemas);
|
|
2785
|
+
_this.sfCrudService.registros.forEach(function (_, i) { return _this.sfCrudService.setTrx("c", i); });
|
|
2786
|
+
_this.loadData()
|
|
2787
|
+
.then(function () {
|
|
2788
|
+
_this.setLabelSumbit();
|
|
2789
|
+
_this.sfCrudService.dataset.forEach(function (data, i) {
|
|
2790
|
+
var _a;
|
|
2791
|
+
if (_this.activeRoute.snapshot.queryParams["_idGWVADO"] && ((_a = data.ADO) === null || _a === void 0 ? void 0 : _a.dataProceso)) {
|
|
2792
|
+
data.ADO.dataProceso.idProceso = _this.activeRoute.snapshot.queryParams["_idGWVADO"];
|
|
2793
|
+
}
|
|
2794
|
+
if (_this.activeRoute.snapshot.queryParams["_idADO"] && data.ADO) {
|
|
2795
|
+
data.ADO.idTransaction = _this.activeRoute.snapshot.queryParams["_idADO"];
|
|
2796
|
+
}
|
|
2797
|
+
_this.sfCrudService.setDataSet(data, i);
|
|
2798
|
+
});
|
|
2799
|
+
})
|
|
2800
|
+
.finally(function () {
|
|
2801
|
+
var willExecuteRequest = _this.advance(0, _this.sfCrudService.uiEsquemas.length - 1, true);
|
|
2802
|
+
_this.createSteps(res.uiEsquemas);
|
|
2803
|
+
_this.sfCrudService.crudLoaded = true;
|
|
2804
|
+
if (!willExecuteRequest) {
|
|
2805
|
+
_this.loading.inProgress = false;
|
|
2806
|
+
_this.sfCrudService.formLoading = _this.loading;
|
|
2807
|
+
}
|
|
2808
|
+
});
|
|
2809
|
+
}).catch(function (ex) {
|
|
2810
|
+
console.error(ex);
|
|
2811
|
+
_this.loading.inProgress = false;
|
|
2812
|
+
_this.sfCrudService.formLoading = _this.loading;
|
|
2813
|
+
});
|
|
2814
|
+
};
|
|
2815
|
+
/**
|
|
2816
|
+
* Step will advance until esquema is not completed
|
|
2817
|
+
*/
|
|
2818
|
+
RegistroComponent.prototype.advance = function (start, limit, executeRequest) {
|
|
2819
|
+
var _this = this;
|
|
2820
|
+
var _a;
|
|
2821
|
+
console.log("advance desde ", start, " hasta ", limit);
|
|
2822
|
+
var i = start;
|
|
2823
|
+
var op;
|
|
2824
|
+
var willExecuteRequest = false;
|
|
2825
|
+
var registro;
|
|
2826
|
+
while (i < limit) {
|
|
2827
|
+
registro = this.sfCrudService.getRegistro(i);
|
|
2828
|
+
op = registro.operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(i)); });
|
|
2829
|
+
if (!this.validateData(op, this.sfCrudService.getData(i), registro.conditions || [], false))
|
|
2830
|
+
break;
|
|
2831
|
+
i++;
|
|
2832
|
+
}
|
|
2833
|
+
this.sfCrudService.index = i;
|
|
2834
|
+
this.stepService.currentIndex = i;
|
|
2835
|
+
this.stepService.desiredIndex = i;
|
|
2836
|
+
console.log("advance", i);
|
|
2837
|
+
this.stepService.requestApproved = true;
|
|
2838
|
+
registro = this.sfCrudService.getRegistro(i);
|
|
2839
|
+
var dataCurrentStep = this.sfCrudService.getData(i);
|
|
2840
|
+
op = this.sfCrudService.getRegistro(i).operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(i)); });
|
|
2841
|
+
if (executeRequest && (this.activeRoute.snapshot.queryParams["_idGWVADO"] || this.activeRoute.snapshot.queryParams["_idADO"]) //Viene de ADO
|
|
2842
|
+
&& dataCurrentStep.ADO && this.validateData(op, dataCurrentStep, (_a = registro.conditions) !== null && _a !== void 0 ? _a : [], false) //El step esta completo
|
|
2843
|
+
) {
|
|
2844
|
+
console.log("advance with approval", i);
|
|
2845
|
+
this.stepService.requestApproval = i;
|
|
2846
|
+
willExecuteRequest = true;
|
|
2847
|
+
}
|
|
2848
|
+
return willExecuteRequest;
|
|
2849
|
+
};
|
|
2850
|
+
RegistroComponent.prototype.loadSession = function () {
|
|
2851
|
+
var wasLoaded = this.sfCrudService.loadSession();
|
|
2852
|
+
if (wasLoaded) {
|
|
2853
|
+
this.customizeCompany(this.sfCrudService.uiEsquemas);
|
|
2854
|
+
this.stepService.currentIndex = this.sfCrudService.index;
|
|
2855
|
+
this.createSteps(this.sfCrudService.uiEsquemas);
|
|
2856
|
+
this.loading.inProgress = false;
|
|
2857
|
+
this.sfCrudService.formLoading = this.loading;
|
|
2858
|
+
}
|
|
2859
|
+
return wasLoaded;
|
|
2860
|
+
};
|
|
2861
|
+
RegistroComponent.prototype.customizeCompany = function (uiEsquemas) {
|
|
2862
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2863
|
+
this.sfCrudService.configEmpresa = (_a = uiEsquemas.find(function (ui) { return ui.general; })) === null || _a === void 0 ? void 0 : _a.general;
|
|
2864
|
+
this.logo = (_c = (_b = this.sfCrudService.configEmpresa) === null || _b === void 0 ? void 0 : _b.icons) === null || _c === void 0 ? void 0 : _c.carga;
|
|
2865
|
+
if (this.sfCrudService.configEmpresa) {
|
|
2866
|
+
if ((_d = this.sfCrudService.configEmpresa.colors) === null || _d === void 0 ? void 0 : _d.main)
|
|
2867
|
+
this.color = this.sfCrudService.configEmpresa.colors.main;
|
|
2868
|
+
if ((_e = this.sfCrudService.configEmpresa.colors) === null || _e === void 0 ? void 0 : _e.secondary)
|
|
2869
|
+
this.color2 = this.sfCrudService.configEmpresa.colors.secondary;
|
|
2870
|
+
if ((_f = this.sfCrudService.configEmpresa.colors) === null || _f === void 0 ? void 0 : _f.button)
|
|
2871
|
+
this.colorButton = this.sfCrudService.configEmpresa.colors.button;
|
|
2872
|
+
}
|
|
2873
|
+
if (!this.colorButton)
|
|
2874
|
+
this.colorButton = "blue";
|
|
2875
|
+
if (!this.color2)
|
|
2876
|
+
this.color2 = "blue";
|
|
2877
|
+
if (!this.color)
|
|
2878
|
+
this.color = "blue";
|
|
2879
|
+
};
|
|
2880
|
+
RegistroComponent.prototype.scrollTop = function () {
|
|
2881
|
+
window.scroll({
|
|
2882
|
+
top: 0,
|
|
2883
|
+
left: 0,
|
|
2884
|
+
behavior: 'smooth'
|
|
2885
|
+
});
|
|
2886
|
+
};
|
|
2887
|
+
RegistroComponent.prototype.createSteps = function (uiEsquemas) {
|
|
2888
|
+
var _this = this;
|
|
2889
|
+
this.items = [];
|
|
2890
|
+
uiEsquemas.forEach(function (uiEsq, index) {
|
|
2891
|
+
if (uiEsq.step)
|
|
2892
|
+
_this.items.push({ label: uiEsq.step, routerLink: index, queryParamsHandling: "preserve" });
|
|
2893
|
+
else
|
|
2894
|
+
_this.items.push({ label: "paso " + index, routerLink: index });
|
|
2895
|
+
_this.sfCrudService.getRegistro(index); //ver si tiene un change
|
|
2896
|
+
});
|
|
2897
|
+
};
|
|
2898
|
+
/**
|
|
2899
|
+
* Instancia todos los esquemas, y realiza los requests para traer la data de todos los step.
|
|
2900
|
+
* @param esquema
|
|
2901
|
+
* @param registro
|
|
2902
|
+
* @returns
|
|
2903
|
+
*/
|
|
2904
|
+
RegistroComponent.prototype.loadData = function () {
|
|
2905
|
+
var _this = this;
|
|
2906
|
+
this.sfCrudService.esquemas.forEach(function (esquema, i) {
|
|
2907
|
+
var op = _this.sfCrudService.registros[i].operations.find(function (x) { return x.type.startsWith(_this.sfCrudService.getTrx(i)); });
|
|
2908
|
+
_this.sfCrudService.setDataSet(_this.sfCrudService.createObject(esquema, op), i);
|
|
2909
|
+
});
|
|
2910
|
+
console.log("loadData");
|
|
2911
|
+
return Promise.all(this.sfCrudService.registros.map(function (registro, i) { return _this.ids.length > 0 ? _this.getInfoRegistro(registro, i, _this.ids[i]) : Promise.resolve(); }));
|
|
2912
|
+
};
|
|
2913
|
+
RegistroComponent.prototype.getInfoRegistro = function (configRegistro, index, id) {
|
|
2914
|
+
var _this = this;
|
|
2915
|
+
var op = configRegistro.operations.find(function (x) { return x.type == 'read'; });
|
|
2916
|
+
if (!op)
|
|
2917
|
+
return;
|
|
2918
|
+
var url = this.sfCrudService.getURL(op, index, id);
|
|
2919
|
+
return this.generalService.genericRequest(op.method, url)
|
|
2920
|
+
.then(function (res) {
|
|
2921
|
+
var value = undefined;
|
|
2922
|
+
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
2923
|
+
value = Array.isArray(res.data) ? res.data[0] : res.data;
|
|
2924
|
+
}
|
|
2925
|
+
else
|
|
2926
|
+
value = Array.isArray(res) ? res[0] : res;
|
|
2927
|
+
_this.sfCrudService.applyObjectKeys(value, op.keysEsquema || [], configRegistro);
|
|
2928
|
+
if (op.changeTrx)
|
|
2929
|
+
op.changeTrx.forEach(function (x) { return _this.sfCrudService.setTrx(x.trx, x.index); });
|
|
2930
|
+
console.log("getInfoRegistro", op.changeTrx);
|
|
2931
|
+
})
|
|
2932
|
+
.catch(function (error) {
|
|
2933
|
+
console.log(error);
|
|
2934
|
+
var errorChecking;
|
|
2935
|
+
if (Array.isArray(op.errorChecking))
|
|
2936
|
+
errorChecking = op.errorChecking[0];
|
|
2937
|
+
else
|
|
2938
|
+
errorChecking = op.errorChecking;
|
|
2939
|
+
_this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("error", "Formulario no cargado correctamente", "", errorChecking), error.error, errorChecking), errorChecking);
|
|
2940
|
+
throw error;
|
|
2941
|
+
});
|
|
2942
|
+
};
|
|
2943
|
+
RegistroComponent.prototype.setDefaultValue = function (value) {
|
|
2944
|
+
var _a;
|
|
2945
|
+
var data = null;
|
|
2946
|
+
if (value.key && ((_a = this.sfCrudService.currentOperation) === null || _a === void 0 ? void 0 : _a.keys)) {
|
|
2947
|
+
data = this.sfCrudService.getValueKey(this.sfCrudService.currentOperation.keys.find(function (k) { return k.key == value.key; }));
|
|
2948
|
+
value = data;
|
|
2949
|
+
}
|
|
2950
|
+
else {
|
|
2951
|
+
switch (value) {
|
|
2952
|
+
case '@uactivo':
|
|
2953
|
+
data = this.user.UsuarioSistema.TDOC + "-" + this.user.UsuarioSistema.NDOC;
|
|
2954
|
+
break;
|
|
2955
|
+
case '@tdocactivo':
|
|
2956
|
+
data = this.user.UsuarioSistema.TDOC;
|
|
2957
|
+
break;
|
|
2958
|
+
case '@ndocactivo':
|
|
2959
|
+
data = this.user.UsuarioSistema.NDOC;
|
|
2960
|
+
break;
|
|
2961
|
+
case '@hoy':
|
|
2962
|
+
data = new Date();
|
|
2963
|
+
break;
|
|
2964
|
+
default:
|
|
2965
|
+
data = value;
|
|
2966
|
+
break;
|
|
2967
|
+
}
|
|
2968
|
+
return data;
|
|
2969
|
+
}
|
|
2970
|
+
};
|
|
2971
|
+
Object.defineProperty(RegistroComponent.prototype, "indexCrud", {
|
|
2972
|
+
get: function () {
|
|
2973
|
+
return this.stepService.currentIndex;
|
|
2974
|
+
},
|
|
2975
|
+
enumerable: false,
|
|
2976
|
+
configurable: true
|
|
2977
|
+
});
|
|
2978
|
+
RegistroComponent.prototype.primeChecking = function () {
|
|
2979
|
+
return new RequestChecking(undefined, undefined, false, undefined, undefined, false, undefined);
|
|
2980
|
+
};
|
|
2981
|
+
RegistroComponent.prototype.submit = function (index) {
|
|
2982
|
+
var _this = this;
|
|
2983
|
+
this.sfCrudService.applyValuesOnEvent('onSubmit', this.sfCrudService.getEsquema(index), undefined, this.sfCrudService.getData(index));
|
|
2984
|
+
var registro = this.sfCrudService.getRegistro(index);
|
|
2985
|
+
console.log("trx actual: ", this.sfCrudService.getTrx(this.indexCrud));
|
|
2986
|
+
var operation = registro.operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
|
|
2987
|
+
var url = this.sfCrudService.getURL(operation, index);
|
|
2988
|
+
return this.generalService.genericRequest(operation.method, url, this.sfCrudService.getData(index))
|
|
2989
|
+
.then(function (res) {
|
|
2990
|
+
if (res === null)
|
|
2991
|
+
res = {};
|
|
2992
|
+
res = _this.sfCrudService.applyObjectKeys(res, operation.keysEsquema || [], registro);
|
|
2993
|
+
_this.sfCrudService.setAnswers(res, _this.indexCrud);
|
|
2994
|
+
if (operation.changeTrx)
|
|
2995
|
+
operation.changeTrx.forEach(function (x) { return _this.sfCrudService.setTrx(x.trx, x.index); });
|
|
2996
|
+
_this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("success", undefined, "Información subida correctamente", operation.answerChecking), res, operation.answerChecking), operation.answerChecking);
|
|
2997
|
+
return res;
|
|
2998
|
+
})
|
|
2999
|
+
.catch(function (err) {
|
|
3000
|
+
_this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("error", "Error no controlado", "Por favor comunicarse con el admin", operation.errorChecking), err.error, operation.errorChecking), operation.errorChecking);
|
|
3001
|
+
throw new Error(err);
|
|
3002
|
+
});
|
|
3003
|
+
// return Promise.resolve({})
|
|
3004
|
+
};
|
|
3005
|
+
RegistroComponent.prototype.onCloseAddItem = function (index) {
|
|
3006
|
+
var scope = this.dialogElements[index].scope.replaceAll('.properties', '');
|
|
3007
|
+
var item = ___namespace.cloneDeep(this.dialogElements[index].data);
|
|
3008
|
+
if (index == 0) {
|
|
3009
|
+
jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope)[0].push(item);
|
|
3010
|
+
}
|
|
3011
|
+
else
|
|
3012
|
+
jsonpath__namespace.query(this.dialogElements[index - 1].data, scope)[0].push(item);
|
|
3013
|
+
};
|
|
3014
|
+
RegistroComponent.prototype.deleteRow = function (element, indexElement) {
|
|
3015
|
+
var scope = element.scope.replaceAll('.properties', '');
|
|
3016
|
+
var indexDialog = this.dialogElements.length - 1;
|
|
3017
|
+
if (indexDialog == -1)
|
|
3018
|
+
jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope)[0].splice(indexElement, 1);
|
|
3019
|
+
else {
|
|
3020
|
+
indexDialog = indexDialog == 0 ? 1 : indexDialog;
|
|
3021
|
+
jsonpath__namespace.query(this.dialogElements[indexDialog - 1].data, scope)[0].splice(indexElement, 1);
|
|
3022
|
+
}
|
|
3023
|
+
this.sfCrudService.applyValuesOnEvent('onChange', this.sfCrudService.getEsquema(this.indexCrud), element.scope.replace('$..properties.', ''), this.sfCrudService.getData(this.indexCrud));
|
|
3024
|
+
};
|
|
3025
|
+
RegistroComponent.prototype.onCloseEditRow = function (index) {
|
|
3026
|
+
var scope = undefined;
|
|
3027
|
+
try {
|
|
3028
|
+
var iArray = this.dialogElements[index].index;
|
|
3029
|
+
scope = this.dialogElements[index].scope.replaceAll('.properties', '');
|
|
3030
|
+
var item = ___namespace.cloneDeep(this.dialogElements[index].data);
|
|
3031
|
+
if (index == 0) {
|
|
3032
|
+
jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope)[0][iArray] = item;
|
|
3033
|
+
}
|
|
3034
|
+
else {
|
|
3035
|
+
jsonpath__namespace.query(this.dialogElements[index - 1].data, scope)[0][iArray] = item;
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
catch (error) {
|
|
3039
|
+
console.error(error);
|
|
3040
|
+
console.log(this.dialogElements);
|
|
3041
|
+
console.log(index);
|
|
3042
|
+
console.log(scope);
|
|
3043
|
+
console.log(this.indexCrud);
|
|
3044
|
+
console.log(this.sfCrudService.getData(this.indexCrud));
|
|
3045
|
+
if (index == 0 && scope) {
|
|
3046
|
+
console.log(jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope));
|
|
3047
|
+
}
|
|
3048
|
+
else if (scope) {
|
|
3049
|
+
console.log(jsonpath__namespace.query(this.dialogElements[index - 1].data, scope));
|
|
3050
|
+
}
|
|
3051
|
+
throw error;
|
|
3052
|
+
}
|
|
3053
|
+
};
|
|
3054
|
+
RegistroComponent.prototype.validateData = function (operation, data, conditions, printErrors) {
|
|
3055
|
+
if (printErrors === void 0) { printErrors = true; }
|
|
3056
|
+
var _a;
|
|
3057
|
+
if (((_a = operation === null || operation === void 0 ? void 0 : operation.validations) === null || _a === void 0 ? void 0 : _a.type) == 'local') {
|
|
3058
|
+
var err = this.sfCrudService.validateDataLocal(operation, data, conditions);
|
|
3059
|
+
if (err.length != 0 && printErrors)
|
|
3060
|
+
this.notificationService.addNotification({ severity: 'warn', detail: err.slice(0, 5).join('. ') }, this.primeChecking());
|
|
3061
|
+
return err.length == 0;
|
|
3062
|
+
}
|
|
3063
|
+
return true;
|
|
3064
|
+
};
|
|
3065
|
+
RegistroComponent.prototype.onConfirm = function () {
|
|
3066
|
+
this.messageService.clear('c');
|
|
3067
|
+
};
|
|
3068
|
+
RegistroComponent.prototype.onReject = function () {
|
|
3069
|
+
this.messageService.clear('c');
|
|
3070
|
+
};
|
|
3071
|
+
RegistroComponent.prototype.onClickedEditButton = function (element, data, index) {
|
|
3072
|
+
this.dialogOperation = "u";
|
|
3073
|
+
var esquema = ___namespace.cloneDeep(this.sfCrudService.getControl(element.scope, this.sfCrudService.getEsquema(this.indexCrud)));
|
|
3074
|
+
esquema.type = "object";
|
|
3075
|
+
var currentElement = {
|
|
3076
|
+
data: ___namespace.cloneDeep(data),
|
|
3077
|
+
uiEsquema: ___namespace.cloneDeep(element.elements[0]),
|
|
3078
|
+
esquema: esquema,
|
|
3079
|
+
scope: element.scope,
|
|
3080
|
+
index: index
|
|
3081
|
+
};
|
|
3082
|
+
this.displays.push(true);
|
|
3083
|
+
this.dialogElements.push(currentElement);
|
|
3084
|
+
};
|
|
3085
|
+
RegistroComponent.prototype.onClickedAddButton = function (element) {
|
|
3086
|
+
var _this = this;
|
|
3087
|
+
this.dialogOperation = "c";
|
|
3088
|
+
var esquema = ___namespace.cloneDeep(this.sfCrudService.getControl(element.scope, this.sfCrudService.getEsquema(this.indexCrud)));
|
|
3089
|
+
var op = this.sfCrudService.registros[this.indexCrud].operations.find(function (x) { return x.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
|
|
3090
|
+
esquema.type = "object";
|
|
3091
|
+
var currentElement = {
|
|
3092
|
+
data: this.sfCrudService.createObject(esquema, op),
|
|
3093
|
+
uiEsquema: ___namespace.cloneDeep(element.elements[0]),
|
|
3094
|
+
esquema: esquema,
|
|
3095
|
+
scope: element.scope,
|
|
3096
|
+
index: 0
|
|
3097
|
+
};
|
|
3098
|
+
try {
|
|
3099
|
+
currentElement.data.id = this.sfCrudService.getValue(element.scope, this.sfCrudService.getData(this.indexCrud)).length + 1;
|
|
3100
|
+
}
|
|
3101
|
+
catch (error) {
|
|
3102
|
+
console.log("error agregando un id");
|
|
3103
|
+
console.error(error);
|
|
3104
|
+
}
|
|
3105
|
+
this.displays.push(true);
|
|
3106
|
+
this.dialogElements.push(currentElement);
|
|
3107
|
+
};
|
|
3108
|
+
RegistroComponent.prototype.onCloseDialog = function (index) {
|
|
3109
|
+
var validated = true;
|
|
3110
|
+
if (this.dialogElements[index].esquema.validations) {
|
|
3111
|
+
var op = new Operation();
|
|
3112
|
+
op.validations = this.dialogElements[index].esquema.validations;
|
|
3113
|
+
validated = this.validateData(op, this.dialogElements[index].data, this.sfCrudService.getRegistro(this.indexCrud).conditions || []);
|
|
3114
|
+
}
|
|
3115
|
+
console.log(this.dialogElements[index].esquema);
|
|
3116
|
+
if (validated) {
|
|
3117
|
+
switch (this.dialogOperation) {
|
|
3118
|
+
case "c":
|
|
3119
|
+
this.onCloseAddItem(index);
|
|
3120
|
+
break;
|
|
3121
|
+
case "u":
|
|
3122
|
+
this.onCloseEditRow(index);
|
|
3123
|
+
break;
|
|
3124
|
+
}
|
|
3125
|
+
this.removeDialogItem();
|
|
3126
|
+
}
|
|
3127
|
+
};
|
|
3128
|
+
RegistroComponent.prototype.removeDialogItem = function () {
|
|
3129
|
+
this.dialogElements.pop();
|
|
3130
|
+
this.displays.pop();
|
|
3131
|
+
};
|
|
3132
|
+
RegistroComponent.prototype.setLabelSumbit = function () {
|
|
3133
|
+
var x = { "c": { label: 'Guardar', icon: 'pi pi-save' },
|
|
3134
|
+
"u": { label: 'Actualizar', icon: 'pi pi-sync' },
|
|
3135
|
+
"d": { label: 'Eliminar', icon: 'pi pi-trash' }
|
|
3136
|
+
};
|
|
3137
|
+
this.btnSubmit = x[this.sfCrudService.getTrx(0)];
|
|
3138
|
+
};
|
|
3139
|
+
RegistroComponent.prototype.back = function () {
|
|
3140
|
+
this.router.navigateByUrl(this.sfCrudService.registros[0].btnBack);
|
|
3141
|
+
};
|
|
1943
3142
|
return RegistroComponent;
|
|
1944
3143
|
}());
|
|
1945
|
-
RegistroComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, deps: [{ token: GeneralService }, { token: i2__namespace.
|
|
1946
|
-
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", dataExt: "dataExt" }, outputs: { sendData: "sendData", onSubmit: "onSubmit" }, providers: [i2$1.MessageService, i1$1.DialogService, i1$1.DynamicDialogConfig, i1$1.DynamicDialogRef], ngImport: i0__namespace, template: "<p-blockUI [blocked]=\"enProceso\">\r\n <i class=\"pi pi-cog pi-spin\" style=\"font-size: 50px\"></i>\r\n</p-blockUI>\r\n\r\n<p-toast></p-toast>\r\n\r\n<div class=\"card\" *ngIf=\"!enProceso && controlsLoaded\">\r\n <h5 class=\"card-header mb-2\" style=\"display: flex; justify-content: space-between;align-items: center;\">\r\n <span>{{crudConfig.registro?.label || idEntidad}} {{id != '' ? '-' + id : ''}}</span>\r\n <button *ngIf=\"crudConfig.registro?.canBack\" pButton pRipple type=\"button\" icon=\"pi pi-arrow-left\" (click)=\"back()\"></button>\r\n </h5>\r\n <div *ngFor=\"let element of crudConfig.uiEsquema.elements; let i = index\" [class]=\"element?.class\">\r\n <ng-container [ngSwitch]=\"element.type\">\r\n <div *ngSwitchCase=\"'Label'\" [style]=\"element?.style\">\r\n {{element?.label}}\r\n </div>\r\n <ng-container *ngSwitchCase=\"'HorizontalLayout'\">\r\n <div *ngFor=\"let el of element.elements;let j = index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\"\r\n [value]=\"values[i][j]\" (setValue)=\"setValue($event, el.scope, i, j)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'VerticalLayout'\">\r\n <div *ngFor=\"let el of element.elements;let j = index\" [class]=\"el?.class\">\r\n <ng-container [ngSwitch]=\"el.type\">\r\n <sf-control *ngSwitchCase=\"'Control'\" [control]=\"controls[i][j]\" [label]=\"el.label\"\r\n [value]=\"values[i][j]\" (setValue)=\"setValue($event, el.scope, i, j)\"\r\n (sendNotification)=\"sendNotification($event)\" (sendObject)=\"applyValuesFromObject($event)\"></sf-control>\r\n <ng-container *ngSwitchCase=\"'Table'\">\r\n <p-table [value]=\"getValue(el.scope)\" [columns]=\"getControl(el.scope).config.columns\">\r\n <ng-template pTemplate=\"caption\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <button pButton pRipple icon=\"pi pi-plus\" (click)=\"addObjectArray(el)\"\r\n class=\"p-button-success\"></button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n {{col.label}}\r\n </th>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <th></th>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-rowIndex=\"rowIndex\">\r\n <tr>\r\n <ng-container *ngFor=\"let col of columns\" [ngSwitch]=\"col.type\">\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <td>{{rowData[col.col]}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'currency:USD'\">\r\n <td>{{rowData[col.col] | currency: 'USD'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:yyyy-mm-dd'\">\r\n <td>{{rowData[col.col] | date: 'yyyy-mm-dd'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date:dd/mm/yyyy'\">\r\n <td>{{rowData[col.col] | date: 'dd/MM/yyyy'}}</td>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <td>\r\n <i *ngIf=\"rowData[col.col]\" class=\"pi pi-check\"></i>\r\n <i *ngIf=\"!rowData[col.col]\" class=\"pi pi-times\"></i>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"trx == 'c' || trx == 'u'\">\r\n <td>\r\n <button pButton pRipple type=\"button\" (click)=\"editRow(el, rowData, rowIndex)\" icon=\"pi pi-pencil\" class=\"p-button-rounded p-button-info mr-1\"></button>\r\n <button pButton pRipple type=\"button\" (click)=\"deleteRow(el, rowIndex)\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-danger\"></button>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'Control'\">\r\n <sf-control [control]=\"getControl(element.scope)\" [label]=\"element.label\"></sf-control>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <div class=\"card-footer mt-2\" *ngIf=\"btnSubmit\">\r\n <button pButton pRipple type=\"button\" [icon]=\"btnSubmit.icon\" [label]=\"btnSubmit.label\"\r\n (click)=\"submit()\"></button>\r\n </div>\r\n</div>\r\n", components: [{ type: i3__namespace.BlockUI, selector: "p-blockUI", inputs: ["target", "autoZIndex", "baseZIndex", "styleClass", "blocked"] }, { type: i3__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: ControlComponent, selector: "sf-control", inputs: ["control", "label", "value", "appendTo"], outputs: ["setValue", "sendNotification", "sendObject"] }, { type: i5__namespace.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection"], outputs: ["selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i10__namespace.Ripple, selector: "[pRipple]" }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "currency": i7__namespace.CurrencyPipe, "date": i7__namespace.DatePipe } });
|
|
3144
|
+
RegistroComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, deps: [{ token: GeneralService }, { token: i2__namespace.ActivatedRoute }, { token: i1__namespace$1.MessageService }, { token: SfCrudService }, { token: StepService }, { token: i6__namespace$2.SfPdfsignService }, { token: i7__namespace$1.SfSimuladorService }, { token: NotificationService }, { token: i2__namespace.Router }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3145
|
+
RegistroComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RegistroComponent, selector: "sf-registro", inputs: { idKatios: "idKatios", trx: "trx", id: "id", user: "user", dataExt: "dataExt", ids: "ids", environment: "environment", buttonsFooterTemplate: "buttonsFooterTemplate", idEntidad: "idEntidad" }, outputs: { sendData: "sendData", onSubmit: "onSubmit" }, host: { properties: { "style.--primary-color": "this.color", "style.--secondary-color": "this.color2", "style.--button-color": "this.colorButton" } }, providers: [i1$1.MessageService], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"card\">\r\n <!--TODO convertir en template y editarla en -->\r\n <h5 *ngIf=\"sfCrudService.registros.length == 1\" class=\"card-header mb-2\" style=\"display: flex; justify-content: space-between;align-items: center;\">\r\n <span>{{sfCrudService.registros[0]?.label || idForm.replaceAll('_', ' ')}} {{ids.length > 0 ? '-' + ids[0] : ''}}</span>\r\n <button *ngIf=\"sfCrudService.registros[0]?.canBack\" pButton pRipple type=\"button\" icon=\"pi pi-arrow-left\" (click)=\"back()\"></button>\r\n </h5>\r\n <div *ngIf=\"items.length > 1\">\r\n <app-step [items]=\"items\"></app-step>\r\n </div>\r\n <div *ngIf=\"items.length == 1\">\r\n <app-form [data]=\"sfCrudService.dataset[0]\" [esquema]=\"sfCrudService.esquemas[0]\"\r\n [uiEsquema]=\"sfCrudService.uiEsquemas[0]\" [isDialog]=\"false\"></app-form>\r\n\r\n <!--renderizar un codigo personalizado desde el componente padre o renderizar el que se tiene por defecto-->\r\n <ng-container *ngTemplateOutlet=\"buttonsFooterTemplate || defaultButtonsFooterTemplate\"></ng-container>\r\n <ng-template #defaultButtonsFooterTemplate>\r\n <div class=\"card-footer mt-2\" *ngIf=\"btnSubmit\">\r\n <button pButton pRipple type=\"button\" [icon]=\"btnSubmit.icon\" [label]=\"btnSubmit.label\" (click)=\"onClickBtnSubmit()\"></button>\r\n </div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n\r\n<span *ngFor=\"let item of dialogElements; let $index=index\">\r\n <p-dialog [(visible)]=\"displays[$index]\" [modal]=\"true\" [header]=\"'Detalle'\" [closable]=\"false\">\r\n <!-- TODO header = currentElement.element.label ? currentElement.element.label: -->\r\n <app-form [data]=\"item.data\" [esquema]=\"item.esquema\" [uiEsquema]=\"item.uiEsquema\" [isDialog]=\"true\"\r\n [id]=\"ids[indexCrud]\"></app-form>\r\n <ng-template pTemplate=\"footer\">\r\n <p-button icon=\"pi pi-times\" (onClick)=\"removeDialogItem()\" label=\"Cancelar\" ></p-button>\r\n <p-button icon=\"pi pi-check\" [disabled]=\"item.esquema.disabled === true\" (onClick)=\"onCloseDialog($index)\" label=\"Ok\" pAutoFocus\r\n [autofocus]=\"true\"></p-button>\r\n </ng-template>\r\n </p-dialog>\r\n</span>\r\n\r\n<p-toast *ngIf=\"dialogElements.length == 0\">\r\n <ng-template let-message pTemplate=\"message\">\r\n <div class=\"custom-toast\">\r\n <i class=\"pi\" [ngClass]=\"{\r\n 'pi-check-circle': message.severity === 'success',\r\n 'pi-info-circle': message.severity === 'info',\r\n 'pi-exclamation-triangle': message.severity === 'warn',\r\n 'pi-times-circle': message.severity === 'error'\r\n }\"></i>\r\n <div class=\"custom-toast-content\">\r\n <span class=\"custom-toast-detail\">{{message.detail}}</span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-toast>\r\n\r\n\r\n", styles: ["@media screen and (max-width: 600px){::ng-deep .p-toast{width:90vw!important;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:1}::ng-deep .p-dialog-mask .p-dialog{width:95vw}}@media screen and (min-width: 601px){::ng-deep .p-toast{width:25rem!important;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:1}}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.custom-toast{padding:8px;display:-webkit-box;z-index:inherit;justify-content:center;width:100%}.custom-toast-detail{display:flex;font-family:sans-serif;font-size:1.05rem;font-weight:400;margin:.5rem 0 0 .5rem;width:80%}.custom-toast i{margin-right:.5rem;font-size:2rem;width:100%;height:100%}::ng-deep .p-toast-message{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}::ng-deep .p-toast .p-toast-message.p-toast-message-info{background:#B3E5FC;border:solid #0891cf;color:#0891cf;border-width:0 0 0 6px}::ng-deep .p-toast .p-toast-message{border-radius:6px}::ng-deep .p-toast .p-toast-message.p-toast-message-warn{background:rgba(255,242,226,.7);border:solid #cc8925;color:#cc8925;border-width:0 0 0 6px}::ng-deep .p-toast .p-toast-message.p-toast-message-error{background:#FFCDD2;border:solid #e60017;color:#e60017;border-width:0 0 0 6px}::ng-deep .p-toast .p-toast-message.p-toast-message-success{background:#C8E6C9;border:solid #439446;color:#439446;border-width:0 0 0 6px}::ng-deep .p-toast .p-toast-message .p-toast-icon-close{margin-top:1rem;margin-right:1.5rem}::ng-deep .p-toast .p-toast-message.p-toast-message-warn .p-toast-icon-close{color:#cc8925}::ng-deep .p-toast .p-toast-message.p-toast-message-info .p-toast-icon-close{color:#0891cf}::ng-deep .p-toast .p-toast-message.p-toast-message-error .p-toast-icon-close{color:#e60017}::ng-deep .p-toast .p-toast-message.p-toast-message-succes .p-toast-icon-close{color:#439446}\n"], components: [{ type: StepComponent, selector: "app-step", inputs: ["items"] }, { type: FormComponent, selector: "app-form", inputs: ["uiEsquema", "esquema", "data", "isDialog"] }, { type: i11__namespace$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i9__namespace.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i11__namespace$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }], directives: [{ type: i12__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i11__namespace.Ripple, selector: "[pRipple]" }, { type: i12__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i12__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i12__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1947
3146
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, decorators: [{
|
|
1948
3147
|
type: i0.Component,
|
|
1949
3148
|
args: [{
|
|
1950
3149
|
selector: 'sf-registro',
|
|
1951
3150
|
templateUrl: './registro.component.html',
|
|
1952
|
-
providers: [
|
|
1953
|
-
entryComponents: [RegistroComponent]
|
|
3151
|
+
providers: [i1$1.MessageService],
|
|
3152
|
+
entryComponents: [RegistroComponent],
|
|
3153
|
+
styleUrls: ['./registro.component.css']
|
|
1954
3154
|
}]
|
|
1955
|
-
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.
|
|
1956
|
-
type: i0.
|
|
1957
|
-
|
|
3155
|
+
}], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.ActivatedRoute }, { type: i1__namespace$1.MessageService }, { type: SfCrudService }, { type: StepService }, { type: i6__namespace$2.SfPdfsignService }, { type: i7__namespace$1.SfSimuladorService }, { type: NotificationService }, { type: i2__namespace.Router }]; }, propDecorators: { color: [{
|
|
3156
|
+
type: i0.HostBinding,
|
|
3157
|
+
args: ["style.--primary-color"]
|
|
3158
|
+
}], color2: [{
|
|
3159
|
+
type: i0.HostBinding,
|
|
3160
|
+
args: ["style.--secondary-color"]
|
|
3161
|
+
}], colorButton: [{
|
|
3162
|
+
type: i0.HostBinding,
|
|
3163
|
+
args: ["style.--button-color"]
|
|
3164
|
+
}], idKatios: [{
|
|
1958
3165
|
type: i0.Input
|
|
1959
3166
|
}], trx: [{
|
|
1960
3167
|
type: i0.Input
|
|
@@ -1964,10 +3171,18 @@
|
|
|
1964
3171
|
type: i0.Input
|
|
1965
3172
|
}], dataExt: [{
|
|
1966
3173
|
type: i0.Input
|
|
3174
|
+
}], ids: [{
|
|
3175
|
+
type: i0.Input
|
|
3176
|
+
}], environment: [{
|
|
3177
|
+
type: i0.Input
|
|
3178
|
+
}], buttonsFooterTemplate: [{
|
|
3179
|
+
type: i0.Input
|
|
1967
3180
|
}], sendData: [{
|
|
1968
3181
|
type: i0.Output
|
|
1969
3182
|
}], onSubmit: [{
|
|
1970
3183
|
type: i0.Output
|
|
3184
|
+
}], idEntidad: [{
|
|
3185
|
+
type: i0.Input
|
|
1971
3186
|
}] } });
|
|
1972
3187
|
|
|
1973
3188
|
var SfCrudComponent = /** @class */ (function () {
|
|
@@ -1988,6 +3203,27 @@
|
|
|
1988
3203
|
}]
|
|
1989
3204
|
}], ctorParameters: function () { return []; } });
|
|
1990
3205
|
|
|
3206
|
+
var routes = [
|
|
3207
|
+
{ path: ':idStep',
|
|
3208
|
+
component: FormComponent
|
|
3209
|
+
}
|
|
3210
|
+
];
|
|
3211
|
+
var SfCrudRoutingModule = /** @class */ (function () {
|
|
3212
|
+
function SfCrudRoutingModule() {
|
|
3213
|
+
}
|
|
3214
|
+
return SfCrudRoutingModule;
|
|
3215
|
+
}());
|
|
3216
|
+
SfCrudRoutingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudRoutingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3217
|
+
SfCrudRoutingModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudRoutingModule, imports: [i2__namespace.RouterModule], exports: [i2.RouterModule] });
|
|
3218
|
+
SfCrudRoutingModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudRoutingModule, imports: [[i2.RouterModule.forChild(routes)], i2.RouterModule] });
|
|
3219
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudRoutingModule, decorators: [{
|
|
3220
|
+
type: i0.NgModule,
|
|
3221
|
+
args: [{
|
|
3222
|
+
imports: [i2.RouterModule.forChild(routes)],
|
|
3223
|
+
exports: [i2.RouterModule]
|
|
3224
|
+
}]
|
|
3225
|
+
}] });
|
|
3226
|
+
|
|
1991
3227
|
var SfCrudModule = /** @class */ (function () {
|
|
1992
3228
|
function SfCrudModule() {
|
|
1993
3229
|
}
|
|
@@ -1998,16 +3234,20 @@
|
|
|
1998
3234
|
TableroComponent,
|
|
1999
3235
|
RegistroComponent,
|
|
2000
3236
|
ControlComponent,
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
3237
|
+
StepComponent,
|
|
3238
|
+
FormComponent,
|
|
3239
|
+
FileUploadComponent], imports: [SfCrudRoutingModule,
|
|
3240
|
+
i6$2.SfPdfsignModule,
|
|
3241
|
+
i7$1.SfSimuladorModule,
|
|
3242
|
+
accordion.AccordionModule,
|
|
3243
|
+
i6$1.AutoCompleteModule,
|
|
2004
3244
|
avatargroup.AvatarGroupModule,
|
|
2005
3245
|
avatar.AvatarModule,
|
|
2006
3246
|
badge.BadgeModule,
|
|
2007
|
-
|
|
3247
|
+
blockui.BlockUIModule,
|
|
2008
3248
|
breadcrumb.BreadcrumbModule,
|
|
2009
3249
|
i9.ButtonModule,
|
|
2010
|
-
|
|
3250
|
+
i8.CalendarModule,
|
|
2011
3251
|
card.CardModule,
|
|
2012
3252
|
carousel.CarouselModule,
|
|
2013
3253
|
cascadeselect.CascadeSelectModule,
|
|
@@ -2018,29 +3258,28 @@
|
|
|
2018
3258
|
confirmdialog.ConfirmDialogModule,
|
|
2019
3259
|
confirmpopup.ConfirmPopupModule,
|
|
2020
3260
|
contextmenu.ContextMenuModule,
|
|
2021
|
-
|
|
3261
|
+
i11$3.DialogModule,
|
|
2022
3262
|
divider.DividerModule,
|
|
2023
|
-
|
|
2024
|
-
|
|
3263
|
+
i5$1.DropdownModule,
|
|
3264
|
+
dynamicdialog.DynamicDialogModule,
|
|
2025
3265
|
fieldset.FieldsetModule,
|
|
2026
|
-
|
|
2027
|
-
|
|
3266
|
+
fileupload.FileUploadModule,
|
|
3267
|
+
i14.FormsModule,
|
|
2028
3268
|
galleria.GalleriaModule,
|
|
2029
3269
|
i1.HttpClientModule,
|
|
2030
3270
|
inplace.InplaceModule,
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
3271
|
+
i4.InputMaskModule,
|
|
3272
|
+
i9$1.InputNumberModule,
|
|
3273
|
+
i11$1.InputSwitchModule,
|
|
3274
|
+
i16.InputTextareaModule,
|
|
3275
|
+
i12$1.InputTextModule,
|
|
2036
3276
|
knob.KnobModule,
|
|
2037
3277
|
listbox.ListboxModule,
|
|
2038
3278
|
megamenu.MegaMenuModule,
|
|
2039
3279
|
menubar.MenubarModule,
|
|
2040
3280
|
menu.MenuModule,
|
|
2041
3281
|
message.MessageModule,
|
|
2042
|
-
|
|
2043
|
-
multiselect.MultiSelectModule,
|
|
3282
|
+
i10.MultiSelectModule,
|
|
2044
3283
|
organizationchart.OrganizationChartModule,
|
|
2045
3284
|
overlaypanel.OverlayPanelModule,
|
|
2046
3285
|
panelmenu.PanelMenuModule,
|
|
@@ -2049,7 +3288,7 @@
|
|
|
2049
3288
|
progressbar.ProgressBarModule,
|
|
2050
3289
|
radiobutton.RadioButtonModule,
|
|
2051
3290
|
rating.RatingModule,
|
|
2052
|
-
|
|
3291
|
+
i11.RippleModule,
|
|
2053
3292
|
scrollpanel.ScrollPanelModule,
|
|
2054
3293
|
scrolltop.ScrollTopModule,
|
|
2055
3294
|
selectbutton.SelectButtonModule,
|
|
@@ -2057,34 +3296,38 @@
|
|
|
2057
3296
|
skeleton.SkeletonModule,
|
|
2058
3297
|
slidemenu.SlideMenuModule,
|
|
2059
3298
|
slider.SliderModule,
|
|
2060
|
-
|
|
3299
|
+
i7.SplitButtonModule,
|
|
2061
3300
|
splitter.SplitterModule,
|
|
2062
|
-
|
|
2063
|
-
|
|
3301
|
+
i3.StepsModule,
|
|
3302
|
+
i6.TableModule,
|
|
2064
3303
|
tabmenu.TabMenuModule,
|
|
2065
3304
|
tabview.TabViewModule,
|
|
2066
3305
|
tag.TagModule,
|
|
2067
3306
|
terminal.TerminalModule,
|
|
2068
3307
|
tieredmenu.TieredMenuModule,
|
|
2069
3308
|
timeline.TimelineModule,
|
|
2070
|
-
|
|
3309
|
+
i11$2.ToastModule,
|
|
2071
3310
|
togglebutton.ToggleButtonModule,
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
tree.TreeModule
|
|
3311
|
+
i5.ToolbarModule,
|
|
3312
|
+
i13.TooltipModule,
|
|
3313
|
+
tree.TreeModule,
|
|
3314
|
+
i5$2.SfAdoModule], exports: [SfCrudComponent,
|
|
2075
3315
|
TableroComponent,
|
|
2076
3316
|
RegistroComponent,
|
|
2077
3317
|
ControlComponent] });
|
|
2078
3318
|
SfCrudModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, imports: [[
|
|
3319
|
+
SfCrudRoutingModule,
|
|
3320
|
+
i6$2.SfPdfsignModule,
|
|
3321
|
+
i7$1.SfSimuladorModule,
|
|
2079
3322
|
accordion.AccordionModule,
|
|
2080
|
-
|
|
3323
|
+
i6$1.AutoCompleteModule,
|
|
2081
3324
|
avatargroup.AvatarGroupModule,
|
|
2082
3325
|
avatar.AvatarModule,
|
|
2083
3326
|
badge.BadgeModule,
|
|
2084
|
-
|
|
3327
|
+
blockui.BlockUIModule,
|
|
2085
3328
|
breadcrumb.BreadcrumbModule,
|
|
2086
3329
|
i9.ButtonModule,
|
|
2087
|
-
|
|
3330
|
+
i8.CalendarModule,
|
|
2088
3331
|
card.CardModule,
|
|
2089
3332
|
carousel.CarouselModule,
|
|
2090
3333
|
cascadeselect.CascadeSelectModule,
|
|
@@ -2095,29 +3338,28 @@
|
|
|
2095
3338
|
confirmdialog.ConfirmDialogModule,
|
|
2096
3339
|
confirmpopup.ConfirmPopupModule,
|
|
2097
3340
|
contextmenu.ContextMenuModule,
|
|
2098
|
-
|
|
3341
|
+
i11$3.DialogModule,
|
|
2099
3342
|
divider.DividerModule,
|
|
2100
|
-
|
|
2101
|
-
|
|
3343
|
+
i5$1.DropdownModule,
|
|
3344
|
+
dynamicdialog.DynamicDialogModule,
|
|
2102
3345
|
fieldset.FieldsetModule,
|
|
2103
|
-
|
|
2104
|
-
|
|
3346
|
+
fileupload.FileUploadModule,
|
|
3347
|
+
i14.FormsModule,
|
|
2105
3348
|
galleria.GalleriaModule,
|
|
2106
3349
|
i1.HttpClientModule,
|
|
2107
3350
|
inplace.InplaceModule,
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
3351
|
+
i4.InputMaskModule,
|
|
3352
|
+
i9$1.InputNumberModule,
|
|
3353
|
+
i11$1.InputSwitchModule,
|
|
3354
|
+
i16.InputTextareaModule,
|
|
3355
|
+
i12$1.InputTextModule,
|
|
2113
3356
|
knob.KnobModule,
|
|
2114
3357
|
listbox.ListboxModule,
|
|
2115
3358
|
megamenu.MegaMenuModule,
|
|
2116
3359
|
menubar.MenubarModule,
|
|
2117
3360
|
menu.MenuModule,
|
|
2118
3361
|
message.MessageModule,
|
|
2119
|
-
|
|
2120
|
-
multiselect.MultiSelectModule,
|
|
3362
|
+
i10.MultiSelectModule,
|
|
2121
3363
|
organizationchart.OrganizationChartModule,
|
|
2122
3364
|
overlaypanel.OverlayPanelModule,
|
|
2123
3365
|
panelmenu.PanelMenuModule,
|
|
@@ -2126,7 +3368,7 @@
|
|
|
2126
3368
|
progressbar.ProgressBarModule,
|
|
2127
3369
|
radiobutton.RadioButtonModule,
|
|
2128
3370
|
rating.RatingModule,
|
|
2129
|
-
|
|
3371
|
+
i11.RippleModule,
|
|
2130
3372
|
scrollpanel.ScrollPanelModule,
|
|
2131
3373
|
scrolltop.ScrollTopModule,
|
|
2132
3374
|
selectbutton.SelectButtonModule,
|
|
@@ -2134,21 +3376,22 @@
|
|
|
2134
3376
|
skeleton.SkeletonModule,
|
|
2135
3377
|
slidemenu.SlideMenuModule,
|
|
2136
3378
|
slider.SliderModule,
|
|
2137
|
-
|
|
3379
|
+
i7.SplitButtonModule,
|
|
2138
3380
|
splitter.SplitterModule,
|
|
2139
|
-
|
|
2140
|
-
|
|
3381
|
+
i3.StepsModule,
|
|
3382
|
+
i6.TableModule,
|
|
2141
3383
|
tabmenu.TabMenuModule,
|
|
2142
3384
|
tabview.TabViewModule,
|
|
2143
3385
|
tag.TagModule,
|
|
2144
3386
|
terminal.TerminalModule,
|
|
2145
3387
|
tieredmenu.TieredMenuModule,
|
|
2146
3388
|
timeline.TimelineModule,
|
|
2147
|
-
|
|
3389
|
+
i11$2.ToastModule,
|
|
2148
3390
|
togglebutton.ToggleButtonModule,
|
|
2149
|
-
|
|
2150
|
-
|
|
3391
|
+
i5.ToolbarModule,
|
|
3392
|
+
i13.TooltipModule,
|
|
2151
3393
|
tree.TreeModule,
|
|
3394
|
+
i5$2.SfAdoModule
|
|
2152
3395
|
]] });
|
|
2153
3396
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, decorators: [{
|
|
2154
3397
|
type: i0.NgModule,
|
|
@@ -2158,19 +3401,23 @@
|
|
|
2158
3401
|
TableroComponent,
|
|
2159
3402
|
RegistroComponent,
|
|
2160
3403
|
ControlComponent,
|
|
2161
|
-
|
|
2162
|
-
|
|
3404
|
+
StepComponent,
|
|
3405
|
+
FormComponent,
|
|
3406
|
+
FileUploadComponent
|
|
2163
3407
|
],
|
|
2164
3408
|
imports: [
|
|
3409
|
+
SfCrudRoutingModule,
|
|
3410
|
+
i6$2.SfPdfsignModule,
|
|
3411
|
+
i7$1.SfSimuladorModule,
|
|
2165
3412
|
accordion.AccordionModule,
|
|
2166
|
-
|
|
3413
|
+
i6$1.AutoCompleteModule,
|
|
2167
3414
|
avatargroup.AvatarGroupModule,
|
|
2168
3415
|
avatar.AvatarModule,
|
|
2169
3416
|
badge.BadgeModule,
|
|
2170
|
-
|
|
3417
|
+
blockui.BlockUIModule,
|
|
2171
3418
|
breadcrumb.BreadcrumbModule,
|
|
2172
3419
|
i9.ButtonModule,
|
|
2173
|
-
|
|
3420
|
+
i8.CalendarModule,
|
|
2174
3421
|
card.CardModule,
|
|
2175
3422
|
carousel.CarouselModule,
|
|
2176
3423
|
cascadeselect.CascadeSelectModule,
|
|
@@ -2181,29 +3428,28 @@
|
|
|
2181
3428
|
confirmdialog.ConfirmDialogModule,
|
|
2182
3429
|
confirmpopup.ConfirmPopupModule,
|
|
2183
3430
|
contextmenu.ContextMenuModule,
|
|
2184
|
-
|
|
3431
|
+
i11$3.DialogModule,
|
|
2185
3432
|
divider.DividerModule,
|
|
2186
|
-
|
|
2187
|
-
|
|
3433
|
+
i5$1.DropdownModule,
|
|
3434
|
+
dynamicdialog.DynamicDialogModule,
|
|
2188
3435
|
fieldset.FieldsetModule,
|
|
2189
|
-
|
|
2190
|
-
|
|
3436
|
+
fileupload.FileUploadModule,
|
|
3437
|
+
i14.FormsModule,
|
|
2191
3438
|
galleria.GalleriaModule,
|
|
2192
3439
|
i1.HttpClientModule,
|
|
2193
3440
|
inplace.InplaceModule,
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
3441
|
+
i4.InputMaskModule,
|
|
3442
|
+
i9$1.InputNumberModule,
|
|
3443
|
+
i11$1.InputSwitchModule,
|
|
3444
|
+
i16.InputTextareaModule,
|
|
3445
|
+
i12$1.InputTextModule,
|
|
2199
3446
|
knob.KnobModule,
|
|
2200
3447
|
listbox.ListboxModule,
|
|
2201
3448
|
megamenu.MegaMenuModule,
|
|
2202
3449
|
menubar.MenubarModule,
|
|
2203
3450
|
menu.MenuModule,
|
|
2204
3451
|
message.MessageModule,
|
|
2205
|
-
|
|
2206
|
-
multiselect.MultiSelectModule,
|
|
3452
|
+
i10.MultiSelectModule,
|
|
2207
3453
|
organizationchart.OrganizationChartModule,
|
|
2208
3454
|
overlaypanel.OverlayPanelModule,
|
|
2209
3455
|
panelmenu.PanelMenuModule,
|
|
@@ -2212,7 +3458,7 @@
|
|
|
2212
3458
|
progressbar.ProgressBarModule,
|
|
2213
3459
|
radiobutton.RadioButtonModule,
|
|
2214
3460
|
rating.RatingModule,
|
|
2215
|
-
|
|
3461
|
+
i11.RippleModule,
|
|
2216
3462
|
scrollpanel.ScrollPanelModule,
|
|
2217
3463
|
scrolltop.ScrollTopModule,
|
|
2218
3464
|
selectbutton.SelectButtonModule,
|
|
@@ -2220,30 +3466,28 @@
|
|
|
2220
3466
|
skeleton.SkeletonModule,
|
|
2221
3467
|
slidemenu.SlideMenuModule,
|
|
2222
3468
|
slider.SliderModule,
|
|
2223
|
-
|
|
3469
|
+
i7.SplitButtonModule,
|
|
2224
3470
|
splitter.SplitterModule,
|
|
2225
|
-
|
|
2226
|
-
|
|
3471
|
+
i3.StepsModule,
|
|
3472
|
+
i6.TableModule,
|
|
2227
3473
|
tabmenu.TabMenuModule,
|
|
2228
3474
|
tabview.TabViewModule,
|
|
2229
3475
|
tag.TagModule,
|
|
2230
3476
|
terminal.TerminalModule,
|
|
2231
3477
|
tieredmenu.TieredMenuModule,
|
|
2232
3478
|
timeline.TimelineModule,
|
|
2233
|
-
|
|
3479
|
+
i11$2.ToastModule,
|
|
2234
3480
|
togglebutton.ToggleButtonModule,
|
|
2235
|
-
|
|
2236
|
-
|
|
3481
|
+
i5.ToolbarModule,
|
|
3482
|
+
i13.TooltipModule,
|
|
2237
3483
|
tree.TreeModule,
|
|
3484
|
+
i5$2.SfAdoModule
|
|
2238
3485
|
],
|
|
2239
3486
|
exports: [
|
|
2240
3487
|
SfCrudComponent,
|
|
2241
3488
|
TableroComponent,
|
|
2242
3489
|
RegistroComponent,
|
|
2243
3490
|
ControlComponent
|
|
2244
|
-
],
|
|
2245
|
-
entryComponents: [
|
|
2246
|
-
RegistroChildComponent
|
|
2247
3491
|
]
|
|
2248
3492
|
}]
|
|
2249
3493
|
}] });
|
|
@@ -2256,12 +3500,28 @@
|
|
|
2256
3500
|
* Generated bundle index. Do not edit.
|
|
2257
3501
|
*/
|
|
2258
3502
|
|
|
3503
|
+
exports.ChangeData = ChangeData;
|
|
3504
|
+
exports.ConfigRegistro = ConfigRegistro;
|
|
3505
|
+
exports.ConfigTablero = ConfigTablero;
|
|
3506
|
+
exports.ConstructionId = ConstructionId;
|
|
2259
3507
|
exports.ControlComponent = ControlComponent;
|
|
3508
|
+
exports.CrudConfig = CrudConfig;
|
|
3509
|
+
exports.FormComponent = FormComponent;
|
|
3510
|
+
exports.Key = Key;
|
|
3511
|
+
exports.Notification = Notification;
|
|
3512
|
+
exports.NotificationService = NotificationService;
|
|
3513
|
+
exports.Operation = Operation;
|
|
3514
|
+
exports.OverrideConfig = OverrideConfig;
|
|
2260
3515
|
exports.RegistroComponent = RegistroComponent;
|
|
3516
|
+
exports.RequestChecking = RequestChecking;
|
|
2261
3517
|
exports.SfCrudComponent = SfCrudComponent;
|
|
2262
3518
|
exports.SfCrudModule = SfCrudModule;
|
|
2263
3519
|
exports.SfCrudService = SfCrudService;
|
|
3520
|
+
exports.Shema = Shema;
|
|
3521
|
+
exports.StepService = StepService;
|
|
2264
3522
|
exports.TableroComponent = TableroComponent;
|
|
3523
|
+
exports.Validations = Validations;
|
|
3524
|
+
exports.keyEsquema = keyEsquema;
|
|
2265
3525
|
|
|
2266
3526
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2267
3527
|
|