@senior-gestao-pessoas/payroll-core 9.1.0 → 9.2.0-9f30ae11-c2bd-4f8e-8979-920e6996032d

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 (52) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +1355 -0
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +1 -1
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.d.ts +77 -0
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +75 -0
  7. package/components/historical-pix-account/historical-pix-account.module.d.ts +2 -0
  8. package/components/historical-pix-account/historical-pix-account.service.d.ts +8 -0
  9. package/components/historical-pix-account/index.d.ts +3 -0
  10. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +50 -0
  11. package/components/historical-pix-account-list/historical-pix-account-list.module.d.ts +2 -0
  12. package/components/historical-pix-account-list/historical-pix-account-list.service.d.ts +9 -0
  13. package/components/historical-pix-account-list/index.d.ts +3 -0
  14. package/components/utils/format-utils/format-utils.service.d.ts +33 -0
  15. package/components/utils/generic-validators.d.ts +24 -0
  16. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +360 -0
  17. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +327 -0
  18. package/esm2015/components/historical-pix-account/historical-pix-account.module.js +58 -0
  19. package/esm2015/components/historical-pix-account/historical-pix-account.service.js +20 -0
  20. package/esm2015/components/historical-pix-account/index.js +4 -0
  21. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +237 -0
  22. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.module.js +39 -0
  23. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.service.js +35 -0
  24. package/esm2015/components/historical-pix-account-list/index.js +4 -0
  25. package/esm2015/components/utils/format-utils/format-utils.service.js +96 -0
  26. package/esm2015/components/utils/generic-validators.js +164 -0
  27. package/esm2015/public_api.js +3 -1
  28. package/esm2015/senior-gestao-pessoas-payroll-core.js +2 -1
  29. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +385 -0
  30. package/esm5/components/historical-pix-account/historical-pix-account.component.js +361 -0
  31. package/esm5/components/historical-pix-account/historical-pix-account.module.js +61 -0
  32. package/esm5/components/historical-pix-account/historical-pix-account.service.js +22 -0
  33. package/esm5/components/historical-pix-account/index.js +4 -0
  34. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +257 -0
  35. package/esm5/components/historical-pix-account-list/historical-pix-account-list.module.js +42 -0
  36. package/esm5/components/historical-pix-account-list/historical-pix-account-list.service.js +37 -0
  37. package/esm5/components/historical-pix-account-list/index.js +4 -0
  38. package/esm5/components/utils/format-utils/format-utils.service.js +100 -0
  39. package/esm5/components/utils/generic-validators.js +167 -0
  40. package/esm5/public_api.js +3 -1
  41. package/esm5/senior-gestao-pessoas-payroll-core.js +2 -1
  42. package/fesm2015/senior-gestao-pessoas-payroll-core.js +1255 -1
  43. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  44. package/fesm5/senior-gestao-pessoas-payroll-core.js +1349 -1
  45. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  46. package/locale/en-US.json +33 -1
  47. package/locale/es-ES.json +33 -1
  48. package/locale/pt-BR.json +33 -1
  49. package/package.json +1 -1
  50. package/public_api.d.ts +2 -0
  51. package/senior-gestao-pessoas-payroll-core.d.ts +1 -0
  52. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -9156,6 +9156,1354 @@ var FromToModule = /** @class */ (function () {
9156
9156
  return FromToModule;
9157
9157
  }());
9158
9158
 
