sf-crud 12.3.3 → 13.0.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.
Files changed (49) hide show
  1. package/fesm2022/sf-crud.mjs +3254 -0
  2. package/fesm2022/sf-crud.mjs.map +1 -0
  3. package/{sf-crud.d.ts → index.d.ts} +5 -5
  4. package/lib/components/control/control.component.d.ts +67 -67
  5. package/lib/components/file-upload/file-upload.component.d.ts +34 -34
  6. package/lib/components/form/form.component.d.ts +63 -63
  7. package/lib/components/registro/registro.component.d.ts +109 -109
  8. package/lib/components/step/step.component.d.ts +27 -27
  9. package/lib/components/tablero/tablero.component.d.ts +53 -52
  10. package/lib/directives/format-address.pipe.d.ts +7 -7
  11. package/lib/sf-crud.component.d.ts +8 -8
  12. package/lib/sf-crud.module.d.ts +94 -90
  13. package/lib/sf-crud.routing.module.d.ts +7 -7
  14. package/lib/sf-crud.service.d.ts +135 -135
  15. package/lib/shared/models/Conditions.model.d.ts +32 -32
  16. package/lib/shared/models/Empresa.model.d.ts +11 -11
  17. package/lib/shared/models/Reason.model.d.ts +5 -5
  18. package/lib/shared/models/crud-config.model.d.ts +109 -110
  19. package/lib/shared/models/shema.model.d.ts +37 -37
  20. package/lib/shared/services/general.service.d.ts +20 -20
  21. package/lib/shared/services/notification.service.d.ts +26 -27
  22. package/lib/shared/services/step.service.d.ts +27 -27
  23. package/package.json +20 -15
  24. package/public-api.d.ts +12 -12
  25. package/bundles/sf-crud.umd.js +0 -3795
  26. package/bundles/sf-crud.umd.js.map +0 -1
  27. package/esm2015/lib/components/control/control.component.js +0 -403
  28. package/esm2015/lib/components/file-upload/file-upload.component.js +0 -143
  29. package/esm2015/lib/components/form/form.component.js +0 -289
  30. package/esm2015/lib/components/registro/registro.component.js +0 -757
  31. package/esm2015/lib/components/step/step.component.js +0 -79
  32. package/esm2015/lib/components/tablero/tablero.component.js +0 -220
  33. package/esm2015/lib/directives/format-address.pipe.js +0 -22
  34. package/esm2015/lib/sf-crud.component.js +0 -26
  35. package/esm2015/lib/sf-crud.module.js +0 -359
  36. package/esm2015/lib/sf-crud.routing.module.js +0 -23
  37. package/esm2015/lib/sf-crud.service.js +0 -531
  38. package/esm2015/lib/shared/models/Conditions.model.js +0 -81
  39. package/esm2015/lib/shared/models/Empresa.model.js +0 -2
  40. package/esm2015/lib/shared/models/Reason.model.js +0 -7
  41. package/esm2015/lib/shared/models/crud-config.model.js +0 -76
  42. package/esm2015/lib/shared/models/shema.model.js +0 -11
  43. package/esm2015/lib/shared/services/general.service.js +0 -74
  44. package/esm2015/lib/shared/services/notification.service.js +0 -83
  45. package/esm2015/lib/shared/services/step.service.js +0 -63
  46. package/esm2015/public-api.js +0 -16
  47. package/esm2015/sf-crud.js +0 -5
  48. package/fesm2015/sf-crud.js +0 -3143
  49. package/fesm2015/sf-crud.js.map +0 -1
