@seniorsistemas/tmsx-angular-components 1.0.6 → 2.0.0

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 (73) hide show
  1. package/commons/field-type/field-type.d.ts +76 -0
  2. package/commons/field-type/index.d.ts +1 -0
  3. package/commons/index.d.ts +1 -0
  4. package/components/grid-editable-nested/grid-editable-nested.component.d.ts +11 -10
  5. package/components/grid-editable-nested/grid-editable-nested.module.d.ts +31 -0
  6. package/components/index.d.ts +1 -1
  7. package/components/painel-processamento/painel-processamento.component.d.ts +5 -2
  8. package/components/painel-processamento/painel-processamento.module.d.ts +13 -0
  9. package/components/painel-processamento/processamento.d.ts +1 -1
  10. package/esm2022/commons/field-type/field-type.mjs +76 -0
  11. package/esm2022/commons/field-type/index.mjs +2 -0
  12. package/esm2022/commons/index.mjs +2 -0
  13. package/esm2022/components/grid-editable-nested/grid-editable-nested.component.mjs +261 -0
  14. package/esm2022/components/grid-editable-nested/grid-editable-nested.module.mjs +133 -0
  15. package/esm2022/components/grid-editable-nested/grid.interface.mjs +9 -0
  16. package/esm2022/components/grid-editable-nested/index.mjs +3 -0
  17. package/esm2022/components/index.mjs +3 -0
  18. package/esm2022/components/painel-processamento/index.mjs +3 -0
  19. package/esm2022/components/painel-processamento/painel-processamento.component.mjs +226 -0
  20. package/esm2022/components/painel-processamento/painel-processamento.module.mjs +53 -0
  21. package/esm2022/components/painel-processamento/processamento.mjs +14 -0
  22. package/esm2022/locale/fallback.mjs +39 -0
  23. package/esm2022/public-api.mjs +6 -0
  24. package/esm2022/seniorsistemas-tmsx-angular-components.mjs +5 -0
  25. package/esm2022/tmsx-angular-components.module.mjs +24 -0
  26. package/esm2022/utils/index.mjs +2 -0
  27. package/esm2022/utils/services/utils.service.mjs +192 -0
  28. package/fesm2022/seniorsistemas-tmsx-angular-components.mjs +992 -0
  29. package/fesm2022/seniorsistemas-tmsx-angular-components.mjs.map +1 -0
  30. package/{seniorsistemas-tmsx-angular-components.d.ts → index.d.ts} +1 -0
  31. package/package.json +16 -59
  32. package/public-api.d.ts +4 -3
  33. package/tmsx-angular-components.module.d.ts +6 -2
  34. package/utils/services/utils.service.d.ts +7 -3
  35. package/bundles/seniorsistemas-tmsx-angular-components.umd.js +0 -1108
  36. package/bundles/seniorsistemas-tmsx-angular-components.umd.js.map +0 -1
  37. package/bundles/seniorsistemas-tmsx-angular-components.umd.min.js +0 -2
  38. package/bundles/seniorsistemas-tmsx-angular-components.umd.min.js.map +0 -1
  39. package/esm2015/components/grid-editable-nested/grid-editable-nested.component.js +0 -267
  40. package/esm2015/components/grid-editable-nested/grid-editable-nested.module.js +0 -64
  41. package/esm2015/components/grid-editable-nested/grid.interface.js +0 -9
  42. package/esm2015/components/grid-editable-nested/index.js +0 -3
  43. package/esm2015/components/index.js +0 -3
  44. package/esm2015/components/painel-processamento/index.js +0 -3
  45. package/esm2015/components/painel-processamento/painel-processamento.component.js +0 -235
  46. package/esm2015/components/painel-processamento/painel-processamento.module.js +0 -33
  47. package/esm2015/components/painel-processamento/processamento.js +0 -14
  48. package/esm2015/locale/fallback.js +0 -39
  49. package/esm2015/public-api.js +0 -5
  50. package/esm2015/seniorsistemas-tmsx-angular-components.js +0 -5
  51. package/esm2015/tmsx-angular-components.module.js +0 -22
  52. package/esm2015/utils/index.js +0 -2
  53. package/esm2015/utils/services/utils.service.js +0 -196
  54. package/esm5/components/grid-editable-nested/grid-editable-nested.component.js +0 -282
  55. package/esm5/components/grid-editable-nested/grid-editable-nested.module.js +0 -67
  56. package/esm5/components/grid-editable-nested/grid.interface.js +0 -9
  57. package/esm5/components/grid-editable-nested/index.js +0 -3
  58. package/esm5/components/index.js +0 -3
  59. package/esm5/components/painel-processamento/index.js +0 -3
  60. package/esm5/components/painel-processamento/painel-processamento.component.js +0 -263
  61. package/esm5/components/painel-processamento/painel-processamento.module.js +0 -36
  62. package/esm5/components/painel-processamento/processamento.js +0 -15
  63. package/esm5/locale/fallback.js +0 -39
  64. package/esm5/public-api.js +0 -5
  65. package/esm5/seniorsistemas-tmsx-angular-components.js +0 -5
  66. package/esm5/tmsx-angular-components.module.js +0 -26
  67. package/esm5/utils/index.js +0 -2
  68. package/esm5/utils/services/utils.service.js +0 -198
  69. package/fesm2015/seniorsistemas-tmsx-angular-components.js +0 -839
  70. package/fesm2015/seniorsistemas-tmsx-angular-components.js.map +0 -1
  71. package/fesm5/seniorsistemas-tmsx-angular-components.js +0 -895
  72. package/fesm5/seniorsistemas-tmsx-angular-components.js.map +0 -1
  73. package/seniorsistemas-tmsx-angular-components.metadata.json +0 -1