9159
+ var FormatUtilsService = /** @class */ (function () {
9160
+ function FormatUtilsService() {
9161
+ }
9162
+ /**
9163
+ * Retorna o CPF formatado
9164
+ * @param cpf CPF
9165
+ */
9166
+ FormatUtilsService.getFormattedCpf = function (cpf) {
9167
+ if (cpf) {
9168
+ return cpf
9169
+ .replace(/\D/g, "")
9170
+ .replace(/(\d{3})(\d)/, "$1.$2")
9171
+ .replace(/(\d{3})(\d)/, "$1.$2")
9172
+ .replace(/(\d{3})(\d)/, "$1-$2");
9173
+ }
9174
+ return null;
9175
+ };
9176
+ /**
9177
+ * Retorna o CNPJ formatado
9178
+ * @param cnpj CNPJ
9179
+ */
9180
+ FormatUtilsService.getFormattedCnpj = function (cnpj) {
9181
+ if (cnpj) {
9182
+ return cnpj
9183
+ .replace(/\D/g, "")
9184
+ .replace(/(\d{2})(\d)/, "$1.$2")
9185
+ .replace(/(\d{3})(\d)/, "$1.$2")
9186
+ .replace(/(\d{3})(\d)/, "$1/$2")
9187
+ .replace(/(\d{4})(\d)/, "$1-$2");
9188
+ }
9189
+ return null;
9190
+ };
9191
+ /**
9192
+ * Retorna a mascara do CPF/CNPJ
9193
+ * @param key Valores possíveis são CPF ou CNPJ
9194
+ */
9195
+ FormatUtilsService.getCpfCnpjMask = function (key) {
9196
+ switch (key) {
9197
+ case "CPF":
9198
+ return "999.999.999-99";
9199
+ case "CNPJ":
9200
+ return "99.999.999/9999-99";
9201
+ default:
9202
+ return "";
9203
+ }
9204
+ };
9205
+ /**
9206
+ * Metódo para formatar o número de telefone.
9207
+ * @param telephoneNumber String contendo o número de telefone.
9208
+ * @returns String formatada com o número de telefone.
9209
+ */
9210
+ FormatUtilsService.getFormattedTelephoneNumber = function (telephoneNumber) {
9211
+ var tel = telephoneNumber.replace(/\D/g, '');
9212
+ tel = tel.replace(/^0/, '');
9213
+ if (tel.length > 10) {
9214
+ // ########## -> (##) #####-####
9215
+ tel = tel.replace(/^(\d{2})?(\d{5})?(\d{4}).*/, '($1) $2-$3');
9216
+ }
9217
+ else if (tel.length > 9) {
9218
+ // AA######### -> (AA) ####-####
9219
+ tel = tel.replace(/^(\d{2})?(\d{4})?(\d{4}).*/, '($1) $2-$3');
9220
+ }
9221
+ else if (tel.length > 5) {
9222
+ // ####### -> (##) ####-#
9223
+ tel = tel.replace(/^(\d{2})?(\d{4})?(\d{0,4}).*/, '($1) $2-$3');
9224
+ }
9225
+ else if (tel.length > 1) {
9226
+ // #### -> (##) ##
9227
+ tel = tel.replace(/^(\d{2})?(\d{0,5}).*/, '($1) $2');
9228
+ }
9229
+ else {
9230
+ if (tel !== '') {
9231
+ tel = tel.replace(/^(\d*)/, '($1');
9232
+ }
9233
+ }
9234
+ return tel;
9235
+ };
9236
+ /**
9237
+ * Metódo para formatar o número de telefone de um campo Input.
9238
+ * @param event Evento do Input do campo de telefone.
9239
+ */
9240
+ FormatUtilsService.formatTelephoneInputEvent = function (event) {
9241
+ var telephoneNumber = event.target.value;
9242
+ // Permite Backspace para usuário remover ")" e "-"
9243
+ if (event.keyCode === 8 && (telephoneNumber.length === 9 || telephoneNumber.length === 4 || telephoneNumber.length === 3)) {
9244
+ return;
9245
+ }
9246
+ event.target.value = FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9247
+ };
9248
+ /**
9249
+ * Metódo para formatar a porcentagem para 2 casas decimais.
9250
+ * @param value Número a ser formatado.
9251
+ */
9252
+ FormatUtilsService.getFormattedPercentage = function (value) {
9253
+ return parseFloat(value).toFixed(2).replace('.', ',') + '%';
9254
+ };
9255
+ return FormatUtilsService;
9256
+ }());
9257
+
9258
+ var HistoricalPixAccountComponent = /** @class */ (function () {
9259
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder) {
9260
+ var _this = this;
9261
+ this.translateService = translateService;
9262
+ this.cd = cd;
9263
+ this.formBuilder = formBuilder;
9264
+ this.recordByRow = 1;
9265
+ this.showDateChange = false;
9266
+ this.isEditMode = false;
9267
+ this.isViewMode = false;
9268
+ this.withSideBar = true;
9269
+ this.defaultCpfNumber = null;
9270
+ this.visibleChange = new EventEmitter();
9271
+ this.ngUnsubscribe = new Subject();
9272
+ this.orderBy = {
9273
+ field: "dateChange",
9274
+ direction: DirectionEnumeration.DESC,
9275
+ };
9276
+ this.pixAccountItemInput = {};
9277
+ this.totalRecords = 0;
9278
+ this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9279
+ this.loading = true;
9280
+ this.listData = [];
9281
+ this.listDataNoPage = [];
9282
+ this.cols = [
9283
+ {
9284
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9285
+ field: "pixKeyType",
9286
+ },
9287
+ {
9288
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9289
+ field: "pixKey",
9290
+ },
9291
+ {
9292
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9293
+ field: "percentage",
9294
+ },
9295
+ ];
9296
+ this.actions = function (rowData, key) {
9297
+ if (rowData === void 0) { rowData = {}; }
9298
+ return [
9299
+ {
9300
+ visible: _this.isEditMode,
9301
+ label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9302
+ command: function () {
9303
+ rowData["index"] = key;
9304
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9305
+ _this.visible = true;
9306
+ },
9307
+ },
9308
+ {
9309
+ visible: !!(!_this.isEditMode && _this.withSideBar),
9310
+ label: _this.translateService.instant("hcm.payroll.edit"),
9311
+ command: function () {
9312
+ rowData["index"] = key;
9313
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9314
+ _this.visible = true;
9315
+ },
9316
+ },
9317
+ {
9318
+ visible: !_this.isEditMode,
9319
+ label: _this.translateService.instant("hcm.payroll.delete"),
9320
+ command: function () {
9321
+ _this.loading = true;
9322
+ _this.deleteAnnuityItem(key);
9323
+ },
9324
+ },
9325
+ ];
9326
+ };
9327
+ this.createFormGroup();
9328
+ }
9329
+ HistoricalPixAccountComponent.prototype.ngOnInit = function () {
9330
+ this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9331
+ };
9332
+ HistoricalPixAccountComponent.prototype.createFormGroup = function () {
9333
+ this.historicalPixAccountList = this.formBuilder.group({
9334
+ historicalPixAccountList: this.formBuilder.control(null),
9335
+ });
9336
+ };
9337
+ HistoricalPixAccountComponent.prototype.ngOnDestroy = function () {
9338
+ this.ngUnsubscribe.next();
9339
+ this.ngUnsubscribe.complete();
9340
+ };
9341
+ HistoricalPixAccountComponent.prototype.ngAfterViewInit = function () {
9342
+ this.cd.detectChanges();
9343
+ };
9344
+ HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
9345
+ var _this = this;
9346
+ var first = event && event.first ? event.first : 0;
9347
+ var rows = event && event.rows ? event.rows : this.recordByRow;
9348
+ var arrList = this.getHistoricalPixAccountList();
9349
+ this.listData = [];
9350
+ this.totalRecords = null;
9351
+ if (event && event.multiSortMeta && event.multiSortMeta.length) {
9352
+ event.multiSortMeta.map(function (value) {
9353
+ _this.orderBy.field = value.field;
9354
+ _this.orderBy.direction = value.order === 1 ? DirectionEnumeration.ASC : DirectionEnumeration.DESC;
9355
+ });
9356
+ }
9357
+ if (arrList && arrList.length) {
9358
+ this.totalRecords = arrList.length;
9359
+ this.listData = arrList;
9360
+ this.listDataNoPage = __spread(arrList);
9361
+ this.listData.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9362
+ this.listData = this.listData.slice(first, (first + rows));
9363
+ }
9364
+ else {
9365
+ this.listDataNoPage = [];
9366
+ }
9367
+ if (this.isEditMode || arrList && arrList.length === 1) {
9368
+ this.refreshCssInIE11();
9369
+ }
9370
+ this.loading = false;
9371
+ };
9372
+ /**
9373
+ * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
9374
+ */
9375
+ HistoricalPixAccountComponent.prototype.refreshCssInIE11 = function () {
9376
+ if (/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)) {
9377
+ setTimeout(function () {
9378
+ var row = document.getElementsByClassName("row0");
9379
+ if (row && row[0])
9380
+ row[0].className = 'refresh';
9381
+ }, 1);
9382
+ }
9383
+ };
9384
+ HistoricalPixAccountComponent.prototype.add = function () {
9385
+ this.pixAccountItemInput = {};
9386
+ this.visible = true;
9387
+ };
9388
+ HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9389
+ var newlist = __spread(this.getHistoricalPixAccountList());
9390
+ newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9391
+ delete newlist[index];
9392
+ newlist = newlist.filter(function (val) { return val; });
9393
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(newlist);
9394
+ this.verifyTotalPercentage();
9395
+ this.onLazyLoad();
9396
+ };
9397
+ HistoricalPixAccountComponent.prototype.getHistoricalPixAccountList = function () {
9398
+ if (this.historicalPixAccountList.get("historicalPixAccountList") &&
9399
+ this.historicalPixAccountList.get("historicalPixAccountList").value &&
9400
+ this.historicalPixAccountList.get("historicalPixAccountList").value.length)
9401
+ return this.historicalPixAccountList.get("historicalPixAccountList") && this.historicalPixAccountList.get("historicalPixAccountList").value;
9402
+ else
9403
+ return [];
9404
+ };
9405
+ HistoricalPixAccountComponent.prototype.addItemInList = function ($event) {
9406
+ var index = $event && $event.index >= 0 ? $event.index : null;
9407
+ var newDataList = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9408
+ if (index != null) {
9409
+ newDataList[index] = $event;
9410
+ delete $event.index;
9411
+ }
9412
+ else {
9413
+ if (isValid($event["customFields"]) && Object.keys($event["customFields"]).length) {
9414
+ var customValue = mountCustomToSave($event["customFields"]);
9415
+ $event["customFields"] = __spread(customValue);
9416
+ }
9417
+ $event["dateChange"] = this.dateChange;
9418
+ newDataList.push($event);
9419
+ }
9420
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
9421
+ this.verifyTotalPercentage();
9422
+ this.onLazyLoad({ first: this.getNumberPageByIndex(index, newDataList) });
9423
+ };
9424
+ HistoricalPixAccountComponent.prototype.getNumberPageByIndex = function (index, list) {
9425
+ if (index) {
9426
+ var total = list.length;
9427
+ var sub = this.recordByRow - 1;
9428
+ return Math.ceil(total / this.recordByRow) * this.recordByRow - sub - 1;
9429
+ }
9430
+ return null;
9431
+ };
9432
+ HistoricalPixAccountComponent.prototype.verifyTotalPercentage = function () {
9433
+ var list = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9434
+ var arrayPercentage = [];
9435
+ if (!list.length)
9436
+ return this.msgTotalLimitByPercentage = null;
9437
+ list.filter(function (item) { return arrayPercentage.push(item && item["percentage"]); });
9438
+ var sumPercentage = arrayPercentage.reduce(function (total, percentage) {
9439
+ return total + percentage;
9440
+ }, 0);
9441
+ if (sumPercentage === 100) {
9442
+ this.msgTotalLimitByPercentage = this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage");
9443
+ }
9444
+ else {
9445
+ this.msgTotalLimitByPercentage = null;
9446
+ }
9447
+ };
9448
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
9449
+ get: function () {
9450
+ return this.actions.bind(this);
9451
+ },
9452
+ enumerable: true,
9453
+ configurable: true
9454
+ });
9455
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "recordsMessage", {
9456
+ get: function () {
9457
+ return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
9458
+ },
9459
+ enumerable: true,
9460
+ configurable: true
9461
+ });
9462
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "getTooltipAndDisableButtonAdd", {
9463
+ get: function () {
9464
+ return this.dateChange ? null : this.msgTooltipAdd;
9465
+ },
9466
+ enumerable: true,
9467
+ configurable: true
9468
+ });
9469
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "dateChange", {
9470
+ get: function () {
9471
+ return this._dateChange;
9472
+ },
9473
+ set: function (value) {
9474
+ var _this = this;
9475
+ this._dateChange = value;
9476
+ if (this._dateChange) {
9477
+ this.listData.filter(function (row) { return row["dateChange"] = _this._dateChange; });
9478
+ }
9479
+ },
9480
+ enumerable: true,
9481
+ configurable: true
9482
+ });
9483
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "displayDateChange", {
9484
+ get: function () {
9485
+ return this._displayDateChange;
9486
+ },
9487
+ set: function (value) {
9488
+ var _this = this;
9489
+ this._displayDateChange = value;
9490
+ if (this._displayDateChange) {
9491
+ this.listData.filter(function (row) { return row["displayDateChange"] = _this._displayDateChange; });
9492
+ }
9493
+ },
9494
+ enumerable: true,
9495
+ configurable: true
9496
+ });
9497
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "addListData", {
9498
+ set: function (list) {
9499
+ this.loading = true;
9500
+ this.historicalPixAccountList.get("historicalPixAccountList").patchValue(list);
9501
+ this.verifyTotalPercentage();
9502
+ this.onLazyLoad();
9503
+ },
9504
+ enumerable: true,
9505
+ configurable: true
9506
+ });
9507
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "visible", {
9508
+ get: function () {
9509
+ return this._visible;
9510
+ },
9511
+ set: function (value) {
9512
+ this._visible = value;
9513
+ this.visibleChange.emit(this.visible);
9514
+ },
9515
+ enumerable: true,
9516
+ configurable: true
9517
+ });
9518
+ HistoricalPixAccountComponent.prototype.close = function () {
9519
+ this.visible = false;
9520
+ };
9521
+ HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
9522
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9523
+ };
9524
+ HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
9525
+ return FormatUtilsService.getFormattedCpf(cpf);
9526
+ };
9527
+ HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
9528
+ return FormatUtilsService.getFormattedCnpj(cnpj);
9529
+ };
9530
+ HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9531
+ return FormatUtilsService.getFormattedPercentage(value);
9532
+ };
9533
+ HistoricalPixAccountComponent.ctorParameters = function () { return [
9534
+ { type: TranslateService },
9535
+ { type: ChangeDetectorRef },
9536
+ { type: FormBuilder }
9537
+ ]; };
9538
+ __decorate([
9539
+ ViewChild(CustomFieldsComponent$1, { static: false })
9540
+ ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
9541
+ __decorate([
9542
+ Input()
9543
+ ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
9544
+ __decorate([
9545
+ Input()
9546
+ ], HistoricalPixAccountComponent.prototype, "fieldFormGroup", void 0);
9547
+ __decorate([
9548
+ Input()
9549
+ ], HistoricalPixAccountComponent.prototype, "_dateChange", void 0);
9550
+ __decorate([
9551
+ Input()
9552
+ ], HistoricalPixAccountComponent.prototype, "_displayDateChange", void 0);
9553
+ __decorate([
9554
+ Input()
9555
+ ], HistoricalPixAccountComponent.prototype, "recordByRow", void 0);
9556
+ __decorate([
9557
+ Input()
9558
+ ], HistoricalPixAccountComponent.prototype, "showDateChange", void 0);
9559
+ __decorate([
9560
+ Input()
9561
+ ], HistoricalPixAccountComponent.prototype, "msgTooltipAdd", void 0);
9562
+ __decorate([
9563
+ Input()
9564
+ ], HistoricalPixAccountComponent.prototype, "isEditMode", void 0);
9565
+ __decorate([
9566
+ Input()
9567
+ ], HistoricalPixAccountComponent.prototype, "isViewMode", void 0);
9568
+ __decorate([
9569
+ Input()
9570
+ ], HistoricalPixAccountComponent.prototype, "currency", void 0);
9571
+ __decorate([
9572
+ Input()
9573
+ ], HistoricalPixAccountComponent.prototype, "customEntity", void 0);
9574
+ __decorate([
9575
+ Input()
9576
+ ], HistoricalPixAccountComponent.prototype, "customService", void 0);
9577
+ __decorate([
9578
+ Input()
9579
+ ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
9580
+ __decorate([
9581
+ Input()
9582
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
9583
+ __decorate([
9584
+ Input()
9585
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9586
+ __decorate([
9587
+ Input()
9588
+ ], HistoricalPixAccountComponent.prototype, "dateChange", null);
9589
+ __decorate([
9590
+ Input()
9591
+ ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
9592
+ __decorate([
9593
+ Input()
9594
+ ], HistoricalPixAccountComponent.prototype, "addListData", null);
9595
+ __decorate([
9596
+ Input()
9597
+ ], HistoricalPixAccountComponent.prototype, "visible", null);
9598
+ HistoricalPixAccountComponent = __decorate([
9599
+ Component({
9600
+ // tslint:disable-next-line:component-selector
9601
+ selector: "c-historical-pix-account",
9602
+ template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n",
9603
+ styles: [".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]
9604
+ })
9605
+ ], HistoricalPixAccountComponent);
9606
+ return HistoricalPixAccountComponent;
9607
+ }());
9608
+
9609
+ var GenericValidator = /** @class */ (function () {
9610
+ function GenericValidator() {
9611
+ }
9612
+ /**
9613
+ * Valida o CEI (Cadastro específico de INSS) digitado.
9614
+ */
9615
+ GenericValidator.isValidCei = function (control) {
9616
+ var cei = control.value;
9617
+ if (!cei)
9618
+ return null;
9619
+ else if (cei.length != 11)
9620
+ return null;
9621
+ var multiplicadorBase = "3298765432";
9622
+ var total = 0;
9623
+ var resto = 0;
9624
+ var multiplicando = 0;
9625
+ var multiplicador = 0;
9626
+ if (cei.length !== 11 ||
9627
+ cei === "00000000000" ||
9628
+ cei === "11111111111" ||
9629
+ cei === "22222222222" ||
9630
+ cei === "33333333333" ||
9631
+ cei === "44444444444" ||
9632
+ cei === "55555555555" ||
9633
+ cei === "66666666666" ||
9634
+ cei === "77777777777" ||
9635
+ cei === "88888888888" ||
9636
+ cei === "99999999999")
9637
+ return { invalidCei: true };
9638
+ else {
9639
+ for (var i = 0; i < 10; i++) {
9640
+ multiplicando = parseInt(cei.substring(i, i + 1), 10);
9641
+ multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
9642
+ total += multiplicando * multiplicador;
9643
+ }
9644
+ resto = 11 - (total % 11);
9645
+ resto = resto === 10 || resto === 11 ? 0 : resto;
9646
+ var digito = parseInt("" + cei.charAt(10), 10);
9647
+ return resto === digito ? null : { invalidCei: true };
9648
+ }
9649
+ };
9650
+ /**
9651
+ * Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
9652
+ */
9653
+ GenericValidator.isValidCpf = function (control) {
9654
+ var cpf = control.value;
9655
+ if (cpf) {
9656
+ var numbers = void 0, digits = void 0, sum = void 0, i = void 0, result = void 0, equalDigits = void 0;
9657
+ equalDigits = 1;
9658
+ if (cpf.length < 11) {
9659
+ return null;
9660
+ }
9661
+ for (i = 0; i < cpf.length - 1; i++) {
9662
+ if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
9663
+ equalDigits = 0;
9664
+ break;
9665
+ }
9666
+ }
9667
+ if (!equalDigits) {
9668
+ numbers = cpf.substring(0, 9);
9669
+ digits = cpf.substring(9);
9670
+ sum = 0;
9671
+ for (i = 10; i > 1; i--) {
9672
+ sum += numbers.charAt(10 - i) * i;
9673
+ }
9674
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9675
+ if (result !== Number(digits.charAt(0))) {
9676
+ return { cpfNotValid: true };
9677
+ }
9678
+ numbers = cpf.substring(0, 10);
9679
+ sum = 0;
9680
+ for (i = 11; i > 1; i--) {
9681
+ sum += numbers.charAt(11 - i) * i;
9682
+ }
9683
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9684
+ if (result !== Number(digits.charAt(1))) {
9685
+ return { cpfNotValid: true };
9686
+ }
9687
+ return null;
9688
+ }
9689
+ else {
9690
+ return { cpfNotValid: true };
9691
+ }
9692
+ }
9693
+ return null;
9694
+ };
9695
+ /**
9696
+ * Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
9697
+ */
9698
+ GenericValidator.isValidCnpj = function (control) {
9699
+ var cnpj = control.value;
9700
+ if (cnpj) {
9701
+ var size = void 0, numbers = void 0, digits = void 0, sum = void 0, pos = void 0, result = void 0;
9702
+ cnpj = cnpj.replace(/[^\d]+/g, '');
9703
+ if (cnpj.length !== 14) {
9704
+ return null;
9705
+ }
9706
+ // Elimina CNPJs invalidos conhecidos
9707
+ if (cnpj === '00000000000000' ||
9708
+ cnpj === '11111111111111' ||
9709
+ cnpj === '22222222222222' ||
9710
+ cnpj === '33333333333333' ||
9711
+ cnpj === '44444444444444' ||
9712
+ cnpj === '55555555555555' ||
9713
+ cnpj === '66666666666666' ||
9714
+ cnpj === '77777777777777' ||
9715
+ cnpj === '88888888888888' ||
9716
+ cnpj === '99999999999999') {
9717
+ return { cnpjNotValid: true };
9718
+ }
9719
+ // Valida DVs
9720
+ size = cnpj.length - 2;
9721
+ numbers = cnpj.substring(0, size);
9722
+ digits = cnpj.substring(size);
9723
+ sum = 0;
9724
+ pos = size - 7;
9725
+ for (var i = size; i >= 1; i--) {
9726
+ sum += numbers.charAt(size - i) * pos--;
9727
+ if (pos < 2) {
9728
+ pos = 9;
9729
+ }
9730
+ }
9731
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9732
+ if (result !== Number(digits.charAt(0))) {
9733
+ return { cnpjNotValid: true };
9734
+ }
9735
+ size = size + 1;
9736
+ numbers = cnpj.substring(0, size);
9737
+ sum = 0;
9738
+ pos = size - 7;
9739
+ for (var i = size; i >= 1; i--) {
9740
+ sum += numbers.charAt(size - i) * pos--;
9741
+ if (pos < 2) {
9742
+ pos = 9;
9743
+ }
9744
+ }
9745
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9746
+ if (result !== Number(digits.charAt(1))) {
9747
+ return { cnpjNotValid: true };
9748
+ }
9749
+ return null;
9750
+ }
9751
+ return null;
9752
+ };
9753
+ /**
9754
+ * Válida o número de telefone da chave PIX.
9755
+ */
9756
+ GenericValidator.isValidPhoneNumber = function (control) {
9757
+ var cellPhoneKey = control.value || '';
9758
+ cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9759
+ var regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9760
+ var isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9761
+ return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
9762
+ };
9763
+ /**
9764
+ * Valida o email da chave PIX.
9765
+ */
9766
+ GenericValidator.isValidEmail = function (control) {
9767
+ var emailKey = control.value;
9768
+ var regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9769
+ var isValidEmail = regexValidEmail.test(emailKey);
9770
+ return isValidEmail ? null : { invalidEmail: true };
9771
+ };
9772
+ return GenericValidator;
9773
+ }());
9774
+
9775
+ var HistoricalPixAccountFormComponent = /** @class */ (function () {
9776
+ function HistoricalPixAccountFormComponent(formBuilder, cd) {
9777
+ this.formBuilder = formBuilder;
9778
+ this.cd = cd;
9779
+ this.withSideBar = true;
9780
+ this.isEditMode = false;
9781
+ this.paramsForm = new FormGroup({});
9782
+ this.defaultCpfNumber = null;
9783
+ this.visibleChange = new EventEmitter();
9784
+ this.pixAccountItemToList = new EventEmitter();
9785
+ this.ngUnsubscribe = new Subject();
9786
+ this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
9787
+ this.labelBtnAdd = "hcm.payroll.employees_add";
9788
+ this.maxValuePercentage = 100.00;
9789
+ this.visibleBtnSave = true;
9790
+ this.isView = false;
9791
+ this.isShowPixKeyFieldValidatorMessage = false;
9792
+ this.createFormGroup();
9793
+ this.registerSubjects();
9794
+ }
9795
+ HistoricalPixAccountFormComponent.prototype.ngOnInit = function () {
9796
+ };
9797
+ HistoricalPixAccountFormComponent.prototype.ngAfterViewInit = function () {
9798
+ this.cd.detectChanges();
9799
+ };
9800
+ HistoricalPixAccountFormComponent.prototype.ngOnDestroy = function () {
9801
+ this.ngUnsubscribe.next(true);
9802
+ this.ngUnsubscribe.unsubscribe();
9803
+ };
9804
+ HistoricalPixAccountFormComponent.prototype.registerSubjects = function () {
9805
+ };
9806
+ HistoricalPixAccountFormComponent.prototype.createFormGroup = function () {
9807
+ this.pixAccountFormGroup = this.formBuilder.group({
9808
+ id: this.formBuilder.control(null),
9809
+ index: this.formBuilder.control(null),
9810
+ employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9811
+ dateChange: this.formBuilder.control(null),
9812
+ pixKeyType: this.formBuilder.control(null, Validators.required),
9813
+ pixKey: this.formBuilder.control(null),
9814
+ percentage: this.formBuilder.control(null, Validators.compose(__spread(this.initialValidatorOfPercentage, [
9815
+ Validators.max(this.maxValuePercentage),
9816
+ ]))),
9817
+ customFields: this.formBuilder.control(null),
9818
+ });
9819
+ };
9820
+ HistoricalPixAccountFormComponent.prototype.onChangePixKeyType = function (item) {
9821
+ if (item.key) {
9822
+ this.pixKeyType = item.key;
9823
+ this.isShowPixKeyFieldValidatorMessage = true;
9824
+ this.pixAccountFormGroup.get("pixKey").reset();
9825
+ this.setPixKeyValidators(true);
9826
+ if (item.key === "CPF") {
9827
+ this.setDefaultCpfPixKey();
9828
+ }
9829
+ }
9830
+ };
9831
+ HistoricalPixAccountFormComponent.prototype.onClearPixKeyType = function () {
9832
+ this.isShowPixKeyFieldValidatorMessage = false;
9833
+ this.pixAccountFormGroup.get("pixKey").reset();
9834
+ };
9835
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "visible", {
9836
+ get: function () {
9837
+ return this._visible;
9838
+ },
9839
+ set: function (value) {
9840
+ this._visible = value;
9841
+ this.visibleChange.emit(this.visible);
9842
+ },
9843
+ enumerable: true,
9844
+ configurable: true
9845
+ });
9846
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", {
9847
+ set: function (value) {
9848
+ this.resetForm();
9849
+ this.visibleBtnSave = true;
9850
+ if (value && value.currentItem && Object.keys(value.currentItem).length) {
9851
+ this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(__assign({}, value.currentItem)));
9852
+ this.labelBtnAdd = "hcm.payroll.employees_update";
9853
+ this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
9854
+ if (!this.isView) {
9855
+ this.configEnableFields(value && value["isEditMode"]);
9856
+ }
9857
+ else {
9858
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
9859
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9860
+ this.formatPixKeyTelehponeNumber();
9861
+ }
9862
+ }
9863
+ }
9864
+ else {
9865
+ this.labelBtnAdd = "hcm.payroll.employees_add";
9866
+ }
9867
+ },
9868
+ enumerable: true,
9869
+ configurable: true
9870
+ });
9871
+ HistoricalPixAccountFormComponent.prototype.formatPixKeyTelehponeNumber = function () {
9872
+ if (this.pixKeyType === "TELEPHONE") {
9873
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
9874
+ }
9875
+ };
9876
+ HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
9877
+ var obj = __assign({}, data);
9878
+ obj["customFields"] = mountCustomToShow(obj["customFields"]);
9879
+ return obj;
9880
+ };
9881
+ HistoricalPixAccountFormComponent.prototype.configEnableFields = function (isEditMode) {
9882
+ this.visibleBtnSave = isEditMode;
9883
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
9884
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9885
+ this.setPixKeyValidators(isEditMode);
9886
+ this.formatPixKeyTelehponeNumber();
9887
+ }
9888
+ configEnabledFields(this.pixAccountFormGroup, isEditMode, [
9889
+ "pixKeyType",
9890
+ "pixKey",
9891
+ "percentage",
9892
+ "customFields",
9893
+ ], []);
9894
+ };
9895
+ HistoricalPixAccountFormComponent.prototype.close = function () {
9896
+ this.resetForm();
9897
+ this.visible = false;
9898
+ };
9899
+ HistoricalPixAccountFormComponent.prototype.addItem = function () {
9900
+ this.pixAccountFormGroup.updateValueAndValidity();
9901
+ verifyValidationsForm.call(this.pixAccountFormGroup);
9902
+ if (this.pixAccountFormGroup.valid) {
9903
+ if (this.employeeId) {
9904
+ this.pixAccountFormGroup.get("employee").setValue({
9905
+ tableId: this.employeeId,
9906
+ name: "",
9907
+ });
9908
+ }
9909
+ this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
9910
+ this.visible = false;
9911
+ this.resetForm();
9912
+ }
9913
+ };
9914
+ HistoricalPixAccountFormComponent.prototype.resetForm = function () {
9915
+ this.pixAccountFormGroup.reset();
9916
+ this.labelBtnAdd = "hcm.payroll.employees_add";
9917
+ if (this.customFields && this.customFields.formGroup)
9918
+ this.customFields.formGroup.reset();
9919
+ };
9920
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "percentagePlaceholder", {
9921
+ get: function () {
9922
+ return "0" + (this.currency && this.currency.decimalSeparator) + "00";
9923
+ },
9924
+ enumerable: true,
9925
+ configurable: true
9926
+ });
9927
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "optionsPercentage", {
9928
+ get: function () {
9929
+ return __assign({}, this.getOptions(), { precision: 2 });
9930
+ },
9931
+ enumerable: true,
9932
+ configurable: true
9933
+ });
9934
+ HistoricalPixAccountFormComponent.prototype.getOptions = function () {
9935
+ return {
9936
+ prefix: "",
9937
+ thousands: this.currency.thousandsSeparator,
9938
+ decimal: this.currency.decimalSeparator,
9939
+ };
9940
+ };
9941
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "getListPixAccount", {
9942
+ /**
9943
+ * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
9944
+ * @param pixAccountList
9945
+ */
9946
+ set: function (pixAccountList) {
9947
+ if (pixAccountList) {
9948
+ this.setValidatorsAccordingList(pixAccountList, null, false);
9949
+ }
9950
+ else {
9951
+ this.resetForm();
9952
+ }
9953
+ },
9954
+ enumerable: true,
9955
+ configurable: true
9956
+ });
9957
+ /**
9958
+ * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
9959
+ * a validação dos campos "percentage" e "pixAccount".
9960
+ * Quando tem index significa que está em uma edição, os valores na posição do registro da edição (index) não serão adicionados
9961
+ * no array de comparação dos validators.
9962
+ * @param pixAccountList
9963
+ * @param index
9964
+ */
9965
+ HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
9966
+ if (index === void 0) { index = null; }
9967
+ if (isEditMode === void 0) { isEditMode = true; }
9968
+ this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
9969
+ var percentageIncluded = [];
9970
+ if (this.pixAccountList && this.pixAccountList.length) {
9971
+ this.pixAccountList.filter(function (field, key) {
9972
+ if (field["percentage"] && key != index) {
9973
+ percentageIncluded.push(field["percentage"]);
9974
+ }
9975
+ });
9976
+ }
9977
+ this.beforeSetPixKeyTypeValidator();
9978
+ this.setPixKeyValidators(isEditMode);
9979
+ this.validatePercentageValid(percentageIncluded);
9980
+ };
9981
+ /**
9982
+ * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
9983
+ */
9984
+ HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function (isEditMode) {
9985
+ var genericPixKey = this.pixAccountFormGroup.get("pixKey");
9986
+ if (this.pixKeyType) {
9987
+ switch (this.pixKeyType) {
9988
+ case "TELEPHONE":
9989
+ genericPixKey.setValidators(Validators.compose([
9990
+ Validators.required, GenericValidator.isValidPhoneNumber,
9991
+ ]));
9992
+ break;
9993
+ case "EMAIL":
9994
+ genericPixKey.setValidators(Validators.compose([
9995
+ Validators.required, GenericValidator.isValidEmail,
9996
+ ]));
9997
+ break;
9998
+ case "CPF":
9999
+ genericPixKey.setValidators(Validators.compose([
10000
+ Validators.required, GenericValidator.isValidCpf,
10001
+ ]));
10002
+ break;
10003
+ case "CNPJ":
10004
+ genericPixKey.setValidators(Validators.compose([
10005
+ Validators.required, GenericValidator.isValidCnpj,
10006
+ ]));
10007
+ break;
10008
+ case "RANDOM_KEY":
10009
+ genericPixKey.setValidators(Validators.required);
10010
+ break;
10011
+ default:
10012
+ genericPixKey.setValidators(null);
10013
+ break;
10014
+ }
10015
+ if (isEditMode) {
10016
+ genericPixKey.enable();
10017
+ }
10018
+ genericPixKey.updateValueAndValidity();
10019
+ }
10020
+ };
10021
+ /**
10022
+ * Este método calcula as parcentagens que já foram inseridas, e seta a diferença para chegar em
10023
+ * 100% na validação do campo "percentage" como um novo maxValue;
10024
+ * @param listValue
10025
+ */
10026
+ HistoricalPixAccountFormComponent.prototype.validatePercentageValid = function (listValue) {
10027
+ var percentage = this.pixAccountFormGroup.get("percentage");
10028
+ this.maxValuePercentage = listValue
10029
+ .reduce(function (currentValue, total) { return currentValue - total; }, 100.00);
10030
+ percentage
10031
+ .setValidators(Validators.compose(__spread(this.initialValidatorOfPercentage, [
10032
+ Validators.max(this.maxValuePercentage),
10033
+ ])));
10034
+ percentage.updateValueAndValidity();
10035
+ };
10036
+ Object.defineProperty(HistoricalPixAccountFormComponent.prototype, "isViewMode", {
10037
+ set: function (condition) {
10038
+ this.isView = !!(condition && !this.withSideBar);
10039
+ this.configEnableFields(!this.isView);
10040
+ if (!this.isView)
10041
+ this.resetForm();
10042
+ },
10043
+ enumerable: true,
10044
+ configurable: true
10045
+ });
10046
+ HistoricalPixAccountFormComponent.prototype.phoneMask = function (event) {
10047
+ FormatUtilsService.formatTelephoneInputEvent(event);
10048
+ };
10049
+ HistoricalPixAccountFormComponent.prototype.setDefaultCpfPixKey = function () {
10050
+ if (this.defaultCpfNumber) {
10051
+ this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
10052
+ }
10053
+ else {
10054
+ var sheetDocument = this.paramsForm.get("sheetDocument");
10055
+ if (sheetDocument) {
10056
+ var cpf = sheetDocument.get("cpfNumber").value;
10057
+ if (cpf) {
10058
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
10059
+ }
10060
+ }
10061
+ }
10062
+ };
10063
+ HistoricalPixAccountFormComponent.prototype.beforeSetPixKeyTypeValidator = function () {
10064
+ var pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
10065
+ if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
10066
+ pixKeyType
10067
+ .setValidators(Validators.compose([
10068
+ Validators.required,
10069
+ this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
10070
+ ]));
10071
+ }
10072
+ else {
10073
+ pixKeyType.setValidators(Validators.required);
10074
+ }
10075
+ };
10076
+ HistoricalPixAccountFormComponent.prototype.validateDuplicatePixKeyTypeBankAccount = function (listCompare) {
10077
+ return function (control) {
10078
+ var value = control && control.value;
10079
+ var condition = false;
10080
+ listCompare.filter(function (field) {
10081
+ if (value) {
10082
+ if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
10083
+ return condition = true;
10084
+ }
10085
+ }
10086
+ });
10087
+ if (condition) {
10088
+ return { pixKeyTypeBankAccountDuplicate: true };
10089
+ }
10090
+ else {
10091
+ return null;
10092
+ }
10093
+ };
10094
+ };
10095
+ HistoricalPixAccountFormComponent.ctorParameters = function () { return [
10096
+ { type: FormBuilder },
10097
+ { type: ChangeDetectorRef }
10098
+ ]; };
10099
+ __decorate([
10100
+ ViewChild(CustomFieldsComponent$1, { static: true })
10101
+ ], HistoricalPixAccountFormComponent.prototype, "customFields", void 0);
10102
+ __decorate([
10103
+ Input()
10104
+ ], HistoricalPixAccountFormComponent.prototype, "currency", void 0);
10105
+ __decorate([
10106
+ Input()
10107
+ ], HistoricalPixAccountFormComponent.prototype, "customEntity", void 0);
10108
+ __decorate([
10109
+ Input()
10110
+ ], HistoricalPixAccountFormComponent.prototype, "customService", void 0);
10111
+ __decorate([
10112
+ Input()
10113
+ ], HistoricalPixAccountFormComponent.prototype, "withSideBar", void 0);
10114
+ __decorate([
10115
+ Input()
10116
+ ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
10117
+ __decorate([
10118
+ Input()
10119
+ ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
10120
+ __decorate([
10121
+ Input()
10122
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
10123
+ __decorate([
10124
+ Output()
10125
+ ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
10126
+ __decorate([
10127
+ Output()
10128
+ ], HistoricalPixAccountFormComponent.prototype, "pixAccountItemToList", void 0);
10129
+ __decorate([
10130
+ Input()
10131
+ ], HistoricalPixAccountFormComponent.prototype, "visible", null);
10132
+ __decorate([
10133
+ Input()
10134
+ ], HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", null);
10135
+ __decorate([
10136
+ Input()
10137
+ ], HistoricalPixAccountFormComponent.prototype, "getListPixAccount", null);
10138
+ __decorate([
10139
+ Input()
10140
+ ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
10141
+ HistoricalPixAccountFormComponent = __decorate([
10142
+ Component({
10143
+ selector: "pix-account",
10144
+ template: "<div id=\"main\">\n <form [formGroup]=\"pixAccountFormGroup\" autocomplete=\"off\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <!-- Tipo de chave -->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label>{{'hcm.payroll.employees_addition_pix_key_type'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]=\"true\" server=\"payroll\"\n enumeration=\"PixKeyType\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n name=\"pixKeyType\" [form]=\"pixAccountFormGroup\"\n (onSelect)=\"onChangePixKeyType($event)\"\n (onClear)=\"onClearPixKeyType()\"\n id=\"ta-pixKeyType\"></input-rest-auto-complete-enum>\n <s-control-errors [control]=\"pixAccountFormGroup.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Chave Pix-->\n <div class=\"ui-md-6 ui-sm-12\" [ngClass]=\"{'required': pixKeyType !== 'BANK_ACCOUNT'}\">\n <label>{{'hcm.payroll.employees_addition_pix_key' | translate}}</label>\n <ng-container [ngSwitch]=\"pixKeyType\">\n <input *ngSwitchCase=\"'TELEPHONE'\" only-number\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\" maxlength=\"15\"\n placeholder=\"(__) ____-____\">\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\" [unmask]=\"true\"></p-inputMask>\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\" [unmask]=\"true\"></p-inputMask>\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"{{'hcm.payroll.employees_addition_email'|translate}}\"/>\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\" disabled\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"/>\n <input *ngSwitchDefault\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"/>\n </ng-container>\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\" id=\"er-pix-key\"\n [control]=\"pixAccountFormGroup.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: pixAccountFormGroup.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Percentual-->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label id=\"lb-percentage\"\n for=\"ff-percentage\">{{ 'hcm.payroll.historical_bank_account_label_percentage' | translate }}</label>\n <div class=\"ui-inputgroup\">\n <span class=\"ui-inputgroup-addon\">%</span>\n <input pInputText id=\"ff-percentage\" name=\"percentage\"\n formControlName=\"percentage\"\n currencyMask\n [options]=\"optionsPercentage\"\n [placeholder]=\"percentagePlaceholder\"/>\n </div>\n <s-control-errors [control]=\"pixAccountFormGroup.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </div>\n <div class=\"ui-g-12\">\n <p-fieldset\n legend=\"{{ 'hcm.payroll.custom_fields' | translate }}\"\n [attr.data-hidden]=\"!customFields || !customFields.fields.length\"\n >\n <s-custom-fields\n domain=\"hcm\"\n service=\"{{customService}}\"\n entity=\"{{customEntity}}\"\n formControlName=\"customFields\"\n [invalidErrorLabel]=\"'hcm.payroll.employees_invalid_field' | translate\"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]=\"withSideBar ? 'footer' : 'footer-s-border'\">\n <div class=\"form-group\">\n <s-button id=\"btn-save\" label=\"{{ labelBtnAdd | translate}}\" priority=\"primary\"\n (onClick)=\"addItem()\" *ngIf=\"visibleBtnSave && !this.isView\"></s-button>\n <s-button *ngIf=\"withSideBar\" id=\"btn-close\" label=\"{{'hcm.payroll.cancel'|translate}}\" priority=\"secondary\"\n priority=\"link\" (onClick)=\"close()\"></s-button>\n </div>\n </div>\n</div>\n",
10145
+ styles: [".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]
10146
+ })
10147
+ ], HistoricalPixAccountFormComponent);
10148
+ return HistoricalPixAccountFormComponent;
10149
+ }());
10150
+
10151
+ var HistoricalPixAccountService = /** @class */ (function () {
10152
+ function HistoricalPixAccountService(http) {
10153
+ this.http = http;
10154
+ }
10155
+ HistoricalPixAccountService.prototype.query = function (path, body, service) {
10156
+ if (service === void 0) { service = ServiceType.PAYROLL; }
10157
+ return this.http.query(path, body, service);
10158
+ };
10159
+ HistoricalPixAccountService.ctorParameters = function () { return [
10160
+ { type: HttpClientService }
10161
+ ]; };
10162
+ HistoricalPixAccountService = __decorate([
10163
+ Injectable()
10164
+ ], HistoricalPixAccountService);
10165
+ return HistoricalPixAccountService;
10166
+ }());
10167
+
10168
+ var HistoricalPixAccountModule = /** @class */ (function () {
10169
+ function HistoricalPixAccountModule() {
10170
+ }
10171
+ HistoricalPixAccountModule = __decorate([
10172
+ NgModule({
10173
+ imports: [
10174
+ CommonModule,
10175
+ FormsModule,
10176
+ HttpClientModule,
10177
+ AutoCompleteModule,
10178
+ SharedModule,
10179
+ ReactiveFormsModule,
10180
+ TableModule,
10181
+ ButtonModule,
10182
+ TooltipModule,
10183
+ LoadingStateModule,
10184
+ SidebarModule,
10185
+ InputDateModule,
10186
+ ControlErrorsModule,
10187
+ InputRestAutoCompleteEnumModule,
10188
+ CurrencyMaskModule,
10189
+ InputRestAutoCompleteModule,
10190
+ InputTextModule,
10191
+ CoreDirectives,
10192
+ FieldsetModule,
10193
+ CustomFieldsModule$1,
10194
+ PanelModule,
10195
+ InputMaskModule,
10196
+ ],
10197
+ declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
10198
+ providers: [HistoricalPixAccountService, ConfirmationService],
10199
+ exports: [HistoricalPixAccountComponent],
10200
+ })
10201
+ ], HistoricalPixAccountModule);
10202
+ return HistoricalPixAccountModule;
10203
+ }());
10204
+
10205
+ var HistoricalPixAccountListService = /** @class */ (function () {
10206
+ function HistoricalPixAccountListService(http, httpClient) {
10207
+ this.http = http;
10208
+ this.httpClient = httpClient;
10209
+ }
10210
+ HistoricalPixAccountListService.prototype.remove = function (id, dateWhen, service, dependentId) {
10211
+ if (service === void 0) { service = ServiceType.PAYROLL; }
10212
+ if (service === ServiceType.DEPENDENT) {
10213
+ return this.httpClient
10214
+ .post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete", {
10215
+ dependentId: dependentId,
10216
+ dateWhen: dateWhen,
10217
+ });
10218
+ }
10219
+ else {
10220
+ return this.http.post("actions/historicalEmployeePixDelete", {
10221
+ employeeId: id,
10222
+ dateWhen: dateWhen
10223
+ });
10224
+ }
10225
+ };
10226
+ HistoricalPixAccountListService.ctorParameters = function () { return [
10227
+ { type: HttpClientService },
10228
+ { type: HttpClient }
10229
+ ]; };
10230
+ HistoricalPixAccountListService = __decorate([
10231
+ Injectable()
10232
+ ], HistoricalPixAccountListService);
10233
+ return HistoricalPixAccountListService;
10234
+ }());
10235
+
10236
+ var moment$e = moment_;
10237
+ var HistoricalPixAccountListComponent = /** @class */ (function () {
10238
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10239
+ this.confirmationService = confirmationService;
10240
+ this.translateService = translateService;
10241
+ this.activatedRoute = activatedRoute;
10242
+ this.cd = cd;
10243
+ this.router = router;
10244
+ this.messageService = messageService;
10245
+ this.historicalPixAccountListService = historicalPixAccountListService;
10246
+ this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10247
+ this.keyPayload = "historicalEmployeePix";
10248
+ this.withSidebar = true;
10249
+ this.enableView = new EventEmitter();
10250
+ this.ngUnsubscribe = new Subject();
10251
+ this.loading = true;
10252
+ this.columns = [
10253
+ {
10254
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
10255
+ field: "dateChange",
10256
+ },
10257
+ {
10258
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
10259
+ field: "pixKeyType.value",
10260
+ },
10261
+ {
10262
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
10263
+ field: "pixKey",
10264
+ },
10265
+ {
10266
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10267
+ field: "percentage",
10268
+ },
10269
+ {
10270
+ label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
10271
+ field: "numberOfPixAccount",
10272
+ },
10273
+ ];
10274
+ }
10275
+ HistoricalPixAccountListComponent.prototype.ngOnInit = function () {
10276
+ this.initParameters = { employeeId: this.employeeId, dependentId: this.dependentId };
10277
+ };
10278
+ HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10279
+ this.ngUnsubscribe.next();
10280
+ this.ngUnsubscribe.complete();
10281
+ };
10282
+ HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10283
+ this.cd.detectChanges();
10284
+ };
10285
+ HistoricalPixAccountListComponent.prototype.onLazyLoad = function (payload) {
10286
+ var _this = this;
10287
+ payload.forEach(function (value) {
10288
+ value.dateChange = moment$e(value.dateChange).format(_this.dateFormat);
10289
+ value.pixKey = _this.formatPixKeyByType(value.pixKeyType, value.pixKey);
10290
+ value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
10291
+ });
10292
+ this.onGridLoad(payload);
10293
+ this.loading = false;
10294
+ };
10295
+ HistoricalPixAccountListComponent.prototype.formatPixKeyByType = function (pixKeyType, pixKey) {
10296
+ var keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
10297
+ if (keyType === "TELEPHONE") {
10298
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10299
+ }
10300
+ else if (keyType === "CPF") {
10301
+ return FormatUtilsService.getFormattedCpf(pixKey);
10302
+ }
10303
+ else if (keyType === "CNPJ") {
10304
+ return FormatUtilsService.getFormattedCnpj(pixKey);
10305
+ }
10306
+ else {
10307
+ return pixKey;
10308
+ }
10309
+ };
10310
+ HistoricalPixAccountListComponent.prototype.getMenuActions = function (rowData) {
10311
+ var _this = this;
10312
+ return [
10313
+ {
10314
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10315
+ command: function () {
10316
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10317
+ if (_this.withSidebar)
10318
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10319
+ relativeTo: _this.activatedRoute,
10320
+ });
10321
+ else
10322
+ _this.enableView.emit(dateChange);
10323
+ },
10324
+ },
10325
+ {
10326
+ label: this.translateService.instant("hcm.payroll.delete"),
10327
+ command: function () {
10328
+ if (_this.isAllowToDeleteHistorical && rowData) {
10329
+ _this.delete(rowData.id, rowData.dateChange);
10330
+ }
10331
+ else {
10332
+ _this.messageService.add({
10333
+ severity: "error",
10334
+ summary: _this.translateService.instant("hcm.payroll.error"),
10335
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10336
+ });
10337
+ }
10338
+ },
10339
+ },
10340
+ ];
10341
+ };
10342
+ HistoricalPixAccountListComponent.prototype.delete = function (id, dateChange) {
10343
+ var _this = this;
10344
+ if (id === this.lastRecord.id) {
10345
+ var dateChangeToDto_1 = moment$e(dateChange, this.dateFormat).format("YYYY-MM-DD");
10346
+ this.confirmationService.confirm({
10347
+ message: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete") + "?",
10348
+ accept: function () {
10349
+ _this.loading = true;
10350
+ var service = _this.withSidebar ? ServiceType.PAYROLL : ServiceType.DEPENDENT;
10351
+ _this.historicalPixAccountListService
10352
+ .remove(_this.employeeId, dateChangeToDto_1, service, _this.dependentId)
10353
+ .pipe(takeUntil(_this.ngUnsubscribe))
10354
+ .subscribe(function () {
10355
+ _this.messageService.add({
10356
+ severity: "success",
10357
+ summary: _this.translateService.instant("hcm.payroll.success"),
10358
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove"),
10359
+ });
10360
+ _this.parameters = (_this.parameters && __assign({}, _this.parameters)) || {};
10361
+ }, function () {
10362
+ _this.messageService.add({
10363
+ severity: "error",
10364
+ summary: _this.translateService.instant("hcm.payroll.error"),
10365
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove"),
10366
+ });
10367
+ _this.loading = false;
10368
+ });
10369
+ },
10370
+ });
10371
+ }
10372
+ else {
10373
+ this.messageService.add({
10374
+ severity: "error",
10375
+ summary: this.translateService.instant("hcm.payroll.error"),
10376
+ detail: this.translateService.instant("hcm.payroll.not_allowed_delete_last"),
10377
+ });
10378
+ }
10379
+ };
10380
+ HistoricalPixAccountListComponent.prototype.add = function () {
10381
+ if (this.isAllowToAddHistorical) {
10382
+ this.router.navigate(["historical-pix-account-new"], {
10383
+ relativeTo: this.activatedRoute,
10384
+ });
10385
+ }
10386
+ else {
10387
+ this.messageService.add({
10388
+ severity: "error",
10389
+ summary: this.translateService.instant("hcm.payroll.error"),
10390
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10391
+ });
10392
+ }
10393
+ };
10394
+ HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10395
+ if (payload && payload.length) {
10396
+ this.lastRecord = payload[0];
10397
+ }
10398
+ };
10399
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10400
+ get: function () {
10401
+ return (this.permission["incluir"]);
10402
+ },
10403
+ enumerable: true,
10404
+ configurable: true
10405
+ });
10406
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10407
+ get: function () {
10408
+ return (this.permission["excluir"]);
10409
+ },
10410
+ enumerable: true,
10411
+ configurable: true
10412
+ });
10413
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10414
+ get: function () {
10415
+ return this.getMenuActions.bind(this);
10416
+ },
10417
+ enumerable: true,
10418
+ configurable: true
10419
+ });
10420
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "reloadList", {
10421
+ set: function (condition) {
10422
+ if (condition) {
10423
+ this.loading = true;
10424
+ this.parameters = (this.parameters && __assign({}, this.parameters)) || {};
10425
+ }
10426
+ },
10427
+ enumerable: true,
10428
+ configurable: true
10429
+ });
10430
+ HistoricalPixAccountListComponent.ctorParameters = function () { return [
10431
+ { type: ConfirmationService },
10432
+ { type: TranslateService },
10433
+ { type: ActivatedRoute },
10434
+ { type: ChangeDetectorRef },
10435
+ { type: Router },
10436
+ { type: MessageService },
10437
+ { type: HistoricalPixAccountListService }
10438
+ ]; };
10439
+ __decorate([
10440
+ ViewChild(CustomFieldsComponent$1, { static: false })
10441
+ ], HistoricalPixAccountListComponent.prototype, "customFields", void 0);
10442
+ __decorate([
10443
+ Input()
10444
+ ], HistoricalPixAccountListComponent.prototype, "permission", void 0);
10445
+ __decorate([
10446
+ Input()
10447
+ ], HistoricalPixAccountListComponent.prototype, "employeeId", void 0);
10448
+ __decorate([
10449
+ Input()
10450
+ ], HistoricalPixAccountListComponent.prototype, "dependentId", void 0);
10451
+ __decorate([
10452
+ Input()
10453
+ ], HistoricalPixAccountListComponent.prototype, "dateFormat", void 0);
10454
+ __decorate([
10455
+ Input()
10456
+ ], HistoricalPixAccountListComponent.prototype, "endPoint", void 0);
10457
+ __decorate([
10458
+ Input()
10459
+ ], HistoricalPixAccountListComponent.prototype, "keyPayload", void 0);
10460
+ __decorate([
10461
+ Input()
10462
+ ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10463
+ __decorate([
10464
+ Output()
10465
+ ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
10466
+ __decorate([
10467
+ Input()
10468
+ ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
10469
+ HistoricalPixAccountListComponent = __decorate([
10470
+ Component({
10471
+ // tslint:disable-next-line:component-selector
10472
+ selector: "c-historical-pix-account-list",
10473
+ template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <c-data-list-rest\n id=\"ta-historical-pix-account-list\"\n [columns]=\"columns\"\n actionLabel=\"{{ 'hcm.payroll.movimentation_generic_action' | translate }}\"\n emptyMessage=\"{{ 'hcm.payroll.admission_empty_message' | translate }}\"\n [endpoint]=\"endPoint\"\n singularMessageRecords=\"{{\n 'hcm.payroll.admission_register' | translate\n }}\"\n [actions]=\"scopedActions\"\n pluralMessageRecords=\"{{\n 'hcm.payroll.admission_registers' | translate\n }}\"\n [keyPayload]=\"keyPayload\"\n [lazy]=\"true\"\n (lazyLoad)=\"onLazyLoad($event)\"\n [(loading)]=\"loading\"\n [initParameters]=\"initParameters\"\n [parameters]=\"parameters\"\n [isSortable]=\"false\"\n ></c-data-list-rest>\n </div>\n</div>\n\n",
10474
+ styles: [""]
10475
+ })
10476
+ ], HistoricalPixAccountListComponent);
10477
+ return HistoricalPixAccountListComponent;
10478
+ }());
10479
+
10480
+ var HistoricalPixAccountListModule = /** @class */ (function () {
10481
+ function HistoricalPixAccountListModule() {
10482
+ }
10483
+ HistoricalPixAccountListModule = __decorate([
10484
+ NgModule({
10485
+ imports: [
10486
+ CommonModule,
10487
+ FormsModule,
10488
+ HttpClientModule,
10489
+ AutoCompleteModule,
10490
+ SharedModule,
10491
+ ReactiveFormsModule,
10492
+ TableModule,
10493
+ ButtonModule,
10494
+ TooltipModule,
10495
+ LoadingStateModule,
10496
+ DataListRestModule,
10497
+ ConfirmDialogModule,
10498
+ ],
10499
+ declarations: [HistoricalPixAccountListComponent],
10500
+ providers: [HistoricalPixAccountListService],
10501
+ exports: [HistoricalPixAccountListComponent],
10502
+ })
10503
+ ], HistoricalPixAccountListModule);
10504
+ return HistoricalPixAccountListModule;
10505
+ }());
10506
+
9159
10507
  /*
9160
10508
  * Public API Surface of core
9161
10509
  */
@@ -9164,5 +10512,5 @@ var FromToModule = /** @class */ (function () {
9164
10512
  * Generated bundle index. Do not edit.
9165
10513
  */
9166
10514
 
9167
- export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq };
10515
+ export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountListComponent, HistoricalPixAccountListModule, HistoricalPixAccountListService, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq, HistoricalPixAccountFormComponent as ɵr };
9168
10516
  //# sourceMappingURL=senior-gestao-pessoas-payroll-core.js.map