@@ -1,3795 +0,0 @@
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('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
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var ___namespace = /*#__PURE__*/_interopNamespace(_);
29
- var jsonpath__namespace = /*#__PURE__*/_interopNamespace(jsonpath);
30
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
31
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
32
- var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
33
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
34
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
35
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
36
- var i12__namespace = /*#__PURE__*/_interopNamespace(i12);
37
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
38
- var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
39
- var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
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);
46
- var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
47
- var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
48
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
49
- var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
50
- var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
51
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
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);
59
-
60
- /******************************************************************************
61
- Copyright (c) Microsoft Corporation.
62
-
63
- Permission to use, copy, modify, and/or distribute this software for any
64
- purpose with or without fee is hereby granted.
65
-
66
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
67
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
68
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
69
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
70
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
71
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
72
- PERFORMANCE OF THIS SOFTWARE.
73
- ***************************************************************************** */
74
- /* global Reflect, Promise */
75
- var extendStatics = function (d, b) {
76
- extendStatics = Object.setPrototypeOf ||
77
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
78
- function (d, b) { for (var p in b)
79
- if (Object.prototype.hasOwnProperty.call(b, p))
80
- d[p] = b[p]; };
81
- return extendStatics(d, b);
82
- };
83
- function __extends(d, b) {
84
- if (typeof b !== "function" && b !== null)
85
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
86
- extendStatics(d, b);
87
- function __() { this.constructor = d; }
88
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
89
- }
90
- var __assign = function () {
91
- __assign = Object.assign || function __assign(t) {
92
- for (var s, i = 1, n = arguments.length; i < n; i++) {
93
- s = arguments[i];
94
- for (var p in s)
95
- if (Object.prototype.hasOwnProperty.call(s, p))
96
- t[p] = s[p];
97
- }
98
- return t;
99
- };
100
- return __assign.apply(this, arguments);
101
- };
102
- function __rest(s, e) {
103
- var t = {};
104
- for (var p in s)
105
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
106
- t[p] = s[p];
107
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
108
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
109
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
110
- t[p[i]] = s[p[i]];
111
- }
112
- return t;
113
- }
114
- function __decorate(decorators, target, key, desc) {
115
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
116
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
117
- r = Reflect.decorate(decorators, target, key, desc);
118
- else
119
- for (var i = decorators.length - 1; i >= 0; i--)
120
- if (d = decorators[i])
121
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
122
- return c > 3 && r && Object.defineProperty(target, key, r), r;
123
- }
124
- function __param(paramIndex, decorator) {
125
- return function (target, key) { decorator(target, key, paramIndex); };
126
- }
127
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
128
- function accept(f) { if (f !== void 0 && typeof f !== "function")
129
- throw new TypeError("Function expected"); return f; }
130
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
131
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
132
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
133
- var _, done = false;
134
- for (var i = decorators.length - 1; i >= 0; i--) {
135
- var context = {};
136
- for (var p in contextIn)
137
- context[p] = p === "access" ? {} : contextIn[p];
138
- for (var p in contextIn.access)
139
- context.access[p] = contextIn.access[p];
140
- context.addInitializer = function (f) { if (done)
141
- throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
142
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
143
- if (kind === "accessor") {
144
- if (result === void 0)
145
- continue;
146
- if (result === null || typeof result !== "object")
147
- throw new TypeError("Object expected");
148
- if (_ = accept(result.get))
149
- descriptor.get = _;
150
- if (_ = accept(result.set))
151
- descriptor.set = _;
152
- if (_ = accept(result.init))
153
- initializers.unshift(_);
154
- }
155
- else if (_ = accept(result)) {
156
- if (kind === "field")
157
- initializers.unshift(_);
158
- else
159
- descriptor[key] = _;
160
- }
161
- }
162
- if (target)
163
- Object.defineProperty(target, contextIn.name, descriptor);
164
- done = true;
165
- }
166
- ;
167
- function __runInitializers(thisArg, initializers, value) {
168
- var useValue = arguments.length > 2;
169
- for (var i = 0; i < initializers.length; i++) {
170
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
171
- }
172
- return useValue ? value : void 0;
173
- }
174
- ;
175
- function __propKey(x) {
176
- return typeof x === "symbol" ? x : "".concat(x);
177
- }
178
- ;
179
- function __setFunctionName(f, name, prefix) {
180
- if (typeof name === "symbol")
181
- name = name.description ? "[".concat(name.description, "]") : "";
182
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
183
- }
184
- ;
185
- function __metadata(metadataKey, metadataValue) {
186
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
187
- return Reflect.metadata(metadataKey, metadataValue);
188
- }
189
- function __awaiter(thisArg, _arguments, P, generator) {
190
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
191
- return new (P || (P = Promise))(function (resolve, reject) {
192
- function fulfilled(value) { try {
193
- step(generator.next(value));
194
- }
195
- catch (e) {
196
- reject(e);
197
- } }
198
- function rejected(value) { try {
199
- step(generator["throw"](value));
200
- }
201
- catch (e) {
202
- reject(e);
203
- } }
204
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
205
- step((generator = generator.apply(thisArg, _arguments || [])).next());
206
- });
207
- }
208
- function __generator(thisArg, body) {
209
- var _ = { label: 0, sent: function () { if (t[0] & 1)
210
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
211
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
212
- function verb(n) { return function (v) { return step([n, v]); }; }
213
- function step(op) {
214
- if (f)
215
- throw new TypeError("Generator is already executing.");
216
- while (g && (g = 0, op[0] && (_ = 0)), _)
217
- try {
218
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
219
- return t;
220
- if (y = 0, t)
221
- op = [op[0] & 2, t.value];
222
- switch (op[0]) {
223
- case 0:
224
- case 1:
225
- t = op;
226
- break;
227
- case 4:
228
- _.label++;
229
- return { value: op[1], done: false };
230
- case 5:
231
- _.label++;
232
- y = op[1];
233
- op = [0];
234
- continue;
235
- case 7:
236
- op = _.ops.pop();
237
- _.trys.pop();
238
- continue;
239
- default:
240
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
241
- _ = 0;
242
- continue;
243
- }
244
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
245
- _.label = op[1];
246
- break;
247
- }
248
- if (op[0] === 6 && _.label < t[1]) {
249
- _.label = t[1];
250
- t = op;
251
- break;
252
- }
253
- if (t && _.label < t[2]) {
254
- _.label = t[2];
255
- _.ops.push(op);
256
- break;
257
- }
258
- if (t[2])
259
- _.ops.pop();
260
- _.trys.pop();
261
- continue;
262
- }
263
- op = body.call(thisArg, _);
264
- }
265
- catch (e) {
266
- op = [6, e];
267
- y = 0;
268
- }
269
- finally {
270
- f = t = 0;
271
- }
272
- if (op[0] & 5)
273
- throw op[1];
274
- return { value: op[0] ? op[1] : void 0, done: true };
275
- }
276
- }
277
- var __createBinding = Object.create ? (function (o, m, k, k2) {
278
- if (k2 === undefined)
279
- k2 = k;
280
- var desc = Object.getOwnPropertyDescriptor(m, k);
281
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
282
- desc = { enumerable: true, get: function () { return m[k]; } };
283
- }
284
- Object.defineProperty(o, k2, desc);
285
- }) : (function (o, m, k, k2) {
286
- if (k2 === undefined)
287
- k2 = k;
288
- o[k2] = m[k];
289
- });
290
- function __exportStar(m, o) {
291
- for (var p in m)
292
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
293
- __createBinding(o, m, p);
294
- }
295
- function __values(o) {
296
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
297
- if (m)
298
- return m.call(o);
299
- if (o && typeof o.length === "number")
300
- return {
301
- next: function () {
302
- if (o && i >= o.length)
303
- o = void 0;
304
- return { value: o && o[i++], done: !o };
305
- }
306
- };
307
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
308
- }
309
- function __read(o, n) {
310
- var m = typeof Symbol === "function" && o[Symbol.iterator];
311
- if (!m)
312
- return o;
313
- var i = m.call(o), r, ar = [], e;
314
- try {
315
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
316
- ar.push(r.value);
317
- }
318
- catch (error) {
319
- e = { error: error };
320
- }
321
- finally {
322
- try {
323
- if (r && !r.done && (m = i["return"]))
324
- m.call(i);
325
- }
326
- finally {
327
- if (e)
328
- throw e.error;
329
- }
330
- }
331
- return ar;
332
- }
333
- /** @deprecated */
334
- function __spread() {
335
- for (var ar = [], i = 0; i < arguments.length; i++)
336
- ar = ar.concat(__read(arguments[i]));
337
- return ar;
338
- }
339
- /** @deprecated */
340
- function __spreadArrays() {
341
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
342
- s += arguments[i].length;
343
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
344
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
345
- r[k] = a[j];
346
- return r;
347
- }
348
- function __spreadArray(to, from, pack) {
349
- if (pack || arguments.length === 2)
350
- for (var i = 0, l = from.length, ar; i < l; i++) {
351
- if (ar || !(i in from)) {
352
- if (!ar)
353
- ar = Array.prototype.slice.call(from, 0, i);
354
- ar[i] = from[i];
355
- }
356
- }
357
- return to.concat(ar || Array.prototype.slice.call(from));
358
- }
359
- function __await(v) {
360
- return this instanceof __await ? (this.v = v, this) : new __await(v);
361
- }
362
- function __asyncGenerator(thisArg, _arguments, generator) {
363
- if (!Symbol.asyncIterator)
364
- throw new TypeError("Symbol.asyncIterator is not defined.");
365
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
366
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
367
- function verb(n) { if (g[n])
368
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
369
- function resume(n, v) { try {
370
- step(g[n](v));
371
- }
372
- catch (e) {
373
- settle(q[0][3], e);
374
- } }
375
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
376
- function fulfill(value) { resume("next", value); }
377
- function reject(value) { resume("throw", value); }
378
- function settle(f, v) { if (f(v), q.shift(), q.length)
379
- resume(q[0][0], q[0][1]); }
380
- }
381
- function __asyncDelegator(o) {
382
- var i, p;
383
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
384
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
385
- }
386
- function __asyncValues(o) {
387
- if (!Symbol.asyncIterator)
388
- throw new TypeError("Symbol.asyncIterator is not defined.");
389
- var m = o[Symbol.asyncIterator], i;
390
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
391
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
392
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
393
- }
394
- function __makeTemplateObject(cooked, raw) {
395
- if (Object.defineProperty) {
396
- Object.defineProperty(cooked, "raw", { value: raw });
397
- }
398
- else {
399
- cooked.raw = raw;
400
- }
401
- return cooked;
402
- }
403
- ;
404
- var __setModuleDefault = Object.create ? (function (o, v) {
405
- Object.defineProperty(o, "default", { enumerable: true, value: v });
406
- }) : function (o, v) {
407
- o["default"] = v;
408
- };
409
- function __importStar(mod) {
410
- if (mod && mod.__esModule)
411
- return mod;
412
- var result = {};
413
- if (mod != null)
414
- for (var k in mod)
415
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
416
- __createBinding(result, mod, k);
417
- __setModuleDefault(result, mod);
418
- return result;
419
- }
420
- function __importDefault(mod) {
421
- return (mod && mod.__esModule) ? mod : { default: mod };
422
- }
423
- function __classPrivateFieldGet(receiver, state, kind, f) {
424
- if (kind === "a" && !f)
425
- throw new TypeError("Private accessor was defined without a getter");
426
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
427
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
428
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
429
- }
430
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
431
- if (kind === "m")
432
- throw new TypeError("Private method is not writable");
433
- if (kind === "a" && !f)
434
- throw new TypeError("Private accessor was defined without a setter");
435
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
436
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
437
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
438
- }
439
- function __classPrivateFieldIn(state, receiver) {
440
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
441
- throw new TypeError("Cannot use 'in' operator on non-object");
442
- return typeof state === "function" ? receiver === state : state.has(receiver);
443
- }
444
- var tslib_es6 = {
445
- __extends: __extends,
446
- __assign: __assign,
447
- __rest: __rest,
448
- __decorate: __decorate,
449
- __param: __param,
450
- __metadata: __metadata,
451
- __awaiter: __awaiter,
452
- __generator: __generator,
453
- __createBinding: __createBinding,
454
- __exportStar: __exportStar,
455
- __values: __values,
456
- __read: __read,
457
- __spread: __spread,
458
- __spreadArrays: __spreadArrays,
459
- __spreadArray: __spreadArray,
460
- __await: __await,
461
- __asyncGenerator: __asyncGenerator,
462
- __asyncDelegator: __asyncDelegator,
463
- __asyncValues: __asyncValues,
464
- __makeTemplateObject: __makeTemplateObject,
465
- __importStar: __importStar,
466
- __importDefault: __importDefault,
467
- __classPrivateFieldGet: __classPrivateFieldGet,
468
- __classPrivateFieldSet: __classPrivateFieldSet,
469
- __classPrivateFieldIn: __classPrivateFieldIn,
470
- };
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
-
575
- var GeneralService = /** @class */ (function () {
576
- function GeneralService(http) {
577
- this.http = http;
578
- this.generales = '';
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
- });
604
- GeneralService.prototype.getCrudByEntidad = function (idKatios, idEntidad) {
605
- return __awaiter(this, void 0, void 0, function () {
606
- return __generator(this, function (_b) {
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
- }); }))];
631
- });
632
- });
633
- };
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) {
642
- return __awaiter(this, void 0, void 0, function () {
643
- return __generator(this, function (_b) {
644
- switch (method) {
645
- case 'GET':
646
- return [2 /*return*/, this.http.get(url).toPromise()];
647
- case 'POST':
648
- return [2 /*return*/, this.http.post(url, data).toPromise()];
649
- case 'PUT':
650
- return [2 /*return*/, this.http.put(url, data).toPromise()];
651
- case 'DELETE':
652
- return [2 /*return*/, this.http.delete(url, data).toPromise()];
653
- default:
654
- throw new Error("Invalid method");
655
- }
656
- return [2 /*return*/];
657
- });
658
- });
659
- };
660
- return GeneralService;
661
- }());
662
- GeneralService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GeneralService, deps: [{ token: i1__namespace.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
663
- GeneralService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GeneralService, providedIn: 'root' });
664
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: GeneralService, decorators: [{
665
- type: i0.Injectable,
666
- args: [{
667
- providedIn: 'root'
668
- }]
669
- }], ctorParameters: function () { return [{ type: i1__namespace.HttpClient }]; } });
670
-
671
- var Condition = /** @class */ (function () {
672
- function Condition(type, attrs, indexData) {
673
- this.type = type;
674
- this.attrs = attrs;
675
- this.indexData = indexData;
676
- }
677
- Condition.instanceContidion = function (index, allConditions) {
678
- var _this = this;
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
- this._mascaras = [];
780
- }
781
- Object.defineProperty(SfCrudService.prototype, "user", {
782
- get: function () {
783
- if (!this._tfmUser)
784
- this._tfmUser = JSON.parse(localStorage.getItem("oSessionTFM"));
785
- return this._tfmUser;
786
- },
787
- enumerable: false,
788
- configurable: true
789
- });
790
- Object.defineProperty(SfCrudService.prototype, "currentOperation", {
791
- get: function () {
792
- var _this = this;
793
- return this.registros[this.index].operations.find(function (x) { return x.type.startsWith(_this._trx[_this.index]); });
794
- },
795
- enumerable: false,
796
- configurable: true
797
- });
798
- Object.defineProperty(SfCrudService.prototype, "environment", {
799
- get: function () {
800
- return this.jsonConfig;
801
- },
802
- set: function (val) {
803
- this.jsonConfig = val;
804
- },
805
- enumerable: false,
806
- configurable: true
807
- });
808
- Object.defineProperty(SfCrudService.prototype, "onCrudLoaded$", {
809
- get: function () {
810
- return this._crudLoaded.asObservable();
811
- },
812
- enumerable: false,
813
- configurable: true
814
- });
815
- Object.defineProperty(SfCrudService.prototype, "crudLoaded", {
816
- set: function (value) {
817
- this._crudLoaded.next(value);
818
- },
819
- enumerable: false,
820
- configurable: true
821
- });
822
- Object.defineProperty(SfCrudService.prototype, "dataExt", {
823
- get: function () {
824
- return this._dataExt;
825
- },
826
- set: function (val) {
827
- this._dataExt = val;
828
- },
829
- enumerable: false,
830
- configurable: true
831
- });
832
- Object.defineProperty(SfCrudService.prototype, "index", {
833
- get: function () {
834
- return this.__index;
835
- },
836
- set: function (value) {
837
- this.__index = value;
838
- },
839
- enumerable: false,
840
- configurable: true
841
- });
842
- Object.defineProperty(SfCrudService.prototype, "idKatios", {
843
- get: function () {
844
- return this._idKatios;
845
- },
846
- set: function (value) {
847
- var _a;
848
- this._idKatios = (_a = value === null || value === void 0 ? void 0 : value.trim()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
849
- },
850
- enumerable: false,
851
- configurable: true
852
- });
853
- Object.defineProperty(SfCrudService.prototype, "configEmpresa", {
854
- get: function () {
855
- return this._configEmpresa;
856
- },
857
- set: function (value) {
858
- this._configEmpresa = value;
859
- },
860
- enumerable: false,
861
- configurable: true
862
- });
863
- Object.defineProperty(SfCrudService.prototype, "mascaras", {
864
- get: function () {
865
- return this._mascaras;
866
- },
867
- set: function (mascaras) {
868
- this._mascaras = mascaras;
869
- },
870
- enumerable: false,
871
- configurable: true
872
- });
873
- SfCrudService.prototype.getURL = function (operation, index, id) {
874
- if (index === void 0) { index = undefined; }
875
- if (id === void 0) { id = undefined; }
876
- var url = operation.url || "" + this.jsonConfig[operation.server] + operation.endpoint;
877
- url = url.replace('@idKatios', this.idKatios);
878
- if (id)
879
- url = url.replace('@id', id);
880
- url = this.applyStringKeys(url, index);
881
- return url;
882
- };
883
- SfCrudService.prototype.getRegistro = function (index) {
884
- return this._registros[index];
885
- };
886
- SfCrudService.prototype.getId = function (index) {
887
- return this._ids.length == 1 ? this._ids[0] : this._ids[index];
888
- };
889
- Object.defineProperty(SfCrudService.prototype, "dataset", {
890
- get: function () {
891
- return this._dataSet;
892
- },
893
- enumerable: false,
894
- configurable: true
895
- });
896
- SfCrudService.prototype.getData = function (index) {
897
- return this._dataSet.length == 1 ? this._dataSet[0] : this._dataSet[index];
898
- };
899
- SfCrudService.prototype.getTrx = function (index) {
900
- return this._trx[index];
901
- };
902
- Object.defineProperty(SfCrudService.prototype, "totalData", {
903
- get: function () {
904
- return this._dataSet.length;
905
- },
906
- enumerable: false,
907
- configurable: true
908
- });
909
- Object.defineProperty(SfCrudService.prototype, "totalRegistros", {
910
- get: function () {
911
- return this._registros.length;
912
- },
913
- enumerable: false,
914
- configurable: true
915
- });
916
- Object.defineProperty(SfCrudService.prototype, "uiEsquemas", {
917
- get: function () {
918
- return this._uiEsquemas;
919
- },
920
- set: function (uiEsquemas) {
921
- this._uiEsquemas = uiEsquemas;
922
- },
923
- enumerable: false,
924
- configurable: true
925
- });
926
- SfCrudService.prototype.getEsquema = function (index) {
927
- return this._esquemas.length == 1 ? this._esquemas[0] : this._esquemas[index];
928
- };
929
- SfCrudService.prototype.reset = function () {
930
- this._ids = [];
931
- this._dataSet = [];
932
- };
933
- SfCrudService.prototype.getURLRedirect = function (initialURL) {
934
- var finalUrl = this.applyStringKeys(initialURL, undefined);
935
- finalUrl = finalUrl.replace("@URLBASE", window.location.href.split('?')[0]);
936
- return finalUrl;
937
- };
938
- SfCrudService.prototype.getUIEsquema = function (index) {
939
- return this._uiEsquemas[index];
940
- };
941
- /**
942
- * using data, apply each keyEsquema over each dataset indicated on indexData of each key
943
- * @param data
944
- * @param content
945
- * @returns
946
- */
947
- SfCrudService.prototype.applyObjectKeys = function (data, keysEsquema, registro) {
948
- var _a;
949
- for (var i = 0; i < keysEsquema.length; i++) {
950
- var opt = keysEsquema[i];
951
- var value = undefined;
952
- if (opt.indexKey) {
953
- var keyFound = ((_a = registro.keys) !== null && _a !== void 0 ? _a : [undefined])[opt.indexKey];
954
- this.applyKey(keyFound, registro, data);
955
- }
956
- else if (opt.indexData !== undefined) {
957
- if (opt.isArray) {
958
- value = jsonpath__namespace.query(data, opt.scope);
959
- }
960
- else {
961
- value = jsonpath__namespace.query(data, opt.scope)[0];
962
- }
963
- }
964
- if (opt.key == "$")
965
- Object.assign(this._dataSet[opt.indexData], value);
966
- else if (opt.key && ((value !== undefined && value !== null) || (opt.canBeValueUndefined === undefined || opt.canBeValueUndefined === true)))
967
- jsonpath__namespace.value(this._dataSet[opt.indexData], opt.key, value);
968
- }
969
- return data;
970
- };
971
- SfCrudService.prototype.applyKey = function (key, registro, data) {
972
- var _a, _b, _c, _d;
973
- if (key === null || key === void 0 ? void 0 : key.overrideControl) {
974
- var newVal = undefined;
975
- var esquemaToSet = this.getControl(key.scope, this.esquemas[(_a = key.indexData) !== null && _a !== void 0 ? _a : this.index]);
976
- if (!esquemaToSet) {
977
- console.error({ message: "la key esta mal configurada", data: key });
978
- return;
979
- }
980
- var completed = this.isConditionsCompleted((_b = key.overrideControl.conditions) !== null && _b !== void 0 ? _b : [], registro.conditions || [], data);
981
- if ((_c = key.overrideControl) === null || _c === void 0 ? void 0 : _c.property)
982
- jsonpath__namespace.value(esquemaToSet, key.overrideControl.property, completed ? key.overrideControl.value : key.overrideControl.elseValue);
983
- if (completed && key.overrideControl.newPropertyValue !== undefined) {
984
- if (key.overrideControl.newPropertyValue == 'RESETOBJECT')
985
- newVal = this.createObject(esquemaToSet, this.currentOperation);
986
- else
987
- newVal = key.overrideControl.newPropertyValue;
988
- }
989
- else if (!completed && key.overrideControl.elseNewPropertyValue !== undefined) {
990
- if (key.overrideControl.elseNewPropertyValue == 'RESETOBJECT')
991
- newVal = this.createObject(esquemaToSet, this.currentOperation);
992
- else
993
- newVal = key.overrideControl.elseNewPropertyValue;
994
- }
995
- if (newVal !== undefined)
996
- jsonpath__namespace.value(this._dataSet[(_d = key.indexData) !== null && _d !== void 0 ? _d : this.index], key.scope.replaceAll('..properties', ''), newVal);
997
- }
998
- };
999
- /**
1000
- * Validate conditions on datas
1001
- * @param conditions
1002
- * @param index
1003
- */
1004
- SfCrudService.prototype.isConditionsCompleted = function (iConditions, conditions, data) {
1005
- var _this = this;
1006
- var cumple = true;
1007
- iConditions.forEach(function (iCond) {
1008
- var c = Condition.instanceContidion(iCond, conditions);
1009
- var dataToEvaluate = c.indexData !== undefined ? _this._dataSet[c.indexData] : data;
1010
- if (!c.isValid(dataToEvaluate))
1011
- cumple = false;
1012
- });
1013
- return cumple;
1014
- };
1015
- /**
1016
- * Apply each key from register over string content
1017
- * @param indexRegistro
1018
- * @param content
1019
- * @returns
1020
- */
1021
- SfCrudService.prototype.applyStringKeys = function (content, index) {
1022
- var _this = this;
1023
- if (index === void 0) { index = undefined; }
1024
- var _a;
1025
- var indexRegistro = index || this.__index;
1026
- (_a = this._registros[indexRegistro].keys) === null || _a === void 0 ? void 0 : _a.forEach(function (opt) {
1027
- var value;
1028
- if (opt.indexId !== undefined && opt.indexId < _this._ids.length)
1029
- value = _this._ids[opt.indexId];
1030
- else if (opt.indexAnswer !== undefined && opt.indexAnswer < _this._answers.length)
1031
- value = jsonpath__namespace.query(_this._answers[opt.indexAnswer], opt.scope)[0];
1032
- else if (opt.indexData !== undefined)
1033
- value = jsonpath__namespace.query(_this._dataSet[opt.indexData], opt.scope)[0];
1034
- if (value === null)
1035
- value = '';
1036
- content = content.replace(opt.key, value);
1037
- });
1038
- return content;
1039
- };
1040
- SfCrudService.prototype.validateDataLocal = function (operation, data, conditions) {
1041
- var _this = this;
1042
- var _a, _b, _c, _d, _e, _f, _g, _h;
1043
- var err = [];
1044
- //Solo si se cumple la condicion, se valida
1045
- (_b = (_a = operation.validations) === null || _a === void 0 ? void 0 : _a.required) === null || _b === void 0 ? void 0 : _b.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] ||
1048
- (Array.isArray(jsonpath__namespace.query(data, x.field)[0]) && jsonpath__namespace.query(data, x.field)[0].length == 0)))
1049
- err.push(x.message);
1050
- });
1051
- (_d = (_c = operation.validations) === null || _c === void 0 ? void 0 : _c.different) === null || _d === void 0 ? void 0 : _d.forEach(function (x) {
1052
- var cumpleCond = x.conditions ? _this.isConditionsCompleted(x.conditions, conditions, data) : true;
1053
- if (cumpleCond && jsonpath__namespace.query(data, x.field)[0] === x.value)
1054
- err.push(x.message);
1055
- });
1056
- (_f = (_e = operation.validations) === null || _e === void 0 ? void 0 : _e.equals) === null || _f === void 0 ? void 0 : _f.forEach(function (x) {
1057
- var cumpleCond = x.conditions ? _this.isConditionsCompleted(x.conditions, conditions, data) : true;
1058
- if (cumpleCond && jsonpath__namespace.query(data, x.field)[0] != x.value)
1059
- err.push(x.message);
1060
- });
1061
- (_h = (_g = operation.validations) === null || _g === void 0 ? void 0 : _g.operations) === null || _h === void 0 ? void 0 : _h.forEach(function (op) {
1062
- switch (op.action) {
1063
- case 'sumArray':
1064
- var var1 = jsonpath__namespace.query(data, op.scope[0]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
1065
- var var2 = jsonpath__namespace.query(data, op.scope[1]).reduce(function (acc, cur) { return acc += cur[op.key]; }, 0);
1066
- if (var1 != var2)
1067
- err.push(op.message);
1068
- break;
1069
- default:
1070
- break;
1071
- }
1072
- });
1073
- return err;
1074
- };
1075
- Object.defineProperty(SfCrudService.prototype, "esquemas", {
1076
- get: function () {
1077
- return this._esquemas;
1078
- },
1079
- set: function (esquemas) {
1080
- this._esquemas = esquemas;
1081
- },
1082
- enumerable: false,
1083
- configurable: true
1084
- });
1085
- Object.defineProperty(SfCrudService.prototype, "ids", {
1086
- set: function (ids) {
1087
- this._ids = ids;
1088
- },
1089
- enumerable: false,
1090
- configurable: true
1091
- });
1092
- Object.defineProperty(SfCrudService.prototype, "registros", {
1093
- get: function () {
1094
- return this._registros;
1095
- },
1096
- set: function (registros) {
1097
- this._registros = registros;
1098
- },
1099
- enumerable: false,
1100
- configurable: true
1101
- });
1102
- SfCrudService.prototype.setDataSet = function (data, index) {
1103
- if (index === void 0) { index = undefined; }
1104
- index = index ? index : this.__index;
1105
- if (index >= this.totalData) {
1106
- this._dataSet.push(data);
1107
- }
1108
- };
1109
- SfCrudService.prototype.setTrx = function (trx, index) {
1110
- if (Array.isArray(trx))
1111
- this._trx = trx;
1112
- else if (index >= this._trx.length)
1113
- this._trx.push(trx);
1114
- else
1115
- this._trx[index] = trx;
1116
- };
1117
- SfCrudService.prototype.setAnswers = function (answer, index) {
1118
- if (Array.isArray(answer))
1119
- this._answers = answer;
1120
- else {
1121
- if (index >= this._answers.length)
1122
- this._answers.push(answer);
1123
- else
1124
- this._answers[index] = answer;
1125
- }
1126
- };
1127
- SfCrudService.prototype.getControl = function (scope, esquema) {
1128
- return jsonpath__namespace.query(esquema, scope)[0];
1129
- };
1130
- SfCrudService.prototype.getValue = function (scope, data) {
1131
- return jsonpath__namespace.query(data, scope.replaceAll('.properties', ''))[0];
1132
- };
1133
- SfCrudService.prototype.createObject = function (esquema, operation) {
1134
- var _this = this;
1135
- var _a;
1136
- var object = {};
1137
- switch (esquema.type) {
1138
- case 'numeric':
1139
- case 'string':
1140
- case 'date':
1141
- if (esquema.default && operation) {
1142
- return this.setDefaultValue(esquema.default, operation);
1143
- }
1144
- else
1145
- return (_a = esquema.default) !== null && _a !== void 0 ? _a : null;
1146
- case 'boolean':
1147
- return (esquema === null || esquema === void 0 ? void 0 : esquema.default) || false;
1148
- case 'array':
1149
- return [];
1150
- case 'file':
1151
- return null;
1152
- case 'object':
1153
- Object.getOwnPropertyNames(esquema === null || esquema === void 0 ? void 0 : esquema.properties).forEach(function (key) {
1154
- var aux = esquema === null || esquema === void 0 ? void 0 : esquema.properties[key];
1155
- if (aux)
1156
- object[key] = _this.createObject(aux, operation);
1157
- });
1158
- return object;
1159
- default:
1160
- return null;
1161
- }
1162
- };
1163
- SfCrudService.prototype.getValueKey = function (key) {
1164
- var data;
1165
- switch ((key === null || key === void 0 ? void 0 : key.data) || 'externa') {
1166
- case "user":
1167
- data = this.user;
1168
- break;
1169
- default:
1170
- data = this.dataExt;
1171
- break;
1172
- }
1173
- if (data && key) {
1174
- var aux = jsonpath__namespace.query(data, key.scope);
1175
- if (aux.length == 0)
1176
- return undefined;
1177
- if (aux.length == 1)
1178
- return aux[0];
1179
- else
1180
- return aux;
1181
- }
1182
- return undefined;
1183
- };
1184
- SfCrudService.prototype.setDefaultValue = function (value, operation) {
1185
- var data = null;
1186
- if (value.key && operation.keys) {
1187
- data = this.getValueKey(operation.keys.find(function (k) { return k.key == value.key; }));
1188
- value = data;
1189
- }
1190
- switch (value) {
1191
- case '@uactivo':
1192
- data = this.user.UsuarioSistema.TDOC + "-" + this.user.UsuarioSistema.NDOC;
1193
- break;
1194
- case '@tdocactivo':
1195
- data = this.user.UsuarioSistema.TDOC;
1196
- break;
1197
- case '@ndocactivo':
1198
- data = this.user.UsuarioSistema.NDOC;
1199
- break;
1200
- case '@hoy':
1201
- data = new Date();
1202
- break;
1203
- default:
1204
- data = value;
1205
- break;
1206
- }
1207
- return data;
1208
- };
1209
- /**
1210
- * Validate if schema has pdfsign and it's signed, else return false
1211
- * @param index
1212
- * @returns
1213
- */
1214
- SfCrudService.prototype.isSignedPDF = function (index) {
1215
- return this._dataSet[index].signed;
1216
- };
1217
- Object.defineProperty(SfCrudService.prototype, "changeData$", {
1218
- get: function () {
1219
- return this._changeData.asObservable();
1220
- },
1221
- enumerable: false,
1222
- configurable: true
1223
- });
1224
- Object.defineProperty(SfCrudService.prototype, "changeData", {
1225
- set: function (value) {
1226
- this._changeData.next(value);
1227
- },
1228
- enumerable: false,
1229
- configurable: true
1230
- });
1231
- Object.defineProperty(SfCrudService.prototype, "formLoading$", {
1232
- get: function () {
1233
- return this.__formLoading.asObservable();
1234
- },
1235
- enumerable: false,
1236
- configurable: true
1237
- });
1238
- Object.defineProperty(SfCrudService.prototype, "formLoading", {
1239
- set: function (value) {
1240
- this.__formLoading.next(value);
1241
- },
1242
- enumerable: false,
1243
- configurable: true
1244
- });
1245
- SfCrudService.prototype.loadSession = function () {
1246
- var existSession = localStorage.getItem("esquemas") !== null;
1247
- if (existSession) {
1248
- this._esquemas = JSON.parse(localStorage.getItem("esquemas"));
1249
- this._uiEsquemas = JSON.parse(localStorage.getItem("uiEsquemas"));
1250
- this._registros = JSON.parse(localStorage.getItem("registros"));
1251
- this._dataSet = JSON.parse(localStorage.getItem("dataSet"));
1252
- this._answers = JSON.parse(localStorage.getItem("answers"));
1253
- this._trx = JSON.parse(localStorage.getItem("trx"));
1254
- this.__index = +localStorage.getItem("index");
1255
- localStorage.clear();
1256
- }
1257
- return existSession;
1258
- };
1259
- Object.defineProperty(SfCrudService.prototype, "reasons", {
1260
- get: function () {
1261
- var reasonsStorage = localStorage.getItem("reasons");
1262
- if (reasonsStorage)
1263
- return JSON.parse(reasonsStorage);
1264
- return [];
1265
- },
1266
- enumerable: false,
1267
- configurable: true
1268
- });
1269
- SfCrudService.prototype.saveProgress = function (reasons) {
1270
- localStorage.setItem("reasons", JSON.stringify(reasons));
1271
- localStorage.setItem("esquemas", JSON.stringify(this._esquemas));
1272
- localStorage.setItem("trx", JSON.stringify(this._trx));
1273
- localStorage.setItem("uiEsquemas", JSON.stringify(this._uiEsquemas));
1274
- localStorage.setItem("registros", JSON.stringify(this._registros));
1275
- localStorage.setItem("dataSet", JSON.stringify(this._dataSet));
1276
- localStorage.setItem("answers", JSON.stringify(this._answers));
1277
- localStorage.setItem("index", this.__index.toString());
1278
- };
1279
- SfCrudService.prototype.redirectToInicio = function () {
1280
- window.location.href = window.location.href.split('?')[0];
1281
- window.location.reload();
1282
- };
1283
- SfCrudService.prototype.applyValuesOnEvent = function (event, esquema, key, data) {
1284
- var _this = this;
1285
- if (key) {
1286
- if (esquema.properties[key][event]) {
1287
- esquema.properties[key][event].forEach(function (value) {
1288
- _this.setValueEvent(data, value, esquema);
1289
- });
1290
- }
1291
- }
1292
- else {
1293
- for (var key_1 in esquema.properties) {
1294
- if (esquema.properties[key_1][event]) {
1295
- esquema.properties[key_1][event].forEach(function (value) {
1296
- _this.setValueEvent(data, value, esquema);
1297
- });
1298
- }
1299
- }
1300
- }
1301
- };
1302
- SfCrudService.prototype.setValueEvent = function (data, params, esquema) {
1303
- var _a;
1304
- var date = moment__namespace(new Date());
1305
- switch (params.op) {
1306
- case 'sum':
1307
- 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));
1308
- break;
1309
- case 'concat':
1310
- var array_1 = [];
1311
- (_a = params === null || params === void 0 ? void 0 : params.key) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, cur) {
1312
- array_1.push(jsonpath__namespace.query(data, cur)[0]);
1313
- }, []);
1314
- if (params === null || params === void 0 ? void 0 : params.separator)
1315
- jsonpath__namespace.value(data, params.scope[0], array_1.join((params === null || params === void 0 ? void 0 : params.separator) || ' '));
1316
- break;
1317
- case 'enable':
1318
- jsonpath__namespace.value(esquema, params.scope[0], false);
1319
- break;
1320
- case 'disabled':
1321
- jsonpath__namespace.value(esquema, params.scope[0], true);
1322
- break;
1323
- case 'replace:endpoint':
1324
- jsonpath__namespace.value(esquema, params.scope[0], esquema.config.endpointtemp.replace(params.scope[1], jsonpath__namespace.query(data, "$.." + params.key)));
1325
- break;
1326
- case 'setNull':
1327
- jsonpath__namespace.value(data, "$." + params.key, null);
1328
- break;
1329
- case 'datediff:years':
1330
- jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'years'));
1331
- break;
1332
- case 'datediff:months':
1333
- jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'months'));
1334
- break;
1335
- case 'datediff:weeks':
1336
- jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'weeks'));
1337
- break;
1338
- case 'datediff:days':
1339
- jsonpath__namespace.value(data, params.scope[0], date.diff(moment__namespace(jsonpath__namespace.query(data, params.scope[1])[0]), 'days'));
1340
- break;
1341
- default:
1342
- break;
1343
- }
1344
- console.log('setValueEvent sale:');
1345
- console.log(data);
1346
- console.log(esquema);
1347
- console.log(params);
1348
- };
1349
- SfCrudService.prototype.armarNuevaDireccion = function (tipo, dataDireccion, separador) {
1350
- var resultado;
1351
- if (tipo == "string") {
1352
- resultado = "";
1353
- this.mascaras.forEach(function (mascara) {
1354
- mascara.Campo.forEach(function (campo, i) {
1355
- var valor = jsonpath__namespace.query(dataDireccion, "$." + campo.Id)[0];
1356
- if (valor && i - 1 >= 0 && mascara.Campo[i - 1].Tipo.toLocaleLowerCase() == "label") {
1357
- valor = mascara.Campo[i - 1].Valor + valor;
1358
- }
1359
- if (valor && !separador)
1360
- resultado += valor + " ";
1361
- else if (separador)
1362
- resultado += (valor !== null && valor !== void 0 ? valor : "") + separador;
1363
- });
1364
- });
1365
- }
1366
- else {
1367
- throw new Error("flujo sin realizar");
1368
- }
1369
- return resultado;
1370
- };
1371
- return SfCrudService;
1372
- }());
1373
- SfCrudService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1374
- SfCrudService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, providedIn: 'root' });
1375
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudService, decorators: [{
1376
- type: i0.Injectable,
1377
- args: [{
1378
- providedIn: 'root'
1379
- }]
1380
- }] });
1381
- var ChangeData = /** @class */ (function () {
1382
- function ChangeData(value, scope, index) {
1383
- this.value = value;
1384
- this.scope = scope;
1385
- this.index = index;
1386
- }
1387
- return ChangeData;
1388
- }());
1389
-
1390
- var StepService = /** @class */ (function () {
1391
- function StepService() {
1392
- this._requestApproval = new rxjs.Subject();
1393
- this._customChildrenEvents = new rxjs.Subject();
1394
- this._currentPosition = new rxjs.BehaviorSubject(0);
1395
- this._requestApproved = new rxjs.BehaviorSubject(true);
1396
- }
1397
- Object.defineProperty(StepService.prototype, "currentIndex", {
1398
- get: function () {
1399
- return this._currentPosition.getValue();
1400
- },
1401
- set: function (value) {
1402
- this._currentPosition.next(value);
1403
- },
1404
- enumerable: false,
1405
- configurable: true
1406
- });
1407
- Object.defineProperty(StepService.prototype, "currentIndex$", {
1408
- get: function () {
1409
- return this._currentPosition.asObservable();
1410
- },
1411
- enumerable: false,
1412
- configurable: true
1413
- });
1414
- Object.defineProperty(StepService.prototype, "requestApproval", {
1415
- /*
1416
- Envia una peticion para que se envie el formulario
1417
- */
1418
- set: function (newPos) {
1419
- this._desiredIndex = newPos;
1420
- this._requestApproval.next({ current: this.currentIndex, desired: newPos });
1421
- },
1422
- enumerable: false,
1423
- configurable: true
1424
- });
1425
- Object.defineProperty(StepService.prototype, "requestApproval$", {
1426
- get: function () {
1427
- return this._requestApproval.asObservable();
1428
- },
1429
- enumerable: false,
1430
- configurable: true
1431
- });
1432
- Object.defineProperty(StepService.prototype, "requestApproved$", {
1433
- get: function () {
1434
- return this._requestApproved.asObservable();
1435
- },
1436
- enumerable: false,
1437
- configurable: true
1438
- });
1439
- Object.defineProperty(StepService.prototype, "requestApproved", {
1440
- /**
1441
- * Useful to deny or approve request made by requestAprroval
1442
- */
1443
- set: function (approved) {
1444
- if (approved && this._desiredIndex !== undefined)
1445
- this._currentPosition.next(this._desiredIndex);
1446
- this._requestApproved.next(approved);
1447
- },
1448
- enumerable: false,
1449
- configurable: true
1450
- });
1451
- Object.defineProperty(StepService.prototype, "desiredIndex", {
1452
- set: function (index) {
1453
- this._desiredIndex = index;
1454
- },
1455
- enumerable: false,
1456
- configurable: true
1457
- });
1458
- StepService.prototype.addCustomChildrenEvent = function (name, data) {
1459
- this._customChildrenEvents.next({ name: name, data: data });
1460
- };
1461
- StepService.prototype.reset = function () {
1462
- //this._requestApproval = new BehaviorSubject({current:0, desired: undefined});
1463
- //this._customChildrenEvents = new BehaviorSubject(undefined);
1464
- };
1465
- Object.defineProperty(StepService.prototype, "customChildrenEvents$", {
1466
- get: function () {
1467
- return this._customChildrenEvents.asObservable();
1468
- },
1469
- enumerable: false,
1470
- configurable: true
1471
- });
1472
- return StepService;
1473
- }());
1474
- StepService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1475
- StepService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepService, providedIn: 'root' });
1476
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepService, decorators: [{
1477
- type: i0.Injectable,
1478
- args: [{
1479
- providedIn: 'root'
1480
- }]
1481
- }] });
1482
-
1483
- var TableroComponent = /** @class */ (function () {
1484
- function TableroComponent(generalService, router, sfCrudService, stepService) {
1485
- this.generalService = generalService;
1486
- this.router = router;
1487
- this.sfCrudService = sfCrudService;
1488
- this.stepService = stepService;
1489
- this.opciones = [];
1490
- this.idEntidad = '';
1491
- this.idKatios = '';
1492
- this.onSelectAction = new i0.EventEmitter();
1493
- this.items = [];
1494
- this.crudConfig = new CrudConfig();
1495
- this.data = [];
1496
- this.initialData = [];
1497
- this.btn = { create: undefined, read: undefined, update: undefined, delete: undefined };
1498
- this.loading = { inProgress: false, target: undefined };
1499
- }
1500
- TableroComponent.prototype.ngOnInit = function () {
1501
- this.generalService.environment = this.environment;
1502
- this.loadConfigCrud();
1503
- };
1504
- TableroComponent.prototype.loadConfigCrud = function () {
1505
- var _this = this;
1506
- this.loading.inProgress = true;
1507
- this.sfCrudService.formLoading = this.loading;
1508
- this.generalService.getCrudByEntidad(this.idKatios, this.idEntidad)
1509
- .then(function (res) {
1510
- _this.crudConfig = res;
1511
- _this.getInfoTablero();
1512
- })
1513
- .catch(function (err) {
1514
- console.log(err);
1515
- _this.loading.inProgress = false;
1516
- _this.sfCrudService.formLoading = _this.loading;
1517
- });
1518
- };
1519
- TableroComponent.prototype.customizeCompany = function (uiEsquemas) {
1520
- var _a, _b, _c;
1521
- this.sfCrudService.configEmpresa = (_a = uiEsquemas.find(function (ui) { return ui.general; })) === null || _a === void 0 ? void 0 : _a.general;
1522
- if (this.sfCrudService.configEmpresa) {
1523
- if ((_b = this.sfCrudService.configEmpresa.colors) === null || _b === void 0 ? void 0 : _b.secondary)
1524
- this.color2 = this.sfCrudService.configEmpresa.colors.secondary;
1525
- if ((_c = this.sfCrudService.configEmpresa.colors) === null || _c === void 0 ? void 0 : _c.button)
1526
- this.colorButtons = this.sfCrudService.configEmpresa.colors.secondary;
1527
- }
1528
- if (!this.color2)
1529
- this.color2 = this.colorButtons = "blue";
1530
- };
1531
- // submit(index: number) {
1532
- // let registro = this.sfCrudService.getRegistro(index)
1533
- // let operation = registro.operations.find(op => op.type.startsWith(this.sfCrudService.getTrx(0)))!
1534
- // console.log(operation)
1535
- // let url = this.sfCrudService.getURL(operation, index)
1536
- // return this.generalService.genericRequest(operation.method, url, this.sfCrudService.getData(index))
1537
- // .then((res) => {
1538
- // if (res === null) res = {}
1539
- // res = this.sfCrudService.applyObjectKeys(res, operation.keysEsquema || [], registro)
1540
- // console.log(res)
1541
- // this.sfCrudService.setAnswers(res, 0)
1542
- // if (operation.changeTrx) operation.changeTrx.forEach(x => this.sfCrudService.setTrx(x.trx, x.index))
1543
- // // this.notificationService.generateMessage(this.notificationService.genDefaultMessage("success", undefined, "Información subida correctamente", operation.answerChecking), res, operation.answerChecking)
1544
- // // return res;
1545
- // })
1546
- // .catch(err => {
1547
- // // const operation = this.sfCrudService.getRegistro(this.indexCrud).operations.find(op => op.type.startsWith(this.sfCrudService.getTrx(index)))!
1548
- // // this.notificationService.generateMessage(this.notificationService.genDefaultMessage("error", "Error no controlado", "Por favor comunicarse con el admin",operation.errorChecking), err.error, operation.errorChecking)
1549
- // // throw new Error(err)
1550
- // })
1551
- // }
1552
- TableroComponent.prototype.getInfoTablero = function () {
1553
- var _this = this;
1554
- //this.submit(0)
1555
- this.data = [];
1556
- this.initialData = [];
1557
- this.loading.inProgress = true;
1558
- this.sfCrudService.formLoading = this.loading;
1559
- var url = this.aplyKeys(this.crudConfig.tablero.keys, "" + this.generalService.jsonConfig[this.crudConfig.tablero.server] + this.crudConfig.tablero.endpoint, this.dataExt);
1560
- this.generalService.genericRequest(this.crudConfig.tablero.method, url, this.dataExt)
1561
- .then(function (res) {
1562
- var aux;
1563
- if (!Array.isArray(res))
1564
- aux = res.data;
1565
- else
1566
- aux = res;
1567
- _this.initialData = ___namespace.cloneDeep(aux);
1568
- _this.generateData(aux);
1569
- _this.loadOptions();
1570
- })
1571
- .finally(function () {
1572
- _this.loading.inProgress = false;
1573
- _this.sfCrudService.formLoading = _this.loading;
1574
- });
1575
- };
1576
- TableroComponent.prototype.generateData = function (data) {
1577
- var _this = this;
1578
- data.forEach(function (item) {
1579
- var newItem = {};
1580
- _this.crudConfig.tablero.columns.forEach(function (col) {
1581
- newItem[col.col] = _this.getValue(col.col, item);
1582
- });
1583
- _this.data.push(newItem);
1584
- });
1585
- console.log(this.data);
1586
- };
1587
- TableroComponent.prototype.getValue = function (path, item) {
1588
- if (path.includes("."))
1589
- return jsonpath__namespace.query(item, path)[0];
1590
- return item[path];
1591
- };
1592
- TableroComponent.prototype.externalLinkAction = function () {
1593
- var _this = this;
1594
- this.opciones.filter(function (opc) { return opc.valor.action; }).forEach(function (opc) { return _this.execAction(opc.valor); });
1595
- };
1596
- TableroComponent.prototype.loadOptions = function () {
1597
- var _this = this;
1598
- this.items = [];
1599
- this.btn.create = this.opciones.find(function (x) { return x.label == 'Crear'; });
1600
- this.opciones.filter(function (opc) { return opc.valor.action; }).forEach(function (opc) {
1601
- _this.items.push({ label: opc.label, icon: opc.icon, command: function () { return _this.execAction(opc.valor); } });
1602
- });
1603
- };
1604
- TableroComponent.prototype.redirect = function (accion, data) {
1605
- var _a, _b;
1606
- this.stepService.reset();
1607
- this.sfCrudService.reset();
1608
- switch (accion) {
1609
- case 'create':
1610
- this.router.navigateByUrl(((_b = (_a = this.btn.create) === null || _a === void 0 ? void 0 : _a.valor) === null || _b === void 0 ? void 0 : _b.redirect) || '');
1611
- break;
1612
- case 'read':
1613
- this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, this.btn.read.valor.redirect, data));
1614
- break;
1615
- case 'update':
1616
- this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, this.btn.update.valor.redirect, data));
1617
- break;
1618
- case 'delete':
1619
- this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, this.btn.delete.valor.redirect, data));
1620
- break;
1621
- default:
1622
- break;
1623
- }
1624
- };
1625
- TableroComponent.prototype.aplyKeys = function (keys, endpoint, data) {
1626
- var _this = this;
1627
- keys.forEach(function (key) {
1628
- var _a, _b, _c, _d;
1629
- switch (key.key) {
1630
- case '@ndoc':
1631
- endpoint = endpoint.replace(key.key, ((_b = (_a = _this.user) === null || _a === void 0 ? void 0 : _a.UsuarioSistema) === null || _b === void 0 ? void 0 : _b.NDOC) || '');
1632
- break;
1633
- case '@tdoc':
1634
- endpoint = endpoint.replace(key.key, ((_d = (_c = _this.user) === null || _c === void 0 ? void 0 : _c.UsuarioSistema) === null || _d === void 0 ? void 0 : _d.TDOC) || '');
1635
- break;
1636
- case '@idKatios':
1637
- endpoint = endpoint.replace(key.key, _this.idKatios);
1638
- break;
1639
- default:
1640
- if (endpoint.includes(key.key) && data)
1641
- endpoint = endpoint.replace(key.key, jsonpath__namespace.query(data, (key === null || key === void 0 ? void 0 : key.scope) || '')[0]);
1642
- break;
1643
- }
1644
- });
1645
- return endpoint;
1646
- };
1647
- TableroComponent.prototype.execAction = function (params) {
1648
- switch (params.action) {
1649
- case 'redirect':
1650
- this.router.navigateByUrl(this.aplyKeys(this.crudConfig.tablero.keys, params.link, this.itemSelected)).then(function () {
1651
- if (params.reload)
1652
- window.location.reload();
1653
- });
1654
- break;
1655
- default:
1656
- this.onSelectAction.emit({ data: ___namespace.cloneDeep(this.itemSelected), params: params });
1657
- break;
1658
- }
1659
- };
1660
- return TableroComponent;
1661
- }());
1662
- 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 });
1663
- 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 } });
1664
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TableroComponent, decorators: [{
1665
- type: i0.Component,
1666
- args: [{
1667
- selector: 'sf-crudtablero',
1668
- templateUrl: './tablero.component.html',
1669
- styleUrls: ['./tablero.component.css']
1670
- }]
1671
- }], ctorParameters: function () { return [{ type: GeneralService }, { type: i2__namespace.Router }, { type: SfCrudService }, { type: StepService }]; }, propDecorators: { opciones: [{
1672
- type: i0.Input
1673
- }], idEntidad: [{
1674
- type: i0.Input
1675
- }], idKatios: [{
1676
- type: i0.Input
1677
- }], environment: [{
1678
- type: i0.Input
1679
- }], user: [{
1680
- type: i0.Input
1681
- }], dataExt: [{
1682
- type: i0.Input
1683
- }], onSelectAction: [{
1684
- type: i0.Output
1685
- }], color2: [{
1686
- type: i0.HostBinding,
1687
- args: ["style.--secondary-color"]
1688
- }], colorButtons: [{
1689
- type: i0.HostBinding,
1690
- args: ["style.--button-color"]
1691
- }] } });
1692
-
1693
- var NotificationService = /** @class */ (function () {
1694
- function NotificationService(sfCrudService) {
1695
- this.sfCrudService = sfCrudService;
1696
- this._notificationAdded = new rxjs.BehaviorSubject(undefined);
1697
- }
1698
- NotificationService.prototype.addNotification = function (msg, requestChecking) {
1699
- this._notificationAdded.next({ msg: msg, requestChecking: requestChecking });
1700
- };
1701
- NotificationService.prototype.notificationAdded$ = function () {
1702
- return this._notificationAdded.asObservable();
1703
- };
1704
- /**
1705
- * Generates message using answerchecking
1706
- * @param currentMsg Default message: Message | SweetAlertOptions
1707
- * @param rta Resquest's response
1708
- * @param answerChecking
1709
- */
1710
- NotificationService.prototype.generateMessage = function (currentMsg, rta, requestChecking) {
1711
- if (requestChecking) {
1712
- if (requestChecking.statics)
1713
- Object.assign(currentMsg, requestChecking.statics);
1714
- //mapear los dinamicos
1715
- if (requestChecking.dynamics) {
1716
- var dynamics = requestChecking.dynamics;
1717
- try {
1718
- if (dynamics && typeof (rta) == "string")
1719
- rta = JSON.parse(rta);
1720
- if (requestChecking.parse) {
1721
- var valueParsed = JSON.parse(jsonpath__namespace.query(rta, requestChecking.parse)[0]);
1722
- jsonpath__namespace.value(rta, requestChecking.parse, valueParsed);
1723
- }
1724
- if (dynamics) {
1725
- for (var property in dynamics) {
1726
- currentMsg[property] = jsonpath__namespace.query(rta, dynamics[property])[0];
1727
- }
1728
- }
1729
- }
1730
- catch (error) { //es una respuesta sin JSON
1731
- if (dynamics)
1732
- currentMsg.detail = rta;
1733
- }
1734
- }
1735
- }
1736
- return currentMsg;
1737
- };
1738
- NotificationService.prototype.genDefaultMessage = function (severity, title, detail, requestChecking) {
1739
- var _a, _b, _c, _d, _e, _f;
1740
- var obj = { title: title, text: detail, icon: severity,
1741
- 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",
1742
- 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" };
1743
- if (requestChecking && requestChecking.useSwal && severity == "error") {
1744
- obj.showCancelButton = true;
1745
- obj.confirmButtonText = '<i class="pi pi-check"></i> Continuar';
1746
- obj.cancelButtonText = '<i class="pi pi-times"></i> Terminar';
1747
- }
1748
- if (!requestChecking || !requestChecking.useSwal) {
1749
- obj.severity = severity;
1750
- obj.summary = title;
1751
- obj.detail = detail;
1752
- }
1753
- return obj;
1754
- };
1755
- return NotificationService;
1756
- }());
1757
- 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 });
1758
- NotificationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NotificationService, providedIn: 'root' });
1759
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: NotificationService, decorators: [{
1760
- type: i0.Injectable,
1761
- args: [{
1762
- providedIn: 'root'
1763
- }]
1764
- }], ctorParameters: function () { return [{ type: SfCrudService }]; } });
1765
- var Notification = /** @class */ (function () {
1766
- function Notification(msg, requestChecking) {
1767
- this.msg = msg;
1768
- this.requestChecking = requestChecking;
1769
- }
1770
- return Notification;
1771
- }());
1772
-
1773
- var StepComponent = /** @class */ (function () {
1774
- function StepComponent(router, stepService, activatedRoute) {
1775
- this.router = router;
1776
- this.stepService = stepService;
1777
- this.activatedRoute = activatedRoute;
1778
- this.activeIndex = 0;
1779
- this.loading = false;
1780
- this.nextMovement = 0;
1781
- }
1782
- StepComponent.prototype.ngOnInit = function () {
1783
- var _this = this;
1784
- this.stepService.currentIndex$.subscribe(function (result) {
1785
- _this.nextMovement = result;
1786
- _this.router.navigate([_this.items[result].routerLink], { relativeTo: _this.activatedRoute, queryParamsHandling: "preserve" });
1787
- _this.moveScroll(_this.nextMovement);
1788
- _this.activeIndex = result;
1789
- });
1790
- };
1791
- StepComponent.prototype.ngAfterViewInit = function () {
1792
- var _this = this;
1793
- this.stepService.requestApproved$.subscribe(function (result) {
1794
- if (result) {
1795
- _this.navigate();
1796
- }
1797
- _this.loading = false;
1798
- });
1799
- this.moveScroll(this.nextMovement);
1800
- };
1801
- StepComponent.prototype.onactiveIndexChange = function ($event) {
1802
- this.requestNaviagtion($event - this.activeIndex);
1803
- };
1804
- /**
1805
- * Button solicitates permissions to change tab.
1806
- * @param add steps to advance. If negative will go back
1807
- */
1808
- StepComponent.prototype.requestNaviagtion = function (add) {
1809
- this.loading = true;
1810
- this.nextMovement = this.activeIndex + add;
1811
- this.stepService.requestApproval = this.nextMovement;
1812
- };
1813
- StepComponent.prototype.navigate = function () {
1814
- if (this.nextMovement < this.items.length) {
1815
- this.activeIndex = this.nextMovement;
1816
- this.router.navigate([this.items[this.nextMovement].routerLink], { relativeTo: this.activatedRoute, queryParamsHandling: "preserve" });
1817
- }
1818
- };
1819
- StepComponent.prototype.moveScroll = function (nextIndex) {
1820
- var miDiv = document.getElementById("step-container");
1821
- var steps = document.querySelector(".p-steps ul[role='tablist']");
1822
- if (steps !== null) {
1823
- var i = 0;
1824
- var value = 0;
1825
- while (i < nextIndex) {
1826
- var child = steps.children[i];
1827
- value += child.clientWidth;
1828
- i++;
1829
- }
1830
- miDiv.scrollLeft = value;
1831
- }
1832
- };
1833
- return StepComponent;
1834
- }());
1835
- 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 });
1836
- 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"] }] });
1837
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StepComponent, decorators: [{
1838
- type: i0.Component,
1839
- args: [{
1840
- selector: 'app-step',
1841
- templateUrl: './step.component.html',
1842
- styleUrls: ['./step.component.css']
1843
- }]
1844
- }], ctorParameters: function () { return [{ type: i2__namespace.Router }, { type: StepService }, { type: i2__namespace.ActivatedRoute }]; }, propDecorators: { items: [{
1845
- type: i0.Input
1846
- }] } });
1847
-
1848
- var Shema = /** @class */ (function () {
1849
- function Shema() {
1850
- this.type = '';
1851
- this.subtype = '';
1852
- this.configuration = new ShemaConfig();
1853
- this.allowCustomOption = false;
1854
- }
1855
- return Shema;
1856
- }());
1857
- var ShemaConfig = /** @class */ (function () {
1858
- function ShemaConfig() {
1859
- }
1860
- return ShemaConfig;
1861
- }());
1862
-
1863
- var FileUploadComponent = /** @class */ (function () {
1864
- function FileUploadComponent(messageSerice) {
1865
- var _this = this;
1866
- this.messageSerice = messageSerice;
1867
- this.files = [];
1868
- this.loading = false;
1869
- this.accept = "image/*,application/pdf";
1870
- this.onUpload = new i0.EventEmitter();
1871
- this.onDeleteFile = new i0.EventEmitter();
1872
- this.newFiles = [];
1873
- window.addEventListener("paste", function (e) {
1874
- var _a;
1875
- if (((_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.files) && e.clipboardData.files.length > 0) {
1876
- _this.appendFile(e.clipboardData.files[0]);
1877
- }
1878
- });
1879
- }
1880
- FileUploadComponent.prototype.ngOnChanges = function (changes) {
1881
- };
1882
- FileUploadComponent.prototype.ngOnInit = function () {
1883
- };
1884
- FileUploadComponent.prototype.appendFile = function (file) {
1885
- var allowedTypes = this.accept.split(",");
1886
- var allowedFile = allowedTypes.some(function (pattern) {
1887
- var regexObj = new RegExp(pattern);
1888
- var match = regexObj.exec(file.type);
1889
- return match ? (match === null || match === void 0 ? void 0 : match.length) > 0 : false;
1890
- });
1891
- if (allowedFile) {
1892
- var newFile = new File([file], this.getName(file), { type: file.type });
1893
- if (this.limit == 1) {
1894
- this.newFiles = [newFile];
1895
- }
1896
- else
1897
- this.newFiles.push(newFile);
1898
- this.files.push({ name: newFile.name, url: window.URL.createObjectURL(newFile) });
1899
- }
1900
- else {
1901
- this.messageSerice.add({ severity: "warn", detail: "Tipo de archivo no válido" });
1902
- }
1903
- };
1904
- FileUploadComponent.prototype.emitFiles = function () {
1905
- this.loading = true;
1906
- this.onUpload.emit(this.newFiles);
1907
- };
1908
- FileUploadComponent.prototype.getName = function (file) {
1909
- var sName = "";
1910
- var date = new Date();
1911
- if (this.configName !== undefined) {
1912
- var name = this.configName.split('|');
1913
- name.forEach(function (item) {
1914
- if (item.indexOf("DATE@") != -1)
1915
- sName += (moment__namespace(date)).format(item.split('@')[1]);
1916
- else if (item.indexOf("@") == -1)
1917
- sName += item;
1918
- });
1919
- var ext = this.getExt(file);
1920
- sName += ext ? "." + ext : "";
1921
- }
1922
- else
1923
- sName = file.name;
1924
- return sName;
1925
- };
1926
- FileUploadComponent.prototype.getExt = function (file) {
1927
- var ext = undefined;
1928
- var aux = file.name.split('.');
1929
- if (aux.length > 0)
1930
- ext = aux[aux.length - 1];
1931
- return ext;
1932
- };
1933
- FileUploadComponent.prototype.appendFiles = function ($event) {
1934
- if ($event.target.files.length > 0) {
1935
- this.appendFile($event.target.files[0]);
1936
- }
1937
- if (this.limit == this.files.length) {
1938
- this.stopAnimation();
1939
- this.emitFiles();
1940
- }
1941
- else
1942
- this.startAnimation();
1943
- this.fileUploader.nativeElement.value = "";
1944
- };
1945
- FileUploadComponent.prototype.dropFile = function (archivo) {
1946
- var _this = this;
1947
- this.files.forEach(function (f, index) {
1948
- if (f == archivo) {
1949
- _this.files.splice(index, 1);
1950
- _this.onDeleteFile.emit(index);
1951
- }
1952
- });
1953
- };
1954
- FileUploadComponent.prototype.openFile = function (archivo) {
1955
- window.open(archivo.url, '_blank');
1956
- window.addEventListener('focus', function () { return URL.revokeObjectURL(archivo.url); });
1957
- };
1958
- FileUploadComponent.prototype.startAnimation = function () {
1959
- var button = document.querySelector('.button-upload');
1960
- if (button) {
1961
- button.classList.add('animate-pulse');
1962
- }
1963
- };
1964
- FileUploadComponent.prototype.stopAnimation = function () {
1965
- var button = document.querySelector('.button-upload');
1966
- if (button) {
1967
- button.classList.remove('animate-pulse');
1968
- }
1969
- };
1970
- return FileUploadComponent;
1971
- }());
1972
- 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 });
1973
- 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"] }] });
1974
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FileUploadComponent, decorators: [{
1975
- type: i0.Component,
1976
- args: [{
1977
- selector: 'sf-file-upload',
1978
- templateUrl: './file-upload.component.html',
1979
- styleUrls: ['./file-upload.component.css']
1980
- }]
1981
- }], ctorParameters: function () { return [{ type: i1__namespace$1.MessageService }]; }, propDecorators: { limit: [{
1982
- type: i0.Input
1983
- }], files: [{
1984
- type: i0.Input
1985
- }], loading: [{
1986
- type: i0.Input
1987
- }], configName: [{
1988
- type: i0.Input
1989
- }], accept: [{
1990
- type: i0.Input
1991
- }], onUpload: [{
1992
- type: i0.Output
1993
- }], onDeleteFile: [{
1994
- type: i0.Output
1995
- }], fileUploader: [{
1996
- type: i0.ViewChild,
1997
- args: ['fileUpload']
1998
- }] } });
1999
- var Archivo = /** @class */ (function () {
2000
- function Archivo() {
2001
- }
2002
- return Archivo;
2003
- }());
2004
-
2005
- var FormatAddressPipe = /** @class */ (function () {
2006
- function FormatAddressPipe() {
2007
- }
2008
- FormatAddressPipe.prototype.transform = function (address, separator) {
2009
- if (!address) {
2010
- return address;
2011
- }
2012
- if (separator) {
2013
- return address.replaceAll(separator, ' ').replaceAll(' ', ' ');
2014
- }
2015
- return address;
2016
- };
2017
- return FormatAddressPipe;
2018
- }());
2019
- FormatAddressPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FormatAddressPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2020
- FormatAddressPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FormatAddressPipe, name: "formatAddress" });
2021
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FormatAddressPipe, decorators: [{
2022
- type: i0.Pipe,
2023
- args: [{
2024
- name: 'formatAddress'
2025
- }]
2026
- }] });
2027
-
2028
- var ControlComponent = /** @class */ (function () {
2029
- function ControlComponent(generalService, crudService, cdr, notificationService) {
2030
- this.generalService = generalService;
2031
- this.crudService = crudService;
2032
- this.cdr = cdr;
2033
- this.notificationService = notificationService;
2034
- this.showTempValue = false;
2035
- this.control = new Shema();
2036
- this.label = '';
2037
- this.setValue = new i0.EventEmitter();
2038
- this.sendObject = new i0.EventEmitter();
2039
- this.addressClicked = new i0.EventEmitter();
2040
- this.isLoading = false;
2041
- this.dataFromService = [];
2042
- this.uploadedFiles = [];
2043
- this.displayAdd = false;
2044
- this.clicked = false;
2045
- this.maskDate = "99/99/9999";
2046
- this.uploadingFiles = false;
2047
- }
2048
- ControlComponent.prototype.ngOnChanges = function (changes) {
2049
- };
2050
- ControlComponent.prototype.ngOnInit = function () {
2051
- var _this = this;
2052
- var _a, _b;
2053
- this.loadDefaultValues();
2054
- if ((_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.depends) {
2055
- this.crudService.changeData$.subscribe(function (res) {
2056
- var _a, _b;
2057
- if (res) {
2058
- var registro = _this.crudService.getRegistro(_this.crudService.index);
2059
- var keyFound = (_a = registro.keys) === null || _a === void 0 ? void 0 : _a.find(function (k) { return k.scope === res.scope
2060
- && _this.control.config.depends.includes(k.key) &&
2061
- (res.index === k.indexData || res.index === k.indexAnswer); });
2062
- if (keyFound === null || keyFound === void 0 ? void 0 : keyFound.overrideControl) {
2063
- var override = keyFound.overrideControl;
2064
- var completed = _this.crudService.isConditionsCompleted((_b = override.conditions) !== null && _b !== void 0 ? _b : [], registro.conditions || [], _this.crudService.getData(_this.crudService.index));
2065
- jsonpath__namespace.value(_this.control, override.property, completed ? override.value : override.elseValue);
2066
- _this.value = _this.getNewValue(override, completed);
2067
- _this.tempValue = null;
2068
- _this.sendValue();
2069
- if (_this.control.subtype == 'dropdown' || _this.control.subtype == 'multiselect')
2070
- _this.loadDataFromService();
2071
- //this.cdr.detectChanges()
2072
- }
2073
- else if (keyFound) {
2074
- _this.value = null;
2075
- _this.sendValue();
2076
- _this.loadDefaultValues();
2077
- //this.cdr.detectChanges()
2078
- }
2079
- }
2080
- });
2081
- }
2082
- };
2083
- ControlComponent.prototype.getNewValue = function (override, completed) {
2084
- var newValue = completed ? override.newPropertyValue : override.elseNewPropertyValue;
2085
- if (newValue && typeof (newValue) == "string") {
2086
- if (!newValue.startsWith('$') && !newValue.startsWith('@')) {
2087
- return newValue;
2088
- }
2089
- }
2090
- return null;
2091
- };
2092
- ControlComponent.prototype.loadDefaultValues = function () {
2093
- var _a, _b, _c, _d, _e;
2094
- if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.config) && this.control.subtype == 'dropdown' || this.control.subtype == 'multiselect')
2095
- this.loadDataFromService();
2096
- if (((_b = this.control) === null || _b === void 0 ? void 0 : _b.subtype) == 'autocomplete')
2097
- this.extracValueFromControlBusqueda();
2098
- if (this.value && this.control.type == 'date')
2099
- this.instanceDate();
2100
- if (((_c = this.control) === null || _c === void 0 ? void 0 : _c.subtype) == "file") {
2101
- this.loadFiles();
2102
- }
2103
- if (((_d = this.control) === null || _d === void 0 ? void 0 : _d.type) == 'string')
2104
- this.lenghtWord = this.value ? this.value.length : 0;
2105
- if (((_e = this.control) === null || _e === void 0 ? void 0 : _e.subtype) == 'switch')
2106
- this.instanceBoolField();
2107
- };
2108
- ControlComponent.prototype.instanceBoolField = function () {
2109
- this.tempValue = this.value;
2110
- if (this.value == true && this.control.trueValue !== undefined) {
2111
- this.value = this.control.trueValue;
2112
- this.sendValue();
2113
- }
2114
- else if (this.value == false && this.control.falseValue !== undefined) {
2115
- this.value = this.control.falseValue;
2116
- this.sendValue();
2117
- }
2118
- };
2119
- ControlComponent.prototype.onChangeSwitch = function () {
2120
- this.value = this.tempValue;
2121
- this.sendValue();
2122
- };
2123
- ControlComponent.prototype.loadFiles = function () {
2124
- var _this = this;
2125
- this.isLoading = true;
2126
- this.uploadedFiles = [];
2127
- if (!this.value) {
2128
- this.isLoading = false;
2129
- this.cdr.detectChanges();
2130
- }
2131
- else if (this.control.config.namePattern && this.control.type == "string") {
2132
- var urls = this.control.config.separator ? this.value.split(",") : [this.value];
2133
- urls.forEach(function (url) { return _this.uploadedFiles.push({ url: url, name: _this.getNameFile(_this.control.config.namePattern, url) }); });
2134
- this.isLoading = false;
2135
- this.cdr.detectChanges();
2136
- }
2137
- else if (this.control.config.namePattern && this.control.type == "array") {
2138
- this.value.forEach(function (url) { return _this.uploadedFiles.push({ url: url, name: _this.getNameFile(_this.control.config.namePattern, url) }); });
2139
- this.isLoading = false;
2140
- this.cdr.detectChanges();
2141
- }
2142
- };
2143
- ControlComponent.prototype.onDeleteFile = function (index) {
2144
- var _a, _b;
2145
- 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")
2146
- this.value = null;
2147
- else if (this.control.type == "array")
2148
- this.value.splice(index, 1);
2149
- };
2150
- ControlComponent.prototype.getNameFile = function (namePattern, url) {
2151
- var regexObj = new RegExp(namePattern);
2152
- var match = regexObj.exec(url);
2153
- if (!match)
2154
- throw new Error("El pattern no coincide con la url. " + url);
2155
- return match[0];
2156
- };
2157
- ControlComponent.prototype.sendValue = function () {
2158
- var _a;
2159
- if (this.control.type == "string" && this.value == "" && ((_a = this.control.config) === null || _a === void 0 ? void 0 : _a.allowEmpty) == false)
2160
- this.value = null;
2161
- this.setValue.emit(this.value);
2162
- };
2163
- ControlComponent.prototype.sendNumberValue = function ($event) {
2164
- this.value = $event.value;
2165
- this.sendValue();
2166
- };
2167
- ControlComponent.prototype.onInputEmail = function (force) {
2168
- var aux = Math.abs(this.lenghtWord - this.value.length);
2169
- this.lenghtWord = this.value.length;
2170
- if (aux > 1 || force) {
2171
- var regex = new RegExp(/([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/igm);
2172
- if (regex.test(this.value))
2173
- this.sendValue();
2174
- else {
2175
- this.value = null;
2176
- this.sendValue();
2177
- this.notificationService.addNotification({ severity: 'warn', detail: 'El correo no es válido' }, this.primeChecking());
2178
- }
2179
- }
2180
- };
2181
- ControlComponent.prototype.sendValueFromObject = function (event) {
2182
- switch (typeof (this.control.config.optionValue)) {
2183
- case 'object':
2184
- this.control.config.optionValue.forEach(function (op) { return op['value'] = event[op.key]; });
2185
- this.setValue.emit(this.control.config.optionValue);
2186
- break;
2187
- default:
2188
- this.setValue.emit(event[this.control.config.optionValue]);
2189
- break;
2190
- }
2191
- };
2192
- ControlComponent.prototype.loadDataFromService = function () {
2193
- var _this = this;
2194
- var _a;
2195
- this.isLoading = true;
2196
- this.dataFromService = [];
2197
- var op = this.control.config;
2198
- var url = this.crudService.getURL(op, undefined, undefined);
2199
- if ((_a = this.control.config) === null || _a === void 0 ? void 0 : _a.customOptions) {
2200
- this.dataFromService = this.control.config.customOptions;
2201
- }
2202
- else {
2203
- this.generalService.genericRequest(this.control.config.method, url)
2204
- .then(function (res) {
2205
- _this.dataFromService = res.data;
2206
- }).finally(function () {
2207
- _this.isLoading = false;
2208
- _this.cdr.detectChanges();
2209
- });
2210
- }
2211
- };
2212
- ControlComponent.prototype.loadDataFromControlBusquedaService = function (event) {
2213
- var _this = this;
2214
- this.isLoading = true;
2215
- var op = this.control.config;
2216
- var url = this.crudService.getURL(op);
2217
- url = url.replace('@query', (event === null || event === void 0 ? void 0 : event.query) || '');
2218
- this.generalService.genericRequest(this.control.config.method, url)
2219
- .then(function (res) {
2220
- var _a;
2221
- _this.dataFromService = res.data;
2222
- if (((_a = _this.dataFromService) === null || _a === void 0 ? void 0 : _a.length) == 0 && _this.control.allowCustomOption) {
2223
- //agregar un campo que el usuario haya digitado
2224
- var newItem = {};
2225
- newItem[_this.control.field] = _this.tempValue;
2226
- newItem[_this.control.config.optionValue] = _this.tempValue;
2227
- _this.dataFromService.push(newItem);
2228
- }
2229
- }).finally(function () {
2230
- _this.isLoading = false;
2231
- _this.cdr.detectChanges();
2232
- });
2233
- };
2234
- ControlComponent.prototype.extracValueFromControlBusqueda = function () {
2235
- var _this = this;
2236
- var op = this.control.config;
2237
- var url = this.crudService.getURL(op);
2238
- url = url.replace('@query', this.value);
2239
- this.generalService.genericRequest(this.control.config.method, url)
2240
- .then(function (res) {
2241
- var _a;
2242
- if (((_a = res.data) === null || _a === void 0 ? void 0 : _a.length) == 1 && res.data[0][_this.control.field]) {
2243
- _this.tempValue = res.data[0];
2244
- _this.value = res.data[0][_this.control.field];
2245
- }
2246
- else
2247
- _this.setDefaultValue();
2248
- }).finally(function () {
2249
- _this.cdr.detectChanges();
2250
- }).catch(function () {
2251
- _this.setDefaultValue();
2252
- });
2253
- };
2254
- ControlComponent.prototype.onUpload = function (event) {
2255
- var _this = this;
2256
- this.uploadingFiles = true;
2257
- var formData = new FormData();
2258
- var path = this.control.config.path || 'Imagenes/CRUD/temp';
2259
- formData.append('Ruta', "/" + path);
2260
- for (var i = 0; i < event.length; i++)
2261
- formData.append("uploadFile_" + i, event[i]);
2262
- var op = this.control.config;
2263
- var url = this.crudService.getURL(op);
2264
- this.generalService.genericRequest(this.control.config.method, url, formData)
2265
- .then(function () {
2266
- var _a;
2267
- var separator = ((_a = _this.control.config) === null || _a === void 0 ? void 0 : _a.separator) || ",";
2268
- //se asume que viene namePattern
2269
- if (_this.control.type == "string")
2270
- _this.value = event.map(function (f) { return "" + _this.generalService.jsonConfig.Server + path + "/" + f.name; }).join(separator);
2271
- else if (_this.control.type == "array")
2272
- _this.value = event.map(function (f) { return "" + _this.generalService.jsonConfig.Server + path + "/" + f.name; });
2273
- // SI NO TRAE namePattern, debe retornar un objeto con el nombre y href
2274
- //else if (this.control.config.namePattern && this.control.type == "array") this.value = event.map(x => x.name)
2275
- //else if (!this.control.config.namePattern && this.control.type == "array") this.value = event.map(f => `${this.generalService.jsonConfig.Server}${path}/${f.name}`)
2276
- _this.sendValue();
2277
- var msg = !_this.control.config.limit || _this.control.config.limit == 1 ? "Archivo cargado correctamente!" : "Archivos cargados correctamente!";
2278
- _this.notificationService.addNotification({ severity: 'info', detail: msg }, _this.primeChecking());
2279
- })
2280
- .catch(function () { return _this.notificationService.addNotification({ severity: 'error', detail: "Error al cargar el archivo!" }, _this.primeChecking()); })
2281
- .finally(function () { return _this.uploadingFiles = false; });
2282
- };
2283
- ControlComponent.prototype.refresData = function () {
2284
- var _a, _b;
2285
- if ((_b = (_a = this.control) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.endpointtemp)
2286
- this.loadDataFromService();
2287
- };
2288
- ControlComponent.prototype.setDefaultValue = function () {
2289
- this.tempValue = {};
2290
- if (!this.control.config.optionLabel)
2291
- console.error("No esta bien configurado el control ", this.control);
2292
- else
2293
- this.tempValue[this.control.config.optionLabel] = this.value ? this.value : "";
2294
- };
2295
- ControlComponent.prototype.searchValue = function (value) {
2296
- var _this = this;
2297
- var op = this.control.config;
2298
- var url = this.crudService.getURL(op, undefined, undefined);
2299
- url = url.replace('@id', value);
2300
- this.generalService.genericRequest(this.control.config.method, url)
2301
- .then(function (res) {
2302
- var _a;
2303
- if (((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
2304
- _this.sendObject.emit({ data: res.data[0], optionValue: _this.control.config.optionValue });
2305
- }
2306
- else {
2307
- _this.notificationService.addNotification({ severity: 'warn', detail: "Valor no encontrado." }, _this.primeChecking());
2308
- _this.sendObject.emit({ data: null, optionValue: _this.control.config.optionValue });
2309
- }
2310
- })
2311
- .catch(function (err) {
2312
- _this.notificationService.addNotification({ severity: 'error', detail: "Error al consumir el servicio." }, _this.primeChecking());
2313
- });
2314
- };
2315
- ControlComponent.prototype.primeChecking = function () {
2316
- return new RequestChecking(undefined, undefined, false, undefined, undefined, false, undefined);
2317
- };
2318
- ControlComponent.prototype.instanceDate = function () {
2319
- var format = this.control.formatMoment;
2320
- if (this.value) {
2321
- if (typeof (this.value) == "string" && this.value.includes("T"))
2322
- this.value = new Date(this.value);
2323
- else if (typeof (this.value) == "string")
2324
- this.value = moment__namespace(this.value, format).toDate();
2325
- this.tempValue = moment__namespace(this.value).format("DD/MM/YYYY");
2326
- }
2327
- else {
2328
- this.tempValue = null;
2329
- this.value = null;
2330
- }
2331
- };
2332
- /**
2333
- * Cast tempValue to date
2334
- */
2335
- ControlComponent.prototype.onChangeSDate = function ($event) {
2336
- console.log($event);
2337
- console.log(this.tempValue);
2338
- console.log(this.value);
2339
- var aux = moment__namespace(this.tempValue, "DD/MM/YYYY");
2340
- if (this.tempValue == this.maskDate.replaceAll("9", "_")) {
2341
- this.value = null;
2342
- this.sendValue();
2343
- }
2344
- else if (aux.isValid()) {
2345
- this.value = aux.toDate();
2346
- this.sendValue();
2347
- }
2348
- else {
2349
- this.tempValue = null;
2350
- this.notificationService.addNotification({ severity: 'warn', detail: 'La fecha no es válida' }, this.primeChecking());
2351
- }
2352
- this.cdr.detectChanges();
2353
- };
2354
- ControlComponent.prototype.onChangeDate = function () {
2355
- this.tempValue = moment__namespace(this.value).format("DD/MM/YYYY");
2356
- this.sendValue();
2357
- };
2358
- ControlComponent.prototype.onTouchDescription = function () {
2359
- var _a;
2360
- try {
2361
- (_a = this.tooltips.get(0)) === null || _a === void 0 ? void 0 : _a.activate();
2362
- }
2363
- catch (ex) { }
2364
- };
2365
- ControlComponent.prototype.onUnTouchDescription = function () {
2366
- var _a;
2367
- try {
2368
- (_a = this.tooltips.get(0)) === null || _a === void 0 ? void 0 : _a.deactivate();
2369
- }
2370
- catch (ex) { }
2371
- };
2372
- ControlComponent.prototype.doFocusOut = function () {
2373
- if (document.activeElement) {
2374
- document.activeElement.blur();
2375
- }
2376
- this.cdr.detectChanges();
2377
- };
2378
- ControlComponent.prototype.onClickedAddres = function () {
2379
- this.addressClicked.emit();
2380
- };
2381
- return ControlComponent;
2382
- }());
2383
- 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 });
2384
- 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", addressClicked: "addressClicked" }, viewQueries: [{ propertyName: "tooltips", predicate: i13.Tooltip, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"showTempValue\"><p *ngIf=\"tempValue\">{{tempValue[control.field]}}</p></ng-container>\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=\"'address'\">\r\n <input pInputText type=\"text\" [value]=\"value | formatAddress: control.separador\" autocomplete=\"off\" [disabled]=\"clicked\" (keydown)=\"onClickedAddres()\" (focus)=\"onClickedAddres()\">\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\" [showClear]=\"control.config.showClear\"\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]=\"maskDate\" [placeholder]=\"control.placeholder\"\r\n (onBlur)=\"onChangeSDate($event)\" [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]" }], pipes: { "formatAddress": FormatAddressPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2385
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlComponent, decorators: [{
2386
- type: i0.Component,
2387
- args: [{
2388
- selector: 'sf-control',
2389
- templateUrl: './control.component.html',
2390
- styleUrls: ['./control.component.css'],
2391
- changeDetection: i0.ChangeDetectionStrategy.OnPush
2392
- }]
2393
- }], ctorParameters: function () { return [{ type: GeneralService }, { type: SfCrudService }, { type: i0__namespace.ChangeDetectorRef }, { type: NotificationService }]; }, propDecorators: { showTempValue: [{
2394
- type: i0.Input
2395
- }], control: [{
2396
- type: i0.Input
2397
- }], label: [{
2398
- type: i0.Input
2399
- }], value: [{
2400
- type: i0.Input
2401
- }], appendTo: [{
2402
- type: i0.Input
2403
- }], setValue: [{
2404
- type: i0.Output
2405
- }], sendObject: [{
2406
- type: i0.Output
2407
- }], addressClicked: [{
2408
- type: i0.Output
2409
- }], tooltips: [{
2410
- type: i0.ViewChildren,
2411
- args: [i13.Tooltip]
2412
- }] } });
2413
-
2414
- var FormComponent = /** @class */ (function () {
2415
- function FormComponent(messageService, crudService, domSanitizer, stepService, adoService, jwtService) {
2416
- var _this = this;
2417
- this.messageService = messageService;
2418
- this.crudService = crudService;
2419
- this.domSanitizer = domSanitizer;
2420
- this.stepService = stepService;
2421
- this.adoService = adoService;
2422
- this.jwtService = jwtService;
2423
- this.isDialog = false;
2424
- this.isAddressDialog = false;
2425
- this.controlsLoaded = false;
2426
- this.isMobile = false;
2427
- this.loading = { inProgress: true, target: undefined };
2428
- if (window.innerWidth <= 768)
2429
- this.isMobile = true;
2430
- window.addEventListener('resize', function () {
2431
- if (window.innerWidth <= 768)
2432
- _this.isMobile = true;
2433
- });
2434
- }
2435
- FormComponent.prototype.ngOnChanges = function (changes) {
2436
- this.buildControls();
2437
- };
2438
- FormComponent.prototype.ngOnInit = function () {
2439
- var _this = this;
2440
- try {
2441
- if (this.isAddressDialog)
2442
- this.currentAddress = this.data.currentValue;
2443
- this.jwtService.idKatios = this.crudService.idKatios;
2444
- this.jwtService.servidorIntegraciones = this.crudService.environment.ServidorIntegraciones;
2445
- this.adoService.servidorIntegraciones = this.crudService.environment.ServidorIntegraciones;
2446
- this.idKatios = this.crudService.idKatios;
2447
- this.stepService.requestApproved$.subscribe(function (approved) {
2448
- if (!_this.isDialog && approved) {
2449
- _this.uiEsquema = _this.crudService.getUIEsquema(_this.stepService.currentIndex);
2450
- _this.esquema = _this.crudService.getEsquema(_this.stepService.currentIndex);
2451
- _this.data = _this.crudService.getData(_this.stepService.currentIndex);
2452
- _this.registro = _this.crudService.getRegistro(_this.stepService.currentIndex);
2453
- _this.buildControls();
2454
- }
2455
- });
2456
- }
2457
- catch (error) {
2458
- console.error(error);
2459
- }
2460
- };
2461
- FormComponent.prototype.emitLoadingForm = function ($event) {
2462
- var _this = this;
2463
- this.loading.inProgress = $event;
2464
- Promise.resolve().then(function () { return _this.crudService.formLoading = _this.loading; }); //si no se usa asi el enproceso totea con el simulador
2465
- };
2466
- FormComponent.prototype.buildControls = function () {
2467
- var _this = this;
2468
- var _a, _b, _c;
2469
- this.visible = [];
2470
- this.controlsLoaded = false;
2471
- this.controls = [];
2472
- this.values = [];
2473
- //address
2474
- if (this.isAddressDialog)
2475
- this.newAddress = this.crudService.armarNuevaDireccion("string", this.data, this.crudService.getValue("$..separador", this.data));
2476
- this.uiEsquema.elements.forEach(function (layout, i) {
2477
- var _a;
2478
- var isVisible = layout.conditions ? _this.crudService.isConditionsCompleted(layout.conditions, _this.registro.conditions || [], _this.data) : true;
2479
- _this.visible.push(layout.elements ? layout.elements.map(function () { return isVisible; }) : [isVisible]);
2480
- _this.controls.push([]);
2481
- _this.values.push([]);
2482
- (_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, j) {
2483
- if (element.conditions)
2484
- _this.visible[i][j] = _this.crudService.isConditionsCompleted(element.conditions, _this.registro.conditions || [], _this.data);
2485
- if (element.ngStyle && typeof (element.ngStyle) == "string")
2486
- element.ngStyle = JSON.parse(element.ngStyle);
2487
- if (element.url) {
2488
- _this.controls[i].push(undefined);
2489
- var url = _this.crudService.applyStringKeys(element.url);
2490
- _this.values[i].push(_this.domSanitizer.bypassSecurityTrustResourceUrl(url));
2491
- }
2492
- else if (!element.scope) {
2493
- _this.controls[i].push(undefined);
2494
- _this.values[i].push(undefined);
2495
- }
2496
- else {
2497
- try {
2498
- _this.controls[i].push(_this.crudService.getControl(element.scope, _this.esquema));
2499
- _this.controls[i][j].scope = element.scope;
2500
- _this.values[i].push(_this.crudService.getValue(element.scope, _this.data));
2501
- }
2502
- catch (e) {
2503
- console.log(element);
2504
- console.error(e);
2505
- console.log(_this.controls[i]);
2506
- console.log(_this.values[i]);
2507
- }
2508
- }
2509
- });
2510
- });
2511
- this.controlsLoaded = true;
2512
- var idProceso = (_b = (_a = this.data.ADO) === null || _a === void 0 ? void 0 : _a.dataProceso) === null || _b === void 0 ? void 0 : _b.idProceso;
2513
- if (idProceso && ((_c = this.proceso) === null || _c === void 0 ? void 0 : _c.id) != idProceso)
2514
- this.refreshIntegracion(idProceso);
2515
- };
2516
- FormComponent.prototype.refreshIntegracion = function (idProceso) {
2517
- var _this = this;
2518
- this.emitLoadingForm(true);
2519
- return Promise.all([
2520
- this.adoService.getProceso(idProceso).then(function (proceso) {
2521
- _this.proceso = proceso;
2522
- _this.data.ADO.proceso = _this.proceso;
2523
- })
2524
- ])
2525
- .finally(function () { return _this.emitLoadingForm(false); });
2526
- };
2527
- FormComponent.prototype.extracControlFromTableElements = function (i, j, col) {
2528
- var property = this.controls[i][j].properties[col.col];
2529
- return property;
2530
- };
2531
- FormComponent.prototype.extracValueFromTableElements = function (i, j, k, col) {
2532
- var value = this.values[i][j][k][col.col];
2533
- return value;
2534
- };
2535
- FormComponent.prototype.setValue = function (value, scope, i, j) {
2536
- var _this = this;
2537
- var _a;
2538
- scope = scope.replaceAll('..properties', '');
2539
- if (scope) {
2540
- var control = this.controls[i][j];
2541
- this.values[i][j] = value;
2542
- jsonpath__namespace.value(this.data, scope, value);
2543
- this.crudService.changeData = new ChangeData(value, scope, this.crudService.index);
2544
- this.uiEsquema.elements.forEach(function (layout, iLayout) {
2545
- var _a;
2546
- if (layout.conditions) {
2547
- var isVisible_1 = _this.crudService.isConditionsCompleted(layout.conditions, _this.crudService.getRegistro(_this.crudService.index).conditions || [], _this.data);
2548
- if (layout.elements)
2549
- _this.visible[iLayout] = layout.elements.map(function () { return isVisible_1; });
2550
- else
2551
- _this.visible[iLayout][0] = isVisible_1;
2552
- }
2553
- (_a = layout.elements) === null || _a === void 0 ? void 0 : _a.forEach(function (element, indexEl) {
2554
- if (element.conditions) {
2555
- _this.visible[iLayout][indexEl] = _this.crudService.isConditionsCompleted(element.conditions, _this.registro.conditions || [], _this.data);
2556
- }
2557
- });
2558
- });
2559
- (_a = control.applyKeys) === null || _a === void 0 ? void 0 : _a.forEach(function (i) {
2560
- var key = _this.registro.keys ? _this.registro.keys[i] : undefined;
2561
- if (key)
2562
- _this.crudService.applyKey(key, _this.registro, key.indexData ? _this.crudService.getData(key.indexData) : _this.data);
2563
- });
2564
- this.buildControls();
2565
- }
2566
- this.crudService.applyValuesOnEvent('onChange', this.esquema, undefined, this.data);
2567
- };
2568
- FormComponent.prototype.sendNotification = function (message) {
2569
- this.messageService.add(message);
2570
- };
2571
- FormComponent.prototype.applyValuesFromObject = function (event) {
2572
- if (event.optionValue) {
2573
- for (var i = 0; i < event.optionValue.length; i++) {
2574
- var optionVal = event.optionValue[i];
2575
- var newVal = event.data ? this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]) : null;
2576
- jsonpath__namespace.value(this.data, optionVal.scope.replace('.properties', ''), this.aplyFormatValue(optionVal.scope, event.data[optionVal.key]));
2577
- this.setValueByScope(optionVal.scope, newVal);
2578
- }
2579
- }
2580
- };
2581
- FormComponent.prototype.setValueByScope = function (scope, newVal) {
2582
- var _this = this;
2583
- var _loop_1 = function (i) {
2584
- var row = this_1.controls[i];
2585
- row.forEach(function (el, j) {
2586
- if (el.scope && el.scope.replace('.properties', '') == scope.replace('.properties', '')) {
2587
- _this.values[i][j] = newVal;
2588
- }
2589
- });
2590
- };
2591
- var this_1 = this;
2592
- for (var i = 0; i < this.controls.length; i++) {
2593
- _loop_1(i);
2594
- }
2595
- };
2596
- FormComponent.prototype.aplyFormatValue = function (scope, value) {
2597
- var control = jsonpath__namespace.query(this.esquema, scope)[0];
2598
- var resp;
2599
- switch (control.type) {
2600
- case 'date':
2601
- resp = new Date("" + value);
2602
- break;
2603
- case 'numeric':
2604
- resp = +value;
2605
- break;
2606
- default:
2607
- resp = value;
2608
- break;
2609
- }
2610
- return resp;
2611
- };
2612
- FormComponent.prototype.editRow = function (element, data, index) {
2613
- this.stepService.addCustomChildrenEvent("onClickedEditButton", { element: element, data: data, index: index });
2614
- };
2615
- FormComponent.prototype.deleteRow = function (element, index) {
2616
- this.stepService.addCustomChildrenEvent("onClickedDeleteButton", { element: element, index: index });
2617
- };
2618
- FormComponent.prototype.addObjectArray = function (element) {
2619
- this.stepService.addCustomChildrenEvent("onClickedAddButton", { element: element });
2620
- };
2621
- FormComponent.prototype.openPopUpDireccion = function (scope) {
2622
- this.stepService.addCustomChildrenEvent("onClickedAddress", { scope: scope });
2623
- };
2624
- FormComponent.prototype.onStateDocument = function (state) {
2625
- this.data.pdf.signed = state.toUpperCase() == "FIRMADO";
2626
- };
2627
- FormComponent.prototype.onSimuladorChange = function ($event) {
2628
- var _this = this;
2629
- Promise.resolve().then(function () { return Object.assign(_this.data, $event); });
2630
- };
2631
- FormComponent.prototype.goToADO = function () {
2632
- var _a;
2633
- var url = window.location.href;
2634
- var callback = url.split('?')[0] + ("?id=" + this.data.idForm);
2635
- var idProceso = (_a = this.data.ADO.dataProceso) === null || _a === void 0 ? void 0 : _a.idProceso;
2636
- var dataProceso = this.data.ADO.dataProceso;
2637
- dataProceso.ctivo = this.data.idForm;
2638
- //this.data.ADO.idTransaction = null
2639
- //this.data.ADO.idProceso = null
2640
- if (idProceso) {
2641
- window.location.href = this.crudService.environment.WebUtilities + "GWV/ADO/" + this.crudService.idKatios + "?id=" + idProceso;
2642
- window.location.reload();
2643
- }
2644
- else if (dataProceso) {
2645
- window.location.href = this.crudService.environment.WebUtilities + "GWV/ADO/" + this.crudService.idKatios + "?dataProceso=" + btoa(JSON.stringify(dataProceso)) + "&callback=" + encodeURIComponent(callback);
2646
- window.location.reload();
2647
- }
2648
- };
2649
- FormComponent.prototype.onTouchDescription = function (id, alignRight) {
2650
- if (alignRight === void 0) { alignRight = true; }
2651
- var foundTooltip = this.tooltips.find(function (tooltip) { return tooltip.el.nativeElement.id === id; });
2652
- try {
2653
- foundTooltip.activate();
2654
- alignRight ? foundTooltip.alignRight() : foundTooltip.alignTop();
2655
- }
2656
- catch (ex) { }
2657
- };
2658
- FormComponent.prototype.onUnTouchDescription = function (descripcion) {
2659
- var foundTooltip = this.tooltips.find(function (tooltip) { return tooltip.el.nativeElement.id === descripcion; });
2660
- try {
2661
- foundTooltip.deactivate();
2662
- }
2663
- catch (ex) { }
2664
- };
2665
- FormComponent.prototype.copyToClipboard = function (idProceso) {
2666
- var url = this.crudService.environment.WebUtilities + "GWV/ADO/" + this.crudService.idKatios + "?id=" + idProceso;
2667
- navigator.clipboard.writeText(url);
2668
- };
2669
- return FormComponent;
2670
- }());
2671
- 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 });
2672
- 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", isAddressDialog: "isAddressDialog", separador: "separador" }, viewQueries: [{ propertyName: "tooltips", predicate: i13.Tooltip, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div *ngIf=\"controlsLoaded\" class=\"frm-container\">\r\n <ng-container *ngIf=\"isAddressDialog && currentAddress\">\r\n Direcci\u00F3n actual: {{currentAddress | formatAddress: separador}}\r\n <br>\r\n </ng-container>\r\n <br>\r\n <ng-container *ngIf=\"isAddressDialog\">\r\n Direcci\u00F3n nueva: {{newAddress | formatAddress: separador}}\r\n </ng-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)\"\r\n (addressClicked)=\"openPopUpDireccion(el.scope)\"></sf-control>\r\n <div *ngSwitchCase=\"'Texto'\" [ngStyle]=\"{'height': '100%', 'margin-block': 'auto'}\">\r\n <p>{{el.label}}</p>\r\n </div>\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)\"\r\n (addressClicked)=\"openPopUpDireccion(el.scope)\"></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 <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=\"'address'\">\r\n <td>{{rowData[col.col] | formatAddress: extracControlFromTableElements(i, j, col).separador }}</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>\r\n", 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", "addressClicked"] }, { 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: { "formatAddress": FormatAddressPipe, "currency": i12__namespace.CurrencyPipe, "date": i12__namespace.DatePipe } });
2673
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FormComponent, decorators: [{
2674
- type: i0.Component,
2675
- args: [{
2676
- selector: 'app-form',
2677
- templateUrl: './form.component.html',
2678
- styleUrls: ['./form.component.css']
2679
- }]
2680
- }], 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: [{
2681
- type: i0.Input
2682
- }], esquema: [{
2683
- type: i0.Input
2684
- }], data: [{
2685
- type: i0.Input
2686
- }], isDialog: [{
2687
- type: i0.Input
2688
- }], isAddressDialog: [{
2689
- type: i0.Input
2690
- }], separador: [{
2691
- type: i0.Input
2692
- }], tooltips: [{
2693
- type: i0.ViewChildren,
2694
- args: [i13.Tooltip]
2695
- }] } });
2696
-
2697
- var RegistroComponent = /** @class */ (function () {
2698
- function RegistroComponent(generalService, activeRoute, messageService, sfCrudService, stepService, sfPdfSignService, sfSimuladorService, notificationService, router) {
2699
- this.generalService = generalService;
2700
- this.activeRoute = activeRoute;
2701
- this.messageService = messageService;
2702
- this.sfCrudService = sfCrudService;
2703
- this.stepService = stepService;
2704
- this.sfPdfSignService = sfPdfSignService;
2705
- this.sfSimuladorService = sfSimuladorService;
2706
- this.notificationService = notificationService;
2707
- this.router = router;
2708
- this.idKatios = '';
2709
- this.trx = '';
2710
- this.id = '';
2711
- this.ids = [];
2712
- this.sendData = new i0.EventEmitter();
2713
- this.onSubmit = new i0.EventEmitter();
2714
- this.subsToKillOnDestroy = [];
2715
- this.isLocal = false;
2716
- this.displays = [];
2717
- this.firstLoad = true;
2718
- this.dialogElements = [];
2719
- this.items = [];
2720
- this.loading = { inProgress: true, target: undefined };
2721
- }
2722
- Object.defineProperty(RegistroComponent.prototype, "idEntidad", {
2723
- set: function (value) {
2724
- this.idForm = value;
2725
- },
2726
- enumerable: false,
2727
- configurable: true
2728
- });
2729
- RegistroComponent.prototype.ngOnChanges = function (changes) {
2730
- if (this.idKatios && this.idForm && this.environment && (changes["idKatios"] || changes["idEntidad"])) {
2731
- this.sfCrudService.ids = this.ids;
2732
- this.sfCrudService.idKatios = this.idKatios;
2733
- this.sfCrudService.environment = this.environment;
2734
- this.generalService.idKatios = this.idKatios;
2735
- this.generalService.environment = this.environment;
2736
- this.sfPdfSignService.setEnviroments(this.environment);
2737
- this.sfSimuladorService.environments = this.environment;
2738
- this.sfSimuladorService.idKatios = this.idKatios;
2739
- this.loadConfigCrud();
2740
- }
2741
- };
2742
- RegistroComponent.prototype.ngOnInit = function () {
2743
- var _this = this;
2744
- this.cargarMascarasDirecciones();
2745
- this.instanceSubsStepService();
2746
- this.notificationSubscription = this.notificationService.notificationAdded$().subscribe(function (notification) {
2747
- var _a, _b;
2748
- if ((_a = notification === null || notification === void 0 ? void 0 : notification.requestChecking) === null || _a === void 0 ? void 0 : _a.useSwal) {
2749
- Swal__default["default"].fire(notification.msg).then(function (res) {
2750
- var _a, _b;
2751
- if (notification.msg.showCancelButton && res.isDismissed && ((_a = notification.requestChecking) === null || _a === void 0 ? void 0 : _a.cancelRedirect)) {
2752
- if (notification.requestChecking.cancelRedirect.toUpperCase() == "INICIO")
2753
- _this.sfCrudService.redirectToInicio();
2754
- else
2755
- window.location.href = notification.requestChecking.cancelRedirect;
2756
- }
2757
- else if (res.isConfirmed && ((_b = notification.requestChecking) === null || _b === void 0 ? void 0 : _b.redirect)) {
2758
- if (notification.requestChecking.redirect.toUpperCase() == "INICIO")
2759
- _this.sfCrudService.redirectToInicio();
2760
- else
2761
- window.location.href = notification.requestChecking.redirect;
2762
- }
2763
- });
2764
- }
2765
- else if ((notification === null || notification === void 0 ? void 0 : notification.msg) && ((_b = notification.requestChecking) === null || _b === void 0 ? void 0 : _b.redirect)) {
2766
- _this.messageService.add(notification.msg);
2767
- if (notification.requestChecking.redirect.toUpperCase() == "INICIO")
2768
- _this.sfCrudService.redirectToInicio();
2769
- else {
2770
- var newURL = _this.sfCrudService.getURLRedirect(notification.requestChecking.redirect);
2771
- window.location.href = newURL;
2772
- window.location.reload();
2773
- }
2774
- }
2775
- else if (notification === null || notification === void 0 ? void 0 : notification.msg) {
2776
- _this.messageService.add(notification.msg);
2777
- }
2778
- });
2779
- };
2780
- RegistroComponent.prototype.ngOnDestroy = function () {
2781
- if (this.notificationSubscription) {
2782
- this.notificationSubscription.unsubscribe();
2783
- }
2784
- this.subsToKillOnDestroy.forEach(function (sub) { return sub.unsubscribe(); });
2785
- this.stepService.reset();
2786
- this.sfCrudService.reset();
2787
- console.log("destroy");
2788
- };
2789
- RegistroComponent.prototype.instanceSubsStepService = function () {
2790
- var _this = this;
2791
- this.subsToKillOnDestroy.push(this.stepService.customChildrenEvents$.subscribe(function (event) {
2792
- if (!event)
2793
- return;
2794
- switch (event.name.toUpperCase()) {
2795
- case "ONCLICKEDEDITBUTTON":
2796
- _this.onClickedEditButton(event.data.element, event.data.data, event.data.index);
2797
- break;
2798
- case "ONCLICKEDDELETEBUTTON":
2799
- _this.deleteRow(event.data.element, event.data.index);
2800
- break;
2801
- case "ONCLICKEDADDBUTTON":
2802
- _this.onClickedAddButton(event.data.element);
2803
- break;
2804
- case "ONCLICKEDADDRESS":
2805
- _this.onClickedAddress(event.data.scope);
2806
- break;
2807
- }
2808
- }));
2809
- this.subsToKillOnDestroy.push(this.stepService.requestApproval$.subscribe(function (value) {
2810
- console.log(value);
2811
- if ((value === null || value === void 0 ? void 0 : value.desired) != undefined) {
2812
- if (value.desired < value.current) {
2813
- _this.stepService.requestApproved = true;
2814
- _this.sfCrudService.index = _this.stepService.currentIndex;
2815
- _this.scrollTop();
2816
- }
2817
- else {
2818
- var operation = _this.sfCrudService.getRegistro(_this.indexCrud).operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
2819
- if (!_this.validateData(operation, _this.sfCrudService.getData(_this.indexCrud), _this.sfCrudService.getRegistro(_this.indexCrud).conditions || []))
2820
- _this.stepService.requestApproved = false;
2821
- else if (operation.method != null)
2822
- _this.uploadInfoStep(value);
2823
- else if (operation.answerChecking) { //no tiene request, solo un mensaje
2824
- _this.stepService.requestApproved = true;
2825
- _this.loading.inProgress = false;
2826
- _this.sfCrudService.formLoading = _this.loading;
2827
- _this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("success", undefined, "Información subida correctamente", operation.answerChecking), {}, operation.answerChecking), operation.answerChecking);
2828
- _this.sfCrudService.index = _this.stepService.currentIndex;
2829
- _this.scrollTop();
2830
- }
2831
- else { //no tiene nada configurado
2832
- _this.stepService.requestApproved = true;
2833
- _this.sfCrudService.index = _this.stepService.currentIndex;
2834
- _this.scrollTop();
2835
- }
2836
- }
2837
- }
2838
- }));
2839
- console.log("subs step service terminadas");
2840
- };
2841
- RegistroComponent.prototype.uploadInfoStep = function (position) {
2842
- var _this = this;
2843
- this.loading.inProgress = true;
2844
- this.sfCrudService.formLoading = this.loading;
2845
- this.submit(position.current).then(function () {
2846
- var _a, _b, _c;
2847
- 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;
2848
- console.log(_this.items.length);
2849
- if (_this.items.length == 1) {
2850
- _this.stepService.requestApproved = false;
2851
- //this.stepService.desiredIndex = undefined
2852
- _this.sfCrudService.index = _this.stepService.currentIndex;
2853
- }
2854
- else if (!tieneRedirect) {
2855
- _this.advance(position.current, position.desired, false);
2856
- }
2857
- _this.scrollTop();
2858
- })
2859
- .catch(function () {
2860
- _this.stepService.requestApproved = false;
2861
- }).finally(function () {
2862
- _this.loading.inProgress = false;
2863
- _this.sfCrudService.formLoading = _this.loading;
2864
- });
2865
- };
2866
- RegistroComponent.prototype.onClickBtnSubmit = function () {
2867
- this.stepService.requestApproval = this.indexCrud;
2868
- };
2869
- RegistroComponent.prototype.loadConfigCrud = function () {
2870
- var _this = this;
2871
- this.loading.inProgress = true;
2872
- this.sfCrudService.formLoading = this.loading;
2873
- this.sfCrudService.dataExt = this.dataExt;
2874
- this.sfCrudService.crudLoaded = false;
2875
- if (this.loadSession()) {
2876
- this.sfCrudService.crudLoaded = true;
2877
- return;
2878
- }
2879
- this.generalService.getCrudByEntidad(this.idKatios, this.idForm)
2880
- .then(function (res) {
2881
- console.log("crud cargado");
2882
- _this.sfCrudService.uiEsquemas = res.uiEsquemas;
2883
- _this.sfCrudService.esquemas = res.esquemas;
2884
- _this.sfCrudService.registros = res.registros;
2885
- _this.customizeCompany(res.uiEsquemas);
2886
- _this.sfCrudService.registros.forEach(function (_, i) { return _this.sfCrudService.setTrx("c", i); });
2887
- _this.loadData()
2888
- .then(function () {
2889
- _this.setLabelSumbit();
2890
- _this.sfCrudService.dataset.forEach(function (data, i) {
2891
- var _a;
2892
- if (_this.activeRoute.snapshot.queryParams["_idGWVADO"] && ((_a = data.ADO) === null || _a === void 0 ? void 0 : _a.dataProceso)) {
2893
- data.ADO.dataProceso.idProceso = _this.activeRoute.snapshot.queryParams["_idGWVADO"];
2894
- }
2895
- if (_this.activeRoute.snapshot.queryParams["_idADO"] && data.ADO) {
2896
- data.ADO.idTransaction = _this.activeRoute.snapshot.queryParams["_idADO"];
2897
- }
2898
- _this.sfCrudService.setDataSet(data, i);
2899
- });
2900
- })
2901
- .finally(function () {
2902
- var willExecuteRequest = _this.advance(0, _this.sfCrudService.uiEsquemas.length - 1, true);
2903
- _this.createSteps(res.uiEsquemas);
2904
- _this.sfCrudService.crudLoaded = true;
2905
- if (!willExecuteRequest) {
2906
- _this.loading.inProgress = false;
2907
- _this.sfCrudService.formLoading = _this.loading;
2908
- }
2909
- });
2910
- }).catch(function (ex) {
2911
- console.error(ex);
2912
- _this.loading.inProgress = false;
2913
- _this.sfCrudService.formLoading = _this.loading;
2914
- });
2915
- };
2916
- /**
2917
- * Step will advance until esquema is not completed
2918
- */
2919
- RegistroComponent.prototype.advance = function (start, limit, executeRequest) {
2920
- var _this = this;
2921
- var _a;
2922
- console.log("advance desde ", start, " hasta ", limit);
2923
- var i = start;
2924
- var op;
2925
- var willExecuteRequest = false;
2926
- var registro;
2927
- while (i < limit) {
2928
- registro = this.sfCrudService.getRegistro(i);
2929
- op = registro.operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(i)); });
2930
- if (!this.validateData(op, this.sfCrudService.getData(i), registro.conditions || [], false))
2931
- break;
2932
- i++;
2933
- }
2934
- this.sfCrudService.index = i;
2935
- this.stepService.currentIndex = i;
2936
- this.stepService.desiredIndex = i;
2937
- console.log("advance", i);
2938
- this.stepService.requestApproved = true;
2939
- registro = this.sfCrudService.getRegistro(i);
2940
- var dataCurrentStep = this.sfCrudService.getData(i);
2941
- op = this.sfCrudService.getRegistro(i).operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(i)); });
2942
- if (executeRequest && (this.activeRoute.snapshot.queryParams["_idGWVADO"] || this.activeRoute.snapshot.queryParams["_idADO"]) //Viene de ADO
2943
- && dataCurrentStep.ADO && this.validateData(op, dataCurrentStep, (_a = registro.conditions) !== null && _a !== void 0 ? _a : [], false) //El step esta completo
2944
- ) {
2945
- console.log("advance with approval", i);
2946
- this.stepService.requestApproval = i;
2947
- willExecuteRequest = true;
2948
- }
2949
- return willExecuteRequest;
2950
- };
2951
- RegistroComponent.prototype.loadSession = function () {
2952
- var wasLoaded = this.sfCrudService.loadSession();
2953
- if (wasLoaded) {
2954
- this.customizeCompany(this.sfCrudService.uiEsquemas);
2955
- this.stepService.currentIndex = this.sfCrudService.index;
2956
- this.createSteps(this.sfCrudService.uiEsquemas);
2957
- this.loading.inProgress = false;
2958
- this.sfCrudService.formLoading = this.loading;
2959
- }
2960
- return wasLoaded;
2961
- };
2962
- RegistroComponent.prototype.customizeCompany = function (uiEsquemas) {
2963
- var _a, _b, _c, _d, _e, _f;
2964
- this.sfCrudService.configEmpresa = (_a = uiEsquemas.find(function (ui) { return ui.general; })) === null || _a === void 0 ? void 0 : _a.general;
2965
- this.logo = (_c = (_b = this.sfCrudService.configEmpresa) === null || _b === void 0 ? void 0 : _b.icons) === null || _c === void 0 ? void 0 : _c.carga;
2966
- if (this.sfCrudService.configEmpresa) {
2967
- if ((_d = this.sfCrudService.configEmpresa.colors) === null || _d === void 0 ? void 0 : _d.main)
2968
- this.color = this.sfCrudService.configEmpresa.colors.main;
2969
- if ((_e = this.sfCrudService.configEmpresa.colors) === null || _e === void 0 ? void 0 : _e.secondary)
2970
- this.color2 = this.sfCrudService.configEmpresa.colors.secondary;
2971
- if ((_f = this.sfCrudService.configEmpresa.colors) === null || _f === void 0 ? void 0 : _f.button)
2972
- this.colorButton = this.sfCrudService.configEmpresa.colors.button;
2973
- }
2974
- if (!this.colorButton)
2975
- this.colorButton = "blue";
2976
- if (!this.color2)
2977
- this.color2 = "blue";
2978
- if (!this.color)
2979
- this.color = "blue";
2980
- };
2981
- RegistroComponent.prototype.scrollTop = function () {
2982
- window.scroll({
2983
- top: 0,
2984
- left: 0,
2985
- behavior: 'smooth'
2986
- });
2987
- };
2988
- RegistroComponent.prototype.createSteps = function (uiEsquemas) {
2989
- var _this = this;
2990
- this.items = [];
2991
- uiEsquemas.forEach(function (uiEsq, index) {
2992
- if (uiEsq.step)
2993
- _this.items.push({ label: uiEsq.step, routerLink: index, queryParamsHandling: "preserve" });
2994
- else
2995
- _this.items.push({ label: "paso " + index, routerLink: index });
2996
- _this.sfCrudService.getRegistro(index); //ver si tiene un change
2997
- });
2998
- };
2999
- /**
3000
- * Instancia todos los esquemas, y realiza los requests para traer la data de todos los step.
3001
- * @param esquema
3002
- * @param registro
3003
- * @returns
3004
- */
3005
- RegistroComponent.prototype.loadData = function () {
3006
- var _this = this;
3007
- this.sfCrudService.esquemas.forEach(function (esquema, i) {
3008
- var op = _this.sfCrudService.registros[i].operations.find(function (x) { return x.type.startsWith(_this.sfCrudService.getTrx(i)); });
3009
- _this.sfCrudService.setDataSet(_this.sfCrudService.createObject(esquema, op), i);
3010
- });
3011
- console.log("loadData");
3012
- return Promise.all(this.sfCrudService.registros.map(function (registro, i) { return _this.ids.length > 0 ? _this.getInfoRegistro(registro, i, _this.ids[i]) : Promise.resolve(); }));
3013
- };
3014
- RegistroComponent.prototype.getInfoRegistro = function (configRegistro, index, id) {
3015
- var _this = this;
3016
- var op = configRegistro.operations.find(function (x) { return x.type == 'read'; });
3017
- if (!op)
3018
- return;
3019
- var url = this.sfCrudService.getURL(op, index, id);
3020
- return this.generalService.genericRequest(op.method, url)
3021
- .then(function (res) {
3022
- var value = undefined;
3023
- if (res === null || res === void 0 ? void 0 : res.data) {
3024
- value = Array.isArray(res.data) ? res.data[0] : res.data;
3025
- }
3026
- else
3027
- value = Array.isArray(res) ? res[0] : res;
3028
- _this.sfCrudService.applyObjectKeys(value, op.keysEsquema || [], configRegistro);
3029
- if (op.changeTrx)
3030
- op.changeTrx.forEach(function (x) { return _this.sfCrudService.setTrx(x.trx, x.index); });
3031
- console.log("getInfoRegistro", op.changeTrx);
3032
- })
3033
- .catch(function (error) {
3034
- console.log(error);
3035
- var errorChecking;
3036
- if (Array.isArray(op.errorChecking))
3037
- errorChecking = op.errorChecking[0];
3038
- else
3039
- errorChecking = op.errorChecking;
3040
- _this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("error", "Formulario no cargado correctamente", "", errorChecking), error.error, errorChecking), errorChecking);
3041
- throw error;
3042
- });
3043
- };
3044
- RegistroComponent.prototype.setDefaultValue = function (value) {
3045
- var _a;
3046
- var data = null;
3047
- if (value.key && ((_a = this.sfCrudService.currentOperation) === null || _a === void 0 ? void 0 : _a.keys)) {
3048
- data = this.sfCrudService.getValueKey(this.sfCrudService.currentOperation.keys.find(function (k) { return k.key == value.key; }));
3049
- value = data;
3050
- }
3051
- else {
3052
- switch (value) {
3053
- case '@uactivo':
3054
- data = this.user.UsuarioSistema.TDOC + "-" + this.user.UsuarioSistema.NDOC;
3055
- break;
3056
- case '@tdocactivo':
3057
- data = this.user.UsuarioSistema.TDOC;
3058
- break;
3059
- case '@ndocactivo':
3060
- data = this.user.UsuarioSistema.NDOC;
3061
- break;
3062
- case '@hoy':
3063
- data = new Date();
3064
- break;
3065
- default:
3066
- data = value;
3067
- break;
3068
- }
3069
- return data;
3070
- }
3071
- };
3072
- Object.defineProperty(RegistroComponent.prototype, "indexCrud", {
3073
- get: function () {
3074
- return this.stepService.currentIndex;
3075
- },
3076
- enumerable: false,
3077
- configurable: true
3078
- });
3079
- RegistroComponent.prototype.primeChecking = function () {
3080
- return new RequestChecking(undefined, undefined, false, undefined, undefined, false, undefined);
3081
- };
3082
- RegistroComponent.prototype.submit = function (index) {
3083
- var _this = this;
3084
- this.sfCrudService.applyValuesOnEvent('onSubmit', this.sfCrudService.getEsquema(index), undefined, this.sfCrudService.getData(index));
3085
- var registro = this.sfCrudService.getRegistro(index);
3086
- console.log("trx actual: ", this.sfCrudService.getTrx(this.indexCrud));
3087
- var operation = registro.operations.find(function (op) { return op.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
3088
- var url = this.sfCrudService.getURL(operation, index);
3089
- return this.generalService.genericRequest(operation.method, url, this.sfCrudService.getData(index))
3090
- .then(function (res) {
3091
- if (res === null)
3092
- res = {};
3093
- res = _this.sfCrudService.applyObjectKeys(res, operation.keysEsquema || [], registro);
3094
- _this.sfCrudService.setAnswers(res, _this.indexCrud);
3095
- if (operation.changeTrx && Array.isArray(operation.changeTrx))
3096
- operation.changeTrx.forEach(function (x) { return _this.sfCrudService.setTrx(x.trx, x.index); });
3097
- _this.notificationService.addNotification(_this.notificationService.generateMessage(_this.notificationService.genDefaultMessage("success", undefined, "Información subida correctamente", operation.answerChecking), res, operation.answerChecking), operation.answerChecking);
3098
- return res;
3099
- })
3100
- .catch(function (err) {
3101
- console.error(err);
3102
- _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);
3103
- throw new Error(err);
3104
- });
3105
- // return Promise.resolve({})
3106
- };
3107
- RegistroComponent.prototype.onCloseAddItem = function (index) {
3108
- var scope = this.dialogElements[index].scope.replaceAll('.properties', '');
3109
- var item = ___namespace.cloneDeep(this.dialogElements[index].data);
3110
- if (index == 0) {
3111
- jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope)[0].push(item);
3112
- }
3113
- else
3114
- jsonpath__namespace.query(this.dialogElements[index - 1].data, scope)[0].push(item);
3115
- };
3116
- RegistroComponent.prototype.deleteRow = function (element, indexElement) {
3117
- var scope = element.scope.replaceAll('.properties', '');
3118
- var indexDialog = this.dialogElements.length - 1;
3119
- if (indexDialog == -1)
3120
- jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope)[0].splice(indexElement, 1);
3121
- else {
3122
- indexDialog = indexDialog == 0 ? 1 : indexDialog;
3123
- jsonpath__namespace.query(this.dialogElements[indexDialog - 1].data, scope)[0].splice(indexElement, 1);
3124
- }
3125
- this.sfCrudService.applyValuesOnEvent('onChange', this.sfCrudService.getEsquema(this.indexCrud), element.scope.replace('$..properties.', ''), this.sfCrudService.getData(this.indexCrud));
3126
- };
3127
- RegistroComponent.prototype.onCloseEditRow = function (index) {
3128
- var scope = undefined;
3129
- try {
3130
- var iArray = this.dialogElements[index].index;
3131
- scope = this.dialogElements[index].scope.replaceAll('.properties', '');
3132
- var item = ___namespace.cloneDeep(this.dialogElements[index].data);
3133
- if (index == 0) {
3134
- jsonpath__namespace.query(this.sfCrudService.getData(this.indexCrud), scope)[0][iArray] = item;
3135
- }
3136
- else {
3137
- jsonpath__namespace.query(this.dialogElements[index - 1].data, scope)[0][iArray] = item;
3138
- }
3139
- }
3140
- catch (error) {
3141
- console.error(error);
3142
- console.log(this.dialogElements);
3143
- console.log(index);
3144
- console.log(scope);
3145
- console.log(this.indexCrud);
3146
- console.log(this.sfCrudService.getData(this.indexCrud));
3147
- throw error;
3148
- }
3149
- };
3150
- RegistroComponent.prototype.validateData = function (operation, data, conditions, printErrors) {
3151
- if (printErrors === void 0) { printErrors = true; }
3152
- var _a;
3153
- if (((_a = operation === null || operation === void 0 ? void 0 : operation.validations) === null || _a === void 0 ? void 0 : _a.type) == 'local') {
3154
- var err = this.sfCrudService.validateDataLocal(operation, data, conditions);
3155
- if (err.length != 0 && printErrors)
3156
- this.notificationService.addNotification({ severity: 'warn', detail: err.slice(0, 5).join('. ') }, this.primeChecking());
3157
- return err.length == 0;
3158
- }
3159
- return true;
3160
- };
3161
- RegistroComponent.prototype.onConfirm = function () {
3162
- this.messageService.clear('c');
3163
- };
3164
- RegistroComponent.prototype.onReject = function () {
3165
- this.messageService.clear('c');
3166
- };
3167
- RegistroComponent.prototype.onClickedAddress = function (scope) {
3168
- var _this = this;
3169
- var _a;
3170
- var j = 1, k = 0;
3171
- var separador = (_a = jsonpath__namespace.query(this.sfCrudService.esquemas[this.indexCrud], scope)[0]) === null || _a === void 0 ? void 0 : _a.separador;
3172
- var dataPadre = this.dialogElements.length > 0 ? this.dialogElements[this.dialogElements.length - 1].data : this.sfCrudService.dataset[this.indexCrud];
3173
- var currentValue = jsonpath__namespace.query(dataPadre, scope.replaceAll('.properties', ''))[0];
3174
- var currentValues = currentValue === null || currentValue === void 0 ? void 0 : currentValue.split(separador);
3175
- var esquema = {
3176
- type: "object",
3177
- validations: {
3178
- type: "local",
3179
- required: []
3180
- },
3181
- properties: {
3182
- currentValue: {
3183
- type: "string",
3184
- default: currentValue
3185
- },
3186
- separador: {
3187
- type: "string",
3188
- default: separador
3189
- }
3190
- }
3191
- };
3192
- var uiesquema = { elements: [] };
3193
- var traductorTamaniosMascaras = {
3194
- "grande": "field col-12 md:col-4",
3195
- "pequeño": "field col-12 md:col-2",
3196
- "mediano": "field col-12 md:col-3",
3197
- };
3198
- this.cargarMascarasDirecciones().then(function () {
3199
- var op = _this.sfCrudService.registros[_this.indexCrud].operations.find(function (x) { return x.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
3200
- _this.sfCrudService.mascaras.forEach(function (mascara) {
3201
- //generar el uiesquema de las direcciones
3202
- uiesquema.elements.push({
3203
- "type": "Label",
3204
- "class": "col-12 md:col-12",
3205
- "style": "font-size: medium; color:white; background: var(--primary-color) !important; border-radius: 10px; text-align: center;",
3206
- "label": "L\u00EDnea " + mascara.linea
3207
- });
3208
- uiesquema.elements.push({
3209
- "type": "HorizontalLayout",
3210
- "class": "p-fluid p-formgrid grid",
3211
- "elements": []
3212
- });
3213
- mascara.Campo.forEach(function (campo) {
3214
- if (campo.Tipo.toLocaleLowerCase() == "label") {
3215
- uiesquema.elements[j].elements.push({
3216
- "type": "Texto",
3217
- "class": "my-auto",
3218
- "label": campo.Valor,
3219
- "scope": "$..properties." + campo.Id,
3220
- "ngStyle": {
3221
- "font-size": "1.5rem"
3222
- }
3223
- });
3224
- }
3225
- else {
3226
- uiesquema.elements[j].elements.push({
3227
- "type": "Control",
3228
- "class": campo.Tamaño ? traductorTamaniosMascaras[campo.Tamaño.toLocaleLowerCase()] : traductorTamaniosMascaras.mediano,
3229
- "scope": "$..properties." + campo.Id
3230
- });
3231
- }
3232
- //generar el esquema de las direcciones
3233
- if (campo.Tipo.toLocaleLowerCase() == "combo") {
3234
- var customOptions_1 = [];
3235
- var valores = campo.Valores.split(",");
3236
- valores.forEach(function (valor) { return customOptions_1.push({ label: valor.split("-")[0], value: valor.split("-")[1] }); });
3237
- esquema.properties[campo.Id] = {
3238
- type: "string",
3239
- subtype: "dropdown",
3240
- default: _this.getDefaultValueDireccion(k, currentValues),
3241
- config: {
3242
- optionLabel: "label",
3243
- optionValue: "value",
3244
- customOptions: customOptions_1,
3245
- showClear: k >= 2
3246
- }
3247
- };
3248
- }
3249
- else if (campo.Tipo.toLocaleLowerCase() == "text" || campo.Tipo.toLocaleLowerCase() == "label") {
3250
- esquema.properties[campo.Id] = {
3251
- type: "string",
3252
- subtype: "input",
3253
- default: _this.getDefaultValueDireccion(k, currentValues)
3254
- };
3255
- }
3256
- else if (campo.Tipo.toLocaleLowerCase() == "numeric") {
3257
- esquema.properties[campo.Id] = {
3258
- type: "numeric",
3259
- subtype: "decimal",
3260
- default: _this.getDefaultValueDireccion(k, currentValues)
3261
- };
3262
- }
3263
- if (esquema.validations.required.length < 2) { //validar los primeros 2 campos
3264
- esquema.validations.required.push({
3265
- "field": "$.." + campo.Id,
3266
- "message": "Por favor digite el campo N\u00B0 " + (esquema.validations.required.length + 1)
3267
- });
3268
- }
3269
- k += 1;
3270
- });
3271
- j += 2;
3272
- });
3273
- var currentElement = {
3274
- data: _this.sfCrudService.createObject(esquema, op),
3275
- uiEsquema: uiesquema,
3276
- esquema: esquema,
3277
- scope: scope,
3278
- index: 0,
3279
- isAddressDialog: true,
3280
- separador: separador,
3281
- operation: "address"
3282
- };
3283
- console.log(currentElement);
3284
- _this.displays.push(true);
3285
- _this.dialogElements.push(currentElement);
3286
- });
3287
- };
3288
- RegistroComponent.prototype.getDefaultValueDireccion = function (index, currentValues) {
3289
- var valoresLiterales = [];
3290
- this.sfCrudService.mascaras.forEach(function (mascara) {
3291
- mascara.Campo.forEach(function (campo) {
3292
- if (campo.Valor && campo.Tipo.toLocaleLowerCase() == "label")
3293
- valoresLiterales.push(campo.Valor);
3294
- });
3295
- });
3296
- var invalidCurrentValues = ["", null, undefined];
3297
- var temporalValue = currentValues && index < currentValues.length && currentValues.length > 1 && !invalidCurrentValues.includes(currentValues[index]) ? currentValues[index] : null;
3298
- valoresLiterales.forEach(function (valor) {
3299
- if (temporalValue === null || temporalValue === void 0 ? void 0 : temporalValue.startsWith(valor))
3300
- temporalValue = temporalValue.replace(valor, "");
3301
- });
3302
- return temporalValue;
3303
- };
3304
- RegistroComponent.prototype.onClickedEditButton = function (element, data, index) {
3305
- var esquema = ___namespace.cloneDeep(this.sfCrudService.getControl(element.scope, this.sfCrudService.getEsquema(this.indexCrud)));
3306
- esquema.type = "object";
3307
- var currentElement = {
3308
- data: ___namespace.cloneDeep(data),
3309
- uiEsquema: ___namespace.cloneDeep(element.elements[0]),
3310
- esquema: esquema,
3311
- scope: element.scope,
3312
- index: index,
3313
- operation: "u"
3314
- };
3315
- this.displays.push(true);
3316
- this.dialogElements.push(currentElement);
3317
- };
3318
- RegistroComponent.prototype.onClickedAddButton = function (element) {
3319
- var _this = this;
3320
- var esquema = ___namespace.cloneDeep(this.sfCrudService.getControl(element.scope, this.sfCrudService.getEsquema(this.indexCrud)));
3321
- var op = this.sfCrudService.registros[this.indexCrud].operations.find(function (x) { return x.type.startsWith(_this.sfCrudService.getTrx(_this.indexCrud)); });
3322
- esquema.type = "object";
3323
- var currentElement = {
3324
- data: this.sfCrudService.createObject(esquema, op),
3325
- uiEsquema: ___namespace.cloneDeep(element.elements[0]),
3326
- esquema: esquema,
3327
- scope: element.scope,
3328
- index: 0,
3329
- operation: "c"
3330
- };
3331
- try {
3332
- currentElement.data.id = this.sfCrudService.getValue(element.scope, this.sfCrudService.getData(this.indexCrud)).length + 1;
3333
- }
3334
- catch (error) {
3335
- console.log("error agregando un id");
3336
- console.error(error);
3337
- }
3338
- this.displays.push(true);
3339
- this.dialogElements.push(currentElement);
3340
- };
3341
- RegistroComponent.prototype.onCloseAddress = function (index) {
3342
- var _a;
3343
- var separador = (_a = jsonpath__namespace.query(this.sfCrudService.esquemas[this.indexCrud], this.dialogElements[index].scope)[0]) === null || _a === void 0 ? void 0 : _a.separador;
3344
- //leer los campos de las mascaras, setear el string
3345
- var newValue = this.sfCrudService.armarNuevaDireccion("string", this.dialogElements[index].data, separador);
3346
- console.log(newValue);
3347
- var scope = this.dialogElements[index].scope.replaceAll('.properties', '');
3348
- console.log(scope);
3349
- if (index == 0) {
3350
- jsonpath__namespace.value(this.sfCrudService.getData(this.indexCrud), scope, newValue);
3351
- }
3352
- else {
3353
- //Actualizarlo en un dialog anterior. Se crea una nueva referencia para que el compilador detecte cambios en el objeto data y lo recargue
3354
- var newDataPreviousDialog = ___namespace.cloneDeep(this.dialogElements[index - 1].data);
3355
- jsonpath__namespace.value(newDataPreviousDialog, scope, newValue);
3356
- this.dialogElements[index - 1].data = newDataPreviousDialog;
3357
- }
3358
- this.stepService.desiredIndex = undefined;
3359
- this.stepService.requestApproved = true;
3360
- };
3361
- RegistroComponent.prototype.onCloseDialog = function (index) {
3362
- var validated = true;
3363
- if (this.dialogElements[index].esquema.validations) {
3364
- var op = new Operation();
3365
- op.validations = this.dialogElements[index].esquema.validations;
3366
- validated = this.validateData(op, this.dialogElements[index].data, this.sfCrudService.getRegistro(this.indexCrud).conditions || []);
3367
- }
3368
- if (validated) {
3369
- switch (this.dialogElements[index].operation) {
3370
- case "c":
3371
- this.onCloseAddItem(index);
3372
- break;
3373
- case "u":
3374
- this.onCloseEditRow(index);
3375
- break;
3376
- case "address":
3377
- this.onCloseAddress(index);
3378
- break;
3379
- }
3380
- this.removeDialogItem();
3381
- }
3382
- };
3383
- RegistroComponent.prototype.removeDialogItem = function () {
3384
- this.dialogElements.pop();
3385
- this.displays.pop();
3386
- };
3387
- RegistroComponent.prototype.setLabelSumbit = function () {
3388
- var x = { "c": { label: 'Guardar', icon: 'pi pi-save' },
3389
- "u": { label: 'Actualizar', icon: 'pi pi-sync' },
3390
- "d": { label: 'Eliminar', icon: 'pi pi-trash' }
3391
- };
3392
- this.btnSubmit = x[this.sfCrudService.getTrx(0)];
3393
- };
3394
- RegistroComponent.prototype.back = function () {
3395
- this.router.navigateByUrl(this.sfCrudService.registros[0].btnBack);
3396
- };
3397
- RegistroComponent.prototype.cargarMascarasDirecciones = function () {
3398
- var _this = this;
3399
- if (this.sfCrudService.mascaras.length == 0) {
3400
- return this.generalService.genericRequest("GET", this.generalService.generales + "/General/getConfiguracionKatios/" + this.idKatios).then(function (res) {
3401
- _this.sfCrudService.mascaras = JSON.parse(res).RESPUESTA.MascarasDirecciones.Mascaras.Mascara;
3402
- });
3403
- }
3404
- return Promise.resolve(this.sfCrudService.mascaras);
3405
- };
3406
- return RegistroComponent;
3407
- }());
3408
- 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 });
3409
- 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]\" [isAddressDialog]=\"item.isAddressDialog === true\" [separador]=\"item.separador\"></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", "isAddressDialog", "separador"] }, { 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"] }] });
3410
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RegistroComponent, decorators: [{
3411
- type: i0.Component,
3412
- args: [{
3413
- selector: 'sf-registro',
3414
- templateUrl: './registro.component.html',
3415
- providers: [i1$1.MessageService],
3416
- entryComponents: [RegistroComponent],
3417
- styleUrls: ['./registro.component.css']
3418
- }]
3419
- }], 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: [{
3420
- type: i0.HostBinding,
3421
- args: ["style.--primary-color"]
3422
- }], color2: [{
3423
- type: i0.HostBinding,
3424
- args: ["style.--secondary-color"]
3425
- }], colorButton: [{
3426
- type: i0.HostBinding,
3427
- args: ["style.--button-color"]
3428
- }], idKatios: [{
3429
- type: i0.Input
3430
- }], trx: [{
3431
- type: i0.Input
3432
- }], id: [{
3433
- type: i0.Input
3434
- }], user: [{
3435
- type: i0.Input
3436
- }], dataExt: [{
3437
- type: i0.Input
3438
- }], ids: [{
3439
- type: i0.Input
3440
- }], environment: [{
3441
- type: i0.Input
3442
- }], buttonsFooterTemplate: [{
3443
- type: i0.Input
3444
- }], sendData: [{
3445
- type: i0.Output
3446
- }], onSubmit: [{
3447
- type: i0.Output
3448
- }], idEntidad: [{
3449
- type: i0.Input
3450
- }] } });
3451
-
3452
- var SfCrudComponent = /** @class */ (function () {
3453
- function SfCrudComponent() {
3454
- }
3455
- SfCrudComponent.prototype.ngOnInit = function () {
3456
- };
3457
- return SfCrudComponent;
3458
- }());
3459
- SfCrudComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
3460
- SfCrudComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SfCrudComponent, selector: "lib-sf-crud", ngImport: i0__namespace, template: "\n <p>\n sf-crud works!\n </p>\n ", isInline: true });
3461
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudComponent, decorators: [{
3462
- type: i0.Component,
3463
- args: [{
3464
- selector: 'lib-sf-crud',
3465
- template: "\n <p>\n sf-crud works!\n </p>\n ",
3466
- styles: []
3467
- }]
3468
- }], ctorParameters: function () { return []; } });
3469
-
3470
- var routes = [
3471
- { path: ':idStep',
3472
- component: FormComponent
3473
- }
3474
- ];
3475
- var SfCrudRoutingModule = /** @class */ (function () {
3476
- function SfCrudRoutingModule() {
3477
- }
3478
- return SfCrudRoutingModule;
3479
- }());
3480
- SfCrudRoutingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudRoutingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3481
- 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] });
3482
- 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] });
3483
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudRoutingModule, decorators: [{
3484
- type: i0.NgModule,
3485
- args: [{
3486
- imports: [i2.RouterModule.forChild(routes)],
3487
- exports: [i2.RouterModule]
3488
- }]
3489
- }] });
3490
-
3491
- var SfCrudModule = /** @class */ (function () {
3492
- function SfCrudModule() {
3493
- }
3494
- return SfCrudModule;
3495
- }());
3496
- SfCrudModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3497
- SfCrudModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, declarations: [SfCrudComponent,
3498
- TableroComponent,
3499
- RegistroComponent,
3500
- ControlComponent,
3501
- StepComponent,
3502
- FormComponent,
3503
- FileUploadComponent,
3504
- FormatAddressPipe], imports: [SfCrudRoutingModule,
3505
- i6$2.SfPdfsignModule,
3506
- i7$1.SfSimuladorModule,
3507
- accordion.AccordionModule,
3508
- i6$1.AutoCompleteModule,
3509
- avatargroup.AvatarGroupModule,
3510
- avatar.AvatarModule,
3511
- badge.BadgeModule,
3512
- blockui.BlockUIModule,
3513
- breadcrumb.BreadcrumbModule,
3514
- i9.ButtonModule,
3515
- i8.CalendarModule,
3516
- card.CardModule,
3517
- carousel.CarouselModule,
3518
- cascadeselect.CascadeSelectModule,
3519
- checkbox.CheckboxModule,
3520
- chip.ChipModule,
3521
- chips.ChipsModule,
3522
- colorpicker.ColorPickerModule,
3523
- confirmdialog.ConfirmDialogModule,
3524
- confirmpopup.ConfirmPopupModule,
3525
- contextmenu.ContextMenuModule,
3526
- i11$3.DialogModule,
3527
- divider.DividerModule,
3528
- i5$1.DropdownModule,
3529
- dynamicdialog.DynamicDialogModule,
3530
- fieldset.FieldsetModule,
3531
- fileupload.FileUploadModule,
3532
- i14.FormsModule,
3533
- galleria.GalleriaModule,
3534
- i1.HttpClientModule,
3535
- inplace.InplaceModule,
3536
- i4.InputMaskModule,
3537
- i9$1.InputNumberModule,
3538
- i11$1.InputSwitchModule,
3539
- i16.InputTextareaModule,
3540
- i12$1.InputTextModule,
3541
- knob.KnobModule,
3542
- listbox.ListboxModule,
3543
- megamenu.MegaMenuModule,
3544
- menubar.MenubarModule,
3545
- menu.MenuModule,
3546
- message.MessageModule,
3547
- i10.MultiSelectModule,
3548
- organizationchart.OrganizationChartModule,
3549
- overlaypanel.OverlayPanelModule,
3550
- panelmenu.PanelMenuModule,
3551
- panel.PanelModule,
3552
- password.PasswordModule,
3553
- progressbar.ProgressBarModule,
3554
- radiobutton.RadioButtonModule,
3555
- rating.RatingModule,
3556
- i11.RippleModule,
3557
- scrollpanel.ScrollPanelModule,
3558
- scrolltop.ScrollTopModule,
3559
- selectbutton.SelectButtonModule,
3560
- sidebar.SidebarModule,
3561
- skeleton.SkeletonModule,
3562
- slidemenu.SlideMenuModule,
3563
- slider.SliderModule,
3564
- i7.SplitButtonModule,
3565
- splitter.SplitterModule,
3566
- i3.StepsModule,
3567
- i6.TableModule,
3568
- tabmenu.TabMenuModule,
3569
- tabview.TabViewModule,
3570
- tag.TagModule,
3571
- terminal.TerminalModule,
3572
- tieredmenu.TieredMenuModule,
3573
- timeline.TimelineModule,
3574
- i11$2.ToastModule,
3575
- togglebutton.ToggleButtonModule,
3576
- i5.ToolbarModule,
3577
- i13.TooltipModule,
3578
- tree.TreeModule,
3579
- i5$2.SfAdoModule], exports: [SfCrudComponent,
3580
- TableroComponent,
3581
- RegistroComponent,
3582
- ControlComponent] });
3583
- SfCrudModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, imports: [[
3584
- SfCrudRoutingModule,
3585
- i6$2.SfPdfsignModule,
3586
- i7$1.SfSimuladorModule,
3587
- accordion.AccordionModule,
3588
- i6$1.AutoCompleteModule,
3589
- avatargroup.AvatarGroupModule,
3590
- avatar.AvatarModule,
3591
- badge.BadgeModule,
3592
- blockui.BlockUIModule,
3593
- breadcrumb.BreadcrumbModule,
3594
- i9.ButtonModule,
3595
- i8.CalendarModule,
3596
- card.CardModule,
3597
- carousel.CarouselModule,
3598
- cascadeselect.CascadeSelectModule,
3599
- checkbox.CheckboxModule,
3600
- chip.ChipModule,
3601
- chips.ChipsModule,
3602
- colorpicker.ColorPickerModule,
3603
- confirmdialog.ConfirmDialogModule,
3604
- confirmpopup.ConfirmPopupModule,
3605
- contextmenu.ContextMenuModule,
3606
- i11$3.DialogModule,
3607
- divider.DividerModule,
3608
- i5$1.DropdownModule,
3609
- dynamicdialog.DynamicDialogModule,
3610
- fieldset.FieldsetModule,
3611
- fileupload.FileUploadModule,
3612
- i14.FormsModule,
3613
- galleria.GalleriaModule,
3614
- i1.HttpClientModule,
3615
- inplace.InplaceModule,
3616
- i4.InputMaskModule,
3617
- i9$1.InputNumberModule,
3618
- i11$1.InputSwitchModule,
3619
- i16.InputTextareaModule,
3620
- i12$1.InputTextModule,
3621
- knob.KnobModule,
3622
- listbox.ListboxModule,
3623
- megamenu.MegaMenuModule,
3624
- menubar.MenubarModule,
3625
- menu.MenuModule,
3626
- message.MessageModule,
3627
- i10.MultiSelectModule,
3628
- organizationchart.OrganizationChartModule,
3629
- overlaypanel.OverlayPanelModule,
3630
- panelmenu.PanelMenuModule,
3631
- panel.PanelModule,
3632
- password.PasswordModule,
3633
- progressbar.ProgressBarModule,
3634
- radiobutton.RadioButtonModule,
3635
- rating.RatingModule,
3636
- i11.RippleModule,
3637
- scrollpanel.ScrollPanelModule,
3638
- scrolltop.ScrollTopModule,
3639
- selectbutton.SelectButtonModule,
3640
- sidebar.SidebarModule,
3641
- skeleton.SkeletonModule,
3642
- slidemenu.SlideMenuModule,
3643
- slider.SliderModule,
3644
- i7.SplitButtonModule,
3645
- splitter.SplitterModule,
3646
- i3.StepsModule,
3647
- i6.TableModule,
3648
- tabmenu.TabMenuModule,
3649
- tabview.TabViewModule,
3650
- tag.TagModule,
3651
- terminal.TerminalModule,
3652
- tieredmenu.TieredMenuModule,
3653
- timeline.TimelineModule,
3654
- i11$2.ToastModule,
3655
- togglebutton.ToggleButtonModule,
3656
- i5.ToolbarModule,
3657
- i13.TooltipModule,
3658
- tree.TreeModule,
3659
- i5$2.SfAdoModule
3660
- ]] });
3661
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: SfCrudModule, decorators: [{
3662
- type: i0.NgModule,
3663
- args: [{
3664
- declarations: [
3665
- SfCrudComponent,
3666
- TableroComponent,
3667
- RegistroComponent,
3668
- ControlComponent,
3669
- StepComponent,
3670
- FormComponent,
3671
- FileUploadComponent,
3672
- FormatAddressPipe
3673
- ],
3674
- imports: [
3675
- SfCrudRoutingModule,
3676
- i6$2.SfPdfsignModule,
3677
- i7$1.SfSimuladorModule,
3678
- accordion.AccordionModule,
3679
- i6$1.AutoCompleteModule,
3680
- avatargroup.AvatarGroupModule,
3681
- avatar.AvatarModule,
3682
- badge.BadgeModule,
3683
- blockui.BlockUIModule,
3684
- breadcrumb.BreadcrumbModule,
3685
- i9.ButtonModule,
3686
- i8.CalendarModule,
3687
- card.CardModule,
3688
- carousel.CarouselModule,
3689
- cascadeselect.CascadeSelectModule,
3690
- checkbox.CheckboxModule,
3691
- chip.ChipModule,
3692
- chips.ChipsModule,
3693
- colorpicker.ColorPickerModule,
3694
- confirmdialog.ConfirmDialogModule,
3695
- confirmpopup.ConfirmPopupModule,
3696
- contextmenu.ContextMenuModule,
3697
- i11$3.DialogModule,
3698
- divider.DividerModule,
3699
- i5$1.DropdownModule,
3700
- dynamicdialog.DynamicDialogModule,
3701
- fieldset.FieldsetModule,
3702
- fileupload.FileUploadModule,
3703
- i14.FormsModule,
3704
- galleria.GalleriaModule,
3705
- i1.HttpClientModule,
3706
- inplace.InplaceModule,
3707
- i4.InputMaskModule,
3708
- i9$1.InputNumberModule,
3709
- i11$1.InputSwitchModule,
3710
- i16.InputTextareaModule,
3711
- i12$1.InputTextModule,
3712
- knob.KnobModule,
3713
- listbox.ListboxModule,
3714
- megamenu.MegaMenuModule,
3715
- menubar.MenubarModule,
3716
- menu.MenuModule,
3717
- message.MessageModule,
3718
- i10.MultiSelectModule,
3719
- organizationchart.OrganizationChartModule,
3720
- overlaypanel.OverlayPanelModule,
3721
- panelmenu.PanelMenuModule,
3722
- panel.PanelModule,
3723
- password.PasswordModule,
3724
- progressbar.ProgressBarModule,
3725
- radiobutton.RadioButtonModule,
3726
- rating.RatingModule,
3727
- i11.RippleModule,
3728
- scrollpanel.ScrollPanelModule,
3729
- scrolltop.ScrollTopModule,
3730
- selectbutton.SelectButtonModule,
3731
- sidebar.SidebarModule,
3732
- skeleton.SkeletonModule,
3733
- slidemenu.SlideMenuModule,
3734
- slider.SliderModule,
3735
- i7.SplitButtonModule,
3736
- splitter.SplitterModule,
3737
- i3.StepsModule,
3738
- i6.TableModule,
3739
- tabmenu.TabMenuModule,
3740
- tabview.TabViewModule,
3741
- tag.TagModule,
3742
- terminal.TerminalModule,
3743
- tieredmenu.TieredMenuModule,
3744
- timeline.TimelineModule,
3745
- i11$2.ToastModule,
3746
- togglebutton.ToggleButtonModule,
3747
- i5.ToolbarModule,
3748
- i13.TooltipModule,
3749
- tree.TreeModule,
3750
- i5$2.SfAdoModule
3751
- ],
3752
- exports: [
3753
- SfCrudComponent,
3754
- TableroComponent,
3755
- RegistroComponent,
3756
- ControlComponent
3757
- ]
3758
- }]
3759
- }] });
3760
-
3761
- /*
3762
- * Public API Surface of sf-crud
3763
- */
3764
-
3765
- /**
3766
- * Generated bundle index. Do not edit.
3767
- */
3768
-
3769
- exports.ChangeData = ChangeData;
3770
- exports.ConfigRegistro = ConfigRegistro;
3771
- exports.ConfigTablero = ConfigTablero;
3772
- exports.ConstructionId = ConstructionId;
3773
- exports.ControlComponent = ControlComponent;
3774
- exports.CrudConfig = CrudConfig;
3775
- exports.FormComponent = FormComponent;
3776
- exports.Key = Key;
3777
- exports.Notification = Notification;
3778
- exports.NotificationService = NotificationService;
3779
- exports.Operation = Operation;
3780
- exports.OverrideConfig = OverrideConfig;
3781
- exports.RegistroComponent = RegistroComponent;
3782
- exports.RequestChecking = RequestChecking;
3783
- exports.SfCrudComponent = SfCrudComponent;
3784
- exports.SfCrudModule = SfCrudModule;
3785
- exports.SfCrudService = SfCrudService;
3786
- exports.Shema = Shema;
3787
- exports.StepService = StepService;
3788
- exports.TableroComponent = TableroComponent;
3789
- exports.Validations = Validations;
3790
- exports.keyEsquema = keyEsquema;
3791
-
3792
- Object.defineProperty(exports, '__esModule', { value: true });
3793
-
3794
- }));
3795
- //# sourceMappingURL=sf-crud.umd.js.map