@@ -1,895 +0,0 @@
1
- import pLimit from 'p-limit';
2
- import { __awaiter, __generator, __decorate, __read, __assign } from 'tslib';
3
- import { TranslateService, TranslateModule } from '@ngx-translate/core';
4
- import { EventEmitter, ɵɵdefineInjectable, ɵɵinject, Input, Output, Injectable, Component, NgModule, ChangeDetectorRef, ViewChild, InjectionToken } from '@angular/core';
5
- import { EnumColumnFieldType, LocaleModule, TooltipModule, TableModule as TableModule$1, ButtonModule, FieldType, LocalizedDatePipe, LoadingStateModule, NumberInputModule, BreadcrumbModule, ControlErrorsModule, CustomFieldsModule, DynamicFormModule, EmptyStateModule, TokenListModule } from '@seniorsistemas/angular-components';
6
- import { TableModule } from 'primeng/table';
7
- import { CommonModule } from '@angular/common';
8
- import { PanelModule } from 'primeng/panel';
9
- import { Subject } from 'rxjs';
10
- import { Hotkey, HotkeysService } from 'angular2-hotkeys';
11
- import { ToastModule } from 'primeng/toast';
12
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
13
- import { InputTextModule } from 'primeng/inputtext';
14
- import { ConfirmDialogModule } from 'primeng/confirmdialog';
15
- import { CalendarModule } from 'primeng/calendar';
16
- import { DropdownModule } from 'primeng/dropdown';
17
- import { SharedModule } from 'primeng/api';
18
- import { TooltipModule as TooltipModule$1 } from 'primeng/tooltip';
19
- import { AutoCompleteModule } from 'primeng/autocomplete';
20
- import { CheckboxModule } from 'primeng/checkbox';
21
-
22
- var _a;
23
- var EnumProcessamentoStatus;
24
- (function (EnumProcessamentoStatus) {
25
- EnumProcessamentoStatus["SUCCESS"] = "SUCCESS";
26
- EnumProcessamentoStatus["FAILED"] = "FAILED";
27
- EnumProcessamentoStatus["PENDING"] = "PENDING";
28
- EnumProcessamentoStatus["PROCESSING"] = "PROCESSING";
29
- })(EnumProcessamentoStatus || (EnumProcessamentoStatus = {}));
30
- var EnumProcessamentoStatusTranslationMap = (_a = {},
31
- _a[EnumProcessamentoStatus.SUCCESS] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_success',
32
- _a[EnumProcessamentoStatus.FAILED] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_failed',
33
- _a[EnumProcessamentoStatus.PENDING] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_pending',
34
- _a[EnumProcessamentoStatus.PROCESSING] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_processing',
35
- _a);
36
-
37
- var PainelProcessamentoComponent = /** @class */ (function () {
38
- function PainelProcessamentoComponent(translate) {
39
- this.translate = translate;
40
- this.processado = new EventEmitter();
41
- this.concluido = new EventEmitter();
42
- this.totalRecords = 0;
43
- this.successCount = 0;
44
- this.failedCount = 0;
45
- this.pendingCount = 0;
46
- this.successProgress = '0%';
47
- this.failedProgress = '0%';
48
- this.pendingProgress = '100%';
49
- this.processingProgress = '0%';
50
- this.sortField = 'status';
51
- this.sortOrder = 1;
52
- }
53
- PainelProcessamentoComponent_1 = PainelProcessamentoComponent;
54
- PainelProcessamentoComponent.prototype.ngOnInit = function () {
55
- this.initPanel();
56
- };
57
- PainelProcessamentoComponent.prototype.initPanel = function () {
58
- this.gridColumns = this.getGridColumn();
59
- this.initGrid();
60
- this.initProgressBar();
61
- };
62
- PainelProcessamentoComponent.prototype.initProgressBar = function () {
63
- this.successProgress = '0%';
64
- this.failedProgress = '0%';
65
- this.pendingProgress = '100%';
66
- this.processingProgress = '0%';
67
- this.totalRecords = this.params.registros.length;
68
- this.pendingCount = this.totalRecords;
69
- if (this.params.quantidadeChamadasSimultaneas > 1) {
70
- this.processAllRecordsWithPLimit();
71
- }
72
- else {
73
- this.syncProcessRecord(0);
74
- }
75
- };
76
- PainelProcessamentoComponent.prototype.initGrid = function () {
77
- this.gridData = [];
78
- this.gridData = this.params.registros.map(function (registro) { return ({
79
- registro: registro,
80
- status: EnumProcessamentoStatus.PENDING,
81
- label: registro.descricao
82
- }); });
83
- };
84
- PainelProcessamentoComponent.prototype.getErrorMessage = function (error) {
85
- var _a, _b;
86
- try {
87
- if (!error) {
88
- return this.genericErrorMsg;
89
- }
90
- if ((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.message) {
91
- return String(error.error.message);
92
- }
93
- if ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.message) {
94
- return String(error.message.message);
95
- }
96
- return this.genericErrorMsg;
97
- }
98
- catch (_c) {
99
- return this.genericErrorMsg;
100
- }
101
- };
102
- Object.defineProperty(PainelProcessamentoComponent.prototype, "genericErrorMsg", {
103
- get: function () {
104
- return this.translate.instant(PainelProcessamentoComponent_1.GENERIC_ERR_KEY);
105
- },
106
- enumerable: true,
107
- configurable: true
108
- });
109
- PainelProcessamentoComponent.prototype.updateRowSuccess = function (row, index) {
110
- this.successCount++;
111
- this.pendingCount--;
112
- this.updateRowStatus(row, EnumProcessamentoStatus.SUCCESS);
113
- this.processado.emit(row);
114
- this.updateProgressBar();
115
- };
116
- PainelProcessamentoComponent.prototype.updateRowError = function (row, index, message) {
117
- this.failedCount++;
118
- this.pendingCount--;
119
- this.updateRowStatus(row, EnumProcessamentoStatus.FAILED, message);
120
- this.processado.emit(row);
121
- this.updateProgressBar();
122
- };
123
- PainelProcessamentoComponent.prototype.syncProcessRecord = function (index) {
124
- var _this = this;
125
- if (this.pendingCount < 1) {
126
- this.concluido.emit('ok');
127
- return;
128
- }
129
- this.updateRowStatus(this.gridData[index], EnumProcessamentoStatus.PROCESSING);
130
- var record = this.params.registros[index];
131
- var row = this.gridData.find(function (item) { return item.registro === record; });
132
- if (record.apiEnvio) {
133
- record.apiEnvio(record.objEnvio)
134
- .subscribe(function () {
135
- _this.updateRowSuccess(row, index);
136
- _this.syncProcessRecord(index + 1);
137
- }, function (error) {
138
- _this.updateRowError(row, index, _this.getErrorMessage(error));
139
- _this.syncProcessRecord(index + 1);
140
- });
141
- }
142
- else {
143
- this.failedCount = this.pendingCount;
144
- this.pendingCount = 0;
145
- this.updateRowStatus(row, EnumProcessamentoStatus.FAILED, this.translate.instant('tmsx_fnd.tmsx_angular_components.painel_processamento_api_error'));
146
- this.updateProgressBar();
147
- this.concluido.emit('erro');
148
- }
149
- };
150
- PainelProcessamentoComponent.prototype.processAllRecordsWithPLimit = function () {
151
- return __awaiter(this, void 0, void 0, function () {
152
- var pLimit$1, limit, promises, results;
153
- var _this = this;
154
- return __generator(this, function (_a) {
155
- switch (_a.label) {
156
- case 0:
157
- pLimit$1 = pLimit;
158
- limit = pLimit$1(this.params.quantidadeChamadasSimultaneas);
159
- promises = this.params.registros.map(function (record, index) {
160
- return limit(function () { return __awaiter(_this, void 0, void 0, function () {
161
- var row, result, error_1;
162
- return __generator(this, function (_a) {
163
- switch (_a.label) {
164
- case 0:
165
- row = this.gridData.find(function (item) { return item.registro === record; });
166
- this.updateRowStatus(row, EnumProcessamentoStatus.PROCESSING);
167
- _a.label = 1;
168
- case 1:
169
- _a.trys.push([1, 3, , 4]);
170
- return [4 /*yield*/, record.apiEnvio(record.objEnvio).toPromise()];
171
- case 2:
172
- result = _a.sent();
173
- this.updateRowSuccess(row, index);
174
- return [2 /*return*/, { success: true, record: record, result: result }];
175
- case 3:
176
- error_1 = _a.sent();
177
- this.updateRowError(row, index, this.getErrorMessage(error_1));
178
- return [2 /*return*/, { success: false, record: record, error: error_1 }];
179
- case 4: return [2 /*return*/];
180
- }
181
- });
182
- }); });
183
- });
184
- return [4 /*yield*/, Promise.all(promises)];
185
- case 1:
186
- results = _a.sent();
187
- this.concluido.emit(results);
188
- return [2 /*return*/, results];
189
- }
190
- });
191
- });
192
- };
193
- PainelProcessamentoComponent.prototype.updateProgressBar = function () {
194
- var successWidth = (this.successCount / this.totalRecords) * 100;
195
- var failedWidth = (this.failedCount / this.totalRecords) * 100;
196
- var pendingWidth = (this.pendingCount / this.totalRecords) * 100;
197
- var processedWidth = successWidth + failedWidth;
198
- this.processingProgress = processedWidth.toFixed(0) + "%";
199
- this.successProgress = successWidth.toFixed(0) + "%";
200
- this.failedProgress = failedWidth.toFixed(0) + "%";
201
- this.pendingProgress = pendingWidth.toFixed(0) + "%";
202
- };
203
- PainelProcessamentoComponent.prototype.updateRowStatus = function (row, status, message) {
204
- row.status = status;
205
- if (message) {
206
- row.message = message;
207
- }
208
- this.sortGridData();
209
- };
210
- PainelProcessamentoComponent.prototype.sortGridData = function () {
211
- var _this = this;
212
- this.gridData.sort(function (a, b) {
213
- var _a;
214
- var statusOrder = (_a = {},
215
- _a[EnumProcessamentoStatus.FAILED] = 1,
216
- _a[EnumProcessamentoStatus.PROCESSING] = 2,
217
- _a[EnumProcessamentoStatus.SUCCESS] = 3,
218
- _a[EnumProcessamentoStatus.PENDING] = 4,
219
- _a);
220
- if (_this.sortField === 'status') {
221
- return (statusOrder[a.status] - statusOrder[b.status]) * _this.sortOrder;
222
- }
223
- else {
224
- var valA = a[_this.sortField] || '';
225
- var valB = b[_this.sortField] || '';
226
- return valA.localeCompare(valB) * _this.sortOrder;
227
- }
228
- });
229
- };
230
- PainelProcessamentoComponent.prototype.getData = function (rowData, field) {
231
- if (field === 'status') {
232
- var text = this.translate.instant(EnumProcessamentoStatusTranslationMap[rowData.status]);
233
- if (rowData.message) {
234
- text += ": " + rowData.message;
235
- }
236
- return text;
237
- }
238
- return rowData[field];
239
- };
240
- PainelProcessamentoComponent.prototype.getClassStatus = function (rowData, field) {
241
- if (field !== 'status') {
242
- return '';
243
- }
244
- return "status " + rowData[field].toLowerCase();
245
- };
246
- PainelProcessamentoComponent.prototype.getGridColumn = function () {
247
- return [
248
- {
249
- field: 'label',
250
- header: this.translate.instant('tmsx_fnd.tmsx_angular_components.registro'),
251
- style: { width: '50%' },
252
- attributes: [],
253
- type: EnumColumnFieldType.STRING
254
- },
255
- {
256
- field: 'status',
257
- header: this.translate.instant('tmsx_fnd.tmsx_angular_components.status'),
258
- style: { width: '50%' },
259
- attributes: [],
260
- type: EnumColumnFieldType.STRING
261
- },
262
- ];
263
- };
264
- var PainelProcessamentoComponent_1;
265
- PainelProcessamentoComponent.GENERIC_ERR_KEY = 'tmsx_fnd.tmsx_angular_components.painel_processamento_generic_error';
266
- PainelProcessamentoComponent.ctorParameters = function () { return [
267
- { type: TranslateService }
268
- ]; };
269
- PainelProcessamentoComponent.ɵprov = ɵɵdefineInjectable({ factory: function PainelProcessamentoComponent_Factory() { return new PainelProcessamentoComponent(ɵɵinject(TranslateService)); }, token: PainelProcessamentoComponent, providedIn: "root" });
270
- __decorate([
271
- Input()
272
- ], PainelProcessamentoComponent.prototype, "params", void 0);
273
- __decorate([
274
- Output()
275
- ], PainelProcessamentoComponent.prototype, "processado", void 0);
276
- __decorate([
277
- Output()
278
- ], PainelProcessamentoComponent.prototype, "concluido", void 0);
279
- PainelProcessamentoComponent = PainelProcessamentoComponent_1 = __decorate([
280
- Injectable({
281
- providedIn: 'root'
282
- }),
283
- Component({
284
- selector: 'tmsx-painel-processamento',
285
- template: "<p-panel>\n <p-header>{{ this.params.titulo }} ({{processingProgress }})</p-header>\n\n <div class=\"progressbar\">\n <div class=\"success\"\n [ngClass]=\"successProgress == '0%' ? '' : 'visible'\"\n [ngStyle]=\"{'width': successProgress }\"\n [sTooltip]=\"successProgress\"\n [escape]=\"false\"\n mobileBehavior=\"tap\"></div>\n <div class=\"failed\"\n [ngClass]=\"failedProgress == '0%' ? '' : 'visible'\"\n [ngStyle]=\"{'width': failedProgress }\"\n [sTooltip]=\"failedProgress\"\n [escape]=\"false\"\n mobileBehavior=\"tap\"></div>\n <div class=\"pending\"\n [ngClass]=\"pendingProgress == '0%' ? '' : 'visible'\"\n [ngStyle]=\"{'width': pendingProgress }\"\n [sTooltip]=\"pendingProgress\"\n [escape]=\"false\"\n mobileBehavior=\"tap\"></div>\n </div>\n\n <p-table\n #myTable\n [value]=\"gridData\"\n [columns]=\"gridColumns\"\n dataKey=\"id\"\n [resizableColumns]=\"true\"\n sortMode=\"multiple\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [rows]=\"10\"\n showInitialSortBadge=\"true\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [sortField]=\"sortField\"\n [sortOrder]=\"sortOrder\">\n\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [ngStyle]=\"col.style\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th scope=\"col\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.field\"\n [pSortableColumnDisabled]=\"col.disableColumnSort\"\n [ngStyle]=\"col.style\"\n pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{col.header}}</span>\n <p-sortIcon *ngIf=\"!col.disableColumnSort\" [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr>\n <td *ngFor=\"let col of columns\" [ngClass]=\"getClassStatus(rowData, col.field)\">\n {{ getData(rowData, col.field) }}\n </td>\n </tr>\n\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <s-table-paging\n [table]=\"myTable\"\n [totalRecords]=\"gridData.length\"\n [exportable]=\"false\"\n >\n </s-table-paging>\n </ng-template>\n </p-table>\n</p-panel>\n",
286
- styles: [".progressbar{margin-bottom:30px;border-radius:20px;height:40px}.progressbar .visible:nth-child(1of.visible){border-top-left-radius:20px;border-bottom-left-radius:20px}.progressbar .visible:nth-last-child(1of.visible){border-top-right-radius:20px;border-bottom-right-radius:20px}.progressbar .failed,.progressbar .pending,.progressbar .success{display:inline-block;height:100%;width:0%}.progressbar .success{background-color:#4caf50}.progressbar .failed{background-color:#f44336}.progressbar .pending{background-color:#ccc}.status.success{color:#007504}.status.pending{color:#333}.status.failed{color:#8d0900}.status.processing{color:#b96f00}"]
287
- })
288
- ], PainelProcessamentoComponent);
289
- return PainelProcessamentoComponent;
290
- }());
291
-
292
- var PainelProcessamentoModule = /** @class */ (function () {
293
- function PainelProcessamentoModule() {
294
- }
295
- PainelProcessamentoModule = __decorate([
296
- NgModule({
297
- imports: [
298
- LocaleModule.forChild(),
299
- TranslateModule.forChild(),
300
- TooltipModule,
301
- TableModule,
302
- TableModule$1,
303
- ButtonModule,
304
- CommonModule,
305
- PanelModule,
306
- ],
307
- declarations: [
308
- PainelProcessamentoComponent
309
- ],
310
- providers: [],
311
- exports: [
312
- PainelProcessamentoComponent
313
- ],
314
- })
315
- ], PainelProcessamentoModule);
316
- return PainelProcessamentoModule;
317
- }());
318
-
319
- var UtilsService = /** @class */ (function () {
320
- function UtilsService(translate, dataPipe) {
321
- this.translate = translate;
322
- this.dataPipe = dataPipe;
323
- }
324
- UtilsService.prototype.getAuditCreatedBy = function (createdBy, createdDate) {
325
- if (!createdBy || !createdDate) {
326
- return '';
327
- }
328
- var date = '';
329
- this.dataPipe.transform(createdDate).subscribe(function (item) { return date = item.split(' '); });
330
- return this.translate.instant('tmsx_fnd.tmsx_angular_components.audit_created_by', { nome: createdBy, data: date[0], hora: date[1] });
331
- };
332
- UtilsService.prototype.getAuditModifiedBy = function (modifiedBy, modifiedDate) {
333
- if (!modifiedBy || !modifiedDate) {
334
- return '';
335
- }
336
- var date = '';
337
- this.dataPipe.transform(modifiedDate).subscribe(function (item) { return date = item.split(' '); });
338
- return this.translate.instant('tmsx_fnd.tmsx_angular_components.audit_modified_by', { nome: modifiedBy, data: date[0], hora: date[1] });
339
- };
340
- UtilsService.prototype.getAuditInactivatedBy = function (inactivatedBy, inactivatedDate) {
341
- if (!inactivatedBy || !inactivatedDate) {
342
- return '';
343
- }
344
- var date = '';
345
- this.dataPipe.transform(inactivatedDate).subscribe(function (item) { return date = item.split(' '); });
346
- return this.translate.instant('tmsx_fnd.tmsx_angular_components.audit_inactivated_by', { nome: inactivatedBy, data: date[0], hora: date[1] });
347
- };
348
- /* usage: [innerHTML]="getProp(rowData, 'nome')" */
349
- UtilsService.prototype.getProp = function (obj, path, type) {
350
- var value = path.split('.').reduce(function (result, prop) { return (result[prop] === undefined ? '' : result[prop]); }, obj);
351
- if (value || value === 0) {
352
- if (type) {
353
- value = this.formatType(value, type);
354
- }
355
- return "<span>" + value + "</span>";
356
- }
357
- return "<span class=\"empty-grid\">" + this.translate.instant('tmsx_fnd.tmsx_angular_components.list_grid_empty_field') + "</span>";
358
- };
359
- UtilsService.prototype.formatType = function (value, type) {
360
- if (value) {
361
- if (type === 'date') {
362
- var date_1 = '';
363
- this.dataPipe.transform(value).subscribe(function (item) { return date_1 = item.split(' '); });
364
- return date_1[0];
365
- }
366
- if (type === 'datetime') {
367
- var date_2 = '';
368
- this.dataPipe.transform(value).subscribe(function (item) { return date_2 = item; });
369
- return date_2;
370
- }
371
- if (type === 'decimal') {
372
- if (typeof value === 'string') {
373
- value = Number(value);
374
- }
375
- return value.toLocaleString('pt-BR', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
376
- }
377
- if (type === 'currency') {
378
- return value.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' });
379
- }
380
- if (type === 'cep') {
381
- return value.replace(/^(\d{2})(\d{3})(\d{3})/, '$1.$2-$3');
382
- }
383
- }
384
- return value;
385
- };
386
- /* usage: [ngClass]="emptyGridClass(value)" */
387
- UtilsService.prototype.emptyGridClass = function (value) {
388
- if (!value || value === this.translate.instant('tmsx_fnd.replicacao.list_grid_empty_field')) {
389
- return 'empty-grid';
390
- }
391
- return '';
392
- };
393
- UtilsService.prototype.infoContent = function (entity) {
394
- var text = '';
395
- if (!entity) {
396
- return this.translate.instant("tmsx_fnd.tmsx_angular_components.condicao_valor_lookup_condicional_no_audit");
397
- }
398
- text += this.getAuditCreatedBy(entity.createdBy, entity.createdDate);
399
- if (text) {
400
- text += '\n';
401
- }
402
- text += this.getAuditModifiedBy(entity.lastModifiedBy, entity.lastModifiedDate);
403
- return text;
404
- };
405
- UtilsService.prototype.formatCurrency = function (value) {
406
- return value.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' });
407
- };
408
- UtilsService.prototype.getAtivoTokenLabel = function (formField, value, translate) {
409
- var _a = formField, name = _a.name, type = _a.type, label = _a.label;
410
- if (type === FieldType.Radio) {
411
- var labelValue = value
412
- ? translate.instant('tmsx_fnd.tmsx_angular_components.situacao_ativo_true')
413
- : translate.instant('tmsx_fnd.tmsx_angular_components.situacao_ativo_false');
414
- return { id: name, label: label + ": " + labelValue };
415
- }
416
- return this.createFilterTokens(formField, value, translate);
417
- };
418
- UtilsService.prototype.getUtilsProp = function (obj, path) {
419
- return path.split('.').reduce(function (result, prop) { return (result[prop] === undefined ? '' : result[prop]); }, obj);
420
- };
421
- UtilsService.prototype.createFilterTokens = function (formField, value, translate) {
422
- var _a = formField, name = _a.name, type = _a.type, label = _a.label, searchFields = _a.searchFields, options = _a.options;
423
- var labelValue = this.getLabelValueByType(type, value, searchFields, options, translate);
424
- return { id: name, label: label + ": " + labelValue };
425
- };
426
- UtilsService.prototype.getLabelValueByType = function (type, value, searchFields, options, translate) {
427
- switch (type) {
428
- case FieldType.Date:
429
- return this.getDateLabel(value);
430
- case FieldType.Time:
431
- return this.getTimeFromDate(value);
432
- case FieldType.LocalDateTime:
433
- case FieldType.DateTime:
434
- return this.getDateTimeFromDate(value);
435
- case FieldType.Lookup:
436
- return this.getLookupLabel(value, searchFields);
437
- case FieldType.Enum:
438
- return this.getEnumLabel(value, options);
439
- case FieldType.Boolean:
440
- return this.getBooleanLabel(value, translate);
441
- default:
442
- return value;
443
- }
444
- };
445
- UtilsService.prototype.getDateLabel = function (value) {
446
- var dateObj = value instanceof Date ? value : new Date(value);
447
- return !isNaN(dateObj.getTime()) ? dateObj.toLocaleDateString('pt-BR') : value;
448
- };
449
- UtilsService.prototype.getLookupLabel = function (value, searchFields) {
450
- var _this = this;
451
- return searchFields.map(function (field) { return _this.getUtilsProp(value, field.name); }).join(' - ');
452
- };
453
- UtilsService.prototype.getEnumLabel = function (value, options) {
454
- var option = options.find(function (opt) { return opt.value === value; });
455
- return option ? option.label : value;
456
- };
457
- UtilsService.prototype.getBooleanLabel = function (value, translate) {
458
- return value
459
- ? translate.instant('tmsx_fnd.tmsx_angular_components.list_grid_boolean_true')
460
- : translate.instant('tmsx_fnd.tmsx_angular_components.list_grid_boolean_false');
461
- };
462
- UtilsService.prototype.getTimeFromDate = function (value) {
463
- var dateObj;
464
- if (typeof value === 'string' && /^\d{2}:\d{2}(:\d{2})?$/.test(value)) {
465
- var _a = __read(value.split(':'), 3), h = _a[0], m = _a[1], _b = _a[2], s = _b === void 0 ? '00' : _b;
466
- dateObj = new Date();
467
- dateObj.setHours(+h, +m, +s, 0);
468
- }
469
- else {
470
- dateObj = value instanceof Date ? value : new Date(value);
471
- }
472
- if (!isNaN(dateObj.getTime())) {
473
- return dateObj.toLocaleTimeString('pt-BR', {
474
- hour: '2-digit',
475
- minute: '2-digit',
476
- second: '2-digit',
477
- hour12: false
478
- }); // HH:mm:ss
479
- }
480
- return value;
481
- };
482
- UtilsService.prototype.getDateTimeFromDate = function (value) {
483
- var dateObj = value instanceof Date ? value : new Date(value);
484
- if (!isNaN(dateObj.getTime())) {
485
- var datePart = dateObj.toLocaleDateString('pt-BR'); // DD/MM/AAAA
486
- var timePart = dateObj.toLocaleTimeString('pt-BR', {
487
- hour: '2-digit',
488
- minute: '2-digit',
489
- second: '2-digit',
490
- hour12: false
491
- }); // HH:mm:ss
492
- return datePart + " " + timePart;
493
- }
494
- return value;
495
- };
496
- UtilsService.ctorParameters = function () { return [
497
- { type: TranslateService },
498
- { type: LocalizedDatePipe }
499
- ]; };
500
- UtilsService.ɵprov = ɵɵdefineInjectable({ factory: function UtilsService_Factory() { return new UtilsService(ɵɵinject(TranslateService), ɵɵinject(LocalizedDatePipe)); }, token: UtilsService, providedIn: "root" });
501
- UtilsService = __decorate([
502
- Injectable({
503
- providedIn: 'root'
504
- })
505
- ], UtilsService);
506
- return UtilsService;
507
- }());
508
-
509
- var GridEditableNestedComponent = /** @class */ (function () {
510
- function GridEditableNestedComponent(changeDetectorRef, translate, utils, hotkeysService) {
511
- this.changeDetectorRef = changeDetectorRef;
512
- this.translate = translate;
513
- this.utils = utils;
514
- this.hotkeysService = hotkeysService;
515
- this.openDetails = new EventEmitter();
516
- this.paging = new EventEmitter();
517
- this.delete = new EventEmitter();
518
- this.save = new EventEmitter();
519
- this.add = new EventEmitter();
520
- this.clonedData = {};
521
- this.gridLoading = true;
522
- this.editing = false;
523
- this.lazy = true;
524
- this.deleteEnabled = false;
525
- this.editEnabled = false;
526
- this.addEnabled = false;
527
- this.detailsEnabled = false;
528
- this.calendarTooltipText = '';
529
- this.currentListParams = { page: 0, size: 5, sort: [] };
530
- this.gridData = [];
531
- this.gridColumns = [];
532
- this.gridTotalRecords = 0;
533
- this.selected = [];
534
- this.nestedGridLoading = false;
535
- this.frozenPosition = 'left';
536
- this.frozenWidth = '200px';
537
- this.frozenColumns = [];
538
- this.ngUnsubscribe = new Subject();
539
- this.calendarTooltipText = this.translate.instant('tmsx_fnd.tmsx_angular_components.grid_editable_nested_calendar_required');
540
- }
541
- GridEditableNestedComponent.prototype.ngOnInit = function () {
542
- this.setGridData();
543
- this.setHotkeys();
544
- };
545
- GridEditableNestedComponent.prototype.ngOnChanges = function (changes) {
546
- if (changes.config) {
547
- this.setGridData();
548
- }
549
- };
550
- GridEditableNestedComponent.prototype.formatData = function (column, value) {
551
- return value;
552
- };
553
- GridEditableNestedComponent.prototype.setGridData = function () {
554
- if (!this.config) {
555
- return;
556
- }
557
- var _a = this.config, data = _a.data, size = _a.size, columns = _a.columns, frozenPosition = _a.frozenPosition, frozenColumns = _a.frozenColumns, editing = _a.editing, lazy = _a.lazy, deleteActionsEnabled = _a.deleteActionsEnabled, editEnabled = _a.editEnabled, addEnabled = _a.addEnabled, editActionsEnabled = _a.editActionsEnabled;
558
- this.gridData = data !== null && data !== void 0 ? data : [];
559
- this.gridTotalRecords = size !== null && size !== void 0 ? size : 0;
560
- this.gridColumns = columns !== null && columns !== void 0 ? columns : [];
561
- this.frozenPosition = frozenPosition !== null && frozenPosition !== void 0 ? frozenPosition : 'left';
562
- this.frozenColumns = frozenColumns !== null && frozenColumns !== void 0 ? frozenColumns : [];
563
- this.frozenWidth = this.calculateFrozenWidth(this.frozenColumns);
564
- this.editing = !!editing;
565
- this.lazy = !!lazy;
566
- this.deleteEnabled = !!deleteActionsEnabled;
567
- this.editEnabled = !!editEnabled;
568
- this.addEnabled = !!addEnabled;
569
- this.detailsEnabled = !!editActionsEnabled;
570
- this.changeDetectorRef.detectChanges();
571
- this.nestedGridLoading = false;
572
- this.gridLoading = false;
573
- };
574
- GridEditableNestedComponent.prototype.calculateFrozenWidth = function (frozenColumns) {
575
- var gutter = 120;
576
- if (!(frozenColumns === null || frozenColumns === void 0 ? void 0 : frozenColumns.length)) {
577
- return '120px';
578
- }
579
- var totalWidth = frozenColumns.reduce(function (sum, col) { return sum + gutter + (parseInt(col.width, 10) || 0); }, 0);
580
- return totalWidth + "px";
581
- };
582
- GridEditableNestedComponent.prototype.getActions = function (data) {
583
- var _this = this;
584
- return [
585
- {
586
- id: 'edit',
587
- label: this.translate.instant('tmsx_fnd.tmsx_angular_components.edit'),
588
- disabled: !this.detailsEnabled,
589
- command: function () {
590
- _this.openRowDetails(data.id);
591
- },
592
- },
593
- { separator: true },
594
- {
595
- id: 'delete',
596
- label: this.translate.instant('tmsx_fnd.tmsx_angular_components.delete'),
597
- disabled: !this.deleteEnabled,
598
- command: function () {
599
- _this.onDelete(data.id);
600
- },
601
- },
602
- ];
603
- };
604
- GridEditableNestedComponent.prototype.updateGridData = function (event) {
605
- var size = event.rows ? event.rows : 10;
606
- var page = event.first ? event.first / size : 0;
607
- this.gridLoading = true;
608
- if (this.clonedData && Object.keys(this.clonedData).length) {
609
- this.clonedData = {};
610
- this.table.editingRowKeys = {};
611
- }
612
- this.paging.emit({ page: page, size: size });
613
- };
614
- GridEditableNestedComponent.prototype.updateNestedGridData = function (event, rowData) {
615
- return __awaiter(this, void 0, void 0, function () {
616
- var size, page, sort;
617
- return __generator(this, function (_a) {
618
- switch (_a.label) {
619
- case 0:
620
- size = event.rows ? event.rows : 10;
621
- page = event.first ? event.first / size : 0;
622
- sort = event.multiSortMeta || [];
623
- rowData.nestedGridLoading = true;
624
- return [4 /*yield*/, this.nestedFunction({ page: page, size: size, sort: sort }, rowData)];
625
- case 1:
626
- _a.sent();
627
- return [2 /*return*/];
628
- }
629
- });
630
- });
631
- };
632
- GridEditableNestedComponent.prototype.onTab = function (event) {
633
- if (event.key !== 'Tab') {
634
- return;
635
- }
636
- event.preventDefault();
637
- var focusables = Array.from(document.querySelectorAll('p-cellEditor input, p-cellEditor textarea, p-cellEditor [tabindex="0"]')).filter(function (el) { return el.offsetParent !== null; });
638
- var currentIndex = focusables.indexOf(event.target);
639
- var next;
640
- if (event.shiftKey) {
641
- next = focusables[currentIndex - 1] || focusables[focusables.length - 1];
642
- }
643
- else {
644
- next = focusables[currentIndex + 1] || focusables[0];
645
- }
646
- if (next) {
647
- next.focus();
648
- }
649
- };
650
- GridEditableNestedComponent.prototype.getRowIndex = function () {
651
- var page = this.currentListParams.page || 0;
652
- var size = this.currentListParams.size || 0;
653
- return page * size;
654
- };
655
- GridEditableNestedComponent.prototype.getPageSize = function () {
656
- var _a;
657
- return (_a = this.currentListParams.size) !== null && _a !== void 0 ? _a : 0;
658
- };
659
- GridEditableNestedComponent.prototype.openRowDetails = function (id) {
660
- this.openDetails.emit(id);
661
- };
662
- GridEditableNestedComponent.prototype.onDelete = function (id) {
663
- this.delete.emit(id);
664
- };
665
- GridEditableNestedComponent.prototype.onAdd = function () {
666
- this.add.emit();
667
- };
668
- GridEditableNestedComponent.prototype.ngOnDestroy = function () {
669
- this.ngUnsubscribe.next();
670
- this.ngUnsubscribe.complete();
671
- };
672
- GridEditableNestedComponent.prototype.onEditSave = function () {
673
- this.saveAllRows();
674
- };
675
- GridEditableNestedComponent.prototype.onEditCancel = function () {
676
- var _this = this;
677
- this.gridData.forEach(function (data) {
678
- if (_this.clonedData[data.id]) {
679
- var index = _this.gridData.findIndex(function (row) { return row.id === data.id; });
680
- _this.gridData[index] = _this.clonedData[data.id];
681
- delete _this.clonedData[data.id];
682
- }
683
- _this.table.cancelRowEdit(data);
684
- });
685
- this.editing = false;
686
- };
687
- GridEditableNestedComponent.prototype.initAllRowsEdit = function () {
688
- var _this = this;
689
- this.gridData.forEach(function (data) {
690
- _this.editing = true;
691
- _this.table.initRowEdit(data);
692
- _this.clonedData[data.id] = __assign({}, data);
693
- });
694
- };
695
- GridEditableNestedComponent.prototype.saveAllRows = function () {
696
- var _this = this;
697
- this.gridData.forEach(function (data) {
698
- if (_this.clonedData[data.id]) {
699
- delete _this.clonedData[data.id];
700
- }
701
- _this.table.cancelRowEdit(data);
702
- });
703
- this.editing = false;
704
- this.save.emit(this.gridData);
705
- };
706
- GridEditableNestedComponent.prototype.formatRowData = function (field) {
707
- return field;
708
- };
709
- GridEditableNestedComponent.prototype.filterOptions = function (event) {
710
- return event;
711
- };
712
- GridEditableNestedComponent.prototype.getSpanProp = function (obj, path, type) {
713
- type = type === null || type === void 0 ? void 0 : type.toLowerCase();
714
- var value = this.utils.getProp(obj, path, type);
715
- if (value === '<span>0</span>' && type === 'decimal') {
716
- return '<span>0,00</span>';
717
- }
718
- if (!obj.tiposDados) {
719
- return value;
720
- }
721
- if ('MONETARIO' === obj.tiposDados[path]) {
722
- return 'R$ ' + value;
723
- }
724
- if ('PERCENTUAL' === obj.tiposDados[path]) {
725
- return value + ' %';
726
- }
727
- return value;
728
- };
729
- GridEditableNestedComponent.prototype.setHotkeys = function () {
730
- var _this = this;
731
- this.hotkeysService.add(new Hotkey('alt+shift+n', function () {
732
- _this.onAdd();
733
- return false;
734
- }, ['INPUT', 'SELECT', 'TEXTAREA']));
735
- };
736
- GridEditableNestedComponent.ctorParameters = function () { return [
737
- { type: ChangeDetectorRef },
738
- { type: TranslateService },
739
- { type: UtilsService },
740
- { type: HotkeysService }
741
- ]; };
742
- GridEditableNestedComponent.ɵprov = ɵɵdefineInjectable({ factory: function GridEditableNestedComponent_Factory() { return new GridEditableNestedComponent(ɵɵinject(ChangeDetectorRef), ɵɵinject(TranslateService), ɵɵinject(UtilsService), ɵɵinject(HotkeysService)); }, token: GridEditableNestedComponent, providedIn: "root" });
743
- __decorate([
744
- Input()
745
- ], GridEditableNestedComponent.prototype, "config", void 0);
746
- __decorate([
747
- Input()
748
- ], GridEditableNestedComponent.prototype, "nestedFunction", void 0);
749
- __decorate([
750
- Output()
751
- ], GridEditableNestedComponent.prototype, "openDetails", void 0);
752
- __decorate([
753
- Output()
754
- ], GridEditableNestedComponent.prototype, "paging", void 0);
755
- __decorate([
756
- Output()
757
- ], GridEditableNestedComponent.prototype, "delete", void 0);
758
- __decorate([
759
- Output()
760
- ], GridEditableNestedComponent.prototype, "save", void 0);
761
- __decorate([
762
- Output()
763
- ], GridEditableNestedComponent.prototype, "add", void 0);
764
- __decorate([
765
- ViewChild("table", { static: false })
766
- ], GridEditableNestedComponent.prototype, "table", void 0);
767
- GridEditableNestedComponent = __decorate([
768
- Injectable({
769
- providedIn: 'root'
770
- }),
771
- Component({
772
- selector: 'tmsx-grid-editable-nested',
773
- template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button id=\"add-button\"\n data-cy=\"add-button\"\n priority=\"primary\" type=\"button\"\n [label]=\"'tmsx_fnd.tmsx_angular_components.add' | translate\"\n tooltip=\"{{'tmsx_fnd.tmsx_angular_components.add' | translate}} (Alt + Shift + N)\"\n [disabled]=\"!addEnabled\"\n (click)=\"onAdd()\">\n </s-button>\n <s-button\n *ngIf=\"!editing\"\n priority=\"primary\"\n iconClass=\"fa fa-edit\"\n label=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_editar' | translate}}\"\n tooltip=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_editar' | translate}}\"\n [disabled]=\"!editEnabled\"\n (click)=\"initAllRowsEdit()\"\n ></s-button>\n <s-button\n *ngIf=\"editing\"\n priority=\"primary\"\n label=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_salvar' | translate}}\"\n iconClass=\"fa fa-check\"\n [disabled]=\"false\"\n (click)=\"onEditSave()\"\n ></s-button>\n <s-button\n *ngIf=\"editing\"\n priority=\"default\"\n label=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_cancelar' | translate}}\"\n iconClass=\"fa fa-times\"\n [disabled]=\"false\"\n (click)=\"onEditCancel()\"\n ></s-button>\n <p-table\n selectionMode=\"single\"\n [(selection)]=\"selected\"\n [value]=\"gridData\"\n [columns]=\"gridColumns\"\n dataKey=\"id\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [paginator]=\"true\"\n [totalRecords]=\"gridTotalRecords\"\n [lazy]=\"lazy\"\n (onLazyLoad)=\"updateGridData($event)\"\n *sLoadingState=\"gridLoading\"\n sortMode=\"multiple\"\n [frozenWidth]=\"frozenWidth\"\n [scrollable]=\"true\"\n [sTableFrozenPosition]=\"frozenPosition\"\n [sTableFrozenValue]=\"gridData\"\n editMode=\"row\"\n #table\n >\n <ng-template pTemplate=\"frozencolgroup\" let-columns>\n <colgroup>\n <col class=\"col50\" />\n <col *ngFor=\"let col of frozenColumns\" class=\"col200\" />\n <col class=\"frozenButton\" />\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"frozenheader\">\n <tr>\n <th pResizableColumn scope=\"col\"></th>\n <th pResizableColumn *ngFor=\"let col of frozenColumns\" scope=\"col\">{{ col.header }}</th>\n <th pResizableColumn scope=\"col\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"frozenbody\" let-rowData let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"col50\" tabindex=\"0\" [sRowToggler]=\"rowData\">\n <i class=\"fa fa-{{ expanded ? 'minus' : 'plus' }} \"></i>\n </td>\n <td *ngFor=\"let col of frozenColumns\" class=\"colText\"\n tooltipPosition=\"top\" showDelay=\"500\"\n [innerHTML]=\"getSpanProp(rowData, col.field)\">\n </td>\n <td class=\"frozenButton\">\n <s-button\n id=\"edit-button\"\n data-cy=\"edit-button\"\n priority=\"default\"\n type=\"button\"\n size=\"small\"\n [auxiliary]=\"true\"\n [disabled]=\"false\"\n [model]=\"getActions(rowData)\">\n </s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-expanded=\"expanded\" let-columns=\"columns\">\n <tr sNavigation tabindex=\"0\" [pEditableRow]=\"rowData\">\n <td\n *ngFor=\"let col of columns\"\n [ngClass]=\"editing? 'editPadding': ''\"\n pResizableColumn\n [pTooltip]=\"rowData[col.field]\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n tabindex=\"0\"\n class=\"col80 colText\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div class=\"ui-fluid\">\n <ng-container [ngSwitch]=\"col.type\">\n <ng-container *ngSwitchCase=\"'Text'\">\n <span>{{ rowData[col.field] }}</span>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Date'\">\n <p-calendar\n [(ngModel)]=\"rowData[col.field]\"\n appendTo=\"body\"\n [showIcon]=\"true\"\n [required]=\"true\"\n pTooltip=\"{{ calendarTooltipText }}\"\n tooltipPosition=\"bottom\"\n [tooltipDisabled]=\"rowData[col.field]\"\n ></p-calendar>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Autocomplete'\">\n <p-autoComplete\n [(ngModel)]=\"rowData[col.field]\"\n [suggestions]=\"col.options\"\n appendTo=\"body\"\n (completeMethod)=\"filterOptions($event)\"\n [dropdown]=\"true\"\n [forceSelection]=\"true\"\n ></p-autoComplete>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Decimal'\">\n <div class=\"ui-inputgroup\">\n <span class=\"ui-inputgroup-addon\"\n *ngIf=\"'MONETARIO' === rowData.tiposDados[col.field]\"\n >R$</span>\n <input sNumberInput [scale]=\"2\"\n alignTo=\"right\"\n thousandsSeparator=\".\"\n pInputText\n [(ngModel)]=\"rowData[col.field]\"\n (keydown)=\"onTab($event)\"\n />\n <span class=\"ui-inputgroup-addon\"\n *ngIf=\"'PERCENTUAL' === rowData.tiposDados[col.field]\"\n >%</span>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <input pInputText type=\"text\"\n [(ngModel)]=\"rowData[col.field]\"\n (keydown)=\"onTab($event)\"\n />\n </ng-container>\n </ng-container>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n <div [innerHTML]=\"getSpanProp(rowData, col.field, col.type)\"></div>\n </ng-template>\n </p-cellEditor>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"rowexpansion\" let-rowData>\n <tr class=\"sds-expanded-row\">\n <td [attr.colspan]=\"gridColumns.length + 1\">\n <p-table\n [value]=\"rowData.nestedGridData\"\n [columns]=\"rowData.nestedGridColumns\"\n dataKey=\"id\"\n rows=\"5\"\n [first]=\"getRowIndex()\"\n [rows]=\"getPageSize()\"\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\n [paginator]=\"true\"\n [totalRecords]=\"rowData.nestedGridTotalRecords\"\n [responsive]=\"true\"\n [lazy]=\"true\"\n (onLazyLoad)=\"updateNestedGridData($event, rowData)\"\n sortMode=\"multiple\"\n *sLoadingState=\"rowData.nestedGridLoading\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" scope=\"col\"\n [pSortableColumn]=\"col.field\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr [pSelectableRow]=\"rowData\">\n <td *ngFor=\"let col of columns\" class=\"colText\">\n {{ formatData(col, rowData[col.field]) }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ rowData.nestedGridTotalRecords }}\n {{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_paging' | translate}}\n </span>\n </ng-template>\n </p-table>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords }}\n {{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_paging' | translate}}\n </span>\n </ng-template>\n </p-table>\n </div>\n</div>\n",
774
- styles: [":host ::ng-deep div.contents{margin-top:15px}input{max-width:100%}.col50{width:50px}.col80{width:80px}.col200{width:200px}.colText{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.frozenButton{width:70px;padding:5px}.editPadding{padding-top:8px;padding-bottom:9px}"]
775
- })
776
- ], GridEditableNestedComponent);
777
- return GridEditableNestedComponent;
778
- }());
779
-
780
- var GridEditableNestedModule = /** @class */ (function () {
781
- function GridEditableNestedModule() {
782
- }
783
- GridEditableNestedModule = __decorate([
784
- NgModule({
785
- imports: [
786
- CommonModule,
787
- LocaleModule.forChild(),
788
- TranslateModule.forChild(),
789
- ButtonModule,
790
- TableModule$1,
791
- TooltipModule,
792
- LoadingStateModule,
793
- NumberInputModule,
794
- BreadcrumbModule,
795
- ControlErrorsModule,
796
- CustomFieldsModule,
797
- DynamicFormModule,
798
- EmptyStateModule,
799
- TokenListModule,
800
- // PrimeNG modules
801
- ToastModule,
802
- TableModule,
803
- TooltipModule$1,
804
- PanelModule,
805
- InputTextModule,
806
- ConfirmDialogModule,
807
- CalendarModule,
808
- DropdownModule,
809
- SharedModule,
810
- AutoCompleteModule,
811
- CheckboxModule,
812
- // Angular modules
813
- FormsModule,
814
- ReactiveFormsModule
815
- ],
816
- declarations: [
817
- GridEditableNestedComponent,
818
- ],
819
- providers: [],
820
- exports: [
821
- GridEditableNestedComponent,
822
- ],
823
- })
824
- ], GridEditableNestedModule);
825
- return GridEditableNestedModule;
826
- }());
827
-
828
- var HostProjectConfigsInjectionToken = new InjectionToken("hostProjectConfigs");
829
- var TmsxAngularComponentsModule = /** @class */ (function () {
830
- function TmsxAngularComponentsModule() {
831
- }
832
- TmsxAngularComponentsModule_1 = TmsxAngularComponentsModule;
833
- TmsxAngularComponentsModule.forRoot = function (config) {
834
- return {
835
- ngModule: TmsxAngularComponentsModule_1,
836
- providers: [
837
- {
838
- provide: HostProjectConfigsInjectionToken,
839
- useValue: config
840
- }
841
- ]
842
- };
843
- };
844
- var TmsxAngularComponentsModule_1;
845
- TmsxAngularComponentsModule = TmsxAngularComponentsModule_1 = __decorate([
846
- NgModule({})
847
- ], TmsxAngularComponentsModule);
848
- return TmsxAngularComponentsModule;
849
- }());
850
-
851
- var fallback = {
852
- "tmsx_fnd.tmsx_angular_components.add": "Adicionar",
853
- "tmsx_fnd.tmsx_angular_components.audit_created_by": "Criado por {{nome}} em {{data}} às {{hora}}.",
854
- "tmsx_fnd.tmsx_angular_components.audit_modified_by": "Modificado por {{nome}} em {{data}} às {{hora}}.",
855
- "tmsx_fnd.tmsx_angular_components.audit_inactivated_by": "Inativado por {{nome}} em {{data}} às {{hora}}.",
856
- "tmsx_fnd.tmsx_angular_components.condicao_valor_lookup_condicional_no_audit": "Sem informações de auditoria",
857
- "tmsx_fnd.tmsx_angular_components.delete": "Excluir",
858
- "tmsx_fnd.tmsx_angular_components.edit": "Editar",
859
- "tmsx_fnd.tmsx_angular_components.error_forbidden_description": "Você não tem permissão para acessar este recurso.",
860
- "tmsx_fnd.tmsx_angular_components.error_forbidden_title": "Acesso Negado",
861
- "tmsx_fnd.tmsx_angular_components.error_not_found_description": "O recurso solicitado não foi encontrado.",
862
- "tmsx_fnd.tmsx_angular_components.error_not_found_title": "Não Encontrado",
863
- "tmsx_fnd.tmsx_angular_components.error_unauthorized_description": "Você não está autorizado a acessar este recurso.",
864
- "tmsx_fnd.tmsx_angular_components.error_unauthorized_title": "Não Autorizado",
865
- "tmsx_fnd.tmsx_angular_components.grid_aninhada": "Grid Aninhada",
866
- "tmsx_fnd.tmsx_angular_components.grid_editable_nested_calendar_required": "É necessário informar a data",
867
- "tmsx_fnd.tmsx_angular_components.grid_editable_nested_cancelar": "Cancelar",
868
- "tmsx_fnd.tmsx_angular_components.grid_editable_nested_editar": "Editar valores",
869
- "tmsx_fnd.tmsx_angular_components.grid_editable_nested_paging": "registros encontrados",
870
- "tmsx_fnd.tmsx_angular_components.grid_editable_nested_salvar": "Salvar alterações",
871
- "tmsx_fnd.tmsx_angular_components.list_grid_boolean_false": "Não",
872
- "tmsx_fnd.tmsx_angular_components.list_grid_boolean_true": "Sim",
873
- "tmsx_fnd.tmsx_angular_components.list_grid_empty_field": "Não informado",
874
- "tmsx_fnd.tmsx_angular_components.painel_processamento": "Painel de Processamento",
875
- "tmsx_fnd.tmsx_angular_components.painel_processamento_api_error": "API de envio não definida",
876
- "tmsx_fnd.tmsx_angular_components.painel_processamento_status_failed": "Ocorreu um erro",
877
- "tmsx_fnd.tmsx_angular_components.painel_processamento_status_pending": "Pendente",
878
- "tmsx_fnd.tmsx_angular_components.painel_processamento_status_processing": "Processando",
879
- "tmsx_fnd.tmsx_angular_components.painel_processamento_status_success": "Finalizado com sucesso",
880
- "tmsx_fnd.tmsx_angular_components.registro": "Registro",
881
- "tmsx_fnd.tmsx_angular_components.showcase_painel_processamento_title": "Demonstração do Painel de Processamento",
882
- "tmsx_fnd.tmsx_angular_components.showcase_table_title": "Demonstração da Tabela",
883
- "tmsx_fnd.tmsx_angular_components.showcase_title": "Showcase",
884
- "tmsx_fnd.tmsx_angular_components.situacao_ativo_false": "Inativo",
885
- "tmsx_fnd.tmsx_angular_components.situacao_ativo_true": "Ativo",
886
- "tmsx_fnd.tmsx_angular_components.status": "Situação",
887
- "tmsx_fnd.tmsx_angular_components.total_records": "{{ value }} registros encontrados"
888
- };
889
-
890
- /**
891
- * Generated bundle index. Do not edit.
892
- */
893
-
894
- export { GridEditableNestedComponent, GridEditableNestedModule, HostProjectConfigsInjectionToken, PainelProcessamentoComponent, PainelProcessamentoModule, TmsxAngularComponentsModule, UtilsService, fallback };
895
- //# sourceMappingURL=seniorsistemas-tmsx-angular-components.js.map